sw/source/core/layout/layouter.cxx |   16 ++++++----------
 sw/source/core/layout/tabfrm.cxx   |    4 +---
 2 files changed, 7 insertions(+), 13 deletions(-)

New commits:
commit 85d961200b674b8c8179f85aed752fb179350dbb
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Thu May 11 18:54:33 2023 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Thu May 11 20:15:54 2023 +0200

    sw: move some loop control debug messages out of #if OSL_DEBUG_LEVEL > 1
    
    Also convert some obvious assert().
    
    Change-Id: I6ec56920df5b4aceff5e85b7e7e40ee8ce37f93a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151679
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/sw/source/core/layout/layouter.cxx 
b/sw/source/core/layout/layouter.cxx
index 57f2ee0aeae1..5bed8fcba2b5 100644
--- a/sw/source/core/layout/layouter.cxx
+++ b/sw/source/core/layout/layouter.cxx
@@ -141,7 +141,7 @@ void SwEndnoter::InsertEndnotes()
 
 SwLooping::SwLooping( SwPageFrame const * pPage )
 {
-    OSL_ENSURE( pPage, "Where's my page?" );
+    assert(pPage);
     mnMinPage = pPage->GetPhyPageNum();
     mnMaxPage = mnMinPage;
     mnCount = 0;
@@ -184,12 +184,10 @@ void SwLooping::Control( SwPageFrame* pPage )
         static bool bNoLouie = false;
         if( bNoLouie )
             return;
+#endif
 
         // FME 2007-08-30 #i81146# new loop control
-        OSL_ENSURE( 0 != mnLoopControlStage, "Looping Louie: Stage 1!" );
-        OSL_ENSURE( 1 != mnLoopControlStage, "Looping Louie: Stage 2!!" );
-        OSL_ENSURE( 2 >  mnLoopControlStage, "Looping Louie: Stage 3!!!" );
-#endif
+        SAL_WARN("sw.layout", "Looping Louie: Stage " << (mnLoopControlStage + 
1) << "!");
 
         Drastic( pPage->Lower() );
         if (nNew > mnMinPage && pPage->GetPrev())
@@ -236,7 +234,7 @@ void SwLayouter::InsertEndnotes( SwSectionFrame const * 
pSect )
 
 void SwLayouter::LoopControl( SwPageFrame* pPage )
 {
-    OSL_ENSURE( mpLooping, "Looping: Lost control" );
+    assert(mpLooping);
     mpLooping->Control( pPage );
 }
 
@@ -244,9 +242,7 @@ void SwLayouter::LoopingLouieLight( const SwDoc& rDoc, 
const SwTextFrame& rFrame
 {
     if ( mpLooping && mpLooping->IsLoopingLouieLight() )
     {
-#if OSL_DEBUG_LEVEL > 1
-        OSL_FAIL( "Looping Louie (Light): Fixating fractious frame" );
-#endif
+        SAL_WARN("sw.layout", "Looping Louie (Light): Fixating fractious 
frame");
         SwLayouter::InsertMovedFwdFrame( rDoc, rFrame, 
rFrame.FindPageFrame()->GetPhyPageNum() );
     }
 }
@@ -290,7 +286,7 @@ bool SwLayouter::Collecting( SwDoc* pDoc, SwSectionFrame 
const * pSect, SwFootno
 
 bool SwLayouter::StartLoopControl( SwDoc* pDoc, SwPageFrame const *pPage )
 {
-    OSL_ENSURE( pDoc, "No doc, no fun" );
+    assert(pDoc);
     if( !pDoc->getIDocumentLayoutAccess().GetLayouter() )
         pDoc->getIDocumentLayoutAccess().SetLayouter( new SwLayouter() );
     return !pDoc->getIDocumentLayoutAccess().GetLayouter()->mpLooping &&
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 421c29b8d271..86685f620e37 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -1603,9 +1603,7 @@ bool SwContentFrame::CalcLowers(SwLayoutFrame & rLay, 
SwLayoutFrame const& rDont
                         continue;
                     }
 
-#if OSL_DEBUG_LEVEL > 1
-                    OSL_FAIL( "LoopControl in SwContentFrame::CalcLowers" );
-#endif
+                    SAL_WARN("sw.layout", "LoopControl in 
SwContentFrame::CalcLowers");
                 }
             }
             if (!rDontLeave.IsAnLower(pCnt)) // moved backward?

Reply via email to