Kaydet (Commit) cea45899 authored tarafından pv2k's avatar pv2k Kaydeden (comit) Katarina Behrens

tdf#106679 UI:SideBar Master Slide Button label corrected

Change-Id: Id3ac678d3b1b28564fc8d7e677caf157b4757bcb
Reviewed-on: https://gerrit.libreoffice.org/37946Reviewed-by: 's avatarKatarina Behrens <Katarina.Behrens@cib.de>
Tested-by: 's avatarKatarina Behrens <Katarina.Behrens@cib.de>
üst 03589f66
...@@ -108,6 +108,10 @@ SlideBackground::SlideBackground( ...@@ -108,6 +108,10 @@ SlideBackground::SlideBackground(
mbEditModeChangePending(false), mbEditModeChangePending(false),
mxFrame(rxFrame), mxFrame(rxFrame),
maContext(), 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), maApplication(vcl::EnumContext::Application::NONE),
mbTitle(false), mbTitle(false),
mpBindings(pBindings) mpBindings(pBindings)
...@@ -146,7 +150,6 @@ void SlideBackground::Initialize() ...@@ -146,7 +150,6 @@ void SlideBackground::Initialize()
mpPaperSizeBox->FillPaperSizeEntries( PaperSizeApp::Draw ); mpPaperSizeBox->FillPaperSizeEntries( PaperSizeApp::Draw );
mpPaperSizeBox->SetSelectHdl(LINK(this,SlideBackground,PaperSizeModifyHdl)); mpPaperSizeBox->SetSelectHdl(LINK(this,SlideBackground,PaperSizeModifyHdl));
mpPaperOrientation->SetSelectHdl(LINK(this,SlideBackground,PaperSizeModifyHdl)); mpPaperOrientation->SetSelectHdl(LINK(this,SlideBackground,PaperSizeModifyHdl));
mpCloseMaster->Hide();
mpCloseMaster->SetClickHdl(LINK(this, SlideBackground, CloseMasterHdl)); mpCloseMaster->SetClickHdl(LINK(this, SlideBackground, CloseMasterHdl));
meUnit = maPaperSizeController.GetCoreMetric(); meUnit = maPaperSizeController.GetCoreMetric();
...@@ -171,6 +174,25 @@ void SlideBackground::Initialize() ...@@ -171,6 +174,25 @@ void SlideBackground::Initialize()
aLayoutName = aLayoutName.copy(0,aLayoutName.indexOf(SD_LT_SEPARATOR)); aLayoutName = aLayoutName.copy(0,aLayoutName.indexOf(SD_LT_SEPARATOR));
mpMasterSlide->SelectEntry(aLayoutName); 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)); mpFillStyle->SelectEntryPos(static_cast< sal_Int32 >(NONE));
...@@ -187,6 +209,14 @@ void SlideBackground::HandleContextChange( ...@@ -187,6 +209,14 @@ void SlideBackground::HandleContextChange(
if (maContext == rContext) if (maContext == rContext)
return; return;
maContext = rContext; 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() void SlideBackground::Update()
...@@ -390,32 +420,22 @@ IMPL_LINK(SlideBackground, EventMultiplexerListener, ...@@ -390,32 +420,22 @@ IMPL_LINK(SlideBackground, EventMultiplexerListener,
{ {
if(!mbTitle) if(!mbTitle)
{ {
vcl::EnumContext aDrawOtherContext(vcl::EnumContext::Application::Draw, if(maContext == maDrawOtherContext || maContext == maDrawMasterContext)
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)
{ {
mpMasterLabel->SetText(SdResId(STR_MASTERPAGE_NAME)); mpMasterLabel->SetText(SdResId(STR_MASTERPAGE_NAME));
maApplication = vcl::EnumContext::Application::Draw;
mpCloseMaster->Hide(); mpCloseMaster->Hide();
mpEditMaster->Hide(); mpEditMaster->Hide();
if( maContext == aDrawMasterContext) if( maContext == maDrawMasterContext)
SetPanelTitle(SdResId(STR_MASTERPAGE_NAME)); SetPanelTitle(SdResId(STR_MASTERPAGE_NAME));
else else
SetPanelTitle(SdResId(STR_PAGE_NAME)); SetPanelTitle(SdResId(STR_PAGE_NAME));
} }
else if ( maContext == aImpressOtherContext || maContext == aImpressMasterContext ) else if ( maContext == maImpressOtherContext || maContext == maImpressMasterContext )
{ {
mpMasterLabel->SetText(SdResId(STR_MASTERSLIDE_NAME)); mpMasterLabel->SetText(SdResId(STR_MASTERSLIDE_NAME));
maApplication = vcl::EnumContext::Application::Impress;
mpCloseMaster->Hide(); mpCloseMaster->Hide();
mpEditMaster->Show(); mpEditMaster->Show();
if( maContext == aImpressMasterContext ) if( maContext == maImpressMasterContext )
SetPanelTitle(SdResId(STR_MASTERSLIDE_NAME)); SetPanelTitle(SdResId(STR_MASTERSLIDE_NAME));
else else
SetPanelTitle(SdResId(STR_SLIDE_NAME)); SetPanelTitle(SdResId(STR_SLIDE_NAME));
......
...@@ -113,6 +113,10 @@ private: ...@@ -113,6 +113,10 @@ private:
css::uno::Reference<css::frame::XFrame> mxFrame; css::uno::Reference<css::frame::XFrame> mxFrame;
vcl::EnumContext maContext; vcl::EnumContext maContext;
vcl::EnumContext maDrawOtherContext;
vcl::EnumContext maDrawMasterContext;
vcl::EnumContext maImpressOtherContext;
vcl::EnumContext maImpressMasterContext;
vcl::EnumContext::Application maApplication; vcl::EnumContext::Application maApplication;
bool mbTitle; bool mbTitle;
SfxBindings* mpBindings; SfxBindings* mpBindings;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment