Kaydet (Commit) b413584f authored tarafından Miklos Vajna's avatar Miklos Vajna Kaydeden (comit) Jan Holesovsky

oox: disable gradient fill grab-bag for PPTX

This was added in commit 2fcf3a87
(ooxml: preserve gradient shape fill, 2014-01-31), and assumes that the
theme colors can be preserved, as the theme definition is grab-bagged as
well.

But the theme is grab-bagged only for DOCX, not for PPTX, so skip
gradient grab-bag for PPTX, otherwise the gradient would refer to
incorrect colors in the theme.

Change-Id: I98e1c67d4b10e68916f81dd7fc508eb4146d506b
Reviewed-on: https://gerrit.libreoffice.org/67386Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
(cherry picked from commit cfc1f4ea)
Reviewed-on: https://gerrit.libreoffice.org/67396Reviewed-by: 's avatarJan Holesovsky <kendy@collabora.com>
Tested-by: 's avatarJan Holesovsky <kendy@collabora.com>
üst 30e934df
...@@ -407,7 +407,9 @@ void DrawingML::WriteGradientFill( const Reference< XPropertySet >& rXPropSet ) ...@@ -407,7 +407,9 @@ void DrawingML::WriteGradientFill( const Reference< XPropertySet >& rXPropSet )
} }
// check if an ooxml gradient had been imported and if the user has modified it // check if an ooxml gradient had been imported and if the user has modified it
if( EqualGradients( aOriginalGradient, aGradient ) ) // Gradient grab-bag depends on theme grab-bag, which is implemented
// only for DOCX.
if( EqualGradients( aOriginalGradient, aGradient ) && GetDocumentType() == DOCUMENT_DOCX)
{ {
// If we have no gradient stops that means original gradient were defined by a theme. // If we have no gradient stops that means original gradient were defined by a theme.
if( aGradientStops.hasElements() ) if( aGradientStops.hasElements() )
......
...@@ -885,6 +885,12 @@ void SdOOXMLExportTest1::testTdf94238() ...@@ -885,6 +885,12 @@ void SdOOXMLExportTest1::testTdf94238()
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(100), aGradient.YOffset); CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(100), aGradient.YOffset);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(39), aGradient.Border); CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(39), aGradient.Border);
// Without the accompanying fix in place, this test would have failed with
// 'Expected: 0, Actual : 10592673', i.e. the start color of the gradient
// was incorrect.
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), aGradient.StartColor);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0x8B8B8B), aGradient.EndColor);
xDocShRef->DoClose(); xDocShRef->DoClose();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment