diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-01-17 21:21:24 +0600 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2024-01-18 05:28:38 +0100 |
commit | 67ba6ccd5a75ee6ade0e6aaa8bdc33f651a0d82c (patch) | |
tree | 240723531387ad7182c0208eabd34fab27c61bcd /sd | |
parent | 8b393bba91111bd4f8988457f3a78b0306462bf2 (diff) |
tdf#140912, tdf#159219: fix import of graphic placeholder with custom prompt
Importing the text marks the object as not empty. Then, the object would
behave as an outliner object. This includes showing in slide show; allowing
text esiting; stretching the placeholder image, which required a workaround
implemented in commit 7b3be7f6f3d800e2ad86f5a043e6e9b21ed4409f (tdf#140912
Better handling of the picture placeholders, 2021-12-01).
Instead, drop the custom prompt. More correct solution would be making sure
to mark the object as empty after setting the text; but this doesn't round-
trip to ODF; and it crashes export to PPTX. Proper support for the sustom
placeholder prompt feature should be done separately.
The new workaround (dropping the text) makes previous workaround (special
handling of the placeholder graphic) unnecessary. The unit test is updated.
Change-Id: Ic7f42493af8d1d725ffa39ffab58f1ff033351cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162202
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/export-tests-ooxml4.cxx | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/sd/qa/unit/export-tests-ooxml4.cxx b/sd/qa/unit/export-tests-ooxml4.cxx index cd3b5f5d5de4..9ebb88208cc1 100644 --- a/sd/qa/unit/export-tests-ooxml4.cxx +++ b/sd/qa/unit/export-tests-ooxml4.cxx @@ -751,22 +751,18 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf147121) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf140912_PicturePlaceholder) { - // FIXME: the DPI check should be removed when either (1) the test is fixed to work with - // non-default DPI; or (2) unit tests on Windows are made to use svp VCL plugin. - // -8490 in the test below turns into -8014 on my Windows box with 150% scaling. - if (!IsDefaultDPI()) - return; - + // Given a graphic placeholder with a custom prompt: createSdImpressDoc("pptx/tdfpictureplaceholder.pptx"); uno::Reference<beans::XPropertySet> xShapeProps(getShapeFromPage(0, 0)); - bool bTextContourFrame = true; - xShapeProps->getPropertyValue("TextContourFrame") >>= bTextContourFrame; - CPPUNIT_ASSERT_EQUAL(false, bTextContourFrame); - - text::GraphicCrop aGraphicCrop; - xShapeProps->getPropertyValue("GraphicCrop") >>= aGraphicCrop; - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(-8490), aGraphicCrop.Top); + bool isEmptyPresentationObject = false; + // Without the fix, it would not be imported as empty presentation object; + // the text would be treated as its content. + xShapeProps->getPropertyValue("IsEmptyPresentationObject") >>= isEmptyPresentationObject; + CPPUNIT_ASSERT(isEmptyPresentationObject); + + // If we supported custom prompt text, here we would also test "String" property, + // which would be equal to "Insert Image". } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testEnhancedPathViewBox) |