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

'a'CurrentPage gets on my nerves

Change-Id: Ifb6137048d7206c1f3a718331ed8b42f746052bb
Reviewed-on: https://gerrit.libreoffice.org/42487Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
Tested-by: 's avatarEike Rathke <erack@redhat.com>
üst 9c90cf14
...@@ -115,15 +115,15 @@ sal_Bool SAL_CALL GraphicExportFilter::filter( const Sequence<PropertyValue>& rD ...@@ -115,15 +115,15 @@ sal_Bool SAL_CALL GraphicExportFilter::filter( const Sequence<PropertyValue>& rD
gatherProperties(rDescriptor); gatherProperties(rDescriptor);
DocumentToGraphicRenderer aRenderer( mxDocument, mbSelectionOnly ); DocumentToGraphicRenderer aRenderer( mxDocument, mbSelectionOnly );
sal_Int32 aCurrentPage = aRenderer.getCurrentPageWriter(); sal_Int32 nCurrentPage = aRenderer.getCurrentPageWriter();
Size aDocumentSizePixel = aRenderer.getDocumentSizeInPixels(aCurrentPage); Size aDocumentSizePixel = aRenderer.getDocumentSizeInPixels(nCurrentPage);
Size aTargetSizePixel(mTargetWidth, mTargetHeight); Size aTargetSizePixel(mTargetWidth, mTargetHeight);
if (mTargetWidth == 0 || mTargetHeight == 0) if (mTargetWidth == 0 || mTargetHeight == 0)
aTargetSizePixel = aDocumentSizePixel; aTargetSizePixel = aDocumentSizePixel;
Graphic aGraphic = aRenderer.renderToGraphic(aCurrentPage, aDocumentSizePixel, aTargetSizePixel, COL_WHITE); Graphic aGraphic = aRenderer.renderToGraphic(nCurrentPage, aDocumentSizePixel, aTargetSizePixel, COL_WHITE);
GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter(); GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
......
...@@ -48,11 +48,11 @@ public: ...@@ -48,11 +48,11 @@ public:
sal_Int32 getCurrentPageWriter( ); sal_Int32 getCurrentPageWriter( );
Size getDocumentSizeInPixels( sal_Int32 aCurrentPage ); Size getDocumentSizeInPixels( sal_Int32 nCurrentPage );
Size getDocumentSizeIn100mm( sal_Int32 aCurrentPage ); Size getDocumentSizeIn100mm( sal_Int32 nCurrentPage );
Graphic renderToGraphic(sal_Int32 aCurrentPage, Size aDocumentSizePixel, Graphic renderToGraphic( sal_Int32 nCurrentPage, Size aDocumentSizePixel,
Size aTargetSizePixel, Color aPageColor); Size aTargetSizePixel, Color aPageColor);
}; };
......
...@@ -52,9 +52,9 @@ DocumentToGraphicRenderer::~DocumentToGraphicRenderer() ...@@ -52,9 +52,9 @@ DocumentToGraphicRenderer::~DocumentToGraphicRenderer()
{ {
} }
Size DocumentToGraphicRenderer::getDocumentSizeInPixels(sal_Int32 aCurrentPage) Size DocumentToGraphicRenderer::getDocumentSizeInPixels(sal_Int32 nCurrentPage)
{ {
Size aSize100mm = getDocumentSizeIn100mm(aCurrentPage); Size aSize100mm = getDocumentSizeIn100mm(nCurrentPage);
return Application::GetDefaultDevice()->LogicToPixel( aSize100mm, MapUnit::Map100thMM ); return Application::GetDefaultDevice()->LogicToPixel( aSize100mm, MapUnit::Map100thMM );
} }
...@@ -81,7 +81,7 @@ uno::Any DocumentToGraphicRenderer::getSelection() const ...@@ -81,7 +81,7 @@ uno::Any DocumentToGraphicRenderer::getSelection() const
return aSelection; return aSelection;
} }
Size DocumentToGraphicRenderer::getDocumentSizeIn100mm(sal_Int32 aCurrentPage) Size DocumentToGraphicRenderer::getDocumentSizeIn100mm(sal_Int32 nCurrentPage)
{ {
Reference< awt::XDevice > xDevice(mxToolkit->createScreenCompatibleDevice( 32, 32 ) ); Reference< awt::XDevice > xDevice(mxToolkit->createScreenCompatibleDevice( 32, 32 ) );
...@@ -104,13 +104,13 @@ Size DocumentToGraphicRenderer::getDocumentSizeIn100mm(sal_Int32 aCurrentPage) ...@@ -104,13 +104,13 @@ Size DocumentToGraphicRenderer::getDocumentSizeIn100mm(sal_Int32 aCurrentPage)
/* TODO: the whole absolute "current page" number concept is useless when /* TODO: the whole absolute "current page" number concept is useless when
* it comes to selections, rework that. */ * it comes to selections, rework that. */
sal_Int32 nPages = mxRenderable->getRendererCount( selection, renderProperties ); sal_Int32 nPages = mxRenderable->getRendererCount( selection, renderProperties );
if (nPages >= aCurrentPage || (mbSelectionOnly && nPages > 0)) if (nPages >= nCurrentPage || (mbSelectionOnly && nPages > 0))
{ {
if (nPages < aCurrentPage) if (nPages < nCurrentPage)
// In case of mbSelectionOnly hit. // In case of mbSelectionOnly hit.
aCurrentPage = 1; nCurrentPage = 1;
Sequence< beans::PropertyValue > aResult = mxRenderable->getRenderer(aCurrentPage - 1, selection, renderProperties ); Sequence< beans::PropertyValue > aResult = mxRenderable->getRenderer(nCurrentPage - 1, selection, renderProperties );
for( sal_Int32 nProperty = 0, nPropertyCount = aResult.getLength(); nProperty < nPropertyCount; ++nProperty ) for( sal_Int32 nProperty = 0, nPropertyCount = aResult.getLength(); nProperty < nPropertyCount; ++nProperty )
{ {
if ( aResult[ nProperty ].Name == "PageSize" ) if ( aResult[ nProperty ].Name == "PageSize" )
...@@ -124,7 +124,7 @@ Size DocumentToGraphicRenderer::getDocumentSizeIn100mm(sal_Int32 aCurrentPage) ...@@ -124,7 +124,7 @@ Size DocumentToGraphicRenderer::getDocumentSizeIn100mm(sal_Int32 aCurrentPage)
} }
Graphic DocumentToGraphicRenderer::renderToGraphic( Graphic DocumentToGraphicRenderer::renderToGraphic(
sal_Int32 aCurrentPage, sal_Int32 nCurrentPage,
Size aDocumentSizePixel, Size aDocumentSizePixel,
Size aTargetSizePixel, Size aTargetSizePixel,
Color aPageColor) Color aPageColor)
...@@ -172,7 +172,7 @@ Graphic DocumentToGraphicRenderer::renderToGraphic( ...@@ -172,7 +172,7 @@ Graphic DocumentToGraphicRenderer::renderToGraphic(
} }
uno::Any aSelection( getSelection()); uno::Any aSelection( getSelection());
mxRenderable->render(aCurrentPage - 1, aSelection, renderProps ); mxRenderable->render(nCurrentPage - 1, aSelection, renderProps );
aMtf.Stop(); aMtf.Stop();
aMtf.WindStart(); aMtf.WindStart();
......
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