Kaydet (Commit) a96c308e authored tarafından Noel Grandin's avatar Noel Grandin

java: these fields can be converted to local variables

Change-Id: Ifefb5de196a3e5cbaa8945759da42886c69daacf
üst 0897aae2
......@@ -102,7 +102,9 @@ public class OOoBean
Neither a connection is established nor any document loaded.
*/
public OOoBean()
{}
{
setLayout(new java.awt.BorderLayout());
}
// @requirement FUNC.CON.MULT/0.3
/** Constructor for an OOoBean which uses a specific office connection.
......@@ -120,6 +122,7 @@ public class OOoBean
public OOoBean( OfficeConnection iConnection )
throws NoConnectionException
{
setLayout(new java.awt.BorderLayout());
try { setOOoConnection( iConnection ); }
catch ( HasConnectionException aExc )
{ /* impossible here */ }
......@@ -1305,11 +1308,6 @@ xLayoutManager.showElement("private:resource/menubar/menubar");
// Helper Methods / Internal Methods
// general instance intializer
{
setLayout(new java.awt.BorderLayout());
}
@Deprecated
@Override
public void paint( java.awt.Graphics aGraphics )
......
......@@ -33,10 +33,8 @@ public class DatabaseDocument
{
protected DatabaseDocument( final DataSource _dataSource )
{
m_dataSource = _dataSource;
XDocumentDataSource docDataSource = UnoRuntime.queryInterface(
XDocumentDataSource.class, m_dataSource.getDataSource() );
XDocumentDataSource.class, _dataSource.getDataSource() );
m_databaseDocument = UnoRuntime.queryInterface(XOfficeDatabaseDocument.class,
docDataSource.getDatabaseDocument() );
......@@ -67,7 +65,6 @@ public class DatabaseDocument
m_storeDoc.storeAsURL( _url, new PropertyValue[] { } );
}
private final DataSource m_dataSource;
private final XOfficeDatabaseDocument m_databaseDocument;
private final XModel m_model;
private final XStorable m_storeDoc;
......
......@@ -27,22 +27,16 @@ import com.sun.star.uno.UnoRuntime;
public class Resource
{
private XMultiServiceFactory xMSF;
private String Module;
private XIndexAccess xStringIndexAccess;
private XIndexAccess xStringListIndexAccess;
/** Creates a new instance of Resource
*/
public Resource(XMultiServiceFactory _xMSF, String _Module)
{
this.xMSF = _xMSF;
this.Module = _Module;
try
{
Object[] aArgs = new Object[1];
aArgs[0] = this.Module;
XInterface xResource = (XInterface) xMSF.createInstanceWithArguments(
Object[] aArgs = new Object[] { _Module };
XInterface xResource = (XInterface) _xMSF.createInstanceWithArguments(
"org.libreoffice.resource.ResourceIndexAccess",
aArgs);
if (xResource == null)
......@@ -55,10 +49,10 @@ public class Resource
this.xStringIndexAccess = UnoRuntime.queryInterface(
XIndexAccess.class,
xNameAccess.getByName("String"));
this.xStringListIndexAccess = UnoRuntime.queryInterface(
XIndexAccess xStringListIndexAccess = UnoRuntime.queryInterface(
XIndexAccess.class,
xNameAccess.getByName("StringList"));
if(this.xStringListIndexAccess == null)
if(xStringListIndexAccess == null)
throw new Exception("could not initialize xStringListIndexAccess");
if(this.xStringIndexAccess == null)
throw new Exception("could not initialize xStringIndexAccess");
......@@ -66,7 +60,7 @@ public class Resource
catch (Exception exception)
{
exception.printStackTrace();
showCommonResourceError(xMSF);
showCommonResourceError(_xMSF);
}
}
......
......@@ -34,9 +34,6 @@ public class QueryMetaData extends CommandMetaData
public PropertyValue[][] GroupByFilterConditions = new PropertyValue[][]
{
};
private String[] UniqueAggregateFieldNames = new String[]
{
};
public int Type = QueryType.SODETAILQUERY;
public interface QueryType
......@@ -212,9 +209,7 @@ public class QueryMetaData extends CommandMetaData
UniqueAggregateFieldVector.add(AggregateFieldNames[i][0]);
}
}
UniqueAggregateFieldNames = new String[UniqueAggregateFieldVector.size()];
UniqueAggregateFieldVector.toArray(UniqueAggregateFieldNames);
return UniqueAggregateFieldNames;
return UniqueAggregateFieldVector.toArray(new String[UniqueAggregateFieldVector.size()]);
}
public boolean hasNumericalFields()
......
......@@ -45,7 +45,6 @@ public class TypeInspector
DataType.INTEGER, DataType.FLOAT, DataType.REAL, DataType.DOUBLE, DataType.NUMERIC, DataType.DECIMAL
};
static final int INVALID = 999999;
private XResultSet xResultSet;
public class TypeInfo
{
......@@ -61,7 +60,6 @@ public class TypeInspector
{
try
{
xResultSet = _xResultSet;
ArrayList<String> aTypeNameVector = new ArrayList<String>();
ArrayList<Integer> aTypeVector = new ArrayList<Integer>();
ArrayList<Integer> aNullableVector = new ArrayList<Integer>();
......@@ -70,8 +68,8 @@ public class TypeInspector
ArrayList<Integer> aMinScaleVector = new ArrayList<Integer>();
ArrayList<Integer> aMaxScaleVector = new ArrayList<Integer>();
ArrayList<Integer> aSearchableVector = new ArrayList<Integer>();
XRow xRow = UnoRuntime.queryInterface(XRow.class, xResultSet);
while (xResultSet.next())
XRow xRow = UnoRuntime.queryInterface(XRow.class, _xResultSet);
while (_xResultSet.next())
{
aTypeNameVector.add(xRow.getString(1));
aTypeVector.add(Integer.valueOf(xRow.getShort(2)));
......
......@@ -43,7 +43,6 @@ public class Control extends Shape
private XControl xControl;
public XPropertySet xPropertySet;
XWindowPeer xWindowPeer;
private String sServiceName;
private static final int SOMAXTEXTSIZE = 50;
private int icontroltype;
private XNameContainer xFormName;
......@@ -76,7 +75,7 @@ public class Control extends Shape
try
{
icontroltype = _icontroltype;
sServiceName = oFormHandler.sModelServices[getControlType()];
String sServiceName = oFormHandler.sModelServices[getControlType()];
Object oControlModel = oFormHandler.xMSFDoc.createInstance(sServiceName);
xControlModel = UnoRuntime.queryInterface( XControlModel.class, oControlModel );
xPropertySet = UnoRuntime.queryInterface( XPropertySet.class, oControlModel );
......
......@@ -88,7 +88,6 @@ public class FormHandler
private XNameAccess xNamedForms;
XControlAccess xControlAccess;
XShapeGrouper xShapeGrouper;
private XNameContainer xNamedFormContainer;
public static class ControlData
{
......@@ -224,7 +223,7 @@ public class FormHandler
private boolean hasFormByName(String _FormName)
{
xNamedFormContainer = getDocumentForms();
XNameContainer xNamedFormContainer = getDocumentForms();
xNamedForms = UnoRuntime.queryInterface(XNameAccess.class, xNamedFormContainer);
return xNamedForms.hasByName(_FormName);
}
......
......@@ -35,12 +35,10 @@ import com.sun.star.lang.XMultiServiceFactory;
public class GridControl extends Shape
{
private FieldColumn[] fieldcolumns;
public XNameContainer xNameContainer;
public XGridColumnFactory xGridColumnFactory;
public XPropertySet xPropertySet;
XNameAccess xNameAccess;
private XControlModel xControlModel;
public XComponent xComponent;
public GridControl(XMultiServiceFactory _xMSF, String _sname, FormHandler _oFormHandler, XNameContainer _xFormName, FieldColumn[] _fieldcolumns, Point _aPoint, Size _aSize)
......@@ -48,21 +46,20 @@ public class GridControl extends Shape
super(_oFormHandler, _aPoint, _aSize);
try
{
fieldcolumns = _fieldcolumns;
Object oGridModel = oFormHandler.xMSFDoc.createInstance(oFormHandler.sModelServices[FormHandler.SOGRIDCONTROL]);
xNameContainer = UnoRuntime.queryInterface( XNameContainer.class, oGridModel );
xNameAccess = UnoRuntime.queryInterface( XNameAccess.class, oGridModel );
_xFormName.insertByName(_sname, oGridModel);
xControlModel = UnoRuntime.queryInterface( XControlModel.class, oGridModel );
XControlModel xControlModel = UnoRuntime.queryInterface( XControlModel.class, oGridModel );
xControlShape.setControl(xControlModel);
xPropertySet = UnoRuntime.queryInterface( XPropertySet.class, oGridModel );
oFormHandler.xDrawPage.add(xShape);
xGridColumnFactory = UnoRuntime.queryInterface( XGridColumnFactory.class, oGridModel );
xComponent = UnoRuntime.queryInterface( XComponent.class, oGridModel );
for (int i = 0; i < fieldcolumns.length; i++)
for (int i = 0; i < _fieldcolumns.length; i++)
{
FieldColumn curfieldcolumn = fieldcolumns[i];
FieldColumn curfieldcolumn = _fieldcolumns[i];
if (curfieldcolumn.getFieldType() == DataType.TIMESTAMP)
{
new TimeStampControl(new Resource(_xMSF, "dbw"), this, curfieldcolumn);
......
......@@ -39,9 +39,7 @@ public class TimeStampControl extends DatabaseControl
private Resource oResource;
private double nreldatewidth;
private double nreltimewidth;
private int nTimeWidth;
private int nDBWidth;
private int nDateWidth;
XShape xShapeGroup;
public TimeStampControl(Resource _oResource, FormHandler _oFormHandler, XNameContainer _xFormName, String _curFieldName, Point _aPoint)
......@@ -50,11 +48,11 @@ public class TimeStampControl extends DatabaseControl
oResource = _oResource;
oDateControl = new DatabaseControl(oFormHandler, _xFormName, _curFieldName, DataType.DATE, aPoint);
int nDBHeight = oDateControl.getControlHeight();
nDateWidth = oDateControl.getPreferredWidth();
int nDateWidth = oDateControl.getPreferredWidth();
oDateControl.setSize(new Size(nDateWidth, nDBHeight));
Point aTimePoint = new Point(aPoint.X + 10 + nDateWidth, aPoint.Y);
oTimeControl = new DatabaseControl(oFormHandler, _xFormName, _curFieldName, DataType.TIME, aTimePoint);
nTimeWidth = oTimeControl.getPreferredWidth();
int nTimeWidth = oTimeControl.getPreferredWidth();
oTimeControl.setSize(new Size(nTimeWidth, nDBHeight));
nDBWidth = nDateWidth + nTimeWidth + 10;
xShapes.add(oDateControl.xShape);
......
......@@ -34,7 +34,6 @@ public class Finalizer
{
private WizardDialog CurUnoDialog;
private short curtabindex;
private XRadioButton optModifyForm;
private XTextComponent txtFormName;
private FormDocument oFormDocument;
......@@ -42,7 +41,7 @@ public class Finalizer
public Finalizer(WizardDialog _CurUnoDialog)
{
this.CurUnoDialog = _CurUnoDialog;
curtabindex = (short) (FormWizard.SOSTORE_PAGE * 100);
short curtabindex = (short) (FormWizard.SOSTORE_PAGE * 100);
String slblFormName = CurUnoDialog.m_oResource.getResText(UIConsts.RID_FORM + 50);
String slblProceed = CurUnoDialog.m_oResource.getResText(UIConsts.RID_FORM + 51);
......
......@@ -41,7 +41,6 @@ public class FormConfiguration
{
private WizardDialog CurUnoDialog;
private short curtabindex;
private XRadioButton optOnExistingRelation;
private XCheckBox chkcreateSubForm;
private XRadioButton optSelectManually;
......@@ -55,7 +54,7 @@ public class FormConfiguration
public FormConfiguration(WizardDialog _CurUnoDialog)
{
this.CurUnoDialog = _CurUnoDialog;
curtabindex = (short) (FormWizard.SOSUBFORM_PAGE * 100);
short curtabindex = (short) (FormWizard.SOSUBFORM_PAGE * 100);
Integer ISubFormStep = Integer.valueOf(FormWizard.SOSUBFORM_PAGE);
String sOnExistingRelation = CurUnoDialog.m_oResource.getResText(UIConsts.RID_FORM + 5);
String sOnManualRelation = CurUnoDialog.m_oResource.getResText(UIConsts.RID_FORM + 7);
......
......@@ -38,7 +38,6 @@ public class ReportFinalizer
private WizardDialog CurUnoDialog;
private XTextComponent xTitleTextBox;
private String StoreName;
private String DefaultName;
private String OldDefaultName;
private IReportDocument CurReportDocument;
public static final int SOCREATEDOCUMENT = 1;
......@@ -189,7 +188,7 @@ public class ReportFinalizer
public void initialize(RecordParser _CurDBMetaData)
{
String FirstCommandName = (_CurDBMetaData.getIncludedCommandNames())[0];
DefaultName = Desktop.getUniqueName(_CurDBMetaData.getReportDocuments(), FirstCommandName);
String DefaultName = Desktop.getUniqueName(_CurDBMetaData.getReportDocuments(), FirstCommandName);
if (!DefaultName.equals(OldDefaultName))
{
OldDefaultName = DefaultName;
......
......@@ -34,7 +34,6 @@ public class CGCategory
private XMultiServiceFactory xMSF;
XNameAccess xNameAccessTablesNode;
private XNameAccess xNameAccessCurBusinessNode;
private Object oconfigView;
public CGCategory(XMultiServiceFactory _xMSF)
{
......@@ -45,7 +44,7 @@ public class CGCategory
{
try
{
oconfigView = Configuration.getConfigurationRoot(xMSF, CGROOTPATH, false); //business/Tables
Object oconfigView = Configuration.getConfigurationRoot(xMSF, CGROOTPATH, false); //business/Tables
xNameAccessCurBusinessNode = Configuration.getChildNodebyName(
UnoRuntime.queryInterface(XNameAccess.class, oconfigView),
category);
......
......@@ -28,7 +28,6 @@ public class CGTable
private XMultiServiceFactory xMSF;
XNameAccess xNameAccessFieldsNode;
private XNameAccess xNameAccessTableNode;
public CGTable(XMultiServiceFactory _xMSF)
{
......@@ -39,7 +38,7 @@ public class CGTable
{
try
{
xNameAccessTableNode = Configuration.getChildNodebyIndex(_xNameAccessParentNode, _index);
XNameAccess xNameAccessTableNode = Configuration.getChildNodebyIndex(_xNameAccessParentNode, _index);
xNameAccessFieldsNode = Configuration.getChildNodebyName(xNameAccessTableNode, "Fields");
}
catch (Exception e)
......
......@@ -46,7 +46,6 @@ public class FieldFormatter implements XItemListener
private Object oColumnDescriptorModel;
private XTextComponent txtfieldname;
private XListBox xlstFieldNames;
private XButton btnplus;
private XButton btnminus;
private XButton btnShiftUp;
private XButton btnShiftDown;
......@@ -144,7 +143,7 @@ public class FieldFormatter implements XItemListener
oFontDesc, 14, "HID:WIZARDS_HID_DLGTABLE_CMDMINUS", "-", 118, 175, IFieldFormatStep, Short.valueOf(curtabindex++), 14
});
btnplus = CurUnoDialog.insertButton("btnplus", new XActionListenerAdapter() {
XButton btnplus = CurUnoDialog.insertButton("btnplus", new XActionListenerAdapter() {
@Override
public void actionPerformed(ActionEvent event) {
addFieldName();
......
......@@ -33,7 +33,6 @@ public class Finalizer
{
private TableWizard CurUnoDialog;
private short curtabindex;
private XRadioButton optModifyTable;
private XRadioButton optWorkWithTable;
private XTextComponent txtTableName;
......@@ -50,7 +49,7 @@ public class Finalizer
{
this.CurUnoDialog = _CurUnoDialog;
this.curtabledescriptor = _curtabledescriptor;
curtabindex = (short) (TableWizard.SOFINALPAGE * 100);
short curtabindex = (short) (TableWizard.SOFINALPAGE * 100);
Integer IFINALSTEP = Integer.valueOf(TableWizard.SOFINALPAGE);
String slblTableName = CurUnoDialog.m_oResource.getResText(UIConsts.RID_TABLE + 34);
String slblProceed = CurUnoDialog.m_oResource.getResText(UIConsts.RID_TABLE + 36);
......
......@@ -52,7 +52,6 @@ public class AggregateComponent extends ControlScroller
private static final int SOADDROW = 1;
private static final int SOREMOVEROW = 2;
private ArrayList<ControlRow> ControlRowVector;
private int curHelpID;
private int lastHelpIndex;
/** Creates a new instance of AggrgateComponent */
......@@ -61,7 +60,6 @@ public class AggregateComponent extends ControlScroller
super(_CurUnoDialog, _iStep, _iPosX + 10, _iPosY, _iWidth - 12, _uitextfieldcount, 18, _firstHelpID + 2);
try
{
curHelpID = _firstHelpID;
this.CurDBMetaData = _CurDBMetaData;
Count = 1;
CurUnoDialog.insertRadioButton("optDetailQuery", 0, new ActionListenerImpl(),
......@@ -71,7 +69,7 @@ public class AggregateComponent extends ControlScroller
},
new Object[]
{
8, HelpIds.getHelpIdString(curHelpID), soptDetailQuery, Integer.valueOf(_iPosX), Integer.valueOf(iCompPosY - 42), Short.valueOf((short) 1), IStep, Short.valueOf(curtabindex++), Integer.valueOf(iCompWidth)
8, HelpIds.getHelpIdString(_firstHelpID), soptDetailQuery, Integer.valueOf(_iPosX), Integer.valueOf(iCompPosY - 42), Short.valueOf((short) 1), IStep, Short.valueOf(curtabindex++), Integer.valueOf(iCompWidth)
});
CurUnoDialog.insertRadioButton("optSummaryQuery", 0, new ActionListenerImpl(),
......@@ -81,7 +79,7 @@ public class AggregateComponent extends ControlScroller
},
new Object[]
{
16, HelpIds.getHelpIdString(curHelpID + 1), soptSummaryQuery, Boolean.TRUE, Integer.valueOf(_iPosX), Integer.valueOf(iCompPosY - 32), IStep, Short.valueOf(curtabindex++), Integer.valueOf(iCompWidth)
16, HelpIds.getHelpIdString(_firstHelpID + 1), soptSummaryQuery, Boolean.TRUE, Integer.valueOf(_iPosX), Integer.valueOf(iCompPosY - 32), IStep, Short.valueOf(curtabindex++), Integer.valueOf(iCompWidth)
});
CurUnoDialog.insertLabel("lblAggregate",
new String[]
......
......@@ -38,11 +38,8 @@ public abstract class ControlScroller
protected int iCompPosY;
protected int iCompWidth;
protected int iCompHeight;
private int iStartPosY;
protected short curtabindex;
private int iStep;
protected Integer IStep;
private int linedistance;
int iScrollBarWidth = 10;
private int SORELFIRSTPOSY = 3;
protected int curHelpIndex;
......@@ -77,16 +74,14 @@ public abstract class ControlScroller
{
this.nblockincrement = _nblockincrement;
this.CurUnoDialog = _CurUnoDialog;
this.iStep = _iStep;
this.curHelpIndex = _firsthelpindex;
curtabindex = UnoDialog.setInitialTabindex(iStep);
this.linedistance = _nlinedistance;
IStep = Integer.valueOf(iStep);
curtabindex = UnoDialog.setInitialTabindex(_iStep);
IStep = Integer.valueOf(_iStep);
this.iCompPosX = _iCompPosX;
this.iCompPosY = _iCompPosY;
this.iCompWidth = _iCompWidth;
this.iCompHeight = 2 * SORELFIRSTPOSY + nblockincrement * linedistance;
iStartPosY = iCompPosY + SORELFIRSTPOSY;
this.iCompHeight = 2 * SORELFIRSTPOSY + nblockincrement * _nlinedistance;
int iStartPosY = iCompPosY + SORELFIRSTPOSY;
int ScrollHeight = iCompHeight - 2;
nlineincrement = 1;
sIncSuffix = com.sun.star.wizards.common.Desktop.getIncrementSuffix(CurUnoDialog.getDlgNameAccess(), "TitleScrollBar");
......@@ -105,7 +100,7 @@ public abstract class ControlScroller
for (int i = 0; i < nblockincrement; i++)
{
insertControlGroup(i, ypos);
ypos += linedistance;
ypos += _nlinedistance;
}
}
......
......@@ -51,7 +51,6 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL
private int nNewStep = 1;
private int nOldStep = 1;
private int nMaxStep = 1;
private XItemEventBroadcaster xRoadmapBroadcaster;
private String[] sRMItemLabels;
private Object oRoadmap;
private XSingleServiceFactory xSSFRoadmap;
......@@ -221,7 +220,7 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL
xIndexContRoadmap = UnoRuntime.queryInterface(XIndexContainer.class, oRoadmap);
XControl xRoadmapControl = this.xDlgContainer.getControl("rdmNavi");
xRoadmapBroadcaster = UnoRuntime.queryInterface(XItemEventBroadcaster.class, xRoadmapControl);
XItemEventBroadcaster xRoadmapBroadcaster = UnoRuntime.queryInterface(XItemEventBroadcaster.class, xRoadmapControl);
xRoadmapBroadcaster.addItemListener(new XItemListenerAdapter() {
public void itemStateChanged(com.sun.star.awt.ItemEvent itemEvent) {
try
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment