java: convert fields to local variables where possible

found by PMD

Change-Id: I05b45382b8fb1b734657ce9421a20e6ef6fbe542
Reviewed-on: https://gerrit.libreoffice.org/12376
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
This commit is contained in:
Noel Grandin 2014-11-12 09:55:57 +02:00 committed by Noel Grandin
parent 84f7f412bf
commit bb437029c1
71 changed files with 226 additions and 387 deletions

View File

@ -57,8 +57,9 @@ public final class JNI_proxy implements java.lang.reflect.InvocationHandler
private long m_bridge_handle;
private IEnvironment m_java_env;
private long m_receiver_handle;
private long m_td_handle;
/** these 2 fields are accessed directly from C++ */
private long m_receiver_handle; // on the C++ side, this is a "UNO_Interface *"
private long m_td_handle; // on the C++ side, this is a "typelib_TypeDescription *"
private Type m_type;
private String m_oid;
private Class m_class;

View File

@ -27,14 +27,9 @@ package com.sun.star.sdbcx.comp.hsqldb;
public class StorageNativeOutputStream {
static { NativeLibraries.load(); }
private String name;
private Object key;
/** Creates a new instance of StorageNativeOutputStream */
public StorageNativeOutputStream(String _name,Object _key) {
name = _name;
key = _key;
openStream(name, (String)key, NativeStorageAccess.WRITE | NativeStorageAccess.TRUNCATE);
public StorageNativeOutputStream(String _name, Object key) {
openStream(_name, (String)key, NativeStorageAccess.WRITE | NativeStorageAccess.TRUNCATE);
}
private native void openStream(String name,String key, int mode);

View File

@ -42,19 +42,18 @@ public class RowSet implements XRowSet, XRow
{
private XRowSet m_rowSet;
private XRow m_row;
private XPropertySet m_rowSetProps;
public RowSet( XMultiServiceFactory _orb, String _dataSource, int _commandType, String _command )
{
try
{
m_rowSetProps = UnoRuntime.queryInterface( XPropertySet.class, _orb.createInstance( "com.sun.star.sdb.RowSet" ) );
m_rowSetProps.setPropertyValue( "DataSourceName", _dataSource );
m_rowSetProps.setPropertyValue( "CommandType", Integer.valueOf( _commandType ) );
m_rowSetProps.setPropertyValue( "Command", _command );
XPropertySet rowSetProps = UnoRuntime.queryInterface( XPropertySet.class, _orb.createInstance( "com.sun.star.sdb.RowSet" ) );
rowSetProps.setPropertyValue( "DataSourceName", _dataSource );
rowSetProps.setPropertyValue( "CommandType", Integer.valueOf( _commandType ) );
rowSetProps.setPropertyValue( "Command", _command );
m_rowSet = UnoRuntime.queryInterface( XRowSet.class, m_rowSetProps );
m_row = UnoRuntime.queryInterface( XRow.class, m_rowSetProps );
m_rowSet = UnoRuntime.queryInterface( XRowSet.class, rowSetProps );
m_row = UnoRuntime.queryInterface( XRow.class, rowSetProps );
}
catch ( Exception e )
{

View File

@ -25,22 +25,19 @@ import com.sun.star.inspection.*;
public class MethodHandler implements XPropertyHandler
{
private XComponentContext m_context;
private XIntrospection m_introspection;
private XIntrospectionAccess m_introspectionAccess;
private XIdlMethod[] m_methods;
private java.util.HashMap<String,XIdlMethod> m_methodsHash;
/** Creates a new instance of MethodHandler */
public MethodHandler( XComponentContext _context )
{
m_context = _context;
m_methodsHash = new java.util.HashMap<String,XIdlMethod>();
try
{
m_introspection = UnoRuntime.queryInterface( XIntrospection.class,
m_context.getServiceManager().createInstanceWithContext( "com.sun.star.beans.Introspection", m_context )
_context.getServiceManager().createInstanceWithContext( "com.sun.star.beans.Introspection", _context )
);
}
catch( com.sun.star.uno.Exception e )
@ -162,15 +159,14 @@ public class MethodHandler implements XPropertyHandler
if ( m_introspection == null )
return;
m_introspectionAccess = null;
m_methods = null;
m_methodsHash = new java.util.HashMap<String,XIdlMethod>();
m_introspectionAccess = m_introspection.inspect( _component );
if ( m_introspectionAccess == null )
XIntrospectionAccess introspectionAccess = m_introspection.inspect( _component );
if ( introspectionAccess == null )
return;
m_methods = m_introspectionAccess.getMethods( MethodConcept.ALL );
m_methods = introspectionAccess.getMethods( MethodConcept.ALL );
}
public boolean isComposable(String _propertyName) throws com.sun.star.beans.UnknownPropertyException

View File

@ -43,8 +43,6 @@ public class CellBinding extends complexlib.ComplexTestCase
private SpreadsheetDocument m_document;
/** our form layer */
private FormLayer m_formLayer;
/** our service factory */
private XMultiServiceFactory m_orb;
@Override
public String[] getTestMethodNames()
@ -89,8 +87,9 @@ public class CellBinding extends complexlib.ComplexTestCase
/* ------------------------------------------------------------------ */
public void before() throws com.sun.star.uno.Exception, java.lang.Exception
{
m_orb = param.getMSF();
m_document = new SpreadsheetDocument( m_orb );
/* our service factory */
XMultiServiceFactory orb = param.getMSF();
m_document = new SpreadsheetDocument( orb );
m_formLayer = new FormLayer( m_document );
}

View File

@ -54,7 +54,6 @@ public class FormControlTest extends complexlib.ComplexTestCase implements XSQLE
private DocumentHelper m_document;
private FormLayer m_formLayer;
private XPropertySet m_masterForm;
private XFormController m_masterFormController;
private String m_sImageURL;
private SQLErrorEvent m_mostRecentErrorEvent;
@ -548,9 +547,9 @@ public class FormControlTest extends complexlib.ComplexTestCase implements XSQLE
// switch the forms into data entry mode
m_document.getCurrentView( ).toggleFormDesignMode( );
m_masterFormController = m_document.getCurrentView().getFormController( m_masterForm );
XFormController masterFormController = m_document.getCurrentView().getFormController( m_masterForm );
XSQLErrorBroadcaster errorBroadcaster = UnoRuntime.queryInterface( XSQLErrorBroadcaster.class,
m_masterFormController );
masterFormController );
errorBroadcaster.addSQLErrorListener( this );
// set the focus to the ID control

View File

@ -38,7 +38,6 @@ import org.openoffice.xforms.XMLDocument;
public class XMLFormSettings extends complexlib.ComplexTestCase
{
private XMultiServiceFactory m_orb;
private XMLDocument m_document;
private Model m_defaultModel;
private FormLayer m_formLayer;
@ -66,8 +65,8 @@ public class XMLFormSettings extends complexlib.ComplexTestCase
public void before() throws java.lang.Exception
{
// create the document and assign related members
m_orb = param.getMSF();
m_document = new XMLDocument( m_orb );
XMultiServiceFactory orb = param.getMSF();
m_document = new XMLDocument( orb );
m_formLayer = new FormLayer( m_document );
// create a simple structure in the DOM tree: an element with two attributes

View File

@ -32,7 +32,6 @@ import integration.forms.DocumentType;
public class XMLDocument extends integration.forms.DocumentHelper
{
private XFormsSupplier m_formsSupplier;
private XNameContainer m_forms;
/* ------------------------------------------------------------------ */
@ -52,13 +51,13 @@ public class XMLDocument extends integration.forms.DocumentHelper
/* ------------------------------------------------------------------ */
private void impl_initialize( XComponent _document )
{
m_formsSupplier = UnoRuntime.queryInterface( XFormsSupplier.class,
XFormsSupplier formsSupplier = UnoRuntime.queryInterface( XFormsSupplier.class,
_document );
if ( m_formsSupplier == null )
if ( formsSupplier == null )
throw new IllegalArgumentException();
m_forms = m_formsSupplier.getXForms();
m_forms = formsSupplier.getXForms();
}
/* ------------------------------------------------------------------ */

View File

@ -148,7 +148,6 @@ public class Protocol extends JComponent
private long m_nWarnings ;
private long m_nTestMarks;
private Timestamp m_aStartTime;
private Timestamp m_aEndTime ;
/**
@ -631,8 +630,8 @@ public class Protocol extends JComponent
*/
public synchronized void logStatistics()
{
m_aEndTime = new Timestamp(System.currentTimeMillis());
Timestamp aDiff = new Timestamp(m_aEndTime.getTime()-m_aStartTime.getTime());
Timestamp aEndTime = new Timestamp(System.currentTimeMillis());
Timestamp aDiff = new Timestamp(aEndTime.getTime()-m_aStartTime.getTime());
int nLogType = TYPE_STATISTIC;
if (m_nErrors > 0)

View File

@ -87,12 +87,6 @@ public class CheckXComponentLoader
// member
/** points to the global uno service manager. */
private XMultiServiceFactory m_xMSF = null;
/** provides XComponentLoader interface. */
private XFrame m_xDesktop = null;
/** provides XComponentLoader interface too. */
private XFrame m_xFrame = null;
@ -123,12 +117,13 @@ public class CheckXComponentLoader
@Before public void before()
{
// get uno service manager from global test environment
m_xMSF = getMSF();
/* points to the global uno service manager. */
XMultiServiceFactory xMSF = getMSF();
// create stream provider
try
{
m_xStreamProvider = UnoRuntime.queryInterface(XSimpleFileAccess.class, m_xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess"));
m_xStreamProvider = UnoRuntime.queryInterface(XSimpleFileAccess.class, xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess"));
}
catch(java.lang.Throwable ex)
{
@ -136,9 +131,11 @@ public class CheckXComponentLoader
}
// create desktop instance
/* provides XComponentLoader interface. */
XFrame xDesktop = null;
try
{
m_xDesktop = UnoRuntime.queryInterface(XFrame.class, m_xMSF.createInstance("com.sun.star.frame.Desktop"));
xDesktop = UnoRuntime.queryInterface(XFrame.class, xMSF.createInstance("com.sun.star.frame.Desktop"));
}
catch(java.lang.Throwable ex)
{
@ -146,13 +143,13 @@ public class CheckXComponentLoader
}
// create frame instance
m_xFrame = m_xDesktop.findFrame("testFrame_componentLoader",
m_xFrame = xDesktop.findFrame("testFrame_componentLoader",
FrameSearchFlag.TASKS | FrameSearchFlag.CREATE);
assertNotNull("Couldn't create test frame.", m_xFrame);
// define default loader for testing
// TODO think about using of bot loader instances!
m_xLoader = UnoRuntime.queryInterface(XComponentLoader.class, m_xDesktop);
m_xLoader = UnoRuntime.queryInterface(XComponentLoader.class, xDesktop);
assertNotNull("Desktop service doesn't support needed component loader interface.", m_xLoader);
// get temp path for this environment

View File

@ -33,21 +33,24 @@ public class StreamSimulator implements com.sun.star.io.XInputStream ,
{
/**
* @member m_sFileName name of the corrsponding file on disk
* @member m_xInStream the internal input stream for reading
* @member m_xOutStream the internal input stream for writing
* @member m_xSeek points at runtime to m_xInStream or m_xOutStream and make it seekable
*
* @member m_bInWasUsed indicates, that the input stream interface was used
* @member m_bOutWasUsed indicates, that the output stream interface was used
* the internal input stream for reading
*/
private String m_sFileName ;
private com.sun.star.io.XInputStream m_xInStream ;
/**
* the internal input stream for writing
*/
private com.sun.star.io.XOutputStream m_xOutStream ;
/**
* points at runtime to m_xInStream or m_xOutStream and make it seekable
*/
private com.sun.star.io.XSeekable m_xSeek ;
/**
* indicates, that the input stream interface was used
*/
public boolean m_bInWasUsed ;
/**
* indicates, that the output stream interface was used
*/
public boolean m_bOutWasUsed ;
/**
@ -77,7 +80,6 @@ public class StreamSimulator implements com.sun.star.io.XInputStream ,
String sFileName, boolean bInput)
throws com.sun.star.io.NotConnectedException
{
m_sFileName = sFileName ;
m_bInWasUsed = false ;
m_bOutWasUsed = false ;
@ -92,14 +94,14 @@ public class StreamSimulator implements com.sun.star.io.XInputStream ,
if (bInput)
{
m_xInStream = xHelper.openFileRead(m_sFileName);
m_xInStream = xHelper.openFileRead(sFileName);
m_xSeek = UnoRuntime.queryInterface(
com.sun.star.io.XSeekable.class,
m_xInStream);
}
else
{
m_xOutStream = xHelper.openFileWrite(m_sFileName);
m_xOutStream = xHelper.openFileWrite(sFileName);
m_xSeek = UnoRuntime.queryInterface(
com.sun.star.io.XSeekable.class,
m_xOutStream);

View File

@ -51,8 +51,6 @@ public class DEPSAgent implements ILibEngine {
//temp variable
private AbsGTBehavior selectGTBehavior;
//The referred library
private Library socialLib;
//the own memory: store the point that generated in old learning cycle
private BasicPoint pold_t;
//the own memory: store the point that generated in last learning cycle
@ -66,9 +64,8 @@ public class DEPSAgent implements ILibEngine {
public double switchP = 0.5;
public void setLibrary(Library lib) {
socialLib = lib;
deGTBehavior.setLibrary(socialLib);
psGTBehavior.setLibrary(socialLib);
deGTBehavior.setLibrary(lib);
psGTBehavior.setLibrary(lib);
}
public void setProblemEncoder(ProblemEncoder encoder) {

View File

@ -82,9 +82,9 @@ public abstract class BaseNLPSolver extends WeakBase
m_xContext = xContext;
m_name = name;
m_componentFactory = xContext.getServiceManager();
XMultiComponentFactory componentFactory = xContext.getServiceManager();
try {
Object toolkit = m_componentFactory.createInstanceWithContext("com.sun.star.awt.Toolkit", xContext);
Object toolkit = componentFactory.createInstanceWithContext("com.sun.star.awt.Toolkit", xContext);
m_xReschedule = UnoRuntime.queryInterface(XReschedule.class, toolkit);
} catch (Exception ex) {
Logger.getLogger(BaseNLPSolver.class.getName()).log(Level.SEVERE, null, ex);
@ -115,7 +115,6 @@ public abstract class BaseNLPSolver extends WeakBase
// com.sun.star.sheet.XSolver:
private XSpreadsheetDocument m_document;
private XMultiComponentFactory m_componentFactory;
private XModel m_xModel;
protected XReschedule m_xReschedule;
private CellAddress m_objective;
@ -129,7 +128,6 @@ public abstract class BaseNLPSolver extends WeakBase
protected int m_cellRangeCount;
protected XCell m_objectiveCell;
protected XCell[] m_variableCells;
private CellRangeAddress[] m_cellRanges;
protected XChartDataArray[] m_cellRangeData;
protected CellMap[] m_variableMap;
protected double[][][] m_variableData;
@ -280,21 +278,19 @@ public abstract class BaseNLPSolver extends WeakBase
}
m_cellRangeCount = cellRangeAddresses.size();
m_cellRanges = new CellRangeAddress[m_cellRangeCount];
m_cellRanges = cellRangeAddresses.toArray(m_cellRanges);
m_cellRangeData = new XChartDataArray[m_cellRangeCount];
int varID = 0;
//get cell range data and map the variables to their new location
for (int i = 0; i < m_cellRangeCount; i++) {
for (int y = 0; y <= m_cellRanges[i].EndRow - m_cellRanges[i].StartRow; y++)
for (int x = 0; x <= m_cellRanges[i].EndColumn - m_cellRanges[i].StartColumn; x++) {
for (int y = 0; y <= cellRangeAddresses.get(i).EndRow - cellRangeAddresses.get(i).StartRow; y++)
for (int x = 0; x <= cellRangeAddresses.get(i).EndColumn - cellRangeAddresses.get(i).StartColumn; x++) {
CellMap map = new CellMap();
m_variableMap[varID++] = map;
map.Range = i;
map.Col = x;
map.Row = y;
}
m_cellRangeData[i] = getChartDataArray(m_cellRanges[i]);
m_cellRangeData[i] = getChartDataArray(cellRangeAddresses.get(i));
m_variableData[i] = m_cellRangeData[i].getData();
}
}

View File

@ -100,9 +100,6 @@ public final class DEPSSolverImpl extends BaseEvolutionarySolver
return m_serviceNames;
}
// com.sun.star.sheet.XSolver:
private DEPSAgent[] m_agents;
private PropertyInfo<Double> m_agentSwitchRate = new PropertyInfo<Double>("AgentSwitchRate", 0.5, "Agent Switch Rate (DE Probability)");
// --DE
private PropertyInfo<Double> m_factor = new PropertyInfo<Double>("DEFactor", 0.5, "DE: Scaling Factor (0-1.2)");
@ -122,11 +119,11 @@ public final class DEPSSolverImpl extends BaseEvolutionarySolver
initializeSolve();
//Init:
m_agents = new DEPSAgent[m_swarmSize.getValue()];
DEPSAgent[] agents = new DEPSAgent[m_swarmSize.getValue()];
for (int i = 0; i < m_swarmSize.getValue(); i++) {
m_agents[i] = new DEPSAgent();
m_agents[i].setProblemEncoder(m_problemEncoder);
m_agents[i].setPbest(m_library.getSelectedPoint(i));
agents[i] = new DEPSAgent();
agents[i].setProblemEncoder(m_problemEncoder);
agents[i].setPbest(m_library.getSelectedPoint(i));
DEGTBehavior deGTBehavior = new DEGTBehavior();
deGTBehavior.FACTOR = m_factor.getValue();
@ -138,12 +135,12 @@ public final class DEPSSolverImpl extends BaseEvolutionarySolver
psGTBehavior.CL = m_CL.getValue();
psGTBehavior.weight = m_weight.getValue();
m_agents[i].switchP = m_agentSwitchRate.getValue();
m_agents[i].setGTBehavior(deGTBehavior);
m_agents[i].setGTBehavior(psGTBehavior);
agents[i].switchP = m_agentSwitchRate.getValue();
agents[i].setGTBehavior(deGTBehavior);
agents[i].setGTBehavior(psGTBehavior);
m_agents[i].setSpecComparator(m_specCompareEngine);
m_agents[i].setLibrary(m_library);
agents[i].setSpecComparator(m_specCompareEngine);
agents[i].setLibrary(m_library);
}
//Learn:
@ -170,13 +167,13 @@ public final class DEPSSolverImpl extends BaseEvolutionarySolver
m_library.refreshGbest(m_specCompareEngine);
for (int i = 0; i < m_swarmSize.getValue(); i++)
m_agents[i].generatePoint();
agents[i].generatePoint();
for (int i = 0; i < m_swarmSize.getValue(); i++)
m_agents[i].learn();
agents[i].learn();
for (int i = 0; i < m_swarmSize.getValue(); i++) {
SearchPoint agentPoint = m_agents[i].getMGState();
SearchPoint agentPoint = agents[i].getMGState();
boolean inRange = (agentPoint.getObjectiveValue() >= m_toleratedMin && agentPoint.getObjectiveValue() <= m_toleratedMax);
if (Library.replace(m_envCompareEngine, agentPoint, m_totalBestPoint)) {
m_solverStatusDialog.setBestSolution(m_totalBestPoint.getObjectiveValue(), m_totalBestPoint.isFeasible());

View File

@ -45,35 +45,30 @@ import com.sun.star.uno.XComponentContext;
public class ResourceManager {
private final XComponentContext m_context;
private final String m_oxtRoot;
private final String m_resourceBaseUrl;
private final String m_resourceBasename;
private XStringResourceWithLocation m_xStrResource;
private Locale m_locale;
public ResourceManager(XComponentContext xContext, String oxtId, String relativeResourceBaseUrl, String resourceBasename) {
m_context = xContext;
m_resourceBasename = resourceBasename;
XPackageInformationProvider xPkgInfo = PackageInformationProvider.get(m_context);
m_oxtRoot = xPkgInfo.getPackageLocation(oxtId);
m_resourceBaseUrl = m_oxtRoot + relativeResourceBaseUrl;
XPackageInformationProvider xPkgInfo = PackageInformationProvider.get(xContext);
final String oxtRoot = xPkgInfo.getPackageLocation(oxtId);
final String resourceBaseUrl = oxtRoot + relativeResourceBaseUrl;
try {
XMultiServiceFactory xConfig = theDefaultProvider.get(m_context);
XMultiServiceFactory xConfig = theDefaultProvider.get(xContext);
Object[] args = new Object[1];
args[0] = new PropertyValue("nodepath", 0, "/org.openoffice.Setup/L10N", PropertyState.DIRECT_VALUE);
XPropertySet xConfigProps = UnoRuntime.queryInterface(XPropertySet.class,
xConfig.createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", args));
String[] locale = AnyConverter.toString(xConfigProps.getPropertyValue("ooLocale")).split("-");
String lang = locale[0];
String country = (locale.length >= 2 ? locale[1] : "");
String variant = (locale.length >= 3 ? locale[2] : "");
m_locale = new Locale(lang, country, variant);
String[] localeProp = AnyConverter.toString(xConfigProps.getPropertyValue("ooLocale")).split("-");
String lang = localeProp[0];
String country = (localeProp.length >= 2 ? localeProp[1] : "");
String variant = (localeProp.length >= 3 ? localeProp[2] : "");
Locale locale = new Locale(lang, country, variant);
m_xStrResource = StringResourceWithLocation.create(m_context, m_resourceBaseUrl, true, m_locale, m_resourceBasename, "", null);
m_xStrResource = StringResourceWithLocation.create(xContext, resourceBaseUrl, true, locale, m_resourceBasename, "", null);
} catch (Exception ex) {
ex.printStackTrace();
}

View File

@ -87,21 +87,17 @@ public final class SCOSolverImpl extends BaseEvolutionarySolver
return m_serviceNames;
}
// com.sun.star.sheet.XSolver:
private SCAgent[] m_agents;
public void solve() {
initializeSolve();
//Init:
int swarmSize = m_swarmSize.getValue();
m_agents = new SCAgent[swarmSize];
SCAgent[] agents = new SCAgent[swarmSize];
for (int i = 0; i < swarmSize; i++) {
m_agents[i] = new SCAgent();
m_agents[i].setProblemEncoder(m_problemEncoder);
m_agents[i].setSpecComparator(m_specCompareEngine);
m_agents[i].setExternalLib(m_library);
agents[i] = new SCAgent();
agents[i].setProblemEncoder(m_problemEncoder);
agents[i].setSpecComparator(m_specCompareEngine);
agents[i].setExternalLib(m_library);
}
//Learn:
@ -127,7 +123,7 @@ public final class SCOSolverImpl extends BaseEvolutionarySolver
m_toleratedCount < m_required.getValue() &&
m_solverStatusDialog.getUserState() != IEvolutionarySolverStatusDialog.CANCEL; learningCycle++) {
for (int i = 0; i < swarmSize; i++) {
SearchPoint point = m_agents[i].generatePoint();
SearchPoint point = agents[i].generatePoint();
boolean inRange = (point.getObjectiveValue() >= m_toleratedMin && point.getObjectiveValue() <= m_toleratedMax);
if (Library.replace(m_envCompareEngine, point, m_totalBestPoint)) {
m_solverStatusDialog.setBestSolution(m_totalBestPoint.getObjectiveValue(), m_totalBestPoint.isFeasible());
@ -140,7 +136,7 @@ public final class SCOSolverImpl extends BaseEvolutionarySolver
}
for (int i = 0; i < swarmSize; i++)
m_agents[i].updateInfo();
agents[i].updateInfo();
if (m_specCompareEngine instanceof IUpdateCycleEngine)
((IUpdateCycleEngine)m_specCompareEngine).updateCycle(learningCycle);

View File

@ -57,12 +57,10 @@ import java.util.logging.Logger;
public abstract class BaseDialog extends BaseControl {
private XMultiComponentFactory xMCF;
private Object toolkit;
private XMultiServiceFactory xMSF;
protected XWindow xWindow;
protected XDialog xDialog;
private XWindowPeer xWindowPeer;
private ModalState modalState;
@Override
public String getName() {
@ -92,7 +90,7 @@ public abstract class BaseDialog extends BaseControl {
public BaseDialog(XComponentContext context, String title, int x, int y, int width, int height) {
super(context);
modalState = ModalState.Exit;
ModalState modalState = ModalState.Exit;
try {
xMCF = context.getServiceManager();
setUnoModel(xMCF.createInstanceWithContext("com.sun.star.awt.UnoControlDialogModel", context));
@ -107,7 +105,7 @@ public abstract class BaseDialog extends BaseControl {
XControlModel xControlModel = UnoRuntime.queryInterface(XControlModel.class, getUnoModel());
xControl.setModel(xControlModel);
toolkit = xMCF.createInstanceWithContext("com.sun.star.awt.Toolkit", context);
Object toolkit = xMCF.createInstanceWithContext("com.sun.star.awt.Toolkit", context);
XToolkit xToolkit = UnoRuntime.queryInterface(XToolkit.class, toolkit);
xWindow = UnoRuntime.queryInterface(XWindow.class, unoControl);
xWindow.setVisible(false);

View File

@ -45,9 +45,6 @@ public class EvolutionarySolverStatusUno extends BaseDialog
XActionListener {
private int userState;
// <editor-fold defaultstate="collapsed" desc="UNO Controls">
private Label lblSolution;
private Label lblSolutionValue;
private Label lblIteration;
private ProgressBar pbIteration;
@ -55,12 +52,10 @@ public class EvolutionarySolverStatusUno extends BaseDialog
private Label lblStagnation;
private ProgressBar pbStagnation;
private Label lblStagnationValue;
private Label lblRuntime;
private Label lblRuntimeValue;
private Button btnStop;
private Button btnOK;
private Button btnContinue;
// </editor-fold>
private int defaultTextColor;
private int maxIterations;
private int maxStagnation;
@ -81,9 +76,8 @@ public class EvolutionarySolverStatusUno extends BaseDialog
setProperty("Title", resourceManager.getLocalizedString("Dialog.Caption"));
} catch (com.sun.star.resource.MissingResourceException ex) {} //leave the title as it is
// <editor-fold defaultstate="collapsed" desc="Create UNO Controls">
int y = 5;
lblSolution = new Label(this, "lblSolution");
Label lblSolution = new Label(this, "lblSolution");
lblSolution.setPosition(5, y);
lblSolution.setSize(60, 10);
lblSolution.setLabel(resourceManager.getLocalizedString("Controls.lblSolution", "Current Solution:"));
@ -138,7 +132,7 @@ public class EvolutionarySolverStatusUno extends BaseDialog
lblStagnationValue.setVisible(false);
y+= 20;
lblRuntime = new Label(this, "lblRuntime");
Label lblRuntime = new Label(this, "lblRuntime");
lblRuntime.setPosition(5, y);
lblRuntime.setSize(60, 10);
lblRuntime.setLabel(resourceManager.getLocalizedString("Controls.lblRuntime", "Runtime:"));
@ -176,7 +170,6 @@ public class EvolutionarySolverStatusUno extends BaseDialog
btnContinue.setActionCommand("btnContinueClick");
btnContinue.setEnabled(false);
y += 15;
// </editor-fold>
}
public int getUserState() {

View File

@ -73,9 +73,9 @@ public class ListenAtCalcRangeInDraw implements XChartDataChangeEventListener
Helper aHelper = new Helper( args );
maSheetDoc = aHelper.createSpreadsheetDocument();
maDrawDoc = aHelper.createDrawingDocument();
XModel aDrawDoc = aHelper.createDrawingDocument();
CalcHelper aCalcHelper = new CalcHelper( maSheetDoc );
ChartHelper aChartHelper = new ChartHelper( maDrawDoc );
ChartHelper aChartHelper = new ChartHelper( aDrawDoc );
XCellRange aRange = aCalcHelper.insertFormulaRange( 3, 30 );
@ -185,7 +185,6 @@ public class ListenAtCalcRangeInDraw implements XChartDataChangeEventListener
// __________ private __________
private XSpreadsheetDocument maSheetDoc;
private XModel maDrawDoc;
private XChartDocument maChartDocument;
private XChartData maChartData;
}

View File

@ -47,9 +47,6 @@ import com.sun.star.beans.XPropertySet;
public class OpenQuery {
private XComponentContext xContext = null;
private XMultiComponentFactory xMCF = null;
/**
* @param args the command line arguments
*/
@ -67,6 +64,8 @@ public class OpenQuery {
}
protected void openQuery() throws com.sun.star.uno.Exception, java.lang.Exception {
XComponentContext xContext = null;
XMultiComponentFactory xMCF = null;
try {
// get the remote office component context
xContext = com.sun.star.comp.helper.Bootstrap.bootstrap();

View File

@ -101,10 +101,8 @@ public class DocumentView extends JFrame
private String msName ;
private JButton mbtOpen ;
private JButton mbtSave ;
private JButton mbtExport ;
private JButton mbtExit ;
private boolean mbDead ;
@ -122,10 +120,10 @@ public class DocumentView extends JFrame
// create and add command buttons to a panel
// it will be a sub panel of later layouted UI
mbtOpen = new JButton("Open ..." );
JButton mbtOpen = new JButton("Open ..." );
mbtSave = new JButton("Save" );
mbtExport = new JButton("Save as HTML ...");
mbtExit = new JButton("Exit" );
JButton mbtExit = new JButton("Exit" );
mbtOpen.setEnabled (true );
mbtSave.setEnabled (false);

View File

@ -184,14 +184,14 @@ public class Number_Formats
{
// get the remote office context. If necessary a new office
// process is started
maOfficeContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
XComponentContext aOfficeContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
System.out.println("Connected to a running office ...");
maServiceManager = maOfficeContext.getServiceManager();
XMultiComponentFactory aServiceManager = aOfficeContext.getServiceManager();
// create a new spreadsheet document
XComponentLoader aLoader = UnoRuntime.queryInterface(
XComponentLoader.class, maServiceManager.createInstanceWithContext(
"com.sun.star.frame.Desktop", maOfficeContext) );
XComponentLoader.class, aServiceManager.createInstanceWithContext(
"com.sun.star.frame.Desktop", aOfficeContext) );
maSpreadsheetDoc = UnoRuntime.queryInterface(
XSpreadsheetDocument.class,
@ -207,8 +207,6 @@ public class Number_Formats
// __________ private members and methods __________
private XComponentContext maOfficeContext;
private XMultiComponentFactory maServiceManager;
private XSpreadsheetDocument maSpreadsheetDoc;
private XSpreadsheet maSheet; // the first sheet

View File

@ -53,7 +53,7 @@ import com.sun.star.bridge.XBridge;
public class ConnectionAwareClient extends java.awt.Frame
implements ActionListener , com.sun.star.lang.XEventListener
{
private Button _btnWriter,_btnCalc;
private Button _btnWriter;
private Label _txtLabel;
private String _url;
@ -68,7 +68,7 @@ public class ConnectionAwareClient extends java.awt.Frame
Panel p1 = new Panel();
_btnWriter = new Button("New writer");
_btnCalc = new Button("New calc");
Button _btnCalc = new Button("New calc");
_txtLabel = new Label( "disconnected" );
_btnWriter.addActionListener(this);

View File

@ -199,7 +199,6 @@ class ScriptSelectorPanel extends JPanel {
private XBrowseNode myrootnode = null;
public JTextField textField;
public JTree tree;
private DefaultTreeModel treeModel;
public ScriptSelectorPanel(XBrowseNode root)
{
@ -229,7 +228,7 @@ class ScriptSelectorPanel extends JPanel {
}
};
initNodes(myrootnode, top);
treeModel = new DefaultTreeModel(top);
DefaultTreeModel treeModel = new DefaultTreeModel(top);
tree = new JTree(treeModel);
tree.setCellRenderer(new ScriptTreeRenderer());

View File

@ -117,7 +117,6 @@ public class TextDocuments {
private XTextDocument mxDoc = null;
private XMultiServiceFactory mxDocFactory = null;
private XMultiServiceFactory mxFactory = null;
private XPropertySet mxDocProps = null;
private XText mxDocText = null;
private XTextCursor mxDocCursor = null;
private XTextContent mxFishSection = null;
@ -133,12 +132,10 @@ public class TextDocuments {
sOutputDir = args[0];
textDocuments1.runDemo();
}
catch (java.lang.Exception e){
} catch (java.lang.Exception e) {
System.out.println(e.getMessage());
e.printStackTrace();
}
finally {
} finally {
System.exit(0);
}
}
@ -291,8 +288,7 @@ public class TextDocuments {
// Get a reference to the document's property set. This contains document
// information like the current word count
mxDocProps = UnoRuntime.queryInterface(
XPropertySet.class, mxDoc );
UnoRuntime.queryInterface(XPropertySet.class, mxDoc );
// Simple text insertion example
BodyTextExample ();

View File

@ -39,12 +39,6 @@ public abstract class ComplexTestCase extends Assurance implements ComplexTest
* The method name which will be written into f.e. the data base
**/
private String mTestMethodName = null;
/** Maximal time one method is allowed to execute
* Can be set with parameter 'ThreadTimeOut'
**/
private int m_nThreadTimeOut = 0;
private boolean m_bBeforeCalled;
@ -90,10 +84,13 @@ public abstract class ComplexTestCase extends Assurance implements ComplexTest
private void test_method(DescEntry _entry)
{
m_nThreadTimeOut = param.getInt("ThreadTimeOut");
if (m_nThreadTimeOut == 0)
/* Maximal time one method is allowed to execute
* Can be set with parameter 'ThreadTimeOut'
**/
int nThreadTimeOut = param.getInt("ThreadTimeOut");
if (nThreadTimeOut == 0)
{
m_nThreadTimeOut = 300000;
nThreadTimeOut = 300000;
}
for (int i = 0; i < _entry.SubEntries.length; i++)
@ -153,7 +150,7 @@ public abstract class ComplexTestCase extends Assurance implements ComplexTest
int sleepingStep = 1000;
int factor = 0;
while (th.isAlive() && (lastPing != newPing || factor * sleepingStep < m_nThreadTimeOut))
while (th.isAlive() && (lastPing != newPing || factor * sleepingStep < nThreadTimeOut))
{
Thread.sleep(sleepingStep);
factor++;
@ -175,7 +172,7 @@ public abstract class ComplexTestCase extends Assurance implements ComplexTest
{
log.println("Destroy " + mTestMethodName);
th.stopRunning();
subEntry.State = "Test did sleep for " + (m_nThreadTimeOut / 1000) + " seconds and has been killed!";
subEntry.State = "Test did sleep for " + (nThreadTimeOut / 1000) + " seconds and has been killed!";
subEntry.hasErrorMsg = true;
subEntry.ErrorMsg = subEntry.State;
continue;

View File

@ -46,8 +46,6 @@ class Rect
class BorderRemover
{
private ImageHelper m_aImage;
// Helper values, filled after find Border
// --------------------------------- test mode ---------------------------------
@ -121,12 +119,12 @@ class BorderRemover
public boolean createNewImageWithoutBorder(String _sFilenameFrom, String _sFilenameTo)
throws java.io.IOException
{
m_aImage = ImageHelper.createImageHelper(_sFilenameFrom);
ImageHelper aImageHelper = ImageHelper.createImageHelper(_sFilenameFrom);
int nBorderColor = m_aImage.getPixel(0,0);
Rect aInnerRect = findBorder(m_aImage, nBorderColor);
int nBorderColor = aImageHelper.getPixel(0,0);
Rect aInnerRect = findBorder(aImageHelper, nBorderColor);
RenderedImage aImage = createImage(m_aImage, aInnerRect);
RenderedImage aImage = createImage(aImageHelper, aInnerRect);
File aWriteFile = new File(_sFilenameTo);

View File

@ -29,7 +29,6 @@ class ImageHelper
private Image m_aImage;
private int[] m_aPixels;
private int m_w = 0;
private int m_h = 0;
private ImageHelper(Image _aImage)
@ -38,11 +37,11 @@ class ImageHelper
// grab all (consume much memory)
m_w = getWidth();
m_h = getHeight();
int h = getHeight();
int x = 0;
int y = 0;
m_aPixels = new int[m_w * m_h];
PixelGrabber pg = new PixelGrabber(m_aImage, x, y, m_w, m_h, m_aPixels, 0, m_w);
m_aPixels = new int[m_w * h];
PixelGrabber pg = new PixelGrabber(m_aImage, x, y, m_w, h, m_aPixels, 0, m_w);
try {
pg.grabPixels();
} catch (InterruptedException e) {

View File

@ -29,7 +29,6 @@ class ImageHelper
private Image m_aImage;
private int[] m_aPixels;
private int m_w = 0;
private int m_h = 0;
private ImageHelper(Image _aImage)
@ -38,11 +37,11 @@ class ImageHelper
// grab all (consume much memory)
m_w = getWidth();
m_h = getHeight();
int h = getHeight();
int x = 0;
int y = 0;
m_aPixels = new int[m_w * m_h];
PixelGrabber pg = new PixelGrabber(m_aImage, x, y, m_w, m_h, m_aPixels, 0, m_w);
m_aPixels = new int[m_w * h];
PixelGrabber pg = new PixelGrabber(m_aImage, x, y, m_w, h, m_aPixels, 0, m_w);
try
{
pg.grabPixels();

View File

@ -69,8 +69,6 @@ public class ParameterHelper
private int m_nResolutionInDPI = 180;
private boolean m_bIncludeSubdirectories;
private String m_sInputPath = null;
private String m_sOutputPath = null;
@ -126,7 +124,7 @@ public class ParameterHelper
public boolean isIncludeSubDirectories()
{
m_bIncludeSubdirectories = true;
boolean bIncludeSubdirectories = true;
String sRECURSIVE = (String)getTestParameters().get( PropertyName.DOC_COMPARATOR_INCLUDE_SUBDIRS );
// TODO: I need to get the boolean value with get("name") because, if it is not given getBool() returns
// with a default of 'false' which is not very helpful if the default should be 'true'
@ -138,9 +136,9 @@ public class ParameterHelper
if (sRECURSIVE.equalsIgnoreCase("no") ||
sRECURSIVE.equalsIgnoreCase("false"))
{
m_bIncludeSubdirectories = false;
bIncludeSubdirectories = false;
}
return m_bIncludeSubdirectories;
return bIncludeSubdirectories;
}
public String getReferenceType()

View File

@ -85,7 +85,6 @@ import com.sun.star.util.*;
*/
public class ConfigHelper
{
private XMultiServiceFactory m_xSMGR = null;
private XHierarchicalNameAccess m_xConfig = null;
@ -94,12 +93,9 @@ public class ConfigHelper
boolean bReadOnly )
throws com.sun.star.uno.Exception
{
m_xSMGR = xSMGR;
XMultiServiceFactory xConfigRoot = UnoRuntime.queryInterface(
XMultiServiceFactory.class,
m_xSMGR.createInstance(
"com.sun.star.configuration.ConfigurationProvider"));
xSMGR.createInstance("com.sun.star.configuration.ConfigurationProvider"));
PropertyValue[] lParams = new PropertyValue[1];
lParams[0] = new PropertyValue();

View File

@ -46,7 +46,6 @@ public class StreamSimulator implements com.sun.star.io.XInputStream ,
* @member m_bOutWasUsed indicates, that the output stream interface was used
*/
private String m_sFileName ;
private com.sun.star.io.XInputStream m_xInStream ;
private com.sun.star.io.XOutputStream m_xOutStream ;
private com.sun.star.io.XSeekable m_xSeek ;
@ -57,7 +56,7 @@ public class StreamSimulator implements com.sun.star.io.XInputStream ,
/**
* construct a new instance of this class
* It set the name of the correspojnding file on disk, which
* It set the name of the corresponding file on disk, which
* should be source or target for the following operations on
* this object. And it regulate if it should function as
* input or output stream.
@ -74,13 +73,11 @@ public class StreamSimulator implements com.sun.star.io.XInputStream ,
*
* @throw com.sun.star.io.NotConnectedException
* in case the internal streams to the file on disk couldn't established.
* They are necessary. Otherwhise this simulator can't really work.
* They are necessary. Otherwise this simulator can't really work.
*/
public StreamSimulator( String sFileName , boolean bInput ,
lib.TestParameters param ) throws com.sun.star.io.NotConnectedException
{
m_sFileName = sFileName ;
try
{
XSimpleFileAccess xHelper = UnoRuntime.queryInterface(XSimpleFileAccess.class,
@ -91,14 +88,14 @@ public class StreamSimulator implements com.sun.star.io.XInputStream ,
if (bInput)
{
m_xInStream = xHelper.openFileRead(m_sFileName);
m_xInStream = xHelper.openFileRead(sFileName);
m_xSeek = UnoRuntime.queryInterface(
com.sun.star.io.XSeekable.class,
m_xInStream);
}
else
{
m_xOutStream = xHelper.openFileWrite(m_sFileName);
m_xOutStream = xHelper.openFileWrite(sFileName);
m_xSeek = UnoRuntime.queryInterface(
com.sun.star.io.XSeekable.class,
m_xOutStream);

View File

@ -21,7 +21,6 @@ import helper.CfgParser;
import helper.ClParser;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.Map;
import java.util.Properties;
import java.util.StringTokenizer;

View File

@ -30,7 +30,6 @@ import com.sun.star.beans.XPropertySet;
*/
public class FrameDsc extends InstDescr {
private Size size = null;
private int height = 2000;
private int width = 2000;
private String name = null;
@ -77,7 +76,7 @@ public class FrameDsc extends InstDescr {
public XInterface createInstance( XMultiServiceFactory docMSF ) {
Object SrvObj = null;
size = new Size();
Size size = new Size();
size.Height = height;
size.Width = width;

View File

@ -55,7 +55,6 @@ import com.sun.star.util.XURLTransformer;
public class _XSynchronousFrameLoader extends MultiMethodTest {
public XSynchronousFrameLoader oObj = null; // oObj filled by MultiMethodTest
private String url = null ;
private XFrame frame = null ;
private XComponent frameSup = null ;
private PropertyValue[] descr = null;
@ -72,7 +71,7 @@ public class _XSynchronousFrameLoader extends MultiMethodTest {
*/
@Override
public void before() {
url = (String) tEnv.getObjRelation("FrameLoader.URL") ;
String url = (String) tEnv.getObjRelation("FrameLoader.URL") ;
frame = (XFrame) tEnv.getObjRelation("FrameLoader.Frame") ;
if (url == null) {

View File

@ -44,7 +44,6 @@ import com.sun.star.lang.Locale;
public class _XCollator extends MultiMethodTest {
public XCollator oObj = null;
private String[] alg = null ;
private int[] opt = null ;
Locale loc = new Locale("en", "EN", "");
/**
@ -75,7 +74,7 @@ public class _XCollator extends MultiMethodTest {
*/
public void _listCollatorOptions() {
requiredMethod("listCollatorAlgorithms()") ;
opt = oObj.listCollatorOptions(alg[0]) ;
int[] opt = oObj.listCollatorOptions(alg[0]) ;
log.println("Collator '" + alg[0] + "' options :");
if (opt != null) {
for (int i = 0; i < opt.length; i++) {

View File

@ -48,7 +48,6 @@ import com.sun.star.lang.Locale;
public class _XTransliteration extends MultiMethodTest {
public XTransliteration oObj = null;
private String[] mod = null ;
private Locale loc = new Locale("en", "EN", "") ;
/**
@ -57,7 +56,7 @@ public class _XTransliteration extends MultiMethodTest {
* one module name.
*/
public void _getAvailableModules() {
mod = oObj.getAvailableModules(loc, TransliterationType.ONE_TO_ONE);
String[] mod = oObj.getAvailableModules(loc, TransliterationType.ONE_TO_ONE);
if (mod != null) {
log.println("Available modules :") ;

View File

@ -47,8 +47,6 @@ import com.sun.star.uno.UnoRuntime;
public class _XObjectInputStream extends MultiMethodTest {
public XObjectInputStream oObj = null;
private Object objRead = null ;
private Object objWrite = null ;
/**
* Test reads perisist object from stream and compares properties
@ -58,7 +56,7 @@ public class _XObjectInputStream extends MultiMethodTest {
* of objects properties are equal. <p>
*/
public void _readObject() {
objWrite = tEnv.getObjRelation("PersistObject") ;
Object objWrite = tEnv.getObjRelation("PersistObject") ;
if (objWrite == null) {
log.println("PersistObject not found in relations") ;
tRes.tested("readObject()", false) ;
@ -77,6 +75,7 @@ public class _XObjectInputStream extends MultiMethodTest {
return;
}
Object objRead = null ;
try {
objRead = oObj.readObject() ;
} catch(com.sun.star.io.IOException e) {

View File

@ -52,7 +52,6 @@ public class _XCachedDynamicResultSetStubFactory extends MultiMethodTest {
*/
public XCachedDynamicResultSetStubFactory oObj;
private XDynamicResultSet resSet = null ;
private XDynamicResultSet resSetStub = null ;
/**
* Retrieves object relation.
@ -77,7 +76,7 @@ public class _XCachedDynamicResultSetStubFactory extends MultiMethodTest {
public void _createCachedDynamicResultSetStub() {
boolean result = true ;
resSetStub = oObj.createCachedDynamicResultSetStub(resSet) ;
XDynamicResultSet resSetStub = oObj.createCachedDynamicResultSetStub(resSet) ;
if (resSetStub == null) {
log.println("!!! Method returned null !!!") ;

View File

@ -44,7 +44,6 @@ import com.sun.star.uno.UnoRuntime;
public class _XControlAccess extends MultiMethodTest {
public XControlAccess oObj = null;
private XControlInformation xCI = null ;
private String[] supControls = null ;
private String[][] supProperties = null ;
@ -58,7 +57,7 @@ public class _XControlAccess extends MultiMethodTest {
*/
@Override
protected void before() {
xCI = UnoRuntime.queryInterface
XControlInformation xCI = UnoRuntime.queryInterface
(XControlInformation.class, oObj);
if (xCI == null) throw new StatusException

View File

@ -78,8 +78,6 @@ public class ODatabaseSource extends TestCase {
private static int uniqueSuffixStat = 0 ;
private int uniqueSuffix = 0 ;
private XNamingService xDBContextNameServ = null ;
private String databaseName = null ;
private XOfficeDatabaseDocument xDBDoc = null;
/**
@ -136,7 +134,7 @@ public class ODatabaseSource extends TestCase {
throw new StatusException("Service not available", e) ;
}
xDBContextNameServ = UnoRuntime.queryInterface(XNamingService.class, oInterface) ;
XNamingService xDBContextNameServ = UnoRuntime.queryInterface(XNamingService.class, oInterface) ;
// retrieving temp directory for database
String tmpDatabaseUrl = utils.getOfficeTempDir(Param.getMSF());
@ -179,7 +177,7 @@ public class ODatabaseSource extends TestCase {
throw new StatusException("Could not set property 'URL' ", e) ;
}
databaseName = "NewDatabaseSource" + uniqueSuffix ;
String databaseName = "NewDatabaseSource" + uniqueSuffix ;
// make sure that the DatabaseContext isn't already registered
try {

View File

@ -134,7 +134,6 @@ public class ORowSet extends TestCase {
private Object m_rowSet = null;
private DataSource m_dataSource;
private String m_tableFile;
private XMultiServiceFactory m_orb = null;
/**
* Initializes some class fields. Then creates DataSource, which serves
@ -160,13 +159,13 @@ public class ORowSet extends TestCase {
protected void initialize ( TestParameters Param, PrintWriter _log)
throws StatusException
{
m_orb = Param.getMSF();
XMultiServiceFactory orb = Param.getMSF();
String tmpDir = utils.getOfficeTemp( m_orb );
String tmpDir = utils.getOfficeTemp( orb );
origDB = util.utils.getFullTestDocName("TestDB/testDB.dbf");
dbTools = new DBTools( m_orb );
dbTools = new DBTools( orb );
// creating DataSource and registering it in DatabaseContext
String dbURL = (String) Param.get("test.db.url");
@ -174,7 +173,7 @@ public class ORowSet extends TestCase {
String dbPassword = (String) Param.get("test.db.password");
log.println("Creating and registering DataSource ...");
srcInf = new DataSourceDescriptor( m_orb );
srcInf = new DataSourceDescriptor( orb );
if (dbURL != null && dbUser != null && dbPassword != null)
{
isMySQLDB = true;

View File

@ -126,7 +126,6 @@ import util.utils;
public class GenericModelTest extends TestCase {
private XTextDocument m_xTextDoc;
private Object m_dbSrc = null;
private DBTools.DataSourceInfo m_srcInf = null;
/**
* This is the name of the Data Base which the test uses: "APITestDatabase"
*/
@ -403,11 +402,11 @@ public class GenericModelTest extends TestCase {
m_dbTools = new DBTools( xMSF );
String tmpDir = utils.getOfficeTemp((xMSF));
m_srcInf = m_dbTools.newDataSourceInfo();
m_srcInf.URL = "sdbc:dbase:" + DBTools.dirToUrl(tmpDir);
log.println("data source: " + m_srcInf.URL);
DBTools.DataSourceInfo srcInf = m_dbTools.newDataSourceInfo();
srcInf.URL = "sdbc:dbase:" + DBTools.dirToUrl(tmpDir);
log.println("data source: " + srcInf.URL);
m_dbSrc = m_srcInf.getDataSourceService();
m_dbSrc = srcInf.getDataSourceService();
m_dbTools.reRegisterDB(m_dbSourceName, m_dbSrc);
m_XFormLoader = FormTools.bindForm(m_xTextDoc, m_dbSourceName,

View File

@ -64,7 +64,6 @@ public final class SOFormulaParser extends ComponentBase
public static final int UNARY_OPERATORS = 2;
public static final int BINARY_OPERATORS = 3;
public static final int FUNCTIONS = 4;
private final XComponentContext m_xContext;
private final PropertySetMixin m_prophlp;
private static final String __serviceName = "com.sun.star.report.meta.FormulaParser";
private static final String OPERATORS = "org.pentaho.reporting.libraries.formula.operators.";
@ -82,14 +81,13 @@ public final class SOFormulaParser extends ComponentBase
public SOFormulaParser(final XComponentContext context)
{
m_xContext = context;
final ClassLoader cl = java.lang.Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
parser = new FormulaParser();
try
{
final XFormulaOpCodeMapper mapper = UnoRuntime.queryInterface(XFormulaOpCodeMapper.class, m_xContext.getServiceManager().createInstanceWithContext("simple.formula.FormulaOpCodeMapperObj", m_xContext));
final XFormulaOpCodeMapper mapper = UnoRuntime.queryInterface(XFormulaOpCodeMapper.class, context.getServiceManager().createInstanceWithContext("simple.formula.FormulaOpCodeMapperObj", context));
FormulaOpCodeMapEntry[] opCodes = mapper.getAvailableMappings(FormulaLanguage.ODFF, FormulaMapGroup.FUNCTIONS);
final DefaultFormulaContext defaultContext = new DefaultFormulaContext();
final FunctionRegistry functionRegistry = defaultContext.getFunctionRegistry();
@ -136,7 +134,7 @@ public final class SOFormulaParser extends ComponentBase
// for your optional attributes if necessary. See the documentation
// of the PropertySetMixin helper for further information.
// Ensure that your attributes are initialized correctly!
m_prophlp = new PropertySetMixin(m_xContext, this,
m_prophlp = new PropertySetMixin(context, this,
new Type(com.sun.star.report.meta.XFormulaParser.class), null);
}

View File

@ -34,17 +34,13 @@ public final class StarFunctionDescription extends WeakBase
implements com.sun.star.report.meta.XFunctionDescription
{
private final XComponentContext m_xContext;
private final PropertySetMixin m_prophlp;
// attributes
// final private com.sun.star.report.meta.XFunctionCategory m_Category;
private final FunctionDescription functionDescription;
private final XFunctionCategory category;
private final Locale defaultLocale;
public StarFunctionDescription(final DefaultFormulaContext defaultContext, final XComponentContext context, final XFunctionCategory category, final FunctionDescription functionDescription)
{
m_xContext = context;
this.category = category;
Locale locale;
try
@ -63,7 +59,7 @@ public final class StarFunctionDescription extends WeakBase
// for your optional attributes if necessary. See the documentation
// of the PropertySetMixin helper for further information.
// Ensure that your attributes are initialized correctly!
m_prophlp = new PropertySetMixin(m_xContext, this,
m_prophlp = new PropertySetMixin(context, this,
new Type(com.sun.star.report.meta.XFunctionDescription.class), null);
}

View File

@ -174,9 +174,6 @@ public class ReportDesignerTest
}
private String m_sMailAddress = null;
private String m_sUPDMinor;
private static final int WRITER = 1;
private static final int CALC = 2;
@ -189,11 +186,11 @@ public class ReportDesignerTest
String sVCSID = System.getProperty("VCSID");
System.out.println("VCSID='" + sVCSID + "'");
m_sMailAddress = sVCSID + "@openoffice.org";
System.out.println("Assumed mail address: " + m_sMailAddress);
String sMailAddress = sVCSID + "@openoffice.org";
System.out.println("Assumed mail address: " + sMailAddress);
m_sUPDMinor = System.getProperty("UPDMINOR");
System.out.println("Current MWS: " + m_sUPDMinor);
String sUPDMinor = System.getProperty("UPDMINOR");
System.out.println("Current MWS: " + sUPDMinor);
// --------------------------- Start the given Office ---------------------------

View File

@ -57,7 +57,6 @@ public class _XDataPilotDescriptor {
private String sTag = "XDataPilotDescriptor_Tag";
private String fieldsNames[];
private int fieldsAmount = 0;
private int tEnvFieldsAmount = 0;
/**
@ -179,7 +178,7 @@ public class _XDataPilotDescriptor {
return false;
} else {System.out.println("getDataPilotFields returned not Null value -- OK");}
fieldsAmount = IA.getCount();
int fieldsAmount = IA.getCount();
if (fieldsAmount < tEnvFieldsAmount) {
System.out.println("Number of fields is less than number goten by relation.");
return false;

View File

@ -52,7 +52,6 @@ public class ParcelDescriptor {
"<parcel xmlns:parcel=\"scripting.dtd\" language=\"Java\">\n" +
"</parcel>").getBytes();
private File file = null;
private Document document = null;
private String language = null;
private Map<String, String> languagedepprops = new HashMap<String, String>(3);
@ -83,8 +82,6 @@ public class ParcelDescriptor {
}
private ParcelDescriptor(File file, String language) throws IOException {
this.file = file;
if (file.exists()) {
FileInputStream fis = null;

View File

@ -16,7 +16,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
import java.awt.Graphics;
import java.awt.Color;
import java.io.File;
import java.io.IOException;

View File

@ -51,18 +51,16 @@ public class CheckTable
connection.tearDown();
}
private XMultiServiceFactory m_xMSF = null;
private XComponentContext m_xContext = null;
private XTextDocument m_xDoc = null;
@Before public void before() throws Exception
{
m_xMSF = UnoRuntime.queryInterface(
XMultiServiceFactory xMSF = UnoRuntime.queryInterface(
XMultiServiceFactory.class,
connection.getComponentContext().getServiceManager());
m_xContext = connection.getComponentContext();
assertNotNull("could not get component context.", m_xContext);
m_xDoc = util.WriterTools.createTextDoc(m_xMSF);
XComponentContext xContext = connection.getComponentContext();
assertNotNull("could not get component context.", xContext);
m_xDoc = util.WriterTools.createTextDoc(xMSF);
}
@After public void after()

View File

@ -63,9 +63,7 @@ public class LoadSaveTest
}
private XMultiServiceFactory m_xMSF = null;
private XComponentContext m_xContext = null;
private XGlobalEventBroadcaster m_xGEB = null;
private String m_TmpDir = null;
private String m_fileURL = "file://";
// these should be parameters or something?
@ -74,13 +72,13 @@ public class LoadSaveTest
@Before public void before() throws Exception
{
m_xContext = connection.getComponentContext();
assertNotNull("could not get component context.", m_xContext);
XComponentContext xContext = connection.getComponentContext();
assertNotNull("could not get component context.", xContext);
m_xMSF = UnoRuntime.queryInterface(
XMultiServiceFactory.class, m_xContext.getServiceManager());
m_xGEB = theGlobalEventBroadcaster.get(m_xContext);
m_TmpDir = util.utils.getOfficeTemp/*Dir*/(m_xMSF);
System.out.println("tempdir: " + m_TmpDir);
XMultiServiceFactory.class, xContext.getServiceManager());
m_xGEB = theGlobalEventBroadcaster.get(xContext);
String sTmpDir = util.utils.getOfficeTemp/*Dir*/(m_xMSF);
System.out.println("tempdir: " + sTmpDir);
System.out.println("sourcedir: " + m_SourceDir);
System.out.println("targetdir: " + m_TargetDir);
}

View File

@ -107,8 +107,7 @@ public class AccessibilityTree
public void SetCanvas (Canvas aCanvas)
{
maCanvas = aCanvas;
((AccessibilityTreeModel)maTree.getModel()).setCanvas (maCanvas);
((AccessibilityTreeModel)maTree.getModel()).setCanvas(aCanvas);
}
/** Expand the nodes in the subtree rooted in aNode according to the the
@ -383,14 +382,7 @@ public class AccessibilityTree
protected AccessibleTreeCellRenderer
maCellRenderer;
private JTree
maTree;
private Canvas
maCanvas;
private int
mnExpandLevel;
protected AccessibleTreeCellRenderer maCellRenderer;
private JTree maTree;
private int mnExpandLevel;
}

View File

@ -39,8 +39,7 @@ public class AccessibilityTreeModel
maNodeMap = new NodeMap();
maEventListener = new EventListener (this);
mxListener = new QueuedListener (maEventListener);
mxListener = new QueuedListener(new EventListener (this));
}
public void clear ()
@ -501,6 +500,4 @@ public class AccessibilityTreeModel
private int mnLockCount;
private Canvas maCanvas;
private EventListener maEventListener;
}

View File

@ -169,11 +169,11 @@ public class AccessibilityWorkBench
aViewSplitPane.setDividerLocation (400);
// Text output area.
maMessageArea = MessageArea.Instance ();
MessageArea aMessageArea = MessageArea.Instance ();
// Split pane for the two views and the message area.
JSplitPane aSplitPane = new JSplitPane (JSplitPane.VERTICAL_SPLIT,
aViewSplitPane, maMessageArea);
aViewSplitPane, aMessageArea);
aSplitPane.setOneTouchExpandable(true);
addGridElement (aViewSplitPane, 0,0, 2,1, 3,3,
GridBagConstraints.CENTER, GridBagConstraints.BOTH);
@ -253,11 +253,11 @@ public class AccessibilityWorkBench
JMenuBar CreateMenuBar ()
{
// Menu bar.
maMenuBar = new JMenuBar ();
JMenuBar aMenuBar = new JMenuBar ();
// File menu.
JMenu aFileMenu = new JMenu ("File");
maMenuBar.add (aFileMenu);
aMenuBar.add (aFileMenu);
JMenuItem aItem;
aItem = new JMenuItem ("Quit");
aFileMenu.add (aItem);
@ -265,7 +265,7 @@ public class AccessibilityWorkBench
// View menu.
JMenu aViewMenu = new JMenu ("View");
maMenuBar.add (aViewMenu);
aMenuBar.add (aViewMenu);
ButtonGroup aGroup = new ButtonGroup ();
JRadioButtonMenuItem aRadioButton = new JRadioButtonMenuItem ("Whole Screen");
aGroup.add (aRadioButton);
@ -294,7 +294,7 @@ public class AccessibilityWorkBench
// Options menu.
JMenu aOptionsMenu = new JMenu ("Options");
maMenuBar.add (aOptionsMenu);
aMenuBar.add (aOptionsMenu);
JCheckBoxMenuItem aCBItem;
aCBItem = new JCheckBoxMenuItem ("Show Descriptions", maCanvas.getShowDescriptions());
aOptionsMenu.add (aCBItem);
@ -314,7 +314,7 @@ public class AccessibilityWorkBench
// Help menu.
JMenu aHelpMenu = new JMenu ("Help");
maMenuBar.add (aHelpMenu);
aMenuBar.add (aHelpMenu);
aItem = new JMenuItem ("Help");
aHelpMenu.add (aItem);
@ -328,7 +328,7 @@ public class AccessibilityWorkBench
aHelpMenu.add (aItem);
aItem.addActionListener (this);
return maMenuBar;
return aMenuBar;
}
@ -579,16 +579,12 @@ public class AccessibilityWorkBench
maAccessibilityTree;
private ObjectViewContainer
maObjectViewContainer;
private MessageArea
maMessageArea;
private JButton
aConnectButton,
aQuitButton,
aUpdateButton,
aExpandButton,
aShapesButton;
private JMenuBar
maMenuBar;
private boolean
mbInitialized;
private TopWindowListener

View File

@ -32,18 +32,16 @@ class EventLogger
{
try
{
maFrame = new JFrame ();
maLogger = new TextLogger ();
maFrame.setContentPane (new JScrollPane (maLogger));
JFrame aFrame = new JFrame ();
TextLogger aLogger = new TextLogger ();
aFrame.setContentPane (new JScrollPane (aLogger));
maFrame.setSize (400,300);
maFrame.setVisible (true);
aFrame.setSize (400,300);
aFrame.setVisible (true);
}
catch (Exception e)
{}
}
private static EventLogger maInstance = null;
private JFrame maFrame;
private TextLogger maLogger;
}

View File

@ -50,11 +50,11 @@ public class ContextView
public ContextView (ObjectViewContainer aContainer)
{
super (aContainer);
maNameLabel = new JLabel ("Name: ");
JLabel aNameLabel = new JLabel ("Name: ");
maName = new JLabel ("");
maDescriptionLabel = new JLabel ("Description: ");
JLabel aDescriptionLabel = new JLabel ("Description: ");
maDescription = new JLabel ("");
maRoleLabel = new JLabel ("Role: ");
JLabel maRoleLabel = new JLabel ("Role: ");
maRole = new JLabel ("");
// Make the background of name and description white and opaque so
@ -77,9 +77,9 @@ public class ContextView
constraints.weighty = 1;
constraints.anchor = GridBagConstraints.WEST;
constraints.fill = GridBagConstraints.NONE;
add (maNameLabel, constraints);
add (aNameLabel, constraints);
constraints.gridy = 1;
add (maDescriptionLabel, constraints);
add (aDescriptionLabel, constraints);
constraints.gridy = 2;
add (maRoleLabel, constraints);
constraints.gridy = 0;
@ -134,10 +134,7 @@ public class ContextView
private JLabel
maNameLabel,
maName,
maDescriptionLabel,
maDescription,
maRoleLabel,
maRole;
}

View File

@ -65,7 +65,6 @@ public class FormHandler
public XMultiServiceFactory xMSFDoc;
public XMultiServiceFactory xMSF;
public XDrawPage xDrawPage;
private XDrawPageSupplier xDrawPageSupplier;
public String[] sModelServices = new String[8];
public static ControlData[] oControlData;
@ -106,7 +105,7 @@ public class FormHandler
public FormHandler(XMultiServiceFactory _xMSF, XTextDocument xTextDocument)
{
this.xMSF = _xMSF;
xDrawPageSupplier = UnoRuntime.queryInterface(XDrawPageSupplier.class, xTextDocument);
XDrawPageSupplier xDrawPageSupplier = UnoRuntime.queryInterface(XDrawPageSupplier.class, xTextDocument);
xDrawPage = xDrawPageSupplier.getDrawPage();
xFormsSupplier = UnoRuntime.queryInterface(XFormsSupplier.class, xDrawPage);
xShapeGrouper = UnoRuntime.queryInterface(XShapeGrouper.class, xDrawPage);

View File

@ -37,10 +37,7 @@ public class TimeStampControl extends DatabaseControl
DatabaseControl oDateControl;
DatabaseControl oTimeControl;
// XShape xGroupShape;
Resource oResource;
private String sDateAppendix; // = GetResText(RID_FORM + 4)
private String sTimeAppendix; // = GetResText(RID_FORM + 5)
XShapes xGroupShapes = null;
double nreldatewidth;
double nreltimewidth;
@ -53,7 +50,6 @@ public class TimeStampControl extends DatabaseControl
{
super(_oFormHandler, "com.sun.star.drawing.ShapeCollection", _aPoint);
oResource = _oResource;
// xGroupShape = xShape;
oDateControl = new DatabaseControl(oFormHandler, _xFormName, _curFieldName, DataType.DATE, aPoint);
int nDBHeight = oDateControl.getControlHeight();
nDateWidth = oDateControl.getPreferredWidth();
@ -93,8 +89,8 @@ public class TimeStampControl extends DatabaseControl
{
super(_oGridControl, _curfieldcolumn);
oResource = _oResource;
sDateAppendix = oResource.getResText(UIConsts.RID_FORM + 88);
sTimeAppendix = oResource.getResText(UIConsts.RID_FORM + 89);
String sDateAppendix = oResource.getResText(UIConsts.RID_FORM + 88);
String sTimeAppendix = oResource.getResText(UIConsts.RID_FORM + 89);
oDateControl = new DatabaseControl(_oGridControl, _curfieldcolumn, DataType.DATE, _curfieldcolumn.getFieldTitle() + PropertyNames.SPACE + sDateAppendix);
oTimeControl = new DatabaseControl(_oGridControl, _curfieldcolumn, DataType.TIME, _curfieldcolumn.getFieldTitle() + PropertyNames.SPACE + sTimeAppendix);
}

View File

@ -30,18 +30,14 @@ import com.sun.star.wizards.common.PropertyNames;
public class DataEntrySetter
{
private WizardDialog CurUnoDialog;
private short curtabindex;
private XRadioButton optNewDataOnly;
private XRadioButton optDisplayAllData;
private XCheckBox chknomodification;
private XCheckBox chknodeletion;
private XCheckBox chknoaddition;
public DataEntrySetter(WizardDialog _CurUnoDialog)
public DataEntrySetter(WizardDialog CurUnoDialog)
{
this.CurUnoDialog = _CurUnoDialog;
curtabindex = (short) (FormWizard.SODATA_PAGE * 100);
short curtabindex = (short) (FormWizard.SODATA_PAGE * 100);
Integer IDataStep = Integer.valueOf(FormWizard.SODATA_PAGE);
String sNewDataOnly = CurUnoDialog.m_oResource.getResText(UIConsts.RID_FORM + 44);
String sDisplayAllData = CurUnoDialog.m_oResource.getResText(UIConsts.RID_FORM + 46);
@ -50,7 +46,7 @@ public class DataEntrySetter
String sNoAddition = CurUnoDialog.m_oResource.getResText(UIConsts.RID_FORM + 49); // AlowInserts
String sdontdisplayExistingData = CurUnoDialog.m_oResource.getResText(UIConsts.RID_FORM + 45);
optNewDataOnly = CurUnoDialog.insertRadioButton("optNewDataOnly", "toggleCheckBoxes", this,
CurUnoDialog.insertRadioButton("optNewDataOnly", "toggleCheckBoxes", this,
new String[]
{
PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH

View File

@ -47,7 +47,6 @@ public class FormDocument extends TextDocument
private FormHandler oFormHandler;
private ViewHandler oViewHandler;
private TextStyleHandler oTextStyleHandler;
private XPropertySet xPropPageStyle;
private static final int SOFORMGAP = 2000;
private boolean bhasSubForm;
@ -68,7 +67,7 @@ public class FormDocument extends TextDocument
{
oFormHandler = new FormHandler(xMSF, xTextDocument);
oFormHandler.setDrawObjectsCaptureMode(false);
oTextStyleHandler = new TextStyleHandler(xMSFDoc, xTextDocument);
TextStyleHandler oTextStyleHandler = new TextStyleHandler(xMSFDoc, xTextDocument);
oViewHandler = new ViewHandler(xMSFDoc, xTextDocument);
oMainFormDBMetaData = new CommandMetaData(xMSF);// , CharLocale);
oSubFormDBMetaData = new CommandMetaData(xMSF);// , CharLocale);

View File

@ -43,20 +43,16 @@ import com.sun.star.wizards.ui.*;
public class StyleApplier
{
private WizardDialog CurUnoDialog;
private XPropertySet xPageStylePropertySet;
private XMultiServiceFactory xMSF;
private short curtabindex;
private XRadioButton optNoBorder;
private XRadioButton opt3DLook;
private XRadioButton optFlat;
private XListBox lstStyles;
private FormDocument curFormDocument;
private short iOldLayoutPos;
private static final String SCHANGELAYOUT = "changeLayout";
private static final String SCHANGEBORDERTYPE = "changeBorderLayouts";
private String[] StyleNames;
private String[] StyleNodeNames;
private String[] FileNames;
private final static int SOBACKGROUNDCOLOR = 0;
private final static int SODBTEXTCOLOR = 1;
@ -64,15 +60,14 @@ public class StyleApplier
private final static int SOBORDERCOLOR = 5;
private Short IBorderValue = Short.valueOf((short) 1);
public StyleApplier(WizardDialog _CurUnoDialog, FormDocument _curFormDocument)
public StyleApplier(WizardDialog CurUnoDialog, FormDocument _curFormDocument)
{
this.curFormDocument = _curFormDocument;
xMSF = curFormDocument.xMSF;
TextStyleHandler oTextStyleHandler = new TextStyleHandler(xMSF, curFormDocument.xTextDocument);
xPageStylePropertySet = oTextStyleHandler.getStyleByName("PageStyles", "Standard");
this.CurUnoDialog = _CurUnoDialog;
curtabindex = (short) (FormWizard.SOSTYLE_PAGE * 100);
short curtabindex = (short) (FormWizard.SOSTYLE_PAGE * 100);
Integer IStyleStep = Integer.valueOf(FormWizard.SOSTYLE_PAGE);
String sPageStyles = CurUnoDialog.m_oResource.getResText(UIConsts.RID_FORM + 86);
String sNoBorder = CurUnoDialog.m_oResource.getResText(UIConsts.RID_FORM + 29);
@ -126,7 +121,7 @@ public class StyleApplier
UIConsts.INTEGERS[10], "HID:WIZARDS_HID_DLGFORM_CMD3DBORDER", s3DLook, 196, 53, Short.valueOf((short) 1), IStyleStep, Short.valueOf(curtabindex++), "1", 93
});
optFlat = CurUnoDialog.insertRadioButton("otpFlat", SCHANGEBORDERTYPE, this,
XRadioButton optFlat = CurUnoDialog.insertRadioButton("otpFlat", SCHANGEBORDERTYPE, this,
new String[]
{
PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, "Tag", PropertyNames.PROPERTY_WIDTH
@ -153,7 +148,7 @@ public class StyleApplier
{
Object oRootNode = Configuration.getConfigurationRoot(xMSF, "org.openoffice.Office.FormWizard/FormWizard/Styles", false);
XNameAccess xNameAccess = UnoRuntime.queryInterface(XNameAccess.class, oRootNode);
StyleNodeNames = xNameAccess.getElementNames();
String[] StyleNodeNames = xNameAccess.getElementNames();
StyleNames = new String[StyleNodeNames.length];
FileNames = new String[StyleNodeNames.length];
for (int i = 0; i < StyleNodeNames.length; i++)

View File

@ -54,10 +54,8 @@ class ReportTextDocument extends com.sun.star.wizards.text.TextDocument implemen
private Object FirstPageStyle;
public ArrayList<DBColumn> DBColumnsVector;
private RecordTable CurRecordTable;
private String sMsgTableNotExisting;
private String sMsgCommonReportError;
private String ContentTemplatePath;
private String sMsgEndAutopilot;
public boolean bIsCurLandscape;
public TextTableHandler oTextTableHandler;
public TextSectionHandler oTextSectionHandler;
@ -99,16 +97,14 @@ class ReportTextDocument extends com.sun.star.wizards.text.TextDocument implemen
oTextFieldHandler = new TextFieldHandler(xMSFDoc, xTextDocument);
DBColumnsVector = new java.util.ArrayList<DBColumn>();
oNumberFormatter = oTextTableHandler.getNumberFormatter();
// CurDBMetaData = new RecordParser(xMSF); //, CharLocale, oNumberFormatter);
CurDBMetaData = _aRecordParser;
long lDateCorrection = oNumberFormatter.getNullDateCorrection();
oNumberFormatter.setBooleanReportDisplayNumberFormat();
oNumberFormatter.setNullDateCorrection(lDateCorrection);
// sMsgInvalidTextField = oResource.getResText(UIConsts.RID_REPORT + 73);
sMsgTableNotExisting = oResource.getResText(UIConsts.RID_REPORT + 61);
String sMsgTableNotExisting = oResource.getResText(UIConsts.RID_REPORT + 61);
sMsgCommonReportError = oResource.getResText(UIConsts.RID_REPORT + 72);
sMsgCommonReportError = JavaTools.replaceSubString(sMsgCommonReportError, String.valueOf((char) 13), "<BR>");
sMsgEndAutopilot = oResource.getResText(UIConsts.RID_DB_COMMON + 33);
String sMsgEndAutopilot = oResource.getResText(UIConsts.RID_DB_COMMON + 33);
sMsgTableNotExisting = sMsgTableNotExisting + (char) 13 + sMsgEndAutopilot;
bIsCurLandscape = true;
getReportPageStyles();

View File

@ -32,32 +32,24 @@ import com.sun.star.wizards.common.PropertyNames;
public class FieldDescription
{
private String tablename = PropertyNames.EMPTY_STRING;
private String keyname;
private XNameAccess xNameAccessTableNode;
private XPropertySet xPropertySet;
private ArrayList<PropertyValue> aPropertyValues;
private Integer Type;
private String Name;
private XMultiServiceFactory xMSF;
private Locale aLocale;
public FieldDescription(XMultiServiceFactory _xMSF, Locale _aLocale, ScenarioSelector _curscenarioselector, String _fieldname, String _keyname, int _nmaxcharCount)
public FieldDescription(XMultiServiceFactory _xMSF, Locale _aLocale, ScenarioSelector _curscenarioselector, String _fieldname, String keyname, int _nmaxcharCount)
{
xMSF = _xMSF;
aLocale = _aLocale;
tablename = _curscenarioselector.getTableName();
Name = _fieldname;
keyname = _keyname;
aPropertyValues = new ArrayList<PropertyValue>();
xNameAccessTableNode = _curscenarioselector.oCGTable.xNameAccessFieldsNode;
XNameAccess xNameAccessTableNode = _curscenarioselector.oCGTable.xNameAccessFieldsNode;
XNameAccess xNameAccessFieldNode;
if (_curscenarioselector.bcolumnnameislimited)
{
xNameAccessFieldNode = Configuration.getChildNodebyDisplayName(xMSF, aLocale, xNameAccessTableNode, keyname, "ShortName", _nmaxcharCount);
xNameAccessFieldNode = Configuration.getChildNodebyDisplayName(_xMSF, _aLocale, xNameAccessTableNode, keyname, "ShortName", _nmaxcharCount);
}
else
{
xNameAccessFieldNode = Configuration.getChildNodebyDisplayName(xMSF, aLocale, xNameAccessTableNode, keyname, PropertyNames.PROPERTY_NAME, _nmaxcharCount);
xNameAccessFieldNode = Configuration.getChildNodebyDisplayName(_xMSF, _aLocale, xNameAccessTableNode, keyname, PropertyNames.PROPERTY_NAME, _nmaxcharCount);
}
setFieldProperties(xNameAccessFieldNode);
}
@ -66,7 +58,7 @@ public class FieldDescription
{
Name = _fieldname;
aPropertyValues = new ArrayList<PropertyValue>();
Type = Integer.valueOf(com.sun.star.sdbc.DataType.VARCHAR);
Integer Type = Integer.valueOf(com.sun.star.sdbc.DataType.VARCHAR);
aPropertyValues.add(Properties.createProperty(PropertyNames.PROPERTY_NAME, _fieldname));
aPropertyValues.add(Properties.createProperty("Type", Type));
}

View File

@ -38,7 +38,6 @@ public class PrimaryKeyHandler implements XFieldSelectionListener
{
private TableWizard CurUnoDialog;
private short curtabindex;
private final static String SPRIMEKEYMODE = "togglePrimeKeyFields";
private XRadioButton optAddAutomatically;
private XRadioButton optUseExisting;
@ -59,7 +58,7 @@ public class PrimaryKeyHandler implements XFieldSelectionListener
this.CurUnoDialog = _CurUnoDialog;
curTableDescriptor = _curTableDescriptor;
bAutoPrimaryKeysupportsAutoIncrmentation = isAutoPrimeKeyAutoIncrementationsupported();
curtabindex = (short) ((TableWizard.SOPRIMARYKEYPAGE * 100) - 20);
short curtabindex = (short) ((TableWizard.SOPRIMARYKEYPAGE * 100) - 20);
Integer IPRIMEKEYSTEP = Integer.valueOf(TableWizard.SOPRIMARYKEYPAGE);
final String sExplanations = CurUnoDialog.m_oResource.getResText(UIConsts.RID_TABLE + 26);
final String screatePrimaryKey = CurUnoDialog.m_oResource.getResText(UIConsts.RID_TABLE + 27);

View File

@ -48,10 +48,7 @@ public class ScenarioSelector extends FieldSelection implements XItemListener, X
final static int PRIVATE = 0;
final static int BUSINESS = 1;
private XFixedText lblExplanation;
private XFixedText lblCategories;
private XRadioButton optBusiness;
private XRadioButton optPrivate;
private XListBox xTableListBox;
private TableWizard CurTableWizardUnoDialog;
private TableDescriptor curtabledescriptor;
@ -84,7 +81,7 @@ public class ScenarioSelector extends FieldSelection implements XItemListener, X
Integer IMAINSTEP = Integer.valueOf(TableWizard.SOMAINPAGE);
oCGCategory = new CGCategory(CurUnoDialog.xMSF);
oCGTable = new CGTable(CurUnoDialog.xMSF);
lblExplanation = CurUnoDialog.insertLabel("lblScenarioExplanation",
CurUnoDialog.insertLabel("lblScenarioExplanation",
new String[]
{
PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_MULTILINE, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
@ -94,7 +91,7 @@ public class ScenarioSelector extends FieldSelection implements XItemListener, X
32, sExplanation, Boolean.TRUE, 91, 27, IMAINSTEP, Short.valueOf(pretabindex++), 233
});
lblCategories = CurUnoDialog.insertLabel("lblCategories",
CurUnoDialog.insertLabel("lblCategories",
new String[]
{
PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH
@ -114,7 +111,7 @@ public class ScenarioSelector extends FieldSelection implements XItemListener, X
UIConsts.INTEGERS[8], "HID:WIZARDS_HID_DLGTABLE_OPTBUSINESS", sBusiness, 98, 70, Short.valueOf((short) 1), IMAINSTEP, Short.valueOf(pretabindex++), 78
});
optPrivate = CurTableWizardUnoDialog.insertRadioButton("optPrivate", SELECTCATEGORY, this,
CurTableWizardUnoDialog.insertRadioButton("optPrivate", SELECTCATEGORY, this,
new String[]
{
PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HELPURL, PropertyNames.PROPERTY_LABEL, PropertyNames.PROPERTY_POSITION_X, PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, PropertyNames.PROPERTY_WIDTH

View File

@ -48,7 +48,6 @@ public class TextTableHandler
public XTextDocument xTextDocument;
public XSimpleText xSimpleText;
private NumberFormatter oNumberFormatter;
private Locale aCharLocale;
/** Creates a new instance of TextTableHandler */
public TextTableHandler(XMultiServiceFactory xMSF, XTextDocument xTextDocument)
@ -60,7 +59,7 @@ public class TextTableHandler
xTextTablesSupplier = UnoRuntime.queryInterface(XTextTablesSupplier.class, xTextDocument);
xSimpleText = UnoRuntime.queryInterface(XSimpleText.class, xTextDocument.getText());
XNumberFormatsSupplier xNumberFormatsSupplier = UnoRuntime.queryInterface(XNumberFormatsSupplier.class, xTextDocument);
aCharLocale = (Locale) Helper.getUnoStructValue(xTextDocument, "CharLocale");
Locale aCharLocale = (Locale) Helper.getUnoStructValue(xTextDocument, "CharLocale");
oNumberFormatter = new NumberFormatter(xNumberFormatsSupplier, aCharLocale);
}
catch (java.lang.Exception e)

View File

@ -35,7 +35,6 @@ public class CommandFieldSelection extends FieldSelection implements Comparator<
private XListBox xTableListBox;
private XFixedText xlblTable;
private String sTableListBoxName;
private String sTableLabelName;
private String sQueryPrefix;
private String sTablePrefix;
private short m_iSelPos = -1;
@ -99,7 +98,7 @@ public class CommandFieldSelection extends FieldSelection implements Comparator<
this.bgetQueries = _bgetQueries;
this.CurDBMetaData = _CurDBMetaData;
toggleListboxControls(Boolean.FALSE);
sTableLabelName = "lblTables_" + super.sIncSuffix;
String sTableLabelName = "lblTables_" + super.sIncSuffix;
sTableListBoxName = "lstTables_" + super.sIncSuffix;
sTablePrefix = getTablePrefix();
sQueryPrefix = getQueryPrefix();

View File

@ -33,10 +33,6 @@ import com.sun.star.wizards.common.PropertyNames;
public class DocumentPreview
{
/**
* The window in which the preview is showed.
*/
private XWindow xWindow;
/**
* The frame service which is used to show the preview
*/
@ -144,7 +140,10 @@ public class DocumentPreview
aDescriptor.WindowAttributes = VclWindowPeerAttribute.CLIPCHILDREN | WindowAttribute.SHOW;
XWindowPeer xPeer = xToolkit.createWindow(aDescriptor);
xWindow = UnoRuntime.queryInterface(XWindow.class, xPeer);
/*
* The window in which the preview is showed.
*/
XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, xPeer);
Object frame = xmsf.createInstance("com.sun.star.frame.Frame");
xFrame = UnoRuntime.queryInterface(XFrame.class, frame);
xFrame.initialize(xWindow);

View File

@ -44,8 +44,6 @@ public class FieldSelection
private String[] AllFieldNames;
private Integer ListBoxWidth;
private Integer SelListBoxPosX;
private boolean bisModified = false;
private final static int SOCMDMOVESEL = 1;
@ -180,7 +178,7 @@ public class FieldSelection
Integer cmdShiftButtonPosX = Integer.valueOf((CompPosX + ListBoxWidth.intValue() + cmdButtonHoriDist));
Integer ListBoxPosY = Integer.valueOf(CompPosY + lblVertiDist + lblHeight);
Integer ListBoxHeight = Integer.valueOf(CompHeight - 8 - 2);
SelListBoxPosX = Integer.valueOf(cmdShiftButtonPosX.intValue() + cmdButtonWidth + cmdButtonHoriDist);
Integer SelListBoxPosX = Integer.valueOf(cmdShiftButtonPosX.intValue() + cmdButtonWidth + cmdButtonHoriDist);
IStep = Integer.valueOf(_iStep);
if (bshowFourButtons)

View File

@ -49,7 +49,6 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL
private static final String CANCEL_ACTION_PERFORMED = "cancelWizard_1";
private static final String HELP_ACTION_PERFORMED = "callHelp";
public VetoableChangeSupport vetos = new VetoableChangeSupport(this);
private String[] sRightPaneHeaders;
private int iButtonWidth = 50;
private int nNewStep = 1;
private int nOldStep = 1;
@ -81,8 +80,6 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL
hid = hid_;
oWizardResource = new Resource(xMSF, "Common", "dbw");
sMsgEndAutopilot = oWizardResource.getResText(UIConsts.RID_DB_COMMON + 33);
//new Resource(xMSF,"Common","com");
}
public Resource getResource()
@ -694,11 +691,10 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL
public void setRightPaneHeaders(String[] _sRightPaneHeaders)
{
this.nMaxStep = _sRightPaneHeaders.length;
this.sRightPaneHeaders = _sRightPaneHeaders;
FontDescriptor oFontDesc = new FontDescriptor();
oFontDesc.Weight = com.sun.star.awt.FontWeight.BOLD;
for (int i = 0; i < sRightPaneHeaders.length; i++)
for (int i = 0; i < _sRightPaneHeaders.length; i++)
{
insertLabel("lblQueryTitle" + i,
new String[]
@ -707,7 +703,7 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL
},
new Object[]
{
oFontDesc, 16, sRightPaneHeaders[i], Boolean.TRUE, 91, 8, Integer.valueOf(i + 1), Short.valueOf((short) 12), 212
oFontDesc, 16, _sRightPaneHeaders[i], Boolean.TRUE, 91, 8, Integer.valueOf(i + 1), Short.valueOf((short) 12), 212
});
}
}

View File

@ -33,7 +33,6 @@ public class ConverterInfoList {
private static String defaultPropsFile = "ConverterInfoList.properties";
private ArrayList<String> jars;
private Properties props = null;
/**
* This constructor loads and reads the default properties file.
@ -59,7 +58,7 @@ public class ConverterInfoList {
Class<? extends ConverterInfoList> c = this.getClass();
InputStream is = c.getResourceAsStream(propsFile);
BufferedInputStream bis = new BufferedInputStream(is);
props = new Properties();
Properties props = new Properties();
props.load(bis);
bis.close();