summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2016-10-29 15:49:18 +0000
committerMichael Meeks <michael.meeks@collabora.com>2016-10-29 21:00:52 +0100
commit76ead0222aac4bc9d8e090c979c2834af121c541 (patch)
treeedbe1ca2d027883367c2d6a1036c76303248711a
parent7acac0db1b4971cd3c3de59bc661e3a8554d1d86 (diff)
tdf#103753: DOCX: Handle relative positions to left or right margin
Positioning relative to left or right margin in MS Word works the same as the positioning relative to left or right page border in LO Writer. Change-Id: I476a5e9e76f766b7fb7f1c7f4a068af8bb3c8813 Reviewed-on: https://gerrit.libreoffice.org/30376 Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
-rw-r--r--sw/source/filter/ww8/docxsdrexport.cxx6
-rw-r--r--writerfilter/source/dmapper/GraphicHelpers.cxx8
2 files changed, 10 insertions, 4 deletions
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx
index 191a9b9cff49..a6da053a28c6 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -445,8 +445,10 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons
relativeFromH = "character";
break;
case text::RelOrientation::PAGE_RIGHT:
- relativeFromH = "page";
- alignH = "right";
+ relativeFromH = "rightMargin";
+ break;
+ case text::RelOrientation::PAGE_LEFT:
+ relativeFromH = "leftMargin";
break;
case text::RelOrientation::FRAME:
default:
diff --git a/writerfilter/source/dmapper/GraphicHelpers.cxx b/writerfilter/source/dmapper/GraphicHelpers.cxx
index 3d410b2e809a..813f690a4ab7 100644
--- a/writerfilter/source/dmapper/GraphicHelpers.cxx
+++ b/writerfilter/source/dmapper/GraphicHelpers.cxx
@@ -94,7 +94,9 @@ void PositionHandler::lcl_attribute( Id aName, Value& rVal )
NS_ooxml::LN_Value_wordprocessingDrawing_ST_RelFromH_margin,
NS_ooxml::LN_Value_wordprocessingDrawing_ST_RelFromH_page,
NS_ooxml::LN_Value_wordprocessingDrawing_ST_RelFromH_column,
- NS_ooxml::LN_Value_wordprocessingDrawing_ST_RelFromH_character
+ NS_ooxml::LN_Value_wordprocessingDrawing_ST_RelFromH_character,
+ NS_ooxml::LN_Value_wordprocessingDrawing_ST_RelFromH_leftMargin,
+ NS_ooxml::LN_Value_wordprocessingDrawing_ST_RelFromH_rightMargin
};
static const sal_Int16 pHoriRelations[] =
@@ -103,9 +105,11 @@ void PositionHandler::lcl_attribute( Id aName, Value& rVal )
text::RelOrientation::PAGE_FRAME,
text::RelOrientation::FRAME,
text::RelOrientation::CHAR,
+ text::RelOrientation::PAGE_LEFT,
+ text::RelOrientation::PAGE_RIGHT,
};
- for ( int i = 0; i < 4; i++ )
+ for ( int i = 0; i < 6; i++ )
{
if ( pHoriRelValues[i] == sal_uInt32( nIntValue ) )
m_nRelation = pHoriRelations[i];