[Libreoffice-commits] .: sw/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Dec 18 09:00:43 PST 2012
sw/source/filter/ww8/docxattributeoutput.cxx | 34 +++++++++++++++++++++++++--
1 file changed, 32 insertions(+), 2 deletions(-)
New commits:
commit 75c05bd7d2e0e2fb41d4218eb0bb8f5631ca46fe
Author: Pierre-Eric Pelloux-Prayer <pierre-eric at lanedo.com>
Date: Fri Dec 14 16:05:24 2012 +0100
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 at suse.cz>
Tested-by: LuboÅ¡ LuÅák <l.lunak at suse.cz>
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 29bef4a..b97b368 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 );
More information about the Libreoffice-commits
mailing list