[PATCH 2/2] n#695479: basic handling of lines in RTF import

Cédric Bosdonnat cedric.bosdonnat.ooo at free.fr
Fri Jul 8 05:49:14 PDT 2011


---
 sw/source/filter/rtf/swparrtf.cxx |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx
index 1b5c076..49a6f77 100644
--- a/sw/source/filter/rtf/swparrtf.cxx
+++ b/sw/source/filter/rtf/swparrtf.cxx
@@ -1173,7 +1173,7 @@ void SwRTFParser::ReadShpTxt(String& s)
 }
 
 /*
- * Very basic support for the "Buchhalternase".
+ * Very basic support for the Z-line.
  */
 void SwRTFParser::ReadDrawingObject()
 {
@@ -1185,6 +1185,9 @@ void SwRTFParser::ReadDrawingObject()
     ::basegfx::B2DPoint aPoint;
     bool bPolygonActive(false);
 
+    SwFmtHoriOrient aHori( 0, text::HoriOrientation::NONE, text::RelOrientation::PAGE_FRAME );
+    SwFmtVertOrient aVert( 0, text::VertOrientation::NONE, text::RelOrientation::PAGE_FRAME );
+
     while (level>0 && IsParserWorking())
     {
         nToken = GetNextToken();
@@ -1196,6 +1199,12 @@ void SwRTFParser::ReadDrawingObject()
             case '{':
                 level++;
                 break;
+            case RTF_DOBXMARGIN:
+                aHori.SetRelationOrient( text::RelOrientation::PAGE_PRINT_AREA );
+                break;
+            case RTF_DOBYMARGIN:
+                aVert.SetRelationOrient( text::RelOrientation::PAGE_PRINT_AREA );
+                break;
             case RTF_DPX:
                 aRect.setX(nTokenValue);
                 break;
@@ -1208,6 +1217,7 @@ void SwRTFParser::ReadDrawingObject()
             case RTF_DPYSIZE:
                 aRect.setHeight(nTokenValue);
                 break;
+            case RTF_DPLINE:
             case RTF_DPPOLYCOUNT:
                 bPolygonActive = true;
                 break;
@@ -1244,9 +1254,7 @@ void SwRTFParser::ReadDrawingObject()
         aAnchor.SetAnchor( pPam->GetPoint() );
         aFlySet.Put( aAnchor );
 
-        SwFmtHoriOrient aHori( 0, text::HoriOrientation::NONE, text::RelOrientation::PAGE_FRAME );
         aFlySet.Put( aHori );
-        SwFmtVertOrient aVert( 0, text::VertOrientation::NONE, text::RelOrientation::PAGE_FRAME );
         aFlySet.Put( aVert );
 
         pDoc->GetOrCreateDrawModel();
-- 
1.7.3.4


--=-GTvCLtjCvFvUoQYDhUcW--



More information about the LibreOffice mailing list