diff options
Diffstat (limited to 'svx/source/dialog')
26 files changed, 412 insertions, 412 deletions
diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx index c31e10543f37..31b8f8c98946 100644 --- a/svx/source/dialog/_bmpmask.cxx +++ b/svx/source/dialog/_bmpmask.cxx @@ -659,9 +659,9 @@ GDIMetaFile SvxBmpMask::ImpMask( const GDIMetaFile& rMtf ) { bool pTrans[4]; Color aCol; - long nR; - long nG; - long nB; + tools::Long nR; + tools::Long nG; + tools::Long nB; std::unique_ptr<long[]> pMinR(new long[nCount]); std::unique_ptr<long[]> pMaxR(new long[nCount]); std::unique_ptr<long[]> pMinG(new long[nCount]); @@ -676,17 +676,17 @@ GDIMetaFile SvxBmpMask::ImpMask( const GDIMetaFile& rMtf ) // Prepare Color comparison array for( i = 0; i < nCount; i++ ) { - long nTol = ( pTols[i] * 255 ) / 100; + tools::Long nTol = ( pTols[i] * 255 ) / 100; - long nVal = static_cast<long>(pSrcCols[i].GetRed()); + tools::Long nVal = static_cast<tools::Long>(pSrcCols[i].GetRed()); pMinR[i] = std::max( nVal - nTol, 0L ); pMaxR[i] = std::min( nVal + nTol, 255L ); - nVal = static_cast<long>(pSrcCols[i].GetGreen()); + nVal = static_cast<tools::Long>(pSrcCols[i].GetGreen()); pMinG[i] = std::max( nVal - nTol, 0L ); pMaxG[i] = std::min( nVal + nTol, 255L ); - nVal = static_cast<long>(pSrcCols[i].GetBlue()); + nVal = static_cast<tools::Long>(pSrcCols[i].GetBlue()); pMinB[i] = std::max( nVal - nTol, 0L ); pMaxB[i] = std::min( nVal + nTol, 255L ); diff --git a/svx/source/dialog/_contdlg.cxx b/svx/source/dialog/_contdlg.cxx index d82004f475bb..82d50178d0fd 100644 --- a/svx/source/dialog/_contdlg.cxx +++ b/svx/source/dialog/_contdlg.cxx @@ -629,7 +629,7 @@ IMPL_LINK( SvxSuperContourDlg, PipetteClickHdl, ContourWindow&, rWnd, void ) if( aGraphic.GetType() == GraphicType::Bitmap ) { - const long nTol = static_cast<long>(m_xMtfTolerance->get_value(FieldUnit::PERCENT) * 255 / 100); + const tools::Long nTol = static_cast<tools::Long>(m_xMtfTolerance->get_value(FieldUnit::PERCENT) * 255 / 100); Bitmap aMask = aGraphic.GetBitmapEx().GetBitmap().CreateMask( rColor, nTol ); diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx index 96ac6ad27c5a..0ff9631fcb3e 100644 --- a/svx/source/dialog/charmap.cxx +++ b/svx/source/dialog/charmap.cxx @@ -465,28 +465,28 @@ void SvxShowCharSet::DeSelect() // stretch a grid rectangle if its at the edge to fill unused space tools::Rectangle SvxShowCharSet::getGridRectangle(const Point &rPointUL, const Size &rOutputSize) { - long x = rPointUL.X() - 1; - long y = rPointUL.Y() - 1; + tools::Long x = rPointUL.X() - 1; + tools::Long y = rPointUL.Y() - 1; Point aPointUL(x+1, y+1); Size aGridSize(nX-1, nY-1); - long nXDistFromLeft = x - m_nXGap; + tools::Long nXDistFromLeft = x - m_nXGap; if (nXDistFromLeft <= 1) { aPointUL.setX( 1 ); aGridSize.AdjustWidth(m_nXGap + nXDistFromLeft ); } - long nXDistFromRight = rOutputSize.Width() - m_nXGap - nX - x; + tools::Long nXDistFromRight = rOutputSize.Width() - m_nXGap - nX - x; if (nXDistFromRight <= 1) aGridSize.AdjustWidth(m_nXGap + nXDistFromRight ); - long nXDistFromTop = y - m_nYGap; + tools::Long nXDistFromTop = y - m_nYGap; if (nXDistFromTop <= 1) { aPointUL.setY( 1 ); aGridSize.AdjustHeight(m_nYGap + nXDistFromTop ); } - long nXDistFromBottom = rOutputSize.Height() - m_nYGap - nY - y; + tools::Long nXDistFromBottom = rOutputSize.Height() - m_nYGap - nY - y; if (nXDistFromBottom <= 1) aGridSize.AdjustHeight(m_nYGap + nXDistFromBottom ); diff --git a/svx/source/dialog/compressgraphicdialog.cxx b/svx/source/dialog/compressgraphicdialog.cxx index d16202cd5c1c..856dd7a08149 100644 --- a/svx/source/dialog/compressgraphicdialog.cxx +++ b/svx/source/dialog/compressgraphicdialog.cxx @@ -249,8 +249,8 @@ void CompressGraphicsDialog::Compress(SvStream& aStream) BitmapEx aBitmap = m_aGraphic.GetBitmapEx(); if ( m_xReduceResolutionCB->get_active() ) { - long nPixelX = static_cast<long>( GetViewWidthInch() * m_dResolution ); - long nPixelY = static_cast<long>( GetViewHeightInch() * m_dResolution ); + tools::Long nPixelX = static_cast<tools::Long>( GetViewWidthInch() * m_dResolution ); + tools::Long nPixelY = static_cast<tools::Long>( GetViewHeightInch() * m_dResolution ); aBitmap.Scale( Size( nPixelX, nPixelY ), GetSelectedInterpolationType() ); } @@ -373,8 +373,8 @@ tools::Rectangle CompressGraphicsDialog::GetScaledCropRectangle() const { if ( m_xReduceResolutionCB->get_active() ) { - long nPixelX = static_cast<long>( GetViewWidthInch() * m_dResolution ); - long nPixelY = static_cast<long>( GetViewHeightInch() * m_dResolution ); + tools::Long nPixelX = static_cast<tools::Long>( GetViewWidthInch() * m_dResolution ); + tools::Long nPixelY = static_cast<tools::Long>( GetViewHeightInch() * m_dResolution ); Size aSize = m_aGraphic.GetBitmapEx().GetSizePixel(); double aScaleX = nPixelX / static_cast<double>(aSize.Width()); double aScaleY = nPixelY / static_cast<double>(aSize.Height()); diff --git a/svx/source/dialog/connctrl.cxx b/svx/source/dialog/connctrl.cxx index b3006fe24f25..e3496cafed57 100644 --- a/svx/source/dialog/connctrl.cxx +++ b/svx/source/dialog/connctrl.cxx @@ -78,8 +78,8 @@ void SvxXConnectionPreview::AdaptSize() Point aNewPos; Size aNewSize; const Size aWinSize = GetDrawingArea()->get_ref_device().PixelToLogic(GetOutputSizePixel(), aDisplayMap); - const long nWidth = aWinSize.Width(); - const long nHeight = aWinSize.Height(); + const tools::Long nWidth = aWinSize.Width(); + const tools::Long nHeight = aWinSize.Height(); if (aRect.GetHeight() == 0) return; double fRectWH = static_cast<double>(aRect.GetWidth()) / aRect.GetHeight(); @@ -90,13 +90,13 @@ void SvxXConnectionPreview::AdaptSize() // Adapt bitmap to Thumb size (not here!) if ( fRectWH < fWinWH) { - aNewSize.setWidth( static_cast<long>( static_cast<double>(nHeight) * fRectWH ) ); + aNewSize.setWidth( static_cast<tools::Long>( static_cast<double>(nHeight) * fRectWH ) ); aNewSize.setHeight( nHeight ); } else { aNewSize.setWidth( nWidth ); - aNewSize.setHeight( static_cast<long>( static_cast<double>(nWidth) / fRectWH ) ); + aNewSize.setHeight( static_cast<tools::Long>( static_cast<double>(nWidth) / fRectWH ) ); } Fraction aFrac1( aWinSize.Width(), aRect.GetWidth() ); @@ -292,8 +292,8 @@ bool SvxXConnectionPreview::MouseButtonDown( const MouseEvent& rMEvt ) aOutSize = GetDrawingArea()->get_ref_device().PixelToLogic(aOutSize); Point aPt( aMapMode.GetOrigin() ); - long nX = static_cast<long>( ( static_cast<double>(aOutSize.Width()) - ( static_cast<double>(aOutSize.Width()) * static_cast<double>(*pMultFrac) ) ) / 2.0 + 0.5 ); - long nY = static_cast<long>( ( static_cast<double>(aOutSize.Height()) - ( static_cast<double>(aOutSize.Height()) * static_cast<double>(*pMultFrac) ) ) / 2.0 + 0.5 ); + tools::Long nX = static_cast<tools::Long>( ( static_cast<double>(aOutSize.Width()) - ( static_cast<double>(aOutSize.Width()) * static_cast<double>(*pMultFrac) ) ) / 2.0 + 0.5 ); + tools::Long nY = static_cast<tools::Long>( ( static_cast<double>(aOutSize.Height()) - ( static_cast<double>(aOutSize.Height()) * static_cast<double>(*pMultFrac) ) ) / 2.0 + 0.5 ); aPt.AdjustX(nX ); aPt.AdjustY(nY ); diff --git a/svx/source/dialog/dialcontrol.cxx b/svx/source/dialog/dialcontrol.cxx index 527bd4f47883..9052d439bd26 100644 --- a/svx/source/dialog/dialcontrol.cxx +++ b/svx/source/dialog/dialcontrol.cxx @@ -28,7 +28,7 @@ namespace svx { -const long DIAL_OUTER_WIDTH = 8; +const tools::Long DIAL_OUTER_WIDTH = 8; DialControlBmp::DialControlBmp(OutputDevice& rReference) : VirtualDevice(rReference, DeviceFormat::DEFAULT, DeviceFormat::DEFAULT) @@ -80,8 +80,8 @@ void DialControlBmp::DrawElements( const OUString& rText, sal_Int32 nAngle ) aFont.SetWeight( WEIGHT_BOLD ); SetFont( aFont ); - long nX = static_cast< long >( mnCenterX - fWidth * fCos - fHeight * fSin ); - long nY = static_cast< long >( mnCenterY + fWidth * fSin - fHeight * fCos ); + tools::Long nX = static_cast< tools::Long >( mnCenterX - fWidth * fCos - fHeight * fSin ); + tools::Long nY = static_cast< tools::Long >( mnCenterY + fWidth * fSin - fHeight * fCos ); tools::Rectangle aRect( nX, nY, 2 * mnCenterX - nX, 2 * mnCenterY - nY ); DrawText( aRect, rText, mbEnabled ? DrawTextFlags::NONE : DrawTextFlags::Disable ); } @@ -103,9 +103,9 @@ void DialControlBmp::DrawElements( const OUString& rText, sal_Int32 nAngle ) SetLineColor( GetButtonLineColor() ); SetFillColor( GetButtonFillColor( bMain ) ); - long nX = mnCenterX - static_cast< long >( (DIAL_OUTER_WIDTH / 2 - mnCenterX) * fCos ); - long nY = mnCenterY - static_cast< long >( (mnCenterY - DIAL_OUTER_WIDTH / 2) * fSin ); - long nSize = bMain ? (DIAL_OUTER_WIDTH / 4) : (DIAL_OUTER_WIDTH / 2 - 1); + tools::Long nX = mnCenterX - static_cast< tools::Long >( (DIAL_OUTER_WIDTH / 2 - mnCenterX) * fCos ); + tools::Long nY = mnCenterY - static_cast< tools::Long >( (mnCenterY - DIAL_OUTER_WIDTH / 2) * fSin ); + tools::Long nSize = bMain ? (DIAL_OUTER_WIDTH / 4) : (DIAL_OUTER_WIDTH / 2 - 1); DrawEllipse( tools::Rectangle( nX - nSize, nY - nSize, nX + nSize, nY + nSize ) ); } @@ -200,8 +200,8 @@ void DialControlBmp::DrawBackground() { SetLineColor( (nAngle % 45) ? aLightColor : aFullColor ); double fAngle = basegfx::deg2rad(nAngle); - long nX = static_cast< long >( -mnCenterX * cos( fAngle ) ); - long nY = static_cast< long >( mnCenterY * sin( fAngle ) ); + tools::Long nX = static_cast< tools::Long >( -mnCenterX * cos( fAngle ) ); + tools::Long nY = static_cast< tools::Long >( mnCenterY * sin( fAngle ) ); DrawLine( aStartPos, Point( mnCenterX - nX, mnCenterY - nY ) ); } @@ -241,7 +241,7 @@ void DialControl::DialControl_Impl::SetSize( const Size& rWinSize ) { // make the control squared, and adjusted so that we have a well-defined // center ["(x - 1) | 1" creates odd value <= x] - long nMin = (std::min(rWinSize.Width(), rWinSize.Height()) - 1) | 1; + tools::Long nMin = (std::min(rWinSize.Width(), rWinSize.Height()) - 1) | 1; maWinSize = Size( nMin, nMin ); @@ -446,8 +446,8 @@ void DialControl::SetModifyHdl( const Link<DialControl&,void>& rLink ) void DialControl::HandleMouseEvent( const Point& rPos, bool bInitial ) { - long nX = rPos.X() - mpImpl->mnCenterX; - long nY = mpImpl->mnCenterY - rPos.Y(); + tools::Long nX = rPos.X() - mpImpl->mnCenterX; + tools::Long nY = mpImpl->mnCenterY - rPos.Y(); double fH = sqrt( static_cast< double >( nX ) * nX + static_cast< double >( nY ) * nY ); if( fH != 0.0 ) { diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx index 4a353d55033a..c15b3ebc7cb8 100644 --- a/svx/source/dialog/dlgctrl.cxx +++ b/svx/source/dialog/dlgctrl.cxx @@ -432,8 +432,8 @@ void SvxRectCtl::LoseFocus() Point SvxRectCtl::GetApproxLogPtFromPixPt( const Point& rPt ) const { Point aPt = rPt; - long x; - long y; + tools::Long x; + tools::Long y; Size aSize(GetOutputSizePixel()); @@ -579,15 +579,15 @@ css::uno::Reference< css::accessibility::XAccessible > SvxPixelCtl::CreateAccess return m_xAccess.get(); } -long SvxPixelCtl::PointToIndex(const Point &aPt) const +tools::Long SvxPixelCtl::PointToIndex(const Point &aPt) const { - long nX = aPt.X() * nLines / aRectSize.Width(); - long nY = aPt.Y() * nLines / aRectSize.Height(); + tools::Long nX = aPt.X() * nLines / aRectSize.Width(); + tools::Long nY = aPt.Y() * nLines / aRectSize.Height(); return nX + nY * nLines ; } -Point SvxPixelCtl::IndexToPoint(long nIndex) const +Point SvxPixelCtl::IndexToPoint(tools::Long nIndex) const { DBG_ASSERT(nIndex >= 0 && nIndex < nSquares ," Check Index"); @@ -601,12 +601,12 @@ Point SvxPixelCtl::IndexToPoint(long nIndex) const return aPtTl; } -long SvxPixelCtl::GetFocusPosIndex() const +tools::Long SvxPixelCtl::GetFocusPosIndex() const { return aFocusPosition.getX() + aFocusPosition.getY() * nLines ; } -long SvxPixelCtl::ShowPosition( const Point &rPt) +tools::Long SvxPixelCtl::ShowPosition( const Point &rPt) { sal_Int32 nX = rPt.X() * nLines / aRectSize.Width(); sal_Int32 nY = rPt.Y() * nLines / aRectSize.Height(); @@ -673,7 +673,7 @@ bool SvxPixelCtl::MouseButtonDown( const MouseEvent& rMEvt ) GrabFocus(); } - long nIndex = ShowPosition(rMEvt.GetPosPixel()); + tools::Long nIndex = ShowPosition(rMEvt.GetPosPixel()); if(m_xAccess.is()) { @@ -751,8 +751,8 @@ void SvxPixelCtl::Paint( vcl::RenderContext& rRenderContext, const tools::Rectan //Calculate visual focus rectangle via focus position tools::Rectangle SvxPixelCtl::implCalFocusRect( const Point& aPosition ) { - long nLeft,nTop,nRight,nBottom; - long i,j; + tools::Long nLeft,nTop,nRight,nBottom; + tools::Long i,j; i = aPosition.Y(); j = aPosition.X(); nLeft = aRectSize.Width() * j / nLines + 1; @@ -820,7 +820,7 @@ bool SvxPixelCtl::KeyInput( const KeyEvent& rKEvt ) } if(m_xAccess.is()) { - long nIndex = GetFocusPosIndex(); + tools::Long nIndex = GetFocusPosIndex(); switch(nCode) { case KEY_LEFT: @@ -931,10 +931,10 @@ void SvxLineLB::Fill( const XDashListRef &pList ) // entries for dashed lines - long nCount = pList->Count(); + tools::Long nCount = pList->Count(); m_xControl->freeze(); - for( long i = 0; i < nCount; i++ ) + for( tools::Long i = 0; i < nCount; i++ ) { const XDashEntry* pEntry = pList->GetDash(i); const BitmapEx aBitmap = pList->GetUiBitmap( i ); @@ -1000,11 +1000,11 @@ void SvxLineEndLB::Fill( const XLineEndListRef &pList, bool bStart ) if( !pList.is() ) return; - long nCount = pList->Count(); + tools::Long nCount = pList->Count(); ScopedVclPtrInstance< VirtualDevice > pVD; m_xControl->freeze(); - for( long i = 0; i < nCount; i++ ) + for( tools::Long i = 0; i < nCount; i++ ) { const XLineEndEntry* pEntry = pList->GetLineEnd(i); const BitmapEx aBitmap = pList->GetUiBitmap( i ); diff --git a/svx/source/dialog/dlgunit.hxx b/svx/source/dialog/dlgunit.hxx index 108e2b5e3062..7d9a98ac5a9a 100644 --- a/svx/source/dialog/dlgunit.hxx +++ b/svx/source/dialog/dlgunit.hxx @@ -24,7 +24,7 @@ #include <svx/svdtrans.hxx> #include <vcl/fieldvalues.hxx> -inline OUString GetUnitString( long nVal_100, FieldUnit eFieldUnit, sal_Unicode cSep ) +inline OUString GetUnitString( tools::Long nVal_100, FieldUnit eFieldUnit, sal_Unicode cSep ) { OUStringBuffer aVal = OUString::number( vcl::ConvertValue(nVal_100, 2, MapUnit::Map100thMM, eFieldUnit)); diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx index 6dd3e62c5f21..146d5220e2d9 100644 --- a/svx/source/dialog/fntctrl.cxx +++ b/svx/source/dialog/fntctrl.cxx @@ -78,7 +78,7 @@ using ::com::sun::star::i18n::BreakIterator; namespace { -void scaleFontWidth(vcl::Font& rFont, vcl::RenderContext const & rRenderContext,long& n100PercentFont) +void scaleFontWidth(vcl::Font& rFont, vcl::RenderContext const & rRenderContext,tools::Long& n100PercentFont) { rFont.SetAverageFontWidth(0); n100PercentFont = rRenderContext.GetFontMetric(rFont).GetAverageFontWidth(); @@ -98,7 +98,7 @@ void setFontSize(vcl::Font& rFont) rFont.SetFontSize(aSize); } -void calcFontHeightAnyAscent(vcl::RenderContext& rRenderContext, const vcl::Font& rFont, long& nHeight, long& nAscent) +void calcFontHeightAnyAscent(vcl::RenderContext& rRenderContext, const vcl::Font& rFont, tools::Long& nHeight, tools::Long& nAscent) { if (!nHeight) { @@ -154,13 +154,13 @@ class FontPrevWin_Impl std::unique_ptr<Color> mpBackColor; std::unique_ptr<Color> mpTextLineColor; std::unique_ptr<Color> mpOverlineColor; - long mnAscent; + tools::Long mnAscent; sal_Unicode mcStartBracket; sal_Unicode mcEndBracket; - long mn100PercentFontWidth; // initial -1 -> not set yet - long mn100PercentFontWidthCJK; - long mn100PercentFontWidthCTL; + tools::Long mn100PercentFontWidth; // initial -1 -> not set yet + tools::Long mn100PercentFontWidthCJK; + tools::Long mn100PercentFontWidthCTL; sal_uInt16 mnFontWidthScale; bool mbSelection : 1; @@ -312,13 +312,13 @@ Size FontPrevWin_Impl::CalcTextSize(vcl::RenderContext& rRenderContext, OutputDe nEnd = maText.getLength(); nScript = css::i18n::ScriptType::LATIN; } - long nTxtWidth = 0; - long nCJKHeight = 0; - long nCTLHeight = 0; - long nHeight = 0; + tools::Long nTxtWidth = 0; + tools::Long nCJKHeight = 0; + tools::Long nCTLHeight = 0; + tools::Long nHeight = 0; mnAscent = 0; - long nCJKAscent = 0; - long nCTLAscent = 0; + tools::Long nCJKAscent = 0; + tools::Long nCTLAscent = 0; do { @@ -327,7 +327,7 @@ Size FontPrevWin_Impl::CalcTextSize(vcl::RenderContext& rRenderContext, OutputDe ((nScript == css::i18n::ScriptType::COMPLEX) ? maCTLFont : rInFont); - long nWidth = rFont.GetTextSize(_pPrinter, maText, nStart, nEnd - nStart).Width(); + tools::Long nWidth = rFont.GetTextSize(_pPrinter, maText, nStart, nEnd - nStart).Width(); if (nIdx >= maTextWidth.size()) break; @@ -702,8 +702,8 @@ void SvxFontPrevWindow::Paint(vcl::RenderContext& rRenderContext, const tools::R const Size aLogSize(rRenderContext.GetOutputSize()); - long nX = aLogSize.Width() / 2 - aTxtSize.Width() / 2; - long nY = aLogSize.Height() / 2 - aTxtSize.Height() / 2; + tools::Long nX = aLogSize.Width() / 2 - aTxtSize.Width() / 2; + tools::Long nY = aLogSize.Height() / 2 - aTxtSize.Height() / 2; if (nY + pImpl->mnAscent > aLogSize.Height()) nY = aLogSize.Height() - pImpl->mnAscent; @@ -741,7 +741,7 @@ void SvxFontPrevWindow::Paint(vcl::RenderContext& rRenderContext, const tools::R rRenderContext.SetOverlineColor(*pImpl->mpOverlineColor); } - long nStdAscent = pImpl->mnAscent; + tools::Long nStdAscent = pImpl->mnAscent; nY += nStdAscent; if (IsTwoLines()) @@ -751,9 +751,9 @@ void SvxFontPrevWindow::Paint(vcl::RenderContext& rRenderContext, const tools::R setFontSize(aSmallFont); setFontSize(pImpl->maCJKFont); - long nStartBracketWidth = 0; - long nEndBracketWidth = 0; - long nTextWidth = 0; + tools::Long nStartBracketWidth = 0; + tools::Long nEndBracketWidth = 0; + tools::Long nTextWidth = 0; if (pImpl->mcStartBracket) { OUString sBracket(pImpl->mcStartBracket); @@ -765,16 +765,16 @@ void SvxFontPrevWindow::Paint(vcl::RenderContext& rRenderContext, const tools::R nEndBracketWidth = rFont.GetTextSize(pPrinter, sBracket).Width(); } nTextWidth = pImpl->CalcTextSize(rRenderContext, pPrinter, aSmallFont).Width(); - long nResultWidth = nStartBracketWidth; + tools::Long nResultWidth = nStartBracketWidth; nResultWidth += nEndBracketWidth; nResultWidth += nTextWidth; - long _nX = (aLogSize.Width() - nResultWidth) / 2; + tools::Long _nX = (aLogSize.Width() - nResultWidth) / 2; rRenderContext.DrawLine(Point(0, nY), Point(_nX, nY)); rRenderContext.DrawLine(Point(_nX + nResultWidth, nY), Point(aLogSize.Width(), nY)); - long nSmallAscent = pImpl->mnAscent; - long nOffset = (nStdAscent - nSmallAscent) / 2; + tools::Long nSmallAscent = pImpl->mnAscent; + tools::Long nOffset = (nStdAscent - nSmallAscent) / 2; if (pImpl->mcStartBracket) { @@ -854,7 +854,7 @@ void SvxFontPrevWindow::AutoCorrectFontColor() void SvxFontPrevWindow::SetFontSize( const SfxItemSet& rSet, sal_uInt16 nSlot, SvxFont& rFont ) { sal_uInt16 nWhich; - long nH; + tools::Long nH; if (GetWhich(rSet, nSlot, nWhich)) { nH = OutputDevice::LogicToLogic(static_cast<const SvxFontHeightItem&>(rSet.Get(nWhich)).GetHeight(), diff --git a/svx/source/dialog/fontwork.cxx b/svx/source/dialog/fontwork.cxx index 6531ffc1b50e..ef4bfe327364 100644 --- a/svx/source/dialog/fontwork.cxx +++ b/svx/source/dialog/fontwork.cxx @@ -738,7 +738,7 @@ IMPL_LINK_NOARG(SvxFontWorkDialog, InputTimeoutHdl_Impl, Timer*, void) } } - long nValue = GetCoreValue(*m_xMtrFldDistance, MapUnit::Map100thMM); + tools::Long nValue = GetCoreValue(*m_xMtrFldDistance, MapUnit::Map100thMM); XFormTextDistanceItem aDistItem( nValue ); nValue = GetCoreValue(*m_xMtrFldTextStart, MapUnit::Map100thMM); XFormTextStartItem aStartItem( nValue ); diff --git a/svx/source/dialog/framelinkarray.cxx b/svx/source/dialog/framelinkarray.cxx index 714f2b87d41f..bf89b58dfba9 100644 --- a/svx/source/dialog/framelinkarray.cxx +++ b/svx/source/dialog/framelinkarray.cxx @@ -44,10 +44,10 @@ private: Style maBLTR; public: - long mnAddLeft; - long mnAddRight; - long mnAddTop; - long mnAddBottom; + tools::Long mnAddLeft; + tools::Long mnAddRight; + tools::Long mnAddTop; + tools::Long mnAddBottom; SvxRotateMode meRotMode; double mfOrientation; @@ -227,8 +227,8 @@ struct ArrayImpl size_t GetMirrorCol( size_t nCol ) const { return mnWidth - nCol - 1; } - long GetColPosition( size_t nCol ) const; - long GetRowPosition( size_t nRow ) const; + tools::Long GetColPosition( size_t nCol ) const; + tools::Long GetRowPosition( size_t nRow ) const; bool HasCellRotation() const; }; @@ -333,7 +333,7 @@ bool ArrayImpl::IsInClipRange( size_t nCol, size_t nRow ) const return IsColInClipRange( nCol ) && IsRowInClipRange( nRow ); } -long ArrayImpl::GetColPosition( size_t nCol ) const +tools::Long ArrayImpl::GetColPosition( size_t nCol ) const { if( mbXCoordsDirty ) { @@ -343,7 +343,7 @@ long ArrayImpl::GetColPosition( size_t nCol ) const return maXCoords[ nCol ]; } -long ArrayImpl::GetRowPosition( size_t nRow ) const +tools::Long ArrayImpl::GetRowPosition( size_t nRow ) const { if( mbYCoordsDirty ) { @@ -709,7 +709,7 @@ void Array::SetMergedRange( size_t nFirstCol, size_t nFirstRow, size_t nLastCol, lclSetMergedRange( mxImpl->maCells, mxImpl->mnWidth, nFirstCol, nFirstRow, nLastCol, nLastRow ); } -void Array::SetAddMergedLeftSize( size_t nCol, size_t nRow, long nAddSize ) +void Array::SetAddMergedLeftSize( size_t nCol, size_t nRow, tools::Long nAddSize ) { DBG_FRAME_CHECK_COLROW( nCol, nRow, "SetAddMergedLeftSize" ); DBG_FRAME_CHECK( mxImpl->GetMergedFirstCol( nCol, nRow ) == 0, "SetAddMergedLeftSize", "additional border inside array" ); @@ -717,7 +717,7 @@ void Array::SetAddMergedLeftSize( size_t nCol, size_t nRow, long nAddSize ) CELLACC( aIt.Col(), aIt.Row() ).mnAddLeft = nAddSize; } -void Array::SetAddMergedRightSize( size_t nCol, size_t nRow, long nAddSize ) +void Array::SetAddMergedRightSize( size_t nCol, size_t nRow, tools::Long nAddSize ) { DBG_FRAME_CHECK_COLROW( nCol, nRow, "SetAddMergedRightSize" ); DBG_FRAME_CHECK( mxImpl->GetMergedLastCol( nCol, nRow ) + 1 == mxImpl->mnWidth, "SetAddMergedRightSize", "additional border inside array" ); @@ -725,7 +725,7 @@ void Array::SetAddMergedRightSize( size_t nCol, size_t nRow, long nAddSize ) CELLACC( aIt.Col(), aIt.Row() ).mnAddRight = nAddSize; } -void Array::SetAddMergedTopSize( size_t nCol, size_t nRow, long nAddSize ) +void Array::SetAddMergedTopSize( size_t nCol, size_t nRow, tools::Long nAddSize ) { DBG_FRAME_CHECK_COLROW( nCol, nRow, "SetAddMergedTopSize" ); DBG_FRAME_CHECK( mxImpl->GetMergedFirstRow( nCol, nRow ) == 0, "SetAddMergedTopSize", "additional border inside array" ); @@ -733,7 +733,7 @@ void Array::SetAddMergedTopSize( size_t nCol, size_t nRow, long nAddSize ) CELLACC( aIt.Col(), aIt.Row() ).mnAddTop = nAddSize; } -void Array::SetAddMergedBottomSize( size_t nCol, size_t nRow, long nAddSize ) +void Array::SetAddMergedBottomSize( size_t nCol, size_t nRow, tools::Long nAddSize ) { DBG_FRAME_CHECK_COLROW( nCol, nRow, "SetAddMergedBottomSize" ); DBG_FRAME_CHECK( mxImpl->GetMergedLastRow( nCol, nRow ) + 1 == mxImpl->mnHeight, "SetAddMergedBottomSize", "additional border inside array" ); @@ -774,76 +774,76 @@ void Array::SetClipRange( size_t nFirstCol, size_t nFirstRow, size_t nLastCol, s } // cell coordinates -void Array::SetXOffset( long nXOffset ) +void Array::SetXOffset( tools::Long nXOffset ) { mxImpl->maXCoords[ 0 ] = nXOffset; mxImpl->mbXCoordsDirty = true; } -void Array::SetYOffset( long nYOffset ) +void Array::SetYOffset( tools::Long nYOffset ) { mxImpl->maYCoords[ 0 ] = nYOffset; mxImpl->mbYCoordsDirty = true; } -void Array::SetColWidth( size_t nCol, long nWidth ) +void Array::SetColWidth( size_t nCol, tools::Long nWidth ) { DBG_FRAME_CHECK_COL( nCol, "SetColWidth" ); mxImpl->maWidths[ nCol ] = nWidth; mxImpl->mbXCoordsDirty = true; } -void Array::SetRowHeight( size_t nRow, long nHeight ) +void Array::SetRowHeight( size_t nRow, tools::Long nHeight ) { DBG_FRAME_CHECK_ROW( nRow, "SetRowHeight" ); mxImpl->maHeights[ nRow ] = nHeight; mxImpl->mbYCoordsDirty = true; } -void Array::SetAllColWidths( long nWidth ) +void Array::SetAllColWidths( tools::Long nWidth ) { std::fill( mxImpl->maWidths.begin(), mxImpl->maWidths.end(), nWidth ); mxImpl->mbXCoordsDirty = true; } -void Array::SetAllRowHeights( long nHeight ) +void Array::SetAllRowHeights( tools::Long nHeight ) { std::fill( mxImpl->maHeights.begin(), mxImpl->maHeights.end(), nHeight ); mxImpl->mbYCoordsDirty = true; } -long Array::GetColPosition( size_t nCol ) const +tools::Long Array::GetColPosition( size_t nCol ) const { DBG_FRAME_CHECK_COL_1( nCol, "GetColPosition" ); return mxImpl->GetColPosition( nCol ); } -long Array::GetRowPosition( size_t nRow ) const +tools::Long Array::GetRowPosition( size_t nRow ) const { DBG_FRAME_CHECK_ROW_1( nRow, "GetRowPosition" ); return mxImpl->GetRowPosition( nRow ); } -long Array::GetColWidth( size_t nFirstCol, size_t nLastCol ) const +tools::Long Array::GetColWidth( size_t nFirstCol, size_t nLastCol ) const { DBG_FRAME_CHECK_COL( nFirstCol, "GetColWidth" ); DBG_FRAME_CHECK_COL( nLastCol, "GetColWidth" ); return GetColPosition( nLastCol + 1 ) - GetColPosition( nFirstCol ); } -long Array::GetRowHeight( size_t nFirstRow, size_t nLastRow ) const +tools::Long Array::GetRowHeight( size_t nFirstRow, size_t nLastRow ) const { DBG_FRAME_CHECK_ROW( nFirstRow, "GetRowHeight" ); DBG_FRAME_CHECK_ROW( nLastRow, "GetRowHeight" ); return GetRowPosition( nLastRow + 1 ) - GetRowPosition( nFirstRow ); } -long Array::GetWidth() const +tools::Long Array::GetWidth() const { return GetColPosition( mxImpl->mnWidth ) - GetColPosition( 0 ); } -long Array::GetHeight() const +tools::Long Array::GetHeight() const { return GetRowPosition( mxImpl->mnHeight ) - GetRowPosition( 0 ); } diff --git a/svx/source/dialog/frmsel.cxx b/svx/source/dialog/frmsel.cxx index 1b23325726da..cbaa7c2ab8dd 100644 --- a/svx/source/dialog/frmsel.cxx +++ b/svx/source/dialog/frmsel.cxx @@ -70,19 +70,19 @@ namespace { /** Space between outer control border and any graphical element of the control. */ -const long FRAMESEL_GEOM_OUTER = 2; +const tools::Long FRAMESEL_GEOM_OUTER = 2; /** Space between arrows and usable inner area. */ -const long FRAMESEL_GEOM_INNER = 3; +const tools::Long FRAMESEL_GEOM_INNER = 3; /** Maximum width to draw a frame border style. */ -const long FRAMESEL_GEOM_WIDTH = 9; +const tools::Long FRAMESEL_GEOM_WIDTH = 9; /** Additional margin for click area of outer lines. */ -const long FRAMESEL_GEOM_ADD_CLICK_OUTER = 5; +const tools::Long FRAMESEL_GEOM_ADD_CLICK_OUTER = 5; /** Additional margin for click area of inner lines. */ -const long FRAMESEL_GEOM_ADD_CLICK_INNER = 2; +const tools::Long FRAMESEL_GEOM_ADD_CLICK_INNER = 2; /** Returns the corresponding flag for a frame border. */ @@ -356,18 +356,18 @@ void FrameSelectorImpl::InitGlobalGeometry() /* nMinSize is the lower of width and height (control will always be squarish). FRAMESEL_GEOM_OUTER is the minimal distance between inner control border and any element. */ - long nMinSize = std::min( aCtrlSize.Width(), aCtrlSize.Height() ) - 2 * FRAMESEL_GEOM_OUTER; + tools::Long nMinSize = std::min( aCtrlSize.Width(), aCtrlSize.Height() ) - 2 * FRAMESEL_GEOM_OUTER; /* nFixedSize is the size all existing elements need in one direction: the diag. arrow, space betw. arrow and frame border, outer frame border, inner frame border, other outer frame border, space betw. frame border and arrow, the other arrow. */ - long nFixedSize = 2 * mnArrowSize + 2 * FRAMESEL_GEOM_INNER + 3 * FRAMESEL_GEOM_WIDTH; + tools::Long nFixedSize = 2 * mnArrowSize + 2 * FRAMESEL_GEOM_INNER + 3 * FRAMESEL_GEOM_WIDTH; /* nBetwBordersSize contains the size between an outer and inner frame border (made odd). */ - long nBetwBordersSize = (((nMinSize - nFixedSize) / 2) - 1) | 1; + tools::Long nBetwBordersSize = (((nMinSize - nFixedSize) / 2) - 1) | 1; /* The final size of the usable area. At least do not get negative */ mnCtrlSize = 2 * nBetwBordersSize + nFixedSize; - mnCtrlSize = std::max(mnCtrlSize, static_cast<long>(0)); + mnCtrlSize = std::max(mnCtrlSize, static_cast<tools::Long>(0)); mpVirDev->SetOutputSizePixel( Size( mnCtrlSize, mnCtrlSize ) ); /* Center the virtual device in the control. */ @@ -421,8 +421,8 @@ void FrameSelectorImpl::InitBorderGeometry() basegfx::fround(aCellRange.getMaxX()), basegfx::fround(aCellRange.getMaxY())); const double fHorDiagAngle(atan2(fabs(aCellRange.getHeight()), fabs(aCellRange.getWidth()))); const double fVerDiagAngle(fHorDiagAngle > 0.0 ? F_PI2 - fHorDiagAngle : 0.0); - const long nDiagFocusOffsX(basegfx::fround(-mnFocusOffs / tan(fHorDiagAngle) + mnFocusOffs / sin(fHorDiagAngle))); - const long nDiagFocusOffsY(basegfx::fround(-mnFocusOffs / tan(fVerDiagAngle) + mnFocusOffs / sin(fVerDiagAngle))); + const tools::Long nDiagFocusOffsX(basegfx::fround(-mnFocusOffs / tan(fHorDiagAngle) + mnFocusOffs / sin(fHorDiagAngle))); + const tools::Long nDiagFocusOffsY(basegfx::fround(-mnFocusOffs / tan(fVerDiagAngle) + mnFocusOffs / sin(fVerDiagAngle))); std::vector< Point > aFocusVec; aFocusVec.emplace_back( aRect.Left() - mnFocusOffs, aRect.Top() + nDiagFocusOffsY ); @@ -454,10 +454,10 @@ void FrameSelectorImpl::InitBorderGeometry() - To right: Dependent on existence of inner vertical frame border (if enabled, use less space). */ - long nClO = FRAMESEL_GEOM_WIDTH / 2 + FRAMESEL_GEOM_ADD_CLICK_OUTER; - long nClI = (mbTLBR && mbBLTR) ? (FRAMESEL_GEOM_WIDTH / 2 + FRAMESEL_GEOM_ADD_CLICK_INNER) : nClO; - long nClH = mbHor ? nClI : nClO; // additional space dependent of horizontal inner border - long nClV = mbVer ? nClI : nClO; // additional space dependent of vertical inner border + tools::Long nClO = FRAMESEL_GEOM_WIDTH / 2 + FRAMESEL_GEOM_ADD_CLICK_OUTER; + tools::Long nClI = (mbTLBR && mbBLTR) ? (FRAMESEL_GEOM_WIDTH / 2 + FRAMESEL_GEOM_ADD_CLICK_INNER) : nClO; + tools::Long nClH = mbHor ? nClI : nClO; // additional space dependent of horizontal inner border + tools::Long nClV = mbVer ? nClI : nClO; // additional space dependent of vertical inner border maLeft.AddClickRect( tools::Rectangle( mnLine1 - nClO, mnLine1 - nClO, mnLine1 + nClV, mnLine3 + nClO ) ); maVer.AddClickRect( tools::Rectangle( mnLine2 - nClI, mnLine1 - nClO, mnLine2 + nClI, mnLine3 + nClO ) ); @@ -565,7 +565,7 @@ void FrameSelectorImpl::DrawArrows( const FrameBorder& rBorder ) { DBG_ASSERT( rBorder.IsEnabled(), "svx::FrameSelectorImpl::DrawArrows - access to disabled border" ); - long nLinePos = 0; + tools::Long nLinePos = 0; switch( rBorder.GetType() ) { case FrameBorderType::Left: @@ -578,8 +578,8 @@ void FrameSelectorImpl::DrawArrows( const FrameBorder& rBorder ) } nLinePos -= mnArrowSize / 2; - long nTLPos = 0; - long nBRPos = mnCtrlSize - mnArrowSize; + tools::Long nTLPos = 0; + tools::Long nBRPos = mnCtrlSize - mnArrowSize; Point aPos1, aPos2; int nImgIndex1 = -1, nImgIndex2 = -1; switch( rBorder.GetType() ) @@ -910,7 +910,7 @@ void FrameSelector::HideAllBorders() mxImpl->SetBorderState( **aIt, FrameBorderState::Hide ); } -bool FrameSelector::GetVisibleWidth( long& rnWidth, SvxBorderLineStyle& rnStyle ) const +bool FrameSelector::GetVisibleWidth( tools::Long& rnWidth, SvxBorderLineStyle& rnStyle ) const { VisFrameBorderCIter aIt( mxImpl->maEnabBorders ); if( !aIt.Is() ) @@ -1000,7 +1000,7 @@ void FrameSelector::SelectAllVisibleBorders() mxImpl->SelectBorder( **aIt, true/*bSelect*/ ); } -void FrameSelector::SetStyleToSelection( long nWidth, SvxBorderLineStyle nStyle ) +void FrameSelector::SetStyleToSelection( tools::Long nWidth, SvxBorderLineStyle nStyle ) { mxImpl->maCurrStyle.SetBorderLineStyle( nStyle ); mxImpl->maCurrStyle.SetWidth( nWidth ); diff --git a/svx/source/dialog/graphctl.cxx b/svx/source/dialog/graphctl.cxx index d3e0671e5ab3..87943b34d804 100644 --- a/svx/source/dialog/graphctl.cxx +++ b/svx/source/dialog/graphctl.cxx @@ -190,21 +190,21 @@ void GraphCtrl::Resize() Size aNewSize; OutputDevice& rDevice = GetDrawingArea()->get_ref_device(); const Size aWinSize = rDevice.PixelToLogic( GetOutputSizePixel(), aDisplayMap ); - const long nWidth = aWinSize.Width(); - const long nHeight = aWinSize.Height(); + const tools::Long nWidth = aWinSize.Width(); + const tools::Long nHeight = aWinSize.Height(); double fGrfWH = static_cast<double>(aGraphSize.Width()) / aGraphSize.Height(); double fWinWH = static_cast<double>(nWidth) / nHeight; // Adapt Bitmap to Thumb size if ( fGrfWH < fWinWH) { - aNewSize.setWidth( static_cast<long>( static_cast<double>(nHeight) * fGrfWH ) ); + aNewSize.setWidth( static_cast<tools::Long>( static_cast<double>(nHeight) * fGrfWH ) ); aNewSize.setHeight( nHeight ); } else { aNewSize.setWidth( nWidth ); - aNewSize.setHeight( static_cast<long>( static_cast<double>(nWidth) / fGrfWH ) ); + aNewSize.setHeight( static_cast<tools::Long>( static_cast<double>(nWidth) / fGrfWH ) ); } aNewPos.setX( ( nWidth - aNewSize.Width() ) >> 1 ); @@ -376,8 +376,8 @@ bool GraphCtrl::KeyInput( const KeyEvent& rKEvt ) case KEY_LEFT: case KEY_RIGHT: { - long nX = 0; - long nY = 0; + tools::Long nX = 0; + tools::Long nY = 0; if (aCode.GetCode() == KEY_UP) { diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx index cae407291912..06605ce2efcf 100644 --- a/svx/source/dialog/hdft.cxx +++ b/svx/source/dialog/hdft.cxx @@ -48,11 +48,11 @@ using namespace com::sun::star; // Word 97 incompatibility (#i19922#) // #i19922# - tdf#126051 see cui/source/tabpages/page.cxx and sw/source/uibase/sidebar/PageMarginControl.hxx -const long MINBODY = 56; // 1mm in twips rounded +const tools::Long MINBODY = 56; // 1mm in twips rounded // default distance to Header or footer -const long DEF_DIST_WRITER = 500; // 5mm (Writer) -const long DEF_DIST_CALC = 250; // 2.5mm (Calc) +const tools::Long DEF_DIST_WRITER = 500; // 5mm (Writer) +const tools::Long DEF_DIST_CALC = 250; // 2.5mm (Calc) const sal_uInt16 SvxHFPage::pRanges[] = { @@ -250,8 +250,8 @@ bool SvxHFPage::FillItemSet( SfxItemSet* rSet ) // Size SvxSizeItem aSizeItem( static_cast<const SvxSizeItem&>(rOldSet.Get( nWSize )) ); Size aSize( aSizeItem.GetSize() ); - long nDist = GetCoreValue( *m_xDistEdit, eUnit ); - long nH = GetCoreValue( *m_xHeightEdit, eUnit ); + tools::Long nDist = GetCoreValue( *m_xDistEdit, eUnit ); + tools::Long nH = GetCoreValue( *m_xHeightEdit, eUnit ); nH += nDist; // add distance aSize.setHeight( nH ); @@ -401,7 +401,7 @@ void SvxHFPage::Reset( const SfxItemSet* rSet ) else { // defaults for distance and height - long nDefaultDist = bIsCalc ? DEF_DIST_CALC : DEF_DIST_WRITER; + tools::Long nDefaultDist = bIsCalc ? DEF_DIST_CALC : DEF_DIST_WRITER; SetMetricValue( *m_xDistEdit, nDefaultDist, MapUnit::Map100thMM ); SetMetricValue( *m_xHeightEdit, 500, MapUnit::Map100thMM ); } @@ -874,7 +874,7 @@ void SvxHFPage::ActivatePage( const SfxItemSet& rSet ) rHeaderSet.Get( GetWhich(SID_ATTR_ULSPACE ) )); const SvxLRSpaceItem& rLR = static_cast<const SvxLRSpaceItem&>( rHeaderSet.Get( GetWhich( SID_ATTR_LRSPACE ) )); - long nDist = rUL.GetLower(); + tools::Long nDist = rUL.GetLower(); m_aBspWin.SetHdHeight( rSize.GetSize().Height() - nDist ); m_aBspWin.SetHdDist( nDist ); @@ -914,7 +914,7 @@ void SvxHFPage::ActivatePage( const SfxItemSet& rSet ) rFooterSet.Get( GetWhich( SID_ATTR_ULSPACE ) )); const SvxLRSpaceItem& rLR = static_cast<const SvxLRSpaceItem&>( rFooterSet.Get( GetWhich( SID_ATTR_LRSPACE ) )); - long nDist = rUL.GetUpper(); + tools::Long nDist = rUL.GetUpper(); m_aBspWin.SetFtHeight( rSize.GetSize().Height() - nDist ); m_aBspWin.SetFtDist( nDist ); @@ -971,19 +971,19 @@ IMPL_LINK_NOARG(SvxHFPage, ValueChangeHdl, weld::MetricSpinButton&, void) void SvxHFPage::RangeHdl() { - long nHHeight = m_aBspWin.GetHdHeight(); - long nHDist = m_aBspWin.GetHdDist(); + tools::Long nHHeight = m_aBspWin.GetHdHeight(); + tools::Long nHDist = m_aBspWin.GetHdDist(); - long nFHeight = m_aBspWin.GetFtHeight(); - long nFDist = m_aBspWin.GetFtDist(); + tools::Long nFHeight = m_aBspWin.GetFtHeight(); + tools::Long nFDist = m_aBspWin.GetFtDist(); - long nHeight = std::max(long(MINBODY), - static_cast<long>(m_xHeightEdit->denormalize(m_xHeightEdit->get_value(FieldUnit::TWIP)))); - long nDist = m_xTurnOnBox->get_active() ? - static_cast<long>(m_xDistEdit->denormalize(m_xDistEdit->get_value(FieldUnit::TWIP))) : 0; + tools::Long nHeight = std::max(tools::Long(MINBODY), + static_cast<tools::Long>(m_xHeightEdit->denormalize(m_xHeightEdit->get_value(FieldUnit::TWIP)))); + tools::Long nDist = m_xTurnOnBox->get_active() ? + static_cast<tools::Long>(m_xDistEdit->denormalize(m_xDistEdit->get_value(FieldUnit::TWIP))) : 0; - long nMin; - long nMax; + tools::Long nMin; + tools::Long nMax; if ( nId == SID_ATTR_PAGE_HEADERSET ) { @@ -997,13 +997,13 @@ void SvxHFPage::RangeHdl() } // Current values of the side edges - long nBT = m_aBspWin.GetTop(); - long nBB = m_aBspWin.GetBottom(); - long nBL = m_aBspWin.GetLeft(); - long nBR = m_aBspWin.GetRight(); + tools::Long nBT = m_aBspWin.GetTop(); + tools::Long nBB = m_aBspWin.GetBottom(); + tools::Long nBL = m_aBspWin.GetLeft(); + tools::Long nBR = m_aBspWin.GetRight(); - long nH = m_aBspWin.GetSize().Height(); - long nW = m_aBspWin.GetSize().Width(); + tools::Long nH = m_aBspWin.GetSize().Height(); + tools::Long nW = m_aBspWin.GetSize().Width(); // Borders if ( nId == SID_ATTR_PAGE_HEADERSET ) @@ -1015,7 +1015,7 @@ void SvxHFPage::RangeHdl() m_xHeightEdit->set_max(m_xHeightEdit->normalize(nMax), FieldUnit::TWIP); nMin = ( nH - nBB - nBT ) / 5; // 20% nDist = std::max( nH - nMin - nHHeight - nFDist - nFHeight - nBB - nBT, - long(0) ); + tools::Long(0) ); m_xDistEdit->set_max(m_xDistEdit->normalize(nDist), FieldUnit::TWIP); } else @@ -1027,17 +1027,17 @@ void SvxHFPage::RangeHdl() m_xHeightEdit->set_max(m_xHeightEdit->normalize(nMax), FieldUnit::TWIP); nMin = ( nH - nBT - nBB ) / 5; // 20% nDist = std::max( nH - nMin - nFHeight - nHDist - nHHeight - nBT - nBB, - long(0) ); + tools::Long(0) ); m_xDistEdit->set_max(m_xDistEdit->normalize(nDist), FieldUnit::TWIP); } // Limit Indentation nMax = nW - nBL - nBR - - static_cast<long>(m_xRMEdit->denormalize(m_xRMEdit->get_value(FieldUnit::TWIP))) - MINBODY; + static_cast<tools::Long>(m_xRMEdit->denormalize(m_xRMEdit->get_value(FieldUnit::TWIP))) - MINBODY; m_xLMEdit->set_max(m_xLMEdit->normalize(nMax), FieldUnit::TWIP); nMax = nW - nBL - nBR - - static_cast<long>(m_xLMEdit->denormalize(m_xLMEdit->get_value(FieldUnit::TWIP))) - MINBODY; + static_cast<tools::Long>(m_xLMEdit->denormalize(m_xLMEdit->get_value(FieldUnit::TWIP))) - MINBODY; m_xRMEdit->set_max(m_xLMEdit->normalize(nMax), FieldUnit::TWIP); } diff --git a/svx/source/dialog/hyperdlg.cxx b/svx/source/dialog/hyperdlg.cxx index c7ae9fc51c4c..153e6d4c4f7d 100644 --- a/svx/source/dialog/hyperdlg.cxx +++ b/svx/source/dialog/hyperdlg.cxx @@ -54,11 +54,11 @@ SvxHlinkDlgWrapper::SvxHlinkDlgWrapper( vcl::Window* _pParent, sal_uInt16 nId, Size aDlgSize(pDialog->get_size()); if( aParentSize.Width() < pInfo->aPos.X() ) - pInfo->aPos.setX( aParentSize.Width()-aDlgSize.Width() < long(0.1*aParentSize.Width()) ? - long(0.1*aParentSize.Width()) : aParentSize.Width()-aDlgSize.Width() ); + pInfo->aPos.setX( aParentSize.Width()-aDlgSize.Width() < tools::Long(0.1*aParentSize.Width()) ? + tools::Long(0.1*aParentSize.Width()) : aParentSize.Width()-aDlgSize.Width() ); if( aParentSize.Height() < pInfo->aPos. Y() ) - pInfo->aPos.setY( aParentSize.Height()-aDlgSize.Height() < long(0.1*aParentSize.Height()) ? - long(0.1*aParentSize.Height()) : aParentSize.Height()-aDlgSize.Height() ); + pInfo->aPos.setY( aParentSize.Height()-aDlgSize.Height() < tools::Long(0.1*aParentSize.Height()) ? + tools::Long(0.1*aParentSize.Height()) : aParentSize.Height()-aDlgSize.Height() ); pDialog->window_move(pInfo->aPos.X(), pInfo->aPos.Y()); } diff --git a/svx/source/dialog/imapdlg.cxx b/svx/source/dialog/imapdlg.cxx index 0a16d670002c..d093f44fe515 100644 --- a/svx/source/dialog/imapdlg.cxx +++ b/svx/source/dialog/imapdlg.cxx @@ -188,7 +188,7 @@ IMPL_LINK_NOARG(SvxIMapDlg, CancelHdl, weld::Button&, void) { std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(m_xDialog.get(), "svx/ui/querymodifyimagemapchangesdialog.ui")); std::unique_ptr<weld::MessageDialog> xQBox(xBuilder->weld_message_dialog("QueryModifyImageMapChangesDialog")); - const long nRet = xQBox->run(); + const tools::Long nRet = xQBox->run(); if( nRet == RET_YES ) { @@ -204,7 +204,7 @@ IMPL_LINK_NOARG(SvxIMapDlg, CancelHdl, weld::Button&, void) { std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(m_xDialog.get(), "svx/ui/querysaveimagemapchangesdialog.ui")); std::unique_ptr<weld::MessageDialog> xQBox(xBuilder->weld_message_dialog("QuerySaveImageMapChangesDialog")); - const long nRet = xQBox->run(); + const tools::Long nRet = xQBox->run(); if( nRet == RET_YES ) bRet = DoSave(); diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx index 0ca5a122677f..14345a5cdaff 100644 --- a/svx/source/dialog/imapwnd.cxx +++ b/svx/source/dialog/imapwnd.cxx @@ -199,7 +199,7 @@ SdrObject* IMapWindow::CreateObj( const IMapObject* pIMapObj ) { const IMapCircleObject* pIMapCircleObj = static_cast<const IMapCircleObject*>(pIMapObj); const Point aCenter( pIMapCircleObj->GetCenter( false ) ); - const long nRadius = pIMapCircleObj->GetRadius( false ); + const tools::Long nRadius = pIMapCircleObj->GetRadius( false ); const Point aOffset( nRadius, nRadius ); tools::Rectangle aCircle( aCenter - aOffset, aCenter + aOffset ); diff --git a/svx/source/dialog/measctrl.cxx b/svx/source/dialog/measctrl.cxx index fd237aea31a2..0bad56b64454 100644 --- a/svx/source/dialog/measctrl.cxx +++ b/svx/source/dialog/measctrl.cxx @@ -56,9 +56,9 @@ void SvxXMeasurePreview::ResizeImpl(const Size& rSize) rRefDevice.SetMapMode(m_aMapMode); Size aSize = rRefDevice.PixelToLogic(rSize); - Point aPt1(aSize.Width() / 5, static_cast<long>(aSize.Height() / 2)); + Point aPt1(aSize.Width() / 5, static_cast<tools::Long>(aSize.Height() / 2)); pMeasureObj->SetPoint(aPt1, 0); - Point aPt2(aSize.Width() * 4 / 5, static_cast<long>(aSize.Height() / 2)); + Point aPt2(aSize.Width() * 4 / 5, static_cast<tools::Long>(aSize.Height() / 2)); pMeasureObj->SetPoint(aPt2, 1); rRefDevice.Pop(); @@ -140,8 +140,8 @@ bool SvxXMeasurePreview::MouseButtonDown(const MouseEvent& rMEvt) rRefDevice.Pop(); Point aPt(m_aMapMode.GetOrigin()); - long nX = long((double(aOutSize.Width()) - (double(aOutSize.Width()) * double(*pMultFrac))) / 2.0 + 0.5); - long nY = long((double(aOutSize.Height()) - (double(aOutSize.Height()) * double(*pMultFrac))) / 2.0 + 0.5); + tools::Long nX = tools::Long((double(aOutSize.Width()) - (double(aOutSize.Width()) * double(*pMultFrac))) / 2.0 + 0.5); + tools::Long nY = tools::Long((double(aOutSize.Height()) - (double(aOutSize.Height()) * double(*pMultFrac))) / 2.0 + 0.5); aPt.AdjustX(nX ); aPt.AdjustY(nY ); diff --git a/svx/source/dialog/optgrid.cxx b/svx/source/dialog/optgrid.cxx index 104000303210..598aacb420e9 100644 --- a/svx/source/dialog/optgrid.cxx +++ b/svx/source/dialog/optgrid.cxx @@ -161,13 +161,13 @@ bool SvxGridTabPage::FillItemSet( SfxItemSet* rCoreSet ) MapUnit eUnit = rCoreSet->GetPool()->GetMetric( GetWhich( SID_ATTR_GRID_OPTIONS ) ); - long nX = GetCoreValue( *m_xMtrFldDrawX, eUnit ); - long nY = GetCoreValue( *m_xMtrFldDrawY, eUnit ); + tools::Long nX = GetCoreValue( *m_xMtrFldDrawX, eUnit ); + tools::Long nY = GetCoreValue( *m_xMtrFldDrawY, eUnit ); aGridItem.nFldDrawX = static_cast<sal_uInt32>(nX); aGridItem.nFldDrawY = static_cast<sal_uInt32>(nY); - aGridItem.nFldDivisionX = static_cast<long>(m_xNumFldDivisionX->get_value() - 1); - aGridItem.nFldDivisionY = static_cast<long>(m_xNumFldDivisionY->get_value() - 1); + aGridItem.nFldDivisionX = static_cast<tools::Long>(m_xNumFldDivisionX->get_value() - 1); + aGridItem.nFldDivisionY = static_cast<tools::Long>(m_xNumFldDivisionY->get_value() - 1); rCoreSet->Put( aGridItem ); } @@ -219,7 +219,7 @@ void SvxGridTabPage::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_xMtrFldDrawX->get_unit()) return; diff --git a/svx/source/dialog/pagectrl.cxx b/svx/source/dialog/pagectrl.cxx index 6aee246982db..2a9dfb0a30b3 100644 --- a/svx/source/dialog/pagectrl.cxx +++ b/svx/source/dialog/pagectrl.cxx @@ -75,7 +75,7 @@ void SvxPageWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Recta rRenderContext.Push(PushFlags::MAPMODE); rRenderContext.SetMapMode(MapMode(MapUnit::MapTwip)); - Fraction aXScale(aWinSize.Width(), std::max(long(aSize.Width() * 2 + aSize.Width() / 8), 1L)); + Fraction aXScale(aWinSize.Width(), std::max(tools::Long(aSize.Width() * 2 + aSize.Width() / 8), 1L)); Fraction aYScale(aWinSize.Height(), std::max(aSize.Height(), 1L)); MapMode aMapMode(rRenderContext.GetMapMode()); @@ -91,7 +91,7 @@ void SvxPageWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Recta } rRenderContext.SetMapMode(aMapMode); Size aSz(rRenderContext.PixelToLogic(GetOutputSizePixel())); - long nYPos = (aSz.Height() - aSize.Height()) / 2; + tools::Long nYPos = (aSz.Height() - aSize.Height()) / 2; if (eUsage == SvxPageUsage::All) { @@ -109,7 +109,7 @@ void SvxPageWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Recta rRenderContext.SetMapMode(aMapMode); aSz = rRenderContext.PixelToLogic(GetOutputSizePixel()); nYPos = (aSz.Height() - aSize.Height()) / 2; - long nXPos = (aSz.Width() - aSize.Width()) / 2; + tools::Long nXPos = (aSz.Width() - aSize.Width()) / 2; DrawPage(rRenderContext, Point(nXPos,nYPos),true,true); } else @@ -161,8 +161,8 @@ void SvxPageWindow::DrawPage(vcl::RenderContext& rRenderContext, const Point& rO rRenderContext.SetFillColor(rFieldColor); rRenderContext.DrawRect(tools::Rectangle(rOrg, aTempSize)); - long nL = nLeft; - long nR = nRight; + tools::Long nL = nLeft; + tools::Long nR = nRight; if (eUsage == SvxPageUsage::Mirror && !bSecond) { @@ -235,7 +235,7 @@ void SvxPageWindow::DrawPage(vcl::RenderContext& rRenderContext, const Point& rO OUString sText("ABC"); Point aMove(1, rRenderContext.GetTextHeight()); sal_Unicode cArrow = 0x2193; - long nAWidth = rRenderContext.GetTextWidth(sText.copy(0,1)); + tools::Long nAWidth = rRenderContext.GetTextWidth(sText.copy(0,1)); switch (nFrameDirection) { case SvxFrameDirection::Horizontal_LR_TB: @@ -267,8 +267,8 @@ void SvxPageWindow::DrawPage(vcl::RenderContext& rRenderContext, const Point& rO for (sal_Int32 i = 0; i < sText.getLength(); i++) { OUString sDraw(sText.copy(i,1)); - long nHDiff = 0; - long nCharWidth = rRenderContext.GetTextWidth(sDraw); + tools::Long nHDiff = 0; + tools::Long nCharWidth = rRenderContext.GetTextWidth(sDraw); bool bHorizontal = 0 == aMove.Y(); if (!bHorizontal) { @@ -296,12 +296,12 @@ void SvxPageWindow::DrawPage(vcl::RenderContext& rRenderContext, const Point& rO // Paint Table, if necessary center it rRenderContext.SetLineColor(COL_LIGHTGRAY); - long nW = aRect.GetWidth(); - long nH = aRect.GetHeight(); - long const nTW = CELL_WIDTH * 3; - long const nTH = CELL_HEIGHT * 3; - long _nLeft = bHorz ? aRect.Left() + ((nW - nTW) / 2) : aRect.Left(); - long _nTop = bVert ? aRect.Top() + ((nH - nTH) / 2) : aRect.Top(); + tools::Long nW = aRect.GetWidth(); + tools::Long nH = aRect.GetHeight(); + tools::Long const nTW = CELL_WIDTH * 3; + tools::Long const nTH = CELL_HEIGHT * 3; + tools::Long _nLeft = bHorz ? aRect.Left() + ((nW - nTW) / 2) : aRect.Left(); + tools::Long _nTop = bVert ? aRect.Top() + ((nH - nTH) / 2) : aRect.Top(); tools::Rectangle aCellRect(Point(_nLeft, _nTop),Size(CELL_WIDTH, CELL_HEIGHT)); for (sal_uInt16 i = 0; i < 3; ++i) diff --git a/svx/source/dialog/paraprev.cxx b/svx/source/dialog/paraprev.cxx index fb5003559edc..bdb4f7f9da9b 100644 --- a/svx/source/dialog/paraprev.cxx +++ b/svx/source/dialog/paraprev.cxx @@ -71,7 +71,7 @@ void SvxParaPrevWindow::DrawParagraph(vcl::RenderContext& rRenderContext) rRenderContext.SetLineColor(); - long nH = aWinSize.Height() / 19; + tools::Long nH = aWinSize.Height() / 19; Size aLineSiz(aWinSize.Width() - DEF_MARGIN, nH); Size aSiz = aLineSiz; Point aPnt; @@ -92,9 +92,9 @@ void SvxParaPrevWindow::DrawParagraph(vcl::RenderContext& rRenderContext) if (3 <= i && 6 > i) { - long nLeft = nLeftMargin * aLineSiz.Width() / aSize.Width(); - long nFirst = nFirstLineOffset * aLineSiz.Width() / aSize.Width(); - long nTmp = nLeft + nFirst; + tools::Long nLeft = nLeftMargin * aLineSiz.Width() / aSize.Width(); + tools::Long nFirst = nFirstLineOffset * aLineSiz.Width() / aSize.Width(); + tools::Long nTmp = nLeft + nFirst; if (i == 3) { @@ -106,7 +106,7 @@ void SvxParaPrevWindow::DrawParagraph(vcl::RenderContext& rRenderContext) aPnt.AdjustX(nLeft ); aSiz.AdjustWidth( -nLeft ); } - long nRight = nRightMargin * aLineSiz.Width() / aSize.Width(); + tools::Long nRight = nRightMargin * aLineSiz.Width() / aSize.Width(); aSiz.AdjustWidth( -nRight ); } @@ -136,7 +136,7 @@ void SvxParaPrevWindow::DrawParagraph(vcl::RenderContext& rRenderContext) if (3 <= i && 5 >= i) { - long nLW = long(); + tools::Long nLW = long(); switch (i) { case 3: diff --git a/svx/source/dialog/rubydialog.cxx b/svx/source/dialog/rubydialog.cxx index 06dd3fdc6751..a2769bb6f09b 100644 --- a/svx/source/dialog/rubydialog.cxx +++ b/svx/source/dialog/rubydialog.cxx @@ -387,7 +387,7 @@ void SvxRubyDialog::SetRubyText(sal_Int32 nPos, weld::Entry& rLeft, weld::Entry& void SvxRubyDialog::GetRubyText() { - long nTempLastPos = GetLastPos(); + tools::Long nTempLastPos = GetLastPos(); for (int i = 0; i < 8; i+=2) { if (aEditArr[i]->get_sensitive() && @@ -731,13 +731,13 @@ void RubyPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rectang OUString sBaseText, sRubyText; m_pParentDlg->GetCurrentText(sBaseText, sRubyText); - long nTextHeight = rRenderContext.GetTextHeight(); - long nBaseWidth = rRenderContext.GetTextWidth(sBaseText); + tools::Long nTextHeight = rRenderContext.GetTextHeight(); + tools::Long nBaseWidth = rRenderContext.GetTextWidth(sBaseText); vcl::Font aRubyFont(aFont); aRubyFont.SetFontHeight(aRubyFont.GetFontHeight() * 70 / 100); rRenderContext.SetFont(aRubyFont); - long nRubyWidth = rRenderContext.GetTextWidth(sRubyText); + tools::Long nRubyWidth = rRenderContext.GetTextWidth(sRubyText); rRenderContext.SetFont(aFont); RubyAdjust nAdjust = static_cast<RubyAdjust>(m_pParentDlg->m_xAdjustLB->get_active()); @@ -748,19 +748,19 @@ void RubyPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rectang //which part is stretched ? bool bRubyStretch = nBaseWidth >= nRubyWidth; - long nCenter = aWinSize.Width() / 2; - long nHalfWidth = std::max( nBaseWidth, nRubyWidth ) /2; - long nLeftStart = nCenter - nHalfWidth; - long nRightEnd = nCenter + nHalfWidth; + tools::Long nCenter = aWinSize.Width() / 2; + tools::Long nHalfWidth = std::max( nBaseWidth, nRubyWidth ) /2; + tools::Long nLeftStart = nCenter - nHalfWidth; + tools::Long nRightEnd = nCenter + nHalfWidth; // Default values for TOP or no selection - long nYRuby = aWinSize.Height() / 4 - nTextHeight / 2; - long nYBase = aWinSize.Height() * 3 / 4 - nTextHeight / 2; + tools::Long nYRuby = aWinSize.Height() / 4 - nTextHeight / 2; + tools::Long nYBase = aWinSize.Height() * 3 / 4 - nTextHeight / 2; sal_Int16 nRubyPos = m_pParentDlg->m_xPositionLB->get_active(); if ( nRubyPos == 1 ) // BOTTOM { - long nTmp = nYRuby; + tools::Long nTmp = nYRuby; nYRuby = nYBase; nYBase = nTmp; } @@ -782,8 +782,8 @@ void RubyPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rectang aRubyFont.SetOrientation(Degree10(2700)); } - long nYOutput; - long nOutTextWidth; + tools::Long nYOutput; + tools::Long nOutTextWidth; OUString sOutputText; if (bRubyStretch) @@ -814,7 +814,7 @@ void RubyPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rectang break; case RubyAdjust_INDENT_BLOCK: { - long nCharWidth = rRenderContext.GetTextWidth("X"); + tools::Long nCharWidth = rRenderContext.GetTextWidth("X"); if (nOutTextWidth < (nRightEnd - nLeftStart - nCharWidth)) { nCharWidth /= 2; @@ -828,12 +828,12 @@ void RubyPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rectang if (sOutputText.getLength() > 1) { sal_Int32 nCount = sOutputText.getLength(); - long nSpace = ((nRightEnd - nLeftStart) - rRenderContext.GetTextWidth(sOutputText)) / (nCount - 1); + tools::Long nSpace = ((nRightEnd - nLeftStart) - rRenderContext.GetTextWidth(sOutputText)) / (nCount - 1); for (sal_Int32 i = 0; i < nCount; i++) { OUString sChar(sOutputText[i]); rRenderContext.DrawText(Point(nLeftStart , nYOutput), sChar); - long nCharWidth = rRenderContext.GetTextWidth(sChar); + tools::Long nCharWidth = rRenderContext.GetTextWidth(sChar); nLeftStart += nCharWidth + nSpace; } break; diff --git a/svx/source/dialog/rulritem.cxx b/svx/source/dialog/rulritem.cxx index bde481f15b4b..7943283364e8 100644 --- a/svx/source/dialog/rulritem.cxx +++ b/svx/source/dialog/rulritem.cxx @@ -134,7 +134,7 @@ SvxLongLRSpaceItem* SvxLongLRSpaceItem::Clone(SfxItemPool *) const return new SvxLongLRSpaceItem(*this); } -SvxLongLRSpaceItem::SvxLongLRSpaceItem(long lLeft, long lRight, sal_uInt16 nId) : +SvxLongLRSpaceItem::SvxLongLRSpaceItem(tools::Long lLeft, tools::Long lRight, sal_uInt16 nId) : SfxPoolItem (nId), mlLeft (lLeft), mlRight (lRight) @@ -146,12 +146,12 @@ SvxLongLRSpaceItem::SvxLongLRSpaceItem() : mlRight (0) {} -void SvxLongLRSpaceItem::SetLeft(long lArgLeft) +void SvxLongLRSpaceItem::SetLeft(tools::Long lArgLeft) { mlLeft = lArgLeft; } -void SvxLongLRSpaceItem::SetRight(long lArgRight) +void SvxLongLRSpaceItem::SetRight(tools::Long lArgRight) { mlRight = lArgRight; } @@ -253,7 +253,7 @@ SvxLongULSpaceItem* SvxLongULSpaceItem::Clone(SfxItemPool *) const return new SvxLongULSpaceItem(*this); } -SvxLongULSpaceItem::SvxLongULSpaceItem(long lLeft, long lRight, sal_uInt16 nId) : +SvxLongULSpaceItem::SvxLongULSpaceItem(tools::Long lLeft, tools::Long lRight, sal_uInt16 nId) : SfxPoolItem (nId), mlLeft (lLeft), mlRight (lRight) @@ -266,12 +266,12 @@ SvxLongULSpaceItem::SvxLongULSpaceItem() : {} -void SvxLongULSpaceItem::SetUpper(long lArgLeft) +void SvxLongULSpaceItem::SetUpper(tools::Long lArgLeft) { mlLeft = lArgLeft; } -void SvxLongULSpaceItem::SetLower(long lArgRight) +void SvxLongULSpaceItem::SetLower(tools::Long lArgRight) { mlRight = lArgRight; } @@ -368,7 +368,7 @@ SvxPagePosSizeItem* SvxPagePosSizeItem::Clone(SfxItemPool *) const return new SvxPagePosSizeItem(*this); } -SvxPagePosSizeItem::SvxPagePosSizeItem(const Point &rP, long lW, long lH) : +SvxPagePosSizeItem::SvxPagePosSizeItem(const Point &rP, tools::Long lW, tools::Long lH) : SfxPoolItem (SID_RULER_PAGE_POS), aPos (rP), lWidth (lW), @@ -444,7 +444,7 @@ bool SvxColumnItem::CalcOrtho() const if(nCount < 2) return false; - long nColWidth = (*this)[0].GetWidth(); + tools::Long nColWidth = (*this)[0].GetWidth(); for(sal_uInt16 i = 1; i < nCount; ++i) { if( (*this)[i].GetWidth() != nColWidth) return false; @@ -550,12 +550,12 @@ void SvxColumnItem::Append(const SvxColumnDescription &rDesc) aColumns.push_back(rDesc); } -void SvxColumnItem::SetLeft(long left) +void SvxColumnItem::SetLeft(tools::Long left) { nLeft = left; } -void SvxColumnItem::SetRight(long right) +void SvxColumnItem::SetRight(tools::Long right) { nRight = right; } @@ -571,7 +571,7 @@ bool SvxColumnItem::IsLastAct() const return nActColumn == Count() - 1; } -SvxColumnDescription::SvxColumnDescription(long start, long end, bool bVis) : +SvxColumnDescription::SvxColumnDescription(tools::Long start, tools::Long end, bool bVis) : nStart (start), nEnd (end), bVisible (bVis), @@ -579,7 +579,7 @@ SvxColumnDescription::SvxColumnDescription(long start, long end, bool bVis) : nEndMax (0) {} -SvxColumnDescription::SvxColumnDescription(long start, long end, long endMin, long endMax, bool bVis) : +SvxColumnDescription::SvxColumnDescription(tools::Long start, tools::Long end, tools::Long endMin, tools::Long endMax, bool bVis) : nStart (start), nEnd (end), bVisible (bVis), @@ -602,7 +602,7 @@ bool SvxColumnDescription::operator!=(const SvxColumnDescription& rCmp) const return !operator==(rCmp); } -long SvxColumnDescription::GetWidth() const +tools::Long SvxColumnDescription::GetWidth() const { return nEnd - nStart; } @@ -643,8 +643,8 @@ SvxObjectItem* SvxObjectItem::Clone(SfxItemPool *) const return new SvxObjectItem(*this); } -SvxObjectItem::SvxObjectItem( long nSX, long nEX, - long nSY, long nEY ) : +SvxObjectItem::SvxObjectItem( tools::Long nSX, tools::Long nEX, + tools::Long nSY, tools::Long nEY ) : SfxPoolItem (SID_RULER_OBJECT), nStartX (nSX), nEndX (nEX), @@ -709,22 +709,22 @@ bool SvxObjectItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) } -void SvxObjectItem::SetStartX(long lValue) +void SvxObjectItem::SetStartX(tools::Long lValue) { nStartX = lValue; } -void SvxObjectItem::SetEndX(long lValue) +void SvxObjectItem::SetEndX(tools::Long lValue) { nEndX = lValue; } -void SvxObjectItem::SetStartY(long lValue) +void SvxObjectItem::SetStartY(tools::Long lValue) { nStartY = lValue; } -void SvxObjectItem::SetEndY(long lValue) +void SvxObjectItem::SetEndY(tools::Long lValue) { nEndY = lValue; } diff --git a/svx/source/dialog/svxbmpnumvalueset.cxx b/svx/source/dialog/svxbmpnumvalueset.cxx index 1086e45d3894..c86145630402 100644 --- a/svx/source/dialog/svxbmpnumvalueset.cxx +++ b/svx/source/dialog/svxbmpnumvalueset.cxx @@ -154,8 +154,8 @@ void SvxNumValueSet::UserDraw( const UserDrawEvent& rUDEvt ) tools::Rectangle aRect = rUDEvt.GetRect(); sal_uInt16 nItemId = rUDEvt.GetItemId(); - long nRectWidth = aRect.GetWidth(); - long nRectHeight = aRect.GetHeight(); + tools::Long nRectWidth = aRect.GetWidth(); + tools::Long nRectHeight = aRect.GetHeight(); Size aRectSize(nRectWidth, aRect.GetHeight()); Point aBLPos = aRect.TopLeft(); vcl::Font aOldFont = pDev->GetFont(); @@ -261,8 +261,8 @@ void SvxNumValueSet::UserDraw( const UserDrawEvent& rUDEvt ) // has to be made again pVDev->SetLineColor(aBackColor); pVDev->DrawRect(aOrgRect); - long nStartX = aOrgRect.TopLeft().X(); - long nStartY = aOrgRect.TopLeft().Y(); + tools::Long nStartX = aOrgRect.TopLeft().X(); + tools::Long nStartY = aOrgRect.TopLeft().Y(); if(xFormatter.is() && aOutlineSettings.getLength() > nItemId - 1) { @@ -282,7 +282,7 @@ void SvxNumValueSet::UserDraw( const UserDrawEvent& rUDEvt ) nLevelCount = 5; for( sal_Int32 i = 0; i < nLevelCount; i++) { - long nTop = nStartY + nRectHeight * (aLinesArr[2 * i + 11])/100 ; + tools::Long nTop = nStartY + nRectHeight * (aLinesArr[2 * i + 11])/100 ; Point aLeft(nStartX + nRectWidth * (aLinesArr[2 * i + 10])/ 100, nTop ); Any aLevelAny = xLevel->getByIndex(i); @@ -361,7 +361,7 @@ void SvxNumValueSet::UserDraw( const UserDrawEvent& rUDEvt ) aLeft.AdjustX(pDev->GetTextWidth(sSuffixes[i]) ); } - long nLineTop = nStartY + nRectHeight * aLinesArr[2 * i + 1]/100 ; + tools::Long nLineTop = nStartY + nRectHeight * aLinesArr[2 * i + 1]/100 ; Point aLineLeft(aLeft.X(), nLineTop ); Point aLineRight(nStartX + nRectWidth * 90 /100, nLineTop ); pVDev->SetLineColor(COL_LIGHTGRAY); @@ -498,7 +498,7 @@ void SvxBmpNumValueSet::UserDraw(const UserDrawEvent& rUDEvt) sal_uInt16 nItemId = rUDEvt.GetItemId(); Point aBLPos = aRect.TopLeft(); - long nRectHeight = aRect.GetHeight(); + tools::Long nRectHeight = aRect.GetHeight(); Size aSize(nRectHeight/8, nRectHeight/8); Graphic aGraphic; diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx index 16ee08d4413e..66457d3bca1e 100644 --- a/svx/source/dialog/svxruler.cxx +++ b/svx/source/dialog/svxruler.cxx @@ -60,12 +60,12 @@ struct SvxRuler_Impl { std::unique_ptr<sal_uInt16[]> pPercBuf; std::unique_ptr<sal_uInt16[]> pBlockBuf; sal_uInt16 nPercSize; - long nTotalDist; - long lOldWinPos; - long lMaxLeftLogic; - long lMaxRightLogic; - long lLastLMargin; - long lLastRMargin; + tools::Long nTotalDist; + tools::Long lOldWinPos; + tools::Long lMaxLeftLogic; + tools::Long lMaxRightLogic; + tools::Long lLastLMargin; + tools::Long lLastRMargin; std::unique_ptr<SvxProtectItem> aProtectItem; std::unique_ptr<SfxBoolItem> pTextRTLItem; sal_uInt16 nControllerItems; @@ -153,7 +153,7 @@ void SvxRuler_Impl::SetPercSize(sal_uInt16 nSize) // expects: something like SwTabCols // Ruler: SetBorders -constexpr long glMinFrame = 5; // minimal frame width in pixels +constexpr tools::Long glMinFrame = 5; // minimal frame width in pixels SvxRuler::SvxRuler( vcl::Window* pParent, // StarView Parent @@ -297,18 +297,18 @@ void SvxRuler::dispose() Ruler::dispose(); } -long SvxRuler::MakePositionSticky(long aPosition, long aPointOfReference, bool aSnapToFrameMargin) const +tools::Long SvxRuler::MakePositionSticky(tools::Long aPosition, tools::Long aPointOfReference, bool aSnapToFrameMargin) const { - long aPointOfReferencePixel = ConvertHPosPixel(aPointOfReference); - long aLeftFramePosition = ConvertHPosPixel(GetLeftFrameMargin()); - long aRightFramePosition = ConvertHPosPixel(GetRightFrameMargin()); + tools::Long aPointOfReferencePixel = ConvertHPosPixel(aPointOfReference); + tools::Long aLeftFramePosition = ConvertHPosPixel(GetLeftFrameMargin()); + tools::Long aRightFramePosition = ConvertHPosPixel(GetRightFrameMargin()); double aTick = GetCurrentRulerUnit().nTick1; if (mbCoarseSnapping) aTick = GetCurrentRulerUnit().nTick2; - long aTickPixel = pEditWin->LogicToPixel(Size(aTick, 0), GetCurrentMapMode()).Width(); + tools::Long aTickPixel = pEditWin->LogicToPixel(Size(aTick, 0), GetCurrentMapMode()).Width(); double aHalfTick = aTick / 2.0; double aHalfTickPixel = aTickPixel / 2.0; @@ -326,9 +326,9 @@ long SvxRuler::MakePositionSticky(long aPosition, long aPointOfReference, bool a return aPosition; // Move "coordinate system" to frame position so ticks are calculated correctly - long aTranslatedPosition = aPosition - aPointOfReferencePixel; + tools::Long aTranslatedPosition = aPosition - aPointOfReferencePixel; // Convert position to current selected map mode - long aPositionLogic = pEditWin->PixelToLogic(Size(aTranslatedPosition, 0), GetCurrentMapMode()).Width(); + tools::Long aPositionLogic = pEditWin->PixelToLogic(Size(aTranslatedPosition, 0), GetCurrentMapMode()).Width(); // Normalize -- snap to nearest tick aPositionLogic = rtl::math::round((aPositionLogic + aHalfTick) / aTick) * aTick; // Convert back to pixels @@ -337,67 +337,67 @@ long SvxRuler::MakePositionSticky(long aPosition, long aPointOfReference, bool a return aPosition + aPointOfReferencePixel; } -long SvxRuler::ConvertHPosPixel(long nVal) const +tools::Long SvxRuler::ConvertHPosPixel(tools::Long nVal) const { return pEditWin->LogicToPixel(Size(nVal, 0)).Width(); } -long SvxRuler::ConvertVPosPixel(long nVal) const +tools::Long SvxRuler::ConvertVPosPixel(tools::Long nVal) const { return pEditWin->LogicToPixel(Size(0, nVal)).Height(); } -long SvxRuler::ConvertHSizePixel(long nVal) const +tools::Long SvxRuler::ConvertHSizePixel(tools::Long nVal) const { return pEditWin->LogicToPixel(Size(nVal, 0)).Width(); } -long SvxRuler::ConvertVSizePixel(long nVal) const +tools::Long SvxRuler::ConvertVSizePixel(tools::Long nVal) const { return pEditWin->LogicToPixel(Size(0, nVal)).Height(); } -long SvxRuler::ConvertPosPixel(long nVal) const +tools::Long SvxRuler::ConvertPosPixel(tools::Long nVal) const { return bHorz ? ConvertHPosPixel(nVal): ConvertVPosPixel(nVal); } -long SvxRuler::ConvertSizePixel(long nVal) const +tools::Long SvxRuler::ConvertSizePixel(tools::Long nVal) const { return bHorz? ConvertHSizePixel(nVal): ConvertVSizePixel(nVal); } -inline long SvxRuler::ConvertHPosLogic(long nVal) const +inline tools::Long SvxRuler::ConvertHPosLogic(tools::Long nVal) const { return pEditWin->PixelToLogic(Size(nVal, 0)).Width(); } -inline long SvxRuler::ConvertVPosLogic(long nVal) const +inline tools::Long SvxRuler::ConvertVPosLogic(tools::Long nVal) const { return pEditWin->PixelToLogic(Size(0, nVal)).Height(); } -inline long SvxRuler::ConvertHSizeLogic(long nVal) const +inline tools::Long SvxRuler::ConvertHSizeLogic(tools::Long nVal) const { return pEditWin->PixelToLogic(Size(nVal, 0)).Width(); } -inline long SvxRuler::ConvertVSizeLogic(long nVal) const +inline tools::Long SvxRuler::ConvertVSizeLogic(tools::Long nVal) const { return pEditWin->PixelToLogic(Size(0, nVal)).Height(); } -inline long SvxRuler::ConvertPosLogic(long nVal) const +inline tools::Long SvxRuler::ConvertPosLogic(tools::Long nVal) const { return bHorz? ConvertHPosLogic(nVal): ConvertVPosLogic(nVal); } -inline long SvxRuler::ConvertSizeLogic(long nVal) const +inline tools::Long SvxRuler::ConvertSizeLogic(tools::Long nVal) const { return bHorz? ConvertHSizeLogic(nVal): ConvertVSizeLogic(nVal); } -long SvxRuler::PixelHAdjust(long nVal, long nValOld) const +tools::Long SvxRuler::PixelHAdjust(tools::Long nVal, tools::Long nValOld) const { if(ConvertHSizePixel(nVal) != ConvertHSizePixel(nValOld)) return nVal; @@ -405,7 +405,7 @@ long SvxRuler::PixelHAdjust(long nVal, long nValOld) const return nValOld; } -long SvxRuler::PixelVAdjust(long nVal, long nValOld) const +tools::Long SvxRuler::PixelVAdjust(tools::Long nVal, tools::Long nValOld) const { if(ConvertVSizePixel(nVal) != ConvertVSizePixel(nValOld)) return nVal; @@ -413,7 +413,7 @@ long SvxRuler::PixelVAdjust(long nVal, long nValOld) const return nValOld; } -long SvxRuler::PixelAdjust(long nVal, long nValOld) const +tools::Long SvxRuler::PixelAdjust(tools::Long nVal, tools::Long nValOld) const { if(ConvertSizePixel(nVal) != ConvertSizePixel(nValOld)) return nVal; @@ -440,7 +440,7 @@ void SvxRuler::UpdateFrame() if(mxLRSpaceItem && mxPagePosItem) { // if no initialization by default app behavior - const long nOld = lLogicNullOffset; + const tools::Long nOld = lLogicNullOffset; lLogicNullOffset = mxColumnItem ? mxColumnItem->GetLeft() : mxLRSpaceItem->GetLeft(); if(bAppSetNullOffset) @@ -459,7 +459,7 @@ void SvxRuler::UpdateFrame() SetMargin1(ConvertHPosPixel(lAppNullOffset), nMarginStyle); } - long lRight = 0; + tools::Long lRight = 0; // evaluate the table right edge of the table if(mxColumnItem && mxColumnItem->IsTable()) @@ -467,15 +467,15 @@ void SvxRuler::UpdateFrame() else lRight = mxLRSpaceItem->GetRight(); - long aWidth = mxPagePosItem->GetWidth() - lRight - lLogicNullOffset + lAppNullOffset; - long aWidthPixel = ConvertHPosPixel(aWidth); + tools::Long aWidth = mxPagePosItem->GetWidth() - lRight - lLogicNullOffset + lAppNullOffset; + tools::Long aWidthPixel = ConvertHPosPixel(aWidth); SetMargin2(aWidthPixel, nMarginStyle); } else if(mxULSpaceItem && mxPagePosItem) { // relative the upper edge of the surrounding frame - const long nOld = lLogicNullOffset; + const tools::Long nOld = lLogicNullOffset; lLogicNullOffset = mxColumnItem ? mxColumnItem->GetLeft() : mxULSpaceItem->GetUpper(); if(bAppSetNullOffset) @@ -494,9 +494,9 @@ void SvxRuler::UpdateFrame() SetMargin1(ConvertVPosPixel(lAppNullOffset), nMarginStyle); } - long lLower = mxColumnItem ? mxColumnItem->GetRight() : mxULSpaceItem->GetLower(); - long nMargin2 = mxPagePosItem->GetHeight() - lLower - lLogicNullOffset + lAppNullOffset; - long nMargin2Pixel = ConvertVPosPixel(nMargin2); + tools::Long lLower = mxColumnItem ? mxColumnItem->GetRight() : mxULSpaceItem->GetLower(); + tools::Long nMargin2 = mxPagePosItem->GetHeight() - lLower - lLogicNullOffset + lAppNullOffset; + tools::Long nMargin2Pixel = ConvertVPosPixel(nMargin2); SetMargin2(nMargin2Pixel, nMarginStyle); } @@ -552,9 +552,9 @@ void SvxRuler::MouseMove( const MouseEvent& rMEvt ) if (!mxParaItem) break; - long nIndex = aSelection.nAryPos + INDENT_GAP; + tools::Long nIndex = aSelection.nAryPos + INDENT_GAP; - long nIndentValue = 0.0; + tools::Long nIndentValue = 0.0; if (nIndex == INDENT_LEFT_MARGIN) nIndentValue = mxParaItem->GetTextLeft(); else if (nIndex == INDENT_FIRST_LINE) @@ -590,7 +590,7 @@ void SvxRuler::MouseMove( const MouseEvent& rMEvt ) } case RulerType::Margin1: { - long nLeft = 0.0; + tools::Long nLeft = 0.0; if (mxLRSpaceItem) nLeft = mxLRSpaceItem->GetLeft(); else if (mxULSpaceItem) @@ -606,7 +606,7 @@ void SvxRuler::MouseMove( const MouseEvent& rMEvt ) } case RulerType::Margin2: { - long nRight = 0.0; + tools::Long nRight = 0.0; if (mxLRSpaceItem) nRight = mxLRSpaceItem->GetRight(); else if (mxULSpaceItem) @@ -786,7 +786,7 @@ void SvxRuler::UpdateObject() { DBG_ASSERT(!mpObjectBorders.empty(), "no Buffer"); // !! to the page margin - long nMargin = mxLRSpaceItem ? mxLRSpaceItem->GetLeft() : 0; + tools::Long nMargin = mxLRSpaceItem ? mxLRSpaceItem->GetLeft() : 0; mpObjectBorders[0].nPos = ConvertPosPixel(mxObjectItem->GetStartX() - nMargin + lAppNullOffset); @@ -825,14 +825,14 @@ void SvxRuler::UpdatePara() { bool bRTLText = mxRulerImpl->pTextRTLItem && mxRulerImpl->pTextRTLItem->GetValue(); // First-line indent is negative to the left paragraph margin - long nLeftFrameMargin = GetLeftFrameMargin(); - long nRightFrameMargin = GetRightFrameMargin(); + tools::Long nLeftFrameMargin = GetLeftFrameMargin(); + tools::Long nRightFrameMargin = GetRightFrameMargin(); SetLeftFrameMargin(ConvertHPosPixel(nLeftFrameMargin)); SetRightFrameMargin(ConvertHPosPixel(nRightFrameMargin)); - long leftMargin; - long leftFirstLine; - long rightMargin; + tools::Long leftMargin; + tools::Long leftFirstLine; + tools::Long rightMargin; if(bRTLText) { @@ -917,7 +917,7 @@ void SvxRuler::UpdatePage() SetPagePos(); } - long lPos = 0; + tools::Long lPos = 0; Point aOwnPos = GetPosPixel(); Point aEdtWinPos = pEditWin->GetPosPixel(); if( AllSettings::GetLayoutRTL() && bHorz ) @@ -957,7 +957,7 @@ void SvxRuler::Update(const SvxPagePosSizeItem *pItem) // new value of page attr } } -void SvxRuler::SetDefTabDist(long inDefTabDist) // New distance for DefaultTabs in App-Metrics +void SvxRuler::SetDefTabDist(tools::Long inDefTabDist) // New distance for DefaultTabs in App-Metrics { if (lAppNullOffset == LONG_MAX) UpdateFrame(); // hack: try to get lAppNullOffset initialized @@ -1003,22 +1003,22 @@ void SvxRuler::UpdateTabs() // Distance last Tab <-> Right paragraph margin / DefaultTabDist bool bRTL = mxRulerImpl->pTextRTLItem && mxRulerImpl->pTextRTLItem->GetValue(); - const long nLeftFrameMargin = GetLeftFrameMargin(); - const long nRightFrameMargin = GetRightFrameMargin(); + const tools::Long nLeftFrameMargin = GetLeftFrameMargin(); + const tools::Long nRightFrameMargin = GetRightFrameMargin(); //#i24363# tab stops relative to indent - const long nParaItemTxtLeft = mxParaItem->GetTextLeft(); + const tools::Long nParaItemTxtLeft = mxParaItem->GetTextLeft(); - const long lParaIndent = nLeftFrameMargin + nParaItemTxtLeft; - const long lRightMargin = nRightFrameMargin - nParaItemTxtLeft; + const tools::Long lParaIndent = nLeftFrameMargin + nParaItemTxtLeft; + const tools::Long lRightMargin = nRightFrameMargin - nParaItemTxtLeft; - const long lLastTab = mxTabStopItem->Count() + const tools::Long lLastTab = mxTabStopItem->Count() ? ConvertHPosPixel(mxTabStopItem->At(mxTabStopItem->Count() - 1).GetTabPos()) : 0; - const long lPosPixel = ConvertHPosPixel(lParaIndent) + lLastTab; - const long lRightIndent = ConvertHPosPixel(nRightFrameMargin - mxParaItem->GetRight()); + const tools::Long lPosPixel = ConvertHPosPixel(lParaIndent) + lLastTab; + const tools::Long lRightIndent = ConvertHPosPixel(nRightFrameMargin - mxParaItem->GetRight()); - long nDefTabDist = ConvertHPosPixel(lDefTabDist); + tools::Long nDefTabDist = ConvertHPosPixel(lDefTabDist); if( !nDefTabDist ) nDefTabDist = 1; @@ -1037,20 +1037,20 @@ void SvxRuler::UpdateTabs() nTabCount = 0; sal_uInt16 j; - const long lParaIndentPix = ConvertSizePixel(lParaIndent); + const tools::Long lParaIndentPix = ConvertSizePixel(lParaIndent); - long lTabStartLogic = (mxRulerImpl->bIsTabsRelativeToIndent ? lParaIndent : nLeftFrameMargin) + tools::Long lTabStartLogic = (mxRulerImpl->bIsTabsRelativeToIndent ? lParaIndent : nLeftFrameMargin) + lAppNullOffset; if (bRTL) { lTabStartLogic = lParaIndent + lRightMargin - lTabStartLogic; } - long lLastTabOffsetLogic = 0; + tools::Long lLastTabOffsetLogic = 0; for(j = 0; j < mxTabStopItem->Count(); ++j) { const SvxTabStop* pTab = &mxTabStopItem->At(j); lLastTabOffsetLogic = pTab->GetTabPos(); - long lPos = lTabStartLogic + (bRTL ? -lLastTabOffsetLogic : lLastTabOffsetLogic); + tools::Long lPos = lTabStartLogic + (bRTL ? -lLastTabOffsetLogic : lLastTabOffsetLogic); mpTabs[nTabCount + TAB_GAP].nPos = ConvertHPosPixel(lPos); mpTabs[nTabCount + TAB_GAP].nStyle = ToSvTab_Impl(pTab->GetAdjustment()); ++nTabCount; @@ -1123,7 +1123,7 @@ void SvxRuler::Update(const SvxObjectItem *pItem) // new value for objects } } -void SvxRuler::SetNullOffsetLogic(long lVal) // Setting of the logic NullOffsets +void SvxRuler::SetNullOffsetLogic(tools::Long lVal) // Setting of the logic NullOffsets { lAppNullOffset = lLogicNullOffset - lVal; bAppSetNullOffset = true; @@ -1151,14 +1151,14 @@ void SvxRuler::Update() UpdateTabs(); } -long SvxRuler::GetPageWidth() const +tools::Long SvxRuler::GetPageWidth() const { if (!mxPagePosItem) return 0; return bHorz ? mxPagePosItem->GetWidth() : mxPagePosItem->GetHeight(); } -inline long SvxRuler::GetFrameLeft() const +inline tools::Long SvxRuler::GetFrameLeft() const { /* Get Left margin in Pixels */ return bAppSetNullOffset ? @@ -1166,25 +1166,25 @@ inline long SvxRuler::GetFrameLeft() const Ruler::GetNullOffset(); } -long SvxRuler::GetFirstLineIndent() const +tools::Long SvxRuler::GetFirstLineIndent() const { /* Get First-line indent in pixels */ return mxParaItem ? mpIndents[INDENT_FIRST_LINE].nPos : GetMargin1(); } -long SvxRuler::GetLeftIndent() const +tools::Long SvxRuler::GetLeftIndent() const { /* Get Left paragraph margin in Pixels */ return mxParaItem ? mpIndents[INDENT_LEFT_MARGIN].nPos : GetMargin1(); } -long SvxRuler::GetRightIndent() const +tools::Long SvxRuler::GetRightIndent() const { /* Get Right paragraph margin in Pixels */ return mxParaItem ? mpIndents[INDENT_RIGHT_MARGIN].nPos : GetMargin2(); } -long SvxRuler::GetLogicRightIndent() const +tools::Long SvxRuler::GetLogicRightIndent() const { /* Get Right paragraph margin in Logic */ return mxParaItem ? GetRightFrameMargin() - mxParaItem->GetRight() : GetRightFrameMargin(); @@ -1192,12 +1192,12 @@ long SvxRuler::GetLogicRightIndent() const // Left margin in App values, is either the margin (= 0) or the left edge of // the column that is set in the column attribute as current column. -long SvxRuler::GetLeftFrameMargin() const +tools::Long SvxRuler::GetLeftFrameMargin() const { // #126721# for some unknown reason the current column is set to 0xffff DBG_ASSERT(!mxColumnItem || mxColumnItem->GetActColumn() < mxColumnItem->Count(), "issue #126721# - invalid current column!"); - long nLeft = 0; + tools::Long nLeft = 0; if (mxColumnItem && mxColumnItem->Count() && mxColumnItem->IsConsistent()) @@ -1208,7 +1208,7 @@ long SvxRuler::GetLeftFrameMargin() const return nLeft; } -inline long SvxRuler::GetLeftMin() const +inline tools::Long SvxRuler::GetLeftMin() const { DBG_ASSERT(mxMinMaxItem, "no MinMax value set"); if (mxMinMaxItem) @@ -1221,7 +1221,7 @@ inline long SvxRuler::GetLeftMin() const return 0; } -inline long SvxRuler::GetRightMax() const +inline tools::Long SvxRuler::GetRightMax() const { DBG_ASSERT(mxMinMaxItem, "no MinMax value set"); if (mxMinMaxItem) @@ -1235,7 +1235,7 @@ inline long SvxRuler::GetRightMax() const } -long SvxRuler::GetRightFrameMargin() const +tools::Long SvxRuler::GetRightFrameMargin() const { /* Get right frame margin (in logical units) */ if (mxColumnItem) @@ -1246,7 +1246,7 @@ long SvxRuler::GetRightFrameMargin() const } } - long lResult = lLogicNullOffset; + tools::Long lResult = lLogicNullOffset; // If possible deduct right table entry if(mxColumnItem && mxColumnItem->IsTable()) @@ -1268,15 +1268,15 @@ long SvxRuler::GetRightFrameMargin() const SvxRulerSupportFlags::NEGATIVE_MARGINS ) #define TAB_FLAG ( mxColumnItem && mxColumnItem->IsTable() ) -long SvxRuler::GetCorrectedDragPos( bool bLeft, bool bRight ) +tools::Long SvxRuler::GetCorrectedDragPos( bool bLeft, bool bRight ) { /* Corrects the position within the calculated limits. The limit values are in pixels relative to the page edge. */ - const long lNullPix = Ruler::GetNullOffset(); - long lDragPos = GetDragPos() + lNullPix; + const tools::Long lNullPix = Ruler::GetNullOffset(); + tools::Long lDragPos = GetDragPos() + lNullPix; bool bHoriRows = bHorz && mxRulerImpl->bIsTableRows; if((bLeft || bHoriRows) && lDragPos < nMaxLeft) lDragPos = nMaxLeft; @@ -1287,7 +1287,7 @@ long SvxRuler::GetCorrectedDragPos( bool bLeft, bool bRight ) static void ModifyTabs_Impl( sal_uInt16 nCount, // Number of Tabs RulerTab* pTabs, // Tab buffer - long lDiff) // difference to be added + tools::Long lDiff) // difference to be added { /* Helper function, move all the tabs by a fixed value */ if( pTabs ) @@ -1302,7 +1302,7 @@ static void ModifyTabs_Impl( sal_uInt16 nCount, // Number of Tabs void SvxRuler::DragMargin1() { /* Dragging the left edge of frame */ - long aDragPosition = GetCorrectedDragPos( !TAB_FLAG || !NEG_FLAG ); + tools::Long aDragPosition = GetCorrectedDragPos( !TAB_FLAG || !NEG_FLAG ); aDragPosition = MakePositionSticky(aDragPosition, GetRightFrameMargin(), false); @@ -1316,10 +1316,10 @@ void SvxRuler::DragMargin1() AdjustMargin1(aDragPosition); } -void SvxRuler::AdjustMargin1(long lInputDiff) +void SvxRuler::AdjustMargin1(tools::Long lInputDiff) { - const long nOld = bAppSetNullOffset? GetMargin1(): GetNullOffset(); - const long lDragPos = lInputDiff; + const tools::Long nOld = bAppSetNullOffset? GetMargin1(): GetNullOffset(); + const tools::Long lDragPos = lInputDiff; bool bProtectColumns = mxRulerImpl->aProtectItem->IsSizeProtected() || @@ -1330,7 +1330,7 @@ void SvxRuler::AdjustMargin1(long lInputDiff) if(!bAppSetNullOffset) { - long lDiff = lDragPos; + tools::Long lDiff = lDragPos; SetNullOffset(nOld + lDiff); if (!mxColumnItem || !(nDragType & SvxRulerDragFlags::OBJECT_SIZE_LINEAR)) { @@ -1383,7 +1383,7 @@ void SvxRuler::AdjustMargin1(long lInputDiff) } else { - long lDiff = lDragPos - nOld; + tools::Long lDiff = lDragPos - nOld; SetMargin1(nOld + lDiff, nMarginStyle); if (!mxColumnItem @@ -1437,9 +1437,9 @@ void SvxRuler::AdjustMargin1(long lInputDiff) void SvxRuler::DragMargin2() { /* Dragging the right edge of frame */ - long aDragPosition = GetCorrectedDragPos( true, !TAB_FLAG || !NEG_FLAG); + tools::Long aDragPosition = GetCorrectedDragPos( true, !TAB_FLAG || !NEG_FLAG); aDragPosition = MakePositionSticky(aDragPosition, GetLeftFrameMargin(), false); - long lDiff = aDragPosition - GetMargin2(); + tools::Long lDiff = aDragPosition - GetMargin2(); // Check if position changed if (lDiff == 0) @@ -1474,7 +1474,7 @@ void SvxRuler::DragMargin2() void SvxRuler::DragIndents() { /* Dragging the paragraph indents */ - long aDragPosition = NEG_FLAG ? GetDragPos() : GetCorrectedDragPos(); + tools::Long aDragPosition = NEG_FLAG ? GetDragPos() : GetCorrectedDragPos(); const sal_uInt16 nIndex = GetDragAryPos() + INDENT_GAP; bool bRTL = mxRulerImpl->pTextRTLItem && mxRulerImpl->pTextRTLItem->GetValue(); @@ -1484,7 +1484,7 @@ void SvxRuler::DragIndents() else aDragPosition = MakePositionSticky(aDragPosition, bRTL ? GetRightFrameMargin() : GetLeftFrameMargin()); - const long lDiff = mpIndents[nIndex].nPos - aDragPosition; + const tools::Long lDiff = mpIndents[nIndex].nPos - aDragPosition; // Check if position changed if (lDiff == 0) @@ -1502,7 +1502,7 @@ void SvxRuler::DragIndents() DrawLine_Impl(lTabPos, 1, bHorz); } -void SvxRuler::DrawLine_Impl(long& lTabPosition, int nNew, bool bHorizontal) +void SvxRuler::DrawLine_Impl(tools::Long& lTabPosition, int nNew, bool bHorizontal) { /* Output routine for the ledger line when moving tabs, tables and other @@ -1510,7 +1510,7 @@ void SvxRuler::DrawLine_Impl(long& lTabPosition, int nNew, bool bHorizontal) */ if(bHorizontal) { - const long nHeight = pEditWin->GetOutputSize().Height(); + const tools::Long nHeight = pEditWin->GetOutputSize().Height(); Point aZero = pEditWin->GetMapMode().GetOrigin(); if(lTabPosition != -1) { @@ -1521,7 +1521,7 @@ void SvxRuler::DrawLine_Impl(long& lTabPosition, int nNew, bool bHorizontal) } if( nNew & 1 ) { - long nDrapPosition = GetCorrectedDragPos( ( nNew & 4 ) != 0, ( nNew & 2 ) != 0 ); + tools::Long nDrapPosition = GetCorrectedDragPos( ( nNew & 4 ) != 0, ( nNew & 2 ) != 0 ); nDrapPosition = MakePositionSticky(nDrapPosition, GetLeftFrameMargin()); lTabPosition = ConvertHSizeLogic( nDrapPosition + GetNullOffset() ); if (mxPagePosItem) @@ -1534,7 +1534,7 @@ void SvxRuler::DrawLine_Impl(long& lTabPosition, int nNew, bool bHorizontal) } else { - const long nWidth = pEditWin->GetOutputSize().Width(); + const tools::Long nWidth = pEditWin->GetOutputSize().Width(); Point aZero = pEditWin->GetMapMode().GetOrigin(); if(lTabPosition != -1) { @@ -1546,7 +1546,7 @@ void SvxRuler::DrawLine_Impl(long& lTabPosition, int nNew, bool bHorizontal) if(nNew & 1) { - long nDrapPosition = GetCorrectedDragPos(); + tools::Long nDrapPosition = GetCorrectedDragPos(); nDrapPosition = MakePositionSticky(nDrapPosition, GetLeftFrameMargin()); lTabPosition = ConvertVSizeLogic(nDrapPosition + GetNullOffset()); if (mxPagePosItem) @@ -1562,11 +1562,11 @@ void SvxRuler::DrawLine_Impl(long& lTabPosition, int nNew, bool bHorizontal) void SvxRuler::DragTabs() { /* Dragging of Tabs */ - long aDragPosition = GetCorrectedDragPos(true, false); + tools::Long aDragPosition = GetCorrectedDragPos(true, false); aDragPosition = MakePositionSticky(aDragPosition, GetLeftFrameMargin()); sal_uInt16 nIdx = GetDragAryPos() + TAB_GAP; - long nDiff = aDragPosition - mpTabs[nIdx].nPos; + tools::Long nDiff = aDragPosition - mpTabs[nIdx].nPos; if (nDiff == 0) return; @@ -1594,7 +1594,7 @@ void SvxRuler::DragTabs() if(mpTabs[i].nStyle & RULER_TAB_DEFAULT) // can be canceled at the DefaultTabs break; - long nDelta = mxRulerImpl->nTotalDist * mxRulerImpl->pPercBuf[i]; + tools::Long nDelta = mxRulerImpl->nTotalDist * mxRulerImpl->pPercBuf[i]; nDelta /= 1000; mpTabs[i].nPos = mpTabs[nIdx].nPos + nDelta; if(mpTabs[i].nPos + GetNullOffset() > nMaxRight) @@ -1638,7 +1638,7 @@ void SvxRuler::SetActive(bool bOn) } void SvxRuler::UpdateParaContents_Impl( - long lDifference, + tools::Long lDifference, UpdateType eType) // Art (all, left or right) { /* Helper function; carry Tabs and Paragraph Margins */ @@ -1683,10 +1683,10 @@ void SvxRuler::DragBorders() } RulerDragSize nDragSize = GetDragSize(); - long lDiff = 0; + tools::Long lDiff = 0; // the drag position has to be corrected to be able to prevent borders from passing each other - long lPos = MakePositionSticky(GetCorrectedDragPos(), GetLeftFrameMargin()); + tools::Long lPos = MakePositionSticky(GetCorrectedDragPos(), GetLeftFrameMargin()); switch(nDragSize) { @@ -1699,10 +1699,10 @@ void SvxRuler::DragBorders() if(nDragType & SvxRulerDragFlags::OBJECT_SIZE_LINEAR) { - long nRight = GetMargin2() - glMinFrame; // Right limiters + tools::Long nRight = GetMargin2() - glMinFrame; // Right limiters for(int i = mpBorders.size() - 2; i >= nIndex; --i) { - long l = mpBorders[i].nPos; + tools::Long l = mpBorders[i].nPos; mpBorders[i].nPos += lDiff; mpBorders[i].nPos = std::min(mpBorders[i].nPos, nRight - mpBorders[i].nWidth); nRight = mpBorders[i].nPos - glMinFrame; @@ -1723,7 +1723,7 @@ void SvxRuler::DragBorders() else if(nDragType & SvxRulerDragFlags::OBJECT_SIZE_PROPORTIONAL) { int nLimit; - long lLeft; + tools::Long lLeft; int nStartLimit = mpBorders.size() - 2; switch(GetDragType()) { @@ -1772,7 +1772,7 @@ void SvxRuler::DragBorders() for(int i = nStartLimit; i >= nLimit; --i) { - long l = mpBorders[i].nPos; + tools::Long l = mpBorders[i].nPos; mpBorders[i].nPos = lLeft + (mxRulerImpl->nTotalDist * mxRulerImpl->pPercBuf[i]) / 1000 + @@ -1860,7 +1860,7 @@ void SvxRuler::DragBorders() } case RulerDragSize::N2: { - const long nOld = mpBorders[nIndex].nWidth; + const tools::Long nOld = mpBorders[nIndex].nWidth; mpBorders[nIndex].nWidth = lPos - mpBorders[nIndex].nPos; lDiff = mpBorders[nIndex].nWidth - nOld; break; @@ -1889,7 +1889,7 @@ void SvxRuler::DragObjectBorder() /* Dragging of object edges */ if(RulerDragSize::Move == GetDragSize()) { - const long lPosition = MakePositionSticky(GetCorrectedDragPos(), GetLeftFrameMargin()); + const tools::Long lPosition = MakePositionSticky(GetCorrectedDragPos(), GetLeftFrameMargin()); const sal_uInt16 nIdx = GetDragAryPos(); mpObjectBorders[GetObjectBordersOff(nIdx)].nPos = lPosition; @@ -1907,7 +1907,7 @@ void SvxRuler::ApplyMargins() if(bHorz) { - const long lOldNull = lLogicNullOffset; + const tools::Long lOldNull = lLogicNullOffset; if(mxRulerImpl->lMaxLeftLogic != -1 && nMaxLeft == GetMargin1() + Ruler::GetNullOffset()) { lLogicNullOffset = mxRulerImpl->lMaxLeftLogic; @@ -1924,7 +1924,7 @@ void SvxRuler::ApplyMargins() lAppNullOffset += lLogicNullOffset - lOldNull; } - long nRight; + tools::Long nRight; if(mxRulerImpl->lMaxRightLogic != -1 && nMaxRight == GetMargin2() + Ruler::GetNullOffset()) { @@ -1932,7 +1932,7 @@ void SvxRuler::ApplyMargins() } else { - nRight = std::max(long(0), + nRight = std::max(tools::Long(0), mxPagePosItem->GetWidth() - mxLRSpaceItem->GetLeft() - (ConvertHPosLogic(GetMargin2()) - lAppNullOffset)); @@ -1949,7 +1949,7 @@ void SvxRuler::ApplyMargins() } else { - const long lOldNull = lLogicNullOffset; + const tools::Long lOldNull = lLogicNullOffset; lLogicNullOffset = ConvertVPosLogic(GetFrameLeft()) - lAppNullOffset; @@ -1961,7 +1961,7 @@ void SvxRuler::ApplyMargins() } mxULSpaceItem->SetLower( PixelVAdjust( - std::max(long(0), mxPagePosItem->GetHeight() - + std::max(tools::Long(0), mxPagePosItem->GetHeight() - mxULSpaceItem->GetUpper() - (ConvertVPosLogic(GetMargin2()) - lAppNullOffset)), mxULSpaceItem->GetLower())); @@ -1978,12 +1978,12 @@ void SvxRuler::ApplyMargins() UpdateTabs(); } -long SvxRuler::RoundToCurrentMapMode(long lValue) const +tools::Long SvxRuler::RoundToCurrentMapMode(tools::Long lValue) const { RulerUnitData aUnitData = GetCurrentRulerUnit(); double aRoundingFactor = aUnitData.nTickUnit / aUnitData.nTick1; - long lNewValue = OutputDevice::LogicToLogic(Size(lValue, 0), pEditWin->GetMapMode(), GetCurrentMapMode()).Width(); + tools::Long lNewValue = OutputDevice::LogicToLogic(Size(lValue, 0), pEditWin->GetMapMode(), GetCurrentMapMode()).Width(); lNewValue = (rtl::math::round(lNewValue / static_cast<double>(aUnitData.nTickUnit) * aRoundingFactor) / aRoundingFactor) * aUnitData.nTickUnit; return OutputDevice::LogicToLogic(Size(lNewValue, 0), GetCurrentMapMode(), pEditWin->GetMapMode()).Width(); } @@ -1992,30 +1992,30 @@ void SvxRuler::ApplyIndents() { /* Applying paragraph settings; changed by dragging. */ - long nLeftFrameMargin = GetLeftFrameMargin(); + tools::Long nLeftFrameMargin = GetLeftFrameMargin(); bool bRTL = mxRulerImpl->pTextRTLItem && mxRulerImpl->pTextRTLItem->GetValue(); - long nNewTxtLeft; - long nNewFirstLineOffset; - long nNewRight; + tools::Long nNewTxtLeft; + tools::Long nNewFirstLineOffset; + tools::Long nNewRight; - long nFirstLine = ConvertPosLogic(mpIndents[INDENT_FIRST_LINE].nPos); - long nLeftMargin = ConvertPosLogic(mpIndents[INDENT_LEFT_MARGIN].nPos); - long nRightMargin = ConvertPosLogic(mpIndents[INDENT_RIGHT_MARGIN].nPos); + tools::Long nFirstLine = ConvertPosLogic(mpIndents[INDENT_FIRST_LINE].nPos); + tools::Long nLeftMargin = ConvertPosLogic(mpIndents[INDENT_LEFT_MARGIN].nPos); + tools::Long nRightMargin = ConvertPosLogic(mpIndents[INDENT_RIGHT_MARGIN].nPos); if(mxColumnItem && ((bRTL && !IsActLastColumn(true)) || (!bRTL && !IsActFirstColumn(true)))) { if(bRTL) { - long nRightColumn = GetActRightColumn(true); - long nRightBorder = ConvertPosLogic(mpBorders[nRightColumn].nPos); + tools::Long nRightColumn = GetActRightColumn(true); + tools::Long nRightBorder = ConvertPosLogic(mpBorders[nRightColumn].nPos); nNewTxtLeft = nRightBorder - nLeftMargin - lAppNullOffset; } else { - long nLeftColumn = GetActLeftColumn(true); - long nLeftBorder = ConvertPosLogic(mpBorders[nLeftColumn].nPos + mpBorders[nLeftColumn].nWidth); + tools::Long nLeftColumn = GetActLeftColumn(true); + tools::Long nLeftBorder = ConvertPosLogic(mpBorders[nLeftColumn].nPos + mpBorders[nLeftColumn].nWidth); nNewTxtLeft = nLeftMargin - nLeftBorder - lAppNullOffset; } } @@ -2023,12 +2023,12 @@ void SvxRuler::ApplyIndents() { if(bRTL) { - long nRightBorder = ConvertPosLogic(GetMargin2()); + tools::Long nRightBorder = ConvertPosLogic(GetMargin2()); nNewTxtLeft = nRightBorder - nLeftMargin - lAppNullOffset; } else { - long nLeftBorder = ConvertPosLogic(GetMargin1()); + tools::Long nLeftBorder = ConvertPosLogic(GetMargin1()); nNewTxtLeft = nLeftBorder + nLeftMargin - nLeftFrameMargin - lAppNullOffset; } } @@ -2042,14 +2042,14 @@ void SvxRuler::ApplyIndents() { if(bRTL) { - long nLeftColumn = GetActLeftColumn(true); - long nLeftBorder = ConvertPosLogic(mpBorders[nLeftColumn].nPos + mpBorders[nLeftColumn].nWidth); + tools::Long nLeftColumn = GetActLeftColumn(true); + tools::Long nLeftBorder = ConvertPosLogic(mpBorders[nLeftColumn].nPos + mpBorders[nLeftColumn].nWidth); nNewRight = nRightMargin - nLeftBorder - lAppNullOffset; } else { - long nRightColumn = GetActRightColumn(true); - long nRightBorder = ConvertPosLogic(mpBorders[nRightColumn].nPos); + tools::Long nRightColumn = GetActRightColumn(true); + tools::Long nRightBorder = ConvertPosLogic(mpBorders[nRightColumn].nPos); nNewRight = nRightBorder - nRightMargin - lAppNullOffset; } } @@ -2057,12 +2057,12 @@ void SvxRuler::ApplyIndents() { if(bRTL) { - long nLeftBorder = ConvertPosLogic(GetMargin1()); + tools::Long nLeftBorder = ConvertPosLogic(GetMargin1()); nNewRight = nLeftBorder + nRightMargin - nLeftFrameMargin - lAppNullOffset; } else { - long nRightBorder = ConvertPosLogic(GetMargin2()); + tools::Long nRightBorder = ConvertPosLogic(GetMargin2()); nNewRight = nRightBorder - nRightMargin - lAppNullOffset; } } @@ -2133,7 +2133,7 @@ void SvxRuler::ApplyTabs() mpTabs[nCoreIdx + TAB_GAP].nPos + Ruler::GetNullOffset() == nMaxRight ) { // Set tab pos exactly at the right indent - long nTmpLeftIndentLogic + tools::Long nTmpLeftIndentLogic = lAppNullOffset + (bRTL ? GetRightFrameMargin() : GetLeftFrameMargin()); if (mxRulerImpl->bIsTabsRelativeToIndent && mxParaItem) { @@ -2147,21 +2147,21 @@ void SvxRuler::ApplyTabs() if(bRTL) { //#i24363# tab stops relative to indent - const long nTmpLeftIndent = mxRulerImpl->bIsTabsRelativeToIndent ? + const tools::Long nTmpLeftIndent = mxRulerImpl->bIsTabsRelativeToIndent ? GetLeftIndent() : ConvertHPosPixel( GetRightFrameMargin() + lAppNullOffset ); - long nNewPosition = ConvertHPosLogic(nTmpLeftIndent - mpTabs[nCoreIdx + TAB_GAP].nPos); + tools::Long nNewPosition = ConvertHPosLogic(nTmpLeftIndent - mpTabs[nCoreIdx + TAB_GAP].nPos); aTabStop.GetTabPos() = PixelHAdjust(nNewPosition - lAppNullOffset, aTabStop.GetTabPos()); } else { //#i24363# tab stops relative to indent - const long nTmpLeftIndent = mxRulerImpl->bIsTabsRelativeToIndent ? + const tools::Long nTmpLeftIndent = mxRulerImpl->bIsTabsRelativeToIndent ? GetLeftIndent() : ConvertHPosPixel( GetLeftFrameMargin() + lAppNullOffset ); - long nNewPosition = ConvertHPosLogic(mpTabs[nCoreIdx + TAB_GAP].nPos - nTmpLeftIndent); + tools::Long nNewPosition = ConvertHPosLogic(mpTabs[nCoreIdx + TAB_GAP].nPos - nTmpLeftIndent); aTabStop.GetTabPos() = PixelHAdjust(nNewPosition - lAppNullOffset, aTabStop.GetTabPos()); } } @@ -2179,10 +2179,10 @@ void SvxRuler::ApplyBorders() /* Applying (table) column settings; changed by dragging. */ if(mxColumnItem->IsTable()) { - long lValue = GetFrameLeft(); + tools::Long lValue = GetFrameLeft(); if(lValue != mxRulerImpl->nColLeftPix) { - long nLeft = PixelHAdjust( + tools::Long nLeft = PixelHAdjust( ConvertHPosLogic(lValue) - lAppNullOffset, mxColumnItem->GetLeft()); @@ -2193,8 +2193,8 @@ void SvxRuler::ApplyBorders() if(lValue != mxRulerImpl->nColRightPix) { - long nWidthOrHeight = bHorz ? mxPagePosItem->GetWidth() : mxPagePosItem->GetHeight(); - long nRight = PixelHAdjust( + tools::Long nWidthOrHeight = bHorz ? mxPagePosItem->GetWidth() : mxPagePosItem->GetHeight(); + tools::Long nRight = PixelHAdjust( nWidthOrHeight - mxColumnItem->GetLeft() - ConvertHPosLogic(lValue) - @@ -2206,11 +2206,11 @@ void SvxRuler::ApplyBorders() for(sal_uInt16 i = 0; i < mxColumnItem->Count() - 1; ++i) { - long& nEnd = mxColumnItem->At(i).nEnd; + tools::Long& nEnd = mxColumnItem->At(i).nEnd; nEnd = PixelHAdjust( ConvertPosLogic(mpBorders[i].nPos), mxColumnItem->At(i).nEnd); - long& nStart = mxColumnItem->At(i + 1).nStart; + tools::Long& nStart = mxColumnItem->At(i + 1).nStart; nStart = PixelHAdjust( ConvertSizeLogic(mpBorders[i].nPos + mpBorders[i].nWidth) - @@ -2241,15 +2241,15 @@ void SvxRuler::ApplyObject() /* Applying object settings, changed by dragging. */ // to the page margin - long nMargin = mxLRSpaceItem ? mxLRSpaceItem->GetLeft() : 0; - long nStartX = PixelAdjust( + tools::Long nMargin = mxLRSpaceItem ? mxLRSpaceItem->GetLeft() : 0; + tools::Long nStartX = PixelAdjust( ConvertPosLogic(mpObjectBorders[0].nPos) + nMargin - lAppNullOffset, mxObjectItem->GetStartX()); mxObjectItem->SetStartX(nStartX); - long nEndX = PixelAdjust( + tools::Long nEndX = PixelAdjust( ConvertPosLogic(mpObjectBorders[1].nPos) + nMargin - lAppNullOffset, @@ -2257,14 +2257,14 @@ void SvxRuler::ApplyObject() mxObjectItem->SetEndX(nEndX); nMargin = mxULSpaceItem ? mxULSpaceItem->GetUpper() : 0; - long nStartY = PixelAdjust( + tools::Long nStartY = PixelAdjust( ConvertPosLogic(mpObjectBorders[2].nPos) + nMargin - lAppNullOffset, mxObjectItem->GetStartY()); mxObjectItem->SetStartY(nStartY); - long nEndY = PixelAdjust( + tools::Long nEndY = PixelAdjust( ConvertPosLogic(mpObjectBorders[3].nPos) + nMargin - lAppNullOffset, @@ -2292,13 +2292,13 @@ void SvxRuler::PrepareProportional_Impl(RulerType eType) mxRulerImpl->SetPercSize(mxColumnItem->Count()); - long lPos; - long lWidth=0; + tools::Long lPos; + tools::Long lWidth=0; sal_uInt16 nStart; sal_uInt16 nIdx=GetDragAryPos(); - long lActWidth=0; - long lActBorderSum; - long lOrigLPos; + tools::Long lActWidth=0; + tools::Long lActBorderSum; + tools::Long lOrigLPos; if(eType != RulerType::Border) { @@ -2393,7 +2393,7 @@ void SvxRuler::PrepareProportional_Impl(RulerType eType) for(sal_uInt16 n=0;n<=nIdx;mxRulerImpl->pPercBuf[n++]=0) ; for(sal_uInt16 i = nIdx+1; i < nTabCount; ++i) { - const long nDelta = mpTabs[i].nPos - mpTabs[nIdx].nPos; + const tools::Long nDelta = mpTabs[i].nPos - mpTabs[nIdx].nPos; mxRulerImpl->pPercBuf[i] = static_cast<sal_uInt16>((nDelta * 1000) / mxRulerImpl->nTotalDist); } break; @@ -2481,13 +2481,13 @@ void SvxRuler::Click() bool bContentProtected = mxRulerImpl->aProtectItem->IsContentProtected(); if( bContentProtected ) return; - const long lPos = GetClickPos(); + const tools::Long lPos = GetClickPos(); if(!((bRTL && lPos < std::min(GetFirstLineIndent(), GetLeftIndent()) && lPos > GetRightIndent()) || (!bRTL && lPos > std::min(GetFirstLineIndent(), GetLeftIndent()) && lPos < GetRightIndent()))) return; //convert position in left-to-right text - long nTabPos; + tools::Long nTabPos; //#i24363# tab stops relative to indent if(bRTL) nTabPos = ( mxRulerImpl->bIsTabsRelativeToIndent ? @@ -2513,7 +2513,7 @@ void SvxRuler::CalcMinMax() page edge */ bool bRTL = mxRulerImpl->pTextRTLItem && mxRulerImpl->pTextRTLItem->GetValue(); - const long lNullPix = ConvertPosPixel(lLogicNullOffset); + const tools::Long lNullPix = ConvertPosPixel(lLogicNullOffset); mxRulerImpl->lMaxLeftLogic=mxRulerImpl->lMaxRightLogic=-1; switch(GetDragType()) { @@ -2597,7 +2597,7 @@ void SvxRuler::CalcMinMax() // Do not drag the left table edge over the edge of the page if(mxLRSpaceItem && mxColumnItem->IsTable()) { - long nTmp=ConvertSizePixel(mxLRSpaceItem->GetLeft()); + tools::Long nTmp=ConvertSizePixel(mxLRSpaceItem->GetLeft()); if(nTmp>nMaxLeft) nMaxLeft=nTmp; } @@ -2673,7 +2673,7 @@ void SvxRuler::CalcMinMax() } if( mxColumnItem->Count() >= 2 ) { - long nNewMaxLeft = + tools::Long nNewMaxLeft = glMinFrame + lNullPix + mpBorders[mxColumnItem->Count() - 2].nPos + mpBorders[mxColumnItem->Count() - 2].nWidth; @@ -2856,7 +2856,7 @@ void SvxRuler::CalcMinMax() if( nActLeftCol == nIdx ) { - long nBorder = nNotHiddenRightCol == + tools::Long nBorder = nNotHiddenRightCol == USHRT_MAX ? GetMargin2() : mpBorders[nNotHiddenRightCol].nPos; @@ -3151,7 +3151,7 @@ void SvxRuler::EndDrag() data to the application. */ const bool bUndo = IsDragCanceled(); - const long lPos = GetDragPos(); + const tools::Long lPos = GetDragPos(); DrawLine_Impl(lTabPos, 6, bHorz); lTabPos = -1; @@ -3421,19 +3421,19 @@ bool SvxRuler::IsActFirstColumn( return GetActLeftColumn(bForceDontConsiderHidden, nAct) == USHRT_MAX; } -long SvxRuler::CalcPropMaxRight(sal_uInt16 nCol) const +tools::Long SvxRuler::CalcPropMaxRight(sal_uInt16 nCol) const { if(!(nDragType & SvxRulerDragFlags::OBJECT_SIZE_LINEAR)) { // Remove the minimum width for all affected columns // starting from the right edge - long _nMaxRight = GetMargin2() - GetMargin1(); + tools::Long _nMaxRight = GetMargin2() - GetMargin1(); - long lFences = 0; - long lMinSpace = USHRT_MAX; - long lOldPos; - long lColumns = 0; + tools::Long lFences = 0; + tools::Long lMinSpace = USHRT_MAX; + tools::Long lOldPos; + tools::Long lColumns = 0; sal_uInt16 nStart; if(!mxColumnItem->IsTable()) @@ -3452,14 +3452,14 @@ long SvxRuler::CalcPropMaxRight(sal_uInt16 nCol) const for(size_t i = nStart; i < mpBorders.size() - 1; ++i) { - long lWidth = mpBorders[i].nPos - lOldPos; + tools::Long lWidth = mpBorders[i].nPos - lOldPos; lColumns += lWidth; if(lWidth < lMinSpace) lMinSpace = lWidth; lOldPos = mpBorders[i].nPos + mpBorders[i].nWidth; lFences += mpBorders[i].nWidth; } - long lWidth = GetMargin2() - lOldPos; + tools::Long lWidth = GetMargin2() - lOldPos; lColumns += lWidth; if(lWidth < lMinSpace) lMinSpace = lWidth; @@ -3494,7 +3494,7 @@ long SvxRuler::CalcPropMaxRight(sal_uInt16 nCol) const nRight = GetActRightColumn(false, nActCol); } - long lWidth; + tools::Long lWidth; if(nRight != USHRT_MAX) { lWidth = mpBorders[nRight].nPos - lOldPos; @@ -3512,7 +3512,7 @@ long SvxRuler::CalcPropMaxRight(sal_uInt16 nCol) const } } - _nMaxRight -= static_cast<long>(lFences + glMinFrame / static_cast<float>(lMinSpace) * lColumns); + _nMaxRight -= static_cast<tools::Long>(lFences + glMinFrame / static_cast<float>(lMinSpace) * lColumns); return _nMaxRight; } else @@ -3530,7 +3530,7 @@ long SvxRuler::CalcPropMaxRight(sal_uInt16 nCol) const } else { - long lWidth = 0; + tools::Long lWidth = 0; for(size_t i = nCol; i < mpBorders.size() - 1; i++) { lWidth += glMinFrame + mpBorders[i].nWidth; @@ -3546,7 +3546,7 @@ void SvxRuler::SetTabsRelativeToIndent( bool bRel ) mxRulerImpl->bIsTabsRelativeToIndent = bRel; } -void SvxRuler::SetValues(RulerChangeType type, long diffValue) +void SvxRuler::SetValues(RulerChangeType type, tools::Long diffValue) { if (diffValue == 0) return; diff --git a/svx/source/dialog/swframeexample.cxx b/svx/source/dialog/swframeexample.cxx index ab866786be82..770b58f1eee9 100644 --- a/svx/source/dialog/swframeexample.cxx +++ b/svx/source/dialog/swframeexample.cxx @@ -219,7 +219,7 @@ void SwFrameExample::InitAllRects_Impl(vcl::RenderContext& rRenderContext) sal_uInt32 nFreeWidth = aPagePrtArea.GetWidth() - rRenderContext.GetTextWidth(DEMOTEXT); aFrmSize = Size(nFreeWidth / 2, (aTextLine.GetHeight() + 2) * 3); - aDrawObj.SetSize(Size(std::max(5L, static_cast<long>(nFreeWidth) / 3L), std::max(5L, aFrmSize.Height() * 3L))); + aDrawObj.SetSize(Size(std::max(5L, static_cast<tools::Long>(nFreeWidth) / 3L), std::max(5L, aFrmSize.Height() * 3L))); aDrawObj.SetPos(Point(aParaPrtArea.Right() + 1, aParaPrtArea.Bottom() / 2)); aParaPrtArea.SetRight( aDrawObj.Right() ); } @@ -480,8 +480,8 @@ void SwFrameExample::Paint(vcl::RenderContext& rRenderContext, const tools::Rect if (nAnchor == RndStdIds::FLY_AT_FLY) aRect = DrawInnerFrame_Impl(rRenderContext, aFrameAtFrame, m_aBgCol, m_aBorderCol); - long lXPos = 0; - long lYPos = 0; + tools::Long lXPos = 0; + tools::Long lYPos = 0; // Horizontal alignment if (nAnchor != RndStdIds::FLY_AS_CHAR) @@ -601,7 +601,7 @@ void SwFrameExample::Paint(vcl::RenderContext& rRenderContext, const tools::Rect aFrmRect.Move(0, pOuterFrame->Bottom() - aFrmRect.Bottom()); // Draw Test paragraph - const long nTxtLineHeight = aTextLine.GetHeight(); + const tools::Long nTxtLineHeight = aTextLine.GetHeight(); tools::Rectangle aTxt(aTextLine); sal_Int32 nStep; sal_uInt16 nLines; @@ -626,8 +626,8 @@ void SwFrameExample::Paint(vcl::RenderContext& rRenderContext, const tools::Rect if (nAnchor != RndStdIds::FLY_AS_CHAR) { // Simulate text - const long nOldR = aTxt.Right(); - const long nOldL = aTxt.Left(); + const tools::Long nOldR = aTxt.Right(); + const tools::Long nOldL = aTxt.Left(); // #i22341# const bool bIgnoreWrap = nAnchor == RndStdIds::FLY_AT_CHAR && |