[Libreoffice-commits] .: Branch 'libreoffice-3-6' - writerfilter/source

Noel Power noelp at kemper.freedesktop.org
Thu Aug 2 07:54:59 PDT 2012


 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   16 ++++++++++++++++
 writerfilter/source/rtftok/rtfdocumentimpl.hxx |    3 +++
 writerfilter/source/rtftok/rtfsdrimport.cxx    |    4 ++++
 3 files changed, 23 insertions(+)

New commits:
commit 5ea5a0ff387d22e10b7565eec7f0f4abc685dda7
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Wed Aug 1 20:30:40 2012 +0200

    fdo#49892 import RTF_SHPB{X,Y}PAGE
    
    (cherry picked from commit 2111c6e6dc18f3ffd11de176791ecc04bab41afb)
    
    Conflicts:
    
    	writerfilter/source/rtftok/rtfdocumentimpl.cxx
    
    Change-Id: I8fe2b28f44ee61fc0f1438de3681fd86b16d29ae

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index a59c06d..2074d69 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -2207,6 +2207,12 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
         case RTF_LANDSCAPE:
                 lcl_putNestedAttribute(m_aStates.top().aSectionSprms, NS_ooxml::LN_EG_SectPrContents_pgSz, NS_ooxml::LN_CT_PageSz_orient, RTFValue::Pointer_t(new RTFValue(1)));
                 break;
+        case RTF_SHPBXPAGE:
+                m_aStates.top().aShape.nHoriOrientRelation = text::RelOrientation::PAGE_FRAME;
+                break;
+        case RTF_SHPBYPAGE:
+                m_aStates.top().aShape.nVertOrientRelation = text::RelOrientation::PAGE_FRAME;
+                break;
         default:
             SAL_INFO("writerfilter", OSL_THIS_FUNC << ": TODO handle flag '" << lcl_RtfToString(nKeyword) << "'");
             aSkip.setParsed(false);
@@ -3734,6 +3740,16 @@ RTFPicture::RTFPicture()
 {
 }
 
+RTFShape::RTFShape()
+    : nLeft(0),
+    nTop(0),
+    nRight(0),
+    nBottom(0),
+    nHoriOrientRelation(0),
+    nVertOrientRelation(0)
+{
+}
+
 RTFDrawingObject::RTFDrawingObject()
     : nLineColorR(0),
     nLineColorG(0),
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
index 9778ce7..c43ca29 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -190,11 +190,14 @@ namespace writerfilter {
         class RTFShape
         {
             public:
+                RTFShape();
                 std::vector< std::pair<rtl::OUString, rtl::OUString> > aProperties;
                 int nLeft;
                 int nTop;
                 int nRight;
                 int nBottom;
+                sal_Int16 nHoriOrientRelation;
+                sal_Int16 nVertOrientRelation;
         };
 
         /// Stores the properties of a drawing object.
diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx
index f12e44c..701780d 100644
--- a/writerfilter/source/rtftok/rtfsdrimport.cxx
+++ b/writerfilter/source/rtftok/rtfsdrimport.cxx
@@ -321,6 +321,10 @@ void RTFSdrImport::resolve(RTFShape& rShape)
     {
         xShape->setPosition(awt::Point(rShape.nLeft, rShape.nTop));
         xShape->setSize(awt::Size(rShape.nRight - rShape.nLeft, rShape.nBottom - rShape.nTop));
+        if (rShape.nHoriOrientRelation != 0)
+            xPropertySet->setPropertyValue("HoriOrientRelation", uno::makeAny(rShape.nHoriOrientRelation));
+        if (rShape.nVertOrientRelation != 0)
+            xPropertySet->setPropertyValue("VertOrientRelation", uno::makeAny(rShape.nVertOrientRelation));
     }
 
     // Send it to dmapper


More information about the Libreoffice-commits mailing list