diff options
author | Gülşah Köse <gulsah.kose@collabora.com> | 2021-02-01 17:03:33 +0300 |
---|---|---|
committer | Gülşah Köse <gulsah.kose@collabora.com> | 2021-02-10 07:04:38 +0100 |
commit | ccdee8eebaa56619248e35001017226eecfe4e83 (patch) | |
tree | 708db8ed2f0e37e9709b553b4a04de6c51a60aab /sd/qa/unit/export-tests-ooxml1.cxx | |
parent | e4e0cf825a858e82c299c55632b03ca6f80647d1 (diff) |
tdf#134210 Import crop position of bitmap filled shape.
Change-Id: I6a62d68cd0f57e53934851a2f53dae05bf7d3730
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110262
Tested-by: Jenkins
Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
Diffstat (limited to 'sd/qa/unit/export-tests-ooxml1.cxx')
-rw-r--r-- | sd/qa/unit/export-tests-ooxml1.cxx | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx b/sd/qa/unit/export-tests-ooxml1.cxx index da61677f7b48..a134e699d3fa 100644 --- a/sd/qa/unit/export-tests-ooxml1.cxx +++ b/sd/qa/unit/export-tests-ooxml1.cxx @@ -1152,17 +1152,36 @@ void SdOOXMLExportTest1::testCustomshapeBitmapfillSrcrect() xDocShRef->DoClose(); xmlDocUniquePtr pXmlDoc = parseExport(tempFile, "ppt/slides/slide1.xml"); - const OString sXmlPath = "//a:blipFill/a:srcRect"; + + // tdf#132680 + // We are preventing the side effect of DOCX improvement to PPTX case. // Without the accompanying fix in place, this test would have failed with: // - Expected: 1 // - Actual : 0 // - XPath '//a:blipFill/a:srcRect' number of nodes is incorrect // i.e. <a:srcRect> was exported as <a:fillRect> in <a:stretch>, which made part of the image // invisible. - double fLeftPercent = std::round(getXPath(pXmlDoc, sXmlPath, "l").toDouble() / 1000); - CPPUNIT_ASSERT_EQUAL(4.0, fLeftPercent); - double fRightPercent = std::round(getXPath(pXmlDoc, sXmlPath, "r").toDouble() / 1000); - CPPUNIT_ASSERT_EQUAL(4.0, fRightPercent); + + // tdf#134210 + // Original values of attribute of l and r in xml files: <a:srcRect l="4393" r="4393"/> + // Because of we have not core feature for cropping bitmap in custom shapes, we added cropping + // support to import filter. We modified the bitmap during import. As result the original + // image is cropped anymore (if we had the core feature for that, the original image would + // remain same, just we would see like cropped in the shape) To see the image in correct + // position in Microsoft Office too, we have to remove left right top bottom percentages + // anymore. In the future if we add core feature to LibreOffice, this test will failed with + // When we add the core feature, we should change the control value with 4393 as following. + + //const OString sXmlPath = "//a:blipFill/a:srcRect"; + //sal_Int32 nLeftPercent = getXPath(pXmlDoc, sXmlPath, "l").toInt32(); + //CPPUNIT_ASSERT_EQUAL(sal_Int32(4393), nLeftPercent); + //sal_Int32 nRightPercent = getXPath(pXmlDoc, sXmlPath, "r").toInt32(); + //CPPUNIT_ASSERT_EQUAL(sal_Int32(4393), nRightPercent); + + assertXPathNoAttribute(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:blipFill/a:srcRect", "l"); + assertXPathNoAttribute(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:blipFill/a:srcRect", "r"); + assertXPathNoAttribute(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:blipFill/a:srcRect", "t"); + assertXPathNoAttribute(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:blipFill/a:srcRect", "b"); } void SdOOXMLExportTest1::testTdf100348FontworkBitmapFill() |