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

Noel Power noelp at kemper.freedesktop.org
Wed Mar 2 08:11:50 PST 2011


 sw/source/filter/ww8/ww8par.cxx |   28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

New commits:
commit 42e70ee046504caf6e628f03bc79b83a706a8cfb
Author: Noel Power <noel.power at novell.com>
Date:   Fri Feb 4 09:56:54 2011 +0000

    fix for bnc#659631
    
    Signed-off-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 76c6ae1..033df99 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -3699,6 +3699,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);
         }
 


More information about the Libreoffice-commits mailing list