[PATCH libreoffice-4-0] fdo#58076 import RTF_SHPLEFT/TOP of ESCHER_ShpInst_PictureFr...

Miklos Vajna (via Code Review) gerrit at gerrit.libreoffice.org
Tue Feb 5 12:01:28 PST 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/2005

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/05/2005/1

fdo#58076 import RTF_SHPLEFT/TOP of ESCHER_ShpInst_PictureFrame

(cherry picked from commit bd52275bf311f4ea2f94aec4336deb7ee14a3ba4)

Change-Id: Ia655743710778ea7d48a9b2221f22f55a4ccce32
---
M writerfilter/source/rtftok/rtfdocumentimpl.cxx
1 file changed, 15 insertions(+), 0 deletions(-)



diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 37d0376..cb68e83 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -63,6 +63,7 @@
 #include <ooxml/OOXMLFastTokens.hxx> // ooxml namespace
 #include <oox/token/namespaces.hxx> // oox namespace
 #include <oox/token/tokens.hxx>
+#include <dmapper/GraphicHelpers.hxx>
 
 #include <rtfsdrimport.hxx>
 #include <rtftokenizer.hxx>
@@ -72,6 +73,7 @@
 #include <rtffly.hxx>
 
 #define TWIP_TO_MM100(TWIP)     ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L))
+#define MM100_TO_EMU(MM100)     (MM100 * 360)
 #define M_TOKEN(token) OOX_TOKEN(officeMath, token)
 #define OPEN_M_TOKEN( rtftok, ooxtok ) \
         case RTF_M##rtftok: \
@@ -807,6 +809,19 @@
         aAnchorSprms.set(NS_ooxml::LN_CT_Anchor_extent, pExtentValue);
         if (aAnchorWrapAttributes.size())
             aAnchorSprms.set(NS_ooxml::LN_EG_WrapType_wrapSquare, pAnchorWrapValue);
+
+        // See OOXMLFastContextHandler::positionOffset(), we can't just put values in an RTFValue.
+        if (m_aStates.top().aShape.nLeft > 0)
+        {
+            writerfilter::dmapper::PositionHandler::setPositionOffset(OUString::number(MM100_TO_EMU(m_aStates.top().aShape.nLeft)), false);
+            aAnchorSprms.set(NS_ooxml::LN_CT_Anchor_positionH, RTFValue::Pointer_t(new RTFValue(RTFSprms())));
+        }
+        if (m_aStates.top().aShape.nTop > 0)
+        {
+            writerfilter::dmapper::PositionHandler::setPositionOffset(OUString::number(MM100_TO_EMU(m_aStates.top().aShape.nTop)), true);
+            aAnchorSprms.set(NS_ooxml::LN_CT_Anchor_positionV, RTFValue::Pointer_t(new RTFValue(RTFSprms())));
+        }
+
         aAnchorSprms.set(NS_ooxml::LN_CT_Anchor_docPr, pDocprValue);
         aAnchorSprms.set(NS_ooxml::LN_graphic_graphic, pGraphicValue);
         // anchor sprm

-- 
To view, visit https://gerrit.libreoffice.org/2005
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia655743710778ea7d48a9b2221f22f55a4ccce32
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Miklos Vajna <vmiklos at suse.cz>


More information about the LibreOffice mailing list