diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-01-15 09:03:18 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-01-15 09:03:18 +0100 |
commit | 9d1c14ce4c47030f8315f1f6b04d9314d3f62f48 (patch) | |
tree | e9df0eab541cf0de54a54e4a63ae1d237844b881 /sfx2 | |
parent | b20ccaf2bc25997563f00aca4b47ae5353140030 (diff) |
More loplugin:cstylecast: sfx2
Change-Id: Ifdb964558f070e7c9ee87eabeaafa5c3c079c0c9
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/appcfg.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/appl/childwin.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/appl/module.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/bastyp/frmhtml.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/control/dispatch.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/control/objface.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/control/sfxstatuslistener.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/dialog/dockwin.cxx | 8 | ||||
-rw-r--r-- | sfx2/source/dialog/mgetempl.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/dialog/splitwin.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/dialog/templdlg.cxx | 20 | ||||
-rw-r--r-- | sfx2/source/doc/printhelper.cxx | 12 | ||||
-rw-r--r-- | sfx2/source/doc/zoomitem.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/statbar/stbitem.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/toolbox/tbxitem.cxx | 2 |
15 files changed, 38 insertions, 38 deletions
diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx index ebdcce8b53af..f3e0552dc223 100644 --- a/sfx2/source/appl/appcfg.cxx +++ b/sfx2/source/appl/appcfg.cxx @@ -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 diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx index 07f0e1186a43..c6f56ee27a78 100644 --- a/sfx2/source/appl/childwin.cxx +++ b/sfx2/source/appl/childwin.cxx @@ -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(','); diff --git a/sfx2/source/appl/module.cxx b/sfx2/source/appl/module.cxx index 3fb4376cc7a1..202a4391f5ad 100644 --- a/sfx2/source/appl/module.cxx +++ b/sfx2/source/appl/module.cxx @@ -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; } diff --git a/sfx2/source/bastyp/frmhtml.cxx b/sfx2/source/bastyp/frmhtml.cxx index 65ac16e894c8..1ca43cd67bdb 100644 --- a/sfx2/source/bastyp/frmhtml.cxx +++ b/sfx2/source/bastyp/frmhtml.cxx @@ -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( diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx index e7dd16a45bd7..5834d8923d11 100644 --- a/sfx2/source/control/dispatch.cxx +++ b/sfx2/source/control/dispatch.cxx @@ -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 ) diff --git a/sfx2/source/control/objface.cxx b/sfx2/source/control/objface.cxx index 46951bd9e6ad..aa063e1fd07a 100644 --- a/sfx2/source/control/objface.cxx +++ b/sfx2/source/control/objface.cxx @@ -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 diff --git a/sfx2/source/control/sfxstatuslistener.cxx b/sfx2/source/control/sfxstatuslistener.cxx index a115d4baa34a..9197f4af64a0 100644 --- a/sfx2/source/control/sfxstatuslistener.cxx +++ b/sfx2/source/control/sfxstatuslistener.cxx @@ -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() ) diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx index e4ba1463a909..d1caedf86848 100644 --- a/sfx2/source/dialog/dockwin.cxx +++ b/sfx2/source/dialog/dockwin.cxx @@ -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); diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx index b6e78d3a5ff9..068f2ab6f9a5 100644 --- a/sfx2/source/dialog/mgetempl.cxx +++ b/sfx2/source/dialog/mgetempl.cxx @@ -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 ) { OUString aTemplName(m_pBaseLb->GetSelectedEntry()); if (aTemplName != SfxResId(STR_NONE)) - Execute_Impl( SID_STYLE_EDIT, aTemplName, OUString(),(sal_uInt16)pStyle->GetFamily() ); + Execute_Impl( SID_STYLE_EDIT, aTemplName, OUString(),static_cast<sal_uInt16>(pStyle->GetFamily()) ); } // Internal: Perform functions through the Dispatcher diff --git a/sfx2/source/dialog/splitwin.cxx b/sfx2/source/dialog/splitwin.cxx index 5b9dcaf873e0..4ca909d50142 100644 --- a/sfx2/source/dialog/splitwin.cxx +++ b/sfx2/source/dialog/splitwin.cxx @@ -226,7 +226,7 @@ SfxSplitWindow::SfxSplitWindow( vcl::Window* pParent, SfxChildAlignment eAl, { // Read Configuration OUString aWindowId("SplitWindow"); - aWindowId += OUString::number( (sal_Int32) eTbxAlign ); + aWindowId += OUString::number( static_cast<sal_Int32>(eTbxAlign) ); SvtViewOptions aWinOpt( EViewType::Window, aWindowId ); OUString aWinData; Any aUserItem = aWinOpt.GetUserItem( USERITEM_NAME ); @@ -329,7 +329,7 @@ void SfxSplitWindow::SaveConfig_Impl() } OUString aWindowId("SplitWindow"); - aWindowId += OUString::number( (sal_Int32) GetAlign() ); + aWindowId += OUString::number( static_cast<sal_Int32>(GetAlign()) ); SvtViewOptions aWinOpt( EViewType::Window, aWindowId ); aWinOpt.SetUserItem( USERITEM_NAME, makeAny( aWinData.makeStringAndClear() ) ); } diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index d6e883afeff3..dc2e7e47e882 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -1679,7 +1679,7 @@ void SfxCommonTemplateDialog_Impl::ActionSelect(sal_uInt16 nEntry) GetSelectedEntry()); Execute_Impl( SID_STYLE_WATERCAN, aTemplName, "", - (sal_uInt16)GetFamilyItem_Impl()->GetFamily() ); + static_cast<sal_uInt16>(GetFamilyItem_Impl()->GetFamily()) ); bCheck = true; } else @@ -1717,7 +1717,7 @@ void SfxCommonTemplateDialog_Impl::ActionSelect(sal_uInt16 nEntry) const OUString aTemplName(pDlg->GetName()); Execute_Impl(SID_STYLE_NEW_BY_EXAMPLE, aTemplName, "", - (sal_uInt16)GetFamilyItem_Impl()->GetFamily(), + static_cast<sal_uInt16>(GetFamilyItem_Impl()->GetFamily()), nFilter); } pStyleSheetPool->SetSearchMask( eFam, nFilter ); @@ -1728,7 +1728,7 @@ void SfxCommonTemplateDialog_Impl::ActionSelect(sal_uInt16 nEntry) { Execute_Impl(SID_STYLE_UPDATE_BY_EXAMPLE, "", "", - (sal_uInt16)GetFamilyItem_Impl()->GetFamily()); + static_cast<sal_uInt16>(GetFamilyItem_Impl()->GetFamily())); break; } case SID_TEMPLATE_LOAD: @@ -1829,7 +1829,7 @@ void SfxCommonTemplateDialog_Impl::NewHdl() Execute_Impl(SID_STYLE_NEW, "", GetSelectedEntry(), - ( sal_uInt16 )GetFamilyItem_Impl()->GetFamily(), + static_cast<sal_uInt16>(GetFamilyItem_Impl()->GetFamily()), nMask); } } @@ -1843,7 +1843,7 @@ void SfxCommonTemplateDialog_Impl::EditHdl() OUString aTemplName(GetSelectedEntry()); GetSelectedStyle(); // -Wall required?? if ( Execute_Impl( SID_STYLE_EDIT, aTemplName, OUString(), - (sal_uInt16)GetFamilyItem_Impl()->GetFamily(), 0, &nFilter ) ) + static_cast<sal_uInt16>(GetFamilyItem_Impl()->GetFamily()), 0, &nFilter ) ) { } } @@ -1907,7 +1907,7 @@ void SfxCommonTemplateDialog_Impl::DeleteHdl() const OUString aTemplName(pTreeBox ? pTreeBox->GetEntryText(*it) : aFmtLb->GetEntryText(*it)); bDontUpdate = true; // To prevent the Treelistbox to shut down while deleting Execute_Impl( SID_STYLE_DELETE, aTemplName, - OUString(), (sal_uInt16)GetFamilyItem_Impl()->GetFamily() ); + OUString(), static_cast<sal_uInt16>(GetFamilyItem_Impl()->GetFamily()) ); if ( pTreeBox ) { @@ -1932,7 +1932,7 @@ void SfxCommonTemplateDialog_Impl::HideHdl() OUString aTemplName = pTreeBox ? pTreeBox->GetEntryText(pEntry) : aFmtLb->GetEntryText(pEntry); Execute_Impl( SID_STYLE_HIDE, aTemplName, - OUString(), (sal_uInt16)GetFamilyItem_Impl()->GetFamily() ); + OUString(), static_cast<sal_uInt16>(GetFamilyItem_Impl()->GetFamily()) ); pEntry = pTreeBox ? pTreeBox->NextSelected(pEntry) : aFmtLb->NextSelected(pEntry); } @@ -1951,7 +1951,7 @@ void SfxCommonTemplateDialog_Impl::ShowHdl() OUString aTemplName = pTreeBox ? pTreeBox->GetEntryText(pEntry) : aFmtLb->GetEntryText(pEntry); Execute_Impl( SID_STYLE_SHOW, aTemplName, - OUString(), (sal_uInt16)GetFamilyItem_Impl()->GetFamily() ); + OUString(), static_cast<sal_uInt16>(GetFamilyItem_Impl()->GetFamily()) ); pEntry = pTreeBox ? pTreeBox->NextSelected(pEntry) : aFmtLb->NextSelected(pEntry); } @@ -2006,7 +2006,7 @@ IMPL_LINK_NOARG( SfxCommonTemplateDialog_Impl, ApplyHdl, LinkParamNone*, void ) sal_uInt16 nModifier = aFmtLb->GetModifier(); Execute_Impl(SID_STYLE_APPLY, GetSelectedEntry(), OUString(), - ( sal_uInt16 )GetFamilyItem_Impl()->GetFamily(), + static_cast<sal_uInt16>(GetFamilyItem_Impl()->GetFamily()), 0, nullptr, &nModifier ); } // After selecting a focused item if possible again on the app window @@ -2060,7 +2060,7 @@ IMPL_LINK( SfxCommonTemplateDialog_Impl, FmtSelectHdl, SvTreeListBox *, pListBox "", "", 0); Execute_Impl(SID_STYLE_WATERCAN, GetSelectedEntry(), "", - ( sal_uInt16 )GetFamilyItem_Impl()->GetFamily()); + static_cast<sal_uInt16>(GetFamilyItem_Impl()->GetFamily())); } EnableItem(SID_STYLE_WATERCAN, !bWaterDisabled); EnableDelete(); diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx index 0005f2534870..08a607b91d0d 100644 --- a/sfx2/source/doc/printhelper.cxx +++ b/sfx2/source/doc/printhelper.cxx @@ -55,7 +55,7 @@ #include <sfx2/objsh.hxx> #include <sfx2/event.hxx> -#define SFX_PRINTABLESTATE_CANCELJOB (css::view::PrintableState)-2 +#define SFX_PRINTABLESTATE_CANCELJOB css::view::PrintableState(-2) using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -297,7 +297,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SfxPrintHelper::getPrinter() aPrinter.getArray()[2].Value <<= eFormat; aPrinter.getArray()[1].Name = "PaperOrientation"; - view::PaperOrientation eOrient = (view::PaperOrientation)pPrinter->GetOrientation(); + view::PaperOrientation eOrient = static_cast<view::PaperOrientation>(pPrinter->GetOrientation()); aPrinter.getArray()[1].Value <<= eOrient; aPrinter.getArray()[0].Name = "Name"; @@ -369,12 +369,12 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue > { if ( !( rProp.Value >>= lDummy ) ) throw css::lang::IllegalArgumentException(); - eOrient = ( view::PaperOrientation) lDummy; + eOrient = static_cast<view::PaperOrientation>(lDummy); } - if ( (Orientation) eOrient != pPrinter->GetOrientation() ) + if ( static_cast<Orientation>(eOrient) != pPrinter->GetOrientation() ) { - pPrinter->SetOrientation( (Orientation) eOrient ); + pPrinter->SetOrientation( static_cast<Orientation>(eOrient) ); nChangeFlags |= SfxPrinterChangeFlags::CHG_ORIENTATION; } } @@ -386,7 +386,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue > { if ( !( rProp.Value >>= lDummy ) ) throw css::lang::IllegalArgumentException(); - nPaperFormat = ( view::PaperFormat ) lDummy; + nPaperFormat = static_cast<view::PaperFormat>(lDummy); } if ( convertToPaper(nPaperFormat) != pPrinter->GetPaper() ) diff --git a/sfx2/source/doc/zoomitem.cxx b/sfx2/source/doc/zoomitem.cxx index a94f92ec5d42..aed98ad5c648 100644 --- a/sfx2/source/doc/zoomitem.cxx +++ b/sfx2/source/doc/zoomitem.cxx @@ -83,8 +83,8 @@ bool SvxZoomItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) const } case MID_VALUE: rVal <<= static_cast<sal_Int32>(GetValue()); break; - case MID_VALUESET: rVal <<= (sal_Int16) nValueSet; break; - case MID_TYPE: rVal <<= (sal_Int16) eType; break; + case MID_VALUESET: rVal <<= static_cast<sal_Int16>(nValueSet); break; + case MID_TYPE: rVal <<= static_cast<sal_Int16>(eType); break; default: OSL_FAIL("sfx2::SvxZoomItem::QueryValue(), Wrong MemberId!"); return false; diff --git a/sfx2/source/statbar/stbitem.cxx b/sfx2/source/statbar/stbitem.cxx index 6306380fd976..2949ec86a578 100644 --- a/sfx2/source/statbar/stbitem.cxx +++ b/sfx2/source/statbar/stbitem.cxx @@ -263,7 +263,7 @@ void SAL_CALL SfxStatusBarControl::statusChanged( const frame::FeatureStateEvent { frame::status::ItemStatus aItemStatus; rEvent.State >>= aItemStatus; - eState = (SfxItemState) aItemStatus.State; + eState = static_cast<SfxItemState>(aItemStatus.State); pItem = new SfxVoidItem( nSlotID ); } else diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx index 4a08477c5339..9dfa94a8eafa 100644 --- a/sfx2/source/toolbox/tbxitem.cxx +++ b/sfx2/source/toolbox/tbxitem.cxx @@ -490,7 +490,7 @@ void SAL_CALL SfxToolBoxControl::statusChanged( const FeatureStateEvent& rEvent { ItemStatus aItemStatus; rEvent.State >>= aItemStatus; - SfxItemState tmpState = (SfxItemState) aItemStatus.State; + SfxItemState tmpState = static_cast<SfxItemState>(aItemStatus.State); // make sure no-one tries to send us a combination of states if (tmpState != SfxItemState::UNKNOWN && tmpState != SfxItemState::DISABLED && tmpState != SfxItemState::READONLY && tmpState != SfxItemState::DONTCARE && |