diff options
author | Noel <noelgrandin@gmail.com> | 2020-10-21 09:30:59 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-10-21 14:33:39 +0200 |
commit | 5e43e888f6b9bc32fc5d3361be5a7962796726ea (patch) | |
tree | 061df26f907bece9cacad5b53290db3f6937d09e /cui/source/tabpages | |
parent | 5100a06c15ee8d66dc88f58523a35014988fd9fe (diff) |
use tools::Long in comphelper..cui
Change-Id: I65167999c6049038f8f5d530a0c5cb0552ab0e06
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104609
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui/source/tabpages')
-rw-r--r-- | cui/source/tabpages/border.cxx | 14 | ||||
-rw-r--r-- | cui/source/tabpages/chardlg.cxx | 30 | ||||
-rw-r--r-- | cui/source/tabpages/grfpage.cxx | 60 | ||||
-rw-r--r-- | cui/source/tabpages/labdlg.cxx | 4 | ||||
-rw-r--r-- | cui/source/tabpages/measure.cxx | 2 | ||||
-rw-r--r-- | cui/source/tabpages/numfmt.cxx | 6 | ||||
-rw-r--r-- | cui/source/tabpages/numpages.cxx | 110 | ||||
-rw-r--r-- | cui/source/tabpages/page.cxx | 82 | ||||
-rw-r--r-- | cui/source/tabpages/paragrph.cxx | 12 | ||||
-rw-r--r-- | cui/source/tabpages/swpossizetabpage.cxx | 4 | ||||
-rw-r--r-- | cui/source/tabpages/tabstpge.cxx | 10 | ||||
-rw-r--r-- | cui/source/tabpages/textanim.cxx | 6 | ||||
-rw-r--r-- | cui/source/tabpages/tpbitmap.cxx | 20 | ||||
-rw-r--r-- | cui/source/tabpages/tpcolor.cxx | 8 | ||||
-rw-r--r-- | cui/source/tabpages/tpgradnt.cxx | 8 | ||||
-rw-r--r-- | cui/source/tabpages/tphatch.cxx | 10 | ||||
-rw-r--r-- | cui/source/tabpages/tpline.cxx | 30 | ||||
-rw-r--r-- | cui/source/tabpages/tplnedef.cxx | 18 | ||||
-rw-r--r-- | cui/source/tabpages/tplneend.cxx | 14 | ||||
-rw-r--r-- | cui/source/tabpages/tppattern.cxx | 8 | ||||
-rw-r--r-- | cui/source/tabpages/transfrm.cxx | 10 |
21 files changed, 233 insertions, 233 deletions
diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx index 0c8fda14defe..d952ae97ad8c 100644 --- a/cui/source/tabpages/border.cxx +++ b/cui/source/tabpages/border.cxx @@ -678,19 +678,19 @@ void SvxBorderTabPage::Reset( const SfxItemSet* rSet ) m_xTopMF->set_min(0, FieldUnit::NONE); m_xBottomMF->set_min(0, FieldUnit::NONE); } - long nLeftDist = pBoxItem->GetDistance( SvxBoxItemLine::LEFT); + tools::Long nLeftDist = pBoxItem->GetDistance( SvxBoxItemLine::LEFT); SetMetricValue(*m_xLeftMF, nLeftDist, eCoreUnit); - long nRightDist = pBoxItem->GetDistance( SvxBoxItemLine::RIGHT); + tools::Long nRightDist = pBoxItem->GetDistance( SvxBoxItemLine::RIGHT); SetMetricValue(*m_xRightMF, nRightDist, eCoreUnit); - long nTopDist = pBoxItem->GetDistance( SvxBoxItemLine::TOP); + tools::Long nTopDist = pBoxItem->GetDistance( SvxBoxItemLine::TOP); SetMetricValue( *m_xTopMF, nTopDist, eCoreUnit ); - long nBottomDist = pBoxItem->GetDistance( SvxBoxItemLine::BOTTOM); + tools::Long nBottomDist = pBoxItem->GetDistance( SvxBoxItemLine::BOTTOM); SetMetricValue( *m_xBottomMF, nBottomDist, eCoreUnit ); // if the distance is set with no active border line // or it is null with an active border line // no automatic changes should be made - const long nDefDist = bIsAnyBorderVisible ? pBoxInfoItem->GetDefDist() : 0; + const tools::Long nDefDist = bIsAnyBorderVisible ? pBoxInfoItem->GetDefDist() : 0; bool bDiffDist = (nDefDist != nLeftDist || nDefDist != nRightDist || nDefDist != nTopDist || @@ -732,7 +732,7 @@ void SvxBorderTabPage::Reset( const SfxItemSet* rSet ) { // Do all visible lines show the same line widths? - long nWidth; + tools::Long nWidth; SvxBorderLineStyle nStyle; bool bWidthEq = m_aFrameSel.GetVisibleWidth( nWidth, nStyle ); if( bWidthEq ) @@ -1331,7 +1331,7 @@ void SvxBorderTabPage::FillLineListBox_Impl() static struct { SvxBorderLineStyle mnStyle; - long mnMinWidth; + tools::Long mnMinWidth; SvtLineListBox::ColorFunc mpColor1Fn; SvtLineListBox::ColorFunc mpColor2Fn; SvtLineListBox::ColorDistFunc mpColorDistFn; diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index b7f9b17165fc..4ec72e217772 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -440,18 +440,18 @@ namespace const SvxFontHeightItem& rOldItem = static_cast<const SvxFontHeightItem&>(_pPage->GetItemSet().GetParent()->Get( _nFontHeightWhich )); // old value, scaled - long nHeight; + tools::Long nHeight; if ( _pFontSizeLB->IsPtRelative() ) - nHeight = rOldItem.GetHeight() + PointToTwips( static_cast<long>(_pFontSizeLB->get_value() / 10) ); + nHeight = rOldItem.GetHeight() + PointToTwips( static_cast<tools::Long>(_pFontSizeLB->get_value() / 10) ); else - nHeight = static_cast<long>(rOldItem.GetHeight() * _pFontSizeLB->get_value() / 100); + nHeight = static_cast<tools::Long>(rOldItem.GetHeight() * _pFontSizeLB->get_value() / 100); // conversion twips for the example-window aSize.setHeight( ItemToControl( nHeight, _pPage->GetItemSet().GetPool()->GetMetric( _nFontHeightWhich ), FieldUnit::TWIP ) ); } else if ( !_pFontSizeLB->get_active_text().isEmpty() ) - aSize.setHeight( PointToTwips( static_cast<long>(_pFontSizeLB->get_value() / 10) ) ); + aSize.setHeight( PointToTwips( static_cast<tools::Long>(_pFontSizeLB->get_value() / 10) ) ); else aSize.setHeight( 200 ); // default 10pt aFontMetrics.SetFontSize( aSize ); @@ -1012,11 +1012,11 @@ bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLangGrp rSet.InvalidateItem(nWhich); // FontSize - long nSize = pSizeBox->get_value(); + tools::Long nSize = pSizeBox->get_value(); if ( pSizeBox->get_active_text().isEmpty() ) // GetValue() returns the min-value nSize = 0; - long nSavedSize = pSizeBox->get_saved_value(); + tools::Long nSavedSize = pSizeBox->get_saved_value(); const bool bRel = pSizeBox->IsRelative(); switch ( eLangGrp ) @@ -1033,7 +1033,7 @@ bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLangGrp pExampleSet->GetItemState( nWhich, false, &pItem ) == SfxItemState::SET ) { float fSize = static_cast<float>(nSize) / 10; - long nVal = CalcToUnit( fSize, rSet.GetPool()->GetMetric( nWhich ) ); + tools::Long nVal = CalcToUnit( fSize, rSet.GetPool()->GetMetric( nWhich ) ); if ( static_cast<const SvxFontHeightItem*>(pItem)->GetHeight() != static_cast<sal_uInt32>(nVal) ) bChanged = true; } @@ -2583,9 +2583,9 @@ IMPL_LINK_NOARG(SvxCharPositionPage, FitToLineHdl_Impl, weld::ToggleButton&, voi IMPL_LINK_NOARG(SvxCharPositionPage, KerningModifyHdl_Impl, weld::MetricSpinButton&, void) { - long nVal = static_cast<long>(m_xKerningMF->get_value(FieldUnit::POINT)); + tools::Long nVal = static_cast<tools::Long>(m_xKerningMF->get_value(FieldUnit::POINT)); nVal = OutputDevice::LogicToLogic( nVal, MapUnit::MapPoint, MapUnit::MapTwip ); - long nKern = static_cast<short>(m_xKerningMF->denormalize(nVal)); + tools::Long nKern = static_cast<short>(m_xKerningMF->denormalize(nVal)); SvxFont& rFont = GetPreviewFont(); SvxFont& rCJKFont = GetPreviewCJKFont(); @@ -2761,17 +2761,17 @@ void SvxCharPositionPage::Reset( const SfxItemSet* rSet ) { const SvxKerningItem& rItem = static_cast<const SvxKerningItem&>(rSet->Get( nWhich )); MapUnit eUnit = rSet->GetPool()->GetMetric( nWhich ); - long nBig = static_cast<long>(m_xKerningMF->normalize( static_cast<long>(rItem.GetValue()) )); - long nKerning = OutputDevice::LogicToLogic(nBig, eUnit, MapUnit::MapPoint); + tools::Long nBig = static_cast<tools::Long>(m_xKerningMF->normalize( static_cast<tools::Long>(rItem.GetValue()) )); + tools::Long nKerning = OutputDevice::LogicToLogic(nBig, eUnit, MapUnit::MapPoint); // set Kerning at the Font, convert into Twips before - long nKern = OutputDevice::LogicToLogic(rItem.GetValue(), eUnit, MapUnit::MapTwip); + tools::Long nKern = OutputDevice::LogicToLogic(rItem.GetValue(), eUnit, MapUnit::MapTwip); rFont.SetFixKerning( static_cast<short>(nKern) ); rCJKFont.SetFixKerning( static_cast<short>(nKern) ); rCTLFont.SetFixKerning( static_cast<short>(nKern) ); //the attribute value must be displayed also if it's above the maximum allowed value - long nVal = static_cast<long>(m_xKerningMF->get_max(FieldUnit::POINT)); + tools::Long nVal = static_cast<tools::Long>(m_xKerningMF->get_max(FieldUnit::POINT)); if(nVal < nKerning) m_xKerningMF->set_max(nKerning, FieldUnit::POINT); m_xKerningMF->set_value(nKerning, FieldUnit::POINT); @@ -2929,8 +2929,8 @@ bool SvxCharPositionPage::FillItemSet( SfxItemSet* rSet ) short nKerning = 0; MapUnit eUnit = rSet->GetPool()->GetMetric( nWhich ); - long nTmp = static_cast<long>(m_xKerningMF->get_value(FieldUnit::POINT)); - long nVal = OutputDevice::LogicToLogic(nTmp, MapUnit::MapPoint, eUnit); + tools::Long nTmp = static_cast<tools::Long>(m_xKerningMF->get_value(FieldUnit::POINT)); + tools::Long nVal = OutputDevice::LogicToLogic(nTmp, MapUnit::MapPoint, eUnit); nKerning = static_cast<short>(m_xKerningMF->denormalize( nVal )); SfxItemState eOldKernState = rOldSet.GetItemState( nWhich, false ); diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx index 583bedecf0df..707c954703e2 100644 --- a/cui/source/tabpages/grfpage.cxx +++ b/cui/source/tabpages/grfpage.cxx @@ -361,7 +361,7 @@ IMPL_LINK( SvxGrfCropPage, ZoomHdl, weld::MetricSpinButton&, rField, void ) if (&rField == m_xWidthZoomMF.get()) { - long nLRBorders = lcl_GetValue(*m_xLeftMF, eUnit) + tools::Long nLRBorders = lcl_GetValue(*m_xLeftMF, eUnit) +lcl_GetValue(*m_xRightMF, eUnit); m_xWidthMF->set_value( m_xWidthMF->normalize( ((aOrigSize.Width() - nLRBorders) * rField.get_value(FieldUnit::NONE))/100), @@ -369,7 +369,7 @@ IMPL_LINK( SvxGrfCropPage, ZoomHdl, weld::MetricSpinButton&, rField, void ) } else { - long nULBorders = lcl_GetValue(*m_xTopMF, eUnit) + tools::Long nULBorders = lcl_GetValue(*m_xTopMF, eUnit) +lcl_GetValue(*m_xBottomMF, eUnit); m_xHeightMF->set_value( m_xHeightMF->normalize( ((aOrigSize.Height() - nULBorders ) * rField.get_value(FieldUnit::NONE))/100) , @@ -393,7 +393,7 @@ IMPL_LINK( SvxGrfCropPage, SizeHdl, weld::MetricSpinButton&, rField, void ) if(&rField == m_xWidthMF.get()) { - long nWidth = aOrigSize.Width() - + tools::Long nWidth = aOrigSize.Width() - ( lcl_GetValue(*m_xLeftMF, eUnit) + lcl_GetValue(*m_xRightMF, eUnit) ); if(!nWidth) @@ -403,7 +403,7 @@ IMPL_LINK( SvxGrfCropPage, SizeHdl, weld::MetricSpinButton&, rField, void ) } else { - long nHeight = aOrigSize.Height() - + tools::Long nHeight = aOrigSize.Height() - ( lcl_GetValue(*m_xTopMF, eUnit) + lcl_GetValue(*m_xBottomMF, eUnit)); if(!nHeight) @@ -427,9 +427,9 @@ IMPL_LINK( SvxGrfCropPage, CropModifyHdl, weld::MetricSpinButton&, rField, void bool bZoom = m_xZoomConstRB->get_active(); if (&rField == m_xLeftMF.get() || &rField == m_xRightMF.get()) { - long nLeft = lcl_GetValue( *m_xLeftMF, eUnit ); - long nRight = lcl_GetValue( *m_xRightMF, eUnit ); - long nWidthZoom = static_cast<long>(m_xWidthZoomMF->get_value(FieldUnit::NONE)); + tools::Long nLeft = lcl_GetValue( *m_xLeftMF, eUnit ); + tools::Long nRight = lcl_GetValue( *m_xRightMF, eUnit ); + tools::Long nWidthZoom = static_cast<tools::Long>(m_xWidthZoomMF->get_value(FieldUnit::NONE)); if (bZoom && nWidthZoom != 0 && ( ( ( aOrigSize.Width() - (nLeft + nRight )) * nWidthZoom ) / 100 >= aPageSize.Width() ) ) { @@ -464,9 +464,9 @@ IMPL_LINK( SvxGrfCropPage, CropModifyHdl, weld::MetricSpinButton&, rField, void } else { - long nTop = lcl_GetValue( *m_xTopMF, eUnit ); - long nBottom = lcl_GetValue( *m_xBottomMF, eUnit ); - long nHeightZoom = static_cast<long>(m_xHeightZoomMF->get_value(FieldUnit::NONE)); + tools::Long nTop = lcl_GetValue( *m_xTopMF, eUnit ); + tools::Long nBottom = lcl_GetValue( *m_xBottomMF, eUnit ); + tools::Long nHeightZoom = static_cast<tools::Long>(m_xHeightZoomMF->get_value(FieldUnit::NONE)); if(bZoom && ( ( ( aOrigSize.Height() - (nTop + nBottom )) * nHeightZoom) / 100 >= aPageSize.Height())) { @@ -509,11 +509,11 @@ IMPL_LINK_NOARG(SvxGrfCropPage, OrigSizeHdl, weld::Button&, void) FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( pPool->GetWhich( SID_ATTR_GRAF_CROP ) ) ); - long nWidth = aOrigSize.Width() - + tools::Long nWidth = aOrigSize.Width() - lcl_GetValue( *m_xLeftMF, eUnit ) - lcl_GetValue( *m_xRightMF, eUnit ); m_xWidthMF->set_value( m_xWidthMF->normalize( nWidth ), eUnit ); - long nHeight = aOrigSize.Height() - + tools::Long nHeight = aOrigSize.Height() - lcl_GetValue( *m_xTopMF, eUnit ) - lcl_GetValue( *m_xBottomMF, eUnit ); m_xHeightMF->set_value( m_xHeightMF->normalize( nHeight ), eUnit ); @@ -532,14 +532,14 @@ void SvxGrfCropPage::CalcZoom() FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( pPool->GetWhich( SID_ATTR_GRAF_CROP ) ) ); - long nWidth = lcl_GetValue( *m_xWidthMF, eUnit ); - long nHeight = lcl_GetValue( *m_xHeightMF, eUnit ); - long nLRBorders = lcl_GetValue( *m_xLeftMF, eUnit ) + + tools::Long nWidth = lcl_GetValue( *m_xWidthMF, eUnit ); + tools::Long nHeight = lcl_GetValue( *m_xHeightMF, eUnit ); + tools::Long nLRBorders = lcl_GetValue( *m_xLeftMF, eUnit ) + lcl_GetValue( *m_xRightMF, eUnit ); - long nULBorders = lcl_GetValue( *m_xTopMF, eUnit ) + + tools::Long nULBorders = lcl_GetValue( *m_xTopMF, eUnit ) + lcl_GetValue( *m_xBottomMF, eUnit ); sal_uInt16 nZoom = 0; - long nDen; + tools::Long nDen; if( (nDen = aOrigSize.Width() - nLRBorders) > 0) nZoom = static_cast<sal_uInt16>((( nWidth * 1000 / nDen )+5)/10); m_xWidthZoomMF->set_value(nZoom, FieldUnit::NONE); @@ -560,21 +560,21 @@ void SvxGrfCropPage::CalcMinMaxBorder() DBG_ASSERT( pPool, "Where is the pool?" ); FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( pPool->GetWhich( SID_ATTR_GRAF_CROP ) ) ); - long nR = lcl_GetValue(*m_xRightMF, eUnit ); - long nMinWidth = (aOrigSize.Width() * 10) /11; - long nMin = nMinWidth - (nR >= 0 ? nR : 0); + tools::Long nR = lcl_GetValue(*m_xRightMF, eUnit ); + tools::Long nMinWidth = (aOrigSize.Width() * 10) /11; + tools::Long nMin = nMinWidth - (nR >= 0 ? nR : 0); m_xLeftMF->set_max( m_xLeftMF->normalize(nMin), eUnit ); - long nL = lcl_GetValue(*m_xLeftMF, eUnit ); + tools::Long nL = lcl_GetValue(*m_xLeftMF, eUnit ); nMin = nMinWidth - (nL >= 0 ? nL : 0); m_xRightMF->set_max( m_xRightMF->normalize(nMin), eUnit ); - long nUp = lcl_GetValue( *m_xTopMF, eUnit ); - long nMinHeight = (aOrigSize.Height() * 10) /11; + tools::Long nUp = lcl_GetValue( *m_xTopMF, eUnit ); + tools::Long nMinHeight = (aOrigSize.Height() * 10) /11; nMin = nMinHeight - (nUp >= 0 ? nUp : 0); m_xBottomMF->set_max( m_xBottomMF->normalize(nMin), eUnit ); - long nLow = lcl_GetValue(*m_xBottomMF, eUnit ); + tools::Long nLow = lcl_GetValue(*m_xBottomMF, eUnit ); nMin = nMinHeight - (nLow >= 0 ? nLow : 0); m_xTopMF->set_max( m_xTopMF->normalize(nMin), eUnit ); } @@ -597,21 +597,21 @@ void SvxGrfCropPage::GraphicHasChanged( bool bFound ) eUnit, m_xLeftMF->get_unit()); // if the margin is too big, it is set to 1/3 on both pages - long nR = lcl_GetValue( *m_xRightMF, eUnit ); - long nL = lcl_GetValue( *m_xLeftMF, eUnit ); + tools::Long nR = lcl_GetValue( *m_xRightMF, eUnit ); + tools::Long nL = lcl_GetValue( *m_xLeftMF, eUnit ); if((nL + nR) < - aOrigSize.Width()) { - long nVal = aOrigSize.Width() / -3; + tools::Long nVal = aOrigSize.Width() / -3; m_xRightMF->set_value( m_xRightMF->normalize( nVal ), eUnit ); m_xLeftMF->set_value( m_xLeftMF->normalize( nVal ), eUnit ); m_aExampleWN.SetLeft(nVal); m_aExampleWN.SetRight(nVal); } - long nUp = lcl_GetValue(*m_xTopMF, eUnit ); - long nLow = lcl_GetValue(*m_xBottomMF, eUnit ); + tools::Long nUp = lcl_GetValue(*m_xTopMF, eUnit ); + tools::Long nLow = lcl_GetValue(*m_xBottomMF, eUnit ); if((nUp + nLow) < - aOrigSize.Height()) { - long nVal = aOrigSize.Height() / -3; + tools::Long nVal = aOrigSize.Height() / -3; m_xTopMF->set_value( m_xTopMF->normalize( nVal ), eUnit ); m_xBottomMF->set_value( m_xBottomMF->normalize( nVal ), eUnit ); m_aExampleWN.SetTop(nVal); diff --git a/cui/source/tabpages/labdlg.cxx b/cui/source/tabpages/labdlg.cxx index 0ae754eeb2e7..c12ebc53601e 100644 --- a/cui/source/tabpages/labdlg.cxx +++ b/cui/source/tabpages/labdlg.cxx @@ -177,7 +177,7 @@ bool SvxCaptionTabPage::FillItemSet( SfxItemSet* _rOutAttrs) if( bEscRel ) { - long nVal = 0; + tools::Long nVal = 0; switch (m_xLB_POSITION->get_active()) { @@ -246,7 +246,7 @@ void SvxCaptionTabPage::Reset( const SfxItemSet* ) nEscAbs = m_xMF_BY->get_value(FieldUnit::NONE); nWhich = GetWhich( SDRATTR_CAPTIONESCREL ); - nEscRel = static_cast<long>(static_cast<const SdrCaptionEscRelItem&>( rOutAttrs.Get( nWhich ) ).GetValue()); + nEscRel = static_cast<tools::Long>(static_cast<const SdrCaptionEscRelItem&>( rOutAttrs.Get( nWhich ) ).GetValue()); //------- line length ---------- nWhich = GetWhich( SDRATTR_CAPTIONLINELEN ); diff --git a/cui/source/tabpages/measure.cxx b/cui/source/tabpages/measure.cxx index 60e473d68494..14c9fef1e09b 100644 --- a/cui/source/tabpages/measure.cxx +++ b/cui/source/tabpages/measure.cxx @@ -232,7 +232,7 @@ void SvxMeasurePage::Reset( const SfxItemSet* rAttrs ) // SdrMeasureUnitItem if( rAttrs->GetItemState( SDRATTR_MEASUREUNIT ) != SfxItemState::DONTCARE ) { - long nFieldUnit = static_cast<long>(rAttrs->Get( SDRATTR_MEASUREUNIT ).GetValue()); + tools::Long nFieldUnit = static_cast<tools::Long>(rAttrs->Get( SDRATTR_MEASUREUNIT ).GetValue()); for (sal_Int32 i = 0; i < m_xLbUnit->get_count(); ++i) { diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx index 9cefae5d85ae..960aab9c0101 100644 --- a/cui/source/tabpages/numfmt.cxx +++ b/cui/source/tabpages/numfmt.cxx @@ -147,7 +147,7 @@ void SvxNumberPreview::Paint(vcl::RenderContext& rRenderContext, const ::tools:: vcl::Font aDrawFont = rRenderContext.GetFont(); Size aSzWnd(GetOutputSizePixel()); OUString aTmpStr( aPrevStr ); - long nLeadSpace = (aSzWnd.Width() - rRenderContext.GetTextWidth(aTmpStr)) / 2; + tools::Long nLeadSpace = (aSzWnd.Width() - rRenderContext.GetTextWidth(aTmpStr)) / 2; aDrawFont.SetTransparent(true); aDrawFont.SetColor(aPrevCol); @@ -155,7 +155,7 @@ void SvxNumberPreview::Paint(vcl::RenderContext& rRenderContext, const ::tools:: if (mnPos != -1) { - long nCharWidth = rRenderContext.GetTextWidth(OUString(mnChar)); + tools::Long nCharWidth = rRenderContext.GetTextWidth(OUString(mnChar)); int nNumCharsToInsert = 0; if (nCharWidth > 0) @@ -168,7 +168,7 @@ void SvxNumberPreview::Paint(vcl::RenderContext& rRenderContext, const ::tools:: } } - long nX = 0; + tools::Long nX = 0; if (mnPos == -1 && nLeadSpace > 0) //tdf#122120 if it won't fit anyway, then left align it { nX = nLeadSpace; diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx index 4e9b322f4f87..35674698a6b7 100644 --- a/cui/source/tabpages/numpages.cxx +++ b/cui/source/tabpages/numpages.cxx @@ -956,18 +956,18 @@ IMPL_LINK_NOARG(SvxBitmapPickTabPage, ClickAddBrowseHdl_Impl, weld::Button&, voi GraphicConverter::Import( *pIn, aGraphic ); BitmapEx aBitmap = aGraphic.GetBitmapEx(); - long nPixelX = aBitmap.GetSizePixel().Width(); - long nPixelY = aBitmap.GetSizePixel().Height(); + tools::Long nPixelX = aBitmap.GetSizePixel().Width(); + tools::Long nPixelY = aBitmap.GetSizePixel().Height(); double ratio = nPixelY/static_cast<double>(nPixelX); if(nPixelX > 30) { nPixelX = 30; - nPixelY = static_cast<long>(nPixelX*ratio); + nPixelY = static_cast<tools::Long>(nPixelX*ratio); } if(nPixelY > 30) { nPixelY = 30; - nPixelX = static_cast<long>(nPixelY/ratio); + nPixelX = static_cast<tools::Long>(nPixelY/ratio); } aBitmap.Scale( Size( nPixelX, nPixelY ), BmpScaleFlag::Fast ); @@ -1986,8 +1986,8 @@ IMPL_LINK( SvxNumOptionsTabPage, SizeHdl_Impl, weld::MetricSpinButton&, rField, bool bWidth = &rField == m_xWidthMF.get(); bLastWidthModified = bWidth; bool bRatio = m_xRatioCB->get_active(); - long nWidthVal = static_cast<long>(m_xWidthMF->denormalize(m_xWidthMF->get_value(FieldUnit::MM_100TH))); - long nHeightVal = static_cast<long>(m_xHeightMF->denormalize(m_xHeightMF->get_value(FieldUnit::MM_100TH))); + tools::Long nWidthVal = static_cast<tools::Long>(m_xWidthMF->denormalize(m_xWidthMF->get_value(FieldUnit::MM_100TH))); + tools::Long nHeightVal = static_cast<tools::Long>(m_xHeightMF->denormalize(m_xHeightMF->get_value(FieldUnit::MM_100TH))); nWidthVal = OutputDevice::LogicToLogic( nWidthVal , MapUnit::Map100thMM, eCoreUnit ); nHeightVal = OutputDevice::LogicToLogic( nHeightVal, @@ -2013,11 +2013,11 @@ IMPL_LINK( SvxNumOptionsTabPage, SizeHdl_Impl, weld::MetricSpinButton&, rField, if(bWidth) { - long nDelta = nWidthVal - aInitSize[i].Width(); + tools::Long nDelta = nWidthVal - aInitSize[i].Width(); aSize.setWidth( nWidthVal ); if (bRatio) { - aSize.setHeight( aInitSize[i].Height() + static_cast<long>(static_cast<double>(nDelta) / fSizeRatio) ); + aSize.setHeight( aInitSize[i].Height() + static_cast<tools::Long>(static_cast<double>(nDelta) / fSizeRatio) ); m_xHeightMF->set_value(m_xHeightMF->normalize( OutputDevice::LogicToLogic( aSize.Height(), eCoreUnit, MapUnit::Map100thMM )), FieldUnit::MM_100TH); @@ -2025,11 +2025,11 @@ IMPL_LINK( SvxNumOptionsTabPage, SizeHdl_Impl, weld::MetricSpinButton&, rField, } else { - long nDelta = nHeightVal - aInitSize[i].Height(); + tools::Long nDelta = nHeightVal - aInitSize[i].Height(); aSize.setHeight( nHeightVal ); if (bRatio) { - aSize.setWidth( aInitSize[i].Width() + static_cast<long>(static_cast<double>(nDelta) * fSizeRatio) ); + aSize.setWidth( aInitSize[i].Width() + static_cast<tools::Long>(static_cast<double>(nDelta) * fSizeRatio) ); m_xWidthMF->set_value(m_xWidthMF->normalize( OutputDevice::LogicToLogic( aSize.Width(), eCoreUnit, MapUnit::Map100thMM )), FieldUnit::MM_100TH); @@ -2118,11 +2118,11 @@ void SvxNumOptionsTabPage::EditModifyHdl_Impl(const weld::Entry* pEdit) SetModified(); } -static long lcl_DrawGraphic(VirtualDevice* pVDev, const SvxNumberFormat &rFmt, long nXStart, - long nYMiddle, long nDivision) +static tools::Long lcl_DrawGraphic(VirtualDevice* pVDev, const SvxNumberFormat &rFmt, tools::Long nXStart, + tools::Long nYMiddle, tools::Long nDivision) { const SvxBrushItem* pBrushItem = rFmt.GetBrush(); - long nRet = 0; + tools::Long nRet = 0; if(pBrushItem) { const Graphic* pGrf = pBrushItem->GetGraphic(); @@ -2140,9 +2140,9 @@ static long lcl_DrawGraphic(VirtualDevice* pVDev, const SvxNumberFormat &rFmt, l } -static long lcl_DrawBullet(VirtualDevice* pVDev, - const SvxNumberFormat& rFmt, long nXStart, - long nYStart, const Size& rSize) +static tools::Long lcl_DrawBullet(VirtualDevice* pVDev, + const SvxNumberFormat& rFmt, tools::Long nXStart, + tools::Long nYStart, const Size& rSize) { vcl::Font aTmpFont(pVDev->GetFont()); @@ -2167,10 +2167,10 @@ static long lcl_DrawBullet(VirtualDevice* pVDev, pVDev->SetFont( aFont ); sal_UCS4 cChar = rFmt.GetBulletChar(); OUString aText(&cChar, 1); - long nY = nYStart; + tools::Long nY = nYStart; nY -= ((aTmpSize.Height() - rSize.Height())/ 2); pVDev->DrawText( Point(nXStart, nY), aText ); - long nRet = pVDev->GetTextWidth(aText); + tools::Long nRet = pVDev->GetTextWidth(aText); pVDev->SetFont(aTmpFont); return nRet; @@ -2205,21 +2205,21 @@ void SvxNumberingPreview::Paint(vcl::RenderContext& rRenderContext, const ::tool if (pActNum) { - long nWidthRelation = 30; // chapter dialog + tools::Long nWidthRelation = 30; // chapter dialog // height per level - long nXStep = aSize.Width() / (3 * pActNum->GetLevelCount()); + tools::Long nXStep = aSize.Width() / (3 * pActNum->GetLevelCount()); if (pActNum->GetLevelCount() < 10) nXStep /= 2; - long nYStart = 4; + tools::Long nYStart = 4; // the whole height mustn't be used for a single level - long nYStep = (aSize.Height() - 6)/ (pActNum->GetLevelCount() > 1 ? pActNum->GetLevelCount() : 5); + tools::Long nYStep = (aSize.Height() - 6)/ (pActNum->GetLevelCount() > 1 ? pActNum->GetLevelCount() : 5); aStdFont = OutputDevice::GetDefaultFont(DefaultFontType::UI_SANS, MsLangId::getSystemLanguage(), GetDefaultFontFlags::OnlyOne); aStdFont.SetColor(aTextColor); aStdFont.SetFillColor(aBackColor); - long nFontHeight = nYStep * 6 / 10; + tools::Long nFontHeight = nYStep * 6 / 10; if (bPosition) nFontHeight = nYStep * 15 / 10; aStdFont.SetFontSize(Size( 0, nFontHeight )); @@ -2229,7 +2229,7 @@ void SvxNumberingPreview::Paint(vcl::RenderContext& rRenderContext, const ::tool if (bPosition) { - long nLineHeight = nFontHeight * 8 / 7; + tools::Long nLineHeight = nFontHeight * 8 / 7; sal_uInt8 nStart = 0; while (!(nActLevel & (1<<nStart))) { @@ -2243,15 +2243,15 @@ void SvxNumberingPreview::Paint(vcl::RenderContext& rRenderContext, const ::tool const SvxNumberFormat &rFmt = pActNum->GetLevel(nLevel); aNum.GetLevelVal()[nLevel] = rFmt.GetStart(); - long nXStart( 0 ); + tools::Long nXStart( 0 ); short nTextOffset( 0 ); - long nNumberXPos( 0 ); + tools::Long nNumberXPos( 0 ); if (rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION) { nXStart = rFmt.GetAbsLSpace() / nWidthRelation; nTextOffset = rFmt.GetCharTextDistance() / nWidthRelation; nNumberXPos = nXStart; - long nFirstLineOffset = (-rFmt.GetFirstLineOffset()) / nWidthRelation; + tools::Long nFirstLineOffset = (-rFmt.GetFirstLineOffset()) / nWidthRelation; if (nFirstLineOffset <= nNumberXPos) nNumberXPos = nNumberXPos - nFirstLineOffset; @@ -2263,7 +2263,7 @@ void SvxNumberingPreview::Paint(vcl::RenderContext& rRenderContext, const ::tool } else if (rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT) { - const long nTmpNumberXPos((rFmt.GetIndentAt() + rFmt.GetFirstLineIndent() ) / nWidthRelation); + const tools::Long nTmpNumberXPos((rFmt.GetIndentAt() + rFmt.GetFirstLineIndent() ) / nWidthRelation); if (nTmpNumberXPos < 0) { nNumberXPos = 0; @@ -2274,10 +2274,10 @@ void SvxNumberingPreview::Paint(vcl::RenderContext& rRenderContext, const ::tool } } - long nBulletWidth = 0; + tools::Long nBulletWidth = 0; if (SVX_NUM_BITMAP == (rFmt.GetNumberingType() &(~LINK_TOKEN))) { - long nYMiddle = nYStart + ( nFontHeight / 2 ); + tools::Long nYMiddle = nYStart + ( nFontHeight / 2 ); nBulletWidth = rFmt.IsShowSymbol() ? lcl_DrawGraphic(pVDev.get(), rFmt, nNumberXPos, nYMiddle, nWidthRelation) : 0; } else if (SVX_NUM_CHAR_SPECIAL == rFmt.GetNumberingType()) @@ -2314,7 +2314,7 @@ void SvxNumberingPreview::Paint(vcl::RenderContext& rRenderContext, const ::tool nBulletWidth = nBulletWidth + pVDev->GetTextWidth(aText); } - long nTextXPos( 0 ); + tools::Long nTextXPos( 0 ); if (rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION) { nTextXPos = nXStart; @@ -2360,10 +2360,10 @@ void SvxNumberingPreview::Paint(vcl::RenderContext& rRenderContext, const ::tool else { //#i5153# painting gray or black rectangles as 'normal' numbering text - long nWidth = pVDev->GetTextWidth("Preview"); - long nTextHeight = pVDev->GetTextHeight(); - long nRectHeight = nTextHeight * 2 / 3; - long nTopOffset = nTextHeight - nRectHeight; + tools::Long nWidth = pVDev->GetTextWidth("Preview"); + tools::Long nTextHeight = pVDev->GetTextHeight(); + tools::Long nRectHeight = nTextHeight * 2 / 3; + tools::Long nTopOffset = nTextHeight - nRectHeight; Color aBlackColor(COL_BLACK); if (aBlackColor == aBackColor) aBlackColor.Invert(); @@ -2372,7 +2372,7 @@ void SvxNumberingPreview::Paint(vcl::RenderContext& rRenderContext, const ::tool { const SvxNumberFormat &rFmt = pActNum->GetLevel(nLevel); aNum.GetLevelVal()[ nLevel ] = rFmt.GetStart(); - long nXStart( 0 ); + tools::Long nXStart( 0 ); pVDev->SetFillColor( aBackColor ); if (rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION) @@ -2381,7 +2381,7 @@ void SvxNumberingPreview::Paint(vcl::RenderContext& rRenderContext, const ::tool } else if (rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT) { - const long nTmpXStart((rFmt.GetIndentAt() + rFmt.GetFirstLineIndent() ) / nWidthRelation); + const tools::Long nTmpXStart((rFmt.GetIndentAt() + rFmt.GetFirstLineIndent() ) / nWidthRelation); if (nTmpXStart < 0) { nXStart = 0; @@ -2393,12 +2393,12 @@ void SvxNumberingPreview::Paint(vcl::RenderContext& rRenderContext, const ::tool } nXStart /= 2; nXStart += 2; - long nTextOffset = 2 * nXStep; + tools::Long nTextOffset = 2 * nXStep; if (SVX_NUM_BITMAP == (rFmt.GetNumberingType()&(~LINK_TOKEN))) { if (rFmt.IsShowSymbol()) { - long nYMiddle = nYStart + ( nFontHeight / 2 ); + tools::Long nYMiddle = nYStart + ( nFontHeight / 2 ); nTextOffset = lcl_DrawGraphic(pVDev.get(), rFmt, nXStart, nYMiddle, nWidthRelation); nTextOffset = nTextOffset + nXStep; } @@ -2436,7 +2436,7 @@ void SvxNumberingPreview::Paint(vcl::RenderContext& rRenderContext, const ::tool if (pActNum->IsContinuousNumbering()) aNum.GetLevelVal()[nLevel] = nPreNum; OUString aText(pActNum->MakeNumString(aNum)); - long nY = nYStart; + tools::Long nY = nYStart; nY -= (pVDev->GetTextHeight() - nTextHeight - pVDev->GetFontMetric().GetDescent()); pVDev->DrawText(Point(nXStart, nY), aText); nTextOffset = pVDev->GetTextWidth(aText); @@ -2575,7 +2575,7 @@ void SvxNumPositionTabPage::InitControls() const SvxNumberFormat* aNumFmtArr[SVX_MAX_NUM]; sal_uInt16 nMask = 1; sal_uInt16 nLvl = SAL_MAX_UINT16; - long nFirstBorderTextRelative = -1; + tools::Long nFirstBorderTextRelative = -1; for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++) { aNumFmtArr[i] = &pActNum->GetLevel(i); @@ -2633,16 +2633,16 @@ void SvxNumPositionTabPage::InitControls() if(bSameDistBorderNum) { - long nDistBorderNum; + tools::Long nDistBorderNum; if(bRelative) { - nDistBorderNum = static_cast<long>(aNumFmtArr[nLvl]->GetAbsLSpace())+ aNumFmtArr[nLvl]->GetFirstLineOffset(); + nDistBorderNum = static_cast<tools::Long>(aNumFmtArr[nLvl]->GetAbsLSpace())+ aNumFmtArr[nLvl]->GetFirstLineOffset(); if(nLvl) - nDistBorderNum -= static_cast<long>(aNumFmtArr[nLvl - 1]->GetAbsLSpace())+ aNumFmtArr[nLvl - 1]->GetFirstLineOffset(); + nDistBorderNum -= static_cast<tools::Long>(aNumFmtArr[nLvl - 1]->GetAbsLSpace())+ aNumFmtArr[nLvl - 1]->GetFirstLineOffset(); } else { - nDistBorderNum = static_cast<long>(aNumFmtArr[nLvl]->GetAbsLSpace())+ aNumFmtArr[nLvl]->GetFirstLineOffset(); + nDistBorderNum = static_cast<tools::Long>(aNumFmtArr[nLvl]->GetAbsLSpace())+ aNumFmtArr[nLvl]->GetFirstLineOffset(); } SetMetricValue(*m_xDistBorderMF, nDistBorderNum, eCoreUnit); } @@ -3042,7 +3042,7 @@ IMPL_LINK(SvxNumPositionTabPage, DistanceHdl_Impl, weld::MetricSpinButton&, rFld { if(bInInintControl) return; - long nValue = GetCoreValue(rFld, eCoreUnit); + tools::Long nValue = GetCoreValue(rFld, eCoreUnit); sal_uInt16 nMask = 1; for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++) { @@ -3061,7 +3061,7 @@ IMPL_LINK(SvxNumPositionTabPage, DistanceHdl_Impl, weld::MetricSpinButton&, rFld } else { - long nTmp = pActNum->GetLevel( i - 1 ).GetAbsLSpace() + + tools::Long nTmp = pActNum->GetLevel( i - 1 ).GetAbsLSpace() + pActNum->GetLevel( i - 1 ).GetFirstLineOffset() - pActNum->GetLevel( i ).GetFirstLineOffset(); @@ -3080,7 +3080,7 @@ IMPL_LINK(SvxNumPositionTabPage, DistanceHdl_Impl, weld::MetricSpinButton&, rFld else if (&rFld == m_xIndentMF.get()) { // together with the FirstLineOffset the AbsLSpace must be changed, too - long nDiff = nValue + aNumFmt.GetFirstLineOffset(); + tools::Long nDiff = nValue + aNumFmt.GetFirstLineOffset(); auto const nAbsLSpace = aNumFmt.GetAbsLSpace(); aNumFmt.SetAbsLSpace(nAbsLSpace + nDiff); aNumFmt.SetFirstLineOffset( -nValue ); @@ -3103,7 +3103,7 @@ IMPL_LINK(SvxNumPositionTabPage, RelativeHdl_Impl, weld::ToggleButton&, rBox, vo bool bOn = rBox.get_active(); bool bSingleSelection = m_xLevelLB->count_selected_rows() == 1 && SAL_MAX_UINT16 != nActNumLvl; bool bSetValue = false; - long nValue = 0; + tools::Long nValue = 0; if(bOn || bSingleSelection) { sal_uInt16 nMask = 1; @@ -3203,7 +3203,7 @@ IMPL_LINK_NOARG(SvxNumPositionTabPage, LabelFollowedByHdl_Impl, weld::ComboBox&, IMPL_LINK(SvxNumPositionTabPage, ListtabPosHdl_Impl, weld::MetricSpinButton&, rFld, void) { // determine value to be set at the chosen list levels - const long nValue = GetCoreValue(rFld, eCoreUnit); + const tools::Long nValue = GetCoreValue(rFld, eCoreUnit); // set value at the chosen list levels sal_uInt16 nMask = 1; @@ -3224,7 +3224,7 @@ IMPL_LINK(SvxNumPositionTabPage, ListtabPosHdl_Impl, weld::MetricSpinButton&, rF IMPL_LINK(SvxNumPositionTabPage, AlignAtHdl_Impl, weld::MetricSpinButton&, rFld, void) { // determine value to be set at the chosen list levels - const long nValue = GetCoreValue(rFld, eCoreUnit); + const tools::Long nValue = GetCoreValue(rFld, eCoreUnit); // set value at the chosen list levels sal_uInt16 nMask = 1; @@ -3233,7 +3233,7 @@ IMPL_LINK(SvxNumPositionTabPage, AlignAtHdl_Impl, weld::MetricSpinButton&, rFld, if ( nActNumLvl & nMask ) { SvxNumberFormat aNumFmt( pActNum->GetLevel(i) ); - const long nFirstLineIndent = nValue - aNumFmt.GetIndentAt(); + const tools::Long nFirstLineIndent = nValue - aNumFmt.GetIndentAt(); aNumFmt.SetFirstLineIndent( nFirstLineIndent ); pActNum->SetLevel( i, aNumFmt ); } @@ -3246,7 +3246,7 @@ IMPL_LINK(SvxNumPositionTabPage, AlignAtHdl_Impl, weld::MetricSpinButton&, rFld, IMPL_LINK(SvxNumPositionTabPage, IndentAtHdl_Impl, weld::MetricSpinButton&, rFld, void) { // determine value to be set at the chosen list levels - const long nValue = GetCoreValue(rFld, eCoreUnit); + const tools::Long nValue = GetCoreValue(rFld, eCoreUnit); // set value at the chosen list levels sal_uInt16 nMask = 1; @@ -3255,10 +3255,10 @@ IMPL_LINK(SvxNumPositionTabPage, IndentAtHdl_Impl, weld::MetricSpinButton&, rFld if ( nActNumLvl & nMask ) { SvxNumberFormat aNumFmt( pActNum->GetLevel(i) ); - const long nAlignedAt = aNumFmt.GetIndentAt() + + const tools::Long nAlignedAt = aNumFmt.GetIndentAt() + aNumFmt.GetFirstLineIndent(); aNumFmt.SetIndentAt( nValue ); - const long nNewFirstLineIndent = nAlignedAt - nValue; + const tools::Long nNewFirstLineIndent = nAlignedAt - nValue; aNumFmt.SetFirstLineIndent( nNewFirstLineIndent ); pActNum->SetLevel( i, aNumFmt ); } diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx index c0606c2f65be..e478fbc5f492 100644 --- a/cui/source/tabpages/page.cxx +++ b/cui/source/tabpages/page.cxx @@ -56,7 +56,7 @@ // static ---------------------------------------------------------------- // #i19922# - tdf#126051 see svx/source/dialog/hdft.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 const sal_uInt16 SvxPageDescPage::pRanges[] = { @@ -107,7 +107,7 @@ static Size GetMinBorderSpace_Impl( const SvxShadowItem& rShadow, const SvxBoxIt } -static long ConvertLong_Impl( const long nIn, MapUnit eUnit ) +static tools::Long ConvertLong_Impl( const tools::Long nIn, MapUnit eUnit ) { return OutputDevice::LogicToLogic( nIn, eUnit, MapUnit::MapTwip ); } @@ -117,8 +117,8 @@ static bool IsEqualSize_Impl( const SvxSizeItem* pSize, const Size& rSize ) if ( pSize ) { Size aSize = pSize->GetSize(); - long nDiffW = std::abs( rSize.Width () - aSize.Width () ); - long nDiffH = std::abs( rSize.Height() - aSize.Height() ); + tools::Long nDiffW = std::abs( rSize.Width () - aSize.Width () ); + tools::Long nDiffH = std::abs( rSize.Height() - aSize.Height() ); return ( nDiffW < 10 && nDiffH < 10 ); } else @@ -344,10 +344,10 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet ) const SvxULSpaceItem& rULSpace = static_cast<const SvxULSpaceItem&>(*pItem); SetMetricValue( *m_xTopMarginEdit, rULSpace.GetUpper(), eUnit ); m_aBspWin.SetTop( - static_cast<sal_uInt16>(ConvertLong_Impl( static_cast<long>(rULSpace.GetUpper()), eUnit )) ); + static_cast<sal_uInt16>(ConvertLong_Impl( static_cast<tools::Long>(rULSpace.GetUpper()), eUnit )) ); SetMetricValue( *m_xBottomMarginEdit, rULSpace.GetLower(), eUnit ); m_aBspWin.SetBottom( - static_cast<sal_uInt16>(ConvertLong_Impl( static_cast<long>(rULSpace.GetLower()), eUnit )) ); + static_cast<sal_uInt16>(ConvertLong_Impl( static_cast<tools::Long>(rULSpace.GetLower()), eUnit )) ); } // general page data @@ -855,7 +855,7 @@ IMPL_LINK_NOARG(SvxPageDescPage, PaperSizeSelect_Impl, weld::ComboBox&, void) return; // Draw: if paper format the margin shall be 1 cm - long nTmp = 0; + tools::Long nTmp = 0; bool bScreen = (( PAPER_SCREEN_4_3 == ePaper )||( PAPER_SCREEN_16_9 == ePaper)||( PAPER_SCREEN_16_10 == ePaper)); if ( !bScreen ) @@ -908,8 +908,8 @@ IMPL_LINK(SvxPageDescPage, SwapOrientation_Impl, weld::Button&, rBtn, void) bLandscape = m_xLandscapeBtn->get_active(); - const long lWidth = GetCoreValue( *m_xPaperWidthEdit, MapUnit::Map100thMM ); - const long lHeight = GetCoreValue( *m_xPaperHeightEdit, MapUnit::Map100thMM ); + const tools::Long lWidth = GetCoreValue( *m_xPaperWidthEdit, MapUnit::Map100thMM ); + const tools::Long lHeight = GetCoreValue( *m_xPaperHeightEdit, MapUnit::Map100thMM ); // swap width and height SetMetricValue(*m_xPaperWidthEdit, lHeight, MapUnit::Map100thMM); @@ -956,10 +956,10 @@ void SvxPageDescPage::SwapFirstValues_Impl( bool bSet ) sal_Int64 nSetB = m_xBottomMarginEdit->denormalize( m_xBottomMarginEdit->get_value( FieldUnit::TWIP ) ); - long nNewL = aPrintOffset.X(); - long nNewR = aPaperSize.Width() - aPrintSize.Width() - aPrintOffset.X(); - long nNewT = aPrintOffset.Y(); - long nNewB = aPaperSize.Height() - aPrintSize.Height() - aPrintOffset.Y(); + tools::Long nNewL = aPrintOffset.X(); + tools::Long nNewR = aPaperSize.Width() - aPrintSize.Width() - aPrintOffset.X(); + tools::Long nNewT = aPrintOffset.Y(); + tools::Long nNewB = aPaperSize.Height() - aPrintSize.Height() - aPrintOffset.Y(); nFirstLeftMargin = m_xLeftMarginEdit->convert_value_from(m_xLeftMarginEdit->normalize(nNewL), FieldUnit::TWIP); nFirstRightMargin = m_xRightMarginEdit->convert_value_from(m_xRightMarginEdit->normalize(nNewR), FieldUnit::TWIP); @@ -1139,7 +1139,7 @@ void SvxPageDescPage::InitHeadFoot_Impl( const SfxItemSet& rSet ) rHeaderSet.Get( GetWhich( SID_ATTR_PAGE_SIZE ) )); const SvxULSpaceItem& rUL = static_cast<const SvxULSpaceItem&>( rHeaderSet.Get( GetWhich( SID_ATTR_ULSPACE ) )); - long nDist = rUL.GetLower(); + tools::Long nDist = rUL.GetLower(); m_aBspWin.SetHdHeight( rSize.GetSize().Height() - nDist ); m_aBspWin.SetHdDist( nDist ); const SvxLRSpaceItem& rLR = static_cast<const SvxLRSpaceItem&>( @@ -1194,7 +1194,7 @@ void SvxPageDescPage::InitHeadFoot_Impl( const SfxItemSet& rSet ) rFooterSet.Get( GetWhich( SID_ATTR_PAGE_SIZE ) )); const SvxULSpaceItem& rUL = static_cast<const SvxULSpaceItem&>( rFooterSet.Get( GetWhich( SID_ATTR_ULSPACE ) )); - long nDist = rUL.GetUpper(); + tools::Long nDist = rUL.GetUpper(); m_aBspWin.SetFtHeight( rSize.GetSize().Height() - nDist ); m_aBspWin.SetFtDist( nDist ); const SvxLRSpaceItem& rLR = static_cast<const SvxLRSpaceItem&>( @@ -1298,20 +1298,20 @@ DeactivateRC SvxPageDescPage::DeactivatePage( SfxItemSet* _pSet ) void SvxPageDescPage::RangeHdl_Impl() { // example window - 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 nHFLeft = std::max(m_aBspWin.GetHdLeft(), m_aBspWin.GetFtLeft()); - long nHFRight = std::max(m_aBspWin.GetHdRight(), m_aBspWin.GetFtRight()); + tools::Long nHFLeft = std::max(m_aBspWin.GetHdLeft(), m_aBspWin.GetFtLeft()); + tools::Long nHFRight = std::max(m_aBspWin.GetHdRight(), m_aBspWin.GetFtRight()); // current values for page margins - long nBT = static_cast<long>(m_xTopMarginEdit->denormalize(m_xTopMarginEdit->get_value(FieldUnit::TWIP))); - long nBB = static_cast<long>(m_xBottomMarginEdit->denormalize(m_xBottomMarginEdit->get_value(FieldUnit::TWIP))); - long nBL = static_cast<long>(m_xLeftMarginEdit->denormalize(m_xLeftMarginEdit->get_value(FieldUnit::TWIP))); - long nBR = static_cast<long>(m_xRightMarginEdit->denormalize(m_xRightMarginEdit->get_value(FieldUnit::TWIP))); + tools::Long nBT = static_cast<tools::Long>(m_xTopMarginEdit->denormalize(m_xTopMarginEdit->get_value(FieldUnit::TWIP))); + tools::Long nBB = static_cast<tools::Long>(m_xBottomMarginEdit->denormalize(m_xBottomMarginEdit->get_value(FieldUnit::TWIP))); + tools::Long nBL = static_cast<tools::Long>(m_xLeftMarginEdit->denormalize(m_xLeftMarginEdit->get_value(FieldUnit::TWIP))); + tools::Long nBR = static_cast<tools::Long>(m_xRightMarginEdit->denormalize(m_xRightMarginEdit->get_value(FieldUnit::TWIP))); // calculate width of page border const SfxItemSet* _pSet = &GetItemSet(); @@ -1330,18 +1330,18 @@ void SvxPageDescPage::RangeHdl_Impl() // limits paper // maximum is 54 cm - long nMin = nHHeight + nHDist + nFDist + nFHeight + nBT + nBB + + tools::Long nMin = nHHeight + nHDist + nFDist + nFHeight + nBT + nBB + MINBODY + aBorder.Height(); m_xPaperHeightEdit->set_min(m_xPaperHeightEdit->normalize(nMin), FieldUnit::TWIP); nMin = MINBODY + nBL + nBR + aBorder.Width(); m_xPaperWidthEdit->set_min(m_xPaperWidthEdit->normalize(nMin), FieldUnit::TWIP); - long nH = static_cast<long>(m_xPaperHeightEdit->denormalize(m_xPaperHeightEdit->get_value(FieldUnit::TWIP))); - long nW = static_cast<long>(m_xPaperWidthEdit->denormalize(m_xPaperWidthEdit->get_value(FieldUnit::TWIP))); + tools::Long nH = static_cast<tools::Long>(m_xPaperHeightEdit->denormalize(m_xPaperHeightEdit->get_value(FieldUnit::TWIP))); + tools::Long nW = static_cast<tools::Long>(m_xPaperWidthEdit->denormalize(m_xPaperWidthEdit->get_value(FieldUnit::TWIP))); // Top - long nMax = nH - nBB - aBorder.Height() - MINBODY - + tools::Long nMax = nH - nBB - aBorder.Height() - MINBODY - nFDist - nFHeight - nHDist - nHHeight; m_xTopMarginEdit->set_max(m_xTopMarginEdit->normalize(nMax), FieldUnit::TWIP); @@ -1364,24 +1364,24 @@ void SvxPageDescPage::RangeHdl_Impl() void SvxPageDescPage::CalcMargin_Impl() { // current values for page margins - long nBT = GetCoreValue( *m_xTopMarginEdit, MapUnit::MapTwip ); - long nBB = GetCoreValue( *m_xBottomMarginEdit, MapUnit::MapTwip ); + tools::Long nBT = GetCoreValue( *m_xTopMarginEdit, MapUnit::MapTwip ); + tools::Long nBB = GetCoreValue( *m_xBottomMarginEdit, MapUnit::MapTwip ); - long nBL = GetCoreValue( *m_xLeftMarginEdit, MapUnit::MapTwip ); - long nBR = GetCoreValue( *m_xRightMarginEdit, MapUnit::MapTwip ); + tools::Long nBL = GetCoreValue( *m_xLeftMarginEdit, MapUnit::MapTwip ); + tools::Long nBR = GetCoreValue( *m_xRightMarginEdit, MapUnit::MapTwip ); - long nH = GetCoreValue( *m_xPaperHeightEdit, MapUnit::MapTwip ); - long nW = GetCoreValue( *m_xPaperWidthEdit, MapUnit::MapTwip ); + tools::Long nH = GetCoreValue( *m_xPaperHeightEdit, MapUnit::MapTwip ); + tools::Long nW = GetCoreValue( *m_xPaperWidthEdit, MapUnit::MapTwip ); - long nWidth = nBL + nBR + MINBODY; - long nHeight = nBT + nBB + MINBODY; + tools::Long nWidth = nBL + nBR + MINBODY; + tools::Long nHeight = nBT + nBB + MINBODY; if ( nWidth <= nW && nHeight <= nH ) return; if ( nWidth > nW ) { - long nTmp = nBL <= nBR ? nBR : nBL; + tools::Long nTmp = nBL <= nBR ? nBR : nBL; nTmp -= nWidth - nW; if ( nBL <= nBR ) @@ -1392,7 +1392,7 @@ void SvxPageDescPage::CalcMargin_Impl() if ( nHeight > nH ) { - long nTmp = nBT <= nBB ? nBB : nBT; + tools::Long nTmp = nBT <= nBB ? nBB : nBT; nTmp -= nHeight - nH; if ( nBT <= nBB ) @@ -1457,11 +1457,11 @@ IMPL_LINK_NOARG(SvxPageDescPage, FrameDirectionModify_Impl, weld::ComboBox&, voi } bool SvxPageDescPage::IsPrinterRangeOverflow( - weld::MetricSpinButton& rField, long nFirstMargin, long nLastMargin, MarginPosition nPos ) + weld::MetricSpinButton& rField, tools::Long nFirstMargin, tools::Long nLastMargin, MarginPosition nPos ) { bool bRet = false; bool bCheck = ( ( m_nPos & nPos ) == 0 ); - long nValue = rField.get_value(FieldUnit::NONE); + tools::Long nValue = rField.get_value(FieldUnit::NONE); if ( bCheck && ( nValue < nFirstMargin || nValue > nLastMargin ) && rField.get_value_changed_from_saved() ) diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx index 5f6ae38d3ad9..4788969bcf4e 100644 --- a/cui/source/tabpages/paragrph.cxx +++ b/cui/source/tabpages/paragrph.cxx @@ -100,10 +100,10 @@ enum LineSpaceList } -static void SetLineSpace_Impl( SvxLineSpacingItem&, int, long lValue = 0 ); +static void SetLineSpace_Impl( SvxLineSpacingItem&, int, tools::Long lValue = 0 ); void SetLineSpace_Impl( SvxLineSpacingItem& rLineSpace, - int eSpace, long lValue ) + int eSpace, tools::Long lValue ) { switch ( eSpace ) { @@ -247,7 +247,7 @@ bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet* rOutSet ) case LLINESPACE_PROP: SetLineSpace_Impl( aSpacing, nPos, - static_cast<long>(m_xLineDistAtPercentBox->denormalize( + static_cast<tools::Long>(m_xLineDistAtPercentBox->denormalize( m_xLineDistAtPercentBox->get_value(FieldUnit::NONE) )) ); break; @@ -895,8 +895,8 @@ void SvxStdParagraphTabPage::Init_Impl() void SvxStdParagraphTabPage::UpdateExample_Impl() { m_aExampleWin.SetFirstLineOffset( static_cast<short>(m_xFLineIndent->denormalize( m_xFLineIndent->get_value( FieldUnit::TWIP ) )) ); - m_aExampleWin.SetLeftMargin( static_cast<long>(m_xLeftIndent->denormalize( m_xLeftIndent->get_value( FieldUnit::TWIP ) ) ) ); - m_aExampleWin.SetRightMargin( static_cast<long>(m_xRightIndent->denormalize( m_xRightIndent->get_value( FieldUnit::TWIP ) ) ) ); + m_aExampleWin.SetLeftMargin( static_cast<tools::Long>(m_xLeftIndent->denormalize( m_xLeftIndent->get_value( FieldUnit::TWIP ) ) ) ); + m_aExampleWin.SetRightMargin( static_cast<tools::Long>(m_xRightIndent->denormalize( m_xRightIndent->get_value( FieldUnit::TWIP ) ) ) ); m_aExampleWin.SetUpper( static_cast<sal_uInt16>(m_xTopDist->denormalize( m_xTopDist->get_value( FieldUnit::TWIP ) )) ); m_aExampleWin.SetLower( static_cast<sal_uInt16>(m_xBottomDist->denormalize( m_xBottomDist->get_value( FieldUnit::TWIP ) )) ); @@ -941,7 +941,7 @@ void SvxStdParagraphTabPage::EnableAutoFirstLine() m_xAutoCB->show(); } -void SvxStdParagraphTabPage::EnableAbsLineDist(long nMinTwip) +void SvxStdParagraphTabPage::EnableAbsLineDist(tools::Long nMinTwip) { m_xLineDist->append_text(sAbsDist); nMinFixDist = nMinTwip; diff --git a/cui/source/tabpages/swpossizetabpage.cxx b/cui/source/tabpages/swpossizetabpage.cxx index 803b56081007..b0366bf48053 100644 --- a/cui/source/tabpages/swpossizetabpage.cxx +++ b/cui/source/tabpages/swpossizetabpage.cxx @@ -1463,8 +1463,8 @@ void SvxSwPosSizeTabPage::InitPos(RndStdIds nAnchor, sal_uInt16 nHRel, sal_uInt16 nV, sal_uInt16 nVRel, - long nX, - long nY) + tools::Long nX, + tools::Long nY) { int nPos = m_xVertLB->get_active(); if (nPos != -1 && m_pVMap) diff --git a/cui/source/tabpages/tabstpge.cxx b/cui/source/tabpages/tabstpge.cxx index 939a51e41256..202576bff30d 100644 --- a/cui/source/tabpages/tabstpge.cxx +++ b/cui/source/tabpages/tabstpge.cxx @@ -39,7 +39,7 @@ const sal_uInt16 SvxTabulatorTabPage::pRanges[] = 0 }; -static void FillUpWithDefTabs_Impl( long nDefDist, SvxTabStopItem& rTabs ) +static void FillUpWithDefTabs_Impl( tools::Long nDefDist, SvxTabStopItem& rTabs ) { if( rTabs.Count() ) return; @@ -250,7 +250,7 @@ void SvxTabulatorTabPage::Reset(const SfxItemSet* rSet) pItem = GetItem(*rSet, SID_ATTR_TABSTOP_DEFAULTS); if (pItem) - nDefDist = OutputDevice::LogicToLogic(long(static_cast<const SfxUInt16Item*>(pItem)->GetValue()), eUnit, MapUnit::Map100thMM); + nDefDist = OutputDevice::LogicToLogic(tools::Long(static_cast<const SfxUInt16Item*>(pItem)->GetValue()), eUnit, MapUnit::Map100thMM); // Tab pos currently selected sal_uInt16 nTabPos = 0; @@ -316,7 +316,7 @@ void SvxTabulatorTabPage::InitTabPos_Impl( sal_uInt16 nTabPos ) { m_xTabBox->clear(); - long nOffset = 0; + tools::Long nOffset = 0; const SfxPoolItem* pItem = nullptr; if (GetItemSet().GetItemState(SID_ATTR_TABSTOP_OFFSET, true, &pItem) == SfxItemState::SET) { @@ -430,7 +430,7 @@ void SvxTabulatorTabPage::NewHdl_Impl(const weld::Button* pBtn) if (nVal == 0 && pBtn == nullptr) return; - long nOffset = 0; + tools::Long nOffset = 0; const SfxPoolItem* pItem = nullptr; if ( GetItemSet().GetItemState( SID_ATTR_TABSTOP_OFFSET, true, &pItem ) == @@ -440,7 +440,7 @@ void SvxTabulatorTabPage::NewHdl_Impl(const weld::Button* pBtn) MapUnit eUnit = GetItemSet().GetPool()->GetMetric( GetWhich( SID_ATTR_TABSTOP ) ); nOffset = OutputDevice::LogicToLogic( nOffset, eUnit, MapUnit::Map100thMM ); } - const long nReal = nVal - nOffset; + const tools::Long nReal = nVal - nOffset; sal_Int32 nSize = m_xTabBox->get_count(); sal_Int32 i; diff --git a/cui/source/tabpages/textanim.cxx b/cui/source/tabpages/textanim.cxx index ab5dc095bfff..e5239dede67e 100644 --- a/cui/source/tabpages/textanim.cxx +++ b/cui/source/tabpages/textanim.cxx @@ -186,7 +186,7 @@ void SvxTextAnimationPage::Reset( const SfxItemSet* rAttrs ) if( !pItem ) pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANICOUNT ); - long nValue = static_cast<long>(static_cast<const SdrTextAniCountItem*>(pItem)->GetValue()); + tools::Long nValue = static_cast<tools::Long>(static_cast<const SdrTextAniCountItem*>(pItem)->GetValue()); m_xNumFldCount->set_value(nValue); if (nValue == 0) { @@ -211,7 +211,7 @@ void SvxTextAnimationPage::Reset( const SfxItemSet* rAttrs ) if( !pItem ) pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANIDELAY ); - nValue = static_cast<long>(static_cast<const SdrTextAniDelayItem*>(pItem)->GetValue()); + nValue = static_cast<tools::Long>(static_cast<const SdrTextAniDelayItem*>(pItem)->GetValue()); m_xMtrFldDelay->set_value(nValue, FieldUnit::NONE); if (nValue == 0) { @@ -228,7 +228,7 @@ void SvxTextAnimationPage::Reset( const SfxItemSet* rAttrs ) if( !pItem ) pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANIAMOUNT ); - nValue = static_cast<long>(static_cast<const SdrTextAniAmountItem*>(pItem)->GetValue()); + nValue = static_cast<tools::Long>(static_cast<const SdrTextAniAmountItem*>(pItem)->GetValue()); if (nValue <= 0) { m_xTsbPixel->set_state(TRISTATE_TRUE); diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx index cff0dab685b0..ebb4426f6ce2 100644 --- a/cui/source/tabpages/tpbitmap.cxx +++ b/cui/source/tabpages/tpbitmap.cxx @@ -308,8 +308,8 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* rAttrs ) else m_xBitmapStyleLB->set_active(static_cast<sal_Int32>(CUSTOM)); - long nWidth = 0; - long nHeight = 0; + tools::Long nWidth = 0; + tools::Long nHeight = 0; if(rAttrs->GetItemState(XATTR_FILLBMP_SIZELOG) != SfxItemState::DONTCARE) { @@ -432,8 +432,8 @@ void SvxBitmapTabPage::CalculateBitmapPresetSize() if(rBitmapSize.IsEmpty()) return; - long nObjectWidth = static_cast<long>(m_fObjectWidth); - long nObjectHeight = static_cast<long>(m_fObjectHeight); + tools::Long nObjectWidth = static_cast<tools::Long>(m_fObjectWidth); + tools::Long nObjectHeight = static_cast<tools::Long>(m_fObjectHeight); if(std::abs(rBitmapSize.Width() - nObjectWidth) < std::abs(rBitmapSize.Height() - nObjectHeight)) { @@ -717,7 +717,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl, weld::Button&, void) SvxOpenGraphicDialog aDlg(CuiResId(RID_SVXSTR_ADD_IMAGE), pDialogFrameWeld); aDlg.EnableLink(false); - long nCount = m_pBitmapList->Count(); + tools::Long nCount = m_pBitmapList->Count(); if( aDlg.Execute() ) return; @@ -746,7 +746,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl, weld::Button&, void) bool bDifferent = true; - for( long i = 0; i < nCount && bDifferent; i++ ) + for( tools::Long i = 0; i < nCount && bDifferent; i++ ) if( aName == m_pBitmapList->GetBitmap( i )->GetName() ) bDifferent = false; @@ -788,10 +788,10 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl, weld::Button&, void) sal_Int32 SvxBitmapTabPage::SearchBitmapList(const GraphicObject& rGraphicObject) { - long nCount = m_pBitmapList->Count(); + tools::Long nCount = m_pBitmapList->Count(); sal_Int32 nPos = -1; - for(long i = 0;i < nCount;i++) + for(tools::Long i = 0;i < nCount;i++) { if(rGraphicObject.GetUniqueID() == m_pBitmapList->GetBitmap( i )->GetGraphicObject().GetUniqueID()) { @@ -804,11 +804,11 @@ sal_Int32 SvxBitmapTabPage::SearchBitmapList(const GraphicObject& rGraphicObject sal_Int32 SvxBitmapTabPage::SearchBitmapList(const OUString& rBitmapName) { - long nCount = m_pBitmapList->Count(); + tools::Long nCount = m_pBitmapList->Count(); bool bValidBitmapName = true; sal_Int32 nPos = -1; - for(long i = 0;i < nCount && bValidBitmapName;i++) + for(tools::Long i = 0;i < nCount && bValidBitmapName;i++) { if(rBitmapName == m_pBitmapList->GetBitmap( i )->GetName()) { diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx index 586557c2c089..c9a6060f8169 100644 --- a/cui/source/tabpages/tpcolor.cxx +++ b/cui/source/tabpages/tpcolor.cxx @@ -315,7 +315,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickAddHdl_Impl, weld::Button&, void) OUString aDesc( CuiResId( RID_SVXSTR_DESC_COLOR ) ); OUString aName; - long j = 1; + tools::Long j = 1; bool bValidColorName = false; // check if name is already existing while (!bValidColorName) @@ -623,11 +623,11 @@ void SvxColorTabPage::UpdateColorValues( bool bUpdatePreset ) sal_Int32 SvxColorTabPage::FindInCustomColors(OUString const & aColorName) { css::uno::Sequence< OUString > aCustomColorNameList(officecfg::Office::Common::UserColors::CustomColorName::get()); - long nCount = aCustomColorNameList.getLength(); + tools::Long nCount = aCustomColorNameList.getLength(); bool bValidColorName = true; sal_Int32 nPos = -1; - for(long i = 0;i < nCount && bValidColorName;i++) + for(tools::Long i = 0;i < nCount && bValidColorName;i++) { if(aColorName == aCustomColorNameList[i]) { @@ -666,7 +666,7 @@ void SvxColorTabPage::RgbToCmyk_Impl( Color& rColor, sal_uInt16& rK ) void SvxColorTabPage::CmykToRgb_Impl( Color& rColor, const sal_uInt16 nK ) { - long lTemp; + tools::Long lTemp; lTemp = 255 - ( rColor.GetRed() + nK ); diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx index 32deb5ae8fd2..c94f53f56b35 100644 --- a/cui/source/tabpages/tpgradnt.cxx +++ b/cui/source/tabpages/tpgradnt.cxx @@ -320,8 +320,8 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl, weld::Button&, void) OUString aDesc( CuiResId( RID_SVXSTR_DESC_GRADIENT ) ); OUString aName; - long nCount = m_pGradientList->Count(); - long j = 1; + tools::Long nCount = m_pGradientList->Count(); + tools::Long j = 1; bool bValidGradientName = false; while( !bValidGradientName ) @@ -611,11 +611,11 @@ void SvxGradientTabPage::SetControlState_Impl( css::awt::GradientStyle eXGS ) sal_Int32 SvxGradientTabPage::SearchGradientList(const OUString& rGradientName) { - long nCount = m_pGradientList->Count(); + tools::Long nCount = m_pGradientList->Count(); bool bValidGradientName = true; sal_Int32 nPos = -1; - for(long i = 0;i < nCount && bValidGradientName;i++) + for(tools::Long i = 0;i < nCount && bValidGradientName;i++) { if(rGradientName == m_pGradientList->GetGradient( i )->GetName()) { diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx index 3be0005ef62a..59c046ea6d88 100644 --- a/cui/source/tabpages/tphatch.cxx +++ b/cui/source/tabpages/tphatch.cxx @@ -201,11 +201,11 @@ DeactivateRC SvxHatchTabPage::DeactivatePage( SfxItemSet* _pSet ) sal_Int32 SvxHatchTabPage::SearchHatchList(const OUString& rHatchName) { - long nCount = m_pHatchingList->Count(); + tools::Long nCount = m_pHatchingList->Count(); bool bValidHatchName = true; sal_Int32 nPos = -1; - for(long i = 0;i < nCount && bValidHatchName;i++) + for(tools::Long i = 0;i < nCount && bValidHatchName;i++) { if(rHatchName == m_pHatchingList->GetHatch( i )->GetName()) { @@ -378,7 +378,7 @@ void SvxHatchTabPage::ChangeHatchHdl_Impl() m_xLbLineColor->SetNoSelection(); m_xLbLineColor->SelectEntry( pHatch->GetColor() ); SetMetricValue( *m_xMtrDistance, pHatch->GetDistance(), m_ePoolUnit ); - long nHatchAngle = pHatch->GetAngle().get() / 10; + tools::Long nHatchAngle = pHatch->GetAngle().get() / 10; m_xMtrAngle->set_value(nHatchAngle, FieldUnit::NONE); m_xSliderAngle->set_value(nHatchAngle); @@ -402,8 +402,8 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickAddHdl_Impl, weld::Button&, void) OUString aDesc( CuiResId( RID_SVXSTR_DESC_HATCH ) ); OUString aName; - long nCount = m_pHatchingList->Count(); - long j = 1; + tools::Long nCount = m_pHatchingList->Count(); + tools::Long j = 1; bool bValidHatchName = false; while( !bValidHatchName ) diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx index 00b32a5de5db..aba1fafc6735 100644 --- a/cui/source/tabpages/tpline.cxx +++ b/cui/source/tabpages/tpline.cxx @@ -402,7 +402,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs ) pStyleItem.reset(new XLineStyleItem( drawing::LineStyle_DASH )); // For added security - if( m_pDashList->Count() > static_cast<long>( nPos - 2 ) ) + if( m_pDashList->Count() > static_cast<tools::Long>( nPos - 2 ) ) { XLineDashItem aDashItem( m_xLbLineStyle->get_active_text(), m_pDashList->GetDash( nPos - 2 )->GetDash() ); @@ -479,7 +479,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs ) std::unique_ptr<XLineStartItem> pItem; if( nPos == 0 ) pItem.reset(new XLineStartItem()); - else if( m_pLineEndList->Count() > static_cast<long>( nPos - 1 ) ) + else if( m_pLineEndList->Count() > static_cast<tools::Long>( nPos - 1 ) ) pItem.reset(new XLineStartItem( m_xLbStartStyle->get_active_text(), m_pLineEndList->GetLineEnd( nPos - 1 )->GetLineEnd() )); pOld = GetOldItem( *rAttrs, XATTR_LINESTART ); if( pItem && ( !pOld || *pOld != *pItem ) ) @@ -495,7 +495,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs ) std::unique_ptr<XLineEndItem> pItem; if( nPos == 0 ) pItem.reset(new XLineEndItem()); - else if( m_pLineEndList->Count() > static_cast<long>( nPos - 1 ) ) + else if( m_pLineEndList->Count() > static_cast<tools::Long>( nPos - 1 ) ) pItem.reset(new XLineEndItem( m_xLbEndStyle->get_active_text(), m_pLineEndList->GetLineEnd( nPos - 1 )->GetLineEnd() )); pOld = GetOldItem( *rAttrs, XATTR_LINEEND ); if( pItem && @@ -790,7 +790,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs ) // Line style const SfxPoolItem *pPoolItem; - long nSymType=SVX_SYMBOLTYPE_UNKNOWN; + tools::Long nSymType=SVX_SYMBOLTYPE_UNKNOWN; bool bPrevSym=false; bool bEnable=true; bool bIgnoreGraphic=false; @@ -971,7 +971,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs ) bool bSelected(false); const basegfx::B2DPolyPolygon& rItemPolygon = rAttrs->Get(XATTR_LINESTART).GetLineStartValue(); - for(long a(0);!bSelected && a < m_pLineEndList->Count(); a++) + for(tools::Long a(0);!bSelected && a < m_pLineEndList->Count(); a++) { const XLineEndEntry* pEntry = m_pLineEndList->GetLineEnd(a); const basegfx::B2DPolyPolygon& rEntryPolygon = pEntry->GetLineEnd(); @@ -1003,7 +1003,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs ) bool bSelected(false); const basegfx::B2DPolyPolygon& rItemPolygon = rAttrs->Get(XATTR_LINEEND).GetLineEndValue(); - for(long a(0);!bSelected && a < m_pLineEndList->Count(); a++) + for(tools::Long a(0);!bSelected && a < m_pLineEndList->Count(); a++) { const XLineEndEntry* pEntry = m_pLineEndList->GetLineEnd(a); const basegfx::B2DPolyPolygon& rEntryPolygon = pEntry->GetLineEnd(); @@ -1516,7 +1516,7 @@ IMPL_LINK(SvxLineTabPage, GraphicHdl_Impl, const OString&, rIdent, void) Graphic aGraphic; bool bResetSize = false; bool bEnable = true; - long nPreviousSymbolType = m_nSymbolType; + tools::Long nPreviousSymbolType = m_nSymbolType; OString sNumber; if (rIdent.startsWith("gallery", &sNumber)) @@ -1575,8 +1575,8 @@ IMPL_LINK(SvxLineTabPage, GraphicHdl_Impl, const OString&, rIdent, void) { //#i31097# Data Point Symbol size changes when a different symbol is chosen(maoyg) if( m_aSymbolSize.Width() != m_aSymbolSize.Height() ) { - aSize.setWidth( static_cast<long>( m_aSymbolSize.Width() + m_aSymbolSize.Height() )/2 ); - aSize.setHeight( static_cast<long>( m_aSymbolSize.Width() + m_aSymbolSize.Height() )/2 ); + aSize.setWidth( static_cast<tools::Long>( m_aSymbolSize.Width() + m_aSymbolSize.Height() )/2 ); + aSize.setHeight( static_cast<tools::Long>( m_aSymbolSize.Width() + m_aSymbolSize.Height() )/2 ); m_aSymbolSize = aSize; } } @@ -1602,8 +1602,8 @@ IMPL_LINK( SvxLineTabPage, SizeHdl_Impl, weld::MetricSpinButton&, rField, void) bool bWidth = &rField == m_xSymbolWidthMF.get(); m_bLastWidthModified = bWidth; bool bRatio = m_xSymbolRatioCB->get_active(); - long nWidthVal = static_cast<long>(m_xSymbolWidthMF->denormalize(m_xSymbolWidthMF->get_value(FieldUnit::MM_100TH))); - long nHeightVal= static_cast<long>(m_xSymbolHeightMF->denormalize(m_xSymbolHeightMF->get_value(FieldUnit::MM_100TH))); + tools::Long nWidthVal = static_cast<tools::Long>(m_xSymbolWidthMF->denormalize(m_xSymbolWidthMF->get_value(FieldUnit::MM_100TH))); + tools::Long nHeightVal= static_cast<tools::Long>(m_xSymbolHeightMF->denormalize(m_xSymbolHeightMF->get_value(FieldUnit::MM_100TH))); nWidthVal = OutputDevice::LogicToLogic(nWidthVal,MapUnit::Map100thMM, m_ePoolUnit ); nHeightVal = OutputDevice::LogicToLogic(nHeightVal,MapUnit::Map100thMM, m_ePoolUnit); m_aSymbolSize = Size(nWidthVal,nHeightVal); @@ -1617,11 +1617,11 @@ IMPL_LINK( SvxLineTabPage, SizeHdl_Impl, weld::MetricSpinButton&, rField, void) if (bWidth) { - long nDelta = nWidthVal - m_aSymbolLastSize.Width(); + tools::Long nDelta = nWidthVal - m_aSymbolLastSize.Width(); m_aSymbolSize.setWidth( nWidthVal ); if (bRatio) { - m_aSymbolSize.setHeight( m_aSymbolLastSize.Height() + static_cast<long>(static_cast<double>(nDelta) / fSizeRatio) ); + m_aSymbolSize.setHeight( m_aSymbolLastSize.Height() + static_cast<tools::Long>(static_cast<double>(nDelta) / fSizeRatio) ); m_aSymbolSize.setHeight( OutputDevice::LogicToLogic( m_aSymbolSize.Height(), m_ePoolUnit, MapUnit::Map100thMM ) ); //TODO m_xSymbolHeightMF->SetUserValue(m_xSymbolHeightMF->normalize(m_aSymbolSize.Height()), FieldUnit::MM_100TH); m_xSymbolHeightMF->set_value(m_xSymbolHeightMF->normalize(m_aSymbolSize.Height()), FieldUnit::MM_100TH); @@ -1629,11 +1629,11 @@ IMPL_LINK( SvxLineTabPage, SizeHdl_Impl, weld::MetricSpinButton&, rField, void) } else { - long nDelta = nHeightVal - m_aSymbolLastSize.Height(); + tools::Long nDelta = nHeightVal - m_aSymbolLastSize.Height(); m_aSymbolSize.setHeight( nHeightVal ); if (bRatio) { - m_aSymbolSize.setWidth( m_aSymbolLastSize.Width() + static_cast<long>(static_cast<double>(nDelta) * fSizeRatio) ); + m_aSymbolSize.setWidth( m_aSymbolLastSize.Width() + static_cast<tools::Long>(static_cast<double>(nDelta) * fSizeRatio) ); m_aSymbolSize.setWidth( OutputDevice::LogicToLogic( m_aSymbolSize.Width(), m_ePoolUnit, MapUnit::Map100thMM ) ); //TODO m_xSymbolWidthMF->SetUserValue(m_xSymbolWidthMF->normalize(m_aSymbolSize.Width()), FieldUnit::MM_100TH); m_xSymbolWidthMF->set_value(m_xSymbolWidthMF->normalize(m_aSymbolSize.Width()), FieldUnit::MM_100TH); diff --git a/cui/source/tabpages/tplnedef.cxx b/cui/source/tabpages/tplnedef.cxx index 2cef64e0e22e..2af5b2558421 100644 --- a/cui/source/tabpages/tplnedef.cxx +++ b/cui/source/tabpages/tplnedef.cxx @@ -377,7 +377,7 @@ void SvxLineDefTabPage::ChangeMetricHdl_Impl(const weld::ToggleButton* p) { if( !m_xCbxSynchronize->get_active() && m_xMtrLength1->get_unit() != eFUnit ) { - long nTmp1, nTmp2, nTmp3; + tools::Long nTmp1, nTmp2, nTmp3; // was changed with Control if( p ) @@ -412,7 +412,7 @@ void SvxLineDefTabPage::ChangeMetricHdl_Impl(const weld::ToggleButton* p) } else if( m_xCbxSynchronize->get_active() && m_xMtrLength1->get_unit() != FieldUnit::PERCENT ) { - long nTmp1, nTmp2, nTmp3; + tools::Long nTmp1, nTmp2, nTmp3; // was changed with Control if( p ) @@ -491,8 +491,8 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickAddHdl_Impl, weld::Button&, void) OUString aDesc(CuiResId(RID_SVXSTR_DESC_LINESTYLE)); OUString aName; - long nCount = pDashList->Count(); - long j = 1; + tools::Long nCount = pDashList->Count(); + tools::Long j = 1; bool bDifferent = false; while ( !bDifferent ) @@ -500,7 +500,7 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickAddHdl_Impl, weld::Button&, void) aName = aNewName + " " + OUString::number( j++ ); bDifferent = true; - for ( long i = 0; i < nCount && bDifferent; i++ ) + for ( tools::Long i = 0; i < nCount && bDifferent; i++ ) if ( aName == pDashList->GetDash( i )->GetName() ) bDifferent = false; } @@ -514,7 +514,7 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickAddHdl_Impl, weld::Button&, void) pDlg->GetName( aName ); bDifferent = true; - for( long i = 0; i < nCount && bDifferent; i++ ) + for( tools::Long i = 0; i < nCount && bDifferent; i++ ) { if( aName == pDashList->GetDash( i )->GetName() ) bDifferent = false; @@ -525,7 +525,7 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickAddHdl_Impl, weld::Button&, void) bLoop = false; FillDash_Impl(); - long nDashCount = pDashList->Count(); + tools::Long nDashCount = pDashList->Count(); pDashList->Insert( std::make_unique<XDashEntry>(aDash, aName), nDashCount ); m_xLbLineStyles->Append( *pDashList->GetDash(nDashCount), pDashList->GetUiBitmap(nDashCount) ); @@ -575,7 +575,7 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickModifyHdl_Impl, weld::Button&, void) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetFrameWeld(), aName, aDesc)); - long nCount = pDashList->Count(); + tools::Long nCount = pDashList->Count(); bool bLoop = true; while ( bLoop && pDlg->Execute() == RET_OK ) @@ -583,7 +583,7 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickModifyHdl_Impl, weld::Button&, void) pDlg->GetName( aName ); bool bDifferent = true; - for( long i = 0; i < nCount && bDifferent; i++ ) + for( tools::Long i = 0; i < nCount && bDifferent; i++ ) { if( aName == pDashList->GetDash( i )->GetName() && aName != aOldName ) diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx index a9db979bcda5..e51119dcdefc 100644 --- a/cui/source/tabpages/tplneend.cxx +++ b/cui/source/tabpages/tplneend.cxx @@ -271,11 +271,11 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickModifyHdl_Impl, weld::Button&, void) OUString aDesc(CuiResId(RID_SVXSTR_DESC_LINEEND)); OUString aName(m_xEdtName->get_text()); - long nCount = pLineEndList->Count(); + tools::Long nCount = pLineEndList->Count(); bool bDifferent = true; // check whether the name is existing already - for ( long i = 0; i < nCount && bDifferent; i++ ) + for ( tools::Long i = 0; i < nCount && bDifferent; i++ ) if ( aName == pLineEndList->GetLineEnd( i )->GetName() ) bDifferent = false; @@ -295,7 +295,7 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickModifyHdl_Impl, weld::Button&, void) pDlg->GetName( aName ); bDifferent = true; - for( long i = 0; i < nCount && bDifferent; i++ ) + for( tools::Long i = 0; i < nCount && bDifferent; i++ ) { if( aName == pLineEndList->GetLineEnd( i )->GetName() ) bDifferent = false; @@ -375,8 +375,8 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickAddHdl_Impl, weld::Button&, void) OUString aDesc(CuiResId(RID_SVXSTR_DESC_LINEEND)); OUString aName; - long nCount = pLineEndList->Count(); - long j = 1; + tools::Long nCount = pLineEndList->Count(); + tools::Long j = 1; bool bDifferent = false; while ( !bDifferent ) @@ -384,7 +384,7 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickAddHdl_Impl, weld::Button&, void) aName = aNewName + " " + OUString::number( j++ ); bDifferent = true; - for( long i = 0; i < nCount && bDifferent; i++ ) + for( tools::Long i = 0; i < nCount && bDifferent; i++ ) if ( aName == pLineEndList->GetLineEnd( i )->GetName() ) bDifferent = false; } @@ -398,7 +398,7 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickAddHdl_Impl, weld::Button&, void) pDlg->GetName( aName ); bDifferent = true; - for( long i = 0; i < nCount && bDifferent; i++ ) + for( tools::Long i = 0; i < nCount && bDifferent; i++ ) { if( aName == pLineEndList->GetLineEnd( i )->GetName() ) bDifferent = false; diff --git a/cui/source/tabpages/tppattern.cxx b/cui/source/tabpages/tppattern.cxx index 553430b5b38a..422d70da1814 100644 --- a/cui/source/tabpages/tppattern.cxx +++ b/cui/source/tabpages/tppattern.cxx @@ -322,8 +322,8 @@ IMPL_LINK_NOARG(SvxPatternTabPage, ClickAddHdl_Impl, weld::Button&, void) OUString aDesc( CuiResId( RID_SVXSTR_DESC_NEW_PATTERN ) ); OUString aName; - long nCount = m_pPatternList->Count(); - long j = 1; + tools::Long nCount = m_pPatternList->Count(); + tools::Long j = 1; bool bValidPatternName = false; while( !bValidPatternName ) @@ -536,11 +536,11 @@ void SvxPatternTabPage::PointChanged(weld::DrawingArea* pDrawingArea, RectPoint) sal_Int32 SvxPatternTabPage::SearchPatternList(const OUString& rPatternName) { - long nCount = m_pPatternList->Count(); + tools::Long nCount = m_pPatternList->Count(); bool bValidPatternName = true; sal_Int32 nPos = -1; - for(long i = 0;i < nCount && bValidPatternName;i++) + for(tools::Long i = 0;i < nCount && bValidPatternName;i++) { if(rPatternName == m_pPatternList->GetBitmap( i )->GetName()) { diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx index 77c3b7e7e8d2..42b17b553cc2 100644 --- a/cui/source/tabpages/transfrm.cxx +++ b/cui/source/tabpages/transfrm.cxx @@ -451,7 +451,7 @@ bool SvxSlantTabPage::FillItemSet(SfxItemSet* rAttrs) if (m_xMtrRadius->get_value_changed_from_saved()) { Fraction aUIScale = pView->GetModel()->GetUIScale(); - long nTmp = long(GetCoreValue(*m_xMtrRadius, ePoolUnit) * aUIScale); + tools::Long nTmp = tools::Long(GetCoreValue(*m_xMtrRadius, ePoolUnit) * aUIScale); rAttrs->Put( makeSdrEckenradiusItem( nTmp ) ); bModified = true; @@ -953,15 +953,15 @@ bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet* rOutAttrs ) // get Width double nWidth = static_cast<double>(m_xMtrWidth->get_value(FieldUnit::MM_100TH)); - long lWidth = long(nWidth * static_cast<double>(aUIScale)); + tools::Long lWidth = tools::Long(nWidth * static_cast<double>(aUIScale)); lWidth = OutputDevice::LogicToLogic( lWidth, MapUnit::Map100thMM, mePoolUnit ); - lWidth = static_cast<long>(m_xMtrWidth->denormalize( lWidth )); + lWidth = static_cast<tools::Long>(m_xMtrWidth->denormalize( lWidth )); // get Height double nHeight = static_cast<double>(m_xMtrHeight->get_value(FieldUnit::MM_100TH)); - long lHeight = long(nHeight * static_cast<double>(aUIScale)); + tools::Long lHeight = tools::Long(nHeight * static_cast<double>(aUIScale)); lHeight = OutputDevice::LogicToLogic( lHeight, MapUnit::Map100thMM, mePoolUnit ); - lHeight = static_cast<long>(m_xMtrHeight->denormalize( lHeight )); + lHeight = static_cast<tools::Long>(m_xMtrHeight->denormalize( lHeight )); // put Width & Height to itemset rOutAttrs->Put( SfxUInt32Item( GetWhich( SID_ATTR_TRANSFORM_WIDTH ), static_cast<sal_uInt32>(lWidth) ) ); |