[Libreoffice-commits] core.git: sc/source

Eike Rathke erack at redhat.com
Tue Jul 10 21:01:58 UTC 2018


 sc/source/core/data/global.cxx |   15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

New commits:
commit 28dc2add855f4d2eb85cb76a52a3b990e4772f0a
Author: Eike Rathke <erack at redhat.com>
Date:   Tue Jul 10 22:58:52 2018 +0200

    ScGlobal::OpenURL: obtain pViewFrm early and bail out if not available
    
    Unnecessary to init a bunch of stuff if not.
    
    Change-Id: Ica80185370ecc341bda5b1615ff6d765b579f45e

diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index a356cc362047..495abb6ac49a 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -809,6 +809,11 @@ void ScGlobal::OpenURL(const OUString& rURL, const OUString& rTarget)
         // other key combo. and security option is set, so return
         return;
     }
+
+    SfxViewFrame* pViewFrm = SfxViewFrame::Current();
+    if (!pViewFrm)
+        return;
+
     SfxStringItem aUrl( SID_FILE_NAME, rURL );
     SfxStringItem aTarget( SID_TARGETNAME, rTarget );
     if ( nScClickMouseModifier & KEY_SHIFT )     // control-click -> into new window
@@ -830,13 +835,9 @@ void ScGlobal::OpenURL(const OUString& rURL, const OUString& rTarget)
     SfxBoolItem aBrowsing( SID_BROWSE, true );
 
     // No SID_SILENT anymore
-    SfxViewFrame* pViewFrm = SfxViewFrame::Current();
-    if (pViewFrm)
-    {
-        pViewFrm->GetDispatcher()->ExecuteList(SID_OPENDOC,
-                SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
-                { &aUrl, &aTarget, &aFrm, &aReferer, &aNewView, &aBrowsing });
-    }
+    pViewFrm->GetDispatcher()->ExecuteList(SID_OPENDOC,
+            SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
+            { &aUrl, &aTarget, &aFrm, &aReferer, &aNewView, &aBrowsing });
 }
 
 bool ScGlobal::IsSystemRTL()


More information about the Libreoffice-commits mailing list