diff options
author | Noel <noelgrandin@gmail.com> | 2020-10-21 15:31:38 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-10-23 08:48:52 +0200 |
commit | 0d79d216886a71436e705c93829ed66a33270a9c (patch) | |
tree | ef29702266bca9df9f39b442505479b013891517 | |
parent | e8205f38c611cfc97ca0e32c911b3d373a94d230 (diff) |
long->tools::Long in pyuno..sd
Change-Id: I67c1218d225f49ea9ce789433283ab85275e39a5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104627
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
103 files changed, 642 insertions, 638 deletions
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; NavDocInfo* pInfo = GetDocInfo(); diff --git a/sd/source/ui/dlg/present.cxx b/sd/source/ui/dlg/present.cxx index bd06661554cb..bf4fb696e12a 100644 --- a/sd/source/ui/dlg/present.cxx +++ b/sd/source/ui/dlg/present.cxx @@ -115,7 +115,7 @@ SdStartPresentationDlg::SdStartPresentationDlg(weld::Window* pWindow, const SfxI const bool bEndless = static_cast<const SfxBoolItem&>( rOutAttrs.Get( ATTR_PRESENT_ENDLESS ) ).GetValue(); const bool bWindow = !static_cast<const SfxBoolItem&>( rOutAttrs.Get( ATTR_PRESENT_FULLSCREEN ) ).GetValue(); - const long nPause = static_cast<const SfxUInt32Item&>( rOutAttrs.Get( ATTR_PRESENT_PAUSE_TIMEOUT ) ).GetValue(); + const tools::Long nPause = static_cast<const SfxUInt32Item&>( rOutAttrs.Get( ATTR_PRESENT_PAUSE_TIMEOUT ) ).GetValue(); m_xFormatter->SetTime( tools::Time( 0, 0, nPause ) ); // set cursor in timefield to end diff --git a/sd/source/ui/dlg/sdpreslt.cxx b/sd/source/ui/dlg/sdpreslt.cxx index 6cc2ec279f28..bfd0c9ea5513 100644 --- a/sd/source/ui/dlg/sdpreslt.cxx +++ b/sd/source/ui/dlg/sdpreslt.cxx @@ -67,7 +67,7 @@ SdPresLayoutDlg::~SdPresLayoutDlg() void SdPresLayoutDlg::Reset() { const SfxPoolItem *pPoolItem = nullptr; - long nName; + tools::Long nName; // replace master page if( mrOutAttrs.GetItemState( ATTR_PRESLAYOUT_MASTER_PAGE, false, &pPoolItem ) == SfxItemState::SET ) diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx index 2331510efb5c..d011508a8866 100644 --- a/sd/source/ui/dlg/tpoption.cxx +++ b/sd/source/ui/dlg/tpoption.cxx @@ -277,7 +277,7 @@ void SdTpOptionsMisc::ActivatePage( const SfxItemSet& rSet ) const SfxUInt16Item* pItem = static_cast<const SfxUInt16Item*>(pAttr); - FieldUnit eFUnit = static_cast<FieldUnit>(static_cast<long>(pItem->GetValue())); + FieldUnit eFUnit = static_cast<FieldUnit>(static_cast<tools::Long>(pItem->GetValue())); if( eFUnit == m_xMtrFldOriginalWidth->get_unit() ) return; @@ -546,7 +546,7 @@ bool SdTpOptionsMisc::SetScale( const OUString& aScale, sal_Int32& rX, sal_Int32 if (!comphelper::string::isdigitAsciiString(aTmp)) return false; - rX = static_cast<long>(aTmp.toInt32()); + rX = static_cast<tools::Long>(aTmp.toInt32()); if( rX == 0 ) return false; @@ -557,7 +557,7 @@ bool SdTpOptionsMisc::SetScale( const OUString& aScale, sal_Int32& rX, sal_Int32 if (!comphelper::string::isdigitAsciiString(aTmp)) return false; - rY = static_cast<long>(aTmp.toInt32()); + rY = static_cast<tools::Long>(aTmp.toInt32()); return rY != 0; } diff --git a/sd/source/ui/dlg/vectdlg.cxx b/sd/source/ui/dlg/vectdlg.cxx index dce0e837ac38..e84b4cce95f4 100644 --- a/sd/source/ui/dlg/vectdlg.cxx +++ b/sd/source/ui/dlg/vectdlg.cxx @@ -79,13 +79,13 @@ SdVectorizeDlg::~SdVectorizeDlg() if( fGrfWH < fWinWH ) { - aBmpSize.setWidth( static_cast<long>( rDispSize.Height() * fGrfWH ) ); + aBmpSize.setWidth( static_cast<tools::Long>( rDispSize.Height() * fGrfWH ) ); aBmpSize.setHeight( rDispSize.Height() ); } else { aBmpSize.setWidth( rDispSize.Width() ); - aBmpSize.setHeight( static_cast<long>( rDispSize.Width() / fGrfWH) ); + aBmpSize.setHeight( static_cast<tools::Long>( rDispSize.Width() / fGrfWH) ); } const Point aBmpPos( ( rDispSize.Width() - aBmpSize.Width() ) >> 1, @@ -147,26 +147,26 @@ void SdVectorizeDlg::Calculate( Bitmap const & rBmp, GDIMetaFile& rMtf ) if( pRAcc ) { - const long nWidth = pRAcc->Width(); - const long nHeight = pRAcc->Height(); - const long nTileX = m_xMtFillHoles->get_value(FieldUnit::NONE); - const long nTileY = m_xMtFillHoles->get_value(FieldUnit::NONE); + const tools::Long nWidth = pRAcc->Width(); + const tools::Long nHeight = pRAcc->Height(); + const tools::Long nTileX = m_xMtFillHoles->get_value(FieldUnit::NONE); + const tools::Long nTileY = m_xMtFillHoles->get_value(FieldUnit::NONE); assert(nTileX && "div-by-zero"); - const long nCountX = nWidth / nTileX; + const tools::Long nCountX = nWidth / nTileX; assert(nTileY && "div-by-zero"); - const long nCountY = nHeight / nTileY; - const long nRestX = nWidth % nTileX; - const long nRestY = nHeight % nTileY; + const tools::Long nCountY = nHeight / nTileY; + const tools::Long nRestX = nWidth % nTileX; + const tools::Long nRestY = nHeight % nTileY; MapMode aMap( rMtf.GetPrefMapMode() ); aNewMtf.SetPrefSize( rMtf.GetPrefSize() ); aNewMtf.SetPrefMapMode( aMap ); - for( long nTY = 0; nTY < nCountY; nTY++ ) + for( tools::Long nTY = 0; nTY < nCountY; nTY++ ) { - const long nY = nTY * nTileY; + const tools::Long nY = nTY * nTileY; - for( long nTX = 0; nTX < nCountX; nTX++ ) + for( tools::Long nTX = 0; nTX < nCountX; nTX++ ) AddTile( pRAcc.get(), aNewMtf, nTX * nTileX, nTY * nTileY, nTileX, nTileY ); if( nRestX ) @@ -175,9 +175,9 @@ void SdVectorizeDlg::Calculate( Bitmap const & rBmp, GDIMetaFile& rMtf ) if( nRestY ) { - const long nY = nCountY * nTileY; + const tools::Long nY = nCountY * nTileY; - for( long nTX = 0; nTX < nCountX; nTX++ ) + for( tools::Long nTX = 0; nTX < nCountX; nTX++ ) AddTile( pRAcc.get(), aNewMtf, nTX * nTileX, nY, nTileX, nRestY ); if( nRestX ) @@ -202,16 +202,16 @@ void SdVectorizeDlg::Calculate( Bitmap const & rBmp, GDIMetaFile& rMtf ) } void SdVectorizeDlg::AddTile( BitmapReadAccess const * pRAcc, GDIMetaFile& rMtf, - long nPosX, long nPosY, long nWidth, long nHeight ) + tools::Long nPosX, tools::Long nPosY, tools::Long nWidth, tools::Long nHeight ) { sal_uLong nSumR = 0, nSumG = 0, nSumB = 0; - const long nRight = nPosX + nWidth - 1; - const long nBottom = nPosY + nHeight - 1; + const tools::Long nRight = nPosX + nWidth - 1; + const tools::Long nBottom = nPosY + nHeight - 1; const double fMult = 1.0 / ( nWidth * nHeight ); - for( long nY = nPosY; nY <= nBottom; nY++ ) + for( tools::Long nY = nPosY; nY <= nBottom; nY++ ) { - for( long nX = nPosX; nX <= nRight; nX++ ) + for( tools::Long nX = nPosX; nX <= nRight; nX++ ) { const BitmapColor aPixel( pRAcc->GetColor( nY, nX ) ); @@ -241,7 +241,7 @@ void SdVectorizeDlg::AddTile( BitmapReadAccess const * pRAcc, GDIMetaFile& rMtf, rMtf.AddAction( new MetaRectAction( aRect ) ); } -IMPL_LINK( SdVectorizeDlg, ProgressHdl, long, nData, void ) +IMPL_LINK( SdVectorizeDlg, ProgressHdl, tools::Long, nData, void ) { m_xPrgs->set_percentage(nData); } diff --git a/sd/source/ui/docshell/sdclient.cxx b/sd/source/ui/docshell/sdclient.cxx index 41c3f73406ea..de684f8c061a 100644 --- a/sd/source/ui/docshell/sdclient.cxx +++ b/sd/source/ui/docshell/sdclient.cxx @@ -161,8 +161,8 @@ void Client::ViewChanged() Size aSize = pSdrOle2Obj->GetOrigObjSize( &aMap100 ); aVisArea.SetSize( aSize ); - Size aScaledSize( static_cast< long >( GetScaleWidth() * Fraction( aVisArea.GetWidth() ) ), - static_cast< long >( GetScaleHeight() * Fraction( aVisArea.GetHeight() ) ) ); + Size aScaledSize( static_cast< ::tools::Long >( GetScaleWidth() * Fraction( aVisArea.GetWidth() ) ), + static_cast< ::tools::Long >( GetScaleHeight() * Fraction( aVisArea.GetHeight() ) ) ); // react to the change if the difference is bigger than one pixel Size aPixelDiff = diff --git a/sd/source/ui/func/fucon3d.cxx b/sd/source/ui/func/fucon3d.cxx index f8cfa6a1ffe2..81d4919928b0 100644 --- a/sd/source/ui/func/fucon3d.cxx +++ b/sd/source/ui/func/fucon3d.cxx @@ -389,7 +389,7 @@ SdrObjectUniquePtr FuConstruct3dObject::CreateDefaultObject(const sal_uInt16 nID basegfx::B3DRange aVolume(aObjVol); double fW(aVolume.getWidth()); double fH(aVolume.getHeight()); - ::tools::Rectangle a3DRect(0, 0, static_cast<long>(fW), static_cast<long>(fH)); + ::tools::Rectangle a3DRect(0, 0, static_cast<::tools::Long>(fW), static_cast<::tools::Long>(fH)); std::unique_ptr< E3dScene, SdrObjectFreeOp > pScene(new E3dScene(*mpDoc)); // copied code from E3dView::InitScene diff --git a/sd/source/ui/func/fuconarc.cxx b/sd/source/ui/func/fuconarc.cxx index 8a968d351051..e42db7025863 100644 --- a/sd/source/ui/func/fuconarc.cxx +++ b/sd/source/ui/func/fuconarc.cxx @@ -94,8 +94,8 @@ void FuConstructArc::DoExecute( SfxRequest& rReq ) mpView->getSdrModelFromSdrView(), ToSdrCircKind(static_cast<SdrObjKind>(mpView->GetCurrentObjIdentifier())), aNewRectangle, - static_cast<long>(pPhiStart->GetValue () * 10.0), - static_cast<long>(pPhiEnd->GetValue () * 10.0)); + static_cast<::tools::Long>(pPhiStart->GetValue () * 10.0), + static_cast<::tools::Long>(pPhiEnd->GetValue () * 10.0)); SdrPageView *pPV = mpView->GetSdrPageView(); mpView->InsertObjectAtView(pNewCircle, *pPV, SdrInsertFlags::SETDEFLAYER); diff --git a/sd/source/ui/func/fuconrec.cxx b/sd/source/ui/func/fuconrec.cxx index c0adb2266891..b74547587fc3 100644 --- a/sd/source/ui/func/fuconrec.cxx +++ b/sd/source/ui/func/fuconrec.cxx @@ -655,8 +655,8 @@ static ::basegfx::B2DPolyPolygon getPolygon(const char* pResId, const SdrModel& if( pLineEndList.is() ) { OUString aArrowName(SvxResId(pResId)); - long nCount = pLineEndList->Count(); - long nIndex; + ::tools::Long nCount = pLineEndList->Count(); + ::tools::Long nIndex; for( nIndex = 0; nIndex < nCount; nIndex++ ) { const XLineEndEntry* pEntry = pLineEndList->GetLineEnd(nIndex); @@ -730,12 +730,12 @@ void FuConstructRectangle::SetLineEnds(SfxItemSet& rAttr, SdrObject const & rObj // #i3908# Here, the default Line Start/End width for arrow construction is // set. To have the same value in all situations (construction) in i3908 // it was decided to change the default to 0.03 cm for all situations. - long nWidth = 300; // (1/100th mm) + ::tools::Long nWidth = 300; // (1/100th mm) // determine line width and calculate with it the line end width if( aSet.GetItemState( XATTR_LINEWIDTH ) != SfxItemState::DONTCARE ) { - long nValue = aSet.Get( XATTR_LINEWIDTH ).GetValue(); + ::tools::Long nValue = aSet.Get( XATTR_LINEWIDTH ).GetValue(); if( nValue > 0 ) nWidth = nValue * 3; } diff --git a/sd/source/ui/func/fucopy.cxx b/sd/source/ui/func/fucopy.cxx index d0461367ca56..8a10daaec5d6 100644 --- a/sd/source/ui/func/fucopy.cxx +++ b/sd/source/ui/func/fucopy.cxx @@ -183,14 +183,14 @@ void FuCopy::DoExecute( SfxRequest& rReq ) if( lWidth < 0 ) { - long nTmp = ( aRect.Right() - aRect.Left() ) / -lWidth; - nNumber = static_cast<sal_uInt16>(std::min( nTmp, static_cast<long>(nNumber) )); + ::tools::Long nTmp = ( aRect.Right() - aRect.Left() ) / -lWidth; + nNumber = static_cast<sal_uInt16>(std::min( nTmp, static_cast<::tools::Long>(nNumber) )); } if( lHeight < 0 ) { - long nTmp = ( aRect.Bottom() - aRect.Top() ) / -lHeight; - nNumber = static_cast<sal_uInt16>(std::min( nTmp, static_cast<long>(nNumber) )); + ::tools::Long nTmp = ( aRect.Bottom() - aRect.Top() ) / -lHeight; + nNumber = static_cast<sal_uInt16>(std::min( nTmp, static_cast<::tools::Long>(nNumber) )); } for( sal_uInt16 i = 1; i <= nNumber; i++ ) @@ -260,9 +260,9 @@ void FuCopy::DoExecute( SfxRequest& rReq ) if( bColor ) { // probably room for optimizations, but may can lead to rounding errors - sal_uInt8 nRed = aStartColor.GetRed() + static_cast<sal_uInt8>( ( static_cast<long>(aEndColor.GetRed()) - static_cast<long>(aStartColor.GetRed()) ) * static_cast<long>(i) / static_cast<long>(nNumber) ); - sal_uInt8 nGreen = aStartColor.GetGreen() + static_cast<sal_uInt8>( ( static_cast<long>(aEndColor.GetGreen()) - static_cast<long>(aStartColor.GetGreen()) ) * static_cast<long>(i) / static_cast<long>(nNumber) ); - sal_uInt8 nBlue = aStartColor.GetBlue() + static_cast<sal_uInt8>( ( static_cast<long>(aEndColor.GetBlue()) - static_cast<long>(aStartColor.GetBlue()) ) * static_cast<long>(i) / static_cast<long>(nNumber) ); + sal_uInt8 nRed = aStartColor.GetRed() + static_cast<sal_uInt8>( ( static_cast<::tools::Long>(aEndColor.GetRed()) - static_cast<::tools::Long>(aStartColor.GetRed()) ) * static_cast<::tools::Long>(i) / static_cast<::tools::Long>(nNumber) ); + sal_uInt8 nGreen = aStartColor.GetGreen() + static_cast<sal_uInt8>( ( static_cast<::tools::Long>(aEndColor.GetGreen()) - static_cast<::tools::Long>(aStartColor.GetGreen()) ) * static_cast<::tools::Long>(i) / static_cast<::tools::Long>(nNumber) ); + sal_uInt8 nBlue = aStartColor.GetBlue() + static_cast<sal_uInt8>( ( static_cast<::tools::Long>(aEndColor.GetBlue()) - static_cast<::tools::Long>(aStartColor.GetBlue()) ) * static_cast<::tools::Long>(i) / static_cast<::tools::Long>(nNumber) ); Color aNewColor( nRed, nGreen, nBlue ); SfxItemSet aNewSet( mpViewShell->GetPool(), svl::Items<XATTR_FILLSTYLE, XATTR_FILLCOLOR>{} ); aNewSet.Put( XFillStyleItem( drawing::FillStyle_SOLID ) ); diff --git a/sd/source/ui/func/fudraw.cxx b/sd/source/ui/func/fudraw.cxx index 46988c5f435f..0babe0a565c0 100644 --- a/sd/source/ui/func/fudraw.cxx +++ b/sd/source/ui/func/fudraw.cxx @@ -590,7 +590,7 @@ bool FuDraw::SetPointer(const SdrObject* pObj, const Point& rPos) const SdrLayerIDSet* pVisiLayer = &mpView->GetSdrPageView()->GetVisibleLayers(); sal_uInt16 nHitLog(sal_uInt16(mpWindow->PixelToLogic(Size(HITPIX, 0)).Width())); - long n2HitLog(nHitLog * 2); + ::tools::Long n2HitLog(nHitLog * 2); Point aHitPosR(rPos); Point aHitPosL(rPos); Point aHitPosT(rPos); diff --git a/sd/source/ui/func/fuediglu.cxx b/sd/source/ui/func/fuediglu.cxx index 678582736ceb..efbf255f3ef2 100644 --- a/sd/source/ui/func/fuediglu.cxx +++ b/sd/source/ui/func/fuediglu.cxx @@ -270,8 +270,8 @@ bool FuEditGluePoints::KeyInput(const KeyEvent& rKEvt) case KEY_RIGHT: { if(rKEvt.GetKeyCode().IsShift()&& mpView->IsInsGluePointMode() ){ - long nX = 0; - long nY = 0; + ::tools::Long nX = 0; + ::tools::Long nY = 0; sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode(); if (nCode == KEY_UP) { diff --git a/sd/source/ui/func/fulinend.cxx b/sd/source/ui/func/fulinend.cxx index 8d3886a6be4d..20280ec205f2 100644 --- a/sd/source/ui/func/fulinend.cxx +++ b/sd/source/ui/func/fulinend.cxx @@ -96,15 +96,15 @@ void FuLineEnd::DoExecute( SfxRequest& ) OUString aDesc( SdResId( STR_DESC_LINEEND ) ); OUString aName; - long nCount = pLineEndList->Count(); - long j = 1; + ::tools::Long nCount = pLineEndList->Count(); + ::tools::Long j = 1; bool bDifferent = false; while( !bDifferent ) { aName = aNewName + " " + OUString::number(j++); bDifferent = true; - for( long i = 0; i < nCount && bDifferent; i++ ) + for( ::tools::Long i = 0; i < nCount && bDifferent; i++ ) { if( aName == pLineEndList->GetLineEnd( i )->GetName() ) bDifferent = false; @@ -122,7 +122,7 @@ void FuLineEnd::DoExecute( SfxRequest& ) pDlg->GetName( aName ); bDifferent = true; - for( long i = 0; i < nCount && bDifferent; i++ ) + for( ::tools::Long i = 0; i < nCount && bDifferent; i++ ) { if( aName == pLineEndList->GetLineEnd( i )->GetName() ) bDifferent = false; diff --git a/sd/source/ui/func/fumorph.cxx b/sd/source/ui/func/fumorph.cxx index 812d2d68b484..9755b7ae3a20 100644 --- a/sd/source/ui/func/fumorph.cxx +++ b/sd/source/ui/func/fumorph.cxx @@ -328,8 +328,8 @@ void FuMorph::ImpInsertPolygons( Color aEndFillCol; Color aStartLineCol; Color aEndLineCol; - long nStartLineWidth = 0; - long nEndLineWidth = 0; + ::tools::Long nStartLineWidth = 0; + ::tools::Long nEndLineWidth = 0; SdrPageView* pPageView = mpView->GetSdrPageView(); SfxItemPool & rPool = pObj1->GetObjectItemPool(); SfxItemSet aSet1( rPool,svl::Items<SDRATTR_START,SDRATTR_NOTPERSIST_FIRST-1,EE_ITEMS_START,EE_ITEMS_END>{} ); @@ -415,7 +415,7 @@ void FuMorph::ImpInsertPolygons( // line width if ( bLineWidth ) - aSet.Put( XLineWidthItem( nStartLineWidth + static_cast<long>( fFactor * fDelta + 0.5 ) ) ); + aSet.Put( XLineWidthItem( nStartLineWidth + static_cast<::tools::Long>( fFactor * fDelta + 0.5 ) ) ); pNewObj->SetMergedItemSetAndBroadcast(aSet); diff --git a/sd/source/ui/func/fuparagr.cxx b/sd/source/ui/func/fuparagr.cxx index 6a455f5d1e87..19560db03da1 100644 --- a/sd/source/ui/func/fuparagr.cxx +++ b/sd/source/ui/func/fuparagr.cxx @@ -75,7 +75,7 @@ void FuParagraph::DoExecute( SfxRequest& rReq ) aNewAttr.Put( aEditAttr ); // left border is offset - const long nOff = aNewAttr.Get( EE_PARA_LRSPACE ).GetTextLeft(); + const ::tools::Long nOff = aNewAttr.Get( EE_PARA_LRSPACE ).GetTextLeft(); // conversion since TabulatorTabPage always uses Twips! SfxInt32Item aOff( SID_ATTR_TABSTOP_OFFSET, nOff ); aNewAttr.Put( aOff ); diff --git a/sd/source/ui/func/fupoor.cxx b/sd/source/ui/func/fupoor.cxx index 47225d7bb2c5..3b0a81870672 100644 --- a/sd/source/ui/func/fupoor.cxx +++ b/sd/source/ui/func/fupoor.cxx @@ -561,8 +561,8 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt) { if (!mpView->IsTextEdit() && !bSlideShow) { - long nX = 0; - long nY = 0; + ::tools::Long nX = 0; + ::tools::Long nY = 0; if (nCode == KEY_UP) { diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx index baa6c6b9e3ad..904696bb063a 100644 --- a/sd/source/ui/func/fusel.cxx +++ b/sd/source/ui/func/fusel.cxx @@ -169,7 +169,7 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt) mpWindow->CaptureMouse(); pHdl = mpView->PickHandle(aMDPos); - long nAngle0 = GetAngle(aMDPos - mpView->GetRef1()); + ::tools::Long nAngle0 = GetAngle(aMDPos - mpView->GetRef1()); nAngle0 -= 27000; nAngle0 = NormAngle36000(nAngle0); bMirrorSide0 = nAngle0 < 18000; @@ -742,7 +742,7 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) * If 3D-rotation bodies are about to be created, * end creation now **********************************************************/ - long nAngle1 = GetAngle(aPnt - mpView->GetRef1()); + ::tools::Long nAngle1 = GetAngle(aPnt - mpView->GetRef1()); nAngle1 -= 27000; nAngle1 = NormAngle36000(nAngle1); bool bMirrorSide1 = nAngle1 < 18000; @@ -940,8 +940,8 @@ bool FuSelection::KeyInput(const KeyEvent& rKEvt) case KEY_RIGHT: { if(rKEvt.GetKeyCode().IsShift()&&(nEditMode == SID_BEZIER_INSERT)){ - long nX = 0; - long nY = 0; + ::tools::Long nX = 0; + ::tools::Long nY = 0; sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode(); if (nCode == KEY_UP) { @@ -1217,7 +1217,7 @@ bool FuSelection::HandleImageMapClick(const SdrObject* pObj, const Point& rPos) const SdrLayerIDSet* pVisiLayer = &mpView->GetSdrPageView()->GetVisibleLayers(); sal_uInt16 nHitLog = sal_uInt16(mpWindow->PixelToLogic(Size(HITPIX, 0)).Width()); - const long n2HitLog = nHitLog * 2; + const ::tools::Long n2HitLog = nHitLog * 2; Point aHitPosR(rPos); Point aHitPosL(rPos); Point aHitPosT(rPos); diff --git a/sd/source/ui/func/fusldlg.cxx b/sd/source/ui/func/fusldlg.cxx index 5722eb3798d9..484aa5f1f9b7 100644 --- a/sd/source/ui/func/fusldlg.cxx +++ b/sd/source/ui/func/fusldlg.cxx @@ -64,7 +64,7 @@ void FuSlideShowDlg::DoExecute( SfxRequest& ) const OUString& rPresPage = rPresentationSettings.maPresPage; OUString aFirstPage; SdPage* pPage = nullptr; - long nPage; + ::tools::Long nPage; for( nPage = mpDoc->GetSdPageCount( PageKind::Standard ) - 1; nPage >= 0; nPage-- ) { @@ -111,7 +111,7 @@ void FuSlideShowDlg::DoExecute( SfxRequest& ) if( pDlg->Execute() != RET_OK ) return; - long nValue32; + ::tools::Long nValue32; bool bValue; bool bValuesChanged = false; diff --git a/sd/source/ui/func/fuzoom.cxx b/sd/source/ui/func/fuzoom.cxx index dd2901cb7e42..aa5395267183 100644 --- a/sd/source/ui/func/fuzoom.cxx +++ b/sd/source/ui/func/fuzoom.cxx @@ -156,7 +156,7 @@ bool FuZoom::MouseButtonUp(const MouseEvent& rMEvt) Size aZoomSizePixel = mpWindow->LogicToPixel(aZoomRect).GetSize(); sal_uLong nTol = DRGPIX + DRGPIX; - if ( ( aZoomSizePixel.Width() < static_cast<long>(nTol) && aZoomSizePixel.Height() < static_cast<long>(nTol) ) || rMEvt.IsMod1() ) + if ( ( aZoomSizePixel.Width() < static_cast<::tools::Long>(nTol) && aZoomSizePixel.Height() < static_cast<::tools::Long>(nTol) ) || rMEvt.IsMod1() ) { // click at place: double zoom factor Point aPos = mpWindow->PixelToLogic(aPosPix); diff --git a/sd/source/ui/func/sdundogr.cxx b/sd/source/ui/func/sdundogr.cxx index 37b243f2b208..497c27c8d6c7 100644 --- a/sd/source/ui/func/sdundogr.cxx +++ b/sd/source/ui/func/sdundogr.cxx @@ -18,7 +18,7 @@ */ #include <sdundogr.hxx> - +#include <tools/long.hxx> SdUndoGroup::~SdUndoGroup() = default; @@ -45,8 +45,8 @@ bool SdUndoGroup::Merge( SfxUndoAction* pNextAction ) */ void SdUndoGroup::Undo() { - long nLast = aCtn.size(); - for (long nAction = nLast - 1; nAction >= 0; nAction--) + ::tools::Long nLast = aCtn.size(); + for (::tools::Long nAction = nLast - 1; nAction >= 0; nAction--) { aCtn[nAction]->Undo(); } diff --git a/sd/source/ui/inc/DrawViewShell.hxx b/sd/source/ui/inc/DrawViewShell.hxx index 0a34879f518c..5170883b3379 100644 --- a/sd/source/ui/inc/DrawViewShell.hxx +++ b/sd/source/ui/inc/DrawViewShell.hxx @@ -125,7 +125,7 @@ public: virtual void ChangeEditMode (EditMode eMode, bool bIsLayerModeActive); - virtual void SetZoom( long nZoom ) override; + virtual void SetZoom( ::tools::Long nZoom ) override; virtual void SetZoomRect( const ::tools::Rectangle& rZoomRect ) override; void InsertURLField(const OUString& rURL, const OUString& rText, const OUString& rTarget); @@ -264,8 +264,8 @@ public: virtual void ReadFrameViewData(FrameView* pView) override; virtual void WriteFrameViewData() override; - virtual ErrCode DoVerb(long nVerb) override; - virtual bool ActivateObject(SdrOle2Obj* pObj, long nVerb) override; + virtual ErrCode DoVerb(::tools::Long nVerb) override; + virtual bool ActivateObject(SdrOle2Obj* pObj, ::tools::Long nVerb) override; void SetZoomOnPage( bool bZoom ) { mbZoomOnPage = bZoom; } bool IsZoomOnPage() const { return mbZoomOnPage; } @@ -409,7 +409,7 @@ protected: virtual void UpdateVRuler() override; virtual void SetZoomFactor(const Fraction& rZoomX, const Fraction& rZoomY) override; - void SetupPage( Size const &rSize, long nLeft, long nRight, long nUpper, long nLower, + void SetupPage( Size const &rSize, ::tools::Long nLeft, ::tools::Long nRight, ::tools::Long nUpper, ::tools::Long nLower, bool bSize, bool bMargin, bool bScaleAll ); void GetMenuStateSel(SfxItemSet& rSet); diff --git a/sd/source/ui/inc/OutlineViewShell.hxx b/sd/source/ui/inc/OutlineViewShell.hxx index b2a6aaf9aef4..b9825118866b 100644 --- a/sd/source/ui/inc/OutlineViewShell.hxx +++ b/sd/source/ui/inc/OutlineViewShell.hxx @@ -100,7 +100,7 @@ public: void FuPermanent(SfxRequest &rReq); void FuSupport(SfxRequest &rReq); - virtual void SetZoom(long nZoom) override; + virtual void SetZoom(::tools::Long nZoom) override; virtual void SetZoomRect(const ::tools::Rectangle& rZoomRect) override; void Execute(SfxRequest& rReq); diff --git a/sd/source/ui/inc/SlideSorterViewShell.hxx b/sd/source/ui/inc/SlideSorterViewShell.hxx index 7bc7a20cb201..f76203f79563 100644 --- a/sd/source/ui/inc/SlideSorterViewShell.hxx +++ b/sd/source/ui/inc/SlideSorterViewShell.hxx @@ -95,7 +95,7 @@ public: An integer percent value, i.e. nZoom/100 is the actual zoom factor. */ - virtual void SetZoom (long int nZoom) override; + virtual void SetZoom (::tools::Long nZoom) override; virtual void SetZoomRect (const ::tools::Rectangle& rZoomRect) override; /** This is a callback method used by the active window to delegate its diff --git a/sd/source/ui/inc/ViewShell.hxx b/sd/source/ui/inc/ViewShell.hxx index 20f581e9f1ab..e1856d9a231f 100644 --- a/sd/source/ui/inc/ViewShell.hxx +++ b/sd/source/ui/inc/ViewShell.hxx @@ -197,10 +197,10 @@ public: bar controls are not modified. */ virtual void UpdateScrollBars(); - void Scroll(long nX, long nY); - void ScrollLines(long nX, long nY); - virtual void SetZoom(long nZoom); - long GetZoom() const; + void Scroll(::tools::Long nX, ::tools::Long nY); + void ScrollLines(::tools::Long nX, ::tools::Long nY); + virtual void SetZoom(::tools::Long nZoom); + ::tools::Long GetZoom() const; virtual void SetZoomRect(const ::tools::Rectangle& rZoomRect); void InitWindows(const Point& rViewOrigin, const Size& rViewSize, const Point& rWinPos, bool bUpdate = false); @@ -229,7 +229,7 @@ public: void WriteUserData(); void ReadUserData(); - virtual bool ActivateObject(SdrOle2Obj* pObj, long nVerb); + virtual bool ActivateObject(SdrOle2Obj* pObj, ::tools::Long nVerb); /** @returns current or selected page or 0. This method @@ -255,7 +255,7 @@ public: void DeactivateCurrentFunction( bool bPermanent = false ); void SetPageSizeAndBorder(PageKind ePageKind, const Size& rNewSize, - long nLeft, long nRight, long nUpper, long nLower, + ::tools::Long nLeft, ::tools::Long nRight, ::tools::Long nUpper, ::tools::Long nLower, bool bScaleAll, Orientation eOrient, sal_uInt16 nPaperBin, bool bBackgroundFullSize ); @@ -370,7 +370,7 @@ public: /** This function is called from the underlying ViewShellBase object to handle a verb execution request. */ - virtual ErrCode DoVerb (long nVerb); + virtual ErrCode DoVerb (::tools::Long nVerb); virtual void UIActivating( SfxInPlaceClient* ); virtual void UIDeactivated( SfxInPlaceClient* ); diff --git a/sd/source/ui/inc/ViewShellBase.hxx b/sd/source/ui/inc/ViewShellBase.hxx index bf8e9990a64d..0510b2ad0fb5 100644 --- a/sd/source/ui/inc/ViewShellBase.hxx +++ b/sd/source/ui/inc/ViewShellBase.hxx @@ -118,7 +118,7 @@ public: /** This call is forwarded to the main sub-shell. */ - virtual ErrCode DoVerb (long nVerb) override; + virtual ErrCode DoVerb (::tools::Long nVerb) override; /** Return a new renderer that can be used for example for printing the document. diff --git a/sd/source/ui/inc/Window.hxx b/sd/source/ui/inc/Window.hxx index f7439d7336e0..a33b009e1b1c 100644 --- a/sd/source/ui/inc/Window.hxx +++ b/sd/source/ui/inc/Window.hxx @@ -21,6 +21,7 @@ #define INCLUDED_SD_SOURCE_UI_INC_WINDOW_HXX #include <tools/gen.hxx> +#include <tools/long.hxx> #include <vcl/window.hxx> #include <vcl/transfer.hxx> @@ -56,7 +57,7 @@ public: @param nZoom The zoom factor is given as integral percent value. */ - void SetZoomIntegral(long nZoom); + void SetZoomIntegral(::tools::Long nZoom); /** This internally used method performs the actual adaptation of the window's map mode to the specified zoom factor. @@ -69,7 +70,7 @@ public: forced into that interval. Therefore the returned value is a valid zoom factor. */ - long SetZoomFactor(long nZoom); + ::tools::Long SetZoomFactor(::tools::Long nZoom); /** This method is called when the whole page shall be displayed in the window. Position and zoom factor are set so that the given @@ -83,9 +84,9 @@ public: @return The new zoom factor is returned as integral percent value. */ - long SetZoomRect (const ::tools::Rectangle& rZoomRect); + ::tools::Long SetZoomRect (const ::tools::Rectangle& rZoomRect); - long GetZoomForRect( const ::tools::Rectangle& rZoomRect ); + ::tools::Long GetZoomForRect( const ::tools::Rectangle& rZoomRect ); void SetMinZoomAutoCalc (bool bAuto); @@ -100,12 +101,12 @@ public: <member>bMinZoomAutoCalc</member> is set (to <TRUE/>).</p> */ void CalcMinZoom(); - void SetMinZoom (long int nMin); - long GetMinZoom() const { return mnMinZoom;} - void SetMaxZoom (long int nMax); - long GetMaxZoom() const { return mnMaxZoom;} + void SetMinZoom (::tools::Long nMin); + ::tools::Long GetMinZoom() const { return mnMinZoom;} + void SetMaxZoom (::tools::Long nMax); + ::tools::Long GetMaxZoom() const { return mnMaxZoom;} - long GetZoom() const; + ::tools::Long GetZoom() const; const Point& GetWinViewPos() const { return maWinPos;} const Point& GetViewOrigin() const { return maViewOrigin;} @@ -163,7 +164,7 @@ protected: */ bool mbMinZoomAutoCalc; bool mbCenterAllowed; - long mnTicks; + ::tools::Long mnTicks; ViewShell* mpViewShell; bool mbUseDropScroll; diff --git a/sd/source/ui/inc/sdpreslt.hxx b/sd/source/ui/inc/sdpreslt.hxx index ab3c921f006c..d981771bdacf 100644 --- a/sd/source/ui/inc/sdpreslt.hxx +++ b/sd/source/ui/inc/sdpreslt.hxx @@ -55,7 +55,7 @@ private: std::vector<OUString> maLayoutNames; OUString maName; ///< layout name or file name - long mnLayoutCount; ///< number of master pages in the document + tools::Long mnLayoutCount; ///< number of master pages in the document const OUString maStrNone; std::unique_ptr<weld::CheckButton> m_xCbxMasterPage; diff --git a/sd/source/ui/inc/unomodel.hxx b/sd/source/ui/inc/unomodel.hxx index acd3d8ed02aa..4f4ba44e170e 100644 --- a/sd/source/ui/inc/unomodel.hxx +++ b/sd/source/ui/inc/unomodel.hxx @@ -229,8 +229,8 @@ public: int nOutputHeight, int nTilePosX, int nTilePosY, - long nTileWidth, - long nTileHeight ) override; + tools::Long nTileWidth, + tools::Long nTileHeight ) override; virtual Size getDocumentSize() override; virtual void setPart( int nPart ) override; virtual int getPart() override; diff --git a/sd/source/ui/inc/vectdlg.hxx b/sd/source/ui/inc/vectdlg.hxx index 1bbcec397ad5..91d437368d67 100644 --- a/sd/source/ui/inc/vectdlg.hxx +++ b/sd/source/ui/inc/vectdlg.hxx @@ -62,9 +62,9 @@ class SdVectorizeDlg : public weld::GenericDialogController Bitmap GetPreparedBitmap( Bitmap const & rBmp, Fraction& rScale ); void Calculate( Bitmap const & rBmp, GDIMetaFile& rMtf ); static void AddTile( BitmapReadAccess const * pRAcc, GDIMetaFile& rMtf, - long nPosX, long nPosY, long nWidth, long nHeight ); + tools::Long nPosX, tools::Long nPosY, tools::Long nWidth, tools::Long nHeight ); - DECL_LINK( ProgressHdl, long, void ); + DECL_LINK( ProgressHdl, tools::Long, void ); DECL_LINK( ClickPreviewHdl, weld::Button&, void ); DECL_LINK( ClickOKHdl, weld::Button&, void ); DECL_LINK( ToggleHdl, weld::ToggleButton&, void ); diff --git a/sd/source/ui/sidebar/PageMarginUtils.hxx b/sd/source/ui/sidebar/PageMarginUtils.hxx index 592ac1139f78..9fcab95af75e 100644 --- a/sd/source/ui/sidebar/PageMarginUtils.hxx +++ b/sd/source/ui/sidebar/PageMarginUtils.hxx @@ -28,8 +28,8 @@ namespace sd::sidebar{ -bool IsNone( const long nPageLeftMargin, const long nPageRightMargin, - const long nPageTopMargin, const long nPageBottomMargin ) +bool IsNone( const ::tools::Long nPageLeftMargin, const ::tools::Long nPageRightMargin, + const ::tools::Long nPageTopMargin, const ::tools::Long nPageBottomMargin ) { return( std::abs(nPageLeftMargin - SDPAGE_NO_MARGIN) <= SDPAGE_UNIT_THRESHOLD && std::abs(nPageRightMargin - SDPAGE_NO_MARGIN ) <= SDPAGE_UNIT_THRESHOLD && @@ -37,8 +37,8 @@ bool IsNone( const long nPageLeftMargin, const long nPageRightMargin, std::abs(nPageBottomMargin - SDPAGE_NO_MARGIN) <= SDPAGE_UNIT_THRESHOLD ); } -void SetNone( long& nPageLeftMargin, long& nPageRightMargin, - long& nPageTopMargin, long& nPageBottomMargin ) +void SetNone( ::tools::Long& nPageLeftMargin, ::tools::Long& nPageRightMargin, + ::tools::Long& nPageTopMargin, ::tools::Long& nPageBottomMargin ) { nPageLeftMargin = SDPAGE_NO_MARGIN; nPageRightMargin = SDPAGE_NO_MARGIN; @@ -46,8 +46,8 @@ void SetNone( long& nPageLeftMargin, long& nPageRightMargin, nPageBottomMargin = SDPAGE_NO_MARGIN; } -bool IsNarrow( const long nPageLeftMargin, const long nPageRightMargin, - const long nPageTopMargin, const long nPageBottomMargin ) +bool IsNarrow( const ::tools::Long nPageLeftMargin, const ::tools::Long nPageRightMargin, + const ::tools::Long nPageTopMargin, const ::tools::Long nPageBottomMargin ) { return( std::abs(nPageLeftMargin - SDPAGE_NARROW_VALUE) <= SDPAGE_UNIT_THRESHOLD && std::abs(nPageRightMargin - SDPAGE_NARROW_VALUE) <= SDPAGE_UNIT_THRESHOLD && @@ -55,8 +55,8 @@ bool IsNarrow( const long nPageLeftMargin, const long nPageRightMargin, std::abs(nPageBottomMargin - SDPAGE_NARROW_VALUE) <= SDPAGE_UNIT_THRESHOLD ); } -void SetNarrow( long& nPageLeftMargin, long& nPageRightMargin, - long& nPageTopMargin, long& nPageBottomMargin ) +void SetNarrow( ::tools::Long& nPageLeftMargin, ::tools::Long& nPageRightMargin, + ::tools::Long& nPageTopMargin, ::tools::Long& nPageBottomMargin ) { nPageLeftMargin = SDPAGE_NARROW_VALUE; nPageRightMargin = SDPAGE_NARROW_VALUE; @@ -64,8 +64,8 @@ void SetNarrow( long& nPageLeftMargin, long& nPageRightMargin, nPageBottomMargin = SDPAGE_NARROW_VALUE; } -bool IsModerate( const long nPageLeftMargin, const long nPageRightMargin, - const long nPageTopMargin, const long nPageBottomMargin ) +bool IsModerate( const ::tools::Long nPageLeftMargin, const ::tools::Long nPageRightMargin, + const ::tools::Long nPageTopMargin, const ::tools::Long nPageBottomMargin ) { return( std::abs(nPageLeftMargin - SDPAGE_MODERATE_LR) <= SDPAGE_UNIT_THRESHOLD && std::abs(nPageRightMargin - SDPAGE_MODERATE_LR) <= SDPAGE_UNIT_THRESHOLD && @@ -73,8 +73,8 @@ bool IsModerate( const long nPageLeftMargin, const long nPageRightMargin, std::abs(nPageBottomMargin - SDPAGE_WIDE_VALUE1) <= SDPAGE_UNIT_THRESHOLD ); } -void SetModerate( long& nPageLeftMargin, long& nPageRightMargin, - long& nPageTopMargin, long& nPageBottomMargin ) +void SetModerate( ::tools::Long& nPageLeftMargin, ::tools::Long& nPageRightMargin, + ::tools::Long& nPageTopMargin, ::tools::Long& nPageBottomMargin ) { nPageLeftMargin = SDPAGE_MODERATE_LR; nPageRightMargin = SDPAGE_MODERATE_LR; @@ -82,8 +82,8 @@ void SetModerate( long& nPageLeftMargin, long& nPageRightMargin, nPageBottomMargin = SDPAGE_WIDE_VALUE1; } -bool IsNormal075( const long nPageLeftMargin, const long nPageRightMargin, - const long nPageTopMargin, const long nPageBottomMargin ) +bool IsNormal075( const ::tools::Long nPageLeftMargin, const ::tools::Long nPageRightMargin, + const ::tools::Long nPageTopMargin, const ::tools::Long nPageBottomMargin ) { return( std::abs(nPageLeftMargin - SDPAGE_NORMAL_VALUE) <= SDPAGE_UNIT_THRESHOLD && std::abs(nPageRightMargin - SDPAGE_NORMAL_VALUE) <= SDPAGE_UNIT_THRESHOLD && @@ -91,8 +91,8 @@ bool IsNormal075( const long nPageLeftMargin, const long nPageRightMargin, std::abs(nPageBottomMargin - SDPAGE_NORMAL_VALUE) <= SDPAGE_UNIT_THRESHOLD ); } -void SetNormal075( long& nPageLeftMargin, long& nPageRightMargin, - long& nPageTopMargin, long& nPageBottomMargin ) +void SetNormal075( ::tools::Long& nPageLeftMargin, ::tools::Long& nPageRightMargin, + ::tools::Long& nPageTopMargin, ::tools::Long& nPageBottomMargin ) { nPageLeftMargin = SDPAGE_NORMAL_VALUE; nPageRightMargin = SDPAGE_NORMAL_VALUE; @@ -100,8 +100,8 @@ void SetNormal075( long& nPageLeftMargin, long& nPageRightMargin, nPageBottomMargin = SDPAGE_NORMAL_VALUE; } -bool IsNormal100( const long nPageLeftMargin, const long nPageRightMargin, - const long nPageTopMargin, const long nPageBottomMargin ) +bool IsNormal100( const ::tools::Long nPageLeftMargin, const ::tools::Long nPageRightMargin, + const ::tools::Long nPageTopMargin, const ::tools::Long nPageBottomMargin ) { return( std::abs(nPageLeftMargin - SDPAGE_WIDE_VALUE1) <= SDPAGE_UNIT_THRESHOLD && std::abs(nPageRightMargin - SDPAGE_WIDE_VALUE1) <= SDPAGE_UNIT_THRESHOLD && @@ -109,8 +109,8 @@ bool IsNormal100( const long nPageLeftMargin, const long nPageRightMargin, std::abs(nPageBottomMargin - SDPAGE_WIDE_VALUE1) <= SDPAGE_UNIT_THRESHOLD ); } -void SetNormal100( long& nPageLeftMargin, long& nPageRightMargin, - long& nPageTopMargin, long& nPageBottomMargin ) +void SetNormal100( ::tools::Long& nPageLeftMargin, ::tools::Long& nPageRightMargin, + ::tools::Long& nPageTopMargin, ::tools::Long& nPageBottomMargin ) { nPageLeftMargin = SDPAGE_WIDE_VALUE1; nPageRightMargin = SDPAGE_WIDE_VALUE1; @@ -118,8 +118,8 @@ void SetNormal100( long& nPageLeftMargin, long& nPageRightMargin, nPageBottomMargin = SDPAGE_WIDE_VALUE1; } -bool IsNormal125( const long nPageLeftMargin, const long nPageRightMargin, - const long nPageTopMargin, const long nPageBottomMargin ) +bool IsNormal125( const ::tools::Long nPageLeftMargin, const ::tools::Long nPageRightMargin, + const ::tools::Long nPageTopMargin, const ::tools::Long nPageBottomMargin ) { return( std::abs(nPageLeftMargin - SDPAGE_WIDE_VALUE3) <= SDPAGE_UNIT_THRESHOLD && std::abs(nPageRightMargin - SDPAGE_WIDE_VALUE3) <= SDPAGE_UNIT_THRESHOLD && @@ -127,8 +127,8 @@ bool IsNormal125( const long nPageLeftMargin, const long nPageRightMargin, std::abs(nPageBottomMargin - SDPAGE_WIDE_VALUE1) <= SDPAGE_UNIT_THRESHOLD ); } -void SetNormal125( long& nPageLeftMargin, long& nPageRightMargin, - long& nPageTopMargin, long& nPageBottomMargin ) +void SetNormal125( ::tools::Long& nPageLeftMargin, ::tools::Long& nPageRightMargin, + ::tools::Long& nPageTopMargin, ::tools::Long& nPageBottomMargin ) { nPageLeftMargin = SDPAGE_WIDE_VALUE3; nPageRightMargin = SDPAGE_WIDE_VALUE3; @@ -136,8 +136,8 @@ void SetNormal125( long& nPageLeftMargin, long& nPageRightMargin, nPageBottomMargin = SDPAGE_WIDE_VALUE1; } -bool IsWide( const long nPageLeftMargin, const long nPageRightMargin, - const long nPageTopMargin, const long nPageBottomMargin ) +bool IsWide( const ::tools::Long nPageLeftMargin, const ::tools::Long nPageRightMargin, + const ::tools::Long nPageTopMargin, const ::tools::Long nPageBottomMargin ) { return( std::abs(nPageLeftMargin - SDPAGE_WIDE_VALUE2) <= SDPAGE_UNIT_THRESHOLD && std::abs(nPageRightMargin - SDPAGE_WIDE_VALUE2) <= SDPAGE_UNIT_THRESHOLD && @@ -145,8 +145,8 @@ bool IsWide( const long nPageLeftMargin, const long nPageRightMargin, std::abs(nPageBottomMargin - SDPAGE_WIDE_VALUE1) <= SDPAGE_UNIT_THRESHOLD ); } -void SetWide( long& nPageLeftMargin, long& nPageRightMargin, - long& nPageTopMargin, long& nPageBottomMargin ) +void SetWide( ::tools::Long& nPageLeftMargin, ::tools::Long& nPageRightMargin, + ::tools::Long& nPageTopMargin, ::tools::Long& nPageBottomMargin ) { nPageLeftMargin = SDPAGE_WIDE_VALUE2; nPageRightMargin = SDPAGE_WIDE_VALUE2; diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx index 493c0eb49f29..fb720af1f034 100644 --- a/sd/source/ui/sidebar/SlideBackground.cxx +++ b/sd/source/ui/sidebar/SlideBackground.cxx @@ -727,14 +727,14 @@ void SlideBackground::dispose() PanelLayout::dispose(); } -void SlideBackground::ExecuteMarginLRChange(const long mnPageLeftMargin, const long mnPageRightMargin) +void SlideBackground::ExecuteMarginLRChange(const ::tools::Long mnPageLeftMargin, const ::tools::Long mnPageRightMargin) { mpPageLRMarginItem->SetLeft(mnPageLeftMargin); mpPageLRMarginItem->SetRight(mnPageRightMargin); GetBindings()->GetDispatcher()->ExecuteList( SID_ATTR_PAGE_LRSPACE, SfxCallMode::RECORD, { mpPageLRMarginItem.get() } ); } -void SlideBackground::ExecuteMarginULChange(const long mnPageTopMargin, const long mnPageBottomMargin) +void SlideBackground::ExecuteMarginULChange(const ::tools::Long mnPageTopMargin, const ::tools::Long mnPageBottomMargin) { mpPageULMarginItem->SetUpper(mnPageTopMargin); mpPageULMarginItem->SetLower(mnPageBottomMargin); diff --git a/sd/source/ui/sidebar/SlideBackground.hxx b/sd/source/ui/sidebar/SlideBackground.hxx index 5599c104c9a4..0fbf7718d913 100644 --- a/sd/source/ui/sidebar/SlideBackground.hxx +++ b/sd/source/ui/sidebar/SlideBackground.hxx @@ -42,7 +42,7 @@ class XFillGradientItem; class XFillBitmapItem; class XFillHatchItem; -const long MINBODY = 284; +const tools::Long MINBODY = 284; namespace sd::sidebar { @@ -133,10 +133,10 @@ private: bool mbTitle; std::unique_ptr<SvxLongLRSpaceItem> mpPageLRMarginItem; std::unique_ptr<SvxLongULSpaceItem> mpPageULMarginItem; - long m_nPageLeftMargin; - long m_nPageRightMargin; - long m_nPageTopMargin; - long m_nPageBottomMargin; + ::tools::Long m_nPageLeftMargin; + ::tools::Long m_nPageRightMargin; + ::tools::Long m_nPageTopMargin; + ::tools::Long m_nPageBottomMargin; FieldUnit meFUnit; OUString maCustomEntry; @@ -172,8 +172,8 @@ private: bool IsImpress(); void addListener(); void removeListener(); - void ExecuteMarginLRChange(const long mnPageLeftMargin, const long mnPageRightMargin); - void ExecuteMarginULChange(const long mnPageTopMargin, const long mnPageBottomMargin); + void ExecuteMarginLRChange(const ::tools::Long mnPageLeftMargin, const ::tools::Long mnPageRightMargin); + void ExecuteMarginULChange(const ::tools::Long mnPageTopMargin, const ::tools::Long mnPageBottomMargin); void populateMasterSlideDropdown(); void updateMasterSlideSelection(); diff --git a/sd/source/ui/slideshow/slideshowimpl.hxx b/sd/source/ui/slideshow/slideshowimpl.hxx index dbb4eddc81b9..bb1a59d271c9 100644 --- a/sd/source/ui/slideshow/slideshowimpl.hxx +++ b/sd/source/ui/slideshow/slideshowimpl.hxx @@ -253,7 +253,7 @@ private: This actually starts the slideshow. */ void onFirstPaint(); - long getRestoreSlide() const { return mnRestoreSlide; } + ::tools::Long getRestoreSlide() const { return mnRestoreSlide; } private: bool startShowImpl( @@ -300,7 +300,7 @@ private: std::shared_ptr< AnimationSlideController > mpSlideController; - long mnRestoreSlide; + ::tools::Long mnRestoreSlide; Point maPopupMousePos; Size maPresSize; AnimationMode meAnimationMode; diff --git a/sd/source/ui/slideshow/slideshowviewimpl.cxx b/sd/source/ui/slideshow/slideshowviewimpl.cxx index 46d92f8967ba..7f3d8c90b7e9 100644 --- a/sd/source/ui/slideshow/slideshowviewimpl.cxx +++ b/sd/source/ui/slideshow/slideshowviewimpl.cxx @@ -340,8 +340,8 @@ geometry::AffineMatrix2D SAL_CALL SlideShowView::getTransformation( ) if( meAnimationMode != ANIMATIONMODE_SHOW ) { - aOutputSize.setWidth( static_cast<long>( aOutputSize.Width() / 1.03 ) ); - aOutputSize.setHeight( static_cast<long>( aOutputSize.Height() / 1.03 ) ); + aOutputSize.setWidth( static_cast<::tools::Long>( aOutputSize.Width() / 1.03 ) ); + aOutputSize.setHeight( static_cast<::tools::Long>( aOutputSize.Height() / 1.03 ) ); } SdPage* pP = mpDoc->GetSdPage( 0, PageKind::Standard ); diff --git a/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx b/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx index 64613db12096..ce1a843f42a0 100644 --- a/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx @@ -144,7 +144,7 @@ void ScrollBarManager::PlaceHorizontalScrollBar (const ::tools::Rectangle& aAvai // Restore the relative position. mpHorizontalScrollBar->SetThumbPos( - static_cast<long>(0.5 + mnHorizontalPosition * mpHorizontalScrollBar->GetRange().Len())); + static_cast<::tools::Long>(0.5 + mnHorizontalPosition * mpHorizontalScrollBar->GetRange().Len())); } void ScrollBarManager::PlaceVerticalScrollBar (const ::tools::Rectangle& aArea) @@ -158,7 +158,7 @@ void ScrollBarManager::PlaceVerticalScrollBar (const ::tools::Rectangle& aArea) mpVerticalScrollBar->SetPosSizePixel(aPosition, aSize); // Restore the position. - mpVerticalScrollBar->SetThumbPos(static_cast<long>(nThumbPosition)); + mpVerticalScrollBar->SetThumbPos(static_cast<::tools::Long>(nThumbPosition)); mnVerticalPosition = nThumbPosition / double(mpVerticalScrollBar->GetRange().Len()); } @@ -192,7 +192,7 @@ void ScrollBarManager::UpdateScrollBars(bool bUseScrolling) mpHorizontalScrollBar->SetVisibleSize (aWindowModelSize.Width()); - const long nWidth (mpContentWindow->PixelToLogic( + const ::tools::Long nWidth (mpContentWindow->PixelToLogic( mpContentWindow->GetSizePixel()).Width()); // Make the line size about 10% of the visible width. mpHorizontalScrollBar->SetLineSize (nWidth / 10); @@ -215,7 +215,7 @@ void ScrollBarManager::UpdateScrollBars(bool bUseScrolling) mpVerticalScrollBar->SetVisibleSize (aWindowModelSize.Height()); - const long nHeight (mpContentWindow->PixelToLogic( + const ::tools::Long nHeight (mpContentWindow->PixelToLogic( mpContentWindow->GetSizePixel()).Height()); // Make the line size about 10% of the visible height. mpVerticalScrollBar->SetLineSize (nHeight / 10); @@ -279,8 +279,8 @@ void ScrollBarManager::SetWindowOrigin ( sd::Window *pWindow (mrSlideSorter.GetContentWindow().get()); Size aViewSize (pWindow->GetViewSize()); Point aOrigin ( - static_cast<long int>(mnHorizontalPosition * aViewSize.Width()), - static_cast<long int>(mnVerticalPosition * aViewSize.Height())); + static_cast<::tools::Long>(mnHorizontalPosition * aViewSize.Width()), + static_cast<::tools::Long>(mnVerticalPosition * aViewSize.Height())); pWindow->SetWinViewPos (aOrigin); pWindow->UpdateMapMode (); diff --git a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx index 4836ba3dd1b5..028d8f2a4266 100644 --- a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx +++ b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx @@ -554,7 +554,7 @@ void SlideSorterViewShell::WriteFrameViewData() } } -void SlideSorterViewShell::SetZoom (long int ) +void SlideSorterViewShell::SetZoom (::tools::Long ) { // Ignored. // The zoom scale is adapted internally to fit a number of columns in @@ -570,7 +570,7 @@ void SlideSorterViewShell::SetZoomRect (const ::tools::Rectangle& rZoomRect) if (aRect.GetWidth() < aPageSize.Width()) { - long nWidthDiff = (aPageSize.Width() - aRect.GetWidth()) / 2; + ::tools::Long nWidthDiff = (aPageSize.Width() - aRect.GetWidth()) / 2; aRect.AdjustLeft( -nWidthDiff ); aRect.AdjustRight(nWidthDiff ); @@ -583,7 +583,7 @@ void SlideSorterViewShell::SetZoomRect (const ::tools::Rectangle& rZoomRect) if (aRect.GetHeight() < aPageSize.Height()) { - long nHeightDiff = (aPageSize.Height() - aRect.GetHeight()) / 2; + ::tools::Long nHeightDiff = (aPageSize.Height() - aRect.GetHeight()) / 2; aRect.AdjustTop( -nHeightDiff ); aRect.AdjustBottom(nHeightDiff ); diff --git a/sd/source/ui/slidesorter/view/SlideSorterView.cxx b/sd/source/ui/slidesorter/view/SlideSorterView.cxx index f6a6a1786e05..e7f3d90b3026 100644 --- a/sd/source/ui/slidesorter/view/SlideSorterView.cxx +++ b/sd/source/ui/slidesorter/view/SlideSorterView.cxx @@ -330,7 +330,7 @@ void SlideSorterView::UpdateOrientation() if (pDockingWindow != nullptr) { - const long nScrollBarSize ( + const ::tools::Long nScrollBarSize ( Application::GetSettings().GetStyleSettings().GetScrollBarSize()); switch (pDockingWindow->GetOrientation()) { @@ -443,7 +443,7 @@ void SlideSorterView::DeterminePageObjectVisibilities() mbPreciousFlagUpdatePending |= true; model::SharedPageDescriptor pDescriptor; - for (long nIndex=aUnion.Min(); nIndex<=aUnion.Max(); nIndex++) + for (::tools::Long nIndex=aUnion.Min(); nIndex<=aUnion.Max(); nIndex++) { pDescriptor = mrModel.GetPageDescriptor(nIndex); if (pDescriptor) @@ -648,7 +648,7 @@ void SlideSorterView::Paint ( // Try to prefetch all graphics from the pages to paint. This will be done // in threads to be more efficient than loading them on-demand one by one. std::vector<Graphic*> graphics; - for (long nIndex=aRange.Min(); nIndex<=aRange.Max(); ++nIndex) + for (::tools::Long nIndex=aRange.Min(); nIndex<=aRange.Max(); ++nIndex) { model::SharedPageDescriptor pDescriptor (mrModel.GetPageDescriptor(nIndex)); if (!pDescriptor || ! pDescriptor->HasState(PageDescriptor::ST_Visible)) @@ -658,7 +658,7 @@ void SlideSorterView::Paint ( if(graphics.size() > 1) // threading does not help with loading just one GraphicFilter::GetGraphicFilter().MakeGraphicsAvailableThreaded(graphics); - for (long nIndex=aRange.Min(); nIndex<=aRange.Max(); ++nIndex) + for (::tools::Long nIndex=aRange.Min(); nIndex<=aRange.Max(); ++nIndex) { model::SharedPageDescriptor pDescriptor (mrModel.GetPageDescriptor(nIndex)); if (!pDescriptor || ! pDescriptor->HasState(PageDescriptor::ST_Visible)) diff --git a/sd/source/ui/slidesorter/view/SlsFramePainter.cxx b/sd/source/ui/slidesorter/view/SlsFramePainter.cxx index 26b9a53e445d..b93601ee2fd5 100644 --- a/sd/source/ui/slidesorter/view/SlsFramePainter.cxx +++ b/sd/source/ui/slidesorter/view/SlsFramePainter.cxx @@ -176,7 +176,7 @@ void FramePainter::OffsetBitmap::PaintSide ( { rDevice.DrawBitmapEx( Point(nX,nY), - Size(std::min(aBitmapSize.Width(),static_cast<long>(nRight-nX+1)),aBitmapSize.Height()), + Size(std::min(aBitmapSize.Width(),static_cast<::tools::Long>(nRight-nX+1)),aBitmapSize.Height()), maBitmap); } } @@ -196,7 +196,7 @@ void FramePainter::OffsetBitmap::PaintSide ( { rDevice.DrawBitmapEx( Point(nX,nY), - Size(aBitmapSize.Width(), std::min(aBitmapSize.Height(), static_cast<long>(nBottom-nY+1))), + Size(aBitmapSize.Width(), std::min(aBitmapSize.Height(), static_cast<::tools::Long>(nBottom-nY+1))), maBitmap); } } @@ -212,8 +212,8 @@ void FramePainter::OffsetBitmap::PaintCenter ( const ::tools::Rectangle& rBox) const { const Size aBitmapSize (maBitmap.GetSizePixel()); - for (long nY=rBox.Top(); nY<=rBox.Bottom(); nY+=aBitmapSize.Height()) - for (long nX=rBox.Left(); nX<=rBox.Right(); nX+=aBitmapSize.Width()) + for (::tools::Long nY=rBox.Top(); nY<=rBox.Bottom(); nY+=aBitmapSize.Height()) + for (::tools::Long nX=rBox.Left(); nX<=rBox.Right(); nX+=aBitmapSize.Width()) rDevice.DrawBitmapEx( Point(nX,nY), Size( diff --git a/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx b/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx index 6e44a7310eff..6c17152faa9b 100644 --- a/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx +++ b/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx @@ -194,8 +194,8 @@ Point InsertionIndicatorOverlay::PaintRepresentatives ( const sal_Int32 nIconHeight (aExclusionOverlay.GetSizePixel().Height()); if (nIconWidth>0 && nIconHeight>0) { - for (long nX=0; nX<rPreviewSize.Width(); nX+=nIconWidth) - for (long nY=0; nY<rPreviewSize.Height(); nY+=nIconHeight) + for (::tools::Long nX=0; nX<rPreviewSize.Width(); nX+=nIconWidth) + for (::tools::Long nY=0; nY<rPreviewSize.Height(); nY+=nIconHeight) rContent.DrawBitmapEx(Point(nX,nY)+aPageOffset, aExclusionOverlay); } rContent.SetClipRegion(aSavedClipRegion); diff --git a/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx b/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx index 4865135474fc..6dc956516269 100644 --- a/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx +++ b/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx @@ -170,8 +170,8 @@ BitmapEx PageObjectPainter::CreateMarkedPreview ( const sal_Int32 nIconHeight (rOverlay.GetSizePixel().Height()); if (nIconWidth>0 && nIconHeight>0) { - for (long nX=0; nX<rSize.Width(); nX+=nIconWidth) - for (long nY=0; nY<rSize.Height(); nY+=nIconHeight) + for (::tools::Long nX=0; nX<rSize.Width(); nX+=nIconWidth) + for (::tools::Long nY=0; nY<rSize.Height(); nY+=nIconHeight) pDevice->DrawBitmapEx(Point(nX,nY), rOverlay); } return pDevice->GetBitmapEx(Point(0,0), rSize); diff --git a/sd/source/ui/tools/PreviewRenderer.cxx b/sd/source/ui/tools/PreviewRenderer.cxx index 34f394737c09..3f47b7663f2c 100644 --- a/sd/source/ui/tools/PreviewRenderer.cxx +++ b/sd/source/ui/tools/PreviewRenderer.cxx @@ -435,7 +435,7 @@ Image PreviewRenderer::ScaleBitmap ( break; Size aFrameSize ( nWidth, - static_cast<long>((nWidth*1.0 * aSize.Height()) / aSize.Width() + 0.5)); + static_cast<::tools::Long>((nWidth*1.0 * aSize.Height()) / aSize.Width() + 0.5)); Size aPreviewSize (aFrameSize.Width()-2,aFrameSize.Height()-2); MapMode aMapMode (mpPreviewDevice->GetMapMode()); aMapMode.SetMapUnit(MapUnit::MapPixel); diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 67871eaefdfd..267fdbb3c34e 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -1569,8 +1569,8 @@ static void ImplPDFExportComments( const uno::Reference< drawing::XDrawPage >& x aNote.Contents = xText->getString(); aNote.maModificationDate = xAnnotation->getDateTime(); - rPDFExtOutDevData.CreateNote( ::tools::Rectangle( Point( static_cast< long >( aRealPoint2D.X * 100 ), - static_cast< long >( aRealPoint2D.Y * 100 ) ), Size( 1000, 1000 ) ), aNote ); + rPDFExtOutDevData.CreateNote( ::tools::Rectangle( Point( static_cast< ::tools::Long >( aRealPoint2D.X * 100 ), + static_cast< ::tools::Long >( aRealPoint2D.Y * 100 ) ), Size( 1000, 1000 ) ), aNote ); } } catch (const uno::Exception&) @@ -2214,7 +2214,7 @@ DrawViewShell* SdXImpressDocument::GetViewShell() void SdXImpressDocument::paintTile( VirtualDevice& rDevice, int nOutputWidth, int nOutputHeight, int nTilePosX, int nTilePosY, - long nTileWidth, long nTileHeight ) + ::tools::Long nTileWidth, ::tools::Long nTileHeight ) { DrawViewShell* pViewSh = GetViewShell(); if (!pViewSh) @@ -2233,8 +2233,8 @@ void SdXImpressDocument::paintTile( VirtualDevice& rDevice, // 100th mm rather than TWIP. It makes most sense just to // convert here and in getDocumentSize, and leave the tiled // rendering API working in TWIPs. - long nTileWidthHMM = convertTwipToMm100( nTileWidth ); - long nTileHeightHMM = convertTwipToMm100( nTileHeight ); + ::tools::Long nTileWidthHMM = convertTwipToMm100( nTileWidth ); + ::tools::Long nTileHeightHMM = convertTwipToMm100( nTileHeight ); int nTilePosXHMM = convertTwipToMm100( nTilePosX ); int nTilePosYHMM = convertTwipToMm100( nTilePosY ); diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index 5b2debfcd06e..29ba9c20ee34 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -1764,8 +1764,8 @@ static void refreshpage( SdDrawDocument* pDoc, const PageKind ePageKind ) pDrawViewShell->ResetActualPage(); Size aPageSize = pDoc->GetSdPage(0, ePageKind)->GetSize(); - const long nWidth = aPageSize.Width(); - const long nHeight = aPageSize.Height(); + const tools::Long nWidth = aPageSize.Width(); + const tools::Long nHeight = aPageSize.Height(); Point aPageOrg(nWidth, nHeight / 2); Size aViewSize(nWidth * 3, nHeight * 2); diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx index 8d6675e7137e..7d8e8c6fdb25 100644 --- a/sd/source/ui/view/DocumentRenderer.cxx +++ b/sd/source/ui/view/DocumentRenderer.cxx @@ -1638,7 +1638,7 @@ private: pOutliner->SetPaperSize(aOutRect.GetSize()); pOutliner->SetUpdateMode(true); - long nPageH = aOutRect.GetHeight(); + ::tools::Long nPageH = aOutRect.GetHeight(); std::vector< sal_Int32 > aPages; sal_Int32 nPageCount = mrBase.GetDocument()->GetSdPageCount(PageKind::Standard); @@ -1651,7 +1651,7 @@ private: pOutliner->Clear(); Paragraph* pPara = nullptr; - long nH (0); + ::tools::Long nH (0); while (nH < nPageH && nIndex<nCount) { SdPage* pPage = GetFilteredPage(aPages[nIndex], PageKind::Standard); @@ -1954,8 +1954,8 @@ private: rInfo.msPageString.clear(); rInfo.msPageString += rInfo.msTimeDate; - long aPageWidth = aPageSize.Width() - pPage->GetLeftBorder() - pPage->GetRightBorder(); - long aPageHeight = aPageSize.Height() - pPage->GetUpperBorder() - pPage->GetLowerBorder(); + ::tools::Long aPageWidth = aPageSize.Width() - pPage->GetLeftBorder() - pPage->GetRightBorder(); + ::tools::Long aPageHeight = aPageSize.Height() - pPage->GetUpperBorder() - pPage->GetLowerBorder(); // Bugfix for 44530: // if it was implicitly changed (Landscape/Portrait), // this is considered for tiling, respectively for the splitting up @@ -2006,13 +2006,13 @@ private: if( fPageWH < fPrintWH ) { - aPageSize_2.setWidth( static_cast<long>( aPrintSize_2.Height() * fPageWH ) ); + aPageSize_2.setWidth( static_cast<::tools::Long>( aPrintSize_2.Height() * fPageWH ) ); aPageSize_2.setHeight( aPrintSize_2.Height() ); } else { aPageSize_2.setWidth( aPrintSize_2.Width() ); - aPageSize_2.setHeight( static_cast<long>( aPrintSize_2.Width() / fPageWH ) ); + aPageSize_2.setHeight( static_cast<::tools::Long>( aPrintSize_2.Width() / fPageWH ) ); } MapMode aMap (rInfo.maMap); @@ -2187,9 +2187,9 @@ private: // keep the page content at its position if it fits, otherwise // move it to the printable area - const long nPageWidth ( + const ::tools::Long nPageWidth ( rInfo.maPageSize.Width() - rPage.GetLeftBorder() - rPage.GetRightBorder()); - const long nPageHeight ( + const ::tools::Long nPageHeight ( rInfo.maPageSize.Height() - rPage.GetUpperBorder() - rPage.GetLowerBorder()); Point aOrigin ( 0, 0 ); diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx index 303ea3355a53..241befe0ba5a 100644 --- a/sd/source/ui/view/ViewShellBase.cxx +++ b/sd/source/ui/view/ViewShellBase.cxx @@ -473,8 +473,8 @@ void ViewShellBase::InnerResizePixel (const Point& rOrigin, const Size &rSize, b aSize.AdjustHeight( -(aBorder.Top() + aBorder.Bottom()) ); Size aObjSizePixel = mpImpl->mpViewWindow->LogicToPixel(aObjSize, MapMode(MapUnit::Map100thMM)); SfxViewShell::SetZoomFactor( - Fraction( aSize.Width(), std::max( aObjSizePixel.Width(), static_cast<long int>(1) ) ), - Fraction( aSize.Height(), std::max( aObjSizePixel.Height(), static_cast<long int>(1)) ) ); + Fraction( aSize.Width(), std::max( aObjSizePixel.Width(), static_cast<::tools::Long>(1) ) ), + Fraction( aSize.Height(), std::max( aObjSizePixel.Height(), static_cast<::tools::Long>(1)) ) ); } mpImpl->ResizePixel(rOrigin, rSize, false); @@ -506,7 +506,7 @@ void ViewShellBase::Rearrange() GetViewFrame()->Resize(true); } -ErrCode ViewShellBase::DoVerb (long nVerb) +ErrCode ViewShellBase::DoVerb (::tools::Long nVerb) { ErrCode aResult = ERRCODE_NONE; diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx index 38caef16ae22..02344e1c4564 100644 --- a/sd/source/ui/view/drtxtob.cxx +++ b/sd/source/ui/view/drtxtob.cxx @@ -479,13 +479,13 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) nStartPara = 0; nEndPara = pOLV->GetOutliner()->GetParagraphCount() - 1; } - long nUpper = 0; + ::tools::Long nUpper = 0; for( sal_Int32 nPara = nStartPara; nPara <= nEndPara; nPara++ ) { const SfxItemSet& rItems = pOLV->GetOutliner()->GetParaAttribs( nPara ); const SvxULSpaceItem& rItem = rItems.Get( EE_PARA_ULSPACE ); - nUpper = std::max( nUpper, static_cast<long>(rItem.GetUpper()) ); + nUpper = std::max( nUpper, static_cast<::tools::Long>(rItem.GetUpper()) ); } if( nUpper == 0 ) rSet.DisableItem( SID_PARASPACE_DECREASE ); diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx index 7b7b70624583..22f2eaf81d55 100644 --- a/sd/source/ui/view/drtxtob1.cxx +++ b/sd/source/ui/view/drtxtob1.cxx @@ -190,7 +190,7 @@ void TextObjectBar::Execute( SfxRequest &rReq ) const SvxLRSpaceItem& rItem = aAttr.Get( EE_PARA_LRSPACE ); std::unique_ptr<SvxLRSpaceItem> pNewItem(rItem.Clone()); - long nLeft = pNewItem->GetLeft(); + ::tools::Long nLeft = pNewItem->GetLeft(); if( nSlot == SID_INC_INDENT ) nLeft += 1000; else @@ -247,7 +247,7 @@ void TextObjectBar::Execute( SfxRequest &rReq ) const SvxULSpaceItem& rItem = aAttr.Get( EE_PARA_ULSPACE ); std::unique_ptr<SvxULSpaceItem> pNewItem(rItem.Clone()); - long nUpper = pNewItem->GetUpper(); + ::tools::Long nUpper = pNewItem->GetUpper(); if( nSlot == SID_PARASPACE_INCREASE ) nUpper += 100; else @@ -257,7 +257,7 @@ void TextObjectBar::Execute( SfxRequest &rReq ) } pNewItem->SetUpper( static_cast<sal_uInt16>(nUpper) ); - long nLower = pNewItem->GetLower(); + ::tools::Long nLower = pNewItem->GetLower(); if( nSlot == SID_PARASPACE_INCREASE ) nLower += 100; else @@ -289,7 +289,7 @@ void TextObjectBar::Execute( SfxRequest &rReq ) SfxItemSet aNewAttrs(*(aEditAttr.GetPool()), aEditAttr.GetRanges()); const SvxULSpaceItem& rItem = aEditAttr.Get( EE_PARA_ULSPACE ); std::unique_ptr<SvxULSpaceItem> pNewItem(rItem.Clone()); - long nUpper = pNewItem->GetUpper(); + ::tools::Long nUpper = pNewItem->GetUpper(); if( nSlot == SID_PARASPACE_INCREASE ) nUpper += 100; @@ -300,7 +300,7 @@ void TextObjectBar::Execute( SfxRequest &rReq ) } pNewItem->SetUpper( static_cast<sal_uInt16>(nUpper) ); - long nLower = pNewItem->GetLower(); + ::tools::Long nLower = pNewItem->GetLower(); if( nSlot == SID_PARASPACE_INCREASE ) nLower += 100; else diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx index 09814bd7b470..18b6ba8a89c9 100644 --- a/sd/source/ui/view/drviews1.cxx +++ b/sd/source/ui/view/drviews1.cxx @@ -273,7 +273,7 @@ void collectUIInformation(const OUString& aZoom) /** * set zoom factor */ -void DrawViewShell::SetZoom( long nZoom ) +void DrawViewShell::SetZoom( ::tools::Long nZoom ) { // Make sure that the zoom factor will not be recalculated on // following window resizings. @@ -601,11 +601,11 @@ void DrawViewShell::UpdateVRuler() IMPL_LINK( DrawViewShell, TabSplitHdl, TabBar *, pTab, void ) { - const long int nMax = maViewSize.Width() - maScrBarWH.Width() + const ::tools::Long nMax = maViewSize.Width() - maScrBarWH.Width() - maTabControl->GetPosPixel().X() ; Size aTabSize = maTabControl->GetSizePixel(); - aTabSize.setWidth( std::min(pTab->GetSplitSize(), static_cast<long>(nMax-1)) ); + aTabSize.setWidth( std::min(pTab->GetSplitSize(), static_cast<::tools::Long>(nMax-1)) ); maTabControl->SetSizePixel(aTabSize); @@ -711,7 +711,7 @@ void DrawViewShell::ResetActualPage() * Apply "Verb" on OLE-object. */ -ErrCode DrawViewShell::DoVerb(long nVerb) +ErrCode DrawViewShell::DoVerb(::tools::Long nVerb) { if ( mpDrawView->AreObjectsMarked() ) { @@ -739,7 +739,7 @@ ErrCode DrawViewShell::DoVerb(long nVerb) * Activate OLE-object */ -bool DrawViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb) +bool DrawViewShell::ActivateObject(SdrOle2Obj* pObj, ::tools::Long nVerb) { bool bActivated = false; diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index a76151901147..411b377b3141 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -991,7 +991,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) switch( eZT ) { case SvxZoomType::PERCENT: - SetZoom( static_cast<long>( pArgs->Get( SID_ATTR_ZOOM ).GetValue()) ); + SetZoom( static_cast<::tools::Long>( pArgs->Get( SID_ATTR_ZOOM ).GetValue()) ); break; case SvxZoomType::OPTIMAL: diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx index 2883be985b46..53dd0f75c688 100644 --- a/sd/source/ui/view/drviews3.cxx +++ b/sd/source/ui/view/drviews3.cxx @@ -565,8 +565,8 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq) } else { - long nLeft = std::max(0L, rLRSpace.GetLeft() - aPagePos.X()); - long nRight = std::max(0L, rLRSpace.GetRight() + aPagePos.X() + + ::tools::Long nLeft = std::max(0L, rLRSpace.GetLeft() - aPagePos.X()); + ::tools::Long nRight = std::max(0L, rLRSpace.GetRight() + aPagePos.X() + aPageSize.Width() - aViewSize.Width()); sal_uInt16 nPageCnt = GetDoc()->GetSdPageCount(mePageKind); @@ -631,8 +631,8 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq) } else { - long nUpper = std::max(0L, rULSpace.GetUpper() - aPagePos.Y()); - long nLower = std::max(0L, rULSpace.GetLower() + aPagePos.Y() + + ::tools::Long nUpper = std::max(0L, rULSpace.GetUpper() - aPagePos.Y()); + ::tools::Long nLower = std::max(0L, rULSpace.GetLower() + aPagePos.Y() + aPageSize.Height() - aViewSize.Height()); sal_uInt16 nPageCnt = GetDoc()->GetSdPageCount(mePageKind); @@ -840,8 +840,8 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq) // become negative - EditEngine really does not // like that. const auto nAbsLSpace=aFormat.GetAbsLSpace(); - const long nTxtLeft=rItem.GetTextLeft(); - const long nLeftIndent=std::max(0L,nTxtLeft - nAbsLSpace); + const ::tools::Long nTxtLeft=rItem.GetTextLeft(); + const ::tools::Long nLeftIndent=std::max(0L,nTxtLeft - nAbsLSpace); aLRSpaceItem.SetTextLeft(nLeftIndent); // control for clipped left indent - remainder // reduces number format first line indent @@ -976,7 +976,7 @@ void DrawViewShell::GetRulerState(SfxItemSet& rSet) if ( aEditAttr.GetItemState( SDRATTR_TEXT_LEFTDIST ) == SfxItemState::SET ) { const SdrMetricItem& rTLDItem = aEditAttr.Get( SDRATTR_TEXT_LEFTDIST ); - long nLD = rTLDItem.GetValue(); + ::tools::Long nLD = rTLDItem.GetValue(); aPos.AdjustX(nLD ); } @@ -996,7 +996,7 @@ void DrawViewShell::GetRulerState(SfxItemSet& rSet) if ( aEditAttr.GetItemState( SDRATTR_TEXT_LEFTDIST ) == SfxItemState::SET ) { const SdrMetricItem& rTLDItem = aEditAttr.Get( SDRATTR_TEXT_LEFTDIST ); - long nLD = rTLDItem.GetValue(); + ::tools::Long nLD = rTLDItem.GetValue(); aLRSpace.SetLeft( aLRSpace.GetLeft() + nLD ); } @@ -1005,7 +1005,7 @@ void DrawViewShell::GetRulerState(SfxItemSet& rSet) if ( aEditAttr.GetItemState( SDRATTR_TEXT_RIGHTDIST ) == SfxItemState::SET ) { const SdrMetricItem& rTRDItem = aEditAttr.Get( SDRATTR_TEXT_RIGHTDIST ); - long nRD = rTRDItem.GetValue(); + ::tools::Long nRD = rTRDItem.GetValue(); aLRSpace.SetRight( aLRSpace.GetRight() + nRD ); } diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx index c6ad21c0d74b..f71ecc6a6014 100644 --- a/sd/source/ui/view/drviews4.cxx +++ b/sd/source/ui/view/drviews4.cxx @@ -396,18 +396,18 @@ void DrawViewShell::MouseMove(const MouseEvent& rMEvt, ::sd::Window* pWin) if (!pBmpMask) return; - const long nStartX = maMousePos.X() - PIPETTE_RANGE; - const long nEndX = maMousePos.X() + PIPETTE_RANGE; - const long nStartY = maMousePos.Y() - PIPETTE_RANGE; - const long nEndY = maMousePos.Y() + PIPETTE_RANGE; - long nRed = 0; - long nGreen = 0; - long nBlue = 0; + const ::tools::Long nStartX = maMousePos.X() - PIPETTE_RANGE; + const ::tools::Long nEndX = maMousePos.X() + PIPETTE_RANGE; + const ::tools::Long nStartY = maMousePos.Y() - PIPETTE_RANGE; + const ::tools::Long nEndY = maMousePos.Y() + PIPETTE_RANGE; + ::tools::Long nRed = 0; + ::tools::Long nGreen = 0; + ::tools::Long nBlue = 0; const double fDiv = ( ( PIPETTE_RANGE << 1 ) + 1 ) * ( ( PIPETTE_RANGE << 1 ) + 1 ); - for ( long nY = nStartY; nY <= nEndY; nY++ ) + for ( ::tools::Long nY = nStartY; nY <= nEndY; nY++ ) { - for( long nX = nStartX; nX <= nEndX; nX++ ) + for( ::tools::Long nX = nStartX; nX <= nEndX; nX++ ) { const Color aCol( pWin->GetPixel( pWin->PixelToLogic( Point( nX, nY ) ) ) ); @@ -816,8 +816,8 @@ void DrawViewShell::ShowMousePosInfo(const ::tools::Rectangle& rRect, { RulerLine pHLines[2]; RulerLine pVLines[2]; - long nHOffs = 0; - long nVOffs = 0; + ::tools::Long nHOffs = 0; + ::tools::Long nVOffs = 0; sal_uInt16 nCnt; if (mpHorizontalRuler) diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index cdb8b78bb8bf..baac52ee46e1 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -259,8 +259,8 @@ void DrawViewShell::GetMarginProperties( SfxItemSet &rSet ) { // const SvxLRSpaceItem aTmpPageLRSpace ( rDesc.GetMaster().GetLRSpace() ); const SvxLongLRSpaceItem aLongLR( - static_cast<long>(pPage->GetLeftBorder()), - static_cast<long>(pPage->GetRightBorder()), + static_cast<::tools::Long>(pPage->GetLeftBorder()), + static_cast<::tools::Long>(pPage->GetRightBorder()), SID_ATTR_PAGE_LRSPACE ); rSet.Put( aLongLR ); } @@ -270,8 +270,8 @@ void DrawViewShell::GetMarginProperties( SfxItemSet &rSet ) { // const SvxULSpaceItem aUL( rDesc.GetMaster().GetULSpace() ); SvxLongULSpaceItem aLongUL( - static_cast<long>(pPage->GetUpperBorder()), - static_cast<long>(pPage->GetLowerBorder()), + static_cast<::tools::Long>(pPage->GetUpperBorder()), + static_cast<::tools::Long>(pPage->GetLowerBorder()), SID_ATTR_PAGE_ULSPACE ); rSet.Put( aLongUL ); } diff --git a/sd/source/ui/view/drviews9.cxx b/sd/source/ui/view/drviews9.cxx index baeda924d957..aa4ef5f36a2f 100644 --- a/sd/source/ui/view/drviews9.cxx +++ b/sd/source/ui/view/drviews9.cxx @@ -109,13 +109,13 @@ void DrawViewShell::ExecGallery(SfxRequest const & rReq) // constrain size to page size if necessary if ((fGrfWH != 0.F) && (fGrfWH < fWinWH)) { - aSize.setWidth( static_cast<long>(aPageSize.Height() * fGrfWH) ); + aSize.setWidth( static_cast<::tools::Long>(aPageSize.Height() * fGrfWH) ); aSize.setHeight( aPageSize.Height() ); } else { aSize.setWidth( aPageSize.Width() ); - aSize.setHeight( static_cast<long>(aPageSize.Width() / fGrfWH) ); + aSize.setHeight( static_cast<::tools::Long>(aPageSize.Width() / fGrfWH) ); } } @@ -331,11 +331,11 @@ void DrawViewShell::AttrExec (SfxRequest &rReq) const SfxUInt32Item* pBlue = rReq.GetArg<SfxUInt32Item>(ID_VAL_BLUE); XGradientListRef pGradientList = GetDoc()->GetGradientList (); - long nCounts = pGradientList->Count (); + ::tools::Long nCounts = pGradientList->Count (); Color aColor (static_cast<sal_uInt8>(pRed->GetValue ()), static_cast<sal_uInt8>(pGreen->GetValue ()), static_cast<sal_uInt8>(pBlue->GetValue ())); - long i; + ::tools::Long i; pAttr->ClearItem (XATTR_FILLGRADIENT); pAttr->ClearItem (XATTR_FILLSTYLE); @@ -401,11 +401,11 @@ void DrawViewShell::AttrExec (SfxRequest &rReq) const SfxUInt32Item* pBlue = rReq.GetArg<SfxUInt32Item>(ID_VAL_BLUE); XHatchListRef pHatchList = GetDoc()->GetHatchList (); - long nCounts = pHatchList->Count (); + ::tools::Long nCounts = pHatchList->Count (); Color aColor (static_cast<sal_uInt8>(pRed->GetValue ()), static_cast<sal_uInt8>(pGreen->GetValue ()), static_cast<sal_uInt8>(pBlue->GetValue ())); - long i; + ::tools::Long i; pAttr->ClearItem (XATTR_FILLHATCH); pAttr->ClearItem (XATTR_FILLSTYLE); @@ -476,9 +476,9 @@ void DrawViewShell::AttrExec (SfxRequest &rReq) pAttr->ClearItem (XATTR_LINESTYLE); XDashListRef pDashList = GetDoc()->GetDashList(); - long nCounts = pDashList->Count (); + ::tools::Long nCounts = pDashList->Count (); std::unique_ptr<XDashEntry> pEntry = std::make_unique<XDashEntry>(aNewDash, pName->GetValue()); - long i; + ::tools::Long i; for ( i = 0; i < nCounts; i++ ) if (pDashList->GetDash (i)->GetName () == pName->GetValue ()) @@ -533,8 +533,8 @@ void DrawViewShell::AttrExec (SfxRequest &rReq) pAttr->ClearItem (XATTR_FILLSTYLE); XGradientListRef pGradientList = GetDoc()->GetGradientList (); - long nCounts = pGradientList->Count (); - long i; + ::tools::Long nCounts = pGradientList->Count (); + ::tools::Long i; for ( i = 0; i < nCounts; i++ ) { @@ -610,8 +610,8 @@ void DrawViewShell::AttrExec (SfxRequest &rReq) pAttr->ClearItem (XATTR_FILLSTYLE); XHatchListRef pHatchList = GetDoc()->GetHatchList (); - long nCounts = pHatchList->Count (); - long i; + ::tools::Long nCounts = pHatchList->Count (); + ::tools::Long i; for ( i = 0; i < nCounts; i++ ) { @@ -668,9 +668,9 @@ void DrawViewShell::AttrExec (SfxRequest &rReq) const SfxStringItem* pName = rReq.GetArg<SfxStringItem>(ID_VAL_INDEX); XGradientListRef pGradientList = GetDoc()->GetGradientList (); - long nCounts = pGradientList->Count (); + ::tools::Long nCounts = pGradientList->Count (); - for (long i = 0; i < nCounts; i ++) + for (::tools::Long i = 0; i < nCounts; i ++) { const XGradientEntry* pEntry = pGradientList->GetGradient(i); @@ -705,9 +705,9 @@ void DrawViewShell::AttrExec (SfxRequest &rReq) const SfxStringItem* pName = rReq.GetArg<SfxStringItem>(ID_VAL_INDEX); XHatchListRef pHatchList = GetDoc()->GetHatchList (); - long nCounts = pHatchList->Count (); + ::tools::Long nCounts = pHatchList->Count (); - for (long i = 0; i < nCounts; i ++) + for (::tools::Long i = 0; i < nCounts; i ++) { const XHatchEntry* pEntry = pHatchList->GetHatch(i); @@ -796,7 +796,7 @@ void DrawViewShell::AttrState (SfxItemSet& rSet) { const XFillStyleItem &rFillStyleItem = aAttr.Get (XATTR_FILLSTYLE); - rSet.Put (SfxUInt32Item (nWhich, static_cast<long>(rFillStyleItem.GetValue ()))); + rSet.Put (SfxUInt32Item (nWhich, static_cast<::tools::Long>(rFillStyleItem.GetValue ()))); break; } @@ -804,7 +804,7 @@ void DrawViewShell::AttrState (SfxItemSet& rSet) { const XLineStyleItem &rLineStyleItem = aAttr.Get (XATTR_LINESTYLE); - rSet.Put (SfxUInt32Item (nWhich, static_cast<long>(rLineStyleItem.GetValue ()))); + rSet.Put (SfxUInt32Item (nWhich, static_cast<::tools::Long>(rLineStyleItem.GetValue ()))); break; } @@ -812,7 +812,7 @@ void DrawViewShell::AttrState (SfxItemSet& rSet) { const XLineWidthItem &rLineWidthItem = aAttr.Get (XATTR_LINEWIDTH); - rSet.Put (SfxUInt32Item (nWhich, static_cast<long>(rLineWidthItem.GetValue ()))); + rSet.Put (SfxUInt32Item (nWhich, static_cast<::tools::Long>(rLineWidthItem.GetValue ()))); break; } @@ -866,7 +866,7 @@ void DrawViewShell::AttrState (SfxItemSet& rSet) ; } - rSet.Put (SfxUInt32Item (nWhich, static_cast<long>((nWhich == SID_GETRED) + rSet.Put (SfxUInt32Item (nWhich, static_cast<::tools::Long>((nWhich == SID_GETRED) ? aColor.GetRed () : (nWhich == SID_GETGREEN) ? aColor.GetGreen () diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx index 74a68af15e15..c489745af601 100644 --- a/sd/source/ui/view/drviewsa.cxx +++ b/sd/source/ui/view/drviewsa.cxx @@ -414,10 +414,10 @@ void DrawViewShell::CheckLineTo(SfxRequest& rReq) * Change page parameter if SID_PAGESIZE or SID_PAGEMARGIN */ void DrawViewShell::SetupPage (Size const &rSize, - long nLeft, - long nRight, - long nUpper, - long nLower, + ::tools::Long nLeft, + ::tools::Long nRight, + ::tools::Long nUpper, + ::tools::Long nLower, bool bSize, bool bMargin, bool bScaleAll) @@ -495,8 +495,8 @@ void DrawViewShell::SetupPage (Size const &rSize, pHandoutPage->CreateTitleAndLayout(true); } - long nWidth = mpActualPage->GetSize().Width(); - long nHeight = mpActualPage->GetSize().Height(); + ::tools::Long nWidth = mpActualPage->GetSize().Width(); + ::tools::Long nHeight = mpActualPage->GetSize().Height(); Point aPageOrg(nWidth, nHeight / 2); Size aSize( nWidth * 3, nHeight * 2); @@ -578,10 +578,10 @@ void DrawViewShell::GetStatusBarState(SfxItemSet& rSet) Size aPageSize = pPageView->GetPage()->GetSize(); aPagePos.AdjustX(aPageSize.Width() / 2 ); - aPageSize.setWidth( static_cast<long>(aPageSize.Width() * 1.03) ); + aPageSize.setWidth( static_cast<::tools::Long>(aPageSize.Width() * 1.03) ); aPagePos.AdjustY(aPageSize.Height() / 2 ); - aPageSize.setHeight( static_cast<long>(aPageSize.Height() * 1.03) ); + aPageSize.setHeight( static_cast<::tools::Long>(aPageSize.Height() * 1.03) ); aPagePos.AdjustY( -(aPageSize.Height() / 2) ); aPagePos.AdjustX( -(aPageSize.Width() / 2) ); @@ -600,8 +600,8 @@ void DrawViewShell::GetStatusBarState(SfxItemSet& rSet) Point aPos = GetActiveWindow()->PixelToLogic(maMousePos); pPageView->LogicToPagePos(aPos); Fraction aUIScale(GetDoc()->GetUIScale()); - aPos.setX( long(aPos.X() / aUIScale) ); - aPos.setY( long(aPos.Y() / aUIScale) ); + aPos.setX( ::tools::Long(aPos.X() / aUIScale) ); + aPos.setY( ::tools::Long(aPos.Y() / aUIScale) ); // position- and size items if ( mpDrawView->IsAction() ) @@ -615,12 +615,12 @@ void DrawViewShell::GetStatusBarState(SfxItemSet& rSet) { pPageView->LogicToPagePos(aRect); aPos = aRect.TopLeft(); - aPos.setX( long(aPos.X() / aUIScale) ); - aPos.setY( long(aPos.Y() / aUIScale) ); + aPos.setX( ::tools::Long(aPos.X() / aUIScale) ); + aPos.setY( ::tools::Long(aPos.Y() / aUIScale) ); rSet.Put( SfxPointItem( SID_ATTR_POSITION, aPos) ); Size aSize( aRect.Right() - aRect.Left(), aRect.Bottom() - aRect.Top() ); - aSize.setHeight( long(aSize.Height() / aUIScale) ); - aSize.setWidth( long(aSize.Width() / aUIScale) ); + aSize.setHeight( ::tools::Long(aSize.Height() / aUIScale) ); + aSize.setWidth( ::tools::Long(aSize.Width() / aUIScale) ); rSet.Put( SvxSizeItem( SID_ATTR_SIZE, aSize) ); } } @@ -633,13 +633,13 @@ void DrawViewShell::GetStatusBarState(SfxItemSet& rSet) // Show the position of the selected shape(s) Point aShapePosition (aRect.TopLeft()); - aShapePosition.setX( long(aShapePosition.X() / aUIScale) ); - aShapePosition.setY( long(aShapePosition.Y() / aUIScale) ); + aShapePosition.setX( ::tools::Long(aShapePosition.X() / aUIScale) ); + aShapePosition.setY( ::tools::Long(aShapePosition.Y() / aUIScale) ); rSet.Put (SfxPointItem(SID_ATTR_POSITION, aShapePosition)); Size aSize( aRect.Right() - aRect.Left(), aRect.Bottom() - aRect.Top() ); - aSize.setHeight( long(aSize.Height() / aUIScale) ); - aSize.setWidth( long(aSize.Width() / aUIScale) ); + aSize.setHeight( ::tools::Long(aSize.Height() / aUIScale) ); + aSize.setWidth( ::tools::Long(aSize.Width() / aUIScale) ); rSet.Put( SvxSizeItem( SID_ATTR_SIZE, aSize) ); } else diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx index 80866c2b887f..30b160ea88f7 100644 --- a/sd/source/ui/view/drviewse.cxx +++ b/sd/source/ui/view/drviewse.cxx @@ -1132,12 +1132,12 @@ void DrawViewShell::FuSupport(SfxRequest& rReq) Size aPageSize = pPageView->GetPage()->GetSize(); aPagePos.AdjustX(aPageSize.Width() / 2 ); - aPageSize.setWidth( static_cast<long>(aPageSize.Width() * 1.03) ); + aPageSize.setWidth( static_cast<::tools::Long>(aPageSize.Width() * 1.03) ); if( rReq.GetSlot() == SID_SIZE_PAGE ) { aPagePos.AdjustY(aPageSize.Height() / 2 ); - aPageSize.setHeight( static_cast<long>(aPageSize.Height() * 1.03) ); + aPageSize.setHeight( static_cast<::tools::Long>(aPageSize.Height() * 1.03) ); aPagePos.AdjustY( -(aPageSize.Height() / 2) ); } else @@ -1228,8 +1228,8 @@ void DrawViewShell::FuSupport(SfxRequest& rReq) if ( mpDrawView->AreObjectsMarked() ) { maMarkRect = mpDrawView->GetAllMarkedRect(); - long nW = static_cast<long>(maMarkRect.GetWidth() * 1.03); - long nH = static_cast<long>(maMarkRect.GetHeight() * 1.03); + ::tools::Long nW = static_cast<::tools::Long>(maMarkRect.GetWidth() * 1.03); + ::tools::Long nH = static_cast<::tools::Long>(maMarkRect.GetHeight() * 1.03); Point aPos = maMarkRect.Center(); aPos.AdjustX( -(nW / 2) ); aPos.AdjustY( -(nH / 2) ); @@ -1260,8 +1260,8 @@ void DrawViewShell::FuSupport(SfxRequest& rReq) { ::tools::Rectangle aBoundRect( pPageView->GetObjList()->GetAllObjBoundRect() ); - long nW = static_cast<long>(aBoundRect.GetWidth() * 1.03); - long nH = static_cast<long>(aBoundRect.GetHeight() * 1.03); + ::tools::Long nW = static_cast<::tools::Long>(aBoundRect.GetWidth() * 1.03); + ::tools::Long nH = static_cast<::tools::Long>(aBoundRect.GetHeight() * 1.03); Point aPos = aBoundRect.Center(); aPos.AdjustX( -(nW / 2) ); aPos.AdjustY( -(nH / 2) ); diff --git a/sd/source/ui/view/drviewsh.cxx b/sd/source/ui/view/drviewsh.cxx index f6e92706993d..72013d5fd99d 100644 --- a/sd/source/ui/view/drviewsh.cxx +++ b/sd/source/ui/view/drviewsh.cxx @@ -127,19 +127,19 @@ void DrawViewShell::MakeVisible(const ::tools::Rectangle& rRect, vcl::Window& rW } else { - const long distRight(rRect.Right() - aNewPos.X() - aVisAreaSize.Width()); + const ::tools::Long distRight(rRect.Right() - aNewPos.X() - aVisAreaSize.Width()); if(distRight > 0) { - long mult = (distRight / nFreeSpaceX) + 1; + ::tools::Long mult = (distRight / nFreeSpaceX) + 1; aNewPos.AdjustX(mult * nFreeSpaceX ); } - const long distLeft(aNewPos.X() - rRect.Left()); + const ::tools::Long distLeft(aNewPos.X() - rRect.Left()); if(distLeft > 0) { - long mult = (distLeft / nFreeSpaceX) + 1; + ::tools::Long mult = (distLeft / nFreeSpaceX) + 1; aNewPos.AdjustX( -(mult * nFreeSpaceX) ); } } @@ -172,19 +172,19 @@ void DrawViewShell::MakeVisible(const ::tools::Rectangle& rRect, vcl::Window& rW } else { - const long distBottom(rRect.Bottom() - aNewPos.Y() - aVisAreaSize.Height()); + const ::tools::Long distBottom(rRect.Bottom() - aNewPos.Y() - aVisAreaSize.Height()); if(distBottom > 0) { - long mult = (distBottom / nFreeSpaceY) + 1; + ::tools::Long mult = (distBottom / nFreeSpaceY) + 1; aNewPos.AdjustY(mult * nFreeSpaceY ); } - const long distTop(aNewPos.Y() - rRect.Top()); + const ::tools::Long distTop(aNewPos.Y() - rRect.Top()); if(distTop > 0) { - long mult = (distTop / nFreeSpaceY) + 1; + ::tools::Long mult = (distTop / nFreeSpaceY) + 1; aNewPos.AdjustY( -(mult * nFreeSpaceY) ); } } diff --git a/sd/source/ui/view/drviewsj.cxx b/sd/source/ui/view/drviewsj.cxx index 829338a67de1..47cbb175ddf4 100644 --- a/sd/source/ui/view/drviewsj.cxx +++ b/sd/source/ui/view/drviewsj.cxx @@ -192,9 +192,9 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet ) aAttrSet.GetItemState( SDRATTR_EDGELINE2DELTA ) >= SfxItemState::DEFAULT && aAttrSet.GetItemState( SDRATTR_EDGELINE3DELTA ) >= SfxItemState::DEFAULT ) { - long nVal1 = aAttrSet.Get( SDRATTR_EDGELINE1DELTA ).GetValue(); - long nVal2 = aAttrSet.Get( SDRATTR_EDGELINE2DELTA ).GetValue(); - long nVal3 = aAttrSet.Get( SDRATTR_EDGELINE3DELTA ).GetValue(); + ::tools::Long nVal1 = aAttrSet.Get( SDRATTR_EDGELINE1DELTA ).GetValue(); + ::tools::Long nVal2 = aAttrSet.Get( SDRATTR_EDGELINE2DELTA ).GetValue(); + ::tools::Long nVal3 = aAttrSet.Get( SDRATTR_EDGELINE3DELTA ).GetValue(); { if( nVal1 != 0 || nVal2 != 0 || nVal3 != 0 ) bDisable = false; diff --git a/sd/source/ui/view/outlnvs2.cxx b/sd/source/ui/view/outlnvs2.cxx index a11d9b28282e..72626b9654ed 100644 --- a/sd/source/ui/view/outlnvs2.cxx +++ b/sd/source/ui/view/outlnvs2.cxx @@ -84,7 +84,7 @@ void OutlineViewShell::FuTemporary(SfxRequest &rReq) switch( eZT ) { case SvxZoomType::PERCENT: - SetZoom( static_cast<long>( pArgs->Get( SID_ATTR_ZOOM ).GetValue()) ); + SetZoom( static_cast<::tools::Long>( pArgs->Get( SID_ATTR_ZOOM ).GetValue()) ); Invalidate( SID_ATTR_ZOOM ); Invalidate( SID_ATTR_ZOOMSLIDER ); break; diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx index c62380fde3de..ce1cb0ceeee3 100644 --- a/sd/source/ui/view/outlnvsh.cxx +++ b/sd/source/ui/view/outlnvsh.cxx @@ -1051,19 +1051,19 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet ) */ void OutlineViewShell::VirtHScrollHdl(ScrollBar* pHScroll) { - long nThumb = pHScroll->GetThumbPos(); - long nRange = pHScroll->GetRange().Len(); + ::tools::Long nThumb = pHScroll->GetThumbPos(); + ::tools::Long nRange = pHScroll->GetRange().Len(); double fX = static_cast<double>(nThumb) / nRange; Window* pWin = mpContentWindow.get(); OutlinerView* pOutlinerView = pOlView->GetViewByWindow(pWin); - long nViewWidth = pWin->PixelToLogic( + ::tools::Long nViewWidth = pWin->PixelToLogic( pWin->GetSizePixel()).Width(); - long nTextWidth = pOlView->GetPaperWidth(); + ::tools::Long nTextWidth = pOlView->GetPaperWidth(); nViewWidth = std::max(nViewWidth, nTextWidth); - long nCurrentPos = pOutlinerView->GetVisArea().Left(); - long nTargetPos = static_cast<long>(fX * nViewWidth); - long nDelta = nTargetPos - nCurrentPos; + ::tools::Long nCurrentPos = pOutlinerView->GetVisArea().Left(); + ::tools::Long nTargetPos = static_cast<::tools::Long>(fX * nViewWidth); + ::tools::Long nDelta = nTargetPos - nCurrentPos; pOutlinerView->HideCursor(); pOutlinerView->Scroll(-nDelta, 0); @@ -1072,19 +1072,19 @@ void OutlineViewShell::VirtHScrollHdl(ScrollBar* pHScroll) void OutlineViewShell::VirtVScrollHdl(ScrollBar* pVScroll) { - long nThumb = pVScroll->GetThumbPos(); - long nRange = pVScroll->GetRange().Len(); + ::tools::Long nThumb = pVScroll->GetThumbPos(); + ::tools::Long nRange = pVScroll->GetRange().Len(); double fY = static_cast<double>(nThumb) / nRange; Window* pWin = mpContentWindow.get(); OutlinerView* pOutlinerView = pOlView->GetViewByWindow(pWin); - long nViewHeight = pWin->PixelToLogic( + ::tools::Long nViewHeight = pWin->PixelToLogic( pWin->GetSizePixel()).Height(); - long nTextHeight = pOlView->GetOutliner().GetTextHeight(); + ::tools::Long nTextHeight = pOlView->GetOutliner().GetTextHeight(); nViewHeight += nTextHeight; - long nCurrentPos = pOutlinerView->GetVisArea().Top(); - long nTargetPos = static_cast<long>(fY * nViewHeight); - long nDelta = nTargetPos - nCurrentPos; + ::tools::Long nCurrentPos = pOutlinerView->GetVisArea().Top(); + ::tools::Long nTargetPos = static_cast<::tools::Long>(fY * nViewHeight); + ::tools::Long nDelta = nTargetPos - nCurrentPos; pOutlinerView->HideCursor(); pOutlinerView->Scroll(0, -nDelta); @@ -1108,7 +1108,7 @@ bool OutlineViewShell::PrepareClose( bool bUI ) /** * Zoom with zoom factor. Inform OutlinerView */ -void OutlineViewShell::SetZoom(long nZoom) +void OutlineViewShell::SetZoom(::tools::Long nZoom) { ViewShell::SetZoom(nZoom); diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx index 11a7d332da8b..8abad53cccc6 100644 --- a/sd/source/ui/view/outlview.cxx +++ b/sd/source/ui/view/outlview.cxx @@ -1542,7 +1542,7 @@ IMPL_LINK(OutlineView, PaintingFirstLineHdl, PaintFirstLineInfo*, pInfo, void) if( !(pPara && ::Outliner::HasParaFlag(pPara,ParaFlag::ISPAGE)) ) return; - long nPage = 0; // todo, printing?? + ::tools::Long nPage = 0; // todo, printing?? for ( sal_Int32 n = 0; n <= pInfo->mnPara; n++ ) { Paragraph* p = mrOutliner.GetParagraph( n ); @@ -1550,8 +1550,8 @@ IMPL_LINK(OutlineView, PaintingFirstLineHdl, PaintFirstLineInfo*, pInfo, void) nPage++; } - long nBulletHeight = static_cast<long>(mrOutliner.GetLineHeight( pInfo->mnPara )); - long nFontHeight = 0; + ::tools::Long nBulletHeight = static_cast<::tools::Long>(mrOutliner.GetLineHeight( pInfo->mnPara )); + ::tools::Long nFontHeight = 0; if ( !rEditEngine.IsFlatMode() ) { nFontHeight = nBulletHeight / 5; @@ -1569,9 +1569,9 @@ IMPL_LINK(OutlineView, PaintingFirstLineHdl, PaintFirstLineInfo*, pInfo, void) if (aImageSize.Width() != 0) { const float fImageRatio = static_cast<float>(aImageSize.Height()) / static_cast<float>(aImageSize.Width()); - aImageSize.setWidth( static_cast<long>( fImageRatio * fImageHeight ) ); + aImageSize.setWidth( static_cast<::tools::Long>( fImageRatio * fImageHeight ) ); } - aImageSize.setHeight( static_cast<long>(fImageHeight) ); + aImageSize.setHeight( static_cast<::tools::Long>(fImageHeight) ); Point aImagePos( pInfo->mrStartPos ); aImagePos.AdjustX(aOutSize.Width() - aImageSize.Width() - aOffset.Width() ) ; diff --git a/sd/source/ui/view/sdruler.cxx b/sd/source/ui/view/sdruler.cxx index 60600b301afc..a3892acfd957 100644 --- a/sd/source/ui/view/sdruler.cxx +++ b/sd/source/ui/view/sdruler.cxx @@ -120,7 +120,7 @@ void Ruler::MouseButtonDown(const MouseEvent& rMEvt) void Ruler::SetNullOffset(const Point& rOffset) { - long nOffset; + ::tools::Long nOffset; if ( bHorz ) nOffset = rOffset.X(); else nOffset = rOffset.Y(); diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index eca9b996d9dd..e05e370d3321 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -645,7 +645,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, maDropPos.setY( pOwnData->GetStartPos().Y() + ( aSize.Height() >> 1 ) ); // delete pages, that are not of any interest for us - for( long i = pWorkModel->GetPageCount() - 1; i >= 0; i-- ) + for( ::tools::Long i = pWorkModel->GetPageCount() - 1; i >= 0; i-- ) { SdPage* pP = static_cast< SdPage* >( pWorkModel->GetPage( static_cast<sal_uInt16>(i) ) ); @@ -892,7 +892,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, } // delete pages, that are not of any interest for us - for( long i = pModel->GetPageCount() - 1; i >= 0; i-- ) + for( ::tools::Long i = pModel->GetPageCount() - 1; i >= 0; i-- ) { SdPage* pP = static_cast< SdPage* >( pModel->GetPage( static_cast<sal_uInt16>(i) ) ); @@ -1345,7 +1345,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, ::sd::Window* pWin = mpViewSh->GetActiveWindow(); sal_uInt16 nHitLog = static_cast<sal_uInt16>(pWin->PixelToLogic( Size(FuPoor::HITPIX, 0 ) ).Width()); - const long n2HitLog = nHitLog << 1; + const ::tools::Long n2HitLog = nHitLog << 1; Point aHitPosR( rPos ); Point aHitPosL( rPos ); Point aHitPosT( rPos ); diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx index 1c06ad1762f4..bb71ade2f70f 100644 --- a/sd/source/ui/view/sdwindow.cxx +++ b/sd/source/ui/view/sdwindow.cxx @@ -142,7 +142,7 @@ void Window::CalcMinZoom() return; // Get current zoom factor. - long nZoom = GetZoom(); + ::tools::Long nZoom = GetZoom(); // Get the rectangle of the output area in logical coordinates // and calculate the scaling factors that would lead to the view @@ -164,25 +164,25 @@ void Window::CalcMinZoom() // If the current zoom factor is smaller than the calculated minimal // zoom factor then set the new minimal factor as the current zoom // factor. - if ( nZoom < static_cast<long>(mnMinZoom) ) + if ( nZoom < static_cast<::tools::Long>(mnMinZoom) ) SetZoomFactor(mnMinZoom); } -void Window::SetMinZoom (long int nMin) +void Window::SetMinZoom (::tools::Long nMin) { mnMinZoom = static_cast<sal_uInt16>(nMin); } -void Window::SetMaxZoom (long int nMax) +void Window::SetMaxZoom (::tools::Long nMax) { mnMaxZoom = static_cast<sal_uInt16>(nMax); } -long Window::GetZoom() const +::tools::Long Window::GetZoom() const { if( GetMapMode().GetScaleX().GetDenominator() ) { - return long(GetMapMode().GetScaleX() * 100); + return ::tools::Long(GetMapMode().GetScaleX() * 100); } else { @@ -324,13 +324,13 @@ void Window::SetCenterAllowed (bool bIsAllowed) mbCenterAllowed = bIsAllowed; } -long Window::SetZoomFactor(long nZoom) +::tools::Long Window::SetZoomFactor(::tools::Long nZoom) { // Clip the zoom factor to the valid range marked by nMinZoom as // calculated by CalcMinZoom() and the constant MAX_ZOOM. if ( nZoom > MAX_ZOOM ) nZoom = MAX_ZOOM; - if ( nZoom < static_cast<long>(mnMinZoom) ) + if ( nZoom < static_cast<::tools::Long>(mnMinZoom) ) nZoom = mnMinZoom; // Set the zoom factor at the window's map mode. @@ -357,20 +357,20 @@ long Window::SetZoomFactor(long nZoom) return nZoom; } -void Window::SetZoomIntegral(long nZoom) +void Window::SetZoomIntegral(::tools::Long nZoom) { // Clip the zoom factor to the valid range marked by nMinZoom as // previously calculated by <member>CalcMinZoom()</member> and the // MAX_ZOOM constant. if ( nZoom > MAX_ZOOM ) nZoom = MAX_ZOOM; - if ( nZoom < static_cast<long>(mnMinZoom) ) + if ( nZoom < static_cast<::tools::Long>(mnMinZoom) ) nZoom = mnMinZoom; // Calculate the window's new origin. Size aSize = PixelToLogic(GetOutputSizePixel()); - long nW = aSize.Width() * GetZoom() / nZoom; - long nH = aSize.Height() * GetZoom() / nZoom; + ::tools::Long nW = aSize.Width() * GetZoom() / nZoom; + ::tools::Long nH = aSize.Height() * GetZoom() / nZoom; maWinPos.AdjustX((aSize.Width() - nW) / 2 ); maWinPos.AdjustY((aSize.Height() - nH) / 2 ); if ( maWinPos.X() < 0 ) maWinPos.setX( 0 ); @@ -381,9 +381,9 @@ void Window::SetZoomIntegral(long nZoom) SetZoomFactor(nZoom); } -long Window::GetZoomForRect( const ::tools::Rectangle& rZoomRect ) +::tools::Long Window::GetZoomForRect( const ::tools::Rectangle& rZoomRect ) { - long nRetZoom = 100; + ::tools::Long nRetZoom = 100; if( (rZoomRect.GetWidth() != 0) && (rZoomRect.GetHeight() != 0)) { @@ -428,7 +428,7 @@ long Window::GetZoomForRect( const ::tools::Rectangle& rZoomRect ) // MAX_ZOOM constant. if ( nRetZoom > MAX_ZOOM ) nRetZoom = MAX_ZOOM; - if ( nRetZoom < static_cast<long>(mnMinZoom) ) + if ( nRetZoom < static_cast<::tools::Long>(mnMinZoom) ) nRetZoom = mnMinZoom; } } @@ -440,9 +440,9 @@ long Window::GetZoomForRect( const ::tools::Rectangle& rZoomRect ) is displayed centered and as large as possible while still being fully visible in the window. */ -long Window::SetZoomRect (const ::tools::Rectangle& rZoomRect) +::tools::Long Window::SetZoomRect (const ::tools::Rectangle& rZoomRect) { - long nNewZoom = 100; + ::tools::Long nNewZoom = 100; if (rZoomRect.GetWidth() == 0 || rZoomRect.GetHeight() == 0) { @@ -486,7 +486,7 @@ long Window::SetZoomRect (const ::tools::Rectangle& rZoomRect) // Transform the current zoom factor so that it leads to the desired // scaling. - long nZoom = nFact * GetZoom() / ZOOM_MULTIPLICATOR; + ::tools::Long nZoom = nFact * GetZoom() / ZOOM_MULTIPLICATOR; // Calculate the new origin. if ( nFact == 0 ) @@ -503,9 +503,9 @@ long Window::SetZoomRect (const ::tools::Rectangle& rZoomRect) maWinPos = maViewOrigin + aPos; - aWinSize.setWidth( static_cast<long>(static_cast<double>(aWinSize.Width()) * double(ZOOM_MULTIPLICATOR) / static_cast<double>(nFact)) ); + aWinSize.setWidth( static_cast<::tools::Long>(static_cast<double>(aWinSize.Width()) * double(ZOOM_MULTIPLICATOR) / static_cast<double>(nFact)) ); maWinPos.AdjustX((rZoomRect.GetWidth() - aWinSize.Width()) / 2 ); - aWinSize.setHeight( static_cast<long>(static_cast<double>(aWinSize.Height()) * double(ZOOM_MULTIPLICATOR) / static_cast<double>(nFact)) ); + aWinSize.setHeight( static_cast<::tools::Long>(static_cast<double>(aWinSize.Height()) * double(ZOOM_MULTIPLICATOR) / static_cast<double>(nFact)) ); maWinPos.AdjustY((rZoomRect.GetHeight() - aWinSize.Height()) / 2 ); if ( maWinPos.X() < 0 ) maWinPos.setX( 0 ); @@ -644,13 +644,13 @@ double Window::GetVisibleY() const */ void Window::SetVisibleXY(double fX, double fY) { - long nOldX = maWinPos.X(); - long nOldY = maWinPos.Y(); + ::tools::Long nOldX = maWinPos.X(); + ::tools::Long nOldY = maWinPos.Y(); if ( fX >= 0 ) - maWinPos.setX( static_cast<long>(fX * maViewSize.Width()) ); + maWinPos.setX( static_cast<::tools::Long>(fX * maViewSize.Width()) ); if ( fY >= 0 ) - maWinPos.setY( static_cast<long>(fY * maViewSize.Height()) ); + maWinPos.setY( static_cast<::tools::Long>(fY * maViewSize.Height()) ); UpdateMapOrigin(false); Scroll(nOldX - maWinPos.X(), nOldY - maWinPos.Y(), ScrollFlags::Children); PaintImmediately(); diff --git a/sd/source/ui/view/viewoverlaymanager.cxx b/sd/source/ui/view/viewoverlaymanager.cxx index 0bcd5fcb3ddd..5c309ba4cf67 100644 --- a/sd/source/ui/view/viewoverlaymanager.cxx +++ b/sd/source/ui/view/viewoverlaymanager.cxx @@ -367,7 +367,7 @@ BitmapEx ChangePlaceholderTag::createOverlayImage( int nHighlight ) pDev = Application::GetDefaultDevice(); Size aShapeSizePix = pDev->LogicToPixel(rSnapRect.GetSize()); - long nShapeSizePix = std::min(aShapeSizePix.Width(),aShapeSizePix.Height()); + ::tools::Long nShapeSizePix = std::min(aShapeSizePix.Width(),aShapeSizePix.Height()); bool bLarge = nShapeSizePix > 250; @@ -403,7 +403,7 @@ void ChangePlaceholderTag::addCustomHandles( SdrHdlList& rHandlerList ) pDev = Application::GetDefaultDevice(); Size aShapeSizePix = pDev->LogicToPixel(rSnapRect.GetSize()); - long nShapeSizePix = std::min(aShapeSizePix.Width(),aShapeSizePix.Height()); + ::tools::Long nShapeSizePix = std::min(aShapeSizePix.Width(),aShapeSizePix.Height()); if( 50 > nShapeSizePix ) return; @@ -414,8 +414,8 @@ void ChangePlaceholderTag::addCustomHandles( SdrHdlList& rHandlerList ) const int nColumns = 2; const int nRows = 2; - long all_width = nColumns * aButtonSize.Width(); - long all_height = nRows * aButtonSize.Height(); + ::tools::Long all_width = nColumns * aButtonSize.Width(); + ::tools::Long all_height = nRows * aButtonSize.Height(); Point aPos( rSnapRect.Center() ); aPos.AdjustX( -(all_width >> 1) ); diff --git a/sd/source/ui/view/viewshe2.cxx b/sd/source/ui/view/viewshe2.cxx index 4e1ebe7321ad..8bfc9739e6e7 100644 --- a/sd/source/ui/view/viewshe2.cxx +++ b/sd/source/ui/view/viewshe2.cxx @@ -73,21 +73,21 @@ void ViewShell::UpdateScrollBars() { if (mpHorizontalScrollBar) { - long nW = static_cast<long>(mpContentWindow->GetVisibleWidth() * 32000); - long nX = static_cast<long>(mpContentWindow->GetVisibleX() * 32000); + ::tools::Long nW = static_cast<::tools::Long>(mpContentWindow->GetVisibleWidth() * 32000); + ::tools::Long nX = static_cast<::tools::Long>(mpContentWindow->GetVisibleX() * 32000); mpHorizontalScrollBar->SetVisibleSize(nW); mpHorizontalScrollBar->SetThumbPos(nX); nW = 32000 - nW; - long nLine = static_cast<long>(mpContentWindow->GetScrlLineWidth() * nW); - long nPage = static_cast<long>(mpContentWindow->GetScrlPageWidth() * nW); + ::tools::Long nLine = static_cast<::tools::Long>(mpContentWindow->GetScrlLineWidth() * nW); + ::tools::Long nPage = static_cast<::tools::Long>(mpContentWindow->GetScrlPageWidth() * nW); mpHorizontalScrollBar->SetLineSize(nLine); mpHorizontalScrollBar->SetPageSize(nPage); } if (mpVerticalScrollBar) { - long nH = static_cast<long>(mpContentWindow->GetVisibleHeight() * 32000); - long nY = static_cast<long>(mpContentWindow->GetVisibleY() * 32000); + ::tools::Long nH = static_cast<::tools::Long>(mpContentWindow->GetVisibleHeight() * 32000); + ::tools::Long nY = static_cast<::tools::Long>(mpContentWindow->GetVisibleY() * 32000); if(IsPageFlipMode()) // ie in zoom mode where no panning { @@ -106,8 +106,8 @@ void ViewShell::UpdateScrollBars() mpVerticalScrollBar->SetVisibleSize(nH); mpVerticalScrollBar->SetThumbPos(nY); nH = 32000 - nH; - long nLine = static_cast<long>(mpContentWindow->GetScrlLineHeight() * nH); - long nPage = static_cast<long>(mpContentWindow->GetScrlPageHeight() * nH); + ::tools::Long nLine = static_cast<::tools::Long>(mpContentWindow->GetScrlLineHeight() * nH); + ::tools::Long nPage = static_cast<::tools::Long>(mpContentWindow->GetScrlPageHeight() * nH); mpVerticalScrollBar->SetLineSize(nLine); mpVerticalScrollBar->SetPageSize(nPage); } @@ -133,7 +133,7 @@ IMPL_LINK(ViewShell, HScrollHdl, ScrollBar *, pHScroll, void ) */ void ViewShell::VirtHScrollHdl(ScrollBar* pHScroll) { - long nDelta = pHScroll->GetDelta(); + ::tools::Long nDelta = pHScroll->GetDelta(); if (nDelta == 0) return; @@ -254,7 +254,7 @@ void ViewShell::UpdateVRuler() * Scroll a specific number of lines. Is used in the automatic scrolling * (character/drag). */ -void ViewShell::ScrollLines(long nLinesX, long nLinesY) +void ViewShell::ScrollLines(::tools::Long nLinesX, ::tools::Long nLinesY) { if ( nLinesX ) { @@ -268,16 +268,16 @@ void ViewShell::ScrollLines(long nLinesX, long nLinesY) Scroll(nLinesX, nLinesY); } -void ViewShell::Scroll(long nScrollX, long nScrollY) +void ViewShell::Scroll(::tools::Long nScrollX, ::tools::Long nScrollY) { if (nScrollX) { - long nNewThumb = mpHorizontalScrollBar->GetThumbPos() + nScrollX; + ::tools::Long nNewThumb = mpHorizontalScrollBar->GetThumbPos() + nScrollX; mpHorizontalScrollBar->SetThumbPos(nNewThumb); } if (nScrollY) { - long nNewThumb = mpVerticalScrollBar->GetThumbPos() + nScrollY; + ::tools::Long nNewThumb = mpVerticalScrollBar->GetThumbPos() + nScrollY; mpVerticalScrollBar->SetThumbPos(nNewThumb); } double fX = static_cast<double>(mpHorizontalScrollBar->GetThumbPos()) / @@ -312,7 +312,7 @@ void ViewShell::Scroll(long nScrollX, long nScrollY) /** * Set zoom factor for all split windows. */ -void ViewShell::SetZoom(long nZoom) +void ViewShell::SetZoom(::tools::Long nZoom) { Fraction aUIScale(nZoom, 100); aUIScale *= GetDoc()->GetUIScale(); @@ -347,7 +347,7 @@ void ViewShell::SetZoom(long nZoom) UpdateScrollBars(); } -long ViewShell::GetZoom() const +::tools::Long ViewShell::GetZoom() const { if (mpContentWindow) { @@ -363,7 +363,7 @@ long ViewShell::GetZoom() const */ void ViewShell::SetZoomRect(const ::tools::Rectangle& rZoomRect) { - long nZoom = GetActiveWindow()->SetZoomRect(rZoomRect); + ::tools::Long nZoom = GetActiveWindow()->SetZoomRect(rZoomRect); Fraction aUIScale(nZoom, 100); aUIScale *= GetDoc()->GetUIScale(); @@ -454,8 +454,8 @@ void ViewShell::DrawMarkRect(const ::tools::Rectangle& rRect) const } void ViewShell::SetPageSizeAndBorder(PageKind ePageKind, const Size& rNewSize, - long nLeft, long nRight, - long nUpper, long nLower, bool bScaleAll, + ::tools::Long nLeft, ::tools::Long nRight, + ::tools::Long nUpper, ::tools::Long nLower, bool bScaleAll, Orientation eOrientation, sal_uInt16 nPaperBin, bool bBackgroundFullSize) { @@ -506,8 +506,8 @@ void ViewShell::SetPageSizeAndBorder(PageKind ePageKind, const Size& rNewSize, SdPage* pPage(0 != nPageCnt ? GetDoc()->GetSdPage(0, ePageKind) : GetDoc()->GetMasterSdPage(0, ePageKind)); - const long nWidth(pPage->GetSize().Width()); - const long nHeight(pPage->GetSize().Height()); + const ::tools::Long nWidth(pPage->GetSize().Width()); + const ::tools::Long nHeight(pPage->GetSize().Height()); const Point aPageOrg(nWidth, nHeight / 2); const Size aViewSize(nWidth * 3, nHeight * 2); Point aVisAreaPos; @@ -548,7 +548,7 @@ void ViewShell::SetPageSizeAndBorder(PageKind ePageKind, const Size& rNewSize, */ void ViewShell::SetZoomFactor(const Fraction& rZoomX, const Fraction&) { - long nZoom = static_cast<long>(static_cast<double>(rZoomX) * 100); + ::tools::Long nZoom = static_cast<::tools::Long>(static_cast<double>(rZoomX) * 100); SetZoom(nZoom); } @@ -627,7 +627,7 @@ void ViewShell::WriteFrameViewData() { } -bool ViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb) +bool ViewShell::ActivateObject(SdrOle2Obj* pObj, ::tools::Long nVerb) { ErrCode aErrCode = ERRCODE_NONE; diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx index a5d1cb22f140..691e5f8a0963 100644 --- a/sd/source/ui/view/viewshel.cxx +++ b/sd/source/ui/view/viewshel.cxx @@ -695,7 +695,7 @@ bool ViewShell::HandleScrollCommand(const CommandEvent& rCEvt, ::sd::Window* pWi const CommandWheelData* pData = rCEvt.GetWheelData(); if( pData && !pData->GetModifier() && ( pData->GetMode() == CommandWheelMode::SCROLL ) && !pData->IsHorz() ) { - long nDelta = pData->GetDelta(); + ::tools::Long nDelta = pData->GetDelta(); if( nDelta > 0 ) xSlideShowController->gotoPreviousSlide(); else if( nDelta < 0 ) @@ -716,8 +716,8 @@ bool ViewShell::HandleScrollCommand(const CommandEvent& rCEvt, ::sd::Window* pWi { if( !GetDocSh()->IsUIActive() ) { - const long nOldZoom = GetActiveWindow()->GetZoom(); - long nNewZoom; + const ::tools::Long nOldZoom = GetActiveWindow()->GetZoom(); + ::tools::Long nNewZoom; Point aOldMousePos = GetActiveWindow()->PixelToLogic(rCEvt.GetMousePosPixel()); if( pData->GetDelta() < 0 ) @@ -768,7 +768,7 @@ void ViewShell::SetupRulers() if(!mbHasRulers || !mpContentWindow || SlideShow::IsRunning(GetViewShellBase())) return; - long nHRulerOfs = 0; + ::tools::Long nHRulerOfs = 0; if ( !mpVerticalRuler ) { @@ -937,10 +937,10 @@ void ViewShell::ArrangeGUIElements() mpImpl->mbArrangeActive = true; // Calculate border for in-place editing. - long nLeft = maViewPos.X(); - long nTop = maViewPos.Y(); - long nRight = maViewPos.X() + maViewSize.Width(); - long nBottom = maViewPos.Y() + maViewSize.Height(); + ::tools::Long nLeft = maViewPos.X(); + ::tools::Long nTop = maViewPos.Y(); + ::tools::Long nRight = maViewPos.X() + maViewSize.Width(); + ::tools::Long nBottom = maViewPos.Y() + maViewSize.Height(); // Horizontal scrollbar. if (mpHorizontalScrollBar @@ -1397,7 +1397,7 @@ SdDrawDocument* ViewShell::GetDoc() const return GetViewShellBase().GetDocument(); } -ErrCode ViewShell::DoVerb (long ) +ErrCode ViewShell::DoVerb (::tools::Long ) { return ERRCODE_NONE; } |