diff options
author | Armin Le Grand (allotropia) <armin.le.grand.extern@allotropia.de> | 2024-03-28 12:22:12 +0100 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@me.com> | 2024-03-29 01:55:38 +0100 |
commit | aef28c23adc87b8e26eacb56c7dbcf652e907fb9 (patch) | |
tree | c0db14318c17aacb439061457b604e616ec47252 /svx | |
parent | 3027850e18eb2983e26d2535c33ff79eaa756af9 (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 'svx')
-rw-r--r-- | svx/source/unodraw/unopage.cxx | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx index 06cebcfc4914..0dcba14527ec 100644 --- a/svx/source/unodraw/unopage.cxx +++ b/svx/source/unodraw/unopage.cxx @@ -907,6 +907,42 @@ SdrPage* GetSdrPageFromXDrawPage( const uno::Reference< drawing::XDrawPage >& xD return nullptr; } +// helper that returns true if the given XShape is member of the given +// XDrawPage or it's MasterPage (aka associated) +bool IsXShapeAssociatedWithXDrawPage( + const css::uno::Reference<css::drawing::XShape>& rxShape, + const css::uno::Reference< css::drawing::XDrawPage >& rxDrawPage) noexcept +{ + if (!rxShape) + return false; + + if (!rxDrawPage) + return false; + + const SdrObject* pSdrObject(SdrObject::getSdrObjectFromXShape(rxShape)); + if (nullptr == pSdrObject) + return false; + + SdrPage* pSdrPage(GetSdrPageFromXDrawPage(rxDrawPage)); + if (nullptr == pSdrPage) + return false; + + const SdrPage* pPageFromObj(pSdrObject->getSdrPageFromSdrObject()); + if (nullptr == pPageFromObj) + return false; + + if (pSdrPage == pPageFromObj) + // given XShape is member of given XDrawPage + return true; + + if (pSdrPage->TRG_HasMasterPage()) + if (&pSdrPage->TRG_GetMasterPage() == pPageFromObj) + // given XShape is member of MasterPage of given XDrawPage + return true; + + return false; +} + // XFormsSupplier css::uno::Reference< css::container::XNameContainer > SAL_CALL SvxDrawPage::getForms() { |