tdf#109067 Fix default value of rotWithShape
According to the OOXML standard the default value is true, so for the export of gradients and blips it has to be set explicitly to false. Change-Id: I06f6f2a00fca88ec79e2eb956c3c780f037a9d1e Reviewed-on: https://gerrit.libreoffice.org/39973 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
This commit is contained in:
committed by
Michael Stahl
parent
21394b0847
commit
30907c0bb7
@@ -362,8 +362,8 @@ void FillProperties::pushToPropMap( ShapePropertyMap& rPropMap,
|
||||
if ( bFlipV )
|
||||
nShapeRotation = -nShapeRotation;
|
||||
|
||||
// "rotate with shape" not set, or set to false -> do not rotate
|
||||
if ( !maGradientProps.moRotateWithShape.get( false ) )
|
||||
// "rotate with shape" set to false -> do not rotate
|
||||
if ( !maGradientProps.moRotateWithShape.get( true ) )
|
||||
nShapeRotation = 0;
|
||||
|
||||
if( maGradientProps.moGradientPath.has() )
|
||||
|
@@ -386,14 +386,14 @@ void DrawingML::WriteGradientFill( const Reference< XPropertySet >& rXPropSet )
|
||||
// If we have no gradient stops that means original gradient were defined by a theme.
|
||||
if( aGradientStops.hasElements() )
|
||||
{
|
||||
mpFS->startElementNS( XML_a, XML_gradFill, FSEND );
|
||||
mpFS->startElementNS( XML_a, XML_gradFill, XML_rotWithShape, "0", FSEND );
|
||||
WriteGrabBagGradientFill(aGradientStops, aGradient);
|
||||
mpFS->endElementNS( XML_a, XML_gradFill );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mpFS->startElementNS( XML_a, XML_gradFill, FSEND );
|
||||
mpFS->startElementNS( XML_a, XML_gradFill, XML_rotWithShape, "0", FSEND );
|
||||
WriteGradientFill(aGradient);
|
||||
mpFS->endElementNS( XML_a, XML_gradFill );
|
||||
}
|
||||
@@ -1063,7 +1063,7 @@ void DrawingML::WriteBlipFill( const Reference< XPropertySet >& rXPropSet, const
|
||||
{
|
||||
SAL_INFO("oox.shape", "URL: " << sBitmapURL);
|
||||
|
||||
mpFS->startElementNS( nXmlNamespace , XML_blipFill, FSEND );
|
||||
mpFS->startElementNS( nXmlNamespace , XML_blipFill, XML_rotWithShape, "0", FSEND );
|
||||
|
||||
WriteBlip( rXPropSet, sBitmapURL, bRelPathToMedia );
|
||||
|
||||
|
BIN
sd/qa/unit/data/pptx/tdf109067.pptx
Normal file
BIN
sd/qa/unit/data/pptx/tdf109067.pptx
Normal file
Binary file not shown.
@@ -161,6 +161,7 @@ public:
|
||||
void testTdf100926();
|
||||
void testTdf89064();
|
||||
void testTdf108925();
|
||||
void testTdf109067();
|
||||
|
||||
bool checkPattern(sd::DrawDocShellRef& rDocRef, int nShapeNumber, std::vector<sal_uInt8>& rExpected);
|
||||
void testPatternImport();
|
||||
@@ -230,6 +231,7 @@ public:
|
||||
CPPUNIT_TEST(testPatternImport);
|
||||
CPPUNIT_TEST(testTdf89064);
|
||||
CPPUNIT_TEST(testTdf108925);
|
||||
CPPUNIT_TEST(testTdf109067);
|
||||
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
};
|
||||
@@ -2206,6 +2208,17 @@ void SdImportTest::testTdf108925()
|
||||
xDocShRef->DoClose();
|
||||
}
|
||||
|
||||
void SdImportTest::testTdf109067()
|
||||
{
|
||||
sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf109067.pptx"), PPTX);
|
||||
uno::Reference< beans::XPropertySet > xShape(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY_THROW);
|
||||
awt::Gradient gradient;
|
||||
CPPUNIT_ASSERT(xShape->getPropertyValue("FillGradient") >>= gradient);
|
||||
CPPUNIT_ASSERT_EQUAL(sal_Int16(450), gradient.Angle);
|
||||
|
||||
xDocShRef->DoClose();
|
||||
}
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest);
|
||||
|
||||
CPPUNIT_PLUGIN_IMPLEMENT();
|
||||
|
Reference in New Issue
Block a user