[Libreoffice-commits] .: 10 commits - drawinglayer/source editeng/source fpicker/source framework/uiconfig officecfg/registry readlicense_oo/odt readlicense_oo/prj sfx2/inc

René Engelhard rene at kemper.freedesktop.org
Fri Nov 26 08:51:39 PST 2010


 drawinglayer/source/primitive2d/metafileprimitive2d.cxx              |   12 ++++++----
 editeng/source/misc/svxacorr.cxx                                     |    2 -
 fpicker/source/unx/gnome/SalGtkFilePicker.cxx                        |    2 -
 framework/uiconfig/startmodule/menubar/menubar.xml                   |    2 -
 officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu |    2 -
 readlicense_oo/odt/makefile.mk                                       |    4 ++-
 readlicense_oo/prj/d.lst                                             |    1 
 sfx2/inc/sfx2/sfxsids.hrc                                            |    2 -
 8 files changed, 17 insertions(+), 10 deletions(-)

New commits:
commit 282305273e2c19b546ba81b934eab815c6e48e37
Merge: 0ddcd21... 84a939e...
Author: Rene Engelhard <rene at debian.org>
Date:   Fri Nov 26 17:50:29 2010 +0100

    Merge branch 'libreoffice-3-3'

commit 84a939e443d0d90eefffa75921d3c921e0bf9c42
Merge: 6e07792... 2a0abc9...
Author: Rene Engelhard <rene at debian.org>
Date:   Fri Nov 26 17:41:54 2010 +0100

    Merge commit 'ooo/OOO330_m17' into libreoffice-3-3

commit 6e077925721c5d8e78f7eee2e09ed68647a03652
Author: Michael Meeks <michael.meeks at novell.com>
Date:   Thu Nov 25 16:30:04 2010 +0000

    disable multiple migrations via MIGRATED stamp file
    
    If we fail to auto-migrate, this can cause lots of pain - since people
    are unaware of where the migration occurs from. Thus - before we start
    migrating, we create a 'MIGRATED' stamp file in the source of that, and
    if this is present next migration, we simply don't migrate - fixed for
    Mechtilde.

diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx
index 2c1d6d6..e66d126 100644
--- a/desktop/source/migration/migration.cxx
+++ b/desktop/source/migration/migration.cxx
@@ -85,6 +85,7 @@ static const ::rtl::OUString ITEM_DESCRIPTOR_LABEL(RTL_CONSTASCII_USTRINGPARAM("
 
 static const ::rtl::OUString MENU_SEPERATOR(RTL_CONSTASCII_USTRINGPARAM(" | "));
 static const ::rtl::OUString MENU_SUBMENU(RTL_CONSTASCII_USTRINGPARAM("..."));
+static const ::rtl::OUString MIGRATION_STAMP_NAME(RTL_CONSTASCII_USTRINGPARAM("/MIGRATED"));
 
 ::rtl::OUString retrieveLabelFromCommand(const ::rtl::OUString& sCommand, const ::rtl::OUString& sModuleIdentifier)
 {
@@ -194,15 +195,31 @@ static const ::rtl::OUString MENU_SUBMENU(RTL_CONSTASCII_USTRINGPARAM("..."));
     return sIdentifier;
 }
 
-sal_Bool MigrationImpl::initializeMigration()
+bool MigrationImpl::alreadyMigrated()
 {
-    sal_Bool bRet = sal_False;
+    rtl::OUString aStr = m_aInfo.userdata + MIGRATION_STAMP_NAME;
+    File aFile(aStr);
+    // create migration stamp, and/or check its existence
+    bool bRet = aFile.open (osl_File_OpenFlag_Write | osl_File_OpenFlag_Create | osl_File_OpenFlag_NoLock) == FileBase::E_EXIST;
+    OSL_TRACE( "File '%s' exists? %d\n",
+             rtl::OUStringToOString(aStr, RTL_TEXTENCODING_ASCII_US).getStr(),
+             bRet );
+    return bRet;
+}
+
+bool MigrationImpl::initializeMigration()
+{
+    bool bRet = false;
 
     if (!checkMigrationCompleted()) {
         readAvailableMigrations(m_vMigrationsAvailable);
         sal_Int32 nIndex = findPreferedMigrationProcess(m_vMigrationsAvailable);
-        if ( nIndex >= 0 )
+        // m_aInfo is now set to the preferred migration source
+        if ( nIndex >= 0 ) {
+            if (alreadyMigrated())
+                return false;
             m_vrMigrations = readMigrationSteps(m_vMigrationsAvailable[nIndex].name);
+        }
 
         bRet = m_aInfo.userdata.getLength() > 0;
     }
@@ -358,7 +375,7 @@ void MigrationImpl::setMigrationCompleted()
     }
 }
 
-sal_Bool MigrationImpl::checkMigrationCompleted()
+bool MigrationImpl::checkMigrationCompleted()
 {
     sal_Bool bMigrationCompleted = sal_False;
     try {
@@ -367,15 +384,17 @@ sal_Bool MigrationImpl::checkMigrationCompleted()
         aPropertySet->getPropertyValue(
             OUString(RTL_CONSTASCII_USTRINGPARAM("MigrationCompleted"))) >>= bMigrationCompleted;
 
-        static const char* pEnv = getenv("SAL_DISABLE_USERMIGRATION" );
-        if( !bMigrationCompleted && pEnv != NULL )
+        if( !bMigrationCompleted && getenv("SAL_DISABLE_USERMIGRATION" ) )
         {
             // migration prevented - fake it's success
             setMigrationCompleted();
+            bMigrationCompleted = sal_True;
         }
     } catch (Exception&) {
         // just return false...
     }
+    OSL_TRACE( "Migration %s", bMigrationCompleted ? "already completed" : "not done" );
+
     return bMigrationCompleted;
 }
 
@@ -1210,7 +1229,7 @@ void MigrationImpl::mergeOldToNewVersion(const uno::Reference< ui::XUIConfigurat
                 for (; i<nCount; ++i)
                 {
                     ::rtl::OUString sCmd;
-                    uno::Sequence< beans::PropertyValue > aTempPropSeq;			
+                    uno::Sequence< beans::PropertyValue > aTempPropSeq;
                     xTemp->getByIndex(i) >>= aTempPropSeq;
                     for (sal_Int32 j=0; j<aTempPropSeq.getLength(); ++j)
                     {
diff --git a/desktop/source/migration/migration_impl.hxx b/desktop/source/migration/migration_impl.hxx
index 835194f..d66caba 100644
--- a/desktop/source/migration/migration_impl.hxx
+++ b/desktop/source/migration/migration_impl.hxx
@@ -207,6 +207,7 @@ private:
 
     // functions to control the migration process
     bool          readAvailableMigrations(migrations_available&);
+    bool          alreadyMigrated();
     migrations_vr readMigrationSteps(const ::rtl::OUString& rMigrationName);
     sal_Int32     findPreferedMigrationProcess(const migrations_available&);
     install_info  findInstallation(const strings_v& rVersions);
@@ -235,12 +236,12 @@ private:
     void refresh();
 
     void setMigrationCompleted();
-    sal_Bool checkMigrationCompleted();
+    bool checkMigrationCompleted();
 
 public:
     MigrationImpl(const NS_UNO::Reference< NS_CSS::lang::XMultiServiceFactory >&);
     ~MigrationImpl();
-    sal_Bool initializeMigration();
+    bool initializeMigration();
     sal_Bool doMigration();
     rtl::OUString getOldVersionName();
 };
commit 448d3cfe248fe733dfcb1d857f016db7780d90a9
Author: Michael Meeks <michael.meeks at novell.com>
Date:   Thu Nov 25 16:25:55 2010 +0000

    fix crash in exiting via disabling lone quick-starter, terminate at idle

diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx
index e495843..26ec5c9 100644
--- a/sfx2/source/appl/shutdownicon.cxx
+++ b/sfx2/source/appl/shutdownicon.cxx
@@ -182,6 +182,9 @@ bool ShutdownIcon::LoadModule( osl::Module **pModule,
     return true;
 }
 
+// These two timeouts are necessary to avoid there being
+// plugin frames still on the stack, after unloading that
+// code, causing a crash during disabling / termination.
 class IdleUnloader : Timer
 {
     ::osl::Module *m_pModule;
@@ -199,6 +202,22 @@ public:
     }
 };
 
+class IdleTerminate : Timer
+{
+    Reference< XDesktop > m_xDesktop;
+public:
+    IdleTerminate (Reference< XDesktop > xDesktop)
+    {
+        m_xDesktop = xDesktop;
+        Start();
+    }
+    virtual void Timeout()
+    {
+        m_xDesktop->terminate();
+        delete this;
+    }
+};
+
 void ShutdownIcon::initSystray()
 {
     if (m_bInitialized)
@@ -576,11 +595,8 @@ void ShutdownIcon::terminateDesktop()
     if ( xSupplier.is() )
     {
         Reference< XIndexAccess > xTasks ( xSupplier->getFrames(), UNO_QUERY );
-        if( xTasks.is() )
-        {
-            if( xTasks->getCount() < 1 )
-                xDesktop->terminate();
-        }
+        if( xTasks.is() && xTasks->getCount() < 1 )
+            new IdleTerminate( xDesktop );
     }
 
     // remove the instance pointer
commit 83d985d952229d5cd9c8c9be572f4b7b05530caa
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date:   Fri Nov 26 15:44:31 2010 +0100

    When saving a docx file to doc, the used filter is docx.

diff --git a/fpicker/source/unx/gnome/SalGtkFilePicker.cxx b/fpicker/source/unx/gnome/SalGtkFilePicker.cxx
index a417f81..6a85798 100644
--- a/fpicker/source/unx/gnome/SalGtkFilePicker.cxx
+++ b/fpicker/source/unx/gnome/SalGtkFilePicker.cxx
@@ -917,7 +917,7 @@ uno::Sequence<rtl::OUString> SAL_CALL SalGtkFilePicker::getSelectedFiles() throw
                               ++aListIter
                         )
                         {
-                            if( aListIter->getFilter().indexOf( aStarDot+sExtension ) >= 0 )
+                            if( aListIter->getFilter().equalsIgnoreAsciiCase( aStarDot+sExtension ) )
                             {
                                 if( !aNewFilter.getLength() )
                                     aNewFilter = aListIter->getTitle();
commit 90c8ee558f5dc1680e1201d24687b065b3f8e7e2
Author: Thorsten Behrens <tbehrens at novell.com>
Date:   Thu Nov 25 23:10:13 2010 +0100

    Put show credits entry into all app ui configs
    
    * fix cmd url typo in GenericCommands.xcu
    * build & deliver credits.odt
    * avoid duplicate slot id for ShowCredits menu item

diff --git a/framework/uiconfig/startmodule/menubar/menubar.xml b/framework/uiconfig/startmodule/menubar/menubar.xml
index fac0b3c..5ac4c3e 100644
--- a/framework/uiconfig/startmodule/menubar/menubar.xml
+++ b/framework/uiconfig/startmodule/menubar/menubar.xml
@@ -76,7 +76,7 @@
             <menu:menuseparator/>
             <menu:menuitem menu:id=".uno:ShowLicense"/>
             <menu:menuseparator/>
-            <menu:menuitem menu:id=".uno:Credits"/>
+            <menu:menuitem menu:id=".uno:ShowCredits"/>
             <menu:menuitem menu:id=".uno:About"/>
         </menu:menupopup>
     </menu:menu>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
index 15dd7d2..ed5a78e 100755
--- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
@@ -4145,7 +4145,7 @@
                     <value xml:lang="en-US">License Information...</value>
                 </prop>
             </node>
-            <node oor:name=".uno:Credits" oor:op="replace">
+            <node oor:name=".uno:ShowCredits" oor:op="replace">
                 <prop oor:name="Label" oor:type="xs:string">
                     <value xml:lang="en-US">%PRODUCTNAME Credits...</value>
                 </prop>
diff --git a/readlicense_oo/odt/makefile.mk b/readlicense_oo/odt/makefile.mk
index 1e68a17..89cea1a 100644
--- a/readlicense_oo/odt/makefile.mk
+++ b/readlicense_oo/odt/makefile.mk
@@ -36,7 +36,7 @@ TARGET=odt
 
 # --- Files --------------------------------------------------------
 
-all: $(MISC)$/LICENSE.odt
+all: $(MISC)$/LICENSE.odt $(MISC)$/CREDITS.odt
 
 # --- Targets ------------------------------------------------------
 
@@ -44,3 +44,5 @@ all: $(MISC)$/LICENSE.odt
 
 $(MISC)$/LICENSE.odt: LICENSE.odt
     $(COPY) LICENSE.odt $@
+$(MISC)$/CREDITS.odt: CREDITS.odt
+    $(COPY) CREDITS.odt $@
diff --git a/readlicense_oo/prj/d.lst b/readlicense_oo/prj/d.lst
index 2a368be..aa771c5 100644
--- a/readlicense_oo/prj/d.lst
+++ b/readlicense_oo/prj/d.lst
@@ -27,6 +27,7 @@ mkdir: %_DEST%\bin%_EXT%\ure
 ..\%__SRC%\misc\THIRDPARTYLICENSEREADME.html %_DEST%\bin%_EXT%\THIRDPARTYLICENSEREADME.html
 
 ..\%__SRC%\misc\LICENSE.odt %_DEST%\bin%_EXT%\LICENSE.odt
+..\%__SRC%\misc\CREDITS.odt %_DEST%\bin%_EXT%\CREDITS.odt
 
 dos: echo =====================================================================
 dos: echo Delivering README files
diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc
index 161237b..c823aaa 100644
--- a/sfx2/inc/sfx2/sfxsids.hrc
+++ b/sfx2/inc/sfx2/sfxsids.hrc
@@ -126,7 +126,7 @@
 #define SID_HELP_HELPFILEBOX				(SID_SFX_START + 419)
 #define SID_HELP_HELPFILEBOX_SELECTED		(SID_SFX_START + 420)
 #define SID_SHOW_LICENSE					(SID_SFX_START + 1683)
-#define SID_SHOW_CREDITS					(SID_SFX_START + 1684)
+#define SID_SHOW_CREDITS					(SID_SFX_START + 1711)
 #define SID_HELP_TUTORIALS					(SID_SFX_START + 1695)
 
 // default-ids for document
commit f10c27040a40cbc9e0b97258c1a0edc5f721d37f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Nov 25 20:36:03 2010 +0000

    Resolves: fdo#31494# get ownership right
    
    Ensure that the mutex lives as long as all its consumers. And
    avoid launching threads if they have no work to do.
    (cherry picked from commit e34373935bff7f1ed8e8bfd06b54383917b1177a)

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index fda967a..0382054 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -166,7 +166,9 @@ void Access::initBroadcaster(
 
 Access::Access(Components & components):
     components_(components), disposed_(false)
-{}
+{
+    lock_ = lock();
+}
 
 Access::~Access() {}
 
@@ -851,7 +853,7 @@ css::uno::Sequence< css::uno::Type > Access::getTypes()
     throw (css::uno::RuntimeException)
 {
     OSL_ASSERT(thisIs(IS_ANY));
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     checkLocalizedPropertyAccess();
     comphelper::SequenceAsVector< css::uno::Type > types;
     types.push_back(cppu::UnoType< css::uno::XInterface >::get());
@@ -900,7 +902,7 @@ css::uno::Sequence< sal_Int8 > Access::getImplementationId()
     throw (css::uno::RuntimeException)
 {
     OSL_ASSERT(thisIs(IS_ANY));
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     checkLocalizedPropertyAccess();
     return css::uno::Sequence< sal_Int8 >();
 }
@@ -908,7 +910,7 @@ css::uno::Sequence< sal_Int8 > Access::getImplementationId()
 rtl::OUString Access::getImplementationName() throw (css::uno::RuntimeException)
 {
     OSL_ASSERT(thisIs(IS_ANY));
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     checkLocalizedPropertyAccess();
     throw css::uno::RuntimeException(
         rtl::OUString(
@@ -921,7 +923,7 @@ sal_Bool Access::supportsService(rtl::OUString const & ServiceName)
     throw (css::uno::RuntimeException)
 {
     OSL_ASSERT(thisIs(IS_ANY));
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     checkLocalizedPropertyAccess();
     css::uno::Sequence< rtl::OUString > names(getSupportedServiceNames());
     for (sal_Int32 i = 0; i < names.getLength(); ++i) {
@@ -936,7 +938,7 @@ css::uno::Sequence< rtl::OUString > Access::getSupportedServiceNames()
     throw (css::uno::RuntimeException)
 {
     OSL_ASSERT(thisIs(IS_ANY));
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     checkLocalizedPropertyAccess();
     comphelper::SequenceAsVector< rtl::OUString > services;
     services.push_back(
@@ -1000,7 +1002,7 @@ void Access::dispose() throw (css::uno::RuntimeException) {
     OSL_ASSERT(thisIs(IS_ANY));
     Broadcaster bc;
     {
-        osl::MutexGuard g(lock);
+        osl::MutexGuard g(*lock_);
         checkLocalizedPropertyAccess();
         if (getParentAccess().is()) {
             throw css::uno::RuntimeException(
@@ -1025,7 +1027,7 @@ void Access::addEventListener(
 {
     OSL_ASSERT(thisIs(IS_ANY));
     {
-        osl::MutexGuard g(lock);
+        osl::MutexGuard g(*lock_);
         checkLocalizedPropertyAccess();
         if (!xListener.is()) {
             throw css::uno::RuntimeException(
@@ -1048,7 +1050,7 @@ void Access::removeEventListener(
     throw (css::uno::RuntimeException)
 {
     OSL_ASSERT(thisIs(IS_ANY));
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     checkLocalizedPropertyAccess();
     DisposeListeners::iterator i(disposeListeners_.find(aListener));
     if (i != disposeListeners_.end()) {
@@ -1058,7 +1060,7 @@ void Access::removeEventListener(
 
 css::uno::Type Access::getElementType() throw (css::uno::RuntimeException) {
     OSL_ASSERT(thisIs(IS_ANY));
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     checkLocalizedPropertyAccess();
     rtl::Reference< Node > p(getNode());
     switch (p->kind()) {
@@ -1082,7 +1084,7 @@ css::uno::Type Access::getElementType() throw (css::uno::RuntimeException) {
 
 sal_Bool Access::hasElements() throw (css::uno::RuntimeException) {
     OSL_ASSERT(thisIs(IS_ANY));
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     checkLocalizedPropertyAccess();
     return !getAllChildren().empty(); //TODO: optimize
 }
@@ -1093,7 +1095,7 @@ css::uno::Any Access::getByName(rtl::OUString const & aName)
         css::lang::WrappedTargetException, css::uno::RuntimeException)
 {
     OSL_ASSERT(thisIs(IS_ANY));
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     checkLocalizedPropertyAccess();
     rtl::Reference< ChildAccess > child(getChild(aName));
     if (!child.is()) {
@@ -1107,7 +1109,7 @@ css::uno::Sequence< rtl::OUString > Access::getElementNames()
     throw (css::uno::RuntimeException)
 {
     OSL_ASSERT(thisIs(IS_ANY));
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     checkLocalizedPropertyAccess();
     std::vector< rtl::Reference< ChildAccess > > children(getAllChildren());
     comphelper::SequenceAsVector< rtl::OUString > names;
@@ -1124,7 +1126,7 @@ sal_Bool Access::hasByName(rtl::OUString const & aName)
     throw (css::uno::RuntimeException)
 {
     OSL_ASSERT(thisIs(IS_ANY));
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     checkLocalizedPropertyAccess();
     return getChild(aName).is();
 }
@@ -1133,7 +1135,7 @@ css::uno::Any Access::getByHierarchicalName(rtl::OUString const & aName)
     throw (css::container::NoSuchElementException, css::uno::RuntimeException)
 {
     OSL_ASSERT(thisIs(IS_ANY));
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     checkLocalizedPropertyAccess();
     rtl::Reference< ChildAccess > child(getSubChild(aName));
     if (!child.is()) {
@@ -1147,7 +1149,7 @@ sal_Bool Access::hasByHierarchicalName(rtl::OUString const & aName)
     throw (css::uno::RuntimeException)
 {
     OSL_ASSERT(thisIs(IS_ANY));
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     checkLocalizedPropertyAccess();
     return getSubChild(aName).is();
 }
@@ -1158,7 +1160,7 @@ void Access::addContainerListener(
 {
     OSL_ASSERT(thisIs(IS_ANY));
     {
-        osl::MutexGuard g(lock);
+        osl::MutexGuard g(*lock_);
         checkLocalizedPropertyAccess();
         if (!xListener.is()) {
             throw css::uno::RuntimeException(
@@ -1181,7 +1183,7 @@ void Access::removeContainerListener(
     throw (css::uno::RuntimeException)
 {
     OSL_ASSERT(thisIs(IS_ANY));
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     checkLocalizedPropertyAccess();
     ContainerListeners::iterator i(containerListeners_.find(xListener));
     if (i != containerListeners_.end()) {
@@ -1193,7 +1195,7 @@ rtl::OUString Access::getExactName(rtl::OUString const & aApproximateName)
     throw (css::uno::RuntimeException)
 {
     OSL_ASSERT(thisIs(IS_ANY));
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     checkLocalizedPropertyAccess();
     return aApproximateName;
 }
@@ -1202,7 +1204,7 @@ css::uno::Sequence< css::beans::Property > Access::getProperties()
     throw (css::uno::RuntimeException)
 {
     OSL_ASSERT(thisIs(IS_GROUP));
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     std::vector< rtl::Reference< ChildAccess > > children(getAllChildren());
     comphelper::SequenceAsVector< css::beans::Property > properties;
     for (std::vector< rtl::Reference< ChildAccess > >::iterator i(
@@ -1218,7 +1220,7 @@ css::beans::Property Access::getPropertyByName(rtl::OUString const & aName)
     throw (css::beans::UnknownPropertyException, css::uno::RuntimeException)
 {
     OSL_ASSERT(thisIs(IS_GROUP));
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     rtl::Reference< ChildAccess > child(getChild(aName));
     if (!child.is()) {
         throw css::beans::UnknownPropertyException(
@@ -1231,13 +1233,13 @@ sal_Bool Access::hasPropertyByName(rtl::OUString const & Name)
     throw (css::uno::RuntimeException)
 {
     OSL_ASSERT(thisIs(IS_GROUP));
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     return getChild(Name).is();
 }
 
 rtl::OUString Access::getHierarchicalName() throw (css::uno::RuntimeException) {
     OSL_ASSERT(thisIs(IS_ANY));
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     checkLocalizedPropertyAccess();
     // For backwards compatibility, return an absolute path representation where
     // available:
@@ -1261,7 +1263,7 @@ rtl::OUString Access::composeHierarchicalName(
         css::uno::RuntimeException)
 {
     OSL_ASSERT(thisIs(IS_ANY));
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     checkLocalizedPropertyAccess();
     if (aRelativeName.getLength() == 0 || aRelativeName[0] == '/') {
         throw css::lang::IllegalArgumentException(
@@ -1281,7 +1283,7 @@ rtl::OUString Access::composeHierarchicalName(
 
 rtl::OUString Access::getName() throw (css::uno::RuntimeException) {
     OSL_ASSERT(thisIs(IS_ANY));
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     checkLocalizedPropertyAccess();
     return getNameInternal();
 }
@@ -1292,7 +1294,7 @@ void Access::setName(rtl::OUString const & aName)
     OSL_ASSERT(thisIs(IS_ANY));
     Broadcaster bc;
     {
-        osl::MutexGuard g(lock);
+        osl::MutexGuard g(*lock_);
         checkLocalizedPropertyAccess();
         checkFinalized();
         Modifications localMods;
@@ -1356,7 +1358,7 @@ void Access::setName(rtl::OUString const & aName)
 css::beans::Property Access::getAsProperty() throw (css::uno::RuntimeException)
 {
     OSL_ASSERT(thisIs(IS_ANY));
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     checkLocalizedPropertyAccess();
     return asProperty();
 }
@@ -1378,7 +1380,7 @@ void Access::setPropertyValue(
     OSL_ASSERT(thisIs(IS_GROUP));
     Broadcaster bc;
     {
-        osl::MutexGuard g(lock);
+        osl::MutexGuard g(*lock_);
         if (!getRootAccess()->isUpdate()) {
             throw css::uno::RuntimeException(
                 rtl::OUString(
@@ -1402,7 +1404,7 @@ css::uno::Any Access::getPropertyValue(rtl::OUString const & PropertyName)
         css::uno::RuntimeException)
 {
     OSL_ASSERT(thisIs(IS_GROUP));
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     rtl::Reference< ChildAccess > child(getChild(PropertyName));
     if (!child.is()) {
         throw css::beans::UnknownPropertyException(
@@ -1421,7 +1423,7 @@ void Access::addPropertyChangeListener(
 {
     OSL_ASSERT(thisIs(IS_GROUP));
     {
-        osl::MutexGuard g(lock);
+        osl::MutexGuard g(*lock_);
         if (!xListener.is()) {
             throw css::uno::RuntimeException(
                 rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("null listener")),
@@ -1448,7 +1450,7 @@ void Access::removePropertyChangeListener(
         css::uno::RuntimeException)
 {
     OSL_ASSERT(thisIs(IS_GROUP));
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     checkKnownProperty(aPropertyName);
     PropertyChangeListeners::iterator i(
         propertyChangeListeners_.find(aPropertyName));
@@ -1473,7 +1475,7 @@ void Access::addVetoableChangeListener(
 {
     OSL_ASSERT(thisIs(IS_GROUP));
     {
-        osl::MutexGuard g(lock);
+        osl::MutexGuard g(*lock_);
         if (!aListener.is()) {
             throw css::uno::RuntimeException(
                 rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("null listener")),
@@ -1501,7 +1503,7 @@ void Access::removeVetoableChangeListener(
         css::uno::RuntimeException)
 {
     OSL_ASSERT(thisIs(IS_GROUP));
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     checkKnownProperty(PropertyName);
     VetoableChangeListeners::iterator i(
         vetoableChangeListeners_.find(PropertyName));
@@ -1526,7 +1528,7 @@ void Access::setPropertyValues(
     OSL_ASSERT(thisIs(IS_GROUP));
     Broadcaster bc;
     {
-        osl::MutexGuard g(lock);
+        osl::MutexGuard g(*lock_);
         if (!getRootAccess()->isUpdate()) {
             throw css::uno::RuntimeException(
                 rtl::OUString(
@@ -1563,7 +1565,7 @@ css::uno::Sequence< css::uno::Any > Access::getPropertyValues(
     throw (css::uno::RuntimeException)
 {
     OSL_ASSERT(thisIs(IS_GROUP));
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     css::uno::Sequence< css::uno::Any > vals(aPropertyNames.getLength());
     for (sal_Int32 i = 0; i < aPropertyNames.getLength(); ++i) {
         rtl::Reference< ChildAccess > child(getChild(aPropertyNames[i]));
@@ -1588,7 +1590,7 @@ void Access::addPropertiesChangeListener(
 {
     OSL_ASSERT(thisIs(IS_GROUP));
     {
-        osl::MutexGuard g(lock);
+        osl::MutexGuard g(*lock_);
         if (!xListener.is()) {
             throw css::uno::RuntimeException(
                 rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("null listener")),
@@ -1611,7 +1613,7 @@ void Access::removePropertiesChangeListener(
     throw (css::uno::RuntimeException)
 {
     OSL_ASSERT(thisIs(IS_GROUP));
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     PropertiesChangeListeners::iterator i(
         propertiesChangeListeners_.find(xListener));
     if (i != propertiesChangeListeners_.end()) {
@@ -1654,7 +1656,7 @@ void Access::setHierarchicalPropertyValue(
     OSL_ASSERT(thisIs(IS_GROUP));
     Broadcaster bc;
     {
-        osl::MutexGuard g(lock);
+        osl::MutexGuard g(*lock_);
         if (!getRootAccess()->isUpdate()) {
             throw css::uno::RuntimeException(
                 rtl::OUString(
@@ -1686,7 +1688,7 @@ css::uno::Any Access::getHierarchicalPropertyValue(
         css::uno::RuntimeException)
 {
     OSL_ASSERT(thisIs(IS_GROUP));
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     rtl::Reference< ChildAccess > child(getSubChild(aHierarchicalPropertyName));
     if (!child.is()) {
         throw css::beans::UnknownPropertyException(
@@ -1706,7 +1708,7 @@ void Access::setHierarchicalPropertyValues(
     OSL_ASSERT(thisIs(IS_GROUP));
     Broadcaster bc;
     {
-        osl::MutexGuard g(lock);
+        osl::MutexGuard g(*lock_);
         if (!getRootAccess()->isUpdate()) {
             throw css::uno::RuntimeException(
                 rtl::OUString(
@@ -1750,7 +1752,7 @@ css::uno::Sequence< css::uno::Any > Access::getHierarchicalPropertyValues(
         css::uno::RuntimeException)
 {
     OSL_ASSERT(thisIs(IS_GROUP));
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     css::uno::Sequence< css::uno::Any > vals(
         aHierarchicalPropertyNames.getLength());
     for (sal_Int32 i = 0; i < aHierarchicalPropertyNames.getLength(); ++i) {
@@ -1774,7 +1776,7 @@ css::beans::Property Access::getPropertyByHierarchicalName(
     throw (css::beans::UnknownPropertyException, css::uno::RuntimeException)
 {
     OSL_ASSERT(thisIs(IS_GROUP));
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     rtl::Reference< ChildAccess > child(getSubChild(aHierarchicalName));
     if (!child.is()) {
         throw css::beans::UnknownPropertyException(
@@ -1788,7 +1790,7 @@ sal_Bool Access::hasPropertyByHierarchicalName(
     throw (css::uno::RuntimeException)
 {
     OSL_ASSERT(thisIs(IS_GROUP));
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     return getSubChild(aHierarchicalName).is();
 }
 
@@ -1802,7 +1804,7 @@ void Access::replaceByName(
     OSL_ASSERT(thisIs(IS_UPDATE));
     Broadcaster bc;
     {
-        osl::MutexGuard g(lock);
+        osl::MutexGuard g(*lock_);
         checkLocalizedPropertyAccess();
         rtl::Reference< ChildAccess > child(getChild(aName));
         if (!child.is()) {
@@ -1846,7 +1848,7 @@ void Access::insertByName(
     OSL_ASSERT(thisIs(IS_EXTENSIBLE|IS_UPDATE));
     Broadcaster bc;
     {
-        osl::MutexGuard g(lock);
+        osl::MutexGuard g(*lock_);
         checkLocalizedPropertyAccess();
         checkFinalized();
         if (getChild(aName).is()) {
@@ -1896,7 +1898,7 @@ void Access::removeByName(rtl::OUString const & aName)
     OSL_ASSERT(thisIs(IS_EXTENSIBLE|IS_UPDATE));
     Broadcaster bc;
     {
-        osl::MutexGuard g(lock);
+        osl::MutexGuard g(*lock_);
         checkLocalizedPropertyAccess();
         rtl::Reference< ChildAccess > child(getChild(aName));
         if (!child.is() || child->isFinalized() ||
@@ -2189,7 +2191,7 @@ rtl::Reference< Access > Access::getNotificationRoot() {
 
 #if OSL_DEBUG_LEVEL > 0
 bool Access::thisIs(int what) {
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     rtl::Reference< Node > p(getNode());
     Node::Kind k(p->kind());
     return k != Node::KIND_PROPERTY && k != Node::KIND_LOCALIZED_VALUE &&
diff --git a/configmgr/source/access.hxx b/configmgr/source/access.hxx
index 32c0ea9..8a05329 100644
--- a/configmgr/source/access.hxx
+++ b/configmgr/source/access.hxx
@@ -36,6 +36,7 @@
 #include <vector>
 
 #include "boost/noncopyable.hpp"
+#include "boost/shared_ptr.hpp"
 #include "com/sun/star/beans/PropertyVetoException.hpp"
 #include "com/sun/star/beans/UnknownPropertyException.hpp"
 #include "com/sun/star/beans/XExactName.hpp"
@@ -569,6 +570,8 @@ private:
     PropertiesChangeListeners propertiesChangeListeners_;
     bool disposed_;
 
+    boost::shared_ptr<osl::Mutex> lock_;
+
 #if OSL_DEBUG_LEVEL > 0
 protected:
     enum {
diff --git a/configmgr/source/childaccess.cxx b/configmgr/source/childaccess.cxx
index 3ec23b7..3d9c40b 100644
--- a/configmgr/source/childaccess.cxx
+++ b/configmgr/source/childaccess.cxx
@@ -95,6 +95,7 @@ ChildAccess::ChildAccess(
     Access(components), root_(root), parent_(parent), name_(name), node_(node),
     inTransaction_(false)
 {
+    lock_ = lock();
     OSL_ASSERT(root.is() && parent.is() && node.is());
 }
 
@@ -103,6 +104,7 @@ ChildAccess::ChildAccess(
     rtl::Reference< Node > const & node):
     Access(components), root_(root), node_(node), inTransaction_(false)
 {
+    lock_ = lock();
     OSL_ASSERT(root.is() && node.is());
 }
 
@@ -169,7 +171,7 @@ css::uno::Reference< css::uno::XInterface > ChildAccess::getParent()
     throw (css::uno::RuntimeException)
 {
     OSL_ASSERT(thisIs(IS_ANY));
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     checkLocalizedPropertyAccess();
     return static_cast< cppu::OWeakObject * >(parent_.get());
 }
@@ -178,7 +180,7 @@ void ChildAccess::setParent(css::uno::Reference< css::uno::XInterface > const &)
     throw (css::lang::NoSupportException, css::uno::RuntimeException)
 {
     OSL_ASSERT(thisIs(IS_ANY));
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     checkLocalizedPropertyAccess();
     throw css::lang::NoSupportException(
         rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("setParent")),
@@ -190,7 +192,7 @@ sal_Int64 ChildAccess::getSomething(
     throw (css::uno::RuntimeException)
 {
     OSL_ASSERT(thisIs(IS_ANY));
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     checkLocalizedPropertyAccess();
     return aIdentifier == getTunnelId()
         ? reinterpret_cast< sal_Int64 >(this) : 0;
@@ -360,7 +362,7 @@ void ChildAccess::commitChanges(bool valid, Modifications * globalModifications)
 }
 
 ChildAccess::~ChildAccess() {
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     if (parent_.is()) {
         parent_->releaseChild(name_);
     }
@@ -390,7 +392,7 @@ css::uno::Any ChildAccess::queryInterface(css::uno::Type const & aType)
     throw (css::uno::RuntimeException)
 {
     OSL_ASSERT(thisIs(IS_ANY));
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     checkLocalizedPropertyAccess();
     css::uno::Any res(Access::queryInterface(aType));
     return res.hasValue()
diff --git a/configmgr/source/childaccess.hxx b/configmgr/source/childaccess.hxx
index 3d9b2fc..977d97e 100644
--- a/configmgr/source/childaccess.hxx
+++ b/configmgr/source/childaccess.hxx
@@ -40,6 +40,7 @@
 #include "com/sun/star/uno/Reference.hxx"
 #include "com/sun/star/uno/RuntimeException.hpp"
 #include "com/sun/star/uno/Sequence.hxx"
+#include "boost/shared_ptr.hpp"
 #include "rtl/ref.hxx"
 #include "sal/types.h"
 
@@ -151,6 +152,7 @@ private:
     std::auto_ptr< com::sun::star::uno::Any > changedValue_;
     bool inTransaction_;
         // to determine if a free node can be inserted underneath some root
+    boost::shared_ptr<osl::Mutex> lock_;
 };
 
 }
diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx
index 2e07320..e6cfb10 100644
--- a/configmgr/source/components.cxx
+++ b/configmgr/source/components.cxx
@@ -183,6 +183,7 @@ private:
     rtl::OUString url_;
     Data const & data_;
     osl::Condition delay_;
+    boost::shared_ptr<osl::Mutex> lock_;
 };
 
 Components::WriteThread::WriteThread(
@@ -190,6 +191,7 @@ Components::WriteThread::WriteThread(
     rtl::OUString const & url, Data const & data):
     reference_(reference), components_(components), url_(url), data_(data)
 {
+    lock_ = lock();
     OSL_ASSERT(reference != 0);
     acquire();
 }
@@ -197,7 +199,7 @@ Components::WriteThread::WriteThread(
 void Components::WriteThread::run() {
     TimeValue t = { 1, 0 }; // 1 sec
     delay_.wait(&t); // must not throw; result_error is harmless and ignored
-    osl::MutexGuard g(lock); // must not throw
+    osl::MutexGuard g(*lock_); // must not throw
     try {
         try {
             writeModFile(components_, url_, data_);
@@ -304,7 +306,17 @@ void Components::addModification(Path const & path) {
     data_.modifications.add(path);
 }
 
+bool Components::hasModifications() const
+{
+    return data_.modifications.getRoot().children.begin() !=
+        data_.modifications.getRoot().children.end();
+}
+
 void Components::writeModifications() {
+
+    if (!hasModifications())
+        return;
+
     if (!writeThread_.is()) {
         writeThread_ = new WriteThread(
             &writeThread_, *this, getModificationFileUrl(), data_);
@@ -315,7 +327,7 @@ void Components::writeModifications() {
 void Components::flushModifications() {
     rtl::Reference< WriteThread > thread;
     {
-        osl::MutexGuard g(lock);
+        osl::MutexGuard g(*lock_);
         thread = writeThread_;
     }
     if (thread.is()) {
@@ -506,6 +518,8 @@ Components::Components(
     css::uno::Reference< css::uno::XComponentContext > const & context):
     context_(context)
 {
+    lock_ = lock();
+
     OSL_ASSERT(context.is());
     RTL_LOGFILE_TRACE_AUTHOR("configmgr", "sb", "begin parsing");
     parseXcsXcuLayer(
diff --git a/configmgr/source/components.hxx b/configmgr/source/components.hxx
index 2d0843b..e810c6a 100644
--- a/configmgr/source/components.hxx
+++ b/configmgr/source/components.hxx
@@ -35,6 +35,7 @@
 #include <set>
 
 #include "boost/noncopyable.hpp"
+#include "boost/shared_ptr.hpp"
 #include "com/sun/star/beans/Optional.hpp"
 #include "com/sun/star/uno/Reference.hxx"
 #include "rtl/ref.hxx"
@@ -95,6 +96,8 @@ public:
 
     void writeModifications();
 
+    bool hasModifications() const;
+
     void flushModifications();
         // must be called with configmgr::lock unaquired; must be called before
         // shutdown if writeModifications has ever been called (probably
@@ -174,6 +177,7 @@ private:
     WeakRootSet roots_;
     ExternalServices externalServices_;
     rtl::Reference< WriteThread > writeThread_;
+    boost::shared_ptr<osl::Mutex> lock_;
 };
 
 }
diff --git a/configmgr/source/configurationprovider.cxx b/configmgr/source/configurationprovider.cxx
index ed50642..cccb746 100644
--- a/configmgr/source/configurationprovider.cxx
+++ b/configmgr/source/configurationprovider.cxx
@@ -109,6 +109,7 @@ public:
         ServiceBase(*static_cast< osl::Mutex * >(this)), context_(context),
         locale_(locale)
     {
+        lock_ = lock();
         OSL_ASSERT(context.is());
     }
 
@@ -173,6 +174,7 @@ private:
 
     css::uno::Reference< css::uno::XComponentContext > context_;
     rtl::OUString locale_;
+    boost::shared_ptr<osl::Mutex> lock_;
 };
 
 css::uno::Reference< css::uno::XInterface > Service::createInstance(
@@ -276,7 +278,7 @@ Service::createInstanceWithArguments(
              ServiceSpecifier),
             static_cast< cppu::OWeakObject * >(this));
     }
-    osl::MutexGuard guard(lock);
+    osl::MutexGuard guard(*lock_);
     Components::initSingleton(context_);
     Components & components = Components::getSingleton();
     rtl::Reference< RootAccess > root(
@@ -358,13 +360,13 @@ void Service::removeFlushListener(
 void Service::setLocale(css::lang::Locale const & eLocale)
     throw (css::uno::RuntimeException)
 {
-    osl::MutexGuard guard(lock);
+    osl::MutexGuard guard(*lock_);
     locale_ = comphelper::Locale(
         eLocale.Language, eLocale.Country, eLocale.Variant).toISO();
 }
 
 css::lang::Locale Service::getLocale() throw (css::uno::RuntimeException) {
-    osl::MutexGuard guard(lock);
+    osl::MutexGuard guard(*lock_);
     css::lang::Locale loc;
     if (locale_.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("*"))) {
         loc.Language = locale_;
@@ -388,7 +390,7 @@ css::lang::Locale Service::getLocale() throw (css::uno::RuntimeException) {
 void Service::flushModifications() const {
     Components * components;
     {
-        osl::MutexGuard guard(lock);
+        osl::MutexGuard guard(*lock_);
         Components::initSingleton(context_);
         components = &Components::getSingleton();
     }
diff --git a/configmgr/source/defaultprovider.cxx b/configmgr/source/defaultprovider.cxx
index aa928d7..16cf66d 100644
--- a/configmgr/source/defaultprovider.cxx
+++ b/configmgr/source/defaultprovider.cxx
@@ -30,6 +30,7 @@
 #include "sal/config.h"
 
 #include "boost/noncopyable.hpp"
+#include "boost/shared_ptr.hpp"
 #include "com/sun/star/lang/XSingleComponentFactory.hpp"
 #include "com/sun/star/uno/Any.hxx"
 #include "com/sun/star/uno/Exception.hpp"
@@ -60,7 +61,10 @@ class Factory:
     private boost::noncopyable
 {
 public:
-    Factory() {}
+    Factory()
+    {
+        lock_ = lock();
+    }
 
 private:
     virtual ~Factory() {}
@@ -75,6 +79,8 @@ private:
         css::uno::Sequence< css::uno::Any > const & Arguments,
         css::uno::Reference< css::uno::XComponentContext > const & Context)
         throw (css::uno::Exception, css::uno::RuntimeException);
+
+    boost::shared_ptr<osl::Mutex> lock_;
 };
 
 css::uno::Reference< css::uno::XInterface > Factory::createInstanceWithContext(
@@ -99,7 +105,7 @@ Factory::createInstanceWithArgumentsAndContext(
                     " instantiated without arguments")),
             static_cast< cppu::OWeakObject * >(this));
     }
-    osl::MutexGuard guard(lock);
+    osl::MutexGuard guard(*lock_);
     static css::uno::Reference< css::uno::XInterface > singleton(
         configuration_provider::createDefault(Context));
     return singleton;
diff --git a/configmgr/source/lock.cxx b/configmgr/source/lock.cxx
index 4894ab2..3950a2d 100644
--- a/configmgr/source/lock.cxx
+++ b/configmgr/source/lock.cxx
@@ -35,7 +35,13 @@
 
 namespace configmgr {
 
-osl::Mutex lock;
+boost::shared_ptr<osl::Mutex> lock()
+{
+    static boost::shared_ptr<osl::Mutex> theLock;
+    if (!theLock.get())
+        theLock.reset(new osl::Mutex);
+    return theLock;
+}
 
 }
 
diff --git a/configmgr/source/lock.hxx b/configmgr/source/lock.hxx
index 8b3c7b4..b37e83a 100644
--- a/configmgr/source/lock.hxx
+++ b/configmgr/source/lock.hxx
@@ -30,12 +30,12 @@
 #define INCLUDED_CONFIGMGR_SOURCE_LOCK_HXX
 
 #include "sal/config.h"
-
 #include "osl/mutex.hxx"
+#include "boost/shared_ptr.hpp"
 
 namespace configmgr {
 
-extern osl::Mutex lock;
+boost::shared_ptr<osl::Mutex> lock();
 
 }
 
diff --git a/configmgr/source/rootaccess.cxx b/configmgr/source/rootaccess.cxx
index 72716aa..27f3884 100644
--- a/configmgr/source/rootaccess.cxx
+++ b/configmgr/source/rootaccess.cxx
@@ -78,7 +78,9 @@ RootAccess::RootAccess(
     rtl::OUString const & locale, bool update):
     Access(components), pathRepresentation_(pathRepresentation),
     locale_(locale), update_(update)
-{}
+{
+    lock_ = lock();
+}
 
 Path RootAccess::getAbsolutePath() {
     getNode();
@@ -129,7 +131,7 @@ bool RootAccess::isUpdate() const {
 }
 
 RootAccess::~RootAccess() {
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     getComponents().removeRootAccess(this);
 }
 
@@ -227,7 +229,7 @@ css::uno::Any RootAccess::queryInterface(css::uno::Type const & aType)
     throw (css::uno::RuntimeException)
 {
     OSL_ASSERT(thisIs(IS_ANY));
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     checkLocalizedPropertyAccess();
     css::uno::Any res(Access::queryInterface(aType));
     if (res.hasValue()) {
@@ -251,7 +253,7 @@ void RootAccess::addChangesListener(
 {
     OSL_ASSERT(thisIs(IS_ANY));
     {
-        osl::MutexGuard g(lock);
+        osl::MutexGuard g(*lock_);
         checkLocalizedPropertyAccess();
         if (!aListener.is()) {
             throw css::uno::RuntimeException(
@@ -274,7 +276,7 @@ void RootAccess::removeChangesListener(
     throw (css::uno::RuntimeException)
 {
     OSL_ASSERT(thisIs(IS_ANY));
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     checkLocalizedPropertyAccess();
     ChangesListeners::iterator i(changesListeners_.find(aListener));
     if (i != changesListeners_.end()) {
@@ -288,7 +290,7 @@ void RootAccess::commitChanges()
     OSL_ASSERT(thisIs(IS_UPDATE));
     Broadcaster bc;
     {
-        osl::MutexGuard g(lock);
+        osl::MutexGuard g(*lock_);
         checkLocalizedPropertyAccess();
         int finalizedLayer;
         Modifications globalMods;
@@ -306,7 +308,7 @@ void RootAccess::commitChanges()
 
 sal_Bool RootAccess::hasPendingChanges() throw (css::uno::RuntimeException) {
     OSL_ASSERT(thisIs(IS_UPDATE));
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     checkLocalizedPropertyAccess();
     //TODO: Optimize:
     std::vector< css::util::ElementChange > changes;
@@ -318,7 +320,7 @@ css::util::ChangesSet RootAccess::getPendingChanges()
     throw (css::uno::RuntimeException)
 {
     OSL_ASSERT(thisIs(IS_UPDATE));
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     checkLocalizedPropertyAccess();
     comphelper::SequenceAsVector< css::util::ElementChange > changes;
     reportChildChanges(&changes);
diff --git a/configmgr/source/rootaccess.hxx b/configmgr/source/rootaccess.hxx
index c7300c4..4d74167 100644
--- a/configmgr/source/rootaccess.hxx
+++ b/configmgr/source/rootaccess.hxx
@@ -39,6 +39,7 @@
 #include "com/sun/star/util/ChangesSet.hpp"
 #include "com/sun/star/util/XChangesBatch.hpp"
 #include "com/sun/star/util/XChangesNotifier.hpp"
+#include "boost/shared_ptr.hpp"
 #include "rtl/ref.hxx"
 #include "rtl/ustring.hxx"
 #include "sal/types.h"
@@ -151,6 +152,8 @@ private:
     rtl::OUString name_;
     bool finalized_;
     ChangesListeners changesListeners_;
+
+    boost::shared_ptr<osl::Mutex> lock_;
 };
 
 }
diff --git a/configmgr/source/update.cxx b/configmgr/source/update.cxx
index 53eff2c..7208eb3 100644
--- a/configmgr/source/update.cxx
+++ b/configmgr/source/update.cxx
@@ -32,6 +32,7 @@
 #include <set>
 
 #include "boost/noncopyable.hpp"
+#include "boost/shared_ptr.hpp"
 #include "com/sun/star/configuration/XUpdate.hpp"
 #include "com/sun/star/lang/XSingleComponentFactory.hpp"
 #include "com/sun/star/uno/Any.hxx"
@@ -77,7 +78,10 @@ class Service:
     private boost::noncopyable
 {
 public:
-    Service() {}
+    Service()
+    {
+        lock_ = lock();
+    }
 
 private:
     virtual ~Service() {}
@@ -98,13 +102,15 @@ private:
         css::uno::Sequence< rtl::OUString > const & includedPaths,
         css::uno::Sequence< rtl::OUString > const & excludedPaths)
         throw (css::uno::RuntimeException);
+
+    boost::shared_ptr<osl::Mutex> lock_;
 };
 
 void Service::insertExtensionXcsFile(
     sal_Bool shared, rtl::OUString const & fileUri)
     throw (css::uno::RuntimeException)
 {
-    osl::MutexGuard g(lock);
+    osl::MutexGuard g(*lock_);
     Components::getSingleton().insertExtensionXcsFile(shared, fileUri);
 }
 
@@ -114,7 +120,7 @@ void Service::insertExtensionXcuFile(
 {
     Broadcaster bc;
     {
-        osl::MutexGuard g(lock);
+        osl::MutexGuard g(*lock_);
         Modifications mods;
         Components::getSingleton().insertExtensionXcuFile(
             shared, fileUri, &mods);
@@ -129,7 +135,7 @@ void Service::removeExtensionXcuFile(rtl::OUString const & fileUri)
 {
     Broadcaster bc;
     {
-        osl::MutexGuard g(lock);
+        osl::MutexGuard g(*lock_);
         Modifications mods;
         Components::getSingleton().removeExtensionXcuFile(fileUri, &mods);
         Components::getSingleton().initGlobalBroadcaster(
@@ -146,7 +152,7 @@ void Service::insertModificationXcuFile(
 {
     Broadcaster bc;
     {
-        osl::MutexGuard g(lock);
+        osl::MutexGuard g(*lock_);
         Modifications mods;
         Components::getSingleton().insertModificationXcuFile(
             fileUri, seqToSet(includedPaths), seqToSet(excludedPaths), &mods);
commit 2a0abc9acfea536ef68ab2083e6f57aaa9e860d0
Author: obo <obo at openoffice.org>
Date:   Thu Nov 25 11:51:51 2010 +0100

    masterfix OOO330: #i115774# crash in FR version when typing / as first character

diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 8eea009..672223a 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -701,7 +701,7 @@ BOOL SvxAutoCorrect::FnAddNonBrkSpace(
                     bRunNext = true;
             }
         }
-        else if ( cChar == '/' )
+        else if ( cChar == '/' && nEndPos > 1 && rTxt.Len() > (nEndPos - 1) )
         {
             // Remove the hardspace right before to avoid formatting URLs
             sal_Unicode cPrevChar = rTxt.GetChar( nEndPos - 1 );
commit 79df60d709cade49cbd73550ea08d33a07395e99
Merge: 74112b4... 3c0fad2...
Author: Kurt Zenker <kz at openoffice.org>
Date:   Tue Nov 23 16:56:24 2010 +0100

    CWS-TOOLING: integrate CWS os145

commit 3c0fad2e49ba3de613eb1ad70dd6144dcda859aa
Author: sj <sj at openoffice.org>
Date:   Mon Nov 22 18:56:17 2010 +0100

    os145: #b7001888# fixing small svm problem

diff --git a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
index 269c5cf..6b1931d 100644
--- a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
@@ -248,9 +248,12 @@ namespace
             if(nPushFlags)
             {
                 OSL_ENSURE(maPropertyHolders.size(), "PropertyHolders: PUSH with no property holders (!)");
-                PropertyHolder* pNew = new PropertyHolder(*maPropertyHolders.back());
-                pNew->setPushFlags(nPushFlags);
-                maPropertyHolders.push_back(pNew);
+                if ( !maPropertyHolders.empty() )
+                {
+                    PropertyHolder* pNew = new PropertyHolder(*maPropertyHolders.back());
+                    pNew->setPushFlags(nPushFlags);
+                    maPropertyHolders.push_back(pNew);
+                }
             }
         }
 
@@ -354,8 +357,9 @@ namespace
 
         PropertyHolder& Current()
         {
+            static PropertyHolder aDummy;
             OSL_ENSURE(maPropertyHolders.size(), "PropertyHolders: CURRENT with no property holders (!)");
-            return *maPropertyHolders.back();
+            return maPropertyHolders.empty() ? aDummy : *maPropertyHolders.back();
         }
 
         ~PropertyHolders()


More information about the Libreoffice-commits mailing list