summaryrefslogtreecommitdiff
path: root/cui/source/tabpages
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-01-12 20:26:08 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-01-12 20:26:08 +0100
commitf6e256c4825a6d7c9d7125a4100c10f8c4de750a (patch)
treeafb3e2979708a202ea2a833cf47a978d35faeae4 /cui/source/tabpages
parentd597bb77b271a0e9f2c3f4789517435f6b63f170 (diff)
More loplugin:cstylecast: cui
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I04b0e0c0268cbcc1c7e7ff2174c5125785e09a07
Diffstat (limited to 'cui/source/tabpages')
-rw-r--r--cui/source/tabpages/autocdlg.cxx16
-rw-r--r--cui/source/tabpages/border.cxx8
-rw-r--r--cui/source/tabpages/chardlg.cxx64
-rw-r--r--cui/source/tabpages/grfpage.cxx16
-rw-r--r--cui/source/tabpages/labdlg.cxx2
-rw-r--r--cui/source/tabpages/measure.cxx6
-rw-r--r--cui/source/tabpages/numfmt.cxx36
-rw-r--r--cui/source/tabpages/numpages.cxx58
-rw-r--r--cui/source/tabpages/page.cxx38
-rw-r--r--cui/source/tabpages/paragrph.cxx46
-rw-r--r--cui/source/tabpages/swpossizetabpage.cxx16
-rw-r--r--cui/source/tabpages/tabstpge.cxx8
-rw-r--r--cui/source/tabpages/textanim.cxx12
-rw-r--r--cui/source/tabpages/tpbitmap.cxx4
-rw-r--r--cui/source/tabpages/tpcolor.cxx30
-rw-r--r--cui/source/tabpages/tpgradnt.cxx50
-rw-r--r--cui/source/tabpages/tpline.cxx38
-rw-r--r--cui/source/tabpages/tplnedef.cxx4
-rw-r--r--cui/source/tabpages/tpshadow.cxx4
-rw-r--r--cui/source/tabpages/tptrans.cxx32
-rw-r--r--cui/source/tabpages/transfrm.cxx36
21 files changed, 262 insertions, 262 deletions
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index a84db340d3a7..caac1b3c27b8 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -121,14 +121,14 @@ OfaAutoCorrDlg::OfaAutoCorrDlg(vcl::Window* pParent, const SfxItemSet* _pSet )
m_pLanguageLB->SelectLanguage( LANGUAGE_NONE );
sal_Int32 nPos = m_pLanguageLB->GetSelectedEntryPos();
DBG_ASSERT( LISTBOX_ENTRY_NOTFOUND != nPos, "listbox entry missing" );
- m_pLanguageLB->SetEntryData( nPos, reinterpret_cast<void*>((sal_uInt16)LANGUAGE_UNDETERMINED) );
+ m_pLanguageLB->SetEntryData( nPos, reinterpret_cast<void*>(static_cast<sal_uInt16>(LANGUAGE_UNDETERMINED)) );
// Initializing doesn't work for static on linux - therefore here
if( LANGUAGE_SYSTEM == eLastDialogLanguage )
eLastDialogLanguage = Application::GetSettings().GetLanguageTag().getLanguageType();
LanguageType nSelectLang = LANGUAGE_UNDETERMINED;
- nPos = m_pLanguageLB->GetEntryPos( reinterpret_cast<void*>((sal_uInt16)eLastDialogLanguage) );
+ nPos = m_pLanguageLB->GetEntryPos( reinterpret_cast<void*>(static_cast<sal_uInt16>(eLastDialogLanguage)) );
if (LISTBOX_ENTRY_NOTFOUND != nPos)
nSelectLang = eLastDialogLanguage;
m_pLanguageLB->SelectLanguage( nSelectLang );
@@ -580,7 +580,7 @@ bool OfaSwAutoFmtOptionsPage::FillItemSet( SfxItemSet* )
bModified |= pOpt->bRightMargin != bCheck;
pOpt->bRightMargin = bCheck;
bModified |= nPercent != pOpt->nRightMargin;
- pOpt->nRightMargin = (sal_uInt8)nPercent;
+ pOpt->nRightMargin = static_cast<sal_uInt8>(nPercent);
bCheck = m_pCheckLB->IsChecked(APPLY_NUMBERING, CBCOL_SECOND);
bModified |= pOpt->bSetNumRule != bCheck;
@@ -750,7 +750,7 @@ IMPL_LINK_NOARG(OfaSwAutoFmtOptionsPage, EditHdl, Button*, void)
aDlg->GetPrcntFld().SetValue(nPercent);
if(RET_OK == aDlg->Execute())
{
- nPercent = (sal_uInt16)aDlg->GetPrcntFld().GetValue();
+ nPercent = static_cast<sal_uInt16>(aDlg->GetPrcntFld().GetValue());
sMargin = " " +
unicode::formatPercent(nPercent, Application::GetSettings().GetUILanguageTag());
}
@@ -1009,7 +1009,7 @@ void OfaAutocorrReplacePage::RefillReplaceBox(bool bFromReset,
pArray = &aDoubleStringTable[eOldLanguage]; // create new array
}
- sal_uInt32 nListBoxCount = (sal_uInt32) m_pReplaceTLB->GetEntryCount();
+ sal_uInt32 nListBoxCount = static_cast<sal_uInt32>(m_pReplaceTLB->GetEntryCount());
sal_uInt32 i;
for(i = 0; i < nListBoxCount; i++)
{
@@ -2264,11 +2264,11 @@ bool OfaAutoCompleteTabPage::FillItemSet( SfxItemSet* )
bModified |= pOpt->bAutoCmpltShowAsTip != bCheck;
pOpt->bAutoCmpltShowAsTip = bCheck;
- nVal = (sal_uInt16)m_pNFMinWordlen->GetValue();
+ nVal = static_cast<sal_uInt16>(m_pNFMinWordlen->GetValue());
bModified |= nVal != pOpt->nAutoCmpltWordLen;
pOpt->nAutoCmpltWordLen = nVal;
- nVal = (sal_uInt16)m_pNFMaxEntries->GetValue();
+ nVal = static_cast<sal_uInt16>(m_pNFMaxEntries->GetValue());
bModified |= nVal != pOpt->nAutoCmpltListLen;
pOpt->nAutoCmpltListLen = nVal;
@@ -2277,7 +2277,7 @@ bool OfaAutoCompleteTabPage::FillItemSet( SfxItemSet* )
{
sal_uLong nKey = reinterpret_cast<sal_uLong>(m_pDCBExpandKey->GetEntryData( nPos ));
bModified |= nKey != pOpt->nAutoCmpltExpandKey;
- pOpt->nAutoCmpltExpandKey = (sal_uInt16)nKey;
+ pOpt->nAutoCmpltExpandKey = static_cast<sal_uInt16>(nKey);
}
if (m_pAutoCompleteList && m_nAutoCmpltListCnt != m_pLBEntries->GetEntryCount())
diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index 79416476b750..eaae0619e77f 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -723,10 +723,10 @@ bool SvxBorderTabPage::FillItemSet( SfxItemSet* rCoreAttrs )
(pOldBoxInfoItem && !pOldBoxInfoItem->IsValid(SvxBoxInfoItemValidFlags::DISTANCE))
)
{
- aBoxItem.SetDistance( (sal_uInt16)GetCoreValue(*m_pLeftMF, eCoreUnit ), SvxBoxItemLine::LEFT );
- aBoxItem.SetDistance( (sal_uInt16)GetCoreValue(*m_pRightMF, eCoreUnit ), SvxBoxItemLine::RIGHT );
- aBoxItem.SetDistance( (sal_uInt16)GetCoreValue(*m_pTopMF, eCoreUnit ), SvxBoxItemLine::TOP );
- aBoxItem.SetDistance( (sal_uInt16)GetCoreValue(*m_pBottomMF, eCoreUnit ), SvxBoxItemLine::BOTTOM);
+ aBoxItem.SetDistance( static_cast<sal_uInt16>(GetCoreValue(*m_pLeftMF, eCoreUnit )), SvxBoxItemLine::LEFT );
+ aBoxItem.SetDistance( static_cast<sal_uInt16>(GetCoreValue(*m_pRightMF, eCoreUnit )), SvxBoxItemLine::RIGHT );
+ aBoxItem.SetDistance( static_cast<sal_uInt16>(GetCoreValue(*m_pTopMF, eCoreUnit )), SvxBoxItemLine::TOP );
+ aBoxItem.SetDistance( static_cast<sal_uInt16>(GetCoreValue(*m_pBottomMF, eCoreUnit )), SvxBoxItemLine::BOTTOM);
}
else
{
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index af80bb565ef7..4fbea4152af0 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -775,7 +775,7 @@ void SvxCharNamePage::Reset_Impl( const SfxItemSet& rSet, LanguageGroup eLangGrp
{
bool bPtRel = MapUnit::MapPoint == rItem.GetPropUnit();
pSizeBox->SetPtRelative( bPtRel );
- pSizeBox->SetValue( bPtRel ? ((short)rItem.GetProp()) * 10 : rItem.GetProp() );
+ pSizeBox->SetValue( bPtRel ? static_cast<short>(rItem.GetProp()) * 10 : rItem.GetProp() );
}
else
{
@@ -1063,9 +1063,9 @@ bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLangGrp
if ( !bChanged && pExampleSet &&
pExampleSet->GetItemState( nWhich, false, &pItem ) == SfxItemState::SET )
{
- float fSize = (float)nSize / 10;
+ float fSize = static_cast<float>(nSize) / 10;
long nVal = CalcToUnit( fSize, rSet.GetPool()->GetMetric( nWhich ) );
- if ( static_cast<const SvxFontHeightItem*>(pItem)->GetHeight() != (sal_uInt32)nVal )
+ if ( static_cast<const SvxFontHeightItem*>(pItem)->GetHeight() != static_cast<sal_uInt32>(nVal) )
bChanged = true;
}
@@ -1081,14 +1081,14 @@ bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLangGrp
SvxFontHeightItem aHeight( 240, 100, nWhich );
if ( pSizeBox->IsPtRelative() )
- aHeight.SetHeight( rOldItem.GetHeight(), (sal_uInt16)( nSize / 10 ), MapUnit::MapPoint, eUnit );
+ aHeight.SetHeight( rOldItem.GetHeight(), static_cast<sal_uInt16>( nSize / 10 ), MapUnit::MapPoint, eUnit );
else
- aHeight.SetHeight( rOldItem.GetHeight(), (sal_uInt16)nSize );
+ aHeight.SetHeight( rOldItem.GetHeight(), static_cast<sal_uInt16>(nSize) );
rSet.Put( aHeight );
}
else
{
- float fSize = (float)nSize / 10;
+ float fSize = static_cast<float>(nSize) / 10;
rSet.Put( SvxFontHeightItem( CalcToUnit( fSize, eUnit ), 100, nWhich ) );
}
bModified = true;
@@ -2511,12 +2511,12 @@ void SvxCharEffectsPage::PageCreated(const SfxAllItemSet& aSet)
SvxCharPositionPage::SvxCharPositionPage( vcl::Window* pParent, const SfxItemSet& rInSet )
: SvxCharBasePage(pParent, "PositionPage", "cui/ui/positionpage.ui", rInSet)
- , m_nSuperEsc((short)DFLT_ESC_SUPER)
- , m_nSubEsc((short)DFLT_ESC_SUB)
+ , m_nSuperEsc(short(DFLT_ESC_SUPER))
+ , m_nSubEsc(short(DFLT_ESC_SUB))
, m_nScaleWidthItemSetVal(100)
, m_nScaleWidthInitialVal(100)
- , m_nSuperProp((sal_uInt8)DFLT_ESC_PROP)
- , m_nSubProp((sal_uInt8)DFLT_ESC_PROP)
+ , m_nSuperProp(sal_uInt8(DFLT_ESC_PROP))
+ , m_nSubProp(sal_uInt8(DFLT_ESC_PROP))
{
get(m_pHighPosBtn, "superscript");
get(m_pNormalPosBtn, "normal");
@@ -2686,8 +2686,8 @@ IMPL_LINK( SvxCharPositionPage, RotationHdl_Impl, Button*, pBtn, void )
IMPL_LINK_NOARG(SvxCharPositionPage, FontModifyHdl_Impl, Edit&, void)
{
- sal_uInt8 nEscProp = (sal_uInt8)m_pFontSizeMF->GetValue();
- short nEsc = (short)m_pHighLowMF->GetValue();
+ sal_uInt8 nEscProp = static_cast<sal_uInt8>(m_pFontSizeMF->GetValue());
+ short nEsc = static_cast<short>(m_pHighLowMF->GetValue());
nEsc *= m_pLowPosBtn->IsChecked() ? -1 : 1;
UpdatePreview_Impl( 100, nEscProp, nEsc );
}
@@ -2725,15 +2725,15 @@ IMPL_LINK_NOARG(SvxCharPositionPage, KerningModifyHdl_Impl, Edit&, void)
{
long nVal = static_cast<long>(m_pKerningMF->GetValue());
nVal = LogicToLogic( nVal, MapUnit::MapPoint, MapUnit::MapTwip );
- long nKern = (short)m_pKerningMF->Denormalize( nVal );
+ long nKern = static_cast<short>(m_pKerningMF->Denormalize( nVal ));
SvxFont& rFont = GetPreviewFont();
SvxFont& rCJKFont = GetPreviewCJKFont();
SvxFont& rCTLFont = GetPreviewCTLFont();
- rFont.SetFixKerning( (short)nKern );
- rCJKFont.SetFixKerning( (short)nKern );
- rCTLFont.SetFixKerning( (short)nKern );
+ rFont.SetFixKerning( static_cast<short>(nKern) );
+ rCJKFont.SetFixKerning( static_cast<short>(nKern) );
+ rCTLFont.SetFixKerning( static_cast<short>(nKern) );
m_pPreviewWin->Invalidate();
}
@@ -2748,16 +2748,16 @@ IMPL_LINK( SvxCharPositionPage, LoseFocusHdl_Impl, Control&, rControl, void )
if ( m_pHighLowMF == pField )
{
if ( bLow )
- m_nSubEsc = (short)m_pHighLowMF->GetValue() * -1;
+ m_nSubEsc = static_cast<short>(m_pHighLowMF->GetValue()) * -1;
else
- m_nSuperEsc = (short)m_pHighLowMF->GetValue();
+ m_nSuperEsc = static_cast<short>(m_pHighLowMF->GetValue());
}
else if ( m_pFontSizeMF == pField )
{
if ( bLow )
- m_nSubProp = (sal_uInt8)m_pFontSizeMF->GetValue();
+ m_nSubProp = static_cast<sal_uInt8>(m_pFontSizeMF->GetValue());
else
- m_nSuperProp = (sal_uInt8)m_pFontSizeMF->GetValue();
+ m_nSuperProp = static_cast<sal_uInt8>(m_pFontSizeMF->GetValue());
}
}
@@ -2787,10 +2787,10 @@ void SvxCharPositionPage::Reset( const SfxItemSet* rSet )
if ( !sUser.isEmpty() )
{
- m_nSuperEsc = (short)sUser.getToken( 0, ';' ).toInt32();
- m_nSubEsc = (short)sUser.getToken( 1, ';' ).toInt32();
- m_nSuperProp = (sal_uInt8)sUser.getToken( 2, ';' ).toInt32();
- m_nSubProp = (sal_uInt8)sUser.getToken( 3, ';' ).toInt32();
+ m_nSuperEsc = static_cast<short>(sUser.getToken( 0, ';' ).toInt32());
+ m_nSubEsc = static_cast<short>(sUser.getToken( 1, ';' ).toInt32());
+ m_nSuperProp = static_cast<sal_uInt8>(sUser.getToken( 2, ';' ).toInt32());
+ m_nSubProp = static_cast<sal_uInt8>(sUser.getToken( 3, ';' ).toInt32());
//fdo#75307 validate all the entries and discard all of them if any are
//out of range
@@ -2906,9 +2906,9 @@ void SvxCharPositionPage::Reset( const SfxItemSet* rSet )
// set Kerning at the Font, convert into Twips before
long nKern = LogicToLogic( rItem.GetValue(), eUnit, MapUnit::MapTwip );
- rFont.SetFixKerning( (short)nKern );
- rCJKFont.SetFixKerning( (short)nKern );
- rCTLFont.SetFixKerning( (short)nKern );
+ 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_pKerningMF->GetMax());
@@ -3034,10 +3034,10 @@ bool SvxCharPositionPage::FillItemSet( SfxItemSet* rSet )
nEsc = bHigh ? DFLT_ESC_AUTO_SUPER : DFLT_ESC_AUTO_SUB;
else
{
- nEsc = (short)m_pHighLowMF->Denormalize( m_pHighLowMF->GetValue() );
+ nEsc = static_cast<short>(m_pHighLowMF->Denormalize( m_pHighLowMF->GetValue() ));
nEsc *= (bHigh ? 1 : -1);
}
- nEscProp = (sal_uInt8)m_pFontSizeMF->Denormalize( m_pFontSizeMF->GetValue() );
+ nEscProp = static_cast<sal_uInt8>(m_pFontSizeMF->Denormalize( m_pFontSizeMF->GetValue() ));
}
else
{
@@ -3075,7 +3075,7 @@ bool SvxCharPositionPage::FillItemSet( SfxItemSet* rSet )
long nTmp = static_cast<long>(m_pKerningMF->GetValue());
long nVal = LogicToLogic( nTmp, MapUnit::MapPoint, eUnit );
- nKerning = (short)m_pKerningMF->Denormalize( nVal );
+ nKerning = static_cast<short>(m_pKerningMF->Denormalize( nVal ));
SfxItemState eOldKernState = rOldSet.GetItemState( nWhich, false );
if ( pOld )
@@ -3108,7 +3108,7 @@ bool SvxCharPositionPage::FillItemSet( SfxItemSet* rSet )
nWhich = GetWhich( SID_ATTR_CHAR_SCALEWIDTH );
if ( m_pScaleWidthMF->IsValueChangedFromSaved() )
{
- rSet->Put( SvxCharScaleWidthItem( (sal_uInt16)m_pScaleWidthMF->GetValue(), nWhich ) );
+ rSet->Put( SvxCharScaleWidthItem( static_cast<sal_uInt16>(m_pScaleWidthMF->GetValue()), nWhich ) );
bModified = true;
}
else if ( SfxItemState::DEFAULT == rOldSet.GetItemState( nWhich, false ) )
@@ -3218,7 +3218,7 @@ void SvxCharTwoLinesPage::SelectCharacter( ListBox* pBox )
if ( aDlg->Execute() == RET_OK )
{
- sal_Unicode cChar = (sal_Unicode) aDlg->GetChar();
+ sal_Unicode cChar = static_cast<sal_Unicode>(aDlg->GetChar());
SetBracket( cChar, bStart );
}
else
diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx
index 6009f92f9749..a6601edbe2cf 100644
--- a/cui/source/tabpages/grfpage.cxx
+++ b/cui/source/tabpages/grfpage.cxx
@@ -457,7 +457,7 @@ IMPL_LINK( SvxGrfCropPage, SizeHdl, Edit&, rField, void )
lcl_GetValue(*m_pRightMF, eUnit) );
if(!nWidth)
nWidth++;
- sal_uInt16 nZoom = (sal_uInt16)( aSize.Width() * 100 / nWidth);
+ sal_uInt16 nZoom = static_cast<sal_uInt16>( aSize.Width() * 100 / nWidth);
m_pWidthZoomMF->SetValue(nZoom);
}
else
@@ -467,7 +467,7 @@ IMPL_LINK( SvxGrfCropPage, SizeHdl, Edit&, rField, void )
lcl_GetValue(*m_pBottomMF, eUnit));
if(!nHeight)
nHeight++;
- sal_uInt16 nZoom = (sal_uInt16)( aSize.Height() * 100 / nHeight);
+ sal_uInt16 nZoom = static_cast<sal_uInt16>( aSize.Height() * 100 / nHeight);
m_pHeightZoomMF->SetValue(nZoom);
}
}
@@ -599,10 +599,10 @@ void SvxGrfCropPage::CalcZoom()
sal_uInt16 nZoom = 0;
long nDen;
if( (nDen = aOrigSize.Width() - nLRBorders) > 0)
- nZoom = (sal_uInt16)((( nWidth * 1000 / nDen )+5)/10);
+ nZoom = static_cast<sal_uInt16>((( nWidth * 1000 / nDen )+5)/10);
m_pWidthZoomMF->SetValue(nZoom);
if( (nDen = aOrigSize.Height() - nULBorders) > 0)
- nZoom = (sal_uInt16)((( nHeight * 1000 / nDen )+5)/10);
+ nZoom = static_cast<sal_uInt16>((( nHeight * 1000 / nDen )+5)/10);
else
nZoom = 0;
m_pHeightZoomMF->SetValue(nZoom);
@@ -699,10 +699,10 @@ void SvxGrfCropPage::GraphicHasChanged( bool bFound )
sTemp += OUStringLiteral1(0x00D7) + aFld->GetText();
if ( aOrigPixelSize.Width() && aOrigPixelSize.Height() ) {
- sal_Int32 ax = sal_Int32(floor((float)aOrigPixelSize.Width() /
- ((float)aOrigSize.Width()/TWIP_TO_INCH)+0.5));
- sal_Int32 ay = sal_Int32(floor((float)aOrigPixelSize.Height() /
- ((float)aOrigSize.Height()/TWIP_TO_INCH)+0.5));
+ sal_Int32 ax = sal_Int32(floor(static_cast<float>(aOrigPixelSize.Width()) /
+ (static_cast<float>(aOrigSize.Width())/TWIP_TO_INCH)+0.5));
+ sal_Int32 ay = sal_Int32(floor(static_cast<float>(aOrigPixelSize.Height()) /
+ (static_cast<float>(aOrigSize.Height())/TWIP_TO_INCH)+0.5));
sTemp += " ";
sTemp += CuiResId( RID_SVXSTR_PPI );
OUString sPPI = OUString::number(ax);
diff --git a/cui/source/tabpages/labdlg.cxx b/cui/source/tabpages/labdlg.cxx
index f16c4c81b4e4..384475316bac 100644
--- a/cui/source/tabpages/labdlg.cxx
+++ b/cui/source/tabpages/labdlg.cxx
@@ -269,7 +269,7 @@ void SvxCaptionTabPage::Reset( const SfxItemSet* )
nEscAbs = static_cast<long>(m_pMF_ANSATZ->GetValue());
nWhich = GetWhich( SDRATTR_CAPTIONESCREL );
- nEscRel = (long)static_cast<const SdrCaptionEscRelItem&>( rOutAttrs.Get( nWhich ) ).GetValue();
+ nEscRel = static_cast<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 63c5ed9104d4..f220327a9c15 100644
--- a/cui/source/tabpages/measure.cxx
+++ b/cui/source/tabpages/measure.cxx
@@ -318,7 +318,7 @@ void SvxMeasurePage::Reset( const SfxItemSet* rAttrs )
// SdrMeasureUnitItem
if( rAttrs->GetItemState( SDRATTR_MEASUREUNIT ) != SfxItemState::DONTCARE )
{
- long nFieldUnit = (long) rAttrs->Get( SDRATTR_MEASUREUNIT ).GetValue();
+ long nFieldUnit = static_cast<long>(rAttrs->Get( SDRATTR_MEASUREUNIT ).GetValue());
for( sal_Int32 i = 0; i < m_pLbUnit->GetEntryCount(); ++i )
{
@@ -511,7 +511,7 @@ bool SvxMeasurePage::FillItemSet( SfxItemSet* rAttrs)
{
if( nPos != LISTBOX_ENTRY_NOTFOUND )
{
- sal_uInt16 nFieldUnit = (sal_uInt16)reinterpret_cast<sal_IntPtr>(m_pLbUnit->GetEntryData( nPos ));
+ sal_uInt16 nFieldUnit = static_cast<sal_uInt16>(reinterpret_cast<sal_IntPtr>(m_pLbUnit->GetEntryData( nPos )));
FieldUnit _eUnit = (FieldUnit) nFieldUnit;
rAttrs->Put( SdrMeasureUnitItem( _eUnit ) );
bModified = true;
@@ -737,7 +737,7 @@ void SvxMeasurePage::ChangeAttrHdl_Impl( void const * p )
sal_Int32 nPos = m_pLbUnit->GetSelectedEntryPos();
if( nPos != LISTBOX_ENTRY_NOTFOUND )
{
- sal_uInt16 nFieldUnit = (sal_uInt16)reinterpret_cast<sal_IntPtr>(m_pLbUnit->GetEntryData( nPos ));
+ sal_uInt16 nFieldUnit = static_cast<sal_uInt16>(reinterpret_cast<sal_IntPtr>(m_pLbUnit->GetEntryData( nPos )));
FieldUnit _eUnit = (FieldUnit) nFieldUnit;
aAttrSet.Put( SdrMeasureUnitItem( _eUnit ) );
}
diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx
index d724ecacc61d..0466d11eec2d 100644
--- a/cui/source/tabpages/numfmt.cxx
+++ b/cui/source/tabpages/numfmt.cxx
@@ -918,7 +918,7 @@ void SvxNumberFormatTabPage::UpdateOptions_Impl( bool bCheckCatChange /*= sal_Fa
if(nCategory==CAT_CURRENCY)
{
sal_uInt16 nTstPos=pNumFmtShell->FindCurrencyFormat(theFormat);
- if(nCurrencyPos!=static_cast<sal_Int32>(nTstPos) && nTstPos!=(sal_uInt16)-1)
+ if(nCurrencyPos!=static_cast<sal_Int32>(nTstPos) && nTstPos!=sal_uInt16(-1))
{
m_pLbCurrency->SelectEntryPos(nTstPos);
pNumFmtShell->SetCurrencySymbol(nTstPos);
@@ -1095,7 +1095,7 @@ void SvxNumberFormatTabPage::UpdateFormatListBox_Impl
m_pFtComment->SetText(m_pLbCategory->GetEntry(1));
}
}
- ChangePreviewText( (sal_uInt16)nFmtLbSelPos );
+ ChangePreviewText( static_cast<sal_uInt16>(nFmtLbSelPos) );
}
}
@@ -1104,7 +1104,7 @@ void SvxNumberFormatTabPage::UpdateFormatListBox_Impl
FillFormatListBox_Impl( aEntryList );
if(nFmtLbSelPos != SELPOS_NONE)
{
- m_pLbFormat->SelectEntryPos( (sal_uInt16)nFmtLbSelPos );
+ m_pLbFormat->SelectEntryPos( static_cast<sal_uInt16>(nFmtLbSelPos) );
m_pFtComment->SetText(pNumFmtShell->GetComment4Entry(nFmtLbSelPos));
if(pNumFmtShell->GetUserDefined4Entry(nFmtLbSelPos))
@@ -1384,7 +1384,7 @@ bool SvxNumberFormatTabPage::Click_Impl(PushButton* pIB)
if(nCatLbSelPos==CAT_CURRENCY)
{
- m_pLbCurrency->SelectEntryPos((sal_uInt16)pNumFmtShell->GetCurrencySymbol());
+ m_pLbCurrency->SelectEntryPos(static_cast<sal_uInt16>(pNumFmtShell->GetCurrencySymbol()));
}
if(bOneAreaFlag && (nFixedCategory!=nCatLbSelPos))
@@ -1420,12 +1420,12 @@ bool SvxNumberFormatTabPage::Click_Impl(PushButton* pIB)
pNumFmtShell->SetComment4Entry(nFmtLbSelPos,
OUString());
}
- m_pLbFormat->SelectEntryPos( (sal_uInt16)nFmtLbSelPos );
+ m_pLbFormat->SelectEntryPos( static_cast<sal_uInt16>(nFmtLbSelPos) );
m_pEdFormat->SetText( aFormat );
m_pEdComment->SetText(m_pLbCategory->GetEntry(1)); // String for user defined
- ChangePreviewText( (sal_uInt16)nFmtLbSelPos );
+ ChangePreviewText( static_cast<sal_uInt16>(nFmtLbSelPos) );
}
}
}
@@ -1469,9 +1469,9 @@ bool SvxNumberFormatTabPage::Click_Impl(PushButton* pIB)
else
SetCategory(nCatLbSelPos );
- m_pLbFormat->SelectEntryPos( (sal_uInt16)nFmtLbSelPos );
+ m_pLbFormat->SelectEntryPos( static_cast<sal_uInt16>(nFmtLbSelPos) );
m_pEdFormat->SetText( aFormat );
- ChangePreviewText( (sal_uInt16)nFmtLbSelPos );
+ ChangePreviewText( static_cast<sal_uInt16>(nFmtLbSelPos) );
}
else
{
@@ -1549,12 +1549,12 @@ void SvxNumberFormatTabPage::EditHdl_Impl( Edit const * pEdFormat )
{
sal_uInt16 nTmpCurPos=pNumFmtShell->FindCurrencyFormat(aFormat );
- if(nTmpCurPos!=(sal_uInt16)-1)
+ if(nTmpCurPos!=sal_uInt16(-1))
m_pLbCurrency->SelectEntryPos(nTmpCurPos);
}
short nPosi=pNumFmtShell->GetListPos4Entry(aFormat);
if(nPosi>=0)
- m_pLbFormat->SelectEntryPos( (sal_uInt16)nPosi);
+ m_pLbFormat->SelectEntryPos( static_cast<sal_uInt16>(nPosi));
}
else
@@ -1610,13 +1610,13 @@ void SvxNumberFormatTabPage::OptHdl_Impl( void const * pOptCtrl )
|| ( m_pBtnEngineering->IsVisible() && m_pBtnEngineering->IsEnabled() && m_pBtnEngineering->IsChecked() );
bool bNegRed = m_pBtnNegRed->IsEnabled() && m_pBtnNegRed->IsChecked();
sal_uInt16 nPrecision = (m_pEdDecimals->IsEnabled() && m_pEdDecimals->IsVisible())
- ? (sal_uInt16)m_pEdDecimals->GetValue()
+ ? static_cast<sal_uInt16>(m_pEdDecimals->GetValue())
: ( (m_pEdDenominator->IsEnabled() && m_pEdDenominator->IsVisible())
- ? (sal_uInt16)m_pEdDenominator->GetValue()
- : (sal_uInt16)0 );
+ ? static_cast<sal_uInt16>(m_pEdDenominator->GetValue())
+ : sal_uInt16(0) );
sal_uInt16 nLeadZeroes = (m_pEdLeadZeroes->IsEnabled())
- ? (sal_uInt16)m_pEdLeadZeroes->GetValue()
- : (sal_uInt16)0;
+ ? static_cast<sal_uInt16>(m_pEdLeadZeroes->GetValue())
+ : sal_uInt16(0);
if ( pNumFmtShell->GetStandardName() == m_pEdFormat->GetText() )
{
m_pEdDecimals->SetValue( nPrecision );
@@ -1625,7 +1625,7 @@ void SvxNumberFormatTabPage::OptHdl_Impl( void const * pOptCtrl )
pNumFmtShell->MakeFormat( aFormat,
bThousand, bNegRed,
nPrecision, nLeadZeroes,
- (sal_uInt16)m_pLbFormat->GetSelectedEntryPos() );
+ static_cast<sal_uInt16>(m_pLbFormat->GetSelectedEntryPos()) );
m_pEdFormat->SetText( aFormat );
MakePreviewText( aFormat );
@@ -1675,7 +1675,7 @@ IMPL_LINK( SvxNumberFormatTabPage, LostFocusHdl_Impl, Control&, rControl, void)
m_pFtComment->Show();
if(!m_pIbAdd->IsEnabled())
{
- sal_uInt16 nSelPos = (sal_uInt16) m_pLbFormat->GetSelectedEntryPos();
+ sal_uInt16 nSelPos = static_cast<sal_uInt16>(m_pLbFormat->GetSelectedEntryPos());
pNumFmtShell->SetComment4Entry(nSelPos,
m_pEdComment->GetText());
m_pEdComment->SetText(m_pLbCategory->GetEntry(1)); // String for user defined
@@ -1813,7 +1813,7 @@ void SvxNumberFormatTabPage::AddAutomaticLanguage_Impl(LanguageType eAutoLang, b
{
m_pLbLanguage->RemoveLanguage(LANGUAGE_SYSTEM);
const sal_Int32 nPos = m_pLbLanguage->InsertEntry(sAutomaticEntry);
- m_pLbLanguage->SetEntryData(nPos, reinterpret_cast<void*>((sal_uInt16)eAutoLang));
+ m_pLbLanguage->SetEntryData(nPos, reinterpret_cast<void*>(static_cast<sal_uInt16>(eAutoLang)));
if(bSelect)
m_pLbLanguage->SelectEntryPos(nPos);
}
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index c8cded8ce25d..53495f6168af 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -705,7 +705,7 @@ IMPL_LINK_NOARG(SvxNumPickTabPage, NumSelectHdl_Impl, ValueSet*, void)
break;
SvxNumberFormat aFmt(pActNum->GetLevel(i));
aFmt.SetNumberingType( pLevelSettings->nNumberType );
- sal_uInt16 nUpperLevelOrChar = (sal_uInt16)pLevelSettings->nParentNumbering;
+ sal_uInt16 nUpperLevelOrChar = static_cast<sal_uInt16>(pLevelSettings->nParentNumbering);
if(aFmt.GetNumberingType() == SVX_NUM_CHAR_SPECIAL)
{
// #i93908# clear suffix for bullet lists
@@ -1022,16 +1022,16 @@ IMPL_LINK_NOARG(SvxBitmapPickTabPage, ClickAddBrowseHdl_Impl, Button*, void)
BitmapEx aBitmap = aGraphic.GetBitmapEx();
long nPixelX = aBitmap.GetSizePixel().Width();
long nPixelY = aBitmap.GetSizePixel().Height();
- double ratio = nPixelY/(double)nPixelX;
+ double ratio = nPixelY/static_cast<double>(nPixelX);
if(nPixelX > 30)
{
nPixelX = 30;
- nPixelY = (long) (nPixelX*ratio);
+ nPixelY = static_cast<long>(nPixelX*ratio);
}
if(nPixelY > 30)
{
nPixelY = 30;
- nPixelX = (long) (nPixelY/ratio);
+ nPixelX = static_cast<long>(nPixelY/ratio);
}
aBitmap.Scale( Size( nPixelX, nPixelY ), BmpScaleFlag::Fast );
@@ -1040,9 +1040,9 @@ IMPL_LINK_NOARG(SvxBitmapPickTabPage, ClickAddBrowseHdl_Impl, Button*, void)
Sequence< PropertyValue > aFilterData( 2 );
aFilterData[ 0 ].Name = "Compression";
- aFilterData[ 0 ].Value <<= (sal_Int32) -1 ;
+ aFilterData[ 0 ].Value <<= sal_Int32(-1) ;
aFilterData[ 1 ].Name = "Quality";
- aFilterData[ 1 ].Value <<= (sal_Int32) 1;
+ aFilterData[ 1 ].Value <<= sal_Int32(1);
sal_uInt16 nFilterFormat = rFilter.GetExportFormatNumberForShortName( gURL.GetFileExtension() );
rFilter.ExportGraphic( aScaledGraphic, gURL , nFilterFormat, &aFilterData );
@@ -1399,7 +1399,7 @@ void SvxNumOptionsTabPage::Reset( const SfxItemSet* rSet )
sal_Int32 nFmtCount = m_pFmtLB->GetEntryCount();
for(sal_Int32 i = nFmtCount; i; i--)
{
- sal_uInt16 nEntryData = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pFmtLB->GetEntryData(i - 1));
+ sal_uInt16 nEntryData = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pFmtLB->GetEntryData(i - 1)));
if(/*SVX_NUM_NUMBER_NONE == nEntryData ||*/
(SVX_NUM_BITMAP|LINK_TOKEN) == nEntryData)
m_pFmtLB->RemoveEntry(i - 1);
@@ -1426,7 +1426,7 @@ void SvxNumOptionsTabPage::Reset( const SfxItemSet* rSet )
sal_Int32 nFmtCount = m_pFmtLB->GetEntryCount();
for(sal_Int32 i = nFmtCount; i; i--)
{
- sal_uInt16 nEntryData = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pFmtLB->GetEntryData(i - 1));
+ sal_uInt16 nEntryData = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pFmtLB->GetEntryData(i - 1)));
if( /*nEntryData >= SVX_NUM_CHARS_UPPER_LETTER &&*/ nEntryData <= SVX_NUM_NUMBER_NONE)
m_pFmtLB->RemoveEntry(i - 1);
}
@@ -1724,7 +1724,7 @@ IMPL_LINK( SvxNumOptionsTabPage, AllLevelHdl_Impl, Edit&, rBox, void )
if(nActNumLvl & nMask)
{
SvxNumberFormat aNumFmt(pActNum->GetLevel(e));
- aNumFmt.SetIncludeUpperLevels((sal_uInt8) std::min(static_cast<NumericField&>(rBox).GetValue(), sal_Int64(e + 1)) );
+ aNumFmt.SetIncludeUpperLevels(static_cast<sal_uInt8>(std::min(static_cast<NumericField&>(rBox).GetValue(), sal_Int64(e + 1))) );
pActNum->SetLevel(e, aNumFmt);
}
nMask <<= 1;
@@ -1839,7 +1839,7 @@ IMPL_LINK( SvxNumOptionsTabPage, OrientHdl_Impl, ListBox&, rBox, void )
{
const SvxBrushItem* pBrushItem = aNumFmt.GetBrush();
const Size& rSize = aNumFmt.GetGraphicSize();
- sal_Int16 eOrient = (sal_Int16)nPos;
+ sal_Int16 eOrient = static_cast<sal_Int16>(nPos);
aNumFmt.SetGraphicBrush( pBrushItem, &rSize, &eOrient );
pActNum->SetLevel(i, aNumFmt);
}
@@ -1887,7 +1887,7 @@ IMPL_LINK(SvxNumOptionsTabPage, BulColorHdl_Impl, SvxColorListBox&, rColorBox, v
IMPL_LINK( SvxNumOptionsTabPage, BulRelSizeHdl_Impl, Edit&, rField, void)
{
- sal_uInt16 nRelSize = (sal_uInt16)static_cast<MetricField&>(rField).GetValue();
+ sal_uInt16 nRelSize = static_cast<sal_uInt16>(static_cast<MetricField&>(rField).GetValue());
sal_uInt16 nMask = 1;
for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
@@ -2014,8 +2014,8 @@ IMPL_LINK_NOARG(SvxNumOptionsTabPage, PopupActivateHdl_Impl, MenuButton *, void)
{
bool bWidth = aSize.Width() > aSize.Height();
double nScale = bWidth ?
- (double)MAX_BMP_WIDTH / (double)aSize.Width():
- (double)MAX_BMP_HEIGHT / (double)aSize.Height();
+ double(MAX_BMP_WIDTH) / static_cast<double>(aSize.Width()):
+ double(MAX_BMP_HEIGHT) / static_cast<double>(aSize.Height());
aBitmap.Scale(nScale, nScale);
}
Image aImage(aBitmap);
@@ -2084,7 +2084,7 @@ IMPL_LINK_NOARG(SvxNumOptionsTabPage, BulletHdl_Impl, Button*, void)
{
SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
aNumFmt.SetBulletFont(&aActBulletFont);
- aNumFmt.SetBulletChar( (sal_Unicode) pMap->GetChar() );
+ aNumFmt.SetBulletChar( static_cast<sal_Unicode>(pMap->GetChar()) );
pActNum->SetLevel(i, aNumFmt);
}
_nMask <<= 1;
@@ -2120,9 +2120,9 @@ IMPL_LINK( SvxNumOptionsTabPage, SizeHdl_Impl, Edit&, rField, void)
Size aSaveSize(aSize);
if (aInitSize[i].Height())
- fSizeRatio = (double)aInitSize[i].Width() / (double)aInitSize[i].Height();
+ fSizeRatio = static_cast<double>(aInitSize[i].Width()) / static_cast<double>(aInitSize[i].Height());
else
- fSizeRatio = (double)1;
+ fSizeRatio = double(1);
if(bWidth)
{
@@ -2130,7 +2130,7 @@ IMPL_LINK( SvxNumOptionsTabPage, SizeHdl_Impl, Edit&, rField, void)
aSize.Width() = nWidthVal;
if (bRatio)
{
- aSize.Height() = aInitSize[i].Height() + (long)((double)nDelta / fSizeRatio);
+ aSize.Height() = aInitSize[i].Height() + static_cast<long>(static_cast<double>(nDelta) / fSizeRatio);
m_pHeightMF->SetUserValue(m_pHeightMF->Normalize(
OutputDevice::LogicToLogic( aSize.Height(), eCoreUnit, MapUnit::Map100thMM )),
FUNIT_100TH_MM);
@@ -2142,7 +2142,7 @@ IMPL_LINK( SvxNumOptionsTabPage, SizeHdl_Impl, Edit&, rField, void)
aSize.Height() = nHeightVal;
if (bRatio)
{
- aSize.Width() = aInitSize[i].Width() + (long)((double)nDelta * fSizeRatio);
+ aSize.Width() = aInitSize[i].Width() + static_cast<long>(static_cast<double>(nDelta) * fSizeRatio);
m_pWidthMF->SetUserValue(m_pWidthMF->Normalize(
OutputDevice::LogicToLogic( aSize.Width(), eCoreUnit, MapUnit::Map100thMM )),
FUNIT_100TH_MM);
@@ -2221,7 +2221,7 @@ void SvxNumOptionsTabPage::EditModifyHdl_Impl( Edit* pEdit )
else if(bSuffix)
aNumFmt.SetSuffix( m_pSuffixED->GetText() );
else if(bStart)
- aNumFmt.SetStart( (sal_uInt16)m_pStartED->GetValue() );
+ aNumFmt.SetStart( static_cast<sal_uInt16>(m_pStartED->GetValue()) );
pActNum->SetLevel(i, aNumFmt);
}
nMask <<= 1;
@@ -2241,7 +2241,7 @@ static sal_uInt16 lcl_DrawGraphic(VirtualDevice* pVDev, const SvxNumberFormat &r
{
Size aGSize( rFmt.GetGraphicSize() );
aGSize.Width() /= nDivision;
- nRet = (sal_uInt16)aGSize.Width();
+ nRet = static_cast<sal_uInt16>(aGSize.Width());
aGSize.Height() /= nDivision;
pGrf->Draw( pVDev, Point(nXStart,nYMiddle - ( aGSize.Height() / 2) ),
pVDev->PixelToLogic( aGSize ) );
@@ -2280,7 +2280,7 @@ static sal_uInt16 lcl_DrawBullet(VirtualDevice* pVDev,
long nY = nYStart;
nY -= ((aTmpSize.Height() - rSize.Height())/ 2);
pVDev->DrawText( Point(nXStart, nY), aText );
- sal_uInt16 nRet = (sal_uInt16)pVDev->GetTextWidth(aText);
+ sal_uInt16 nRet = static_cast<sal_uInt16>(pVDev->GetTextWidth(aText));
pVDev->SetFont(aTmpFont);
return nRet;
@@ -2425,7 +2425,7 @@ void SvxNumberingPreview::Paint(vcl::RenderContext& rRenderContext, const ::tool
pVDev->SetFont(aStdFont);
OUString aText(' ');
pVDev->DrawText( Point(nNumberXPos, nYStart), aText );
- nBulletWidth = nBulletWidth + (sal_uInt16)pVDev->GetTextWidth(aText);
+ nBulletWidth = nBulletWidth + static_cast<sal_uInt16>(pVDev->GetTextWidth(aText));
}
sal_uInt16 nTextXPos( 0 );
@@ -2540,7 +2540,7 @@ void SvxNumberingPreview::Paint(vcl::RenderContext& rRenderContext, const ::tool
OUString aText(pActNum->MakeNumString(aNum));
pVDev->DrawText(Point(nXStart, nYStart), aText);
pVDev->SetFont(aStdFont);
- nTextOffset = (sal_uInt16)pVDev->GetTextWidth(aText);
+ nTextOffset = static_cast<sal_uInt16>(pVDev->GetTextWidth(aText));
nTextOffset = nTextOffset + nXStep;
nPreNum++;
}
@@ -2813,13 +2813,13 @@ void SvxNumPositionTabPage::InitControls()
long nDistBorderNum;
if(bRelative)
{
- nDistBorderNum = (long)aNumFmtArr[nLvl]->GetAbsLSpace()+ aNumFmtArr[nLvl]->GetFirstLineOffset();
+ nDistBorderNum = static_cast<long>(aNumFmtArr[nLvl]->GetAbsLSpace())+ aNumFmtArr[nLvl]->GetFirstLineOffset();
if(nLvl)
- nDistBorderNum -= (long)aNumFmtArr[nLvl - 1]->GetAbsLSpace()+ aNumFmtArr[nLvl - 1]->GetFirstLineOffset();
+ nDistBorderNum -= static_cast<long>(aNumFmtArr[nLvl - 1]->GetAbsLSpace())+ aNumFmtArr[nLvl - 1]->GetFirstLineOffset();
}
else
{
- nDistBorderNum = (long)aNumFmtArr[nLvl]->GetAbsLSpace()+ aNumFmtArr[nLvl]->GetFirstLineOffset();
+ nDistBorderNum = static_cast<long>(aNumFmtArr[nLvl]->GetAbsLSpace())+ aNumFmtArr[nLvl]->GetFirstLineOffset();
}
SetMetricValue(*m_pDistBorderMF, nDistBorderNum, eCoreUnit);
}
@@ -3241,12 +3241,12 @@ IMPL_LINK( SvxNumPositionTabPage, DistanceHdl_Impl, SpinField&, rFld, void )
}
else
{
- aNumFmt.SetAbsLSpace( (short)nValue - aNumFmt.GetFirstLineOffset());
+ aNumFmt.SetAbsLSpace( static_cast<short>(nValue) - aNumFmt.GetFirstLineOffset());
}
}
else if (&rFld == m_pDistNumMF)
{
- aNumFmt.SetCharTextDistance( (short)nValue );
+ aNumFmt.SetCharTextDistance( static_cast<short>(nValue) );
}
else if (&rFld == m_pIndentMF)
{
@@ -3254,7 +3254,7 @@ IMPL_LINK( SvxNumPositionTabPage, DistanceHdl_Impl, SpinField&, rFld, void )
long nDiff = nValue + aNumFmt.GetFirstLineOffset();
long nAbsLSpace = aNumFmt.GetAbsLSpace();
aNumFmt.SetAbsLSpace(sal_uInt16(nAbsLSpace + nDiff));
- aNumFmt.SetFirstLineOffset( -(short)nValue );
+ aNumFmt.SetFirstLineOffset( -static_cast<short>(nValue) );
}
pActNum->SetLevel( i, aNumFmt );
diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx
index 4f2303c28a40..36548ec99905 100644
--- a/cui/source/tabpages/page.cxx
+++ b/cui/source/tabpages/page.cxx
@@ -133,10 +133,10 @@ bool IsEqualSize_Impl( const SvxSizeItem* pSize, const Size& rSize )
}
-#define MARGIN_LEFT ( (MarginPosition)0x0001 )
-#define MARGIN_RIGHT ( (MarginPosition)0x0002 )
-#define MARGIN_TOP ( (MarginPosition)0x0004 )
-#define MARGIN_BOTTOM ( (MarginPosition)0x0008 )
+#define MARGIN_LEFT ( MarginPosition(0x0001) )
+#define MARGIN_RIGHT ( MarginPosition(0x0002) )
+#define MARGIN_TOP ( MarginPosition(0x0004) )
+#define MARGIN_BOTTOM ( MarginPosition(0x0008) )
// class SvxPageDescPage --------------------------------------------------
@@ -420,10 +420,10 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet )
const SvxLRSpaceItem& rLRSpace = static_cast<const SvxLRSpaceItem&>(*pItem);
SetMetricValue( *m_pLeftMarginEdit, rLRSpace.GetLeft(), eUnit );
m_pBspWin->SetLeft(
- (sal_uInt16)ConvertLong_Impl( rLRSpace.GetLeft(), eUnit ) );
+ static_cast<sal_uInt16>(ConvertLong_Impl( rLRSpace.GetLeft(), eUnit )) );
SetMetricValue( *m_pRightMarginEdit, rLRSpace.GetRight(), eUnit );
m_pBspWin->SetRight(
- (sal_uInt16)ConvertLong_Impl( rLRSpace.GetRight(), eUnit ) );
+ static_cast<sal_uInt16>(ConvertLong_Impl( rLRSpace.GetRight(), eUnit )) );
}
// adjust margins (top/bottom)
@@ -434,10 +434,10 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet )
const SvxULSpaceItem& rULSpace = static_cast<const SvxULSpaceItem&>(*pItem);
SetMetricValue( *m_pTopMarginEdit, rULSpace.GetUpper(), eUnit );
m_pBspWin->SetTop(
- (sal_uInt16)ConvertLong_Impl( (long)rULSpace.GetUpper(), eUnit ) );
+ static_cast<sal_uInt16>(ConvertLong_Impl( static_cast<long>(rULSpace.GetUpper()), eUnit )) );
SetMetricValue( *m_pBottomMarginEdit, rULSpace.GetLower(), eUnit );
m_pBspWin->SetBottom(
- (sal_uInt16)ConvertLong_Impl( (long)rULSpace.GetLower(), eUnit ) );
+ static_cast<sal_uInt16>(ConvertLong_Impl( static_cast<long>(rULSpace.GetLower()), eUnit )) );
}
// general page data
@@ -462,7 +462,7 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet )
//adjust numeration type of the page style
//Get the Position of the saved NumType
for(int i=0; i<m_pNumberFormatBox->GetEntryCount(); i++)
- if(eNumType == (sal_uInt16)reinterpret_cast<sal_uLong>(m_pNumberFormatBox->GetEntryData(i)))
+ if(eNumType == static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pNumberFormatBox->GetEntryData(i))))
{
m_pNumberFormatBox->SelectEntryPos( i );
break;
@@ -485,10 +485,10 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet )
if ( PAPERBIN_PRINTER_SETTINGS == nPaperBin )
aBinName = EditResId(RID_SVXSTR_PAPERBIN_SETTINGS);
else
- aBinName = mpDefPrinter->GetPaperBinName( (sal_uInt16)nPaperBin );
+ aBinName = mpDefPrinter->GetPaperBinName( static_cast<sal_uInt16>(nPaperBin) );
const sal_Int32 nEntryPos = m_pPaperTrayBox->InsertEntry( aBinName );
- m_pPaperTrayBox->SetEntryData( nEntryPos, reinterpret_cast<void*>((sal_uLong)nPaperBin) );
+ m_pPaperTrayBox->SetEntryData( nEntryPos, reinterpret_cast<void*>(static_cast<sal_uLong>(nPaperBin)) );
m_pPaperTrayBox->SelectEntry( aBinName );
Size aPaperSize = SvxPaperInfo::GetPaperSize( mpDefPrinter );
@@ -662,13 +662,13 @@ bool SvxPageDescPage::FillItemSet( SfxItemSet* rSet )
if ( m_pLeftMarginEdit->IsValueChangedFromSaved() )
{
- aMargin.SetLeft( (sal_uInt16)GetCoreValue( *m_pLeftMarginEdit, eUnit ) );
+ aMargin.SetLeft( static_cast<sal_uInt16>(GetCoreValue( *m_pLeftMarginEdit, eUnit )) );
bModified = true;
}
if ( m_pRightMarginEdit->IsValueChangedFromSaved() )
{
- aMargin.SetRight( (sal_uInt16)GetCoreValue( *m_pRightMarginEdit, eUnit ) );
+ aMargin.SetRight( static_cast<sal_uInt16>(GetCoreValue( *m_pRightMarginEdit, eUnit )) );
bModified = true;
}
@@ -687,13 +687,13 @@ bool SvxPageDescPage::FillItemSet( SfxItemSet* rSet )
if ( m_pTopMarginEdit->IsValueChangedFromSaved() )
{
- aTopMargin.SetUpper( (sal_uInt16)GetCoreValue( *m_pTopMarginEdit, eUnit ) );
+ aTopMargin.SetUpper( static_cast<sal_uInt16>(GetCoreValue( *m_pTopMarginEdit, eUnit )) );
bMod = true;
}
if ( m_pBottomMarginEdit->IsValueChangedFromSaved() )
{
- aTopMargin.SetLower( (sal_uInt16)GetCoreValue( *m_pBottomMarginEdit, eUnit ) );
+ aTopMargin.SetLower( static_cast<sal_uInt16>(GetCoreValue( *m_pBottomMarginEdit, eUnit )) );
bMod = true;
}
@@ -713,12 +713,12 @@ bool SvxPageDescPage::FillItemSet( SfxItemSet* rSet )
// paper tray
nWhich = GetWhich( SID_ATTR_PAGE_PAPERBIN );
sal_Int32 nPos = m_pPaperTrayBox->GetSelectedEntryPos();
- sal_uInt16 nBin = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pPaperTrayBox->GetEntryData( nPos ));
+ sal_uInt16 nBin = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pPaperTrayBox->GetEntryData( nPos )));
pOld = GetOldItem( *rSet, SID_ATTR_PAGE_PAPERBIN );
if ( !pOld || static_cast<const SvxPaperBinItem*>(pOld)->GetValue() != nBin )
{
- rSet->Put( SvxPaperBinItem( nWhich, (sal_uInt8)nBin ) );
+ rSet->Put( SvxPaperBinItem( nWhich, static_cast<sal_uInt8>(nBin) ) );
bModified = true;
}
@@ -901,7 +901,7 @@ IMPL_LINK_NOARG(SvxPageDescPage, PaperBinHdl_Impl, Control&, void)
sal_Int32 nEntryPos = m_pPaperTrayBox->InsertEntry(
EditResId( RID_SVXSTR_PAPERBIN_SETTINGS ) );
m_pPaperTrayBox->SetEntryData( nEntryPos,
- reinterpret_cast<void*>((sal_uLong)PAPERBIN_PRINTER_SETTINGS) );
+ reinterpret_cast<void*>(sal_uLong(PAPERBIN_PRINTER_SETTINGS)) );
OUString aPaperBin( EditResId( RID_SVXSTR_PAPERBIN ) );
const sal_uInt16 nBinCount = mpDefPrinter->GetPaperBinCount();
@@ -914,7 +914,7 @@ IMPL_LINK_NOARG(SvxPageDescPage, PaperBinHdl_Impl, Control&, void)
aName = aPaperBin + " " + OUString::number( i+1 );
}
nEntryPos = m_pPaperTrayBox->InsertEntry( aName );
- m_pPaperTrayBox->SetEntryData( nEntryPos, reinterpret_cast<void*>((sal_uLong)i) );
+ m_pPaperTrayBox->SetEntryData( nEntryPos, reinterpret_cast<void*>(static_cast<sal_uLong>(i)) );
}
m_pPaperTrayBox->SelectEntry( aOldName );
m_pPaperTrayBox->SetUpdateMode( true );
diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx
index a16097152592..fc050eb31451 100644
--- a/cui/source/tabpages/paragrph.cxx
+++ b/cui/source/tabpages/paragrph.cxx
@@ -124,21 +124,21 @@ void SetLineSpace_Impl( SvxLineSpacingItem& rLineSpace,
case LLINESPACE_PROP:
rLineSpace.SetLineSpaceRule( SvxLineSpaceRule::Auto );
- rLineSpace.SetPropLineSpace( (sal_uInt8)lValue );
+ rLineSpace.SetPropLineSpace( static_cast<sal_uInt8>(lValue) );
break;
case LLINESPACE_MIN:
- rLineSpace.SetLineHeight( (sal_uInt16)lValue );
+ rLineSpace.SetLineHeight( static_cast<sal_uInt16>(lValue) );
rLineSpace.SetInterLineSpaceRule( SvxInterLineSpaceRule::Off );
break;
case LLINESPACE_DURCH:
rLineSpace.SetLineSpaceRule( SvxLineSpaceRule::Auto );
- rLineSpace.SetInterLineSpace( (sal_uInt16)lValue );
+ rLineSpace.SetInterLineSpace( static_cast<sal_uInt16>(lValue) );
break;
case LLINESPACE_FIX:
- rLineSpace.SetLineHeight((sal_uInt16)lValue);
+ rLineSpace.SetLineHeight(static_cast<sal_uInt16>(lValue));
rLineSpace.SetLineSpaceRule( SvxLineSpaceRule::Fix );
rLineSpace.SetInterLineSpaceRule( SvxInterLineSpaceRule::Off );
break;
@@ -277,21 +277,21 @@ bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet* rOutSet )
if ( m_pTopDist->IsRelative() )
aMargin.SetUpper( rOldItem.GetUpper(),
- (sal_uInt16)m_pTopDist->GetValue() );
+ static_cast<sal_uInt16>(m_pTopDist->GetValue()) );
else
- aMargin.SetUpper( (sal_uInt16)GetCoreValue( *m_pTopDist, eUnit ) );
+ aMargin.SetUpper( static_cast<sal_uInt16>(GetCoreValue( *m_pTopDist, eUnit )) );
if ( m_pBottomDist->IsRelative() )
aMargin.SetLower( rOldItem.GetLower(),
- (sal_uInt16)m_pBottomDist->GetValue() );
+ static_cast<sal_uInt16>(m_pBottomDist->GetValue()) );
else
- aMargin.SetLower( (sal_uInt16)GetCoreValue( *m_pBottomDist, eUnit ) );
+ aMargin.SetLower( static_cast<sal_uInt16>(GetCoreValue( *m_pBottomDist, eUnit )) );
}
else
{
- aMargin.SetUpper( (sal_uInt16)GetCoreValue( *m_pTopDist, eUnit ) );
- aMargin.SetLower( (sal_uInt16)GetCoreValue( *m_pBottomDist, eUnit ) );
+ aMargin.SetUpper( static_cast<sal_uInt16>(GetCoreValue( *m_pTopDist, eUnit )) );
+ aMargin.SetLower( static_cast<sal_uInt16>(GetCoreValue( *m_pBottomDist, eUnit )) );
}
aMargin.SetContextValue(m_pContextualCB->IsChecked());
eState = GetItemSet().GetItemState( nWhich );
@@ -324,29 +324,29 @@ bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet* rOutSet )
if ( m_pLeftIndent->IsRelative() )
aMargin.SetTextLeft( rOldItem.GetTextLeft(),
- (sal_uInt16)m_pLeftIndent->GetValue() );
+ static_cast<sal_uInt16>(m_pLeftIndent->GetValue()) );
else
aMargin.SetTextLeft( GetCoreValue( *m_pLeftIndent, eUnit ) );
if ( m_pRightIndent->IsRelative() )
aMargin.SetRight( rOldItem.GetRight(),
- (sal_uInt16)m_pRightIndent->GetValue() );
+ static_cast<sal_uInt16>(m_pRightIndent->GetValue()) );
else
aMargin.SetRight( GetCoreValue( *m_pRightIndent, eUnit ) );
if ( m_pFLineIndent->IsRelative() )
aMargin.SetTextFirstLineOfst( rOldItem.GetTextFirstLineOfst(),
- (sal_uInt16)m_pFLineIndent->GetValue() );
+ static_cast<sal_uInt16>(m_pFLineIndent->GetValue()) );
else
aMargin.SetTextFirstLineOfst(
- (sal_uInt16)GetCoreValue( *m_pFLineIndent, eUnit ) );
+ static_cast<sal_uInt16>(GetCoreValue( *m_pFLineIndent, eUnit )) );
}
else
{
aMargin.SetTextLeft( GetCoreValue( *m_pLeftIndent, eUnit ) );
aMargin.SetRight( GetCoreValue( *m_pRightIndent, eUnit ) );
aMargin.SetTextFirstLineOfst(
- (sal_uInt16)GetCoreValue( *m_pFLineIndent, eUnit ) );
+ static_cast<sal_uInt16>(GetCoreValue( *m_pFLineIndent, eUnit )) );
}
aMargin.SetAutoFirst(m_pAutoCB->IsChecked());
if ( aMargin.GetTextFirstLineOfst() < 0 )
@@ -879,11 +879,11 @@ void SvxStdParagraphTabPage::Init_Impl()
void SvxStdParagraphTabPage::UpdateExample_Impl()
{
- m_pExampleWin->SetFirstLineOfst( (short)m_pFLineIndent->Denormalize( m_pFLineIndent->GetValue( FUNIT_TWIP ) ) );
+ m_pExampleWin->SetFirstLineOfst( static_cast<short>(m_pFLineIndent->Denormalize( m_pFLineIndent->GetValue( FUNIT_TWIP ) )) );
m_pExampleWin->SetLeftMargin( static_cast<long>(m_pLeftIndent->Denormalize( m_pLeftIndent->GetValue( FUNIT_TWIP ) ) ) );
m_pExampleWin->SetRightMargin( static_cast<long>(m_pRightIndent->Denormalize( m_pRightIndent->GetValue( FUNIT_TWIP ) ) ) );
- m_pExampleWin->SetUpper( (sal_uInt16)m_pTopDist->Denormalize( m_pTopDist->GetValue( FUNIT_TWIP ) ) );
- m_pExampleWin->SetLower( (sal_uInt16)m_pBottomDist->Denormalize( m_pBottomDist->GetValue( FUNIT_TWIP ) ) );
+ m_pExampleWin->SetUpper( static_cast<sal_uInt16>(m_pTopDist->Denormalize( m_pTopDist->GetValue( FUNIT_TWIP ) )) );
+ m_pExampleWin->SetLower( static_cast<sal_uInt16>(m_pBottomDist->Denormalize( m_pBottomDist->GetValue( FUNIT_TWIP ) )) );
sal_Int32 nPos = m_pLineDist->GetSelectedEntryPos();
@@ -1381,10 +1381,10 @@ bool SvxExtParagraphTabPage::FillItemSet( SfxItemSet* rOutSet )
if ( eHyphenState == TRISTATE_TRUE )
{
- aHyphen.GetMinLead() = (sal_uInt8)m_pExtHyphenBeforeBox->GetValue();
- aHyphen.GetMinTrail() = (sal_uInt8)m_pExtHyphenAfterBox->GetValue();
+ aHyphen.GetMinLead() = static_cast<sal_uInt8>(m_pExtHyphenBeforeBox->GetValue());
+ aHyphen.GetMinTrail() = static_cast<sal_uInt8>(m_pExtHyphenAfterBox->GetValue());
}
- aHyphen.GetMaxHyphens() = (sal_uInt8)m_pMaxHyphenEdit->GetValue();
+ aHyphen.GetMaxHyphens() = static_cast<sal_uInt8>(m_pMaxHyphenEdit->GetValue());
if ( !pOld ||
!( *static_cast<const SvxHyphenZoneItem*>(pOld) == aHyphen ) ||
@@ -1542,7 +1542,7 @@ bool SvxExtParagraphTabPage::FillItemSet( SfxItemSet* rOutSet )
m_pWidowRowNo->IsValueModified() )
{
SvxWidowsItem rItem( eState == TRISTATE_TRUE ?
- (sal_uInt8)m_pWidowRowNo->GetValue() : 0, _nWhich );
+ static_cast<sal_uInt8>(m_pWidowRowNo->GetValue()) : 0, _nWhich );
pOld = GetOldItem( *rOutSet, SID_ATTR_PARA_WIDOWS );
if ( m_pWidowBox->IsValueChangedFromSaved() || !pOld || !( *static_cast<const SvxWidowsItem*>(pOld) == rItem ) )
@@ -1559,7 +1559,7 @@ bool SvxExtParagraphTabPage::FillItemSet( SfxItemSet* rOutSet )
m_pOrphanRowNo->IsValueModified() )
{
SvxOrphansItem rItem( eState == TRISTATE_TRUE ?
- (sal_uInt8)m_pOrphanRowNo->GetValue() : 0, _nWhich );
+ static_cast<sal_uInt8>(m_pOrphanRowNo->GetValue()) : 0, _nWhich );
pOld = GetOldItem( *rOutSet, SID_ATTR_PARA_ORPHANS );
if ( m_pOrphanBox->IsValueChangedFromSaved() ||
diff --git a/cui/source/tabpages/swpossizetabpage.cxx b/cui/source/tabpages/swpossizetabpage.cxx
index 93eca0ac14f7..bc9995dcd5bb 100644
--- a/cui/source/tabpages/swpossizetabpage.cxx
+++ b/cui/source/tabpages/swpossizetabpage.cxx
@@ -1025,12 +1025,12 @@ void SvxSwPosSizeTabPage::Reset( const SfxItemSet* rSet)
}
pItem = GetItem( *rSet, SID_ATTR_TRANSFORM_WIDTH );
- sal_Int32 nWidth = std::max( pItem ? ( static_cast<const SfxUInt32Item*>(pItem)->GetValue()) : 0, (sal_uInt32)1 );
+ sal_Int32 nWidth = std::max( pItem ? ( static_cast<const SfxUInt32Item*>(pItem)->GetValue()) : 0, sal_uInt32(1) );
m_pWidthMF->SetValue(m_pWidthMF->Normalize(nWidth), FUNIT_TWIP);
pItem = GetItem( *rSet, SID_ATTR_TRANSFORM_HEIGHT );
- sal_Int32 nHeight = std::max( pItem ? ( static_cast<const SfxUInt32Item*>(pItem)->GetValue()) : 0, (sal_uInt32)1 );
+ sal_Int32 nHeight = std::max( pItem ? ( static_cast<const SfxUInt32Item*>(pItem)->GetValue()) : 0, sal_uInt32(1) );
m_pHeightMF->SetValue(m_pHeightMF->Normalize(nHeight), FUNIT_TWIP);
m_fWidthHeightRatio = double(nWidth) / double(nHeight);
@@ -1165,8 +1165,8 @@ IMPL_LINK_NOARG(SvxSwPosSizeTabPage, RangeModifyHdl, Control&, void)
sal_uInt16 nAlign = GetAlignment(m_pHMap, nMapPos, *m_pHoriToLB);
sal_uInt16 nRel = GetRelation(*m_pHoriToLB);
- aVal.nHoriOrient = (short)nAlign;
- aVal.nHRelOrient = (short)nRel;
+ aVal.nHoriOrient = static_cast<short>(nAlign);
+ aVal.nHRelOrient = static_cast<short>(nRel);
}
else
aVal.nHoriOrient = HoriOrientation::NONE;
@@ -1178,8 +1178,8 @@ IMPL_LINK_NOARG(SvxSwPosSizeTabPage, RangeModifyHdl, Control&, void)
sal_uInt16 nAlign = GetAlignment(m_pVMap, nMapPos, *m_pVertToLB);
sal_uInt16 nRel = GetRelation(*m_pVertToLB);
- aVal.nVertOrient = (short)nAlign;
- aVal.nVRelOrient = (short)nRel;
+ aVal.nVertOrient = static_cast<short>(nAlign);
+ aVal.nVRelOrient = static_cast<short>(nRel);
}
else
aVal.nVertOrient = VertOrientation::NONE;
@@ -1378,12 +1378,12 @@ IMPL_LINK( SvxSwPosSizeTabPage, ModifyHdl, Edit&, rEdit, void )
{
if ( &rEdit == m_pWidthMF )
{
- nHeight = sal_Int64((double)nWidth / m_fWidthHeightRatio);
+ nHeight = sal_Int64(static_cast<double>(nWidth) / m_fWidthHeightRatio);
m_pHeightMF->SetValue(m_pHeightMF->Normalize(nHeight), FUNIT_TWIP);
}
else if(&rEdit == m_pHeightMF)
{
- nWidth = sal_Int64((double)nHeight * m_fWidthHeightRatio);
+ nWidth = sal_Int64(static_cast<double>(nHeight) * m_fWidthHeightRatio);
m_pWidthMF->SetValue(m_pWidthMF->Normalize(nWidth), FUNIT_TWIP);
}
}
diff --git a/cui/source/tabpages/tabstpge.cxx b/cui/source/tabpages/tabstpge.cxx
index ee55f1bb1a93..aa72b0f452d7 100644
--- a/cui/source/tabpages/tabstpge.cxx
+++ b/cui/source/tabpages/tabstpge.cxx
@@ -105,10 +105,10 @@ SvxTabulatorTabPage::SvxTabulatorTabPage(vcl::Window* pParent, const SfxItemSet&
m_pRightWin->SetTabulatorTabPage(this);
m_pCenterWin->SetTabulatorTabPage(this);
m_pDezWin->SetTabulatorTabPage(this);
- m_pLeftWin->SetTabStyle((sal_uInt16)(RULER_TAB_LEFT|WB_HORZ));
- m_pRightWin->SetTabStyle((sal_uInt16)(RULER_TAB_RIGHT|WB_HORZ));
- m_pCenterWin->SetTabStyle((sal_uInt16)(RULER_TAB_CENTER|WB_HORZ));
- m_pDezWin->SetTabStyle((sal_uInt16)(RULER_TAB_DECIMAL|WB_HORZ));
+ m_pLeftWin->SetTabStyle(sal_uInt16(RULER_TAB_LEFT|WB_HORZ));
+ m_pRightWin->SetTabStyle(sal_uInt16(RULER_TAB_RIGHT|WB_HORZ));
+ m_pCenterWin->SetTabStyle(sal_uInt16(RULER_TAB_CENTER|WB_HORZ));
+ m_pDezWin->SetTabStyle(sal_uInt16(RULER_TAB_DECIMAL|WB_HORZ));
//upper radiobuttons
SvtCJKOptions aCJKOptions;
get(m_pLeftTab, aCJKOptions.IsAsianTypographyEnabled() ? "radiobuttonST_LEFTTAB_ASIAN" : "radiobuttonBTN_TABTYPE_LEFT");
diff --git a/cui/source/tabpages/textanim.cxx b/cui/source/tabpages/textanim.cxx
index 5d994f078271..bab7754a2de0 100644
--- a/cui/source/tabpages/textanim.cxx
+++ b/cui/source/tabpages/textanim.cxx
@@ -247,7 +247,7 @@ void SvxTextAnimationPage::Reset( const SfxItemSet* rAttrs )
if( pItem )
{
m_pTsbEndless->EnableTriState( false );
- long nValue = (long) static_cast<const SdrTextAniCountItem*>(pItem)->GetValue();
+ long nValue = static_cast<long>(static_cast<const SdrTextAniCountItem*>(pItem)->GetValue());
m_pNumFldCount->SetValue( nValue );
if( nValue == 0 )
{
@@ -280,7 +280,7 @@ void SvxTextAnimationPage::Reset( const SfxItemSet* rAttrs )
if( pItem )
{
m_pTsbAuto->EnableTriState( false );
- long nValue = (long) static_cast<const SdrTextAniDelayItem*>(pItem)->GetValue();
+ long nValue = static_cast<long>(static_cast<const SdrTextAniDelayItem*>(pItem)->GetValue());
m_pMtrFldDelay->SetValue( nValue );
if( nValue == 0 )
{
@@ -305,7 +305,7 @@ void SvxTextAnimationPage::Reset( const SfxItemSet* rAttrs )
if( pItem )
{
m_pTsbPixel->EnableTriState( false );
- long nValue = (long) static_cast<const SdrTextAniAmountItem*>(pItem)->GetValue();
+ long nValue = static_cast<long>(static_cast<const SdrTextAniAmountItem*>(pItem)->GetValue());
if( nValue <= 0 )
{
m_pTsbPixel->SetState( TRISTATE_TRUE );
@@ -420,7 +420,7 @@ bool SvxTextAnimationPage::FillItemSet( SfxItemSet* rAttrs)
}
}
if( bModified )
- rAttrs->Put( SdrTextAniCountItem( (sal_uInt16) nValue ) );
+ rAttrs->Put( SdrTextAniCountItem( static_cast<sal_uInt16>(nValue) ) );
}
// delay
@@ -441,7 +441,7 @@ bool SvxTextAnimationPage::FillItemSet( SfxItemSet* rAttrs)
}
}
if( bModified )
- rAttrs->Put( SdrTextAniDelayItem( (sal_uInt16) nValue ) );
+ rAttrs->Put( SdrTextAniDelayItem( static_cast<sal_uInt16>(nValue) ) );
}
// step size
@@ -460,7 +460,7 @@ bool SvxTextAnimationPage::FillItemSet( SfxItemSet* rAttrs)
{
nValue = GetCoreValue( *m_pMtrFldAmount, eUnit );
}
- rAttrs->Put( SdrTextAniAmountItem( (sal_Int16) nValue ) );
+ rAttrs->Put( SdrTextAniAmountItem( static_cast<sal_Int16>(nValue) ) );
bModified = true;
}
diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx
index b74041e211c0..f1b1752c8659 100644
--- a/cui/source/tabpages/tpbitmap.cxx
+++ b/cui/source/tabpages/tpbitmap.cxx
@@ -290,8 +290,8 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* rAttrs )
pItemTransfHeight= GetItem( rGeoAttr, SID_ATTR_TRANSFORM_HEIGHT );
}
}
- m_fObjectWidth = std::max( pItemTransfWidth ? (double)static_cast<const SfxUInt32Item*>(pItemTransfWidth)->GetValue() : 0.0, 1.0 );
- m_fObjectHeight = std::max( pItemTransfHeight ? (double)static_cast<const SfxUInt32Item*>(pItemTransfHeight)->GetValue() : 0.0, 1.0 );
+ m_fObjectWidth = std::max( pItemTransfWidth ? static_cast<double>(static_cast<const SfxUInt32Item*>(pItemTransfWidth)->GetValue()) : 0.0, 1.0 );
+ m_fObjectHeight = std::max( pItemTransfHeight ? static_cast<double>(static_cast<const SfxUInt32Item*>(pItemTransfHeight)->GetValue()) : 0.0, 1.0 );
double fTmpWidth((OutputDevice::LogicToLogic(static_cast<sal_Int32>(m_fObjectWidth), mePoolUnit, MapUnit::Map100thMM )) / fUIScale);
m_fObjectWidth = fTmpWidth;
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index 055bf4f19af8..4fe0db177ddc 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -325,9 +325,9 @@ IMPL_LINK(SvxColorTabPage, ModifiedHdl_Impl, Edit&, rEdit, void)
aCurrentColor = Color(m_pHexcustom->GetColor());
else
{
- aCurrentColor.SetColor ( Color( (sal_uInt8)PercentToColor_Impl( (sal_uInt16) m_pRcustom->GetValue() ),
- (sal_uInt8)PercentToColor_Impl( (sal_uInt16) m_pGcustom->GetValue() ),
- (sal_uInt8)PercentToColor_Impl( (sal_uInt16) m_pBcustom->GetValue() ) ).GetColor() );
+ aCurrentColor.SetColor ( Color( static_cast<sal_uInt8>(PercentToColor_Impl( static_cast<sal_uInt16>(m_pRcustom->GetValue()) )),
+ static_cast<sal_uInt8>(PercentToColor_Impl( static_cast<sal_uInt16>(m_pGcustom->GetValue()) )),
+ static_cast<sal_uInt8>(PercentToColor_Impl( static_cast<sal_uInt16>(m_pBcustom->GetValue()) )) ).GetColor() );
}
UpdateColorValues();
@@ -335,10 +335,10 @@ IMPL_LINK(SvxColorTabPage, ModifiedHdl_Impl, Edit&, rEdit, void)
else
{
// read current MtrFields, if cmyk, then k-value as transparency
- aCurrentColor.SetColor ( Color( (sal_uInt8)PercentToColor_Impl( (sal_uInt16) m_pKcustom->GetValue() ),
- (sal_uInt8)PercentToColor_Impl( (sal_uInt16) m_pCcustom->GetValue() ),
- (sal_uInt8)PercentToColor_Impl( (sal_uInt16) m_pYcustom->GetValue() ),
- (sal_uInt8)PercentToColor_Impl( (sal_uInt16) m_pMcustom->GetValue() ) ).GetColor() );
+ aCurrentColor.SetColor ( Color( static_cast<sal_uInt8>(PercentToColor_Impl( static_cast<sal_uInt16>(m_pKcustom->GetValue()) )),
+ static_cast<sal_uInt8>(PercentToColor_Impl( static_cast<sal_uInt16>(m_pCcustom->GetValue()) )),
+ static_cast<sal_uInt8>(PercentToColor_Impl( static_cast<sal_uInt16>(m_pYcustom->GetValue()) )),
+ static_cast<sal_uInt8>(PercentToColor_Impl( static_cast<sal_uInt16>(m_pMcustom->GetValue()) )) ).GetColor() );
ConvertColorValues (aCurrentColor, ColorModel::RGB);
}
@@ -540,8 +540,8 @@ void SvxColorTabPage::ConvertColorValues (Color& rColor, ColorModel eModell)
{
case ColorModel::RGB:
{
- CmykToRgb_Impl (rColor, (sal_uInt16)rColor.GetTransparency() );
- rColor.SetTransparency ((sal_uInt8) 0);
+ CmykToRgb_Impl (rColor, static_cast<sal_uInt16>(rColor.GetTransparency()) );
+ rColor.SetTransparency (sal_uInt8(0));
}
break;
@@ -549,7 +549,7 @@ void SvxColorTabPage::ConvertColorValues (Color& rColor, ColorModel eModell)
{
sal_uInt16 nK;
RgbToCmyk_Impl (rColor, nK );
- rColor.SetTransparency ((sal_uInt8) nK);
+ rColor.SetTransparency (static_cast<sal_uInt8>(nK));
}
break;
}
@@ -703,19 +703,19 @@ void SvxColorTabPage::CmykToRgb_Impl( Color& rColor, const sal_uInt16 nK )
if( lTemp < 0 )
lTemp = 0;
- rColor.SetRed( (sal_uInt8)lTemp );
+ rColor.SetRed( static_cast<sal_uInt8>(lTemp) );
lTemp = 255 - ( rColor.GetGreen() + nK );
if( lTemp < 0 )
lTemp = 0;
- rColor.SetGreen( (sal_uInt8)lTemp );
+ rColor.SetGreen( static_cast<sal_uInt8>(lTemp) );
lTemp = 255 - ( rColor.GetBlue() + nK );
if( lTemp < 0 )
lTemp = 0;
- rColor.SetBlue( (sal_uInt8)lTemp );
+ rColor.SetBlue( static_cast<sal_uInt8>(lTemp) );
}
@@ -730,7 +730,7 @@ sal_uInt16 SvxColorTabPage::ColorToPercent_Impl( sal_uInt16 nColor )
break;
case ColorModel::CMYK:
- nValue = (sal_uInt16) ( (double) nColor * 100.0 / 255.0 + 0.5 );
+ nValue = static_cast<sal_uInt16>( static_cast<double>(nColor) * 100.0 / 255.0 + 0.5 );
break;
}
@@ -749,7 +749,7 @@ sal_uInt16 SvxColorTabPage::PercentToColor_Impl( sal_uInt16 nPercent )
break;
case ColorModel::CMYK:
- nValue = (sal_uInt16) ( (double) nPercent * 255.0 / 100.0 + 0.5 );
+ nValue = static_cast<sal_uInt16>( static_cast<double>(nPercent) * 255.0 / 100.0 + 0.5 );
break;
}
diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx
index b7274fd379f9..e01db477109b 100644
--- a/cui/source/tabpages/tpgradnt.cxx
+++ b/cui/source/tabpages/tpgradnt.cxx
@@ -239,12 +239,12 @@ bool SvxGradientTabPage::FillItemSet( SfxItemSet* rSet )
m_pLbColorTo->GetSelectEntryColor(),
(css::awt::GradientStyle) m_pLbGradientType->GetSelectedEntryPos(),
static_cast<long>(m_pMtrAngle->GetValue() * 10), // should be changed in resource
- (sal_uInt16) m_pMtrCenterX->GetValue(),
- (sal_uInt16) m_pMtrCenterY->GetValue(),
- (sal_uInt16) m_pMtrBorder->GetValue(),
- (sal_uInt16) m_pMtrColorFrom->GetValue(),
- (sal_uInt16) m_pMtrColorTo->GetValue(),
- (sal_uInt16) m_pMtrIncrement->GetValue() ));
+ static_cast<sal_uInt16>(m_pMtrCenterX->GetValue()),
+ static_cast<sal_uInt16>(m_pMtrCenterY->GetValue()),
+ static_cast<sal_uInt16>(m_pMtrBorder->GetValue()),
+ static_cast<sal_uInt16>(m_pMtrColorFrom->GetValue()),
+ static_cast<sal_uInt16>(m_pMtrColorTo->GetValue()),
+ static_cast<sal_uInt16>(m_pMtrIncrement->GetValue()) ));
}
sal_uInt16 nValue = 0;
@@ -336,12 +336,12 @@ void SvxGradientTabPage::ModifiedHdl_Impl( void const * pControl )
m_pLbColorTo->GetSelectEntryColor(),
eXGS,
static_cast<long>(m_pMtrAngle->GetValue() * 10), // should be changed in resource
- (sal_uInt16) m_pMtrCenterX->GetValue(),
- (sal_uInt16) m_pMtrCenterY->GetValue(),
- (sal_uInt16) m_pMtrBorder->GetValue(),
- (sal_uInt16) m_pMtrColorFrom->GetValue(),
- (sal_uInt16) m_pMtrColorTo->GetValue(),
- (sal_uInt16) m_pMtrIncrement->GetValue() );
+ static_cast<sal_uInt16>(m_pMtrCenterX->GetValue()),
+ static_cast<sal_uInt16>(m_pMtrCenterY->GetValue()),
+ static_cast<sal_uInt16>(m_pMtrBorder->GetValue()),
+ static_cast<sal_uInt16>(m_pMtrColorFrom->GetValue()),
+ static_cast<sal_uInt16>(m_pMtrColorTo->GetValue()),
+ static_cast<sal_uInt16>(m_pMtrIncrement->GetValue()) );
// enable/disable controls
if( pControl == m_pLbGradientType || pControl == this )
@@ -349,7 +349,7 @@ void SvxGradientTabPage::ModifiedHdl_Impl( void const * pControl )
sal_uInt16 nValue = 0;
if(!m_pCbIncrement->IsChecked())
- nValue = (sal_uInt16)m_pMtrIncrement->GetValue();
+ nValue = static_cast<sal_uInt16>(m_pMtrIncrement->GetValue());
m_rXFSet.Put( XGradientStepCountItem( nValue ) );
// displaying in XOutDev
@@ -412,12 +412,12 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl, Button*, void)
m_pLbColorTo->GetSelectEntryColor(),
(css::awt::GradientStyle) m_pLbGradientType->GetSelectedEntryPos(),
static_cast<long>(m_pMtrAngle->GetValue() * 10), // should be changed in resource
- (sal_uInt16) m_pMtrCenterX->GetValue(),
- (sal_uInt16) m_pMtrCenterY->GetValue(),
- (sal_uInt16) m_pMtrBorder->GetValue(),
- (sal_uInt16) m_pMtrColorFrom->GetValue(),
- (sal_uInt16) m_pMtrColorTo->GetValue(),
- (sal_uInt16) m_pMtrIncrement->GetValue() );
+ static_cast<sal_uInt16>(m_pMtrCenterX->GetValue()),
+ static_cast<sal_uInt16>(m_pMtrCenterY->GetValue()),
+ static_cast<sal_uInt16>(m_pMtrBorder->GetValue()),
+ static_cast<sal_uInt16>(m_pMtrColorFrom->GetValue()),
+ static_cast<sal_uInt16>(m_pMtrColorTo->GetValue()),
+ static_cast<sal_uInt16>(m_pMtrIncrement->GetValue()) );
m_pGradientList->Insert(o3tl::make_unique<XGradientEntry>(aXGradient, aName), nCount);
@@ -451,12 +451,12 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickModifyHdl_Impl, Button*, void)
m_pLbColorTo->GetSelectEntryColor(),
(css::awt::GradientStyle) m_pLbGradientType->GetSelectedEntryPos(),
static_cast<long>(m_pMtrAngle->GetValue() * 10), // should be changed in resource
- (sal_uInt16) m_pMtrCenterX->GetValue(),
- (sal_uInt16) m_pMtrCenterY->GetValue(),
- (sal_uInt16) m_pMtrBorder->GetValue(),
- (sal_uInt16) m_pMtrColorFrom->GetValue(),
- (sal_uInt16) m_pMtrColorTo->GetValue(),
- (sal_uInt16) m_pMtrIncrement->GetValue() );
+ static_cast<sal_uInt16>(m_pMtrCenterX->GetValue()),
+ static_cast<sal_uInt16>(m_pMtrCenterY->GetValue()),
+ static_cast<sal_uInt16>(m_pMtrBorder->GetValue()),
+ static_cast<sal_uInt16>(m_pMtrColorFrom->GetValue()),
+ static_cast<sal_uInt16>(m_pMtrColorTo->GetValue()),
+ static_cast<sal_uInt16>(m_pMtrIncrement->GetValue()) );
m_pGradientList->Replace(o3tl::make_unique<XGradientEntry>(aXGradient, aName), nPos);
diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx
index 3a0b2fb45df9..c57590af33ee 100644
--- a/cui/source/tabpages/tpline.cxx
+++ b/cui/source/tabpages/tpline.cxx
@@ -299,7 +299,7 @@ void SvxLineTabPage::InitSymbols(MenuButton const * pButton)
SvxBmpItemInfo* pInfo = new SvxBmpItemInfo;
pInfo->pBrushItem = pBrushItem;
- pInfo->nItemId = (sal_uInt16)(MN_GALLERY_ENTRY + i);
+ pInfo->nItemId = static_cast<sal_uInt16>(MN_GALLERY_ENTRY + i);
if ( i < m_aGrfBrushItems.size() )
{
m_aGrfBrushItems.insert( m_aGrfBrushItems.begin() + i, pInfo );
@@ -317,8 +317,8 @@ void SvxLineTabPage::InitSymbols(MenuButton const * pButton)
{
bool bWidth = aSize.Width() > aSize.Height();
double nScale = bWidth ?
- (double)MAX_BMP_WIDTH / (double)aSize.Width():
- (double)MAX_BMP_HEIGHT / (double)aSize.Height();
+ double(MAX_BMP_WIDTH) / static_cast<double>(aSize.Width()):
+ double(MAX_BMP_HEIGHT) / static_cast<double>(aSize.Height());
aBitmap.Scale(nScale, nScale);
}
@@ -390,8 +390,8 @@ void SvxLineTabPage::InitSymbols(MenuButton const * pButton)
SvxBmpItemInfo* pInfo = new SvxBmpItemInfo;
pInfo->pBrushItem = pBrushItem;
- pInfo->nItemId = (sal_uInt16)(MN_GALLERY_ENTRY + i + m_nNumMenuGalleryItems);
- if ( (size_t)(m_nNumMenuGalleryItems + i) < m_aGrfBrushItems.size() ) {
+ pInfo->nItemId = static_cast<sal_uInt16>(MN_GALLERY_ENTRY + i + m_nNumMenuGalleryItems);
+ if ( static_cast<size_t>(m_nNumMenuGalleryItems + i) < m_aGrfBrushItems.size() ) {
m_aGrfBrushItems.insert( m_aGrfBrushItems.begin() + m_nNumMenuGalleryItems + i, pInfo );
} else {
m_aGrfBrushItems.push_back( pInfo );
@@ -402,8 +402,8 @@ void SvxLineTabPage::InitSymbols(MenuButton const * pButton)
{
bool bWidth = aSize.Width() > aSize.Height();
double nScale = bWidth ?
- (double)MAX_BMP_WIDTH / (double)aSize.Width():
- (double)MAX_BMP_HEIGHT / (double)aSize.Height();
+ double(MAX_BMP_WIDTH) / static_cast<double>(aSize.Width()):
+ double(MAX_BMP_HEIGHT) / static_cast<double>(aSize.Height());
aBitmapEx.Scale(nScale, nScale);
}
Image aImage(aBitmapEx);
@@ -495,8 +495,8 @@ void SvxLineTabPage::SymbolSelected(MenuButton const * pButton)
{ //#i31097# Data Point Symbol size changes when a different symbol is chosen(maoyg)
if( m_aSymbolSize.Width() != m_aSymbolSize.Height() )
{
- aSize.setWidth( (long)( m_aSymbolSize.Width() + m_aSymbolSize.Height() )/2 );
- aSize.setHeight( (long)( m_aSymbolSize.Width() + m_aSymbolSize.Height() )/2 );
+ aSize.setWidth( static_cast<long>( m_aSymbolSize.Width() + m_aSymbolSize.Height() )/2 );
+ aSize.setHeight( static_cast<long>( m_aSymbolSize.Width() + m_aSymbolSize.Height() )/2 );
m_aSymbolSize = aSize;
}
}
@@ -699,7 +699,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs )
pStyleItem.reset(new XLineStyleItem( drawing::LineStyle_DASH ));
// For added security
- if( m_pDashList->Count() > (long) ( nPos - 2 ) )
+ if( m_pDashList->Count() > static_cast<long>( nPos - 2 ) )
{
XLineDashItem aDashItem( m_pLbLineStyle->GetSelectedEntry(),
m_pDashList->GetDash( nPos - 2 )->GetDash() );
@@ -775,7 +775,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs )
std::unique_ptr<XLineStartItem> pItem;
if( nPos == 0 )
pItem.reset(new XLineStartItem());
- else if( m_pLineEndList->Count() > (long) ( nPos - 1 ) )
+ else if( m_pLineEndList->Count() > static_cast<long>( nPos - 1 ) )
pItem.reset(new XLineStartItem( m_pLbStartStyle->GetSelectedEntry(), m_pLineEndList->GetLineEnd( nPos - 1 )->GetLineEnd() ));
pOld = GetOldItem( *rAttrs, XATTR_LINESTART );
if( pItem && ( !pOld || !( *static_cast<const XLineEndItem*>(pOld) == *pItem ) ) )
@@ -791,7 +791,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs )
std::unique_ptr<XLineEndItem> pItem;
if( nPos == 0 )
pItem.reset(new XLineEndItem());
- else if( m_pLineEndList->Count() > (long) ( nPos - 1 ) )
+ else if( m_pLineEndList->Count() > static_cast<long>( nPos - 1 ) )
pItem.reset(new XLineEndItem( m_pLbEndStyle->GetSelectedEntry(), m_pLineEndList->GetLineEnd( nPos - 1 )->GetLineEnd() ));
pOld = GetOldItem( *rAttrs, XATTR_LINEEND );
if( pItem &&
@@ -828,7 +828,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs )
}
// Transparency
- sal_uInt16 nVal = (sal_uInt16)m_pMtrTransparent->GetValue();
+ sal_uInt16 nVal = static_cast<sal_uInt16>(m_pMtrTransparent->GetValue());
if( m_pMtrTransparent->IsValueChangedFromSaved() )
{
XLineTransparenceItem aItem( nVal );
@@ -1073,7 +1073,7 @@ void SvxLineTabPage::FillXLSet_Impl()
m_rXLSet.Put( XLineEndCenterItem( false ) );
// Transparency
- sal_uInt16 nVal = (sal_uInt16)m_pMtrTransparent->GetValue();
+ sal_uInt16 nVal = static_cast<sal_uInt16>(m_pMtrTransparent->GetValue());
m_rXLSet.Put( XLineTransparenceItem( nVal ) );
m_pCtlPreview->SetLineAttributes(m_aXLineAttr.GetItemSet());
@@ -1656,7 +1656,7 @@ void SvxLineTabPage::ChangeEndHdl_Impl( void const * p )
IMPL_LINK_NOARG(SvxLineTabPage, ChangeTransparentHdl_Impl, Edit&, void)
{
- sal_uInt16 nVal = (sal_uInt16)m_pMtrTransparent->GetValue();
+ sal_uInt16 nVal = static_cast<sal_uInt16>(m_pMtrTransparent->GetValue());
m_rXLSet.Put( XLineTransparenceItem( nVal ) );
@@ -1706,12 +1706,12 @@ IMPL_LINK( SvxLineTabPage, SizeHdl_Impl, Edit&, rField, void)
nWidthVal = OutputDevice::LogicToLogic(nWidthVal,MapUnit::Map100thMM, m_ePoolUnit );
nHeightVal = OutputDevice::LogicToLogic(nHeightVal,MapUnit::Map100thMM, m_ePoolUnit);
m_aSymbolSize = Size(nWidthVal,nHeightVal);
- double fSizeRatio = (double)1;
+ double fSizeRatio = double(1);
if(bRatio)
{
if (m_aSymbolLastSize.Height() && m_aSymbolLastSize.Width())
- fSizeRatio = (double)m_aSymbolLastSize.Width() / m_aSymbolLastSize.Height();
+ fSizeRatio = static_cast<double>(m_aSymbolLastSize.Width()) / m_aSymbolLastSize.Height();
}
//Size aSymbolSize(aSymbolLastSize);
@@ -1722,7 +1722,7 @@ IMPL_LINK( SvxLineTabPage, SizeHdl_Impl, Edit&, rField, void)
m_aSymbolSize.Width() = nWidthVal;
if (bRatio)
{
- m_aSymbolSize.Height() = m_aSymbolLastSize.Height() + (long)((double)nDelta / fSizeRatio);
+ m_aSymbolSize.Height() = m_aSymbolLastSize.Height() + static_cast<long>(static_cast<double>(nDelta) / fSizeRatio);
m_aSymbolSize.Height() = OutputDevice::LogicToLogic( m_aSymbolSize.Height(), m_ePoolUnit, MapUnit::Map100thMM );
m_pSymbolHeightMF->SetUserValue(m_pSymbolHeightMF->Normalize(m_aSymbolSize.Height()), FUNIT_100TH_MM);
}
@@ -1733,7 +1733,7 @@ IMPL_LINK( SvxLineTabPage, SizeHdl_Impl, Edit&, rField, void)
m_aSymbolSize.Height() = nHeightVal;
if (bRatio)
{
- m_aSymbolSize.Width() = m_aSymbolLastSize.Width() + (long)((double)nDelta * fSizeRatio);
+ m_aSymbolSize.Width() = m_aSymbolLastSize.Width() + static_cast<long>(static_cast<double>(nDelta) * fSizeRatio);
m_aSymbolSize.Width() = OutputDevice::LogicToLogic( m_aSymbolSize.Width(), m_ePoolUnit, MapUnit::Map100thMM );
m_pSymbolWidthMF->SetUserValue(m_pSymbolWidthMF->Normalize(m_aSymbolSize.Width()), FUNIT_100TH_MM);
}
diff --git a/cui/source/tabpages/tplnedef.cxx b/cui/source/tabpages/tplnedef.cxx
index 330ee686e6ed..c89661fe52b9 100644
--- a/cui/source/tabpages/tplnedef.cxx
+++ b/cui/source/tabpages/tplnedef.cxx
@@ -850,9 +850,9 @@ void SvxLineDefTabPage::FillDash_Impl()
eXDS = css::drawing::DashStyle_RECT;
aDash.SetDashStyle( eXDS );
- aDash.SetDots( (sal_uInt8) m_pNumFldNumber1->GetValue() );
+ aDash.SetDots( static_cast<sal_uInt8>(m_pNumFldNumber1->GetValue()) );
aDash.SetDotLen( m_pLbType1->GetSelectedEntryPos() == 0 ? 0 : GetCoreValue( *m_pMtrLength1, ePoolUnit ) );
- aDash.SetDashes( (sal_uInt8) m_pNumFldNumber2->GetValue() );
+ aDash.SetDashes( static_cast<sal_uInt8>(m_pNumFldNumber2->GetValue()) );
aDash.SetDashLen( m_pLbType2->GetSelectedEntryPos() == 0 ? 0 : GetCoreValue( *m_pMtrLength2, ePoolUnit ) );
aDash.SetDistance( GetCoreValue( *m_pMtrDistance, ePoolUnit ) );
diff --git a/cui/source/tabpages/tpshadow.cxx b/cui/source/tabpages/tpshadow.cxx
index ded82ed5134b..6296400844e7 100644
--- a/cui/source/tabpages/tpshadow.cxx
+++ b/cui/source/tabpages/tpshadow.cxx
@@ -312,7 +312,7 @@ bool SvxShadowTabPage::FillItemSet( SfxItemSet* rAttrs )
}
// transparency
- sal_uInt16 nVal = (sal_uInt16)m_pMtrTransparent->GetValue();
+ sal_uInt16 nVal = static_cast<sal_uInt16>(m_pMtrTransparent->GetValue());
if( m_pMtrTransparent->IsValueChangedFromSaved() )
{
SdrPercentItem aItem( makeSdrShadowTransparenceItem(nVal) );
@@ -464,7 +464,7 @@ IMPL_LINK_NOARG(SvxShadowTabPage, ModifyShadowHdl_Impl, Edit&, void)
m_rXFSet.Put( XFillStyleItem( drawing::FillStyle_NONE ) );
m_rXFSet.Put( XFillColorItem( OUString(), m_pLbShadowColor->GetSelectEntryColor() ) );
- sal_uInt16 nVal = (sal_uInt16)m_pMtrTransparent->GetValue();
+ sal_uInt16 nVal = static_cast<sal_uInt16>(m_pMtrTransparent->GetValue());
m_rXFSet.Put( XFillTransparenceItem( nVal ) );
// shadow removal
diff --git a/cui/source/tabpages/tptrans.cxx b/cui/source/tabpages/tptrans.cxx
index 4e54d74cc28a..e4faafec0142 100644
--- a/cui/source/tabpages/tptrans.cxx
+++ b/cui/source/tabpages/tptrans.cxx
@@ -131,7 +131,7 @@ void SvxTransparenceTabPage::ActivateLinear(bool bActivate)
IMPL_LINK_NOARG(SvxTransparenceTabPage, ModifyTransparentHdl_Impl, Edit&, void)
{
- sal_uInt16 nPos = (sal_uInt16)m_pMtrTransparent->GetValue();
+ sal_uInt16 nPos = static_cast<sal_uInt16>(m_pMtrTransparent->GetValue());
rXFSet.Put(XFillTransparenceItem(nPos));
// preview
@@ -157,16 +157,16 @@ void SvxTransparenceTabPage::ModifiedTrgrHdl_Impl(void const * pControl)
}
// preview
- sal_uInt8 nStartCol = (sal_uInt8)(((sal_uInt16)m_pMtrTrgrStartValue->GetValue() * 255) / 100);
- sal_uInt8 nEndCol = (sal_uInt8)(((sal_uInt16)m_pMtrTrgrEndValue->GetValue() * 255) / 100);
+ sal_uInt8 nStartCol = static_cast<sal_uInt8>((static_cast<sal_uInt16>(m_pMtrTrgrStartValue->GetValue()) * 255) / 100);
+ sal_uInt8 nEndCol = static_cast<sal_uInt8>((static_cast<sal_uInt16>(m_pMtrTrgrEndValue->GetValue()) * 255) / 100);
XGradient aTmpGradient(
Color(nStartCol, nStartCol, nStartCol),
Color(nEndCol, nEndCol, nEndCol),
(css::awt::GradientStyle)m_pLbTrgrGradientType->GetSelectedEntryPos(),
- (sal_uInt16)m_pMtrTrgrAngle->GetValue() * 10,
- (sal_uInt16)m_pMtrTrgrCenterX->GetValue(),
- (sal_uInt16)m_pMtrTrgrCenterY->GetValue(),
- (sal_uInt16)m_pMtrTrgrBorder->GetValue(),
+ static_cast<sal_uInt16>(m_pMtrTrgrAngle->GetValue()) * 10,
+ static_cast<sal_uInt16>(m_pMtrTrgrCenterX->GetValue()),
+ static_cast<sal_uInt16>(m_pMtrTrgrCenterY->GetValue()),
+ static_cast<sal_uInt16>(m_pMtrTrgrBorder->GetValue()),
100, 100);
XFillFloatTransparenceItem aItem( aTmpGradient);
@@ -314,7 +314,7 @@ bool SvxTransparenceTabPage::FillItemSet(SfxItemSet* rAttrs)
if(m_pMtrTransparent->IsEnabled())
{
// linear transparence
- sal_uInt16 nPos = (sal_uInt16)m_pMtrTransparent->GetValue();
+ sal_uInt16 nPos = static_cast<sal_uInt16>(m_pMtrTransparent->GetValue());
if(m_pMtrTransparent->IsValueChangedFromSaved() || !bLinearActive)
{
XFillTransparenceItem aItem(nPos);
@@ -341,16 +341,16 @@ bool SvxTransparenceTabPage::FillItemSet(SfxItemSet* rAttrs)
|| m_pMtrTrgrStartValue->IsValueChangedFromSaved()
|| m_pMtrTrgrEndValue->IsValueChangedFromSaved() )
{
- sal_uInt8 nStartCol = (sal_uInt8)(((sal_uInt16)m_pMtrTrgrStartValue->GetValue() * 255) / 100);
- sal_uInt8 nEndCol = (sal_uInt8)(((sal_uInt16)m_pMtrTrgrEndValue->GetValue() * 255) / 100);
+ sal_uInt8 nStartCol = static_cast<sal_uInt8>((static_cast<sal_uInt16>(m_pMtrTrgrStartValue->GetValue()) * 255) / 100);
+ sal_uInt8 nEndCol = static_cast<sal_uInt8>((static_cast<sal_uInt16>(m_pMtrTrgrEndValue->GetValue()) * 255) / 100);
XGradient aTmpGradient(
Color(nStartCol, nStartCol, nStartCol),
Color(nEndCol, nEndCol, nEndCol),
(css::awt::GradientStyle)m_pLbTrgrGradientType->GetSelectedEntryPos(),
- (sal_uInt16)m_pMtrTrgrAngle->GetValue() * 10,
- (sal_uInt16)m_pMtrTrgrCenterX->GetValue(),
- (sal_uInt16)m_pMtrTrgrCenterY->GetValue(),
- (sal_uInt16)m_pMtrTrgrBorder->GetValue(),
+ static_cast<sal_uInt16>(m_pMtrTrgrAngle->GetValue()) * 10,
+ static_cast<sal_uInt16>(m_pMtrTrgrCenterX->GetValue()),
+ static_cast<sal_uInt16>(m_pMtrTrgrCenterY->GetValue()),
+ static_cast<sal_uInt16>(m_pMtrTrgrBorder->GetValue()),
100, 100);
XFillFloatTransparenceItem aItem(aTmpGradient);
@@ -419,8 +419,8 @@ void SvxTransparenceTabPage::Reset(const SfxItemSet* rAttrs)
m_pMtrTrgrBorder->SetValue(rGradient.GetBorder());
m_pMtrTrgrCenterX->SetValue(rGradient.GetXOffset());
m_pMtrTrgrCenterY->SetValue(rGradient.GetYOffset());
- m_pMtrTrgrStartValue->SetValue((sal_uInt16)((((sal_uInt16)rGradient.GetStartColor().GetRed() + 1) * 100) / 255));
- m_pMtrTrgrEndValue->SetValue((sal_uInt16)((((sal_uInt16)rGradient.GetEndColor().GetRed() + 1) * 100) / 255));
+ m_pMtrTrgrStartValue->SetValue(static_cast<sal_uInt16>(((static_cast<sal_uInt16>(rGradient.GetStartColor().GetRed()) + 1) * 100) / 255));
+ m_pMtrTrgrEndValue->SetValue(static_cast<sal_uInt16>(((static_cast<sal_uInt16>(rGradient.GetEndColor().GetRed()) + 1) * 100) / 255));
// linear transparence
sal_uInt16 nTransp = static_cast<const XFillTransparenceItem*>(pLinearItem)->GetValue();
diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx
index d9a3ff38ac85..b7c154ab2842 100644
--- a/cui/source/tabpages/transfrm.cxx
+++ b/cui/source/tabpages/transfrm.cxx
@@ -289,7 +289,7 @@ void SvxAngleTabPage::Reset(const SfxItemSet* rAttrs)
const SfxPoolItem* pItem = GetItem( *rAttrs, SID_ATTR_TRANSFORM_ROT_X );
if(pItem)
{
- const double fTmp(((double)static_cast<const SfxInt32Item*>(pItem)->GetValue() - maAnchor.getX()) / fUIScale);
+ const double fTmp((static_cast<double>(static_cast<const SfxInt32Item*>(pItem)->GetValue()) - maAnchor.getX()) / fUIScale);
SetMetricValue(*m_pMtrPosX, basegfx::fround(fTmp), ePoolUnit);
}
else
@@ -300,7 +300,7 @@ void SvxAngleTabPage::Reset(const SfxItemSet* rAttrs)
pItem = GetItem(*rAttrs, SID_ATTR_TRANSFORM_ROT_Y);
if(pItem)
{
- const double fTmp(((double)static_cast<const SfxInt32Item*>(pItem)->GetValue() - maAnchor.getY()) / fUIScale);
+ const double fTmp((static_cast<double>(static_cast<const SfxInt32Item*>(pItem)->GetValue()) - maAnchor.getY()) / fUIScale);
SetMetricValue(*m_pMtrPosY, basegfx::fround(fTmp), ePoolUnit);
}
else
@@ -583,7 +583,7 @@ void SvxSlantTabPage::Reset(const SfxItemSet* rAttrs)
if( pItem )
{
const double fUIScale(double(pView->GetModel()->GetUIScale()));
- const double fTmp((double)static_cast<const SdrMetricItem*>(pItem)->GetValue() / fUIScale);
+ const double fTmp(static_cast<double>(static_cast<const SdrMetricItem*>(pItem)->GetValue()) / fUIScale);
SetMetricValue(*m_pMtrRadius, basegfx::fround(fTmp), ePoolUnit);
}
else
@@ -966,20 +966,20 @@ bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet* rOutAttrs )
// get Width
double nWidth = static_cast<double>(m_pMtrWidth->GetValue( meDlgUnit ));
nWidth = MetricField::ConvertDoubleValue( nWidth, m_pMtrWidth->GetBaseValue(), m_pMtrWidth->GetDecimalDigits(), meDlgUnit, FUNIT_100TH_MM );
- long lWidth = long(nWidth * (double)aUIScale);
+ long lWidth = long(nWidth * static_cast<double>(aUIScale));
lWidth = OutputDevice::LogicToLogic( lWidth, MapUnit::Map100thMM, mePoolUnit );
lWidth = static_cast<long>(m_pMtrWidth->Denormalize( lWidth ));
// get Height
double nHeight = static_cast<double>(m_pMtrHeight->GetValue( meDlgUnit ));
nHeight = MetricField::ConvertDoubleValue( nHeight, m_pMtrHeight->GetBaseValue(), m_pMtrHeight->GetDecimalDigits(), meDlgUnit, FUNIT_100TH_MM );
- long lHeight = long(nHeight * (double)aUIScale);
+ long lHeight = long(nHeight * static_cast<double>(aUIScale));
lHeight = OutputDevice::LogicToLogic( lHeight, MapUnit::Map100thMM, mePoolUnit );
lHeight = static_cast<long>(m_pMtrHeight->Denormalize( lHeight ));
// put Width & Height to itemset
- rOutAttrs->Put( SfxUInt32Item( GetWhich( SID_ATTR_TRANSFORM_WIDTH ), (sal_uInt32) lWidth ) );
- rOutAttrs->Put( SfxUInt32Item( GetWhich( SID_ATTR_TRANSFORM_HEIGHT ), (sal_uInt32) lHeight ) );
+ rOutAttrs->Put( SfxUInt32Item( GetWhich( SID_ATTR_TRANSFORM_WIDTH ), static_cast<sal_uInt32>(lWidth) ) );
+ rOutAttrs->Put( SfxUInt32Item( GetWhich( SID_ATTR_TRANSFORM_HEIGHT ), static_cast<sal_uInt32>(lHeight) ) );
rOutAttrs->Put( SfxAllEnumItem( GetWhich( SID_ATTR_TRANSFORM_SIZE_POINT ), sal::static_int_cast< sal_uInt16 >( meRP ) ) );
bModified = true;
}
@@ -1070,7 +1070,7 @@ void SvxPositionSizeTabPage::Reset( const SfxItemSet* )
{ // #i75273# set width
pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_WIDTH );
- mfOldWidth = std::max( pItem ? (double)static_cast<const SfxUInt32Item*>(pItem)->GetValue() : 0.0, 1.0 );
+ mfOldWidth = std::max( pItem ? static_cast<double>(static_cast<const SfxUInt32Item*>(pItem)->GetValue()) : 0.0, 1.0 );
double fTmpWidth((OutputDevice::LogicToLogic(static_cast<sal_Int32>(mfOldWidth), mePoolUnit, MapUnit::Map100thMM)) / fUIScale);
if(m_pMtrWidth->GetDecimalDigits())
@@ -1082,7 +1082,7 @@ void SvxPositionSizeTabPage::Reset( const SfxItemSet* )
{ // #i75273# set height
pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_HEIGHT );
- mfOldHeight = std::max( pItem ? (double)static_cast<const SfxUInt32Item*>(pItem)->GetValue() : 0.0, 1.0 );
+ mfOldHeight = std::max( pItem ? static_cast<double>(static_cast<const SfxUInt32Item*>(pItem)->GetValue()) : 0.0, 1.0 );
double fTmpHeight((OutputDevice::LogicToLogic(static_cast<sal_Int32>(mfOldHeight), mePoolUnit, MapUnit::Map100thMM)) / fUIScale);
if(m_pMtrHeight->GetDecimalDigits())
@@ -1160,8 +1160,8 @@ DeactivateRC SvxPositionSizeTabPage::DeactivatePage( SfxItemSet* _pSet )
{
if( _pSet )
{
- double fX((double)m_pMtrPosX->GetValue());
- double fY((double)m_pMtrPosY->GetValue());
+ double fX(static_cast<double>(m_pMtrPosX->GetValue()));
+ double fY(static_cast<double>(m_pMtrPosY->GetValue()));
GetTopLeftPosition(fX, fY, maRange);
const ::tools::Rectangle aOutRectangle(
@@ -1308,7 +1308,7 @@ void SvxPositionSizeTabPage::SetMinMaxPosition()
}
}
- const double fMaxLong((double)(MetricField::ConvertValue( LONG_MAX, 0, MapUnit::Map100thMM, meDlgUnit ) - 1));
+ const double fMaxLong(static_cast<double>(MetricField::ConvertValue( LONG_MAX, 0, MapUnit::Map100thMM, meDlgUnit ) - 1));
fLeft = basegfx::clamp(fLeft, -fMaxLong, fMaxLong);
fRight = basegfx::clamp(fRight, -fMaxLong, fMaxLong);
fTop = basegfx::clamp(fTop, - fMaxLong, fMaxLong);
@@ -1549,7 +1549,7 @@ IMPL_LINK_NOARG(SvxPositionSizeTabPage, ChangeWidthHdl, Edit&, void)
{
if( m_pCbxScale->IsChecked() && m_pCbxScale->IsEnabled() )
{
- sal_Int64 nHeight(basegfx::fround64((mfOldHeight * (double)m_pMtrWidth->GetValue()) / mfOldWidth));
+ sal_Int64 nHeight(basegfx::fround64((mfOldHeight * static_cast<double>(m_pMtrWidth->GetValue())) / mfOldWidth));
if(nHeight <= m_pMtrHeight->GetMax(FUNIT_NONE))
{
@@ -1560,7 +1560,7 @@ IMPL_LINK_NOARG(SvxPositionSizeTabPage, ChangeWidthHdl, Edit&, void)
nHeight = m_pMtrHeight->GetMax(FUNIT_NONE);
m_pMtrHeight->SetUserValue(nHeight);
- const sal_Int64 nWidth(basegfx::fround64((mfOldWidth * (double)nHeight) / mfOldHeight));
+ const sal_Int64 nWidth(basegfx::fround64((mfOldWidth * static_cast<double>(nHeight)) / mfOldHeight));
m_pMtrWidth->SetUserValue(nWidth, FUNIT_NONE);
}
}
@@ -1571,7 +1571,7 @@ IMPL_LINK_NOARG(SvxPositionSizeTabPage, ChangeHeightHdl, Edit&, void)
{
if( m_pCbxScale->IsChecked() && m_pCbxScale->IsEnabled() )
{
- sal_Int64 nWidth(basegfx::fround64((mfOldWidth * (double)m_pMtrHeight->GetValue()) / mfOldHeight));
+ sal_Int64 nWidth(basegfx::fround64((mfOldWidth * static_cast<double>(m_pMtrHeight->GetValue())) / mfOldHeight));
if(nWidth <= m_pMtrWidth->GetMax(FUNIT_NONE))
{
@@ -1582,7 +1582,7 @@ IMPL_LINK_NOARG(SvxPositionSizeTabPage, ChangeHeightHdl, Edit&, void)
nWidth = m_pMtrWidth->GetMax(FUNIT_NONE);
m_pMtrWidth->SetUserValue(nWidth);
- const sal_Int64 nHeight(basegfx::fround64((mfOldHeight * (double)nWidth) / mfOldWidth));
+ const sal_Int64 nHeight(basegfx::fround64((mfOldHeight * static_cast<double>(nWidth)) / mfOldWidth));
m_pMtrHeight->SetUserValue(nHeight, FUNIT_NONE);
}
}
@@ -1599,8 +1599,8 @@ IMPL_LINK_NOARG(SvxPositionSizeTabPage, ClickAutoHdl, Button*, void)
{
if( m_pCbxScale->IsChecked() )
{
- mfOldWidth = std::max( (double)GetCoreValue( *m_pMtrWidth, mePoolUnit ), 1.0 );
- mfOldHeight = std::max( (double)GetCoreValue( *m_pMtrHeight, mePoolUnit ), 1.0 );
+ mfOldWidth = std::max( static_cast<double>(GetCoreValue( *m_pMtrWidth, mePoolUnit )), 1.0 );
+ mfOldHeight = std::max( static_cast<double>(GetCoreValue( *m_pMtrHeight, mePoolUnit )), 1.0 );
}
}