summaryrefslogtreecommitdiff
path: root/sd/source/ui/slideshow
diff options
context:
space:
mode:
authorRegina Henschel <rb.henschel@t-online.de>2020-04-19 18:22:11 +0200
committerRegina Henschel <rb.henschel@t-online.de>2020-04-25 14:49:30 +0200
commiteb2d669af61b8808d5819b16157c59d3c6c3e03b (patch)
tree504c6c46494d41d85c6ac73387b47ce305895f7b /sd/source/ui/slideshow
parent10dba26804cc0c14f74069c26112e75dacf3865b (diff)
tdf#129898 Use layer DrawnInSlideshow in edit mode
If 'Mouse pointer as pen' is set in slideshow settings, painting in slideshow becomes persistent. A layer DrawnInSlideshow is created for that purpose during slideshow. But that layer was not known to the view from where the slideshow was started. Generating a layer had been done regardless whether such layer already exists or not. That had produced several layers with identical name. That may not happen, because layers are identified by name. Change-Id: I2ba9bad5babe5a1bba3d1fc69d028d9037d2bd47 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92502 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
Diffstat (limited to 'sd/source/ui/slideshow')
-rw-r--r--sd/source/ui/slideshow/slideshow.cxx26
1 files changed, 26 insertions, 0 deletions
diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx
index e43d08b960a9..1b63f0d06f14 100644
--- a/sd/source/ui/slideshow/slideshow.cxx
+++ b/sd/source/ui/slideshow/slideshow.cxx
@@ -28,6 +28,7 @@
#include <vcl/svapp.hxx>
#include <vcl/wrkwin.hxx>
#include <svx/svdpool.hxx>
+#include <svx/svdlayer.hxx>
#include <svl/itemprop.hxx>
#include <sfx2/bindings.hxx>
@@ -35,6 +36,7 @@
#include <sfx2/sfxsids.hrc>
#include <framework/FrameworkHelper.hxx>
+#include <comphelper/extract.hxx>
#include <FrameView.hxx>
#include <createpresentation.hxx>
@@ -766,6 +768,30 @@ void SAL_CALL SlideShow::end()
}
}
+ // In case mbMouseAsPen was set, a new layer DrawnInSlideshow might have been generated
+ // during slideshow, which is not known to FrameView yet.
+ if (any2bool(getPropertyValue("UsePen"))
+ && pViewShell->GetDoc()->GetLayerAdmin().GetLayer("DrawnInSlideshow"))
+ {
+ SdrLayerIDSet aDocLayerIDSet;
+ pViewShell->GetDoc()->GetLayerAdmin().getVisibleLayersODF(aDocLayerIDSet);
+ if (pViewShell->GetFrameView()->GetVisibleLayers() != aDocLayerIDSet)
+ {
+ pViewShell->GetFrameView()->SetVisibleLayers(aDocLayerIDSet);
+ }
+ pViewShell->GetDoc()->GetLayerAdmin().getPrintableLayersODF(aDocLayerIDSet);
+ if (pViewShell->GetFrameView()->GetPrintableLayers() != aDocLayerIDSet)
+ {
+ pViewShell->GetFrameView()->SetPrintableLayers(aDocLayerIDSet);
+ }
+ pViewShell->GetDoc()->GetLayerAdmin().getLockedLayersODF(aDocLayerIDSet);
+ if (pViewShell->GetFrameView()->GetLockedLayers() != aDocLayerIDSet)
+ {
+ pViewShell->GetFrameView()->SetLockedLayers(aDocLayerIDSet);
+ }
+ pViewShell->InvalidateWindows();
+ }
+
// Fire the acc focus event when focus is switched back. The above method
// mpCurrentViewShellBase->GetWindow()->GrabFocus() will set focus to WorkWindow
// instead of the sd::window, so here call Shell's method to fire the focus event