[Libreoffice-commits] .: 3 commits - sfx2/source sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Jan 16 08:09:52 PST 2013


 sfx2/source/doc/objcont.cxx      |   12 ++++++++----
 sfx2/source/doc/sfxbasemodel.cxx |    3 ---
 sw/source/ui/app/docst.cxx       |    9 +++++++++
 3 files changed, 17 insertions(+), 7 deletions(-)

New commits:
commit 7dc663ec764d569957e0e1758b701dfb8f399647
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Jan 16 17:00:23 2013 +0100

    SfxObjectShell::UpdateFromTemplate_Impl: template URL...
    
    ... is an URI not a system path so convert it to absolute URI via
    rtl::Uri.
    
    Change-Id: I1ce4c732340a52916dab658f43b96da9a81b3525

diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx
index e7bd7f3..6f816aa 100644
--- a/sfx2/source/doc/objcont.cxx
+++ b/sfx2/source/doc/objcont.cxx
@@ -42,6 +42,7 @@
 #include <svtools/ehdl.hxx>
 #include <tools/datetime.hxx>
 #include <rtl/logfile.hxx>
+#include <rtl/uri.hxx>
 #include <math.h>
 
 #include <unotools/saveopt.hxx>
@@ -736,11 +737,14 @@ void SfxObjectShell::UpdateFromTemplate_Impl(  )
         // an error if the template filename points not to a valid file
         SfxDocumentTemplates aTempl;
         aTempl.Construct();
-        if ( !aTemplURL.isEmpty() )
+        if (!aTemplURL.isEmpty())
         {
-            String aURL;
-            if( ::utl::LocalFileHelper::ConvertSystemPathToURL( aTemplURL, GetMedium()->GetName(), aURL ) )
-                aFoundName = aURL;
+            try {
+                aFoundName = ::rtl::Uri::convertRelToAbs(GetMedium()->GetName(),
+                            aTemplURL);
+            } catch (::rtl::MalformedUriException const&) {
+                assert(false); // don't think that's supposed to happen?
+            }
         }
 
         if( !aFoundName.Len() && !aTemplName.isEmpty() )
commit beacee6fad46aa2c8fc813bb0150e5c7a5175b26
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Jan 16 16:23:30 2013 +0100

    rhbz#818557: fix it differently: SwDocShell::_LoadStyles():
    
    Try to prevent pushing of SfxShells from this function via EndAllAction
    and SwView::AttrChangedNotify() by setting a ridiculous pre-exising
    global bNoInterrupt variable.
    
    Change-Id: I9c91ca882891c8dfcd9dc08ba197233cfefddefd

diff --git a/sw/source/ui/app/docst.cxx b/sw/source/ui/app/docst.cxx
index ddee625..b57aacc 100644
--- a/sw/source/ui/app/docst.cxx
+++ b/sw/source/ui/app/docst.cxx
@@ -22,6 +22,8 @@
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/container/XNameAccess.hpp>
 
+#include <comphelper/flagguard.hxx>
+
 #include <hintids.hxx>
 #include <sfx2/app.hxx>
 #include <svl/whiter.hxx>
@@ -77,6 +79,8 @@
 
 #include <paratr.hxx>   //#outline level,add by zhaojianwei
 
+extern bool bNoInterrupt;       // in mainwn.cxx
+
 using namespace ::com::sun::star;
 
 void  SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh)
@@ -1276,6 +1280,11 @@ void SwDocShell::_LoadStyles( SfxObjectShell& rSource, sal_Bool bPreserveCurrent
             ((SwDocShell&)rSource).pDoc->SetFixFields(false, NULL);
         if( pWrtShell )
         {
+            // rhbz#818557, fdo#58893: EndAllAction will call SelectShell(),
+            // which pushes a bunch of SfxShells that are not cleared
+            // (for unknown reasons) when closing the document, causing crash;
+            // setting bNoInterrupt appears to avoid the problem.
+            ::comphelper::FlagRestorationGuard g(bNoInterrupt, true);
             pWrtShell->StartAllAction();
             pDoc->ReplaceStyles( *((SwDocShell&)rSource).pDoc );
             pWrtShell->EndAllAction();
commit 5090267eada3d68a618769c5dbae8b2ee8d6dab5
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Jan 15 21:25:14 2013 +0100

    fdo#58893: Revert "Resolves: rhbz#818557 crash with NULL shell..."
    
    This reverts commit a1d265be484f1c70f57ab3de9b2d8c27d2fd3aa4.
    
    This commit causes the crash, because apparently it causes some event to
    be delayed via SfxHintPoster which refers to some SfxRequest that is
    then deleted too early.
    
    Change-Id: I301f3b52001c1d8b1b60f5b1cfb3b093c9f81607

diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index d0cb58f..9eb6026 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -1120,10 +1120,7 @@ void SAL_CALL SfxBaseModel::connectController( const uno::Reference< frame::XCon
     {
         SfxViewFrame* pViewFrame = SfxViewFrame::Get( xController, GetObjectShell() );
         ENSURE_OR_THROW( pViewFrame, "SFX document without SFX view!?" );
-        bool bOldLock = pViewFrame->GetDispatcher()->IsLocked();
-        pViewFrame->GetDispatcher()->Lock(sal_True);
         pViewFrame->UpdateDocument_Impl();
-        pViewFrame->GetDispatcher()->Lock(bOldLock);
         const String sDocumentURL = GetObjectShell()->GetMedium()->GetName();
         if ( sDocumentURL.Len() )
             SFX_APP()->Broadcast( SfxStringHint( SID_OPENURL, sDocumentURL ) );


More information about the Libreoffice-commits mailing list