[Libreoffice-commits] core.git: 2 commits - Repository.mk stoc/source

Caolán McNamara caolanm at redhat.com
Mon Mar 7 13:24:10 UTC 2016


 Repository.mk                         |    4 -
 stoc/source/inspect/introspection.cxx |  110 ++++++++++++++++------------------
 2 files changed, 56 insertions(+), 58 deletions(-)

New commits:
commit e451b03e8c21ad23cb1abfd6dd68b6d1e8188121
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Mar 7 13:19:55 2016 +0000

    gtktiledviewer needs gtk3 not gtk2
    
    Change-Id: Iede2008139cb570ff65202762e92f6694548a065

diff --git a/Repository.mk b/Repository.mk
index e9cd89a..423d58b 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -68,13 +68,13 @@ $(eval $(call gb_Helper_register_executables,NONE, \
         svptest \
         svpclient \
         pixelctl ) \
-	$(if $(and $(ENABLE_GTK), $(filter LINUX %BSD SOLARIS,$(OS))), tilebench) \
+	$(if $(and $(ENABLE_GTK3), $(filter LINUX %BSD SOLARIS,$(OS))), tilebench) \
 	$(if $(filter LINUX MACOSX SOLARIS WNT %BSD,$(OS)),icontest \
 	    outdevgrind) \
 	vcldemo \
 	tiledrendering \
     mtfdemo \
-	$(if $(and $(ENABLE_GTK), $(filter LINUX %BSD SOLARIS,$(OS))), gtktiledviewer) \
+	$(if $(and $(ENABLE_GTK3), $(filter LINUX %BSD SOLARIS,$(OS))), gtktiledviewer) \
 ))
 
 $(eval $(call gb_Helper_register_executables_for_install,SDK,sdk, \
commit a998217202106f65e52f743db0cad8209d6ee972
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Mar 7 13:12:49 2016 +0000

    return early and drop else
    
    Change-Id: I4887f01c94e6d7d716d2a074d503fca505a4aff8

diff --git a/stoc/source/inspect/introspection.cxx b/stoc/source/inspect/introspection.cxx
index 2393dd7..0148540 100644
--- a/stoc/source/inspect/introspection.cxx
+++ b/stoc/source/inspect/introspection.cxx
@@ -290,90 +290,88 @@ IntrospectionAccessStatic_Impl::IntrospectionAccessStatic_Impl( Reference< XIdlR
 
 sal_Int32 IntrospectionAccessStatic_Impl::getPropertyIndex( const OUString& aPropertyName ) const
 {
-    sal_Int32 iHashResult = -1;
     IntrospectionAccessStatic_Impl* pThis = const_cast<IntrospectionAccessStatic_Impl*>(this);
     IntrospectionNameMap::iterator aIt = pThis->maPropertyNameMap.find( aPropertyName );
     if (aIt != pThis->maPropertyNameMap.end())
-        iHashResult = (*aIt).second;
-    return iHashResult;
+        return aIt->second;
+
+    return -1;
 }
 
 sal_Int32 IntrospectionAccessStatic_Impl::getMethodIndex( const OUString& aMethodName ) const
 {
-    sal_Int32 iHashResult = -1;
     IntrospectionAccessStatic_Impl* pThis = const_cast<IntrospectionAccessStatic_Impl*>(this);
     IntrospectionNameMap::iterator aIt = pThis->maMethodNameMap.find( aMethodName );
     if (aIt != pThis->maMethodNameMap.end())
     {
-        iHashResult = (*aIt).second;
+        return aIt->second;
     }
+
     // #95159 Check if full qualified name matches
-    else
+    sal_Int32 iHashResult = -1;
+    sal_Int32 nSearchFrom = aMethodName.getLength();
+    while( true )
     {
-        sal_Int32 nSearchFrom = aMethodName.getLength();
-        while( true )
-        {
-            // Strategy: Search back until the first '_' is found
-            sal_Int32 nFound = aMethodName.lastIndexOf( '_', nSearchFrom );
-            if( nFound == -1 )
-                break;
+        // Strategy: Search back until the first '_' is found
+        sal_Int32 nFound = aMethodName.lastIndexOf( '_', nSearchFrom );
+        if( nFound == -1 )
+            break;
 
-            OUString aPureMethodName = aMethodName.copy( nFound + 1 );
+        OUString aPureMethodName = aMethodName.copy( nFound + 1 );
 
-            aIt = pThis->maMethodNameMap.find( aPureMethodName );
-            if (aIt != pThis->maMethodNameMap.end())
+        aIt = pThis->maMethodNameMap.find( aPureMethodName );
+        if (aIt != pThis->maMethodNameMap.end())
+        {
+            // Check if it can be a type?
+            // Problem: Does not work if package names contain _ ?!
+            OUString aStr = aMethodName.copy( 0, nFound );
+            OUString aTypeName = aStr.replace( '_', '.' );
+            Reference< XIdlClass > xClass = mxCoreReflection->forName( aTypeName );
+            if( xClass.is() )
             {
-                // Check if it can be a type?
-                // Problem: Does not work if package names contain _ ?!
-                OUString aStr = aMethodName.copy( 0, nFound );
-                OUString aTypeName = aStr.replace( '_', '.' );
-                Reference< XIdlClass > xClass = mxCoreReflection->forName( aTypeName );
-                if( xClass.is() )
-                {
-                    // If this is a valid class it could be the right method
+                // If this is a valid class it could be the right method
 
-                    // Could be the right method, type has to be checked
-                    iHashResult = (*aIt).second;
+                // Could be the right method, type has to be checked
+                iHashResult = aIt->second;
 
-                    const Reference<XIdlMethod> xMethod = maAllMethodSeq.at(iHashResult);
+                const Reference<XIdlMethod> xMethod = maAllMethodSeq.at(iHashResult);
 
-                    Reference< XIdlClass > xMethClass = xMethod->getDeclaringClass();
-                    if( xClass->equals( xMethClass ) )
-                    {
-                        break;
-                    }
-                    else
-                    {
-                        iHashResult = -1;
+                Reference< XIdlClass > xMethClass = xMethod->getDeclaringClass();
+                if( xClass->equals( xMethClass ) )
+                {
+                    break;
+                }
+                else
+                {
+                    iHashResult = -1;
 
-                        // Could also be another method with the same name
-                        // Iterate over all methods
-                        size_t nLen = maAllMethodSeq.size();
-                        for (size_t i = 0; i < nLen; ++i)
+                    // Could also be another method with the same name
+                    // Iterate over all methods
+                    size_t nLen = maAllMethodSeq.size();
+                    for (size_t i = 0; i < nLen; ++i)
+                    {
+                        const Reference<XIdlMethod> xMethod2 = maAllMethodSeq[ i ];
+                        if( xMethod2->getName() == aPureMethodName )
                         {
-                            const Reference<XIdlMethod> xMethod2 = maAllMethodSeq[ i ];
-                            if( xMethod2->getName() == aPureMethodName )
-                            {
-                                Reference< XIdlClass > xMethClass2 = xMethod2->getDeclaringClass();
+                            Reference< XIdlClass > xMethClass2 = xMethod2->getDeclaringClass();
 
-                                if( xClass->equals( xMethClass2 ) )
-                                {
-                                    iHashResult = i;
-                                    break;
-                                }
+                            if( xClass->equals( xMethClass2 ) )
+                            {
+                                iHashResult = i;
+                                break;
                             }
                         }
-
-                        if( iHashResult != -1 )
-                            break;
                     }
+
+                    if( iHashResult != -1 )
+                        break;
                 }
             }
-
-            nSearchFrom = nFound - 1;
-            if( nSearchFrom < 0 )
-                break;
         }
+
+        nSearchFrom = nFound - 1;
+        if( nSearchFrom < 0 )
+            break;
     }
     return iHashResult;
 }
@@ -2378,7 +2376,7 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
                             }
                             else
                             {
-                                sal_Int32 iHashResult = (*aIt).second;
+                                sal_Int32 iHashResult = aIt->second;
 
                                 Reference<XIdlMethod> xExistingMethod = pAccess->maAllMethodSeq.at(iHashResult);
 


More information about the Libreoffice-commits mailing list