Kaydet (Commit) 6ceeb0df authored tarafından Luboš Luňák's avatar Luboš Luňák

proper reading of mso-position-(horizontal|vertical)(-relative)

Change-Id: I50f537c697f6e73c1fd150f3f03fc65b85ccbeaf
üst 1424a817
...@@ -339,6 +339,7 @@ OutputPosition ...@@ -339,6 +339,7 @@ OutputPosition
OverlapSequence OverlapSequence
PageScale PageScale
PageStyle PageStyle
PageToggle
PageViewZoomValue PageViewZoomValue
PaintTransparent PaintTransparent
ParaAdjust ParaAdjust
......
...@@ -473,12 +473,38 @@ void lcl_SetAnchorType(PropertySet& rPropSet, const ShapeTypeModel& rTypeModel) ...@@ -473,12 +473,38 @@ void lcl_SetAnchorType(PropertySet& rPropSet, const ShapeTypeModel& rTypeModel)
{ {
if ( rTypeModel.maPositionHorizontal == "center" ) if ( rTypeModel.maPositionHorizontal == "center" )
rPropSet.setAnyProperty(PROP_HoriOrient, makeAny(text::HoriOrientation::CENTER)); rPropSet.setAnyProperty(PROP_HoriOrient, makeAny(text::HoriOrientation::CENTER));
else if ( rTypeModel.maPositionHorizontal == "left" )
rPropSet.setAnyProperty(PROP_HoriOrient, makeAny(text::HoriOrientation::LEFT));
else if ( rTypeModel.maPositionHorizontal == "right" )
rPropSet.setAnyProperty(PROP_HoriOrient, makeAny(text::HoriOrientation::RIGHT));
else if ( rTypeModel.maPositionHorizontal == "inside" )
{
rPropSet.setAnyProperty(PROP_HoriOrient, makeAny(text::HoriOrientation::LEFT));
rPropSet.setAnyProperty(PROP_PageToggle, makeAny(sal_True));
}
else if ( rTypeModel.maPositionHorizontal == "outside" )
{
rPropSet.setAnyProperty(PROP_HoriOrient, makeAny(text::HoriOrientation::RIGHT));
rPropSet.setAnyProperty(PROP_PageToggle, makeAny(sal_True));
}
if ( rTypeModel.maPositionHorizontalRelative == "page" ) if ( rTypeModel.maPositionHorizontalRelative == "page" )
rPropSet.setAnyProperty(PROP_HoriOrientRelation, makeAny(text::RelOrientation::PAGE_FRAME)); rPropSet.setAnyProperty(PROP_HoriOrientRelation, makeAny(text::RelOrientation::PAGE_FRAME));
else if ( rTypeModel.maPositionVerticalRelative == "margin" )
rPropSet.setProperty(PROP_VertOrientRelation, text::RelOrientation::PAGE_PRINT_AREA);
else if ( rTypeModel.maPositionVerticalRelative == "text" )
rPropSet.setProperty(PROP_VertOrientRelation, text::RelOrientation::FRAME);
if ( rTypeModel.maPositionVertical == "center" ) if ( rTypeModel.maPositionVertical == "center" )
rPropSet.setAnyProperty(PROP_VertOrient, makeAny(text::VertOrientation::CENTER)); rPropSet.setAnyProperty(PROP_VertOrient, makeAny(text::VertOrientation::CENTER));
else if ( rTypeModel.maPositionVertical == "top" )
rPropSet.setAnyProperty(PROP_VertOrient, makeAny(text::VertOrientation::TOP));
else if ( rTypeModel.maPositionVertical == "bottom" )
rPropSet.setAnyProperty(PROP_VertOrient, makeAny(text::VertOrientation::BOTTOM));
else if ( rTypeModel.maPositionVertical == "inside" )
rPropSet.setAnyProperty(PROP_VertOrient, makeAny(text::VertOrientation::LINE_TOP));
else if ( rTypeModel.maPositionVertical == "outside" )
rPropSet.setAnyProperty(PROP_VertOrient, makeAny(text::VertOrientation::LINE_BOTTOM));
if ( rTypeModel.maPosition == "absolute" ) if ( rTypeModel.maPosition == "absolute" )
{ {
...@@ -495,7 +521,6 @@ void lcl_SetAnchorType(PropertySet& rPropSet, const ShapeTypeModel& rTypeModel) ...@@ -495,7 +521,6 @@ void lcl_SetAnchorType(PropertySet& rPropSet, const ShapeTypeModel& rTypeModel)
} }
else else
{ {
// Vertical placement relative to margin, because parent style must not modify vertical position
rPropSet.setProperty(PROP_VertOrientRelation, text::RelOrientation::FRAME); rPropSet.setProperty(PROP_VertOrientRelation, text::RelOrientation::FRAME);
} }
} }
......
...@@ -7301,13 +7301,17 @@ void DocxAttributeOutput::FormatVertOrientation( const SwFmtVertOrient& rFlyVert ...@@ -7301,13 +7301,17 @@ void DocxAttributeOutput::FormatVertOrientation( const SwFmtVertOrient& rFlyVert
sAlign = OString( "center" ); sAlign = OString( "center" );
break; break;
case text::VertOrientation::BOTTOM: case text::VertOrientation::BOTTOM:
case text::VertOrientation::LINE_BOTTOM:
sAlign = OString( "bottom" ); sAlign = OString( "bottom" );
break; break;
case text::VertOrientation::LINE_BOTTOM:
sAlign = OString( "outside" );
break;
case text::VertOrientation::TOP: case text::VertOrientation::TOP:
sAlign = OString( "top" );
break;
case text::VertOrientation::LINE_TOP: case text::VertOrientation::LINE_TOP:
default: default:
sAlign = OString( "top" ); sAlign = OString( "inside" );
break; break;
} }
OString sVAnchor( "page" ); OString sVAnchor( "page" );
......
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