connectivity/qa/connectivity/mysql/mysql.cxx | 2 - cui/source/customize/SvxNotebookbarConfigPage.cxx | 2 - cui/source/dialogs/toolbarmodedlg.cxx | 4 +- editeng/inc/editdoc.hxx | 2 - editeng/source/editeng/editdoc.cxx | 4 +- framework/inc/uielement/fontsizemenucontroller.hxx | 2 - hwpfilter/source/hpara.h | 3 + lotuswordpro/source/filter/tocread.cxx | 6 +-- opencl/source/opencl_device.cxx | 10 +++--- sc/source/core/data/dpgroup.cxx | 2 - sc/source/core/data/dpsave.cxx | 4 +- sc/source/core/data/dptabres.cxx | 2 - sc/source/core/data/table2.cxx | 2 - sc/source/core/data/table5.cxx | 4 +- sc/source/ui/inc/pvfundlg.hxx | 2 - sc/source/ui/inc/viewdata.hxx | 2 - sd/source/ui/slideshow/slideshowimpl.cxx | 4 +- sd/source/ui/slideshow/slideshowimpl.hxx | 2 - sfx2/source/dialog/splitwin.cxx | 8 ++-- sfx2/source/doc/objcont.cxx | 4 +- svx/source/dialog/paraprev.cxx | 2 - sw/inc/PostItMgr.hxx | 22 ++++++------- sw/inc/SwNumberTreeTypes.hxx | 3 + sw/inc/postithelper.hxx | 4 +- sw/inc/swtypes.hxx | 2 - sw/qa/extras/uiwriter/uiwriter.cxx | 2 - sw/source/core/doc/tblrwcl.cxx | 6 +-- sw/source/core/fields/postithelper.cxx | 4 +- sw/source/core/layout/tabfrm.cxx | 4 +- sw/source/core/table/swnewtable.cxx | 2 - sw/source/core/text/txtdrop.cxx | 2 - sw/source/core/txtnode/fntcache.cxx | 4 +- sw/source/filter/ww8/WW8TableInfo.cxx | 6 +-- sw/source/filter/ww8/WW8TableInfo.hxx | 10 +++--- sw/source/filter/ww8/wrtww8.cxx | 16 ++++----- sw/source/filter/ww8/ww8scan.cxx | 2 - sw/source/ui/frmdlg/frmpage.cxx | 4 +- sw/source/uibase/docvw/AnnotationWin2.cxx | 2 - sw/source/uibase/docvw/PageBreakWin.cxx | 2 - sw/source/uibase/docvw/PostItMgr.cxx | 34 ++++++++++----------- sw/source/uibase/misc/swruler.cxx | 2 - vcl/inc/salgeom.hxx | 4 +- vcl/source/bitmap/BitmapEmbossGreyFilter.cxx | 4 +- vcl/source/bitmap/BitmapFastScaleFilter.cxx | 4 +- vcl/source/bitmap/BitmapInterpolateScaleFilter.cxx | 8 ++-- vcl/source/bitmap/BitmapMedianFilter.cxx | 4 +- vcl/source/bitmap/bitmappaint.cxx | 12 +++---- vcl/source/control/imivctl1.cxx | 4 +- vcl/source/filter/jpeg/JpegReader.hxx | 10 +++--- vcl/source/gdi/dibtools.cxx | 2 - vcl/source/gdi/gdimtf.cxx | 4 +- vcl/source/gdi/impvect.cxx | 6 +-- vcl/source/gdi/metaact.cxx | 4 +- vcl/source/gdi/print.cxx | 4 +- vcl/source/gdi/salmisc.cxx | 6 +-- vcl/source/outdev/map.cxx | 4 +- vcl/source/outdev/transparent.cxx | 4 +- vcl/source/window/NotebookBarAddonsMerger.cxx | 7 +--- vcl/unx/generic/dtrans/bmp.hxx | 4 +- vcl/win/gdi/gdiimpl.cxx | 26 ++++++++-------- vcl/win/gdi/salbmp.cxx | 2 - vcl/win/gdi/salfont.cxx | 10 +++--- vcl/win/gdi/salgdi.cxx | 10 +++--- vcl/win/gdi/salgdi2.cxx | 12 +++---- vcl/win/window/salframe.cxx | 24 +++++++------- xmloff/source/core/xmlexp.cxx | 2 - 66 files changed, 194 insertions(+), 193 deletions(-)
New commits: commit 941f2c866a98ca7caf71a11732853da012cd25e4 Author: Noel <noelgran...@gmail.com> AuthorDate: Tue Nov 10 10:14:12 2020 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Nov 11 11:25:43 2020 +0100 convert more long -> tools::Long found by grepping and changed by hand. Change-Id: I3c720859dba430fde3abc76c6c5cb58269efaf4b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105512 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/connectivity/qa/connectivity/mysql/mysql.cxx b/connectivity/qa/connectivity/mysql/mysql.cxx index 7291c9f444d3..7a4267b5e95b 100644 --- a/connectivity/qa/connectivity/mysql/mysql.cxx +++ b/connectivity/qa/connectivity/mysql/mysql.cxx @@ -200,7 +200,7 @@ void MysqlTestDriver::testIntegerInsertAndQuery() Reference<XColumnLocate> xColumnLocate(xResultSet, UNO_QUERY); CPPUNIT_ASSERT_MESSAGE("cannot extract row from result set!", xRow.is()); - for (long i = 0; i < ROW_COUNT; ++i) + for (tools::Long i = 0; i < ROW_COUNT; ++i) { bool hasRow = xResultSet->next(); CPPUNIT_ASSERT_MESSAGE("not enough result after query", hasRow); diff --git a/cui/source/customize/SvxNotebookbarConfigPage.cxx b/cui/source/customize/SvxNotebookbarConfigPage.cxx index 35cb7ce0713e..c8b594b9039e 100644 --- a/cui/source/customize/SvxNotebookbarConfigPage.cxx +++ b/cui/source/customize/SvxNotebookbarConfigPage.cxx @@ -412,7 +412,7 @@ void SvxNotebookbarConfigPage::SelectElement() m_xTopLevelListBox->append(aCategoryList[nIdx].sUIItemId, aCategoryList[nIdx].sDisplayName); } - unsigned long nStart = 0; + tools::ULong nStart = 0; if (aEntries[nStart].sClassId == "sfxlo-PriorityHBox" || aEntries[nStart].sClassId == "sfxlo-PriorityMergedHBox") nStart = 1; diff --git a/cui/source/dialogs/toolbarmodedlg.cxx b/cui/source/dialogs/toolbarmodedlg.cxx index e645f6bb26d0..e15f54e830cb 100644 --- a/cui/source/dialogs/toolbarmodedlg.cxx +++ b/cui/source/dialogs/toolbarmodedlg.cxx @@ -101,7 +101,7 @@ ToolbarmodeDialog::ToolbarmodeDialog(weld::Window* pParent) Link<weld::ToggleButton&, void> aLink = LINK(this, ToolbarmodeDialog, SelectToolbarmode); const OUString sCurrentMode = GetCurrentMode(); - for (unsigned long i = 0; i < SAL_N_ELEMENTS(m_pRadioButtons); i++) + for (tools::ULong i = 0; i < SAL_N_ELEMENTS(m_pRadioButtons); i++) { m_pRadioButtons[i]->connect_toggled(aLink); if (sCurrentMode == std::get<1>(TOOLBARMODES_ARRAY[i])) @@ -133,7 +133,7 @@ static bool file_exists(const OUString& fileName) int ToolbarmodeDialog::GetActiveRadioButton() { - for (unsigned long i = 0; i < SAL_N_ELEMENTS(m_pRadioButtons); i++) + for (tools::ULong i = 0; i < SAL_N_ELEMENTS(m_pRadioButtons); i++) { if (m_pRadioButtons[i]->get_active()) return i; diff --git a/editeng/inc/editdoc.hxx b/editeng/inc/editdoc.hxx index 440221bc047b..ff2681e3ca5e 100644 --- a/editeng/inc/editdoc.hxx +++ b/editeng/inc/editdoc.hxx @@ -361,7 +361,7 @@ struct ExtraPortionInfo bool bFirstCharIsRightPunktuation; bool bCompressed; - std::unique_ptr<long[]> pOrgDXArray; + std::unique_ptr<tools::Long[]> pOrgDXArray; std::vector< sal_Int32 > lineBreaksList; diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx index b26142224a1f..bfbba8257424 100644 --- a/editeng/source/editeng/editdoc.cxx +++ b/editeng/source/editeng/editdoc.cxx @@ -497,8 +497,8 @@ void ExtraPortionInfo::SaveOrgDXArray( const tools::Long* pDXArray, sal_Int32 nL { if (pDXArray) { - pOrgDXArray.reset(new long[nLen]); - memcpy( pOrgDXArray.get(), pDXArray, nLen * sizeof(long) ); + pOrgDXArray.reset(new tools::Long[nLen]); + memcpy( pOrgDXArray.get(), pDXArray, nLen * sizeof(tools::Long) ); } else pOrgDXArray.reset(); diff --git a/framework/inc/uielement/fontsizemenucontroller.hxx b/framework/inc/uielement/fontsizemenucontroller.hxx index a0114155984a..5c57623559d1 100644 --- a/framework/inc/uielement/fontsizemenucontroller.hxx +++ b/framework/inc/uielement/fontsizemenucontroller.hxx @@ -61,7 +61,7 @@ namespace framework void fillPopupMenu( css::uno::Reference< css::awt::XPopupMenu > const & rPopupMenu ); OUString retrievePrinterName( css::uno::Reference< css::frame::XFrame > const & rFrame ); - std::unique_ptr<long[]> m_pHeightArray; + std::unique_ptr<tools::Long[]> m_pHeightArray; css::awt::FontDescriptor m_aFontDescriptor; css::frame::status::FontHeight m_aFontHeight; css::uno::Reference< css::frame::XDispatch > m_xCurrentFontDispatch; diff --git a/hwpfilter/source/hpara.h b/hwpfilter/source/hpara.h index d181aa21f94b..d3b0b788970e 100644 --- a/hwpfilter/source/hpara.h +++ b/hwpfilter/source/hpara.h @@ -23,6 +23,7 @@ #include "hwplib.h" #include "hwpfile.h" #include "hinfo.h" +#include <tools/long.hxx> #include <map> #include <memory> #include <vector> @@ -103,7 +104,7 @@ class DLLEXPORT HWPPara /** * Checks the special characters in the paragraph */ - unsigned long ctrlflag; + tools::ULong ctrlflag; unsigned char pstyno; std::shared_ptr<CharShape> cshape; /* When characters are all the same shape */ std::shared_ptr<ParaShape> pshape; /* if reuse flag is 0, */ diff --git a/lotuswordpro/source/filter/tocread.cxx b/lotuswordpro/source/filter/tocread.cxx index 18a062d1bb1e..dff08e68e3cf 100644 --- a/lotuswordpro/source/filter/tocread.cxx +++ b/lotuswordpro/source/filter/tocread.cxx @@ -72,7 +72,7 @@ CBenTOCReader::ReadLabelAndTOC() { BenError Err; - unsigned long TOCOffset; + tools::ULong TOCOffset; if ((Err = ReadLabel(&TOCOffset, &cTOCSize)) != BenErr_OK) return Err; @@ -97,7 +97,7 @@ CBenTOCReader::ReadLabelAndTOC() } BenError -CBenTOCReader::ReadLabel(unsigned long * pTOCOffset, unsigned long * pTOCSize) +CBenTOCReader::ReadLabel(tools::ULong * pTOCOffset, tools::ULong * pTOCSize) { // If seek fails, then probably because stream is smaller than // BEN_LABEL_SIZE and thus can't be Bento container @@ -503,7 +503,7 @@ CBenTOCReader::GetCode() } BenError -CBenTOCReader::GetData(void * pBuffer, unsigned long Amt) +CBenTOCReader::GetData(void * pBuffer, tools::ULong Amt) { if (! CanGetData(Amt)) return BenErr_ReadPastEndOfTOC; diff --git a/opencl/source/opencl_device.cxx b/opencl/source/opencl_device.cxx index f0f4a07fe6b1..682b92d0eb47 100644 --- a/opencl/source/opencl_device.cxx +++ b/opencl/source/opencl_device.cxx @@ -50,8 +50,8 @@ struct LibreOfficeDeviceEvaluationIO std::vector<double> input2; std::vector<double> input3; std::vector<double> output; - unsigned long inputSize; - unsigned long outputSize; + tools::ULong inputSize; + tools::ULong outputSize; }; const char* source = STRINGIFY( @@ -126,7 +126,7 @@ void populateInput(std::unique_ptr<LibreOfficeDeviceEvaluationIO> const & testDa double* input1 = testData->input1.data(); double* input2 = testData->input2.data(); double* input3 = testData->input3.data(); - for (unsigned long i = 0; i < testData->inputSize; i++) + for (tools::ULong i = 0; i < testData->inputSize; i++) { input0[i] = random(0, i); input1[i] = random(0, i); @@ -276,13 +276,13 @@ ds_status evaluateScoreForDevice(ds_device& rDevice, std::unique_ptr<LibreOffice SAL_INFO("opencl.device", "Device: \"CPU\" (Native) evaluation..."); sal_uInt64 kernelTime = tools::Time::GetMonotonicTicks(); - unsigned long j; + tools::ULong j; for (j = 0; j < testData->outputSize; j++) { double fAverage = 0.0f; double fMin = DBL_MAX; double fSoP = 0.0f; - for (unsigned long i = 0; i < testData->inputSize; i++) + for (tools::ULong i = 0; i < testData->inputSize; i++) { fAverage += testData->input0[i]; fMin = std::min(fMin, testData->input1[i]); diff --git a/sc/source/core/data/dpgroup.cxx b/sc/source/core/data/dpgroup.cxx index 4ac9114337d8..e2ef44e785bd 100644 --- a/sc/source/core/data/dpgroup.cxx +++ b/sc/source/core/data/dpgroup.cxx @@ -639,7 +639,7 @@ public: void ScDPGroupTableData::ModifyFilterCriteria(vector<ScDPFilteredCache::Criterion>& rCriteria) { // Build dimension ID to object map for group dimensions. - typedef std::unordered_map<long, const ScDPGroupDimension*> GroupFieldMapType; + typedef std::unordered_map<tools::Long, const ScDPGroupDimension*> GroupFieldMapType; GroupFieldMapType aGroupFieldIds; for (const auto& rGroup : aGroups) diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx index 7dc080a37eb4..95bd2a84985f 100644 --- a/sc/source/core/data/dpsave.cxx +++ b/sc/source/core/data/dpsave.cxx @@ -1213,7 +1213,7 @@ void ScDPSaveData::BuildAllDimensionMembers(ScDPTableData* pData) return; // First, build a dimension name-to-index map. - typedef std::unordered_map<OUString, long> NameIndexMap; + typedef std::unordered_map<OUString, tools::Long> NameIndexMap; NameIndexMap aMap; tools::Long nColCount = pData->GetColumnCount(); for (tools::Long i = 0; i < nColCount; ++i) @@ -1255,7 +1255,7 @@ void ScDPSaveData::BuildAllDimensionMembers(ScDPTableData* pData) void ScDPSaveData::SyncAllDimensionMembers(ScDPTableData* pData) { - typedef std::unordered_map<OUString, long> NameIndexMap; + typedef std::unordered_map<OUString, tools::Long> NameIndexMap; // First, build a dimension name-to-index map. NameIndexMap aMap; diff --git a/sc/source/core/data/dptabres.cxx b/sc/source/core/data/dptabres.cxx index 263db7ea5a2b..c0022282a9d6 100644 --- a/sc/source/core/data/dptabres.cxx +++ b/sc/source/core/data/dptabres.cxx @@ -3906,7 +3906,7 @@ void ScDPResultVisibilityData::addVisibleMember(const OUString& rDimName, const void ScDPResultVisibilityData::fillFieldFilters(vector<ScDPFilteredCache::Criterion>& rFilters) const { - typedef std::unordered_map<OUString, long> FieldNameMapType; + typedef std::unordered_map<OUString, tools::Long> FieldNameMapType; FieldNameMapType aFieldNames; ScDPTableData* pData = mpSource->GetData(); sal_Int32 nColumnCount = pData->GetColumnCount(); diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index 826c7125a89e..d8fb7fac5b0f 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -3955,7 +3955,7 @@ sal_uLong ScTable::GetRowOffset( SCROW nRow, bool bHiddenAsZero ) const n = GetTotalRowHeight(0, nRow-1, bHiddenAsZero); #if OSL_DEBUG_LEVEL > 0 - if (n == ::std::numeric_limits<unsigned long>::max()) + if (n == ::std::numeric_limits<tools::ULong>::max()) OSL_FAIL("ScTable::GetRowOffset: row heights overflow"); #endif } diff --git a/sc/source/core/data/table5.cxx b/sc/source/core/data/table5.cxx index f2c248ee7fbf..34c49a281f33 100644 --- a/sc/source/core/data/table5.cxx +++ b/sc/source/core/data/table5.cxx @@ -236,9 +236,9 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea ) if ( bStartOfPage && bRepeatRow && nY>nRepeatStartY && !bRowFound ) { // subtract size of repeat rows from page size - unsigned long nHeights = GetTotalRowHeight(nRepeatStartY, nRepeatEndY); + tools::ULong nHeights = GetTotalRowHeight(nRepeatStartY, nRepeatEndY); #if OSL_DEBUG_LEVEL > 0 - if (nHeights == ::std::numeric_limits<unsigned long>::max()) + if (nHeights == ::std::numeric_limits<tools::ULong>::max()) OSL_FAIL("ScTable::UpdatePageBreaks: row heights overflow"); #endif nPageSizeY -= nHeights; diff --git a/sc/source/ui/inc/pvfundlg.hxx b/sc/source/ui/inc/pvfundlg.hxx index 47891ece7a8d..4c74ceb4e04e 100644 --- a/sc/source/ui/inc/pvfundlg.hxx +++ b/sc/source/ui/inc/pvfundlg.hxx @@ -194,7 +194,7 @@ private: DECL_LINK(DblClickHdl, weld::TreeView&, bool); private: - typedef std::unordered_map<OUString, long> DimNameIndexMap; + typedef std::unordered_map<OUString, tools::Long> DimNameIndexMap; DimNameIndexMap maNameIndexMap; ScDPObject& mrDPObj; diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx index 1895799f7531..4026c175e13e 100644 --- a/sc/source/ui/inc/viewdata.hxx +++ b/sc/source/ui/inc/viewdata.hxx @@ -121,7 +121,7 @@ class ScPositionHelper { public: typedef SCCOLROW index_type; - typedef std::pair<index_type, long> value_type; + typedef std::pair<index_type, tools::Long> value_type; static_assert(std::numeric_limits<index_type>::is_signed, "ScPositionCache: index type is not signed"); private: diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index 3f782edaaa2e..8d518c65011d 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -2335,7 +2335,7 @@ void SlideshowImpl::hideChildWindows() if( pViewFrame->GetChildWindow( nId ) ) { pViewFrame->SetChildWindow( nId, false ); - mnChildMask |= 1 << i; + mnChildMask |= ::tools::ULong(1) << i; } } } @@ -2349,7 +2349,7 @@ void SlideshowImpl::showChildWindows() { for( sal_uLong i = 0; i < SAL_N_ELEMENTS(aShowChildren); i++ ) { - if( mnChildMask & ( 1 << i ) ) + if( mnChildMask & ( ::tools::ULong(1) << i ) ) pViewFrame->SetChildWindow( ( *aShowChildren[ i ] )(), true ); } } diff --git a/sd/source/ui/slideshow/slideshowimpl.hxx b/sd/source/ui/slideshow/slideshowimpl.hxx index bb1a59d271c9..d870d7ec49d3 100644 --- a/sd/source/ui/slideshow/slideshowimpl.hxx +++ b/sd/source/ui/slideshow/slideshowimpl.hxx @@ -307,7 +307,7 @@ private: OUString maCharBuffer; VclPtr< ::sd::Window> mpOldActiveWindow; Link<StarBASIC*,bool> maStarBASICGlobalErrorHdl; - unsigned long mnChildMask; + ::tools::ULong mnChildMask; bool mbDisposed; bool mbAutoSaveWasOn; bool mbRehearseTimings; diff --git a/sfx2/source/dialog/splitwin.cxx b/sfx2/source/dialog/splitwin.cxx index dff0a88d0d60..2e910f8d2fb0 100644 --- a/sfx2/source/dialog/splitwin.cxx +++ b/sfx2/source/dialog/splitwin.cxx @@ -375,7 +375,7 @@ void SfxSplitWindow::Split() SplitWindow::Split(); - std::vector< std::pair< sal_uInt16, long > > aNewOrgSizes; + std::vector< std::pair< sal_uInt16, tools::Long > > aNewOrgSizes; sal_uInt16 nCount = maDockArr.size(); for ( sal_uInt16 n=0; n<nCount; n++ ) @@ -409,7 +409,7 @@ void SfxSplitWindow::Split() // apply FIXED item size as 'original' item size to improve layouting of undock-dock-cycle of a window { DeactivateUpdateMode aDeactivateUpdateMode( *this ); - for (const std::pair< sal_uInt16, long > & rNewOrgSize : aNewOrgSizes) + for (const std::pair< sal_uInt16, tools::Long > & rNewOrgSize : aNewOrgSizes) { SetItemSize( rNewOrgSize.first, rNewOrgSize.second ); } @@ -733,7 +733,7 @@ void SfxSplitWindow::InsertWindow_Impl( SfxDock_Impl const * pDock, // workaround insufficiency of <SplitWindow> regarding dock layouting: // apply FIXED item size as 'original' item size to improve layouting of undock-dock-cycle of a window { - std::vector< std::pair< sal_uInt16, long > > aNewOrgSizes; + std::vector< std::pair< sal_uInt16, tools::Long > > aNewOrgSizes; // get FIXED item sizes sal_uInt16 nCount = maDockArr.size(); for ( sal_uInt16 n=0; n<nCount; ++n ) @@ -748,7 +748,7 @@ void SfxSplitWindow::InsertWindow_Impl( SfxDock_Impl const * pDock, } // apply new item sizes DeactivateUpdateMode aDeactivateUpdateMode( *this ); - for (const std::pair< sal_uInt16, long > & rNewOrgSize : aNewOrgSizes) + for (const std::pair< sal_uInt16, tools::Long > & rNewOrgSize : aNewOrgSizes) { SetItemSize( rNewOrgSize.first, rNewOrgSize.second ); } diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx index fc1ce7cceedd..8d3faa98a8a0 100644 --- a/sfx2/source/doc/objcont.cxx +++ b/sfx2/source/doc/objcont.cxx @@ -163,9 +163,9 @@ bool SfxObjectShell::CreatePreview_Impl( bool bFullContent, VirtualDevice* pDevi // determine size that has the same aspect ratio as image size and // fits into the rectangle determined by nMaximumExtent if ( aSizePix.Width() && aSizePix.Height() - && ( sal::static_int_cast< unsigned long >(aSizePix.Width()) > + && ( sal::static_int_cast< tools::ULong >(aSizePix.Width()) > nMaximumExtent || - sal::static_int_cast< unsigned long >(aSizePix.Height()) > + sal::static_int_cast< tools::ULong >(aSizePix.Height()) > nMaximumExtent ) ) { double fWH = static_cast< double >( aSizePix.Width() ) / aSizePix.Height(); diff --git a/svx/source/dialog/paraprev.cxx b/svx/source/dialog/paraprev.cxx index bdb4f7f9da9b..d582cf7e5a89 100644 --- a/svx/source/dialog/paraprev.cxx +++ b/svx/source/dialog/paraprev.cxx @@ -136,7 +136,7 @@ void SvxParaPrevWindow::DrawParagraph(vcl::RenderContext& rRenderContext) if (3 <= i && 5 >= i) { - tools::Long nLW = long(); + tools::Long nLW = tools::Long(); switch (i) { case 3: diff --git a/sw/inc/PostItMgr.hxx b/sw/inc/PostItMgr.hxx index bbcb862b0190..391f97a340c6 100644 --- a/sw/inc/PostItMgr.hxx +++ b/sw/inc/PostItMgr.hxx @@ -147,15 +147,15 @@ class SAL_DLLPUBLIC_RTTI SwPostItMgr final : public SfxListener void AddPostIts(bool bCheckExistence = true,bool bFocus = true); void RemoveSidebarWin(); void PreparePageContainer(); - void Scroll(const tools::Long lScroll,const unsigned long aPage ); - void AutoScroll(const sw::annotation::SwAnnotationWin* pPostIt,const unsigned long aPage ); - bool ScrollbarHit(const unsigned long aPage,const Point &aPoint); + void Scroll(const tools::Long lScroll,const tools::ULong aPage ); + void AutoScroll(const sw::annotation::SwAnnotationWin* pPostIt,const tools::ULong aPage ); + bool ScrollbarHit(const tools::ULong aPage,const Point &aPoint); bool LayoutByPage( std::vector<sw::annotation::SwAnnotationWin*> &aVisiblePostItList, const tools::Rectangle& rBorder, tools::Long lNeededHeight); void CheckForRemovedPostIts(); - bool ArrowEnabled(sal_uInt16 aDirection,unsigned long aPage) const; - bool BorderOverPageBorder(unsigned long aPage) const; + bool ArrowEnabled(sal_uInt16 aDirection,tools::ULong aPage) const; + bool BorderOverPageBorder(tools::ULong aPage) const; bool HasScrollbars() const; void Focus(SfxBroadcaster& rBC); @@ -185,12 +185,12 @@ class SAL_DLLPUBLIC_RTTI SwPostItMgr final : public SfxListener void MakeVisible( const sw::annotation::SwAnnotationWin* pPostIt); - bool ShowScrollbar(const unsigned long aPage) const; + bool ShowScrollbar(const tools::ULong aPage) const; bool HasNotes() const ; bool ShowNotes() const; bool IsShowAnchor() const { return mbIsShowAnchor;} - unsigned long GetSidebarWidth(bool bPx = false) const; - unsigned long GetSidebarBorderWidth(bool bPx = false) const; + tools::ULong GetSidebarWidth(bool bPx = false) const; + tools::ULong GetSidebarBorderWidth(bool bPx = false) const; void PrepareView(bool bIgnoreCount = false); @@ -215,13 +215,13 @@ class SAL_DLLPUBLIC_RTTI SwPostItMgr final : public SfxListener void Rescale(); - tools::Rectangle GetBottomScrollRect(const unsigned long aPage) const; - tools::Rectangle GetTopScrollRect(const unsigned long aPage) const; + tools::Rectangle GetBottomScrollRect(const tools::ULong aPage) const; + tools::Rectangle GetTopScrollRect(const tools::ULong aPage) const; bool IsHit(const Point &aPointPixel); /// Get the matching window that is responsible for handling mouse events of rPointLogic, if any. vcl::Window* IsHitSidebarWindow(const Point& rPointLogic); - Color GetArrowColor(sal_uInt16 aDirection,unsigned long aPage) const; + Color GetArrowColor(sal_uInt16 aDirection, tools::ULong aPage) const; sw::annotation::SwAnnotationWin* GetAnnotationWin(const SwPostItField* pField) const; sw::annotation::SwAnnotationWin* GetAnnotationWin(const sal_uInt32 nPostItId) const; diff --git a/sw/inc/SwNumberTreeTypes.hxx b/sw/inc/SwNumberTreeTypes.hxx index e05fa667ffc3..c1b72821d46a 100644 --- a/sw/inc/SwNumberTreeTypes.hxx +++ b/sw/inc/SwNumberTreeTypes.hxx @@ -20,11 +20,12 @@ #ifndef INCLUDED_SW_INC_SWNUMBERTREETYPES_HXX #define INCLUDED_SW_INC_SWNUMBERTREETYPES_HXX +#include <tools/long.hxx> #include <vector> namespace SwNumberTree { - typedef long tSwNumTreeNumber; + typedef tools::Long tSwNumTreeNumber; typedef std::vector<tSwNumTreeNumber> tNumberVector; } diff --git a/sw/inc/postithelper.hxx b/sw/inc/postithelper.hxx index fb946b969c87..356f42e114db 100644 --- a/sw/inc/postithelper.hxx +++ b/sw/inc/postithelper.hxx @@ -48,7 +48,7 @@ struct SwLayoutInfo SwRect mPageFrame; SwRect mPagePrtArea; - unsigned long mnPageNumber; + tools::ULong mnPageNumber; sw::sidebarwindows::SidebarPosition meSidebarPosition; @@ -88,7 +88,7 @@ namespace SwPostItHelper tools::Long getLayoutHeight( const SwRootFrame* pRoot ); void setSidebarChanged( SwRootFrame* pRoot, bool bBrowseMode ); - unsigned long getPageInfo( SwRect& rPageFrame, const SwRootFrame* , const Point& ); + tools::ULong getPageInfo( SwRect& rPageFrame, const SwRootFrame* , const Point& ); } class SAL_DLLPUBLIC_RTTI SwSidebarItem diff --git a/sw/inc/swtypes.hxx b/sw/inc/swtypes.hxx index f457004570f7..24e9c248b167 100644 --- a/sw/inc/swtypes.hxx +++ b/sw/inc/swtypes.hxx @@ -48,7 +48,7 @@ class CharClass; class CollatorWrapper; class LanguageTag; -typedef long SwTwips; +typedef tools::Long SwTwips; #define INVALID_TWIPS LONG_MAX #define TWIPS_MAX (LONG_MAX - 1) diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index f1bb78af34cb..21b3e2f3b958 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -1286,7 +1286,7 @@ void SwUiWriterTest::testWatermarkPosition() const int aAdditionalPagesCount[] = { 0, 0, 1, 1, 5, 5, 20, 20 }; const bool aChangeHeader[] = { true, false, true, false, true, false, true, false }; - for (unsigned long i = 0; i < sizeof(aAdditionalPagesCount) / sizeof(int); ++i) + for (tools::ULong i = 0; i < sizeof(aAdditionalPagesCount) / sizeof(int); ++i) { int aPages = aPagesInDocument + aAdditionalPagesCount[i]; diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx index 8a825c15076c..76474bba91b6 100644 --- a/sw/source/core/doc/tblrwcl.cxx +++ b/sw/source/core/doc/tblrwcl.cxx @@ -1022,10 +1022,10 @@ bool SwTable::OldSplitRow( SwDoc& rDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCn // If the rows should get the same (min) height, we first have // to store the old row heights before deleting the frames - std::unique_ptr<long[]> pRowHeights; + std::unique_ptr<tools::Long[]> pRowHeights; if ( bSameHeight ) { - pRowHeights.reset(new long[ rBoxes.size() ]); + pRowHeights.reset(new tools::Long[ rBoxes.size() ]); for (size_t n = 0; n < rBoxes.size(); ++n) { SwTableBox* pSelBox = rBoxes[n]; @@ -2581,7 +2581,7 @@ void CheckBoxWidth( const SwTableLine& rLine, SwTwips nSize ) CheckBoxWidth( *pLn, nBoxW ); } - if (sal::static_int_cast< unsigned long >(std::abs(nCurrentSize - nSize)) > + if (sal::static_int_cast< tools::ULong >(std::abs(nCurrentSize - nSize)) > (COLFUZZY * rBoxes.size())) { OSL_FAIL( "Line's Boxes are too small or too large" ); diff --git a/sw/source/core/fields/postithelper.cxx b/sw/source/core/fields/postithelper.cxx index d647fc9621bf..c61637601ad2 100644 --- a/sw/source/core/fields/postithelper.cxx +++ b/sw/source/core/fields/postithelper.cxx @@ -222,9 +222,9 @@ void SwPostItHelper::setSidebarChanged( SwRootFrame* pRoot, bool bBrowseMode ) } } -unsigned long SwPostItHelper::getPageInfo( SwRect& rPageFrame, const SwRootFrame* pRoot, const Point& rPoint ) +tools::ULong SwPostItHelper::getPageInfo( SwRect& rPageFrame, const SwRootFrame* pRoot, const Point& rPoint ) { - unsigned long nRet = 0; + tools::ULong nRet = 0; const SwFrame* pPage = pRoot->GetPageAtPos( rPoint, nullptr, true ); if( pPage ) { diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index 44e31aac0993..619afa8ba8a0 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -2978,7 +2978,7 @@ void SwTabFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA nRightSpacing = nRightLine + ( ( (nWishRight+nLeftOffset) < 0 ) ? (nWishRight+nLeftOffset) : - std::max( 0L, nWishRight ) ); + std::max( SwTwips(0), nWishRight ) ); } } break; @@ -3009,7 +3009,7 @@ void SwTabFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA nLeftSpacing = nLeftLine + ( ( (nWishLeft+nRightOffset) < 0 ) ? (nWishLeft+nRightOffset) : - std::max( 0L, nWishLeft ) ); + std::max( SwTwips(0), nWishLeft ) ); } } break; diff --git a/sw/source/core/table/swnewtable.cxx b/sw/source/core/table/swnewtable.cxx index dbe11ea74942..84d7185c3ec2 100644 --- a/sw/source/core/table/swnewtable.cxx +++ b/sw/source/core/table/swnewtable.cxx @@ -378,7 +378,7 @@ std::unique_ptr<SwBoxSelection> SwTable::CollectBoxSelection( const SwPaM& rPam tools::Long nMid = ( nMin + nMax ) / 2; auto pRet(std::make_unique<SwBoxSelection>()); - std::vector< std::pair< SwTableBox*, long > > aNewWidthVector; + std::vector< std::pair< SwTableBox*, tools::Long > > aNewWidthVector; size_t nCheckBottom = nBottom; tools::Long nLeftSpan = 0; tools::Long nRightSpan = 0; diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx index 6a4847229a5e..1a0eb5d292bc 100644 --- a/sw/source/core/text/txtdrop.cxx +++ b/sw/source/core/text/txtdrop.cxx @@ -784,7 +784,7 @@ void SwDropCapCache::CalcFontSize( SwDropPortion* pDrop, SwTextFormatInfo &rInf tools::Long nMax = USHRT_MAX; tools::Long nMin = 0; #if OSL_DEBUG_LEVEL > 1 - long nGrow = 0; + tools::Long nGrow = 0; #endif bool bWinUsed = false; diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index b544ba56a48b..7f2e65230e65 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -590,7 +590,7 @@ void SwFntObj::GuessLeading( const SwViewShell& { // If the Leading on the Window is also 0, then it has to stay // that way (see also StarMath). - long nTmpLeading = aWinMet.GetInternalLeading(); + tools::Long nTmpLeading = aWinMet.GetInternalLeading(); if( nTmpLeading <= 0 ) { pWin->SetFont( rMet ); @@ -611,7 +611,7 @@ void SwFntObj::GuessLeading( const SwViewShell& // Those who lie about their Leading, may lie about their // Ascent/Descent as well, hence the Font will be lowered a // little without changing its height. - long nDiff = std::min( rMet.GetDescent() - aWinMet.GetDescent(), + tools::Long nDiff = std::min( rMet.GetDescent() - aWinMet.GetDescent(), aWinMet.GetAscent() - rMet.GetAscent() - nTmpLeading ); if( nDiff > 0 ) { diff --git a/sw/source/filter/ww8/WW8TableInfo.cxx b/sw/source/filter/ww8/WW8TableInfo.cxx index 0f9e509b16b7..03f376fbeec9 100644 --- a/sw/source/filter/ww8/WW8TableInfo.cxx +++ b/sw/source/filter/ww8/WW8TableInfo.cxx @@ -199,7 +199,7 @@ GridColsPtr WW8TableNodeInfoInner::getGridColsOfRow(AttributeOutputBase & rBase, return pResult; const SwFormatFrameSize &rSize = pFormat->GetFrameSize(); - unsigned long nTableSz = static_cast<unsigned long>(rSize.GetWidth()); + tools::ULong nTableSz = static_cast<tools::ULong>(rSize.GetWidth()); tools::Long nPageSize = 0; bool bRelBoxSize = false; @@ -1076,7 +1076,7 @@ CellInfoMultiSet::const_iterator WW8TableCellGrid::getCellsEnd(tools::Long nTop) void WW8TableCellGrid::insert(const SwRect & rRect, WW8TableNodeInfo * pNodeInfo, - const unsigned long * pFormatFrameWidth) + const tools::ULong * pFormatFrameWidth) { CellInfo aCellInfo(rRect, pNodeInfo); @@ -1117,7 +1117,7 @@ void WW8TableCellGrid::addShadowCells() *aRowSpanIt < aCellIt->bottom()) { aRect.Top(*aRowSpanIt); - unsigned long nFormatFrameWidth = aCellIt->getFormatFrameWidth(); + tools::ULong nFormatFrameWidth = aCellIt->getFormatFrameWidth(); insert(aRect, nullptr, &nFormatFrameWidth); bVertMerge = true; diff --git a/sw/source/filter/ww8/WW8TableInfo.hxx b/sw/source/filter/ww8/WW8TableInfo.hxx index ce7dbbb5faa7..5b3294cd506e 100644 --- a/sw/source/filter/ww8/WW8TableInfo.hxx +++ b/sw/source/filter/ww8/WW8TableInfo.hxx @@ -116,7 +116,7 @@ class CellInfo { SwRect m_aRect; WW8TableNodeInfo * m_pNodeInfo; - unsigned long m_nFormatFrameWidth; + tools::ULong m_nFormatFrameWidth; public: CellInfo(const SwRect & aRect, WW8TableNodeInfo * pNodeInfo); @@ -139,12 +139,12 @@ public: const SwRect& getRect() const { return m_aRect; } WW8TableNodeInfo * getTableNodeInfo() const { return m_pNodeInfo; } - unsigned long getFormatFrameWidth() const + tools::ULong getFormatFrameWidth() const { return m_nFormatFrameWidth; } - void setFormatFrameWidth(unsigned long nFormatFrameWidth) + void setFormatFrameWidth(tools::ULong nFormatFrameWidth) { m_nFormatFrameWidth = nFormatFrameWidth; } @@ -256,7 +256,7 @@ public: class WW8TableCellGrid { typedef std::set<tools::Long> RowTops_t; - typedef std::map<long, WW8TableCellGridRow::Pointer_t> Rows_t; + typedef std::map<tools::Long, WW8TableCellGridRow::Pointer_t> Rows_t; RowTops_t m_aRowTops; Rows_t m_aRows; @@ -274,7 +274,7 @@ public: ~WW8TableCellGrid(); void insert(const SwRect & rRect, WW8TableNodeInfo * pNodeInfo, - unsigned long const * pFormatFrameWidth = nullptr); + tools::ULong const * pFormatFrameWidth = nullptr); void addShadowCells(); WW8TableNodeInfo *connectCells(RowEndInners_t &rLastRowEnds); diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 413ef854121d..5e54f9443c84 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -179,10 +179,10 @@ public: WW8_FC GetStartFc() const { return nStartFc; } }; -typedef std::map<OUString,long> BKMKNames; +typedef std::map<OUString,tools::Long> BKMKNames; typedef std::pair<bool,OUString> BKMK; -typedef std::pair<long,BKMK> BKMKCP; -typedef std::multimap<long,BKMKCP*> BKMKCPs; +typedef std::pair<tools::Long,BKMK> BKMKCP; +typedef std::multimap<tools::Long,BKMKCP*> BKMKCPs; typedef BKMKCPs::iterator CPItr; class WW8_WrtBookmarks @@ -223,12 +223,12 @@ WW8_WrtBookmarks::~WW8_WrtBookmarks() void WW8_WrtBookmarks::Append( WW8_CP nStartCp, const OUString& rNm) { - std::pair<BKMKNames::iterator, bool> aResult = maSwBkmkNms.insert(std::pair<OUString,long>(rNm,0L)); + std::pair<BKMKNames::iterator, bool> aResult = maSwBkmkNms.insert(std::pair<OUString,tools::Long>(rNm,0L)); if (aResult.second) { BKMK aBK(false,rNm); BKMKCP* pBKCP = new BKMKCP(static_cast<tools::Long>(nStartCp),aBK); - aSttCps.insert(std::pair<long,BKMKCP*>(nStartCp,pBKCP)); + aSttCps.insert(std::pair<tools::Long,BKMKCP*>(nStartCp,pBKCP)); aResult.first->second = static_cast<tools::Long>(nStartCp); } else @@ -261,7 +261,7 @@ void WW8_WrtBookmarks::Write( WW8Export& rWrt) { if (rEntry.second) { - aEndCps.insert(std::pair<long,BKMKCP*>(rEntry.second->first, rEntry.second)); + aEndCps.insert(std::pair<tools::Long,BKMKCP*>(rEntry.second->first, rEntry.second)); aNames.push_back(rEntry.second->second.second); SwWW8Writer::WriteLong(aTempStrm1, rEntry.first); } @@ -312,7 +312,7 @@ void WW8_WrtBookmarks::MoveFieldMarks(WW8_CP nFrom, WW8_CP nTo) aItr->second->second.first = true; aItr->second->first = nTo; } - aSttCps.insert(std::pair<long,BKMKCP*>(nTo,aItr->second)); + aSttCps.insert(std::pair<tools::Long,BKMKCP*>(nTo,aItr->second)); aItr->second = nullptr; aRange = aSttCps.equal_range(nFrom); aItr = aRange.first; @@ -2450,7 +2450,7 @@ void AttributeOutputBase::GetTablePageSize( ww8::WW8TableNodeInfoInner const * p if ( (pFormat->GetHoriOrient().GetHoriOrient() == text::HoriOrientation::FULL) || bManualAligned ) nWidthPercent = 100; bool bRelBoxSize = nWidthPercent != 0; - unsigned long nTableSz = static_cast<unsigned long>(rSize.GetWidth()); + tools::ULong nTableSz = static_cast<tools::ULong>(rSize.GetWidth()); if (nTableSz > USHRT_MAX/2 && !bRelBoxSize) { OSL_ENSURE(bRelBoxSize, "huge table width but not relative, suspicious"); diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index cba66a28dbf5..a2b9289349b3 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -2537,7 +2537,7 @@ WW8PLCFpcd::WW8PLCFpcd(SvStream* pSt, sal_uInt32 nFilePos, nIMax = ( nPLCF - 4 ) / ( 4 + nStruct ); #ifdef OSL_BIGENDIAN - for( long nI = 0; nI <= nIMax; nI++ ) + for( tools::Long nI = 0; nI <= nIMax; nI++ ) pPLCF_PosArray[nI] = OSL_SWAPDWORD( pPLCF_PosArray[nI] ); #endif // OSL_BIGENDIAN diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index 341dc317f2a9..cdb94dc6254a 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -1837,10 +1837,10 @@ void SwFramePage::RangeModifyHdl() if (aVal.bAutoHeight && (m_sDlgType == "PictureDialog" || m_sDlgType == "ObjectDialog")) { - SwTwips nTmp = std::min(nWidth * nMaxHeight / std::max(nHeight, 1L), nMaxHeight); + SwTwips nTmp = std::min(nWidth * nMaxHeight / std::max(nHeight, SwTwips(1)), nMaxHeight); m_xWidthED->set_max(m_xWidthED->NormalizePercent(nTmp), FieldUnit::TWIP); - nTmp = std::min(nHeight * nMaxWidth / std::max(nWidth, 1L), nMaxWidth); + nTmp = std::min(nHeight * nMaxWidth / std::max(nWidth, SwTwips(1)), nMaxWidth); m_xHeightED->set_max(m_xWidthED->NormalizePercent(nTmp), FieldUnit::TWIP); } else diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx index 4f4677971c01..bec2b148a58c 100644 --- a/sw/source/uibase/docvw/AnnotationWin2.cxx +++ b/sw/source/uibase/docvw/AnnotationWin2.cxx @@ -892,7 +892,7 @@ void SwAnnotationWin::DoResize() { tools::Long aTextHeight = LogicToPixel( mpOutliner->CalcTextSize()).Height(); tools::Long aHeight = GetSizePixel().Height(); - unsigned long aWidth = GetSizePixel().Width(); + tools::ULong aWidth = GetSizePixel().Width(); aHeight -= GetMetaHeight(); mpMetadataAuthor->Show(); diff --git a/sw/source/uibase/docvw/PageBreakWin.cxx b/sw/source/uibase/docvw/PageBreakWin.cxx index 8172713fc47e..c78a8710af4b 100644 --- a/sw/source/uibase/docvw/PageBreakWin.cxx +++ b/sw/source/uibase/docvw/PageBreakWin.cxx @@ -359,7 +359,7 @@ void SwPageBreakWin::UpdatePosition(const std::optional<Point>& xEvtPt) tools::Long nPgLeft = aFrameRect.Left(); tools::Long nPgRight = aFrameRect.Right(); - unsigned long nSidebarWidth = 0; + tools::ULong nSidebarWidth = 0; const SwPostItMgr* pPostItMngr = GetEditWin()->GetView().GetWrtShell().GetPostItMgr(); if ( pPostItMngr && pPostItMngr->HasNotes() && pPostItMngr->ShowNotes() ) nSidebarWidth = pPostItMngr->GetSidebarBorderWidth( true ) + pPostItMngr->GetSidebarWidth( true ); diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx index 4041609b56d6..d5153892a0dc 100644 --- a/sw/source/uibase/docvw/PostItMgr.cxx +++ b/sw/source/uibase/docvw/PostItMgr.cxx @@ -603,12 +603,12 @@ bool SwPostItMgr::CalcRects() } } - const unsigned long aPageNum = pItem->maLayoutInfo.mnPageNumber; + const tools::ULong aPageNum = pItem->maLayoutInfo.mnPageNumber; if (aPageNum > mPages.size()) { - const unsigned long nNumberOfPages = mPages.size(); + const tools::ULong nNumberOfPages = mPages.size(); mPages.reserve(aPageNum); - for (unsigned long j=0; j<aPageNum - nNumberOfPages; ++j) + for (tools::ULong j=0; j<aPageNum - nNumberOfPages; ++j) mPages.emplace_back( new SwPostItPageItem()); } mPages[aPageNum-1]->mvSidebarItems.push_back(pItem.get()); @@ -699,7 +699,7 @@ void SwPostItMgr::LayoutPostIts() if (!pPage->mvSidebarItems.empty()) { std::vector<SwAnnotationWin*> aVisiblePostItList; - unsigned long lNeededHeight = 0; + tools::ULong lNeededHeight = 0; tools::Long mlPageBorder = 0; tools::Long mlPageEnd = 0; @@ -933,7 +933,7 @@ void SwPostItMgr::LayoutPostIts() mpEditWin->EnableMapMode(false); } -bool SwPostItMgr::BorderOverPageBorder(unsigned long aPage) const +bool SwPostItMgr::BorderOverPageBorder(tools::ULong aPage) const { if ( mPages[aPage-1]->mvSidebarItems.empty() ) { @@ -995,7 +995,7 @@ void SwPostItMgr::PaintTile(OutputDevice& rRenderContext) } } -void SwPostItMgr::Scroll(const tools::Long lScroll,const unsigned long aPage) +void SwPostItMgr::Scroll(const tools::Long lScroll,const tools::ULong aPage) { OSL_ENSURE((lScroll % GetScrollSize() )==0,"SwPostItMgr::Scroll: scrolling by wrong value"); // do not scroll more than necessary up or down @@ -1047,7 +1047,7 @@ void SwPostItMgr::Scroll(const tools::Long lScroll,const unsigned long aPage) } } -void SwPostItMgr::AutoScroll(const SwAnnotationWin* pPostIt,const unsigned long aPage ) +void SwPostItMgr::AutoScroll(const SwAnnotationWin* pPostIt,const tools::ULong aPage ) { // otherwise all notes are visible if (!mPages[aPage-1]->bScrollbar) @@ -1093,7 +1093,7 @@ void SwPostItMgr::MakeVisible(const SwAnnotationWin* pPostIt ) mpWrtShell->MakeVisible(SwRect(mpEditWin->PixelToLogic(aNoteRect))); } -bool SwPostItMgr::ArrowEnabled(sal_uInt16 aDirection,unsigned long aPage) const +bool SwPostItMgr::ArrowEnabled(sal_uInt16 aDirection,tools::ULong aPage) const { switch (aDirection) { @@ -1109,7 +1109,7 @@ bool SwPostItMgr::ArrowEnabled(sal_uInt16 aDirection,unsigned long aPage) const } } -Color SwPostItMgr::GetArrowColor(sal_uInt16 aDirection,unsigned long aPage) const +Color SwPostItMgr::GetArrowColor(sal_uInt16 aDirection,tools::ULong aPage) const { if (ArrowEnabled(aDirection,aPage)) { @@ -1921,7 +1921,7 @@ void SwPostItMgr::PrepareView(bool bIgnoreCount) } } -bool SwPostItMgr::ShowScrollbar(const unsigned long aPage) const +bool SwPostItMgr::ShowScrollbar(const tools::ULong aPage) const { if (mPages.size() > aPage-1) return (mPages[aPage-1]->bScrollbar && !mbWaitingForCalcRects); @@ -1936,7 +1936,7 @@ bool SwPostItMgr::IsHit(const Point &aPointPixel) const Point aPoint = mpEditWin->PixelToLogic(aPointPixel); const SwRootFrame* pLayout = mpWrtShell->GetLayout(); SwRect aPageFrame; - const unsigned long nPageNum = SwPostItHelper::getPageInfo( aPageFrame, pLayout, aPoint ); + const tools::ULong nPageNum = SwPostItHelper::getPageInfo( aPageFrame, pLayout, aPoint ); if( nPageNum ) { tools::Rectangle aRect; @@ -1988,7 +1988,7 @@ vcl::Window* SwPostItMgr::IsHitSidebarWindow(const Point& rPointLogic) return pRet; } -tools::Rectangle SwPostItMgr::GetBottomScrollRect(const unsigned long aPage) const +tools::Rectangle SwPostItMgr::GetBottomScrollRect(const tools::ULong aPage) const { SwRect aPageRect = mPages[aPage-1]->mPageRect; Point aPointBottom = mPages[aPage-1]->eSidebarPosition == sw::sidebarwindows::SidebarPosition::LEFT @@ -1998,7 +1998,7 @@ tools::Rectangle SwPostItMgr::GetBottomScrollRect(const unsigned long aPage) con return tools::Rectangle(aPointBottom,aSize); } -tools::Rectangle SwPostItMgr::GetTopScrollRect(const unsigned long aPage) const +tools::Rectangle SwPostItMgr::GetTopScrollRect(const tools::ULong aPage) const { SwRect aPageRect = mPages[aPage-1]->mPageRect; Point aPointTop = mPages[aPage-1]->eSidebarPosition == sw::sidebarwindows::SidebarPosition::LEFT @@ -2009,7 +2009,7 @@ tools::Rectangle SwPostItMgr::GetTopScrollRect(const unsigned long aPage) const } //IMPORTANT: if you change the rects here, also change SwPageFrame::PaintNotesSidebar() -bool SwPostItMgr::ScrollbarHit(const unsigned long aPage,const Point &aPoint) +bool SwPostItMgr::ScrollbarHit(const tools::ULong aPage,const Point &aPoint) { SwRect aPageRect = mPages[aPage-1]->mPageRect; Point aPointBottom = mPages[aPage-1]->eSidebarPosition == sw::sidebarwindows::SidebarPosition::LEFT @@ -2101,7 +2101,7 @@ bool SwPostItMgr::HasNotes() const return !mvPostItFields.empty(); } -unsigned long SwPostItMgr::GetSidebarWidth(bool bPx) const +tools::ULong SwPostItMgr::GetSidebarWidth(bool bPx) const { bool bEnableMapMode = !mpWrtShell->GetOut()->IsMapModeEnabled(); sal_uInt16 nZoom = mpWrtShell->GetViewOptions()->GetZoom(); @@ -2111,7 +2111,7 @@ unsigned long SwPostItMgr::GetSidebarWidth(bool bPx) const double fScaleX = double(mpWrtShell->GetOut()->GetMapMode().GetScaleX()); nZoom = fScaleX * 100; } - unsigned long aWidth = static_cast<unsigned long>(nZoom * 1.8); + tools::ULong aWidth = static_cast<tools::ULong>(nZoom * 1.8); if (bPx) return aWidth; @@ -2127,7 +2127,7 @@ unsigned long SwPostItMgr::GetSidebarWidth(bool bPx) const } } -unsigned long SwPostItMgr::GetSidebarBorderWidth(bool bPx) const +tools::ULong SwPostItMgr::GetSidebarBorderWidth(bool bPx) const { if (bPx) return 2; diff --git a/sw/source/uibase/misc/swruler.cxx b/sw/source/uibase/misc/swruler.cxx index 841578834e96..5b9212d9720d 100644 --- a/sw/source/uibase/misc/swruler.cxx +++ b/sw/source/uibase/misc/swruler.cxx @@ -319,7 +319,7 @@ tools::Rectangle SwCommentRuler::GetCommentControlRegion() if (!pPostItMgr) return tools::Rectangle(); - const unsigned long nSidebarWidth = pPostItMgr->GetSidebarWidth(true); + const tools::ULong nSidebarWidth = pPostItMgr->GetSidebarWidth(true); //FIXME When the page width is larger then screen, the ruler is misplaced by one pixel tools::Long nLeft = GetPageOffset(); diff --git a/vcl/inc/salgeom.hxx b/vcl/inc/salgeom.hxx index ac87d83f4a26..0bc7335c2977 100644 --- a/vcl/inc/salgeom.hxx +++ b/vcl/inc/salgeom.hxx @@ -29,9 +29,9 @@ struct SalFrameGeometry { // screen position of upper left corner of drawable area in pixel tools::Long nX, nY; // dimensions of the drawable area in pixel - unsigned long nWidth, nHeight; + tools::ULong nWidth, nHeight; // thickness of the decoration in pixel - unsigned long nLeftDecoration, + tools::ULong nLeftDecoration, nTopDecoration, nRightDecoration, nBottomDecoration; diff --git a/vcl/source/bitmap/BitmapEmbossGreyFilter.cxx b/vcl/source/bitmap/BitmapEmbossGreyFilter.cxx index aa8dff8aaa29..9470dfd3acad 100644 --- a/vcl/source/bitmap/BitmapEmbossGreyFilter.cxx +++ b/vcl/source/bitmap/BitmapEmbossGreyFilter.cxx @@ -47,8 +47,8 @@ BitmapEx BitmapEmbossGreyFilter::execute(BitmapEx const& rBitmapEx) const tools::Long nGrey31, nGrey32, nGrey33; double fAzim = basegfx::deg2rad(mnAzimuthAngle100 * 0.01); double fElev = basegfx::deg2rad(mnElevationAngle100 * 0.01); - std::unique_ptr<long[]> pHMap(new long[nWidth + 2]); - std::unique_ptr<long[]> pVMap(new long[nHeight + 2]); + std::unique_ptr<tools::Long[]> pHMap(new tools::Long[nWidth + 2]); + std::unique_ptr<tools::Long[]> pVMap(new tools::Long[nHeight + 2]); tools::Long nX, nY, nNx, nNy, nDotL; const tools::Long nLx = FRound(cos(fAzim) * cos(fElev) * 255.0); const tools::Long nLy = FRound(sin(fAzim) * cos(fElev) * 255.0); diff --git a/vcl/source/bitmap/BitmapFastScaleFilter.cxx b/vcl/source/bitmap/BitmapFastScaleFilter.cxx index 5b9ff591c953..7c8b63a0f729 100644 --- a/vcl/source/bitmap/BitmapFastScaleFilter.cxx +++ b/vcl/source/bitmap/BitmapFastScaleFilter.cxx @@ -58,8 +58,8 @@ BitmapEx BitmapFastScaleFilter::execute(BitmapEx const& rBitmapEx) const { const double nWidth = pReadAcc->Width(); const double nHeight = pReadAcc->Height(); - std::unique_ptr<long[]> pLutX(new long[nNewWidth]); - std::unique_ptr<long[]> pLutY(new long[nNewHeight]); + std::unique_ptr<tools::Long[]> pLutX(new tools::Long[nNewWidth]); + std::unique_ptr<tools::Long[]> pLutY(new tools::Long[nNewHeight]); for (tools::Long nX = 0; nX < nNewWidth; nX++) { diff --git a/vcl/source/bitmap/BitmapInterpolateScaleFilter.cxx b/vcl/source/bitmap/BitmapInterpolateScaleFilter.cxx index 1542b34a40c7..eb1d027bb295 100644 --- a/vcl/source/bitmap/BitmapInterpolateScaleFilter.cxx +++ b/vcl/source/bitmap/BitmapInterpolateScaleFilter.cxx @@ -52,8 +52,8 @@ BitmapEx BitmapInterpolateScaleFilter::execute(BitmapEx const& rBitmapEx) const const tools::Long nWidth1 = pReadAcc->Width() - 1; const double fRevScaleX = static_cast<double>(nWidth1) / nNewWidth1; - std::unique_ptr<long[]> pLutInt(new long[nNewWidth]); - std::unique_ptr<long[]> pLutFrac(new long[nNewWidth]); + std::unique_ptr<tools::Long[]> pLutInt(new tools::Long[nNewWidth]); + std::unique_ptr<tools::Long[]> pLutFrac(new tools::Long[nNewWidth]); for (tools::Long nX = 0, nTemp = nWidth - 2; nX < nNewWidth; nX++) { @@ -148,8 +148,8 @@ BitmapEx BitmapInterpolateScaleFilter::execute(BitmapEx const& rBitmapEx) const const tools::Long nHeight1 = pReadAcc->Height() - 1; const double fRevScaleY = static_cast<double>(nHeight1) / nNewHeight1; - std::unique_ptr<long[]> pLutInt(new long[nNewHeight]); - std::unique_ptr<long[]> pLutFrac(new long[nNewHeight]); + std::unique_ptr<tools::Long[]> pLutInt(new tools::Long[nNewHeight]); + std::unique_ptr<tools::Long[]> pLutFrac(new tools::Long[nNewHeight]); for (tools::Long nY = 0, nTemp = nHeight - 2; nY < nNewHeight; nY++) { diff --git a/vcl/source/bitmap/BitmapMedianFilter.cxx b/vcl/source/bitmap/BitmapMedianFilter.cxx index 4f1c857c0878..91bc75a7d4bd 100644 --- a/vcl/source/bitmap/BitmapMedianFilter.cxx +++ b/vcl/source/bitmap/BitmapMedianFilter.cxx @@ -66,8 +66,8 @@ BitmapEx BitmapMedianFilter::execute(BitmapEx const& rBitmapEx) const { const tools::Long nWidth = pWriteAcc->Width(), nWidth2 = nWidth + 2; const tools::Long nHeight = pWriteAcc->Height(), nHeight2 = nHeight + 2; - std::unique_ptr<long[]> pColm(new long[nWidth2]); - std::unique_ptr<long[]> pRows(new long[nHeight2]); + std::unique_ptr<tools::Long[]> pColm(new tools::Long[nWidth2]); + std::unique_ptr<tools::Long[]> pRows(new tools::Long[nHeight2]); std::unique_ptr<BitmapColor[]> pColRow1(new BitmapColor[nWidth2]); std::unique_ptr<BitmapColor[]> pColRow2(new BitmapColor[nWidth2]); std::unique_ptr<BitmapColor[]> pColRow3(new BitmapColor[nWidth2]); diff --git a/vcl/source/bitmap/bitmappaint.cxx b/vcl/source/bitmap/bitmappaint.cxx index f1c849bd5787..dd9eb1a5999b 100644 --- a/vcl/source/bitmap/bitmappaint.cxx +++ b/vcl/source/bitmap/bitmappaint.cxx @@ -926,12 +926,12 @@ bool Bitmap::Replace(const Color* pSearchColors, const Color* pReplaceColors, sa if (pAcc) { - std::unique_ptr<long[]> pMinR(new long[nColorCount]); - std::unique_ptr<long[]> pMaxR(new long[nColorCount]); - std::unique_ptr<long[]> pMinG(new long[nColorCount]); - std::unique_ptr<long[]> pMaxG(new long[nColorCount]); - std::unique_ptr<long[]> pMinB(new long[nColorCount]); - std::unique_ptr<long[]> pMaxB(new long[nColorCount]); + std::unique_ptr<tools::Long[]> pMinR(new tools::Long[nColorCount]); + std::unique_ptr<tools::Long[]> pMaxR(new tools::Long[nColorCount]); + std::unique_ptr<tools::Long[]> pMinG(new tools::Long[nColorCount]); + std::unique_ptr<tools::Long[]> pMaxG(new tools::Long[nColorCount]); + std::unique_ptr<tools::Long[]> pMinB(new tools::Long[nColorCount]); + std::unique_ptr<tools::Long[]> pMaxB(new tools::Long[nColorCount]); if (pTols) { diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index bcef44294468..24d64bdd7e41 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -502,7 +502,7 @@ void SvxIconChoiceCtrl_Impl::Paint(vcl::RenderContext& rRenderContext, const too rRenderContext.DrawLine(aStart, aEnd); } - for (long nDX = nGridDX; nDX <= aXSize.Width(); nDX += nGridDX) + for (tools::Long nDX = nGridDX; nDX <= aXSize.Width(); nDX += nGridDX) { Point aStart( nDX+LROFFS_WINBORDER, 0 ); Point aEnd( nDX+LROFFS_WINBORDER, aXSize.Height()); @@ -510,7 +510,7 @@ void SvxIconChoiceCtrl_Impl::Paint(vcl::RenderContext& rRenderContext, const too aEnd -= aOffs; rRenderContext.DrawLine(aStart, aEnd); } - for (long nDY = nGridDY; nDY <= aXSize.Height(); nDY += nGridDY) + for (tools::Long nDY = nGridDY; nDY <= aXSize.Height(); nDY += nGridDY) { Point aStart(0, nDY + TBOFFS_WINBORDER); Point aEnd(aXSize.Width(), nDY + TBOFFS_WINBORDER); diff --git a/vcl/source/filter/jpeg/JpegReader.hxx b/vcl/source/filter/jpeg/JpegReader.hxx index 3dc78ce50e32..c9bf90806ade 100644 --- a/vcl/source/filter/jpeg/JpegReader.hxx +++ b/vcl/source/filter/jpeg/JpegReader.hxx @@ -36,11 +36,11 @@ enum ReadState struct JPEGCreateBitmapParam { - unsigned long nWidth; - unsigned long nHeight; - unsigned long density_unit; - unsigned long X_density; - unsigned long Y_density; + tools::ULong nWidth; + tools::ULong nHeight; + tools::ULong density_unit; + tools::ULong X_density; + tools::ULong Y_density; bool bGray; }; diff --git a/vcl/source/gdi/dibtools.cxx b/vcl/source/gdi/dibtools.cxx index 39203304e2dd..c846d0a3a60c 100644 --- a/vcl/source/gdi/dibtools.cxx +++ b/vcl/source/gdi/dibtools.cxx @@ -862,7 +862,7 @@ bool ImplReadDIBBody(SvStream& rIStm, Bitmap& rBmp, AlphaMask* pBmpAlpha, sal_uL const tools::Long nRead = aCodec.Read(*pMemStm, aData.data() + nDataPos, sal_uInt32(nToRead)); if (nRead > 0) { - nDataPos += static_cast<unsigned long>(nRead); + nDataPos += static_cast<tools::ULong>(nRead); // we haven't read everything yet: resize buffer and continue if (nDataPos < nUncodedSize) aData.resize(aData.size() + nSizeInc); diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index 5fdcac0b3255..454363c6d88c 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -2799,9 +2799,9 @@ bool GDIMetaFile::CreateThumbnail(BitmapEx& rBitmapEx, BmpConversion eColorConve // determine size that has the same aspect ratio as image size and // fits into the rectangle determined by nMaximumExtent if ( aSizePix.Width() && aSizePix.Height() - && ( sal::static_int_cast< unsigned long >(aSizePix.Width()) > + && ( sal::static_int_cast< tools::ULong >(aSizePix.Width()) > nMaximumExtent || - sal::static_int_cast< unsigned long >(aSizePix.Height()) > + sal::static_int_cast< tools::ULong >(aSizePix.Height()) > nMaximumExtent ) ) { const Size aOldSizePix( aSizePix ); diff --git a/vcl/source/gdi/impvect.cxx b/vcl/source/gdi/impvect.cxx index f64d5c437c26..1b340780aa8f 100644 --- a/vcl/source/gdi/impvect.cxx +++ b/vcl/source/gdi/impvect.cxx @@ -40,7 +40,7 @@ #define VECT_POLY_OUTLINE_INNER 4UL #define VECT_POLY_OUTLINE_OUTER 8UL -static void VECT_MAP( const std::unique_ptr<long []> & pMapIn, const std::unique_ptr<long []>& pMapOut, tools::Long nVal ) +static void VECT_MAP( const std::unique_ptr<tools::Long []> & pMapIn, const std::unique_ptr<tools::Long []>& pMapOut, tools::Long nVal ) { pMapIn[nVal] = (nVal * 4) + 1; pMapOut[nVal] = pMapIn[nVal] + 5; @@ -788,8 +788,8 @@ ImplVectMap* ImplExpand( BitmapReadAccess* pRAcc, const Color& rColor ) const tools::Long nNewWidth = ( nOldWidth << 2 ) + 4; const tools::Long nNewHeight = ( nOldHeight << 2 ) + 4; const BitmapColor aTest( pRAcc->GetBestMatchingColor( rColor ) ); - std::unique_ptr<long[]> pMapIn(new long[ std::max( nOldWidth, nOldHeight ) ]); - std::unique_ptr<long[]> pMapOut(new long[ std::max( nOldWidth, nOldHeight ) ]); + std::unique_ptr<tools::Long[]> pMapIn(new tools::Long[ std::max( nOldWidth, nOldHeight ) ]); + std::unique_ptr<tools::Long[]> pMapOut(new tools::Long[ std::max( nOldWidth, nOldHeight ) ]); tools::Long nX, nY, nTmpX, nTmpY; pMap = new ImplVectMap( nNewWidth, nNewHeight ); diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx index 2a1bb8562438..c966a68309e9 100644 --- a/vcl/source/gdi/metaact.cxx +++ b/vcl/source/gdi/metaact.cxx @@ -1092,7 +1092,7 @@ MetaTextArrayAction::MetaTextArrayAction( const MetaTextArrayAction& rAction ) : if( rAction.mpDXAry ) { mpDXAry.reset( new tools::Long[ mnLen ] ); - memcpy( mpDXAry.get(), rAction.mpDXAry.get(), mnLen * sizeof( long ) ); + memcpy( mpDXAry.get(), rAction.mpDXAry.get(), mnLen * sizeof( tools::Long ) ); } } @@ -1112,7 +1112,7 @@ MetaTextArrayAction::MetaTextArrayAction( const Point& rStartPt, if (nAryLen > 0) { mpDXAry.reset( new tools::Long[ nAryLen ] ); - memcpy( mpDXAry.get(), pDXAry, nAryLen * sizeof(long) ); + memcpy( mpDXAry.get(), pDXAry, nAryLen * sizeof(tools::Long) ); } } diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index 756752275b51..48338a879ea5 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -728,8 +728,8 @@ void Printer::DrawDeviceMask( const Bitmap& rMask, const Color& rMaskColor, // do painting const tools::Long nSrcWidth = aSrcRect.GetWidth(), nSrcHeight = aSrcRect.GetHeight(); tools::Long nX, nY; //, nWorkX, nWorkY, nWorkWidth, nWorkHeight; - std::unique_ptr<long[]> pMapX( new long[ nSrcWidth + 1 ] ); - std::unique_ptr<long[]> pMapY( new long[ nSrcHeight + 1 ] ); + std::unique_ptr<tools::Long[]> pMapX( new tools::Long[ nSrcWidth + 1 ] ); + std::unique_ptr<tools::Long[]> pMapY( new tools::Long[ nSrcHeight + 1 ] ); GDIMetaFile* pOldMetaFile = mpMetaFile; const bool bOldMap = mbMap; diff --git a/vcl/source/gdi/salmisc.cxx b/vcl/source/gdi/salmisc.cxx index a077e50be4d6..14af546fca67 100644 --- a/vcl/source/gdi/salmisc.cxx +++ b/vcl/source/gdi/salmisc.cxx @@ -53,9 +53,9 @@ static tools::Long ImplIndexFromColor( const BitmapColor& rCol ) #elif TC_TO_PAL_COLORS == 32768 - return( ( ( (long) rCol.GetBlue() >> 3) << 10 ) | - ( ( (long) rCol.GetGreen() >> 3 ) << 5 ) | - ( (long) rCol.GetRed() >> 3 ) ); + return( ( ( (tools::Long) rCol.GetBlue() >> 3) << 10 ) | + ( ( (tools::Long) rCol.GetGreen() >> 3 ) << 5 ) | + ( (tools::Long) rCol.GetRed() >> 3 ) ); #endif } diff --git a/vcl/source/outdev/map.cxx b/vcl/source/outdev/map.cxx index a2134bd468d5..aba22cb4ef1f 100644 --- a/vcl/source/outdev/map.cxx +++ b/vcl/source/outdev/map.cxx @@ -37,9 +37,9 @@ // we don't actually handle units beyond, hence the zeros in the arrays const MapUnit s_MaxValidUnit = MapUnit::MapPixel; -const o3tl::enumarray<MapUnit,long> aImplNumeratorAry = +const o3tl::enumarray<MapUnit,tools::Long> aImplNumeratorAry = { 1, 1, 5, 50, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0 }; -const o3tl::enumarray<MapUnit,long> aImplDenominatorAry = +const o3tl::enumarray<MapUnit,tools::Long> aImplDenominatorAry = { 2540, 254, 127, 127, 1000, 100, 10, 1, 72, 1440, 1, 0, 0, 0 }; /* diff --git a/vcl/source/outdev/transparent.cxx b/vcl/source/outdev/transparent.cxx index 58242661a2ac..55423fdb6385 100644 --- a/vcl/source/outdev/transparent.cxx +++ b/vcl/source/outdev/transparent.cxx @@ -168,8 +168,8 @@ void OutputDevice::ImplPrintTransparent( const Bitmap& rBmp, const Bitmap& rMask // do painting const tools::Long nSrcWidth = aSrcRect.GetWidth(), nSrcHeight = aSrcRect.GetHeight(); tools::Long nX, nY; // , nWorkX, nWorkY, nWorkWidth, nWorkHeight; - std::unique_ptr<long[]> pMapX(new long[ nSrcWidth + 1 ]); - std::unique_ptr<long[]> pMapY(new long[ nSrcHeight + 1 ]); + std::unique_ptr<tools::Long[]> pMapX(new tools::Long[ nSrcWidth + 1 ]); + std::unique_ptr<tools::Long[]> pMapY(new tools::Long[ nSrcHeight + 1 ]); const bool bOldMap = mbMap; mbMap = false; diff --git a/vcl/source/window/NotebookBarAddonsMerger.cxx b/vcl/source/window/NotebookBarAddonsMerger.cxx index 1d8d5a7e7aec..1bbbc66b9452 100644 --- a/vcl/source/window/NotebookBarAddonsMerger.cxx +++ b/vcl/source/window/NotebookBarAddonsMerger.cxx @@ -64,8 +64,7 @@ static void GetAddonNotebookBarItem(const css::uno::Sequence<css::beans::Propert static void CreateNotebookBarToolBox(vcl::Window* pNotebookbarToolBox, const css::uno::Reference<css::frame::XFrame>& m_xFrame, const AddonNotebookBarItem& aAddonNotebookBarItem, - const std::vector<Image>& aImageVec, - const unsigned long& nIter) + const std::vector<Image>& aImageVec, const tools::ULong& nIter) { sal_uInt16 nItemId = 0; ToolBox* pToolbox = dynamic_cast<ToolBox*>(pNotebookbarToolBox); @@ -111,7 +110,7 @@ void MergeNotebookBarAddons(vcl::Window* pParent, const VclBuilder::customMakeWi VclBuilder::stringmap& rMap) { std::vector<Image> aImageVec = aNotebookBarAddonsItem.aImageValues; - unsigned long nIter = 0; + tools::ULong nIter = 0; sal_uInt16 nPriorityIdx = aImageVec.size(); css::uno::Sequence<css::uno::Sequence<css::beans::PropertyValue>> aExtension; for (std::size_t nIdx = 0; nIdx < aNotebookBarAddonsItem.aAddonValues.size(); nIdx++) @@ -147,7 +146,7 @@ void MergeNotebookBarMenuAddons(Menu* pPopupMenu, sal_Int16 nItemId, const OStri NotebookBarAddonsItem& aNotebookBarAddonsItem) { std::vector<Image> aImageVec = aNotebookBarAddonsItem.aImageValues; - unsigned long nIter = 0; + tools::ULong nIter = 0; css::uno::Sequence<css::uno::Sequence<css::beans::PropertyValue>> aExtension; for (std::size_t nIdx = 0; nIdx < aNotebookBarAddonsItem.aAddonValues.size(); nIdx++) { diff --git a/vcl/unx/generic/dtrans/bmp.hxx b/vcl/unx/generic/dtrans/bmp.hxx index 8d24ff41d92b..e4dc3ee30f9b 100644 --- a/vcl/unx/generic/dtrans/bmp.hxx +++ b/vcl/unx/generic/dtrans/bmp.hxx @@ -45,14 +45,14 @@ class PixmapHolder int m_nRedShift; int m_nGreenShift; int m_nBlueShift; - unsigned long m_nBlueShift2Mask, m_nRedShift2Mask, m_nGreenShift2Mask; + tools::ULong m_nBlueShift2Mask, m_nRedShift2Mask, m_nGreenShift2Mask; // these expect data pointers to bitmapinfo header void setBitmapDataTC( const sal_uInt8* pData, XImage* pImage ); void setBitmapDataTCDither( const sal_uInt8* pData, XImage* pImage ); void setBitmapDataPalette( const sal_uInt8* pData, XImage* pImage ); - unsigned long getTCPixel( sal_uInt8 r, sal_uInt8 g, sal_uInt8 b ) const; + tools::ULong getTCPixel( sal_uInt8 r, sal_uInt8 g, sal_uInt8 b ) const; public: PixmapHolder( Display* pDisplay ); ~PixmapHolder(); diff --git a/vcl/win/gdi/gdiimpl.cxx b/vcl/win/gdi/gdiimpl.cxx index ecfec5c8dccf..102f009dd632 100644 --- a/vcl/win/gdi/gdiimpl.cxx +++ b/vcl/win/gdi/gdiimpl.cxx @@ -1171,13 +1171,13 @@ bool WinSalGraphicsImpl::setClipRegion( const vcl::Region& i_rClip ) for (auto const& rectangle : aRectangles) { - const long nW(rectangle.GetWidth()); - const long nH(rectangle.GetHeight()); + const tools::Long nW(rectangle.GetWidth()); + const tools::Long nH(rectangle.GetHeight()); if(nW && nH) { - const long nRight(rectangle.Left() + nW); - const long nBottom(rectangle.Top() + nH); + const tools::Long nRight(rectangle.Left() + nW); + const tools::Long nBottom(rectangle.Top() + nH); if(bFirstClipRect) { @@ -1560,7 +1560,7 @@ void WinSalGraphicsImpl::SetROPFillColor( SalROPColor nROPColor ) SetFillColor( ImplGetROPColor( nROPColor ) ); } -void WinSalGraphicsImpl::DrawPixelImpl( long nX, long nY, COLORREF crColor ) +void WinSalGraphicsImpl::DrawPixelImpl( tools::Long nX, tools::Long nY, COLORREF crColor ) { const HDC hDC = mrParent.getHDC(); @@ -2505,10 +2505,10 @@ static void paintToGdiPlus( static void setInterpolationMode( Gdiplus::Graphics& rGraphics, - long rSrcWidth, - long rDestWidth, - long rSrcHeight, - long rDestHeight) + tools::Long rSrcWidth, + tools::Long rDestWidth, + tools::Long rSrcHeight, + tools::Long rDestHeight) { const bool bSameWidth(rSrcWidth == rDestWidth); const bool bSameHeight(rSrcHeight == rDestHeight); @@ -2632,13 +2632,13 @@ bool WinSalGraphicsImpl::drawTransformedBitmap( if(aARGB) { - const long nSrcWidth(aARGB->GetWidth()); - const long nSrcHeight(aARGB->GetHeight()); + const tools::Long nSrcWidth(aARGB->GetWidth()); + const tools::Long nSrcHeight(aARGB->GetHeight()); if(nSrcWidth && nSrcHeight) { - const long nDestWidth(basegfx::fround(basegfx::B2DVector(rX - rNull).getLength())); - const long nDestHeight(basegfx::fround(basegfx::B2DVector(rY - rNull).getLength())); + const tools::Long nDestWidth(basegfx::fround(basegfx::B2DVector(rX - rNull).getLength())); + const tools::Long nDestHeight(basegfx::fround(basegfx::B2DVector(rY - rNull).getLength())); if(nDestWidth && nDestHeight) { diff --git a/vcl/win/gdi/salbmp.cxx b/vcl/win/gdi/salbmp.cxx index 43b322358b41..2418c10a1770 100644 --- a/vcl/win/gdi/salbmp.cxx +++ b/vcl/win/gdi/salbmp.cxx @@ -53,7 +53,7 @@ #undef max #endif -static void ImplSetPixel4( sal_uInt8* pScanline, long nX, const BYTE cIndex ) +static void ImplSetPixel4( sal_uInt8* pScanline, tools::Long nX, const BYTE cIndex ) { BYTE& rByte = pScanline[ nX >> 1 ]; diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx index c1d209f4d765..04f3b46ce6e6 100644 --- a/vcl/win/gdi/salfont.cxx +++ b/vcl/win/gdi/salfont.cxx @@ -67,7 +67,7 @@ using namespace vcl; static FIXED FixedFromDouble( double d ) { - const long l = static_cast<tools::Long>( d * 65536. ); + const tools::Long l = static_cast<tools::Long>( d * 65536. ); return *reinterpret_cast<FIXED const *>(&l); } @@ -593,10 +593,10 @@ void ImplSalLogFontToFontW( HDC hDC, const LOGFONTW& rLogFont, Font& rFont ) rFont.SetPitch( ImplLogPitchToSal( rLogFont.lfPitchAndFamily ) ); rFont.SetWeight( ImplWeightToSal( rLogFont.lfWeight ) ); - long nFontHeight = rLogFont.lfHeight; + tools::Long nFontHeight = rLogFont.lfHeight; if ( nFontHeight < 0 ) nFontHeight = -nFontHeight; - long nDPIY = GetDeviceCaps( hDC, LOGPIXELSY ); + tools::Long nDPIY = GetDeviceCaps( hDC, LOGPIXELSY ); if( !nDPIY ) nDPIY = 600; nFontHeight *= 72; @@ -1344,8 +1344,8 @@ bool WinFontInstance::GetGlyphOutline(sal_GlyphId nId, basegfx::B2DPolyPolygon& // of previous segment sal_uInt16 nPnt = 0; - long nX = IntTimes256FromFixed( pHeader->pfxStart.x ); - long nY = IntTimes256FromFixed( pHeader->pfxStart.y ); + tools::Long nX = IntTimes256FromFixed( pHeader->pfxStart.x ); + tools::Long nY = IntTimes256FromFixed( pHeader->pfxStart.y ); pPoints[ nPnt ] = Point( nX, nY ); pFlags[ nPnt++ ] = PolyFlags::Normal; diff --git a/vcl/win/gdi/salgdi.cxx b/vcl/win/gdi/salgdi.cxx index f117bc9a9ba0..92a0b62879d5 100644 --- a/vcl/win/gdi/salgdi.cxx +++ b/vcl/win/gdi/salgdi.cxx @@ -178,11 +178,11 @@ void ImplInitSalGDI() if( bDither16 ) { // create DIBPattern for 16Bit dithering - long n; + tools::Long n; pSalData->mhDitherDIB = GlobalAlloc( GMEM_FIXED, sizeof( BITMAPINFOHEADER ) + 192 ); pSalData->mpDitherDIB = static_cast<BYTE*>(GlobalLock( pSalData->mhDitherDIB )); - pSalData->mpDitherDiff = new long[ 256 ]; + pSalData->mpDitherDiff = new tools::Long[ 256 ]; pSalData->mpDitherLow = new BYTE[ 256 ]; pSalData->mpDitherHigh = new BYTE[ 256 ]; pSalData->mpDitherDIBData = pSalData->mpDitherDIB + sizeof( BITMAPINFOHEADER ); @@ -251,12 +251,12 @@ void ImplInitSalGDI() if( pSalData->mhDitherPal ) { // create DIBPattern for 8Bit dithering - long const nSize = sizeof( BITMAPINFOHEADER ) + ( 256 * sizeof( short ) ) + 64; - long n; + tools::Long const nSize = sizeof( BITMAPINFOHEADER ) + ( 256 * sizeof( short ) ) + 64; + tools::Long n; pSalData->mhDitherDIB = GlobalAlloc( GMEM_FIXED, nSize ); pSalData->mpDitherDIB = static_cast<BYTE*>(GlobalLock( pSalData->mhDitherDIB )); - pSalData->mpDitherDiff = new long[ 256 ]; + pSalData->mpDitherDiff = new tools::Long[ 256 ]; pSalData->mpDitherLow = new BYTE[ 256 ]; pSalData->mpDitherHigh = new BYTE[ 256 ]; pSalData->mpDitherDIBData = pSalData->mpDitherDIB + sizeof( BITMAPINFOHEADER ) + ( 256 * sizeof( short ) ); diff --git a/vcl/win/gdi/salgdi2.cxx b/vcl/win/gdi/salgdi2.cxx index e23ebb4430a8..54afa84c7bc4 100644 --- a/vcl/win/gdi/salgdi2.cxx +++ b/vcl/win/gdi/salgdi2.cxx @@ -77,9 +77,9 @@ public: int mnComponentSize; int mnComponentExchangeIndex; - long mnScanlineSize; + tools::Long mnScanlineSize; - ColorScanlineConverter(ScanlineFormat eSourceFormat, int nComponentSize, long nScanlineSize) + ColorScanlineConverter(ScanlineFormat eSourceFormat, int nComponentSize, tools::Long nScanlineSize) : meSourceFormat(eSourceFormat) , mnComponentSize(nComponentSize) , mnComponentExchangeIndex(0) @@ -94,7 +94,7 @@ public: void convertScanline(sal_uInt8* pSource, sal_uInt8* pDestination) { - for (long x = 0; x < mnScanlineSize; x += mnComponentSize) + for (tools::Long x = 0; x < mnScanlineSize; x += mnComponentSize) { for (int i = 0; i < mnComponentSize; ++i) { @@ -126,7 +126,7 @@ void convertToWinSalBitmap(SalBitmap& rSalBitmap, WinSalBitmap& rWinSalBitmap) sal_uInt8* pSource(pRead->mpBits); sal_uInt8* pDestination(pWrite->mpBits); - long readRowChange = pRead->mnScanlineSize; + tools::Long readRowChange = pRead->mnScanlineSize; if(pRead->mnFormat & ScanlineFormat::TopDown) { pSource += pRead->mnScanlineSize * (pRead->mnHeight - 1); @@ -143,7 +143,7 @@ void convertToWinSalBitmap(SalBitmap& rSalBitmap, WinSalBitmap& rWinSalBitmap) 4, pRead->mnScanlineSize)); if (pConverter) { - for (long y = 0; y < pRead->mnHeight; y++) + for (tools::Long y = 0; y < pRead->mnHeight; y++) { pConverter->convertScanline(pSource, pDestination); pSource += readRowChange; @@ -152,7 +152,7 @@ void convertToWinSalBitmap(SalBitmap& rSalBitmap, WinSalBitmap& rWinSalBitmap) } else { - for (long y = 0; y < pRead->mnHeight; y++) + for (tools::Long y = 0; y < pRead->mnHeight; y++) { memcpy(pDestination, pSource, pRead->mnScanlineSize); pSource += readRowChange; diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx index ab4102056604..e016430611ad 100644 --- a/vcl/win/window/salframe.cxx +++ b/vcl/win/window/salframe.cxx @@ -126,7 +126,7 @@ bool WinSalFrame::mbInReparent = false; // Macros for support of WM_UNICHAR & Keyman 6.0 //#define Uni_UTF32ToSurrogate1(ch) (((unsigned long) (ch) - 0x10000) / 0x400 + 0xD800) -#define Uni_UTF32ToSurrogate2(ch) ((static_cast<unsigned long>(ch) - 0x10000) % 0x400 + 0xDC00) +#define Uni_UTF32ToSurrogate2(ch) ((static_cast<tools::ULong>(ch) - 0x10000) % 0x400 + 0xDC00) #define Uni_SupplementaryPlanesStart 0x10000 static void UpdateFrameGeometry( HWND hWnd, WinSalFrame* pFrame ); @@ -160,10 +160,10 @@ static void ImplSaveFrameState( WinSalFrame* pFrame ) RECT aRect2 = aRect; AdjustWindowRectEx( &aRect2, GetWindowStyle( pFrame->mhWnd ), FALSE, GetWindowExStyle( pFrame->mhWnd ) ); - long nTopDeco = abs( aRect.top - aRect2.top ); - long nLeftDeco = abs( aRect.left - aRect2.left ); - long nBottomDeco = abs( aRect.bottom - aRect2.bottom ); - long nRightDeco = abs( aRect.right - aRect2.right ); + tools::Long nTopDeco = abs( aRect.top - aRect2.top ); + tools::Long nLeftDeco = abs( aRect.left - aRect2.left ); + tools::Long nBottomDeco = abs( aRect.bottom - aRect2.bottom ); + tools::Long nRightDeco = abs( aRect.right - aRect2.right ); pFrame->maState.mnX = aRect.left + nLeftDeco; pFrame->maState.mnY = aRect.top + nTopDeco; @@ -180,10 +180,10 @@ static void ImplSaveFrameState( WinSalFrame* pFrame ) RECT aRect2 = aRect; AdjustWindowRectEx( &aRect2, GetWindowStyle( pFrame->mhWnd ), FALSE, GetWindowExStyle( pFrame->mhWnd ) ); - long nTopDeco = abs( aRect.top - aRect2.top ); - long nLeftDeco = abs( aRect.left - aRect2.left ); - long nBottomDeco = abs( aRect.bottom - aRect2.bottom ); - long nRightDeco = abs( aRect.right - aRect2.right ); + tools::Long nTopDeco = abs( aRect.top - aRect2.top ); + tools::Long nLeftDeco = abs( aRect.left - aRect2.left ); + tools::Long nBottomDeco = abs( aRect.bottom - aRect2.bottom ); + tools::Long nRightDeco = abs( aRect.right - aRect2.right ); pFrame->maState.mnState &= ~WindowStateState(WindowStateState::Minimized | WindowStateState::Maximized); // subtract decoration @@ -2578,7 +2578,7 @@ static void ImplSalUpdateStyleFontW( HDC hDC, const LOGFONTW& rLogFont, vcl::Fon } } -static long ImplW2I( const wchar_t* pStr ) +static tools::Long ImplW2I( const wchar_t* pStr ) { long n = 0; int nSign = 1; @@ -2607,8 +2607,8 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings ) aMouseSettings.SetDoubleClickTime( GetDoubleClickTime() ); aMouseSettings.SetDoubleClickWidth( GetSystemMetrics( SM_CXDOUBLECLK ) ); aMouseSettings.SetDoubleClickHeight( GetSystemMetrics( SM_CYDOUBLECLK ) ); - long nDragWidth = GetSystemMetrics( SM_CXDRAG ); - long nDragHeight = GetSystemMetrics( SM_CYDRAG ); + tools::Long nDragWidth = GetSystemMetrics( SM_CXDRAG ); + tools::Long nDragHeight = GetSystemMetrics( SM_CYDRAG ); if ( nDragWidth ) aMouseSettings.SetStartDragWidth( nDragWidth ); if ( nDragHeight ) diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 5868ef2f288e..a6b22c178729 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -269,7 +269,7 @@ public: /// stack of backed up namespace maps /// long: depth at which namespace map has been backed up into the stack - ::std::stack< ::std::pair< std::unique_ptr<SvXMLNamespaceMap>, long > > mNamespaceMaps; + ::std::stack< ::std::pair< std::unique_ptr<SvXMLNamespaceMap>, tools::Long > > mNamespaceMaps; /// counts depth (number of open elements/start tags) tools::Long mDepth; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits