summaryrefslogtreecommitdiff
path: root/vcl/source/gdi
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-04-12 12:11:42 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-04-12 14:40:19 +0200
commit7ef44142086670160756705368339a989828653a (patch)
tree189a843c1cf201d42d658bac45b9fbcde2fa1c6e /vcl/source/gdi
parent6dcb611a99b61c7f2056c48a0dd1adf1c24275da (diff)
tdf#134736 move nLastBgAction to also include any trailing pops
RemoveTransparenciesFromMetaFile is a very fragile thing Change-Id: I8feeb436426d16087ab5fbaddf6b39ac32574e5c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113981 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source/gdi')
-rw-r--r--vcl/source/gdi/print2.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/vcl/source/gdi/print2.cxx b/vcl/source/gdi/print2.cxx
index 285818e7284b..f7e4d8875341 100644
--- a/vcl/source/gdi/print2.cxx
+++ b/vcl/source/gdi/print2.cxx
@@ -788,6 +788,18 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
++nActionNum;
}
+ if (nLastBgAction != -1)
+ {
+ size_t nActionSize = rInMtf.GetActionSize();
+ // tdf#134736 move nLastBgAction to also include any trailing pops
+ for (size_t nPostLastBgAction = nLastBgAction + 1; nPostLastBgAction < nActionSize; ++nPostLastBgAction)
+ {
+ if (rInMtf.GetAction(nPostLastBgAction)->GetType() != MetaActionType::POP)
+ break;
+ nLastBgAction = nPostLastBgAction;
+ }
+ }
+
aMapModeVDev->ClearStack(); // clean up aMapModeVDev
// fast-forward until one after the last background action