[Libreoffice-commits] .: 2 commits - sw/source

Cédric Bosdonnat cbosdo at kemper.freedesktop.org
Thu Mar 22 07:10:49 PDT 2012


 sw/source/core/doc/doc.cxx                      |    1 
 sw/source/core/inc/layouter.hxx                 |    9 ----
 sw/source/core/layout/layouter.cxx              |   48 ------------------------
 sw/source/core/layout/objectformattertxtfrm.cxx |    6 ---
 sw/source/core/text/txtfly.cxx                  |   10 +++--
 5 files changed, 7 insertions(+), 67 deletions(-)

New commits:
commit 8a233f17ae589b33e3b54ef9ebb1fcff41ef6cd7
Author: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
Date:   Thu Mar 22 14:52:37 2012 +0100

    n#750258: removed strange non-wrapping condition
    
    In the bug file, some text wrapping was badly computed when showing the
    document (but not at the first rendering) due to that weird NotToWrap
    mecahnism in SwLayouter. Checked the original issue i#40155 that
    removing this does hurt.

diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 64f14f4..4761473 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -1898,7 +1898,6 @@ void SwDoc::ClearSwLayouterEntries()
 {
     SwLayouter::ClearMovedFwdFrms( *this );
     SwLayouter::ClearObjsTmpConsiderWrapInfluence( *this );
-    SwLayouter::ClearFrmsNotToWrap( *this );
     // #i65250#
     SwLayouter::ClearMoveBwdLayoutInfo( *this );
 }
diff --git a/sw/source/core/inc/layouter.hxx b/sw/source/core/inc/layouter.hxx
index 135263e..4350b95 100644
--- a/sw/source/core/inc/layouter.hxx
+++ b/sw/source/core/inc/layouter.hxx
@@ -68,9 +68,6 @@ class SwLayouter
     SwMovedFwdFrmsByObjPos* mpMovedFwdFrms;
     // --> #i35911#
     SwObjsMarkedAsTmpConsiderWrapInfluence* mpObjsTmpConsiderWrapInfl;
-    // --> #i40155# - data structure to collect frames, which are
-    // marked not to wrap around objects.
-    std::vector< const SwFrm* > maFrmsNotToWrap;
 
 public:
     // --> #i65250#
@@ -148,12 +145,6 @@ public:
     static void InsertObjForTmpConsiderWrapInfluence(
                                         const SwDoc& _rDoc,
                                         SwAnchoredObject& _rAnchoredObj );
-    // --> #i40155#
-    static void ClearFrmsNotToWrap( const SwDoc& _rDoc );
-    static void InsertFrmNotToWrap( const SwDoc& _rDoc,
-                                    const SwFrm& _rFrm );
-    static bool FrmNotToWrap( const IDocumentLayoutAccess& _rIDLA,
-                              const SwFrm& _rFrm );
     // --> #i65250#
     static bool MoveBwdSuppressed( const SwDoc& p_rDoc,
                                    const SwFlowFrm& p_rFlowFrm,
diff --git a/sw/source/core/layout/layouter.cxx b/sw/source/core/layout/layouter.cxx
index 344b388..aa2ac46 100644
--- a/sw/source/core/layout/layouter.cxx
+++ b/sw/source/core/layout/layouter.cxx
@@ -440,54 +440,6 @@ void SwLayouter::InsertObjForTmpConsiderWrapInfluence(
 
     _rDoc.GetLayouter()->mpObjsTmpConsiderWrapInfl->Insert( _rAnchoredObj );
 }
-// #i40155#
-void SwLayouter::ClearFrmsNotToWrap( const SwDoc& _rDoc )
-{
-    if ( _rDoc.GetLayouter() )
-    {
-        const_cast<SwDoc&>(_rDoc).GetLayouter()->maFrmsNotToWrap.clear();
-    }
-}
-
-void SwLayouter::InsertFrmNotToWrap( const SwDoc& _rDoc,
-                                             const SwFrm& _rFrm )
-{
-    if ( !_rDoc.GetLayouter() )
-    {
-        const_cast<SwDoc&>(_rDoc).SetLayouter( new SwLayouter() );
-    }
-
-    if ( !SwLayouter::FrmNotToWrap( _rDoc, _rFrm ) )
-    {
-        const_cast<SwDoc&>(_rDoc).GetLayouter()->maFrmsNotToWrap.push_back( &_rFrm );
-    }
-}
-
-bool SwLayouter::FrmNotToWrap( const IDocumentLayoutAccess& _rDLA,
-                               const SwFrm& _rFrm )
-{
-    const SwLayouter* pLayouter = _rDLA.GetLayouter();
-    if ( !pLayouter )
-    {
-        return false;
-    }
-    else
-    {
-        bool bFrmNotToWrap( false );
-        std::vector< const SwFrm* >::const_iterator aIter =
-                            pLayouter->maFrmsNotToWrap.begin();
-        for ( ; aIter != pLayouter->maFrmsNotToWrap.end(); ++aIter )
-        {
-            const SwFrm* pFrm = *(aIter);
-            if ( pFrm == &_rFrm )
-            {
-                bFrmNotToWrap = true;
-                break;
-            }
-        }
-        return bFrmNotToWrap;
-    }
-}
 
 void LOOPING_LOUIE_LIGHT( bool bCondition, const SwTxtFrm& rTxtFrm )
 {
diff --git a/sw/source/core/layout/objectformattertxtfrm.cxx b/sw/source/core/layout/objectformattertxtfrm.cxx
index 3ceb54a..c1d8eb8 100644
--- a/sw/source/core/layout/objectformattertxtfrm.cxx
+++ b/sw/source/core/layout/objectformattertxtfrm.cxx
@@ -296,9 +296,6 @@ bool SwObjectFormatterTxtFrm::DoFormatObj( SwAnchoredObject& _rAnchoredObj,
                       mrAnchorTxtFrm.GetFollow() &&
                       mrAnchorTxtFrm.GetFollow()->GetOfst() == 0 )
             {
-                SwLayouter::InsertFrmNotToWrap(
-                                *(mrAnchorTxtFrm.FindPageFrm()->GetFmt()->GetDoc()),
-                                mrAnchorTxtFrm );
                 SwLayouter::RemoveMovedFwdFrm(
                                 *(mrAnchorTxtFrm.FindPageFrm()->GetFmt()->GetDoc()),
                                 mrAnchorTxtFrm );
@@ -467,9 +464,6 @@ bool SwObjectFormatterTxtFrm::DoFormatObjs()
                   mrAnchorTxtFrm.GetFollow() &&
                   mrAnchorTxtFrm.GetFollow()->GetOfst() == 0 )
         {
-            SwLayouter::InsertFrmNotToWrap(
-                            *(mrAnchorTxtFrm.FindPageFrm()->GetFmt()->GetDoc()),
-                            mrAnchorTxtFrm );
             SwLayouter::RemoveMovedFwdFrm(
                             *(mrAnchorTxtFrm.FindPageFrm()->GetFmt()->GetDoc()),
                             mrAnchorTxtFrm );
diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx
index dfe4996..8e255eb 100644
--- a/sw/source/core/text/txtfly.cxx
+++ b/sw/source/core/text/txtfly.cxx
@@ -892,8 +892,7 @@ SwAnchoredObjList* SwTxtFly::InitAnchoredObjList()
     const IDocumentSettingAccess* pIDSA = pCurrFrm->GetTxtNode()->getIDocumentSettingAccess();
     // #i40155# - check, if frame is marked not to wrap
     const sal_Bool bWrapAllowed = ( pIDSA->get(IDocumentSettingAccess::USE_FORMER_TEXT_WRAPPING) ||
-                                    ( !pCurrFrm->IsInFtn() && !bFooterHeader ) ) &&
-                                      !SwLayouter::FrmNotToWrap( *pCurrFrm->GetTxtNode()->getIDocumentLayoutAccess(), *pCurrFrm );
+                                    ( !pCurrFrm->IsInFtn() && !bFooterHeader ) );
 
     bOn = sal_False;
 
commit 2a4e77a6f94d35919237b9db9de184e70943fc13
Author: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
Date:   Thu Mar 22 14:27:43 2012 +0100

    Revert "make text wrapping work in headers/footers too (fdo#39155)"
    
    This reverts commit e2a8fb0427e6b33a0fd3873bb7e077a6e5da8ebb. This is a
    feature, not a bug and would cause loads of documents to be badly
    rendered.
    
    Link to the spec that brough that feature:
        http://www.openoffice.org/specs/writer/compatibility/adjust-text-wrapping.sxw
    
    Conflicts:
    
    	sw/source/core/text/txtfly.cxx

diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx
index ec6d09a..dfe4996 100644
--- a/sw/source/core/text/txtfly.cxx
+++ b/sw/source/core/text/txtfly.cxx
@@ -886,7 +886,14 @@ SwAnchoredObjList* SwTxtFly::InitAnchoredObjList()
 
     const SwSortedObjs *pSorted = pPage->GetSortedObjs();
     const sal_uInt32 nCount = pSorted ? pSorted->Count() : 0;
-    const sal_Bool bWrapAllowed = !SwLayouter::FrmNotToWrap( *pCurrFrm->GetTxtNode()->getIDocumentLayoutAccess(), *pCurrFrm );
+    // --> #108724# Page header/footer content doesn't have to wrap around
+    //              floating screen objects
+    const bool bFooterHeader = 0 != pCurrFrm->FindFooterOrHeader();
+    const IDocumentSettingAccess* pIDSA = pCurrFrm->GetTxtNode()->getIDocumentSettingAccess();
+    // #i40155# - check, if frame is marked not to wrap
+    const sal_Bool bWrapAllowed = ( pIDSA->get(IDocumentSettingAccess::USE_FORMER_TEXT_WRAPPING) ||
+                                    ( !pCurrFrm->IsInFtn() && !bFooterHeader ) ) &&
+                                      !SwLayouter::FrmNotToWrap( *pCurrFrm->GetTxtNode()->getIDocumentLayoutAccess(), *pCurrFrm );
 
     bOn = sal_False;
 
@@ -898,7 +905,6 @@ SwAnchoredObjList* SwTxtFly::InitAnchoredObjList()
         // #i28701# - consider complete frame area for new
         // text wrapping
         SwRect aRect;
-        const IDocumentSettingAccess* pIDSA = pCurrFrm->GetTxtNode()->getIDocumentSettingAccess();
         if ( pIDSA->get(IDocumentSettingAccess::USE_FORMER_TEXT_WRAPPING) )
         {
             aRect = pCurrFrm->Prt();
@@ -914,7 +920,6 @@ SwAnchoredObjList* SwTxtFly::InitAnchoredObjList()
         const long nRight = (aRect.*fnRect->fnGetRight)() - 1;
         const long nLeft = (aRect.*fnRect->fnGetLeft)() + 1;
         const sal_Bool bR2L = pCurrFrm->IsRightToLeft();
-        const bool bFooterHeader = ( pCurrFrm->FindFooterOrHeader() != NULL );
 
         const IDocumentDrawModelAccess* pIDDMA = pCurrFrm->GetTxtNode()->getIDocumentDrawModelAccess();
 


More information about the Libreoffice-commits mailing list