summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-01-15 09:05:45 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-01-15 09:05:45 +0100
commit3d8090f87e68962e3e585dafb27162b021e4732c (patch)
treed8aaa312c7f60c8bce9eb36a4ab869b0cad3b197 /extensions
parent5906792ea5d4039a01cd563a8d32487a0189e680 (diff)
More loplugin:cstylecast: extensions
Change-Id: Ia2f6f15f56b4e32887b04f882a5b62eb9eb81159
Diffstat (limited to 'extensions')
-rw-r--r--extensions/source/dbpilots/listcombowizard.cxx2
-rw-r--r--extensions/source/propctrlr/fontdialog.cxx22
-rw-r--r--extensions/source/propctrlr/formcomponenthandler.cxx4
-rw-r--r--extensions/source/propctrlr/pushbuttonnavigation.cxx20
-rw-r--r--extensions/source/scanner/grid.cxx2
-rw-r--r--extensions/source/scanner/sane.cxx2
-rw-r--r--extensions/source/update/check/updatehdl.cxx2
7 files changed, 27 insertions, 27 deletions
diff --git a/extensions/source/dbpilots/listcombowizard.cxx b/extensions/source/dbpilots/listcombowizard.cxx
index 64cf36e0f0a1..bf9cd9b26fa6 100644
--- a/extensions/source/dbpilots/listcombowizard.cxx
+++ b/extensions/source/dbpilots/listcombowizard.cxx
@@ -172,7 +172,7 @@ namespace dbp
}
// ListSourceType: SQL
- getContext().xObjectModel->setPropertyValue("ListSourceType", makeAny((sal_Int32)ListSourceType_SQL));
+ getContext().xObjectModel->setPropertyValue("ListSourceType", makeAny(sal_Int32(ListSourceType_SQL)));
if (isListBox())
{
diff --git a/extensions/source/propctrlr/fontdialog.cxx b/extensions/source/propctrlr/fontdialog.cxx
index 8fd7d4dcc548..86b0258a536b 100644
--- a/extensions/source/propctrlr/fontdialog.cxx
+++ b/extensions/source/propctrlr/fontdialog.cxx
@@ -209,28 +209,28 @@ namespace pcr
sal_Int16 nFontCharset = aPropExtractor.getInt16FontProperty(PROPERTY_FONT_CHARSET, aDefaultFont.CharSet);
float nFontHeight = aPropExtractor.getFloatFontProperty(PROPERTY_FONT_HEIGHT, static_cast<float>(aDefaultFont.Height));
float nFontWeight = aPropExtractor.getFloatFontProperty(PROPERTY_FONT_WEIGHT, aDefaultFont.Weight);
- css::awt::FontSlant nFontSlant = static_cast<css::awt::FontSlant>(aPropExtractor.getInt16FontProperty(PROPERTY_FONT_SLANT, (sal_Int16)aDefaultFont.Slant));
+ css::awt::FontSlant nFontSlant = static_cast<css::awt::FontSlant>(aPropExtractor.getInt16FontProperty(PROPERTY_FONT_SLANT, static_cast<sal_Int16>(aDefaultFont.Slant)));
sal_Int16 nFontLineStyle = aPropExtractor.getInt16FontProperty(PROPERTY_FONT_UNDERLINE, aDefaultFont.Underline);
sal_Int16 nFontStrikeout = aPropExtractor.getInt16FontProperty(PROPERTY_FONT_STRIKEOUT, aDefaultFont.Strikeout);
sal_Int32 nTextLineColor = aPropExtractor.getInt32FontProperty(PROPERTY_TEXTLINECOLOR, COL_AUTO);
- sal_Int16 nFontRelief = aPropExtractor.getInt16FontProperty(PROPERTY_FONT_RELIEF, (sal_Int16)aDefaultVCLFont.GetRelief());
- sal_Int16 nFontEmphasisMark = aPropExtractor.getInt16FontProperty(PROPERTY_FONT_EMPHASIS_MARK, (sal_uInt16)aDefaultVCLFont.GetEmphasisMark());
+ sal_Int16 nFontRelief = aPropExtractor.getInt16FontProperty(PROPERTY_FONT_RELIEF, static_cast<sal_Int16>(aDefaultVCLFont.GetRelief()));
+ sal_Int16 nFontEmphasisMark = aPropExtractor.getInt16FontProperty(PROPERTY_FONT_EMPHASIS_MARK, static_cast<sal_uInt16>(aDefaultVCLFont.GetEmphasisMark()));
Any aValue;
bool bWordLineMode = aPropExtractor.getCheckFontProperty(PROPERTY_WORDLINEMODE, aValue) ? aDefaultFont.WordLineMode : ::cppu::any2bool(aValue);
sal_Int32 nColor32 = aPropExtractor.getInt32FontProperty(PROPERTY_TEXTCOLOR, 0);
// build SfxItems with the values
- SvxFontItem aFontItem((FontFamily)nFontFamily, aFontName, aFontStyleName, PITCH_DONTKNOW, nFontCharset, CFID_FONT);
+ SvxFontItem aFontItem(static_cast<FontFamily>(nFontFamily), aFontName, aFontStyleName, PITCH_DONTKNOW, nFontCharset, CFID_FONT);
nFontHeight = static_cast<float>(OutputDevice::LogicToLogic(Size(0, static_cast<sal_Int32>(nFontHeight)), MapMode(MapUnit::MapPoint), MapMode(MapUnit::MapTwip)).Height());
SvxFontHeightItem aSvxFontHeightItem(static_cast<sal_uInt32>(nFontHeight),100,CFID_HEIGHT);
FontWeight eWeight=vcl::unohelper::ConvertFontWeight(nFontWeight);
FontItalic eItalic=vcl::unohelper::ConvertFontSlant(nFontSlant);
- FontLineStyle eUnderline=(FontLineStyle)nFontLineStyle;
- FontStrikeout eStrikeout=(FontStrikeout)nFontStrikeout;
+ FontLineStyle eUnderline=static_cast<FontLineStyle>(nFontLineStyle);
+ FontStrikeout eStrikeout=static_cast<FontStrikeout>(nFontStrikeout);
SvxWeightItem aWeightItem(eWeight,CFID_WEIGHT);
SvxPostureItem aPostureItem(eItalic,CFID_POSTURE);
@@ -245,8 +245,8 @@ namespace pcr
SvxLanguageItem aLanguageItem(Application::GetSettings().GetUILanguageTag().getLanguageType(), CFID_LANGUAGE);
// the 2 CJK props
- SvxCharReliefItem aFontReliefItem((FontRelief)nFontRelief, CFID_RELIEF);
- SvxEmphasisMarkItem aEmphasisMarkitem((FontEmphasisMark)nFontEmphasisMark, CFID_EMPHASIS);
+ SvxCharReliefItem aFontReliefItem(static_cast<FontRelief>(nFontRelief), CFID_RELIEF);
+ SvxEmphasisMarkItem aEmphasisMarkitem(static_cast<FontEmphasisMark>(nFontEmphasisMark), CFID_EMPHASIS);
_pSet->Put(aFontItem);
_pSet->Put(aSvxFontHeightItem);
@@ -356,7 +356,7 @@ namespace pcr
static_cast<const SvxPostureItem&>(_rSet.Get(CFID_POSTURE));
css::awt::FontSlant eSlant = vcl::unohelper::ConvertFontSlant(rPostureItem.GetPosture());
- lcl_pushBackPropertyValue( _out_properties, PROPERTY_FONT_SLANT, makeAny((sal_Int16)eSlant));
+ lcl_pushBackPropertyValue( _out_properties, PROPERTY_FONT_SLANT, makeAny(static_cast<sal_Int16>(eSlant)));
}
@@ -433,7 +433,7 @@ namespace pcr
const SvxCharReliefItem& rReliefItem =
static_cast<const SvxCharReliefItem&>(_rSet.Get(CFID_RELIEF));
- lcl_pushBackPropertyValue( _out_properties, PROPERTY_FONT_RELIEF, makeAny((sal_Int16)rReliefItem.GetValue()) );
+ lcl_pushBackPropertyValue( _out_properties, PROPERTY_FONT_RELIEF, makeAny(static_cast<sal_Int16>(rReliefItem.GetValue())) );
}
@@ -445,7 +445,7 @@ namespace pcr
const SvxEmphasisMarkItem& rEmphMarkItem =
static_cast<const SvxEmphasisMarkItem&>(_rSet.Get(CFID_EMPHASIS));
- lcl_pushBackPropertyValue( _out_properties, PROPERTY_FONT_EMPHASIS_MARK, makeAny((sal_Int16)rEmphMarkItem.GetEmphasisMark()) );
+ lcl_pushBackPropertyValue( _out_properties, PROPERTY_FONT_EMPHASIS_MARK, makeAny(static_cast<sal_Int16>(rEmphMarkItem.GetEmphasisMark())) );
}
}
catch (const Exception& )
diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx
index 60bbffd76bb3..40fce9868229 100644
--- a/extensions/source/propctrlr/formcomponenthandler.cxx
+++ b/extensions/source/propctrlr/formcomponenthandler.cxx
@@ -2489,9 +2489,9 @@ namespace pcr
// read out ListSourceTypes
Any aListSourceType( m_xComponent->getPropertyValue( PROPERTY_LISTSOURCETYPE ) );
- sal_Int32 nListSourceType = (sal_Int32)ListSourceType_VALUELIST;
+ sal_Int32 nListSourceType = sal_Int32(ListSourceType_VALUELIST);
::cppu::enum2int( nListSourceType, aListSourceType );
- ListSourceType eListSourceType = (ListSourceType)nListSourceType;
+ ListSourceType eListSourceType = static_cast<ListSourceType>(nListSourceType);
_out_rDescriptor.DisplayName = m_pInfoService->getPropertyTranslation( PROPERTY_ID_LISTSOURCE );
_out_rDescriptor.HelpURL = HelpIdUrl::getHelpURL( m_pInfoService->getPropertyHelpId( PROPERTY_ID_LISTSOURCE ) );
diff --git a/extensions/source/propctrlr/pushbuttonnavigation.cxx b/extensions/source/propctrlr/pushbuttonnavigation.cxx
index d0424d1df37c..fde97c0e2209 100644
--- a/extensions/source/propctrlr/pushbuttonnavigation.cxx
+++ b/extensions/source/propctrlr/pushbuttonnavigation.cxx
@@ -37,7 +37,7 @@ namespace pcr
namespace
{
- static const sal_Int32 s_nFirstVirtualButtonType = 1 + (sal_Int32)FormButtonType_URL;
+ static const sal_Int32 s_nFirstVirtualButtonType = 1 + sal_Int32(FormButtonType_URL);
static const sal_Char* pNavigationURLs[] =
{
@@ -98,12 +98,12 @@ namespace pcr
FormButtonType PushButtonNavigation::implGetCurrentButtonType() const
{
- sal_Int32 nButtonType = (sal_Int32)FormButtonType_PUSH;
+ sal_Int32 nButtonType = sal_Int32(FormButtonType_PUSH);
if ( !m_xControlModel.is() )
- return (FormButtonType)nButtonType;
+ return static_cast<FormButtonType>(nButtonType);
OSL_VERIFY( ::cppu::enum2int( nButtonType, m_xControlModel->getPropertyValue( PROPERTY_BUTTONTYPE ) ) );
- if ( nButtonType == (sal_Int32)FormButtonType_URL )
+ if ( nButtonType == sal_Int32(FormButtonType_URL) )
{
// there's a chance that this is a "virtual" button type
// (which are realized by special URLs)
@@ -115,7 +115,7 @@ namespace pcr
// it actually *is* a virtual button type
nButtonType = s_nFirstVirtualButtonType + nNavigationURLIndex;
}
- return (FormButtonType)nButtonType;
+ return static_cast<FormButtonType>(nButtonType);
}
@@ -144,7 +144,7 @@ namespace pcr
try
{
- sal_Int32 nButtonType = (sal_Int32)FormButtonType_PUSH;
+ sal_Int32 nButtonType = sal_Int32(FormButtonType_PUSH);
OSL_VERIFY( ::cppu::enum2int( nButtonType, _rValue ) );
OUString sTargetURL;
@@ -154,7 +154,7 @@ namespace pcr
const sal_Char* pURL = lcl_getNavigationURL( nButtonType - s_nFirstVirtualButtonType );
sTargetURL = OUString::createFromAscii( pURL );
- nButtonType = (sal_Int32)FormButtonType_URL;
+ nButtonType = sal_Int32(FormButtonType_URL);
}
m_xControlModel->setPropertyValue( PROPERTY_BUTTONTYPE, makeAny( static_cast< FormButtonType >( nButtonType ) ) );
@@ -181,10 +181,10 @@ namespace pcr
eState = xStateAccess->getPropertyState( PROPERTY_BUTTONTYPE );
if ( eState == PropertyState_DIRECT_VALUE )
{
- sal_Int32 nRealButtonType = (sal_Int32)FormButtonType_PUSH;
+ sal_Int32 nRealButtonType = sal_Int32(FormButtonType_PUSH);
OSL_VERIFY( ::cppu::enum2int( nRealButtonType, m_xControlModel->getPropertyValue( PROPERTY_BUTTONTYPE ) ) );
// perhaps it's one of the virtual button types?
- if ( (sal_Int32)FormButtonType_URL == nRealButtonType )
+ if ( sal_Int32(FormButtonType_URL) == nRealButtonType )
{
// yes, it is -> rely on the state of the URL property
eState = xStateAccess->getPropertyState( PROPERTY_TARGET_URL );
@@ -213,7 +213,7 @@ namespace pcr
if ( m_bIsPushButton )
{
FormButtonType nCurrentButtonType = implGetCurrentButtonType();
- bool bIsVirtualButtonType = nCurrentButtonType >= (FormButtonType)s_nFirstVirtualButtonType;
+ bool bIsVirtualButtonType = nCurrentButtonType >= FormButtonType(s_nFirstVirtualButtonType);
if ( bIsVirtualButtonType )
{
// pretend (to the user) that there's no URL set - since
diff --git a/extensions/source/scanner/grid.cxx b/extensions/source/scanner/grid.cxx
index a5b195756830..2daec50a5215 100644
--- a/extensions/source/scanner/grid.cxx
+++ b/extensions/source/scanner/grid.cxx
@@ -707,7 +707,7 @@ IMPL_LINK( GridDialog, ClickButtonHdl, Button*, pButton, void )
if (pButton == m_pResetButton)
{
int nType = m_pResetTypeBox->GetSelectedEntryPos();
- m_pGridWindow->ChangeMode((ResetType)nType);
+ m_pGridWindow->ChangeMode(static_cast<ResetType>(nType));
}
}
diff --git a/extensions/source/scanner/sane.cxx b/extensions/source/scanner/sane.cxx
index be0d5bd40527..caac1ec01707 100644
--- a/extensions/source/scanner/sane.cxx
+++ b/extensions/source/scanner/sane.cxx
@@ -630,7 +630,7 @@ bool Sane::Start( BitmapTransporter& rBitmap )
aParams.format)
> 4 )
{
- aParams.format = (SANE_Frame)5;
+ aParams.format = SANE_Frame(5);
}
fprintf( stderr, "format: %s\n", ppFormats[ static_cast<int>(aParams.format) ] );
fprintf( stderr, "last_frame: %s\n", aParams.last_frame ? "TRUE" : "FALSE" );
diff --git a/extensions/source/update/check/updatehdl.cxx b/extensions/source/update/check/updatehdl.cxx
index d00d2f935f53..2320e7cd993b 100644
--- a/extensions/source/update/check/updatehdl.cxx
+++ b/extensions/source/update/check/updatehdl.cxx
@@ -314,7 +314,7 @@ void SAL_CALL UpdateHandler::actionPerformed( awt::ActionEvent const & rEvent )
{
if ( rEvent.ActionCommand == msButtonIDs[i] )
{
- eButton = (DialogControls) i;
+ eButton = static_cast<DialogControls>(i);
break;
}
}