[Libreoffice-commits] .: Branch 'libreoffice-3-4' - sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Wed May 4 15:49:50 PDT 2011


 sc/source/ui/docshell/externalrefmgr.cxx |    8 ++++++++
 1 file changed, 8 insertions(+)

New commits:
commit 8fdf19844c061923424835054b66c2d3380662a9
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed May 4 18:47:36 2011 -0400

    Properly close the document shell when erased from the manager.
    
    Because the document shell object was erased without properly having
    its shell closed, it failed to update the values when the link was
    updated, especially when the source document was open.  Closing it
    properly when its object is erased should fix it.

diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index f9de3e8..fc12cf1 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -2358,9 +2358,14 @@ void lcl_removeByFileId(sal_uInt16 nFileId, MapContainer& rMap)
 {
     typename MapContainer::iterator itr = rMap.find(nFileId);
     if (itr != rMap.end())
+    {
+        // Close this document shell.
+        itr->second.maShell->DoClose();
         rMap.erase(itr);
+    }
 }
 
+
 void ScExternalRefManager::refreshNames(sal_uInt16 nFileId)
 {
     maRefCache.clearCache(nFileId);
@@ -2528,6 +2533,9 @@ void ScExternalRefManager::purgeStaleSrcDocument(sal_Int32 nTimeOut)
         sal_Int32 nSinceLastAccess = (Time() - itr->second.maLastAccess).GetTime();
         if (nSinceLastAccess < nTimeOut)
             aNewDocShells.insert(*itr);
+        else
+            // Timed out.  Let's close this.
+            itr->second.maShell->DoClose();
     }
     maDocShells.swap(aNewDocShells);
 


More information about the Libreoffice-commits mailing list