[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - 4 commits - extensions/source languagetool/ExternalProject_languagetool.mk offapi/com qadevOOo/runner qadevOOo/tests

Stephan Bergmann sbergman at redhat.com
Tue May 21 23:24:31 PDT 2013


 extensions/source/update/check/updatehdl.cxx                            |   27 +-
 extensions/source/update/check/updatehdl.hxx                            |    2 
 languagetool/ExternalProject_languagetool.mk                            |    6 
 offapi/com/sun/star/awt/PrinterServer.idl                               |    7 
 qadevOOo/runner/util/AccessibilityTools.java                            |  100 +---------
 qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_PreviewCell.java |    4 
 qadevOOo/tests/java/mod/_toolkit/AccessibleListBox.java                 |    4 
 7 files changed, 40 insertions(+), 110 deletions(-)

New commits:
commit e4d8eaab8c9413fa102a56364c5f3c632e3ca43e
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue May 21 17:16:18 2013 +0200

    Clean up
    
    Change-Id: I9f58a08ec0867237b80da6787bc1840f0a6bbba8
    (cherry picked from commit 355180f3e574b069fcd68df08f4909521fa7e6a0)

diff --git a/offapi/com/sun/star/awt/PrinterServer.idl b/offapi/com/sun/star/awt/PrinterServer.idl
index e323939..3725eee 100644
--- a/offapi/com/sun/star/awt/PrinterServer.idl
+++ b/offapi/com/sun/star/awt/PrinterServer.idl
@@ -15,11 +15,10 @@
 module com {  module sun {  module star {  module awt {
 
 /** mechanism to discover and manage printers
+
+    @since LibreOffice 4.1
  */
-service PrinterServer
-{
-    interface com::sun::star::awt::XPrinterServer;
-};
+service PrinterServer: com::sun::star::awt::XPrinterServer;
 
 }; }; }; };
 
commit aedb02a728532d256318472742b31e90ccdf1d51
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue May 21 17:02:09 2013 +0200

    Missing dependencies
    
    cf. the various ext.ooo.*.lib in the tarball's build.xml
    
    Change-Id: If58534c78b04768ab2d0524079d70bdd8ad16c00
    (cherry picked from commit 90e2ad99a594c185ccc578c36121da83eaf8885f)

diff --git a/languagetool/ExternalProject_languagetool.mk b/languagetool/ExternalProject_languagetool.mk
index fdee1ad..1035bb6 100644
--- a/languagetool/ExternalProject_languagetool.mk
+++ b/languagetool/ExternalProject_languagetool.mk
@@ -13,7 +13,11 @@ $(eval $(call gb_ExternalProject_register_targets,languagetool,\
 	build \
 ))
 
-$(call gb_ExternalProject_get_state_target,languagetool,build) : $(call gb_Jar_get_outdir_target,juh)
+$(call gb_ExternalProject_get_state_target,languagetool,build) : \
+            $(call gb_Jar_get_outdir_target,juh) \
+            $(call gb_Jar_get_outdir_target,jurt) \
+            $(call gb_Jar_get_outdir_target,ridl) \
+            $(call gb_Jar_get_outdir_target,unoil)
 	cd "$(call gb_UnpackedTarball_get_dir,languagetool)" && \
 	$(ICECREAM_RUN) "$(ANT)" \
 		-q \
commit 7696bbddaeb9e6748bcd64cf1b6ab5b59e7311ca
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue May 21 16:40:03 2013 +0200

    Revert "Java cleanup, AccessibilityTools.."
    
    This reverts commit d702dd4396161f8e2e7396f5c24554088b752fcb, which reproducibly
    broke JunitTest_sc_unoapi:
    
    java.lang.NullPointerException
     at util.AccessibilityTools.getAccessibleObjectForRole_(AccessibilityTools.java:177)
     at util.AccessibilityTools.getAccessibleObjectForRole(AccessibilityTools.java:95)
     at mod._sc.AccessibleEditableTextPara_PreviewCell.createTestEnvironment(AccessibleEditableTextPara_PreviewCell.java:149)
     at lib.TestCase.getTestEnvironment(TestCase.java:121)
     at base.java_fat.getTestEnvironment(java_fat.java:319)
     at base.java_fat.executeTest(java_fat.java:167)
     at org.openoffice.Runner.run(Runner.java:234)
     at org.openoffice.test.UnoApiTest.test(UnoApiTest.java:38)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     at java.lang.reflect.Method.invoke(Method.java:601)
     at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
     at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
     at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
     at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
     at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
     at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
     at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
     at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
     at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
     at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
     at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
     at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
     at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
     at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
     at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
     at org.junit.runners.Suite.runChild(Suite.java:128)
     at org.junit.runners.Suite.runChild(Suite.java:24)
     at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
     at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
     at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
     at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
     at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
     at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
     at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
     at org.junit.runner.JUnitCore.run(JUnitCore.java:136)
     at org.junit.runner.JUnitCore.run(JUnitCore.java:117)
     at org.junit.runner.JUnitCore.runMain(JUnitCore.java:98)
     at org.junit.runner.JUnitCore.runMainAndExit(JUnitCore.java:53)
     at org.junit.runner.JUnitCore.main(JUnitCore.java:45)
    
    Change-Id: I3601fe24db21bd63f7dc6cdf0a1eb69f447d962a
    (cherry picked from commit 89fbed7e29104bf189dc3d75dc11a8aadd362322)

diff --git a/qadevOOo/runner/util/AccessibilityTools.java b/qadevOOo/runner/util/AccessibilityTools.java
index c7cb483..85cd442 100644
--- a/qadevOOo/runner/util/AccessibilityTools.java
+++ b/qadevOOo/runner/util/AccessibilityTools.java
@@ -17,7 +17,6 @@
  */
 package util;
 
-import com.sun.star.accessibility.AccessibleStateType;
 import com.sun.star.accessibility.XAccessible;
 import com.sun.star.accessibility.XAccessibleComponent;
 import com.sun.star.accessibility.XAccessibleContext;
@@ -33,7 +32,7 @@ import java.io.PrintWriter;
 
 
 public class AccessibilityTools {
-    private XAccessible SearchedAccessible = null;
+    public static XAccessible SearchedAccessible = null;
     private static boolean debug = false;
 
     public AccessibilityTools() {
@@ -92,12 +91,15 @@ public class AccessibilityTools {
 
     public static XAccessibleContext getAccessibleObjectForRole(XAccessible xacc,
         short role) {
+        SearchedAccessible = null;
         return getAccessibleObjectForRole_(xacc, role);
     }
 
     public static XAccessibleContext getAccessibleObjectForRole(XAccessible xacc,
         short role,
         boolean ignoreShowing) {
+        SearchedAccessible = null;
+
         if (ignoreShowing) {
             return getAccessibleObjectForRoleIgnoreShowing_(xacc, role);
         } else {
@@ -105,49 +107,12 @@ public class AccessibilityTools {
         }
     }
 
-    public XAccessible getSearchedAccessibleObjectForRole(XAccessible xacc,
-        short role,
-        boolean ignoreShowing) {
-        SearchedAccessible = null;
-        getSearchedAccessibleObjectForRole_(xacc, role, ignoreShowing);
-        return SearchedAccessible;
-    }
-
-    private XAccessibleContext getSearchedAccessibleObjectForRole_(XAccessible xacc,
-            short role, boolean ignoreShowing) {
-        XAccessibleContext ac = xacc.getAccessibleContext();
-        boolean isShowing = isShowing(ac);
-
-        if ((ac.getAccessibleRole() == role) && (!ignoreShowing || isShowing)) {
-            SearchedAccessible = xacc;
-            return ac;
-        } else {
-            int k = ac.getAccessibleChildCount();
-
-            if (ac.getAccessibleChildCount() > 100) {
-                k = 50;
-            }
-
-            for (int i = 0; i < k; i++) {
-                try {
-                    XAccessibleContext ac2 = getSearchedAccessibleObjectForRole_(ac.getAccessibleChild(i), role, ignoreShowing);
-
-                    if (ac2 != null) {
-                        return ac2;
-                    }
-                } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
-                    System.out.println("Couldn't get Child");
-                }
-            }
-            return null;
-        }
-    }
-
     public static XAccessibleContext getAccessibleObjectForRoleIgnoreShowing_(XAccessible xacc,
         short role) {
         XAccessibleContext ac = xacc.getAccessibleContext();
 
         if (ac.getAccessibleRole() == role) {
+            SearchedAccessible = xacc;
             return ac;
         } else {
             int k = ac.getAccessibleChildCount();
@@ -175,9 +140,11 @@ public class AccessibilityTools {
     public static XAccessibleContext getAccessibleObjectForRole_(XAccessible xacc,
         short role) {
         XAccessibleContext ac = xacc.getAccessibleContext();
-        boolean isShowing = isShowing(ac);
+        boolean isShowing = ac.getAccessibleStateSet()
+        .contains(com.sun.star.accessibility.AccessibleStateType.SHOWING);
 
         if ((ac.getAccessibleRole() == role) && isShowing) {
+            SearchedAccessible = xacc;
             return ac;
         } else {
             int k = ac.getAccessibleChildCount();
@@ -227,6 +194,7 @@ public class AccessibilityTools {
         if ((ac.getAccessibleRole() == role) &&
             (ac.getAccessibleName().indexOf(name) > -1) &&
             (utils.getImplName(ac).indexOf(implName) > -1)) {
+            SearchedAccessible = xacc;
 
             //System.out.println("FOUND the desired component -- "+ ac.getAccessibleName() +isShowing);
             return ac;
@@ -260,7 +228,8 @@ public class AccessibilityTools {
         String name,
         String implName) {
         XAccessibleContext ac = xacc.getAccessibleContext();
-        boolean isShowing = isShowing(ac);
+        boolean isShowing = ac.getAccessibleStateSet()
+        .contains(com.sun.star.accessibility.AccessibleStateType.SHOWING);
 
         // hotfix for i91828:
         // if role to search is 0 then ignore the role.
@@ -268,6 +237,7 @@ public class AccessibilityTools {
             (ac.getAccessibleName().indexOf(name) > -1) &&
             (utils.getImplName(ac).indexOf(implName) > -1) &&
             isShowing) {
+            SearchedAccessible = xacc;
             //System.out.println("FOUND the desired component -- "+ ac.getAccessibleName() +isShowing);
             return ac;
         } else {
@@ -295,45 +265,6 @@ public class AccessibilityTools {
         return null;
     }
 
-    public XAccessible getSearchedAccessibleObjectForRole(XAccessible xacc,
-            short role,
-            String name,
-            String implName) {
-            XAccessibleContext ac = xacc.getAccessibleContext();
-            boolean isShowing = isShowing(ac);
-
-            // hotfix for i91828:
-            // if role to search is 0 then ignore the role.
-            if ( (role == 0 || ac.getAccessibleRole() == role) &&
-                (ac.getAccessibleName().indexOf(name) > -1) &&
-                (utils.getImplName(ac).indexOf(implName) > -1) &&
-                isShowing) {
-                SearchedAccessible = xacc;
-            } else {
-                int k = ac.getAccessibleChildCount();
-
-                if (ac.getAccessibleChildCount() > 100) {
-                    k = 50;
-                }
-
-                for (int i = 0; i < k; i++) {
-                    try {
-                        XAccessibleContext ac1 = getAccessibleObjectForRole(
-                            ac.getAccessibleChild(i),
-                            role, name, implName);
-
-                        if (ac1 != null) {
-                            break;
-                        }
-                    } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
-                        System.out.println("Couldn't get Child");
-                    }
-                }
-            }
-
-            return SearchedAccessible;
-        }
-
     /**
      * This methods retunrs the <CODE>XAccessibleContext</CODE> of a named Sheet-Cell like "G5".<p>
      * @param xSheetAcc The <CODE>XAccessibleContext</CODE> of a Sheet
@@ -414,7 +345,8 @@ public class AccessibilityTools {
             logging(log,indent + indent + bounds);
         }
 
-        boolean isShowing = isShowing(ac);
+        boolean isShowing = ac.getAccessibleStateSet()
+        .contains(com.sun.star.accessibility.AccessibleStateType.SHOWING);
         logging(log,indent + indent + "StateType contains SHOWING: " +
             isShowing);
 
@@ -511,8 +443,4 @@ public class AccessibilityTools {
     private static void logging(PrintWriter log, String content){
         if (debug) log.println(content);
     }
-
-    private static boolean isShowing(XAccessibleContext ac) {
-        return ac.getAccessibleStateSet().contains(AccessibleStateType.SHOWING);
-    }
 }
\ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_PreviewCell.java b/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_PreviewCell.java
index fe26e25..ac90e5b 100644
--- a/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_PreviewCell.java
+++ b/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_PreviewCell.java
@@ -142,7 +142,9 @@ public class AccessibleEditableTextPara_PreviewCell extends TestCase {
         XWindow xWindow = AccessibilityTools.getCurrentWindow( (XMultiServiceFactory) Param.getMSF(), xModel);
         XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow);
         //AccessibilityTools.printAccessibleTree(log,xRoot);
-        xRoot = new AccessibilityTools().getSearchedAccessibleObjectForRole(xRoot, AccessibleRole.TABLE_CELL,true);
+        AccessibilityTools.getAccessibleObjectForRole(xRoot, AccessibleRole.TABLE_CELL,true);
+
+        xRoot = AccessibilityTools.SearchedAccessible;
 
         //AccessibilityTools.printAccessibleTree(log,xRoot);
 
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleListBox.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleListBox.java
index efc02df..142a42a 100644
--- a/qadevOOo/tests/java/mod/_toolkit/AccessibleListBox.java
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleListBox.java
@@ -169,10 +169,8 @@ public class AccessibleListBox extends TestCase {
 
         oObj = AccessibilityTools.getAccessibleObjectForRole(xRoot, AccessibleRole.PANEL, "",
                                              "com.sun.star.comp.toolkit.AccessibleListBox");
-        XAccessible searchedAccessible = new AccessibilityTools().getSearchedAccessibleObjectForRole(xRoot, AccessibleRole.PANEL, "",
-                "com.sun.star.comp.toolkit.AccessibleListBox");
 
-        Object list = AccessibilityTools.getAccessibleObjectForRole(searchedAccessible,
+        Object list = AccessibilityTools.getAccessibleObjectForRole(AccessibilityTools.SearchedAccessible,
                                                     AccessibleRole.LIST);
 
         log.println("ImplementationName " + utils.getImplName(oObj));
commit 98101d9ee14f02fd7ff082ac1b1180fec81127b5
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue May 21 16:29:31 2013 +0200

    -Werror,-Wuninitialized
    
    Bogus
    
      uno::Reference< awt::XControlModel > xControlModel = xControlModel;
    
    introduced with 6c61b20a8d4a6dcac28801cde82a211fb7e30654 "fdo#46808, Convert
    awt::UnoControlDialogModel to new style."  Correct fix involves adding missing
    "const" in declaration of UpdateHandler::insertControlModel, so implicit
    Reference up-cast works.
    
    Change-Id: I8f6d679a38d99188eb893366e9b552974b3c1bf2
    (cherry picked from commit cb4b6dde8fda2a5848e11063028bf44d72f85431)

diff --git a/extensions/source/update/check/updatehdl.cxx b/extensions/source/update/check/updatehdl.cxx
index 1852581..6c96e6e 100644
--- a/extensions/source/update/check/updatehdl.cxx
+++ b/extensions/source/update/check/updatehdl.cxx
@@ -819,7 +819,7 @@ void UpdateHandler::focusControl( DialogControls eID )
 }
 
 //--------------------------------------------------------------------
-void UpdateHandler::insertControlModel( uno::Reference< awt::XControlModel > & rxDialogModel,
+void UpdateHandler::insertControlModel( uno::Reference< awt::XControlModel > const & rxDialogModel,
                                         OUString const & rServiceName,
                                         OUString const & rControlName,
                                         awt::Rectangle const & rPosSize,
@@ -1093,23 +1093,22 @@ void UpdateHandler::createDialog()
 
     loadStrings();
 
-    uno::Reference< awt::XUnoControlDialogModel > xControlDialogModel = awt::UnoControlDialogModel::create( mxContext );
+    uno::Reference< awt::XUnoControlDialogModel > xControlModel = awt::UnoControlDialogModel::create( mxContext );
     {
         // @see awt/UnoControlDialogModel.idl
-        xControlDialogModel->setTitle( msDlgTitle);
-        xControlDialogModel->setCloseable( true );
-        xControlDialogModel->setEnabled( true );
-        xControlDialogModel->setMoveable( true );
-        xControlDialogModel->setSizeable( true );
-        xControlDialogModel->setDesktopAsParent( true );
-        xControlDialogModel->setPositionX( 100 );
-        xControlDialogModel->setPositionY( 100 );
-        xControlDialogModel->setWidth( DIALOG_WIDTH );
-        xControlDialogModel->setHeight( DIALOG_HEIGHT );
-        xControlDialogModel->setHelpURL( INET_HID_SCHEME + OUString::createFromAscii( HID_CHECK_FOR_UPD_DLG ) );
+        xControlModel->setTitle( msDlgTitle);
+        xControlModel->setCloseable( true );
+        xControlModel->setEnabled( true );
+        xControlModel->setMoveable( true );
+        xControlModel->setSizeable( true );
+        xControlModel->setDesktopAsParent( true );
+        xControlModel->setPositionX( 100 );
+        xControlModel->setPositionY( 100 );
+        xControlModel->setWidth( DIALOG_WIDTH );
+        xControlModel->setHeight( DIALOG_HEIGHT );
+        xControlModel->setHelpURL( INET_HID_SCHEME + OUString::createFromAscii( HID_CHECK_FOR_UPD_DLG ) );
     }
 
-    uno::Reference< awt::XControlModel > xControlModel = xControlModel;
     {   // Label (fixed text) <status>
         uno::Sequence< beans::NamedValue > aProps(1);
 
diff --git a/extensions/source/update/check/updatehdl.hxx b/extensions/source/update/check/updatehdl.hxx
index 39804a7..661b6a8 100644
--- a/extensions/source/update/check/updatehdl.hxx
+++ b/extensions/source/update/check/updatehdl.hxx
@@ -149,7 +149,7 @@ private:
     static void             setProperty( com::sun::star::uno::Sequence< com::sun::star::beans::NamedValue > &rProps,
                                          const int nIndex, const OUString &rPropName, const com::sun::star::uno::Any &rPropValue )
                                          { rProps[ nIndex ].Name = rPropName; rProps[ nIndex ].Value = rPropValue; }
-    static void             insertControlModel( com::sun::star::uno::Reference< com::sun::star::awt::XControlModel > & rxDialogModel,
+    static void             insertControlModel( com::sun::star::uno::Reference< com::sun::star::awt::XControlModel > const & rxDialogModel,
                                                 OUString const & rServiceName,
                                                 OUString const & rControlName,
                                                 com::sun::star::awt::Rectangle const & rPosSize,


More information about the Libreoffice-commits mailing list