sc/inc/document.hxx                      |   20 ++++++++++----------
 sc/qa/unit/ucalc.cxx                     |   18 +++++++++---------
 sc/qa/unit/ucalc_copypaste.cxx           |    8 ++++----
 sc/source/core/data/documen3.cxx         |   12 ++++++------
 sc/source/core/data/documen9.cxx         |    7 ++++---
 sc/source/core/data/document.cxx         |    4 ++--
 sc/source/core/data/dpobject.cxx         |    2 +-
 sc/source/filter/excel/xistyle.cxx       |    2 +-
 sc/source/filter/lotus/lotimpop.cxx      |    6 +++---
 sc/source/filter/oox/sheetdatabuffer.cxx |    2 +-
 sc/source/filter/xml/xmlcelli.cxx        |    4 ++--
 sc/source/ui/docshell/dbdocfun.cxx       |    4 ++--
 sc/source/ui/docshell/docfunc.cxx        |   12 ++++++------
 sc/source/ui/docshell/impex.cxx          |    2 +-
 sc/source/ui/undo/undoblk3.cxx           |   12 ++++++------
 sc/source/ui/view/cellsh1.cxx            |   10 ++++++----
 sc/source/ui/view/cellsh2.cxx            |    6 +++---
 sc/source/ui/view/dbfunc.cxx             |    5 ++---
 sc/source/ui/view/printfun.cxx           |    6 +++---
 sc/source/ui/view/tabview3.cxx           |    4 ++--
 sc/source/ui/view/tabvwshc.cxx           |    5 ++---
 sc/source/ui/view/viewfun2.cxx           |   16 ++++++++--------
 sc/source/ui/view/viewfun3.cxx           |    4 ++--
 23 files changed, 86 insertions(+), 85 deletions(-)

New commits:
commit 1e990a5ab399a1bb15d4002ca30f13611ba6edbc
Author:     Luboš Luňák <l.lu...@collabora.com>
AuthorDate: Thu May 12 12:05:44 2022 +0200
Commit:     Luboš Luňák <l.lu...@collabora.com>
CommitDate: Thu May 12 16:38:38 2022 +0200

    fix up order of some ScDocument functions
    
    For better or worse the usual order of arguments in Calc is
    SCCOL, SCROW, SCTAB, so make this consistent.
    
    Change-Id: Ie63c75f5ae92f82cb757c0873f7ff569f331e0df
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134229
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lu...@collabora.com>

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index f61650e5a256..7f32bb7bc6bd 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -1325,19 +1325,19 @@ public:
     bool              RefreshAutoFilter( SCCOL nStartCol, SCROW nStartRow,
                                          SCCOL nEndCol, SCROW nEndRow, SCTAB 
nTab );
 
-    SC_DLLPUBLIC void DoMergeContents( SCTAB nTab, SCCOL nStartCol, SCROW 
nStartRow,
-                                       SCCOL nEndCol, SCROW nEndRow );
-    SC_DLLPUBLIC void DoEmptyBlock( SCTAB nTab, SCCOL nStartCol, SCROW 
nStartRow,
-                                    SCCOL nEndCol, SCROW nEndRow );
+    SC_DLLPUBLIC void DoMergeContents( SCCOL nStartCol, SCROW nStartRow,
+                                       SCCOL nEndCol, SCROW nEndRow, SCTAB 
nTab );
+    SC_DLLPUBLIC void DoEmptyBlock( SCCOL nStartCol, SCROW nStartRow,
+                                    SCCOL nEndCol, SCROW nEndRow, SCTAB nTab );
                     //  without checking:
-    SC_DLLPUBLIC void DoMerge( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow,
-                               SCCOL nEndCol, SCROW nEndRow, bool 
bDeleteCaptions = true );
+    SC_DLLPUBLIC void DoMerge( SCCOL nStartCol, SCROW nStartRow,
+                               SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, bool 
bDeleteCaptions = true );
     void              RemoveMerge( SCCOL nCol, SCROW nRow, SCTAB nTab );
 
-    bool              IsBlockEmpty( SCTAB nTab, SCCOL nStartCol, SCROW 
nStartRow,
-                                    SCCOL nEndCol, SCROW nEndRow, bool 
bIgnoreNotes = false ) const;
-    bool              IsPrintEmpty( SCTAB nTab, SCCOL nStartCol, SCROW 
nStartRow,
-                                    SCCOL nEndCol, SCROW nEndRow,
+    bool              IsBlockEmpty( SCCOL nStartCol, SCROW nStartRow,
+                                    SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, 
bool bIgnoreNotes = false ) const;
+    bool              IsPrintEmpty( SCCOL nStartCol, SCROW nStartRow,
+                                    SCCOL nEndCol, SCROW nEndRow, SCTAB nTab,
                                     bool bLeftIsEmpty = false,
                                     ScRange* pLastRange = nullptr,
                                     tools::Rectangle* pLastMM = nullptr ) 
const;
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index b35d88e3b3a9..1019cf44a879 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -2602,8 +2602,8 @@ void Test::testDataArea()
     m_pDoc->InsertTab(0, "Data");
 
     // Totally empty sheet should be rightfully considered empty in all 
accounts.
-    CPPUNIT_ASSERT_MESSAGE("Sheet is expected to be empty.", 
m_pDoc->IsPrintEmpty(0, 0, 0, 100, 100));
-    CPPUNIT_ASSERT_MESSAGE("Sheet is expected to be empty.", 
m_pDoc->IsBlockEmpty(0, 0, 0, 100, 100));
+    CPPUNIT_ASSERT_MESSAGE("Sheet is expected to be empty.", 
m_pDoc->IsPrintEmpty(0, 0, 100, 100, 0));
+    CPPUNIT_ASSERT_MESSAGE("Sheet is expected to be empty.", 
m_pDoc->IsBlockEmpty(0, 0, 100, 100, 0));
 
     // Now, set borders in some cells...
     ::editeng::SvxBorderLine aLine(nullptr, 50, SvxBorderLineStyle::SOLID);
@@ -2619,12 +2619,12 @@ void Test::testDataArea()
     CPPUNIT_ASSERT_MESSAGE("Empty sheet with borders should be printable.",
                            !m_pDoc->IsPrintEmpty(0, 0, 0, 100, 100));
     CPPUNIT_ASSERT_MESSAGE("But it should still be considered empty in all the 
other cases.",
-                           m_pDoc->IsBlockEmpty(0, 0, 0, 100, 100));
+                           m_pDoc->IsBlockEmpty(0, 0, 100, 100, 0));
 
     // Adding a real cell content should turn the block non-empty.
     m_pDoc->SetString(0, 0, 0, "Some text");
     CPPUNIT_ASSERT_MESSAGE("Now the block should not be empty with a real cell 
content.",
-                           !m_pDoc->IsBlockEmpty(0, 0, 0, 100, 100));
+                           !m_pDoc->IsBlockEmpty(0, 0, 100, 100, 0));
 
     // TODO: Add more tests for normal data area calculation.
 
@@ -4138,7 +4138,7 @@ void Test::testMergedCells()
     //test merge and unmerge
     //TODO: an undo/redo test for this would be a good idea
     m_pDoc->InsertTab(0, "Sheet1");
-    m_pDoc->DoMerge(0, 1, 1, 3, 3, false);
+    m_pDoc->DoMerge(1, 1, 3, 3, 0, false);
     SCCOL nEndCol = 1;
     SCROW nEndRow = 1;
     m_pDoc->ExtendMerge( 1, 1, nEndCol, nEndRow, 0);
@@ -4895,7 +4895,7 @@ void Test::testShiftCells()
     m_pDoc->InsertCol(3, 0, 3, 0, 3, 1);
     OUString aStr = m_pDoc->GetString(5, 3, 0);
     CPPUNIT_ASSERT_EQUAL_MESSAGE("We should have a string cell here.", 
aTestVal, aStr);
-    CPPUNIT_ASSERT_MESSAGE("D5 is supposed to be blank.", 
m_pDoc->IsBlockEmpty(0, 3, 4, 3, 4));
+    CPPUNIT_ASSERT_MESSAGE("D5 is supposed to be blank.", 
m_pDoc->IsBlockEmpty(3, 4, 3, 4, 0));
 
     CPPUNIT_ASSERT_MESSAGE("there should be NO note", !m_pDoc->HasNote(4, 3, 
0));
     CPPUNIT_ASSERT_MESSAGE("there should be a note", m_pDoc->HasNote(5, 3, 0));
@@ -4904,7 +4904,7 @@ void Test::testShiftCells()
     m_pDoc->DeleteCol(3, 0, 3, 0, 3, 1);
     aStr = m_pDoc->GetString(4, 3, 0);
     CPPUNIT_ASSERT_EQUAL_MESSAGE("We should have a string cell here.", 
aTestVal, aStr);
-    CPPUNIT_ASSERT_MESSAGE("E5 is supposed to be blank.", 
m_pDoc->IsBlockEmpty(0, 4, 4, 4, 4));
+    CPPUNIT_ASSERT_MESSAGE("E5 is supposed to be blank.", 
m_pDoc->IsBlockEmpty(4, 4, 4, 4, 0));
 
     CPPUNIT_ASSERT_MESSAGE("there should be NO note", !m_pDoc->HasNote(5, 3, 
0));
     CPPUNIT_ASSERT_MESSAGE("there should be a note", m_pDoc->HasNote(4, 3, 0));
@@ -5009,9 +5009,9 @@ void Test::testNoteDeleteRow()
 
     // test with IsBlockEmpty
     bool bIgnoreNotes = true;
-    CPPUNIT_ASSERT_MESSAGE("The Block should be detected as empty (no Notes)", 
m_pDoc->IsBlockEmpty(0, 0, 0, 100, 100, bIgnoreNotes));
+    CPPUNIT_ASSERT_MESSAGE("The Block should be detected as empty (no Notes)", 
m_pDoc->IsBlockEmpty(0, 0, 100, 100, 0, bIgnoreNotes));
     bIgnoreNotes = false;
-    CPPUNIT_ASSERT_MESSAGE("The Block should NOT be detected as empty", 
!m_pDoc->IsBlockEmpty(0, 0, 0, 100, 100, bIgnoreNotes));
+    CPPUNIT_ASSERT_MESSAGE("The Block should NOT be detected as empty", 
!m_pDoc->IsBlockEmpty(0, 0, 100, 100, 0, bIgnoreNotes));
 
     m_pDoc->DeleteRow(0, 0, m_pDoc->MaxCol(), 0, 1, 1);
 
diff --git a/sc/qa/unit/ucalc_copypaste.cxx b/sc/qa/unit/ucalc_copypaste.cxx
index 78412c4d9820..0fe6eb03f161 100644
--- a/sc/qa/unit/ucalc_copypaste.cxx
+++ b/sc/qa/unit/ucalc_copypaste.cxx
@@ -764,8 +764,8 @@ void 
TestCopyPaste::testCopyPasteSpecialMergedCellsTranspose()
     m_pDoc->SetValue(0, 2, srcSheet, 3); // A3
     m_pDoc->SetValue(0, 3, srcSheet, 4); // A4
 
-    m_pDoc->DoMerge(srcSheet, 0, 1, 1, 1, false); // Merge A2 and B2
-    m_pDoc->DoMerge(srcSheet, 0, 2, 1, 2, false); // Merge A3 and B3
+    m_pDoc->DoMerge(0, 1, 1, 1, srcSheet, false); // Merge A2 and B2
+    m_pDoc->DoMerge(0, 2, 1, 2, srcSheet, false); // Merge A3 and B3
 
     // Test precondition
     CPPUNIT_ASSERT_EQUAL(ScAddress(0, 0, srcSheet),
@@ -833,8 +833,8 @@ void 
TestCopyPaste::testCopyPasteSpecialMergedCellsFilteredTranspose()
     m_pDoc->SetValue(0, 2, srcSheet, 3); // A3
     m_pDoc->SetValue(0, 3, srcSheet, 4); // A4
 
-    m_pDoc->DoMerge(srcSheet, 0, 1, 1, 1, false); // Merge A2 and B2
-    m_pDoc->DoMerge(srcSheet, 0, 2, 1, 2, false); // Merge A3 and B3
+    m_pDoc->DoMerge(0, 1, 1, 1, srcSheet, false); // Merge A2 and B2
+    m_pDoc->DoMerge(0, 2, 1, 2, srcSheet, false); // Merge A3 and B3
 
     // Filter row 1
     ScDBData* pDBData = new ScDBData("TRANSPOSE_TEST_DATA", srcSheet, 0, 0, 0, 
3);
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index bf269ec860f7..37c0839fcf26 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -2032,8 +2032,8 @@ void 
ScDocument::SetClipOptions(std::unique_ptr<ScClipOptions> pClipOptions)
     mpClipOptions = std::move(pClipOptions);
 }
 
-void ScDocument::DoMergeContents( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow,
-                                    SCCOL nEndCol, SCROW nEndRow )
+void ScDocument::DoMergeContents( SCCOL nStartCol, SCROW nStartRow,
+                                    SCCOL nEndCol, SCROW nEndRow, SCTAB nTab )
 {
     OUStringBuffer aTotal;
     OUString aCellStr;
@@ -2056,8 +2056,8 @@ void ScDocument::DoMergeContents( SCTAB nTab, SCCOL 
nStartCol, SCROW nStartRow,
     SetString(nStartCol,nStartRow,nTab,aTotal.makeStringAndClear());
 }
 
-void ScDocument::DoEmptyBlock( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow,
-                               SCCOL nEndCol, SCROW nEndRow )
+void ScDocument::DoEmptyBlock( SCCOL nStartCol, SCROW nStartRow,
+                               SCCOL nEndCol, SCROW nEndRow, SCTAB nTab )
 {
     SCCOL nCol;
     SCROW nRow;
@@ -2069,8 +2069,8 @@ void ScDocument::DoEmptyBlock( SCTAB nTab, SCCOL 
nStartCol, SCROW nStartRow,
         }
 }
 
-void ScDocument::DoMerge( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow,
-                                    SCCOL nEndCol, SCROW nEndRow, bool 
bDeleteCaptions )
+void ScDocument::DoMerge( SCCOL nStartCol, SCROW nStartRow,
+                          SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, bool 
bDeleteCaptions )
 {
     ScTable* pTab = FetchTable(nTab);
     if (!pTab)
diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx
index 69c37888057b..28f0e233386c 100644
--- a/sc/source/core/data/documen9.cxx
+++ b/sc/source/core/data/documen9.cxx
@@ -432,11 +432,12 @@ SdrObject* ScDocument::GetObjectAtPoint( SCTAB nTab, 
const Point& rPos )
     return pFound;
 }
 
-bool ScDocument::IsPrintEmpty( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow,
-                                SCCOL nEndCol, SCROW nEndRow, bool 
bLeftIsEmpty,
+bool ScDocument::IsPrintEmpty( SCCOL nStartCol, SCROW nStartRow,
+                                SCCOL nEndCol, SCROW nEndRow,
+                                SCTAB nTab, bool bLeftIsEmpty,
                                 ScRange* pLastRange, tools::Rectangle* pLastMM 
) const
 {
-    if (!IsBlockEmpty( nTab, nStartCol, nStartRow, nEndCol, nEndRow ))
+    if (!IsBlockEmpty( nStartCol, nStartRow, nEndCol, nEndRow, nTab ))
         return false;
 
     if (HasAttrib(ScRange(nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab), 
HasAttrFlags::Lines))
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index c730710bf081..de398e96a13f 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -5388,8 +5388,8 @@ void ScDocument::GetBorderLines( SCCOL nCol, SCROW nRow, 
SCTAB nTab,
         *ppBottom = pBottomLine;
 }
 
-bool ScDocument::IsBlockEmpty( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow,
-                                        SCCOL nEndCol, SCROW nEndRow, bool 
bIgnoreNotes ) const
+bool ScDocument::IsBlockEmpty(SCCOL nStartCol, SCROW nStartRow,
+                              SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, bool 
bIgnoreNotes ) const
 {
     if (ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size()))
         if (maTabs[nTab])
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index e0f42e1581de..efa77beb3377 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -947,7 +947,7 @@ void ScDPObject::RefreshAfterLoad()
         ++nInitial;
 
     if ( nInitial + 1 < nOutRows &&
-        pDoc->IsBlockEmpty( nTab, nFirstCol, nFirstRow + nInitial, nFirstCol, 
nFirstRow + nInitial ) &&
+        pDoc->IsBlockEmpty( nFirstCol, nFirstRow + nInitial, nFirstCol, 
nFirstRow + nInitial, nTab ) &&
         aOutRange.aEnd.Col() > nFirstCol )
     {
         nHeaderRows = nInitial;
diff --git a/sc/source/filter/excel/xistyle.cxx 
b/sc/source/filter/excel/xistyle.cxx
index f06cb4790aa7..7361c7ee612d 100644
--- a/sc/source/filter/excel/xistyle.cxx
+++ b/sc/source/filter/excel/xistyle.cxx
@@ -2067,7 +2067,7 @@ void XclImpXFRangeBuffer::Finalize()
             SetBorderLine( rRange, nScTab, SvxBoxItemLine::BOTTOM );
         // do merge
         if( bMultiCol || bMultiRow )
-            rDoc.DoMerge( nScTab, rStart.Col(), rStart.Row(), rEnd.Col(), 
rEnd.Row() );
+            rDoc.DoMerge( rStart.Col(), rStart.Row(), rEnd.Col(), rEnd.Row(), 
nScTab );
         // #i93609# merged range in a single row: test if manual row height is 
needed
         if( !bMultiRow )
         {
diff --git a/sc/source/filter/lotus/lotimpop.cxx 
b/sc/source/filter/lotus/lotimpop.cxx
index ed06a7ab373f..df7f17380ea6 100644
--- a/sc/source/filter/lotus/lotimpop.cxx
+++ b/sc/source/filter/lotus/lotimpop.cxx
@@ -454,7 +454,7 @@ void ImportLotus::Row_( const sal_uInt16 nRecLen )
                 if (rD.HasData(nColCnt, nRow, nDestTab))
                 {
                     // new Center after previous Center
-                    rD.DoMerge(nDestTab, nCenterStart, nRow, nCenterEnd, nRow);
+                    rD.DoMerge( nCenterStart, nRow, nCenterEnd, nRow, 
nDestTab);
                     nCenterStart = nColCnt;
                 }
             }
@@ -471,7 +471,7 @@ void ImportLotus::Row_( const sal_uInt16 nRecLen )
             if( bCenter )
             {
                 // possibly reset old Center
-                rD.DoMerge(nDestTab, nCenterStart, nRow, nCenterEnd, nRow);
+                rD.DoMerge( nCenterStart, nRow, nCenterEnd, nRow, nDestTab );
                 bCenter = false;
             }
         }
@@ -484,6 +484,6 @@ void ImportLotus::Row_( const sal_uInt16 nRecLen )
 
     if( bCenter )
         // possibly reset old Center
-        rD.DoMerge(nDestTab, nCenterStart, nRow, nCenterEnd, nRow);
+        rD.DoMerge( nCenterStart, nRow, nCenterEnd, nRow, nDestTab );
 }
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/oox/sheetdatabuffer.cxx 
b/sc/source/filter/oox/sheetdatabuffer.cxx
index 63b9b4f11145..244d70b62844 100644
--- a/sc/source/filter/oox/sheetdatabuffer.cxx
+++ b/sc/source/filter/oox/sheetdatabuffer.cxx
@@ -815,7 +815,7 @@ void SheetDataBuffer::applyCellMerging( const ScRange& 
rRange )
         lcl_SetBorderLine( rDoc, rRange, getSheetIndex(), 
SvxBoxItemLine::BOTTOM );
     // do merge
     if( bMultiCol || bMultiRow )
-        rDoc.DoMerge( getSheetIndex(), rStart.Col(), rStart.Row(), rEnd.Col(), 
rEnd.Row() );
+        rDoc.DoMerge( rStart.Col(), rStart.Row(), rEnd.Col(), rEnd.Row(), 
getSheetIndex() );
 }
 
 } // namespace oox
diff --git a/sc/source/filter/xml/xmlcelli.cxx 
b/sc/source/filter/xml/xmlcelli.cxx
index 8e2a7711ac3b..0f47ae25c96b 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -719,8 +719,8 @@ void ScXMLTableRowCellContext::DoMerge( const ScAddress& 
rScAddress, const SCCOL
                        mergeToCol <= pDoc->MaxCol() && mergeToRow <= 
pDoc->MaxRow();
     if( bInBounds )
     {
-        pDoc->DoMerge( rScAddress.Tab(),
-            rScAddress.Col(), rScAddress.Row(), mergeToCol, mergeToRow );
+        pDoc->DoMerge( rScAddress.Col(), rScAddress.Row(),
+                       mergeToCol, mergeToRow, rScAddress.Tab() );
     }
 }
 
diff --git a/sc/source/ui/docshell/dbdocfun.cxx 
b/sc/source/ui/docshell/dbdocfun.cxx
index 3f6b1b804978..ee59f36232ae 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -1553,8 +1553,8 @@ bool ScDBDocFunc::CreatePivotTable(const ScDPObject& 
rDPObj, bool bRecord, bool
     if (!bApi)
     {
         bool bEmpty = rDoc.IsBlockEmpty(
-            aNewOut.aStart.Tab(), aNewOut.aStart.Col(), aNewOut.aStart.Row(),
-            aNewOut.aEnd.Col(), aNewOut.aEnd.Row());
+            aNewOut.aStart.Col(), aNewOut.aStart.Row(),
+            aNewOut.aEnd.Col(), aNewOut.aEnd.Row(), aNewOut.aStart.Tab() );
 
         if (!bEmpty)
         {
diff --git a/sc/source/ui/docshell/docfunc.cxx 
b/sc/source/ui/docshell/docfunc.cxx
index eee39e0e81f5..1619fa781047 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -4976,9 +4976,9 @@ bool ScDocFunc::MergeCells( const ScCellMergeOption& 
rOption, bool bContents, bo
     for (const SCTAB nTab : rOption.maTabs)
     {
         bool bIsBlockEmpty = ( nStartRow == nEndRow )
-                             ? rDoc.IsBlockEmpty( nTab, nStartCol+1,nStartRow, 
nEndCol,nEndRow, true )
-                             : rDoc.IsBlockEmpty( nTab, nStartCol,nStartRow+1, 
nStartCol,nEndRow, true ) &&
-                               rDoc.IsBlockEmpty( nTab, nStartCol+1,nStartRow, 
nEndCol,nEndRow, true );
+                             ? rDoc.IsBlockEmpty( nStartCol+1,nStartRow, 
nEndCol,nEndRow, nTab, true )
+                             : rDoc.IsBlockEmpty( nStartCol,nStartRow+1, 
nStartCol,nEndRow, nTab, true ) &&
+                               rDoc.IsBlockEmpty( nStartCol+1,nStartRow, 
nEndCol,nEndRow, nTab, true );
         bool bNeedContents = bContents && !bIsBlockEmpty;
         bool bNeedEmpty = bEmptyMergedCells && !bIsBlockEmpty && 
!bNeedContents; // if DoMergeContents then cells are emptied
 
@@ -4999,10 +4999,10 @@ bool ScDocFunc::MergeCells( const ScCellMergeOption& 
rOption, bool bContents, bo
         }
 
         if (bNeedContents)
-            rDoc.DoMergeContents( nTab, nStartCol,nStartRow, nEndCol,nEndRow );
+            rDoc.DoMergeContents( nStartCol,nStartRow, nEndCol,nEndRow,  nTab 
);
         else if ( bNeedEmpty )
-            rDoc.DoEmptyBlock( nTab, nStartCol,nStartRow, nEndCol,nEndRow );
-        rDoc.DoMerge( nTab, nStartCol,nStartRow, nEndCol,nEndRow );
+            rDoc.DoEmptyBlock( nStartCol,nStartRow, nEndCol,nEndRow, nTab );
+        rDoc.DoMerge( nStartCol,nStartRow, nEndCol,nEndRow, nTab );
 
         if (rOption.mbCenter)
         {
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index e7982d2f877b..24869ab5b6f3 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -1751,7 +1751,7 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm )
             aRange.aEnd.SetRow( nRow );
 
             if ( !mbApi && nStartCol != nEndCol &&
-                 !rDoc.IsBlockEmpty( nTab, nStartCol + 1, nStartRow, nEndCol, 
nRow ) )
+                 !rDoc.IsBlockEmpty( nStartCol + 1, nStartRow, nEndCol, nRow, 
nTab ) )
             {
                 ScReplaceWarnBox aBox(ScDocShell::GetActiveDialogParent());
                 if (aBox.run() != RET_YES)
diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx
index 57ce491c6fcb..4aa05b5780e8 100644
--- a/sc/source/ui/undo/undoblk3.cxx
+++ b/sc/source/ui/undo/undoblk3.cxx
@@ -678,9 +678,9 @@ void ScUndoMerge::DoChange( bool bUndo ) const
         else
         {
             // repeat merge, but do not remove note captions (will be done by 
drawing redo below)
-            rDoc.DoMerge( aRange.aStart.Tab(),
-                           aRange.aStart.Col(), aRange.aStart.Row(),
-                           aRange.aEnd.Col(),   aRange.aEnd.Row(), false );
+            rDoc.DoMerge( aRange.aStart.Col(), aRange.aStart.Row(),
+                          aRange.aEnd.Col(),   aRange.aEnd.Row(),
+                          aRange.aStart.Tab(), false );
 
             if (maOption.mbCenter)
             {
@@ -709,9 +709,9 @@ void ScUndoMerge::DoChange( bool bUndo ) const
         // redo -> merge contents again
         else if (!bUndo && mbMergeContents)
         {
-            rDoc.DoMergeContents( aRange.aStart.Tab(),
-                                   aRange.aStart.Col(), aRange.aStart.Row(),
-                                   aRange.aEnd.Col(), aRange.aEnd.Row() );
+            rDoc.DoMergeContents( aRange.aStart.Col(), aRange.aStart.Row(),
+                                  aRange.aEnd.Col(), aRange.aEnd.Row(),
+                                  aRange.aStart.Tab() );
         }
 
         if (bUndo)
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 1b1953b18e95..17c4936567f9 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -1500,15 +1500,17 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
                                         CellShiftDisabledFlags nDisableShiftY 
= CellShiftDisabledFlags::NONE;
 
                                         //check if horizontal shift will fit
-                                        if ( 
!rData.GetDocument().IsBlockEmpty( nStartTab,
+                                        if ( !rData.GetDocument().IsBlockEmpty(
                                                     rDoc.MaxCol() - 
nRangeSizeX, nStartY,
-                                                    rDoc.MaxCol(), nStartY + 
nRangeSizeY ) )
+                                                    rDoc.MaxCol(), nStartY + 
nRangeSizeY,
+                                                    nStartTab ) )
                                             nDisableShiftX = 
CellShiftDisabledFlags::Right;
 
                                         //check if vertical shift will fit
-                                        if ( 
!rData.GetDocument().IsBlockEmpty( nStartTab,
+                                        if ( !rData.GetDocument().IsBlockEmpty(
                                                     nStartX, rDoc.MaxRow() - 
nRangeSizeY,
-                                                    nStartX + nRangeSizeX, 
rDoc.MaxRow() ) )
+                                                    nStartX + nRangeSizeX, 
rDoc.MaxRow(),
+                                                    nStartTab ) )
                                             nDisableShiftY = 
CellShiftDisabledFlags::Down;
 
                                         if ( nDisableShiftX != 
CellShiftDisabledFlags::NONE || nDisableShiftY != CellShiftDisabledFlags::NONE)
diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index 5d8a94e889fb..bc9dc416b1d5 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -99,9 +99,9 @@ static bool lcl_GetTextToColumnsRange( const ScViewData& 
rData, ScRange& rRange,
 
     if ( bDoEmptyCheckOnly )
     {
-        if ( bRet && rDoc.IsBlockEmpty( rRange.aStart.Tab(), 
rRange.aStart.Col(),
-                                         rRange.aStart.Row(), 
rRange.aEnd.Col(),
-                                         rRange.aEnd.Row() ) )
+        if ( bRet && rDoc.IsBlockEmpty( rRange.aStart.Col(), 
rRange.aStart.Row(),
+                                        rRange.aEnd.Col(),  rRange.aEnd.Row(),
+                                        rRange.aStart.Tab() ) )
         {
             bRet = false;
         }
diff --git a/sc/source/ui/view/dbfunc.cxx b/sc/source/ui/view/dbfunc.cxx
index 6cca326c45d3..24376b5097ea 100644
--- a/sc/source/ui/view/dbfunc.cxx
+++ b/sc/source/ui/view/dbfunc.cxx
@@ -339,9 +339,8 @@ void ScDBFunc::ToggleAutoFilter()
     }
     else                                    // show filter buttons
     {
-        if ( !rDoc.IsBlockEmpty( nTab,
-                                 aParam.nCol1, aParam.nRow1,
-                                 aParam.nCol2, aParam.nRow2 ) )
+        if ( !rDoc.IsBlockEmpty( aParam.nCol1, aParam.nRow1,
+                                 aParam.nCol2, aParam.nRow2, nTab ) )
         {
             if (!bHeader)
             {
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index fc75fb3bbc80..92e593a9dcca 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -3020,7 +3020,7 @@ static void lcl_SetHidden( const ScDocument& rDoc, SCTAB 
nPrintTab, ScPageRowEnt
     {
         OSL_ENSURE(i < rPageEndX.size(), "vector access error for aPageEndX");
         SCCOL nEndCol = rPageEndX[i];
-        if ( rDoc.IsPrintEmpty( nPrintTab, nStartCol, nStartRow, nEndCol, 
nEndRow,
+        if ( rDoc.IsPrintEmpty( nStartCol, nStartRow, nEndCol, nEndRow, 
nPrintTab,
                                     bLeftIsEmpty, &aTempRange, &aTempRect ) )
         {
             rPageRowEntry.SetHidden(i);
@@ -3165,7 +3165,7 @@ void PrintPageRanges::calculate(ScDocument& rDoc,
             (*m_xPageEndY)[m_nTotalY] = nRow - 1;
             ++m_nTotalY;
 
-            if (!bSkipEmpty || !rDoc.IsPrintEmpty(nPrintTab, nStartCol, 
nPageStartRow, nEndCol, nRow-1))
+            if (!bSkipEmpty || !rDoc.IsPrintEmpty(nStartCol, nPageStartRow, 
nEndCol, nRow-1, nPrintTab))
             {
                 auto& rPageRow = (*m_xPageRows)[m_nPagesY];
                 rPageRow.SetStartRow(nPageStartRow);
@@ -3209,7 +3209,7 @@ void PrintPageRanges::calculate(ScDocument& rDoc,
     (*m_xPageEndY)[m_nTotalY] = nEndRow;
     ++m_nTotalY;
 
-    if (!bSkipEmpty || !rDoc.IsPrintEmpty(nPrintTab, nStartCol, nPageStartRow, 
nEndCol, nEndRow))
+    if (!bSkipEmpty || !rDoc.IsPrintEmpty(nStartCol, nPageStartRow, nEndCol, 
nEndRow, nPrintTab))
     {
         auto& rPageRow = (*m_xPageRows)[m_nPagesY];
         rPageRow.SetStartRow(nPageStartRow);
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 58c0e9a3c84f..97f80622fa23 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -2416,8 +2416,8 @@ void ScTabView::PaintArea( SCCOL nStartCol, SCROW 
nStartRow, SCCOL nEndCol, SCRO
             // ScColumn::IsEmptyBlock has to be optimized for this
             //  (switch to Search() )
             //!if ( nCol1 > 0 && !aViewData.GetDocument()->IsBlockEmpty(
-            //!                     aViewData.GetTabNo(),
-            //!                     0, nRow1, nCol1-1, nRow2 ) )
+            //!                     0, nRow1, nCol1-1, nRow2.
+            //!                     aViewData.GetTabNo() ) )
             tools::Long nMarkPixel = static_cast<tools::Long>( 
SC_CLIPMARK_SIZE * aViewData.GetPPTX() );
             aStart.AdjustX( -(nMarkPixel * nLayoutSign) );
         }
diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx
index 5ea8701a0dbe..e4d95ed5541d 100644
--- a/sc/source/ui/view/tabvwshc.cxx
+++ b/sc/source/ui/view/tabvwshc.cxx
@@ -680,9 +680,8 @@ OUString ScTabViewShell::DoAutoSum(bool& rRangeFinder, 
bool& rSubTotal, const Op
         for ( size_t i = 0; i < nCount; ++i )
         {
             const ScRange & rRange( aMarkRangeList[i] );
-            if ( rDoc.IsBlockEmpty( rRange.aStart.Tab(),
-                 rRange.aStart.Col(), rRange.aStart.Row(),
-                 rRange.aEnd.Col(), rRange.aEnd.Row() ) )
+            if ( rDoc.IsBlockEmpty( rRange.aStart.Col(), rRange.aStart.Row(),
+                     rRange.aEnd.Col(), rRange.aEnd.Row(),  
rRange.aStart.Tab() ) )
             {
                 bEmpty = true;
                 break;
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 5d7d62d4ad84..648af012aaeb 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -674,8 +674,8 @@ bool ScViewFunc::AutoSum( const ScRange& rRange, bool 
bSubTotal, bool bSetCursor
         return false;
     }
 
-    const bool bEndRowEmpty = rDoc.IsBlockEmpty( nTab, nStartCol, nEndRow, 
nEndCol, nEndRow );
-    const bool bEndColEmpty = rDoc.IsBlockEmpty( nTab, nEndCol, nStartRow, 
nEndCol, nEndRow );
+    const bool bEndRowEmpty = rDoc.IsBlockEmpty( nStartCol, nEndRow, nEndCol, 
nEndRow, nTab );
+    const bool bEndColEmpty = rDoc.IsBlockEmpty( nEndCol, nStartRow, nEndCol, 
nEndRow, nTab );
     bool bRow = ( nStartRow != nEndRow ) && ( bEndRowEmpty || !bEndColEmpty );
     bool bCol = ( nStartCol != nEndCol ) && ( bEndColEmpty || nStartRow == 
nEndRow );
 
@@ -686,7 +686,7 @@ bool ScViewFunc::AutoSum( const ScRange& rRange, bool 
bSubTotal, bool bSetCursor
         if ( nInsRow < rDoc.MaxRow() )
         {
             ++nInsRow;
-            while ( !rDoc.IsBlockEmpty( nTab, nStartCol, nInsRow, nEndCol, 
nInsRow ) )
+            while ( !rDoc.IsBlockEmpty( nStartCol, nInsRow, nEndCol, nInsRow, 
nTab ) )
             {
                 if ( nInsRow < rDoc.MaxRow() )
                 {
@@ -712,7 +712,7 @@ bool ScViewFunc::AutoSum( const ScRange& rRange, bool 
bSubTotal, bool bSetCursor
         if ( nInsCol < rDoc.MaxCol() )
         {
             ++nInsCol;
-            while ( !rDoc.IsBlockEmpty( nTab, nInsCol, nStartRow, nInsCol, 
nEndRow ) )
+            while ( !rDoc.IsBlockEmpty( nInsCol, nStartRow, nInsCol, nEndRow, 
nTab ) )
             {
                 if ( nInsCol < rDoc.MaxCol() )
                 {
@@ -764,7 +764,7 @@ bool ScViewFunc::AutoSum( const ScRange& rRange, bool 
bSubTotal, bool bSetCursor
 
         for ( SCCOL nCol = nStartCol; nCol <= nEndCol; ++nCol )
         {
-            if ( !rDoc.IsBlockEmpty( nTab, nCol, nStartRow, nCol, nSumEndRow ) 
)
+            if ( !rDoc.IsBlockEmpty( nCol, nStartRow, nCol, nSumEndRow, nTab ) 
)
             {
                 ScRangeList aRangeList;
                 // Include the originally selected start row.
@@ -801,7 +801,7 @@ bool ScViewFunc::AutoSum( const ScRange& rRange, bool 
bSubTotal, bool bSetCursor
 
         for ( SCROW nRow = nStartRow; nRow <= nEndRow; ++nRow )
         {
-            if ( !rDoc.IsBlockEmpty( nTab, nStartCol, nRow, nSumEndCol, nRow ) 
)
+            if ( !rDoc.IsBlockEmpty( nStartCol, nRow, nSumEndCol, nRow, nTab ) 
)
             {
                 ScRangeList aRangeList;
                 // Include the originally selected start column.
@@ -1763,7 +1763,7 @@ void ScViewFunc::FillCrossDblClick()
         return;
 
     // Make sure the selection is not empty
-    if ( rDoc.IsBlockEmpty( nTab, nStartX, nStartY, nEndX, nEndY ) )
+    if ( rDoc.IsBlockEmpty( nStartX, nStartY, nEndX, nEndY, nTab ) )
         return;
 
     // If there is data in all columns immediately below the selection then
@@ -1824,7 +1824,7 @@ void ScViewFunc::FillCrossDblClick()
         bDataFound = (rDoc.HasData( nMovX, nStartY, nTab) && rDoc.HasData( 
nMovX, nStartY + 1, nTab));
     }
 
-    if (!(bDataFound && rDoc.IsBlockEmpty( nTab, nStartX, nEndY + 1, nEndX, 
nEndY + 1, true)))
+    if (!(bDataFound && rDoc.IsBlockEmpty( nStartX, nEndY + 1, nEndX, nEndY + 
1, nTab, true)))
         return;
 
     // Get end of data left or right.
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index 9bb69513a8e8..73b32c0e162e 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -846,8 +846,8 @@ bool checkDestRangeForOverwrite(const ScRangeList& 
rDestRanges, const ScDocument
         {
             const ScRange& rRange = rDestRanges[i];
             bIsEmpty = rDoc.IsBlockEmpty(
-                rTab, rRange.aStart.Col(), rRange.aStart.Row(),
-                rRange.aEnd.Col(), rRange.aEnd.Row());
+                rRange.aStart.Col(), rRange.aStart.Row(),
+                rRange.aEnd.Col(), rRange.aEnd.Row(), rTab );
         }
         if (!bIsEmpty)
             break;

Reply via email to