summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-09-19 20:30:05 +0200
committerEike Rathke <erack@redhat.com>2017-09-19 20:31:23 +0200
commitcb9d99dbb5a7249ca7437bd5c30c6c9374089a16 (patch)
treea4a11508ef697d92a461e1c0e89cb8e207f0456c /svtools
parentc9f765c4de58bd9b79c52b1b536c19c2abd06b0c (diff)
DocumentToGraphicRenderer: suppress selection for Writer, it doesn't work
See FIXME comment. Change-Id: I7511f5b498029fedcbd0c39d5ec67288782330ae Reviewed-on: https://gerrit.libreoffice.org/42493 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.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/svtools/source/filter/DocumentToGraphicRenderer.cxx b/svtools/source/filter/DocumentToGraphicRenderer.cxx
index f262ff5c0161..524c30afcd64 100644
--- a/svtools/source/filter/DocumentToGraphicRenderer.cxx
+++ b/svtools/source/filter/DocumentToGraphicRenderer.cxx
@@ -30,6 +30,7 @@
#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
#include <com/sun/star/view/XSelectionSupplier.hpp>
#include <com/sun/star/beans/PropertyValues.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
#include <toolkit/helper/vclunohelper.hxx>
@@ -55,7 +56,20 @@ DocumentToGraphicRenderer::DocumentToGraphicRenderer( const Reference<XComponent
{
uno::Any aViewSelection( xSelSup->getSelection());
if (aViewSelection.hasValue())
+ {
maSelection = aViewSelection;
+ /* FIXME: Writer always has a selection even if nothing is
+ * selected, but passing a selection to
+ * XRenderable::render() it always renders an empty page.
+ * So disable the selection already here. The current page
+ * the cursor is on is rendered. */
+ uno::Reference< lang::XServiceInfo > xServiceInfo( mxDocument, uno::UNO_QUERY);
+ if (xServiceInfo.is())
+ {
+ if (xServiceInfo->supportsService("com.sun.star.text.TextDocument"))
+ maSelection = uno::Any();
+ }
+ }
}
}
catch (const uno::Exception&)