summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-04-10 14:00:59 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-04-10 16:05:21 +0200
commit80c233cddff5daca7ffa3fca0499f539fae5ce62 (patch)
tree4b591a1674dcfcac20ee8a6a46fbc6aba524e3bb
parent95803f44cfa0dc62b500e931e401e0593b0c3eae (diff)
search for hidden rows/columns and not filtered areas, fdo#48449
-rw-r--r--sc/inc/table.hxx2
-rw-r--r--sc/source/core/data/table2.cxx20
-rw-r--r--sc/source/core/data/table4.cxx8
3 files changed, 15 insertions, 15 deletions
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index cec3676f7dd0..0c440f9f4fe7 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -674,7 +674,7 @@ public:
/// @return the index of the last changed row (flags and row height, auto pagebreak is ignored).
SCROW GetLastChangedRow() const;
- bool IsDataFiltered() const;
+ bool IsDataFiltered(SCCOL nColStart, SCROW nRowStart, SCCOL nColEnd, SCROW nRowEnd) const;
sal_uInt8 GetColFlags( SCCOL nCol ) const;
sal_uInt8 GetRowFlags( SCROW nRow ) const;
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 1d09d7cf2825..646e0d8e4ace 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -2806,19 +2806,19 @@ void ScTable::ShowRows(SCROW nRow1, SCROW nRow2, bool bShow)
DecRecalcLevel();
}
-bool ScTable::IsDataFiltered() const
+bool ScTable::IsDataFiltered(SCCOL nColStart, SCROW nRowStart, SCCOL nColEnd, SCROW nRowEnd) const
{
- bool bAnyQuery = false;
- const ScDBCollection* pDBs = pDocument->GetDBCollection();
- const ScDBData* pDBData = pDBs->GetFilterDBAtTable(nTab);
- if ( pDBData )
+ for (SCROW i = nRowStart; i <= nRowEnd; ++i)
{
- ScQueryParam aParam;
- pDBData->GetQueryParam( aParam );
- if ( aParam.GetEntry(0).bDoQuery )
- bAnyQuery = true;
+ if (RowHidden(i))
+ return true;
}
- return bAnyQuery;
+ for (SCCOL i = nColStart; i <= nColEnd; ++i)
+ {
+ if (ColHidden(i))
+ return true;
+ }
+ return false;
}
diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx
index 5cc05aa0e6e5..44eb2262061a 100644
--- a/sc/source/core/data/table4.cxx
+++ b/sc/source/core/data/table4.cxx
@@ -198,7 +198,7 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
rMinDigits = 0;
rListData = NULL;
rCmd = FILL_SIMPLE;
- if ( (nScFillModeMouseModifier & KEY_MOD1) || IsDataFiltered() )
+ if ( (nScFillModeMouseModifier & KEY_MOD1) || IsDataFiltered(nCol1, nRow1, nCol2, nRow2) )
return ; // Ctrl-Taste: Copy
SCCOL nAddX;
@@ -531,7 +531,7 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
sal_uLong nIMin = nIStart;
sal_uLong nIMax = nIEnd;
PutInOrder(nIMin,nIMax);
- bool bHasFiltered = IsDataFiltered();
+ bool bHasFiltered = IsDataFiltered(nCol1, nRow1, nCol2, nRow2);
if (!bHasFiltered)
{
@@ -1015,7 +1015,7 @@ String ScTable::GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCROW n
aValue = ((ScStringCell*)pCell)->GetString();
else
aValue = ((ScEditCell*)pCell)->GetString();
- if ( !(nScFillModeMouseModifier & KEY_MOD1) && !IsDataFiltered() )
+ if ( !(nScFillModeMouseModifier & KEY_MOD1) && !IsDataFiltered(nCol1, nRow1, nCol2, nRow2) )
{
sal_Int32 nVal;
sal_uInt16 nCellDigits = 0; // look at each source cell individually
@@ -1036,7 +1036,7 @@ String ScTable::GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCROW n
{
// dabei kann's keinen Ueberlauf geben...
double nVal = ((ScValueCell*)pCell)->GetValue();
- if ( !(nScFillModeMouseModifier & KEY_MOD1) && !IsDataFiltered() )
+ if ( !(nScFillModeMouseModifier & KEY_MOD1) && !IsDataFiltered(nCol1, nRow1, nCol2, nRow2) )
nVal += (double) nDelta;
Color* pColor;