[Libreoffice-commits] core.git: desktop/source framework/inc framework/source

Noel Grandin noel at peralex.com
Mon Aug 18 02:08:07 PDT 2014


 desktop/source/app/dispatchwatcher.hxx                        |    2 +-
 framework/inc/classes/filtercachedata.hxx                     |    4 ++--
 framework/inc/stdtypes.h                                      |    4 ++--
 framework/inc/uifactory/configurationaccessfactorymanager.hxx |    2 +-
 framework/inc/uifactory/factoryconfiguration.hxx              |    2 +-
 framework/inc/xml/imagesdocumenthandler.hxx                   |    2 +-
 framework/inc/xml/statusbardocumenthandler.hxx                |    2 +-
 framework/inc/xml/toolboxdocumenthandler.hxx                  |    2 +-
 framework/source/uielement/controlmenucontroller.cxx          |    2 +-
 9 files changed, 11 insertions(+), 11 deletions(-)

New commits:
commit 3b6091ca42cd2d9f230e7d81648c34f3d7085107
Author: Noel Grandin <noel at peralex.com>
Date:   Fri Aug 15 15:30:09 2014 +0200

    document the swap-on-free idiom usage
    
    Effective C++, item 17
    
    Change-Id: I5c6f20c9631f1ca86b481a56ef08d578a7addbad

diff --git a/desktop/source/app/dispatchwatcher.hxx b/desktop/source/app/dispatchwatcher.hxx
index 125e9d9..228b6a1 100644
--- a/desktop/source/app/dispatchwatcher.hxx
+++ b/desktop/source/app/dispatchwatcher.hxx
@@ -44,7 +44,7 @@ class DispatchWatcherHashMap : public ::boost::unordered_map< OUString, sal_Int3
     public:
         inline void free()
         {
-            DispatchWatcherHashMap().swap( *this );
+            DispatchWatcherHashMap().swap( *this ); // get rid of reserved capacity
         }
 };
 
diff --git a/framework/inc/classes/filtercachedata.hxx b/framework/inc/classes/filtercachedata.hxx
index 499e48f..af9053a 100644
--- a/framework/inc/classes/filtercachedata.hxx
+++ b/framework/inc/classes/filtercachedata.hxx
@@ -337,7 +337,7 @@ class SetNodeHash : public ::boost::unordered_map< OUString                    ,
 
         inline void free()
         {
-            SetNodeHash().swap( *this );
+            SetNodeHash().swap( *this ); // get rid of reserved capacity
             lAddedItems.free  ();
             lChangedItems.free();
             lRemovedItems.free();
@@ -372,7 +372,7 @@ class PerformanceHash   :   public  ::boost::unordered_map<    OUString
 
         inline void free()
         {
-            PerformanceHash().swap( *this );
+            PerformanceHash().swap( *this ); // get rid of reserved capacity
         }
 
         //  normaly a complete string must match our hash key values ...
diff --git a/framework/inc/stdtypes.h b/framework/inc/stdtypes.h
index d814a57..3ff9e0d 100644
--- a/framework/inc/stdtypes.h
+++ b/framework/inc/stdtypes.h
@@ -108,7 +108,7 @@ class OUStringList : public ::comphelper::SequenceAsVector< OUString >
         // the only way to free used memory really!
         void free()
         {
-            OUStringList().swap( *this );
+            OUStringList().swap( *this );// get rid of reserved capacity
         }
 };
 
@@ -135,7 +135,7 @@ class BaseHash : public ::boost::unordered_map< OUString                    ,
         // the only way to free used memory really!
         void free()
         {
-            BaseHash().swap( *this );
+            BaseHash().swap( *this );// get rid of reserved capacity
         }
 };
 
diff --git a/framework/inc/uifactory/configurationaccessfactorymanager.hxx b/framework/inc/uifactory/configurationaccessfactorymanager.hxx
index 5d6ad0a..b4f9afe 100644
--- a/framework/inc/uifactory/configurationaccessfactorymanager.hxx
+++ b/framework/inc/uifactory/configurationaccessfactorymanager.hxx
@@ -63,7 +63,7 @@ namespace framework {
         {
             inline void free()
             {
-                FactoryManagerMap().swap( *this );
+                FactoryManagerMap().swap( *this );// get rid of reserved capacity
             }
         };
 
diff --git a/framework/inc/uifactory/factoryconfiguration.hxx b/framework/inc/uifactory/factoryconfiguration.hxx
index 8360f8b..2df76a2 100644
--- a/framework/inc/uifactory/factoryconfiguration.hxx
+++ b/framework/inc/uifactory/factoryconfiguration.hxx
@@ -80,7 +80,7 @@ private:
     {
         inline void free()
         {
-            MenuControllerMap().swap( *this );
+            MenuControllerMap().swap( *this );// get rid of reserved capacity
         }
     };
 
diff --git a/framework/inc/xml/imagesdocumenthandler.hxx b/framework/inc/xml/imagesdocumenthandler.hxx
index 7659d39..b984ced 100644
--- a/framework/inc/xml/imagesdocumenthandler.hxx
+++ b/framework/inc/xml/imagesdocumenthandler.hxx
@@ -116,7 +116,7 @@ class OReadImagesDocumentHandler : public ::cppu::WeakImplHelper1< ::com::sun::s
             public:
                 inline void free()
                 {
-                    ImageHashMap().swap( *this );
+                    ImageHashMap().swap( *this );// get rid of reserved capacity
                 }
         };
 
diff --git a/framework/inc/xml/statusbardocumenthandler.hxx b/framework/inc/xml/statusbardocumenthandler.hxx
index 88c094e..8242874 100644
--- a/framework/inc/xml/statusbardocumenthandler.hxx
+++ b/framework/inc/xml/statusbardocumenthandler.hxx
@@ -112,7 +112,7 @@ class FWE_DLLPUBLIC OReadStatusBarDocumentHandler :
             public:
                 inline void free()
                 {
-                    StatusBarHashMap().swap( *this );
+                    StatusBarHashMap().swap( *this );// get rid of reserved capacity
                 }
         };
 
diff --git a/framework/inc/xml/toolboxdocumenthandler.hxx b/framework/inc/xml/toolboxdocumenthandler.hxx
index 9eadc33..f1bb2c3 100644
--- a/framework/inc/xml/toolboxdocumenthandler.hxx
+++ b/framework/inc/xml/toolboxdocumenthandler.hxx
@@ -117,7 +117,7 @@ class FWE_DLLPUBLIC OReadToolBoxDocumentHandler :
             public:
                 inline void free()
                 {
-                    ToolBoxHashMap().swap( *this );
+                    ToolBoxHashMap().swap( *this );// get rid of reserved capacity
                 }
         };
 
diff --git a/framework/source/uielement/controlmenucontroller.cxx b/framework/source/uielement/controlmenucontroller.cxx
index 2604b66..9c78c1c 100644
--- a/framework/source/uielement/controlmenucontroller.cxx
+++ b/framework/source/uielement/controlmenucontroller.cxx
@@ -229,7 +229,7 @@ private:
         public:
             inline void free()
             {
-                UrlToDispatchMap().swap( *this );
+                UrlToDispatchMap().swap( *this );// get rid of reserved capacity
             }
     };
 


More information about the Libreoffice-commits mailing list