[Libreoffice-commits] .: 3 commits - framework/Library_lomenubar.mk framework/source scripting/source sfx2/source

Bjoern Michaelsen bmichaelsen at kemper.freedesktop.org
Sat Jul 14 07:09:22 PDT 2012


 framework/Library_lomenubar.mk                        |    1 
 framework/source/lomenubar/FrameHelper.cxx            |    3 +-
 framework/source/lomenubar/MenuItemInfo.cxx           |   10 +++---
 framework/source/lomenubar/MenuItemInfo.hxx           |   10 +++---
 framework/source/lomenubar/MenuItemStatusListener.cxx |   16 +++++------
 scripting/source/stringresource/stringresource.cxx    |   26 +++++++++---------
 sfx2/source/appl/lnkbase2.cxx                         |    2 -
 sfx2/source/dialog/filtergrouping.cxx                 |    4 +-
 8 files changed, 37 insertions(+), 35 deletions(-)

New commits:
commit d3bfd982137dcfc90ca922e2471a07e58b1c0164
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Sat Jul 14 12:39:28 2012 +0200

    fix breaker introduced by 0fcd1a73f0e1ec564f3c6da1ccd890183d3c18db
    
    Change-Id: I5e60c2d157e53831fb8239ca6d833aaca6735994

diff --git a/framework/Library_lomenubar.mk b/framework/Library_lomenubar.mk
index 7ce6d10..3536625 100644
--- a/framework/Library_lomenubar.mk
+++ b/framework/Library_lomenubar.mk
@@ -42,6 +42,7 @@ $(eval $(call gb_Library_use_libraries,lomenubar,\
 	sal \
 	cppu \
 	cppuhelper \
+    comphelper \
 	X11 \
 	$(gb_STDLIBS) \
 ))
diff --git a/framework/source/lomenubar/FrameHelper.cxx b/framework/source/lomenubar/FrameHelper.cxx
index 8f0e622..12edf35 100644
--- a/framework/source/lomenubar/FrameHelper.cxx
+++ b/framework/source/lomenubar/FrameHelper.cxx
@@ -64,6 +64,7 @@
 #include <com/sun/star/ui/XAcceleratorConfiguration.hpp>
 #include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp>
 #include <rtl/process.h>
+#include <comphelper/componentcontext.hxx>
 
 #include <gio/gio.h>
 //#pragma GCC diagnostic push
@@ -261,7 +262,7 @@ FrameHelper::FrameHelper(const Reference< XMultiServiceFactory >&  rServiceManag
     : m_xStatusListener(new MenuItemStatusListener(this))
     , m_pDispatchRegistry(new framework::lomenubar::DispatchRegistry(m_xStatusListener))
     , m_xMSF(rServiceManager)
-    , m_xTrans(util::URLTransformer::create(m_xMSF))
+    , m_xTrans(util::URLTransformer::create(comphelper::ComponentContext(m_xMSF).getUNOContext()))
     , m_xMM(m_xMSF->createInstance(OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.ModuleManager"))),UNO_QUERY)
     , m_xPCF(m_xMSF->createInstance(OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.PopupMenuControllerFactory"))), UNO_QUERY)
     , m_xFrame(xFrame)
commit d24b51826109f73a23386b69879de66967a600db
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Sat Jul 14 12:30:24 2012 +0200

    Revert "Some cppcheck cleaning"
    
    This reverts commit b21661ce4200fd8040a213770a3f9e63a4b9f137.
    
    this breaks with ../framework/source/lomenubar/MenuItemInfo.hxx:49:12: error: expected ‘;’ at end of member declaration

diff --git a/framework/source/lomenubar/MenuItemInfo.cxx b/framework/source/lomenubar/MenuItemInfo.cxx
index 02a8e7c..18c159d 100644
--- a/framework/source/lomenubar/MenuItemInfo.cxx
+++ b/framework/source/lomenubar/MenuItemInfo.cxx
@@ -74,31 +74,31 @@ MenuItemInfo::setVisible (gboolean is_visible)
 
 //Getters
 gchar*
-MenuItemInfo::getLabel const()
+MenuItemInfo::getLabel ()
 {
     return m_label;
 }
 
 gboolean
-MenuItemInfo::getEnabled const()
+MenuItemInfo::getEnabled ()
 {
     return m_is_enabled;
 }
 
 gint
-MenuItemInfo::getCheckState const()
+MenuItemInfo::getCheckState ()
 {
     return m_check_state;
 }
 
 const gchar*
-MenuItemInfo::getCheckType const()
+MenuItemInfo::getCheckType ()
 {
     return m_check_type;
 }
 
 gboolean
-MenuItemInfo::getVisible const()
+MenuItemInfo::getVisible ()
 {
     return m_is_visible;
 }
diff --git a/framework/source/lomenubar/MenuItemInfo.hxx b/framework/source/lomenubar/MenuItemInfo.hxx
index 2429976..72d411c 100644
--- a/framework/source/lomenubar/MenuItemInfo.hxx
+++ b/framework/source/lomenubar/MenuItemInfo.hxx
@@ -46,11 +46,11 @@ class MenuItemInfo {
     void setVisible (gboolean is_visible);
 
     //Getters
-    gchar*       getLabel const();
-    gboolean     getEnabled const();
-    gint         getCheckState const();
-    const gchar* getCheckType const();
-    gboolean     getVisible const();
+    gchar*       getLabel ();
+    gboolean     getEnabled ();
+    gint         getCheckState ();
+    const gchar* getCheckType ();
+    gboolean     getVisible ();
 };
 #endif // __MENU_ITEM_INFO_HXX__
 
diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx
index b0d4eb6..c26492b 100644
--- a/scripting/source/stringresource/stringresource.cxx
+++ b/scripting/source/stringresource/stringresource.cxx
@@ -113,13 +113,13 @@ StringResourceImpl::StringResourceImpl( const Reference< XComponentContext >& rx
 
 StringResourceImpl::~StringResourceImpl()
 {
-    for( LocaleItemVectorIt it = m_aLocaleItemVector.begin(); it != m_aLocaleItemVector.end(); ++it )
+    for( LocaleItemVectorIt it = m_aLocaleItemVector.begin(); it != m_aLocaleItemVector.end(); it++ )
     {
         LocaleItem* pLocaleItem = *it;
         delete pLocaleItem;
     }
 
-    for( LocaleItemVectorIt it = m_aDeletedLocaleItemVector.begin(); it != m_aDeletedLocaleItemVector.end(); ++it )
+    for( LocaleItemVectorIt it = m_aDeletedLocaleItemVector.begin(); it != m_aDeletedLocaleItemVector.end(); it++ )
     {
         LocaleItem* pLocaleItem = *it;
         delete pLocaleItem;
@@ -316,7 +316,7 @@ Sequence< Locale > StringResourceImpl::getLocales(  )
     Sequence< Locale > aLocalSeq( nSize );
     Locale* pLocales = aLocalSeq.getArray();
     int iTarget = 0;
-    for( LocaleItemVectorConstIt it = m_aLocaleItemVector.begin(); it != m_aLocaleItemVector.end(); ++it )
+    for( LocaleItemVectorConstIt it = m_aLocaleItemVector.begin(); it != m_aLocaleItemVector.end(); it++ )
     {
         LocaleItem* pLocaleItem = *it;
         pLocales[iTarget] = pLocaleItem->m_locale;
@@ -556,7 +556,7 @@ void StringResourceImpl::removeLocale( const Locale& locale )
             if( m_pCurrentLocaleItem == pRemoveItem ||
                 m_pDefaultLocaleItem  == pRemoveItem )
             {
-                for( LocaleItemVectorIt it = m_aLocaleItemVector.begin(); it != m_aLocaleItemVector.end(); ++it )
+                for( LocaleItemVectorIt it = m_aLocaleItemVector.begin(); it != m_aLocaleItemVector.end(); it++ )
                 {
                     LocaleItem* pLocaleItem = *it;
                     if( pLocaleItem != pRemoveItem )
@@ -576,7 +576,7 @@ void StringResourceImpl::removeLocale( const Locale& locale )
                 }
             }
         }
-        for( LocaleItemVectorIt it = m_aLocaleItemVector.begin(); it != m_aLocaleItemVector.end(); ++it )
+        for( LocaleItemVectorIt it = m_aLocaleItemVector.begin(); it != m_aLocaleItemVector.end(); it++ )
         {
             LocaleItem* pLocaleItem = *it;
             if( pLocaleItem == pRemoveItem )
@@ -656,7 +656,7 @@ LocaleItem* StringResourceImpl::getItemForLocale
     LocaleItem* pRetItem = NULL;
 
     // Search for locale
-    for( LocaleItemVectorConstIt it = m_aLocaleItemVector.begin(); it != m_aLocaleItemVector.end(); ++it )
+    for( LocaleItemVectorConstIt it = m_aLocaleItemVector.begin(); it != m_aLocaleItemVector.end(); it++ )
     {
         LocaleItem* pLocaleItem = *it;
         if( pLocaleItem )
@@ -689,7 +689,7 @@ LocaleItem* StringResourceImpl::getClosestMatchItemForLocale( const Locale& loca
     // Search for locale
     for( sal_Int32 iPass = 0 ; iPass <= 2 ; ++iPass )
     {
-        for( LocaleItemVectorConstIt it = m_aLocaleItemVector.begin(); it != m_aLocaleItemVector.end(); ++it )
+        for( LocaleItemVectorConstIt it = m_aLocaleItemVector.begin(); it != m_aLocaleItemVector.end(); it++ )
         {
             LocaleItem* pLocaleItem = *it;
             if( pLocaleItem )
@@ -1048,7 +1048,7 @@ void StringResourcePersistenceImpl::implStoreAtStorage
         }
     }
 
-    for( LocaleItemVectorConstIt it = m_aLocaleItemVector.begin(); it != m_aLocaleItemVector.end(); ++it )
+    for( LocaleItemVectorConstIt it = m_aLocaleItemVector.begin(); it != m_aLocaleItemVector.end(); it++ )
     {
         LocaleItem* pLocaleItem = *it;
         if( pLocaleItem != NULL && (bStoreAll || pLocaleItem->m_bModified) &&
@@ -1087,7 +1087,7 @@ void StringResourcePersistenceImpl::implStoreAtStorage
     if( bUsedForStore )
     {
         for( LocaleItemVectorIt it = m_aChangedDefaultLocaleVector.begin();
-             it != m_aChangedDefaultLocaleVector.end(); ++it )
+             it != m_aChangedDefaultLocaleVector.end(); it++ )
         {
             LocaleItem* pLocaleItem = *it;
             if( pLocaleItem != NULL )
@@ -1182,7 +1182,7 @@ void StringResourcePersistenceImpl::implKillChangedDefaultFiles
 {
     // Delete files for changed defaults
     for( LocaleItemVectorIt it = m_aChangedDefaultLocaleVector.begin();
-         it != m_aChangedDefaultLocaleVector.end(); ++it )
+         it != m_aChangedDefaultLocaleVector.end(); it++ )
     {
         LocaleItem* pLocaleItem = *it;
         if( pLocaleItem != NULL )
@@ -1214,7 +1214,7 @@ void StringResourcePersistenceImpl::implStoreAtLocation
     if( bUsedForStore || bKillAll )
         implKillRemovedLocaleFiles( Location, aNameBase, xFileAccess );
 
-    for( LocaleItemVectorConstIt it = m_aLocaleItemVector.begin(); it != m_aLocaleItemVector.end(); ++it )
+    for( LocaleItemVectorConstIt it = m_aLocaleItemVector.begin(); it != m_aLocaleItemVector.end(); it++ )
     {
         LocaleItem* pLocaleItem = *it;
         if( pLocaleItem != NULL && (bStoreAll || bKillAll || pLocaleItem->m_bModified) &&
@@ -1417,7 +1417,7 @@ Sequence< sal_Int8 > StringResourcePersistenceImpl::exportBinary(  )
     sal_Int32 iLocale = 0;
     sal_Int32 iDefault = 0;
     for( LocaleItemVectorConstIt it = m_aLocaleItemVector.begin();
-         it != m_aLocaleItemVector.end(); ++it,++iLocale )
+         it != m_aLocaleItemVector.end(); it++,iLocale++ )
     {
         LocaleItem* pLocaleItem = *it;
         if( pLocaleItem != NULL && loadLocale( pLocaleItem ) )
@@ -1726,7 +1726,7 @@ bool checkNamingSceme( const ::rtl::OUString& aName, const ::rtl::OUString& aNam
 
 void StringResourcePersistenceImpl::implLoadAllLocales( void )
 {
-    for( LocaleItemVectorIt it = m_aLocaleItemVector.begin(); it != m_aLocaleItemVector.end(); ++it )
+    for( LocaleItemVectorIt it = m_aLocaleItemVector.begin(); it != m_aLocaleItemVector.end(); it++ )
     {
         LocaleItem* pLocaleItem = *it;
         if( pLocaleItem != NULL )
diff --git a/sfx2/source/appl/lnkbase2.cxx b/sfx2/source/appl/lnkbase2.cxx
index 8bc6704..d22c4fd 100644
--- a/sfx2/source/appl/lnkbase2.cxx
+++ b/sfx2/source/appl/lnkbase2.cxx
@@ -620,7 +620,7 @@ static DdeTopic* FindTopic( const String & rLinkName, sal_uInt16* pItemStt )
             for( int i = 0; i < 2; ++i )
             {
                 for( std::vector<DdeTopic*>::iterator iterTopic = rTopics.begin();
-                     iterTopic != rTopics.end(); ++iterTopic )
+                     iterTopic != rTopics.end(); iterTopic++ )
                     if( (*iterTopic)->GetName() == sTopic )
                         return *iterTopic;
 
diff --git a/sfx2/source/dialog/filtergrouping.cxx b/sfx2/source/dialog/filtergrouping.cxx
index ce73733..2745d65 100644
--- a/sfx2/source/dialog/filtergrouping.cxx
+++ b/sfx2/source/dialog/filtergrouping.cxx
@@ -1048,7 +1048,7 @@ namespace sfx2
         if ( xFilterGroupManager.is() )
         {
             // Add both html/pdf filter as a filter group to get a separator between both groups
-            if ( !aImportantFilterGroup.empty() )
+            if ( aImportantFilterGroup.size() > 0 )
             {
                 Sequence< StringPair > aFilters( aImportantFilterGroup.size() );
                 for ( sal_Int32 i = 0; i < (sal_Int32)aImportantFilterGroup.size(); i++ )
@@ -1068,7 +1068,7 @@ namespace sfx2
                 }
             }
 
-            if ( !aFilterGroup.empty() )
+            if ( aFilterGroup.size() > 0 )
             {
                 Sequence< StringPair > aFilters( aFilterGroup.size() );
                 for ( sal_Int32 i = 0; i < (sal_Int32)aFilterGroup.size(); i++ )
commit feca4833447be51e97bcd8f1672e5256bf8c27b2
Author: Christophe JAILLET <christophe.jaillet at wanadoo.fr>
Date:   Wed Jul 11 00:16:18 2012 +0200

    Simplify code and correct the erroneous length parameter for "macro:///" and align text
    
    Change-Id: Id9eef27636c5c74857ed05b891514bee70903c3b

diff --git a/framework/source/lomenubar/MenuItemStatusListener.cxx b/framework/source/lomenubar/MenuItemStatusListener.cxx
index e57c53a..16a40de 100644
--- a/framework/source/lomenubar/MenuItemStatusListener.cxx
+++ b/framework/source/lomenubar/MenuItemStatusListener.cxx
@@ -58,17 +58,17 @@ MenuItemStatusListener::statusChanged(const FeatureStateEvent& Event)
     //For some reason, URLs can slip through as labels, we make sure
     //this doesn't happen.
     if ((Event.State >>= oULabel) &&
-        !oULabel.matchAsciiL ("private:", 8, 0) &&
-        !oULabel.matchAsciiL (".uno:", 5, 0)    &&
-        !oULabel.matchAsciiL ("slot:", 5, 0)    &&
-        !oULabel.matchAsciiL ("service:", 8, 0) &&
-        !oULabel.matchAsciiL (".cmd:", 5, 0)    &&
-        !oULabel.matchAsciiL ("macro:///", 5, 0))
+        !oULabel.match ("private:", 0) &&
+        !oULabel.match (".uno:", 0)    &&
+        !oULabel.match ("slot:", 0)    &&
+        !oULabel.match ("service:", 0) &&
+        !oULabel.match (".cmd:", 0)    &&
+        !oULabel.match ("macro:///", 0))
     {
         oULabel = oULabel.replace ((sal_Unicode)0x007e, (sal_Unicode)0x005f);
         gchar* label = g_utf16_to_utf8 (oULabel.getStr(),
-                                 oULabel.getLength(),
-                                 NULL, NULL, NULL);
+                                        oULabel.getLength(),
+                                        NULL, NULL, NULL);
         info->setLabel (label);
         g_free (label);
     }


More information about the Libreoffice-commits mailing list