diff options
Diffstat (limited to 'sd/source/ui')
80 files changed, 443 insertions, 442 deletions
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; } |