[Libreoffice-commits] core.git: 14 commits - bean/com bridges/test connectivity/qa filter/qa forms/qa framework/qa nlpsolver/src qadevOOo/runner qadevOOo/tests scripting/java toolkit/test ucb/qa unoxml/qa vcl/qa wizards/com xmerge/source
Noel Grandin
noel at peralex.com
Fri Dec 19 00:42:30 PST 2014
bean/com/sun/star/comp/beans/OOoBean.java | 10 -
bridges/test/java_uno/equals/TestEquals.java | 1
connectivity/qa/complex/connectivity/DBaseDriverTest.java | 2
filter/qa/complex/filter/misc/FinalizedMandatoryTest.java | 2
filter/qa/complex/filter/misc/TypeDetection6FileFormat.java | 2
forms/qa/integration/forms/TableCellTextBinding.java | 13 --
framework/qa/complex/XUserInputInterception/EventTest.java | 3
framework/qa/complex/api_internal/CheckAPI.java | 2
framework/qa/complex/imageManager/CheckImageManager.java | 2
framework/qa/complex/imageManager/_XComponent.java | 6 -
framework/qa/complex/imageManager/_XInitialization.java | 4
framework/qa/complex/imageManager/_XTypeProvider.java | 7 -
framework/qa/complex/path_substitution/PathSubstitutionTest.java | 2
nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java | 2
qadevOOo/runner/base/java_fat.java | 8 -
qadevOOo/runner/complexlib/ComplexTestCase.java | 4
qadevOOo/runner/helper/ProcessHandler.java | 60 ----------
qadevOOo/runner/stats/InternalLogWriter.java | 34 +----
qadevOOo/runner/util/db/DatabaseDocument.java | 5
qadevOOo/tests/java/ifc/awt/_XUserInputInterception.java | 3
qadevOOo/tests/java/ifc/document/_XEventBroadcaster.java | 4
qadevOOo/tests/java/ifc/lang/_XComponent.java | 2
qadevOOo/tests/java/ifc/linguistic2/_XAvailableLocales.java | 3
qadevOOo/tests/java/ifc/linguistic2/_XSupportedLocales.java | 2
qadevOOo/tests/java/ifc/table/_XCellCursor.java | 5
qadevOOo/tests/java/ifc/text/_NumberingLevel.java | 10 -
qadevOOo/tests/java/mod/_acceptor/Acceptor.java | 2
qadevOOo/tests/java/mod/_remotebridge/uno/various.java | 1
qadevOOo/tests/java/mod/_remotebridge/various.java | 1
scripting/java/com/sun/star/script/framework/io/XStorageHelper.java | 2
toolkit/test/accessibility/EventQueue.java | 3
toolkit/test/accessibility/NodeHandler.java | 2
toolkit/test/accessibility/TextLogger.java | 5
ucb/qa/complex/tdoc/_XComponent.java | 2
unoxml/qa/complex/unoxml/RDFRepositoryTest.java | 2
vcl/qa/complex/memCheck/CheckMemoryUsage.java | 2
wizards/com/sun/star/wizards/common/Resource.java | 16 --
wizards/com/sun/star/wizards/db/QueryMetaData.java | 7 -
wizards/com/sun/star/wizards/db/TypeInspector.java | 6 -
wizards/com/sun/star/wizards/document/Control.java | 3
wizards/com/sun/star/wizards/document/FormHandler.java | 3
wizards/com/sun/star/wizards/document/GridControl.java | 9 -
wizards/com/sun/star/wizards/document/TimeStampControl.java | 6 -
wizards/com/sun/star/wizards/form/Finalizer.java | 3
wizards/com/sun/star/wizards/form/FormConfiguration.java | 3
wizards/com/sun/star/wizards/report/Dataimport.java | 8 -
wizards/com/sun/star/wizards/report/ReportFinalizer.java | 3
wizards/com/sun/star/wizards/table/CGCategory.java | 3
wizards/com/sun/star/wizards/table/CGTable.java | 3
wizards/com/sun/star/wizards/table/FieldFormatter.java | 3
wizards/com/sun/star/wizards/table/Finalizer.java | 3
wizards/com/sun/star/wizards/ui/AggregateComponent.java | 6 -
wizards/com/sun/star/wizards/ui/ControlScroller.java | 15 --
wizards/com/sun/star/wizards/ui/WizardDialog.java | 3
xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/OfficeDocumentException.java | 25 ++--
55 files changed, 111 insertions(+), 237 deletions(-)
New commits:
commit 1f9297e7a011004d578e1f503d9d710c20c0ef0e
Author: Noel Grandin <noel at peralex.com>
Date: Wed Dec 17 11:36:51 2014 +0200
java: unused import
Change-Id: I5e753737a0dfd024da4ce076645a4ddc2e7550e0
diff --git a/qadevOOo/runner/helper/ProcessHandler.java b/qadevOOo/runner/helper/ProcessHandler.java
index 4496241..1be600d 100644
--- a/qadevOOo/runner/helper/ProcessHandler.java
+++ b/qadevOOo/runner/helper/ProcessHandler.java
@@ -17,7 +17,6 @@
*/
package helper;
-import java.io.BufferedReader;
import java.io.InputStream;
import java.io.File;
import java.io.PrintWriter;
commit 2d82619a528ebdf867f242c85ad626462609ba39
Author: Noel Grandin <noel at peralex.com>
Date: Wed Dec 17 11:35:04 2014 +0200
java: static fields that should not be static
Found by FindBugs.
Change-Id: I223841f7bb8c515c9612322abc0b13e134385abd
diff --git a/connectivity/qa/complex/connectivity/DBaseDriverTest.java b/connectivity/qa/complex/connectivity/DBaseDriverTest.java
index 6afada8..7749fde 100644
--- a/connectivity/qa/complex/connectivity/DBaseDriverTest.java
+++ b/connectivity/qa/complex/connectivity/DBaseDriverTest.java
@@ -50,7 +50,7 @@ public class DBaseDriverTest extends ComplexTestCase implements TestCase
public LogWriter getLog()
{
- return ComplexTestCase.log;
+ return log;
}
public void Functions() throws com.sun.star.uno.Exception, com.sun.star.beans.UnknownPropertyException
diff --git a/filter/qa/complex/filter/misc/FinalizedMandatoryTest.java b/filter/qa/complex/filter/misc/FinalizedMandatoryTest.java
index 92f91df..f0c04b6 100644
--- a/filter/qa/complex/filter/misc/FinalizedMandatoryTest.java
+++ b/filter/qa/complex/filter/misc/FinalizedMandatoryTest.java
@@ -71,7 +71,7 @@ import static org.junit.Assert.*;
public class FinalizedMandatoryTest
{
- static XMultiServiceFactory xMSF;
+ XMultiServiceFactory xMSF;
/** Create the environment for following tests.
* Use either a component loader from desktop or
diff --git a/filter/qa/complex/filter/misc/TypeDetection6FileFormat.java b/filter/qa/complex/filter/misc/TypeDetection6FileFormat.java
index 8d76aaa..75903c0 100644
--- a/filter/qa/complex/filter/misc/TypeDetection6FileFormat.java
+++ b/filter/qa/complex/filter/misc/TypeDetection6FileFormat.java
@@ -35,7 +35,7 @@ import static org.junit.Assert.*;
public class TypeDetection6FileFormat
{
- static XMultiServiceFactory xMSF;
+ XMultiServiceFactory xMSF;
/** Create the environment for following tests.
* Use either a component loader from desktop or
diff --git a/framework/qa/complex/api_internal/CheckAPI.java b/framework/qa/complex/api_internal/CheckAPI.java
index e3ffa8b..dfc7754 100644
--- a/framework/qa/complex/api_internal/CheckAPI.java
+++ b/framework/qa/complex/api_internal/CheckAPI.java
@@ -50,7 +50,7 @@ public class CheckAPI {
/**
* The test parameters
*/
- private static TestParameters param = null;
+ private TestParameters param = null;
/**
*
diff --git a/framework/qa/complex/imageManager/CheckImageManager.java b/framework/qa/complex/imageManager/CheckImageManager.java
index 6495f79..0efb6ed 100644
--- a/framework/qa/complex/imageManager/CheckImageManager.java
+++ b/framework/qa/complex/imageManager/CheckImageManager.java
@@ -49,7 +49,7 @@ public class CheckImageManager {
/**
* The test parameters
*/
- private static TestParameters param = null;
+ private TestParameters param = null;
@Before public void before()
{
diff --git a/framework/qa/complex/imageManager/_XComponent.java b/framework/qa/complex/imageManager/_XComponent.java
index 8b7cdb5..e5a3ea9 100644
--- a/framework/qa/complex/imageManager/_XComponent.java
+++ b/framework/qa/complex/imageManager/_XComponent.java
@@ -38,7 +38,7 @@ import lib.TestParameters;
*/
public class _XComponent {
- private static XComponent oObj = null;
+ private XComponent oObj = null;
private XComponent altDispose = null;
private final TestParameters tEnv;
private boolean listenerDisposed[] = new boolean[2];
@@ -66,7 +66,7 @@ public class _XComponent {
public _XComponent(TestParameters tEnv, XComponent oObj) {
this.tEnv = tEnv;
- _XComponent.oObj = oObj;
+ this.oObj = oObj;
}
/**
@@ -115,7 +115,7 @@ public class _XComponent {
return true;
} // finished _removeEventListener()
- private static boolean disposed = false;
+ private boolean disposed = false;
/**
* Disposes the object and then check appropriate listeners were
diff --git a/framework/qa/complex/imageManager/_XInitialization.java b/framework/qa/complex/imageManager/_XInitialization.java
index 14cab34..5a55657 100644
--- a/framework/qa/complex/imageManager/_XInitialization.java
+++ b/framework/qa/complex/imageManager/_XInitialization.java
@@ -41,12 +41,12 @@ public class _XInitialization {
private final TestParameters tEnv;
- private static XInitialization oObj = null;
+ private XInitialization oObj = null;
public _XInitialization(TestParameters tEnv, XInitialization oObj) {
this.tEnv = tEnv;
- _XInitialization.oObj = oObj;
+ this.oObj = oObj;
}
/**
diff --git a/framework/qa/complex/imageManager/_XTypeProvider.java b/framework/qa/complex/imageManager/_XTypeProvider.java
index 4af3a74..0e5e9e6 100644
--- a/framework/qa/complex/imageManager/_XTypeProvider.java
+++ b/framework/qa/complex/imageManager/_XTypeProvider.java
@@ -38,11 +38,10 @@ public class _XTypeProvider {
- private static XTypeProvider oObj = null;
- private static Type[] types = null;
+ private XTypeProvider oObj = null;
public _XTypeProvider(TestParameters tEnv, XTypeProvider oObj) {
- _XTypeProvider.oObj = oObj;
+ this.oObj = oObj;
}
/**
@@ -69,7 +68,7 @@ public class _XTypeProvider {
public boolean _getTypes() {
boolean result = false;
System.out.println("getting Types...");
- types = oObj.getTypes();
+ Type[] types = oObj.getTypes();
for (int i=0;i<types.length;i++) {
int k = i+1;
System.out.println(k+". Type is "+types[i].toString());
diff --git a/framework/qa/complex/path_substitution/PathSubstitutionTest.java b/framework/qa/complex/path_substitution/PathSubstitutionTest.java
index 152ee4d..ff331392 100644
--- a/framework/qa/complex/path_substitution/PathSubstitutionTest.java
+++ b/framework/qa/complex/path_substitution/PathSubstitutionTest.java
@@ -38,7 +38,7 @@ import com.sun.star.util.XStringSubstitution;
public class PathSubstitutionTest
{
- private static XMultiServiceFactory xMSF;
+ private XMultiServiceFactory xMSF;
// all substitution variables
private VariableContainer substVars = null;
diff --git a/qadevOOo/runner/base/java_fat.java b/qadevOOo/runner/base/java_fat.java
index 04f159a..c9891d4 100644
--- a/qadevOOo/runner/base/java_fat.java
+++ b/qadevOOo/runner/base/java_fat.java
@@ -45,10 +45,10 @@ import com.sun.star.lang.XMultiServiceFactory;
public class java_fat implements TestBase
{
- private static boolean m_isDebug = false;
- private static boolean keepdocument = false;
- private static boolean logging = true;
- private static boolean newOffice = false;
+ private boolean m_isDebug = false;
+ private boolean keepdocument = false;
+ private boolean logging = true;
+ private boolean newOffice = false;
private DynamicClassLoader m_aDynamicClassLoader = null;
private lib.TestParameters m_aParams;
diff --git a/qadevOOo/runner/complexlib/ComplexTestCase.java b/qadevOOo/runner/complexlib/ComplexTestCase.java
index 2486692..3e94074 100644
--- a/qadevOOo/runner/complexlib/ComplexTestCase.java
+++ b/qadevOOo/runner/complexlib/ComplexTestCase.java
@@ -32,9 +32,9 @@ public abstract class ComplexTestCase extends Assurance implements ComplexTest
{
/** The test parameters **/
- protected static TestParameters param = null;
+ protected TestParameters param = null;
/** Log writer **/
- protected static LogWriter log = null;
+ protected LogWriter log = null;
/**
* The method name which will be written into f.e. the data base
**/
diff --git a/qadevOOo/runner/stats/InternalLogWriter.java b/qadevOOo/runner/stats/InternalLogWriter.java
index d9a0a2d..a39e372 100644
--- a/qadevOOo/runner/stats/InternalLogWriter.java
+++ b/qadevOOo/runner/stats/InternalLogWriter.java
@@ -24,18 +24,18 @@ import java.io.StringWriter;
* Write all logs into a java.io.PrintWriter, i.e. a StringBuffer.
* Log is gathered there.
*/
-public class InternalLogWriter extends PrintWriter
- implements share.LogWriter {
+public class InternalLogWriter implements share.LogWriter {
/** log active **/
private boolean active;
/** write all output to a StringBuffer **/
- private static StringWriter writer = new StringWriter();
+ private StringWriter writer = new StringWriter();
+ private PrintWriter printWriter;
/**
* c'*tor
*/
public InternalLogWriter() {
- super(new PrintWriter(writer));
+ printWriter = new PrintWriter(writer);
active = true;
}
@@ -54,21 +54,9 @@ public class InternalLogWriter extends PrintWriter
* Method to print a line that is added to the StringBuffer.
* @param msg The message that is printed.
*/
- @Override
public void println(String msg) {
if (active)
- super.println(msg);
- }
-
- /**
- * Method to print to the StringBuffer.
- * @param msg The message that is printed.
- */
- @Override
- public void print(String msg) {
- if (active)
- super.print(msg);
-
+ printWriter.println(msg);
}
/**
@@ -80,17 +68,17 @@ public class InternalLogWriter extends PrintWriter
public boolean summary(share.DescEntry entry) {
// linePrefix = "";
String header = "***** State for "+entry.longName+" ******";
- println(header);
+ printWriter.println(header);
if (entry.hasErrorMsg) {
- println(entry.ErrorMsg);
- println("Whole "+entry.EntryType+": "+entry.State);
+ printWriter.println(entry.ErrorMsg);
+ printWriter.println("Whole "+entry.EntryType+": "+entry.State);
} else {
- println("Whole "+entry.EntryType+": "+entry.State);
+ printWriter.println("Whole "+entry.EntryType+": "+entry.State);
}
for (int i=0;i<header.length();i++) {
- print("*");
+ printWriter.print("*");
}
- println("");
+ printWriter.println("");
return true;
}
diff --git a/qadevOOo/tests/java/ifc/document/_XEventBroadcaster.java b/qadevOOo/tests/java/ifc/document/_XEventBroadcaster.java
index 02c41b5..b2b3ff3 100644
--- a/qadevOOo/tests/java/ifc/document/_XEventBroadcaster.java
+++ b/qadevOOo/tests/java/ifc/document/_XEventBroadcaster.java
@@ -29,8 +29,8 @@ import com.sun.star.uno.UnoRuntime;
public class _XEventBroadcaster extends MultiMethodTest {
public XEventBroadcaster oObj;
- protected static boolean listenerCalled=false;
- private static XEventListener listener=null;
+ protected boolean listenerCalled = false;
+ private XEventListener listener = null;
public class MyEventListener implements XEventListener {
diff --git a/qadevOOo/tests/java/ifc/lang/_XComponent.java b/qadevOOo/tests/java/ifc/lang/_XComponent.java
index 184f6cc..c05b7c5 100644
--- a/qadevOOo/tests/java/ifc/lang/_XComponent.java
+++ b/qadevOOo/tests/java/ifc/lang/_XComponent.java
@@ -113,7 +113,7 @@ public class _XComponent extends MultiMethodTest {
log.println(Thread.currentThread() + " is removing EL " + listener2);
} // finished _removeEventListener()
- static boolean disposed = false;
+ boolean disposed = false;
/**
* Disposes the object and then check appropriate listeners were
diff --git a/qadevOOo/tests/java/ifc/linguistic2/_XAvailableLocales.java b/qadevOOo/tests/java/ifc/linguistic2/_XAvailableLocales.java
index 41f093f..0fb7e4f 100644
--- a/qadevOOo/tests/java/ifc/linguistic2/_XAvailableLocales.java
+++ b/qadevOOo/tests/java/ifc/linguistic2/_XAvailableLocales.java
@@ -33,14 +33,13 @@ import lib.MultiMethodTest;
public class _XAvailableLocales extends MultiMethodTest {
public XAvailableLocales oObj = null;
- public static Locale[] locales = new Locale[0];
/**
* Test calls the method, stores returned value and checks it. <p>
* Has <b> OK </b> status if length of returned array isn't zero. <p>
*/
public void _getAvailableLocales() {
- locales = oObj.getAvailableLocales("com.sun.star.linguistic2.Hyphenator");
+ Locale[] locales = oObj.getAvailableLocales("com.sun.star.linguistic2.Hyphenator");
tRes.tested("getAvailableLocales()", locales.length > 0);
}
diff --git a/qadevOOo/tests/java/ifc/linguistic2/_XSupportedLocales.java b/qadevOOo/tests/java/ifc/linguistic2/_XSupportedLocales.java
index b70eecf..269e07c 100644
--- a/qadevOOo/tests/java/ifc/linguistic2/_XSupportedLocales.java
+++ b/qadevOOo/tests/java/ifc/linguistic2/_XSupportedLocales.java
@@ -35,7 +35,7 @@ import com.sun.star.linguistic2.XSupportedLocales;
public class _XSupportedLocales extends MultiMethodTest {
public XSupportedLocales oObj = null;
- public static Locale[] locales = new Locale[0];
+ public Locale[] locales = new Locale[0];
/**
* Test calls the method, stores returned value and checks it. <p>
diff --git a/qadevOOo/tests/java/ifc/table/_XCellCursor.java b/qadevOOo/tests/java/ifc/table/_XCellCursor.java
index 9c2591f..a01c466 100644
--- a/qadevOOo/tests/java/ifc/table/_XCellCursor.java
+++ b/qadevOOo/tests/java/ifc/table/_XCellCursor.java
@@ -54,8 +54,7 @@ import com.sun.star.uno.UnoRuntime;
*/
public class _XCellCursor extends MultiMethodTest {
- public static XCellCursor oObj = null;
- public static XSpreadsheet oSheet = null;
+ public XCellCursor oObj = null;
/**
* <code>XCellRangeAddressable</code> interface is queried
@@ -174,7 +173,7 @@ public class _XCellCursor extends MultiMethodTest {
*/
public void _gotoEnd(){
//gotoEnd gets it's own cursor to see a change
- oSheet = (XSpreadsheet) tEnv.getObjRelation("SHEET");
+ XSpreadsheet oSheet = (XSpreadsheet) tEnv.getObjRelation("SHEET");
XCellRange testRange = oSheet.getCellRangeByName("$A$1:$g$7") ;
XSheetCellRange testSheetRange = UnoRuntime.queryInterface(XSheetCellRange.class,testRange);
XSheetCellCursor oCellCursor = oSheet.createCursorByRange
diff --git a/qadevOOo/tests/java/ifc/text/_NumberingLevel.java b/qadevOOo/tests/java/ifc/text/_NumberingLevel.java
index bc9a594..a23c7fb 100644
--- a/qadevOOo/tests/java/ifc/text/_NumberingLevel.java
+++ b/qadevOOo/tests/java/ifc/text/_NumberingLevel.java
@@ -64,9 +64,9 @@ import com.sun.star.beans.PropertyValue;
*/
public class _NumberingLevel {
- private static HashMap<String, Boolean> NumberingLevel = new HashMap<String,Boolean>();
- private static PropertyValue[] PropertyArray = null;
- private static LogWriter log = null;
+ private HashMap<String, Boolean> NumberingLevel = new HashMap<String,Boolean>();
+ private PropertyValue[] PropertyArray = null;
+ private LogWriter log = null;
/**
@@ -77,9 +77,9 @@ public class _NumberingLevel {
*/
public _NumberingLevel(LogWriter log, TestParameters tParam, PropertyValue[] propertyValues){
- _NumberingLevel.PropertyArray = propertyValues;
+ this.PropertyArray = propertyValues;
- _NumberingLevel.log = log;
+ this.log = log;
//key = PropertyName, value = Ooptional
NumberingLevel.put("Adjust", Boolean.FALSE);
diff --git a/qadevOOo/tests/java/mod/_acceptor/Acceptor.java b/qadevOOo/tests/java/mod/_acceptor/Acceptor.java
index 67c4794..11b1a65 100644
--- a/qadevOOo/tests/java/mod/_acceptor/Acceptor.java
+++ b/qadevOOo/tests/java/mod/_acceptor/Acceptor.java
@@ -45,7 +45,7 @@ public class Acceptor extends TestCase {
*/
protected static final int basePort = 10000;
private int curPort ;
- private static String sOfficeHost = null ;
+ private String sOfficeHost = null ;
/**
* Retrieves host name where StarOffice is started from test
diff --git a/ucb/qa/complex/tdoc/_XComponent.java b/ucb/qa/complex/tdoc/_XComponent.java
index 13958ec..582b0d6 100644
--- a/ucb/qa/complex/tdoc/_XComponent.java
+++ b/ucb/qa/complex/tdoc/_XComponent.java
@@ -110,7 +110,7 @@ public class _XComponent {
return true;
} // finished _removeEventListener()
- private static boolean disposed = false;
+ private boolean disposed = false;
/**
* Disposes the object and then check appropriate listeners were
diff --git a/unoxml/qa/complex/unoxml/RDFRepositoryTest.java b/unoxml/qa/complex/unoxml/RDFRepositoryTest.java
index 754c21b..ba2bdfd 100644
--- a/unoxml/qa/complex/unoxml/RDFRepositoryTest.java
+++ b/unoxml/qa/complex/unoxml/RDFRepositoryTest.java
@@ -75,7 +75,7 @@ public class RDFRepositoryTest
/**
* The test parameters
*/
- private static TestParameters param = null;
+ private TestParameters param = null;
@Before public void before()
{
diff --git a/vcl/qa/complex/memCheck/CheckMemoryUsage.java b/vcl/qa/complex/memCheck/CheckMemoryUsage.java
index 8d53afb..c37a017 100644
--- a/vcl/qa/complex/memCheck/CheckMemoryUsage.java
+++ b/vcl/qa/complex/memCheck/CheckMemoryUsage.java
@@ -103,7 +103,7 @@ public class CheckMemoryUsage
/**
* The test parameters
*/
- private static TestParameters param = null;
+ private TestParameters param = null;
/**
* Collect all documents to load and all filters used for export.
diff --git a/wizards/com/sun/star/wizards/report/Dataimport.java b/wizards/com/sun/star/wizards/report/Dataimport.java
index 329dcea..17eb4c0 100644
--- a/wizards/com/sun/star/wizards/report/Dataimport.java
+++ b/wizards/com/sun/star/wizards/report/Dataimport.java
@@ -34,10 +34,10 @@ public class Dataimport extends UnoDialog2 implements com.sun.star.awt.XActionLi
// ReportTextDocument CurReportDocument;
IReportDocument CurReportDocument;
- private static String sProgressDBConnection;
- private static String sProgressDataImport;
- private static String sProgressTitle;
- private static String sStop;
+ private String sProgressDBConnection;
+ private String sProgressDataImport;
+ private String sProgressTitle;
+ private String sStop;
public Dataimport(XMultiServiceFactory _xMSF)
{
commit 0ae24c2189ea68576c96fcbe87299b51256cb468
Author: Noel Grandin <noel at peralex.com>
Date: Wed Dec 17 11:15:15 2014 +0200
java: fix access to always null field
this cannot have ever worked, but at least it'll stop bugging me now
Change-Id: Idd9738358d18770258ca0648afe4b9256458a4d6
diff --git a/toolkit/test/accessibility/TextLogger.java b/toolkit/test/accessibility/TextLogger.java
index fde7488..952d140 100644
--- a/toolkit/test/accessibility/TextLogger.java
+++ b/toolkit/test/accessibility/TextLogger.java
@@ -19,7 +19,6 @@
import javax.swing.JEditorPane;
import javax.swing.event.HyperlinkListener;
import javax.swing.event.HyperlinkEvent;
-import javax.swing.text.Document;
class TextLogger
extends JEditorPane
@@ -52,11 +51,9 @@ class TextLogger
{
try
{
- maDocument.insertString (maDocument.getLength(), sText, null);
+ getDocument().insertString (getDocument().getLength(), sText, null);
}
catch (javax.swing.text.BadLocationException e)
{}
}
-
- private Document maDocument;
}
commit ce3e78b6a0add1e1d2c3b5ca8ebca643d9c232d0
Author: Noel Grandin <noel at peralex.com>
Date: Wed Dec 17 11:12:02 2014 +0200
java: dead code
Change-Id: Ief2bf7d3e98186a2268b873c4c5f7114057bd10f
diff --git a/qadevOOo/runner/helper/ProcessHandler.java b/qadevOOo/runner/helper/ProcessHandler.java
index 0057e89..4496241 100644
--- a/qadevOOo/runner/helper/ProcessHandler.java
+++ b/qadevOOo/runner/helper/ProcessHandler.java
@@ -129,7 +129,6 @@ public class ProcessHandler
private boolean bUseOutput = true;
private int m_nProcessTimeout = 0;
- private String m_sProcessKiller;
private ProcessWatcher m_aWatcher;
/**
@@ -645,13 +644,11 @@ public class ProcessHandler
{
private int m_nTimeoutInSec;
- private final String m_sProcessToStart;
private final boolean m_bInterrupt;
- private ProcessWatcher(int _nTimeOut, String _sProcess)
+ private ProcessWatcher(int _nTimeOut)
{
m_nTimeoutInSec = _nTimeOut;
- m_sProcessToStart = _sProcess;
m_bInterrupt = false;
}
@@ -681,55 +678,8 @@ public class ProcessHandler
break;
}
}
- if (m_nTimeoutInSec <= 0 && !isInHoldOn()) // not zero, so we are interrupted.
- {
- system(m_sProcessToStart);
- }
}
- /**
- * Start an external Process
- * @param _sProcess
- */
- private void system(String _sProcess)
- {
- if (_sProcess == null)
- {
- return;
- }
-
- try
- {
-
- // run a _sProcess command
- // using the Runtime exec method:
- Process p = Runtime.getRuntime().exec(_sProcess);
-
- BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream()));
-
- BufferedReader stdError = new BufferedReader(new InputStreamReader(p.getErrorStream()));
-
- // read the output from the command
- String s;
- while ((s = stdInput.readLine()) != null)
- {
- System.out.println("out:" + s);
- }
-
- // read any errors from the attempted command
- while ((s = stdError.readLine()) != null)
- {
- System.out.println("err:" + s);
- }
-
- }
- catch (java.io.IOException e)
- {
- System.out.println("exception caught: ");
- e.printStackTrace();
- }
-
- }
}
/**
@@ -742,7 +692,7 @@ public class ProcessHandler
{
if (m_nProcessTimeout != 0)
{
- m_aWatcher = new ProcessWatcher(m_nProcessTimeout, m_sProcessKiller);
+ m_aWatcher = new ProcessWatcher(m_nProcessTimeout);
m_aWatcher.start();
}
}
commit 35da4ec559ac29d51db88661ff0712b7782ade0b
Author: Noel Grandin <noel at peralex.com>
Date: Wed Dec 17 11:09:10 2014 +0200
java: unused imports
Change-Id: I7866959b9ea36c81003259cd387a001e9f34f26a
diff --git a/bridges/test/java_uno/equals/TestEquals.java b/bridges/test/java_uno/equals/TestEquals.java
index b776519..5b9cbec 100644
--- a/bridges/test/java_uno/equals/TestEquals.java
+++ b/bridges/test/java_uno/equals/TestEquals.java
@@ -24,7 +24,6 @@ import java.util.HashMap;
import test.lib.TestBed;
-import com.sun.star.bridge.XBridge;
import com.sun.star.bridge.XBridgeFactory;
import com.sun.star.bridge.XInstanceProvider;
import com.sun.star.comp.helper.Bootstrap;
diff --git a/qadevOOo/tests/java/mod/_remotebridge/uno/various.java b/qadevOOo/tests/java/mod/_remotebridge/uno/various.java
index 38367978..378a89d 100644
--- a/qadevOOo/tests/java/mod/_remotebridge/uno/various.java
+++ b/qadevOOo/tests/java/mod/_remotebridge/uno/various.java
@@ -25,7 +25,6 @@ import com.sun.star.connection.XConnection;
import com.sun.star.connection.XConnector;
import com.sun.star.lang.XComponent;
import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.uno.Exception;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XInterface;
import java.io.PrintWriter;
diff --git a/qadevOOo/tests/java/mod/_remotebridge/various.java b/qadevOOo/tests/java/mod/_remotebridge/various.java
index 2dc605f..0cd56a5 100644
--- a/qadevOOo/tests/java/mod/_remotebridge/various.java
+++ b/qadevOOo/tests/java/mod/_remotebridge/various.java
@@ -32,7 +32,6 @@ import com.sun.star.connection.XConnection;
import com.sun.star.connection.XConnector;
import com.sun.star.lang.XComponent;
import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.uno.Exception;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XInterface;
commit e747737ad36f4ed0f89d2f01b278e250daea1a04
Author: Noel Grandin <noel at peralex.com>
Date: Wed Dec 17 11:08:26 2014 +0200
java: synching on an interned String object not good
Just remove this field altogether, it was not being used for
anything other than synchronisation.
Change-Id: I982385f9eb7aed3fff0adf85d2a37bfe003d937b
diff --git a/qadevOOo/runner/helper/ProcessHandler.java b/qadevOOo/runner/helper/ProcessHandler.java
index 9105a86..0057e89 100644
--- a/qadevOOo/runner/helper/ProcessHandler.java
+++ b/qadevOOo/runner/helper/ProcessHandler.java
@@ -120,7 +120,6 @@ public class ProcessHandler
private boolean isFinished = false;
private boolean isStarted = false;
private long mTimeOut = 0;
- private String stdInBuff = "";
private Pump stdout = null;
private Pump stderr = null;
private PrintStream stdIn = null;
@@ -546,11 +545,9 @@ public class ProcessHandler
return;
}
- synchronized(stdInBuff)
+ synchronized(this)
{
- stdIn.print(stdInBuff);
stdIn.flush();
- stdInBuff = "";
}
}
commit 52d844485820c8bd1db8e15ce06ab6c76a8b6156
Author: Noel Grandin <noel at peralex.com>
Date: Wed Dec 17 11:05:24 2014 +0200
java: synching on a global object is not very useful
when you're using it as a local lock
Change-Id: Ie7f42176f7b582c6dad426d9f8eb0a846a3519c2
diff --git a/toolkit/test/accessibility/EventQueue.java b/toolkit/test/accessibility/EventQueue.java
index 8449c64..8489426 100644
--- a/toolkit/test/accessibility/EventQueue.java
+++ b/toolkit/test/accessibility/EventQueue.java
@@ -66,7 +66,6 @@ class EventQueue
private EventQueue ()
{
- maMonitor = Boolean.TRUE;
maRegularQueue = new LinkedList<Runnable>();
maDisposingQueue = new LinkedList<Runnable>();
new Thread(this, "AWB.EventQueue").start();
@@ -133,7 +132,7 @@ class EventQueue
}
private static EventQueue maInstance = null;
- private final Object maMonitor;
+ private final Object maMonitor = new Object();
private final LinkedList<Runnable> maRegularQueue;
private final LinkedList<Runnable> maDisposingQueue;
}
commit 567592c9e24075173a6f396b81bff14f74596f83
Author: Noel Grandin <noel at peralex.com>
Date: Wed Dec 17 11:04:04 2014 +0200
java: don't synch on an object and also assign to it
Change-Id: Ie0a098e935e640f10b77d259c96bbd1c604d701e
diff --git a/forms/qa/integration/forms/TableCellTextBinding.java b/forms/qa/integration/forms/TableCellTextBinding.java
index 7064960..7f745a8 100644
--- a/forms/qa/integration/forms/TableCellTextBinding.java
+++ b/forms/qa/integration/forms/TableCellTextBinding.java
@@ -102,14 +102,11 @@ public class TableCellTextBinding
throw new com.sun.star.form.binding.IncompatibleTypesException();
}
// remember the new text
- synchronized( m_newCellText )
- {
- m_newCellText = text;
- m_haveNewCellText = true;
- }
// and wake up the thread which is waiting for it
synchronized( m_writeSignal )
{
+ m_newCellText = text;
+ m_haveNewCellText = true;
m_writeSignal.notify();
}
}
@@ -142,11 +139,7 @@ public class TableCellTextBinding
synchronized( m_writeSignal )
{
m_writeSignal.wait( 200 );
- }
-
- // if there's new text in the control, propagate it to the cell
- synchronized ( m_newCellText )
- {
+ // if there's new text in the control, propagate it to the cell
if ( m_haveNewCellText )
{
m_cellText.setString( m_newCellText );
commit 41f4417ba4ebbb29c614ad4ac1198efce709f495
Author: Noel Grandin <noel at peralex.com>
Date: Wed Dec 17 11:01:38 2014 +0200
java: dodgy synchronisation around clear
if we want to synchronize access to this datastructure, and we want
to use it as a lock object, creating a new one is not a good idea
Change-Id: I99c2f665242ef16611bc15a0690b8da222085efb
diff --git a/toolkit/test/accessibility/NodeHandler.java b/toolkit/test/accessibility/NodeHandler.java
index 73a36aa..a172be7 100644
--- a/toolkit/test/accessibility/NodeHandler.java
+++ b/toolkit/test/accessibility/NodeHandler.java
@@ -43,7 +43,7 @@ abstract class NodeHandler
{
synchronized (maChildList)
{
- maChildList = new Vector<AccessibleTreeNode> ();
+ maChildList.clear();
}
}
commit 126eea88e615f3fcc82e081a3dbc7cb85154e575
Author: Noel Grandin <noel at peralex.com>
Date: Wed Dec 17 11:00:10 2014 +0200
java: nlpsolver: getPropertyByName was checking the wrong datastructure
Found by PMD
Change-Id: I76d38d71a3379416fe7e5078ef8b121915b26b6b
diff --git a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java
index 1e91448..30b8392 100644
--- a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java
+++ b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/BaseNLPSolver.java
@@ -460,7 +460,7 @@ public abstract class BaseNLPSolver extends WeakBase
}
public boolean hasPropertyByName(String property) {
- return m_properties.contains(property);
+ return m_propertyMap.containsKey(property);
}
// <editor-fold defaultstate="collapsed" desc="Helper functions">
commit cba3956750eebc4a5e2c8f8c7cb48764df18b3cb
Author: Noel Grandin <noel at peralex.com>
Date: Wed Dec 17 10:48:31 2014 +0200
java: this does not need to be a Thread
It is just being used as a Runnable
Change-Id: I1e652ab0f3b0450d3a85384b9dd513419e2f8046
diff --git a/framework/qa/complex/XUserInputInterception/EventTest.java b/framework/qa/complex/XUserInputInterception/EventTest.java
index 9737bbe..e8462b4 100644
--- a/framework/qa/complex/XUserInputInterception/EventTest.java
+++ b/framework/qa/complex/XUserInputInterception/EventTest.java
@@ -400,7 +400,7 @@ public class EventTest {
* press a key with the <CODE>Robot</CODE> class
* @see java.awt.Robot
*/
- private class EventTrigger extends Thread{
+ private class EventTrigger implements Runnable {
/**
* represents an <CODE>EventType</CODE>
@@ -439,7 +439,6 @@ public class EventTest {
* </LI>
* </UL>
*/
- @Override
public void run(){
switch (this.eventType){
diff --git a/qadevOOo/tests/java/ifc/awt/_XUserInputInterception.java b/qadevOOo/tests/java/ifc/awt/_XUserInputInterception.java
index 976c8f4..557abd5 100644
--- a/qadevOOo/tests/java/ifc/awt/_XUserInputInterception.java
+++ b/qadevOOo/tests/java/ifc/awt/_XUserInputInterception.java
@@ -395,7 +395,7 @@ public class _XUserInputInterception extends MultiMethodTest {
* press a key with the <CODE>Robot</CODE> class
* @see java.awt.Robot
*/
- private class EventTrigger extends Thread{
+ private class EventTrigger implements Runnable {
/**
* represents an <CODE>EventType</CODE>
@@ -434,7 +434,6 @@ public class _XUserInputInterception extends MultiMethodTest {
* </LI>
* </UL>
*/
- @Override
public void run(){
switch (this.eventType){
commit e92d3e90075573a374bfc39449c0e74f518890ba
Author: Noel Grandin <noel at peralex.com>
Date: Wed Dec 17 10:43:11 2014 +0200
java: scripting: fix bug in removing model from map
found by PMD
Change-Id: I4bd35dd30f6c77aad96932216d8459b812004a88
diff --git a/scripting/java/com/sun/star/script/framework/io/XStorageHelper.java b/scripting/java/com/sun/star/script/framework/io/XStorageHelper.java
index 0856e6d..7123ca5 100644
--- a/scripting/java/com/sun/star/script/framework/io/XStorageHelper.java
+++ b/scripting/java/com/sun/star/script/framework/io/XStorageHelper.java
@@ -181,7 +181,7 @@ public class XStorageHelper implements XEventListener {
if (model != null) {
LogUtils.DEBUG(" Disposing doc " + model.getURL());
- modelMap.remove(model);
+ modelMap.remove(PathUtils.getOidForModel(model));
}
}
commit 3090d96f73714d5f2cc151e94a202010b5e96cf3
Author: Noel Grandin <noel at peralex.com>
Date: Wed Dec 17 10:38:54 2014 +0200
xmerge: store the original exception in the cause field properly
Change-Id: I154b8b80aabd824edc62a7fdd831074fcf5cb21b
diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/OfficeDocumentException.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/OfficeDocumentException.java
index 89f9149..1279906 100644
--- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/OfficeDocumentException.java
+++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/OfficeDocumentException.java
@@ -33,16 +33,22 @@ import org.openoffice.xmerge.util.Resources;
*/
public final class OfficeDocumentException extends IOException {
- private StringBuffer message = null;
-
/**
* Constructor, capturing additional information from the {@code SAXException}.
*
* @param e The {@code SAXException}.
*/
public OfficeDocumentException(SAXException e) {
- super(e.toString());
- message = new StringBuffer();
+ super(constructMessage(e));
+ if (e.getException() != null) {
+ initCause(e.getException());
+ } else {
+ initCause(e);
+ }
+ }
+
+ private static String constructMessage(SAXException e) {
+ StringBuffer message = new StringBuffer();
if (e instanceof SAXParseException) {
String msgParseError =
Resources.getInstance().getString("PARSE_ERROR");
@@ -80,6 +86,7 @@ public final class OfficeDocumentException extends IOException {
if (ex != null) {
message.append(ex.getMessage());
}
+ return message.toString();
}
/**
@@ -99,15 +106,7 @@ public final class OfficeDocumentException extends IOException {
*/
public OfficeDocumentException(Exception e) {
super(e.getMessage());
+ initCause(e);
}
- /**
- * Returns the message value for the {@code Exception}.
- *
- * @return The message value for the {@code Exception}.
- */
- @Override
- public String getMessage() {
- return message.toString() + super.getMessage();
- }
}
\ No newline at end of file
commit a96c308e52983b7bc0275e31e50a9b04e5805852
Author: Noel Grandin <noel at peralex.com>
Date: Wed Dec 17 10:33:26 2014 +0200
java: these fields can be converted to local variables
Change-Id: Ifefb5de196a3e5cbaa8945759da42886c69daacf
diff --git a/bean/com/sun/star/comp/beans/OOoBean.java b/bean/com/sun/star/comp/beans/OOoBean.java
index 964ff80..36d622d 100644
--- a/bean/com/sun/star/comp/beans/OOoBean.java
+++ b/bean/com/sun/star/comp/beans/OOoBean.java
@@ -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 )
diff --git a/qadevOOo/runner/util/db/DatabaseDocument.java b/qadevOOo/runner/util/db/DatabaseDocument.java
index 8ad6d77..f9c4913 100644
--- a/qadevOOo/runner/util/db/DatabaseDocument.java
+++ b/qadevOOo/runner/util/db/DatabaseDocument.java
@@ -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;
diff --git a/wizards/com/sun/star/wizards/common/Resource.java b/wizards/com/sun/star/wizards/common/Resource.java
index f438190..1715fb23 100644
--- a/wizards/com/sun/star/wizards/common/Resource.java
+++ b/wizards/com/sun/star/wizards/common/Resource.java
@@ -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);
}
}
diff --git a/wizards/com/sun/star/wizards/db/QueryMetaData.java b/wizards/com/sun/star/wizards/db/QueryMetaData.java
index 4cb4bcd..1286c9f 100644
--- a/wizards/com/sun/star/wizards/db/QueryMetaData.java
+++ b/wizards/com/sun/star/wizards/db/QueryMetaData.java
@@ -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()
diff --git a/wizards/com/sun/star/wizards/db/TypeInspector.java b/wizards/com/sun/star/wizards/db/TypeInspector.java
index b51a3ff..b888659 100644
--- a/wizards/com/sun/star/wizards/db/TypeInspector.java
+++ b/wizards/com/sun/star/wizards/db/TypeInspector.java
@@ -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)));
diff --git a/wizards/com/sun/star/wizards/document/Control.java b/wizards/com/sun/star/wizards/document/Control.java
index ae26efe..448b84f 100644
--- a/wizards/com/sun/star/wizards/document/Control.java
+++ b/wizards/com/sun/star/wizards/document/Control.java
@@ -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 );
diff --git a/wizards/com/sun/star/wizards/document/FormHandler.java b/wizards/com/sun/star/wizards/document/FormHandler.java
index 86243bf..a8b02d3 100644
--- a/wizards/com/sun/star/wizards/document/FormHandler.java
+++ b/wizards/com/sun/star/wizards/document/FormHandler.java
@@ -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);
}
diff --git a/wizards/com/sun/star/wizards/document/GridControl.java b/wizards/com/sun/star/wizards/document/GridControl.java
index 359b1aa..4b8f98d 100644
--- a/wizards/com/sun/star/wizards/document/GridControl.java
+++ b/wizards/com/sun/star/wizards/document/GridControl.java
@@ -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);
diff --git a/wizards/com/sun/star/wizards/document/TimeStampControl.java b/wizards/com/sun/star/wizards/document/TimeStampControl.java
index ed5a30b..d777375 100644
--- a/wizards/com/sun/star/wizards/document/TimeStampControl.java
+++ b/wizards/com/sun/star/wizards/document/TimeStampControl.java
@@ -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);
diff --git a/wizards/com/sun/star/wizards/form/Finalizer.java b/wizards/com/sun/star/wizards/form/Finalizer.java
index 557814a..ef2541d 100644
--- a/wizards/com/sun/star/wizards/form/Finalizer.java
+++ b/wizards/com/sun/star/wizards/form/Finalizer.java
@@ -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);
diff --git a/wizards/com/sun/star/wizards/form/FormConfiguration.java b/wizards/com/sun/star/wizards/form/FormConfiguration.java
index e39f3cf..dbdaa62 100644
--- a/wizards/com/sun/star/wizards/form/FormConfiguration.java
+++ b/wizards/com/sun/star/wizards/form/FormConfiguration.java
@@ -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);
diff --git a/wizards/com/sun/star/wizards/report/ReportFinalizer.java b/wizards/com/sun/star/wizards/report/ReportFinalizer.java
index 682c958..1d3e3aa 100644
--- a/wizards/com/sun/star/wizards/report/ReportFinalizer.java
+++ b/wizards/com/sun/star/wizards/report/ReportFinalizer.java
@@ -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;
diff --git a/wizards/com/sun/star/wizards/table/CGCategory.java b/wizards/com/sun/star/wizards/table/CGCategory.java
index 5c2c3ad..c0a1148 100644
--- a/wizards/com/sun/star/wizards/table/CGCategory.java
+++ b/wizards/com/sun/star/wizards/table/CGCategory.java
@@ -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);
diff --git a/wizards/com/sun/star/wizards/table/CGTable.java b/wizards/com/sun/star/wizards/table/CGTable.java
index 0d4d8e0..1b6313b 100644
--- a/wizards/com/sun/star/wizards/table/CGTable.java
+++ b/wizards/com/sun/star/wizards/table/CGTable.java
@@ -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)
diff --git a/wizards/com/sun/star/wizards/table/FieldFormatter.java b/wizards/com/sun/star/wizards/table/FieldFormatter.java
index 97dcf3b..1e79d29 100644
--- a/wizards/com/sun/star/wizards/table/FieldFormatter.java
+++ b/wizards/com/sun/star/wizards/table/FieldFormatter.java
@@ -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();
diff --git a/wizards/com/sun/star/wizards/table/Finalizer.java b/wizards/com/sun/star/wizards/table/Finalizer.java
index 5e83129..1341469 100644
--- a/wizards/com/sun/star/wizards/table/Finalizer.java
+++ b/wizards/com/sun/star/wizards/table/Finalizer.java
@@ -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);
diff --git a/wizards/com/sun/star/wizards/ui/AggregateComponent.java b/wizards/com/sun/star/wizards/ui/AggregateComponent.java
index 10aa56b..4e2102f 100644
--- a/wizards/com/sun/star/wizards/ui/AggregateComponent.java
+++ b/wizards/com/sun/star/wizards/ui/AggregateComponent.java
@@ -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[]
diff --git a/wizards/com/sun/star/wizards/ui/ControlScroller.java b/wizards/com/sun/star/wizards/ui/ControlScroller.java
index ed2afa0..df5131f 100644
--- a/wizards/com/sun/star/wizards/ui/ControlScroller.java
+++ b/wizards/com/sun/star/wizards/ui/ControlScroller.java
@@ -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;
}
}
diff --git a/wizards/com/sun/star/wizards/ui/WizardDialog.java b/wizards/com/sun/star/wizards/ui/WizardDialog.java
index 4e10c13..081b9a3 100644
--- a/wizards/com/sun/star/wizards/ui/WizardDialog.java
+++ b/wizards/com/sun/star/wizards/ui/WizardDialog.java
@@ -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
More information about the Libreoffice-commits
mailing list