sc/inc/address.hxx                                   |   19 ++++-
 sc/inc/bigrange.hxx                                  |    8 +-
 sc/inc/rangelst.hxx                                  |    2 
 sc/qa/unit/rangelst_test.cxx                         |   66 +++++++++----------
 sc/qa/unit/subsequent_export_test.cxx                |    8 +-
 sc/qa/unit/subsequent_filters_test.cxx               |    6 -
 sc/qa/unit/ucalc.cxx                                 |    6 -
 sc/source/core/data/bcaslot.cxx                      |   10 +-
 sc/source/core/data/column.cxx                       |    2 
 sc/source/core/data/conditio.cxx                     |    2 
 sc/source/core/data/documen2.cxx                     |    8 +-
 sc/source/core/data/documen3.cxx                     |    6 -
 sc/source/core/data/document10.cxx                   |    2 
 sc/source/core/data/drwlayer.cxx                     |   16 ++--
 sc/source/core/data/formulacell.cxx                  |   12 +--
 sc/source/core/data/tabprotection.cxx                |    2 
 sc/source/core/tool/address.cxx                      |    9 --
 sc/source/core/tool/chgtrack.cxx                     |   40 +++++------
 sc/source/core/tool/compiler.cxx                     |    2 
 sc/source/core/tool/dbdata.cxx                       |    2 
 sc/source/core/tool/interpr4.cxx                     |    4 -
 sc/source/core/tool/listenerquery.cxx                |    2 
 sc/source/core/tool/rangelst.cxx                     |   16 ++--
 sc/source/core/tool/reftokenhelper.cxx               |    2 
 sc/source/core/tool/refupdat.cxx                     |    4 -
 sc/source/core/tool/token.cxx                        |   42 ++++++------
 sc/source/filter/excel/xecontent.cxx                 |    2 
 sc/source/filter/html/htmlexp.cxx                    |    2 
 sc/source/filter/html/htmlimp.cxx                    |    2 
 sc/source/filter/xml/xmlsubti.cxx                    |    2 
 sc/source/ui/Accessibility/AccessibleCell.cxx        |    2 
 sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx |    8 +-
 sc/source/ui/dbgui/PivotLayoutDialog.cxx             |    2 
 sc/source/ui/docshell/dbdocfun.cxx                   |    2 
 sc/source/ui/docshell/docfunc.cxx                    |    8 +-
 sc/source/ui/docshell/docsh3.cxx                     |    4 -
 sc/source/ui/docshell/externalrefmgr.cxx             |    4 -
 sc/source/ui/unoobj/cellsuno.cxx                     |    2 
 sc/source/ui/vba/vbaapplication.cxx                  |    4 -
 sc/source/ui/vba/vbahyperlinks.cxx                   |    2 
 sc/source/ui/view/dbfunc4.cxx                        |    2 
 sc/source/ui/view/gridwin.cxx                        |    2 
 sc/source/ui/view/gridwin5.cxx                       |    4 -
 sc/source/ui/view/pfuncache.cxx                      |    2 
 sc/source/ui/view/prevloc.cxx                        |    2 
 sc/source/ui/view/spellcheckcontext.cxx              |    2 
 sc/source/ui/view/tabview3.cxx                       |    4 -
 47 files changed, 182 insertions(+), 180 deletions(-)

New commits:
commit 9809441f05e4dbac8e12b042fd4391f1a7580643
Author:     Luboš Luňák <l.lu...@collabora.com>
AuthorDate: Mon Dec 6 01:03:50 2021 +0100
Commit:     Luboš Luňák <l.lu...@collabora.com>
CommitDate: Mon Dec 6 12:21:00 2021 +0100

    rename In() to Contains()
    
    Similarly to b22d4785310eac35696d, 'A.In(B)' makes it unclear
    whether the check is for A in B or B in A, as it's actually
    the latter.
    
    Change-Id: Iaccc41d40f4bb105a44c1bb8d9211c06d1a3c127
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126392
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lu...@collabora.com>

diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx
index dca071604627..725e696059db 100644
--- a/sc/inc/address.hxx
+++ b/sc/inc/address.hxx
@@ -547,8 +547,9 @@ public:
     {
         return aStart.IsValid() && aEnd.IsValid();
     }
-    inline bool In( const ScAddress& ) const;   ///< is Address& in Range?
-    inline bool In( const ScRange& ) const;     ///< is Range& in Range?
+    inline bool Contains( const ScAddress& ) const;   ///< is Address& fully 
in Range?
+    inline bool Contains( const ScRange& ) const;     ///< is Range& fully in 
Range?
+    inline bool Intersects( const ScRange& rRange ) const;    // do two ranges 
intersect?
 
     ScRefFlags Parse( const OUString&, const ScDocument&,
                                    const ScAddress::Details& rDetails = 
ScAddress::detailsOOOa1,
@@ -640,7 +641,6 @@ public:
     void IncRowIfNotLessThan(const ScDocument& rDoc, SCROW nStartRow, SCROW 
nOffset);
 
     void ExtendTo( const ScRange& rRange );
-    bool Intersects( const ScRange& rRange ) const;    // do two ranges 
intersect?
 
     ScRange Intersection( const ScRange& rOther ) const;
 
@@ -729,7 +729,7 @@ inline bool ScRange::operator<=( const ScRange& rRange ) 
const
     return operator<( rRange ) || operator==( rRange );
 }
 
-inline bool ScRange::In( const ScAddress& rAddress ) const
+inline bool ScRange::Contains( const ScAddress& rAddress ) const
 {
     return
         aStart.Col() <= rAddress.Col() && rAddress.Col() <= aEnd.Col() &&
@@ -737,7 +737,7 @@ inline bool ScRange::In( const ScAddress& rAddress ) const
         aStart.Tab() <= rAddress.Tab() && rAddress.Tab() <= aEnd.Tab();
 }
 
-inline bool ScRange::In( const ScRange& rRange ) const
+inline bool ScRange::Contains( const ScRange& rRange ) const
 {
     return
         aStart.Col() <= rRange.aStart.Col() && rRange.aEnd.Col() <= aEnd.Col() 
&&
@@ -745,6 +745,15 @@ inline bool ScRange::In( const ScRange& rRange ) const
         aStart.Tab() <= rRange.aStart.Tab() && rRange.aEnd.Tab() <= aEnd.Tab();
 }
 
+inline bool ScRange::Intersects( const ScRange& rRange ) const
+{
+    return !(
+        std::min( aEnd.Col(), rRange.aEnd.Col() ) < std::max( aStart.Col(), 
rRange.aStart.Col() )
+     || std::min( aEnd.Row(), rRange.aEnd.Row() ) < std::max( aStart.Row(), 
rRange.aStart.Row() )
+     || std::min( aEnd.Tab(), rRange.aEnd.Tab() ) < std::max( aStart.Tab(), 
rRange.aStart.Tab() )
+        );
+}
+
 inline size_t ScRange::hashArea() const
 {
 #if SAL_TYPES_SIZEOFPOINTER == 8
diff --git a/sc/inc/bigrange.hxx b/sc/inc/bigrange.hxx
index a935681c58b8..979c861ba07f 100644
--- a/sc/inc/bigrange.hxx
+++ b/sc/inc/bigrange.hxx
@@ -137,8 +137,8 @@ public:
                     { return ScRange( aStart.MakeAddress(),
                         aEnd.MakeAddress() ); }
 
-    inline bool In( const ScBigAddress& ) const;    ///< is Address& in range?
-    inline bool In( const ScBigRange& ) const;      ///< is Range& in range?
+    inline bool Contains( const ScBigAddress& ) const;    ///< is Address& in 
range?
+    inline bool Contains( const ScBigRange& ) const;      ///< is Range& in 
range?
     inline bool Intersects( const ScBigRange& ) const;  ///< do two ranges 
overlap?
 
     ScBigRange&     operator=( const ScBigRange& r )
@@ -150,7 +150,7 @@ public:
                         { return !operator==( r ); }
 };
 
-inline bool ScBigRange::In( const ScBigAddress& rAddr ) const
+inline bool ScBigRange::Contains( const ScBigAddress& rAddr ) const
 {
     return
         aStart.Col() <= rAddr.Col() && rAddr.Col() <= aEnd.Col() &&
@@ -158,7 +158,7 @@ inline bool ScBigRange::In( const ScBigAddress& rAddr ) 
const
         aStart.Tab() <= rAddr.Tab() && rAddr.Tab() <= aEnd.Tab();
 }
 
-inline bool ScBigRange::In( const ScBigRange& r ) const
+inline bool ScBigRange::Contains( const ScBigRange& r ) const
 {
     return
         aStart.Col() <= r.aStart.Col() && r.aEnd.Col() <= aEnd.Col() &&
diff --git a/sc/inc/rangelst.hxx b/sc/inc/rangelst.hxx
index 5489ab44b1b9..9052b086680f 100644
--- a/sc/inc/rangelst.hxx
+++ b/sc/inc/rangelst.hxx
@@ -72,7 +72,7 @@ public:
     bool            operator==( const ScRangeList& ) const;
     bool            operator!=( const ScRangeList& r ) const;
     bool            Intersects( const ScRange& ) const;
-    bool            In( const ScRange& ) const;
+    bool            Contains( const ScRange& ) const;
     size_t          GetCellCount() const;
     ScAddress       GetTopLeftCorner() const;
 
diff --git a/sc/qa/unit/rangelst_test.cxx b/sc/qa/unit/rangelst_test.cxx
index 4239cc91e8a9..6957891c653a 100644
--- a/sc/qa/unit/rangelst_test.cxx
+++ b/sc/qa/unit/rangelst_test.cxx
@@ -121,9 +121,9 @@ void Test::testDeleteArea_4Ranges()
         for(SCROW nRow = 0; nRow <= 5; ++nRow)
         {
             if((nCol == 2 || nCol == 3) && ( nRow == 2 || nRow == 3))
-                CPPUNIT_ASSERT(!aList.In(ScRange(nCol, nRow, 0)));
+                CPPUNIT_ASSERT(!aList.Contains(ScRange(nCol, nRow, 0)));
             else
-                CPPUNIT_ASSERT(aList.In(ScRange(nCol, nRow, 0)));
+                CPPUNIT_ASSERT(aList.Contains(ScRange(nCol, nRow, 0)));
         }
     }
 }
@@ -139,9 +139,9 @@ void Test::testDeleteArea_3Ranges()
         for(SCROW nRow = 1; nRow <= 6; ++nRow)
         {
             if((nRow == 3 || nRow == 4) && (nCol >= 3))
-                CPPUNIT_ASSERT(!aList.In(ScRange(nCol, nRow, 0)));
+                CPPUNIT_ASSERT(!aList.Contains(ScRange(nCol, nRow, 0)));
             else
-                CPPUNIT_ASSERT(aList.In(ScRange(nCol, nRow, 0)));
+                CPPUNIT_ASSERT(aList.Contains(ScRange(nCol, nRow, 0)));
         }
     }
 
@@ -162,9 +162,9 @@ void Test::testDeleteArea_3Ranges_Case2()
         for (SCROW nRow = 1; nRow <= 6; ++nRow)
         {
             if ((1 <= nCol && nCol <= 2) && (2 <= nRow && nRow <= 4))
-                CPPUNIT_ASSERT(!aList.In(ScRange(nCol, nRow, 0)));
+                CPPUNIT_ASSERT(!aList.Contains(ScRange(nCol, nRow, 0)));
             else
-                CPPUNIT_ASSERT(aList.In(ScRange(nCol, nRow, 0)));
+                CPPUNIT_ASSERT(aList.Contains(ScRange(nCol, nRow, 0)));
         }
     }
 }
@@ -182,9 +182,9 @@ void Test::testDeleteArea_3Ranges_Case3()
         for (SCROW nRow = 5; nRow <= 11; ++nRow)
         {
             if ((3 <= nCol && nCol <= 4) && (5 <= nRow && nRow <= 8))
-                CPPUNIT_ASSERT(!aList.In(ScRange(nCol, nRow, 0)));
+                CPPUNIT_ASSERT(!aList.Contains(ScRange(nCol, nRow, 0)));
             else
-                CPPUNIT_ASSERT(aList.In(ScRange(nCol, nRow, 0)));
+                CPPUNIT_ASSERT(aList.Contains(ScRange(nCol, nRow, 0)));
         }
     }
 }
@@ -202,9 +202,9 @@ void Test::testDeleteArea_3Ranges_Case4()
         for (SCROW nRow = 5; nRow <= 11; ++nRow)
         {
             if ((3 <= nCol && nCol <= 4) && 5 == nRow )
-                CPPUNIT_ASSERT(!aList.In(ScRange(nCol, nRow, 0)));
+                CPPUNIT_ASSERT(!aList.Contains(ScRange(nCol, nRow, 0)));
             else
-                CPPUNIT_ASSERT(aList.In(ScRange(nCol, nRow, 0)));
+                CPPUNIT_ASSERT(aList.Contains(ScRange(nCol, nRow, 0)));
         }
     }
 }
@@ -222,9 +222,9 @@ void Test::testDeleteArea_3Ranges_Case5()
         for (SCROW nRow = 5; nRow <= 11; ++nRow)
         {
             if ( nCol == 6 && (7 <= nRow && nRow <= 9))
-                CPPUNIT_ASSERT(!aList.In(ScRange(nCol, nRow, 0)));
+                CPPUNIT_ASSERT(!aList.Contains(ScRange(nCol, nRow, 0)));
             else
-                CPPUNIT_ASSERT(aList.In(ScRange(nCol, nRow, 0)));
+                CPPUNIT_ASSERT(aList.Contains(ScRange(nCol, nRow, 0)));
         }
     }
 }
@@ -244,9 +244,9 @@ void Test::testDeleteArea_2Ranges()
         for(SCROW nRow = 0; nRow <= 5; ++nRow)
         {
             if(nCol>=4 && nRow >= 4)
-                CPPUNIT_ASSERT(!aList.In(ScRange(nCol, nRow, 0)));
+                CPPUNIT_ASSERT(!aList.Contains(ScRange(nCol, nRow, 0)));
             else
-                CPPUNIT_ASSERT(aList.In(ScRange(nCol, nRow, 0)));
+                CPPUNIT_ASSERT(aList.Contains(ScRange(nCol, nRow, 0)));
         }
     }
 }
@@ -259,9 +259,9 @@ void Test::testDeleteArea_2Ranges_Case2()
     for(SCROW nRow = 1; nRow <= 5; ++nRow)
     {
         if(nRow == 3)
-            CPPUNIT_ASSERT(!aList.In(ScRange(1,3,0)));
+            CPPUNIT_ASSERT(!aList.Contains(ScRange(1,3,0)));
         else
-            CPPUNIT_ASSERT(aList.In(ScRange(1,nRow,0)));
+            CPPUNIT_ASSERT(aList.Contains(ScRange(1,nRow,0)));
     }
     CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(4), aList.GetCellCount());
 }
@@ -278,9 +278,9 @@ void Test::testDeleteArea_2Ranges_Case3()
         for (SCROW nRow = 5; nRow <= 10; ++nRow)
         {
             if (nCol == 2 && (5 <= nRow && nRow <= 7))
-                CPPUNIT_ASSERT(!aList.In(ScRange(nCol,nRow,0)));
+                CPPUNIT_ASSERT(!aList.Contains(ScRange(nCol,nRow,0)));
             else
-                CPPUNIT_ASSERT(aList.In(ScRange(nCol,nRow,0)));
+                CPPUNIT_ASSERT(aList.Contains(ScRange(nCol,nRow,0)));
         }
     }
 }
@@ -297,9 +297,9 @@ void Test::testDeleteArea_2Ranges_Case4()
         for (SCROW nRow = 3; nRow <= 7; ++nRow)
         {
             if (nCol == 2 && (3 <= nRow && nRow <= 5))
-                CPPUNIT_ASSERT(!aList.In(ScRange(nCol,nRow,0)));
+                CPPUNIT_ASSERT(!aList.Contains(ScRange(nCol,nRow,0)));
             else
-                CPPUNIT_ASSERT(aList.In(ScRange(nCol,nRow,0)));
+                CPPUNIT_ASSERT(aList.Contains(ScRange(nCol,nRow,0)));
         }
     }
 }
@@ -316,9 +316,9 @@ void Test::testDeleteArea_2Ranges_Case5()
         for(SCROW nRow = 2; nRow <= 5; ++nRow)
         {
             if(nRow == 5 && 4 <= nCol)
-                CPPUNIT_ASSERT(!aList.In(ScRange(nCol, nRow, 0)));
+                CPPUNIT_ASSERT(!aList.Contains(ScRange(nCol, nRow, 0)));
             else
-                CPPUNIT_ASSERT(aList.In(ScRange(nCol, nRow, 0)));
+                CPPUNIT_ASSERT(aList.Contains(ScRange(nCol, nRow, 0)));
         }
     }
 }
@@ -335,9 +335,9 @@ void Test::testDeleteArea_2Ranges_Case6()
         for(SCROW nRow = 2; nRow <= 5; ++nRow)
         {
             if(nRow == 2 && 4 <= nCol)
-                CPPUNIT_ASSERT(!aList.In(ScRange(nCol, nRow, 0)));
+                CPPUNIT_ASSERT(!aList.Contains(ScRange(nCol, nRow, 0)));
             else
-                CPPUNIT_ASSERT(aList.In(ScRange(nCol, nRow, 0)));
+                CPPUNIT_ASSERT(aList.Contains(ScRange(nCol, nRow, 0)));
         }
     }
 }
@@ -354,9 +354,9 @@ void Test::testDeleteArea_2Ranges_Case7()
         for(SCROW nRow = 2; nRow <= 5; ++nRow)
         {
             if(nRow == 5 && nCol == 2)
-                CPPUNIT_ASSERT(!aList.In(ScRange(nCol, nRow, 0)));
+                CPPUNIT_ASSERT(!aList.Contains(ScRange(nCol, nRow, 0)));
             else
-                CPPUNIT_ASSERT(aList.In(ScRange(nCol, nRow, 0)));
+                CPPUNIT_ASSERT(aList.Contains(ScRange(nCol, nRow, 0)));
         }
     }
 }
@@ -373,9 +373,9 @@ void Test::testDeleteArea_2Ranges_Case8()
         for(SCROW nRow = 2; nRow <= 5; ++nRow)
         {
             if(nRow == 2 && nCol <= 3)
-                CPPUNIT_ASSERT(!aList.In(ScRange(nCol, nRow, 0)));
+                CPPUNIT_ASSERT(!aList.Contains(ScRange(nCol, nRow, 0)));
             else
-                CPPUNIT_ASSERT(aList.In(ScRange(nCol, nRow, 0)));
+                CPPUNIT_ASSERT(aList.Contains(ScRange(nCol, nRow, 0)));
         }
     }
 }
@@ -389,7 +389,7 @@ void Test::testDeleteArea_1Range()
 
     for(SCROW nRow = 1; nRow <= 3; ++nRow)
     {
-        CPPUNIT_ASSERT(aList.In(ScRange(3,nRow,0)));
+        CPPUNIT_ASSERT(aList.Contains(ScRange(3,nRow,0)));
     }
     CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), aList.GetCellCount());
 }
@@ -511,9 +511,9 @@ void Test::testUpdateReference_DeleteRow()
     {
         for(SCROW nRow = 1; nRow <= 3; ++nRow)
         {
-            CPPUNIT_ASSERT(aList.In(ScRange(nCol, nRow, 0)));
+            CPPUNIT_ASSERT(aList.Contains(ScRange(nCol, nRow, 0)));
         }
-        CPPUNIT_ASSERT(!aList.In(ScRange(nCol, 4, 0)));
+        CPPUNIT_ASSERT(!aList.Contains(ScRange(nCol, 4, 0)));
     }
     CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(12), aList.GetCellCount());
 
@@ -553,9 +553,9 @@ void Test::testUpdateReference_DeleteCol()
     {
         for(SCCOL nCol = 1; nCol <= 3; ++nCol)
         {
-            CPPUNIT_ASSERT(aList.In(ScRange(nCol, nRow, 0)));
+            CPPUNIT_ASSERT(aList.Contains(ScRange(nCol, nRow, 0)));
         }
-        CPPUNIT_ASSERT(!aList.In(ScRange(4, nRow, 0)));
+        CPPUNIT_ASSERT(!aList.Contains(ScRange(4, nRow, 0)));
     }
     CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(12), aList.GetCellCount());
 }
diff --git a/sc/qa/unit/subsequent_export_test.cxx 
b/sc/qa/unit/subsequent_export_test.cxx
index 8fbe40a10ac9..355fdf4202ad 100644
--- a/sc/qa/unit/subsequent_export_test.cxx
+++ b/sc/qa/unit/subsequent_export_test.cxx
@@ -2541,9 +2541,11 @@ void ScExportTest::testEmbeddedChartXLS()
     CPPUNIT_ASSERT_MESSAGE("Failed to retrieve a chart object from the 2nd 
sheet.", pOleObj);
 
     ScRangeList aRanges = getChartRanges(rDoc, *pOleObj);
-    CPPUNIT_ASSERT_MESSAGE("Label range (B3:B5) not found.", 
aRanges.In(ScRange(1, 2, 1, 1, 4, 1)));
-    CPPUNIT_ASSERT_MESSAGE("Data label (C2) not found.", 
aRanges.In(ScAddress(2, 1, 1)));
-    CPPUNIT_ASSERT_MESSAGE("Data range (C3:C5) not found.", 
aRanges.In(ScRange(2, 2, 1, 2, 4, 1)));
+    CPPUNIT_ASSERT_MESSAGE("Label range (B3:B5) not found.",
+                           aRanges.Contains(ScRange(1, 2, 1, 1, 4, 1)));
+    CPPUNIT_ASSERT_MESSAGE("Data label (C2) not found.", 
aRanges.Contains(ScAddress(2, 1, 1)));
+    CPPUNIT_ASSERT_MESSAGE("Data range (C3:C5) not found.",
+                           aRanges.Contains(ScRange(2, 2, 1, 2, 4, 1)));
 
     xDocSh->DoClose();
 }
diff --git a/sc/qa/unit/subsequent_filters_test.cxx 
b/sc/qa/unit/subsequent_filters_test.cxx
index 99030f3e90d7..3c4939b3e8e6 100644
--- a/sc/qa/unit/subsequent_filters_test.cxx
+++ b/sc/qa/unit/subsequent_filters_test.cxx
@@ -1997,9 +1997,9 @@ void ScFiltersTest::testChartImportODS()
 
     ScRangeList aRanges = getChartRanges(rDoc, *pOleObj);
 
-    CPPUNIT_ASSERT_MESSAGE("Data series title cell not found.", 
aRanges.In(ScAddress(1,0,3))); // B1 on Title
-    CPPUNIT_ASSERT_MESSAGE("Data series label range not found.", 
aRanges.In(ScRange(0,1,2,0,3,2))); // A2:A4 on Data
-    CPPUNIT_ASSERT_MESSAGE("Data series value range not found.", 
aRanges.In(ScRange(1,1,2,1,3,2))); // B2:B4 on Data
+    CPPUNIT_ASSERT_MESSAGE("Data series title cell not found.", 
aRanges.Contains(ScAddress(1,0,3))); // B1 on Title
+    CPPUNIT_ASSERT_MESSAGE("Data series label range not found.", 
aRanges.Contains(ScRange(0,1,2,0,3,2))); // A2:A4 on Data
+    CPPUNIT_ASSERT_MESSAGE("Data series value range not found.", 
aRanges.Contains(ScRange(1,1,2,1,3,2))); // B2:B4 on Data
 
     xDocSh->DoClose();
 }
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 9a80a42ad4b1..5d32bee3223b 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -4143,11 +4143,11 @@ void Test::testSearchCells()
     CPPUNIT_ASSERT_MESSAGE("Search And Replace should succeed", bSuccess);
     CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be exactly 3 matching cells.", 
size_t(3), aMatchedRanges.size());
     ScAddress aHit(0,0,0);
-    CPPUNIT_ASSERT_MESSAGE("A1 should be inside the matched range.", 
aMatchedRanges.In(aHit));
+    CPPUNIT_ASSERT_MESSAGE("A1 should be inside the matched range.", 
aMatchedRanges.Contains(aHit));
     aHit.SetRow(2);
-    CPPUNIT_ASSERT_MESSAGE("A3 should be inside the matched range.", 
aMatchedRanges.In(aHit));
+    CPPUNIT_ASSERT_MESSAGE("A3 should be inside the matched range.", 
aMatchedRanges.Contains(aHit));
     aHit.SetRow(4);
-    CPPUNIT_ASSERT_MESSAGE("A5 should be inside the matched range.", 
aMatchedRanges.In(aHit));
+    CPPUNIT_ASSERT_MESSAGE("A5 should be inside the matched range.", 
aMatchedRanges.Contains(aHit));
 
     m_pDoc->DeleteTab(0);
 }
diff --git a/sc/source/core/data/bcaslot.cxx b/sc/source/core/data/bcaslot.cxx
index 65dbb97a9450..03a031be7943 100644
--- a/sc/source/core/data/bcaslot.cxx
+++ b/sc/source/core/data/bcaslot.cxx
@@ -305,7 +305,7 @@ bool ScBroadcastAreaSlot::AreaBroadcast( const ScHint& 
rHint)
 
         ScBroadcastArea* pArea = (*aIter).mpArea;
         const ScRange& rAreaRange = pArea->GetRange();
-        if (rAreaRange.In( rAddress))
+        if (rAreaRange.Contains( rAddress))
         {
             if (pArea->IsGroupListening())
             {
@@ -345,7 +345,7 @@ void ScBroadcastAreaSlot::DelBroadcastAreasInRange( const 
ScRange& rRange )
             aIter != aBroadcastAreaTbl.end(); /* increment in body */ )
     {
         const ScRange& rAreaRange = (*aIter).mpArea->GetRange();
-        if (rRange.In( rAreaRange))
+        if (rRange.Contains( rAreaRange))
         {
             ScBroadcastArea* pArea = (*aIter).mpArea;
             aIter = aBroadcastAreaTbl.erase(aIter);  // erase before modifying
@@ -489,7 +489,7 @@ void ScBroadcastAreaSlot::GetAllListeners(
         switch (eType)
         {
             case sc::AreaOverlapType::Inside:
-                if (!rRange.In(rAreaRange))
+                if (!rRange.Contains(rAreaRange))
                     // The range needs to be fully inside specified range.
                     continue;
                 break;
@@ -499,13 +499,13 @@ void ScBroadcastAreaSlot::GetAllListeners(
                     continue;
                 break;
             case sc::AreaOverlapType::OneRowInside:
-                if (rAreaRange.aStart.Row() != rAreaRange.aEnd.Row() || 
!rRange.In(rAreaRange))
+                if (rAreaRange.aStart.Row() != rAreaRange.aEnd.Row() || 
!rRange.Contains(rAreaRange))
                     // The range needs to be one single row and fully inside
                     // specified range.
                     continue;
                 break;
             case sc::AreaOverlapType::OneColumnInside:
-                if (rAreaRange.aStart.Col() != rAreaRange.aEnd.Col() || 
!rRange.In(rAreaRange))
+                if (rAreaRange.aStart.Col() != rAreaRange.aEnd.Col() || 
!rRange.Contains(rAreaRange))
                     // The range needs to be one single column and fully inside
                     // specified range.
                     continue;
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 3b148dda6b88..63ab1886ffff 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -2257,7 +2257,7 @@ class UpdateRefOnNonCopy
         ScAddress aOldPos = aPos;
 
         bool bCellMoved;
-        if (mpCxt->maRange.In(aPos))
+        if (mpCxt->maRange.Contains(aPos))
         {
             bCellMoved = true;
 
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index dc41b0ba28d3..70ea804076b8 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -498,7 +498,7 @@ void ScConditionEntry::UpdateReference( 
sc::RefUpdateContext& rCxt )
         aSrcPos = pCondFormat->GetRange().Combine().aStart;
     ScAddress aOldSrcPos = aSrcPos;
     bool bChangedPos = false;
-    if (rCxt.meMode == URM_INSDEL && rCxt.maRange.In(aSrcPos))
+    if (rCxt.meMode == URM_INSDEL && rCxt.maRange.Contains(aSrcPos))
     {
         ScAddress aErrorPos( ScAddress::UNINITIALIZED );
         if (!aSrcPos.Move(rCxt.mnColDelta, rCxt.mnRowDelta, rCxt.mnTabDelta, 
aErrorPos))
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 9a3a2fb1ce0f..fd7c9ba58d76 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -1227,7 +1227,7 @@ bool ScDocument::IsCellInChangeTrack(const ScAddress 
&cell,Color *pColCellBorder
                     aRange.aEnd.SetCol( aRange.aStart.Col() );
                 if (ScViewUtil::IsActionShown( *pAction, *pSettings, *this ) )
                 {
-                    if (aRange.In(cell))
+                    if (aRange.Contains(cell))
                     {
                         if (pColCellBorder != nullptr)
                         {
@@ -1247,7 +1247,7 @@ bool ScDocument::IsCellInChangeTrack(const ScAddress 
&cell,Color *pColCellBorder
                     GetFromRange().MakeRange();
                 if (ScViewUtil::IsActionShown( *pAction, *pSettings, *this ) )
                 {
-                    if (aRange.In(cell))
+                    if (aRange.Contains(cell))
                     {
                         if (pColCellBorder != nullptr)
                         {
@@ -1292,7 +1292,7 @@ void ScDocument::GetCellChangeTrackNote( const ScAddress 
&aCellPos, OUString &aT
                     aRange.aEnd.SetRow( aRange.aStart.Row() );
                 else if ( eType == SC_CAT_DELETE_COLS )
                     aRange.aEnd.SetCol( aRange.aStart.Col() );
-                if ( aRange.In( aCellPos ) )
+                if ( aRange.Contains( aCellPos ) )
                 {
                     pFound = pAction;       // the last wins
                     switch ( eType )
@@ -1313,7 +1313,7 @@ void ScDocument::GetCellChangeTrackNote( const ScAddress 
&aCellPos, OUString &aT
                 ScRange aRange =
                     static_cast<const ScChangeActionMove*>(pAction)->
                     GetFromRange().MakeRange();
-                if ( aRange.In( aCellPos ) )
+                if ( aRange.Contains( aCellPos ) )
                 {
                     pFound = pAction;
                 }
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index 5d5583628985..cd10db483ae5 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -207,7 +207,7 @@ bool ScDocument::IsAddressInRangeName( RangeNameScope 
eScope, const ScAddress& r
     {
         if (rEntry.second->IsValidReference(aNameRange))
         {
-            if (aNameRange.In(rAddress))
+            if (aNameRange.Contains(rAddress))
                 return true;
         }
     }
@@ -382,7 +382,7 @@ ScDPObject* ScDocument::GetDPAtCursor(SCCOL nCol, SCROW 
nRow, SCTAB nTab) const
     sal_uInt16 nCount = pDPCollection->GetCount();
     ScAddress aPos( nCol, nRow, nTab );
     for (sal_uInt16 i=0; i<nCount; i++)
-        if ( (*pDPCollection)[i].GetOutRange().In( aPos ) )
+        if ( (*pDPCollection)[i].GetOutRange().Contains( aPos ) )
             return &(*pDPCollection)[i];
 
     return nullptr;
@@ -397,7 +397,7 @@ ScDPObject* ScDocument::GetDPAtBlock( const ScRange & 
rBlock ) const
      * approximation of MS Excels 'most recent' effect. */
     sal_uInt16 i = pDPCollection->GetCount();
     while ( i-- > 0 )
-        if ( (*pDPCollection)[i].GetOutRange().In( rBlock ) )
+        if ( (*pDPCollection)[i].GetOutRange().Contains( rBlock ) )
             return &(*pDPCollection)[i];
 
     return nullptr;
diff --git a/sc/source/core/data/document10.cxx 
b/sc/source/core/data/document10.cxx
index f2c8ef5be794..e2293c585e7c 100644
--- a/sc/source/core/data/document10.cxx
+++ b/sc/source/core/data/document10.cxx
@@ -390,7 +390,7 @@ void ScDocument::DelayFormulaGrouping( bool delay )
 
 void ScDocument::AddDelayedFormulaGroupingCell( const ScFormulaCell* cell )
 {
-    if( !pDelayedFormulaGrouping->In( cell->aPos ))
+    if( !pDelayedFormulaGrouping->Contains( cell->aPos ))
         pDelayedFormulaGrouping->ExtendTo( cell->aPos );
 }
 
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index 57cc1640f00b..b0436d407ddd 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -1708,7 +1708,7 @@ void ScDrawLayer::CopyToClip( ScDocument* pClipDoc, SCTAB 
nTab, const tools::Rec
         if (pObjData)
         {
             ScRange aClipRange = lcl_getClipRangeFromClipDoc(pClipDoc, nTab);
-            bObjectInArea = bObjectInArea || aClipRange.In(pObjData->maStart);
+            bObjectInArea = bObjectInArea || 
aClipRange.Contains(pObjData->maStart);
         }
 
         // do not copy internal objects (detective) and note captions
@@ -1758,7 +1758,7 @@ static bool lcl_IsAllInRange( const ::std::vector< 
ScRangeList >& rRangesVector,
         for ( size_t i = 0, nCount = rRanges.size(); i < nCount; i++ )
         {
             const ScRange & rRange = rRanges[ i ];
-            if ( !rClipRange.In( rRange ) )
+            if ( !rClipRange.Contains( rRange ) )
             {
                 return false;   // at least one range is not valid
             }
@@ -1778,7 +1778,7 @@ static bool lcl_MoveRanges( ::std::vector< ScRangeList >& 
rRangesVector, const S
         for ( size_t i = 0, nCount = rRanges.size(); i < nCount; i++ )
         {
             ScRange & rRange = rRanges[ i ];
-            if ( rSourceRange.In( rRange ) )
+            if ( rSourceRange.Contains( rRange ) )
             {
                 SCCOL nDiffX = rDestPos.Col() - rSourceRange.aStart.Col();
                 SCROW nDiffY = rDestPos.Row() - rSourceRange.aStart.Row();
@@ -1897,7 +1897,7 @@ void ScDrawLayer::CopyFromClip( ScDrawLayer* pClipModel, 
SCTAB nSourceTab, const
         bool bObjectInArea = rSourceRange.Contains(aObjRect);
         const ScDrawObjData* pObjData = ScDrawLayer::GetObjData(pOldObject);
         if (pObjData) // Consider images anchored to the copied cell
-            bObjectInArea = bObjectInArea || aClipRange.In(pObjData->maStart);
+            bObjectInArea = bObjectInArea || 
aClipRange.Contains(pObjData->maStart);
         if (bObjectInArea && (pOldObject->GetLayer() != SC_LAYER_INTERN)
             && !IsNoteCaption(pOldObject))
         {
@@ -2475,7 +2475,7 @@ ScDrawLayer::GetObjectsAnchoredToRows(SCTAB nTab, SCROW 
nStartRow, SCROW nEndRow
         if (!dynamic_cast<SdrCaptionObj*>(pObject)) // Caption objects are 
handled differently
         {
             ScDrawObjData* pObjData = GetObjData(pObject);
-            if (pObjData && aRange.In(pObjData->maStart))
+            if (pObjData && aRange.Contains(pObjData->maStart))
                 aObjects.push_back(pObject);
         }
         pObject = aIter.Next();
@@ -2499,7 +2499,7 @@ ScDrawLayer::GetObjectsAnchoredToRange(SCTAB nTab, SCCOL 
nCol, SCROW nStartRow,
         if (!dynamic_cast<SdrCaptionObj*>(pObject)) // Caption objects are 
handled differently
         {
             ScDrawObjData* pObjData = GetObjData(pObject);
-            if (pObjData && aRange.In(pObjData->maStart))
+            if (pObjData && aRange.Contains(pObjData->maStart))
                 aRowObjects[pObjData->maStart.Row()].push_back(pObject);
         }
         pObject = aIter.Next();
@@ -2523,7 +2523,7 @@ bool ScDrawLayer::HasObjectsAnchoredInRange(const 
ScRange& rRange)
         if (!dynamic_cast<SdrCaptionObj*>(pObject)) // Caption objects are 
handled differently
         {
             ScDrawObjData* pObjData = GetObjData(pObject);
-            if (pObjData && rRange.In(pObjData->maStart)) // Object is in 
given range
+            if (pObjData && rRange.Contains(pObjData->maStart)) // Object is 
in given range
                 return true;
         }
         pObject = aIter.Next();
@@ -2547,7 +2547,7 @@ std::vector<SdrObject*> 
ScDrawLayer::GetObjectsAnchoredToCols(SCTAB nTab, SCCOL
         if (!dynamic_cast<SdrCaptionObj*>(pObject)) // Caption objects are 
handled differently
         {
             ScDrawObjData* pObjData = GetObjData(pObject);
-            if (pObjData && aRange.In(pObjData->maStart))
+            if (pObjData && aRange.Contains(pObjData->maStart))
                 aObjects.push_back(pObject);
         }
         pObject = aIter.Next();
diff --git a/sc/source/core/data/formulacell.cxx 
b/sc/source/core/data/formulacell.cxx
index 195fa15286d0..3c948a2f85a8 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -3122,7 +3122,7 @@ bool ScFormulaCell::UpdatePosOnShift( const 
sc::RefUpdateContext& rCxt )
         // No movement.
         return false;
 
-    if (!rCxt.maRange.In(aPos))
+    if (!rCxt.maRange.Contains(aPos))
         return false;
 
     // This formula cell itself is being shifted during cell range
@@ -3207,7 +3207,7 @@ bool checkCompileColRowName(
                 ScAddress aAbs = rRef.toAbs(rDoc, aPos);
                 if (rDoc.ValidAddress(aAbs))
                 {
-                    if (rCxt.maRange.In(aAbs))
+                    if (rCxt.maRange.Contains(aAbs))
                         return true;
                 }
             }
@@ -3376,7 +3376,7 @@ bool ScFormulaCell::UpdateReferenceOnMove(
         aUndoPos = *pUndoCellPos;
     ScAddress aOldPos( aPos );
 
-    bool bCellInMoveTarget = rCxt.maRange.In(aPos);
+    bool bCellInMoveTarget = rCxt.maRange.Contains(aPos);
 
     if ( bCellInMoveTarget )
     {
@@ -3454,7 +3454,7 @@ bool ScFormulaCell::UpdateReferenceOnMove(
             // #i36299# Don't duplicate action during cut&paste / drag&drop
             // on a cell in the range moved, start/end listeners is done
             // via ScDocument::DeleteArea() and ScDocument::CopyFromClip().
-            && !(rDocument.IsInsertingFromOtherDoc() && rCxt.maRange.In(aPos));
+            && !(rDocument.IsInsertingFromOtherDoc() && 
rCxt.maRange.Contains(aPos));
 
         if ( bNewListening )
             EndListeningTo(rDocument, pOldCode.get(), aOldPos);
@@ -3507,7 +3507,7 @@ bool ScFormulaCell::UpdateReferenceOnCopy(
         aUndoPos = *pUndoCellPos;
     ScAddress aOldPos( aPos );
 
-    if (rCxt.maRange.In(aPos))
+    if (rCxt.maRange.Contains(aPos))
     {
         // The cell is being moved or copied to a new position. I guess the
         // position has been updated prior to this call?  Determine
@@ -3800,7 +3800,7 @@ void ScFormulaCell::UpdateTranspose( const ScRange& 
rSource, const ScAddress& rD
                 rDest.Tab() + rSource.aEnd.Tab() - rSource.aStart.Tab() ) );
 
     // cell within range
-    if ( aDestRange.In( aOldPos ) )
+    if ( aDestRange.Contains( aOldPos ) )
     {
         // References of these cells were not changed by 
ScTokenArray::AdjustReferenceOnMove()
         // Count back Positions
diff --git a/sc/source/core/data/tabprotection.cxx 
b/sc/source/core/data/tabprotection.cxx
index 0e3c151634e5..d005d5d5d961 100644
--- a/sc/source/core/data/tabprotection.cxx
+++ b/sc/source/core/data/tabprotection.cxx
@@ -458,7 +458,7 @@ bool ScTableProtectionImpl::isBlockEditable( const ScRange& 
rRange ) const
 
     auto lIsEditable = [rRange](const ScEnhancedProtection& 
rEnhancedProtection) {
         return !rEnhancedProtection.hasSecurityDescriptor()
-            && rEnhancedProtection.maRangeList.is() && 
rEnhancedProtection.maRangeList->In( rRange)
+            && rEnhancedProtection.maRangeList.is() && 
rEnhancedProtection.maRangeList->Contains( rRange)
             && !rEnhancedProtection.hasPassword(); // Range is editable if no 
password is assigned.
     };
     if (std::any_of(maEnhancedProtection.begin(), maEnhancedProtection.end(), 
lIsEditable))
diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx
index d5a0bb29dca7..e7cda8a368e5 100644
--- a/sc/source/core/tool/address.cxx
+++ b/sc/source/core/tool/address.cxx
@@ -1556,15 +1556,6 @@ ScRefFlags ScAddress::Parse( const OUString& r, const 
ScDocument& rDoc,
     return lcl_ScAddress_Parse( r.getStr(), rDoc, *this, rDetails, pExtInfo, 
pExternalLinks, pSheetEndPos, pErrRef);
 }
 
-bool ScRange::Intersects( const ScRange& rRange ) const
-{
-    return !(
-        std::min( aEnd.Col(), rRange.aEnd.Col() ) < std::max( aStart.Col(), 
rRange.aStart.Col() )
-     || std::min( aEnd.Row(), rRange.aEnd.Row() ) < std::max( aStart.Row(), 
rRange.aStart.Row() )
-     || std::min( aEnd.Tab(), rRange.aEnd.Tab() ) < std::max( aStart.Tab(), 
rRange.aStart.Tab() )
-        );
-}
-
 ScRange ScRange::Intersection( const ScRange& rOther ) const
 {
     SCCOL nCol1 = std::max(aStart.Col(), rOther.aStart.Col());
diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx
index ba34b66f908a..feb5d4bea33a 100644
--- a/sc/source/core/tool/chgtrack.cxx
+++ b/sc/source/core/tool/chgtrack.cxx
@@ -862,7 +862,7 @@ void ScChangeActionDel::UpdateReference( const 
ScChangeTrack* /* pTrack */,
     {
         ScChangeAction* p = pL->GetAction();
         if ( p && p->GetType() == SC_CAT_CONTENT &&
-                !GetBigRange().In( p->GetBigRange() ) )
+                !GetBigRange().Contains( p->GetBigRange() ) )
         {
             switch ( GetType() )
             {
@@ -2942,7 +2942,7 @@ void ScChangeTrack::Dependencies( ScChangeAction* pAct )
         {
             ScChangeActionMove* pTest = 
static_cast<ScChangeActionMove*>(pL->GetAction());
             if ( !pTest->IsRejected() &&
-                    pTest->GetFromRange().In( rPos ) )
+                    pTest->GetFromRange().Contains( rPos ) )
             {
                 AddDependentWithNotify( pTest, pAct );
             }
@@ -3328,7 +3328,7 @@ void ScChangeTrack::UpdateReference( ScChangeAction** 
ppFirstAction,
                             p->IsDeletedInDelType( eInsType ) )
                     {   // Content in Insert Undo "Delete"
                         // Do not adjust if this Delete would be in the Insert 
"Delete" (was just moved)
-                        if ( aDelRange.In( p->GetBigRange().aStart ) )
+                        if ( aDelRange.Contains( p->GetBigRange().aStart ) )
                             bUpdate = false;
                         else
                         {
@@ -3337,7 +3337,7 @@ void ScChangeTrack::UpdateReference( ScChangeAction** 
ppFirstAction,
                             {
                                 const ScChangeAction* pDel = 
pLink->GetAction();
                                 if ( pDel && pDel->GetType() == eInsType &&
-                                        pDel->GetBigRange().In( aDelRange ) )
+                                        pDel->GetBigRange().Contains( 
aDelRange ) )
                                     bUpdate = false;
                                 pLink = pLink->GetNext();
                             }
@@ -3346,7 +3346,7 @@ void ScChangeTrack::UpdateReference( ScChangeAction** 
ppFirstAction,
                     if ( !bUpdate )
                         continue; // for
                 }
-                if ( aDelRange.In( p->GetBigRange() ) )
+                if ( aDelRange.Contains( p->GetBigRange() ) )
                 {
                     // Do not adjust within a just deleted range,
                     // instead assign the range.
@@ -3378,13 +3378,13 @@ void ScChangeTrack::UpdateReference( ScChangeAction** 
ppFirstAction,
                         case SC_CAT_INSERT_COLS :
                             if ( eActType == SC_CAT_DELETE_COLS )
                             {
-                                if ( aDelRange.In( p->GetBigRange().aStart ) )
+                                if ( aDelRange.Contains( 
p->GetBigRange().aStart ) )
                                 {
                                     pActDel->SetCutOffInsert(
                                         static_cast<ScChangeActionIns*>(p), 1 
);
                                     p->GetBigRange().aStart.IncCol();
                                 }
-                                else if ( aDelRange.In( p->GetBigRange().aEnd 
) )
+                                else if ( aDelRange.Contains( 
p->GetBigRange().aEnd ) )
                                 {
                                     pActDel->SetCutOffInsert(
                                         static_cast<ScChangeActionIns*>(p), -1 
);
@@ -3395,13 +3395,13 @@ void ScChangeTrack::UpdateReference( ScChangeAction** 
ppFirstAction,
                         case SC_CAT_INSERT_ROWS :
                             if ( eActType == SC_CAT_DELETE_ROWS )
                             {
-                                if ( aDelRange.In( p->GetBigRange().aStart ) )
+                                if ( aDelRange.Contains( 
p->GetBigRange().aStart ) )
                                 {
                                     pActDel->SetCutOffInsert(
                                         static_cast<ScChangeActionIns*>(p), 1 
);
                                     p->GetBigRange().aStart.IncRow();
                                 }
-                                else if ( aDelRange.In( p->GetBigRange().aEnd 
) )
+                                else if ( aDelRange.Contains( 
p->GetBigRange().aEnd ) )
                                 {
                                     pActDel->SetCutOffInsert(
                                         static_cast<ScChangeActionIns*>(p), -1 
);
@@ -3412,13 +3412,13 @@ void ScChangeTrack::UpdateReference( ScChangeAction** 
ppFirstAction,
                         case SC_CAT_INSERT_TABS :
                             if ( eActType == SC_CAT_DELETE_TABS )
                             {
-                                if ( aDelRange.In( p->GetBigRange().aStart ) )
+                                if ( aDelRange.Contains( 
p->GetBigRange().aStart ) )
                                 {
                                     pActDel->SetCutOffInsert(
                                         static_cast<ScChangeActionIns*>(p), 1 
);
                                     p->GetBigRange().aStart.IncTab();
                                 }
-                                else if ( aDelRange.In( p->GetBigRange().aEnd 
) )
+                                else if ( aDelRange.Contains( 
p->GetBigRange().aEnd ) )
                                 {
                                     pActDel->SetCutOffInsert(
                                         static_cast<ScChangeActionIns*>(p), -1 
);
@@ -3431,13 +3431,13 @@ void ScChangeTrack::UpdateReference( ScChangeAction** 
ppFirstAction,
                             ScChangeActionMove* pMove = 
static_cast<ScChangeActionMove*>(p);
                             short nFrom = 0;
                             short nTo = 0;
-                            if ( aDelRange.In( pMove->GetBigRange().aStart ) )
+                            if ( aDelRange.Contains( 
pMove->GetBigRange().aStart ) )
                                 nTo = 1;
-                            else if ( aDelRange.In( pMove->GetBigRange().aEnd 
) )
+                            else if ( aDelRange.Contains( 
pMove->GetBigRange().aEnd ) )
                                 nTo = -1;
-                            if ( aDelRange.In( pMove->GetFromRange().aStart ) )
+                            if ( aDelRange.Contains( 
pMove->GetFromRange().aStart ) )
                                 nFrom = 1;
-                            else if ( aDelRange.In( pMove->GetFromRange().aEnd 
) )
+                            else if ( aDelRange.Contains( 
pMove->GetFromRange().aEnd ) )
                                 nFrom = -1;
                             if ( nFrom )
                             {
@@ -3514,7 +3514,7 @@ void ScChangeTrack::UpdateReference( ScChangeAction** 
ppFirstAction,
                     p->UpdateReference( this, eMode, aRange, nDx, nDy, nDz );
                     if ( p->GetType() == eActType && !p->IsRejected() &&
                             !pActDel->IsDeletedIn() &&
-                            p->GetBigRange().In( aDelRange ) )
+                            p->GetBigRange().Contains( aDelRange ) )
                         pActDel->SetDeletedIn( p ); // Slipped underneath it
                 }
             }
@@ -3526,7 +3526,7 @@ void ScChangeTrack::UpdateReference( ScChangeAction** 
ppFirstAction,
                 if ( p == pAct )
                     continue;   // for
                 bool bUpdate = true;
-                if ( aDelRange.In( p->GetBigRange() ) )
+                if ( aDelRange.Contains( p->GetBigRange() ) )
                 {
                     // #i94841# [Collaboration] When deleting rows is 
rejected, the content is sometimes wrong
                     if ( GetMergeState() == SC_CTMS_UNDO && !p->IsDeletedIn( 
pAct ) && pAct->IsDeleteType() &&
@@ -3587,7 +3587,7 @@ void ScChangeTrack::UpdateReference( ScChangeAction** 
ppFirstAction,
                 if ( p->GetType() == SC_CAT_CONTENT )
                 {
                     // Delete content in Target (Move Content to Source)
-                    if ( rTo.In( p->GetBigRange() ) )
+                    if ( rTo.Contains( p->GetBigRange() ) )
                     {
                         if ( !p->IsDeletedIn( pActMove ) )
                         {
@@ -3599,7 +3599,7 @@ void ScChangeTrack::UpdateReference( ScChangeAction** 
ppFirstAction,
                     }
                     else if ( bLastCutMove &&
                             p->GetActionNumber() > nEndLastCut &&
-                            rFrom.In( p->GetBigRange() ) )
+                            rFrom.Contains( p->GetBigRange() ) )
                     {   // Paste Cut: insert new Content inserted after stays
                         // Split up the ContentChain
                         ScChangeActionContent *pHere, *pTmp;
@@ -3651,7 +3651,7 @@ void ScChangeTrack::UpdateReference( ScChangeAction** 
ppFirstAction,
                         p->UpdateReference( this, eMode, rTo, nDx, nDy, nDz );
                     if ( bActRejected &&
                             
static_cast<ScChangeActionContent*>(p)->IsTopContent() &&
-                            rFrom.In( p->GetBigRange() ) )
+                            rFrom.Contains( p->GetBigRange() ) )
                     {   // Recover dependency to write Content
                         ScChangeActionLinkEntry* pLink =
                             pActMove->AddDependent( p );
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index dfed2b0e0202..b8c8d79ffc89 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -5519,7 +5519,7 @@ bool ScCompiler::HandleColRowName()
     for ( size_t i = 0, nPairs = pRL->size(); i < nPairs; ++i )
     {
         const ScRangePair & rR = (*pRL)[i];
-        if ( rR.GetRange(0).In( aAbs ) )
+        if ( rR.GetRange(0).Contains( aAbs ) )
         {
             bInList = bValidName = true;
             aRange = rR.GetRange(1);
diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx
index b4e52cebb108..5d1fc664e913 100644
--- a/sc/source/core/tool/dbdata.cxx
+++ b/sc/source/core/tool/dbdata.cxx
@@ -937,7 +937,7 @@ void ScDBData::Notify( const SfxHint& rHint )
         if (aHeaderRange.IsValid())
         {
             mpContainer->GetDirtyTableColumnNames().Join( aHeaderRange);
-            if (!aHeaderRange.In( pScHint->GetAddress()))
+            if (!aHeaderRange.Contains( pScHint->GetAddress()))
                 mpContainer->GetDirtyTableColumnNames().Join( 
pScHint->GetAddress());
         }
         else
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 929844886b66..5842da0b8089 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -112,9 +112,9 @@ bool ScInterpreter::IsTableOpInRange( const ScRange& rRange 
)
     for ( size_t i = 0; i < ListSize; ++i )
     {
         ScInterpreterTableOpParams *const pTOp = mrDoc.m_TableOpList[ i ];
-        if ( rRange.In( pTOp->aOld1 ) )
+        if ( rRange.Contains( pTOp->aOld1 ) )
             return true;
-        if ( rRange.In( pTOp->aOld2 ) )
+        if ( rRange.Contains( pTOp->aOld2 ) )
             return true;
     }
     return false;
diff --git a/sc/source/core/tool/listenerquery.cxx 
b/sc/source/core/tool/listenerquery.cxx
index ce2fe9faa5d6..10cebdd42164 100644
--- a/sc/source/core/tool/listenerquery.cxx
+++ b/sc/source/core/tool/listenerquery.cxx
@@ -29,7 +29,7 @@ void RefQueryFormulaGroup::add( const ScAddress& rPos )
     if (!rPos.IsValid())
         return;
 
-    if (maSkipRange.IsValid() && maSkipRange.In(rPos))
+    if (maSkipRange.IsValid() && maSkipRange.Contains(rPos))
         // This is within the skip range.  Skip it.
         return;
 
diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx
index c1b149d7aee5..b913568e4f4b 100644
--- a/sc/source/core/tool/rangelst.cxx
+++ b/sc/source/core/tool/rangelst.cxx
@@ -42,7 +42,7 @@ public:
     explicit FindEnclosingRange(const T& rTest) : mrTest(rTest) {}
     bool operator() (const ScRange & rRange) const
     {
-        return rRange.In(mrTest);
+        return rRange.Contains(mrTest);
     }
 private:
     const T& mrTest;
@@ -55,7 +55,7 @@ public:
     FindRangeIn(const T& rTest) : mrTest(rTest) {}
     bool operator() (const ScRange& rRange) const
     {
-        return mrTest.In(rRange);
+        return mrTest.Contains(rRange);
     }
 private:
     const T& mrTest;
@@ -225,7 +225,7 @@ Label_Range_Join:
             continue;           // the same one, continue with the next
         }
         bool bJoined = false;
-        if ( rRange.In( *pOver ) )
+        if ( rRange.Contains( *pOver ) )
         {   // range pOver included in or identical to range p
             // XXX if we never used Append() before Join() we could remove
             // pOver and end processing, but it is not guaranteed and there can
@@ -238,7 +238,7 @@ Label_Range_Join:
                 break;  // for
             }
         }
-        else if ( pOver->In( rRange ) )
+        else if ( pOver->Contains( rRange ) )
         {   // range rRange included in range pOver, make pOver the new range
             rRange = *pOver;
             bJoined = true;
@@ -1091,7 +1091,7 @@ bool ScRangeList::Intersects( const ScRange& rRange ) 
const
     return std::any_of(maRanges.begin(), maRanges.end(), 
FindIntersectingRange<ScRange>(rRange));
 }
 
-bool ScRangeList::In( const ScRange& rRange ) const
+bool ScRangeList::Contains( const ScRange& rRange ) const
 {
     return std::any_of(maRanges.begin(), maRanges.end(), 
FindEnclosingRange<ScRange>(rRange));
 }
@@ -1292,7 +1292,7 @@ ScRangePair* ScRangePairList::Find( const ScAddress& rAdr 
)
 {
     for (ScRangePair & rR : maPairs)
     {
-        if ( rR.GetRange(0).In( rAdr ) )
+        if ( rR.GetRange(0).Contains( rAdr ) )
             return &rR;
     }
     return nullptr;
@@ -1435,7 +1435,7 @@ Label_RangePair_Join:
         ScRange& rp2 = rPair.GetRange(1);
         if ( rp2 == r2 )
         {   // only if Range2 is equal
-            if ( rp1.In( r1 ) )
+            if ( rp1.Contains( r1 ) )
             {   // RangePair pOver included in or identical to RangePair p
                 if ( bIsInList )
                     bJoined = true;     // do away with RangePair pOver
@@ -1445,7 +1445,7 @@ Label_RangePair_Join:
                     break;  // for
                 }
             }
-            else if ( r1.In( rp1 ) )
+            else if ( r1.Contains( rp1 ) )
             {   // RangePair p included in RangePair pOver, make pOver the new 
RangePair
                 rPair = *pOver;
                 bJoined = true;
diff --git a/sc/source/core/tool/reftokenhelper.cxx 
b/sc/source/core/tool/reftokenhelper.cxx
index 7d49a60f3e97..a4992485ee66 100644
--- a/sc/source/core/tool/reftokenhelper.cxx
+++ b/sc/source/core/tool/reftokenhelper.cxx
@@ -369,7 +369,7 @@ private:
                 // Sheet ranges differ.
                 continue;
 
-            if (aOld.In(aNew))
+            if (aOld.Contains(aNew))
                 // This new range is part of an existing range.  Skip it.
                 return;
 
diff --git a/sc/source/core/tool/refupdat.cxx b/sc/source/core/tool/refupdat.cxx
index a0c3fe31716d..1866a2c65f82 100644
--- a/sc/source/core/tool/refupdat.cxx
+++ b/sc/source/core/tool/refupdat.cxx
@@ -427,7 +427,7 @@ ScRefUpdateRes ScRefUpdate::Update( UpdateRefMode 
eUpdateRefMode,
     }
     else if (eUpdateRefMode == URM_MOVE)
     {
-        if ( rWhere.In( rWhat ) )
+        if ( rWhere.Contains( rWhat ) )
         {
             if ( nDx && (theCol1 != nInt32Min || theCol2 != nInt32Max) )
             {
@@ -541,7 +541,7 @@ ScRefUpdateRes ScRefUpdate::UpdateTranspose(
     ScRefUpdateRes eRet = UR_NOTHING;
     // Only references in source range must be updated, i.e. no references in 
destination area.
     // Otherwise existing references pointing to destination area will be 
wrongly transposed.
-    if (rSource.In(rRef))
+    if (rSource.Contains(rRef))
     {
         // Source range contains the reference range.
         SCCOL nCol1 = rRef.aStart.Col(), nCol2 = rRef.aEnd.Col();
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index c27c964a533a..6cdb552a7397 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -2484,7 +2484,7 @@ void GetExternalTableData(const ScDocument* pOldDoc, 
const ScDocument* pNewDoc,
 bool IsInCopyRange( const ScRange& rRange, const ScDocument* pClipDoc )
 {
     ScClipParam& rClipParam = 
const_cast<ScDocument*>(pClipDoc)->GetClipParam();
-    return rClipParam.maRanges.In(rRange);
+    return rClipParam.maRanges.Contains(rRange);
 }
 
 bool SkipReference(formula::FormulaToken* pToken, const ScAddress& rPos, const 
ScDocument& rOldDoc, bool bRangeName, bool bCheckCopyArea)
@@ -3132,7 +3132,7 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceOnShift( 
const sc::RefUpdateCon
 
     sc::RefUpdateResult aRes;
     ScAddress aNewPos = rOldPos;
-    bool bCellShifted = rCxt.maRange.In(rOldPos);
+    bool bCellShifted = rCxt.maRange.Contains(rOldPos);
     if (bCellShifted)
     {
         ScAddress aErrorPos( ScAddress::UNINITIALIZED );
@@ -3160,7 +3160,7 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceOnShift( 
const sc::RefUpdateCon
                         ScSingleRefData& rRef = *p->GetSingleRef();
                         ScAddress aAbs = rRef.toAbs(*mxSheetLimits, rOldPos);
 
-                        if (rCxt.isDeleted() && aSelectedRange.In(aAbs))
+                        if (rCxt.isDeleted() && aSelectedRange.Contains(aAbs))
                         {
                             // This reference is in the deleted region.
                             setRefDeleted(rRef, rCxt);
@@ -3172,7 +3172,7 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceOnShift( 
const sc::RefUpdateCon
                         {
                             // Check if the token has reference to previously 
deleted region.
                             ScAddress aCheckPos = rRef.toAbs(*mxSheetLimits, 
aNewPos);
-                            if (rCxt.maRange.In(aCheckPos))
+                            if (rCxt.maRange.Contains(aCheckPos))
                             {
                                 restoreDeletedRef(rRef, rCxt);
                                 aRes.mbValueChanged = true;
@@ -3180,7 +3180,7 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceOnShift( 
const sc::RefUpdateCon
                             }
                         }
 
-                        if (rCxt.maRange.In(aAbs))
+                        if (rCxt.maRange.Contains(aAbs))
                         {
                             ScAddress aErrorPos( ScAddress::UNINITIALIZED );
                             if (!aAbs.Move(rCxt.mnColDelta, rCxt.mnRowDelta, 
rCxt.mnTabDelta, aErrorPos))
@@ -3198,7 +3198,7 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceOnShift( 
const sc::RefUpdateCon
 
                         if (rCxt.isDeleted())
                         {
-                            if (aSelectedRange.In(aAbs))
+                            if (aSelectedRange.Contains(aAbs))
                             {
                                 // This reference is in the deleted region.
                                 setRefDeleted(rRef, rCxt);
@@ -3226,7 +3226,7 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceOnShift( 
const sc::RefUpdateCon
                                     // range means also that the other
                                     // conditions below are not met,
                                     // specifically not the
-                                    // if (rCxt.maRange.In(aAbs))
+                                    // if (rCxt.maRange.Contains(aAbs))
                                     // that is able to update the reference,
                                     // but aSelectedRange does not intersect
                                     // with rCxt.maRange so that can't happen
@@ -3241,7 +3241,7 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceOnShift( 
const sc::RefUpdateCon
                         {
                             // Check if the token has reference to previously 
deleted region.
                             ScRange aCheckRange = rRef.toAbs(*mxSheetLimits, 
aNewPos);
-                            if (aSelectedRange.In(aCheckRange))
+                            if (aSelectedRange.Contains(aCheckRange))
                             {
                                 // This reference was previously in the 
deleted region. Restore it.
                                 restoreDeletedRef(rRef, rCxt);
@@ -3271,7 +3271,7 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceOnShift( 
const sc::RefUpdateCon
                             }
                         }
 
-                        if (rCxt.maRange.In(aAbs))
+                        if (rCxt.maRange.Contains(aAbs))
                         {
                             // We shift either by column or by row, not both,
                             // so moving the reference has only to be done in
@@ -3397,17 +3397,17 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceOnMove(
                         // Additionally, do not update the references from 
cells within the moved
                         // range as they lead to #REF! errors here. These 
#REF! cannot by fixed
                         // later in UpdateTranspose().
-                        if (rCxt.mbTransposed && (aOldRange.In(rOldPos) || 
aOldRange.In(aAbs)))
+                        if (rCxt.mbTransposed && (aOldRange.Contains(rOldPos) 
|| aOldRange.Contains(aAbs)))
                             break;
 
-                        if (aOldRange.In(aAbs))
+                        if (aOldRange.Contains(aAbs))
                         {
                             ScAddress aErrorPos( ScAddress::UNINITIALIZED );
                             if (!aAbs.Move(rCxt.mnColDelta, rCxt.mnRowDelta, 
rCxt.mnTabDelta, aErrorPos))
                                 aAbs = aErrorPos;
                             aRes.mbReferenceModified = true;
                         }
-                        else if (rCxt.maRange.In(aAbs))
+                        else if (rCxt.maRange.Contains(aAbs))
                         {
                             // Referenced cell has been overwritten.
                             aRes.mbValueChanged = true;
@@ -3427,17 +3427,17 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceOnMove(
                         // Additionally, do not update the references from 
cells within the moved
                         // range as they lead to #REF! errors here. These 
#REF! cannot by fixed
                         // later in UpdateTranspose().
-                        if (rCxt.mbTransposed && (aOldRange.In(rOldPos) || 
aOldRange.In(aAbs)))
+                        if (rCxt.mbTransposed && (aOldRange.Contains(rOldPos) 
|| aOldRange.Contains(aAbs)))
                             break;
 
-                        if (aOldRange.In(aAbs))
+                        if (aOldRange.Contains(aAbs))
                         {
                             ScRange aErrorRange( ScAddress::UNINITIALIZED );
                             if (!aAbs.Move(rCxt.mnColDelta, rCxt.mnRowDelta, 
rCxt.mnTabDelta, aErrorRange))
                                 aAbs = aErrorRange;
                             aRes.mbReferenceModified = true;
                         }
-                        else if (rCxt.maRange.In(aAbs))
+                        else if (rCxt.maRange.Contains(aAbs))
                         {
                             // Referenced range has been entirely overwritten.
                             aRes.mbValueChanged = true;
@@ -3651,7 +3651,7 @@ bool adjustSingleRefInName(
         return false;
     }
 
-    if (!rCxt.maRange.In(rRef.toAbs(rCxt.mrDoc, rPos)))
+    if (!rCxt.maRange.Contains(rRef.toAbs(rCxt.mrDoc, rPos)))
         return false;
 
     bool bChanged = false;
@@ -3884,7 +3884,7 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceInName(
                             // Sheet references not affected.
                             break;
 
-                        if (rCxt.maRange.In(aAbs))
+                        if (rCxt.maRange.Contains(aAbs))
                         {
                             // This range is entirely within the shifted 
region.
                             if (adjustDoubleRefInName(rRef, rCxt, rPos))
@@ -4094,10 +4094,10 @@ sc::RefUpdateResult 
ScTokenArray::AdjustReferenceInMovedName( const sc::RefUpdat
 
                         // Do not update the reference in transposed case (cut 
paste transposed).
                         // The reference will be updated in UpdateTranspose().
-                        if (rCxt.mbTransposed && aOldRange.In(aAbs))
+                        if (rCxt.mbTransposed && aOldRange.Contains(aAbs))
                             break;
 
-                        if (aOldRange.In(aAbs))
+                        if (aOldRange.Contains(aAbs))
                         {
                             ScAddress aErrorPos( ScAddress::UNINITIALIZED );
                             if (!aAbs.Move(rCxt.mnColDelta, rCxt.mnRowDelta, 
rCxt.mnTabDelta, aErrorPos))
@@ -4119,10 +4119,10 @@ sc::RefUpdateResult 
ScTokenArray::AdjustReferenceInMovedName( const sc::RefUpdat
 
                         // Do not update the reference in transposed case (cut 
paste transposed).
                         // The reference will be updated in UpdateTranspose().
-                        if (rCxt.mbTransposed && aOldRange.In(aAbs))
+                        if (rCxt.mbTransposed && aOldRange.Contains(aAbs))
                             break;
 
-                        if (aOldRange.In(aAbs))
+                        if (aOldRange.Contains(aAbs))
                         {
                             ScRange aErrorRange( ScAddress::UNINITIALIZED );
                             if (!aAbs.Move(rCxt.mnColDelta, rCxt.mnRowDelta, 
rCxt.mnTabDelta, aErrorRange))
diff --git a/sc/source/filter/excel/xecontent.cxx 
b/sc/source/filter/excel/xecontent.cxx
index 17a614b8fdf3..fbeedbcaa80b 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -280,7 +280,7 @@ sal_uInt32 XclExpMergedcells::GetBaseXFId( const ScAddress& 
rPos ) const
     for ( size_t i = 0, nRanges = rNCRanges.size(); i < nRanges; ++i, ++aIt )
     {
         const ScRange & rScRange = rNCRanges[ i ];
-        if( rScRange.In( rPos ) )
+        if( rScRange.Contains( rPos ) )
             return *aIt;
     }
     return EXC_XFID_NOTFOUND;
diff --git a/sc/source/filter/html/htmlexp.cxx 
b/sc/source/filter/html/htmlexp.cxx
index ef6392c02491..102117b7526c 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -897,7 +897,7 @@ void ScHTMLExport::WriteCell( sc::ColumnBlockPosition& 
rBlockPos, SCCOL nCol, SC
         for ( size_t i = 0; i < ListSize; ++i )
         {
             ScHTMLGraphEntry* pE = &aGraphList[ i ];
-            if ( pE->bInCell && pE->aRange.In( aPos ) )
+            if ( pE->bInCell && pE->aRange.Contains( aPos ) )
             {
                 if ( pE->aRange.aStart == aPos )
                 {
diff --git a/sc/source/filter/html/htmlimp.cxx 
b/sc/source/filter/html/htmlimp.cxx
index 575b67ff7001..5e1af28b04d9 100644
--- a/sc/source/filter/html/htmlimp.cxx
+++ b/sc/source/filter/html/htmlimp.cxx
@@ -222,7 +222,7 @@ OUString ScHTMLImport::GetHTMLRangeNameList( const 
ScDocument& rDoc, const OUStr
                 if (!pRangeData)
                     break;
                 ScRange aRange;
-                if( pRangeData->IsReference( aRange ) && !aRangeList.In( 
aRange ) )
+                if( pRangeData->IsReference( aRange ) && !aRangeList.Contains( 
aRange ) )
                 {
                     aNewName = ScGlobal::addToken(aNewName, aToken, ';');
                     aRangeList.push_back( aRange );
diff --git a/sc/source/filter/xml/xmlsubti.cxx 
b/sc/source/filter/xml/xmlsubti.cxx
index a446f4371275..190dc30d3d1f 100644
--- a/sc/source/filter/xml/xmlsubti.cxx
+++ b/sc/source/filter/xml/xmlsubti.cxx
@@ -280,7 +280,7 @@ void ScMyTables::AddMatrixRange(
 bool ScMyTables::IsPartOfMatrix(const ScAddress& rScAddress) const
 {
     if (!maMatrixRangeList.empty())
-        return maMatrixRangeList.In(rScAddress);
+        return maMatrixRangeList.Contains(rScAddress);
     return false;
 }
 
diff --git a/sc/source/ui/Accessibility/AccessibleCell.cxx 
b/sc/source/ui/Accessibility/AccessibleCell.cxx
index 654dfe84ef67..8c6f330e52fa 100644
--- a/sc/source/ui/Accessibility/AccessibleCell.cxx
+++ b/sc/source/ui/Accessibility/AccessibleCell.cxx
@@ -394,7 +394,7 @@ void 
ScAccessibleCell::FillDependents(utl::AccessibleRelationSetHelper* pRelatio
             ScRange aRef;
             while ( !bFound && aIter.GetNextRef( aRef ) )
             {
-                if (aRef.In(maCellAddress))
+                if (aRef.Contains(maCellAddress))
                     bFound = true;
             }
             if (bFound)
diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx 
b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
index b10bdcb685e7..8f3404e46cbe 100644
--- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
+++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
@@ -125,7 +125,7 @@ bool 
ScAccessibleSpreadsheet::CalcScRangeDifferenceMax(const ScRange & rSrc, con
                                 std::vector<ScMyAddress> &vecRet, int &nSize)
 {
     //Src Must be :Src > Dest
-    if (rDest.In(rSrc))
+    if (rDest.Contains(rSrc))
     {//Here is Src In Dest,Src <= Dest
         return false;
     }
@@ -161,7 +161,7 @@ bool 
ScAccessibleSpreadsheet::CalcScRangeDifferenceMax(const ScRange & rSrc, con
                 return true;
             }
             ScMyAddress cell(col,nMinRow,rSrc.aStart.Tab());
-            if(!rDest.In(cell))
+            if(!rDest.Contains(cell))
             {//In Src ,Not In Dest
                 vecRet.push_back(cell);
                 ++nSize;
@@ -176,7 +176,7 @@ bool 
ScAccessibleSpreadsheet::CalcScRangeDifferenceMax(const ScRange & rSrc, con
                     return true;
                 }
                 ScMyAddress cell(col,nMaxRow,rSrc.aStart.Tab());
-                if(!rDest.In(cell))
+                if(!rDest.Contains(cell))
                 {//In Src ,Not In Dest
                     vecRet.push_back(cell);
                     ++nSize;
@@ -551,7 +551,7 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, 
const SfxHint& rHint
                             (::abs(m_aLastWithInMarkRange.aStart.Col() - 
m_aLastWithInMarkRange.aEnd.Col()) == pDoc->MaxCol() && bWholeCol);
                         bool bSelSmaller=
                             bLastIsWholeColRow &&
-                            !aMarkRange.In(m_aLastWithInMarkRange) &&
+                            !aMarkRange.Contains(m_aLastWithInMarkRange) &&
                             aMarkRange.Intersects(m_aLastWithInMarkRange);
                         if( !bSelSmaller )
                         {
diff --git a/sc/source/ui/dbgui/PivotLayoutDialog.cxx 
b/sc/source/ui/dbgui/PivotLayoutDialog.cxx
index 05a9428eda5e..eca43615618c 100644
--- a/sc/source/ui/dbgui/PivotLayoutDialog.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutDialog.cxx
@@ -495,7 +495,7 @@ void ScPivotLayoutDialog::ApplyChanges()
             ScDPObject *pDPObj = nullptr;
             // FIXME: if the new range overlaps with the old one, the table 
actually doesn't move
             // and shouldn't therefore be deleted
-            if ( ( ( rOldRange != aDestinationRange ) && !rOldRange.In( 
aDestinationRange ) )
+            if ( ( ( rOldRange != aDestinationRange ) && !rOldRange.Contains( 
aDestinationRange ) )
                  || bToNewSheet )
             {
                 pDPObj = mrDocument.GetDPAtCursor( maPivotParameters.nCol, 
maPivotParameters.nRow, maPivotParameters.nTab);
diff --git a/sc/source/ui/docshell/dbdocfun.cxx 
b/sc/source/ui/docshell/dbdocfun.cxx
index 097432b414e0..3f6b1b804978 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -1205,7 +1205,7 @@ bool lcl_EmptyExcept( ScDocument& rDoc, const ScRange& 
rRange, const ScRange& rE
     {
         if (!aIter.isEmpty())      // real content?
         {
-            if (!rExcept.In(aIter.GetPos()))
+            if (!rExcept.Contains(aIter.GetPos()))
                 return false;       // cell found
         }
     }
diff --git a/sc/source/ui/docshell/docfunc.cxx 
b/sc/source/ui/docshell/docfunc.cxx
index a126b0b9330b..31b49b1faf4f 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -1990,7 +1990,7 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const 
ScMarkData* pTabMark,
                             rDoc.ExtendOverlapped( aTestRange );
                             rDoc.ExtendMerge( aTestRange, true);
                             ScRange aMergeRange( 
aTestRange.aStart.Col(),aTestRange.aStart.Row(), i );
-                            if( !aExtendRange.In( aMergeRange ) )
+                            if( !aExtendRange.Contains( aMergeRange ) )
                             {
                                 qIncreaseRange.push_back( aTestRange );
                                 bInsertMerge = true;
@@ -2000,7 +2000,7 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const 
ScMarkData* pTabMark,
                     else
                     {
                         ScRange aMergeRange( 
aRange.aStart.Col(),aRange.aStart.Row(), i );
-                        if( !aExtendRange.In( aMergeRange ) )
+                        if( !aExtendRange.Contains( aMergeRange ) )
                         {
                             qIncreaseRange.push_back( aRange );
                         }
@@ -2472,7 +2472,7 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const 
ScMarkData* pTabMark,
                             rDoc.ExtendOverlapped( aTestRange );
                             rDoc.ExtendMerge( aTestRange, true );
                             ScRange aMergeRange( 
aTestRange.aStart.Col(),aTestRange.aStart.Row(), i );
-                            if( !aExtendRange.In( aMergeRange ) )
+                            if( !aExtendRange.Contains( aMergeRange ) )
                             {
                                 qDecreaseRange.push_back( aTestRange );
                                 bDeletingMerge = true;
@@ -2482,7 +2482,7 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const 
ScMarkData* pTabMark,
                     else
                     {
                         ScRange aMergeRange( 
aRange.aStart.Col(),aRange.aStart.Row(), i );
-                        if( !aExtendRange.In( aMergeRange ) )
+                        if( !aExtendRange.Contains( aMergeRange ) )
                         {
                             qDecreaseRange.push_back( aRange );
                         }
diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx
index bc49bca0a165..2d24fde231ed 100644
--- a/sc/source/ui/docshell/docsh3.cxx
+++ b/sc/source/ui/docshell/docsh3.cxx
@@ -595,7 +595,7 @@ ScChangeAction* ScDocShell::GetChangeAction( const 
ScAddress& rPos )
                 else if ( eType == SC_CAT_DELETE_COLS )
                     aRange.aEnd.SetCol( aRange.aStart.Col() );
 
-                if ( aRange.In( rPos ) )
+                if ( aRange.Contains( rPos ) )
                 {
                     pFound = pAction;       // the last one wins
                 }
@@ -605,7 +605,7 @@ ScChangeAction* ScDocShell::GetChangeAction( const 
ScAddress& rPos )
                 ScRange aRange =
                     static_cast<const ScChangeActionMove*>(pAction)->
                     GetFromRange().MakeRange();
-                if ( aRange.In( rPos ) )
+                if ( aRange.Contains( rPos ) )
                 {
                     pFound = pAction;
                 }
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx 
b/sc/source/ui/docshell/externalrefmgr.cxx
index 6ebb6bd7b9fb..af4dc4b7d27b 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -412,7 +412,7 @@ void 
ScExternalRefCache::Table::getAllNumberFormats(vector<sal_uInt32>& rNumFmts
 
 bool ScExternalRefCache::Table::isRangeCached(SCCOL nCol1, SCROW nRow1, SCCOL 
nCol2, SCROW nRow2) const
 {
-    return maCachedRanges.In(ScRange(nCol1, nRow1, 0, nCol2, nRow2, 0));
+    return maCachedRanges.Contains(ScRange(nCol1, nRow1, 0, nCol2, nRow2, 0));
 }
 
 void ScExternalRefCache::Table::setCachedCell(SCCOL nCol, SCROW nRow)
@@ -433,7 +433,7 @@ void ScExternalRefCache::Table::setWholeTableCached()
 
 bool ScExternalRefCache::Table::isInCachedRanges(SCCOL nCol, SCROW nRow) const
 {
-    return maCachedRanges.In(ScRange(nCol, nRow, 0, nCol, nRow, 0));
+    return maCachedRanges.Contains(ScRange(nCol, nRow, 0, nCol, nRow, 0));
 }
 
 ScExternalRefCache::TokenRef ScExternalRefCache::Table::getEmptyOrNullToken(
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index c313fdd6e2a4..dc7369a06a8e 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -4714,7 +4714,7 @@ uno::Reference<table::XCellRange>  
ScCellRangeObj::getCellRangeByName(
 
         if (bFound)         // valid only if within this object's range
         {
-            if (!aRange.In(aCellRange))
+            if (!aRange.Contains(aCellRange))
                 bFound = false;
         }
 
diff --git a/sc/source/ui/vba/vbaapplication.cxx 
b/sc/source/ui/vba/vbaapplication.cxx
index 01885a36f0e3..beb32b4c92f7 100644
--- a/sc/source/ui/vba/vbaapplication.cxx
+++ b/sc/source/ui/vba/vbaapplication.cxx
@@ -1020,11 +1020,11 @@ void lclAddToListOfScRange( ListOfScRange& rList, const 
uno::Any& rArg )
 bool lclTryJoin( ScRange& r1, const ScRange& r2 )
 {
     // 1) r2 is completely inside r1
-    if( r1.In( r2 ) )
+    if( r1.Contains( r2 ) )
         return true;
 
     // 2) r1 is completely inside r2
-    if( r2.In( r1 ) )
+    if( r2.Contains( r1 ) )
     {
         r1 = r2;
         return true;
diff --git a/sc/source/ui/vba/vbahyperlinks.cxx 
b/sc/source/ui/vba/vbahyperlinks.cxx
index b7d2f9da1e94..d309f5f44ec1 100644
--- a/sc/source/ui/vba/vbahyperlinks.cxx
+++ b/sc/source/ui/vba/vbahyperlinks.cxx
@@ -42,7 +42,7 @@ bool lclContains( const ScRangeList& rScOuter, const 
uno::Reference< excel::XRan
         throw uno::RuntimeException("Empty range objects" );
 
     for( size_t nIndex = 0, nCount = rScInner.size(); nIndex < nCount; 
++nIndex )
-        if( !rScOuter.In( rScInner[ nIndex ] ) )
+        if( !rScOuter.Contains( rScInner[ nIndex ] ) )
             return false;
     return true;
 }
diff --git a/sc/source/ui/view/dbfunc4.cxx b/sc/source/ui/view/dbfunc4.cxx
index 9f6719f9c01b..64f444dbf51b 100644
--- a/sc/source/ui/view/dbfunc4.cxx
+++ b/sc/source/ui/view/dbfunc4.cxx
@@ -56,7 +56,7 @@ sal_uInt16 ScDBFunc::DoUpdateCharts(const ScAddress& rPos, 
ScDocument& rDoc, boo
                     bool bColHeaders = false;
                     bool bRowHeaders = false;
                     rDoc.GetOldChartParameters(aName, aRanges, bColHeaders, 
bRowHeaders);
-                    bHit = aRanges.In(rPos);
+                    bHit = aRanges.Contains(rPos);
                 }
                 if (bHit)
                 {
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index dd24eb941a26..235bcb37db75 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -5199,7 +5199,7 @@ bool ScGridWindow::HitRangeFinder( const Point& rMouse, 
RfCorner& rCorner,
                 //  search backwards so that the last repainted frame is found
                 --i;
                 ScRangeFindData& rData = pRangeFinder->GetObject(i);
-                if ( rData.aRef.In(aAddr) )
+                if ( rData.aRef.Contains(aAddr) )
                 {
                     if (pIndex)
                         *pIndex = i;
diff --git a/sc/source/ui/view/gridwin5.cxx b/sc/source/ui/view/gridwin5.cxx
index a77ece6d81be..032d84a3c230 100644
--- a/sc/source/ui/view/gridwin5.cxx
+++ b/sc/source/ui/view/gridwin5.cxx
@@ -81,7 +81,7 @@ bool ScGridWindow::ShowNoteMarker( SCCOL nPosX, SCROW nPosY, 
bool bKeyboard )
                     else if ( eType == SC_CAT_DELETE_COLS )
                         aRange.aEnd.SetCol( aRange.aStart.Col() );
 
-                    if ( aRange.In( aCellPos ) )
+                    if ( aRange.Contains( aCellPos ) )
                     {
                         pFound = pAction;       // the last one wins
                         switch ( eType )
@@ -104,7 +104,7 @@ bool ScGridWindow::ShowNoteMarker( SCCOL nPosX, SCROW 
nPosY, bool bKeyboard )
                     ScRange aRange =
                         static_cast<const ScChangeActionMove*>(pAction)->
                         GetFromRange().MakeRange();
-                    if ( aRange.In( aCellPos ) )
+                    if ( aRange.Contains( aCellPos ) )
                     {
                         pFound = pAction;
                     }
diff --git a/sc/source/ui/view/pfuncache.cxx b/sc/source/ui/view/pfuncache.cxx
index 627f274d12d1..efb33ddb76a1 100644
--- a/sc/source/ui/view/pfuncache.cxx
+++ b/sc/source/ui/view/pfuncache.cxx
@@ -131,7 +131,7 @@ void ScPrintFuncCache::InitLocations( const ScMarkData& 
rMark, OutputDevice* pDe
 bool ScPrintFuncCache::FindLocation( const ScAddress& rCell, 
ScPrintPageLocation& rLocation ) const
 {
     auto aIter = std::find_if(aLocations.begin(), aLocations.end(),
-        [&rCell](const ScPrintPageLocation& rLoc) { return 
rLoc.aCellRange.In(rCell); });
+        [&rCell](const ScPrintPageLocation& rLoc) { return 
rLoc.aCellRange.Contains(rCell); });
     if (aIter != aLocations.end())
     {
         rLocation = *aIter;
diff --git a/sc/source/ui/view/prevloc.cxx b/sc/source/ui/view/prevloc.cxx
index 83538f0b21e8..67505e651483 100644
--- a/sc/source/ui/view/prevloc.cxx
+++ b/sc/source/ui/view/prevloc.cxx
@@ -270,7 +270,7 @@ static ScPreviewLocationEntry* lcl_GetEntryByAddress(
 {
     for (auto const& it : rEntries)
     {
-        if ( it->eType == eType && it->aCellRange.In( rPos ) )
+        if ( it->eType == eType && it->aCellRange.Contains( rPos ) )
             return it.get();
     }
 
diff --git a/sc/source/ui/view/spellcheckcontext.cxx 
b/sc/source/ui/view/spellcheckcontext.cxx
index 224af6859f59..634747df929c 100644
--- a/sc/source/ui/view/spellcheckcontext.cxx
+++ b/sc/source/ui/view/spellcheckcontext.cxx
@@ -272,7 +272,7 @@ void SpellCheckContext::ensureResults(SCCOL nCol, SCROW 
nRow)
         if (ScDPCollection* pDPs = pDoc->GetDPCollection())
         {
             ScRangeList aPivotRanges = pDPs->GetAllTableRanges(mnTab);
-            if (aPivotRanges.In(ScAddress(nCol, nRow, mnTab))) // Don't spell 
check within pivot tables
+            if (aPivotRanges.Contains(ScAddress(nCol, nRow, mnTab))) // Don't 
spell check within pivot tables
             {
                 mpResult->set(nCol, nRow, nullptr);
                 return;
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 7807288fa123..a500d5fe03ab 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -87,7 +87,7 @@ ScRange lcl_getSubRangeByIndex( const ScRange& rRange, 
sal_Int32 nIndex )
         aResult.IncCol( static_cast< SCCOL >( nIndex % nWidth ) );
         aResult.IncRow( static_cast< SCROW >( (nIndex % nArea) / nWidth ) );
         aResult.IncTab( static_cast< SCTAB >( nIndex / nArea ) );
-        if( !rRange.In( aResult ) )
+        if( !rRange.Contains( aResult ) )
             aResult = rRange.aStart;
     }
 
@@ -1226,7 +1226,7 @@ void ScTabView::MoveCursorAbs( SCCOL nCurX, SCROW nCurY, 
ScFollowMode eMode,
         const ScMarkData& rMark = aViewData.GetMarkData();
         ScRangeList aSelList;
         rMark.FillRangeListWithMarks(&aSelList, false);
-        if (!aSelList.In(ScRange(nCurX, nCurY, aViewData.GetTabNo())))
+        if (!aSelList.Contains(ScRange(nCurX, nCurY, aViewData.GetTabNo())))
             // Cursor not in existing selection.  Start a new selection.
             DoneBlockMode(true);
     }

Reply via email to