[Libreoffice-commits] .: sc/inc sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Fri Feb 11 19:38:39 PST 2011


 sc/inc/document.hxx               |    2 --
 sc/inc/table.hxx                  |    2 --
 sc/source/core/data/document.cxx  |   23 -----------------------
 sc/source/core/data/drwlayer.cxx  |    8 ++++----
 sc/source/core/data/fillinfo.cxx  |   14 +++++++-------
 sc/source/core/data/table2.cxx    |   14 +++++++-------
 sc/source/core/data/table5.cxx    |   34 ++--------------------------------
 sc/source/core/tool/chartarr.cxx  |    8 ++++----
 sc/source/filter/rtf/expbase.cxx  |    5 ++---
 sc/source/ui/app/transobj.cxx     |    7 +++----
 sc/source/ui/docshell/docfunc.cxx |    5 ++---
 sc/source/ui/undo/undoblk3.cxx    |    6 ++----
 sc/source/ui/unoobj/cellsuno.cxx  |   10 ++++------
 sc/source/ui/unoobj/chart2uno.cxx |    4 ++--
 sc/source/ui/unoobj/docuno.cxx    |    5 ++---
 sc/source/ui/view/colrowba.cxx    |    5 ++---
 sc/source/ui/view/output.cxx      |    2 +-
 sc/source/ui/view/printfun.cxx    |    3 +--
 sc/source/ui/view/tabview2.cxx    |    5 ++---
 sc/source/ui/view/tabview3.cxx    |    5 ++---
 20 files changed, 49 insertions(+), 118 deletions(-)

New commits:
commit 5ca2a313ac769b0d1b1f57d24f60172568a3b9fa
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Fri Feb 11 22:37:44 2011 -0500

    Cleaned up RowHidden() and ColHidden() calls.
    
    There were two versions of each; let's just keep one and remove the
    other.

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 75863d1..cf1afea 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -1331,9 +1331,7 @@ public:
         ::com::sun::star::sheet::TablePageBreakData> GetRowBreakData(SCTAB nTab) const;
 
     SC_DLLPUBLIC bool           RowHidden(SCROW nRow, SCTAB nTab, SCROW* pFirstRow = NULL, SCROW* pLastRow = NULL);
-    SC_DLLPUBLIC bool           RowHidden(SCROW nRow, SCTAB nTab, SCROW& rLastRow);
     SC_DLLPUBLIC bool           HasHiddenRows(SCROW nStartRow, SCROW nEndRow, SCTAB nTab);
-    SC_DLLPUBLIC bool           ColHidden(SCCOL nCol, SCTAB nTab, SCCOL& rLastCol);
     SC_DLLPUBLIC bool           ColHidden(SCCOL nCol, SCTAB nTab, SCCOL* pFirstCol = NULL, SCCOL* pLastCol = NULL);
     SC_DLLPUBLIC void           SetRowHidden(SCROW nStartRow, SCROW nEndRow, SCTAB nTab, bool bHidden);
     SC_DLLPUBLIC void           SetColHidden(SCCOL nStartCol, SCCOL nEndCol, SCTAB nTab, bool bHidden);
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index db5d893..4d57826 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -727,9 +727,7 @@ public:
         ::com::sun::star::sheet::TablePageBreakData> GetRowBreakData() const;
 
     bool        RowHidden(SCROW nRow, SCROW* pFirstRow = NULL, SCROW* pLastRow = NULL) const;
-    bool        RowHidden(SCROW nRow, SCROW& rLastRow) const;
     bool        HasHiddenRows(SCROW nStartRow, SCROW nEndRow) const;
-    bool        ColHidden(SCCOL nCol, SCCOL& rLastCol) const;
     bool        ColHidden(SCCOL nCol, SCCOL* pFirstCol = NULL, SCCOL* pLastCol = NULL) const;
     bool        SetRowHidden(SCROW nStartRow, SCROW nEndRow, bool bHidden);
     bool        SetColHidden(SCCOL nStartCol, SCCOL nEndCol, bool bHidden);
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index b92ecaf..ec0a12a 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -3610,18 +3610,6 @@ bool ScDocument::RowHidden(SCROW nRow, SCTAB nTab, SCROW* pFirstRow, SCROW* pLas
     return pTab[nTab]->RowHidden(nRow, pFirstRow, pLastRow);
 }
 
-bool ScDocument::RowHidden(SCROW nRow, SCTAB nTab, SCROW& rLastRow)
-{
-    if (!ValidTab(nTab) || !pTab[nTab])
-    {
-        rLastRow = nRow;
-        return false;
-    }
-
-    return pTab[nTab]->RowHidden(nRow, rLastRow);
-}
-
-
 bool ScDocument::HasHiddenRows(SCROW nStartRow, SCROW nEndRow, SCTAB nTab)
 {
     if (!ValidTab(nTab) || !pTab[nTab])
@@ -3630,17 +3618,6 @@ bool ScDocument::HasHiddenRows(SCROW nStartRow, SCROW nEndRow, SCTAB nTab)
     return pTab[nTab]->HasHiddenRows(nStartRow, nEndRow);
 }
 
-bool ScDocument::ColHidden(SCCOL nCol, SCTAB nTab, SCCOL& rLastCol)
-{
-    if (!ValidTab(nTab) || !pTab[nTab])
-    {
-        rLastCol = nCol;
-        return false;
-    }
-
-    return pTab[nTab]->ColHidden(nCol, rLastCol);
-}
-
 bool ScDocument::ColHidden(SCCOL nCol, SCTAB nTab, SCCOL* pFirstCol, SCCOL* pLastCol)
 {
     if (!ValidTab(nTab) || !pTab[nTab])
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index 133e158..57d31d9 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -650,9 +650,9 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, ScDrawObjData& rData, bool bNegati
         if( bValid1 )
         {
             Point aPos( pDoc->GetColOffset( nCol1, nTab1 ), pDoc->GetRowOffset( nRow1, nTab1 ) );
-            if (!pDoc->ColHidden(nCol1, nTab1, nLastCol))
+            if (!pDoc->ColHidden(nCol1, nTab1, NULL, &nLastCol))
                 aPos.X() += pDoc->GetColWidth( nCol1, nTab1 ) / 4;
-            if (!pDoc->RowHidden(nRow1, nTab1, nLastRow))
+            if (!pDoc->RowHidden(nRow1, nTab1, NULL, &nLastRow))
                 aPos.Y() += pDoc->GetRowHeight( nRow1, nTab1 ) / 2;
             TwipsToMM( aPos.X() );
             TwipsToMM( aPos.Y() );
@@ -688,9 +688,9 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, ScDrawObjData& rData, bool bNegati
         if( bValid2 )
         {
             Point aPos( pDoc->GetColOffset( nCol2, nTab2 ), pDoc->GetRowOffset( nRow2, nTab2 ) );
-            if (!pDoc->ColHidden(nCol2, nTab2, nLastCol))
+            if (!pDoc->ColHidden(nCol2, nTab2, NULL, &nLastCol))
                 aPos.X() += pDoc->GetColWidth( nCol2, nTab2 ) / 4;
-            if (!pDoc->RowHidden(nRow2, nTab2, nLastRow))
+            if (!pDoc->RowHidden(nRow2, nTab2, NULL, &nLastRow))
                 aPos.Y() += pDoc->GetRowHeight( nRow2, nTab2 ) / 2;
             TwipsToMM( aPos.X() );
             TwipsToMM( aPos.Y() );
diff --git a/sc/source/core/data/fillinfo.cxx b/sc/source/core/data/fillinfo.cxx
index 0bd0da8..899c527 100644
--- a/sc/source/core/data/fillinfo.cxx
+++ b/sc/source/core/data/fillinfo.cxx
@@ -103,7 +103,7 @@ void lcl_GetMergeRange( SCsCOL nX, SCsROW nY, SCSIZE nArrY,
     while (bHOver)				// nY konstant
     {
         --rStartX;
-        if (rStartX >= (SCsCOL) nX1 && !pDoc->ColHidden(rStartX, nTab, nLastCol))
+        if (rStartX >= (SCsCOL) nX1 && !pDoc->ColHidden(rStartX, nTab, NULL, &nLastCol))
         {
             bHOver = pRowInfo[nArrY].pCellInfo[rStartX+1].bHOverlapped;
             bVOver = pRowInfo[nArrY].pCellInfo[rStartX+1].bVOverlapped;
@@ -125,8 +125,8 @@ void lcl_GetMergeRange( SCsCOL nX, SCsROW nY, SCSIZE nArrY,
             --nArrY;						// lokale Kopie !
 
         if (rStartX >= (SCsCOL) nX1 && rStartY >= (SCsROW) nY1 &&
-            !pDoc->ColHidden(rStartX, nTab, nLastCol) &&
-            !pDoc->RowHidden(rStartY, nTab, nLastRow) &&
+            !pDoc->ColHidden(rStartX, nTab, NULL, &nLastCol) &&
+            !pDoc->RowHidden(rStartY, nTab, NULL, &nLastRow) &&
             (SCsROW) pRowInfo[nArrY].nRowNo == rStartY)
         {
             bHOver = pRowInfo[nArrY].pCellInfo[rStartX+1].bHOverlapped;
@@ -143,8 +143,8 @@ void lcl_GetMergeRange( SCsCOL nX, SCsROW nY, SCSIZE nArrY,
 
     const ScMergeAttr* pMerge;
     if (rStartX >= (SCsCOL) nX1 && rStartY >= (SCsROW) nY1 &&
-        !pDoc->ColHidden(rStartX, nTab, nLastCol) &&
-        !pDoc->RowHidden(rStartY, nTab, nLastRow) &&
+        !pDoc->ColHidden(rStartX, nTab, NULL, &nLastCol) &&
+        !pDoc->RowHidden(rStartY, nTab, NULL, &nLastRow) &&
         (SCsROW) pRowInfo[nArrY].nRowNo == rStartY)
     {
         pMerge = (const ScMergeAttr*) &pRowInfo[nArrY].pCellInfo[rStartX+1].pPatternAttr->
@@ -396,7 +396,7 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX
                         (nThisRow=pThisCol->pItems[nUIndex].nRow) <= nY2 )
                 {
                     if (nThisRow > nHiddenEndRow)
-                        bHiddenRow = RowHidden( nThisRow, nTab, nHiddenEndRow);
+                        bHiddenRow = RowHidden( nThisRow, nTab, NULL, &nHiddenEndRow);
                     if ( !bHiddenRow )
                     {
                         while ( pRowInfo[nArrY].nRowNo < nThisRow )
@@ -487,7 +487,7 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX
                         do
                         {
                             SCROW nLastHiddenRow = -1;
-                            bool bRowHidden = RowHidden(nCurRow, nTab, nLastHiddenRow);
+                            bool bRowHidden = RowHidden(nCurRow, nTab, NULL, &nLastHiddenRow);
                             if ( nArrY==0 || !bRowHidden )
                             {
                                 RowInfo* pThisRowInfo = &pRowInfo[nArrY];
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index ebe1683..572fb76 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -2391,7 +2391,7 @@ ULONG ScTable::GetRowHeight( SCROW nStartRow, SCROW nEndRow ) const
         while (nRow <= nEndRow)
         {
             SCROW nLastRow = -1;
-            if (!RowHidden(nRow, nLastRow))
+            if (!RowHidden(nRow, NULL, &nLastRow))
             {
                 if (nLastRow > nEndRow)
                     nLastRow = nEndRow;
@@ -2417,7 +2417,7 @@ ULONG ScTable::GetScaledRowHeight( SCROW nStartRow, SCROW nEndRow, double fScale
         while (nRow <= nEndRow)
         {
             SCROW nLastRow = -1;
-            if (!RowHidden(nRow, nLastRow))
+            if (!RowHidden(nRow, NULL, &nLastRow))
             {
                 if (nLastRow > nEndRow)
                     nLastRow = nEndRow;
@@ -2453,7 +2453,7 @@ SCROW ScTable::GetHiddenRowCount( SCROW nRow )
         return 0;
 
     SCROW nLastRow = -1;
-    if (!RowHidden(nRow, nLastRow) || !ValidRow(nLastRow))
+    if (!RowHidden(nRow, NULL, &nLastRow) || !ValidRow(nLastRow))
         return 0;
 
     return nLastRow - nRow + 1;
@@ -2549,7 +2549,7 @@ void ScTable::DBShowRows(SCROW nRow1, SCROW nRow2, bool bShow)
     while (nStartRow <= nRow2)
     {
         SCROW nEndRow = -1;
-        bool bWasVis = !RowHidden(nStartRow, nEndRow);
+        bool bWasVis = !RowHidden(nStartRow, NULL, &nEndRow);
         if (nEndRow > nRow2)
             nEndRow = nRow2;
 
@@ -2589,7 +2589,7 @@ void ScTable::ShowRows(SCROW nRow1, SCROW nRow2, bool bShow)
     while (nStartRow <= nRow2)
     {
         SCROW nEndRow = -1;
-        bool bWasVis = !RowHidden(nStartRow, nEndRow);
+        bool bWasVis = !RowHidden(nStartRow, NULL, &nEndRow);
         if (nEndRow > nRow2)
             nEndRow = nRow2;
 
@@ -2783,7 +2783,7 @@ void ScTable::ExtendHidden( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2 )
     if (rY2 < MAXROW)
     {
         SCROW nEndRow = -1;
-        if (RowHidden(rY2+1, nEndRow) && ValidRow(nEndRow))
+        if (RowHidden(rY2+1, NULL, &nEndRow) && ValidRow(nEndRow))
             rY2 = nEndRow;
     }
 }
@@ -2810,7 +2810,7 @@ void ScTable::StripHidden( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2 )
     if (rY1 < rY2)
     {
         SCROW nEndRow = -1;
-        if (RowHidden(rY1, nEndRow) && ValidRow(nEndRow) && nEndRow <= rY2)
+        if (RowHidden(rY1, NULL, &nEndRow) && ValidRow(nEndRow) && nEndRow <= rY2)
             rY1 = nEndRow;
     }
 }
diff --git a/sc/source/core/data/table5.cxx b/sc/source/core/data/table5.cxx
index 66cbe27..e85943f 100644
--- a/sc/source/core/data/table5.cxx
+++ b/sc/source/core/data/table5.cxx
@@ -540,29 +540,13 @@ bool ScTable::RowHidden(SCROW nRow, SCROW* pFirstRow, SCROW* pLastRow) const
     return aData.mbValue;
 }
 
-
-bool ScTable::RowHidden(SCROW nRow, SCROW& rLastRow) const
-{
-    rLastRow = nRow;    
-    if (!ValidRow(nRow))
-        return true;
-
-    ScFlatBoolRowSegments::RangeData aData;
-    if (!mpHiddenRows->getRangeData(nRow, aData))
-        // search failed.
-        return true;
-
-    rLastRow = aData.mnRow2;
-    return aData.mbValue;
-}
-
 bool ScTable::HasHiddenRows(SCROW nStartRow, SCROW nEndRow) const
 {
     SCROW nRow = nStartRow;
     while (nRow <= nEndRow)
     {
         SCROW nLastRow = -1;
-        bool bHidden = RowHidden(nRow, nLastRow);
+        bool bHidden = RowHidden(nRow, NULL, &nLastRow);
         if (bHidden)
             return true;
 
@@ -571,20 +555,6 @@ bool ScTable::HasHiddenRows(SCROW nStartRow, SCROW nEndRow) const
     return false;
 }
 
-bool ScTable::ColHidden(SCCOL nCol, SCCOL& rLastCol) const
-{
-    rLastCol = nCol;    
-    if (!ValidCol(nCol))
-        return true;
-
-    ScFlatBoolColSegments::RangeData aData;
-    if (!mpHiddenCols->getRangeData(nCol, aData))
-        return true;
-
-    rLastCol = aData.mnCol2;
-    return aData.mbValue;
-}
-
 bool ScTable::ColHidden(SCCOL nCol, SCCOL* pFirstCol, SCCOL* pLastCol) const
 {
     if (!ValidCol(nCol))
@@ -645,7 +615,7 @@ void ScTable::CopyRowHidden(ScTable& rTable, SCROW nStartRow, SCROW nEndRow)
     while (nRow <= nEndRow)
     {
         SCROW nLastRow = -1;
-        bool bHidden = rTable.RowHidden(nRow, nLastRow);
+        bool bHidden = rTable.RowHidden(nRow, NULL, &nLastRow);
         if (nLastRow > nEndRow)
             nLastRow = nEndRow;
         SetRowHidden(nRow, nLastRow, bHidden);
diff --git a/sc/source/core/tool/chartarr.cxx b/sc/source/core/tool/chartarr.cxx
index 78764f7..f1ce8af 100644
--- a/sc/source/core/tool/chartarr.cxx
+++ b/sc/source/core/tool/chartarr.cxx
@@ -170,12 +170,12 @@ ScMemChart* ScChartArray::CreateMemChartSingle()
     // Skip hidden columns.
     // TODO: make use of last column value once implemented.
     SCCOL nLastCol = -1;
-    while (pDocument->ColHidden(nCol1, nTab1, nLastCol))
+    while (pDocument->ColHidden(nCol1, nTab1, NULL, &nLastCol))
         ++nCol1;
 
     // Skip hidden rows.
     SCROW nLastRow = -1;
-    if (pDocument->RowHidden(nRow1, nTab1, nLastRow))
+    if (pDocument->RowHidden(nRow1, nTab1, NULL, &nLastRow))
         nRow1 = nLastRow + 1;
 
     // falls alles hidden ist, bleibt die Beschriftung am Anfang
@@ -196,7 +196,7 @@ ScMemChart* ScChartArray::CreateMemChartSingle()
     for (SCSIZE i=0; i<nTotalCols; i++)
     {
         SCCOL nThisCol = sal::static_int_cast<SCCOL>(nCol1+i);
-        if (!pDocument->ColHidden(nThisCol, nTab1, nLastCol))
+        if (!pDocument->ColHidden(nThisCol, nTab1, NULL, &nLastCol))
             aCols.push_back(nThisCol);
     }
     SCSIZE nColCount = aCols.size();
@@ -210,7 +210,7 @@ ScMemChart* ScChartArray::CreateMemChartSingle()
         SCROW nThisRow = nRow1;
         while (nThisRow <= nRow2)
         {
-            if (pDocument->RowHidden(nThisRow, nTab1, nLastRow))
+            if (pDocument->RowHidden(nThisRow, nTab1, NULL, &nLastRow))
                 nThisRow = nLastRow;
             else
                 aRows.push_back(nThisRow);
diff --git a/sc/source/filter/rtf/expbase.cxx b/sc/source/filter/rtf/expbase.cxx
index fd7e0f9..d512f4b 100644
--- a/sc/source/filter/rtf/expbase.cxx
+++ b/sc/source/filter/rtf/expbase.cxx
@@ -76,10 +76,9 @@ BOOL ScExportBase::GetDataArea( SCTAB nTab, SCCOL& nStartCol,
 BOOL ScExportBase::TrimDataArea( SCTAB nTab, SCCOL& nStartCol,
             SCROW& nStartRow, SCCOL& nEndCol, SCROW& nEndRow ) const
 {
-    SCCOL nLastCol;
-    while ( nStartCol <= nEndCol && pDoc->ColHidden(nStartCol, nTab, nLastCol))
+    while ( nStartCol <= nEndCol && pDoc->ColHidden(nStartCol, nTab))
         ++nStartCol;
-    while ( nStartCol <= nEndCol && pDoc->ColHidden(nEndCol, nTab, nLastCol))
+    while ( nStartCol <= nEndCol && pDoc->ColHidden(nEndCol, nTab))
         --nEndCol;
     nStartRow = pDoc->FirstVisibleRow(nStartRow, nEndRow, nTab);
     nEndRow = pDoc->LastVisibleRow(nStartRow, nEndRow, nTab);
diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index 20323b2..d2c79be 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -607,11 +607,11 @@ void ScTransferObj::InitDocShell()
         //	widths / heights
         //	(must be copied before CopyFromClip, for drawing objects)
 
-        SCCOL nCol, nLastCol;
+        SCCOL nCol;
         SCTAB nSrcTab = aBlock.aStart.Tab();
         pDestDoc->SetLayoutRTL(0, pDoc->IsLayoutRTL(nSrcTab));
         for (nCol=nStartX; nCol<=nEndX; nCol++)
-            if ( pDoc->ColHidden(nCol, nSrcTab, nLastCol) )
+            if ( pDoc->ColHidden(nCol, nSrcTab) )
                 pDestDoc->ShowCol( nCol, 0, FALSE );
             else
                 pDestDoc->SetColWidth( nCol, 0, pDoc->GetColWidth( nCol, nSrcTab ) );
@@ -622,8 +622,7 @@ void ScTransferObj::InitDocShell()
         for (SCROW nRow = nStartY; nRow <= nEndY; ++nRow)
         {
             BYTE nSourceFlags = pDoc->GetRowFlags(nRow, nSrcTab);
-            SCROW nLastRow = -1;
-            if ( pDoc->RowHidden(nRow, nSrcTab, nLastRow) )
+            if ( pDoc->RowHidden(nRow, nSrcTab) )
                 pDestDoc->ShowRow( nRow, 0, FALSE );
             else
             {
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 0fe04f7..50054ec 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -3189,7 +3189,7 @@ BOOL ScDocFunc::SetWidthOrHeight( BOOL bWidth, SCCOLROW nRangeCnt, SCCOLROW* pRa
                     {
                         BYTE nOld = pDoc->GetRowFlags(nRow,nTab);
                         SCROW nLastRow = -1;
-                        bool bHidden = pDoc->RowHidden(nRow, nTab, nLastRow);
+                        bool bHidden = pDoc->RowHidden(nRow, nTab, NULL, &nLastRow);
                         if ( !bHidden && ( nOld & CR_MANUALSIZE ) )
                             pDoc->SetRowFlags( nRow, nTab, nOld & ~CR_MANUALSIZE );
                     }
@@ -3225,8 +3225,7 @@ BOOL ScDocFunc::SetWidthOrHeight( BOOL bWidth, SCCOLROW nRangeCnt, SCCOLROW* pRa
         {
             for (SCCOL nCol=static_cast<SCCOL>(nStartNo); nCol<=static_cast<SCCOL>(nEndNo); nCol++)
             {
-                SCCOL nLastCol = -1;
-                if ( eMode != SC_SIZE_VISOPT || !pDoc->ColHidden(nCol, nTab, nLastCol) )
+                if ( eMode != SC_SIZE_VISOPT || !pDoc->ColHidden(nCol, nTab) )
                 {
                     USHORT nThisSize = nSizeTwips;
 
diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx
index 9a9e42d..236afeb 100644
--- a/sc/source/ui/undo/undoblk3.cxx
+++ b/sc/source/ui/undo/undoblk3.cxx
@@ -1081,20 +1081,18 @@ void ScUndoAutoFormat::Redo()
             aDestMark.MarkToMulti();
 
             // wie SC_SIZE_VISOPT
-            SCROW nLastRow = -1;
             for (SCROW nRow=nStartY; nRow<=nEndY; nRow++)
             {
                 BYTE nOld = pDoc->GetRowFlags(nRow,nTab);
-                bool bHidden = pDoc->RowHidden(nRow, nTab, nLastRow);
+                bool bHidden = pDoc->RowHidden(nRow, nTab);
                 if ( !bHidden && ( nOld & CR_MANUALSIZE ) )
                     pDoc->SetRowFlags( nRow, nTab, nOld & ~CR_MANUALSIZE );
             }
             pDoc->SetOptimalHeight( nStartY, nEndY, nTab, 0, &aVirtDev,
                                         nPPTX, nPPTY, aZoomX, aZoomY, FALSE );
 
-            SCCOL nLastCol = -1;
             for (SCCOL nCol=nStartX; nCol<=nEndX; nCol++)
-                if (!pDoc->ColHidden(nCol, nTab, nLastCol))
+                if (!pDoc->ColHidden(nCol, nTab))
                 {
                     USHORT nThisSize = STD_EXTRA_WIDTH + pDoc->GetOptimalColWidth( nCol, nTab,
                                                 &aVirtDev, nPPTX, nPPTY, aZoomX, aZoomY, bFormula,
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 7ec7dfd..3157788 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -3393,7 +3393,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryVisibleC
         SCCOL nCol = 0, nLastCol;
         while (nCol <= MAXCOL)
         {
-            if (pDoc->ColHidden(nCol, nTab, nLastCol))
+            if (pDoc->ColHidden(nCol, nTab, NULL, &nLastCol))
                 // hidden columns.  Unselect them.
                 aMarkData.SetMultiMarkArea(ScRange(nCol, 0, nTab, nLastCol, MAXROW, nTab), false);
 
@@ -3403,7 +3403,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryVisibleC
         SCROW nRow = 0, nLastRow;
         while (nRow <= MAXROW)
         {
-            if (pDoc->RowHidden(nRow, nTab, nLastRow))
+            if (pDoc->RowHidden(nRow, nTab, NULL, &nLastRow))
                 // These rows are hidden.  Unselect them.
                 aMarkData.SetMultiMarkArea(ScRange(0, nRow, nTab, MAXCOL, nLastRow, nTab), false);
 
@@ -8851,8 +8851,7 @@ void ScTableColumnObj::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pE
         }
         else if ( pEntry->nWID == SC_WID_UNO_CELLVIS )
         {
-            SCCOL nDummy;
-            bool bHidden = pDoc->ColHidden(nCol, nTab, nDummy);
+            bool bHidden = pDoc->ColHidden(nCol, nTab);
             ScUnoHelpFunctions::SetBoolInAny( rAny, !bHidden );
         }
         else if ( pEntry->nWID == SC_WID_UNO_OWIDTH )
@@ -9005,8 +9004,7 @@ void ScTableRowObj::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntr
         }
         else if ( pEntry->nWID == SC_WID_UNO_CELLVIS )
         {
-            SCROW nDummy;
-            bool bHidden = pDoc->RowHidden(nRow, nTab, nDummy);
+            bool bHidden = pDoc->RowHidden(nRow, nTab);
             ScUnoHelpFunctions::SetBoolInAny( rAny, !bHidden );
         }
         else if ( pEntry->nWID == SC_WID_UNO_CELLFILT )
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index 23035b5..1ba53a9 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -2456,8 +2456,8 @@ void ScChart2DataSequence::BuildDataCache()
                 {
                     for (SCROW nRow = aRange.aStart.Row(); nRow <= aRange.aEnd.Row(); ++nRow)
                     {
-                        bool bColHidden = m_pDocument->ColHidden(nCol, nTab, nLastCol);
-                        bool bRowHidden = m_pDocument->RowHidden(nRow, nTab, nLastRow);
+                        bool bColHidden = m_pDocument->ColHidden(nCol, nTab, NULL, &nLastCol);
+                        bool bRowHidden = m_pDocument->RowHidden(nRow, nTab, NULL, &nLastRow);
 
                         if (bColHidden || bRowHidden)
                         {
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 1b56b70..ef8c939 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -3003,8 +3003,7 @@ uno::Any SAL_CALL ScTableColumnsObj::getPropertyValue( const rtl::OUString& aPro
     }
     else if ( aNameString.EqualsAscii( SC_UNONAME_CELLVIS ) )
     {
-        SCCOL nLastCol;
-        bool bVis = !pDoc->ColHidden(nStartCol, nTab, nLastCol);
+        bool bVis = !pDoc->ColHidden(nStartCol, nTab);
         ScUnoHelpFunctions::SetBoolInAny( aAny, bVis );
     }
     else if ( aNameString.EqualsAscii( SC_UNONAME_OWIDTH ) )
@@ -3266,7 +3265,7 @@ uno::Any SAL_CALL ScTableRowsObj::getPropertyValue( const rtl::OUString& aProper
     else if ( aNameString.EqualsAscii( SC_UNONAME_CELLVIS ) )
     {
         SCROW nLastRow;
-        bool bVis = !pDoc->RowHidden(nStartRow, nTab, nLastRow);
+        bool bVis = !pDoc->RowHidden(nStartRow, nTab, NULL, &nLastRow);
         ScUnoHelpFunctions::SetBoolInAny( aAny, bVis );
     }
     else if ( aNameString.EqualsAscii( SC_UNONAME_CELLFILT ) )
diff --git a/sc/source/ui/view/colrowba.cxx b/sc/source/ui/view/colrowba.cxx
index ec55d54..eab580c 100644
--- a/sc/source/ui/view/colrowba.cxx
+++ b/sc/source/ui/view/colrowba.cxx
@@ -99,8 +99,7 @@ USHORT ScColBar::GetEntrySize( SCCOLROW nEntryNo )
 {
     ScDocument* pDoc = pViewData->GetDocument();
     SCTAB nTab = pViewData->GetTabNo();
-    SCCOL nLastCol = -1;
-    if (pDoc->ColHidden(static_cast<SCCOL>(nEntryNo), nTab, nLastCol))
+    if (pDoc->ColHidden(static_cast<SCCOL>(nEntryNo), nTab))
         return 0;
     else
         return (USHORT) ScViewData::ToPixel( pDoc->GetColWidth( static_cast<SCCOL>(nEntryNo), nTab ), pViewData->GetPPTX() );
@@ -266,7 +265,7 @@ USHORT ScRowBar::GetEntrySize( SCCOLROW nEntryNo )
     ScDocument* pDoc = pViewData->GetDocument();
     SCTAB nTab = pViewData->GetTabNo();
     SCROW nLastRow = -1;
-    if (pDoc->RowHidden(nEntryNo, nTab, nLastRow))
+    if (pDoc->RowHidden(nEntryNo, nTab, NULL, &nLastRow))
         return 0;
     else
         return (USHORT) ScViewData::ToPixel( pDoc->GetOriginalHeight( nEntryNo,
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 388b1cf..1b843e6 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -487,7 +487,7 @@ void ScOutputData::DrawGrid( BOOL bGrid, BOOL bPage )
                 for (SCROW i = nYplus1; i <= MAXROW; ++i)
                 {
                     if (i > nHiddenEndRow)
-                        bHiddenRow = pDoc->RowHidden(i, nTab, nHiddenEndRow);
+                        bHiddenRow = pDoc->RowHidden(i, nTab, NULL, &nHiddenEndRow);
                     /* TODO: optimize the row break thing for large hidden 
                      * segments where HasRowBreak() has to be called 
                      * nevertheless for each row, as a row break is drawn also 
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index a173b4f..5ad67a2 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -3045,10 +3045,9 @@ void ScPrintFunc::CalcPages()               // berechnet aPageRect und Seiten au
     nTotalY = 0;
 
     bool bVisCol = false;
-    SCCOL nLastCol = -1;
     for (SCCOL i=nStartCol; i<=nEndCol; i++)
     {
-        bool bHidden = pDoc->ColHidden(i, nPrintTab, nLastCol);
+        bool bHidden = pDoc->ColHidden(i, nPrintTab);
         bool bPageBreak = (pDoc->HasColBreak(i, nPrintTab) & BREAK_PAGE);
         if ( i>nStartCol && bVisCol && bPageBreak )
         {
diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx
index 674ccd6..3bc9a82 100644
--- a/sc/source/ui/view/tabview2.cxx
+++ b/sc/source/ui/view/tabview2.cxx
@@ -484,8 +484,7 @@ void ScTabView::SkipCursorHorizontal(SCsCOL& rCurX, SCsROW& rCurY, SCsCOL nOldX,
     bool bHFlip = false;
     do
     {
-        SCCOL nLastCol = -1;
-        bSkipCell = pDoc->ColHidden(rCurX, nTab, nLastCol) || pDoc->IsHorOverlapped(rCurX, rCurY, nTab);
+        bSkipCell = pDoc->ColHidden(rCurX, nTab) || pDoc->IsHorOverlapped(rCurX, rCurY, nTab);
         if (bSkipProtected && !bSkipCell)
             bSkipCell = pDoc->HasAttrib(rCurX, rCurY, nTab, rCurX, rCurY, nTab, HASATTR_PROTECTED);
         if (bSkipUnprotected && !bSkipCell)
@@ -545,7 +544,7 @@ void ScTabView::SkipCursorVertical(SCsCOL& rCurX, SCsROW& rCurY, SCsROW nOldY, S
     do
     {
         SCROW nLastRow = -1;
-        bSkipCell = pDoc->RowHidden(rCurY, nTab, nLastRow) || pDoc->IsVerOverlapped( rCurX, rCurY, nTab );
+        bSkipCell = pDoc->RowHidden(rCurY, nTab, NULL, &nLastRow) || pDoc->IsVerOverlapped( rCurX, rCurY, nTab );
         if (bSkipProtected && !bSkipCell)
             bSkipCell = pDoc->HasAttrib(rCurX, rCurY, nTab, rCurX, rCurY, nTab, HASATTR_PROTECTED);
         if (bSkipUnprotected && !bSkipCell)
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 9bd3e51..127ba9e 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -1973,13 +1973,12 @@ void ScTabView::PaintRangeFinder( long nNumber )
                             BOOL bHiddenEdge = FALSE;
                             SCROW nTmp;
                             ScDocument* pDoc = aViewData.GetDocument();
-                            SCCOL nLastCol = -1;
-                            while ( nCol1 > 0 && pDoc->ColHidden(nCol1, nTab, nLastCol) )
+                            while ( nCol1 > 0 && pDoc->ColHidden(nCol1, nTab) )
                             {
                                 --nCol1;
                                 bHiddenEdge = TRUE;
                             }
-                            while ( nCol2 < MAXCOL && pDoc->ColHidden(nCol2, nTab, nLastCol) )
+                            while ( nCol2 < MAXCOL && pDoc->ColHidden(nCol2, nTab) )
                             {
                                 ++nCol2;
                                 bHiddenEdge = TRUE;


More information about the Libreoffice-commits mailing list