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

David Tardon dtardon at kemper.freedesktop.org
Tue Nov 16 01:52:39 PST 2010


 sw/source/core/layout/anchoreddrawobject.cxx |    8 ---
 sw/source/core/layout/calcmove.cxx           |   21 ---------
 sw/source/core/layout/flycnt.cxx             |   58 ---------------------------
 sw/source/core/layout/flylay.cxx             |   15 ------
 sw/source/core/layout/laycache.cxx           |   53 ------------------------
 sw/source/core/layout/pagechg.cxx            |   24 +----------
 sw/source/core/layout/pagedesc.cxx           |   11 +----
 sw/source/core/layout/paintfrm.cxx           |   14 ------
 sw/source/core/layout/tabfrm.cxx             |   29 -------------
 sw/source/core/layout/trvlfrm.cxx            |   13 ------
 sw/source/core/text/inftxt.cxx               |    2 
 sw/source/core/text/inftxt.hxx               |    2 
 12 files changed, 9 insertions(+), 241 deletions(-)

New commits:
commit f19fb8630f6dbf4b525bdd4ba775f05bb9d7e1a0
Author: David Tardon <dtardon at redhat.com>
Date:   Tue Nov 16 10:51:51 2010 +0100

    fixed DBG_UTIL vs. OSL_DEBUG_LEVEL mixup

diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index c6a1bdf..ec518d0 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -112,7 +112,7 @@ namespace numfunc
 }
 // <--
 
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
 // Test2: WYSIWYG++
 // Test4: WYSIWYG debug
 static sal_Bool bDbgLow = sal_False;
diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index 662f9fb..b11c6c3 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -380,7 +380,7 @@ public:
         { return ( pKanaComp && nKanaIdx < pKanaComp->Count() )
                    ? (*pKanaComp)[nKanaIdx] : 0; }
 
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
     sal_Bool IsOptCalm() const;
     sal_Bool IsOptLow() const;
     sal_Bool IsOptDbg() const;
commit 991013e50ce6f13119c3a3d814109213aa9b1f9d
Author: Kayo Hamid <revol.code at yahoo.com>
Date:   Tue Nov 16 06:31:40 2010 +0100

    remove dead code

diff --git a/sw/source/core/layout/anchoreddrawobject.cxx b/sw/source/core/layout/anchoreddrawobject.cxx
index d9f75bf..cdeed01 100644
--- a/sw/source/core/layout/anchoreddrawobject.cxx
+++ b/sw/source/core/layout/anchoreddrawobject.cxx
@@ -852,13 +852,7 @@ void SwAnchoredDrawObject::_SetPositioningAttr()
         GetFrmFmt().SetFmtAttr( aHori );
 
         SwFmtVertOrient aVert( GetFrmFmt().GetVertOrient() );
-        // --> OD 2007-01-03 #i73079# - vertical position already correct
-//        if ( aVert.GetRelationOrient() == text::RelOrientation::CHAR ||
-//             aVert.GetRelationOrient() == text::RelOrientation::TEXT_LINE )
-//        {
-//            nVertPos = -nVertPos;
-//        }
-        // <--
+
         aVert.SetPos( nVertPos );
         GetFrmFmt().SetFmtAttr( aVert );
         // <--
diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx
index 02733cb..3c1b37c 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -1472,27 +1472,6 @@ void SwCntntFrm::MakeAll()
             // <--
         }
 
-        // FME 16.07.2003 #i16930# - removed this code because it did not work
-
-        // OD 04.04.2003 #108446# - react on the situation detected in the text
-        // formatting - see <SwTxtFrm::FormatAdjust(..)>:
-        // text frame has to move forward, because its text formatting stopped,
-        // created a follow and detected, that it contains no content.
-/*        if ( IsTxtFrm() && bValidPos && bValidSize && bValidPrtArea &&
-             (Frm().*fnRect->fnGetHeight)() == 0 &&
-             HasFollow()
-           )
-        {
-            SwFrm* pOldUpper = GetUpper();
-            MoveFwd( TRUE, FALSE );
-            if ( GetUpper() != pOldUpper )
-            {
-                bMovedFwd = TRUE;
-                SWREFRESHFN( this )
-                continue;
-            }
-        } */
-
         //Wenn ich der erste einer Kette bin koennte ich mal sehen ob
         //ich zurueckfliessen kann (wenn ich mich ueberhaupt bewegen soll).
         //Damit es keine Oszillation gibt, darf ich nicht gerade vorwaerts
diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx
index cdeb6fb..997f4d1 100644
--- a/sw/source/core/layout/flycnt.cxx
+++ b/sw/source/core/layout/flycnt.cxx
@@ -1429,64 +1429,6 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
                              FALSE );
 }
 
-// OD 2004-08-12 #i32795# - Note: method no longer used in <flyincnt.cxx>
-//void DeepCalc( const SwFrm *pFrm )
-//{
-//    if( pFrm->IsSctFrm() ||
-//        ( pFrm->IsFlyFrm() && ((SwFlyFrm*)pFrm)->IsFlyInCntFrm() ) )
-//      return;
-//    const SwFlowFrm *pFlow = SwFlowFrm::CastFlowFrm( pFrm );
-//    if( pFlow && pFlow->IsAnyJoinLocked() )
-//        return;
-
-//    USHORT nCnt = 0;
-
-//  BOOL bContinue = FALSE;
-//  do
-//    {
-//        if ( ++nCnt == 10 )
-//      {
-//          ASSERT( !nCnt, "DeepCalc: Loop detected1?" );
-//          break;
-//      }
-
-//      const BOOL bSetComplete = !pFrm->IsValid();
-//      const SwRect aOldFrm( pFrm->Frm() );
-//      const SwRect aOldPrt( pFrm->Prt() );
-
-//      const SwFrm *pUp = pFrm->GetUpper();
-//      if ( pUp )
-//      {
-//          //Nicht weiter wenn der Up ein Fly mit Spalten ist.
-//          if( ( !pUp->IsFlyFrm() || !((SwLayoutFrm*)pUp)->Lower() ||
-//               !((SwLayoutFrm*)pUp)->Lower()->IsColumnFrm() ) &&
-//               !pUp->IsSctFrm() )
-//          {
-//                SWRECTFN( pUp )
-//                const Point aPt( (pUp->Frm().*fnRect->fnGetPos)() );
-//              ::DeepCalc( pUp );
-//                bContinue = aPt != (pUp->Frm().*fnRect->fnGetPos)();
-//          }
-//      }
-//      else
-//          pUp = pFrm;
-
-//      pFrm->Calc();
-//      if ( bSetComplete && (aOldFrm != pFrm->Frm() || aOldPrt != pFrm->Prt()))
-//          pFrm->SetCompletePaint();
-
-//      if ( pUp->IsFlyFrm() )
-//      {
-//          if ( ((SwFlyFrm*)pUp)->IsLocked() ||
-//               (((SwFlyFrm*)pUp)->IsFlyAtCntFrm() &&
-//                SwOszControl::IsInProgress( (const SwFlyFrm*)pUp )) )
-//          {
-//              bContinue = FALSE;
-//          }
-//      }
-//  } while ( bContinue );
-//}
-
 /** method to assure that anchored object is registered at the correct
     page frame
 
diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx
index eac9e4c..6ec4ed2 100644
--- a/sw/source/core/layout/flylay.cxx
+++ b/sw/source/core/layout/flylay.cxx
@@ -210,21 +210,6 @@ void SwFlyFreeFrm::MakeAll()
             if ( !bValidSize )
             {
                 bValidPrtArea = FALSE;
-/*
-                // This is also done in the Format function, so I think
-                // this code is not necessary anymore:
-                const Size aRelSize( CalcRel( *pSz ) );
-                const SwTwips nMin = MINFLY + rAttrs.CalcLeftLine()+rAttrs.CalcRightLine();
-                long nDiff = bVert ? aRelSize.Height() : aRelSize.Width();
-                if( nDiff < nMin )
-                    nDiff = nMin;
-                nDiff -= (aFrm.*fnRect->fnGetWidth)();
-                if( nDiff )
-                {
-                    (aFrm.*fnRect->fnAddRight)( nDiff );
-                    bValidPos = FALSE;
-                }
-*/
             }
 
             if ( !bValidPrtArea )
diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx
index bd0c293..496650b 100644
--- a/sw/source/core/layout/laycache.cxx
+++ b/sw/source/core/layout/laycache.cxx
@@ -1025,59 +1025,6 @@ void SwLayHelper::_CheckFlyCache( SwPageFrm* pPage )
         SwSortedObjs &rObjs = *pPage->GetSortedObjs();
         USHORT nPgNum = pPage->GetPhyPageNum();
 
-/*
-
-        //
-        // NOTE: This code assumes that all objects have already been
-        // inserted into the drawing layout, so that the cached objects
-        // can be identified by their ordnum. Unfortunately this function
-        // is called with page n if page n+1 has been inserted. Thus
-        // not all the objects have been inserted and the ordnums cannot
-        // be used to identify the objects.
-        //
-
-        for ( USHORT i = 0; i < rObjs.Count(); ++i )  // check objects
-        {
-            SdrObject *pO = rObjs[i];
-            if ( pO->ISA(SwVirtFlyDrawObj) )  // a text frame?
-            {
-                SwFlyFrm *pFly = ((SwVirtFlyDrawObj*)pO)->GetFlyFrm();
-                if( pFly->Frm().Left() == WEIT_WECH && pFly->GetAnchor() &&
-                    !pFly->GetAnchor()->FindFooterOrHeader() )
-                {   // Only frame with default position and not in header/footer
-                    const SwContact *pC = (SwContact*)GetUserCall(pO);
-                    if( pC )
-                    {
-                        ULONG nOrdNum = pO->GetOrdNum(); // the Id
-                        SwFlyCache* pFlyC;
-                        while( nFlyIdx < nFlyCount && ( pFlyC = pImpl->
-                               GetFlyCache(nFlyIdx) )->nPageNum < nPgNum)
-                            ++nFlyIdx;
-                        if( nFlyIdx < nFlyCount &&
-                            pFlyC->nPageNum == nPgNum )
-                        {
-                            USHORT nIdx = nFlyIdx;
-                            while( nIdx < nFlyCount && ( pFlyC = pImpl->
-                                   GetFlyCache( nIdx ) )->nPageNum == nPgNum &&
-                                   pFlyC->nOrdNum != nOrdNum )
-                                ++nIdx;
-                            if( nIdx < nFlyCount && pFlyC->nPageNum == nPgNum &&
-                                pFlyC->nOrdNum == nOrdNum )
-                            {   // we get the stored information
-                                pFly->Frm().Pos().X() = pFlyC->Left() +
-                                                        pPage->Frm().Left();
-                                pFly->Frm().Pos().Y() = pFlyC->Top() +
-                                                        pPage->Frm().Top();
-                                pFly->Frm().Width( pFlyC->Width() );
-                                pFly->Frm().Height( pFlyC->Height() );
-                            }
-                        }
-                    }
-                }
-            }
-        }
- */
-
         //
         // NOTE: Here we do not use the absolute ordnums but
         // relative ordnums for the objects on this page.
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index a6c6261..b8ca66d 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -346,11 +346,7 @@ void SwPageFrm::CheckDirection( BOOL bVert )
             bVertical = 0;
         else
             bVertical = 1;
-/*
-        if( pDesc && pDesc->GetName().GetChar(0)=='x')
-            bReverse = 1;
-        else
- */
+
             bReverse = 0;
         bInvalidVert = 0;
     }
@@ -2281,11 +2277,9 @@ void SwRootFrm::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* pVi
             // first page in book mode is always special:
             if ( bFirstRow && mbBookMode )
             {
-                // --> OD 2008-04-08 #i88036#
-//                nCurrentRowWidth += pStartOfRow->Frm().Width() + nSidebarWidth;
+                // #i88036#
                 nCurrentRowWidth +=
                     pStartOfRow->GetFormatPage().Frm().Width() + nSidebarWidth;
-                // <--
             }
 
             // center page if possible
@@ -2301,10 +2295,8 @@ void SwRootFrm::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* pVi
 
             if ( bFirstRow && mbBookMode )
             {
-                // --> OD 2008-04-08 #i88036#
-//                nX += pStartOfRow->Frm().Width() + nSidebarWidth;
+                // #i88036#
                 nX += pStartOfRow->GetFormatPage().Frm().Width() + nSidebarWidth;
-                // <--
             }
 
             SwPageFrm* pEndOfRow = pPageFrm;
@@ -2455,16 +2447,6 @@ bool SwRootFrm::IsLeftToRightViewLayout() const
     // <--
 }
 
-/*const SwRect SwRootFrm::GetExtendedPageArea( USHORT nPageNumber ) const
-{
-    SwRect aRet;
-    ASSERT( nPageNumber < maPageRects.size(), "No extended page area available" )
-    if ( nPageNumber < maPageRects.size() )
-        aRet = maPageRects[ nPageNumber ];
-    return aRet;
-}*/
-
-
 const SwPageFrm& SwPageFrm::GetFormatPage() const
 {
     const SwPageFrm* pRet = this;
diff --git a/sw/source/core/layout/pagedesc.cxx b/sw/source/core/layout/pagedesc.cxx
index a95915d..374dc48 100644
--- a/sw/source/core/layout/pagedesc.cxx
+++ b/sw/source/core/layout/pagedesc.cxx
@@ -177,14 +177,9 @@ void SwPageDesc::ResetAllAttr( sal_Bool bLeft )
     // erfrage vom Modify Informationen
 BOOL SwPageDesc::GetInfo( SfxPoolItem & rInfo ) const
 {
-//    if( RES_AUTOFMT_DOCNODE == rInfo.Which() )
-//    {
-        // dann weiter zum Format
-        if( !aMaster.GetInfo( rInfo ) )
-            return FALSE;		// gefunden
-        return aLeft.GetInfo( rInfo );
-//    }
-//    return TRUE;        // weiter suchen
+    if( !aMaster.GetInfo( rInfo ) )
+        return FALSE;		// gefunden
+    return aLeft.GetInfo( rInfo );
 }
 
 /*************************************************************************
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index c67d0c6..5d9e44f 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -2894,20 +2894,6 @@ void SwRootFrm::Paint( const SwRect& rRect, const SwPrtOptions *pPrintData ) con
 
                 aPaintRect._Intersection( aRect );
 
-                // --> OD 2007-11-14 #i82616#
-                // Invalidate area for extra data (line numbers or change tracking
-                // marks), if painting on a window and the paint is trigger by an
-                // end action. The inefficient and simple enlargement of the
-                // paint area is replaced by this invalidation.
-    //            if ( bExtraData )
-    //            {
-    //                //Ja, das ist grob, aber wie macht man es besser?
-    //                SWRECTFN( pPage )
-    //                (aPaintRect.*fnRect->fnSetLeftAndWidth)(
-    //                    (pPage->Frm().*fnRect->fnGetLeft)(),
-    //                    (pPage->Frm().*fnRect->fnGetWidth)() );
-    //                aPaintRect._Intersection( pSh->VisArea() );
-    //            }
                 if ( bExtraData &&
                      pSh->GetWin() && pSh->IsInEndAction() )
                 {
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 3cc44c4..6a61f42 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -734,32 +734,6 @@ bool lcl_RecalcSplitLine( SwRowFrm& rLastLine, SwRowFrm& rFollowLine,
     }
 
     //
-    // TODO: e.g., for i71806: What shall we do if the table already
-    // exceeds its upper? I think we have to adjust the heights of the
-    // table, rLastRow and all cells in rLastRow
-    //
-    /*SwTwips nDistanceToUpperPrtBottom =
-            (rTab.Frm().*fnRect->fnBottomDist)( (rTab.GetUpper()->*fnRect->fnGetPrtBottom)());
-
-    if ( nDistanceToUpperPrtBottom < 0 )
-    {
-        (rTab.Frm().*fnRect->fnAddBottom)( nDistanceToUpperPrtBottom );
-        (rTab.Prt().*fnRect->fnAddBottom)( nDistanceToUpperPrtBottom );
-
-        (rLastLine.Frm().*fnRect->fnAddBottom)( nDistanceToUpperPrtBottom );
-        (rLastLine.Prt().*fnRect->fnAddBottom)( nDistanceToUpperPrtBottom );
-
-        SwFrm* pTmpCell = rLastLine.Lower();
-        while ( pTmpCell )
-        {
-            (pTmpCell->Frm().*fnRect->fnAddBottom)( nDistanceToUpperPrtBottom );
-            (pTmpCell->Prt().*fnRect->fnAddBottom)( nDistanceToUpperPrtBottom );
-
-            pTmpCell = pTmpCell->GetNext();
-        }
-    }*/
-
-    //
     // Do the recalculation
     //
     lcl_RecalcRow( rLastLine, LONG_MAX );
@@ -1053,9 +1027,6 @@ bool SwTabFrm::Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowKee
     bool bRet = true;
 
     SWRECTFN( this )
-    //ASSERT( bVert ? nCutPos >= Frm().Left() &&
-    //                nCutPos <= Frm().Left() + Frm().Width() :
-    //                nCutPos >= Frm().Top() && nCutPos <= Frm().Bottom(), "SplitLine out of table." );
 
     // --> OD 2004-10-14 #i26745# - format row and cell frames of table
     {
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index da786b2..17e8944 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -2030,19 +2030,6 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, BOOL bIsTblMode )
           ( !pEndPos->nNode.GetNode().IsCntntNode() ||
             !pEndPos->nNode.GetNode().GetCntntNode()->GetFrm() ) ) )
     {
-        /* For SelectAll we will need something like this later on...
-        const SwFrm* pPageFrm = GetLower();
-        while( pPageFrm )
-        {
-            SwRect aTmp( pPageFrm->Prt() );
-            aTmp.Pos() += pPageFrm->Frm().Pos();
-            Sub( aRegion, aTmp );
-            pPageFrm = pPageFrm->GetNext();
-        }
-        aRegion.Invert();
-        rCrsr.Remove( 0, rCrsr.Count() );
-        rCrsr.Insert( &aRegion, 0 );
-        */
         return;
     }
 


More information about the Libreoffice-commits mailing list