diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-07-18 13:54:51 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-07-18 16:10:37 +0200 |
commit | 23ee72264ed802dc7839c1ae73b1b14382cf1f33 (patch) | |
tree | b05141d8113ad58d01edfe0a8acb60bb629d4023 | |
parent | 91bedcab61424cdfb2f3ba9e48481406fe141ceb (diff) |
make ScRange single-arg constructor explicit
Change-Id: Ie24e1e601b639dd62dbb8a201378a970699b20ab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170686
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
54 files changed, 129 insertions, 128 deletions
diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx index 03cfb1db79d9..70885c139968 100644 --- a/sc/inc/address.hxx +++ b/sc/inc/address.hxx @@ -515,7 +515,7 @@ public: ScRange( const ScRange& rRange ) : aStart( rRange.aStart ), aEnd( rRange.aEnd ) {} - ScRange( const ScAddress& rRange ) : + explicit ScRange( const ScAddress& rRange ) : aStart( rRange ), aEnd( rRange ) {} ScRange( SCCOL nCol, SCROW nRow, SCTAB nTab ) : diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx index 4cc773fadd0b..bde09d28b14a 100644 --- a/sc/qa/unit/helper/qahelper.cxx +++ b/sc/qa/unit/helper/qahelper.cxx @@ -465,7 +465,7 @@ ScRangeList ScModelTestBase::getChartRanges(ScDocument& rDoc, const SdrOle2Obj& ScAddress aAddr; nRes = aAddr.Parse(aRangeReps[i], rDoc, rDoc.GetAddressConvention()); CPPUNIT_ASSERT_MESSAGE("Failed to parse a range representation.", (nRes & ScRefFlags::VALID)); - aRanges.push_back(aAddr); + aRanges.push_back(ScRange(aAddr)); } } diff --git a/sc/qa/unit/subsequent_export_test.cxx b/sc/qa/unit/subsequent_export_test.cxx index e3cad1881415..dde63a313271 100644 --- a/sc/qa/unit/subsequent_export_test.cxx +++ b/sc/qa/unit/subsequent_export_test.cxx @@ -2080,7 +2080,8 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testEmbeddedChartXLS) ScRangeList aRanges = getChartRanges(*pDoc, *pOleObj); 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 label (C2) not found.", + aRanges.Contains(ScRange(ScAddress(2, 1, 1)))); CPPUNIT_ASSERT_MESSAGE("Data range (C3:C5) not found.", aRanges.Contains(ScRange(2, 2, 1, 2, 4, 1))); } diff --git a/sc/qa/unit/subsequent_filters_test4.cxx b/sc/qa/unit/subsequent_filters_test4.cxx index 634973563ba8..5cdcb4e68690 100644 --- a/sc/qa/unit/subsequent_filters_test4.cxx +++ b/sc/qa/unit/subsequent_filters_test4.cxx @@ -267,7 +267,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testChartImportODS) ScRangeList aRanges = getChartRanges(*pDoc, *pOleObj); CPPUNIT_ASSERT_MESSAGE("Data series title cell not found.", - aRanges.Contains(ScAddress(1, 0, 3))); // B1 on Title + aRanges.Contains(ScRange(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.", diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index ae0d6967def8..c5c83476fe5a 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -161,15 +161,15 @@ CPPUNIT_TEST_FIXTURE(Test, testSharedStringPool) CPPUNIT_ASSERT_EQUAL(2+extraCountIgnoreCase, rPool.getCountIgnoreCase()); // Clear A1 - clearRange(m_pDoc, ScAddress(0,0,0)); + clearRange(m_pDoc, ScRange(ScAddress(0,0,0))); // Clear A2 - clearRange(m_pDoc, ScAddress(0,1,0)); + clearRange(m_pDoc, ScRange(ScAddress(0,1,0))); // Clear A3 - clearRange(m_pDoc, ScAddress(0,2,0)); + clearRange(m_pDoc, ScRange(ScAddress(0,2,0))); // Clear A4 - clearRange(m_pDoc, ScAddress(0,3,0)); + clearRange(m_pDoc, ScRange(ScAddress(0,3,0))); // Clear A5 and the pool should be completely empty. - clearRange(m_pDoc, ScAddress(0,4,0)); + clearRange(m_pDoc, ScRange(ScAddress(0,4,0))); rPool.purge(); CPPUNIT_ASSERT_EQUAL(extraCount, rPool.getCount()); CPPUNIT_ASSERT_EQUAL(extraCountIgnoreCase, rPool.getCountIgnoreCase()); @@ -941,7 +941,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCopyToDocument) pDestDoc->InitDrawLayer(xDocSh2.get()); // for note caption objects m_pDoc->CopyStaticToDocument(ScRange(0,1,0,0,3,0), 0, *pDestDoc); // Copy A2:A4 - m_pDoc->CopyStaticToDocument(ScAddress(0,0,0), 0, *pDestDoc); // Copy A1 + m_pDoc->CopyStaticToDocument(ScRange(ScAddress(0,0,0)), 0, *pDestDoc); // Copy A1 m_pDoc->CopyStaticToDocument(ScRange(0,4,0,0,7,0), 0, *pDestDoc); // Copy A5:A8 CPPUNIT_ASSERT_EQUAL(m_pDoc->GetString(0,0,0), pDestDoc->GetString(0,0,0)); @@ -1492,7 +1492,7 @@ CPPUNIT_TEST_FIXTURE(Test, testCellBroadcaster) // Delete formula in C2, which should remove the broadcaster in B3. pBC = m_pDoc->GetBroadcaster(ScAddress(1,2,0)); CPPUNIT_ASSERT_MESSAGE("Broadcaster in B3 should still exist.", pBC); - clearRange(m_pDoc, ScAddress(2,0,0)); + clearRange(m_pDoc, ScRange(ScAddress(2,0,0))); CPPUNIT_ASSERT_EQUAL(CELLTYPE_NONE, m_pDoc->GetCellType(ScAddress(2,0,0))); // C2 should be empty. pBC = m_pDoc->GetBroadcaster(ScAddress(1,2,0)); CPPUNIT_ASSERT_MESSAGE("Broadcaster in B3 should have been removed.", !pBC); @@ -4196,11 +4196,11 @@ CPPUNIT_TEST_FIXTURE(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.Contains(aHit)); + CPPUNIT_ASSERT_MESSAGE("A1 should be inside the matched range.", aMatchedRanges.Contains(ScRange(aHit))); aHit.SetRow(2); - CPPUNIT_ASSERT_MESSAGE("A3 should be inside the matched range.", aMatchedRanges.Contains(aHit)); + CPPUNIT_ASSERT_MESSAGE("A3 should be inside the matched range.", aMatchedRanges.Contains(ScRange(aHit))); aHit.SetRow(4); - CPPUNIT_ASSERT_MESSAGE("A5 should be inside the matched range.", aMatchedRanges.Contains(aHit)); + CPPUNIT_ASSERT_MESSAGE("A5 should be inside the matched range.", aMatchedRanges.Contains(ScRange(aHit))); m_pDoc->DeleteTab(0); } @@ -4291,7 +4291,7 @@ CPPUNIT_TEST_FIXTURE(Test, testJumpToPrecedentsDependents) { // C1's precedent should be A1:A2,B3. ScAddress aC1(2, 0, 0); - ScRangeList aRange(aC1); + ScRangeList aRange((ScRange(aC1))); rDocFunc.DetectiveCollectAllPreds(aRange, aRefTokens); CPPUNIT_ASSERT_MESSAGE("A1:A2 should be a precedent of C1.", hasRange(m_pDoc, aRefTokens, ScRange(0, 0, 0, 0, 1, 0), aC1)); @@ -4302,7 +4302,7 @@ CPPUNIT_TEST_FIXTURE(Test, testJumpToPrecedentsDependents) { // C2's precedent should be A1 only. ScAddress aC2(2, 1, 0); - ScRangeList aRange(aC2); + ScRangeList aRange((ScRange(aC2))); rDocFunc.DetectiveCollectAllPreds(aRange, aRefTokens); CPPUNIT_ASSERT_EQUAL_MESSAGE("there should only be one reference token.", static_cast<size_t>(1), aRefTokens.size()); @@ -4313,7 +4313,7 @@ CPPUNIT_TEST_FIXTURE(Test, testJumpToPrecedentsDependents) { // A1's dependent should be C1:C2. ScAddress aA1(0, 0, 0); - ScRangeList aRange(aA1); + ScRangeList aRange((ScRange(aA1))); rDocFunc.DetectiveCollectAllSuccs(aRange, aRefTokens); CPPUNIT_ASSERT_EQUAL_MESSAGE("C1:C2 should be the only dependent of A1.", std::vector<ScTokenRef>::size_type(1), aRefTokens.size()); @@ -5056,7 +5056,7 @@ CPPUNIT_TEST_FIXTURE(Test, testNoteLifeCycle) // Copy B2 with note to a clipboard. - ScClipParam aClipParam(aPos, false); + ScClipParam aClipParam(ScRange(aPos), false); ScDocument aClipDoc(SCDOCMODE_CLIP); ScMarkData aMarkData(m_pDoc->GetSheetLimits()); aMarkData.SelectOneTable(0); @@ -5147,7 +5147,7 @@ CPPUNIT_TEST_FIXTURE(Test, testNoteLifeCycle) CPPUNIT_ASSERT_MESSAGE("No caption at B5.", pOtherCaptionB5); ScDocument aClipDoc2(SCDOCMODE_CLIP); - copyToClip( pDoc2, aPosB5, &aClipDoc2); + copyToClip( pDoc2, ScRange(aPosB5), &aClipDoc2); // There's no ScTransferObject involved in the "fake" clipboard copy // and ScDocument dtor asking IsClipboardSource() gets no, so emulate @@ -5159,7 +5159,7 @@ CPPUNIT_TEST_FIXTURE(Test, testNoteLifeCycle) xDocSh2->DoClose(); xDocSh2.clear(); - pasteFromClip( m_pDoc, aPosB5, &aClipDoc2); // should not crash... tdf#104967 + pasteFromClip( m_pDoc, ScRange(aPosB5), &aClipDoc2); // should not crash... tdf#104967 ScPostIt* pNoteB5 = m_pDoc->GetNote(aPosB5); CPPUNIT_ASSERT_MESSAGE("Failed to paste cell comment at B5.", pNoteB5); const SdrCaptionObj* pCaptionB5 = pNoteB5->GetOrCreateCaption(aPosB5); @@ -6049,9 +6049,9 @@ CPPUNIT_TEST_FIXTURE(Test, testColumnFindEditCells) m_pDoc->SetScriptType(ScAddress(1,12,0), (SvtScriptType::LATIN | SvtScriptType::ASIAN)); m_pDoc->SetScriptType(ScAddress(1,13,0), (SvtScriptType::LATIN | SvtScriptType::ASIAN)); - nResRow = m_pDoc->GetFirstEditTextRow(ScAddress(1,11,0)); + nResRow = m_pDoc->GetFirstEditTextRow(ScRange(ScAddress(1,11,0))); CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(11), nResRow); - nResRow = m_pDoc->GetFirstEditTextRow(ScAddress(1,12,0)); + nResRow = m_pDoc->GetFirstEditTextRow(ScRange(ScAddress(1,12,0))); CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(12), nResRow); for (SCROW i = 0; i <= 5; ++i) @@ -6059,7 +6059,7 @@ CPPUNIT_TEST_FIXTURE(Test, testColumnFindEditCells) m_pDoc->SetScriptType(ScAddress(2,5,0), (SvtScriptType::LATIN | SvtScriptType::ASIAN)); - nResRow = m_pDoc->GetFirstEditTextRow(ScAddress(2,1,0)); + nResRow = m_pDoc->GetFirstEditTextRow(ScRange(ScAddress(2,1,0))); CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(-1), nResRow); m_pDoc->DeleteTab(0); diff --git a/sc/qa/unit/ucalc_condformat.cxx b/sc/qa/unit/ucalc_condformat.cxx index 4ff4b69dfd82..9f7d7cf39443 100644 --- a/sc/qa/unit/ucalc_condformat.cxx +++ b/sc/qa/unit/ucalc_condformat.cxx @@ -916,7 +916,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testFormulaListenerSingleCellToSingleCell) ScFormulaListener aListener(*m_pDoc); - aListener.addTokenArray(pTokenArray.get(), ScAddress(10, 10, 0)); + aListener.addTokenArray(pTokenArray.get(), ScRange(ScAddress(10, 10, 0))); m_pDoc->SetValue(ScAddress(0, 0, 0), 1.0); CPPUNIT_ASSERT(aListener.NeedsRepaint()); @@ -934,7 +934,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testFormulaListenerSingleCellToMultipleCell ScFormulaListener aListener(*m_pDoc); - aListener.addTokenArray(pTokenArray.get(), ScAddress(10, 10, 0)); + aListener.addTokenArray(pTokenArray.get(), ScRange(ScAddress(10, 10, 0))); m_pDoc->SetValue(ScAddress(0, 0, 0), 1.0); CPPUNIT_ASSERT(aListener.NeedsRepaint()); @@ -952,7 +952,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testFormulaListenerMultipleCellsToSingleCel ScFormulaListener aListener(*m_pDoc); - aListener.addTokenArray(pTokenArray.get(), ScAddress(10, 10, 0)); + aListener.addTokenArray(pTokenArray.get(), ScRange(ScAddress(10, 10, 0))); m_pDoc->SetValue(ScAddress(0, 0, 0), 1.0); CPPUNIT_ASSERT(aListener.NeedsRepaint()); @@ -970,7 +970,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testFormulaListenerMultipleCellsToMultipleC ScFormulaListener aListener(*m_pDoc); - aListener.addTokenArray(pTokenArray.get(), ScAddress(10, 10, 0)); + aListener.addTokenArray(pTokenArray.get(), ScRange(ScAddress(10, 10, 0))); m_pDoc->SetValue(ScAddress(0, 0, 0), 1.0); CPPUNIT_ASSERT(aListener.NeedsRepaint()); @@ -986,7 +986,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testFormulaListenerUpdateInsertTab) std::unique_ptr<ScTokenArray> pTokenArray(aCompiler.CompileString(u"A1"_ustr)); ScFormulaListener aListener(*m_pDoc); - aListener.addTokenArray(pTokenArray.get(), ScAddress(10, 10, 0)); + aListener.addTokenArray(pTokenArray.get(), ScRange(ScAddress(10, 10, 0))); CPPUNIT_ASSERT(!aListener.NeedsRepaint()); m_pDoc->InsertTab(0, u"new_tab"_ustr); @@ -1011,7 +1011,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testFormulaListenerUpdateDeleteTab) std::unique_ptr<ScTokenArray> pTokenArray(aCompiler.CompileString(u"A1"_ustr)); ScFormulaListener aListener(*m_pDoc); - aListener.addTokenArray(pTokenArray.get(), ScAddress(10, 10, 1)); + aListener.addTokenArray(pTokenArray.get(), ScRange(ScAddress(10, 10, 1))); CPPUNIT_ASSERT(!aListener.NeedsRepaint()); m_pDoc->DeleteTab(0); diff --git a/sc/qa/unit/ucalc_copypaste.cxx b/sc/qa/unit/ucalc_copypaste.cxx index 139cdac314c6..299182d794f2 100644 --- a/sc/qa/unit/ucalc_copypaste.cxx +++ b/sc/qa/unit/ucalc_copypaste.cxx @@ -9440,7 +9440,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCutPasteRefUndo) // Set up clip document for cutting of B2. ScDocument aClipDoc(SCDOCMODE_CLIP); aClipDoc.ResetClip(m_pDoc, &aMark); - ScClipParam aParam(ScAddress(1, 1, 0), true); + ScClipParam aParam(ScRange(ScAddress(1, 1, 0)), true); aClipDoc.SetClipParam(aParam); aClipDoc.SetValue(ScAddress(1, 1, 0), 12.0); @@ -9449,8 +9449,8 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCutPasteRefUndo) pUndoDoc->InitUndo(*m_pDoc, 0, 0); // Do the pasting of 12 into C2. This should update A2 to reference C2. - m_pDoc->CopyFromClip(ScAddress(2, 1, 0), aMark, InsertDeleteFlags::CONTENTS, pUndoDoc.get(), - &aClipDoc); + m_pDoc->CopyFromClip(ScRange(ScAddress(2, 1, 0)), aMark, InsertDeleteFlags::CONTENTS, + pUndoDoc.get(), &aClipDoc); CPPUNIT_ASSERT_EQUAL(12.0, m_pDoc->GetValue(0, 1, 0)); CPPUNIT_ASSERT_EQUAL_MESSAGE("A2 should be referencing C2.", u"=C2"_ustr, @@ -9769,7 +9769,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteRelativeFormula) CPPUNIT_ASSERT(!pFC->IsShared()); // single formula cell is never shared. // Copy A1 to clipboard. - aClipParam = ScClipParam(ScAddress(0, 0, 0), false); + aClipParam = ScClipParam(ScRange(ScAddress(0, 0, 0)), false); m_pDoc->CopyToClip(aClipParam, &aClipDoc, &aMark, false, false); pFC = aClipDoc.GetFormulaCell(ScAddress(0, 0, 0)); @@ -9786,7 +9786,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteRelativeFormula) CPPUNIT_ASSERT(!pFC->IsShared()); // Delete A3 and make sure it doesn't crash (see fdo#76132). - clearRange(m_pDoc, ScAddress(0, 2, 0)); + clearRange(m_pDoc, ScRange(ScAddress(0, 2, 0))); CPPUNIT_ASSERT_EQUAL(CELLTYPE_NONE, m_pDoc->GetCellType(ScAddress(0, 2, 0))); m_pDoc->DeleteTab(0); @@ -9830,8 +9830,8 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteRepeatOneFormula) #endif // Copy C1 to clipboard. - ScClipParam aClipParam(aPos, false); - aMark.SetMarkArea(aPos); + ScClipParam aClipParam(ScRange(aPos), false); + aMark.SetMarkArea(ScRange(aPos)); m_pDoc->CopyToClip(aClipParam, &aClipDoc, &aMark, false, false); // Paste it to C2:C10. @@ -10612,7 +10612,7 @@ CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteMatrixFormula) // Copy cell A1 to clipboard. ScAddress aPos(0, 0, 0); // A1 ScDocument aClipDoc(SCDOCMODE_CLIP); - ScClipParam aParam(aPos, false); + ScClipParam aParam(ScRange(aPos), false); m_pDoc->CopyToClip(aParam, &aClipDoc, &aMark, false, false); // Formula string should be equal. CPPUNIT_ASSERT_EQUAL(m_pDoc->GetString(aPos), aClipDoc.GetString(aPos)); diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx index dabd9c3808ad..1660ce5daba4 100644 --- a/sc/qa/unit/ucalc_formula.cxx +++ b/sc/qa/unit/ucalc_formula.cxx @@ -3062,7 +3062,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula, testFormulaRefUpdateDeleteContent) // Delete B2. ScDocFunc& rFunc = m_xDocShell->GetDocFunc(); ScMarkData aMark(m_pDoc->GetSheetLimits()); - aMark.SetMarkArea(ScAddress(1,1,0)); + aMark.SetMarkArea(ScRange(ScAddress(1,1,0))); rFunc.DeleteContents(aMark, InsertDeleteFlags::CONTENTS, true, true); CPPUNIT_ASSERT_EQUAL_MESSAGE("B2 should be empty.", CELLTYPE_NONE, m_pDoc->GetCellType(ScAddress(1,1,0))); diff --git a/sc/qa/unit/ucalc_formula2.cxx b/sc/qa/unit/ucalc_formula2.cxx index 4c077b2d4400..4c4200cfac45 100644 --- a/sc/qa/unit/ucalc_formula2.cxx +++ b/sc/qa/unit/ucalc_formula2.cxx @@ -112,8 +112,8 @@ public: ASSERT_DOUBLES_EQUAL(lExpected(m_nStart1), m_pDoc->GetValue(aPos)); // Copy formula cell to clipboard. - ScClipParam aClipParam(aPos, false); - aMark.SetMarkArea(aPos); + ScClipParam aClipParam(ScRange(aPos), false); + aMark.SetMarkArea(ScRange(aPos)); m_pDoc->CopyToClip(aClipParam, &aClipDoc, &aMark, false, false); // Paste it to first range. @@ -1303,7 +1303,7 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testFormulaDepTracking2) CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(1, 1, 0)); // B2 should equal 2. - clearRange(m_pDoc, ScAddress(2, 0, 0)); // Delete C1. + clearRange(m_pDoc, ScRange(ScAddress(2, 0, 0))); // Delete C1. CPPUNIT_ASSERT_EQUAL(0.0, m_pDoc->GetValue(1, 1, 0)); // B2 should now equal 0. @@ -3685,8 +3685,8 @@ CPPUNIT_TEST_FIXTURE(TestFormula2, testTdf97587) m_pDoc->SetString(aPos, u"=SUM(A1:A10)"_ustr); // Copy formula cell to clipboard. - ScClipParam aClipParam(aPos, false); - aMark.SetMarkArea(aPos); + ScClipParam aClipParam(ScRange(aPos), false); + aMark.SetMarkArea(ScRange(aPos)); m_pDoc->CopyToClip(aClipParam, &aClipDoc, &aMark, false, false); // Paste it to first range. diff --git a/sc/qa/unit/ucalc_pivottable.cxx b/sc/qa/unit/ucalc_pivottable.cxx index 70ae86370afc..594d7a7e1265 100644 --- a/sc/qa/unit/ucalc_pivottable.cxx +++ b/sc/qa/unit/ucalc_pivottable.cxx @@ -56,7 +56,7 @@ ScDPObject* createDPFromSourceDesc( { ScDPObject* pDPObj = new ScDPObject(pDoc); pDPObj->SetSheetDesc(rDesc); - pDPObj->SetOutRange(ScAddress(0, 0, 1)); + pDPObj->SetOutRange(ScRange(ScAddress(0, 0, 1))); ScDPSaveData aSaveData; // Set data pilot table output options. @@ -2203,7 +2203,7 @@ CPPUNIT_TEST_FIXTURE(TestPivottable, testFuncGETPIVOTDATA) fVal = m_pDoc->GetValue(aPos); CPPUNIT_ASSERT_EQUAL(15.0, fVal); - clearRange(m_pDoc, aPos); // Delete the formula. + clearRange(m_pDoc, ScRange(aPos)); // Delete the formula. pDPs->FreeTable(pDPObj); diff --git a/sc/qa/unit/ucalc_sparkline.cxx b/sc/qa/unit/ucalc_sparkline.cxx index 71d29e868762..bb423067b699 100644 --- a/sc/qa/unit/ucalc_sparkline.cxx +++ b/sc/qa/unit/ucalc_sparkline.cxx @@ -405,7 +405,7 @@ CPPUNIT_TEST_FIXTURE(SparklineTest, testUndoRedoClearContentForSparkline) // Clear content of cell D7 - including sparkline { ScMarkData aMark(m_pDoc->GetSheetLimits()); - aMark.SetMarkArea(ScAddress(3, 6, 0)); + aMark.SetMarkArea(ScRange(ScAddress(3, 6, 0))); rDocFunc.DeleteContents(aMark, InsertDeleteFlags::CONTENTS, true, true); } diff --git a/sc/source/core/data/colorscale.cxx b/sc/source/core/data/colorscale.cxx index 7c47bd1116ef..5c1ffe880dd6 100644 --- a/sc/source/core/data/colorscale.cxx +++ b/sc/source/core/data/colorscale.cxx @@ -29,7 +29,7 @@ ScFormulaListener::ScFormulaListener(ScFormulaCell* pCell): mbDirty(false), mrDoc(pCell->GetDocument()) { - startListening( pCell->GetCode(), pCell->aPos ); + startListening( pCell->GetCode(), ScRange(pCell->aPos) ); } ScFormulaListener::ScFormulaListener(ScDocument& rDoc): diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx index 077af2b64ecd..74a66449ec40 100644 --- a/sc/source/core/data/documen4.cxx +++ b/sc/source/core/data/documen4.cxx @@ -601,7 +601,7 @@ bool ScDocument::GetSelectionFunction( ScSubTotalFunc eFunc, ScMarkData aMark(rMark); aMark.MarkToMulti(); if (!aMark.IsMultiMarked() && !aMark.IsCellMarked(rCursor.Col(), rCursor.Row())) - aMark.SetMarkArea(rCursor); + aMark.SetMarkArea(ScRange(rCursor)); SCTAB nMax = GetTableCount(); ScMarkData::const_iterator itr = aMark.begin(), itrEnd = aMark.end(); diff --git a/sc/source/core/data/document10.cxx b/sc/source/core/data/document10.cxx index a2d1ae67b919..a958a9b1543c 100644 --- a/sc/source/core/data/document10.cxx +++ b/sc/source/core/data/document10.cxx @@ -392,7 +392,7 @@ void ScDocument::DelayFormulaGrouping( bool delay ) void ScDocument::AddDelayedFormulaGroupingCell( const ScFormulaCell* cell ) { if( !pDelayedFormulaGrouping->Contains( cell->aPos )) - pDelayedFormulaGrouping->ExtendTo( cell->aPos ); + pDelayedFormulaGrouping->ExtendTo( ScRange(cell->aPos) ); } void ScDocument::EnableDelayStartListeningFormulaCells( ScColumn* column, bool delay ) diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx index efc331ed8bdd..151e703b0451 100644 --- a/sc/source/core/data/dpcache.cxx +++ b/sc/source/core/data/dpcache.cxx @@ -154,7 +154,7 @@ void initFromCell( else if (rCell.hasNumeric()) { double fVal = rCell.getRawValue(); - rNumFormat = rDoc.GetNumberFormat(rPos); + rNumFormat = rDoc.GetNumberFormat(ScRange(rPos)); rData.SetValue(fVal); } else if (!rCell.isEmpty()) diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx index e7ebdb305d72..cf666cda931c 100644 --- a/sc/source/core/data/formulacell.cxx +++ b/sc/source/core/data/formulacell.cxx @@ -2688,7 +2688,7 @@ void ScFormulaCell::GetURLResult( OUString& rURL, OUString& rCellText ) // Cell Text uses the Cell format while the URL uses // the default format for the type. - const sal_uInt32 nCellFormat = rDocument.GetNumberFormat( aPos ); + const sal_uInt32 nCellFormat = rDocument.GetNumberFormat( ScRange(aPos) ); ScInterpreterContext& rContext = rDocument.GetNonThreadedContext(); const sal_uInt32 nURLFormat = ScGlobal::GetStandardFormat(rContext, nCellFormat, SvNumFormatType::NUMBER); diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index 54236396ec5d..8cd53a5a5214 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -1471,7 +1471,7 @@ static ScRefFlags lcl_ScAddress_Parse ( const sal_Unicode* p, const ScDocument& case formula::FormulaGrammar::CONV_XL_A1: case formula::FormulaGrammar::CONV_XL_OOX: { - ScRange rRange = rAddr; + ScRange rRange(rAddr); ScRefFlags nFlags = lcl_ScRange_Parse_XL_A1( rRange, p, rDoc, true, pExtInfo, (rDetails.eConv == formula::FormulaGrammar::CONV_XL_OOX ? pExternalLinks : nullptr), @@ -1481,7 +1481,7 @@ static ScRefFlags lcl_ScAddress_Parse ( const sal_Unicode* p, const ScDocument& } case formula::FormulaGrammar::CONV_XL_R1C1: { - ScRange rRange = rAddr; + ScRange rRange(rAddr); ScRefFlags nFlags = lcl_ScRange_Parse_XL_R1C1( rRange, p, rDoc, rDetails, true, pExtInfo, pSheetEndPos); rAddr = rRange.aStart; return nFlags; diff --git a/sc/source/core/tool/cellform.cxx b/sc/source/core/tool/cellform.cxx index 8e58bdd4a0d9..c20175cd9a62 100644 --- a/sc/source/core/tool/cellform.cxx +++ b/sc/source/core/tool/cellform.cxx @@ -213,7 +213,7 @@ OUString ScCellFormat::GetOutputString( ScDocument& rDoc, const ScAddress& rPos, { // like in GetString for document (column) const Color* pColor; - sal_uInt32 nNumFmt = rDoc.GetNumberFormat(rPos); + sal_uInt32 nNumFmt = rDoc.GetNumberFormat(ScRange(rPos)); return GetString(rCell, nNumFmt, &pColor, nullptr, rDoc); } } diff --git a/sc/source/core/tool/chartarr.cxx b/sc/source/core/tool/chartarr.cxx index 58f1b1221502..86976db2382c 100644 --- a/sc/source/core/tool/chartarr.cxx +++ b/sc/source/core/tool/chartarr.cxx @@ -87,7 +87,7 @@ double getCellValue( ScDocument& rDoc, const ScAddress& rPos, double fDefault, b fRet = aCell.getValue(); if (bCalcAsShown && fRet != 0.0) { - sal_uInt32 nFormat = rDoc.GetNumberFormat(rPos); + sal_uInt32 nFormat = rDoc.GetNumberFormat(ScRange(rPos)); fRet = rDoc.RoundValueAsShown(fRet, nFormat); } } diff --git a/sc/source/core/tool/chartpos.cxx b/sc/source/core/tool/chartpos.cxx index 11af92f9461d..780b8f4ac982 100644 --- a/sc/source/core/tool/chartpos.cxx +++ b/sc/source/core/tool/chartpos.cxx @@ -33,7 +33,7 @@ namespace if (rDocument.HasValueData( nCol, nRow, nTab )) { //treat dates like text #i25706# - sal_uInt32 nNumberFormat = rDocument.GetNumberFormat( ScAddress( nCol, nRow, nTab ) ); + sal_uInt32 nNumberFormat = rDocument.GetNumberFormat( ScRange(ScAddress( nCol, nRow, nTab )) ); SvNumFormatType nType = rDocument.GetFormatTable()->GetType(nNumberFormat); bool bIsDate(nType & SvNumFormatType::DATE); bReturn = !bIsDate; diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx index 6d9a401caa64..657601a224de 100644 --- a/sc/source/core/tool/chgtrack.cxx +++ b/sc/source/core/tool/chgtrack.cxx @@ -1543,7 +1543,7 @@ OUString ScChangeActionContent::GetStringOfCell( const ScCellValue& rCell, const ScDocument* pDoc, const ScAddress& rPos ) { if (NeedsNumberFormat(rCell)) - return GetStringOfCell(rCell, pDoc, pDoc->GetNumberFormat(rPos)); + return GetStringOfCell(rCell, pDoc, pDoc->GetNumberFormat(ScRange(rPos))); else return GetStringOfCell(rCell, pDoc, 0); } @@ -1637,7 +1637,7 @@ void ScChangeActionContent::SetValue( OUString& rStr, ScCellValue& rCell, const ScAddress& rPos, const ScCellValue& rOrgCell, const ScDocument* pFromDoc, ScDocument* pToDoc ) { - sal_uInt32 nFormat = NeedsNumberFormat(rOrgCell) ? pFromDoc->GetNumberFormat(rPos) : 0; + sal_uInt32 nFormat = NeedsNumberFormat(rOrgCell) ? pFromDoc->GetNumberFormat(ScRange(rPos)) : 0; SetValue(rStr, rCell, nFormat, rOrgCell, pFromDoc, pToDoc); } @@ -2604,7 +2604,7 @@ void ScChangeTrack::AppendContent( const ScAddress& rPos, void ScChangeTrack::AppendContent( const ScAddress& rPos, const ScCellValue& rOldCell ) { if (ScChangeActionContent::NeedsNumberFormat(rOldCell)) - AppendContent(rPos, rOldCell, rDoc.GetNumberFormat(rPos), &rDoc); + AppendContent(rPos, rOldCell, rDoc.GetNumberFormat(ScRange(rPos)), &rDoc); else AppendContent(rPos, rOldCell, 0, &rDoc); } diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx index 596f50f756a5..823849554693 100644 --- a/sc/source/core/tool/dbdata.cxx +++ b/sc/source/core/tool/dbdata.cxx @@ -965,7 +965,7 @@ void ScDBData::Notify( const SfxHint& rHint ) { aHintAddress.SetRow( aHeaderRange.aStart.Row()); if (!aHeaderRange.Contains( aHintAddress)) - mpContainer->GetDirtyTableColumnNames().Join( aHintAddress); + mpContainer->GetDirtyTableColumnNames().Join( ScRange(aHintAddress) ); } } else @@ -973,7 +973,7 @@ void ScDBData::Notify( const SfxHint& rHint ) // We need *some* range in the dirty list even without header area, // otherwise the container would not attempt to call a refresh. aHintAddress.SetRow( nStartRow); - mpContainer->GetDirtyTableColumnNames().Join( aHintAddress); + mpContainer->GetDirtyTableColumnNames().Join( ScRange(aHintAddress) ); } } diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index f4b9478cbb6b..7a23828c2402 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -2537,18 +2537,18 @@ void ScInterpreter::ScCell() else if( aInfoType == "FORMAT" ) { // specific format code for standard formats OUString aFuncResult; - sal_uInt32 nFormat = mrDoc.GetNumberFormat( aCellPos ); + sal_uInt32 nFormat = mrDoc.GetNumberFormat( ScRange(aCellPos) ); getFormatString(mrContext, nFormat, aFuncResult); PushString( aFuncResult ); } else if( aInfoType == "COLOR" ) { // 1 = negative values are colored, otherwise 0 - const SvNumberformat* pFormat = mrContext.NFGetFormatEntry( mrDoc.GetNumberFormat( aCellPos ) ); + const SvNumberformat* pFormat = mrContext.NFGetFormatEntry( mrDoc.GetNumberFormat( ScRange(aCellPos) ) ); PushInt( lcl_FormatHasNegColor( pFormat ) ? 1 : 0 ); } else if( aInfoType == "PARENTHESES" ) { // 1 = format string contains a '(' character, otherwise 0 - const SvNumberformat* pFormat = mrContext.NFGetFormatEntry( mrDoc.GetNumberFormat( aCellPos ) ); + const SvNumberformat* pFormat = mrContext.NFGetFormatEntry( mrDoc.GetNumberFormat( ScRange(aCellPos) ) ); PushInt( lcl_FormatHasOpenPar( pFormat ) ? 1 : 0 ); } else diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index c6045ad57362..0d67dee45143 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -3668,9 +3668,9 @@ void ScInterpreter::ScTableOp() } else { // broadcast and indirectly collect cell pointers and positions - mrDoc.SetTableOpDirty( aTableOp.aOld1 ); + mrDoc.SetTableOpDirty( ScRange(aTableOp.aOld1) ); if ( nParamCount == 5 ) - mrDoc.SetTableOpDirty( aTableOp.aOld2 ); + mrDoc.SetTableOpDirty( ScRange(aTableOp.aOld2) ); } aTableOp.bCollectNotifications = false; diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx index 4f2cec309159..35dedd6052ba 100644 --- a/sc/source/filter/excel/xecontent.cxx +++ b/sc/source/filter/excel/xecontent.cxx @@ -540,7 +540,7 @@ void XclExpHyperlink::SaveXml( XclExpXmlStream& rStrm ) if (mxTextMark) sTextMark = XclXmlUtils::ToOString(*mxTextMark); rStrm.GetCurrentStream()->singleElement( XML_hyperlink, - XML_ref, XclXmlUtils::ToOString(rStrm.GetRoot().GetDoc(), maScPos), + XML_ref, XclXmlUtils::ToOString(rStrm.GetRoot().GetDoc(), ScRange(maScPos)), FSNS( XML_r, XML_id ), sax_fastparser::UseIf(sId, !sId.isEmpty()), XML_location, sTextMark, // OOXTODO: XML_tooltip, from record HLinkTooltip 800h wzTooltip diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx index 625021e7555b..7b23e9755162 100644 --- a/sc/source/filter/excel/xeescher.cxx +++ b/sc/source/filter/excel/xeescher.cxx @@ -1778,7 +1778,7 @@ void XclExpNote::WriteXml( sal_Int32 nAuthorId, XclExpXmlStream& rStrm ) sax_fastparser::FSHelperPtr rComments = rStrm.GetCurrentStream(); rComments->startElement( XML_comment, - XML_ref, XclXmlUtils::ToOString(mrRoot.GetDoc(), maScPos), + XML_ref, XclXmlUtils::ToOString(mrRoot.GetDoc(), ScRange(maScPos)), XML_authorId, OString::number(nAuthorId) // OOXTODO: XML_guid ); diff --git a/sc/source/filter/excel/xelink.cxx b/sc/source/filter/excel/xelink.cxx index db68b16770c2..5841535e74ab 100644 --- a/sc/source/filter/excel/xelink.cxx +++ b/sc/source/filter/excel/xelink.cxx @@ -1220,26 +1220,26 @@ void XclExpCrn::SaveXml( XclExpXmlStream& rStrm ) if (std::isfinite( fVal)) { // t='n' is omitted - pFS->startElement(XML_cell, XML_r, XclXmlUtils::ToOString(rStrm.GetRoot().GetDoc(), aAdr)); + pFS->startElement(XML_cell, XML_r, XclXmlUtils::ToOString(rStrm.GetRoot().GetDoc(), ScRange(aAdr))); pFS->startElement(XML_v); pFS->write( fVal ); } else { - pFS->startElement(XML_cell, XML_r, XclXmlUtils::ToOString(rStrm.GetRoot().GetDoc(), aAdr), XML_t, "e"); + pFS->startElement(XML_cell, XML_r, XclXmlUtils::ToOString(rStrm.GetRoot().GetDoc(), ScRange(aAdr)), XML_t, "e"); pFS->startElement(XML_v); pFS->write( "#VALUE!" ); // OOXTODO: support other error values } } else if( rValue.has< OUString >() ) { - pFS->startElement(XML_cell, XML_r, XclXmlUtils::ToOString(rStrm.GetRoot().GetDoc(), aAdr), XML_t, "str"); + pFS->startElement(XML_cell, XML_r, XclXmlUtils::ToOString(rStrm.GetRoot().GetDoc(), ScRange(aAdr)), XML_t, "str"); pFS->startElement(XML_v); pFS->write( rValue.get< OUString >() ); } else if( rValue.has< bool >() ) { - pFS->startElement(XML_cell, XML_r, XclXmlUtils::ToOString(rStrm.GetRoot().GetDoc(), aAdr), XML_t, "b"); + pFS->startElement(XML_cell, XML_r, XclXmlUtils::ToOString(rStrm.GetRoot().GetDoc(), ScRange(aAdr)), XML_t, "b"); pFS->startElement(XML_v); pFS->write( rValue.get< bool >() ? "1" : "0" ); } diff --git a/sc/source/filter/oox/sheetdatabuffer.cxx b/sc/source/filter/oox/sheetdatabuffer.cxx index 968689832407..e9286d5f1523 100644 --- a/sc/source/filter/oox/sheetdatabuffer.cxx +++ b/sc/source/filter/oox/sheetdatabuffer.cxx @@ -718,7 +718,7 @@ void SheetDataBuffer::setCellFormat( const CellModel& rModel ) * It is sufficient to check if the row range size is one */ if (!rRangeList.empty() && - *pLastRange == rModel.maCellAddr) + *pLastRange == ScRange(rModel.maCellAddr)) ; // do nothing - this probably bad data else if (!rRangeList.empty() && pLastRange->aStart.Tab() == rModel.maCellAddr.Tab() && diff --git a/sc/source/filter/xcl97/XclExpChangeTrack.cxx b/sc/source/filter/xcl97/XclExpChangeTrack.cxx index 30812d7bb9e2..0e11e542d0a2 100644 --- a/sc/source/filter/xcl97/XclExpChangeTrack.cxx +++ b/sc/source/filter/xcl97/XclExpChangeTrack.cxx @@ -1040,7 +1040,7 @@ static void lcl_WriteCell( XclExpXmlStream& rStrm, sal_Int32 nElement, const ScA sax_fastparser::FSHelperPtr pStream = rStrm.GetCurrentStream(); pStream->startElement(nElement, - XML_r, XclXmlUtils::ToOString(rStrm.GetRoot().GetDoc(), rPosition), + XML_r, XclXmlUtils::ToOString(rStrm.GetRoot().GetDoc(), ScRange(rPosition)), XML_s, nullptr, // OOXTODO: not supported XML_t, lcl_GetType(pData), XML_cm, nullptr, // OOXTODO: not supported @@ -1108,7 +1108,7 @@ void XclExpChTrCellContent::SaveXml( XclExpXmlStream& rRevisionLogStrm ) lcl_WriteCell( rRevisionLogStrm, XML_oc, aPosition, pOldData.get() ); if (!pNewData) { - pStream->singleElement(XML_nc, XML_r, XclXmlUtils::ToOString(rRevisionLogStrm.GetRoot().GetDoc(), aPosition)); + pStream->singleElement(XML_nc, XML_r, XclXmlUtils::ToOString(rRevisionLogStrm.GetRoot().GetDoc(), ScRange(aPosition))); } } if( pNewData ) diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx index 26bca0d1d442..8f166bcb6f27 100644 --- a/sc/source/filter/xcl97/xcl97rec.cxx +++ b/sc/source/filter/xcl97/xcl97rec.cxx @@ -1476,7 +1476,7 @@ void ExcEScenarioCell::SaveXml( XclExpXmlStream& rStrm ) const rStrm.GetCurrentStream()->singleElement( XML_inputCells, // OOXTODO: XML_deleted, // OOXTODO: XML_numFmtId, - XML_r, XclXmlUtils::ToOString( rStrm.GetRoot().GetDoc(), ScAddress( nCol, nRow, 0 ) ), + XML_r, XclXmlUtils::ToOString( rStrm.GetRoot().GetDoc(), ScRange( ScAddress( nCol, nRow, 0 ) ) ), // OOXTODO: XML_undone, XML_val, XclXmlUtils::ToOString( sText ) ); } diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index a122075f1c68..fd33b8ea81f7 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -1299,7 +1299,7 @@ OUString getOutputString( ScDocument* pDoc, const ScAddress& aCellPos ) { // like in GetString for document (column) const Color* pColor; - sal_uInt32 nNumFmt = pDoc->GetNumberFormat(aCellPos); + sal_uInt32 nNumFmt = pDoc->GetNumberFormat(ScRange(aCellPos)); return ScCellFormat::GetString(aCell, nNumFmt, &pColor, nullptr, *pDoc); } } diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index e57df86477af..35715c62ba74 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -223,7 +223,7 @@ OUString lcl_GetFormattedString(ScDocument* pDoc, const ScRefCellValue& rCell, c case CELLTYPE_STRING: { const Color* pColor; - sal_uInt32 nFormat = pDoc->GetNumberFormat(rAddr); + sal_uInt32 nFormat = pDoc->GetNumberFormat(ScRange(rAddr)); return ScCellFormat::GetString(rCell, nFormat, &pColor, nullptr, *pDoc); } case CELLTYPE_EDIT: diff --git a/sc/source/filter/xml/xmlsubti.cxx b/sc/source/filter/xml/xmlsubti.cxx index 7e5083f2a3c9..aa48f37833b3 100644 --- a/sc/source/filter/xml/xmlsubti.cxx +++ b/sc/source/filter/xml/xmlsubti.cxx @@ -279,7 +279,7 @@ void ScMyTables::AddMatrixRange( bool ScMyTables::IsPartOfMatrix(const ScAddress& rScAddress) const { if (!maMatrixRangeList.empty()) - return maMatrixRangeList.Contains(rScAddress); + return maMatrixRangeList.Contains(ScRange(rScAddress)); return false; } diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index d3512500037a..cb7ffe31e9e0 100644 --- a/sc/source/ui/docshell/dbdocfun.cxx +++ b/sc/source/ui/docshell/dbdocfun.cxx @@ -1318,7 +1318,7 @@ bool ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewOb ScRangeList aRanges; aRanges.push_back(pOldObj->GetOutRange()); - aRanges.push_back(pNewObj->GetOutRange().aStart); // at least one cell in the output position must be editable. + aRanges.push_back(ScRange(pNewObj->GetOutRange().aStart)); // at least one cell in the output position must be editable. if (!isEditable(rDocShell, aRanges, bApi)) return false; diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index fa2a37ea79d0..77e4e372bea3 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -713,7 +713,7 @@ bool ScDocFunc::DeleteCell( sal_uInt16 nExtFlags = 0; // extra flags are needed only if attributes are deleted if (nFlags & InsertDeleteFlags::ATTRIB) - rDocShell.UpdatePaintExt(nExtFlags, rPos); + rDocShell.UpdatePaintExt(nExtFlags, ScRange(rPos)); // order of operations: // 1) BeginDrawUndo @@ -735,8 +735,8 @@ bool ScDocFunc::DeleteCell( ScDocumentUniquePtr pUndoDoc; if (bRecord) { - pUndoDoc = sc::DocFuncUtil::createDeleteContentsUndoDoc(rDoc, rMark, rPos, nFlags, false); - pDataSpans = sc::DocFuncUtil::getNonEmptyCellSpans(rDoc, rMark, rPos); + pUndoDoc = sc::DocFuncUtil::createDeleteContentsUndoDoc(rDoc, rMark, ScRange(rPos), nFlags, false); + pDataSpans = sc::DocFuncUtil::getNonEmptyCellSpans(rDoc, rMark, ScRange(rPos)); } tools::Long nBefore(rDocShell.GetTwipWidthHint(rPos)); @@ -745,11 +745,11 @@ bool ScDocFunc::DeleteCell( if (bRecord) { sc::DocFuncUtil::addDeleteContentsUndo( - rDocShell.GetUndoManager(), &rDocShell, rMark, rPos, std::move(pUndoDoc), + rDocShell.GetUndoManager(), &rDocShell, rMark, ScRange(rPos), std::move(pUndoDoc), nFlags, pDataSpans, false, bDrawUndo); } - if (!AdjustRowHeight(rPos, true, bApi)) + if (!AdjustRowHeight(ScRange(rPos), true, bApi)) rDocShell.PostPaint( rPos.Col(), rPos.Row(), rPos.Tab(), rPos.Col(), rPos.Row(), rPos.Tab(), PaintPartFlags::Grid, nExtFlags, nBefore); @@ -893,7 +893,7 @@ bool ScDocFunc::SetValueCell( const ScAddress& rPos, double fVal, bool bInteract ScDocument& rDoc = rDocShell.GetDocument(); bool bUndo = rDoc.IsUndoEnabled(); - bool bHeight = rDoc.HasAttrib(rPos, HasAttrFlags::NeedHeight); + bool bHeight = rDoc.HasAttrib(ScRange(rPos), HasAttrFlags::NeedHeight); ScCellValue aOldVal; if (bUndo) @@ -910,7 +910,7 @@ bool ScDocFunc::SetValueCell( const ScAddress& rPos, double fVal, bool bInteract } if (bHeight) - AdjustRowHeight(rPos, true, !bInteraction); + AdjustRowHeight(ScRange(rPos), true, !bInteraction); rDocShell.PostPaintCell( rPos ); aModificator.SetDocumentModified(); @@ -962,7 +962,7 @@ bool ScDocFunc::SetStringCell( const ScAddress& rPos, const OUString& rStr, bool ScDocument& rDoc = rDocShell.GetDocument(); bool bUndo = rDoc.IsUndoEnabled(); - bool bHeight = rDoc.HasAttrib(rPos, HasAttrFlags::NeedHeight); + bool bHeight = rDoc.HasAttrib(ScRange(rPos), HasAttrFlags::NeedHeight); ScCellValue aOldVal; if (bUndo) @@ -981,7 +981,7 @@ bool ScDocFunc::SetStringCell( const ScAddress& rPos, const OUString& rStr, bool } if (bHeight) - AdjustRowHeight(rPos, true, !bInteraction); + AdjustRowHeight(ScRange(rPos), true, !bInteraction); rDocShell.PostPaintCell( rPos ); aModificator.SetDocumentModified(); @@ -999,7 +999,7 @@ bool ScDocFunc::SetEditCell( const ScAddress& rPos, const EditTextObject& rStr, ScDocument& rDoc = rDocShell.GetDocument(); bool bUndo = rDoc.IsUndoEnabled(); - bool bHeight = rDoc.HasAttrib(rPos, HasAttrFlags::NeedHeight); + bool bHeight = rDoc.HasAttrib(ScRange(rPos), HasAttrFlags::NeedHeight); ScCellValue aOldVal; if (bUndo) @@ -1016,7 +1016,7 @@ bool ScDocFunc::SetEditCell( const ScAddress& rPos, const EditTextObject& rStr, } if (bHeight) - AdjustRowHeight(rPos, true, !bInteraction); + AdjustRowHeight(ScRange(rPos), true, !bInteraction); rDocShell.PostPaintCell( rPos ); aModificator.SetDocumentModified(); @@ -1051,7 +1051,7 @@ bool ScDocFunc::SetFormulaCell( const ScAddress& rPos, ScFormulaCell* pCell, boo ScDocument& rDoc = rDocShell.GetDocument(); bool bUndo = rDoc.IsUndoEnabled(); - bool bHeight = rDoc.HasAttrib(rPos, HasAttrFlags::NeedHeight); + bool bHeight = rDoc.HasAttrib(ScRange(rPos), HasAttrFlags::NeedHeight); ScCellValue aOldVal; if (bUndo) @@ -1080,7 +1080,7 @@ bool ScDocFunc::SetFormulaCell( const ScAddress& rPos, ScFormulaCell* pCell, boo } if (bHeight) - AdjustRowHeight(rPos, true, !bInteraction); + AdjustRowHeight(ScRange(rPos), true, !bInteraction); rDocShell.PostPaintCell( rPos ); aModificator.SetDocumentModified(); diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 7a95002a45a4..6250ca15b24e 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -2212,7 +2212,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt, } else if (pCell->getFormula()->IsValue()) { - sal_uInt32 nFormat = m_pDocument->GetNumberFormat(aPos); + sal_uInt32 nFormat = m_pDocument->GetNumberFormat(ScRange(aPos)); if ( bFixedWidth || bSaveAsShown ) { const Color* pDummy; @@ -2229,7 +2229,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt, { if ( bSaveAsShown ) { - sal_uInt32 nFormat = m_pDocument->GetNumberFormat(aPos); + sal_uInt32 nFormat = m_pDocument->GetNumberFormat(ScRange(aPos)); const Color* pDummy; aString = ScCellFormat::GetString(*pCell, nFormat, &pDummy, &rContext, *m_pDocument); } @@ -2242,7 +2242,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt, case CELLTYPE_STRING : if ( bSaveAsShown ) { - sal_uInt32 nFormat = m_pDocument->GetNumberFormat(aPos); + sal_uInt32 nFormat = m_pDocument->GetNumberFormat(ScRange(aPos)); const Color* pDummy; aString = ScCellFormat::GetString(*pCell, nFormat, &pDummy, &rContext, *m_pDocument); } diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx index 7fa58b0aba43..1ae715a12276 100644 --- a/sc/source/ui/docshell/docsh8.cxx +++ b/sc/source/ui/docshell/docsh8.cxx @@ -717,7 +717,7 @@ void lcl_getLongVarCharString( { const Color* pColor; ScAddress aPos(nCol, nRow, nTab); - sal_uInt32 nFormat = rDoc.GetNumberFormat(aPos); + sal_uInt32 nFormat = rDoc.GetNumberFormat(ScRange(aPos)); rString = ScCellFormat::GetString(rDoc, aPos, nFormat, &pColor, &rContext); } diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index 42b281e2aadf..cd6926739594 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -1942,7 +1942,7 @@ bool ScImportExport::Doc2Text( SvStream& rStrm ) for (nCol = nStartCol; nCol <= nEndCol; nCol++) { ScAddress aPos(nCol, nRow, nStartTab); - sal_uInt32 nNumFmt = rDoc.GetNumberFormat(aPos); + sal_uInt32 nNumFmt = rDoc.GetNumberFormat(ScRange(aPos)); ScInterpreterContext& rContext = rDoc.GetNonThreadedContext(); ScRefCellValue aCell(rDoc, aPos, blockPos[ nCol - nStartCol ]); diff --git a/sc/source/ui/drawfunc/futext3.cxx b/sc/source/ui/drawfunc/futext3.cxx index c7e59c5beaba..11154d9bd7ff 100644 --- a/sc/source/ui/drawfunc/futext3.cxx +++ b/sc/source/ui/drawfunc/futext3.cxx @@ -165,7 +165,7 @@ void FuText::StopEditMode() pUndoMgr->RemoveLastUndoAction(); // Make sure the former area of the note anchor is invalidated. - ScRangeList aRangeList(aNotePos); + ScRangeList aRangeList((ScRange(aNotePos))); ScMarkData aMarkData(rDoc.GetSheetLimits(), aRangeList); rViewShell.UpdateSelectionArea(aMarkData); } diff --git a/sc/source/ui/inc/undocell.hxx b/sc/source/ui/inc/undocell.hxx index ec465e75e646..1bceeb3af5fb 100644 --- a/sc/source/ui/inc/undocell.hxx +++ b/sc/source/ui/inc/undocell.hxx @@ -94,7 +94,7 @@ public: virtual OUString GetComment() const override; - virtual std::optional<ScRange> getAffectedRange() const override { return maPos; } + virtual std::optional<ScRange> getAffectedRange() const override { return ScRange(maPos); } private: ValuesType maOldValues; @@ -124,7 +124,7 @@ public: virtual OUString GetComment() const override; - virtual std::optional<ScRange> getAffectedRange() const override { return aPos; } + virtual std::optional<ScRange> getAffectedRange() const override { return ScRange(aPos); } private: ScAddress aPos; @@ -148,7 +148,7 @@ public: virtual bool CanRepeat( SfxRepeatTarget& rTarget ) const override; virtual OUString GetComment() const override; - virtual std::optional<ScRange> getAffectedRange() const override { return maPos; } + virtual std::optional<ScRange> getAffectedRange() const override { return ScRange(maPos); } private: void SetChangeTrack(); @@ -269,7 +269,7 @@ public: virtual OUString GetComment() const override; - virtual std::optional<ScRange> getAffectedRange() const override { return maPos; } + virtual std::optional<ScRange> getAffectedRange() const override { return ScRange(maPos); } private: void DoInsertNote( const ScNoteData& rNoteData ); @@ -296,7 +296,7 @@ public: virtual OUString GetComment() const override; - virtual std::optional<ScRange> getAffectedRange() const override { return maPos; } + virtual std::optional<ScRange> getAffectedRange() const override { return ScRange(maPos); } private: ScAddress maPos; diff --git a/sc/source/ui/undo/areasave.cxx b/sc/source/ui/undo/areasave.cxx index bc224bba651d..374ae9c8a63a 100644 --- a/sc/source/ui/undo/areasave.cxx +++ b/sc/source/ui/undo/areasave.cxx @@ -65,7 +65,7 @@ void ScAreaLinkSaver::InsertNewLink( ScDocument* pDoc ) if ( pLinkManager && pObjSh ) { ScAreaLink* pLink = new ScAreaLink( pObjSh, aFileName, aFilterName, aOptions, - aSourceArea, aDestArea.aStart, nRefreshDelaySeconds ); + aSourceArea, ScRange(aDestArea.aStart), nRefreshDelaySeconds ); pLink->SetInCreate( true ); pLink->SetDestArea( aDestArea ); OUString aTmp1(aFilterName), aTmp2(aSourceArea); diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx index c9747ad6de4b..9c4bc4409ebd 100644 --- a/sc/source/ui/undo/undoblk3.cxx +++ b/sc/source/ui/undo/undoblk3.cxx @@ -1522,7 +1522,7 @@ void ScUndoInsertAreaLink::Redo() sfx2::LinkManager* pLinkManager = rDoc.GetLinkManager(); ScAreaLink* pLink = new ScAreaLink( pDocShell, aDocName, aFltName, aOptions, - aAreaName, aRange.aStart, nRefreshDelay ); + aAreaName, ScRange(aRange.aStart), nRefreshDelay ); pLink->SetInCreate( true ); pLink->SetDestArea( aRange ); pLinkManager->InsertFileLink( *pLink, sfx2::SvBaseLinkObjectType::ClientFile, aDocName, &aFltName, &aAreaName ); @@ -1571,7 +1571,7 @@ void ScUndoRemoveAreaLink::Undo() sfx2::LinkManager* pLinkManager = rDoc.GetLinkManager(); ScAreaLink* pLink = new ScAreaLink( pDocShell, aDocName, aFltName, aOptions, - aAreaName, aRange.aStart, nRefreshDelay ); + aAreaName, ScRange(aRange.aStart), nRefreshDelay ); pLink->SetInCreate( true ); pLink->SetDestArea( aRange ); pLinkManager->InsertFileLink( *pLink, sfx2::SvBaseLinkObjectType::ClientFile, aDocName, &aFltName, &aAreaName ); diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index a3338bba3496..2c777b43178b 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -1299,7 +1299,7 @@ static OUString lcl_GetInputString( ScDocument& rDoc, const ScAddress& rPos, boo // Since the English formatter was constructed with // LANGUAGE_ENGLISH_US the "General" format has index key 0, // we don't have to query. - sal_uInt32 nNumFmt = bEnglish ? 0 : rDoc.GetNumberFormat(rPos); + sal_uInt32 nNumFmt = bEnglish ? 0 : rDoc.GetNumberFormat(ScRange(rPos)); if (eType == CELLTYPE_EDIT) { @@ -3318,7 +3318,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryEmptyCel { // notes count as non-empty if (!aIter.isEmpty()) - aMarkData.SetMultiMarkArea(aIter.GetPos(), false); + aMarkData.SetMultiMarkArea(ScRange(aIter.GetPos()), false); } } @@ -3397,7 +3397,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryContentC } if (bAdd) - aMarkData.SetMultiMarkArea(aIter.GetPos()); + aMarkData.SetMultiMarkArea(ScRange(aIter.GetPos())); } } @@ -3408,7 +3408,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryContentC for (const auto& i : aNotes) { - aMarkData.SetMultiMarkArea(i.maPos); + aMarkData.SetMultiMarkArea(ScRange(i.maPos)); } } @@ -3461,7 +3461,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryFormulaC } if (bAdd) - aMarkData.SetMultiMarkArea(aIter.GetPos()); + aMarkData.SetMultiMarkArea(ScRange(aIter.GetPos())); } } } @@ -5868,7 +5868,7 @@ void ScCellObj::InputEnglishString( const OUString& rText ) ScDocument& rDoc = pDocSh->GetDocument(); ScInterpreterContext& rContext = rDoc.GetNonThreadedContext(); - sal_uInt32 nOldFormat = rDoc.GetNumberFormat( aCellPos ); + sal_uInt32 nOldFormat = rDoc.GetNumberFormat( ScRange(aCellPos) ); if (rContext.NFGetType(nOldFormat) == SvNumFormatType::TEXT) { SetString_Impl(rText, false, false); // text cell diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index 5c35d8739b0d..73e3e54d7be7 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -3208,7 +3208,7 @@ namespace { sal_uInt32 getDisplayNumberFormat(const ScDocument* pDoc, const ScAddress& rPos) { - sal_uInt32 nFormat = pDoc->GetNumberFormat(rPos); // original format from cell. + sal_uInt32 nFormat = pDoc->GetNumberFormat(ScRange(rPos)); // original format from cell. return nFormat; } diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx index 10015a2f42f7..45deb7d9bb4a 100644 --- a/sc/source/ui/unoobj/textuno.cxx +++ b/sc/source/ui/unoobj/textuno.cxx @@ -818,7 +818,7 @@ SvxTextForwarder* ScCellTextData::GetTextForwarder() } else { - sal_uInt32 nFormat = rDoc.GetNumberFormat(aCellPos); + sal_uInt32 nFormat = rDoc.GetNumberFormat(ScRange(aCellPos)); OUString aText = ScCellFormat::GetInputString(aCell, nFormat, nullptr, rDoc); // tdf#157568 check if edit engine already has text // If the input string is empty but the edit engine's existing diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 888ab37c9ed4..0746215ee8ab 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -3416,7 +3416,7 @@ void ErrorOrRunPivotLayoutDialog(TranslateId pSrcErrorId, } if ( pNewDPObject ) - pNewDPObject->SetOutRange( rDestPos ); + pNewDPObject->SetOutRange( ScRange(rDestPos) ); RunPivotLayoutDialog(pScMod, pTabViewShell, pNewDPObject); } @@ -3498,7 +3498,7 @@ void ScCellShell::ExecuteDataPilotDialog() pServDlg->GetParPass() ); std::unique_ptr<ScDPObject> pNewDPObject(new ScDPObject(&rDoc)); pNewDPObject->SetServiceData( aServDesc ); - pNewDPObject->SetOutRange(aDestPos); + pNewDPObject->SetOutRange(ScRange(aDestPos)); RunPivotLayoutDialog(pScMod, pTabViewShell, pNewDPObject); } @@ -3521,7 +3521,7 @@ void ScCellShell::ExecuteDataPilotDialog() pDataDlg->GetValues( aImpDesc ); std::unique_ptr<ScDPObject> pNewDPObject(new ScDPObject(&rDoc)); pNewDPObject->SetImportDesc( aImpDesc ); - pNewDPObject->SetOutRange(aDestPos); + pNewDPObject->SetOutRange(ScRange(aDestPos)); RunPivotLayoutDialog(pScMod, pTabViewShell, pNewDPObject); } diff --git a/sc/source/ui/view/dbfunc4.cxx b/sc/source/ui/view/dbfunc4.cxx index f13035b29108..56e1512c6775 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.Contains(rPos); + bHit = aRanges.Contains(ScRange(rPos)); } if (bHit) { diff --git a/sc/source/ui/view/drawvie4.cxx b/sc/source/ui/view/drawvie4.cxx index 33af7b0eabb8..d6aba90aec66 100644 --- a/sc/source/ui/view/drawvie4.cxx +++ b/sc/source/ui/view/drawvie4.cxx @@ -253,7 +253,7 @@ void getOleSourceRanges(const SdrMarkList& rMarkList, bool& rAnyOle, bool& rOneO pRanges->insert(pRanges->end(), aRange.begin(), aRange.end()); } else if (aAddr.Parse(rRangeRep, *pDoc, pDoc->GetAddressConvention()) & ScRefFlags::VALID) - pRanges->push_back(aAddr); + pRanges->push_back(ScRange(aAddr)); } return; diff --git a/sc/source/ui/view/spellcheckcontext.cxx b/sc/source/ui/view/spellcheckcontext.cxx index b18483aa8817..890940531874 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.Contains(ScAddress(nCol, nRow, mnTab))) // Don't spell check within pivot tables + if (aPivotRanges.Contains(ScRange(ScAddress(nCol, nRow, mnTab)))) // Don't spell check within pivot tables { mpResult->set(nCol, nRow, nullptr); return; diff --git a/sc/source/ui/view/spelleng.cxx b/sc/source/ui/view/spelleng.cxx index 2782ca363d40..f883f17e5611 100644 --- a/sc/source/ui/view/spelleng.cxx +++ b/sc/source/ui/view/spelleng.cxx @@ -280,7 +280,7 @@ void ScConversionEngineBase::FillFromCell( SCCOL nCol, SCROW nRow, SCTAB nTab ) { case CELLTYPE_STRING: { - sal_uInt32 nNumFmt = mrDoc.GetNumberFormat(aPos); + sal_uInt32 nNumFmt = mrDoc.GetNumberFormat(ScRange(aPos)); const Color* pColor; OUString aText = ScCellFormat::GetString(aCell, nNumFmt, &pColor, nullptr, mrDoc); diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx index 26da7af3a483..c4d48418d0ac 100644 --- a/sc/source/ui/view/tabvwsha.cxx +++ b/sc/source/ui/view/tabvwsha.cxx @@ -755,7 +755,7 @@ void ScTabViewShell::UpdateInputHandler( bool bForce /* = sal_False */, bool bSt else { ScInterpreterContext& rContext = rDoc.GetNonThreadedContext(); - sal_uInt32 nNumFmt = rDoc.GetNumberFormat( aPos ); + sal_uInt32 nNumFmt = rDoc.GetNumberFormat( ScRange(aPos) ); aString = ScCellFormat::GetInputString( rCell, nNumFmt, &rContext, rDoc ); if (rCell.getType() == CELLTYPE_STRING) diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index 6c27c97a0c28..edd609ee3b9d 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -2709,7 +2709,7 @@ void ScViewFunc::InsertAreaLink( const OUString& rFile, SCTAB nTab = GetViewData().GetTabNo(); ScAddress aPos( nPosX, nPosY, nTab ); - pDocSh->GetDocFunc().InsertAreaLink( rFile, rFilter, rOptions, rSource, aPos, 0/*nRefresh*/, false, false ); + pDocSh->GetDocFunc().InsertAreaLink( rFile, rFilter, rOptions, rSource, ScRange(aPos), 0/*nRefresh*/, false, false ); } void ScViewFunc::InsertTableLink( const OUString& rFile, diff --git a/sc/source/ui/view/viewfun6.cxx b/sc/source/ui/view/viewfun6.cxx index 916997ecf21f..ca636813f139 100644 --- a/sc/source/ui/view/viewfun6.cxx +++ b/sc/source/ui/view/viewfun6.cxx @@ -180,7 +180,7 @@ void ScViewFunc::DetectiveMarkPred() if (rMarkData.IsMarked() || rMarkData.IsMultiMarked()) rMarkData.FillRangeListWithMarks(&aRanges, false); else - aRanges.push_back(aCurPos); + aRanges.push_back(ScRange(aCurPos)); vector<ScTokenRef> aRefTokens; pDocSh->GetDocFunc().DetectiveCollectAllPreds(aRanges, aRefTokens); @@ -243,7 +243,7 @@ void ScViewFunc::DetectiveMarkSucc() if (rMarkData.IsMarked() || rMarkData.IsMultiMarked()) rMarkData.FillRangeListWithMarks(&aRanges, false); else - aRanges.push_back(aCurPos); + aRanges.push_back(ScRange(aCurPos)); vector<ScTokenRef> aRefTokens; pDocSh->GetDocFunc().DetectiveCollectAllSuccs(aRanges, aRefTokens); @@ -283,7 +283,7 @@ void ScViewFunc::InsertCurrentTime(SvNumFormatType nReqFmt, const OUString& rUnd ScDocShell* pDocSh = rViewData.GetDocShell(); ScDocument& rDoc = pDocSh->GetDocument(); ScAddress aCurPos = rViewData.GetCurPos(); - const sal_uInt32 nCurNumFormat = rDoc.GetNumberFormat(aCurPos); + const sal_uInt32 nCurNumFormat = rDoc.GetNumberFormat(ScRange(aCurPos)); SvNumberFormatter* pFormatter = rDoc.GetFormatTable(); const SvNumberformat* pCurNumFormatEntry = pFormatter->GetEntry(nCurNumFormat); const SvNumFormatType nCurNumFormatType = (pCurNumFormatEntry ? diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index 7bc0a6482836..68698580dbac 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -1448,7 +1448,7 @@ void ScViewFunc::ApplySelectionPattern( const ScPatternAttr& rAttr, bool bCursor pNewEditData = pEditObj->Clone(); } - aChangeRanges.push_back(aPos); + aChangeRanges.push_back(ScRange(aPos)); std::optional<ScPatternAttr> pOldPat(*rDoc.GetPattern( nCol, nRow, nTab )); rDoc.ApplyPattern( nCol, nRow, nTab, rAttr ); |