sc/inc/document.hxx | 4 +-- sc/inc/table.hxx | 2 - sc/qa/unit/ucalc_condformat.cxx | 38 +++++++++++++++--------------- sc/source/core/data/documen4.cxx | 10 +++---- sc/source/core/data/table1.cxx | 2 - sc/source/filter/excel/xicontent.cxx | 2 - sc/source/filter/oox/condformatbuffer.cxx | 2 - sc/source/filter/xml/xmlcondformat.cxx | 2 - sc/source/filter/xml/xmlstyli.cxx | 2 - sc/source/ui/docshell/docfunc.cxx | 2 - sc/source/ui/docshell/docsh6.cxx | 2 - 11 files changed, 34 insertions(+), 34 deletions(-)
New commits: commit 0decafad011cf84cf9cc7d8bdcad6d7ebfba6073 Author: sahil <gautamsahil1...@gmail.com> AuthorDate: Wed Aug 23 18:05:53 2023 +0530 Commit: Hossein <hoss...@libreoffice.org> CommitDate: Tue Jan 9 19:56:26 2024 +0100 tdf#114441 - Convert sal_uLong to better integer types Change-Id: I55c758f6391cecb261adca79ae1b93006bcae806 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155979 Tested-by: Jenkins Reviewed-by: Hossein <hoss...@libreoffice.org> diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 5a92140973a5..55d0b57cd914 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -1886,11 +1886,11 @@ public: void ClearSelectionItems( const sal_uInt16* pWhich, const ScMarkData& rMark ); void ChangeSelectionIndent( bool bIncrement, const ScMarkData& rMark ); - SC_DLLPUBLIC sal_uLong AddCondFormat( std::unique_ptr<ScConditionalFormat> pNew, SCTAB nTab ); + SC_DLLPUBLIC sal_uInt32 AddCondFormat( std::unique_ptr<ScConditionalFormat> pNew, SCTAB nTab ); void DeleteConditionalFormat( sal_uLong nIndex, SCTAB nTab ); void SetCondFormList( ScConditionalFormatList* pList, SCTAB nTab ); - SC_DLLPUBLIC sal_uLong AddValidationEntry( const ScValidationData& rNew ); + SC_DLLPUBLIC sal_uInt32 AddValidationEntry( const ScValidationData& rNew ); SC_DLLPUBLIC const ScValidationData* GetValidationEntry( sal_uInt32 nIndex ) const; SC_DLLPUBLIC ScConditionalFormatList* GetCondFormList( SCTAB nTab ) const; diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index 8f749a273707..1761d0cdeed4 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -1065,7 +1065,7 @@ public: void DeleteConditionalFormat(sal_uLong nOldIndex); - sal_uLong AddCondFormat( std::unique_ptr<ScConditionalFormat> pNew ); + sal_uInt32 AddCondFormat( std::unique_ptr<ScConditionalFormat> pNew ); SvtScriptType GetScriptType( SCCOL nCol, SCROW nRow ) const; void SetScriptType( SCCOL nCol, SCROW nRow, SvtScriptType nType ); diff --git a/sc/qa/unit/ucalc_condformat.cxx b/sc/qa/unit/ucalc_condformat.cxx index 7a0abc7cf026..a9c289c0aca8 100644 --- a/sc/qa/unit/ucalc_condformat.cxx +++ b/sc/qa/unit/ucalc_condformat.cxx @@ -188,7 +188,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatInsertDeleteSheets) pFormat->SetRange(ScRange(1,1,0,1,3,0)); auto pFormatTmp = pFormat.get(); - sal_uLong nKey = m_pDoc->AddCondFormat(std::move(pFormat), 0); + sal_uInt32 nKey = m_pDoc->AddCondFormat(std::move(pFormat), 0); // Add condition in which if the value equals 2, set the "Result" style. ScCondFormatEntry* pEntry = new ScCondFormatEntry( @@ -305,7 +305,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testDataBarCondCopyPaste) pDatabar->SetDataBarData(pFormatData); pFormat->AddEntry(pDatabar); - sal_uLong nIndex = m_pDoc->AddCondFormat(std::move(pFormat), 0); + sal_uInt32 nIndex = m_pDoc->AddCondFormat(std::move(pFormat), 0); ScDocument aClipDoc(SCDOCMODE_CLIP); copyToClip(m_pDoc, aCondFormatRange, &aClipDoc); @@ -324,14 +324,14 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testDataBarCondCopyPaste) CPPUNIT_ASSERT(pPastedFormat); CPPUNIT_ASSERT_EQUAL(aRangeList, pPastedFormat->GetRange()); - sal_uLong nPastedKey = pPastedFormat->GetKey(); + sal_uInt32 nPastedKey = pPastedFormat->GetKey(); CPPUNIT_ASSERT_EQUAL(nIndex, nPastedKey); const SfxPoolItem* pItem = m_pDoc->GetAttr(nCol, 3, 0, ATTR_CONDITIONAL); const ScCondFormatItem* pCondFormatItem = static_cast<const ScCondFormatItem*>(pItem); CPPUNIT_ASSERT(pCondFormatItem); CPPUNIT_ASSERT_EQUAL(size_t(1), pCondFormatItem->GetCondFormatData().size()); - CPPUNIT_ASSERT_EQUAL(sal_uInt32(nIndex), pCondFormatItem->GetCondFormatData().front()); + CPPUNIT_ASSERT_EQUAL(nIndex, pCondFormatItem->GetCondFormatData().front()); } m_pDoc->DeleteTab(0); @@ -346,7 +346,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testColorScaleInMergedCell) auto pFormat = std::make_unique<ScConditionalFormat>(1, m_pDoc); pFormat->SetRange(ScRange(0, 0, 0, 0, 0, 0)); auto pFormatTmp = pFormat.get(); - sal_uLong nKey = m_pDoc->AddCondFormat(std::move(pFormat), 0); + sal_uInt32 nKey = m_pDoc->AddCondFormat(std::move(pFormat), 0); // Add color scale entries. // The coloring is based on the value. (BLUE (x <= 0), GREEN (x == 1), RED (x >= 2)) @@ -407,7 +407,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testColorScaleCondCopyPaste) pColorScaleFormat->AddEntry(pEntryRed); pFormat->AddEntry(pColorScaleFormat); - sal_uLong nIndex = m_pDoc->AddCondFormat(std::move(pFormat), 0); + sal_uInt32 nIndex = m_pDoc->AddCondFormat(std::move(pFormat), 0); ScDocument aClipDoc(SCDOCMODE_CLIP); copyToClip(m_pDoc, aCondFormatRange, &aClipDoc); @@ -426,7 +426,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testColorScaleCondCopyPaste) CPPUNIT_ASSERT(pPastedFormat); CPPUNIT_ASSERT_EQUAL(aRangeList, pPastedFormat->GetRange()); - sal_uLong nPastedKey = pPastedFormat->GetKey(); + sal_uInt32 nPastedKey = pPastedFormat->GetKey(); CPPUNIT_ASSERT_EQUAL(nIndex, nPastedKey); const SfxPoolItem* pItem = m_pDoc->GetAttr(nCol, 3, 0, ATTR_CONDITIONAL); @@ -450,7 +450,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondCopyPaste) ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,"=B2","",*m_pDoc,ScAddress(0,0,0),ScResId(STR_STYLENAME_RESULT)); pFormat->AddEntry(pEntry); - sal_uLong nIndex = m_pDoc->AddCondFormat(std::move(pFormat), 0); + sal_uInt32 nIndex = m_pDoc->AddCondFormat(std::move(pFormat), 0); ScDocument aClipDoc(SCDOCMODE_CLIP); copyToClip(m_pDoc, aCondFormatRange, &aClipDoc); @@ -467,13 +467,13 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondCopyPaste) CPPUNIT_ASSERT_EQUAL(size_t(1), m_pDoc->GetCondFormList(0)->size()); aRangeList.Join(aTargetRange); CPPUNIT_ASSERT_EQUAL(aRangeList, pPastedFormat->GetRange()); - CPPUNIT_ASSERT_EQUAL(sal_uInt32(nIndex), pPastedFormat->GetKey()); + CPPUNIT_ASSERT_EQUAL(nIndex, pPastedFormat->GetKey()); const SfxPoolItem* pItem = m_pDoc->GetAttr( 7, 7, 0, ATTR_CONDITIONAL ); const ScCondFormatItem* pCondFormatItem = static_cast<const ScCondFormatItem*>(pItem); CPPUNIT_ASSERT(pCondFormatItem); CPPUNIT_ASSERT_EQUAL(size_t(1), pCondFormatItem->GetCondFormatData().size()); - CPPUNIT_ASSERT_EQUAL(sal_uInt32(nIndex), pCondFormatItem->GetCondFormatData().front()); + CPPUNIT_ASSERT_EQUAL(nIndex, pCondFormatItem->GetCondFormatData().front()); m_pDoc->DeleteTab(0); } @@ -490,7 +490,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondCopyPasteSingleCell) ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,"=B2","",*m_pDoc,ScAddress(0,0,0),ScResId(STR_STYLENAME_RESULT)); pFormat->AddEntry(pEntry); - sal_uLong nIndex = m_pDoc->AddCondFormat(std::move(pFormat), 0); + sal_uInt32 nIndex = m_pDoc->AddCondFormat(std::move(pFormat), 0); ScDocument aClipDoc(SCDOCMODE_CLIP); copyToClip(m_pDoc, ScRange(0,0,0,0,0,0), &aClipDoc); @@ -507,13 +507,13 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondCopyPasteSingleCell) CPPUNIT_ASSERT_EQUAL(size_t(1), m_pDoc->GetCondFormList(0)->size()); aRangeList.Join(aTargetRange); CPPUNIT_ASSERT_EQUAL(aRangeList, pPastedFormat->GetRange()); - CPPUNIT_ASSERT_EQUAL(sal_uInt32(nIndex), pPastedFormat->GetKey()); + CPPUNIT_ASSERT_EQUAL(nIndex, pPastedFormat->GetKey()); const SfxPoolItem* pItem = m_pDoc->GetAttr( 4, 4, 0, ATTR_CONDITIONAL ); const ScCondFormatItem* pCondFormatItem = static_cast<const ScCondFormatItem*>(pItem); CPPUNIT_ASSERT(pCondFormatItem); CPPUNIT_ASSERT_EQUAL(size_t(1), pCondFormatItem->GetCondFormatData().size()); - CPPUNIT_ASSERT_EQUAL(sal_uInt32(nIndex), pCondFormatItem->GetCondFormatData().front() ); + CPPUNIT_ASSERT_EQUAL(nIndex, pCondFormatItem->GetCondFormatData().front() ); m_pDoc->DeleteTab(0); } @@ -530,7 +530,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondCopyPasteSingleCellToRange) ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,"=B2","",*m_pDoc,ScAddress(0,0,0),ScResId(STR_STYLENAME_RESULT)); pFormat->AddEntry(pEntry); - sal_uLong nIndex = m_pDoc->AddCondFormat(std::move(pFormat), 0); + sal_uInt32 nIndex = m_pDoc->AddCondFormat(std::move(pFormat), 0); ScDocument aClipDoc(SCDOCMODE_CLIP); copyToClip(m_pDoc, ScRange(0,0,0,0,0,0), &aClipDoc); @@ -550,14 +550,14 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondCopyPasteSingleCellToRange) CPPUNIT_ASSERT(pPastedFormat); CPPUNIT_ASSERT_EQUAL(aRangeList, pPastedFormat->GetRange()); - sal_uLong nPastedKey = pPastedFormat->GetKey(); + sal_uInt32 nPastedKey = pPastedFormat->GetKey(); CPPUNIT_ASSERT_EQUAL(nIndex, nPastedKey); const SfxPoolItem* pItem = m_pDoc->GetAttr( nCol, nRow, 0, ATTR_CONDITIONAL ); const ScCondFormatItem* pCondFormatItem = static_cast<const ScCondFormatItem*>(pItem); CPPUNIT_ASSERT(pCondFormatItem); CPPUNIT_ASSERT_EQUAL(size_t(1), pCondFormatItem->GetCondFormatData().size()); - CPPUNIT_ASSERT_EQUAL(sal_uInt32(nIndex), pCondFormatItem->GetCondFormatData().front() ); + CPPUNIT_ASSERT_EQUAL(nIndex, pCondFormatItem->GetCondFormatData().front() ); } } @@ -576,7 +576,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondCopyPasteSingleCellIntoSameFormatRa ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct, "=B2", "", *m_pDoc, ScAddress(0, 0, 0), ScResId(STR_STYLENAME_RESULT)); pFormat->AddEntry(pEntry); - sal_uLong nIndex = m_pDoc->AddCondFormat(std::move(pFormat), 0); + sal_uInt32 nIndex = m_pDoc->AddCondFormat(std::move(pFormat), 0); ScDocument aClipDoc(SCDOCMODE_CLIP); copyToClip(m_pDoc, ScRange(1, 1, 0, 1, 1, 0), &aClipDoc); @@ -591,13 +591,13 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondCopyPasteSingleCellIntoSameFormatRa // since it already covers the pasted range. No new conditional formats must be created. CPPUNIT_ASSERT_EQUAL(size_t(1), m_pDoc->GetCondFormList(0)->size()); CPPUNIT_ASSERT_EQUAL(aRangeList, pPastedFormat->GetRange()); - CPPUNIT_ASSERT_EQUAL(sal_uInt32(nIndex), pPastedFormat->GetKey()); + CPPUNIT_ASSERT_EQUAL(nIndex, pPastedFormat->GetKey()); const SfxPoolItem* pItem = m_pDoc->GetAttr(2, 2, 0, ATTR_CONDITIONAL); const ScCondFormatItem* pCondFormatItem = static_cast<const ScCondFormatItem*>(pItem); CPPUNIT_ASSERT(pCondFormatItem); CPPUNIT_ASSERT_EQUAL(size_t(1), pCondFormatItem->GetCondFormatData().size()); - CPPUNIT_ASSERT_EQUAL(sal_uInt32(nIndex), pCondFormatItem->GetCondFormatData().front()); + CPPUNIT_ASSERT_EQUAL(nIndex, pCondFormatItem->GetCondFormatData().front()); m_pDoc->DeleteTab(0); } diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx index 08dfb6aefc49..107c7fe80c5d 100644 --- a/sc/source/core/data/documen4.cxx +++ b/sc/source/core/data/documen4.cxx @@ -706,7 +706,7 @@ double ScDocument::RoundValueAsShown( double fVal, sal_uInt32 nFormat, const ScI // conditional formats and validation ranges -sal_uLong ScDocument::AddCondFormat( std::unique_ptr<ScConditionalFormat> pNew, SCTAB nTab ) +sal_uInt32 ScDocument::AddCondFormat( std::unique_ptr<ScConditionalFormat> pNew, SCTAB nTab ) { if(!pNew) return 0; @@ -717,7 +717,7 @@ sal_uLong ScDocument::AddCondFormat( std::unique_ptr<ScConditionalFormat> pNew, return 0; } -sal_uLong ScDocument::AddValidationEntry( const ScValidationData& rNew ) +sal_uInt32 ScDocument::AddValidationEntry( const ScValidationData& rNew ) { if (rNew.IsEmpty()) return 0; // empty is always 0 @@ -728,11 +728,11 @@ sal_uLong ScDocument::AddValidationEntry( const ScValidationData& rNew ) pValidationList.reset(new ScValidationDataList); } - sal_uLong nMax = 0; + sal_uInt32 nMax = 0; for( const auto& rxData : *pValidationList ) { const ScValidationData* pData = rxData.get(); - sal_uLong nKey = pData->GetKey(); + sal_uInt32 nKey = pData->GetKey(); if ( pData->EqualEntries( rNew ) ) return nKey; if ( nKey > nMax ) @@ -740,7 +740,7 @@ sal_uLong ScDocument::AddValidationEntry( const ScValidationData& rNew ) } // might be called from ScPatternAttr::MigrateToDocument; thus clone (real copy) - sal_uLong nNewKey = nMax + 1; + sal_uInt32 nNewKey = nMax + 1; std::unique_ptr<ScValidationData> pInsert(rNew.Clone(this)); pInsert->SetKey( nNewKey ); ScMutationGuard aGuard(*this, ScMutationGuardFlags::CORE); diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index 93d023f96246..0a2fc33df217 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -2465,7 +2465,7 @@ void ScTable::SetAnonymousDBData(std::unique_ptr<ScDBData> pDBData) pDBDataNoName = std::move(pDBData); } -sal_uLong ScTable::AddCondFormat( std::unique_ptr<ScConditionalFormat> pNew ) +sal_uInt32 ScTable::AddCondFormat( std::unique_ptr<ScConditionalFormat> pNew ) { if(!mpCondFormatList) mpCondFormatList.reset(new ScConditionalFormatList()); diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx index 319cd8136aae..1dc973f50d8a 100644 --- a/sc/source/filter/excel/xicontent.cxx +++ b/sc/source/filter/excel/xicontent.cxx @@ -706,7 +706,7 @@ void XclImpCondFormat::Apply() ScDocument& rDoc = GetDoc(); SCTAB nTab = maRanges.front().aStart.Tab(); - sal_uLong nKey = rDoc.AddCondFormat( mxScCondFmt->Clone(), nTab ); + sal_uInt32 nKey = rDoc.AddCondFormat( mxScCondFmt->Clone(), nTab ); rDoc.AddCondFormatData( maRanges, nTab, nKey ); } diff --git a/sc/source/filter/oox/condformatbuffer.cxx b/sc/source/filter/oox/condformatbuffer.cxx index 649c2417f348..919712e2f107 100644 --- a/sc/source/filter/oox/condformatbuffer.cxx +++ b/sc/source/filter/oox/condformatbuffer.cxx @@ -1341,7 +1341,7 @@ void CondFormatBuffer::finalizeImport() auto pNewFormat = std::make_unique<ScConditionalFormat>(0, pDoc); pFormat = pNewFormat.get(); pNewFormat->SetRange(rRange); - sal_uLong nKey = pDoc->AddCondFormat(std::move(pNewFormat), nTab); + sal_uInt32 nKey = pDoc->AddCondFormat(std::move(pNewFormat), nTab); pDoc->AddCondFormatData(rRange, nTab, nKey); } diff --git a/sc/source/filter/xml/xmlcondformat.cxx b/sc/source/filter/xml/xmlcondformat.cxx index 23127414a164..8699f60d4556 100644 --- a/sc/source/filter/xml/xmlcondformat.cxx +++ b/sc/source/filter/xml/xmlcondformat.cxx @@ -339,7 +339,7 @@ void SAL_CALL ScXMLConditionalFormatContext::endFastElement( sal_Int32 /*nElemen } } - sal_uLong nIndex = pDoc->AddCondFormat(std::move(pFormat), nTab); + sal_uInt32 nIndex = pDoc->AddCondFormat(std::move(pFormat), nTab); ScConditionalFormat* pInsertedFormat = pDoc->GetCondFormList(nTab)->GetFormat(nIndex); assert(pInsertedFormat && pInsertedFormat->GetKey() == nIndex); diff --git a/sc/source/filter/xml/xmlstyli.cxx b/sc/source/filter/xml/xmlstyli.cxx index 7b5d8611a954..a8daf209749d 100644 --- a/sc/source/filter/xml/xmlstyli.cxx +++ b/sc/source/filter/xml/xmlstyli.cxx @@ -509,7 +509,7 @@ void XMLTableStyleContext::ApplyCondFormat( const uno::Sequence<table::CellRange if(mpCondFormat && mbDeleteCondFormat) { - sal_uLong nIndex = pDoc->AddCondFormat(std::unique_ptr<ScConditionalFormat>(mpCondFormat), nTab ); + sal_uInt32 nIndex = pDoc->AddCondFormat(std::unique_ptr<ScConditionalFormat>(mpCondFormat), nTab ); mpCondFormat->SetKey(nIndex); mpCondFormat->SetRange(aRangeList); diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 73c3f6dd6738..2ea647aa25a3 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -5653,7 +5653,7 @@ void ScDocFunc::ReplaceConditionalFormat( sal_uLong nOldFormat, std::unique_ptr< else pRepaintRange.reset(new ScRange(aCombinedRange)); - sal_uLong nIndex = rDoc.AddCondFormat(std::move(pFormat), nTab); + sal_uInt32 nIndex = rDoc.AddCondFormat(std::move(pFormat), nTab); rDoc.AddCondFormatData(rRanges, nTab, nIndex); rDoc.SetStreamValid(nTab, false); diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx index 4467182cee24..eeb35327b333 100644 --- a/sc/source/ui/docshell/docsh6.cxx +++ b/sc/source/ui/docshell/docsh6.cxx @@ -352,7 +352,7 @@ void ScDocShell::UpdateLinks() OUString aDocName = m_pDocument->GetLinkDoc(i); OUString aFltName = m_pDocument->GetLinkFlt(i); OUString aOptions = m_pDocument->GetLinkOpt(i); - sal_uLong nRefresh = m_pDocument->GetLinkRefreshDelay(i); + sal_uInt32 nRefresh = m_pDocument->GetLinkRefreshDelay(i); bool bThere = false; for (SCTAB j = 0; j < i && !bThere; ++j) // several times in the document? {