diff options
author | Eike Rathke <erack@redhat.com> | 2017-09-19 19:08:14 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2017-09-19 19:09:22 +0200 |
commit | cb6cbbd5cad2ea0433cf5cc3ced8491f5c400a38 (patch) | |
tree | b5d6108dbe18e77851ba0ed92ecce1f1ff0056b4 /svtools | |
parent | 179da6befe2181e276a12de350e3dd80682c4b2f (diff) |
Introduce DocumentToGraphicRenderer::hasSelection() and maSelection
Change-Id: Ib7a9df04eb1b8646e20f58c3f9af3ee2dbbb13db
Reviewed-on: https://gerrit.libreoffice.org/42489
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.cxx | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/svtools/source/filter/DocumentToGraphicRenderer.cxx b/svtools/source/filter/DocumentToGraphicRenderer.cxx index 459bfb925174..8cf4e0e53a77 100644 --- a/svtools/source/filter/DocumentToGraphicRenderer.cxx +++ b/svtools/source/filter/DocumentToGraphicRenderer.cxx @@ -46,22 +46,6 @@ DocumentToGraphicRenderer::DocumentToGraphicRenderer( const Reference<XComponent mxToolkit( VCLUnoHelper::CreateToolkit() ), mbSelectionOnly( bSelectionOnly ) { -} - -DocumentToGraphicRenderer::~DocumentToGraphicRenderer() -{ -} - -Size DocumentToGraphicRenderer::getDocumentSizeInPixels(sal_Int32 nCurrentPage) -{ - Size aSize100mm = getDocumentSizeIn100mm(nCurrentPage); - return Application::GetDefaultDevice()->LogicToPixel( aSize100mm, MapUnit::Map100thMM ); -} - -uno::Any DocumentToGraphicRenderer::getSelection() const -{ - uno::Any aSelection; - aSelection <<= mxDocument; // default: render whole document if (mbSelectionOnly && mxController.is()) { try @@ -71,13 +55,37 @@ uno::Any DocumentToGraphicRenderer::getSelection() const { uno::Any aViewSelection( xSelSup->getSelection()); if (aViewSelection.hasValue()) - aSelection = aViewSelection; + maSelection = aViewSelection; } } catch (const uno::Exception&) { } } +} + +DocumentToGraphicRenderer::~DocumentToGraphicRenderer() +{ +} + +Size DocumentToGraphicRenderer::getDocumentSizeInPixels(sal_Int32 nCurrentPage) +{ + Size aSize100mm = getDocumentSizeIn100mm(nCurrentPage); + return Application::GetDefaultDevice()->LogicToPixel( aSize100mm, MapUnit::Map100thMM ); +} + +bool DocumentToGraphicRenderer::hasSelection() const +{ + return maSelection.hasValue(); +} + +uno::Any DocumentToGraphicRenderer::getSelection() const +{ + uno::Any aSelection; + if (hasSelection()) + aSelection <<= maSelection; + else + aSelection <<= mxDocument; // default: render whole document return aSelection; } |