More loplugin:cstylecast: extensions
Change-Id: Ia2f6f15f56b4e32887b04f882a5b62eb9eb81159
This commit is contained in:
@@ -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())
|
||||
{
|
||||
|
@@ -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& )
|
||||
|
@@ -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 ) );
|
||||
|
@@ -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
|
||||
|
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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" );
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user