summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorArmin Le Grand (allotropia) <armin.le.grand.extern@allotropia.de>2024-03-28 12:22:12 +0100
committerArmin Le Grand <Armin.Le.Grand@me.com>2024-03-29 01:55:38 +0100
commitaef28c23adc87b8e26eacb56c7dbcf652e907fb9 (patch)
treec0db14318c17aacb439061457b604e616ec47252 /sd
parent3027850e18eb2983e26d2535c33ff79eaa756af9 (diff)
IASS: Update NextSlide in PresenterConsole
Change-Id: I6060e95aabfdb5956bf2f4a71d047bdf5c97a723 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165458 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/console/PresenterController.cxx11
-rw-r--r--sd/source/console/PresenterController.hxx4
-rw-r--r--sd/source/console/PresenterScreen.cxx23
-rw-r--r--sd/source/console/PresenterScreen.hxx2
4 files changed, 40 insertions, 0 deletions
diff --git a/sd/source/console/PresenterController.cxx b/sd/source/console/PresenterController.cxx
index 7bb137d8c03b..e5874c8e7fab 100644
--- a/sd/source/console/PresenterController.cxx
+++ b/sd/source/console/PresenterController.cxx
@@ -51,6 +51,7 @@
#include <com/sun/star/util/URLTransformer.hpp>
#include <rtl/ustrbuf.hxx>
+#include <svx/unoapi.hxx>
#include <utility>
using namespace ::com::sun::star;
@@ -402,6 +403,16 @@ void PresenterController::UpdateViews()
}
}
+void PresenterController::CheckNextSlideUpdate(const Reference<drawing::XShape>& rxShape)
+{
+ if (!mxNextSlide)
+ return;
+
+ // check if shape is member of page or it's masterPage
+ if(IsXShapeAssociatedWithXDrawPage(rxShape, mxNextSlide))
+ UpdateViews();
+}
+
SharedBitmapDescriptor
PresenterController::GetViewBackground (const OUString& rsViewURL) const
{
diff --git a/sd/source/console/PresenterController.hxx b/sd/source/console/PresenterController.hxx
index a4d7993eecda..c4a7d22b6096 100644
--- a/sd/source/console/PresenterController.hxx
+++ b/sd/source/console/PresenterController.hxx
@@ -130,6 +130,10 @@ public:
void HandleMouseClick (const css::awt::MouseEvent& rEvent);
void UpdatePaneTitles();
+ // check if the 'NextSlide' needs an update when the given
+ // XShape is changed and trigger that update
+ void CheckNextSlideUpdate(const css::uno::Reference<css::drawing::XShape>& rxShape);
+
/** Request activation or deactivation of (some of) the views according
to the given parameters.
*/
diff --git a/sd/source/console/PresenterScreen.cxx b/sd/source/console/PresenterScreen.cxx
index 2cbd612ff357..7e3f9f0722c5 100644
--- a/sd/source/console/PresenterScreen.cxx
+++ b/sd/source/console/PresenterScreen.cxx
@@ -220,6 +220,20 @@ void SAL_CALL PresenterScreenListener::notifyEvent( const css::document::EventOb
mpPresenterScreen = nullptr;
}
}
+ else if ( Event.EventName == "ShapeModified" )
+ {
+ if (mpPresenterScreen.is())
+ {
+ Reference<drawing::XShape> xShape(Event.Source, UNO_QUERY);
+
+ if (xShape.is())
+ {
+ // when presenter is used and shape changes, check
+ // and evtl. trigger update of 'NextSlide' view
+ mpPresenterScreen->CheckNextSlideUpdate(xShape);
+ }
+ }
+ }
}
// XEventListener
@@ -432,6 +446,15 @@ void PresenterScreen::SwitchMonitors()
}
}
+void PresenterScreen::CheckNextSlideUpdate(const Reference<drawing::XShape>& rxShape)
+{
+ if (nullptr == mpPresenterController)
+ return;
+
+ // forward to PresenterController if used
+ mpPresenterController->CheckNextSlideUpdate(rxShape);
+}
+
/**
* Return the real VCL screen number to show the presenter console
* on or -1 to not show anything.
diff --git a/sd/source/console/PresenterScreen.hxx b/sd/source/console/PresenterScreen.hxx
index 430384a45c6d..907d48a12e78 100644
--- a/sd/source/console/PresenterScreen.hxx
+++ b/sd/source/console/PresenterScreen.hxx
@@ -127,6 +127,8 @@ public:
virtual void SAL_CALL disposing ( const css::lang::EventObject& rEvent) override;
+ void CheckNextSlideUpdate(const css::uno::Reference<css::drawing::XShape>& rxShape);
+
private:
css::uno::Reference<css::frame::XModel2 > mxModel;
rtl::Reference<::sd::DrawController> mxController;