[Libreoffice-commits] core.git: pyuno/source reportdesign/source sax/source sd/inc sd/qa sd/source

Noel (via logerrit) logerrit at kemper.freedesktop.org
Fri Oct 23 06:49:39 UTC 2020


 pyuno/source/module/pyuno.cxx                                  |    3 
 reportdesign/source/ui/dlg/GroupsSorting.cxx                   |   40 +--
 reportdesign/source/ui/inc/SectionWindow.hxx                   |    2 
 reportdesign/source/ui/report/DesignView.cxx                   |   10 
 reportdesign/source/ui/report/EndMarker.cxx                    |    4 
 reportdesign/source/ui/report/ReportWindow.cxx                 |   24 +-
 reportdesign/source/ui/report/ScrollHelper.cxx                 |   10 
 reportdesign/source/ui/report/SectionWindow.cxx                |   10 
 reportdesign/source/ui/report/StartMarker.cxx                  |   26 +-
 reportdesign/source/ui/report/ViewsWindow.cxx                  |   40 +--
 reportdesign/source/ui/report/dlgedfunc.cxx                    |   10 
 sax/source/tools/converter.cxx                                 |    7 
 sd/inc/CustomAnimationEffect.hxx                               |    3 
 sd/inc/drawdoc.hxx                                             |   16 -
 sd/qa/unit/export-tests-ooxml2.cxx                             |    4 
 sd/qa/unit/import-tests.cxx                                    |   16 -
 sd/qa/unit/tiledrendering/tiledrendering.cxx                   |    8 
 sd/source/core/drawdoc.cxx                                     |   16 -
 sd/source/core/drawdoc2.cxx                                    |    8 
 sd/source/core/sdpage.cxx                                      |  104 +++++-----
 sd/source/filter/eppt/epptso.cxx                               |    4 
 sd/source/filter/grf/sdgrffilter.cxx                           |    4 
 sd/source/filter/html/htmlex.cxx                               |   26 +-
 sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx      |    2 
 sd/source/ui/animations/CustomAnimationDialog.cxx              |   20 -
 sd/source/ui/animations/CustomAnimationList.cxx                |   16 -
 sd/source/ui/animations/motionpathtag.cxx                      |    4 
 sd/source/ui/annotations/annotationtag.cxx                     |   10 
 sd/source/ui/annotations/annotationwindow.cxx                  |   14 -
 sd/source/ui/annotations/annotationwindow.hxx                  |    6 
 sd/source/ui/app/sdmod2.cxx                                    |    2 
 sd/source/ui/dlg/BulletAndPositionDlg.cxx                      |   36 +--
 sd/source/ui/dlg/animobjs.cxx                                  |   10 
 sd/source/ui/dlg/copydlg.cxx                                   |   46 ++--
 sd/source/ui/dlg/custsdlg.cxx                                  |    6 
 sd/source/ui/dlg/dlgsnap.cxx                                   |    2 
 sd/source/ui/dlg/headerfooterdlg.cxx                           |    4 
 sd/source/ui/dlg/navigatr.cxx                                  |    2 
 sd/source/ui/dlg/present.cxx                                   |    2 
 sd/source/ui/dlg/sdpreslt.cxx                                  |    2 
 sd/source/ui/dlg/tpoption.cxx                                  |    6 
 sd/source/ui/dlg/vectdlg.cxx                                   |   42 ++--
 sd/source/ui/docshell/sdclient.cxx                             |    4 
 sd/source/ui/func/fucon3d.cxx                                  |    2 
 sd/source/ui/func/fuconarc.cxx                                 |    4 
 sd/source/ui/func/fuconrec.cxx                                 |    8 
 sd/source/ui/func/fucopy.cxx                                   |   14 -
 sd/source/ui/func/fudraw.cxx                                   |    2 
 sd/source/ui/func/fuediglu.cxx                                 |    4 
 sd/source/ui/func/fulinend.cxx                                 |    8 
 sd/source/ui/func/fumorph.cxx                                  |    6 
 sd/source/ui/func/fuparagr.cxx                                 |    2 
 sd/source/ui/func/fupoor.cxx                                   |    4 
 sd/source/ui/func/fusel.cxx                                    |   10 
 sd/source/ui/func/fusldlg.cxx                                  |    4 
 sd/source/ui/func/fuzoom.cxx                                   |    2 
 sd/source/ui/func/sdundogr.cxx                                 |    6 
 sd/source/ui/inc/DrawViewShell.hxx                             |    8 
 sd/source/ui/inc/OutlineViewShell.hxx                          |    2 
 sd/source/ui/inc/SlideSorterViewShell.hxx                      |    2 
 sd/source/ui/inc/ViewShell.hxx                                 |   14 -
 sd/source/ui/inc/ViewShellBase.hxx                             |    2 
 sd/source/ui/inc/Window.hxx                                    |   21 +-
 sd/source/ui/inc/sdpreslt.hxx                                  |    2 
 sd/source/ui/inc/unomodel.hxx                                  |    4 
 sd/source/ui/inc/vectdlg.hxx                                   |    4 
 sd/source/ui/sidebar/PageMarginUtils.hxx                       |   56 ++---
 sd/source/ui/sidebar/SlideBackground.cxx                       |    4 
 sd/source/ui/sidebar/SlideBackground.hxx                       |   14 -
 sd/source/ui/slideshow/slideshowimpl.hxx                       |    4 
 sd/source/ui/slideshow/slideshowviewimpl.cxx                   |    4 
 sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx    |   12 -
 sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx        |    6 
 sd/source/ui/slidesorter/view/SlideSorterView.cxx              |    8 
 sd/source/ui/slidesorter/view/SlsFramePainter.cxx              |    8 
 sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx |    4 
 sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx         |    4 
 sd/source/ui/tools/PreviewRenderer.cxx                         |    2 
 sd/source/ui/unoidl/unomodel.cxx                               |   10 
 sd/source/ui/unoidl/unopage.cxx                                |    4 
 sd/source/ui/view/DocumentRenderer.cxx                         |   16 -
 sd/source/ui/view/ViewShellBase.cxx                            |    6 
 sd/source/ui/view/drtxtob.cxx                                  |    4 
 sd/source/ui/view/drtxtob1.cxx                                 |   10 
 sd/source/ui/view/drviews1.cxx                                 |   10 
 sd/source/ui/view/drviews2.cxx                                 |    2 
 sd/source/ui/view/drviews3.cxx                                 |   18 -
 sd/source/ui/view/drviews4.cxx                                 |   22 +-
 sd/source/ui/view/drviews7.cxx                                 |    8 
 sd/source/ui/view/drviews9.cxx                                 |   40 +--
 sd/source/ui/view/drviewsa.cxx                                 |   36 +--
 sd/source/ui/view/drviewse.cxx                                 |   12 -
 sd/source/ui/view/drviewsh.cxx                                 |   16 -
 sd/source/ui/view/drviewsj.cxx                                 |    6 
 sd/source/ui/view/outlnvs2.cxx                                 |    2 
 sd/source/ui/view/outlnvsh.cxx                                 |   30 +-
 sd/source/ui/view/outlview.cxx                                 |   10 
 sd/source/ui/view/sdruler.cxx                                  |    2 
 sd/source/ui/view/sdview3.cxx                                  |    6 
 sd/source/ui/view/sdwindow.cxx                                 |   48 ++--
 sd/source/ui/view/viewoverlaymanager.cxx                       |    8 
 sd/source/ui/view/viewshe2.cxx                                 |   44 ++--
 sd/source/ui/view/viewshel.cxx                                 |   18 -
 103 files changed, 642 insertions(+), 638 deletions(-)

New commits:
commit 0d79d216886a71436e705c93829ed66a33270a9c
Author:     Noel <noelgrandin at gmail.com>
AuthorDate: Wed Oct 21 15:31:38 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Oct 23 08:48:52 2020 +0200

    long->tools::Long in pyuno..sd
    
    Change-Id: I67c1218d225f49ea9ce789433283ab85275e39a5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104627
    Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/pyuno/source/module/pyuno.cxx b/pyuno/source/module/pyuno.cxx
index 25aea6436032..527bcdbf76b5 100644
--- a/pyuno/source/module/pyuno.cxx
+++ b/pyuno/source/module/pyuno.cxx
@@ -24,6 +24,7 @@
 
 #include <rtl/strbuf.hxx>
 #include <rtl/ustrbuf.hxx>
+#include <tools/long.hxx>
 
 #include <typelib/typedescription.hxx>
 
@@ -318,7 +319,7 @@ static sal_Int32 lcl_PyNumber_AsSal_Int32( PyObject *pObj )
     // Convert Python number to platform long, then check actual value against
     // bounds of sal_Int32
     int nOverflow;
-    long nResult = PyLong_AsLongAndOverflow( pObj, &nOverflow );
+    tools::Long nResult = PyLong_AsLongAndOverflow( pObj, &nOverflow );
     if ( nOverflow || nResult > SAL_MAX_INT32 || nResult < SAL_MIN_INT32) {
         PyErr_SetString( PyExc_IndexError, "Python int too large to convert to UNO long" );
         return -1;
diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx b/reportdesign/source/ui/dlg/GroupsSorting.cxx
index 4b6777e83ef2..25b8cdd68b7d 100644
--- a/reportdesign/source/ui/dlg/GroupsSorting.cxx
+++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx
@@ -133,18 +133,18 @@ public:
     */
     void moveGroups(const uno::Sequence<uno::Any>& _aGroups,sal_Int32 _nRow,bool _bSelect = true);
 
-    virtual bool CursorMoving(long nNewRow, sal_uInt16 nNewCol) override;
+    virtual bool CursorMoving(tools::Long nNewRow, sal_uInt16 nNewCol) override;
     using ::svt::EditBrowseBox::GetRowCount;
 protected:
     virtual bool IsTabAllowed(bool bForward) const override;
 
-    virtual void InitController( ::svt::CellControllerRef& rController, long nRow, sal_uInt16 nCol ) override;
-    virtual ::svt::CellController* GetController( long nRow, sal_uInt16 nCol ) override;
+    virtual void InitController( ::svt::CellControllerRef& rController, tools::Long nRow, sal_uInt16 nCol ) override;
+    virtual ::svt::CellController* GetController( tools::Long nRow, sal_uInt16 nCol ) override;
     virtual void PaintCell( OutputDevice& rDev, const tools::Rectangle& rRect, sal_uInt16 nColId ) const override;
-    virtual bool SeekRow( long nRow ) override;
+    virtual bool SeekRow( tools::Long nRow ) override;
     virtual bool SaveModified() override;
-    virtual OUString GetCellText( long nRow, sal_uInt16 nColId ) const override;
-    virtual RowStatus GetRowStatus(long nRow) const override;
+    virtual OUString GetCellText( tools::Long nRow, sal_uInt16 nColId ) const override;
+    virtual RowStatus GetRowStatus(tools::Long nRow) const override;
 
     virtual void KeyInput(const KeyEvent& rEvt) override;
     virtual void Command( const CommandEvent& rEvt ) override;
@@ -224,7 +224,7 @@ uno::Sequence<uno::Any> OFieldExpressionControl::fillSelectedGroups()
     sal_Int32 nCount = xGroups->getCount();
     if ( nCount >= 1 )
     {
-        for( long nIndex=FirstSelectedRow(); nIndex != SFX_ENDOFSELECTION; nIndex=NextSelectedRow() )
+        for( tools::Long nIndex=FirstSelectedRow(); nIndex != SFX_ENDOFSELECTION; nIndex=NextSelectedRow() )
         {
             try
             {
@@ -483,7 +483,7 @@ bool OFieldExpressionControl::SaveModified()
     return true;
 }
 
-OUString OFieldExpressionControl::GetCellText( long nRow, sal_uInt16 /*nColId*/ ) const
+OUString OFieldExpressionControl::GetCellText( tools::Long nRow, sal_uInt16 /*nColId*/ ) const
 {
     OUString sText;
     if ( nRow != BROWSER_ENDOFSELECTION && m_aGroupPositions[nRow] != NO_GROUP )
@@ -507,19 +507,19 @@ OUString OFieldExpressionControl::GetCellText( long nRow, sal_uInt16 /*nColId*/
     return sText;
 }
 
-void OFieldExpressionControl::InitController( CellControllerRef& /*rController*/, long nRow, sal_uInt16 nColumnId )
+void OFieldExpressionControl::InitController( CellControllerRef& /*rController*/, tools::Long nRow, sal_uInt16 nColumnId )
 {
     weld::ComboBox& rComboBox = m_pComboCell->get_widget();
     rComboBox.set_entry_text(GetCellText(nRow, nColumnId));
 }
 
-bool OFieldExpressionControl::CursorMoving(long nNewRow, sal_uInt16 nNewCol)
+bool OFieldExpressionControl::CursorMoving(tools::Long nNewRow, sal_uInt16 nNewCol)
 {
 
     if (!EditBrowseBox::CursorMoving(nNewRow, nNewCol))
         return false;
     m_nDataPos = nNewRow;
-    long nOldDataPos = GetCurRow();
+    tools::Long nOldDataPos = GetCurRow();
     InvalidateStatusCell( m_nDataPos );
     InvalidateStatusCell( nOldDataPos );
 
@@ -528,14 +528,14 @@ bool OFieldExpressionControl::CursorMoving(long nNewRow, sal_uInt16 nNewCol)
     return true;
 }
 
-CellController* OFieldExpressionControl::GetController( long /*nRow*/, sal_uInt16 /*nColumnId*/ )
+CellController* OFieldExpressionControl::GetController( tools::Long /*nRow*/, sal_uInt16 /*nColumnId*/ )
 {
     ComboBoxCellController* pCellController = new ComboBoxCellController( m_pComboCell );
     pCellController->GetComboBox().set_entry_editable(m_pParent->m_pController->isEditable());
     return pCellController;
 }
 
-bool OFieldExpressionControl::SeekRow( long _nRow )
+bool OFieldExpressionControl::SeekRow( tools::Long _nRow )
 {
     // the basis class needs the call, because that's how the class knows which line will be painted
     EditBrowseBox::SeekRow(_nRow);
@@ -560,11 +560,11 @@ void OFieldExpressionControl::PaintCell( OutputDevice& rDev, const tools::Rectan
         rDev.SetClipRegion();
 }
 
-EditBrowseBox::RowStatus OFieldExpressionControl::GetRowStatus(long nRow) const
+EditBrowseBox::RowStatus OFieldExpressionControl::GetRowStatus(tools::Long nRow) const
 {
     if (nRow >= 0 && nRow == m_nDataPos)
         return EditBrowseBox::CURRENT;
-    if ( nRow != BROWSER_ENDOFSELECTION && nRow < static_cast<long>(m_aGroupPositions.size()) && m_aGroupPositions[nRow] != NO_GROUP )
+    if ( nRow != BROWSER_ENDOFSELECTION && nRow < static_cast<tools::Long>(m_aGroupPositions.size()) && m_aGroupPositions[nRow] != NO_GROUP )
     {
         try
         {
@@ -682,7 +682,7 @@ void OFieldExpressionControl::Command(const CommandEvent& rEvt)
             if ( nColId == HANDLE_ID )
             {
                 bool bEnable = false;
-                long nIndex = FirstSelectedRow();
+                tools::Long nIndex = FirstSelectedRow();
                 while( nIndex != SFX_ENDOFSELECTION && !bEnable )
                 {
                     if ( m_aGroupPositions[nIndex] != NO_GROUP )
@@ -715,14 +715,14 @@ void OFieldExpressionControl::DeleteRows()
     {
         DeactivateCell();
     }
-    long nIndex = FirstSelectedRow();
+    tools::Long nIndex = FirstSelectedRow();
     if (nIndex == SFX_ENDOFSELECTION)
     {
         nIndex = GetCurRow();
     }
     bool bFirstTime = true;
 
-    long nOldDataPos = nIndex;
+    tools::Long nOldDataPos = nIndex;
     uno::Sequence< beans::PropertyValue > aArgs(1);
     aArgs[0].Name = PROPERTY_GROUP;
     m_bIgnoreEvent = true;
@@ -844,7 +844,7 @@ OGroupsSortingDialog::~OGroupsSortingDialog()
 void OGroupsSortingDialog::UpdateData( )
 {
     m_xFieldExpression->Invalidate();
-    long nCurRow = m_xFieldExpression->GetCurRow();
+    tools::Long nCurRow = m_xFieldExpression->GetCurRow();
     m_xFieldExpression->DeactivateCell();
     m_xFieldExpression->ActivateCell(nCurRow, m_xFieldExpression->GetCurColumnId());
     DisplayData(nCurRow);
@@ -973,7 +973,7 @@ IMPL_LINK(OGroupsSortingDialog, OnFormatAction, const OString&, rCommand, void)
     if ( !m_xFieldExpression )
         return;
 
-    long nIndex = m_xFieldExpression->GetCurrRow();
+    tools::Long nIndex = m_xFieldExpression->GetCurrRow();
     sal_Int32 nGroupPos = m_xFieldExpression->getGroupPosition(nIndex);
     uno::Sequence<uno::Any> aClipboardList;
     if ( nIndex >= 0 && nGroupPos != NO_GROUP )
diff --git a/reportdesign/source/ui/inc/SectionWindow.hxx b/reportdesign/source/ui/inc/SectionWindow.hxx
index 2ef3e8b17006..a202b0a19315 100644
--- a/reportdesign/source/ui/inc/SectionWindow.hxx
+++ b/reportdesign/source/ui/inc/SectionWindow.hxx
@@ -122,7 +122,7 @@ namespace rptui
         */
         void zoom(const Fraction& _aZoom);
 
-        void scrollChildren(long _nThumbPosX);
+        void scrollChildren(tools::Long _nThumbPosX);
     };
 
 } // rptui
diff --git a/reportdesign/source/ui/report/DesignView.cxx b/reportdesign/source/ui/report/DesignView.cxx
index 6332f8b49f48..dc85e34acd2d 100644
--- a/reportdesign/source/ui/report/DesignView.cxx
+++ b/reportdesign/source/ui/report/DesignView.cxx
@@ -223,7 +223,7 @@ void ODesignView::resizeDocumentView(tools::Rectangle& _rPlayground)
                 ||  ( nSplitPos >= aPlaygroundSize.Width() )
                 )
             {
-                long nMinWidth = static_cast<long>(0.1*aPlaygroundSize.Width());
+                tools::Long nMinWidth = static_cast<tools::Long>(0.1*aPlaygroundSize.Width());
                 if ( m_pPropWin && m_pPropWin->IsVisible() )
                     nMinWidth = m_pPropWin->GetMinOutputSizePixel().Width();
                 nSplitPos = static_cast<sal_Int32>(_rPlayground.Right() - nMinWidth);
@@ -234,7 +234,7 @@ void ODesignView::resizeDocumentView(tools::Rectangle& _rPlayground)
         if ( m_aSplitWin->IsItemValid(TASKPANE_ID) )
         {
             // normalize the split pos
-            const long nSplitterWidth = StyleSettings::GetSplitSize();
+            const tools::Long nSplitterWidth = StyleSettings::GetSplitSize();
             Point aTaskPanePos(nSplitPos + nSplitterWidth, _rPlayground.Top());
             if (m_pTaskPane && m_pTaskPane->IsVisible() && m_pPropWin)
             {
@@ -247,7 +247,7 @@ void ODesignView::resizeDocumentView(tools::Rectangle& _rPlayground)
                 nSplitPos = aTaskPanePos.X() - nSplitterWidth;
                 getController().setSplitPos(nSplitPos);
 
-                const long nTaskPaneSize = static_cast<long>((aPlaygroundSize.Width() - aTaskPanePos.X())*100/aPlaygroundSize.Width());
+                const tools::Long nTaskPaneSize = static_cast<tools::Long>((aPlaygroundSize.Width() - aTaskPanePos.X())*100/aPlaygroundSize.Width());
                 if ( m_aSplitWin->GetItemSize( TASKPANE_ID ) != nTaskPaneSize )
                 {
                     m_aSplitWin->SetItemSize( REPORT_ID, 99 - nTaskPaneSize );
@@ -399,8 +399,8 @@ void ODesignView::ImplInitSettings()
 IMPL_LINK_NOARG( ODesignView, SplitHdl, SplitWindow*, void )
 {
     const Size aOutputSize = GetOutputSizePixel();
-    const long nTest = aOutputSize.Width() * m_aSplitWin->GetItemSize(TASKPANE_ID) / 100;
-    long nMinWidth = static_cast<long>(0.1*aOutputSize.Width());
+    const tools::Long nTest = aOutputSize.Width() * m_aSplitWin->GetItemSize(TASKPANE_ID) / 100;
+    tools::Long nMinWidth = static_cast<tools::Long>(0.1*aOutputSize.Width());
     if ( m_pPropWin && m_pPropWin->IsVisible() )
         nMinWidth = m_pPropWin->GetMinOutputSizePixel().Width();
 
diff --git a/reportdesign/source/ui/report/EndMarker.cxx b/reportdesign/source/ui/report/EndMarker.cxx
index 4dd537fae143..ae79c968f12c 100644
--- a/reportdesign/source/ui/report/EndMarker.cxx
+++ b/reportdesign/source/ui/report/EndMarker.cxx
@@ -44,9 +44,9 @@ OEndMarker::~OEndMarker()
 
 void OEndMarker::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& /*rRect*/)
 {
-    Fraction aCornerSpace(long(CORNER_SPACE));
+    Fraction aCornerSpace(tools::Long(CORNER_SPACE));
     aCornerSpace *= rRenderContext.GetMapMode().GetScaleX();
-    const long nCornerSpace = long(aCornerSpace);
+    const tools::Long nCornerSpace = tools::Long(aCornerSpace);
 
     Size aSize = GetSizePixel();
     aSize.AdjustWidth(nCornerSpace );
diff --git a/reportdesign/source/ui/report/ReportWindow.cxx b/reportdesign/source/ui/report/ReportWindow.cxx
index b0b6197015d7..e6bd5325b2df 100644
--- a/reportdesign/source/ui/report/ReportWindow.cxx
+++ b/reportdesign/source/ui/report/ReportWindow.cxx
@@ -135,9 +135,9 @@ void OReportWindow::showRuler(bool _bShow)
 
 sal_Int32 OReportWindow::getMaxMarkerWidth() const
 {
-    Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH));
+    Fraction aStartWidth(tools::Long(REPORT_STARTMARKER_WIDTH));
     aStartWidth *= m_aViewsWindow->GetMapMode().GetScaleX();
-    return sal_Int32(static_cast<long>(aStartWidth));
+    return sal_Int32(static_cast<tools::Long>(aStartWidth));
 }
 
 sal_Int32 OReportWindow::GetTotalWidth() const
@@ -145,13 +145,13 @@ sal_Int32 OReportWindow::GetTotalWidth() const
     sal_Int32 nWidth = 0;
     if ( !m_aViewsWindow->empty() )
     {
-        Fraction aStartWidth(long(REPORT_ENDMARKER_WIDTH + REPORT_STARTMARKER_WIDTH ));
+        Fraction aStartWidth(tools::Long(REPORT_ENDMARKER_WIDTH + REPORT_STARTMARKER_WIDTH ));
         const Fraction aZoom(m_pView->getController().getZoomValue(),100);
         aStartWidth *= aZoom;
         sal_Int32 nPaperWidth = getStyleProperty<awt::Size>(m_pView->getController().getReportDefinition(),PROPERTY_PAPERSIZE).Width;
-        nPaperWidth = long(nPaperWidth * aZoom);
+        nPaperWidth = tools::Long(nPaperWidth * aZoom);
         const Size aPageSize = LogicToPixel(Size(nPaperWidth,0));
-        nWidth = aPageSize.Width() + long(aStartWidth);
+        nWidth = aPageSize.Width() + tools::Long(aStartWidth);
     }
     return nWidth;
 }
@@ -163,10 +163,10 @@ void OReportWindow::Resize()
         return;
 
     const Size aTotalOutputSize = GetOutputSizePixel();
-    Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH)*m_pView->getController().getZoomValue(),100);
+    Fraction aStartWidth(tools::Long(REPORT_STARTMARKER_WIDTH)*m_pView->getController().getZoomValue(),100);
 
     const Point aOffset = LogicToPixel(Point(SECTION_OFFSET, 0), MapMode(MapUnit::MapAppFont));
-    Point aStartPoint(static_cast<long>(aStartWidth) + aOffset.X(),0);
+    Point aStartPoint(static_cast<tools::Long>(aStartWidth) + aOffset.X(),0);
     uno::Reference<report::XReportDefinition> xReportDefinition = getReportView()->getController().getReportDefinition();
     const sal_Int32 nPaperWidth = getStyleProperty<awt::Size>(xReportDefinition,PROPERTY_PAPERSIZE).Width;
     sal_Int32 nLeftMargin = getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_LEFTMARGIN);
@@ -177,8 +177,8 @@ void OReportWindow::Resize()
 
     aPageSize.setHeight( m_aHRuler->GetSizePixel().Height() );
 
-    const long nTermp(m_aViewsWindow->getTotalHeight() + aPageSize.Height());
-    long nSectionsHeight = ::std::max<long>(nTermp,aTotalOutputSize.Height());
+    const tools::Long nTermp(m_aViewsWindow->getTotalHeight() + aPageSize.Height());
+    tools::Long nSectionsHeight = ::std::max<long>(nTermp,aTotalOutputSize.Height());
 
     m_aHRuler->SetPosSizePixel(aStartPoint,aPageSize);
     m_aHRuler->SetNullOffset(nLeftMargin);
@@ -404,14 +404,14 @@ sal_uInt16 OReportWindow::getZoomFactor(SvxZoomType _eType) const
             break;
         case SvxZoomType::WHOLEPAGE:
             {
-                nZoom = static_cast<sal_uInt16>(static_cast<long>(Fraction(aSize.Width()*100,impl_getRealPixelWidth())));
+                nZoom = static_cast<sal_uInt16>(static_cast<tools::Long>(Fraction(aSize.Width()*100,impl_getRealPixelWidth())));
                 MapMode aMap( MapUnit::Map100thMM );
                 const Size aHeight = m_aViewsWindow->LogicToPixel(m_aViewsWindow->PixelToLogic(Size(0,GetTotalHeight() + m_aHRuler->GetSizePixel().Height())),aMap);
-                nZoom = ::std::min(nZoom,static_cast<sal_uInt16>(static_cast<long>(Fraction(aSize.Height()*100,aHeight.Height()))));
+                nZoom = ::std::min(nZoom,static_cast<sal_uInt16>(static_cast<tools::Long>(Fraction(aSize.Height()*100,aHeight.Height()))));
             }
             break;
         case SvxZoomType::PAGEWIDTH:
-            nZoom = static_cast<sal_uInt16>(static_cast<long>(Fraction(aSize.Width()*100,impl_getRealPixelWidth())));
+            nZoom = static_cast<sal_uInt16>(static_cast<tools::Long>(Fraction(aSize.Width()*100,impl_getRealPixelWidth())));
             break;
         default:
             break;
diff --git a/reportdesign/source/ui/report/ScrollHelper.cxx b/reportdesign/source/ui/report/ScrollHelper.cxx
index 0f64f0ac1b8d..a7a8fda02ad3 100644
--- a/reportdesign/source/ui/report/ScrollHelper.cxx
+++ b/reportdesign/source/ui/report/ScrollHelper.cxx
@@ -110,7 +110,7 @@ void OScrollWindowHelper::setTotalSize(sal_Int32 _nWidth ,sal_Int32 _nHeight)
 
     // now set the ranges without start marker
     Fraction aStartWidth(REPORT_STARTMARKER_WIDTH * m_pParent->getController().getZoomValue(),100);
-    long nWidth = long(_nWidth - static_cast<double>(aStartWidth));
+    tools::Long nWidth = tools::Long(_nWidth - static_cast<double>(aStartWidth));
     m_aHScroll->SetRangeMax( nWidth );
     m_aVScroll->SetRangeMax( m_aTotalPixelSize.Height() );
 
@@ -126,7 +126,7 @@ Size OScrollWindowHelper::ResizeScrollBars()
 
     aOutPixSz.AdjustHeight( -(m_aReportWindow->getRulerHeight()) );
     // determine the size of the output-area and if we need scrollbars
-    const long nScrSize = GetSettings().GetStyleSettings().GetScrollBarSize();
+    const tools::Long nScrSize = GetSettings().GetStyleSettings().GetScrollBarSize();
     bool bVVisible = false; // by default no vertical-ScrollBar
     bool bHVisible = false; // by default no horizontal-ScrollBar
     bool bChanged;          // determines if a visiblility was changed
@@ -171,9 +171,9 @@ Size OScrollWindowHelper::ResizeScrollBars()
     const Point aOffset = LogicToPixel(Point(SECTION_OFFSET, SECTION_OFFSET), MapMode(MapUnit::MapAppFont));
     // resize scrollbars and set their ranges
     {
-        Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH*m_pParent->getController().getZoomValue()),100);
-        const sal_Int32 nNewWidth = aOutPixSz.Width() - aOffset.X() - static_cast<long>(aStartWidth);
-        lcl_setScrollBar(nNewWidth,Point( static_cast<long>(aStartWidth) + aOffset.X(), aOutPixSz.Height() ), Size( nNewWidth, nScrSize ), *m_aHScroll);
+        Fraction aStartWidth(tools::Long(REPORT_STARTMARKER_WIDTH*m_pParent->getController().getZoomValue()),100);
+        const sal_Int32 nNewWidth = aOutPixSz.Width() - aOffset.X() - static_cast<tools::Long>(aStartWidth);
+        lcl_setScrollBar(nNewWidth,Point( static_cast<tools::Long>(aStartWidth) + aOffset.X(), aOutPixSz.Height() ), Size( nNewWidth, nScrSize ), *m_aHScroll);
     }
     {
         const sal_Int32 nNewHeight = aOutPixSz.Height() - m_aReportWindow->getRulerHeight();
diff --git a/reportdesign/source/ui/report/SectionWindow.cxx b/reportdesign/source/ui/report/SectionWindow.cxx
index 627490e62f53..8d05c77f4c00 100644
--- a/reportdesign/source/ui/report/SectionWindow.cxx
+++ b/reportdesign/source/ui/report/SectionWindow.cxx
@@ -227,7 +227,7 @@ void OSectionWindow::Resize()
     Window::Resize();
 
     Size aOutputSize = GetOutputSizePixel();
-    long nEndWidth = long(REPORT_ENDMARKER_WIDTH * GetMapMode().GetScaleX());
+    tools::Long nEndWidth = tools::Long(REPORT_ENDMARKER_WIDTH * GetMapMode().GetScaleX());
 
     const Point aThumbPos = m_pParent->getView()->getThumbPos();
     aOutputSize.AdjustWidth( -(aThumbPos.X()) );
@@ -242,7 +242,7 @@ void OSectionWindow::Resize()
     {
         const bool bShowEndMarker = m_pParent->getView()->GetTotalWidth() <= (aThumbPos.X() +  aOutputSize.Width() );
 
-        long nStartWidth = long(REPORT_STARTMARKER_WIDTH * GetMapMode().GetScaleX());
+        tools::Long nStartWidth = tools::Long(REPORT_STARTMARKER_WIDTH * GetMapMode().GetScaleX());
 
         // set start marker
         m_aStartMarker->SetPosSizePixel(Point(0,0),Size(nStartWidth,aOutputSize.Height()));
@@ -260,7 +260,7 @@ void OSectionWindow::Resize()
         // set splitter
         aReportPos.AdjustY(aSectionSize.Height() );
         m_aSplitter->SetPosSizePixel(aReportPos,Size(aSectionSize.Width(),m_aSplitter->GetSizePixel().Height()));
-        aSectionSize.setHeight( static_cast<long>(1000 * static_cast<double>(GetMapMode().GetScaleY())) );
+        aSectionSize.setHeight( static_cast<tools::Long>(1000 * static_cast<double>(GetMapMode().GetScaleY())) );
         m_aSplitter->SetDragRectPixel( tools::Rectangle(Point(nStartWidth,0),aSectionSize));
 
         // set end marker
@@ -357,14 +357,14 @@ static void lcl_scroll(vcl::Window& _rWindow,const Point& _aDelta)
     _rWindow.Invalidate(InvalidateFlags::Transparent);
 }
 
-static void lcl_setOrigin(vcl::Window& _rWindow,long _nX, long _nY)
+static void lcl_setOrigin(vcl::Window& _rWindow,tools::Long _nX, tools::Long _nY)
 {
     MapMode aMap = _rWindow.GetMapMode();
     aMap.SetOrigin( Point(- _nX, - _nY));
     _rWindow.SetMapMode( aMap );
 }
 
-void OSectionWindow::scrollChildren(long _nX)
+void OSectionWindow::scrollChildren(tools::Long _nX)
 {
     const Point aDelta( _nX,0 );
 
diff --git a/reportdesign/source/ui/report/StartMarker.cxx b/reportdesign/source/ui/report/StartMarker.cxx
index 09a118f41a97..fdc6ccbc4a63 100644
--- a/reportdesign/source/ui/report/StartMarker.cxx
+++ b/reportdesign/source/ui/report/StartMarker.cxx
@@ -99,15 +99,15 @@ void OStartMarker::dispose()
 
 sal_Int32 OStartMarker::getMinHeight() const
 {
-    Fraction aExtraWidth(long(2 * REPORT_EXTRA_SPACE));
+    Fraction aExtraWidth(tools::Long(2 * REPORT_EXTRA_SPACE));
     aExtraWidth *= GetMapMode().GetScaleX();
-    return LogicToPixel(Size(0, m_aText->GetTextHeight())).Height() + long(aExtraWidth);
+    return LogicToPixel(Size(0, m_aText->GetTextHeight())).Height() + tools::Long(aExtraWidth);
 }
 
 void OStartMarker::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& /*rRect*/)
 {
     Size aSize(GetOutputSizePixel());
-    const long nCornerWidth = long(CORNER_SPACE * double(GetMapMode().GetScaleX()));
+    const tools::Long nCornerWidth = tools::Long(CORNER_SPACE * double(GetMapMode().GetScaleX()));
 
     if (isCollapsed())
     {
@@ -115,8 +115,8 @@ void OStartMarker::Paint(vcl::RenderContext& rRenderContext, const tools::Rectan
     }
     else
     {
-        const long nVRulerWidth = m_aVRuler->GetSizePixel().Width();
-        long nSize = aSize.Width() - nVRulerWidth;
+        const tools::Long nVRulerWidth = m_aVRuler->GetSizePixel().Width();
+        tools::Long nSize = aSize.Width() - nVRulerWidth;
         aSize.AdjustWidth(nCornerWidth );
         rRenderContext.SetClipRegion(vcl::Region(rRenderContext.PixelToLogic(tools::Rectangle(Point(),
                                                                              Size(nSize, aSize.Height())))));
@@ -143,7 +143,7 @@ void OStartMarker::Paint(vcl::RenderContext& rRenderContext, const tools::Rectan
     }
     if (m_bMarked)
     {
-        const long nCornerHeight = long(CORNER_SPACE * double(GetMapMode().GetScaleY()));
+        const tools::Long nCornerHeight = tools::Long(CORNER_SPACE * double(GetMapMode().GetScaleY()));
         tools::Rectangle aRect(Point(nCornerWidth, nCornerHeight),
                         Size(aSize.Width() - nCornerWidth - nCornerWidth,
                              aSize.Height() - nCornerHeight - nCornerHeight));
@@ -224,22 +224,22 @@ void OStartMarker::ImplInitSettings()
 void OStartMarker::Resize()
 {
     const Size aOutputSize( GetOutputSizePixel() );
-    const long nOutputWidth  = aOutputSize.Width();
-    const long nOutputHeight = aOutputSize.Height();
+    const tools::Long nOutputWidth  = aOutputSize.Width();
+    const tools::Long nOutputHeight = aOutputSize.Height();
 
-    const long nVRulerWidth = m_aVRuler->GetSizePixel().Width();
+    const tools::Long nVRulerWidth = m_aVRuler->GetSizePixel().Width();
     const Point aRulerPos(nOutputWidth - nVRulerWidth,0);
     m_aVRuler->SetPosSizePixel(aRulerPos,Size(nVRulerWidth,nOutputHeight));
 
     Size aImageSize = m_aImage->GetImage().GetSizePixel();
     const MapMode& rMapMode = GetMapMode();
-    aImageSize.setWidth( long(aImageSize.Width() * static_cast<double>(rMapMode.GetScaleX())) );
-    aImageSize.setHeight( long(aImageSize.Height() * static_cast<double>(rMapMode.GetScaleY())) );
+    aImageSize.setWidth( tools::Long(aImageSize.Width() * static_cast<double>(rMapMode.GetScaleX())) );
+    aImageSize.setHeight( tools::Long(aImageSize.Height() * static_cast<double>(rMapMode.GetScaleY())) );
 
-    long nExtraWidth = long(REPORT_EXTRA_SPACE * rMapMode.GetScaleX());
+    tools::Long nExtraWidth = tools::Long(REPORT_EXTRA_SPACE * rMapMode.GetScaleX());
 
     Point aPos(aImageSize.Width() + (nExtraWidth * 2), nExtraWidth);
-    const long nHeight = ::std::max<sal_Int32>(nOutputHeight - 2*aPos.Y(),LogicToPixel(Size(0,m_aText->GetTextHeight())).Height());
+    const tools::Long nHeight = ::std::max<sal_Int32>(nOutputHeight - 2*aPos.Y(),LogicToPixel(Size(0,m_aText->GetTextHeight())).Height());
     m_aText->SetPosSizePixel(aPos,Size(aRulerPos.X() - aPos.X(),nHeight));
 
     aPos.setX( nExtraWidth );
diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx
index 51204671ba5f..db2b44b6d731 100644
--- a/reportdesign/source/ui/report/ViewsWindow.cxx
+++ b/reportdesign/source/ui/report/ViewsWindow.cxx
@@ -52,7 +52,7 @@ namespace rptui
 using namespace ::com::sun::star;
 using namespace ::comphelper;
 
-static bool lcl_getNewRectSize(const tools::Rectangle& _aObjRect,long& _nXMov, long& _nYMov,SdrObject const * _pObj,SdrView const * _pView, ControlModification _nControlModification)
+static bool lcl_getNewRectSize(const tools::Rectangle& _aObjRect,tools::Long& _nXMov, tools::Long& _nYMov,SdrObject const * _pObj,SdrView const * _pView, ControlModification _nControlModification)
 {
     bool bMoveAllowed = _nXMov != 0 || _nYMov != 0;
     if ( bMoveAllowed )
@@ -202,7 +202,7 @@ void OViewsWindow::impl_resizeSectionWindow(OSectionWindow& _rSectionWindow,Poin
     {
         aSectionSize.setHeight( nMinHeight );
     }
-    aSectionSize.AdjustHeight(static_cast<long>(StyleSettings::GetSplitSize() * static_cast<double>(_rSectionWindow.GetMapMode().GetScaleY())) );
+    aSectionSize.AdjustHeight(static_cast<tools::Long>(StyleSettings::GetSplitSize() * static_cast<double>(_rSectionWindow.GetMapMode().GetScaleY())) );
 
     if ( _bSet )
         _rSectionWindow.SetPosSizePixel(_rStartPoint,aSectionSize);
@@ -257,7 +257,7 @@ void OViewsWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Rectan
     rRenderContext.SetTextFillColor(Application::GetSettings().GetStyleSettings().GetDialogColor());
 
     Size aOut(GetOutputSizePixel());
-    long nStartWidth = long(REPORT_STARTMARKER_WIDTH * rRenderContext.GetMapMode().GetScaleX());
+    tools::Long nStartWidth = tools::Long(REPORT_STARTMARKER_WIDTH * rRenderContext.GetMapMode().GetScaleX());
 
     aOut.AdjustWidth( -nStartWidth );
     aOut = rRenderContext.PixelToLogic(aOut);
@@ -755,9 +755,9 @@ void OViewsWindow::alignMarkedObjects(ControlModification _nControlModification,
         pObj->TakeObjInfo(aInfo);
         if (aInfo.bMoveAllowed && !pObj->IsMoveProtect())
         {
-            long nXMov = 0;
-            long nYMov = 0;
-            long* pValue = &nXMov;
+            tools::Long nXMov = 0;
+            tools::Long nYMov = 0;
+            tools::Long* pValue = &nXMov;
             switch(_nControlModification)
             {
                 case ControlModification::TOP   :
@@ -983,7 +983,7 @@ void OViewsWindow::BegDragObj_createInvisibleObjectAtPosition(const tools::Recta
 
             rView.MarkObj( pNewObj, rView.GetSdrPageView() );
         }
-        const long nSectionHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height();
+        const tools::Long nSectionHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height();
         aNewPos.AdjustY( -nSectionHeight );
     }
 }
@@ -1003,7 +1003,7 @@ void OViewsWindow::BegDragObj(const Point& _aPnt, SdrHdl* _pHdl,const OSectionVi
         OSectionView* pView = &rReportSection.getSectionView();
         if (pView == _pSection)
             break;
-        const long nSectionHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height();
+        const tools::Long nSectionHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height();
         aAbsolutePnt.AdjustY(nSectionHeight );
     }
     m_aDragDelta = Point(SAL_MAX_INT32, SAL_MAX_INT32);
@@ -1054,7 +1054,7 @@ void OViewsWindow::BegDragObj(const Point& _aPnt, SdrHdl* _pHdl,const OSectionVi
         aClipRect.SetTop( -aNewObjPos.Y() );
         rView.SetWorkArea( aClipRect );
 
-        const long nSectionHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height();
+        const tools::Long nSectionHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height();
         aNewObjPos.AdjustY(nSectionHeight );
     }
 
@@ -1086,7 +1086,7 @@ void OViewsWindow::BegDragObj(const Point& _aPnt, SdrHdl* _pHdl,const OSectionVi
                 << nViewCount++);
         rReportSection.getSectionView().BegDragObj(aNewPos, nullptr, pHdl, nDrgLog);
 
-        const long nSectionHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height();
+        const tools::Long nSectionHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height();
         aNewPos.AdjustY( -nSectionHeight );
     }
 }
@@ -1102,7 +1102,7 @@ void OViewsWindow::BegMarkObj(const Point& _aPnt,const OSectionView* _pSection)
     bool bAdd = true;
     Point aNewPos = _aPnt;
 
-    long nLastSectionHeight = 0;
+    tools::Long nLastSectionHeight = 0;
     for (const auto& rxSection : m_aSections)
     {
         OReportSection& rReportSection = rxSection->getReportSection();
@@ -1113,7 +1113,7 @@ void OViewsWindow::BegMarkObj(const Point& _aPnt,const OSectionView* _pSection)
         }
         else if ( bAdd )
         {
-            const long nSectionHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height();
+            const tools::Long nSectionHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height();
             aNewPos.AdjustY(nSectionHeight );
         }
         else
@@ -1156,7 +1156,7 @@ OSectionView* OViewsWindow::getSectionRelativeToPosition(const OSectionView* _pS
         for (; aIter != aEnd; ++aIter)
         {
             OReportSection& rReportSection = (*aIter)->getReportSection();
-            const long nHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height();
+            const tools::Long nHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height();
             if ( (_rPnt.Y() - nHeight) < 0  )
                 break;
             _rPnt.AdjustY( -nHeight );
@@ -1305,7 +1305,7 @@ void OViewsWindow::MovAction(const Point& _aPnt,const OSectionView* _pSection, b
         OReportSection& rReportSection = rxSection->getReportSection();
         if ( &rReportSection.getSectionView() == _pSection )
             break;
-        const long nSectionHeight = rxSection->PixelToLogic(rReportSection.GetOutputSizePixel()).Height();
+        const tools::Long nSectionHeight = rxSection->PixelToLogic(rReportSection.GetOutputSizePixel()).Height();
         aCurrentSectionPos.AdjustY(nSectionHeight );
     }
     aRealMousePos += aCurrentSectionPos;
@@ -1316,7 +1316,7 @@ void OViewsWindow::MovAction(const Point& _aPnt,const OSectionView* _pSection, b
     {
         OReportSection& rReportSection = rxSection->getReportSection();
         OSectionView& rView = rReportSection.getSectionView();
-        const long nSectionHeight = rxSection->PixelToLogic(rxSection->GetOutputSizePixel()).Height();
+        const tools::Long nSectionHeight = rxSection->PixelToLogic(rxSection->GetOutputSizePixel()).Height();
 
         if (_bControlKeySet)
         {
@@ -1342,7 +1342,7 @@ void OViewsWindow::MovAction(const Point& _aPnt,const OSectionView* _pSection, b
         if ( pCurrentHdl && aRealMousePos.Y() > 0 )
             aRealMousePos = _aPnt + pCurrentHdl->GetPos() - aHdlPos;
         rReportSection.getSectionView().MovAction ( aRealMousePos );
-        const long nSectionHeight = rxSection->PixelToLogic(rxSection->GetOutputSizePixel()).Height();
+        const tools::Long nSectionHeight = rxSection->PixelToLogic(rxSection->GetOutputSizePixel()).Height();
         aRealMousePos.AdjustY( -nSectionHeight );
     }
 }
@@ -1382,8 +1382,8 @@ void OViewsWindow::handleKey(const vcl::KeyCode& _rCode)
     for (const auto& rxSection : m_aSections)
     {
         OReportSection& rReportSection = rxSection->getReportSection();
-        long nX = 0;
-        long nY = 0;
+        tools::Long nX = 0;
+        tools::Long nY = 0;
 
         if ( nCode == KEY_UP )
             nY = -1;
@@ -1617,7 +1617,7 @@ void OViewsWindow::zoom(const Fraction& _aZoom)
 {
     const MapMode& aMapMode = GetMapMode();
 
-    Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH));
+    Fraction aStartWidth(tools::Long(REPORT_STARTMARKER_WIDTH));
     if ( _aZoom < aMapMode.GetScaleX() )
         aStartWidth *= aMapMode.GetScaleX();
     else
@@ -1633,7 +1633,7 @@ void OViewsWindow::zoom(const Fraction& _aZoom)
     Resize();
 
     Size aOut = GetOutputSizePixel();
-    aOut.setWidth( long(aStartWidth) );
+    aOut.setWidth( tools::Long(aStartWidth) );
     aOut = PixelToLogic(aOut);
 
     tools::Rectangle aRect(PixelToLogic(Point(0,0)),aOut);
diff --git a/reportdesign/source/ui/report/dlgedfunc.cxx b/reportdesign/source/ui/report/dlgedfunc.cxx
index 799d9e611155..4e653cb87930 100644
--- a/reportdesign/source/ui/report/dlgedfunc.cxx
+++ b/reportdesign/source/ui/report/dlgedfunc.cxx
@@ -70,10 +70,10 @@ void DlgEdFunc::ForceScroll( const Point& rPos )
     OScrollWindowHelper* pScrollWindow = pReportWindow->getScrollWindow();
 
     Size aOut = pReportWindow->GetOutputSizePixel();
-    Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH));
+    Fraction aStartWidth(tools::Long(REPORT_STARTMARKER_WIDTH));
     aStartWidth *= m_pParent->GetMapMode().GetScaleX();
 
-    aOut.AdjustWidth( -static_cast<long>(aStartWidth) );
+    aOut.AdjustWidth( -static_cast<tools::Long>(aStartWidth) );
     aOut.setHeight( m_pParent->GetOutputSizePixel().Height() );
 
     Point aPos = pScrollWindow->getThumbPos();
@@ -82,7 +82,7 @@ void DlgEdFunc::ForceScroll( const Point& rPos )
     tools::Rectangle aOutRect( aPos, aOut );
     aOutRect = m_pParent->PixelToLogic( aOutRect );
     tools::Rectangle aWorkArea(Point(), pScrollWindow->getTotalSize());
-    aWorkArea.AdjustRight( -static_cast<long>(aStartWidth) );
+    aWorkArea.AdjustRight( -static_cast<tools::Long>(aStartWidth) );
     aWorkArea = pScrollWindow->PixelToLogic( aWorkArea );
     if( !aOutRect.IsInside( rPos ) && aWorkArea.IsInside( rPos ) )
     {
@@ -573,8 +573,8 @@ bool DlgEdFunc::isRectangleHit(const MouseEvent& rMEvt)
                      && (dynamic_cast<OUnoObject*>(pObjIter) != nullptr || dynamic_cast<OOle2Obj*>(pObjIter) != nullptr) )
                 {
                     tools::Rectangle aNewRect = pObjIter->GetLastBoundRect();
-                    long nDx = rDragStat.IsHorFixed() ? 0 : rDragStat.GetDX();
-                    long nDy = rDragStat.IsVerFixed() ? 0 : rDragStat.GetDY();
+                    tools::Long nDx = rDragStat.IsHorFixed() ? 0 : rDragStat.GetDX();
+                    tools::Long nDy = rDragStat.IsVerFixed() ? 0 : rDragStat.GetDY();
                     if ( (nDx + aNewRect.Left()) < 0 )
                         nDx = -aNewRect.Left();
                     if ( (nDy + aNewRect.Top()) < 0 )
diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx
index cea2c41e9caf..4e43e332f1e7 100644
--- a/sax/source/tools/converter.cxx
+++ b/sax/source/tools/converter.cxx
@@ -30,6 +30,7 @@
 #include <rtl/math.hxx>
 #include <sal/log.hxx>
 #include <osl/diagnose.h>
+#include <tools/long.hxx>
 
 #include <algorithm>
 #include <string_view>
@@ -288,9 +289,9 @@ void Converter::convertMeasure( OUStringBuffer& rBuffer,
     }
 
     // The new length is (nVal * nMul)/(nDiv*nFac*10)
-    long nMul = 1000;
-    long nDiv = 1;
-    long nFac = 100;
+    tools::Long nMul = 1000;
+    tools::Long nDiv = 1;
+    tools::Long nFac = 100;
     const char* psUnit = nullptr;
     switch( nSourceUnit )
     {
diff --git a/sd/inc/CustomAnimationEffect.hxx b/sd/inc/CustomAnimationEffect.hxx
index a82642a8c178..e4af8b713aa5 100644
--- a/sd/inc/CustomAnimationEffect.hxx
+++ b/sd/inc/CustomAnimationEffect.hxx
@@ -26,6 +26,7 @@
 #include <com/sun/star/drawing/XShape.hpp>
 #include <com/sun/star/util/XChangesListener.hpp>
 #include <vcl/timer.hxx>
+#include <tools/long.hxx>
 #include "sddllapi.h"
 #include <list>
 #include <vector>
@@ -432,7 +433,7 @@ protected:
     bool mbTimerMode;
     bool mbRebuilding;
 
-    long mnRebuildLockGuard;
+    ::tools::Long mnRebuildLockGuard;
     bool mbPendingRebuildRequest;
     sal_Int32 mbIgnoreChanges;
 };
diff --git a/sd/inc/drawdoc.hxx b/sd/inc/drawdoc.hxx
index 12d905f732db..2d05e269ff58 100644
--- a/sd/inc/drawdoc.hxx
+++ b/sd/inc/drawdoc.hxx
@@ -198,10 +198,10 @@ public:
     // including PresObj's in higher derivations
     virtual void adaptSizeAndBorderForAllPages(
         const Size& rNewSize,
-        long nLeft = 0,
-        long nRight = 0,
-        long nUpper = 0,
-        long nLower = 0) override;
+        tools::Long nLeft = 0,
+        tools::Long nRight = 0,
+        tools::Long nUpper = 0,
+        tools::Long nLower = 0) override;
 
     // Adapt PageSize for all Pages of PageKind ePageKind. Also
     // set Borders to left/right/upper/lower, ScaleAll, Orientation,
@@ -211,10 +211,10 @@ public:
         const Size& rNewSize,
         PageKind ePageKind,
         SdUndoGroup* pUndoGroup = nullptr,
-        long nLeft = 0,
-        long nRight = 0,
-        long nUpper = 0,
-        long nLower = 0,
+        tools::Long nLeft = 0,
+        tools::Long nRight = 0,
+        tools::Long nUpper = 0,
+        tools::Long nLower = 0,
         bool bScaleAll = false,
         Orientation eOrientation = Orientation::Landscape,
         sal_uInt16 nPaperBin = 0,
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx
index 1213936f42c7..135cfb5b8b78 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -2693,14 +2693,14 @@ void SdOOXMLExportTest2::testTdf1225573_FontWorkScaleX()
     awt::Rectangle aBoundRectArch;
     xShapeArchProps->getPropertyValue(UNO_NAME_MISC_OBJ_BOUNDRECT) >>= aBoundRectArch;
     // difference should be zero, but allow some range for stroke thickness
-    CPPUNIT_ASSERT_LESS(static_cast<long>(50), labs(aBoundRectArch.Width - 13081));
+    CPPUNIT_ASSERT_LESS(static_cast<tools::Long>(50), labs(aBoundRectArch.Width - 13081));
 
     // Error was, that text in shapes of category "Warp" was not scaled to the path.
     uno::Reference<beans::XPropertySet> xShapeWaveProps(getShapeFromPage(0, 1, xDocShRef));
     awt::Rectangle aBoundRectWave;
     xShapeWaveProps->getPropertyValue(UNO_NAME_MISC_OBJ_BOUNDRECT) >>= aBoundRectWave;
     // difference should be zero, but allow some range for stroke thickness
-    CPPUNIT_ASSERT_LESS(static_cast<long>(50), labs(aBoundRectWave.Width - 11514));
+    CPPUNIT_ASSERT_LESS(static_cast<tools::Long>(50), labs(aBoundRectWave.Width - 11514));
 
     xDocShRef->DoClose();
 }
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 6c163db17296..11cbbb4f98b7 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -1598,9 +1598,9 @@ void SdImportTest::testTdf93124()
         Bitmap::ScopedReadAccess pReadAccess(aBMP);
         int nNonWhiteCount = 0;
         // The word "Top" should be in rectangle 34,4 - 76,30. If text alignment is wrong, the rectangle will be white.
-        for (long nY = 4; nY < (4 + 26); ++nY)
+        for (tools::Long nY = 4; nY < (4 + 26); ++nY)
         {
-            for (long nX = 34; nX < (34 + 43); ++nX)
+            for (tools::Long nX = 34; nX < (34 + 43); ++nX)
             {
                 const Color aColor = pReadAccess->GetColor(nY, nX);
                 if ((aColor.GetRed() != 0xff) || (aColor.GetGreen() != 0xff) || (aColor.GetBlue() != 0xff))
@@ -1657,9 +1657,9 @@ void SdImportTest::testTdf99729()
         BitmapEx aBMPEx = aPNGReader.Read();
         Bitmap aBMP = aBMPEx.GetBitmap();
         Bitmap::ScopedReadAccess pRead(aBMP);
-        for (long nX = 154; nX < (154 + 12); ++nX)
+        for (tools::Long nX = 154; nX < (154 + 12); ++nX)
         {
-            for (long nY = 16; nY < (16 + 96); ++nY)
+            for (tools::Long nY = 16; nY < (16 + 96); ++nY)
             {
                 const Color aColor = pRead->GetColor(nY, nX);
                 if ((aColor.GetRed() != 0xff) || (aColor.GetGreen() != 0xff) || (aColor.GetBlue() != 0xff))
@@ -2169,10 +2169,10 @@ bool checkPatternValues(std::vector<sal_uInt8>& rExpected, Bitmap& rBitmap)
     const Color aBGColor(0xFFFFFF);
 
     Bitmap::ScopedReadAccess pAccess(rBitmap);
-    for (long y = 0; y < pAccess->Height(); ++y)
+    for (tools::Long y = 0; y < pAccess->Height(); ++y)
     {
         Scanline pScanline = pAccess->GetScanline( y );
-        for (long x = 0; x < pAccess->Width(); ++x)
+        for (tools::Long x = 0; x < pAccess->Width(); ++x)
         {
             Color aColor = pAccess->GetPixelFromData(pScanline, x);
             sal_uInt8 aValue = rExpected[y*8+x];
@@ -2619,7 +2619,7 @@ void SdImportTest::testTdf90626()
     {
         const SvxNumBulletItem *pNumFmt = aEdit.GetParaAttribs(i).GetItem(EE_PARA_NUMBULLET);
         CPPUNIT_ASSERT(pNumFmt);
-        CPPUNIT_ASSERT_DOUBLES_EQUAL(long(371), pNumFmt->GetNumRule()->GetLevel(0).GetGraphicSize().getHeight(), long(1));
+        CPPUNIT_ASSERT_DOUBLES_EQUAL(tools::Long(371), pNumFmt->GetNumRule()->GetLevel(0).GetGraphicSize().getHeight(), tools::Long(1));
     }
 
     xDocShRef->DoClose();
@@ -2664,7 +2664,7 @@ void SdImportTest::testTdf114913()
     CPPUNIT_ASSERT_MESSAGE("No text object", pTxtObj != nullptr);
     const SvxNumBulletItem *pItem = pTxtObj->GetOutlinerParaObject()->GetTextObject().GetParaAttribs(0).GetItem(EE_PARA_NUMBULLET);
     CPPUNIT_ASSERT(pItem);
-    CPPUNIT_ASSERT_EQUAL(long(691), pItem->GetNumRule()->GetLevel(0).GetGraphicSize().getHeight());
+    CPPUNIT_ASSERT_EQUAL(tools::Long(691), pItem->GetNumRule()->GetLevel(0).GetGraphicSize().getHeight());
 
     xDocShRef->DoClose();
 }
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 6f790eac0a55..22e2b4bfe2a4 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -2283,14 +2283,14 @@ void SdTiledRenderingTest::testPasteTextOnSlide()
     if (aPos.getX() < 10000)
     {
         // We get this with 'make CppunitTest_sd_tiledrendering'
-        CPPUNIT_ASSERT_DOUBLES_EQUAL(static_cast<long>(6739), aPos.getX(), 100);
-        CPPUNIT_ASSERT_DOUBLES_EQUAL(static_cast<long>(6822), aPos.getY(), 100);
+        CPPUNIT_ASSERT_DOUBLES_EQUAL(static_cast<tools::Long>(6739), aPos.getX(), 100);
+        CPPUNIT_ASSERT_DOUBLES_EQUAL(static_cast<tools::Long>(6822), aPos.getY(), 100);
     }
     else
     {
         // We get this with 'make check'
-        CPPUNIT_ASSERT_DOUBLES_EQUAL(static_cast<long>(12990), aPos.getX(), 100);
-        CPPUNIT_ASSERT_DOUBLES_EQUAL(static_cast<long>(7393), aPos.getY(), 100);
+        CPPUNIT_ASSERT_DOUBLES_EQUAL(static_cast<tools::Long>(12990), aPos.getX(), 100);
+        CPPUNIT_ASSERT_DOUBLES_EQUAL(static_cast<tools::Long>(7393), aPos.getY(), 100);
     }
 }
 
diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx
index ab0b932c8df3..69f746150d64 100644
--- a/sd/source/core/drawdoc.cxx
+++ b/sd/source/core/drawdoc.cxx
@@ -370,10 +370,10 @@ SdDrawDocument::~SdDrawDocument()
 
 void SdDrawDocument::adaptSizeAndBorderForAllPages(
     const Size& rNewSize,
-    long nLeft,
-    long nRight,
-    long nUpper,
-    long nLower)
+    ::tools::Long nLeft,
+    ::tools::Long nRight,
+    ::tools::Long nUpper,
+    ::tools::Long nLower)
 {
     const sal_uInt16 nMasterPageCnt(GetMasterSdPageCount(PageKind::Standard));
     const sal_uInt16 nPageCnt(GetSdPageCount(PageKind::Standard));
@@ -411,10 +411,10 @@ void SdDrawDocument::AdaptPageSizeForAllPages(
     const Size& rNewSize,
     PageKind ePageKind,
     SdUndoGroup* pUndoGroup,
-    long nLeft,
-    long nRight,
-    long nUpper,
-    long nLower,
+    ::tools::Long nLeft,
+    ::tools::Long nRight,
+    ::tools::Long nUpper,
+    ::tools::Long nLower,
     bool bScaleAll,
     Orientation eOrientation,
     sal_uInt16 nPaperBin,
diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx
index 5c31e8fd3614..b5546c1d4066 100644
--- a/sd/source/core/drawdoc2.cxx
+++ b/sd/source/core/drawdoc2.cxx
@@ -60,7 +60,7 @@
 
 using namespace ::sd;
 
-const long PRINT_OFFSET = 30;       // see /svx/source/dialog/page.cxx
+const ::tools::Long PRINT_OFFSET = 30;       // see /svx/source/dialog/page.cxx
 
 using namespace com::sun::star;
 
@@ -565,12 +565,12 @@ void SdDrawDocument::CreateFirstPages( SdDrawDocument const * pRefDocument /* =
                 Size aOutSize(pPrinter->GetOutputSize());
                 Point aPageOffset(pPrinter->GetPageOffset());
                 aPageOffset -= pPrinter->PixelToLogic( Point() );
-                long nOffset = !aPageOffset.X() && !aPageOffset.Y() ? 0 : PRINT_OFFSET;
+                ::tools::Long nOffset = !aPageOffset.X() && !aPageOffset.Y() ? 0 : PRINT_OFFSET;
 
                 sal_uLong nTop    = aPageOffset.Y();
                 sal_uLong nLeft   = aPageOffset.X();
-                sal_uLong nBottom = std::max(static_cast<long>(aDefSize.Height() - aOutSize.Height() - nTop + nOffset), 0L);
-                sal_uLong nRight  = std::max(static_cast<long>(aDefSize.Width() - aOutSize.Width() - nLeft + nOffset), 0L);
+                sal_uLong nBottom = std::max(static_cast<::tools::Long>(aDefSize.Height() - aOutSize.Height() - nTop + nOffset), 0L);
+                sal_uLong nRight  = std::max(static_cast<::tools::Long>(aDefSize.Width() - aOutSize.Width() - nLeft + nOffset), 0L);
 
                 pPage->SetBorder(nLeft, nTop, nRight, nBottom);
             }
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index 8ce62cc077fb..15f2be5fc22e 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -989,8 +989,8 @@ SdrObject* SdPage::CreateDefaultPresObj(PresObjKind eObjKind)
         // create footer objects for standard master page
         if( mePageKind == PageKind::Standard )
         {
-            const long nLftBorder = GetLeftBorder();
-            const long nUppBorder = GetUpperBorder();
+            const ::tools::Long nLftBorder = GetLeftBorder();
+            const ::tools::Long nUppBorder = GetUpperBorder();
 
             Point aPos ( nLftBorder, nUppBorder );
             Size aSize ( GetSize() );
@@ -999,10 +999,10 @@ SdrObject* SdPage::CreateDefaultPresObj(PresObjKind eObjKind)
             aSize.AdjustHeight( -(nUppBorder + GetLowerBorder()) );
 
             getPresObjProp( *this, sObjKind, sPageKind, propvalue);
-            aPos.AdjustX(long( aSize.Width() * propvalue[2] ) );
-            aPos.AdjustY(long( aSize.Height() * propvalue[3] ) );
-            aSize.setWidth( long( aSize.Width() * propvalue[1] ) );
-            aSize.setHeight( long( aSize.Height() * propvalue[0] ) );
+            aPos.AdjustX(::tools::Long( aSize.Width() * propvalue[2] ) );
+            aPos.AdjustY(::tools::Long( aSize.Height() * propvalue[3] ) );
+            aSize.setWidth( ::tools::Long( aSize.Width() * propvalue[1] ) );
+            aSize.setHeight( ::tools::Long( aSize.Height() * propvalue[0] ) );
 
             if(eObjKind == PresObjKind::Header )
             {
@@ -1025,18 +1025,18 @@ SdrObject* SdPage::CreateDefaultPresObj(PresObjKind eObjKind)
             Point aPosition ( GetLeftBorder(), GetUpperBorder() );
 
             getPresObjProp( *this, sObjKind, sPageKind, propvalue);
-            int NOTES_HEADER_FOOTER_WIDTH = long(aPageSize.Width() * propvalue[1]);
-            int NOTES_HEADER_FOOTER_HEIGHT = long(aPageSize.Height() * propvalue[0]);
+            int NOTES_HEADER_FOOTER_WIDTH = ::tools::Long(aPageSize.Width() * propvalue[1]);
+            int NOTES_HEADER_FOOTER_HEIGHT = ::tools::Long(aPageSize.Height() * propvalue[0]);
             Size aSize( NOTES_HEADER_FOOTER_WIDTH, NOTES_HEADER_FOOTER_HEIGHT );
             Point aPos ( 0 ,0 );
             if( propvalue[2] == 0 )
                 aPos.setX( aPosition.X() );
             else
-                aPos.setX( aPosition.X() + long( aPageSize.Width() - NOTES_HEADER_FOOTER_WIDTH ) );
+                aPos.setX( aPosition.X() + ::tools::Long( aPageSize.Width() - NOTES_HEADER_FOOTER_WIDTH ) );
             if( propvalue[3] == 0 )
                 aPos.setY( aPosition.Y() );
             else
-                aPos.setY( aPosition.Y() + long( aPageSize.Height() - NOTES_HEADER_FOOTER_HEIGHT ) );
+                aPos.setY( aPosition.Y() + ::tools::Long( aPageSize.Height() - NOTES_HEADER_FOOTER_HEIGHT ) );
 
             ::tools::Rectangle aRect( aPos, aSize );
             return CreatePresObj( eObjKind, false, aRect );
@@ -1093,21 +1093,21 @@ void SdPage::DestroyDefaultPresObj(PresObjKind eObjKind)
         if (mePageKind == PageKind::Standard)
          {
             getPresObjProp( *this , "PRESOBJ_TITLE" ,sPageKind, propvalue);
-            aTitlePos.AdjustX(long( aTitleSize.Width() * propvalue[2] ) );
-            aTitlePos.AdjustY(long( aTitleSize.Height() * propvalue[3] ) );
-            aTitleSize.setWidth( long( aTitleSize.Width() * propvalue[1] ) );
-            aTitleSize.setHeight( long( aTitleSize.Height() * propvalue[0] ) );
+            aTitlePos.AdjustX(::tools::Long( aTitleSize.Width() * propvalue[2] ) );
+            aTitlePos.AdjustY(::tools::Long( aTitleSize.Height() * propvalue[3] ) );
+            aTitleSize.setWidth( ::tools::Long( aTitleSize.Width() * propvalue[1] ) );
+            aTitleSize.setHeight( ::tools::Long( aTitleSize.Height() * propvalue[0] ) );
         }
         else if (mePageKind == PageKind::Notes)
         {
             Point aPos = aTitlePos;
             getPresObjProp( *this, "PRESOBJ_TITLE" ,sPageKind, propvalue);
-            aPos.AdjustX(long( aTitleSize.Width() * propvalue[2] ) );
-            aPos.AdjustY(long( aTitleSize.Height() * propvalue[3] ) );
+            aPos.AdjustX(::tools::Long( aTitleSize.Width() * propvalue[2] ) );
+            aPos.AdjustY(::tools::Long( aTitleSize.Height() * propvalue[3] ) );
 
             // limit height
-            aTitleSize.setHeight( long( aTitleSize.Height() * propvalue[0] ) );
-            aTitleSize.setWidth( long( aTitleSize.Width() * propvalue[1] ) );
+            aTitleSize.setHeight( ::tools::Long( aTitleSize.Height() * propvalue[0] ) );
+            aTitleSize.setWidth( ::tools::Long( aTitleSize.Width() * propvalue[1] ) );
 
             Size aPartArea = aTitleSize;
             Size aSize;
@@ -1135,8 +1135,8 @@ void SdPage::DestroyDefaultPresObj(PresObjKind eObjKind)
 
                 if ( fH > fV )
                     fH = fV;
-                aSize.setWidth( static_cast<long>(fH * pRefPage->GetWidth()) );
-                aSize.setHeight( static_cast<long>(fH * pRefPage->GetHeight()) );
+                aSize.setWidth( static_cast<::tools::Long>(fH * pRefPage->GetWidth()) );
+                aSize.setHeight( static_cast<::tools::Long>(fH * pRefPage->GetHeight()) );
 
                 aPos.AdjustX((aPartArea.Width() - aSize.Width()) / 2 );
                 aPos.AdjustY((aPartArea.Height()- aSize.Height())/ 2 );
@@ -1176,20 +1176,20 @@ void SdPage::DestroyDefaultPresObj(PresObjKind eObjKind)
         if (mePageKind == PageKind::Standard)
         {
             getPresObjProp( *this ,"PRESOBJ_OUTLINE", sPageKind, propvalue);
-            aLayoutPos.AdjustX(long( aLayoutSize.Width() * propvalue[2] ) );
-            aLayoutPos.AdjustY(long( aLayoutSize.Height() * propvalue[3] ) );
-            aLayoutSize.setWidth( long( aLayoutSize.Width() * propvalue[1] ) );
-            aLayoutSize.setHeight( long( aLayoutSize.Height() * propvalue[0] ) );
+            aLayoutPos.AdjustX(::tools::Long( aLayoutSize.Width() * propvalue[2] ) );
+            aLayoutPos.AdjustY(::tools::Long( aLayoutSize.Height() * propvalue[3] ) );
+            aLayoutSize.setWidth( ::tools::Long( aLayoutSize.Width() * propvalue[1] ) );
+            aLayoutSize.setHeight( ::tools::Long( aLayoutSize.Height() * propvalue[0] ) );
             aLayoutRect.SetPos(aLayoutPos);
             aLayoutRect.SetSize(aLayoutSize);
         }
         else if (mePageKind == PageKind::Notes)
         {
             getPresObjProp( *this, "PRESOBJ_NOTES", sPageKind, propvalue);
-            aLayoutPos.AdjustX(long( aLayoutSize.Width() * propvalue[2] ) );
-            aLayoutPos.AdjustY(long( aLayoutSize.Height() * propvalue[3] ) );
-            aLayoutSize.setWidth( long( aLayoutSize.Width() * propvalue[1] ) );
-            aLayoutSize.setHeight( long( aLayoutSize.Height() * propvalue[0] ) );
+            aLayoutPos.AdjustX(::tools::Long( aLayoutSize.Width() * propvalue[2] ) );
+            aLayoutPos.AdjustY(::tools::Long( aLayoutSize.Height() * propvalue[3] ) );
+            aLayoutSize.setWidth( ::tools::Long( aLayoutSize.Width() * propvalue[1] ) );
+            aLayoutSize.setHeight( ::tools::Long( aLayoutSize.Height() * propvalue[0] ) );
             aLayoutRect.SetPos(aLayoutPos);
             aLayoutRect.SetSize(aLayoutSize);
         }
@@ -1869,8 +1869,8 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const ::tools::Rectangle& rN
         aNewPageSize = aBackgroundSize;
     }
 
-    long nOldWidth  = GetWidth() - GetLeftBorder() - GetRightBorder();
-    long nOldHeight = GetHeight() - GetUpperBorder() - GetLowerBorder();
+    ::tools::Long nOldWidth  = GetWidth() - GetLeftBorder() - GetRightBorder();
+    ::tools::Long nOldHeight = GetHeight() - GetUpperBorder() - GetLowerBorder();
 
     Fraction aFractX(aNewPageSize.Width(), nOldWidth);
     Fraction aFractY(aNewPageSize.Height(), nOldHeight);
@@ -1928,14 +1928,14 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const ::tools::Rectangle& rN
 
                                 const SvxFontHeightItem& rOldHgt = rSet.Get(EE_CHAR_FONTHEIGHT);
                                 sal_uLong nFontHeight = rOldHgt.GetHeight();
-                                nFontHeight = long(nFontHeight * static_cast<double>(aFractY));
+                                nFontHeight = ::tools::Long(nFontHeight * static_cast<double>(aFractY));
                                 rSet.Put(SvxFontHeightItem(nFontHeight, 100, EE_CHAR_FONTHEIGHT));
 
                                 if( SfxItemState::DEFAULT == rSet.GetItemState( EE_CHAR_FONTHEIGHT_CJK ) )
                                 {
                                     const SvxFontHeightItem& rOldHgt2 = rSet.Get(EE_CHAR_FONTHEIGHT_CJK);
                                     nFontHeight = rOldHgt2.GetHeight();
-                                    nFontHeight = long(nFontHeight * static_cast<double>(aFractY));
+                                    nFontHeight = ::tools::Long(nFontHeight * static_cast<double>(aFractY));
                                     rSet.Put(SvxFontHeightItem(nFontHeight, 100, EE_CHAR_FONTHEIGHT_CJK));
                                 }
 
@@ -1943,7 +1943,7 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const ::tools::Rectangle& rN
                                 {
                                     const SvxFontHeightItem& rOldHgt2 = rSet.Get(EE_CHAR_FONTHEIGHT_CTL);
                                     nFontHeight = rOldHgt2.GetHeight();
-                                    nFontHeight = long(nFontHeight * static_cast<double>(aFractY));
+                                    nFontHeight = ::tools::Long(nFontHeight * static_cast<double>(aFractY));
                                     rSet.Put(SvxFontHeightItem(nFontHeight, 100, EE_CHAR_FONTHEIGHT_CTL));
                                 }
 
@@ -1966,14 +1966,14 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const ::tools::Rectangle& rN
 
                                     const SvxFontHeightItem& rOldHgt = aTempSet.Get(EE_CHAR_FONTHEIGHT);
                                     sal_uLong nFontHeight = rOldHgt.GetHeight();
-                                    nFontHeight = long(nFontHeight * static_cast<double>(aFractY));
+                                    nFontHeight = ::tools::Long(nFontHeight * static_cast<double>(aFractY));
                                     aTempSet.Put(SvxFontHeightItem(nFontHeight, 100, EE_CHAR_FONTHEIGHT));
 
                                     if( SfxItemState::DEFAULT == aTempSet.GetItemState( EE_CHAR_FONTHEIGHT_CJK ) )
                                     {
                                         const SvxFontHeightItem& rOldHgt2 = aTempSet.Get(EE_CHAR_FONTHEIGHT_CJK);
                                         nFontHeight = rOldHgt2.GetHeight();
-                                        nFontHeight = long(nFontHeight * static_cast<double>(aFractY));
+                                        nFontHeight = ::tools::Long(nFontHeight * static_cast<double>(aFractY));
                                         aTempSet.Put(SvxFontHeightItem(nFontHeight, 100, EE_CHAR_FONTHEIGHT_CJK));
                                     }
 
@@ -1981,7 +1981,7 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const ::tools::Rectangle& rN
                                     {
                                         const SvxFontHeightItem& rOldHgt2 = aTempSet.Get(EE_CHAR_FONTHEIGHT_CTL);
                                         nFontHeight = rOldHgt2.GetHeight();
-                                        nFontHeight = long(nFontHeight * static_cast<double>(aFractY));
+                                        nFontHeight = ::tools::Long(nFontHeight * static_cast<double>(aFractY));
                                         aTempSet.Put(SvxFontHeightItem(nFontHeight, 100, EE_CHAR_FONTHEIGHT_CTL));
                                     }
 
@@ -2059,8 +2059,8 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const ::tools::Rectangle& rN
 
                 // corrected scaling; only distances may be scaled
                 // use aTopLeft as original TopLeft
-                aNewPos.setX( long((aTopLeft.X() - GetLeftBorder()) * static_cast<double>(aFractX)) + nLeft );
-                aNewPos.setY( long((aTopLeft.Y() - GetUpperBorder()) * static_cast<double>(aFractY)) + nUpper );
+                aNewPos.setX( ::tools::Long((aTopLeft.X() - GetLeftBorder()) * static_cast<double>(aFractX)) + nLeft );
+                aNewPos.setY( ::tools::Long((aTopLeft.Y() - GetUpperBorder()) * static_cast<double>(aFractY)) + nUpper );
 
                 Size aVec(aNewPos.X() - aTopLeft.X(), aNewPos.Y() - aTopLeft.Y());
 
@@ -3002,21 +3002,21 @@ void SdPage::CalculateHandoutAreas( SdDrawDocument& rModel, AutoLayout eLayout,
     }
     else
     {
-        const long nGapW = 1000; // gap is 1cm
-        const long nGapH = 1000;
+        const ::tools::Long nGapW = 1000; // gap is 1cm
+        const ::tools::Long nGapH = 1000;
 
-        long nLeftBorder = rHandoutMaster.GetLeftBorder();
-        long nRightBorder = rHandoutMaster.GetRightBorder();
-        long nTopBorder = rHandoutMaster.GetUpperBorder();
-        long nBottomBorder = rHandoutMaster.GetLowerBorder();
+        ::tools::Long nLeftBorder = rHandoutMaster.GetLeftBorder();
+        ::tools::Long nRightBorder = rHandoutMaster.GetRightBorder();
+        ::tools::Long nTopBorder = rHandoutMaster.GetUpperBorder();
+        ::tools::Long nBottomBorder = rHandoutMaster.GetLowerBorder();
 
-        const long nHeaderFooterHeight = static_cast< long >( (aArea.Height() - nTopBorder - nLeftBorder) * 0.05  );
+        const ::tools::Long nHeaderFooterHeight = static_cast< ::tools::Long >( (aArea.Height() - nTopBorder - nLeftBorder) * 0.05  );
 
         nTopBorder += nHeaderFooterHeight;
         nBottomBorder += nHeaderFooterHeight;
 
-        long nX = nGapW + nLeftBorder;
-        long nY = nGapH + nTopBorder;
+        ::tools::Long nX = nGapW + nLeftBorder;
+        ::tools::Long nY = nGapH + nTopBorder;
 
         aArea.AdjustWidth( -(nGapW * 2 + nLeftBorder + nRightBorder) );
         aArea.AdjustHeight( -(nGapH * 2 + nTopBorder + nBottomBorder) );
@@ -3090,12 +3090,12 @@ void SdPage::CalculateHandoutAreas( SdDrawDocument& rModel, AutoLayout eLayout,
             // scale actual size into handout rect
             double fScale = static_cast<double>(aPartArea.Width()) / static_cast<double>(pFirstPage->GetWidth());
 
-            aSize.setHeight( static_cast<long>(fScale * pFirstPage->GetHeight() ) );
+            aSize.setHeight( static_cast<::tools::Long>(fScale * pFirstPage->GetHeight() ) );
             if( aSize.Height() > aPartArea.Height() )
             {
                 fScale = static_cast<double>(aPartArea.Height()) / static_cast<double>(pFirstPage->GetHeight());
                 aSize.setHeight( aPartArea.Height() );
-                aSize.setWidth( static_cast<long>(fScale * pFirstPage->GetWidth()) );
+                aSize.setWidth( static_cast<::tools::Long>(fScale * pFirstPage->GetWidth()) );
             }
             else
             {
@@ -3114,9 +3114,9 @@ void SdPage::CalculateHandoutAreas( SdDrawDocument& rModel, AutoLayout eLayout,
 
         const bool bRTL = rModel.GetDefaultWritingMode() == css::text::WritingMode_RL_TB;
 
-        const long nOffsetX = (aPartArea.Width() + nGapW) * (bRTL ? -1 : 1);
-        const long nOffsetY = aPartArea.Height() + nGapH;
-        const long nStartX = bRTL ? nOffsetX*(1 - nColCnt) + nX : nX;
+        const ::tools::Long nOffsetX = (aPartArea.Width() + nGapW) * (bRTL ? -1 : 1);
+        const ::tools::Long nOffsetY = aPartArea.Height() + nGapH;
+        const ::tools::Long nStartX = bRTL ? nOffsetX*(1 - nColCnt) + nX : nX;
 
         for(sal_uInt16 nRow = 0; nRow < nRowCnt; nRow++)
         {
diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx
index f775e1fbd063..3ecac3614608 100644
--- a/sd/source/filter/eppt/epptso.cxx
+++ b/sd/source/filter/eppt/epptso.cxx
@@ -984,8 +984,8 @@ void PPTWriter::ImplFlipBoundingBox( EscherPropertyContainer& rPropOpt )
         // Maddeningly, in those two areas of PPT is the BoundingBox already
         // vertical. Therefore, we need to put down it BEFORE THE ROTATION.
         css::awt::Point aTopLeft( static_cast<sal_Int32>( maRect.Left() + fWidthHalf - fHeightHalf ), static_cast<sal_Int32>( maRect.Top() + fHeightHalf - fWidthHalf ) );
-        const long nRotatedWidth(maRect.GetHeight());
-        const long nRotatedHeight(maRect.GetWidth());
+        const tools::Long nRotatedWidth(maRect.GetHeight());
+        const tools::Long nRotatedHeight(maRect.GetWidth());
         const Size aNewSize(nRotatedWidth, nRotatedHeight);
         maRect = ::tools::Rectangle( Point( aTopLeft.X, aTopLeft.Y ), aNewSize );
     }
diff --git a/sd/source/filter/grf/sdgrffilter.cxx b/sd/source/filter/grf/sdgrffilter.cxx
index c1f920362b81..c8d9183d152f 100644
--- a/sd/source/filter/grf/sdgrffilter.cxx
+++ b/sd/source/filter/grf/sdgrffilter.cxx
@@ -174,13 +174,13 @@ bool SdGRFFilter::Import()
             // adjust graphic to page size (scales)
             if( fGrfWH < fWinWH )
             {
-                aGrfSize.setWidth( static_cast<long>( aPagSize.Height() * fGrfWH ) );
+                aGrfSize.setWidth( static_cast<tools::Long>( aPagSize.Height() * fGrfWH ) );
                 aGrfSize.setHeight( aPagSize.Height() );
             }
             else if( fGrfWH > 0.F )
             {
                 aGrfSize.setWidth( aPagSize.Width() );
-                aGrfSize.setHeight( static_cast<long>( aPagSize.Width() / fGrfWH ) );
+                aGrfSize.setHeight( static_cast<tools::Long>( aPagSize.Width() / fGrfWH ) );
             }
         }
 
diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx
index 83618fe199d3..7b1efa7e14b5 100644
--- a/sd/source/filter/html/htmlex.cxx
+++ b/sd/source/filter/html/htmlex.cxx
@@ -1682,11 +1682,11 @@ bool HtmlExport::CreateHtmlForPresPages()
                 aRect.Move(-pPage->GetLeftBorder(), -pPage->GetUpperBorder());
 
                 double fLogicToPixel = static_cast<double>(mnWidthPixel) / nPageWidth;
-                aRect.SetLeft( static_cast<long>(aRect.Left() * fLogicToPixel) );
-                aRect.SetTop( static_cast<long>(aRect.Top() * fLogicToPixel) );
-                aRect.SetRight( static_cast<long>(aRect.Right() * fLogicToPixel) );
-                aRect.SetBottom( static_cast<long>(aRect.Bottom() * fLogicToPixel) );
-                long nRadius = aRect.GetWidth() / 2;
+                aRect.SetLeft( static_cast<tools::Long>(aRect.Left() * fLogicToPixel) );
+                aRect.SetTop( static_cast<tools::Long>(aRect.Top() * fLogicToPixel) );
+                aRect.SetRight( static_cast<tools::Long>(aRect.Right() * fLogicToPixel) );
+                aRect.SetBottom( static_cast<tools::Long>(aRect.Bottom() * fLogicToPixel) );
+                tools::Long nRadius = aRect.GetWidth() / 2;
 
                 /**
                     insert areas into Imagemap of the object, if the object has
@@ -1730,10 +1730,10 @@ bool HtmlExport::CreateHtmlForPresPages()
                                 // conversion into pixel coordinates
                                 aArea.Move(aLogPos.X() - pPage->GetLeftBorder(),
                                            aLogPos.Y() - pPage->GetUpperBorder());
-                                aArea.SetLeft( static_cast<long>(aArea.Left() * fLogicToPixel) );
-                                aArea.SetTop( static_cast<long>(aArea.Top() * fLogicToPixel) );
-                                aArea.SetRight( static_cast<long>(aArea.Right() * fLogicToPixel) );
-                                aArea.SetBottom( static_cast<long>(aArea.Bottom() * fLogicToPixel) );
+                                aArea.SetLeft( static_cast<tools::Long>(aArea.Left() * fLogicToPixel) );
+                                aArea.SetTop( static_cast<tools::Long>(aArea.Top() * fLogicToPixel) );
+                                aArea.SetRight( static_cast<tools::Long>(aArea.Right() * fLogicToPixel) );
+                                aArea.SetBottom( static_cast<tools::Long>(aArea.Bottom() * fLogicToPixel) );
 
                                 aStr.append(CreateHTMLRectArea(aArea, aURL));
                             }
@@ -1745,8 +1745,8 @@ bool HtmlExport::CreateHtmlForPresPages()
                                                  GetCenter(false));
                                 aCenter += Point(aLogPos.X() - pPage->GetLeftBorder(),
                                                  aLogPos.Y() - pPage->GetUpperBorder());
-                                aCenter.setX( static_cast<long>(aCenter.X() * fLogicToPixel) );
-                                aCenter.setY( static_cast<long>(aCenter.Y() * fLogicToPixel) );
+                                aCenter.setX( static_cast<tools::Long>(aCenter.X() * fLogicToPixel) );
+                                aCenter.setY( static_cast<tools::Long>(aCenter.Y() * fLogicToPixel) );
 
                                 sal_uLong nCircleRadius = static_cast<IMapCircleObject*>(pArea)->
                                                  GetRadius(false);
@@ -2786,8 +2786,8 @@ OUString HtmlExport::CreateHTMLPolygonArea( const ::basegfx::B2DPolyPolygon& rPo
             // origin of ordinates
             aPnt.Move(aShift.Width(), aShift.Height());
 
-            aPnt.setX( static_cast<long>(aPnt.X() * fFactor) );
-            aPnt.setY( static_cast<long>(aPnt.Y() * fFactor) );
+            aPnt.setX( static_cast<tools::Long>(aPnt.X() * fFactor) );
+            aPnt.setY( static_cast<tools::Long>(aPnt.Y() * fFactor) );
             aStr.append(OUString::number(aPnt.X())).append(",").append(OUString::number(aPnt.Y()));
 
             if (nPoint < nNoOfPoints - 1)
diff --git a/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx b/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx
index c042eac6254f..4b573d803909 100644
--- a/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx
+++ b/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx
@@ -190,7 +190,7 @@ sal_Int32 SAL_CALL
 {
     ThrowIfDisposed ();
 
-    long nChildCount = AccessibleDocumentViewBase::getAccessibleChildCount();
+    tools::Long nChildCount = AccessibleDocumentViewBase::getAccessibleChildCount();
 
     // Forward request to children manager.
     if (mpChildrenManager != nullptr)
diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx b/sd/source/ui/animations/CustomAnimationDialog.cxx
index ff9f8538b899..5110587f4245 100644
--- a/sd/source/ui/animations/CustomAnimationDialog.cxx
+++ b/sd/source/ui/animations/CustomAnimationDialog.cxx
@@ -377,7 +377,7 @@ void SdCharHeightPropertyBox::setValue( const Any& rValue, const OUString& )
     {
         double fValue = 0.0;
         rValue >>= fValue;
-        mxMetric->set_value(static_cast<long>(fValue * 100.0), FieldUnit::PERCENT);
+        mxMetric->set_value(static_cast<::tools::Long>(fValue * 100.0), FieldUnit::PERCENT);
     }
 }
 
@@ -464,7 +464,7 @@ void SdTransparencyPropertyBox::setValue(const Any& rValue, const OUString&)
     {
         double fValue = 0.0;
         rValue >>= fValue;
-        long nValue = static_cast<long>(fValue * 100);
+        ::tools::Long nValue = static_cast<::tools::Long>(fValue * 100);
         mxMetric->set_value(nValue, FieldUnit::PERCENT);
         updateMenu();
     }
@@ -567,7 +567,7 @@ void SdRotationPropertyBox::setValue( const Any& rValue, const OUString& )
     {
         double fValue = 0.0;
         rValue >>= fValue;
-        long nValue = static_cast<long>(fValue);
+        ::tools::Long nValue = static_cast<::tools::Long>(fValue);
         mxMetric->set_value(nValue, FieldUnit::DEGREE);
         updateMenu();
     }
@@ -707,11 +707,11 @@ void SdScalePropertyBox::setValue(const Any& rValue, const OUString&)
     if ( fValue2 < 0.0 )
         fValue2 += 1;
 
-    long nValue;
+    ::tools::Long nValue;
     if( fValue1 )
-        nValue = static_cast<long>(fValue1 * 100.0);
+        nValue = static_cast<::tools::Long>(fValue1 * 100.0);
     else
-        nValue = static_cast<long>(fValue2 * 100.0);
+        nValue = static_cast<::tools::Long>(fValue2 * 100.0);
     mxMetric->set_value(nValue, FieldUnit::PERCENT);
     updateMenu();
 }
@@ -1041,7 +1041,7 @@ CustomAnimationEffectTabPage::CustomAnimationEffectTabPage(weld::Container* pPar
         {
             double fIterateInterval = 0.0;
             pSet->getPropertyValue( nHandleIterateInterval ) >>= fIterateInterval;
-            mxMFTextDelay->set_value(static_cast<long>(fIterateInterval*10), FieldUnit::NONE);
+            mxMFTextDelay->set_value(static_cast<::tools::Long>(fIterateInterval*10), FieldUnit::NONE);
         }
     }
     else
@@ -1336,7 +1336,7 @@ void CustomAnimationEffectTabPage::openSoundFileDialog()
 
     bool bValidSoundFile = false;
     bool bQuitLoop = false;
-    long nPos = 0;
+    ::tools::Long nPos = 0;
 
     while( !bQuitLoop && (aFileDialog.Execute() == ERRCODE_NONE) )
     {
@@ -1475,7 +1475,7 @@ CustomAnimationDurationTabPage::CustomAnimationDurationTabPage(weld::Container*
     {
         double fBegin = 0.0;
         pSet->getPropertyValue( nHandleBegin ) >>= fBegin;
-        mxMFStartDelay->set_value(static_cast<long>(fBegin*10), FieldUnit::NONE);
+        mxMFStartDelay->set_value(static_cast<::tools::Long>(fBegin*10), FieldUnit::NONE);
     }
 
     if( pSet->getPropertyState( nHandleDuration ) != STLPropertyState::Ambiguous )
@@ -1824,7 +1824,7 @@ CustomAnimationTextAnimTabPage::CustomAnimationTextAnimTabPage(weld::Container*
         {
             mxCBXGroupAuto->set_active(fTextGroupingAuto >= 0.0);
             if( fTextGroupingAuto >= 0.0 )
-                mxMFGroupAuto->set_value(static_cast<long>(fTextGroupingAuto*10), FieldUnit::NONE);
+                mxMFGroupAuto->set_value(static_cast<::tools::Long>(fTextGroupingAuto*10), FieldUnit::NONE);
         }
     }
     else
diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx
index 123582bf791d..b0299ddf0f20 100644
--- a/sd/source/ui/animations/CustomAnimationList.cxx
+++ b/sd/source/ui/animations/CustomAnimationList.cxx
@@ -231,8 +231,8 @@ private:
     CustomAnimationEffectPtr mpEffect;
 
 public:
-    static const long nIconWidth = 19;
-    static const long nItemMinHeight = 38;
+    static const ::tools::Long nIconWidth = 19;
+    static const ::tools::Long nItemMinHeight = 38;
 };
 
 CustomAnimationListEntryItem::CustomAnimationListEntryItem(const OUString& aDescription, const CustomAnimationEffectPtr& pEffect)
@@ -663,10 +663,10 @@ void CustomAnimationList::update()
 
     CustomAnimationEffectPtr pFirstSelEffect;
     CustomAnimationEffectPtr pLastSelEffect;
-    long nFirstVis = -1;
-    long nLastVis = -1;
-    long nFirstSelOld = -1;
-    long nLastSelOld = -1;
+    ::tools::Long nFirstVis = -1;
+    ::tools::Long nLastVis = -1;
+    ::tools::Long nFirstSelOld = -1;
+    ::tools::Long nLastSelOld = -1;
 
     std::unique_ptr<weld::TreeIter> xEntry = mxTreeView->make_iterator();
 
@@ -770,8 +770,8 @@ void CustomAnimationList::update()
 
     if (mpMainSequence)
     {
-        long nFirstSelNew = -1;
-        long nLastSelNew = -1;
+        ::tools::Long nFirstSelNew = -1;
+        ::tools::Long nLastSelNew = -1;
 
         std::vector<std::unique_ptr<weld::TreeIter>> aNewSelection;
 
diff --git a/sd/source/ui/animations/motionpathtag.cxx b/sd/source/ui/animations/motionpathtag.cxx
index 1bc2c58cad96..b20e57740f4f 100644
--- a/sd/source/ui/animations/motionpathtag.cxx
+++ b/sd/source/ui/animations/motionpathtag.cxx
@@ -672,8 +672,8 @@ bool MotionPathTag::OnMarkHandle( const KeyEvent& rKEvt )
 
 bool MotionPathTag::OnMove( const KeyEvent& rKEvt )
 {
-    long nX = 0;
-    long nY = 0;
+    ::tools::Long nX = 0;
+    ::tools::Long nY = 0;
 
     switch( rKEvt.GetKeyCode().GetCode() )
     {
diff --git a/sd/source/ui/annotations/annotationtag.cxx b/sd/source/ui/annotations/annotationtag.cxx
index 61c8ac8b2a3d..9b5540dc73fb 100644
--- a/sd/source/ui/annotations/annotationtag.cxx
+++ b/sd/source/ui/annotations/annotationtag.cxx
@@ -402,8 +402,8 @@ void AnnotationTag::Move( int nDX, int nDY )
 
 bool AnnotationTag::OnMove( const KeyEvent& rKEvt )
 {
-    long nX = 0;
-    long nY = 0;
+    ::tools::Long nX = 0;
+    ::tools::Long nY = 0;
 
     switch( rKEvt.GetKeyCode().GetCode() )
     {
@@ -477,7 +477,7 @@ void AnnotationTag::addCustomHandles( SdrHdlList& rHandlerList )
     pHdl->SetPageView( mrView.GetSdrPageView() );
 
     RealPoint2D aPosition( mxAnnotation->getPosition() );
-    Point aBasePos( static_cast<long>(aPosition.X * 100.0), static_cast<long>(aPosition.Y * 100.0) );
+    Point aBasePos( static_cast<::tools::Long>(aPosition.X * 100.0), static_cast<::tools::Long>(aPosition.Y * 100.0) );
     pHdl->SetPos( aBasePos );
 
     rHandlerList.AddHdl( std::move(pHdl) );
@@ -511,7 +511,7 @@ void AnnotationTag::select()
     if( pWindow )
     {
         RealPoint2D aPosition( mxAnnotation->getPosition() );
-        Point aPos( static_cast<long>(aPosition.X * 100.0), static_cast<long>(aPosition.Y * 100.0) );
+        Point aPos( static_cast<::tools::Long>(aPosition.X * 100.0), static_cast<::tools::Long>(aPosition.Y * 100.0) );
 
         ::tools::Rectangle aVisRect( aPos, pWindow->PixelToLogic(maSize) );
         mrView.MakeVisible(aVisRect, *pWindow);
@@ -586,7 +586,7 @@ void AnnotationTag::OpenPopup( bool bEdit )
         if( pWindow )
         {
             RealPoint2D aPosition( mxAnnotation->getPosition() );
-            Point aPos( pWindow->OutputToScreenPixel( pWindow->LogicToPixel( Point( static_cast<long>(aPosition.X * 100.0), static_cast<long>(aPosition.Y * 100.0) ) ) ) );
+            Point aPos( pWindow->OutputToScreenPixel( pWindow->LogicToPixel( Point( static_cast<::tools::Long>(aPosition.X * 100.0), static_cast<::tools::Long>(aPosition.Y * 100.0) ) ) ) );
 
             aPos.AdjustX(4 ); // magic!
             aPos.AdjustY(1 );
diff --git a/sd/source/ui/annotations/annotationwindow.cxx b/sd/source/ui/annotations/annotationwindow.cxx
index 30193afc474a..5bafcbf1e6d5 100644
--- a/sd/source/ui/annotations/annotationwindow.cxx
+++ b/sd/source/ui/annotations/annotationwindow.cxx
@@ -137,7 +137,7 @@ void AnnotationTextWindow::KeyInput( const KeyEvent& rKeyEvt )
     }
     else
     {
-        long aOldHeight = mpAnnotationWindow->GetPostItTextHeight();
+        ::tools::Long aOldHeight = mpAnnotationWindow->GetPostItTextHeight();
         bool bDone = false;
 
         /// HACK: need to switch off processing of Undo/Redo in Outliner
@@ -341,7 +341,7 @@ void AnnotationWindow::Rescale()
     if ( mpMeta )
     {
         vcl::Font aFont( mpMeta->GetSettings().GetStyleSettings().GetLabelFont() );
-        sal_Int32 nHeight = long(aFont.GetFontHeight() * aMode.GetScaleY());
+        sal_Int32 nHeight = ::tools::Long(aFont.GetFontHeight() * aMode.GetScaleY());
         aFont.SetFontHeight( nHeight );
         mpMeta->SetControlFont( aFont );
     }
@@ -350,10 +350,10 @@ void AnnotationWindow::Rescale()
 void AnnotationWindow::DoResize()
 {
     unsigned long aWidth    =   GetSizePixel().Width();
-    long aHeight            =   GetSizePixel().Height() - POSTIT_META_HEIGHT;
+    ::tools::Long aHeight            =   GetSizePixel().Height() - POSTIT_META_HEIGHT;
 
     mpOutliner->SetPaperSize( PixelToLogic( Size(aWidth,aHeight) ) ) ;
-    long aTextHeight        =   LogicToPixel( mpOutliner->CalcTextSize()).Height();
+    ::tools::Long aTextHeight        =   LogicToPixel( mpOutliner->CalcTextSize()).Height();
 
     if( aTextHeight > aHeight )
     {   // we need vertical scrollbars and have to reduce the width
@@ -408,7 +408,7 @@ void AnnotationWindow::SetScrollbar()
     mpVScrollbar->SetThumbPos(mpOutlinerView->GetVisArea().Top());
 }
 
-void AnnotationWindow::ResizeIfNecessary(long aOldHeight, long aNewHeight)
+void AnnotationWindow::ResizeIfNecessary(::tools::Long aOldHeight, ::tools::Long aNewHeight)
 {
     if (aOldHeight != aNewHeight)
     {
@@ -447,14 +447,14 @@ void AnnotationWindow::ToggleInsMode()
     }
 }
 
-long AnnotationWindow::GetPostItTextHeight()
+::tools::Long AnnotationWindow::GetPostItTextHeight()
 {
     return mpOutliner ? LogicToPixel(mpOutliner->CalcTextSize()).Height() : 0;
 }
 
 IMPL_LINK(AnnotationWindow, ScrollHdl, ScrollBar*, pScroll, void)
 {
-    long nDiff = getView()->GetEditView().GetVisArea().Top() - pScroll->GetThumbPos();
+    ::tools::Long nDiff = getView()->GetEditView().GetVisArea().Top() - pScroll->GetThumbPos();
     getView()->Scroll( 0, nDiff );
 }
 
diff --git a/sd/source/ui/annotations/annotationwindow.hxx b/sd/source/ui/annotations/annotationwindow.hxx
index 0db64ef309a9..c57b4bdfce93 100644
--- a/sd/source/ui/annotations/annotationwindow.hxx
+++ b/sd/source/ui/annotations/annotationwindow.hxx
@@ -24,7 +24,7 @@
 #include <vcl/floatwin.hxx>
 #include <vcl/fixed.hxx>
 #include <vcl/scrbar.hxx>
-
+#include <tools/long.hxx>
 #include <basegfx/polygon/b2dpolygon.hxx>
 
 namespace com::sun::star::office { class XAnnotation; }
@@ -104,11 +104,11 @@ class AnnotationWindow : public FloatingWindow
         ::Outliner*             Engine()        { return mpOutliner.get(); }
         SdDrawDocument*         Doc()           { return mpDoc; }
 
-        long            GetPostItTextHeight();
+        ::tools::Long            GetPostItTextHeight();
 
         void            InitControls();
         void            DoResize();
-        void            ResizeIfNecessary(long aOldHeight, long aNewHeight);
+        void            ResizeIfNecessary(::tools::Long aOldHeight, ::tools::Long aNewHeight);
         void            SetScrollbar();
 
         void            Rescale();
diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx
index b94015b942af..d749d2c73644 100644
--- a/sd/source/ui/app/sdmod2.cxx
+++ b/sd/source/ui/app/sdmod2.cxx
@@ -89,7 +89,7 @@ static SdPage* GetCurrentPage( sd::ViewShell const * pViewSh, EditFieldInfo cons
         // outline mode
         int nPgNum = 0;
         Outliner& rOutl = pSdView->GetOutliner();
-        long nPos = pInfo->GetPara();
+        tools::Long nPos = pInfo->GetPara();
         sal_Int32 nParaPos = 0;
 
         for( Paragraph* pPara = rOutl.GetParagraph( 0 ); pPara && nPos >= 0; pPara = rOutl.GetParagraph( ++nParaPos ), nPos-- )
diff --git a/sd/source/ui/dlg/BulletAndPositionDlg.cxx b/sd/source/ui/dlg/BulletAndPositionDlg.cxx
index 45e2a1dffc41..b3208cf827f0 100644
--- a/sd/source/ui/dlg/BulletAndPositionDlg.cxx
+++ b/sd/source/ui/dlg/BulletAndPositionDlg.cxx
@@ -566,18 +566,18 @@ void SvxBulletAndPositionDlg::InitControls()
 
     if (bSameDistBorderNum)
     {
-        long nDistBorderNum;
+        tools::Long nDistBorderNum;
         if (bRelative)
         {
-            nDistBorderNum = static_cast<long>(aNumFmtArr[nLvl]->GetAbsLSpace())
+            nDistBorderNum = static_cast<tools::Long>(aNumFmtArr[nLvl]->GetAbsLSpace())
                              + aNumFmtArr[nLvl]->GetFirstLineOffset();
             if (nLvl)
-                nDistBorderNum -= static_cast<long>(aNumFmtArr[nLvl - 1]->GetAbsLSpace())
+                nDistBorderNum -= static_cast<tools::Long>(aNumFmtArr[nLvl - 1]->GetAbsLSpace())
                                   + aNumFmtArr[nLvl - 1]->GetFirstLineOffset();
         }
         else
         {
-            nDistBorderNum = static_cast<long>(aNumFmtArr[nLvl]->GetAbsLSpace())
+            nDistBorderNum = static_cast<tools::Long>(aNumFmtArr[nLvl]->GetAbsLSpace())
                              + aNumFmtArr[nLvl]->GetFirstLineOffset();
         }
         SetMetricValue(*m_xDistBorderMF, nDistBorderNum, eCoreUnit);
@@ -976,10 +976,10 @@ IMPL_LINK(SvxBulletAndPositionDlg, SizeHdl_Impl, weld::MetricSpinButton&, rField
     bool bWidth = &rField == m_xWidthMF.get();
     bLastWidthModified = bWidth;
     bool bRatio = m_xRatioCB->get_active();
-    long nWidthVal
-        = static_cast<long>(m_xWidthMF->denormalize(m_xWidthMF->get_value(FieldUnit::MM_100TH)));
-    long nHeightVal
-        = static_cast<long>(m_xHeightMF->denormalize(m_xHeightMF->get_value(FieldUnit::MM_100TH)));
+    tools::Long nWidthVal = static_cast<tools::Long>(
+        m_xWidthMF->denormalize(m_xWidthMF->get_value(FieldUnit::MM_100TH)));
+    tools::Long nHeightVal = static_cast<tools::Long>(
+        m_xHeightMF->denormalize(m_xHeightMF->get_value(FieldUnit::MM_100TH)));
     nWidthVal = OutputDevice::LogicToLogic(nWidthVal, MapUnit::Map100thMM, eCoreUnit);
     nHeightVal = OutputDevice::LogicToLogic(nHeightVal, MapUnit::Map100thMM, eCoreUnit);
     double fSizeRatio;
@@ -1004,13 +1004,13 @@ IMPL_LINK(SvxBulletAndPositionDlg, SizeHdl_Impl, weld::MetricSpinButton&, rField
 
                 if (bWidth)
                 {
-                    long nDelta = nWidthVal - aInitSize[i].Width();
+                    tools::Long nDelta = nWidthVal - aInitSize[i].Width();
                     aSize.setWidth(nWidthVal);
                     if (bRatio)
                     {
                         aSize.setHeight(
                             aInitSize[i].Height()
-                            + static_cast<long>(static_cast<double>(nDelta) / fSizeRatio));
+                            + static_cast<tools::Long>(static_cast<double>(nDelta) / fSizeRatio));
                         m_xHeightMF->set_value(m_xHeightMF->normalize(OutputDevice::LogicToLogic(
                                                    aSize.Height(), eCoreUnit, MapUnit::Map100thMM)),
                                                FieldUnit::MM_100TH);
@@ -1018,13 +1018,13 @@ IMPL_LINK(SvxBulletAndPositionDlg, SizeHdl_Impl, weld::MetricSpinButton&, rField
                 }
                 else
                 {
-                    long nDelta = nHeightVal - aInitSize[i].Height();
+                    tools::Long nDelta = nHeightVal - aInitSize[i].Height();
                     aSize.setHeight(nHeightVal);
                     if (bRatio)
                     {
                         aSize.setWidth(
                             aInitSize[i].Width()
-                            + static_cast<long>(static_cast<double>(nDelta) * fSizeRatio));
+                            + static_cast<tools::Long>(static_cast<double>(nDelta) * fSizeRatio));
                         m_xWidthMF->set_value(m_xWidthMF->normalize(OutputDevice::LogicToLogic(
                                                   aSize.Width(), eCoreUnit, MapUnit::Map100thMM)),
                                               FieldUnit::MM_100TH);
@@ -1128,7 +1128,7 @@ IMPL_LINK(SvxBulletAndPositionDlg, DistanceHdl_Impl, weld::MetricSpinButton&, rF
 {
     if (bInInitControl)
         return;
-    long nValue = GetCoreValue(rFld, eCoreUnit);
+    tools::Long nValue = GetCoreValue(rFld, eCoreUnit);
     sal_uInt16 nMask = 1;
     for (sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
     {
@@ -1146,9 +1146,9 @@ IMPL_LINK(SvxBulletAndPositionDlg, DistanceHdl_Impl, weld::MetricSpinButton&, rF
                     }
                     else
                     {
-                        long nTmp = pActNum->GetLevel(i - 1).GetAbsLSpace()
-                                    + pActNum->GetLevel(i - 1).GetFirstLineOffset()
-                                    - pActNum->GetLevel(i).GetFirstLineOffset();
+                        tools::Long nTmp = pActNum->GetLevel(i - 1).GetAbsLSpace()
+                                           + pActNum->GetLevel(i - 1).GetFirstLineOffset()
+                                           - pActNum->GetLevel(i).GetFirstLineOffset();
 
                         aNumFmt.SetAbsLSpace(nValue + nTmp);
                     }
@@ -1161,7 +1161,7 @@ IMPL_LINK(SvxBulletAndPositionDlg, DistanceHdl_Impl, weld::MetricSpinButton&, rF
             else if (&rFld == m_xIndentMF.get())
             {
                 // together with the FirstLineOffset the AbsLSpace must be changed, too
-                long nDiff = nValue + aNumFmt.GetFirstLineOffset();
+                tools::Long nDiff = nValue + aNumFmt.GetFirstLineOffset();
                 auto const nAbsLSpace = aNumFmt.GetAbsLSpace();
                 aNumFmt.SetAbsLSpace(nAbsLSpace + nDiff);
                 aNumFmt.SetFirstLineOffset(-nValue);
@@ -1188,7 +1188,7 @@ IMPL_LINK(SvxBulletAndPositionDlg, RelativeHdl_Impl, weld::ToggleButton&, rBox,
     bool bOn = rBox.get_active();
     bool bSingleSelection = m_xLevelLB->count_selected_rows() == 1 && SAL_MAX_UINT16 != nActNumLvl;
     bool bSetValue = false;
-    long nValue = 0;
+    tools::Long nValue = 0;
     if (bOn || bSingleSelection)
     {
         sal_uInt16 nMask = 1;
diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx
index 4f2cf6d8dce4..e900ffb45e88 100644
--- a/sd/source/ui/dlg/animobjs.cxx
+++ b/sd/source/ui/dlg/animobjs.cxx
@@ -90,8 +90,8 @@ void SdDisplay::Paint(vcl::RenderContext& rRenderContext, const ::tools::Rectang
     Size aSize = GetOutputSizePixel();
 
     Size aBmpSize = aBitmapEx.GetBitmap().GetSizePixel();
-    aBmpSize.setWidth( static_cast<long>( static_cast<double>(aBmpSize.Width()) * static_cast<double>(aScale) ) );
-    aBmpSize.setHeight( static_cast<long>( static_cast<double>(aBmpSize.Height()) * static_cast<double>(aScale) ) );
+    aBmpSize.setWidth( static_cast<::tools::Long>( static_cast<double>(aBmpSize.Width()) * static_cast<double>(aScale) ) );
+    aBmpSize.setHeight( static_cast<::tools::Long>( static_cast<double>(aBmpSize.Height()) * static_cast<double>(aScale) ) );
 
     if( aBmpSize.Width() < aSize.Width() )
         aPt.setX( ( aSize.Width() - aBmpSize.Width() ) / 2 );
@@ -256,7 +256,7 @@ IMPL_LINK( AnimationWindow, ClickPlayHdl, weld::Button&, rButton, void )
 
     // calculate overall time
     ::tools::Time aTime( 0 );
-    long nFullTime;
+    ::tools::Long nFullTime;
     if( m_xRbtBitmap->get_active() )
     {
         for (size_t i = 0; i < nCount; ++i)
@@ -738,7 +738,7 @@ void AnimationWindow::AddObj (::sd::View& rView )
                             m_xLbLoopCount->set_active_text(OUString::number( nLoopCount ) );
                     }
 
-                    long nTime = rAnimationBitmap.mnWait;
+                    ::tools::Long nTime = rAnimationBitmap.mnWait;
                     ::tools::Time aTime( 0, 0, nTime / 100, nTime % 100 );
                     size_t nIndex = m_nCurrentFrame + 1;
                     m_FrameList.insert(
@@ -908,7 +908,7 @@ void AnimationWindow::CreateAnimObj (::sd::View& rView )
         for (size_t i = 0; i < nCount; ++i)
         {
             ::tools::Time const & rTime = m_FrameList[i].second;
-            long  nTime = rTime.GetNanoSec();
+            ::tools::Long  nTime = rTime.GetNanoSec();
             nTime += rTime.GetSec() * 100;
 
             BitmapEx const & rBitmapEx = m_FrameList[i].first;
diff --git a/sd/source/ui/dlg/copydlg.cxx b/sd/source/ui/dlg/copydlg.cxx
index 08d6dac24aef..398f9e4ee567 100644
--- a/sd/source/ui/dlg/copydlg.cxx
+++ b/sd/source/ui/dlg/copydlg.cxx
@@ -94,10 +94,10 @@ void CopyDlg::Reset()
     // tdf#125011 draw/impress sizes are in mm_100th already, "normalize" to
     // decimal shift by number of decimal places the widgets are using (2) then
     // scale by the ui scaling factor
-    auto nPageWidth = long(m_xMtrFldMoveX->normalize(aPageSize.Width()) / maUIScale);
-    auto nPageHeight = long(m_xMtrFldMoveX->normalize(aPageSize.Height()) / maUIScale);
-    auto nRectWidth = long(m_xMtrFldMoveX->normalize(aRect.GetWidth()) / maUIScale);
-    auto nRectHeight = long(m_xMtrFldMoveX->normalize(aRect.GetHeight()) / maUIScale);
+    auto nPageWidth = tools::Long(m_xMtrFldMoveX->normalize(aPageSize.Width()) / maUIScale);
+    auto nPageHeight = tools::Long(m_xMtrFldMoveX->normalize(aPageSize.Height()) / maUIScale);
+    auto nRectWidth = tools::Long(m_xMtrFldMoveX->normalize(aRect.GetWidth()) / maUIScale);
+    auto nRectHeight = tools::Long(m_xMtrFldMoveX->normalize(aRect.GetHeight()) / maUIScale);
 
     m_xMtrFldMoveX->set_range(-nPageWidth, nPageWidth, FieldUnit::MM_100TH);
     m_xMtrFldMoveY->set_range(-nPageHeight, nPageHeight, FieldUnit::MM_100TH);
@@ -120,30 +120,30 @@ void CopyDlg::Reset()
         else
             m_xNumFldCopies->set_value(1);
 
-        long nMoveX = 500;
+        tools::Long nMoveX = 500;
         if( SfxItemState::SET == mrOutAttrs.GetItemState( ATTR_COPY_MOVE_X, true, &pPoolItem ) )
             nMoveX = static_cast<const SfxInt32Item*>( pPoolItem )->GetValue();
-        SetMetricValue( *m_xMtrFldMoveX, long(nMoveX / maUIScale), MapUnit::Map100thMM);
+        SetMetricValue( *m_xMtrFldMoveX, tools::Long(nMoveX / maUIScale), MapUnit::Map100thMM);
 
-        long nMoveY = 500;
+        tools::Long nMoveY = 500;
         if( SfxItemState::SET == mrOutAttrs.GetItemState( ATTR_COPY_MOVE_Y, true, &pPoolItem ) )
             nMoveY = static_cast<const SfxInt32Item*>( pPoolItem )->GetValue();
-        SetMetricValue( *m_xMtrFldMoveY, long(nMoveY / maUIScale), MapUnit::Map100thMM);
+        SetMetricValue( *m_xMtrFldMoveY, tools::Long(nMoveY / maUIScale), MapUnit::Map100thMM);
 
         if( SfxItemState::SET == mrOutAttrs.GetItemState( ATTR_COPY_ANGLE, true, &pPoolItem ) )
             m_xMtrFldAngle->set_value(static_cast<const SfxInt32Item*>( pPoolItem )->GetValue(), FieldUnit::NONE);
         else
             m_xMtrFldAngle->set_value(0, FieldUnit::NONE);
 
-        long nWidth = 0;
+        tools::Long nWidth = 0;
         if( SfxItemState::SET == mrOutAttrs.GetItemState( ATTR_COPY_WIDTH, true, &pPoolItem ) )
             nWidth = static_cast<const SfxInt32Item*>( pPoolItem )->GetValue();
-        SetMetricValue( *m_xMtrFldWidth, long(nWidth / maUIScale), MapUnit::Map100thMM);
+        SetMetricValue( *m_xMtrFldWidth, tools::Long(nWidth / maUIScale), MapUnit::Map100thMM);
 
-        long nHeight = 0;
+        tools::Long nHeight = 0;
         if( SfxItemState::SET == mrOutAttrs.GetItemState( ATTR_COPY_HEIGHT, true, &pPoolItem ) )
             nHeight = static_cast<const SfxInt32Item*>( pPoolItem )->GetValue();
-        SetMetricValue( *m_xMtrFldHeight, long(nHeight / maUIScale), MapUnit::Map100thMM);
+        SetMetricValue( *m_xMtrFldHeight, tools::Long(nHeight / maUIScale), MapUnit::Map100thMM);
 
         if( SfxItemState::SET == mrOutAttrs.GetItemState( ATTR_COPY_START_COLOR, true, &pPoolItem ) )
         {
@@ -179,10 +179,10 @@ void CopyDlg::Reset()
  */
 void CopyDlg::GetAttr( SfxItemSet& rOutAttrs )
 {
-    long nMoveX = long( GetCoreValue( *m_xMtrFldMoveX, MapUnit::Map100thMM) * maUIScale);
-    long nMoveY = long( GetCoreValue( *m_xMtrFldMoveY, MapUnit::Map100thMM) * maUIScale);
-    long nHeight = long( GetCoreValue( *m_xMtrFldHeight, MapUnit::Map100thMM) * maUIScale);
-    long nWidth  = long( GetCoreValue( *m_xMtrFldWidth, MapUnit::Map100thMM) * maUIScale);
+    tools::Long nMoveX = tools::Long( GetCoreValue( *m_xMtrFldMoveX, MapUnit::Map100thMM) * maUIScale);
+    tools::Long nMoveY = tools::Long( GetCoreValue( *m_xMtrFldMoveY, MapUnit::Map100thMM) * maUIScale);
+    tools::Long nHeight = tools::Long( GetCoreValue( *m_xMtrFldHeight, MapUnit::Map100thMM) * maUIScale);
+    tools::Long nWidth  = tools::Long( GetCoreValue( *m_xMtrFldWidth, MapUnit::Map100thMM) * maUIScale);
 
     rOutAttrs.Put( SfxUInt16Item( ATTR_COPY_NUMBER, static_cast<sal_uInt16>(m_xNumFldCopies->get_value()) ) );
     rOutAttrs.Put( SfxInt32Item( ATTR_COPY_MOVE_X, nMoveX ) );
@@ -219,9 +219,9 @@ IMPL_LINK_NOARG(CopyDlg, SetViewData, weld::Button&, void)
 {
     ::tools::Rectangle aRect = mpView->GetAllMarkedRect();
 
-    SetMetricValue( *m_xMtrFldMoveX, long( aRect.GetWidth() /
+    SetMetricValue( *m_xMtrFldMoveX, tools::Long( aRect.GetWidth() /
                                     maUIScale ), MapUnit::Map100thMM);
-    SetMetricValue( *m_xMtrFldMoveY, long( aRect.GetHeight() /
+    SetMetricValue( *m_xMtrFldMoveY, tools::Long( aRect.GetHeight() /
                                     maUIScale ), MapUnit::Map100thMM);
 
     // sets color attribute
@@ -240,14 +240,14 @@ IMPL_LINK_NOARG(CopyDlg, SetDefault, weld::Button&, void)
 {
     m_xNumFldCopies->set_value(1);
 
-    long nValue = 500;
-    SetMetricValue( *m_xMtrFldMoveX, long(nValue / maUIScale), MapUnit::Map100thMM);
-    SetMetricValue( *m_xMtrFldMoveY, long(nValue / maUIScale), MapUnit::Map100thMM);
+    tools::Long nValue = 500;
+    SetMetricValue( *m_xMtrFldMoveX, tools::Long(nValue / maUIScale), MapUnit::Map100thMM);
+    SetMetricValue( *m_xMtrFldMoveY, tools::Long(nValue / maUIScale), MapUnit::Map100thMM);
 
     nValue = 0;
     m_xMtrFldAngle->set_value(nValue, FieldUnit::DEGREE);
-    SetMetricValue( *m_xMtrFldWidth, long(nValue / maUIScale), MapUnit::Map100thMM);
-    SetMetricValue( *m_xMtrFldHeight, long(nValue / maUIScale), MapUnit::Map100thMM);
+    SetMetricValue( *m_xMtrFldWidth, tools::Long(nValue / maUIScale), MapUnit::Map100thMM);
+    SetMetricValue( *m_xMtrFldHeight, tools::Long(nValue / maUIScale), MapUnit::Map100thMM);
 
     // set color attribute
     const SfxPoolItem*  pPoolItem = nullptr;
diff --git a/sd/source/ui/dlg/custsdlg.cxx b/sd/source/ui/dlg/custsdlg.cxx
index dfb07394b904..c18e8c117e61 100644
--- a/sd/source/ui/dlg/custsdlg.cxx
+++ b/sd/source/ui/dlg/custsdlg.cxx
@@ -64,7 +64,7 @@ SdCustomShowDlg::SdCustomShowDlg(weld::Window* pWindow, SdDrawDocument& rDrawDoc
     pCustomShowList = rDoc.GetCustomShowList();
     if( pCustomShowList )
     {
-        long nPosToSelect = pCustomShowList->GetCurPos();
+        tools::Long nPosToSelect = pCustomShowList->GetCurPos();
         // fill ListBox with CustomShows
         for( SdCustomShow* pCustomShow = pCustomShowList->First();
              pCustomShow != nullptr;
@@ -287,7 +287,7 @@ SdDefineCustomShowDlg::SdDefineCustomShowDlg(weld::Window* pWindow, SdDrawDocume
     m_xLbCustomPages->set_size_request(m_xLbPages->get_approximate_digit_width() * 24, m_xLbCustomPages->get_height_rows(10));
 
     // fill Listbox with page names of Docs
-    for( long nPage = 0;
+    for( tools::Long nPage = 0;
          nPage < rDoc.GetSdPageCount( PageKind::Standard );
          nPage++ )
     {
@@ -464,7 +464,7 @@ IMPL_LINK_NOARG(SdDefineCustomShowDlg, OKHdl, weld::Button&, void)
         OUString aName( m_xEdtName->get_text() );
         SdCustomShow* pCustomShow;
 
-        long nPosToSelect = pCustomShowList->GetCurPos();
+        tools::Long nPosToSelect = pCustomShowList->GetCurPos();
         for( pCustomShow = pCustomShowList->First();
              pCustomShow != nullptr;
              pCustomShow = pCustomShowList->Next() )
diff --git a/sd/source/ui/dlg/dlgsnap.cxx b/sd/source/ui/dlg/dlgsnap.cxx
index e2db2e8cbc59..f7d8e2ef79c3 100644
--- a/sd/source/ui/dlg/dlgsnap.cxx
+++ b/sd/source/ui/dlg/dlgsnap.cxx
@@ -74,7 +74,7 @@ SdSnapLineDlg::SdSnapLineDlg(weld::Window* pWindow, const SfxItemSet& rInAttrs,
 
     // determine max and min values depending on
     // WorkArea, PoolUnit and FieldUnit:
-    auto const map = [ePoolUnit](std::unique_ptr<weld::MetricSpinButton> const & msb, long value) {
+    auto const map = [ePoolUnit](std::unique_ptr<weld::MetricSpinButton> const & msb, tools::Long value) {
             auto const n1 = OutputDevice::LogicToLogic(value, ePoolUnit, MapUnit::Map100thMM);
             auto const n2 = msb->normalize(n1);
             auto const n3 = msb->convert_value_from(n2, FieldUnit::MM_100TH);
diff --git a/sd/source/ui/dlg/headerfooterdlg.cxx b/sd/source/ui/dlg/headerfooterdlg.cxx
index 5b674925163a..ecd69fc1ca35 100644
--- a/sd/source/ui/dlg/headerfooterdlg.cxx
+++ b/sd/source/ui/dlg/headerfooterdlg.cxx
@@ -706,12 +706,12 @@ void PresLayoutPreview::Paint(vcl::RenderContext& rRenderContext, const ::tools:
     if( maPageSize.Width() > maPageSize.Height() )
     {
         nWidth = maOutRect.GetWidth();
-        nHeight = maPageSize.Width() == 0 ? 0 : long( static_cast<double>(nWidth * maPageSize.Height()) / static_cast<double>(maPageSize.Width()) );
+        nHeight = maPageSize.Width() == 0 ? 0 : tools::Long( static_cast<double>(nWidth * maPageSize.Height()) / static_cast<double>(maPageSize.Width()) );
     }
     else
     {
         nHeight = maOutRect.GetHeight();
-        nWidth = maPageSize.Height() == 0 ? 0 : long( static_cast<double>(nHeight * maPageSize.Width()) / static_cast<double>(maPageSize.Height()) );
+        nWidth = maPageSize.Height() == 0 ? 0 : tools::Long( static_cast<double>(nHeight * maPageSize.Width()) / static_cast<double>(maPageSize.Height()) );
     }
 
     maOutRect.AdjustLeft((maOutRect.GetWidth() - nWidth) >> 1 );
diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx
index d3d2e95ca4e0..6f431d713307 100644
--- a/sd/source/ui/dlg/navigatr.cxx
+++ b/sd/source/ui/dlg/navigatr.cxx
@@ -311,7 +311,7 @@ IMPL_LINK_NOARG(SdNavigatorWin, ClickObjectHdl, weld::TreeView&, bool)
 IMPL_LINK_NOARG(SdNavigatorWin, SelectDocumentHdl, weld::ComboBox&, void)
 {
     OUString aStrLb = mxLbDocs->get_active_text();
-    long   nPos = mxLbDocs->get_active();
+    tools::Long   nPos = mxLbDocs->get_active();
     bool   bFound = false;
     ::sd::DrawDocShell* pDocShell = nullptr;

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list