diff options
author | heiko tietze <tietze.heiko@gmail.com> | 2017-11-20 21:17:17 +0100 |
---|---|---|
committer | Heiko Tietze <tietze.heiko@googlemail.com> | 2017-11-21 20:56:46 +0100 |
commit | e21f7f7ef043d4fd7ecda92a513e37f720c52ba8 (patch) | |
tree | 75b67307ccfa7e34aca8ff72dfbfb3ba99822cb3 | |
parent | 9288afaa6956c4fcd8f66cdd03a6fa057469db66 (diff) |
tdf#112650 Disable 'background settings for all pages'
Code removed to set images as background
Change-Id: I3bad649b503420e2561483fbce1775e4aebdd3a3
Reviewed-on: https://gerrit.libreoffice.org/45001
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Yousuf Philips <philipz85@hotmail.com>
Tested-by: Yousuf Philips <philipz85@hotmail.com>
Reviewed-by: Heiko Tietze <tietze.heiko@googlemail.com>
-rw-r--r-- | sd/inc/strings.hrc | 2 | ||||
-rw-r--r-- | sd/source/ui/func/fupage.cxx | 98 | ||||
-rw-r--r-- | uitest/impress_tests/backgrounds.py | 10 |
3 files changed, 16 insertions, 94 deletions
diff --git a/sd/inc/strings.hrc b/sd/inc/strings.hrc index c8630fd892ab..4850e5d63b2d 100644 --- a/sd/inc/strings.hrc +++ b/sd/inc/strings.hrc @@ -228,8 +228,6 @@ #define STR_HTMLEXP_ERROR_CREATE_FILE NC_("STR_HTMLEXP_ERROR_CREATE_FILE", "Cannot create the file $(URL1).") #define STR_HTMLEXP_ERROR_OPEN_FILE NC_("STR_HTMLEXP_ERROR_OPEN_FILE", "Could not open the file $(URL1).") #define STR_HTMLEXP_ERROR_COPY_FILE NC_("STR_HTMLEXP_ERROR_COPY_FILE", "The file $(URL1) could not be copied to $(URL2)") -#define STR_PAGE_BACKGROUND_TITLE NC_("STR_PAGE_BACKGROUND_TITLE", "Page Settings" ) -#define STR_PAGE_BACKGROUND_TXT NC_("STR_PAGE_BACKGROUND_TXT", "Background settings for all pages?" ) #define STR_STATUSBAR_MASTERPAGE NC_("STR_STATUSBAR_MASTERPAGE", "Slide Master name. Right-click for list and double-click for dialog.") #define STR_TITLE_RENAMESLIDE NC_("STR_TITLE_RENAMESLIDE", "Rename Slide") #define STR_DESC_RENAMESLIDE NC_("STR_DESC_RENAMESLIDE", "Name") diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx index 040701cfc286..8f05c7b90727 100644 --- a/sd/source/ui/func/fupage.cxx +++ b/sd/source/ui/func/fupage.cxx @@ -208,8 +208,6 @@ const SfxItemSet* FuPage::ExecuteDialog( vcl::Window* pParent ) if (!mpDrawViewShell) return nullptr; - PageKind ePageKind = mpDrawViewShell->GetPageKind(); - SfxItemSet aNewAttr(mpDoc->GetPool(), {{mpDoc->GetPool().GetWhich(SID_ATTR_LRSPACE), mpDoc->GetPool().GetWhich(SID_ATTR_ULSPACE)}, @@ -363,38 +361,23 @@ const SfxItemSet* FuPage::ExecuteDialog( vcl::Window* pParent ) ( aMergedAttr.GetItem<XFillStyleItem>( XATTR_FILLSTYLE )->GetValue() == drawing::FillStyle_NONE ) ) ) mbPageBckgrdDeleted = true; - bool bSetToAllPages = false; - - // Ask, whether the setting are for the background-page or for the current page - if( !mbMasterPage && bChanges ) + if( !mbMasterPage && bChanges && mbPageBckgrdDeleted ) { - // But don't ask in notice-view, because we can't change the background of - // notice-masterpage (at the moment) - if( ePageKind != PageKind::Notes ) - { - ScopedVclPtrInstance<MessageDialog> aQuestionBox( - pParent, SdResId(STR_PAGE_BACKGROUND_TXT), - VclMessageType::Question, VclButtonsType::YesNo); - aQuestionBox->SetText(SdResId(STR_PAGE_BACKGROUND_TITLE)); - bSetToAllPages = ( RET_YES == aQuestionBox->Execute() ); - } - - if( mbPageBckgrdDeleted ) - { - mpBackgroundObjUndoAction.reset( new SdBackgroundObjUndoAction( - *mpDoc, *mpPage, mpPage->getSdrPageProperties().GetItemSet()) ); - - if(!mpPage->IsMasterPage()) - { - // on normal pages, switch off fill attribute usage - SdrPageProperties& rPageProperties = mpPage->getSdrPageProperties(); - rPageProperties.ClearItem( XATTR_FILLBITMAP ); - rPageProperties.ClearItem( XATTR_FILLGRADIENT ); - rPageProperties.ClearItem( XATTR_FILLHATCH ); - rPageProperties.PutItem(XFillStyleItem(drawing::FillStyle_NONE)); - } - } + mpBackgroundObjUndoAction.reset( new SdBackgroundObjUndoAction( + *mpDoc, *mpPage, mpPage->getSdrPageProperties().GetItemSet()) ); + + if(!mpPage->IsMasterPage()) + { + // on normal pages, switch off fill attribute usage + SdrPageProperties& rPageProperties = mpPage->getSdrPageProperties(); + rPageProperties.ClearItem( XATTR_FILLBITMAP ); + rPageProperties.ClearItem( XATTR_FILLGRADIENT ); + rPageProperties.ClearItem( XATTR_FILLHATCH ); + rPageProperties.PutItem(XFillStyleItem(drawing::FillStyle_NONE)); + } } + + /* Special treatment: reset the INVALIDS to NULL-Pointer (otherwise INVALIDs or pointer point to DefaultItems in the template; both would @@ -409,58 +392,9 @@ const SfxItemSet* FuPage::ExecuteDialog( vcl::Window* pParent ) sdr::properties::CleanupFillProperties( pStyleSheet->GetItemSet() ); pStyleSheet->Broadcast(SfxHint(SfxHintId::DataChanged)); } - else if( bSetToAllPages ) - { - OUString aComment(SdResId(STR_UNDO_CHANGE_PAGEFORMAT)); - ::svl::IUndoManager* pUndoMgr = mpDocSh->GetUndoManager(); - pUndoMgr->EnterListAction(aComment, aComment, 0, mpViewShell->GetViewShellBase().GetViewShellId()); - SdUndoGroup* pUndoGroup = new SdUndoGroup(mpDoc); - pUndoGroup->SetComment(aComment); - - //Set background on all master pages - sal_uInt16 nMasterPageCount = mpDoc->GetMasterSdPageCount(ePageKind); - for (sal_uInt16 i = 0; i < nMasterPageCount; ++i) - { - SdPage *pMasterPage = mpDoc->GetMasterSdPage(i, ePageKind); - SdStyleSheet *pStyle = - pMasterPage->getPresentationStyle(HID_PSEUDOSHEET_BACKGROUND); - StyleSheetUndoAction* pAction = - new StyleSheetUndoAction(mpDoc, static_cast<SfxStyleSheet*>(pStyle), &(*pTempSet.get())); - pUndoGroup->AddAction(pAction); - pStyle->GetItemSet().Put( *(pTempSet.get()) ); - sdr::properties::CleanupFillProperties( pStyleSheet->GetItemSet() ); - pStyle->Broadcast(SfxHint(SfxHintId::DataChanged)); - } - - //Remove background from all pages to reset to the master bg - sal_uInt16 nPageCount(mpDoc->GetSdPageCount(ePageKind)); - for(sal_uInt16 i=0; i<nPageCount; ++i) - { - SdPage *pPage = mpDoc->GetSdPage(i, ePageKind); - - const SfxItemSet& rFillAttributes = pPage->getSdrPageProperties().GetItemSet(); - if(drawing::FillStyle_NONE != rFillAttributes.Get(XATTR_FILLSTYLE).GetValue()) - { - SdBackgroundObjUndoAction *pBackgroundObjUndoAction = new SdBackgroundObjUndoAction(*mpDoc, *pPage, rFillAttributes); - pUndoGroup->AddAction(pBackgroundObjUndoAction); - - SdrPageProperties& rPageProperties = pPage->getSdrPageProperties(); - rPageProperties.ClearItem( XATTR_FILLBITMAP ); - rPageProperties.ClearItem( XATTR_FILLGRADIENT ); - rPageProperties.ClearItem( XATTR_FILLHATCH ); - rPageProperties.PutItem(XFillStyleItem(drawing::FillStyle_NONE)); - - pPage->ActionChanged(); - } - } - - pUndoMgr->AddUndoAction(pUndoGroup); - pUndoMgr->LeaveListAction(); - - } // if background filling is set to master pages then clear from page set - if( mbMasterPage || bSetToAllPages ) + if( mbMasterPage ) { for( sal_uInt16 nWhich = XATTR_FILL_FIRST; nWhich <= XATTR_FILL_LAST; nWhich++ ) { diff --git a/uitest/impress_tests/backgrounds.py b/uitest/impress_tests/backgrounds.py index 4e904899574c..5d422fe8b7bc 100644 --- a/uitest/impress_tests/backgrounds.py +++ b/uitest/impress_tests/backgrounds.py @@ -123,11 +123,6 @@ class ImpressBackgrounds(UITestCase): xOkBtn = xPageSetupDlg.getChild("ok") xOkBtn.executeAction("CLICK", tuple()) - xConfirmDlg = self.xUITest.getTopFocusWindow() - - xNoBtn = xConfirmDlg.getChild("no") - xNoBtn.executeAction("CLICK", tuple()) - self.checkDefaultBackground(button) self.ui_test.execute_dialog_through_command(".uno:PageSetup") @@ -142,11 +137,6 @@ class ImpressBackgrounds(UITestCase): xOkBtn = xPageSetupDlg.getChild("ok") xOkBtn.executeAction("CLICK", tuple()) - xConfirmDlg = self.xUITest.getTopFocusWindow() - - xNoBtn = xConfirmDlg.getChild("no") - xNoBtn.executeAction("CLICK", tuple()) - self.checkDefaultBackground('btnnone') self.ui_test.close_doc() |