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 /odk/examples/DevelopersGuide/OfficeDev | |
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 'odk/examples/DevelopersGuide/OfficeDev')
-rw-r--r-- | odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/DocumentView.java | 6 | ||||
-rw-r--r-- | odk/examples/DevelopersGuide/OfficeDev/Number_Formats.java | 10 |
2 files changed, 6 insertions, 10 deletions
diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/DocumentView.java b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/DocumentView.java index 407cfa4f0052..2a3bad305c94 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/DocumentView.java +++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/DocumentView.java @@ -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); diff --git a/odk/examples/DevelopersGuide/OfficeDev/Number_Formats.java b/odk/examples/DevelopersGuide/OfficeDev/Number_Formats.java index f6a8f8c035d8..4a406a0305a5 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/Number_Formats.java +++ b/odk/examples/DevelopersGuide/OfficeDev/Number_Formats.java @@ -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 |