Anonymous avatar Anonymous committed 31462ac

calcdatatables: first data row/col can be hidden as well..

Comments (0)

Files changed (1)

sc/source/core/data/datatablestyle.cxx

     if (mbBandedRows)
     {
         SCROW nRow = rPos.Row();
-        const SCROW nStartRow = (mbHeaderRow ? maRange.aStart.Row() + 1 : maRange.aStart.Row());
+        SCROW nStartRow = (mbHeaderRow ? maRange.aStart.Row() + 1 : maRange.aStart.Row());
         if (mpDoc->HasHiddenRows( nStartRow, nRow, maRange.aStart.Tab()))
         {
             // Hidden or filtered, use visible area.
                  * seeking each segment. */
                 SCROW nLastHiddenRow;
                 if (mpDoc->RowHidden( nRow, maRange.aStart.Tab(), nLastHiddenRow))
+                {
+                    if (nRow == nStartRow)
+                        nStartRow = nLastHiddenRow + 1;
                     nRow = nLastHiddenRow + 1;
+                }
                 else
                 {
                     SCROW nRowMinPlus = ::std::min( nLastHiddenRow, nEndRow) + 1;
                 }
             } while (nRow <= nEndRow);
             DBG_ASSERT( nRowCount > 0, "ScDataTableFormat::GetStyleType: no visible row");
-            nRow = maRange.aStart.Row() + (nRowCount ? nRowCount - 1 : 0);
+            nRow = nStartRow + (nRowCount ? nRowCount - 1 : 0);
         }
         SCROW nOff = (nRow - nStartRow) % (mnRowsStripe1 + mnRowsStripe2);
         if (nOff < mnRowsStripe1)
     if (mbBandedCols)
     {
         SCCOL nCol = rPos.Col();
-        const SCCOL nStartCol = maRange.aStart.Col();
+        SCCOL nStartCol = maRange.aStart.Col();
         if (mpDoc->HasHiddenCols( nStartCol, nCol, maRange.aStart.Tab()))
         {
             // Hidden or filtered, use visible area.
                  * seeking each segment. */
                 SCCOL nLastHiddenCol;
                 if (mpDoc->ColHidden( nCol, maRange.aStart.Tab(), nLastHiddenCol))
+                {
+                    if (nCol == nStartCol)
+                        nStartCol = nLastHiddenCol + 1;
                     nCol = nLastHiddenCol + 1;
+                }
                 else
                 {
                     SCCOL nColMinPlus = ::std::min( nLastHiddenCol, nEndCol) + 1;
                 }
             } while (nCol <= nEndCol);
             DBG_ASSERT( nColCount > 0, "ScDataTableFormat::GetStyleType: no visible column");
-            nCol = maRange.aStart.Col() + (nColCount ? nColCount - 1 : 0);
+            nCol = nStartCol + (nColCount ? nColCount - 1 : 0);
         }
         SCCOL nOff = (nCol - nStartCol) % (mnColsStripe1 + mnColsStripe2);
         if (nOff < mnColsStripe1)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.