summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-01-15 09:02:04 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-01-15 09:02:04 +0100
commit08857f1401d85562cd34619c3b4eec15b23769eb (patch)
tree83b8a119da5f9bc48c8033257b674926004cea32 /toolkit
parent1c6eb2d25d5d2b680419e4e03f54a2580e71cf7a (diff)
More loplugin:cstylecast: toolkit
Change-Id: I65b3c17c516d364326ce6dc3f7ba90c885a3e5e3
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/source/awt/vclxgraphics.cxx4
-rw-r--r--toolkit/source/awt/vclxmenu.cxx4
-rw-r--r--toolkit/source/awt/vclxpointer.cxx4
-rw-r--r--toolkit/source/awt/vclxwindow.cxx8
-rw-r--r--toolkit/source/awt/vclxwindows.cxx10
-rw-r--r--toolkit/source/controls/unocontrolmodel.cxx12
-rw-r--r--toolkit/source/helper/vclunohelper.cxx20
7 files changed, 31 insertions, 31 deletions
diff --git a/toolkit/source/awt/vclxgraphics.cxx b/toolkit/source/awt/vclxgraphics.cxx
index a250142a5952..fac87df6f571 100644
--- a/toolkit/source/awt/vclxgraphics.cxx
+++ b/toolkit/source/awt/vclxgraphics.cxx
@@ -220,7 +220,7 @@ void VCLXGraphics::setRasterOp( awt::RasterOperation eROP )
{
SolarMutexGuard aGuard;
- meRasterOp = (RasterOp)eROP;
+ meRasterOp = static_cast<RasterOp>(eROP);
}
void VCLXGraphics::setClipRegion( const uno::Reference< awt::XRegion >& rxRegion )
@@ -460,7 +460,7 @@ void VCLXGraphics::drawGradient( sal_Int32 x, sal_Int32 y, sal_Int32 width, sal_
if( mpOutputDevice )
{
InitOutputDevice( InitOutDevFlags::COLORS );
- Gradient aGradient((GradientStyle)rGradient.Style, rGradient.StartColor, rGradient.EndColor);
+ Gradient aGradient(static_cast<GradientStyle>(rGradient.Style), rGradient.StartColor, rGradient.EndColor);
aGradient.SetAngle(rGradient.Angle);
aGradient.SetBorder(rGradient.Border);
aGradient.SetOfsX(rGradient.XOffset);
diff --git a/toolkit/source/awt/vclxmenu.cxx b/toolkit/source/awt/vclxmenu.cxx
index 1aeb497bfa8f..02006e87de31 100644
--- a/toolkit/source/awt/vclxmenu.cxx
+++ b/toolkit/source/awt/vclxmenu.cxx
@@ -309,7 +309,7 @@ void VCLXMenu::insertItem(
::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
if ( mpMenu )
- mpMenu->InsertItem(nItemId, aText, (MenuItemBits)nItemStyle, OString(), nPos);
+ mpMenu->InsertItem(nItemId, aText, static_cast<MenuItemBits>(nItemStyle), OString(), nPos);
}
void VCLXMenu::removeItem(
@@ -657,7 +657,7 @@ css::awt::MenuItemType SAL_CALL VCLXMenu::getItemType(
css::awt::MenuItemType_DONTKNOW;
if ( mpMenu )
{
- aMenuItemType = ( (css::awt::MenuItemType) mpMenu->GetItemType( nItemPos ) );
+ aMenuItemType = static_cast<css::awt::MenuItemType>(mpMenu->GetItemType( nItemPos ));
}
return aMenuItemType;
diff --git a/toolkit/source/awt/vclxpointer.cxx b/toolkit/source/awt/vclxpointer.cxx
index 018c335afc18..19cc2735f963 100644
--- a/toolkit/source/awt/vclxpointer.cxx
+++ b/toolkit/source/awt/vclxpointer.cxx
@@ -37,14 +37,14 @@ void VCLXPointer::setType( sal_Int32 nType )
{
::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
- maPointer = Pointer( (PointerStyle)nType );
+ maPointer = Pointer( static_cast<PointerStyle>(nType) );
}
sal_Int32 VCLXPointer::getType()
{
::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
- return (sal_Int32)maPointer.GetStyle();
+ return static_cast<sal_Int32>(maPointer.GetStyle());
}
OUString VCLXPointer::getImplementationName()
diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx
index fb1fdb11a1cb..6142b15140a3 100644
--- a/toolkit/source/awt/vclxwindow.cxx
+++ b/toolkit/source/awt/vclxwindow.cxx
@@ -1551,7 +1551,7 @@ void VCLXWindow::setProperty( const OUString& PropertyName, const css::uno::Any&
if ( Value >>= n )
{
vcl::Font aFont = pWindow->GetControlFont();
- aFont.SetRelief( (FontRelief)n );
+ aFont.SetRelief( static_cast<FontRelief>(n) );
pWindow->SetControlFont( aFont );
}
}
@@ -1562,7 +1562,7 @@ void VCLXWindow::setProperty( const OUString& PropertyName, const css::uno::Any&
if ( Value >>= n )
{
vcl::Font aFont = pWindow->GetControlFont();
- aFont.SetEmphasisMark( (FontEmphasisMark)n );
+ aFont.SetEmphasisMark( static_cast<FontEmphasisMark>(n) );
pWindow->SetControlFont( aFont );
}
}
@@ -2007,10 +2007,10 @@ css::uno::Any VCLXWindow::getProperty( const OUString& PropertyName )
aProp <<= static_cast<sal_Int32>(GetWindow()->GetDisplayBackground().GetColor().GetColor());
break;
case BASEPROPERTY_FONTRELIEF:
- aProp <<= (sal_Int16) GetWindow()->GetControlFont().GetRelief();
+ aProp <<= static_cast<sal_Int16>(GetWindow()->GetControlFont().GetRelief());
break;
case BASEPROPERTY_FONTEMPHASISMARK:
- aProp <<= (sal_Int16) GetWindow()->GetControlFont().GetEmphasisMark();
+ aProp <<= static_cast<sal_Int16>(GetWindow()->GetControlFont().GetEmphasisMark());
break;
case BASEPROPERTY_TEXTCOLOR:
aProp <<= static_cast<sal_Int32>(GetWindow()->GetControlForeground().GetColor());
diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx
index 70bea4148914..d984f94f66a1 100644
--- a/toolkit/source/awt/vclxwindows.cxx
+++ b/toolkit/source/awt/vclxwindows.cxx
@@ -517,7 +517,7 @@ void VCLXButton::setProperty( const OUString& PropertyName, const css::uno::Any&
{
sal_Int16 n = sal_Int16();
if ( Value >>= n )
- static_cast<PushButton*>(pButton.get())->SetState( (TriState)n );
+ static_cast<PushButton*>(pButton.get())->SetState( static_cast<TriState>(n) );
}
}
break;
@@ -4813,7 +4813,7 @@ void VCLXDateField::setProperty( const OUString& PropertyName, const css::uno::A
{
sal_Int16 n = sal_Int16();
if ( Value >>= n )
- GetAs< DateField >()->SetExtDateFormat( (ExtDateFieldFormat) n );
+ GetAs< DateField >()->SetExtDateFormat( static_cast<ExtDateFieldFormat>(n) );
}
break;
case BASEPROPERTY_DATESHOWCENTURY:
@@ -5296,7 +5296,7 @@ void VCLXTimeField::setProperty( const OUString& PropertyName, const css::uno::A
{
sal_Int16 n = sal_Int16();
if ( Value >>= n )
- GetAs< TimeField >()->SetExtFormat( (ExtTimeFieldFormat) n );
+ GetAs< TimeField >()->SetExtFormat( static_cast<ExtTimeFieldFormat>(n) );
}
break;
case BASEPROPERTY_ENFORCE_FORMAT:
@@ -5772,7 +5772,7 @@ IMPL_XTYPEPROVIDER_START( VCLXMetricField )
IMPL_XTYPEPROVIDER_END
// FIXME: later ...
-#define MetricUnitUnoToVcl(a) ((FieldUnit)(a))
+#define MetricUnitUnoToVcl(a) (static_cast<FieldUnit>(a))
#define METRIC_MAP_PAIR(method,parent) \
sal_Int64 VCLXMetricField::get##method( sal_Int16 nUnit ) \
@@ -5896,7 +5896,7 @@ void VCLXMetricField::setProperty( const OUString& PropertyName, const css::uno:
{
sal_uInt16 nVal = 0;
if ( Value >>= nVal )
- GetAs< MetricField >()->SetUnit( (FieldUnit) nVal );
+ GetAs< MetricField >()->SetUnit( static_cast<FieldUnit>(nVal) );
break;
}
case BASEPROPERTY_CUSTOMUNITTEXT:
diff --git a/toolkit/source/controls/unocontrolmodel.cxx b/toolkit/source/controls/unocontrolmodel.cxx
index 642575a5a2ea..d767dec09e11 100644
--- a/toolkit/source/controls/unocontrolmodel.cxx
+++ b/toolkit/source/controls/unocontrolmodel.cxx
@@ -85,7 +85,7 @@ static void lcl_ImplMergeFontProperty( FontDescriptor& rFD, sal_uInt16 nPropId,
case BASEPROPERTY_FONTDESCRIPTORPART_WEIGHT: rValue >>= rFD.Weight;
break;
case BASEPROPERTY_FONTDESCRIPTORPART_SLANT: if ( rValue >>= nExtractShort )
- rFD.Slant = (css::awt::FontSlant)nExtractShort;
+ rFD.Slant = static_cast<css::awt::FontSlant>(nExtractShort);
else
rValue >>= rFD.Slant;
break;
@@ -176,7 +176,7 @@ css::uno::Any UnoControlModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
case BASEPROPERTY_FONTDESCRIPTORPART_CHARSET: aDefault <<= aFD.CharSet; break;
case BASEPROPERTY_FONTDESCRIPTORPART_HEIGHT: aDefault <<= static_cast<float>(aFD.Height); break;
case BASEPROPERTY_FONTDESCRIPTORPART_WEIGHT: aDefault <<= aFD.Weight; break;
- case BASEPROPERTY_FONTDESCRIPTORPART_SLANT: aDefault <<= (sal_Int16)aFD.Slant; break;
+ case BASEPROPERTY_FONTDESCRIPTORPART_SLANT: aDefault <<= static_cast<sal_Int16>(aFD.Slant); break;
case BASEPROPERTY_FONTDESCRIPTORPART_UNDERLINE: aDefault <<= aFD.Underline; break;
case BASEPROPERTY_FONTDESCRIPTORPART_STRIKEOUT: aDefault <<= aFD.Strikeout; break;
case BASEPROPERTY_FONTDESCRIPTORPART_WIDTH: aDefault <<= aFD.Width; break;
@@ -840,7 +840,7 @@ void UnoControlModel::read( const css::uno::Reference< css::io::XObjectInputStre
aFD.Pitch = InStream->readShort();
aFD.CharacterWidth = static_cast<float>(InStream->readDouble());
aFD.Weight = static_cast<float>(InStream->readDouble());
- aFD.Slant = (css::awt::FontSlant)InStream->readShort();
+ aFD.Slant = static_cast<css::awt::FontSlant>(InStream->readShort());
aFD.Underline = InStream->readShort();
aFD.Strikeout = InStream->readShort();
aFD.Orientation = static_cast<float>(InStream->readDouble());
@@ -951,8 +951,8 @@ void UnoControlModel::read( const css::uno::Reference< css::io::XObjectInputStre
if ( maData.find(BASEPROPERTY_FONTDESCRIPTOR) != maData.end() ) // due to defaults...
maData[BASEPROPERTY_FONTDESCRIPTOR] >>= *pFD;
}
- pFD->Weight = vcl::unohelper::ConvertFontWeight((FontWeight) InStream->readShort());
- pFD->Slant = (css::awt::FontSlant)InStream->readShort();
+ pFD->Weight = vcl::unohelper::ConvertFontWeight(static_cast<FontWeight>(InStream->readShort()));
+ pFD->Slant = static_cast<css::awt::FontSlant>(InStream->readShort());
pFD->Underline = InStream->readShort();
pFD->Strikeout = InStream->readShort();
pFD->Orientation = static_cast<float>(static_cast<double>(InStream->readShort())) / 10;
@@ -1201,7 +1201,7 @@ void UnoControlModel::getFastPropertyValue( css::uno::Any& rValue, sal_Int32 nPr
break;
case BASEPROPERTY_FONTDESCRIPTORPART_WEIGHT: rValue <<= aFD.Weight;
break;
- case BASEPROPERTY_FONTDESCRIPTORPART_SLANT: rValue <<= (sal_Int16)aFD.Slant;
+ case BASEPROPERTY_FONTDESCRIPTORPART_SLANT: rValue <<= static_cast<sal_Int16>(aFD.Slant);
break;
case BASEPROPERTY_FONTDESCRIPTORPART_UNDERLINE: rValue <<= aFD.Underline;
break;
diff --git a/toolkit/source/helper/vclunohelper.cxx b/toolkit/source/helper/vclunohelper.cxx
index c65a04976f1c..cd8a2e5c4e25 100644
--- a/toolkit/source/helper/vclunohelper.cxx
+++ b/toolkit/source/helper/vclunohelper.cxx
@@ -228,22 +228,22 @@ vcl::Font VCLUnoHelper::CreateFont( const css::awt::FontDescriptor& rDescr, cons
aFont.SetStyleName( rDescr.StyleName );
if ( rDescr.Height )
aFont.SetFontSize( Size( rDescr.Width, rDescr.Height ) );
- if ( (FontFamily)rDescr.Family != FAMILY_DONTKNOW )
- aFont.SetFamily( (FontFamily)rDescr.Family );
+ if ( static_cast<FontFamily>(rDescr.Family) != FAMILY_DONTKNOW )
+ aFont.SetFamily( static_cast<FontFamily>(rDescr.Family) );
if ( static_cast<rtl_TextEncoding>(rDescr.CharSet) != RTL_TEXTENCODING_DONTKNOW )
aFont.SetCharSet( static_cast<rtl_TextEncoding>(rDescr.CharSet) );
- if ( (FontPitch)rDescr.Pitch != PITCH_DONTKNOW )
- aFont.SetPitch( (FontPitch)rDescr.Pitch );
+ if ( static_cast<FontPitch>(rDescr.Pitch) != PITCH_DONTKNOW )
+ aFont.SetPitch( static_cast<FontPitch>(rDescr.Pitch) );
if ( rDescr.CharacterWidth )
aFont.SetWidthType(vcl::unohelper::ConvertFontWidth(rDescr.CharacterWidth));
if ( rDescr.Weight )
aFont.SetWeight(vcl::unohelper::ConvertFontWeight(rDescr.Weight));
if ( rDescr.Slant != css::awt::FontSlant_DONTKNOW )
aFont.SetItalic(vcl::unohelper::ConvertFontSlant(rDescr.Slant));
- if ( (FontLineStyle)rDescr.Underline != LINESTYLE_DONTKNOW )
- aFont.SetUnderline( (FontLineStyle)rDescr.Underline );
- if ( (FontStrikeout)rDescr.Strikeout != STRIKEOUT_DONTKNOW )
- aFont.SetStrikeout( (FontStrikeout)rDescr.Strikeout );
+ if ( static_cast<FontLineStyle>(rDescr.Underline) != LINESTYLE_DONTKNOW )
+ aFont.SetUnderline( static_cast<FontLineStyle>(rDescr.Underline) );
+ if ( static_cast<FontStrikeout>(rDescr.Strikeout) != STRIKEOUT_DONTKNOW )
+ aFont.SetStrikeout( static_cast<FontStrikeout>(rDescr.Strikeout) );
// Not DONTKNOW
aFont.SetOrientation( static_cast<short>(rDescr.Orientation) );
@@ -385,7 +385,7 @@ namespace
{
if ( eDirection == FieldUnitToMeasurementUnit )
{
- if ( ( aUnit.eFieldUnit == (FieldUnit)_nUnit ) && ( aUnit.nFieldToMeasureFactor == _rFieldToUNOValueFactor ) )
+ if ( ( aUnit.eFieldUnit == static_cast<FieldUnit>(_nUnit) ) && ( aUnit.nFieldToMeasureFactor == _rFieldToUNOValueFactor ) )
return aUnit.nMeasurementUnit;
}
else
@@ -416,7 +416,7 @@ sal_Int16 VCLUnoHelper::ConvertToMeasurementUnit( FieldUnit _nFieldUnit, sal_Int
FieldUnit VCLUnoHelper::ConvertToFieldUnit( sal_Int16 _nMeasurementUnit, sal_Int16& _rFieldToUNOValueFactor )
{
- return (FieldUnit)convertMeasurementUnit( _nMeasurementUnit, MeasurementUnitToFieldUnit, _rFieldToUNOValueFactor );
+ return static_cast<FieldUnit>(convertMeasurementUnit( _nMeasurementUnit, MeasurementUnitToFieldUnit, _rFieldToUNOValueFactor ));
}