summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2014-09-28 21:31:08 +0200
committerLuboš Luňák <l.lunak@collabora.com>2014-09-29 18:56:21 +0200
commit6ceeb0df6987bb7f70423b473b31eec54526481d (patch)
tree470e00b6091c28686434a88c5db879029e445e0c
parent1424a8174eb37d26a2ec41a981a74f34661c0044 (diff)
proper reading of mso-position-(horizontal|vertical)(-relative)
Change-Id: I50f537c697f6e73c1fd150f3f03fc65b85ccbeaf
-rw-r--r--oox/source/token/properties.txt1
-rw-r--r--oox/source/vml/vmlshape.cxx27
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx8
3 files changed, 33 insertions, 3 deletions
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index 90b841837c7f..f1ef48b3abaa 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -339,6 +339,7 @@ OutputPosition
OverlapSequence
PageScale
PageStyle
+PageToggle
PageViewZoomValue
PaintTransparent
ParaAdjust
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index 7c5bc5ce04e1..1c826a1ee971 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -473,12 +473,38 @@ void lcl_SetAnchorType(PropertySet& rPropSet, const ShapeTypeModel& rTypeModel)
{
if ( rTypeModel.maPositionHorizontal == "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" )
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" )
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" )
{
@@ -495,7 +521,6 @@ void lcl_SetAnchorType(PropertySet& rPropSet, const ShapeTypeModel& rTypeModel)
}
else
{
- // Vertical placement relative to margin, because parent style must not modify vertical position
rPropSet.setProperty(PROP_VertOrientRelation, text::RelOrientation::FRAME);
}
}
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 8a1d84ca0c19..6b49cbf5f492 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -7301,13 +7301,17 @@ void DocxAttributeOutput::FormatVertOrientation( const SwFmtVertOrient& rFlyVert
sAlign = OString( "center" );
break;
case text::VertOrientation::BOTTOM:
- case text::VertOrientation::LINE_BOTTOM:
sAlign = OString( "bottom" );
break;
+ case text::VertOrientation::LINE_BOTTOM:
+ sAlign = OString( "outside" );
+ break;
case text::VertOrientation::TOP:
+ sAlign = OString( "top" );
+ break;
case text::VertOrientation::LINE_TOP:
default:
- sAlign = OString( "top" );
+ sAlign = OString( "inside" );
break;
}
OString sVAnchor( "page" );