svtools/source/filter/DocumentToGraphicRenderer.cxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
New commits: commit cb9d99dbb5a7249ca7437bd5c30c6c9374089a16 Author: Eike Rathke <er...@redhat.com> Date: Tue Sep 19 20:30:05 2017 +0200 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 <er...@redhat.com> Tested-by: Eike Rathke <er...@redhat.com> 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&) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits