summaryrefslogtreecommitdiff
path: root/emfio/source/reader/mtftools.cxx
diff options
context:
space:
mode:
authorBartosz Kosiorek <gang65@poczta.onet.pl>2021-05-29 21:11:55 +0200
committerBartosz Kosiorek <gang65@poczta.onet.pl>2021-05-31 07:32:44 +0200
commitf275c4b31f095193b80cb756f8610c16282fb8f4 (patch)
tree1e7f0bafd33392ebd00eb2faca3e588afea5357d /emfio/source/reader/mtftools.cxx
parent363cf231c73673e8daf766aa6b24498f3e913e21 (diff)
tdf#53004 tdf#142495 WMF EMF Always display Text rectangle
In previous implementation if BKMode was set to Transparent, then both Background of Text and Rectangle was not drawn. It was wrong, and Rectangle should be always drawn. This commit fix that issue and allows EMF images exported by LTspice to be rendered correctly under LibreOffice. Change-Id: I03801d35d92eb2a3fdc175ca1d5b348a2aa30842 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116394 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
Diffstat (limited to 'emfio/source/reader/mtftools.cxx')
-rw-r--r--emfio/source/reader/mtftools.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/emfio/source/reader/mtftools.cxx b/emfio/source/reader/mtftools.cxx
index 6bf0d98a3e76..866f6996d9e3 100644
--- a/emfio/source/reader/mtftools.cxx
+++ b/emfio/source/reader/mtftools.cxx
@@ -1381,12 +1381,15 @@ namespace emfio
{
WinMtfFillStyle aFillStyleBackup = maFillStyle;
bool aTransparentBackup = maLineStyle.bTransparent;
+ BkMode mnBkModeBackup = mnBkMode;
const tools::Polygon aPoly( rRect );
maLineStyle.bTransparent = true;
maFillStyle = maBkColor;
+ mnBkMode = BkMode::OPAQUE;
ImplSetNonPersistentLineColorTransparenz();
DrawPolygon(aPoly, false);
+ mnBkMode = mnBkModeBackup; // The rectangle needs to be always drawned even if mode is transparent
maFillStyle = aFillStyleBackup;
maLineStyle.bTransparent = aTransparentBackup;
}