[Libreoffice-commits] core.git: 11 commits - qadevOOo/tests scripting/java smoketest/org testtools/com wizards/com xmerge/source

Noel Grandin noel at peralex.com
Wed Oct 14 03:09:42 PDT 2015


 qadevOOo/tests/java/ifc/datatransfer/_XMimeContentTypeFactory.java                            |    2 
 qadevOOo/tests/java/ifc/i18n/_XLocaleData.java                                                |   24 ++------
 qadevOOo/tests/java/mod/_dbaccess/OQueryDesign.java                                           |   18 +-----
 scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java |    7 --
 smoketest/org/libreoffice/smoketest/SmoketestCommandEnvironment.java                          |    2 
 testtools/com/sun/star/comp/bridge/TestComponentMain.java                                     |    1 
 wizards/com/sun/star/wizards/db/CommandName.java                                              |    4 -
 wizards/com/sun/star/wizards/db/TypeInspector.java                                            |   27 +---------
 wizards/com/sun/star/wizards/report/ReportTextDocument.java                                   |    3 -
 wizards/com/sun/star/wizards/table/PrimaryKeyHandler.java                                     |    9 ---
 wizards/com/sun/star/wizards/table/TableWizard.java                                           |    9 ---
 xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/CharArrayLCSAlgorithm.java        |   17 +-----
 12 files changed, 24 insertions(+), 99 deletions(-)

New commits:
commit 3c496d8042614718042e46b66e32e860a39abac1
Author: Noel Grandin <noel at peralex.com>
Date:   Wed Oct 14 12:02:17 2015 +0200

    cid#1326716,cid#1326717 DLS: Dead local store
    
    and clean up the method a little
    
    Change-Id: Iaa27bcd20a5b5b1b2b14f277371c5a013ae5d339

diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/CharArrayLCSAlgorithm.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/CharArrayLCSAlgorithm.java
index 1501bd3..94c2bea 100644
--- a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/CharArrayLCSAlgorithm.java
+++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/CharArrayLCSAlgorithm.java
@@ -47,27 +47,18 @@ public class CharArrayLCSAlgorithm {
         int orgSeqlen = orgSeq.length;
         int modSeqlen = modSeq.length;
 
-        int[][] diffTable;
-
         // Diff table is used to keep track which element is the same or not
         // in those 2 sequences
-        diffTable = createDiffTable(orgSeq, modSeq);
+        int[][] diffTable = createDiffTable(orgSeq, modSeq);
 
         ArrayList<Difference> diffResult = new ArrayList<Difference>();
 
         generateResult(diffTable, orgSeqlen, modSeqlen, diffResult);
 
-        Difference[] diffArray = new Difference[0];
-
-        // convert the vector to array, it has to do in here as
+        // convert the vector to array, it has to do it here as
         // generateResult is called recursively
-        if (diffResult.size() > 0) {
-            diffArray = new Difference[diffResult.size()];
-            diffResult.toArray(diffArray);
-        }
-
-        diffTable = null;
-        diffResult = null;
+        Difference[] diffArray = new Difference[diffResult.size()];
+        diffResult.toArray(diffArray);
 
         return diffArray;
     }
commit f3ef91fde2994db54eec9a1323d4d9cf91b991f2
Author: Noel Grandin <noel at peralex.com>
Date:   Wed Oct 14 11:59:04 2015 +0200

    cid#1326683 DLS: Dead local store
    
    Change-Id: I797faf679ec5c6a27570d1dd5ac0aa2c480cf56d

diff --git a/wizards/com/sun/star/wizards/table/TableWizard.java b/wizards/com/sun/star/wizards/table/TableWizard.java
index 8ba08ad..7acfb59 100644
--- a/wizards/com/sun/star/wizards/table/TableWizard.java
+++ b/wizards/com/sun/star/wizards/table/TableWizard.java
@@ -149,7 +149,6 @@ public class TableWizard extends DatabaseObjectWizard implements XTextListener
     public void setcompleted(int _ndialogpage, boolean _biscompleted)
     {
         boolean bScenarioiscompleted = _biscompleted;
-        boolean bFieldFormatsiscompleted = _biscompleted;
         boolean bPrimaryKeysiscompleted = _biscompleted;
         boolean bFinalPageiscompleted = _biscompleted;
         if (_ndialogpage == SOMAINPAGE)
@@ -160,14 +159,6 @@ public class TableWizard extends DatabaseObjectWizard implements XTextListener
         {
             bScenarioiscompleted = iscompleted(SOMAINPAGE);
         }
-        if (_ndialogpage != TableWizard.SOFIELDSFORMATPAGE)
-        {
-            bFieldFormatsiscompleted = iscompleted(SOFIELDSFORMATPAGE);
-            if (!bFieldFormatsiscompleted)                              // it might be that the Fieldformatter has not yet been initialized
-            {
-                bFieldFormatsiscompleted = bScenarioiscompleted;        // in this case query the scenarioselector
-            }
-        }
         if (_ndialogpage != TableWizard.SOPRIMARYKEYPAGE && (this.curPrimaryKeyHandler != null))
         {
             bPrimaryKeysiscompleted = iscompleted(SOPRIMARYKEYPAGE);
commit 5ac427963ab45af356ba0aa9da006847e0c7b32e
Author: Noel Grandin <noel at peralex.com>
Date:   Wed Oct 14 11:57:14 2015 +0200

    cid#1326682 DLS: Dead local store
    
    Change-Id: I9dba5d1eb710ab21258ca19789274ca1b75e53ca

diff --git a/wizards/com/sun/star/wizards/report/ReportTextDocument.java b/wizards/com/sun/star/wizards/report/ReportTextDocument.java
index ec61209..4fe8991 100644
--- a/wizards/com/sun/star/wizards/report/ReportTextDocument.java
+++ b/wizards/com/sun/star/wizards/report/ReportTextDocument.java
@@ -100,11 +100,8 @@ class ReportTextDocument extends com.sun.star.wizards.text.TextDocument implemen
         long lDateCorrection = oNumberFormatter.getNullDateCorrection();
         oNumberFormatter.setBooleanReportDisplayNumberFormat();
         oNumberFormatter.setNullDateCorrection(lDateCorrection);
-        String sMsgTableNotExisting = oResource.getResText(UIConsts.RID_REPORT + 61);
         sMsgCommonReportError = oResource.getResText(UIConsts.RID_REPORT + 72);
         sMsgCommonReportError = JavaTools.replaceSubString(sMsgCommonReportError, String.valueOf((char) 13), "<BR>");
-        String sMsgEndAutopilot = oResource.getResText(UIConsts.RID_DB_COMMON + 33);
-        sMsgTableNotExisting = sMsgTableNotExisting + (char) 13 + sMsgEndAutopilot;
         bIsCurLandscape = true;
         getReportPageStyles();
     }
commit 8f60da0a29744d456cb074af05aeb4b40d1774fa
Author: Noel Grandin <noel at peralex.com>
Date:   Wed Oct 14 11:49:19 2015 +0200

    cid#1326681 DLS: Dead local store
    
    and clean up the return value, no need to return a TypeInfo when all we
    need is a boolean
    
    Change-Id: I0909c2b96762870d753c22ab5056e718af56d75b

diff --git a/wizards/com/sun/star/wizards/db/TypeInspector.java b/wizards/com/sun/star/wizards/db/TypeInspector.java
index e8084b0..a555078 100644
--- a/wizards/com/sun/star/wizards/db/TypeInspector.java
+++ b/wizards/com/sun/star/wizards/db/TypeInspector.java
@@ -354,28 +354,13 @@ public class TypeInspector
         return (getAutoIncrementIndex(_xColPropertySet) != INVALID);
     }
 
-    /** finds the first available DataType that can be used as a primary key in a table.
-     * @return The first datatype that also supports Autoincrmentation is taken according to the following list:
-     *1) INTEGER
-     *2) FLOAT
-     *3) REAL
-     *4) DOUBLE
-     *5) NUMERIC
-     *6) DECIMAL         *
-     * If no appropriate datatype is found the first available numeric type after DataType.INTEGER
-     * according to the 'convertDataType' method is returned
+    /** Do we have a datatype that supports AutoIncrementation?
      */
-    /**TODO the fallback order is the same as implemented in the method 'convertDataType'.
-     * It's not very elegant to have the same intelligence
-     * on several spots in the class!!
-     *
-     */
-    public TypeInfo findAutomaticPrimaryKeyType()
+    public boolean isAutoIncrementationSupported()
     {
-        int nDataType;
         for (int n = 0; n < this.nNumericFallBackList.length; n++)
         {
-            nDataType = nNumericFallBackList[n];
+            int nDataType = nNumericFallBackList[n];
             boolean bleaveloop = false;
             int startindex = 0;
             while (!bleaveloop)
@@ -386,15 +371,13 @@ public class TypeInspector
                 {
                     if (this.bisAutoIncrementableInfos[i])
                     {
-                        return new TypeInfo(true);
+                        return true;
                     }
                     startindex = i + 1;
                 }
                 startindex = i + 1;
             }
         }
-        // As Autoincrementation is not supported for any numeric datatype we take the first available numeric Type;
-        nDataType = convertDataType(DataType.INTEGER);
-        return new TypeInfo(false);
+        return false;
     }
 }
diff --git a/wizards/com/sun/star/wizards/table/PrimaryKeyHandler.java b/wizards/com/sun/star/wizards/table/PrimaryKeyHandler.java
index 0fa3e29..64b8114 100644
--- a/wizards/com/sun/star/wizards/table/PrimaryKeyHandler.java
+++ b/wizards/com/sun/star/wizards/table/PrimaryKeyHandler.java
@@ -60,7 +60,7 @@ public class PrimaryKeyHandler implements XFieldSelectionListener
     {
         this.CurUnoDialog = _CurUnoDialog;
         curTableDescriptor = _curTableDescriptor;
-        bAutoPrimaryKeysupportsAutoIncrmentation = isAutoPrimeKeyAutoIncrementationsupported();
+        bAutoPrimaryKeysupportsAutoIncrmentation = curTableDescriptor.oTypeInspector.isAutoIncrementationSupported();
         short curtabindex = (short) ((TableWizard.SOPRIMARYKEYPAGE * 100) - 20);
         Integer IPRIMEKEYSTEP = Integer.valueOf(TableWizard.SOPRIMARYKEYPAGE);
         final String sExplanations = CurUnoDialog.m_oResource.getResText(UIConsts.RID_TABLE + 26);
@@ -245,13 +245,6 @@ public class PrimaryKeyHandler implements XFieldSelectionListener
         togglePrimeKeyFields();
     }
 
-    private boolean isAutoPrimeKeyAutoIncrementationsupported()
-    {
-        TypeInspector.TypeInfo aAutoPrimeTypeInfo;
-        aAutoPrimeTypeInfo = curTableDescriptor.oTypeInspector.findAutomaticPrimaryKeyType();
-        return aAutoPrimeTypeInfo.bisAutoIncrementable;
-    }
-
     public boolean iscompleted()
     {
         if (chkcreatePrimaryKey.getState() == 0)
commit e96cb6c01ec175b9bd97341ded3e9e8e415a4110
Author: Noel Grandin <noel at peralex.com>
Date:   Wed Oct 14 11:44:06 2015 +0200

    cid#1326680 DLS: Dead local store
    
    Change-Id: I8e1ffdfe4d20664b7c97eb2a33b570aea9b19ccf

diff --git a/wizards/com/sun/star/wizards/db/CommandName.java b/wizards/com/sun/star/wizards/db/CommandName.java
index be65ffd..91e54ed 100644
--- a/wizards/com/sun/star/wizards/db/CommandName.java
+++ b/wizards/com/sun/star/wizards/db/CommandName.java
@@ -105,9 +105,7 @@ public class CommandName
             }
             if (oCommandMetaData.xDBMetaData.supportsSchemasInDataManipulation())
             {
-                String[] NameList;
-                NameList = new String[0];
-                NameList = JavaTools.ArrayoutofString(_DisplayName, ".");
+                String[] NameList = JavaTools.ArrayoutofString(_DisplayName, ".");
                 if (NameList.length > 1)
                 {
                     SchemaName = NameList[0];
commit 7f7ca604c31a13c06d13bcce9728f4d73f8147e5
Author: Noel Grandin <noel at peralex.com>
Date:   Wed Oct 14 11:37:55 2015 +0200

    cid#1326679 DLS: Dead local store
    
    Change-Id: I87748b6af4731e5c774962a7a26b008385146a5f

diff --git a/testtools/com/sun/star/comp/bridge/TestComponentMain.java b/testtools/com/sun/star/comp/bridge/TestComponentMain.java
index c4ea66c..e394f19 100644
--- a/testtools/com/sun/star/comp/bridge/TestComponentMain.java
+++ b/testtools/com/sun/star/comp/bridge/TestComponentMain.java
@@ -76,7 +76,6 @@ public class TestComponentMain
         boolean singleaccept = args[1].equals("singleaccept");
 
         int index = dcp.indexOf(':');
-        String url = dcp.substring(0, index).trim();
         dcp = dcp.substring(index + 1).trim();
 
         index = dcp.indexOf(';');
commit bcfc1fd1488b6e960e9f617893667e8aa4dabbd2
Author: Noel Grandin <noel at peralex.com>
Date:   Wed Oct 14 11:25:10 2015 +0200

    cid#1326675 DLS: Dead local store
    
    Change-Id: I73cfe079b6d2e3c80f260e01c7150894ae0f4bb7

diff --git a/smoketest/org/libreoffice/smoketest/SmoketestCommandEnvironment.java b/smoketest/org/libreoffice/smoketest/SmoketestCommandEnvironment.java
index 66444c2..f5ddd77 100644
--- a/smoketest/org/libreoffice/smoketest/SmoketestCommandEnvironment.java
+++ b/smoketest/org/libreoffice/smoketest/SmoketestCommandEnvironment.java
@@ -74,8 +74,6 @@ class InteractionImpl implements com.sun.star.task.XInteractionHandler
 {
     public void handle( com.sun.star.task.XInteractionRequest xRequest )
     {
-        Object request = xRequest.getRequest();
-
         boolean approve = true;
         boolean abort = false;
 
commit fb451a14c0530b3b8a434a0746be2b82cd44ad17
Author: Noel Grandin <noel at peralex.com>
Date:   Wed Oct 14 11:22:18 2015 +0200

    cid#1326674 DLS: Dead local store
    
    Change-Id: I8168d3703022c9a1baed6e82c43a04ffa0ca52c0

diff --git a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java
index a95b2a1..deef40e 100644
--- a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java
+++ b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java
@@ -187,13 +187,6 @@ public class ScriptEditorForBeanShell implements ScriptEditor, ActionListener {
                 }
 
                 final ClassLoader theCl = cl;
-                String sUrl = entry.getParcelLocation();
-
-                if (!sUrl.endsWith("/")) {
-                    sUrl += "/";
-                }
-
-                sUrl +=  entry.getLanguageName();
                 final URL url = entry.getSourceURL();
                 SwingInvocation.invoke(
                 new Runnable() {
commit 8856d3069494ae16c6e261c4f3b604aebac28e31
Author: Noel Grandin <noel at peralex.com>
Date:   Wed Oct 14 11:19:11 2015 +0200

    cid#1326672 DLS: Dead local store
    
    Change-Id: I43bbad0c77022d999e0a10b10ca9f1e316ed7b9f

diff --git a/qadevOOo/tests/java/mod/_dbaccess/OQueryDesign.java b/qadevOOo/tests/java/mod/_dbaccess/OQueryDesign.java
index e5274bc..4cc3a16 100644
--- a/qadevOOo/tests/java/mod/_dbaccess/OQueryDesign.java
+++ b/qadevOOo/tests/java/mod/_dbaccess/OQueryDesign.java
@@ -67,25 +67,15 @@ public class OQueryDesign extends TestCase {
 
         log.println( "creating a test environment" );
 
-        XInterface oObj = null;
-
         XDispatchProvider aProv = UnoRuntime.queryInterface(XDispatchProvider.class,xDesk);
-
-        XDispatch getting = null;
         XMultiServiceFactory xMSF = Param.getMSF();
 
-        XNameAccess xNameAccess = null;
-
         // we use the first datasource
-        XDataSource xDS = null;
-        xNameAccess = UnoRuntime.queryInterface(
+        XNameAccess xNameAccess = UnoRuntime.queryInterface(
                     XNameAccess.class,
                     xMSF.createInstance("com.sun.star.sdb.DatabaseContext"));
-        xDS = UnoRuntime.queryInterface(
+        XDataSource xDS = UnoRuntime.queryInterface(
                 XDataSource.class, xNameAccess.getByName( "Bibliography" ));
-        xNameAccess = UnoRuntime.queryInterface(
-                    XNameAccess.class,
-                    xMSF.createInstance("com.sun.star.sdb.DatabaseContext"));
 
         log.println("check XMultiServiceFactory");
 
@@ -94,7 +84,7 @@ public class OQueryDesign extends TestCase {
         log.println( "opening QueryDesign" );
         URL the_url = new URL();
         the_url.Complete = ".component:DB/QueryDesign";
-        getting = aProv.queryDispatch(the_url,"Query",12);
+        XDispatch getting = aProv.queryDispatch(the_url,"Query",12);
         PropertyValue[] Args = new PropertyValue[2];
         PropertyValue param1 = new PropertyValue();
         param1.Name = "DataSourceName";
@@ -145,7 +135,7 @@ public class OQueryDesign extends TestCase {
         params[2] = param3;
 
 
-        oObj = xFrame.getController();
+        XInterface oObj = xFrame.getController();
 
         TestEnvironment tEnv = new TestEnvironment(oObj);
 
commit 27336e23d49878ecd7e8d3fbc8c2114c0ebcbc2b
Author: Noel Grandin <noel at peralex.com>
Date:   Wed Oct 14 10:47:11 2015 +0200

    cid#1326663 to cid#1326670 DLS: Dead local store
    
    Change-Id: Ia60aa345ae35ba1f7a0b5d3aadc003aedf98ad9f

diff --git a/qadevOOo/tests/java/ifc/i18n/_XLocaleData.java b/qadevOOo/tests/java/ifc/i18n/_XLocaleData.java
index b9f1ba1..d2ba440 100644
--- a/qadevOOo/tests/java/ifc/i18n/_XLocaleData.java
+++ b/qadevOOo/tests/java/ifc/i18n/_XLocaleData.java
@@ -155,10 +155,9 @@ public class _XLocaleData extends MultiMethodTest {
     public void _getAllCalendars() {
         boolean res = true;
         boolean printit = false;
-        Calendar[] calendar = new Calendar[1];
 
         for (int i=0;i<7;i++) {
-            calendar = oObj.getAllCalendars(getLocale(i));
+            Calendar[] calendar = oObj.getAllCalendars(getLocale(i));
             for (int j=0;j<calendar.length;j++) {
                 if (! goodCalendar(calendar[j]) ) {
                     printit = true;
@@ -181,10 +180,9 @@ public class _XLocaleData extends MultiMethodTest {
     public void _getAllCurrencies() {
         boolean res = true;
         boolean printit = false;
-        Currency[] currency = new Currency[1];
 
         for (int i=0;i<7;i++) {
-            currency = oObj.getAllCurrencies(getLocale(i));
+            Currency[] currency = oObj.getAllCurrencies(getLocale(i));
             for (int j=0;j<currency.length;j++) {
                 if (! goodCurrency(currency[j]) ) {
                     printit=true;
@@ -207,10 +205,9 @@ public class _XLocaleData extends MultiMethodTest {
     public void _getAllFormats() {
         boolean res = true;
         boolean printit = false;
-        FormatElement[] format = new FormatElement[1];
 
         for (int i=0;i<7;i++) {
-            format = oObj.getAllFormats(getLocale(i));
+            FormatElement[] format = oObj.getAllFormats(getLocale(i));
             for (int j=0;j<format.length;j++) {
                 if (! goodFormat(format[j]) ) {
                     printit = true;
@@ -232,10 +229,9 @@ public class _XLocaleData extends MultiMethodTest {
     public void _getCollatorImplementations() {
         boolean res = true;
         boolean printit = false;
-        Implementation[] impl = new Implementation[1];
 
         for (int i=0;i<7;i++) {
-            impl = oObj.getCollatorImplementations(getLocale(i));
+            Implementation[] impl = oObj.getCollatorImplementations(getLocale(i));
             for (int j=0;j<impl.length;j++) {
                 if ((impl[j].unoID.equals(""))) {
                     printit = true;
@@ -258,10 +254,9 @@ public class _XLocaleData extends MultiMethodTest {
     public void _getSearchOptions() {
         boolean res = true;
         boolean printit = false;
-        String[] str = new String[1];
 
         for (int i=0;i<7;i++) {
-            str = oObj.getSearchOptions(getLocale(i));
+            String[] str = oObj.getSearchOptions(getLocale(i));
             for (int j=0;j<str.length;j++) {
                 if ((str[j].equals(""))) {
                     printit = true;
@@ -284,10 +279,9 @@ public class _XLocaleData extends MultiMethodTest {
     public void _getCollationOptions() {
         boolean res = true;
         boolean printit = false;
-        String[] str = new String[1];
 
         for (int i=0;i<7;i++) {
-            str = oObj.getCollationOptions(getLocale(i));
+            String[] str = oObj.getCollationOptions(getLocale(i));
             for (int j=0;j<str.length;j++) {
                 if ((str[j].equals(""))) {
                     printit = true;
@@ -310,10 +304,9 @@ public class _XLocaleData extends MultiMethodTest {
     public void _getTransliterations() {
         boolean res = true;
         boolean printit = false;
-        String[] str = new String[1];
 
         for (int i=0;i<7;i++) {
-            str = oObj.getTransliterations(getLocale(i));
+            String[] str = oObj.getTransliterations(getLocale(i));
             for (int j=0;j<str.length;j++) {
                 if ((str[j].equals(""))) {
                     printit = true;
@@ -358,10 +351,9 @@ public class _XLocaleData extends MultiMethodTest {
     public void _getReservedWord() {
         boolean res = true;
         boolean printit = false;
-        String[] str = new String[1];
 
         for (int i=0;i<7;i++) {
-            str = oObj.getReservedWord(getLocale(i));
+            String[] str = oObj.getReservedWord(getLocale(i));
             for (int j=0;j<str.length;j++) {
                 if ((str[j].equals(""))) {
                     printit = true;
commit c626897c09aeec3781753e82265db745d6e94c64
Author: Noel Grandin <noel at peralex.com>
Date:   Wed Oct 14 10:44:33 2015 +0200

    cid#1326662 DLS: Dead local store
    
    Change-Id: Ie9353f469b7e820341c99e4c81dd9898dc336ecc

diff --git a/qadevOOo/tests/java/ifc/datatransfer/_XMimeContentTypeFactory.java b/qadevOOo/tests/java/ifc/datatransfer/_XMimeContentTypeFactory.java
index 78bb70b..68e47d2 100644
--- a/qadevOOo/tests/java/ifc/datatransfer/_XMimeContentTypeFactory.java
+++ b/qadevOOo/tests/java/ifc/datatransfer/_XMimeContentTypeFactory.java
@@ -71,7 +71,7 @@ public class _XMimeContentTypeFactory extends MultiMethodTest {
         }
 
         try {
-            type = oObj.createMimeContentType("nosuchtype") ;
+            oObj.createMimeContentType("nosuchtype") ;
 
             log.println("!!! No exception was thrown on wrong MIME type !!!") ;
             result = false ;


More information about the Libreoffice-commits mailing list