Kaydet (Commit) af686aa8 authored tarafından Andras Timar's avatar Andras Timar

bnc#902652 OOXML: fix import of insets when shape and/or shape text is rotated

5ac575ee did not get it right, the vert attribute (i.e. the
rotation of text) is relevant, not the rotation of the shape. In
that case both text and shape rotation were 270 degrees. I checked
that the bugdoc of bnc#773048 looked good after this.

Change-Id: I6e0401cd138a82040df82d7da1a47311db7771e4
Reviewed-on: https://gerrit.libreoffice.org/15076Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarAndras Timar <andras.timar@collabora.com>
üst 420acb53
...@@ -45,7 +45,7 @@ struct TextBodyProperties ...@@ -45,7 +45,7 @@ struct TextBodyProperties
explicit TextBodyProperties(); explicit TextBodyProperties();
void pushRotationAdjustments( sal_Int32 nRotation ); void pushRotationAdjustments();
void pushVertSimulation(); void pushVertSimulation();
}; };
......
...@@ -652,7 +652,7 @@ Reference< XShape > Shape::createAndInsert( ...@@ -652,7 +652,7 @@ Reference< XShape > Shape::createAndInsert(
// add properties from textbody to shape properties // add properties from textbody to shape properties
if( mpTextBody.get() ) if( mpTextBody.get() )
{ {
mpTextBody->getTextProperties().pushRotationAdjustments( mnRotation ); mpTextBody->getTextProperties().pushRotationAdjustments();
aShapeProps.assignUsed( mpTextBody->getTextProperties().maPropertyMap ); aShapeProps.assignUsed( mpTextBody->getTextProperties().maPropertyMap );
// Push char properties as well - specifically useful when this is a placeholder // Push char properties as well - specifically useful when this is a placeholder
if( mpMasterTextListStyle && mpMasterTextListStyle->getListStyle()[0]->getTextCharacterProperties().moHeight.has() ) if( mpMasterTextListStyle && mpMasterTextListStyle->getListStyle()[0]->getTextCharacterProperties().moHeight.has() )
......
...@@ -58,17 +58,17 @@ void TextBodyProperties::pushVertSimulation() ...@@ -58,17 +58,17 @@ void TextBodyProperties::pushVertSimulation()
} }
/* Push adjusted values, taking into consideration Shape Rotation */ /* Push adjusted values, taking into consideration Shape Rotation */
void TextBodyProperties::pushRotationAdjustments( sal_Int32 nRotation ) void TextBodyProperties::pushRotationAdjustments()
{ {
sal_Int32 nOff = 0; sal_Int32 nOff = 0;
sal_Int32 aProps[] = { PROP_TextLeftDistance, PROP_TextUpperDistance, PROP_TextRightDistance, PROP_TextLowerDistance }; sal_Int32 aProps[] = { PROP_TextLeftDistance, PROP_TextUpperDistance, PROP_TextRightDistance, PROP_TextLowerDistance };
sal_Int32 n = ( sal_Int32 )( sizeof( aProps ) / sizeof( sal_Int32 ) ); sal_Int32 n = ( sal_Int32 )( sizeof( aProps ) / sizeof( sal_Int32 ) );
switch( nRotation ) // TODO: What happens for part rotations ? switch( moRotation.get(0) )
{ {
case (90*1*60000): nOff = 1; break; case (90*1*60000): nOff = 3; break;
case (90*2*60000): nOff = 2; break; case (90*2*60000): nOff = 2; break;
case (90*3*60000): nOff = 3; break; case (90*3*60000): nOff = 1; break;
default: break; default: break;
} }
......
This diff is collapsed.
...@@ -179,6 +179,7 @@ void SdImportTest::testDocumentLayout() ...@@ -179,6 +179,7 @@ void SdImportTest::testDocumentLayout()
{ "n762695.pptx", "xml/n762695_", PPTX, -1 }, { "n762695.pptx", "xml/n762695_", PPTX, -1 },
{ "n593612.pptx", "xml/n593612_", PPTX, -1 }, { "n593612.pptx", "xml/n593612_", PPTX, -1 },
{ "fdo71434.pptx", "xml/fdo71434_", PPTX, -1 }, { "fdo71434.pptx", "xml/fdo71434_", PPTX, -1 },
{ "n902652.pptx", "xml/n902652_", PPTX, -1 },
// { "pptx/n828390.pptx", "pptx/xml/n828390_", PPTX, PPTX }, // Example // { "pptx/n828390.pptx", "pptx/xml/n828390_", PPTX, PPTX }, // Example
}; };
......
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