[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - drawinglayer/source sw/qa

Caolán McNamara caolanm at redhat.com
Thu Sep 7 10:26:27 UTC 2017


 drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx |    8 ++++++++
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx                   |    4 ++--
 sw/qa/extras/uiwriter/uiwriter.cxx                         |    4 ++--
 3 files changed, 12 insertions(+), 4 deletions(-)

New commits:
commit 63da940c6e31b615269846424a965ba8ce0837a3
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Aug 31 16:22:58 2017 +0100

    Resolves: tdf#112145 pdf export of editengine highlight color fails sometimes
    
    When setting a fill or line color on the outputdevice, put it back to its previous
    setting when finished with the record, PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D
    was the one in this case but protect the other similar ones here too
    
    Change-Id: Ifb9b182d72bb6c48a9d9480270fde4384be6291e
    Reviewed-on: https://gerrit.libreoffice.org/41762
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 99d9e700e390..88616b2517b7 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -1220,6 +1220,8 @@ namespace drawinglayer
                     }
                     else
                     {
+                        mpOutputDevice->Push(PushFlags::LINECOLOR | PushFlags::FILLCOLOR);
+
                         // support SvtGraphicStroke MetaCommentAction
                         SvtGraphicStroke* pSvtGraphicStroke = impTryToCreateSvtGraphicStroke(
                             rBasePolygon, nullptr,
@@ -1275,6 +1277,8 @@ namespace drawinglayer
                         }
 
                         impEndSvtGraphicStroke(pSvtGraphicStroke);
+
+                        mpOutputDevice->Pop();
                     }
 
                     break;
@@ -1667,6 +1671,7 @@ namespace drawinglayer
                 }
                 case PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D :
                 {
+                    mpOutputDevice->Push(PushFlags::LINECOLOR | PushFlags::FILLCOLOR);
                     const primitive2d::PolyPolygonColorPrimitive2D& rPolygonCandidate(static_cast< const primitive2d::PolyPolygonColorPrimitive2D& >(rCandidate));
                     basegfx::B2DPolyPolygon aLocalPolyPolygon(rPolygonCandidate.getB2DPolyPolygon());
 
@@ -1742,6 +1747,7 @@ namespace drawinglayer
                         RenderMetafilePrimitive2D(aMetafile);
                     }
 
+                    mpOutputDevice->Pop();
                     break;
                 }
                 case PRIMITIVE2D_ID_MASKPRIMITIVE2D :
@@ -1812,6 +1818,7 @@ namespace drawinglayer
                 }
                 case PRIMITIVE2D_ID_UNIFIEDTRANSPARENCEPRIMITIVE2D :
                 {
+                    mpOutputDevice->Push(PushFlags::LINECOLOR | PushFlags::FILLCOLOR);
                     // for metafile: Need to examine what the pure vcl version is doing here actually
                     // - uses DrawTransparent with metafile for content and a gradient
                     // - uses DrawTransparent for single PolyPolygons directly. Can be detected by
@@ -1946,6 +1953,7 @@ namespace drawinglayer
                         }
                     }
 
+                    mpOutputDevice->Pop();
                     break;
                 }
                 case PRIMITIVE2D_ID_TRANSPARENCEPRIMITIVE2D :
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index db3dc02027be..2aee8d4d7227 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1329,10 +1329,10 @@ DECLARE_OOXMLIMPORT_TEST(testTdf100072, "tdf100072.docx")
     xmlDocPtr pXmlDoc = dumper.dumpAndParse(rMetaFile);
 
     // Get first polyline rightside x coordinate
-    sal_Int32 nFirstEnd = getXPath(pXmlDoc, "/metafile/polyline[1]/point[2]", "x").toInt32();
+    sal_Int32 nFirstEnd = getXPath(pXmlDoc, "(//polyline)[1]/point[2]", "x").toInt32();
 
     // Get last stroke x coordinate
-    sal_Int32 nSecondEnd = getXPath(pXmlDoc, "/metafile/polyline[last()]/point[2]", "x").toInt32();
+    sal_Int32 nSecondEnd = getXPath(pXmlDoc, "(//polyline)[last()]/point[2]", "x").toInt32();
 
     // Assert that the difference is less than half point.
     CPPUNIT_ASSERT_MESSAGE("Shape line width does not match", abs(nFirstEnd - nSecondEnd) < 10);
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index d18408c435c5..20e048d6558b 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -1381,10 +1381,10 @@ void SwUiWriterTest::testFdo87448()
 
     // The first polyline in the document has a number of points to draw arcs,
     // the last one jumps back to the start, so we call "end" the last but one.
-    sal_Int32 nFirstEnd = getXPath(pXmlDoc, "/metafile/polyline[1]/point[last()-1]", "x").toInt32();
+    sal_Int32 nFirstEnd = getXPath(pXmlDoc, "(//polyline)[1]/point[last()-1]", "x").toInt32();
     // The second polyline has a different start point, but the arc it draws
     // should end at the ~same position as the first polyline.
-    sal_Int32 nSecondEnd = getXPath(pXmlDoc, "/metafile/polyline[2]/point[last()]", "x").toInt32();
+    sal_Int32 nSecondEnd = getXPath(pXmlDoc, "(//polyline)[2]/point[last()]", "x").toInt32();
 
     // nFirstEnd was 6023 and nSecondEnd was 6648, now they should be much closer, e.g. nFirstEnd = 6550, nSecondEnd = 6548
     OString aMsg = "nFirstEnd is " + OString::number(nFirstEnd) + ", nSecondEnd is " + OString::number(nSecondEnd);


More information about the Libreoffice-commits mailing list