From dd7fd51a053be6e664a1a358501dd27e0118f221 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Sun, 23 Sep 2018 11:37:33 +0200 Subject: tdf#120069: Do not crash changing background color in draw Regression from c57f10b67fceef47d304d74dce93be7389a7720c, where I disabled the master background in Impress but not in Draw, and both share some common code. Besides, disable master background in draw as well. Follow-up of bug tdf#111306 Change-Id: I772382b5ed8eff3a35d001ea498810613137d172 Reviewed-on: https://gerrit.libreoffice.org/60914 Reviewed-by: Adolfo Jayme Barrientos Tested-by: Adolfo Jayme Barrientos --- sd/source/ui/sidebar/SlideBackground.cxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'sd') diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx index 4e9a7a1bee04..cf5fea5e708e 100644 --- a/sd/source/ui/sidebar/SlideBackground.cxx +++ b/sd/source/ui/sidebar/SlideBackground.cxx @@ -278,6 +278,17 @@ void SlideBackground::HandleContextChange( else if ( IsDraw() ) { mpMasterLabel->SetText(SdResId(STR_MASTERPAGE_LABEL)); + + if (maContext == maDrawOtherContext) + { + mpFillStyle->Show(); + mpBackgroundLabel->Show(); + } + else if (maContext == maDrawMasterContext) + { + mpFillStyle->Hide(); + mpBackgroundLabel->Hide(); + } } } @@ -285,7 +296,7 @@ void SlideBackground::Update() { eFillStyle nPos = static_cast(mpFillStyle->GetSelectedEntryPos()); - if(maContext != maImpressOtherContext) + if(maContext != maImpressOtherContext && maContext != maDrawOtherContext) nPos = NONE; SfxObjectShell* pSh = SfxObjectShell::Current(); -- cgit