diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-06-08 16:24:27 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-06-08 16:24:27 +0200 |
commit | a4fdc347f8809638af5c598346ec4c978ee40dbe (patch) | |
tree | fed09f1d95b94dc4ab7d07ad1609ea960ddc2584 /cui | |
parent | 85a2ec80c65dbcc7c031d21f584d0417f66f2164 (diff) |
loplugin:cstylecast: deal with remaining pointer casts
Change-Id: Ieecc2f050499823e131504ecd487edc0fe3ea30a
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/customize/eventdlg.cxx | 2 | ||||
-rw-r--r-- | cui/source/customize/macropg.cxx | 2 | ||||
-rw-r--r-- | cui/source/dialogs/cuicharmap.cxx | 2 | ||||
-rw-r--r-- | cui/source/dialogs/hlmarkwn.cxx | 6 | ||||
-rw-r--r-- | cui/source/dialogs/hltpbase.cxx | 2 | ||||
-rw-r--r-- | cui/source/dialogs/iconcdlg.cxx | 2 | ||||
-rw-r--r-- | cui/source/dialogs/linkdlg.cxx | 2 | ||||
-rw-r--r-- | cui/source/factory/dlgfact.cxx | 10 | ||||
-rw-r--r-- | cui/source/inc/hltpbase.hxx | 6 | ||||
-rw-r--r-- | cui/source/options/fontsubs.cxx | 2 | ||||
-rw-r--r-- | cui/source/options/optfltr.cxx | 2 | ||||
-rw-r--r-- | cui/source/options/optgdlg.cxx | 6 | ||||
-rw-r--r-- | cui/source/options/optlingu.cxx | 20 | ||||
-rw-r--r-- | cui/source/options/optsave.cxx | 2 | ||||
-rw-r--r-- | cui/source/tabpages/autocdlg.cxx | 6 |
15 files changed, 36 insertions, 36 deletions
diff --git a/cui/source/customize/eventdlg.cxx b/cui/source/customize/eventdlg.cxx index 970bd055bbd5..cab1e2622610 100644 --- a/cui/source/customize/eventdlg.cxx +++ b/cui/source/customize/eventdlg.cxx @@ -115,7 +115,7 @@ void SvxEventConfigPage::dispose() { OUString const * pEventName = static_cast<OUString const *>(pE->GetUserData()); delete pEventName; - pE->SetUserData((void*)0); + pE->SetUserData(nullptr); pE = SvTreeListBox::NextSibling( pE ); } m_pSaveInListBox.clear(); diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx index 54c944db99a8..8697cf9ce182 100644 --- a/cui/source/customize/macropg.cxx +++ b/cui/source/customize/macropg.cxx @@ -553,7 +553,7 @@ void _SvxMacroTabPage::DisplayAppEvents( bool appEvents) SvTreeListEntry* _pE = rListBox.InsertEntry( displayName ); OUString* pEventName = new OUString( sEventName ); - _pE->SetUserData( (void*)pEventName ); + _pE->SetUserData( static_cast<void*>(pEventName) ); OUString sNew( eventURL ); _pE->ReplaceItem( new IconLBoxString( _pE, 0, sNew, &mpImpl->aMacroImg, &mpImpl->aComponentImg ), LB_MACROS_ITEMPOS ); diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx index 958942366fd9..3e4afde63e37 100644 --- a/cui/source/dialogs/cuicharmap.cxx +++ b/cui/source/dialogs/cuicharmap.cxx @@ -459,7 +459,7 @@ IMPL_LINK_NOARG(SvxCharacterMap, FontSelectHdl) while( NULL != (s = pSubsetMap->GetNextSubset( bFirst )) ) { sal_uInt16 nPos_ = m_pSubsetLB->InsertEntry( s->GetName() ); - m_pSubsetLB->SetEntryData( nPos_, (void*)s ); + m_pSubsetLB->SetEntryData( nPos_, const_cast<Subset *>(s) ); // NOTE: subset must live at least as long as the selected font if( bFirst ) m_pSubsetLB->SelectEntryPos( nPos_ ); diff --git a/cui/source/dialogs/hlmarkwn.cxx b/cui/source/dialogs/hlmarkwn.cxx index 9add30bc15b5..6245fd8aec4c 100644 --- a/cui/source/dialogs/hlmarkwn.cxx +++ b/cui/source/dialogs/hlmarkwn.cxx @@ -459,7 +459,7 @@ int SvxHlinkDlgMarkWnd::FillTree( uno::Reference< container::XNameAccess > xLink aBmp, aBmp, pParentEntry, false, TREELIST_APPEND, - (void*)pData ); + static_cast<void*>(pData) ); nEntries++; } else @@ -468,7 +468,7 @@ int SvxHlinkDlgMarkWnd::FillTree( uno::Reference< container::XNameAccess > xLink pEntry = mpLbTree->InsertEntry ( aStrDisplayname, pParentEntry, false, TREELIST_APPEND, - (void*)pData ); + static_cast<void*>(pData) ); nEntries++; } } @@ -478,7 +478,7 @@ int SvxHlinkDlgMarkWnd::FillTree( uno::Reference< container::XNameAccess > xLink pEntry = mpLbTree->InsertEntry ( aStrDisplayname, pParentEntry, false, TREELIST_APPEND, - (void*)pData ); + static_cast<void*>(pData) ); nEntries++; } diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx index c9b7af89df3c..d7ed1a3eea01 100644 --- a/cui/source/dialogs/hltpbase.cxx +++ b/cui/source/dialogs/hltpbase.cxx @@ -190,7 +190,7 @@ bool SvxHyperlinkTabPageBase::MoveToExtraWnd( Point aNewPos, bool bDisConnectDlg // Show Extra-Window void SvxHyperlinkTabPageBase::ShowMarkWnd () { - ( ( vcl::Window* ) mpMarkWnd )->Show(); + static_cast<vcl::Window*>(mpMarkWnd)->Show(); // Size of dialog-window in screen pixels Rectangle aDlgRect( mpDialog->GetWindowExtentsRelative( NULL ) ); diff --git a/cui/source/dialogs/iconcdlg.cxx b/cui/source/dialogs/iconcdlg.cxx index ec76ff1831ac..6e800d257be5 100644 --- a/cui/source/dialogs/iconcdlg.cxx +++ b/cui/source/dialogs/iconcdlg.cxx @@ -298,7 +298,7 @@ SvxIconChoiceCtrlEntry* IconChoiceDialog::AddTabPage( sal_uInt16 *pId = new sal_uInt16 ( nId ); SvxIconChoiceCtrlEntry* pEntry = m_pIconCtrl->InsertEntry( rIconText, rChoiceIcon ); - pEntry->SetUserData ( (void*) pId ); + pEntry->SetUserData ( static_cast<void*>(pId) ); return pEntry; } diff --git a/cui/source/dialogs/linkdlg.cxx b/cui/source/dialogs/linkdlg.cxx index f1652f82d9eb..235ed7446f30 100644 --- a/cui/source/dialogs/linkdlg.cxx +++ b/cui/source/dialogs/linkdlg.cxx @@ -671,7 +671,7 @@ void SvBaseLinksDlg::InsertEntry( const SvBaseLink& rLink, sal_uLong nPos, bool aEntry += ImplGetStateStr( rLink ); SvTreeListEntry * pE = m_pTbLinks->InsertEntryToColumn( aEntry, nPos ); - pE->SetUserData( (void*)&rLink ); + pE->SetUserData( const_cast<SvBaseLink *>(&rLink) ); if(bSelect) m_pTbLinks->Select(pE); } diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index 2ec3dd4ee7ad..8826c9c33583 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -535,7 +535,7 @@ OUString AbstractURLDlg_Impl::GetName() const void AbstractSvxHlinkDlgMarkWnd_Impl::Hide() { - ((vcl::Window*)pDlg)->Hide(); + static_cast<vcl::Window*>(pDlg)->Hide(); } void AbstractSvxHlinkDlgMarkWnd_Impl::SetSizePixel( const Size& rNewSize ) @@ -550,12 +550,12 @@ Size AbstractSvxHlinkDlgMarkWnd_Impl::GetSizePixel() const bool AbstractSvxHlinkDlgMarkWnd_Impl::IsVisible( ) const { - return (( vcl::Window* )pDlg)->IsVisible(); + return static_cast<vcl::Window*>(pDlg)->IsVisible(); } void AbstractSvxHlinkDlgMarkWnd_Impl::Invalidate( InvalidateFlags nFlags ) { - (( vcl::Window* )pDlg)->Invalidate(nFlags); + static_cast<vcl::Window*>(pDlg)->Invalidate(nFlags); } bool AbstractSvxHlinkDlgMarkWnd_Impl::MoveTo( Point aNewPos )const @@ -810,7 +810,7 @@ void AbstractSvxPathSelectDialog_Impl::SetTitle( const OUString& rNewTitle ) vcl::Window * AbstractSvxHpLinkDlg_Impl::GetWindow() { - return (vcl::Window *)pDlg; + return static_cast<vcl::Window *>(pDlg); } bool AbstractSvxHpLinkDlg_Impl::QueryClose() @@ -942,7 +942,7 @@ IMPL_LINK_NOARG(AbstractSvxPostItDialog_Impl, PrevHdl) } vcl::Window * AbstractSvxPostItDialog_Impl::GetWindow() { - return (vcl::Window *)pDlg; + return static_cast<vcl::Window *>(pDlg); } OUString AbstractPasswordToOpenModifyDialog_Impl::GetPasswordToOpen() const diff --git a/cui/source/inc/hltpbase.hxx b/cui/source/inc/hltpbase.hxx index d155d6e42de7..2522ba866155 100644 --- a/cui/source/inc/hltpbase.hxx +++ b/cui/source/inc/hltpbase.hxx @@ -135,7 +135,7 @@ public: virtual void ActivatePage( const SfxItemSet& rItemSet ) SAL_OVERRIDE; virtual int DeactivatePage( SfxItemSet* pSet = 0 ) SAL_OVERRIDE; - bool IsMarkWndVisible () { return ((vcl::Window*)mpMarkWnd)->IsVisible(); } + bool IsMarkWndVisible () { return static_cast<vcl::Window*>(mpMarkWnd)->IsVisible(); } Size GetSizeExtraWnd () { return ( mpMarkWnd->GetSizePixel() ); } bool MoveToExtraWnd ( Point aNewPos, bool bDisConnectDlg = false ); @@ -148,8 +148,8 @@ protected: virtual void SetMarkWndShouldOpen(bool bOpen); void ShowMarkWnd (); - void HideMarkWnd () { ( ( vcl::Window* ) mpMarkWnd )->Hide(); } - void InvalidateMarkWnd () { ( ( vcl::Window* ) mpMarkWnd )->Invalidate(); } + void HideMarkWnd () { static_cast<vcl::Window*>(mpMarkWnd)->Hide(); } + void InvalidateMarkWnd () { static_cast<vcl::Window*>(mpMarkWnd)->Invalidate(); } SfxDispatcher* GetDispatcher() const; diff --git a/cui/source/options/fontsubs.cxx b/cui/source/options/fontsubs.cxx index 6885694dfcea..95bedeef6d6a 100644 --- a/cui/source/options/fontsubs.cxx +++ b/cui/source/options/fontsubs.cxx @@ -453,7 +453,7 @@ void SvxFontSubstCheckListBox::KeyInput( const KeyEvent& rKEvt ) if ( nCol < 2 ) { CheckEntryPos( nSelPos, nCol, !IsChecked( nSelPos, nCol ) ); - CallImplEventListeners( VCLEVENT_CHECKBOX_TOGGLE, (void*)GetEntry( nSelPos ) ); + CallImplEventListeners( VCLEVENT_CHECKBOX_TOGGLE, static_cast<void*>(GetEntry( nSelPos )) ); } else { diff --git a/cui/source/options/optfltr.cxx b/cui/source/options/optfltr.cxx index ede4059fdbc3..0de47b4b3b7d 100644 --- a/cui/source/options/optfltr.cxx +++ b/cui/source/options/optfltr.cxx @@ -452,7 +452,7 @@ void OfaMSFilterTabPage2::MSFltrSimpleTable::KeyInput( const KeyEvent& rKEvt ) SvTreeListEntry* pEntry = GetEntry( nSelPos ); bool bIsChecked = ( GetCheckButtonState( pEntry, nCol ) == SV_BUTTON_CHECKED ); CheckEntryPos( nSelPos, nCol, !bIsChecked ); - CallImplEventListeners( VCLEVENT_CHECKBOX_TOGGLE, (void*)pEntry ); + CallImplEventListeners( VCLEVENT_CHECKBOX_TOGGLE, static_cast<void*>(pEntry) ); } else { diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index 11b37a77c1ff..4b3f97008c06 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -1216,7 +1216,7 @@ OfaLanguagesTabPage::OfaLanguagesTabPage(vcl::Window* pParent, const SfxItemSet& aTwoSpace + ApplyLreOrRleEmbedding( SvtLanguageTable::GetLanguageString( pCurr->GetLanguage() ) ); sal_uInt16 nPos = m_pCurrencyLB->InsertEntry( aStr_ ); - m_pCurrencyLB->SetEntryData( nPos, (void*) pCurr ); + m_pCurrencyLB->SetEntryData( nPos, const_cast<NfCurrencyEntry *>(pCurr) ); } m_pLocaleSettingLB->SetSelectHdl( LINK( this, OfaLanguagesTabPage, LocaleSettingHdl ) ); @@ -1570,7 +1570,7 @@ void OfaLanguagesTabPage::Reset( const SfxItemSet* rSet ) pCurr = SvNumberFormatter::GetCurrencyEntry( aAbbrev, eLang ); } // if pCurr==NULL the SYSTEM entry is selected - sal_uInt16 nPos = m_pCurrencyLB->GetEntryPos( (void*) pCurr ); + sal_uInt16 nPos = m_pCurrencyLB->GetEntryPos( static_cast<void const *>(pCurr) ); m_pCurrencyLB->SelectEntryPos( nPos ); bReadonly = pLangConfig->aSysLocaleOptions.IsReadOnly(SvtSysLocaleOptions::E_CURRENCY); m_pCurrencyLB->Enable(!bReadonly); @@ -1760,7 +1760,7 @@ IMPL_LINK( OfaLanguagesTabPage, LocaleSettingHdl, SvxLanguageBox*, pBox ) const NfCurrencyEntry* pCurr = &SvNumberFormatter::GetCurrencyEntry( ((eLang == LANGUAGE_USER_SYSTEM_CONFIG) ? MsLangId::getSystemLanguage() : eLang)); - sal_uInt16 nPos = m_pCurrencyLB->GetEntryPos( (void*) NULL ); + sal_uInt16 nPos = m_pCurrencyLB->GetEntryPos( nullptr ); if (pCurr) { // Update the "Default ..." currency. diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx index cafbe1180deb..4b285f554500 100644 --- a/cui/source/options/optlingu.cxx +++ b/cui/source/options/optlingu.cxx @@ -1399,7 +1399,7 @@ void SvxLinguTabPage::UpdateModulesBox_Impl() const ServiceInfo_Impl &rInfo = rAllDispSrvcArr[i]; m_pLinguModulesCLB->InsertEntry( rInfo.sDisplayName, TREELIST_APPEND ); SvTreeListEntry* pEntry = m_pLinguModulesCLB->GetEntry(i); - pEntry->SetUserData( (void *) &rInfo ); + pEntry->SetUserData( const_cast<ServiceInfo_Impl *>(&rInfo) ); m_pLinguModulesCLB->CheckEntryPos( i, rInfo.bConfigured ); } m_pLinguModulesEditPB->Enable( nDispSrvcCount > 0 ); @@ -2099,7 +2099,7 @@ IMPL_LINK( SvxEditModulesDlg, LangSelectHdl_Impl, ListBox *, pBox ) SvTreeListEntry* pEntry = CreateEntry( sSpell, CBCOL_SECOND ); ModuleUserData_Impl* pUserData = new ModuleUserData_Impl( OUString(), true, false, TYPE_SPELL, 0 ); - pEntry->SetUserData( (void *)pUserData ); + pEntry->SetUserData( static_cast<void *>(pUserData) ); pModel->Insert( pEntry ); Sequence< OUString > aNames( rLinguData.GetSortedImplNames( eCurLanguage, TYPE_SPELL ) ); @@ -2133,7 +2133,7 @@ IMPL_LINK( SvxEditModulesDlg, LangSelectHdl_Impl, ListBox *, pBox ) lcl_SetCheckButton( pNewEntry, bCheck ); pUserData = new ModuleUserData_Impl( aImplName, false, bCheck, TYPE_SPELL, (sal_uInt8)nLocalIndex++ ); - pNewEntry->SetUserData( (void *)pUserData ); + pNewEntry->SetUserData( static_cast<void *>(pUserData) ); pModel->Insert( pNewEntry ); } } @@ -2143,7 +2143,7 @@ IMPL_LINK( SvxEditModulesDlg, LangSelectHdl_Impl, ListBox *, pBox ) pEntry = CreateEntry( sGrammar, CBCOL_SECOND ); pUserData = new ModuleUserData_Impl( OUString(), true, false, TYPE_GRAMMAR, 0 ); - pEntry->SetUserData( (void *)pUserData ); + pEntry->SetUserData( static_cast<void *>(pUserData) ); pModel->Insert( pEntry ); aNames = rLinguData.GetSortedImplNames( eCurLanguage, TYPE_GRAMMAR ); @@ -2177,7 +2177,7 @@ IMPL_LINK( SvxEditModulesDlg, LangSelectHdl_Impl, ListBox *, pBox ) lcl_SetCheckButton( pNewEntry, bCheck ); pUserData = new ModuleUserData_Impl( aImplName, false, bCheck, TYPE_GRAMMAR, (sal_uInt8)nLocalIndex++ ); - pNewEntry->SetUserData( (void *)pUserData ); + pNewEntry->SetUserData( static_cast<void *>(pUserData) ); pModel->Insert( pNewEntry ); } } @@ -2187,7 +2187,7 @@ IMPL_LINK( SvxEditModulesDlg, LangSelectHdl_Impl, ListBox *, pBox ) pEntry = CreateEntry( sHyph, CBCOL_SECOND ); pUserData = new ModuleUserData_Impl( OUString(), true, false, TYPE_HYPH, 0 ); - pEntry->SetUserData( (void *)pUserData ); + pEntry->SetUserData( static_cast<void *>(pUserData) ); pModel->Insert( pEntry ); aNames = rLinguData.GetSortedImplNames( eCurLanguage, TYPE_HYPH ); @@ -2221,7 +2221,7 @@ IMPL_LINK( SvxEditModulesDlg, LangSelectHdl_Impl, ListBox *, pBox ) lcl_SetCheckButton( pNewEntry, bCheck ); pUserData = new ModuleUserData_Impl( aImplName, false, bCheck, TYPE_HYPH, (sal_uInt8)nLocalIndex++ ); - pNewEntry->SetUserData( (void *)pUserData ); + pNewEntry->SetUserData( static_cast<void *>(pUserData) ); pModel->Insert( pNewEntry ); } } @@ -2231,7 +2231,7 @@ IMPL_LINK( SvxEditModulesDlg, LangSelectHdl_Impl, ListBox *, pBox ) pEntry = CreateEntry( sThes, CBCOL_SECOND ); pUserData = new ModuleUserData_Impl( OUString(), true, false, TYPE_THES, 0 ); - pEntry->SetUserData( (void *)pUserData ); + pEntry->SetUserData( static_cast<void *>(pUserData) ); pModel->Insert( pEntry ); aNames = rLinguData.GetSortedImplNames( eCurLanguage, TYPE_THES ); @@ -2265,7 +2265,7 @@ IMPL_LINK( SvxEditModulesDlg, LangSelectHdl_Impl, ListBox *, pBox ) lcl_SetCheckButton( pNewEntry, bCheck ); pUserData = new ModuleUserData_Impl( aImplName, false, bCheck, TYPE_THES, (sal_uInt8)nLocalIndex++ ); - pNewEntry->SetUserData( (void *)pUserData ); + pNewEntry->SetUserData( static_cast<void *>(pUserData) ); pModel->Insert( pNewEntry ); } } @@ -2288,7 +2288,7 @@ IMPL_LINK( SvxEditModulesDlg, UpDownHdl_Impl, PushButton *, pBtn ) ModuleUserData_Impl* pData = static_cast<ModuleUserData_Impl*>(pEntry->GetUserData()); OUString aStr(m_pModulesCLB->GetEntryText(pEntry)); SvTreeListEntry* pToInsert = CreateEntry( aStr, CBCOL_FIRST ); - pToInsert->SetUserData( (void *)pData); + pToInsert->SetUserData( static_cast<void *>(pData)); bool bIsChecked = m_pModulesCLB->IsChecked(nCurPos); pModel->Remove(pEntry); diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx index 8c1c67a67421..c617d64f1ace 100644 --- a/cui/source/options/optsave.cxx +++ b/cui/source/options/optsave.cxx @@ -594,7 +594,7 @@ IMPL_LINK( SfxSaveTabPage, FilterHdl_Impl, ListBox *, pBox ) { sal_uInt16 nEntryPos = aSaveAsLB->InsertEntry(pUIFilters[i]); if ( pImpl->aODFArr[nData][i] ) - aSaveAsLB->SetEntryData( nEntryPos, (void*)pImpl ); + aSaveAsLB->SetEntryData( nEntryPos, static_cast<void*>(pImpl) ); if(pFilters[i] == pImpl->aDefaultArr[nData]) sSelect = pUIFilters[i]; } diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx index 37cc472dce22..b1fded465be2 100644 --- a/cui/source/tabpages/autocdlg.cxx +++ b/cui/source/tabpages/autocdlg.cxx @@ -848,7 +848,7 @@ void OfaACorrCheckListBox::KeyInput( const KeyEvent& rKEvt ) if ( nCol < 2 ) { CheckEntryPos( nSelPos, nCol, !IsChecked( nSelPos, nCol ) ); - CallImplEventListeners( VCLEVENT_CHECKBOX_TOGGLE, (void*)GetEntry( nSelPos ) ); + CallImplEventListeners( VCLEVENT_CHECKBOX_TOGGLE, static_cast<void*>(GetEntry( nSelPos )) ); } else { @@ -2338,7 +2338,7 @@ void OfaAutoCompleteTabPage::Reset( const SfxItemSet* ) const OUString* pStr = &(*m_pAutoCompleteList)[n]->GetAutoCompleteString(); sal_Int32 nPos = m_pLBEntries->InsertEntry( *pStr ); - m_pLBEntries->SetEntryData( nPos, (void*)pStr ); + m_pLBEntries->SetEntryData( nPos, const_cast<OUString *>(pStr) ); } } else @@ -2412,7 +2412,7 @@ void OfaAutoCompleteTabPage::CopyToClipboard() const sData.append(aLineEnd); } pCntnr->CopyByteString( SotClipboardFormatId::STRING, sData.makeStringAndClear() ); - pCntnr->CopyToClipboard( (vcl::Window*)this ); + pCntnr->CopyToClipboard( static_cast<vcl::Window*>(const_cast<OfaAutoCompleteTabPage *>(this)) ); } } |