[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sd/source

Caolán McNamara caolanm at redhat.com
Thu Oct 6 14:35:54 UTC 2016


 sd/source/ui/func/fuprlout.cxx |   18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

New commits:
commit 40affcbad618c02f06e8ec2ba031dda187fcd950
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Sep 30 13:43:07 2016 +0100

    Resolves: tdf#101004 crash on using slide master design from master view
    
    started asserting since...
    
    commit f7ed8b99b628625851fb28ec1a3dead710c8871c
    Author: Caolán McNamara <caolanm at redhat.com>
    Date:   Tue Jun 23 16:54:52 2015 +0100
    
        allow slide design to affect multiple standard pages
    
    but looks broken well before that
    
    Change-Id: I03988696e7a25e4f8c932f55bcd1879994ac1005
    (cherry picked from commit 43e241541eefd21cfc7a8e8f51ef958c2a7ba4d7)
    Reviewed-on: https://gerrit.libreoffice.org/29405
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/sd/source/ui/func/fuprlout.cxx b/sd/source/ui/func/fuprlout.cxx
index 674aa64..e5cb57a 100644
--- a/sd/source/ui/func/fuprlout.cxx
+++ b/sd/source/ui/func/fuprlout.cxx
@@ -137,12 +137,6 @@ void FuPresentationLayout::DoExecute( SfxRequest& rReq )
         }
     }
 
-    assert(!aSelectedPages.empty() && "no selected page");
-    OUString aOldLayoutName(aSelectedPages.back()->GetLayoutName());
-    sal_Int32 nPos = aOldLayoutName.indexOf(SD_LT_SEPARATOR);
-    if (nPos != -1)
-        aOldLayoutName = aOldLayoutName.copy(0, nPos);
-
     bool bMasterPage = bOnMaster;
     bool bCheckMasters = false;
 
@@ -155,7 +149,15 @@ void FuPresentationLayout::DoExecute( SfxRequest& rReq )
     aSet.Put( SfxBoolItem( ATTR_PRESLAYOUT_LOAD, bLoad));
     aSet.Put( SfxBoolItem( ATTR_PRESLAYOUT_MASTER_PAGE, bMasterPage ) );
     aSet.Put( SfxBoolItem( ATTR_PRESLAYOUT_CHECK_MASTERS, bCheckMasters ) );
-    aSet.Put( SfxStringItem( ATTR_PRESLAYOUT_NAME, aOldLayoutName));
+
+    if (!aSelectedPages.empty())
+    {
+        OUString aOldLayoutName(aSelectedPages.back()->GetLayoutName());
+        sal_Int32 nPos = aOldLayoutName.indexOf(SD_LT_SEPARATOR);
+        if (nPos != -1)
+            aOldLayoutName = aOldLayoutName.copy(0, nPos);
+        aSet.Put(SfxStringItem(ATTR_PRESLAYOUT_NAME, aOldLayoutName));
+    }
 
     const SfxItemSet *pArgs = rReq.GetArgs ();
 
@@ -238,7 +240,7 @@ void FuPresentationLayout::DoExecute( SfxRequest& rReq )
             static_cast<DrawView*>(mpView)->BlockPageOrderChangedHint(false);
 
         // if the master page was visible, show it again
-        if (!bError)
+        if (!bError && !aSelectedPages.empty())
         {
             if (bOnMaster)
             {


More information about the Libreoffice-commits mailing list