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

Markus Mohrhard mmohrhard at kemper.freedesktop.org
Tue Apr 10 07:05:27 PDT 2012


 sc/inc/table.hxx               |    2 +-
 sc/source/core/data/table2.cxx |   20 ++++++++++----------
 sc/source/core/data/table4.cxx |    8 ++++----
 3 files changed, 15 insertions(+), 15 deletions(-)

New commits:
commit 80c233cddff5daca7ffa3fca0499f539fae5ce62
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Tue Apr 10 14:00:59 2012 +0200

    search for hidden rows/columns and not filtered areas, fdo#48449

diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index cec3676..0c440f9 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 1d09d7c..646e0d8 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 5cc05aa..44eb226 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;


More information about the Libreoffice-commits mailing list