Hi all, Here are two patches to review for the 3.4 branch. I know it's stupid to hack the RTF import filter... but the new one won't be in 3.4 ;)
Thanks, -- Cédric Bosdonnat LibreOffice hacker http://documentfoundation.org OOo Eclipse Integration developer http://cedric.bosdonnat.free.fr
>From 49cfac3bdd9876496954ca1d52a714d6b2edd619 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= <[email protected]> Date: Mon, 27 Jun 2011 16:46:16 +0200 Subject: [PATCH 1/2] n#695479: Remove properties when removing empty fly frame --- sw/source/filter/rtf/rtffly.cxx | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/sw/source/filter/rtf/rtffly.cxx b/sw/source/filter/rtf/rtffly.cxx index 3e02399..eb35f2a 100644 --- a/sw/source/filter/rtf/rtffly.cxx +++ b/sw/source/filter/rtf/rtffly.cxx @@ -1098,6 +1098,8 @@ void SwRTFParser::ReadFly( int nToken, SfxItemSet* pSet ) // dann zerstoere den FlySave wieder. aFlyArr.DeleteAndDestroy( --nFlyArrCnt ); + // Remove the properties that have been parsed before in the paragraph + GetAttrStack().pop_back(); } else { -- 1.7.3.4
>From b1e022057ba263f5233025e7c0d566dc91080227 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= <[email protected]> Date: Fri, 8 Jul 2011 14:49:14 +0200 Subject: [PATCH 2/2] n#695479: basic handling of lines in RTF import --- 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
_______________________________________________ LibreOffice mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice
