summaryrefslogtreecommitdiff
path: root/sw/source/ui/misc
diff options
context:
space:
mode:
authorNoel <noelgrandin@gmail.com>2020-10-19 15:18:15 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-10-20 08:04:53 +0200
commit1e822e401ea8fe950c7fb62172ac61d8396c98e9 (patch)
tree3a29227adfe1c5ec9209d7e7deb2035633104986 /sw/source/ui/misc
parentb225980d2d65694278c9ed89512fbe21b08febd6 (diff)
use tools::Long in sw
Change-Id: I44be72b3a9b14823ec37a3c799cffb4fb4d6e1de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104527 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/ui/misc')
-rw-r--r--sw/source/ui/misc/num.cxx32
-rw-r--r--sw/source/ui/misc/outline.cxx46
-rw-r--r--sw/source/ui/misc/pgfnote.cxx6
-rw-r--r--sw/source/ui/misc/pggrid.cxx4
4 files changed, 44 insertions, 44 deletions
diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx
index 1dce5e2bcf90..53d763a39e44 100644
--- a/sw/source/ui/misc/num.cxx
+++ b/sw/source/ui/misc/num.cxx
@@ -155,7 +155,7 @@ void SwNumPositionTabPage::InitControls()
const SwNumFormat* aNumFormatArr[MAXLEVEL];
sal_uInt16 nMask = 1;
sal_uInt16 nLvl = USHRT_MAX;
- long nFirstBorderTextRelative = -1;
+ tools::Long nFirstBorderTextRelative = -1;
for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
{
aNumFormatArr[i] = &pActNum->Get(i);
@@ -173,7 +173,7 @@ void SwNumPositionTabPage::InitControls()
{
if(bRelative)
{
- const long nBorderTextRelative =
+ const tools::Long nBorderTextRelative =
aNumFormatArr[i]->GetAbsLSpace() + aNumFormatArr[i]->GetFirstLineOffset() -
aNumFormatArr[i - 1]->GetAbsLSpace() + aNumFormatArr[i - 1]->GetFirstLineOffset();
if (nFirstBorderTextRelative == -1)
@@ -215,16 +215,16 @@ void SwNumPositionTabPage::InitControls()
}
if(bSameDistBorderNum)
{
- long nDistBorderNum;
+ tools::Long nDistBorderNum;
if(bRelative)
{
- nDistBorderNum = static_cast<long>(aNumFormatArr[nLvl]->GetAbsLSpace())+ aNumFormatArr[nLvl]->GetFirstLineOffset();
+ nDistBorderNum = static_cast<tools::Long>(aNumFormatArr[nLvl]->GetAbsLSpace())+ aNumFormatArr[nLvl]->GetFirstLineOffset();
if(nLvl)
- nDistBorderNum -= static_cast<long>(aNumFormatArr[nLvl - 1]->GetAbsLSpace())+ aNumFormatArr[nLvl - 1]->GetFirstLineOffset();
+ nDistBorderNum -= static_cast<tools::Long>(aNumFormatArr[nLvl - 1]->GetAbsLSpace())+ aNumFormatArr[nLvl - 1]->GetFirstLineOffset();
}
else
{
- nDistBorderNum = static_cast<long>(aNumFormatArr[nLvl]->GetAbsLSpace())+ aNumFormatArr[nLvl]->GetFirstLineOffset();
+ nDistBorderNum = static_cast<tools::Long>(aNumFormatArr[nLvl]->GetAbsLSpace())+ aNumFormatArr[nLvl]->GetFirstLineOffset();
}
m_xDistBorderMF->set_value(m_xDistBorderMF->normalize(nDistBorderNum),FieldUnit::TWIP);
}
@@ -591,7 +591,7 @@ IMPL_LINK(SwNumPositionTabPage, DistanceHdl, weld::MetricSpinButton&, rField, vo
{
if(bInInintControl)
return;
- long nValue = static_cast< long >(rField.denormalize(rField.get_value(FieldUnit::TWIP)));
+ tools::Long nValue = static_cast< tools::Long >(rField.denormalize(rField.get_value(FieldUnit::TWIP)));
sal_uInt16 nMask = 1;
for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
{
@@ -610,7 +610,7 @@ IMPL_LINK(SwNumPositionTabPage, DistanceHdl, weld::MetricSpinButton&, rField, vo
}
else
{
- long nTmp = pActNum->Get( i - 1 ).GetAbsLSpace() +
+ tools::Long nTmp = pActNum->Get( i - 1 ).GetAbsLSpace() +
pActNum->Get( i - 1 ).GetFirstLineOffset() -
pActNum->Get( i ).GetFirstLineOffset();
@@ -629,7 +629,7 @@ IMPL_LINK(SwNumPositionTabPage, DistanceHdl, weld::MetricSpinButton&, rField, vo
else if (&rField == m_xIndentMF.get())
{
// now AbsLSpace also has to be modified by FirstLineOffset
- long nDiff = nValue + aNumFormat.GetFirstLineOffset();
+ tools::Long nDiff = nValue + aNumFormat.GetFirstLineOffset();
auto const nAbsLSpace = aNumFormat.GetAbsLSpace();
aNumFormat.SetAbsLSpace( nAbsLSpace + nDiff );
aNumFormat.SetFirstLineOffset( -nValue );
@@ -650,7 +650,7 @@ IMPL_LINK( SwNumPositionTabPage, RelativeHdl, weld::ToggleButton&, rBox, void )
bool bOn = rBox.get_active();
bool bSingleSelection = m_xLevelLB->n_children() == 1 && USHRT_MAX != nActNumLvl;
bool bSetValue = false;
- long nValue = 0;
+ tools::Long nValue = 0;
if(bOn || bSingleSelection)
{
sal_uInt16 nMask = 1;
@@ -749,7 +749,7 @@ IMPL_LINK_NOARG(SwNumPositionTabPage, LabelFollowedByHdl_Impl, weld::ComboBox&,
IMPL_LINK( SwNumPositionTabPage, ListtabPosHdl_Impl, weld::MetricSpinButton&, rField, void )
{
// determine value to be set at the chosen list levels
- const long nValue = static_cast< long >(rField.denormalize(rField.get_value(FieldUnit::TWIP)));
+ const tools::Long nValue = static_cast< tools::Long >(rField.denormalize(rField.get_value(FieldUnit::TWIP)));
// set value at the chosen list levels
sal_uInt16 nMask = 1;
@@ -770,7 +770,7 @@ IMPL_LINK( SwNumPositionTabPage, ListtabPosHdl_Impl, weld::MetricSpinButton&, rF
IMPL_LINK( SwNumPositionTabPage, AlignAtHdl_Impl, weld::MetricSpinButton&, rField, void )
{
// determine value to be set at the chosen list levels
- const long nValue = static_cast< long >(rField.denormalize(rField.get_value(FieldUnit::TWIP)));
+ const tools::Long nValue = static_cast< tools::Long >(rField.denormalize(rField.get_value(FieldUnit::TWIP)));
// set value at the chosen list levels
sal_uInt16 nMask = 1;
@@ -779,7 +779,7 @@ IMPL_LINK( SwNumPositionTabPage, AlignAtHdl_Impl, weld::MetricSpinButton&, rFiel
if ( nActNumLvl & nMask )
{
SwNumFormat aNumFormat( pActNum->Get(i) );
- const long nFirstLineIndent = nValue - aNumFormat.GetIndentAt();
+ const tools::Long nFirstLineIndent = nValue - aNumFormat.GetIndentAt();
aNumFormat.SetFirstLineIndent( nFirstLineIndent );
pActNum->Set( i, aNumFormat );
}
@@ -792,7 +792,7 @@ IMPL_LINK( SwNumPositionTabPage, AlignAtHdl_Impl, weld::MetricSpinButton&, rFiel
IMPL_LINK( SwNumPositionTabPage, IndentAtHdl_Impl, weld::MetricSpinButton&, rField, void )
{
// determine value to be set at the chosen list levels
- const long nValue = static_cast< long >(rField.denormalize(rField.get_value(FieldUnit::TWIP)));
+ const tools::Long nValue = static_cast< tools::Long >(rField.denormalize(rField.get_value(FieldUnit::TWIP)));
// set value at the chosen list levels
sal_uInt16 nMask = 1;
@@ -801,10 +801,10 @@ IMPL_LINK( SwNumPositionTabPage, IndentAtHdl_Impl, weld::MetricSpinButton&, rFie
if ( nActNumLvl & nMask )
{
SwNumFormat aNumFormat( pActNum->Get(i) );
- const long nAlignedAt = aNumFormat.GetIndentAt() +
+ const tools::Long nAlignedAt = aNumFormat.GetIndentAt() +
aNumFormat.GetFirstLineIndent();
aNumFormat.SetIndentAt( nValue );
- const long nNewFirstLineIndent = nAlignedAt - nValue;
+ const tools::Long nNewFirstLineIndent = nAlignedAt - nValue;
aNumFormat.SetFirstLineIndent( nNewFirstLineIndent );
pActNum->Set( i, aNumFormat );
}
diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx
index 099b901148cf..bef52a28777c 100644
--- a/sw/source/ui/misc/outline.cxx
+++ b/sw/source/ui/misc/outline.cxx
@@ -817,7 +817,7 @@ void SwOutlineSettingsTabPage::CheckForStartValue_Impl(sal_uInt16 nNumberingType
StartModified(*m_xStartEdit);
}
-static long lcl_DrawBullet(vcl::RenderContext* pVDev, const SwNumFormat& rFormat, long nXStart, long nYStart, const Size& rSize)
+static tools::Long lcl_DrawBullet(vcl::RenderContext* pVDev, const SwNumFormat& rFormat, tools::Long nXStart, tools::Long nYStart, const Size& rSize)
{
vcl::Font aTmpFont(pVDev->GetFont());
@@ -842,19 +842,19 @@ static long lcl_DrawBullet(vcl::RenderContext* pVDev, const SwNumFormat& rFormat
pVDev->SetFont( aFont );
sal_UCS4 cBullet = rFormat.GetBulletChar();
OUString aText(&cBullet, 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;
}
-static long lcl_DrawGraphic(vcl::RenderContext* pVDev, const SwNumFormat &rFormat, long nXStart, long nYStart, long nDivision)
+static tools::Long lcl_DrawGraphic(vcl::RenderContext* pVDev, const SwNumFormat &rFormat, tools::Long nXStart, tools::Long nYStart, tools::Long nDivision)
{
const SvxBrushItem* pBrushItem = rFormat.GetBrush();
- long nRet = 0;
+ tools::Long nRet = 0;
if (pBrushItem)
{
const Graphic* pGraphic = pBrushItem->GetGraphic();
@@ -885,7 +885,7 @@ void NumberingPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Re
if (pActNum)
{
- long nWidthRelation = 30; // chapter dialog
+ tools::Long nWidthRelation = 30; // chapter dialog
if(nPageWidth)
{
nWidthRelation = nPageWidth / aSize.Width();
@@ -896,22 +896,22 @@ void NumberingPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Re
}
// height per level
- const long nXStep = aSize.Width() / (3 * MAXLEVEL * ((MAXLEVEL < 10) ? 2 : 1));
- const long nYStep = (aSize.Height() - 6)/ MAXLEVEL;
- long nYStart = 4;
+ const tools::Long nXStep = aSize.Width() / (3 * MAXLEVEL * ((MAXLEVEL < 10) ? 2 : 1));
+ const tools::Long nYStep = (aSize.Height() - 6)/ MAXLEVEL;
+ tools::Long nYStart = 4;
aStdFont = OutputDevice::GetDefaultFont(DefaultFontType::UI_SANS, GetAppLanguage(),
GetDefaultFontFlags::OnlyOne, &rRenderContext);
// #101524# OJ
aStdFont.SetColor(SwViewOption::GetFontColor());
- const long nFontHeight = nYStep * ( bPosition ? 15 : 6 ) / 10;
+ const tools::Long nFontHeight = nYStep * ( bPosition ? 15 : 6 ) / 10;
aStdFont.SetFontSize(Size( 0, nFontHeight ));
- long nPreNum = pActNum->Get(0).GetStart();
+ tools::Long nPreNum = pActNum->Get(0).GetStart();
if (bPosition)
{
- const long nLineHeight = nFontHeight * 8 / 7;
+ const tools::Long nLineHeight = nFontHeight * 8 / 7;
sal_uInt8 nStart = 0;
while (!(nActLevel & (1 << nStart)))
{
@@ -927,15 +927,15 @@ void NumberingPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Re
const SwNumFormat &rFormat = pActNum->Get(nLevel);
aNumVector.push_back(rFormat.GetStart());
- long nXStart( 0 );
- long nTextOffset( 0 );
- long nNumberXPos( 0 );
+ tools::Long nXStart( 0 );
+ tools::Long nTextOffset( 0 );
+ tools::Long nNumberXPos( 0 );
if (rFormat.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION)
{
nXStart = rFormat.GetAbsLSpace() / nWidthRelation;
nTextOffset = rFormat.GetCharTextDistance() / nWidthRelation;
nNumberXPos = nXStart;
- const long nFirstLineOffset = (-rFormat.GetFirstLineOffset()) / nWidthRelation;
+ const tools::Long nFirstLineOffset = (-rFormat.GetFirstLineOffset()) / nWidthRelation;
if(nFirstLineOffset <= nNumberXPos)
nNumberXPos -= nFirstLineOffset;
@@ -944,11 +944,11 @@ void NumberingPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Re
}
else if (rFormat.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT)
{
- const long nTmpNumberXPos((rFormat.GetIndentAt() + rFormat.GetFirstLineIndent()) / nWidthRelation);
+ const tools::Long nTmpNumberXPos((rFormat.GetIndentAt() + rFormat.GetFirstLineIndent()) / nWidthRelation);
nNumberXPos = (nTmpNumberXPos < 0) ? 0 : nTmpNumberXPos;
}
- long nBulletWidth = 0;
+ tools::Long nBulletWidth = 0;
if (SVX_NUM_BITMAP == rFormat.GetNumberingType())
{
nBulletWidth = lcl_DrawGraphic(pVDev.get(), rFormat, nNumberXPos,
@@ -978,7 +978,7 @@ void NumberingPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Re
nBulletWidth += pVDev->GetTextWidth(aText);
}
- long nTextXPos(0);
+ tools::Long nTextXPos(0);
if (rFormat.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION)
{
nTextXPos = nXStart;
@@ -1024,24 +1024,24 @@ void NumberingPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Re
else
{
SwNumberTree::tNumberVector aNumVector;
- const long nLineHeight = nFontHeight * 3 / 2;
+ const tools::Long nLineHeight = nFontHeight * 3 / 2;
for (sal_uInt8 nLevel = 0; nLevel < MAXLEVEL; ++nLevel, nYStart = nYStart + nYStep)
{
const SwNumFormat &rFormat = pActNum->Get(nLevel);
aNumVector.push_back(rFormat.GetStart());
- long nXStart(0);
+ tools::Long nXStart(0);
if (rFormat.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION)
{
nXStart = rFormat.GetAbsLSpace() / nWidthRelation;
}
else if (rFormat.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT)
{
- const long nTmpXStart((rFormat.GetIndentAt() + rFormat.GetFirstLineIndent() ) / nWidthRelation);
+ const tools::Long nTmpXStart((rFormat.GetIndentAt() + rFormat.GetFirstLineIndent() ) / nWidthRelation);
nXStart = (nTmpXStart < 0) ? 0 : nTmpXStart;
}
nXStart /= 2;
nXStart += 2;
- long nTextOffset;
+ tools::Long nTextOffset;
if (SVX_NUM_BITMAP == rFormat.GetNumberingType())
{
lcl_DrawGraphic(pVDev.get(), rFormat, nXStart, nYStart, nWidthRelation);
diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx
index a90b15e2a26d..4415ae8ab7a2 100644
--- a/sw/source/ui/misc/pgfnote.cxx
+++ b/sw/source/ui/misc/pgfnote.cxx
@@ -116,7 +116,7 @@ SwFootNotePage::SwFootNotePage(weld::Container* pPage, weld::DialogController* p
::SetFieldUnit(*m_xDistEdit, aMetric);
::SetFieldUnit(*m_xLineDistEdit, aMetric);
MeasurementSystem eSys = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum();
- long nHeightValue = MeasurementSystem::Metric != eSys ? 1440 : 1134;
+ tools::Long nHeightValue = MeasurementSystem::Metric != eSys ? 1440 : 1134;
m_xMaxHeightEdit->set_value(m_xMaxHeightEdit->normalize(nHeightValue),FieldUnit::TWIP);
}
@@ -201,7 +201,7 @@ void SwFootNotePage::Reset(const SfxItemSet *rSet)
// width
Fraction aTmp( 100, 1 );
aTmp *= pFootnoteInfo->GetWidth();
- m_xLineLengthEdit->set_value(static_cast<long>(aTmp), FieldUnit::PERCENT);
+ m_xLineLengthEdit->set_value(static_cast<tools::Long>(aTmp), FieldUnit::PERCENT);
// gap footnote area
m_xDistEdit->set_value(m_xDistEdit->normalize(pFootnoteInfo->GetTopDist()), FieldUnit::TWIP);
@@ -236,7 +236,7 @@ bool SwFootNotePage::FillItemSet(SfxItemSet *rSet)
// Separator width
sal_Int64 nWidth = m_xLineWidthEdit->get_value(FieldUnit::NONE);
- nWidth = static_cast<long>(vcl::ConvertDoubleValue(
+ nWidth = static_cast<tools::Long>(vcl::ConvertDoubleValue(
nWidth,
m_xLineWidthEdit->get_digits(),
m_xLineWidthEdit->get_unit(), MapUnit::MapTwip ));
diff --git a/sw/source/ui/misc/pggrid.cxx b/sw/source/ui/misc/pggrid.cxx
index fcc9dc343d84..88d045d31a6d 100644
--- a/sw/source/ui/misc/pggrid.cxx
+++ b/sw/source/ui/misc/pggrid.cxx
@@ -246,8 +246,8 @@ void SwTextGridPage::PutGridItem(SfxItemSet& rSet)
m_bHRulerChanged = true;
}
m_bVRulerChanged = true;
- pView->GetHRuler().SetCharWidth(static_cast<long>(m_xCharWidthMF->get_value(FieldUnit::TWIP)/56.7));
- pView->GetVRuler().SetLineHeight(static_cast<long>(m_xTextSizeMF->get_value(FieldUnit::TWIP)/56.7));
+ pView->GetHRuler().SetCharWidth(static_cast<tools::Long>(m_xCharWidthMF->get_value(FieldUnit::TWIP)/56.7));
+ pView->GetVRuler().SetLineHeight(static_cast<tools::Long>(m_xTextSizeMF->get_value(FieldUnit::TWIP)/56.7));
}
}