[Libreoffice-commits] .: Branch 'libreoffice-3-4' - basic/source
Caolán McNamara
caolan at kemper.freedesktop.org
Mon Nov 21 02:29:51 PST 2011
basic/source/classes/sb.cxx | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
New commits:
commit 738622d199a64327048d6a40953499b9dca5c008
Author: Michael Meeks <michael.meeks at novell.com>
Date: Mon Jul 25 18:08:29 2011 +0100
fdo#39520 - turn DocBasicItems into an rtl::Static to improve shutdown on mac
Signed-off-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index f9cbab6..9ef8de3 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -164,33 +164,33 @@ namespace {
typedef ::rtl::Reference< DocBasicItem > DocBasicItemRef;
typedef boost::unordered_map< const StarBASIC *, DocBasicItemRef > DocBasicItemMap;
- // ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > ModuleInitDependencyMap;
-static DocBasicItemMap GaDocBasicItems;
+class GaDocBasicItems : public rtl::Static<DocBasicItemMap,GaDocBasicItems> {};
const DocBasicItem* lclFindDocBasicItem( const StarBASIC* pDocBasic )
{
- DocBasicItemMap::iterator it = GaDocBasicItems.find( pDocBasic );
- return (it != GaDocBasicItems.end()) ? it->second.get() : 0;
+ DocBasicItemMap::iterator it = GaDocBasicItems::get().find( pDocBasic );
+ DocBasicItemMap::iterator end = GaDocBasicItems::get().end();
+ return (it != end) ? it->second.get() : 0;
}
void lclInsertDocBasicItem( StarBASIC& rDocBasic )
{
- DocBasicItemRef& rxDocBasicItem = GaDocBasicItems[ &rDocBasic ];
+ DocBasicItemRef& rxDocBasicItem = GaDocBasicItems::get()[ &rDocBasic ];
rxDocBasicItem.set( new DocBasicItem( rDocBasic ) );
rxDocBasicItem->startListening();
}
void lclRemoveDocBasicItem( StarBASIC& rDocBasic )
{
- DocBasicItemMap::iterator it = GaDocBasicItems.find( &rDocBasic );
- if( it != GaDocBasicItems.end() )
+ DocBasicItemMap::iterator it = GaDocBasicItems::get().find( &rDocBasic );
+ if( it != GaDocBasicItems::get().end() )
{
it->second->stopListening();
- GaDocBasicItems.erase( it );
+ GaDocBasicItems::get().erase( it );
}
- DocBasicItemMap::iterator it_end = GaDocBasicItems.end();
- for( it = GaDocBasicItems.begin(); it != it_end; ++it )
+ DocBasicItemMap::iterator it_end = GaDocBasicItems::get().end();
+ for( it = GaDocBasicItems::get().begin(); it != it_end; ++it )
it->second->clearDependingVarsOnDelete( rDocBasic );
}
More information about the Libreoffice-commits
mailing list