[ooo-build-commit] patches/test
Kohei Yoshida
kohei at kemper.freedesktop.org
Fri May 29 11:55:46 PDT 2009
patches/test/calc-perf-table-hidden-flags.diff | 475 +++++--------------------
1 file changed, 101 insertions(+), 374 deletions(-)
New commits:
commit 1045372e3da6c26b62e4afeea417532bb065bdc0
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Fri May 29 14:54:17 2009 -0400
Cleaned up the code & fixed lots of regressions.
* patches/test/calc-perf-table-hidden-flags.diff: backup patch.
diff --git a/patches/test/calc-perf-table-hidden-flags.diff b/patches/test/calc-perf-table-hidden-flags.diff
index 16de0cb..2d06c15 100644
--- a/patches/test/calc-perf-table-hidden-flags.diff
+++ b/patches/test/calc-perf-table-hidden-flags.diff
@@ -16,7 +16,7 @@ index 0f9586e..e5901fd 100644
void CopyToColumn(SCROW nRow1, SCROW nRow2, USHORT nFlags, BOOL bMarked,
diff --git sc/inc/document.hxx sc/inc/document.hxx
-index b016e1e..500f4e5 100644
+index b016e1e..f50be06 100644
--- sc/inc/document.hxx
+++ sc/inc/document.hxx
@@ -433,9 +433,6 @@ private:
@@ -45,7 +45,7 @@ index b016e1e..500f4e5 100644
/** No check for flags whether row is hidden, height value
is returned unconditionally. */
inline USHORT FastGetOriginalRowHeight( SCROW nRow, SCTAB nTab ) const;
-@@ -1312,6 +1307,18 @@ public:
+@@ -1312,6 +1307,17 @@ public:
::com::sun::star::uno::Sequence<
::com::sun::star::sheet::TablePageBreakData> GetRowBreakData(SCTAB nTab) const;
@@ -59,12 +59,11 @@ index b016e1e..500f4e5 100644
+ SC_DLLPUBLIC SCROW FirstVisibleRow(SCROW nStartRow, SCROW nEndRow, SCTAB nTab);
+ SC_DLLPUBLIC SCROW LastVisibleRow(SCROW nStartRow, SCROW nEndRow, SCTAB nTab);
+ SCROW CountVisibleRows(SCROW nStartRow, SCROW nEndRow, SCTAB nTab);
-+ sal_uInt32 GetTotalRowHeight(SCROW nStartRow, SCROW nEndRow, SCTAB nTab);
+
/**
* Write all column row flags to table's flag data, because not all column
* row attributes are stored in the flag data members. This is necessary
-@@ -1806,42 +1813,18 @@ inline void ScDocument::SetSortParam( ScSortParam& rParam, SCTAB nTab )
+@@ -1806,42 +1812,18 @@ inline void ScDocument::SetSortParam( ScSortParam& rParam, SCTAB nTab )
inline ULONG ScDocument::FastGetScaledRowHeight( SCROW nStartRow, SCROW nEndRow,
SCTAB nTab, double fScale ) const
{
@@ -454,7 +453,7 @@ index aa2164e..6ceb1cd 100644
rStartRow = nRow;
}
diff --git sc/source/core/data/document.cxx sc/source/core/data/document.cxx
-index 98001ef..e5ac2ba 100644
+index 98001ef..e29716d 100644
--- sc/source/core/data/document.cxx
+++ sc/source/core/data/document.cxx
@@ -100,6 +100,7 @@
@@ -475,7 +474,7 @@ index 98001ef..e5ac2ba 100644
}
ULONG ScDocument::GetScaledRowHeight( SCROW nStartRow, SCROW nEndRow,
-@@ -3279,6 +3279,106 @@ Sequence<TablePageBreakData> ScDocument::GetRowBreakData(SCTAB nTab) const
+@@ -3279,6 +3279,98 @@ Sequence<TablePageBreakData> ScDocument::GetRowBreakData(SCTAB nTab) const
return pTab[nTab]->GetRowBreakData();
}
@@ -571,14 +570,6 @@ index 98001ef..e5ac2ba 100644
+ return pTab[nTab]->CountVisibleRows(nStartRow, nEndRow);
+}
+
-+sal_uInt32 ScDocument::GetTotalRowHeight(SCROW nStartRow, SCROW nEndRow, SCTAB nTab)
-+{
-+ if (!ValidTab(nTab) || !pTab[nTab])
-+ return 0;
-+
-+ return pTab[nTab]->GetTotalRowHeight(nStartRow, nEndRow);
-+}
-+
void ScDocument::SyncColRowFlags()
{
for (SCTAB i = 0; i <= nMaxTableNumber; ++i)
@@ -1012,60 +1003,10 @@ index 9b2c376..dd4f48a 100644
ScBaseCell* pCell = aCol[nDataCol].GetCell(nRow);
if (pCell)
diff --git sc/source/core/data/table2.cxx sc/source/core/data/table2.cxx
-index 637e2b2..659af98 100644
+index 637e2b2..dbb9642 100644
--- sc/source/core/data/table2.cxx
+++ sc/source/core/data/table2.cxx
-@@ -64,6 +64,49 @@
-
- #include <math.h>
-
-+
-+#include <stdio.h>
-+#include <string>
-+#include <sys/time.h>
-+
-+namespace {
-+
-+class StackPrinter
-+{
-+public:
-+ explicit StackPrinter(const char* msg) :
-+ msMsg(msg)
-+ {
-+ fprintf(stdout, "%s: --begin\n", msMsg.c_str());
-+ mfStartTime = getTime();
-+ }
-+
-+ ~StackPrinter()
-+ {
-+ double fEndTime = getTime();
-+ fprintf(stdout, "%s: --end (duration: %g sec)\n", msMsg.c_str(), (fEndTime-mfStartTime));
-+ }
-+
-+ void printTime(int line) const
-+ {
-+ double fEndTime = getTime();
-+ fprintf(stdout, "%s: --(%d) (duration: %g sec)\n", msMsg.c_str(), line, (fEndTime-mfStartTime));
-+ }
-+
-+private:
-+ double getTime() const
-+ {
-+ timeval tv;
-+ gettimeofday(&tv, NULL);
-+ return tv.tv_sec + tv.tv_usec / 1000000.0;
-+ }
-+
-+ ::std::string msMsg;
-+ double mfStartTime;
-+};
-+
-+}
-+
- // STATIC DATA -----------------------------------------------------------
-
-
-@@ -353,20 +396,20 @@ void ScTable::CopyToClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
+@@ -353,20 +353,20 @@ void ScTable::CopyToClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
// copy widths/heights, and only "hidden", "filtered" and "manual" flags
// also for all preceding columns/rows, to have valid positions for drawing objects
@@ -1091,7 +1032,7 @@ index 637e2b2..659af98 100644
// ggf. Formeln durch Werte ersetzen
-@@ -646,10 +689,12 @@ void ScTable::CopyToTable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
+@@ -646,10 +646,12 @@ void ScTable::CopyToTable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
if (nRow1==0 && nRow2==MAXROW && pColWidth && pDestTab->pColWidth)
for (SCCOL i=nCol1; i<=nCol2; i++)
{
@@ -1105,7 +1046,7 @@ index 637e2b2..659af98 100644
//! Aenderungen zusammenfassen?
if (bHiddenChange && pCharts)
pCharts->SetRangeDirty(ScRange( i, 0, nTab, i, MAXROW, nTab ));
-@@ -671,8 +716,10 @@ void ScTable::CopyToTable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
+@@ -671,8 +673,10 @@ void ScTable::CopyToTable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
// TODO: might need some performance improvement, block
// operations instead of single GetValue()/SetValue() calls.
BYTE nThisRowFlags = pRowFlags->GetValue(i);
@@ -1117,7 +1058,7 @@ index 637e2b2..659af98 100644
//! Aenderungen zusammenfassen?
if (bHiddenChange && pCharts)
pCharts->SetRangeDirty(ScRange( 0, i, nTab, MAXCOL, i, nTab ));
-@@ -1262,7 +1309,7 @@ BOOL ScTable::IsBlockEmpty( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
+@@ -1262,7 +1266,7 @@ BOOL ScTable::IsBlockEmpty( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
SCSIZE ScTable::FillMaxRot( RowInfo* pRowInfo, SCSIZE nArrCount, SCCOL nX1, SCCOL nX2,
SCCOL nCol, SCROW nAttrRow1, SCROW nAttrRow2, SCSIZE nArrY,
@@ -1126,7 +1067,7 @@ index 637e2b2..659af98 100644
{
// Rueckgabe = neues nArrY
-@@ -1295,7 +1342,7 @@ SCSIZE ScTable::FillMaxRot( RowInfo* pRowInfo, SCSIZE nArrCount, SCCOL nX1, SCCO
+@@ -1295,7 +1299,7 @@ SCSIZE ScTable::FillMaxRot( RowInfo* pRowInfo, SCSIZE nArrCount, SCCOL nX1, SCCO
for ( SCROW nRow = nAttrRow1; nRow <= nAttrRow2; nRow++ )
{
@@ -1135,7 +1076,7 @@ index 637e2b2..659af98 100644
{
BOOL bHitOne = TRUE;
if ( nCol > nX2+1 )
-@@ -1329,7 +1376,7 @@ SCSIZE ScTable::FillMaxRot( RowInfo* pRowInfo, SCSIZE nArrCount, SCCOL nX1, SCCO
+@@ -1329,7 +1333,7 @@ SCSIZE ScTable::FillMaxRot( RowInfo* pRowInfo, SCSIZE nArrCount, SCCOL nX1, SCCO
return nArrY;
}
@@ -1144,7 +1085,7 @@ index 637e2b2..659af98 100644
{
if ( !pColWidth || !pRowHeight || !pColFlags || !pRowFlags )
{
-@@ -1344,7 +1391,7 @@ void ScTable::FindMaxRotCol( RowInfo* pRowInfo, SCSIZE nArrCount, SCCOL nX1, SCC
+@@ -1344,7 +1348,7 @@ void ScTable::FindMaxRotCol( RowInfo* pRowInfo, SCSIZE nArrCount, SCCOL nX1, SCC
for (SCCOL nCol=0; nCol<=MAXCOL; nCol++)
{
@@ -1153,7 +1094,7 @@ index 637e2b2..659af98 100644
{
SCSIZE nArrY = 0;
ScDocAttrIterator aIter( pDocument, nTab, nCol, nY1, nCol, nY2 );
-@@ -2102,13 +2149,13 @@ void ScTable::SetManualHeight( SCROW nStartRow, SCROW nEndRow, BOOL bManual )
+@@ -2102,13 +2106,13 @@ void ScTable::SetManualHeight( SCROW nStartRow, SCROW nEndRow, BOOL bManual )
}
@@ -1169,7 +1110,7 @@ index 637e2b2..659af98 100644
return 0;
else
return pColWidth[nCol];
-@@ -2129,7 +2176,7 @@ USHORT ScTable::GetOriginalWidth( SCCOL nCol ) const // immer die eingestellte
+@@ -2129,7 +2133,7 @@ USHORT ScTable::GetOriginalWidth( SCCOL nCol ) const // immer die eingestellte
}
@@ -1178,7 +1119,7 @@ index 637e2b2..659af98 100644
{
// get the width that is used in the largest continuous column range (up to nEndCol)
-@@ -2141,24 +2188,24 @@ USHORT ScTable::GetCommonWidth( SCCOL nEndCol ) const
+@@ -2141,24 +2145,24 @@ USHORT ScTable::GetCommonWidth( SCCOL nEndCol ) const
USHORT nMaxWidth = 0;
USHORT nMaxCount = 0;
@@ -1207,7 +1148,7 @@ index 637e2b2..659af98 100644
++nRangeEnd;
}
-@@ -2176,13 +2223,13 @@ USHORT ScTable::GetCommonWidth( SCCOL nEndCol ) const
+@@ -2176,13 +2180,13 @@ USHORT ScTable::GetCommonWidth( SCCOL nEndCol ) const
}
@@ -1224,7 +1165,7 @@ index 637e2b2..659af98 100644
return 0;
else
return pRowHeight->GetValue(nRow);
-@@ -2192,28 +2239,53 @@ USHORT ScTable::GetRowHeight( SCROW nRow ) const
+@@ -2192,28 +2196,53 @@ USHORT ScTable::GetRowHeight( SCROW nRow ) const
}
@@ -1286,7 +1227,7 @@ index 637e2b2..659af98 100644
}
else
return (ULONG) ((nEndRow - nStartRow + 1) * ScGlobal::nStdRowHeight * fScale);
-@@ -2234,18 +2306,29 @@ USHORT ScTable::GetOriginalHeight( SCROW nRow ) const // non-0 even if hidden
+@@ -2234,18 +2263,16 @@ USHORT ScTable::GetOriginalHeight( SCROW nRow ) const // non-0 even if hidden
// Spalten-/Zeilen-Flags
@@ -1303,7 +1244,6 @@ index 637e2b2..659af98 100644
- nEndRow = nRow;
- }
- return nEndRow - nRow;
-+#if 1
+ if (!ValidRow(nRow))
+ return 0;
+
@@ -1312,22 +1252,10 @@ index 637e2b2..659af98 100644
+ return 0;
+
+ return nLastRow - nRow + 1;
-+#else
-+// SCROW nEndRow = nRow;
-+// if ( pRowFlags )
-+// {
-+// nEndRow = pRowFlags->GetBitStateEnd( nRow, CR_HIDDEN, CR_HIDDEN);
-+// if (ValidRow(nEndRow))
-+// ++nEndRow;
-+// else
-+// nEndRow = nRow;
-+// }
-+// return nEndRow - nRow;
-+#endif
}
-@@ -2253,9 +2336,9 @@ SCROW ScTable::GetHiddenRowCount( SCROW nRow ) const
+@@ -2253,9 +2280,9 @@ SCROW ScTable::GetHiddenRowCount( SCROW nRow ) const
void ScTable::ShowCol(SCCOL nCol, BOOL bShow)
{
@@ -1339,7 +1267,7 @@ index 637e2b2..659af98 100644
if (bWasVis != bShow)
{
nRecalcLvl++;
-@@ -2268,10 +2351,8 @@ void ScTable::ShowCol(SCCOL nCol, BOOL bShow)
+@@ -2268,10 +2295,8 @@ void ScTable::ShowCol(SCCOL nCol, BOOL bShow)
pDrawLayer->WidthChanged( nTab, nCol, -(long) pColWidth[nCol] );
}
@@ -1352,7 +1280,7 @@ index 637e2b2..659af98 100644
if( !--nRecalcLvl )
SetDrawPageSize();
-@@ -2292,7 +2373,7 @@ void ScTable::ShowRow(SCROW nRow, BOOL bShow)
+@@ -2292,7 +2317,7 @@ void ScTable::ShowRow(SCROW nRow, BOOL bShow)
if (VALIDROW(nRow) && pRowFlags)
{
BYTE nFlags = pRowFlags->GetValue(nRow);
@@ -1361,7 +1289,7 @@ index 637e2b2..659af98 100644
if (bWasVis != bShow)
{
nRecalcLvl++;
-@@ -2305,16 +2386,10 @@ void ScTable::ShowRow(SCROW nRow, BOOL bShow)
+@@ -2305,16 +2330,10 @@ void ScTable::ShowRow(SCROW nRow, BOOL bShow)
pDrawLayer->HeightChanged( nTab, nRow, -(long) pRowHeight->GetValue(nRow) );
}
@@ -1381,7 +1309,7 @@ index 637e2b2..659af98 100644
if( !--nRecalcLvl )
SetDrawPageSize();
-@@ -2337,7 +2412,7 @@ void ScTable::DBShowRow(SCROW nRow, BOOL bShow)
+@@ -2337,7 +2356,7 @@ void ScTable::DBShowRow(SCROW nRow, BOOL bShow)
if (VALIDROW(nRow) && pRowFlags)
{
BYTE nFlags = pRowFlags->GetValue(nRow);
@@ -1390,7 +1318,7 @@ index 637e2b2..659af98 100644
nRecalcLvl++;
if (bWasVis != bShow)
{
-@@ -2352,16 +2427,14 @@ void ScTable::DBShowRow(SCROW nRow, BOOL bShow)
+@@ -2352,16 +2371,14 @@ void ScTable::DBShowRow(SCROW nRow, BOOL bShow)
}
// Filter-Flag immer setzen, auch wenn Hidden unveraendert
@@ -1413,7 +1341,7 @@ index 637e2b2..659af98 100644
if( !--nRecalcLvl )
SetDrawPageSize();
-@@ -2390,12 +2463,11 @@ void ScTable::DBShowRows(SCROW nRow1, SCROW nRow2, BOOL bShow)
+@@ -2390,12 +2407,11 @@ void ScTable::DBShowRows(SCROW nRow1, SCROW nRow2, BOOL bShow)
nRecalcLvl++;
while (nStartRow <= nRow2)
{
@@ -1428,7 +1356,7 @@ index 637e2b2..659af98 100644
BOOL bChanged = ( bWasVis != bShow );
if ( bChanged )
{
-@@ -2410,10 +2482,11 @@ void ScTable::DBShowRows(SCROW nRow1, SCROW nRow2, BOOL bShow)
+@@ -2410,10 +2426,11 @@ void ScTable::DBShowRows(SCROW nRow1, SCROW nRow2, BOOL bShow)
}
}
@@ -1442,7 +1370,7 @@ index 637e2b2..659af98 100644
if ( bChanged )
{
-@@ -2425,11 +2498,6 @@ void ScTable::DBShowRows(SCROW nRow1, SCROW nRow2, BOOL bShow)
+@@ -2425,11 +2442,6 @@ void ScTable::DBShowRows(SCROW nRow1, SCROW nRow2, BOOL bShow)
nStartRow = nEndRow + 1;
}
@@ -1454,7 +1382,7 @@ index 637e2b2..659af98 100644
// #i12341# For Show/Hide rows, the outlines are updated separately from the outside.
// For filtering, the changes aren't visible to the caller, so UpdateOutlineRow has
// to be done here.
-@@ -2447,12 +2515,11 @@ void ScTable::ShowRows(SCROW nRow1, SCROW nRow2, BOOL bShow)
+@@ -2447,12 +2459,11 @@ void ScTable::ShowRows(SCROW nRow1, SCROW nRow2, BOOL bShow)
nRecalcLvl++;
while (nStartRow <= nRow2)
{
@@ -1469,7 +1397,7 @@ index 637e2b2..659af98 100644
BOOL bChanged = ( bWasVis != bShow );
if ( bChanged )
{
-@@ -2467,16 +2534,9 @@ void ScTable::ShowRows(SCROW nRow1, SCROW nRow2, BOOL bShow)
+@@ -2467,16 +2478,9 @@ void ScTable::ShowRows(SCROW nRow1, SCROW nRow2, BOOL bShow)
}
}
@@ -1488,7 +1416,7 @@ index 637e2b2..659af98 100644
if ( bChanged )
{
-@@ -2601,7 +2661,7 @@ BOOL ScTable::UpdateOutlineCol( SCCOL nStartCol, SCCOL nEndCol, BOOL bShow )
+@@ -2601,7 +2605,7 @@ BOOL ScTable::UpdateOutlineCol( SCCOL nStartCol, SCCOL nEndCol, BOOL bShow )
if (pOutlineTable && pColFlags)
{
ScBitMaskCompressedArray< SCCOLROW, BYTE> aArray( MAXCOL, pColFlags, MAXCOLCOUNT);
@@ -1497,7 +1425,7 @@ index 637e2b2..659af98 100644
}
else
return FALSE;
-@@ -2611,7 +2671,7 @@ BOOL ScTable::UpdateOutlineCol( SCCOL nStartCol, SCCOL nEndCol, BOOL bShow )
+@@ -2611,7 +2615,7 @@ BOOL ScTable::UpdateOutlineCol( SCCOL nStartCol, SCCOL nEndCol, BOOL bShow )
BOOL ScTable::UpdateOutlineRow( SCROW nStartRow, SCROW nEndRow, BOOL bShow )
{
if (pOutlineTable && pRowFlags)
@@ -1506,7 +1434,7 @@ index 637e2b2..659af98 100644
else
return FALSE;
}
-@@ -2619,55 +2679,59 @@ BOOL ScTable::UpdateOutlineRow( SCROW nStartRow, SCROW nEndRow, BOOL bShow )
+@@ -2619,55 +2623,59 @@ BOOL ScTable::UpdateOutlineRow( SCROW nStartRow, SCROW nEndRow, BOOL bShow )
void ScTable::ExtendHidden( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2 )
{
@@ -1602,7 +1530,7 @@ index 637e2b2..659af98 100644
}
-@@ -2874,7 +2938,7 @@ void ScTable::SetDrawPageSize()
+@@ -2874,7 +2882,7 @@ void ScTable::SetDrawPageSize()
}
@@ -1611,7 +1539,7 @@ index 637e2b2..659af98 100644
{
ULONG n = 0;
if ( pRowFlags && pRowHeight )
-@@ -2884,8 +2948,7 @@ ULONG ScTable::GetRowOffset( SCROW nRow ) const
+@@ -2884,8 +2892,7 @@ ULONG ScTable::GetRowOffset( SCROW nRow ) const
else if (nRow == 1)
return GetRowHeight(0);
@@ -1621,13 +1549,12 @@ index 637e2b2..659af98 100644
#ifdef DBG_UTIL
if (n == ::std::numeric_limits<unsigned long>::max())
DBG_ERRORFILE("ScTable::GetRowOffset: row heights overflow");
-@@ -2898,18 +2961,60 @@ ULONG ScTable::GetRowOffset( SCROW nRow ) const
+@@ -2898,18 +2905,42 @@ ULONG ScTable::GetRowOffset( SCROW nRow ) const
return n;
}
+SCROW ScTable::GetRowForHeight(ULONG nHeight)
+{
-+#if 1
+ sal_uInt32 nSum = 0;
+
+ ScFlatBoolRowSegments::RangeData aData;
@@ -1637,36 +1564,19 @@ index 637e2b2..659af98 100644
+ break;
+
+ if (aData.mbValue)
++ {
++ nRow = aData.mnRow2;
+ continue;
++ }
+
+ sal_uInt32 nNew = pRowHeight->GetValue(nRow);
+ nSum += nNew;
+ if (nSum > nHeight)
+ {
-+// fprintf(stdout, "ScTable::GetRowForHeight: hit row = %ld\n", nRow+1);
+ return nRow < MAXROW ? nRow + 1 : MAXROW;
+ }
+ }
+ return -1;
-+#else
-+// ScCoupledCompressedArrayIterator< SCROW, BYTE, USHORT> aIter(
-+// *pRowFlags, 0, MAXROW, CR_HIDDEN, 0, *pRowHeight);
-+// ULONG nSum = 0;
-+// for ( ; aIter; aIter.NextRange() )
-+// {
-+// ULONG nNew = *aIter * (aIter.GetRangeEnd() - aIter.GetRangeStart() + 1);
-+// if (nSum + nNew > nHeight)
-+// {
-+// for ( ; aIter && nSum <= nHeight; ++aIter )
-+// {
-+// nSum += *aIter;
-+// }
-+// return aIter.GetPos();
-+// }
-+// nSum += nNew;
-+// }
-+// return aIter.GetPos();
-+#endif
+}
+
@@ -1736,7 +1646,7 @@ index 9082beb..d9de9e9 100644
void ScTable::FindConditionalFormat( ULONG nKey, ScRangeList& rList )
diff --git sc/source/core/data/table5.cxx sc/source/core/data/table5.cxx
-index 618fe75..197a68e 100644
+index 618fe75..e26a20f 100644
--- sc/source/core/data/table5.cxx
+++ sc/source/core/data/table5.cxx
@@ -53,9 +53,11 @@
@@ -1789,30 +1699,10 @@ index 618fe75..197a68e 100644
#ifdef DBG_UTIL
if (nHeights == ::std::numeric_limits<unsigned long>::max())
DBG_ERRORFILE("ScTable::UpdatePageBreaks: row heights overflow");
-@@ -416,12 +416,287 @@ Sequence<TablePageBreakData> ScTable::GetRowBreakData() const
+@@ -416,12 +416,267 @@ Sequence<TablePageBreakData> ScTable::GetRowBreakData() const
return aSeq;
}
-+//bool ScTable::RowHidden(SCROW nRow)
-+//{
-+// if (!ValidRow(nRow))
-+// return true;
-+//
-+//#if 1
-+// SCROW nLastRow = -1;
-+// return RowHidden(nRow, nLastRow);
-+//#else
-+// bool b = (pRowFlags->GetValue(nRow) & CR_HIDDEN) != 0;
-+//#if 0
-+// bool bHidden = mpHiddenRows->getValue(nRow);
-+// if (b != bHidden)
-+// fprintf(stdout, "ScTable::RowHidden: bad! (table = %d; row = %ld) (hidden %d; myvalue %d)\n",
-+// nTab, nRow, b, bHidden);
-+//#endif
-+// return b;
-+//#endif
-+//}
-+
+bool ScTable::RowHidden(SCROW nRow, SCROW* pFirstRow, SCROW* pLastRow)
+{
+ if (!ValidRow(nRow))
@@ -2079,7 +1969,7 @@ index 618fe75..197a68e 100644
pRowFlags->AndValue(0, MAXROW, static_int_cast<BYTE>(~CR_MANUALBREAK));
for (SCCOL i = 0; i <= MAXCOL; ++i)
pColFlags[i] &= static_int_cast<BYTE>(~CR_MANUALBREAK);
-@@ -439,6 +714,48 @@ void ScTable::SyncColRowFlags()
+@@ -439,6 +694,48 @@ void ScTable::SyncColRowFlags()
itr != itrEnd; ++itr)
pColFlags[*itr] |= CR_MANUALBREAK;
}
@@ -2313,10 +2203,10 @@ index 8d27d2d..e289bf4 100644
::set_flag( mnFlags, EXC_ROW_HIDDEN, bHidden );
diff --git sc/source/filter/excel/xlescher.cxx sc/source/filter/excel/xlescher.cxx
-index 2109a0a..3a3a3c7 100644
+index 2109a0a..a2a64b8 100644
--- sc/source/filter/excel/xlescher.cxx
+++ sc/source/filter/excel/xlescher.cxx
-@@ -143,21 +143,38 @@ void lclGetRowFromY(
+@@ -143,21 +143,20 @@ void lclGetRowFromY(
// rnStartH in conjunction with nXclStartRow is used as buffer for previously calculated height
long nTwipsY = static_cast< long >( nY / fScale + 0.5 );
long nRowH = 0;
@@ -2324,7 +2214,6 @@ index 2109a0a..3a3a3c7 100644
- rDoc.GetRowFlagsArray( nScTab), static_cast<SCROW>(nXclStartRow),
- MAXROW, CR_HIDDEN, 0, rDoc.GetRowHeightArray( nScTab));
- for ( ; aIter; ++aIter )
-+#if 1
+ bool bFound = false;
+ for (SCROW nRow = static_cast<SCROW>(nXclStartRow); nRow <= MAXROW; ++nRow)
{
@@ -2343,23 +2232,6 @@ index 2109a0a..3a3a3c7 100644
- rnXclRow = static_cast< sal_uInt16 >( aIter.GetIterEnd() ); // down to the bottom..
+ if (!bFound)
+ rnXclRow = static_cast<sal_uInt16>(MAXROW);
-+#else
-+// ScCoupledCompressedArrayIterator< SCROW, BYTE, USHORT> aIter(
-+// rDoc.GetRowFlagsArray( nScTab), static_cast<SCROW>(nXclStartRow),
-+// MAXROW, CR_HIDDEN, 0, rDoc.GetRowHeightArray( nScTab));
-+// for ( ; aIter; ++aIter )
-+// {
-+// nRowH = *aIter;
-+// if( rnStartH + nRowH > nTwipsY )
-+// {
-+// rnXclRow = static_cast< sal_uInt16 >( aIter.GetPos() );
-+// break;
-+// }
-+// rnStartH += nRowH;
-+// }
-+// if (!aIter)
-+// rnXclRow = static_cast< sal_uInt16 >( aIter.GetIterEnd() ); // down to the bottom..
-+#endif
rnOffset = static_cast< sal_uInt16 >( nRowH ? ((nTwipsY - rnStartH) * 256.0 / nRowH + 0.5) : 0 );
}
@@ -2537,10 +2409,10 @@ index e8a208d..92dd71e 100644
::set_flag( mnFlags, EXC_ROW_HIDDEN, bHidden );
diff --git sc/source/filter/xlsx/xlsx-xlescher.cxx sc/source/filter/xlsx/xlsx-xlescher.cxx
-index 2109a0a..3a3a3c7 100644
+index 2109a0a..a2a64b8 100644
--- sc/source/filter/xlsx/xlsx-xlescher.cxx
+++ sc/source/filter/xlsx/xlsx-xlescher.cxx
-@@ -143,21 +143,38 @@ void lclGetRowFromY(
+@@ -143,21 +143,20 @@ void lclGetRowFromY(
// rnStartH in conjunction with nXclStartRow is used as buffer for previously calculated height
long nTwipsY = static_cast< long >( nY / fScale + 0.5 );
long nRowH = 0;
@@ -2548,7 +2420,6 @@ index 2109a0a..3a3a3c7 100644
- rDoc.GetRowFlagsArray( nScTab), static_cast<SCROW>(nXclStartRow),
- MAXROW, CR_HIDDEN, 0, rDoc.GetRowHeightArray( nScTab));
- for ( ; aIter; ++aIter )
-+#if 1
+ bool bFound = false;
+ for (SCROW nRow = static_cast<SCROW>(nXclStartRow); nRow <= MAXROW; ++nRow)
{
@@ -2567,41 +2438,11 @@ index 2109a0a..3a3a3c7 100644
- rnXclRow = static_cast< sal_uInt16 >( aIter.GetIterEnd() ); // down to the bottom..
+ if (!bFound)
+ rnXclRow = static_cast<sal_uInt16>(MAXROW);
-+#else
-+// ScCoupledCompressedArrayIterator< SCROW, BYTE, USHORT> aIter(
-+// rDoc.GetRowFlagsArray( nScTab), static_cast<SCROW>(nXclStartRow),
-+// MAXROW, CR_HIDDEN, 0, rDoc.GetRowHeightArray( nScTab));
-+// for ( ; aIter; ++aIter )
-+// {
-+// nRowH = *aIter;
-+// if( rnStartH + nRowH > nTwipsY )
-+// {
-+// rnXclRow = static_cast< sal_uInt16 >( aIter.GetPos() );
-+// break;
-+// }
-+// rnStartH += nRowH;
-+// }
-+// if (!aIter)
-+// rnXclRow = static_cast< sal_uInt16 >( aIter.GetIterEnd() ); // down to the bottom..
-+#endif
rnOffset = static_cast< sal_uInt16 >( nRowH ? ((nTwipsY - rnStartH) * 256.0 / nRowH + 0.5) : 0 );
}
-diff --git sc/source/filter/xml/XMLTableShapeResizer.cxx sc/source/filter/xml/XMLTableShapeResizer.cxx
-index 719ab55..43f10db 100644
---- sc/source/filter/xml/XMLTableShapeResizer.cxx
-+++ sc/source/filter/xml/XMLTableShapeResizer.cxx
-@@ -231,6 +231,8 @@ void ScMyShapeResizer::ResizeShapes()
- {
- Rectangle aRec = pDoc->GetMMRect(static_cast<SCCOL>(aItr->aStartCell.Column), static_cast<SCROW>(aItr->aStartCell.Row),
- static_cast<SCCOL>(aItr->aStartCell.Column), static_cast<SCROW>(aItr->aStartCell.Row), aItr->aStartCell.Sheet);
-+ fprintf(stdout, "ScMyShapeResizer::ResizeShapes: cell rect (%ld,%ld) - (%ld,%ld)\n",
-+ aRec.Left(), aRec.Top(), aRec.Right(), aRec.Bottom());
- awt::Point aPoint(aItr->xShape->getPosition());
- awt::Size aSize(aItr->xShape->getSize());
- if (pDoc->IsNegativePage(static_cast<SCTAB>(nOldSheet)))
diff --git sc/source/ui/Accessibility/AccessibleCellBase.cxx sc/source/ui/Accessibility/AccessibleCellBase.cxx
-index 320f211..819fe2a 100644
+index 320f211..a03f132 100644
--- sc/source/ui/Accessibility/AccessibleCellBase.cxx
+++ sc/source/ui/Accessibility/AccessibleCellBase.cxx
@@ -97,8 +97,12 @@ sal_Bool SAL_CALL ScAccessibleCellBase::isVisible( )
@@ -2614,13 +2455,13 @@ index 320f211..819fe2a 100644
+ SCROW nLastRow;
+ bool bColHidden = mpDoc->ColHidden(maCellAddress.Col(), maCellAddress.Tab(), nLastCol);
+ bool bRowHidden = mpDoc->RowHidden(maCellAddress.Row(), maCellAddress.Tab(), nLastRow);
-+ if (bColHidden || ((nColFlags & CR_FILTERED) == CR_FILTERED) ||
-+ bRowHidden || ((nRowFlags & CR_FILTERED) == CR_FILTERED))
++ if (bColHidden || ((nColFlags & CR_FILTERED) == CR_FILTERED) ||
++ bRowHidden || ((nRowFlags & CR_FILTERED) == CR_FILTERED))
bVisible = sal_False;
}
return bVisible;
diff --git sc/source/ui/app/transobj.cxx sc/source/ui/app/transobj.cxx
-index 1620f95..6542dbc 100644
+index 1620f95..375f2b9 100644
--- sc/source/ui/app/transobj.cxx
+++ sc/source/ui/app/transobj.cxx
@@ -604,25 +604,24 @@ void ScTransferObj::InitDocShell()
@@ -2652,12 +2493,12 @@ index 1620f95..6542dbc 100644
- if ( nSourceFlags & CR_HIDDEN )
+ BYTE nSourceFlags = pDoc->GetRowFlags(nRow, nSrcTab);
+ SCROW nLastRow = -1;
-+ if ( pDoc->RowHidden(nRow, nSrcTab, nLastRow) )
++ if ( pDoc->RowHidden(nRow, nSrcTab, nLastRow) )
pDestDoc->ShowRow( nRow, 0, FALSE );
else
{
diff --git sc/source/ui/docshell/docfunc.cxx sc/source/ui/docshell/docfunc.cxx
-index 1477025..d76e73d 100644
+index 1477025..aa321fe 100644
--- sc/source/ui/docshell/docfunc.cxx
+++ sc/source/ui/docshell/docfunc.cxx
@@ -2927,7 +2927,9 @@ BOOL ScDocFunc::SetWidthOrHeight( BOOL bWidth, SCCOLROW nRangeCnt, SCCOLROW* pRa
@@ -2677,8 +2518,8 @@ index 1477025..d76e73d 100644
{
- if ( eMode != SC_SIZE_VISOPT ||
- (pDoc->GetColFlags( nCol, nTab ) & CR_HIDDEN) == 0 )
-+ SCCOL nLastCol = -1;
-+ if ( eMode != SC_SIZE_VISOPT || !pDoc->ColHidden(nCol, nTab, nLastCol) )
++ SCCOL nLastCol = -1;
++ if ( eMode != SC_SIZE_VISOPT || !pDoc->ColHidden(nCol, nTab, nLastCol) )
{
USHORT nThisSize = nSizeTwips;
@@ -2847,10 +2688,10 @@ index 3107d46..b42726e 100644
else
return (USHORT) ScViewData::ToPixel( pDoc->GetOriginalHeight( nEntryNo,
diff --git sc/source/ui/view/drawutil.cxx sc/source/ui/view/drawutil.cxx
-index dc19949..feba7a3 100644
+index dc19949..3471c1b 100644
--- sc/source/ui/view/drawutil.cxx
+++ sc/source/ui/view/drawutil.cxx
-@@ -69,15 +69,22 @@ void ScDrawUtil::CalcScale( ScDocument* pDoc, SCTAB nTab,
+@@ -69,15 +69,20 @@ void ScDrawUtil::CalcScale( ScDocument* pDoc, SCTAB nTab,
nTwipsX += (long) nWidth;
nPixelX += ScViewData::ToPixel( nWidth, nPPTX );
}
@@ -2863,39 +2704,23 @@ index dc19949..feba7a3 100644
- nTwipsY += (long) nHeight;
- nPixelY += ScViewData::ToPixel( nHeight, nPPTY );
- }
-+#if 1
-+ // TODO: Check this.
-+ sal_uInt32 nHeight = pDoc->GetTotalRowHeight(nStartRow, nEndRow-1, nTab);
-+ nTwipsY += static_cast<long>(nHeight);
-+ nPixelY += ScViewData::ToPixel(nHeight, nPPTY);
-+#else
-+// ScCoupledCompressedArrayIterator< SCROW, BYTE, USHORT> aIter(
-+// pDoc->GetRowFlagsArray( nTab), nStartRow, nEndRow-1, CR_HIDDEN, 0,
-+// pDoc->GetRowHeightArray( nTab));
-+// for ( ; aIter; ++aIter )
-+// {
-+// USHORT nHeight = *aIter;
-+// nTwipsY += (long) nHeight;
-+// nPixelY += ScViewData::ToPixel( nHeight, nPPTY );
-+// }
-+#endif
++
++ for (SCROW nRow = nStartRow; nRow <= nEndRow-1; ++nRow)
++ {
++ SCROW nLastRow = nRow;
++ if (pDoc->RowHidden(nRow, nTab, NULL, &nLastRow))
++ {
++ nRow = nLastRow;
++ continue;
++ }
++
++ USHORT nHeight = pDoc->GetRowHeight(nRow, nTab);
++ nTwipsY += static_cast<long>(nHeight);
++ nPixelY += ScViewData::ToPixel(nHeight, nPPTY);
++ }
MapMode aHMMMode( MAP_100TH_MM, Point(), rZoomX, rZoomY );
Point aPixelLog = pDev->PixelToLogic( Point( nPixelX,nPixelY ), aHMMMode );
-diff --git sc/source/ui/view/drawview.cxx sc/source/ui/view/drawview.cxx
-index 4abdd01..1d4d08d 100644
---- sc/source/ui/view/drawview.cxx
-+++ sc/source/ui/view/drawview.cxx
-@@ -197,6 +197,9 @@ void ScDrawView::AddCustomHdl()
-
- ScTabView* pView = pViewData->GetView();
- ScAddress aScAddress(nCol, nRow, nTab);
-+ String aStr;
-+ aScAddress.Format(aStr, SCA_ABS);
-+ fprintf(stdout, "ScDrawView::AddCustomHdl: anchor cell = '%s'\n", rtl::OUStringToOString(aStr, RTL_TEXTENCODING_UTF8).getStr());
- pView->CreateAnchorHandles(aHdl, aScAddress);
- }
- }
diff --git sc/source/ui/view/gridwin.cxx sc/source/ui/view/gridwin.cxx
index ea8d3d0..3b9ed08 100644
--- sc/source/ui/view/gridwin.cxx
@@ -3057,7 +2882,7 @@ index d01a843..11c57b2 100644
CellInfo& rCellInfo = pThisRowInfo->pCellInfo[nCellX+1];
pPattern = rCellInfo.pPatternAttr;
diff --git sc/source/ui/view/prevloc.cxx sc/source/ui/view/prevloc.cxx
-index ad2731c..e05b380 100644
+index ad2731c..63069dd 100644
--- sc/source/ui/view/prevloc.cxx
+++ sc/source/ui/view/prevloc.cxx
@@ -602,11 +602,11 @@ void ScPreviewLocationData::GetTableInfo( const Rectangle& rVisiblePixel, ScPrev
@@ -3106,7 +2931,7 @@ index ad2731c..e05b380 100644
if ( nRowCount > 0 )
{
-@@ -688,59 +686,101 @@ void ScPreviewLocationData::GetTableInfo( const Rectangle& rVisiblePixel, ScPrev
+@@ -688,59 +686,45 @@ void ScPreviewLocationData::GetTableInfo( const Rectangle& rVisiblePixel, ScPrev
}
if ( bHasRepRows )
{
@@ -3115,7 +2940,6 @@ index ad2731c..e05b380 100644
- pDoc->GetRowFlagsArray( nTab), nRepeatRowStart,
- nRepeatRowEnd);
- do
-+#if 1
+ long nPosY = 0;
+ for (SCROW nRow = nRepeatRowStart; nRow <= nRepeatRowEnd; ++nRow)
{
@@ -3153,33 +2977,6 @@ index ad2731c..e05b380 100644
+ nPosY = nNextY;
+ ++nRowPos;
+ }
-+#else
-+// long nPosY = 0;
-+// ScCompressedArrayIterator< SCROW, BYTE> aIter(
-+// pDoc->GetRowFlagsArray( nTab), nRepeatRowStart,
-+// nRepeatRowEnd);
-+// do
-+// {
-+// if ((*aIter & CR_HIDDEN) == 0)
-+// {
-+// SCROW nRangeEnd = aIter.GetRangeEnd();
-+// for (SCROW nRow=aIter.GetRangeStart(); nRow<=nRangeEnd; ++nRow)
-+// {
-+// USHORT nDocH = pDoc->FastGetOriginalRowHeight( nRow, nTab );
-+// long nNextY = nPosY + (long) (nDocH * nScaleY);
-+//
-+// long nPixelStart = pWindow->LogicToPixel( Size( 0, nPosY ), aCellMapMode ).Height();
-+// long nPixelEnd = pWindow->LogicToPixel( Size( 0, nNextY ), aCellMapMode ).Height() - 1;
-+// pRowInfo[nRowPos].Set( FALSE, nRow,
-+// aRepeatRect.Top() + nPixelStart,
-+// aRepeatRect.Top() + nPixelEnd );
-+//
-+// nPosY = nNextY;
-+// ++nRowPos;
-+// }
-+// }
-+// } while (aIter.NextRange());
-+#endif
}
if ( bHasMainRows )
{
@@ -3188,7 +2985,6 @@ index ad2731c..e05b380 100644
- pDoc->GetRowFlagsArray( nTab), nMainRowStart,
- nMainRowEnd);
- do
-+#if 1
+ long nPosY = 0;
+ for (SCROW nRow = nMainRowStart; nRow <= nMainRowEnd; ++nRow)
{
@@ -3226,33 +3022,6 @@ index ad2731c..e05b380 100644
+ nPosY = nNextY;
+ ++nRowPos;
+ }
-+#else
-+// long nPosY = 0;
-+// ScCompressedArrayIterator< SCROW, BYTE> aIter(
-+// pDoc->GetRowFlagsArray( nTab), nMainRowStart,
-+// nMainRowEnd);
-+// do
-+// {
-+// if ((*aIter & CR_HIDDEN) == 0)
-+// {
-+// SCROW nRangeEnd = aIter.GetRangeEnd();
-+// for (SCROW nRow=aIter.GetRangeStart(); nRow<=nRangeEnd; ++nRow)
-+// {
-+// USHORT nDocH = pDoc->FastGetOriginalRowHeight( nRow, nTab );
-+// long nNextY = nPosY + (long) (nDocH * nScaleY);
-+//
-+// long nPixelStart = pWindow->LogicToPixel( Size( 0, nPosY ), aCellMapMode ).Height();
-+// long nPixelEnd = pWindow->LogicToPixel( Size( 0, nNextY ), aCellMapMode ).Height() - 1;
-+// pRowInfo[nRowPos].Set( FALSE, nRow,
-+// aMainRect.Top() + nPixelStart,
-+// aMainRect.Top() + nPixelEnd );
-+//
-+// nPosY = nNextY;
-+// ++nRowPos;
-+// }
-+// }
-+// } while (aIter.NextRange());
-+#endif
}
rInfo.SetRowInfo( nRowCount, pRowInfo );
}
@@ -3348,10 +3117,10 @@ index 2ddaa99..2a76a83 100644
if (bVisRow)
{
diff --git sc/source/ui/view/select.cxx sc/source/ui/view/select.cxx
-index e4bb262..b04ca46 100644
+index e4bb262..94e3e21 100644
--- sc/source/ui/view/select.cxx
+++ sc/source/ui/view/select.cxx
-@@ -346,12 +346,13 @@ BOOL __EXPORT ScViewFunctionSet::SetCursorAtPoint( const Point& rPointPixel, BOO
+@@ -346,12 +346,12 @@ BOOL __EXPORT ScViewFunctionSet::SetCursorAtPoint( const Point& rPointPixel, BOO
ScDocument* pDoc = pViewData->GetDocument();
SCTAB nTab = pViewData->GetTabNo();
if ( bLeft && !bRightScroll )
@@ -3362,12 +3131,11 @@ index e4bb262..b04ca46 100644
if (--nPosY >= 0)
{
- pDoc->GetRowFlagsArray( nTab).GetLastForCondition( 0, nPosY, CR_HIDDEN, 0);
-+// pDoc->GetRowFlagsArray( nTab).GetLastForCondition( 0, nPosY, CR_HIDDEN, 0); // what's this trying to do here?
+ nPosY = pDoc->LastVisibleRow(0, nPosY, nTab);
if (!ValidRow(nPosY))
nPosY = -1;
}
-@@ -560,7 +561,7 @@ BOOL ScViewFunctionSet::SetCursorAtCell( SCsCOL nPosX, SCsROW nPosY, BOOL bScrol
+@@ -560,7 +560,7 @@ BOOL ScViewFunctionSet::SetCursorAtCell( SCsCOL nPosX, SCsROW nPosY, BOOL bScrol
{
// #94321# in SetCursorAtPoint hidden columns are skipped.
// They must be skipped here too, or the result will always be the first hidden column.
@@ -3376,7 +3144,7 @@ index e4bb262..b04ca46 100644
for (SCCOL i=nPosX; i<nStartX; i++)
nSizeX += pDoc->GetColWidth( i, nTab );
}
-@@ -575,8 +576,7 @@ BOOL ScViewFunctionSet::SetCursorAtCell( SCsCOL nPosX, SCsROW nPosY, BOOL bScrol
+@@ -575,8 +575,7 @@ BOOL ScViewFunctionSet::SetCursorAtCell( SCsCOL nPosX, SCsROW nPosY, BOOL bScrol
// They must be skipped here too, or the result will always be the first hidden row.
if (++nPosY < nStartY)
{
@@ -3409,10 +3177,10 @@ index 83fa37b..320ff65 100644
nNewY += nDir;
diff --git sc/source/ui/view/tabview2.cxx sc/source/ui/view/tabview2.cxx
-index 7dec6f2..8eb43cd 100644
+index 7dec6f2..856b8d5 100644
--- sc/source/ui/view/tabview2.cxx
+++ sc/source/ui/view/tabview2.cxx
-@@ -890,31 +890,58 @@ BOOL lcl_FitsInWindow( double fScaleX, double fScaleY, USHORT nZoom,
+@@ -890,31 +890,30 @@ BOOL lcl_FitsInWindow( double fScaleX, double fScaleY, USHORT nZoom,
}
long nBlockY = 0;
@@ -3421,7 +3189,6 @@ index 7dec6f2..8eb43cd 100644
- pDoc->GetRowHeightArray( nTab));
- for ( ; aIter; ++aIter)
- {
-+#if 1
+ for (SCROW nRow = 0; nRow <= nFixPosY-1; ++nRow)
+ {
+ if (pDoc->RowHidden(nRow, nTab))
@@ -3453,33 +3220,6 @@ index 7dec6f2..8eb43cd 100644
}
- }
+ }
-+#else
-+// ScCoupledCompressedArrayIterator< SCROW, BYTE, USHORT> aIter(
-+// pDoc->GetRowFlagsArray( nTab), 0, nFixPosY-1, CR_HIDDEN, 0,
-+// pDoc->GetRowHeightArray( nTab));
-+// for ( ; aIter; ++aIter)
-+// {
-+// // for frozen panes, add both parts
-+// USHORT nRowTwips = *aIter;
-+// if (nRowTwips)
-+// {
-+// nBlockY += (long)(nRowTwips * fScaleY);
-+// if (nBlockY > nWindowY)
-+// return FALSE;
-+// }
-+// }
-+// aIter.NewLimits( nStartRow, nEndRow);
-+// for ( ; aIter; ++aIter)
-+// {
-+// USHORT nRowTwips = *aIter;
-+// if (nRowTwips)
-+// {
-+// nBlockY += (long)(nRowTwips * fScaleY);
-+// if (nBlockY > nWindowY)
-+// return FALSE;
-+// }
-+// }
-+#endif
return TRUE;
}
@@ -3541,7 +3281,7 @@ index d8392e5..5c305c7 100644
nTmp = MAXROW;
if (nTmp > nRow2)
diff --git sc/source/ui/view/viewdata.cxx sc/source/ui/view/viewdata.cxx
-index be4d659..0295dbe 100644
+index be4d659..ea04a47 100644
--- sc/source/ui/view/viewdata.cxx
+++ sc/source/ui/view/viewdata.cxx
@@ -1603,7 +1603,7 @@ Point ScViewData::GetScrPos( SCCOL nWhereX, SCROW nWhereY, ScSplitPos eWhich,
@@ -3562,7 +3302,7 @@ index be4d659..0295dbe 100644
if ( nNext > MAXROW )
{
// same behavior as without the optimization: set bOut with nY=MAXROW+1
-@@ -1778,11 +1778,9 @@ BOOL ScViewData::GetMergeSizePixel( SCCOL nX, SCROW nY, long& rSizeXPix, long& r
+@@ -1778,11 +1778,19 @@ BOOL ScViewData::GetMergeSizePixel( SCCOL nX, SCROW nY, long& rSizeXPix, long& r
for (SCCOL i=0; i<nCountX; i++)
nOutWidth += ToPixel( pDoc->GetColWidth(nX+i,nTabNo), nPPTX );
SCROW nCountY = pMerge->GetRowMerge();
@@ -3572,16 +3312,26 @@ index be4d659..0295dbe 100644
- for ( ; aIter; ++aIter )
- nOutHeight += ToPixel( *aIter, nPPTY );
+
-+ nOutHeight += ToPixel(
-+ pDoc->GetTotalRowHeight(nY, nY+nCountY-1, nTabNo), nPPTY);
++ for (SCROW nRow = nY; nRow <= nY+nCountY-1; ++nRow)
++ {
++ SCROW nLastRow = nRow;
++ if (pDoc->RowHidden(nRow, nTabNo, NULL, &nLastRow))
++ {
++ nRow = nLastRow;
++ continue;
++ }
++
++ USHORT nHeight = pDoc->GetRowHeight(nRow, nTabNo);
++ nOutHeight += ToPixel(nHeight, nPPTY);
++ }
rSizeXPix = nOutWidth;
rSizeYPix = nOutHeight;
diff --git sc/source/ui/view/viewfunc.cxx sc/source/ui/view/viewfunc.cxx
-index d8e28ce..ca18a77 100644
+index d8e28ce..ea2ddec 100644
--- sc/source/ui/view/viewfunc.cxx
+++ sc/source/ui/view/viewfunc.cxx
-@@ -2244,28 +2244,40 @@ void ScViewFunc::SetWidthOrHeight( BOOL bWidth, SCCOLROW nRangeCnt, SCCOLROW* pR
+@@ -2244,28 +2244,19 @@ void ScViewFunc::SetWidthOrHeight( BOOL bWidth, SCCOLROW nRangeCnt, SCCOLROW* pR
{
// fuer alle eingeblendeten CR_MANUALSIZE loeschen,
// dann SetOptimalHeight mit bShrink = FALSE
@@ -3589,12 +3339,13 @@ index d8e28ce..ca18a77 100644
- pDoc->GetRowFlagsArray( nTab), nStartNo,
- nEndNo);
- do
-+#if 1
+ for (SCROW nRow = nStartNo; nRow <= nEndNo; ++nRow)
{
- BYTE nOld = *aIter;
- if ( (nOld & CR_HIDDEN) == 0 && ( nOld & CR_MANUALSIZE ) )
-- {
++ SCROW nLastRow = nRow;
++ if (pDoc->RowHidden(nRow, nTab, NULL, &nLastRow))
+ {
- SCROW nRangeEnd = aIter.GetRangeEnd();
- pDoc->SetRowFlags( aIter.GetRangeStart(),
- nRangeEnd, nTab,
@@ -3607,43 +3358,19 @@ index d8e28ce..ca18a77 100644
- // removed, so it is safe to continue with
- // the next range, not necessary to catch
- // up with the remaining rows.
-- }
-- } while (aIter.NextRange());
-+ if (pDoc->RowHidden(nRow, nTab))
++ nRow = nLastRow;
+ continue;
+ }
+- } while (aIter.NextRange());
+
+ BYTE nOld = pDoc->GetRowFlags(nRow, nTab);
+ if (nOld & CR_MANUALSIZE)
+ pDoc->SetRowFlags(nRow, nTab, nOld & ~CR_MANUALSIZE);
+ }
-+#else
-+// ScCompressedArrayIterator< SCROW, BYTE> aIter(
-+// pDoc->GetRowFlagsArray( nTab), nStartNo,
-+// nEndNo);
-+// do
-+// {
-+// BYTE nOld = *aIter;
-+// if ( (nOld & CR_HIDDEN) == 0 && ( nOld & CR_MANUALSIZE ) )
-+// {
-+// SCROW nRangeEnd = aIter.GetRangeEnd();
-+// pDoc->SetRowFlags( aIter.GetRangeStart(),
-+// nRangeEnd, nTab,
-+// nOld & ~CR_MANUALSIZE);
-+// aIter.Resync( nRangeEnd);
-+// // Range may be extended due to merges and
-+// // now aIter.GetRangeEnd() may point behind
-+// // the previous row, but all flags of this
-+// // range have the CR_MANUALSIZE bit
-+// // removed, so it is safe to continue with
-+// // the next range, not necessary to catch
-+// // up with the remaining rows.
-+// }
-+// } while (aIter.NextRange());
-+#endif
}
double nPPTX = GetViewData()->GetPPTX();
-@@ -2307,8 +2319,7 @@ void ScViewFunc::SetWidthOrHeight( BOOL bWidth, SCCOLROW nRangeCnt, SCCOLROW* pR
+@@ -2307,8 +2298,7 @@ void ScViewFunc::SetWidthOrHeight( BOOL bWidth, SCCOLROW nRangeCnt, SCCOLROW* pR
{
for (SCCOL nCol=static_cast<SCCOL>(nStartNo); nCol<=static_cast<SCCOL>(nEndNo); nCol++)
{
More information about the ooo-build-commit
mailing list