summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-08-15 15:30:09 +0200
committerNoel Grandin <noel@peralex.com>2014-08-18 11:07:31 +0200
commit3b6091ca42cd2d9f230e7d81648c34f3d7085107 (patch)
tree6bc9e56e46bfabd7e03915a307bbce675536a98a /framework
parenta51c423743835793bf132c925ad962283fd2dc22 (diff)
document the swap-on-free idiom usage
Effective C++, item 17 Change-Id: I5c6f20c9631f1ca86b481a56ef08d578a7addbad
Diffstat (limited to 'framework')
-rw-r--r--framework/inc/classes/filtercachedata.hxx4
-rw-r--r--framework/inc/stdtypes.h4
-rw-r--r--framework/inc/uifactory/configurationaccessfactorymanager.hxx2
-rw-r--r--framework/inc/uifactory/factoryconfiguration.hxx2
-rw-r--r--framework/inc/xml/imagesdocumenthandler.hxx2
-rw-r--r--framework/inc/xml/statusbardocumenthandler.hxx2
-rw-r--r--framework/inc/xml/toolboxdocumenthandler.hxx2
-rw-r--r--framework/source/uielement/controlmenucontroller.cxx2
8 files changed, 10 insertions, 10 deletions
diff --git a/framework/inc/classes/filtercachedata.hxx b/framework/inc/classes/filtercachedata.hxx
index 499e48f85f01..af9053a233f0 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 d814a57eb875..3ff9e0d69170 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 5d6ad0a76072..b4f9afe7c98b 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 8360f8b09a46..2df76a283503 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 7659d39cc17a..b984ced00801 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 88c094ef137b..8242874e1728 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 9eadc337ae01..f1bb2c32226e 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 2604b66f26ac..9c78c1c4efa5 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
}
};