diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2022-03-23 20:06:49 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2022-03-24 08:36:25 +0100 |
commit | 37c41f2c445ecf519f4137c23fb36f3942328b6b (patch) | |
tree | ff6b5562bbd8eeb40ed436b3df66e1b91cc2846c /oox/qa | |
parent | 6f80e618a79ac70bc6658771b64d018cd228200e (diff) |
sd theme: add PPTX export for shape fill color
Do this only in case there are no effects on the color, as that is not
yet handled.
Note that the theme color was already stored in the grab-bag, so this is
primarily interesting in case the theme color was changed or the source
format was ODP.
Change-Id: Ia4995be68d5f243875632eec4aaf8afbb8f4d5cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131984
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'oox/qa')
-rw-r--r-- | oox/qa/unit/data/refer-to-theme-shape-fill.odp | bin | 0 -> 15506 bytes | |||
-rw-r--r-- | oox/qa/unit/export.cxx | 19 |
2 files changed, 19 insertions, 0 deletions
diff --git a/oox/qa/unit/data/refer-to-theme-shape-fill.odp b/oox/qa/unit/data/refer-to-theme-shape-fill.odp Binary files differnew file mode 100644 index 000000000000..b12772e111e3 --- /dev/null +++ b/oox/qa/unit/data/refer-to-theme-shape-fill.odp diff --git a/oox/qa/unit/export.cxx b/oox/qa/unit/export.cxx index 8876d507dd9c..56546384820c 100644 --- a/oox/qa/unit/export.cxx +++ b/oox/qa/unit/export.cxx @@ -396,6 +396,25 @@ CPPUNIT_TEST_FIXTURE(Test, testReferToTheme) assertXPath(pXmlDoc, "//p:sp[3]/p:txBody/a:p/a:r/a:rPr/a:solidFill/a:schemeClr/a:lumOff", 0); } +CPPUNIT_TEST_FIXTURE(Test, testReferToThemeShapeFill) +{ + // Given an ODP file that contains references to a theme for shape fill: + OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "refer-to-theme-shape-fill.odp"; + + // When saving that document: + loadAndSave(aURL, "Impress Office Open XML"); + + // Then make sure the shape fill color is a scheme color: + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 1 + // - Actual : 0 + // i.e. the <a:schemeClr> element was not written. Note that this was already working from PPTX + // files via grab-bags, so this test intentionally uses an ODP file as input. + std::unique_ptr<SvStream> pStream = parseExportStream(getTempFile(), "ppt/slides/slide1.xml"); + xmlDocUniquePtr pXmlDoc = parseXmlStream(pStream.get()); + assertXPath(pXmlDoc, "//p:sp[1]/p:spPr/a:solidFill/a:schemeClr", "val", "accent1"); +} + CPPUNIT_TEST_FIXTURE(Test, testTdf146690_endParagraphRunPropertiesNewLinesTextSize) { // Given a PPTX file that contains references to a theme: |