summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-09-22 14:02:20 +0200
committerEike Rathke <erack@redhat.com>2017-09-22 21:52:30 +0200
commit3b06d9df29dc2aef568bad5bbe10c57e78bbb81a (patch)
treeeaede36ba4366729bd35d68cde580985171e4fe5 /svtools
parentd4b6e524398d83a500647d6a721b703dee767f06 (diff)
Introduce DocumentToGraphicRenderer::isShapeSelected()
Change-Id: I66fc0e39a7a35969b937253c88326516949ea7e7 Reviewed-on: https://gerrit.libreoffice.org/42653 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/filter/DocumentToGraphicRenderer.cxx24
1 files changed, 24 insertions, 0 deletions
diff --git a/svtools/source/filter/DocumentToGraphicRenderer.cxx b/svtools/source/filter/DocumentToGraphicRenderer.cxx
index 180631cf56e4..8bf5120078bc 100644
--- a/svtools/source/filter/DocumentToGraphicRenderer.cxx
+++ b/svtools/source/filter/DocumentToGraphicRenderer.cxx
@@ -31,6 +31,8 @@
#include <com/sun/star/view/XSelectionSupplier.hpp>
#include <com/sun/star/beans/PropertyValues.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/drawing/XShapes.hpp>
+#include <com/sun/star/drawing/XShape.hpp>
#include <toolkit/helper/vclunohelper.hxx>
@@ -227,4 +229,26 @@ sal_Int32 DocumentToGraphicRenderer::getCurrentPageWriter()
return xCursor->getPage();
}
+// static
+bool DocumentToGraphicRenderer::isShapeSelected(
+ css::uno::Reference< css::drawing::XShapes > & rxShapes,
+ css::uno::Reference< css::drawing::XShape > & rxShape,
+ const css::uno::Reference< css::frame::XController > & rxController )
+{
+ bool bShape = false;
+ if (rxController.is())
+ {
+ uno::Reference< view::XSelectionSupplier > xSelectionSupplier( rxController, uno::UNO_QUERY);
+ if (xSelectionSupplier.is())
+ {
+ uno::Any aAny( xSelectionSupplier->getSelection());
+ if (aAny >>= rxShapes)
+ bShape = true;
+ else if (aAny >>= rxShape)
+ bShape = true;
+ }
+ }
+ return bShape;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */