diff options
author | Noel Grandin <noel@peralex.com> | 2014-11-12 09:55:57 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2014-11-12 11:03:29 +0000 |
commit | bb437029c1e5331bcc3f8fb2fc87837142a52f33 (patch) | |
tree | 56bde4059792a5284e90ae3b10ee4388cc913a54 /wizards/com/sun/star/wizards/ui | |
parent | 84f7f412bfc9e18b1ff8b133ceda7757eae28c36 (diff) |
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>
Diffstat (limited to 'wizards/com/sun/star/wizards/ui')
4 files changed, 8 insertions, 16 deletions
diff --git a/wizards/com/sun/star/wizards/ui/CommandFieldSelection.java b/wizards/com/sun/star/wizards/ui/CommandFieldSelection.java index f3f4cbc13d14..f7ded90df20a 100644 --- a/wizards/com/sun/star/wizards/ui/CommandFieldSelection.java +++ b/wizards/com/sun/star/wizards/ui/CommandFieldSelection.java @@ -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(); diff --git a/wizards/com/sun/star/wizards/ui/DocumentPreview.java b/wizards/com/sun/star/wizards/ui/DocumentPreview.java index 56dbc3d06777..d5f2e9653a99 100644 --- a/wizards/com/sun/star/wizards/ui/DocumentPreview.java +++ b/wizards/com/sun/star/wizards/ui/DocumentPreview.java @@ -34,10 +34,6 @@ public class DocumentPreview { /** - * The window in which the preview is showed. - */ - private XWindow xWindow; - /** * The frame service which is used to show the preview */ private XFrame xFrame; @@ -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); diff --git a/wizards/com/sun/star/wizards/ui/FieldSelection.java b/wizards/com/sun/star/wizards/ui/FieldSelection.java index 193aa26aadae..9f43570e3276 100644 --- a/wizards/com/sun/star/wizards/ui/FieldSelection.java +++ b/wizards/com/sun/star/wizards/ui/FieldSelection.java @@ -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) diff --git a/wizards/com/sun/star/wizards/ui/WizardDialog.java b/wizards/com/sun/star/wizards/ui/WizardDialog.java index 5d6292409faa..4fe8221d5a2c 100644 --- a/wizards/com/sun/star/wizards/ui/WizardDialog.java +++ b/wizards/com/sun/star/wizards/ui/WizardDialog.java @@ -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 }); } } |