From cb9d99dbb5a7249ca7437bd5c30c6c9374089a16 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Tue, 19 Sep 2017 20:30:05 +0200 Subject: 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 Tested-by: Eike Rathke --- svtools/source/filter/DocumentToGraphicRenderer.cxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'svtools') 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 #include #include +#include #include @@ -55,7 +56,20 @@ DocumentToGraphicRenderer::DocumentToGraphicRenderer( const ReferencegetSelection()); 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&) -- cgit