summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorPierre-Eric Pelloux-Prayer <pierre-eric@lanedo.com>2012-12-14 16:05:24 +0100
committerLuboš Luňák <l.lunak@suse.cz>2012-12-18 17:00:23 +0000
commit75c05bd7d2e0e2fb41d4218eb0bb8f5631ca46fe (patch)
tree9e69ebdbe6b9c4ff73b80d6aba489bed887ab61a /sw
parenta65f6ef56ea9b8382451500ea8454db4b9738e2b (diff)
docx export: graphics relativeFrom attributes now matches import code
Change-Id: I9f543c08f5e19c11c7e1b8020b8c5f62ae040f6e Reviewed-on: https://gerrit.libreoffice.org/1342 Reviewed-by: Luboš Luňák <l.lunak@suse.cz> Tested-by: Luboš Luňák <l.lunak@suse.cz>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx34
1 files changed, 32 insertions, 2 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 29bef4a79bfe..b97b3683f92c 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -2077,8 +2077,38 @@ void DocxAttributeOutput::FlyFrameGraphic( const SwGrfNode* pGrfNode, const Size
break;
case FLY_AT_CHAR:
default:
- relativeFromH = "character";
- relativeFromV = "line";
+ // We apply the same conversion that we do in import
+ // (see writerfilter/source/dmapper/GraphicHelper.cxx)
+ switch (pFrmFmt->GetVertOrient().GetRelationOrient() )
+ {
+ case text::RelOrientation::PAGE_PRINT_AREA:
+ relativeFromV = "margin";
+ break;
+ case text::RelOrientation::PAGE_FRAME:
+ relativeFromV = "page";
+ break;
+ case text::RelOrientation::FRAME:
+ relativeFromV = "paragraph";
+ break;
+ case text::RelOrientation::TEXT_LINE:
+ default:
+ relativeFromV = "line";
+ }
+ switch (pFrmFmt->GetHoriOrient().GetRelationOrient() )
+ {
+ case text::RelOrientation::PAGE_PRINT_AREA:
+ relativeFromH = "margin";
+ break;
+ case text::RelOrientation::PAGE_FRAME:
+ relativeFromH = "page";
+ break;
+ case text::RelOrientation::CHAR:
+ relativeFromH = "character";
+ break;
+ case text::RelOrientation::FRAME:
+ default:
+ relativeFromH = "column";
+ }
break;
};
Point pos( 0, 0 );