Kaydet (Commit) cb9d99db authored tarafından Eike Rathke's avatar Eike Rathke

DocumentToGraphicRenderer: suppress selection for Writer, it doesn't work

See FIXME comment.

Change-Id: I7511f5b498029fedcbd0c39d5ec67288782330ae
Reviewed-on: https://gerrit.libreoffice.org/42493Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
Tested-by: 's avatarEike Rathke <erack@redhat.com>
üst c9f765c4
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <com/sun/star/text/XTextViewCursorSupplier.hpp> #include <com/sun/star/text/XTextViewCursorSupplier.hpp>
#include <com/sun/star/view/XSelectionSupplier.hpp> #include <com/sun/star/view/XSelectionSupplier.hpp>
#include <com/sun/star/beans/PropertyValues.hpp> #include <com/sun/star/beans/PropertyValues.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <toolkit/helper/vclunohelper.hxx> #include <toolkit/helper/vclunohelper.hxx>
...@@ -55,7 +56,20 @@ DocumentToGraphicRenderer::DocumentToGraphicRenderer( const Reference<XComponent ...@@ -55,7 +56,20 @@ DocumentToGraphicRenderer::DocumentToGraphicRenderer( const Reference<XComponent
{ {
uno::Any aViewSelection( xSelSup->getSelection()); uno::Any aViewSelection( xSelSup->getSelection());
if (aViewSelection.hasValue()) if (aViewSelection.hasValue())
{
maSelection = aViewSelection; 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&) catch (const uno::Exception&)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment