summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpv2k <vidhey96@gmail.com>2017-05-23 13:07:00 +0530
committerKatarina Behrens <Katarina.Behrens@cib.de>2017-06-13 13:25:05 +0200
commitcea458998745f0084271b41d90c92ad27ad071eb (patch)
tree12f955c44ad00d0390885dad2e4e171ef621bf8b
parent03589f669fe16134991b66ebbac19e510f4f6de9 (diff)
tdf#106679 UI:SideBar Master Slide Button label corrected
Change-Id: Id3ac678d3b1b28564fc8d7e677caf157b4757bcb Reviewed-on: https://gerrit.libreoffice.org/37946 Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de> Tested-by: Katarina Behrens <Katarina.Behrens@cib.de>
-rw-r--r--sd/source/ui/sidebar/SlideBackground.cxx50
-rw-r--r--sd/source/ui/sidebar/SlideBackground.hxx4
2 files changed, 39 insertions, 15 deletions
diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx
index c238260f08d8..dae67c1e1081 100644
--- a/sd/source/ui/sidebar/SlideBackground.cxx
+++ b/sd/source/ui/sidebar/SlideBackground.cxx
@@ -108,6 +108,10 @@ SlideBackground::SlideBackground(
mbEditModeChangePending(false),
mxFrame(rxFrame),
maContext(),
+ maDrawOtherContext(vcl::EnumContext::Application::Draw, vcl::EnumContext::Context::DrawPage),
+ maDrawMasterContext(vcl::EnumContext::Application::Draw, vcl::EnumContext::Context::MasterPage),
+ maImpressOtherContext(vcl::EnumContext::Application::Impress, vcl::EnumContext::Context::DrawPage),
+ maImpressMasterContext(vcl::EnumContext::Application::Impress, vcl::EnumContext::Context::MasterPage),
maApplication(vcl::EnumContext::Application::NONE),
mbTitle(false),
mpBindings(pBindings)
@@ -146,7 +150,6 @@ void SlideBackground::Initialize()
mpPaperSizeBox->FillPaperSizeEntries( PaperSizeApp::Draw );
mpPaperSizeBox->SetSelectHdl(LINK(this,SlideBackground,PaperSizeModifyHdl));
mpPaperOrientation->SetSelectHdl(LINK(this,SlideBackground,PaperSizeModifyHdl));
- mpCloseMaster->Hide();
mpCloseMaster->SetClickHdl(LINK(this, SlideBackground, CloseMasterHdl));
meUnit = maPaperSizeController.GetCoreMetric();
@@ -171,6 +174,25 @@ void SlideBackground::Initialize()
aLayoutName = aLayoutName.copy(0,aLayoutName.indexOf(SD_LT_SEPARATOR));
mpMasterSlide->SelectEntry(aLayoutName);
}
+
+ DrawViewShell* pDrawViewShell = static_cast<DrawViewShell*>(pMainViewShell);
+ EditMode eMode = pDrawViewShell->GetEditMode();
+ if ( eMode == EditMode::MasterPage )
+ {
+ mpCloseMaster->Show();
+ mpEditMaster->Hide();
+ mpMasterSlide->Disable();
+ mpDspMasterBackground->Disable();
+ mpDspMasterObjects->Disable();
+ }
+ else
+ {
+ mpCloseMaster->Hide();
+ mpEditMaster->Show();
+ mpMasterSlide->Enable();
+ mpDspMasterBackground->Enable();
+ mpDspMasterObjects->Enable();
+ }
}
mpFillStyle->SelectEntryPos(static_cast< sal_Int32 >(NONE));
@@ -187,6 +209,14 @@ void SlideBackground::HandleContextChange(
if (maContext == rContext)
return;
maContext = rContext;
+ if ( maContext == maImpressOtherContext || maContext == maImpressMasterContext )
+ {
+ maApplication = vcl::EnumContext::Application::Impress;
+ }
+ else if ( maContext == maDrawOtherContext || maContext == maDrawMasterContext )
+ {
+ maApplication = vcl::EnumContext::Application::Draw;
+ }
}
void SlideBackground::Update()
@@ -390,32 +420,22 @@ IMPL_LINK(SlideBackground, EventMultiplexerListener,
{
if(!mbTitle)
{
- vcl::EnumContext aDrawOtherContext(vcl::EnumContext::Application::Draw,
- vcl::EnumContext::Context::DrawPage);
- vcl::EnumContext aDrawMasterContext(vcl::EnumContext::Application::Draw,
- vcl::EnumContext::Context::MasterPage);
- vcl::EnumContext aImpressOtherContext(vcl::EnumContext::Application::Impress,
- vcl::EnumContext::Context::DrawPage);
- vcl::EnumContext aImpressMasterContext(vcl::EnumContext::Application::Impress,
- vcl::EnumContext::Context::MasterPage);
- if(maContext == aDrawOtherContext || maContext == aDrawMasterContext)
+ if(maContext == maDrawOtherContext || maContext == maDrawMasterContext)
{
mpMasterLabel->SetText(SdResId(STR_MASTERPAGE_NAME));
- maApplication = vcl::EnumContext::Application::Draw;
mpCloseMaster->Hide();
mpEditMaster->Hide();
- if( maContext == aDrawMasterContext)
+ if( maContext == maDrawMasterContext)
SetPanelTitle(SdResId(STR_MASTERPAGE_NAME));
else
SetPanelTitle(SdResId(STR_PAGE_NAME));
}
- else if ( maContext == aImpressOtherContext || maContext == aImpressMasterContext )
+ else if ( maContext == maImpressOtherContext || maContext == maImpressMasterContext )
{
mpMasterLabel->SetText(SdResId(STR_MASTERSLIDE_NAME));
- maApplication = vcl::EnumContext::Application::Impress;
mpCloseMaster->Hide();
mpEditMaster->Show();
- if( maContext == aImpressMasterContext )
+ if( maContext == maImpressMasterContext )
SetPanelTitle(SdResId(STR_MASTERSLIDE_NAME));
else
SetPanelTitle(SdResId(STR_SLIDE_NAME));
diff --git a/sd/source/ui/sidebar/SlideBackground.hxx b/sd/source/ui/sidebar/SlideBackground.hxx
index c7ace1a146e8..21098bfac61c 100644
--- a/sd/source/ui/sidebar/SlideBackground.hxx
+++ b/sd/source/ui/sidebar/SlideBackground.hxx
@@ -113,6 +113,10 @@ private:
css::uno::Reference<css::frame::XFrame> mxFrame;
vcl::EnumContext maContext;
+ vcl::EnumContext maDrawOtherContext;
+ vcl::EnumContext maDrawMasterContext;
+ vcl::EnumContext maImpressOtherContext;
+ vcl::EnumContext maImpressMasterContext;
vcl::EnumContext::Application maApplication;
bool mbTitle;
SfxBindings* mpBindings;