[Libreoffice-commits] .: 2 commits - sw/source
Noel Power
noelp at kemper.freedesktop.org
Fri Feb 4 01:58:01 PST 2011
sw/source/filter/ww8/ww8par.cxx | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
New commits:
commit da0006a1b5d7be8411d6fbb0190c1c4d44809458
Author: Noel Power <noel.power at novell.com>
Date: Fri Feb 4 09:56:54 2011 +0000
fix for bnc#659631
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index e626630..601108b 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -3657,6 +3657,34 @@ void wwSectionManager::InsertSegments()
SwFmtPageDesc aDesc(SetSwFmtPageDesc(aIter, aStart, bIgnoreCols));
if (!aDesc.GetPageDesc())
continue;
+
+ // special case handling for odd/even section break
+ // a) as before create a new page style for the section break
+ // b) set Layout of generated page style to right/left ( according
+ // to section break odd/even )
+ // c) create a new style to follow the break page style
+ if ( aIter->maSep.bkc == 3 || aIter->maSep.bkc == 4 )
+ {
+ // SetSwFmtPageDesc calls some methods that could
+ // modify aIter (e.g. wwSection ).
+ // Since we call SetSwFmtPageDesc below to generate the
+ // 'Following' style of the Break style, it is safer
+ // to take a copy of the contents of aIter.
+ wwSection aTmpSection = *aIter;
+ // create a new following page style
+ SwFmtPageDesc aFollow(SetSwFmtPageDesc(aIter, aStart, bIgnoreCols));
+ // restore any contents of aIter trashed by SetSwFmtPageDesc
+ *aIter = aTmpSection;
+
+ // Handle the section break
+ UseOnPage eUseOnPage = nsUseOnPage::PD_LEFT;
+ if ( aIter->maSep.bkc == 4 ) // Odd ( right ) Section break
+ eUseOnPage = nsUseOnPage::PD_RIGHT;
+
+ aDesc.GetPageDesc()->WriteUseOn( eUseOnPage );
+ aDesc.GetPageDesc()->SetFollow( aFollow.GetPageDesc() );
+ }
+
GiveNodePageDesc(aIter->maStart, aDesc, mrReader.rDoc);
}
commit 7140bf7ed014a2d06ca27cc3bd6e3c7f4d5ccd9b
Author: Noel Power <noel.power at novell.com>
Date: Fri Feb 4 09:31:56 2011 +0000
revert c57c4b64a18041534359b2cb98389a34e7222b92
ok, changing the patch a little, for ease of review I think better to just bin
the previous version
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 6e25890..e626630 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -3657,20 +3657,6 @@ void wwSectionManager::InsertSegments()
SwFmtPageDesc aDesc(SetSwFmtPageDesc(aIter, aStart, bIgnoreCols));
if (!aDesc.GetPageDesc())
continue;
-
- // special case handling for odd/even section break
- // set Layout of generated page style to odd/even
- if ( aIter->maSep.bkc == 3 || aIter->maSep.bkc == 4 )
- {
- UseOnPage eUseOnPage = nsUseOnPage::PD_LEFT;
- if ( aIter->maSep.bkc == 4 ) // Odd ( right ) Section break
- eUseOnPage = nsUseOnPage::PD_RIGHT;
- aDesc.GetPageDesc()->WriteUseOn( eUseOnPage );
- // create a new following page style
- SwFmtPageDesc aFollow(SetSwFmtPageDesc(aIter, aStart, bIgnoreCols));
- aDesc.GetPageDesc()->SetFollow( aFollow.GetPageDesc() );
- }
-
GiveNodePageDesc(aIter->maStart, aDesc, mrReader.rDoc);
}
More information about the Libreoffice-commits
mailing list