[PATCH libreoffice-4-0-3] fdo#59259: Suppress the expensive parts when we are only wri...

Jan Holesovsky (via Code Review) gerrit at gerrit.libreoffice.org
Wed Apr 24 08:21:25 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3597

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/97/3597/1

fdo#59259: Suppress the expensive parts when we are only writing to metafile.

When we are launching the printing dialog, we first draw the page using
drawinglayer to a metafile, and then render the metafile.  Unfortunately, here
we did the real operation of allocating large bitmaps, and destroying them
again; all that just to throw all that away at the end of the operation.

The preview sets the mbOutput to false correctly, so we can just skip the
expensive parts.

Change-Id: Ice77d83100eba339602bbdf374fec8546d4d1e12
---
M vcl/source/gdi/outdev6.cxx
1 file changed, 3 insertions(+), 0 deletions(-)



diff --git a/vcl/source/gdi/outdev6.cxx b/vcl/source/gdi/outdev6.cxx
index 46eb689..85f6ce5 100644
--- a/vcl/source/gdi/outdev6.cxx
+++ b/vcl/source/gdi/outdev6.cxx
@@ -614,6 +614,9 @@
     if( mpMetaFile )
         mpMetaFile->AddAction( new MetaFloatTransparentAction( rMtf, rPos, rSize, rTransparenceGradient ) );
 
+    if ( !IsDeviceOutputNecessary() )
+        return;
+
     if( ( rTransparenceGradient.GetStartColor() == aBlack && rTransparenceGradient.GetEndColor() == aBlack ) ||
         ( mnDrawMode & ( DRAWMODE_NOTRANSPARENCY ) ) )
     {

-- 
To view, visit https://gerrit.libreoffice.org/3597
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ice77d83100eba339602bbdf374fec8546d4d1e12
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0-3
Gerrit-Owner: Jan Holesovsky <kendy at suse.cz>



More information about the LibreOffice mailing list