diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2021-03-25 17:21:35 +0100 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2021-04-13 14:25:04 +0200 |
commit | bd93f5cec54350b6f07c5b7cd4987ea3762e3f40 (patch) | |
tree | 6f007978d9579d636d50cc96f0791f9452802666 /sd/source/ui/view/drviews3.cxx | |
parent | f6d1da91ccda960d1ee738d688a2cb374e576aef (diff) |
impress: don't exit textbox editing when new slide was added
When new slide is added by other user before currently visible slide
then SwitchPage is called and textbox editing is ended.
Avoid any focus change when setPart is called just for rendering
or SwitchPage is used on previously avtive slide (only slide numer changed).
Change-Id: I7fef42b863e0079acc84dadfc3f891548652b48f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113144
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113806
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'sd/source/ui/view/drviews3.cxx')
-rw-r--r-- | sd/source/ui/view/drviews3.cxx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx index ed28a4370ebc..545c7befeca4 100644 --- a/sd/source/ui/view/drviews3.cxx +++ b/sd/source/ui/view/drviews3.cxx @@ -106,6 +106,7 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq) // End text edit mode for some requests. sal_uInt16 nSlot = rReq.GetSlot(); + bool bAllowFocusChange = true; switch (nSlot) { case SID_OUTPUT_QUALITY_COLOR: @@ -114,6 +115,15 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq) case SID_OUTPUT_QUALITY_CONTRAST: // Do nothing. break; + case SID_SWITCHPAGE: + if (rReq.GetArgs() && rReq.GetArgs()->Count () == 1) + { + const SfxBoolItem* pAllowFocusChange = rReq.GetArg<SfxBoolItem>(SID_SWITCHPAGE); + bAllowFocusChange = pAllowFocusChange->GetValue(); + if (!bAllowFocusChange) + break; + } + BOOST_FALLTHROUGH; default: if ( mpDrawView->IsTextEdit() ) { @@ -137,7 +147,7 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq) const SfxItemSet *pArgs = rReq.GetArgs (); sal_uInt16 nSelectedPage = 0; - if (! pArgs) + if (! pArgs || pArgs->Count () == 1) { nSelectedPage = maTabControl->GetCurPagePos(); } @@ -183,7 +193,7 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq) if( GetDocSh() && (GetDocSh()->GetCreateMode() == SfxObjectCreateMode::EMBEDDED)) GetDocSh()->SetModified(); - SwitchPage(nSelectedPage); + SwitchPage(nSelectedPage, bAllowFocusChange); if(HasCurrentFunction(SID_BEZIER_EDIT)) GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SfxCallMode::ASYNCHRON); |