Kaydet (Commit) 4833ed2f authored tarafından Katarina Behrens's avatar Katarina Behrens

tdf#100441: Fix listbox state in master vs. normal mode

Events appear in following order:
normal -> master: 1. EID_EDIT_MODE_MASTER, 2. EID_EDIT_VIEW_SELECTION
master -> normal: 1. EID_EDIT_MODE_NORMAL, 2. EID_END_TEXT_EDIT

This is only partial fix, selecting the right master page in other than
normal mode is still broken

Change-Id: I2dd91e77c4ed5627079fc9d2b39e40c8e74a9f8e
Reviewed-on: https://gerrit.libreoffice.org/26484Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarKatarina Behrens <Katarina.Behrens@cib.de>
üst cf5208b6
......@@ -94,6 +94,7 @@ SlideBackground::SlideBackground(
mpGradientItem(),
mpHatchItem(),
mpBitmapItem(),
mbEditModeChangePending(false),
mxFrame(rxFrame),
maContext(),
mbTitle(false),
......@@ -302,6 +303,10 @@ void SlideBackground::addListener()
tools::EventMultiplexerEvent::EID_CURRENT_PAGE |
tools::EventMultiplexerEvent::EID_MAIN_VIEW_ADDED |
tools::EventMultiplexerEvent::EID_SHAPE_CHANGED |
tools::EventMultiplexerEvent::EID_EDIT_MODE_NORMAL |
tools::EventMultiplexerEvent::EID_EDIT_MODE_MASTER |
tools::EventMultiplexerEvent::EID_EDIT_VIEW_SELECTION |
tools::EventMultiplexerEvent::EID_END_TEXT_EDIT |
tools::EventMultiplexerEvent::EID_VIEW_ADDED);
}
......@@ -321,17 +326,29 @@ IMPL_LINK_TYPED(SlideBackground, EventMultiplexerListener,
case tools::EventMultiplexerEvent::EID_SHAPE_CHANGED:
populateMasterSlideDropdown();
break;
case tools::EventMultiplexerEvent::EID_MAIN_VIEW_ADDED:
case tools::EventMultiplexerEvent::EID_EDIT_MODE_NORMAL:
case tools::EventMultiplexerEvent::EID_EDIT_MODE_MASTER:
mbEditModeChangePending = true;
break;
case tools::EventMultiplexerEvent::EID_EDIT_VIEW_SELECTION:
case tools::EventMultiplexerEvent::EID_END_TEXT_EDIT:
{
ViewShell* pMainViewShell = mrBase.GetMainViewShell().get();
if (pMainViewShell)
if (mbEditModeChangePending)
{
DrawViewShell* pDrawViewShell = static_cast<DrawViewShell*>(pMainViewShell);
EditMode eMode = pDrawViewShell->GetEditMode();
ViewShell* pMainViewShell = mrBase.GetMainViewShell().get();
if (pMainViewShell)
{
DrawViewShell* pDrawViewShell = static_cast<DrawViewShell*>(pMainViewShell);
EditMode eMode = pDrawViewShell->GetEditMode();
if ( eMode == EM_MASTERPAGE)
mpMasterSlide->Disable();
else // EM_PAGE
mpMasterSlide->Enable();
}
if ( eMode == EM_MASTERPAGE)
mpMasterSlide->Disable();
mbEditModeChangePending = false;
}
}
break;
......@@ -405,8 +422,6 @@ void SlideBackground::updateMasterSlideSelection()
SdPage* pMasterPage = static_cast<SdPage*>(&rMasterPage);
mpMasterSlide->SelectEntry(pMasterPage->GetName());
}
else
mpMasterSlide->SetNoSelection();
}
void SlideBackground::dispose()
......
......@@ -102,6 +102,8 @@ private:
std::unique_ptr< XFillHatchItem > mpHatchItem;
std::unique_ptr< XFillBitmapItem > mpBitmapItem;
bool mbEditModeChangePending;
css::uno::Reference<css::frame::XFrame> mxFrame;
::sfx2::sidebar::EnumContext maContext;
bool mbTitle;
......
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