[Libreoffice-commits] core.git: sd/source
Szymon KÅos (via logerrit)
logerrit at kemper.freedesktop.org
Thu Apr 8 13:45:16 UTC 2021
sd/source/ui/view/drviews4.cxx | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
New commits:
commit 9968367d841a0a1bd81e1535cfc01b782d2febb5
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Mon Mar 22 16:11:03 2021 +0100
Commit: Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Thu Apr 8 15:44:38 2021 +0200
impress: avoid crash when user edits text and other deletes slide
We need to end text edit when page is deleted by other user.
Change-Id: I89824c91f5652421a443feb9412acbae65db8800
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112917
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Jan Holesovsky <kendy at collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113784
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx
index c3557b4980d8..ec3ec5d11d31 100644
--- a/sd/source/ui/view/drviews4.cxx
+++ b/sd/source/ui/view/drviews4.cxx
@@ -58,6 +58,7 @@
#include <drawview.hxx>
#include <svx/bmpmask.hxx>
#include <LayerTabBar.hxx>
+#include <ViewShellBase.hxx>
#include <SlideSorterViewShell.hxx>
#include <svx/svditer.hxx>
@@ -65,6 +66,26 @@
#include <navigatr.hxx>
#include <memory>
+namespace {
+ void EndTextEditOnPage(sal_uInt16 nPageId)
+ {
+ SfxViewShell* pShell = SfxViewShell::GetFirst();
+ while (pShell)
+ {
+ ::sd::ViewShellBase* pBase = dynamic_cast<::sd::ViewShellBase*>(pShell);
+ if (pBase)
+ {
+ ::sd::ViewShell* pViewSh = pBase->GetMainViewShell().get();
+ ::sd::DrawViewShell* pDrawSh = dynamic_cast<::sd::DrawViewShell*>(pViewSh);
+ if (pDrawSh && pDrawSh->GetDrawView() && pDrawSh->getCurrentPage()->getPageId() == nPageId)
+ pDrawSh->GetDrawView()->SdrEndTextEdit();
+ }
+
+ pShell = SfxViewShell::GetNext(*pShell);
+ }
+ }
+}
+
namespace sd {
#define PIPETTE_RANGE 0
@@ -97,6 +118,7 @@ void DrawViewShell::DeleteActualPage()
if((bUseSlideSorter && IsSelected(nPageIndex)) || (!bUseSlideSorter && pPage->IsSelected()))
{
+ EndTextEditOnPage(pPage->getPageId());
Reference< XDrawPage > xPage( xPages->getByIndex( nPageIndex ), UNO_QUERY_THROW );
pagesToDelete.push_back(xPage);
}
More information about the Libreoffice-commits
mailing list