[ooo-build-commit] .: Branch 'ooo-build-3-2-1' - patches/dev300
Cédric Bosdonnat
cbosdo at kemper.freedesktop.org
Fri May 21 04:47:40 PDT 2010
patches/dev300/apply | 2
patches/dev300/sw-num-fix.diff | 22 ----
patches/dev300/sw-rtf-num-fix.diff | 203 +++++++++++++++++++++++++++++++++++++
3 files changed, 204 insertions(+), 23 deletions(-)
New commits:
commit 14d4043b6384f6a1a1e2947edc779ffe46221f99
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Fri May 21 13:45:29 2010 +0200
RTF bullet roundtrip fixes
The RTF import code wasn't using the new numbering code: that introduced
problems when loading and saving the same simple RTF files.
* patches/dev300/apply:
* patches/dev300/sw-num-fix.diff:
* patches/dev300/sw-rtf-num-fix.diff:
Enhanced and renamed the patch to have a more significant name
diff --git a/patches/dev300/apply b/patches/dev300/apply
index b3c8ab2..5ca410e 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -665,7 +665,7 @@ sw-ww8font-fix.diff, cbosdo
sw-show-Remove-Hyperlink-even-with-selection.diff, alvarezp2000
sw-preserve-char-style-on-reset-format.diff, i#47893, alvarezp2000
-sw-num-fix.diff, n#569266, cbosdo
+sw-rtf-num-fix.diff, n#569266, cbosdo
# Refresh the cell formatting after pasting in it
sw-paste-table.diff, n#564789, cbosdo
diff --git a/patches/dev300/sw-num-fix.diff b/patches/dev300/sw-num-fix.diff
deleted file mode 100644
index 3d2d2bb..0000000
--- a/patches/dev300/sw-num-fix.diff
+++ /dev/null
@@ -1,22 +0,0 @@
-diff --git sw/source/filter/rtf/rtfatr.cxx sw/source/filter/rtf/rtfatr.cxx
-index bbe9030..7f191ad 100644
---- sw/source/filter/rtf/rtfatr.cxx
-+++ sw/source/filter/rtf/rtfatr.cxx
-@@ -1223,7 +1223,7 @@ static Writer& OutRTF_SwTxtNode( Writer& rWrt, SwCntntNode& rNode )
- }
-
- // gibt es harte Attributierung ?
-- if( bNewFmts && pNd->HasSwAttrSet())
-+ if( pNd->HasSwAttrSet() )
- {
- rRTFWrt.pFlyFmt = 0;
-
-@@ -1246,7 +1246,7 @@ static Writer& OutRTF_SwTxtNode( Writer& rWrt, SwCntntNode& rNode )
- SfxItemSet aSet( rNdSet );
- SvxLRSpaceItem aLR( (SvxLRSpaceItem&)rNdSet.Get( RES_LR_SPACE ) );
-
-- aLR.SetTxtLeft( aLR.GetTxtLeft() + pFmt->GetAbsLSpace() );
-+ aLR.SetTxtLeft( aLR.GetTxtLeft() + pFmt->GetIndentAt() );
- if( MAXLEVEL > pNd->GetActualListLevel() )
- aLR.SetTxtFirstLineOfst( pFmt->GetFirstLineOffset() );
- else
diff --git a/patches/dev300/sw-rtf-num-fix.diff b/patches/dev300/sw-rtf-num-fix.diff
new file mode 100644
index 0000000..d35703b
--- /dev/null
+++ b/patches/dev300/sw-rtf-num-fix.diff
@@ -0,0 +1,203 @@
+RTF numbering roundtrip fixes
+
+From: Cédric Bosdonnat <cedricbosdo at openoffice.org>
+
+
+---
+
+ sw/source/filter/rtf/rtfatr.cxx | 12 +++++----
+ sw/source/filter/rtf/rtfnum.cxx | 52 +++++++++++++++++++--------------------
+ 2 files changed, 31 insertions(+), 33 deletions(-)
+
+
+diff --git sw/source/filter/rtf/rtfatr.cxx sw/source/filter/rtf/rtfatr.cxx
+index 6da9f86..56d34e8 100644
+--- sw/source/filter/rtf/rtfatr.cxx
++++ sw/source/filter/rtf/rtfatr.cxx
+@@ -448,15 +448,15 @@ bool SwFmtToSet(SwRTFWriter& rWrt, const SwFmt& rFmt, SfxItemSet &rSet)
+ }
+
+ const SwNumFmt* pNFmt = &rWrt.pDoc->GetOutlineNumRule()->Get( static_cast<USHORT>(nLvl) );
+- if( pNFmt->GetAbsLSpace() )
++ if( pNFmt->GetIndentAt() )
+ {
+ SfxItemSet aSet( *rFmt.GetAttrSet().GetPool(),
+ rFmt.GetAttrSet().GetRanges() );
+ aSet.SetParent( &rFmt.GetAttrSet() );
+ SvxLRSpaceItem aLR( (SvxLRSpaceItem&)aSet.Get( RES_LR_SPACE ) );
+
+- aLR.SetTxtLeft( aLR.GetTxtLeft() + pNFmt->GetAbsLSpace() );
+- aLR.SetTxtFirstLineOfst( pNFmt->GetFirstLineOffset() );
++ aLR.SetTxtLeft( aLR.GetTxtLeft() + pNFmt->GetIndentAt() );
++ aLR.SetTxtFirstLineOfst( pNFmt->GetFirstLineIndent() );
+
+ aSet.Put(aLR);
+ rSet.Put(aSet);
+@@ -1220,7 +1220,7 @@ static Writer& OutRTF_SwTxtNode( Writer& rWrt, SwCntntNode& rNode )
+ }
+
+ // gibt es harte Attributierung ?
+- if( bNewFmts && pNd->HasSwAttrSet())
++ if( pNd->HasSwAttrSet() )
+ {
+ rRTFWrt.pFlyFmt = 0;
+
+@@ -1243,9 +1243,9 @@ static Writer& OutRTF_SwTxtNode( Writer& rWrt, SwCntntNode& rNode )
+ SfxItemSet aSet( rNdSet );
+ SvxLRSpaceItem aLR( (SvxLRSpaceItem&)rNdSet.Get( RES_LR_SPACE ) );
+
+- aLR.SetTxtLeft( aLR.GetTxtLeft() + pFmt->GetAbsLSpace() );
++ aLR.SetTxtLeft( aLR.GetTxtLeft() + pFmt->GetIndentAt() );
+ if( MAXLEVEL > pNd->GetActualListLevel() )
+- aLR.SetTxtFirstLineOfst( pFmt->GetFirstLineOffset() );
++ aLR.SetTxtFirstLineOfst( pFmt->GetFirstLineIndent() );
+ else
+ aSet.ClearItem( RES_PARATR_NUMRULE );
+ aSet.Put( aLR );
+diff --git sw/source/filter/rtf/rtfnum.cxx sw/source/filter/rtf/rtfnum.cxx
+index 0616b96..f1b9067 100644
+--- sw/source/filter/rtf/rtfnum.cxx
++++ sw/source/filter/rtf/rtfnum.cxx
+@@ -43,6 +43,7 @@
+ #include <svx/colritem.hxx>
+ #include <svx/udlnitem.hxx>
+ #include <svx/wrlmitem.hxx>
++#include <svx/numitem.hxx>
+ #include <shellio.hxx>
+ #include <fltini.hxx>
+ #include <swtypes.hxx>
+@@ -72,7 +73,7 @@ void lcl_ExpandNumFmts( SwNumRule& rRule )
+ if( !rRule.GetNumFmt( n ) )
+ {
+ SwNumFmt aNumFmt( rRule.Get( 0 ));
+- aNumFmt.SetAbsLSpace( aNumFmt.GetAbsLSpace() * ( n + 1 ) );
++ aNumFmt.SetIndentAt( aNumFmt.GetIndentAt() * ( n + 1 ) );
+ rRule.Set( n, aNumFmt );
+ }
+ }
+@@ -99,13 +100,13 @@ void SwRTFParser::ReadListLevel( SwNumRule& rRule, BYTE nNumLvl )
+ int nLvlTxtLevel = 0, nLvlNumberLevel = 0;
+ String sLvlText, sLvlNumber;
+ SwNumFmt* pCurNumFmt;
+- String aStringFollow = aEmptyStr;
++ SvxNumberFormat::SvxNumLabelFollowedBy eFollowedBy = SvxNumberFormat::NOTHING;
+
+ if( MAXLEVEL >= nNumLvl )
+ {
+ pCurNumFmt = (SwNumFmt*)rRule.GetNumFmt( nNumLvl );
+- pCurNumFmt->SetAbsLSpace( 0 );
+- pCurNumFmt->SetFirstLineOffset( 0 );
++ pCurNumFmt->SetIndentAt( 0 );
++ pCurNumFmt->SetFirstLineIndent( 0 );
+ }
+ else
+ pCurNumFmt = 0;
+@@ -210,17 +211,16 @@ void SwRTFParser::ReadListLevel( SwNumRule& rRule, BYTE nNumLvl )
+ break;
+
+ case RTF_LEVELFOLLOW:
+- /* removed; waiting for swnum02 to be integrated!
++ /* removed; waiting for swnum02 to be integrated! */
+ switch (nTokenValue)
+ {
+ case 0:
+- aStringFollow=String('\t');
++ eFollowedBy = SvxNumberFormat::LISTTAB;
+ break;
+ case 1:
+- aStringFollow=String(' ');
++ eFollowedBy = SvxNumberFormat::SPACE;
+ break;
+ }
+- */
+ break;
+
+ case RTF_LEVELOLD:
+@@ -244,8 +244,8 @@ void SwRTFParser::ReadListLevel( SwNumRule& rRule, BYTE nNumLvl )
+ // and put the current "LRSpace" into the set
+ {
+ SvxLRSpaceItem aLR( RES_LR_SPACE );
+- aLR.SetTxtLeft( pCurNumFmt->GetAbsLSpace() );
+- aLR.SetTxtFirstLineOfst(pCurNumFmt->GetFirstLineOffset());
++ aLR.SetTxtLeft( pCurNumFmt->GetIndentAt() );
++ aLR.SetTxtFirstLineOfst(pCurNumFmt->GetFirstLineIndent());
+ aSet.Put( aLR );
+ }
+
+@@ -264,8 +264,9 @@ void SwRTFParser::ReadListLevel( SwNumRule& rRule, BYTE nNumLvl )
+ FALSE, &pItem ))
+ {
+ const SvxLRSpaceItem& rLR = *(SvxLRSpaceItem*)pItem;
+- pCurNumFmt->SetAbsLSpace( static_cast< short >(rLR.GetTxtLeft()) );
+- pCurNumFmt->SetFirstLineOffset( rLR.GetTxtFirstLineOfst());
++ pCurNumFmt->SetListtabPos( rLR.GetTxtLeft( ) );
++ pCurNumFmt->SetIndentAt( rLR.GetTxtLeft() );
++ pCurNumFmt->SetFirstLineIndent( rLR.GetTxtFirstLineOfst());
+ }
+
+ // dann aus der Vorlage den Font holen
+@@ -306,16 +307,13 @@ void SwRTFParser::ReadListLevel( SwNumRule& rRule, BYTE nNumLvl )
+ pCurNumFmt->SetSuffix( sLvlText );
+ }
+
+- String newSuffix=pCurNumFmt->GetSuffix();
+- newSuffix+=aStringFollow;
+- pCurNumFmt->SetSuffix(newSuffix);
+- /* removed; waiting for swnum02 to be integrated!
+- if (aStringFollow.GetChar(0)=='\t' && !pCurNumFmt->IsItemize())
++ /* removed; waiting for swnum02 to be integrated!*/
++ pCurNumFmt->SetLabelFollowedBy( eFollowedBy );
++ if (eFollowedBy == SvxNumberFormat::LISTTAB && !pCurNumFmt->IsItemize())
+ {
+- pCurNumFmt->SetAbsLSpace(0);
+- pCurNumFmt->SetFirstLineOffset(0);
++ pCurNumFmt->SetIndentAt(0);
++ pCurNumFmt->SetFirstLineIndent(0);
+ }
+- */
+ }
+
+ SkipToken( -1 );
+@@ -380,7 +378,7 @@ void SwRTFParser::ReadListTable()
+
+ String sTmp( String::CreateFromAscii(
+ RTL_CONSTASCII_STRINGPARAM( RTF_NUMRULE_NAME " 1" )));
+- aEntry.nListDocPos = pDoc->MakeNumRule( sTmp );
++ aEntry.nListDocPos = pDoc->MakeNumRule( sTmp, 0, FALSE, SvxNumberFormat::LABEL_ALIGNMENT );
+ pCurRule = pDoc->GetNumRuleTbl()[ aEntry.nListDocPos ];
+ // --> OD 2008-07-08 #i91400#
+ pCurRule->SetName( pDoc->GetUniqueNumRuleName( &sTmp, FALSE ),
+@@ -1011,8 +1009,8 @@ NUMATTR_SETUNDERLINE:
+ case RTF_PNINDENT:
+ if( 0 > short( nTokenValue ) )
+ nTokenValue = - (short)nTokenValue;
+- pCurNumFmt->SetFirstLineOffset( - short( nTokenValue ));
+- pCurNumFmt->SetAbsLSpace( (nLevel + 1 ) * USHORT( nTokenValue ));
++ pCurNumFmt->SetFirstLineIndent( - nTokenValue );
++ pCurNumFmt->SetIndentAt( (nLevel + 1 ) * nTokenValue );
+ break;
+ case RTF_PNSP:
+ pCurNumFmt->SetCharTextDistance( USHORT( nTokenValue ));
+@@ -1288,8 +1286,8 @@ void SwRTFWriter::OutRTFListTab()
+ }
+
+ Strm() << OOO_STRING_SVTOOLS_RTF_FI;
+- OutLong( rFmt.GetFirstLineOffset() ) << OOO_STRING_SVTOOLS_RTF_LI;
+- OutLong( rFmt.GetAbsLSpace() );
++ OutLong( rFmt.GetFirstLineIndent() ) << OOO_STRING_SVTOOLS_RTF_LI;
++ OutLong( rFmt.GetIndentAt() );
+
+ Strm() << '}';
+
+@@ -1401,9 +1399,9 @@ BOOL SwRTFWriter::OutListNum( const SwTxtNode& rNd )
+ SfxItemSet aSet( *rNdSet.GetPool(), rNdSet.GetRanges() );
+ aSet.SetParent( &rNdSet );
+ SvxLRSpaceItem aLR( (SvxLRSpaceItem&)rNdSet.Get( RES_LR_SPACE ) );
+- aLR.SetTxtLeft( aLR.GetTxtLeft() + pFmt->GetAbsLSpace() );
++ aLR.SetTxtLeft( aLR.GetTxtLeft() + pFmt->GetIndentAt() );
+
+- aLR.SetTxtFirstLineOfst( pFmt->GetFirstLineOffset() );
++ aLR.SetTxtFirstLineOfst( pFmt->GetFirstLineIndent() );
+ if ( bExportNumRule )
+ Strm() << '{' << OOO_STRING_SVTOOLS_RTF_LISTTEXT << OOO_STRING_SVTOOLS_RTF_PARD << OOO_STRING_SVTOOLS_RTF_PLAIN << ' ';
+
More information about the ooo-build-commit
mailing list