Kaydet (Commit) 9d1c14ce authored tarafından Stephan Bergmann's avatar Stephan Bergmann

More loplugin:cstylecast: sfx2

Change-Id: Ifdb964558f070e7c9ee87eabeaafa5c3c079c0c9
üst b20ccaf2
......@@ -61,7 +61,7 @@ namespace std
{
std::size_t operator()(const SfxGroupId& k) const
{
return std::hash<sal_uInt16>()((sal_uInt16)k);
return std::hash<sal_uInt16>()(static_cast<sal_uInt16>(k));
}
};
}
......
......@@ -643,7 +643,7 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet )
if ( SfxItemState::SET == rSet.GetItemState(SID_BASIC_ENABLED, true, &pItem))
{
DBG_ASSERT(dynamic_cast< const SfxUInt16Item *>( pItem ) != nullptr, "SfxInt16Item expected");
aSecurityOptions.SetBasicMode( (EBasicSecurityMode)static_cast<const SfxUInt16Item*>( pItem )->GetValue() );
aSecurityOptions.SetBasicMode( static_cast<EBasicSecurityMode>(static_cast<const SfxUInt16Item*>( pItem )->GetValue()) );
}
// Execute PlugIns
......
......@@ -581,7 +581,7 @@ bool SfxChildWinInfo::GetExtraData_Impl
if ( aStr.isEmpty() )
return false;
if ( pAlign )
*pAlign = (SfxChildAlignment) static_cast<sal_uInt16>(aStr.toInt32());
*pAlign = static_cast<SfxChildAlignment>(static_cast<sal_uInt16>(aStr.toInt32()));
// then the LastAlignment
nPos = aStr.indexOf(',');
......
......@@ -243,7 +243,7 @@ FieldUnit SfxModule::GetCurrentFieldUnit()
{
const SfxPoolItem* pItem = pModule->GetItem( SID_ATTR_METRIC );
if ( pItem )
eUnit = (FieldUnit) static_cast<const SfxUInt16Item*>(pItem)->GetValue();
eUnit = static_cast<FieldUnit>(static_cast<const SfxUInt16Item*>(pItem)->GetValue());
}
else
SAL_WARN( "sfx.appl", "GetModuleFieldUnit(): no module found" );
......@@ -255,7 +255,7 @@ FieldUnit SfxModule::GetFieldUnit() const
FieldUnit eUnit = FUNIT_INCH;
const SfxPoolItem* pItem = GetItem( SID_ATTR_METRIC );
if ( pItem )
eUnit = (FieldUnit) static_cast<const SfxUInt16Item*>(pItem)->GetValue();
eUnit = static_cast<FieldUnit>(static_cast<const SfxUInt16Item*>(pItem)->GetValue());
return eUnit;
}
......
......@@ -38,7 +38,7 @@ static HTMLOptionEnum<ScrollingMode> const aScrollingTable[] =
{ sHTML_SC_yes, ScrollingMode::Yes },
{ sHTML_SC_no, ScrollingMode::No },
{ sHTML_SC_auto, ScrollingMode::Auto },
{ nullptr, (ScrollingMode)0 }
{ nullptr, ScrollingMode(0) }
};
void SfxFrameHTMLParser::ParseFrameOptions(
......
......@@ -1760,7 +1760,7 @@ bool SfxDispatcher::FindServer_(sal_uInt16 nSlot, SfxSlotServer& rServer, bool b
const SfxSlot *pSlot = pIFace->GetSlot(nSlot);
if ( pSlot && pSlot->nDisableFlags != SfxDisableFlags::NONE &&
( (int)pSlot->nDisableFlags & (int)pObjShell->GetDisableFlags() ) != 0 )
( static_cast<int>(pSlot->nDisableFlags) & static_cast<int>(pObjShell->GetDisableFlags()) ) != 0 )
return false;
if ( pSlot && !( pSlot->nFlags & SfxSlotMode::READONLYDOC ) && bReadOnly )
......
......@@ -284,7 +284,7 @@ SfxObjectUI_Impl* CreateObjectBarUI_Impl(sal_uInt16 nPos, SfxVisibilityFlags nFl
if (nFlags == SfxVisibilityFlags::Invisible)
nFlags |= SfxVisibilityFlags::Standard;
return new SfxObjectUI_Impl(nPos, nFlags, (sal_uInt32)eId, nFeature);
return new SfxObjectUI_Impl(nPos, nFlags, static_cast<sal_uInt32>(eId), nFeature);
}
ToolbarId SfxInterface::GetObjectBarId(sal_uInt16 nNo) const
......@@ -303,7 +303,7 @@ ToolbarId SfxInterface::GetObjectBarId(sal_uInt16 nNo) const
assert( nNo<pImplData->aObjectBars.size() );
return (ToolbarId)pImplData->aObjectBars[nNo]->nObjId;
return static_cast<ToolbarId>(pImplData->aObjectBars[nNo]->nObjId);
}
sal_uInt16 SfxInterface::GetObjectBarPos( sal_uInt16 nNo ) const
......
......@@ -198,7 +198,7 @@ void SAL_CALL SfxStatusListener::statusChanged( const FeatureStateEvent& rEvent)
{
ItemStatus aItemStatus;
rEvent.State >>= aItemStatus;
eState = (SfxItemState) aItemStatus.State;
eState = static_cast<SfxItemState>(aItemStatus.State);
pItem = new SfxVoidItem( m_nSlotID );
}
else if ( aType == cppu::UnoType< css::frame::status::Visibility >::get() )
......
......@@ -896,7 +896,7 @@ void SfxDockingWindow::Initialize(SfxChildWinInfo *pInfo)
pImpl->aWinState = pInfo->aWinState;
// check for valid alignment
SfxChildAlignment eLocalAlignment = (SfxChildAlignment) static_cast<sal_uInt16>(aStr.toInt32());
SfxChildAlignment eLocalAlignment = static_cast<SfxChildAlignment>(static_cast<sal_uInt16>(aStr.toInt32()));
bool bIgnoreFloatConfig = (eLocalAlignment == SfxChildAlignment::NOALIGNMENT &&
!StyleSettings::GetDockingFloatsSupported());
if (pImpl->bDockingPrevented || bIgnoreFloatConfig)
......@@ -918,7 +918,7 @@ void SfxDockingWindow::Initialize(SfxChildWinInfo *pInfo)
if ( nPos != -1 )
{
aStr = aStr.copy(nPos+1);
pImpl->SetLastAlignment( (SfxChildAlignment) static_cast<sal_uInt16>(aStr.toInt32()) );
pImpl->SetLastAlignment( static_cast<SfxChildAlignment>(static_cast<sal_uInt16>(aStr.toInt32())) );
}
nPos = aStr.indexOf(',');
......@@ -1083,9 +1083,9 @@ void SfxDockingWindow::FillInfo(SfxChildWinInfo& rInfo) const
rInfo.aWinState = pImpl->aWinState;
rInfo.aExtraString = "AL:(";
rInfo.aExtraString += OUString::number((sal_uInt16) GetAlignment());
rInfo.aExtraString += OUString::number(static_cast<sal_uInt16>(GetAlignment()));
rInfo.aExtraString += ",";
rInfo.aExtraString += OUString::number ((sal_uInt16) pImpl->GetLastAlignment());
rInfo.aExtraString += OUString::number (static_cast<sal_uInt16>(pImpl->GetLastAlignment()));
if ( pImpl->bSplitable )
{
Point aPos(pImpl->nLine, pImpl->nPos);
......
......@@ -314,7 +314,7 @@ void SfxManageStyleSheetPage::SetDescriptionText_Impl()
{
const SfxPoolItem* pPoolItem = pModule->GetItem( SID_ATTR_METRIC );
if ( pPoolItem )
eFieldUnit = (FieldUnit) static_cast<const SfxUInt16Item*>( pPoolItem )->GetValue();
eFieldUnit = static_cast<FieldUnit>(static_cast<const SfxUInt16Item*>( pPoolItem )->GetValue());
}
switch ( eFieldUnit )
......@@ -348,7 +348,7 @@ IMPL_LINK_NOARG( SfxManageStyleSheetPage, EditStyleSelectHdl_Impl, ListBox&, voi
IMPL_LINK_NOARG( SfxManageStyleSheetPage, EditStyleHdl_Impl, Button*, void )
{
OUString aTemplName(m_pFollowLb->GetSelectedEntry());
if (Execute_Impl( SID_STYLE_EDIT, aTemplName, OUString(),(sal_uInt16)pStyle->GetFamily() ))
if (Execute_Impl( SID_STYLE_EDIT, aTemplName, OUString(),static_cast<sal_uInt16>(pStyle->GetFamily()) ))
{
}
}
......@@ -366,7 +366,7 @@ IMPL_LINK_NOARG( SfxManageStyleSheetPage, EditLinkStyleHdl_Impl, Button*, void )
{