From a7a99a574660fc62a9514b2ed3f8ddfe8ad8540c Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Mon, 24 Jul 2017 22:31:34 +0200 Subject: Export to PNG: use selection if Selection is selected The SelectionOnly property from the export file dialog was not passed down from GraphicExportFilter::filter() to DocumentToGraphicRenderer so that always passed a component model instead of a selection object to the implementation of XRenderable (getRendererCount(), getRenderer(), render()) Also have GraphicExportDialog consider the selection so the DocumentToGraphicRenderer at its GraphicExportOptionsDialog calls XRenderable the same. Change-Id: I976bf16cf87cf5ca2678bdba7adfaf61c2063168 Reviewed-on: https://gerrit.libreoffice.org/40380 Reviewed-by: Eike Rathke Tested-by: Jenkins --- include/svtools/DocumentToGraphicRenderer.hxx | 5 ++++- include/svtools/GraphicExportOptionsDialog.hxx | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'include/svtools') diff --git a/include/svtools/DocumentToGraphicRenderer.hxx b/include/svtools/DocumentToGraphicRenderer.hxx index e43e47208198..2e6ee141773a 100644 --- a/include/svtools/DocumentToGraphicRenderer.hxx +++ b/include/svtools/DocumentToGraphicRenderer.hxx @@ -38,9 +38,12 @@ class SVT_DLLPUBLIC DocumentToGraphicRenderer css::uno::Reference mxController; css::uno::Reference mxRenderable; css::uno::Reference mxToolkit; + bool mbSelectionOnly; + + css::uno::Any getSelection() const; public: - DocumentToGraphicRenderer(const css::uno::Reference& xDocument); + DocumentToGraphicRenderer(const css::uno::Reference& xDocument, bool bSelectionOnly); ~DocumentToGraphicRenderer(); sal_Int32 getCurrentPageWriter( ); diff --git a/include/svtools/GraphicExportOptionsDialog.hxx b/include/svtools/GraphicExportOptionsDialog.hxx index 5524b96d4db3..2ed5dfdd7749 100644 --- a/include/svtools/GraphicExportOptionsDialog.hxx +++ b/include/svtools/GraphicExportOptionsDialog.hxx @@ -61,7 +61,8 @@ private: DECL_LINK( resolutionModifiedHandle, Edit&, void ); public: - GraphicExportOptionsDialog( vcl::Window* pWindow, const css::uno::Reference& rxSourceDocument ); + GraphicExportOptionsDialog( vcl::Window* pWindow, + const css::uno::Reference& rxSourceDocument, bool bSelectionOnly ); virtual ~GraphicExportOptionsDialog() override; virtual void dispose() override; css::uno::Sequence getFilterData(); -- cgit