diff options
author | Noel Grandin <noel@peralex.com> | 2014-12-01 10:16:54 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-12-02 09:32:09 +0200 |
commit | d09cc11d17a33e78f76d85f098a05ab4757bfaee (patch) | |
tree | f8b26baba4cde8935caf46cd154fe14b9d37c1c9 /sw/source/ui | |
parent | 9a0f88cf27243ae8fc655aa798ed04b8f27e01ed (diff) |
loplugin: cstylecast
Change-Id: Iedac4c93e84db2db2d9527557c32b01e9a3934bd
Diffstat (limited to 'sw/source/ui')
-rw-r--r-- | sw/source/ui/fldui/DropDownFieldDialog.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/fldui/changedb.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/fldui/flddb.cxx | 22 | ||||
-rw-r--r-- | sw/source/ui/fldui/flddinf.cxx | 18 | ||||
-rw-r--r-- | sw/source/ui/fldui/flddok.cxx | 34 | ||||
-rw-r--r-- | sw/source/ui/fldui/fldedt.cxx | 10 | ||||
-rw-r--r-- | sw/source/ui/fldui/fldfunc.cxx | 16 | ||||
-rw-r--r-- | sw/source/ui/fldui/fldpage.cxx | 20 | ||||
-rw-r--r-- | sw/source/ui/fldui/fldref.cxx | 46 | ||||
-rw-r--r-- | sw/source/ui/fldui/fldtdlg.cxx | 12 | ||||
-rw-r--r-- | sw/source/ui/fldui/fldvar.cxx | 62 | ||||
-rw-r--r-- | sw/source/ui/fldui/inpdlg.cxx | 8 | ||||
-rw-r--r-- | sw/source/ui/fldui/javaedit.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/fmtui/tmpdlg.cxx | 2 |
14 files changed, 132 insertions, 132 deletions
diff --git a/sw/source/ui/fldui/DropDownFieldDialog.cxx b/sw/source/ui/fldui/DropDownFieldDialog.cxx index 854d67dbe42f..fce5029d6e32 100644 --- a/sw/source/ui/fldui/DropDownFieldDialog.cxx +++ b/sw/source/ui/fldui/DropDownFieldDialog.cxx @@ -54,7 +54,7 @@ sw::DropDownFieldDialog::DropDownFieldDialog(vcl::Window *pParent, SwWrtShell &r if( RES_DROPDOWN == pField->GetTyp()->Which() ) { - pDropField = (SwDropDownField*)pField; + pDropField = static_cast<SwDropDownField*>(pField); OUString sTitle = GetText(); sTitle += pDropField->GetPar2(); SetText(sTitle); diff --git a/sw/source/ui/fldui/changedb.cxx b/sw/source/ui/fldui/changedb.cxx index 8f073beaca27..c76c889de239 100644 --- a/sw/source/ui/fldui/changedb.cxx +++ b/sw/source/ui/fldui/changedb.cxx @@ -149,14 +149,14 @@ SvTreeListEntry* SwChangeDBDlg::Insert(const OUString& rDBName) return pChild; } SvTreeListEntry* pRet = m_pUsedDBTLB->InsertEntry(sTableName, rToInsert, rToInsert, pParent); - pRet->SetUserData((void*)nCommandType); + pRet->SetUserData(reinterpret_cast<void*>(nCommandType)); return pRet; } } pParent = m_pUsedDBTLB->InsertEntry(sDBName, aDBImg, aDBImg); SvTreeListEntry* pRet = m_pUsedDBTLB->InsertEntry(sTableName, rToInsert, rToInsert, pParent); - pRet->SetUserData((void*)nCommandType); + pRet->SetUserData(reinterpret_cast<void*>(nCommandType)); return pRet; } @@ -182,7 +182,7 @@ void SwChangeDBDlg::UpdateFlds() { OUString sTmp(m_pUsedDBTLB->GetEntryText( m_pUsedDBTLB->GetParent( pEntry )) + OUString(DB_DELIM) + m_pUsedDBTLB->GetEntryText( pEntry ) + OUString(DB_DELIM) + - OUString::number((int)(sal_uLong)pEntry->GetUserData())); + OUString::number((int)reinterpret_cast<sal_uLong>(pEntry->GetUserData()))); aDBNames.push_back(sTmp); } pEntry = m_pUsedDBTLB->NextSelected(pEntry); diff --git a/sw/source/ui/fldui/flddb.cxx b/sw/source/ui/fldui/flddb.cxx index fb9d25e0508c..a2af66a9d61a 100644 --- a/sw/source/ui/fldui/flddb.cxx +++ b/sw/source/ui/fldui/flddb.cxx @@ -154,7 +154,7 @@ void SwFldDBPage::Reset(const SfxItemSet*) if(nVal != USHRT_MAX) { for (sal_Int32 i = 0; i < m_pTypeLB->GetEntryCount(); ++i) - if(nVal == (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(i)) + if(nVal == (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(i))) { m_pTypeLB->SelectEntryPos(i); break; @@ -196,7 +196,7 @@ bool SwFldDBPage::FillItemSet(SfxItemSet* ) if(!aData.sDataSource.isEmpty()) // without database no new field command { - const sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(GetTypeSel()); + const sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())); sal_uLong nFormat = 0; sal_uInt16 nSubType = 0; @@ -222,8 +222,8 @@ bool SwFldDBPage::FillItemSet(SfxItemSet* ) break; case TYP_DBSETNUMBERFLD: - nFormat = (sal_uLong)m_pFormatLB->GetEntryData( - m_pFormatLB->GetSelectEntryPos() ); + nFormat = reinterpret_cast<sal_uLong>(m_pFormatLB->GetEntryData( + m_pFormatLB->GetSelectEntryPos() )); break; } @@ -277,7 +277,7 @@ IMPL_LINK( SwFldDBPage, TypeHdl, ListBox *, pBox ) if(!pSh) pSh = ::GetActiveWrtShell(); bool bCond = false, bSetNo = false, bFormat = false, bDBFormat = false; - const sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(GetTypeSel()); + const sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())); m_pDatabaseTLB->ShowColumns(nTypeId == TYP_DBFLD); @@ -343,8 +343,8 @@ IMPL_LINK( SwFldDBPage, TypeHdl, ListBox *, pBox ) if( IsFldEdit() ) { for( sal_Int32 nI = m_pFormatLB->GetEntryCount(); nI; ) - if( GetCurField()->GetFormat() == (sal_uLong) - m_pFormatLB->GetEntryData( --nI )) + if( GetCurField()->GetFormat() == reinterpret_cast<sal_uLong>( + m_pFormatLB->GetEntryData( --nI ))) { m_pFormatLB->SelectEntryPos( nI ); break; @@ -390,7 +390,7 @@ IMPL_LINK( SwFldDBPage, NumSelectHdl, NumFormatListBox *, pLB ) void SwFldDBPage::CheckInsert() { bool bInsert = true; - const sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(GetTypeSel()); + const sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())); SvTreeListEntry* pEntry = m_pDatabaseTLB->GetCurEntry(); @@ -421,7 +421,7 @@ IMPL_LINK( SwFldDBPage, TreeSelectHdl, SvTreeListBox *, pBox ) SvTreeListEntry* pEntry = pBox->GetCurEntry(); if (pEntry) { - const sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(GetTypeSel()); + const sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())); pEntry = m_pDatabaseTLB->GetParent(pEntry); @@ -478,14 +478,14 @@ void SwFldDBPage::FillUserData() { const sal_Int32 nEntryPos = m_pTypeLB->GetSelectEntryPos(); const sal_uInt16 nTypeSel = ( LISTBOX_ENTRY_NOTFOUND == nEntryPos ) - ? USHRT_MAX : (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData( nEntryPos ); + ? USHRT_MAX : (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData( nEntryPos )); SetUserData(USER_DATA_VERSION ";" + OUString::number( nTypeSel )); } void SwFldDBPage::ActivateMailMergeAddress() { sal_uLong nData = TYP_DBFLD; - m_pTypeLB->SelectEntryPos(m_pTypeLB->GetEntryPos( (const void*) nData )); + m_pTypeLB->SelectEntryPos(m_pTypeLB->GetEntryPos( reinterpret_cast<const void*>( nData ) )); m_pTypeLB->GetSelectHdl().Call(m_pTypeLB); const SwDBData& rData = SW_MOD()->GetDBConfig()->GetAddressSource(); m_pDatabaseTLB->Select(rData.sDataSource, rData.sCommand, aEmptyOUStr); diff --git a/sw/source/ui/fldui/flddinf.cxx b/sw/source/ui/fldui/flddinf.cxx index 021e9ae6383d..f531becfa996 100644 --- a/sw/source/ui/fldui/flddinf.cxx +++ b/sw/source/ui/fldui/flddinf.cxx @@ -180,12 +180,12 @@ void SwFldDokInfPage::Reset(const SfxItemSet* ) if (pSelEntry != 0) { m_pTypeTLB->Select(pSelEntry); - nSubType = (sal_uInt16)(sal_uLong)pSelEntry->GetUserData(); + nSubType = (sal_uInt16)reinterpret_cast<sal_uLong>(pSelEntry->GetUserData()); } else if ( m_pTypeTLB->GetEntry(0) ) { pSelEntry = m_pTypeTLB->GetEntry(0); - nSubType = (sal_uInt16)(sal_uLong)pSelEntry->GetUserData(); + nSubType = (sal_uInt16)reinterpret_cast<sal_uLong>(pSelEntry->GetUserData()); } FillSelectionLB(nSubType); @@ -221,7 +221,7 @@ IMPL_LINK_NOARG(SwFldDokInfPage, TypeHdl) m_pTypeTLB->Select(pSelEntry); } else if (pOldEntry != pSelEntry) - FillSelectionLB((sal_uInt16)(sal_uLong)pSelEntry->GetUserData()); + FillSelectionLB((sal_uInt16)reinterpret_cast<sal_uLong>(pSelEntry->GetUserData())); SubTypeHdl(); @@ -230,7 +230,7 @@ IMPL_LINK_NOARG(SwFldDokInfPage, TypeHdl) IMPL_LINK_NOARG(SwFldDokInfPage, SubTypeHdl) { - sal_uInt16 nSubType = (sal_uInt16)(sal_uLong)pSelEntry->GetUserData(); + sal_uInt16 nSubType = (sal_uInt16)reinterpret_cast<sal_uLong>(pSelEntry->GetUserData()); sal_Int32 nPos = m_pSelectionLB->GetSelectEntryPos(); sal_uInt16 nExtSubType; sal_uInt16 nNewType = 0; @@ -274,7 +274,7 @@ IMPL_LINK_NOARG(SwFldDokInfPage, SubTypeHdl) nPos = 0; } - nExtSubType = (sal_uInt16)(sal_uLong)m_pSelectionLB->GetEntryData(nPos); + nExtSubType = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pSelectionLB->GetEntryData(nPos)); } else nExtSubType = DI_SUB_TIME; @@ -324,7 +324,7 @@ IMPL_LINK_NOARG(SwFldDokInfPage, SubTypeHdl) nPos = m_pSelectionLB->GetSelectEntryPos(); if (nPos != LISTBOX_ENTRY_NOTFOUND ) { - nSubType = (sal_uInt16)(sal_uLong)m_pSelectionLB->GetEntryData(nPos); + nSubType = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pSelectionLB->GetEntryData(nPos)); nOldSubType &= ~DI_SUB_FIXED; if (nOldSubType == nSubType) @@ -416,10 +416,10 @@ sal_Int32 SwFldDokInfPage::FillSelectionLB(sal_uInt16 nSubType) bool SwFldDokInfPage::FillItemSet(SfxItemSet* ) { - if (!pSelEntry || (sal_uInt16)(sal_uLong)pSelEntry->GetUserData() == USHRT_MAX) + if (!pSelEntry || (sal_uInt16)reinterpret_cast<sal_uLong>(pSelEntry->GetUserData()) == USHRT_MAX) return false; - sal_uInt16 nSubType = (sal_uInt16)(sal_uLong)pSelEntry->GetUserData(); + sal_uInt16 nSubType = (sal_uInt16)reinterpret_cast<sal_uLong>(pSelEntry->GetUserData()); sal_uLong nFormat = 0; @@ -430,7 +430,7 @@ bool SwFldDokInfPage::FillItemSet(SfxItemSet* ) aName = m_pTypeTLB->GetEntryText(pSelEntry); if (nPos != LISTBOX_ENTRY_NOTFOUND) - nSubType |= (sal_uInt16)(sal_uLong)m_pSelectionLB->GetEntryData(nPos); + nSubType |= (sal_uInt16)reinterpret_cast<sal_uLong>(m_pSelectionLB->GetEntryData(nPos)); if (m_pFixedCB->IsChecked()) nSubType |= DI_SUB_FIXED; diff --git a/sw/source/ui/fldui/flddok.cxx b/sw/source/ui/fldui/flddok.cxx index fd26e987395f..b69efd903bc8 100644 --- a/sw/source/ui/fldui/flddok.cxx +++ b/sw/source/ui/fldui/flddok.cxx @@ -111,7 +111,7 @@ void SwFldDokPage::Reset(const SfxItemSet* ) if (!bPage) { nPos = m_pTypeLB->InsertEntry(SW_RESSTR(FMT_REF_PAGE)); - m_pTypeLB->SetEntryData(nPos, (void*)USHRT_MAX); + m_pTypeLB->SetEntryData(nPos, reinterpret_cast<void*>(USHRT_MAX)); bPage = true; } break; @@ -163,7 +163,7 @@ void SwFldDokPage::Reset(const SfxItemSet* ) if(nVal != USHRT_MAX) { for(sal_Int32 i = 0; i < m_pTypeLB->GetEntryCount(); i++) - if(nVal == (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(i)) + if(nVal == (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(i))) { m_pTypeLB->SelectEntryPos(i); break; @@ -205,7 +205,7 @@ IMPL_LINK_NOARG(SwFldDokPage, TypeHdl) m_pDateFT->Hide(); m_pTimeFT->Hide(); - sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(GetTypeSel()); + sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())); // fill Selection-Listbox m_pSelectionLB->Clear(); @@ -286,7 +286,7 @@ IMPL_LINK_NOARG(SwFldDokPage, TypeHdl) AddSubType(TYP_PAGENUMBERFLD); AddSubType(TYP_PREVPAGEFLD); AddSubType(TYP_NEXTPAGEFLD); - nTypeId = (sal_uInt16)(sal_uLong)m_pSelectionLB->GetEntryData(0); + nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pSelectionLB->GetEntryData(0)); nCount = 3; m_pSelectionLB->SetSelectHdl(LINK(this, SwFldDokPage, SubTypeHdl)); } @@ -341,8 +341,8 @@ IMPL_LINK_NOARG(SwFldDokPage, TypeHdl) case TYP_NEXTPAGEFLD: if (IsFldEdit()) { - const sal_uInt16 nTmp = (sal_uInt16)(sal_uLong)m_pFormatLB->GetEntryData( - m_pFormatLB->GetSelectEntryPos() ); + const sal_uInt16 nTmp = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pFormatLB->GetEntryData( + m_pFormatLB->GetSelectEntryPos() )); if(SVX_NUM_CHAR_SPECIAL != nTmp) { @@ -445,7 +445,7 @@ IMPL_LINK_NOARG(SwFldDokPage, SubTypeHdl) if(nPos == LISTBOX_ENTRY_NOTFOUND) nPos = 0; - const sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)m_pSelectionLB->GetEntryData(nPos); + const sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pSelectionLB->GetEntryData(nPos)); FillFormatLB(nTypeId); sal_uInt32 nTextRes = 0; @@ -457,8 +457,8 @@ IMPL_LINK_NOARG(SwFldDokPage, SubTypeHdl) case TYP_PREVPAGEFLD: case TYP_NEXTPAGEFLD: - nTextRes = SVX_NUM_CHAR_SPECIAL == (sal_uInt16)(sal_uLong)m_pFormatLB->GetEntryData( - m_pFormatLB->GetSelectEntryPos() ) + nTextRes = SVX_NUM_CHAR_SPECIAL == (sal_uInt16)reinterpret_cast<sal_uLong>(m_pFormatLB->GetEntryData( + m_pFormatLB->GetSelectEntryPos() )) ? STR_VALUE : STR_OFFSET; break; @@ -510,7 +510,7 @@ sal_Int32 SwFldDokPage::FillFormatLB(sal_uInt16 nTypeId) IMPL_LINK_NOARG(SwFldDokPage, FormatHdl) { - sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(GetTypeSel()); + sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())); if (nTypeId == USHRT_MAX) { @@ -518,14 +518,14 @@ IMPL_LINK_NOARG(SwFldDokPage, FormatHdl) if(nPos == LISTBOX_ENTRY_NOTFOUND) nPos = 0; - nTypeId = (sal_uInt16)(sal_uLong)m_pSelectionLB->GetEntryData(nPos); + nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pSelectionLB->GetEntryData(nPos)); } if (nTypeId == TYP_NEXTPAGEFLD || nTypeId == TYP_PREVPAGEFLD) { // Prev/Next - PageNumFields special treatment: - sal_uInt16 nTmp = (sal_uInt16)(sal_uLong)m_pFormatLB->GetEntryData( - m_pFormatLB->GetSelectEntryPos() ); + sal_uInt16 nTmp = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pFormatLB->GetEntryData( + m_pFormatLB->GetSelectEntryPos() )); const OUString sOldTxt( m_pValueFT->GetText() ); const OUString sNewTxt( SW_RES( SVX_NUM_CHAR_SPECIAL == nTmp ? STR_VALUE : STR_OFFSET )); @@ -542,14 +542,14 @@ IMPL_LINK_NOARG(SwFldDokPage, FormatHdl) bool SwFldDokPage::FillItemSet(SfxItemSet* ) { - sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(GetTypeSel()); + sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())); if (nTypeId == USHRT_MAX) { sal_Int32 nPos = m_pSelectionLB->GetSelectEntryPos(); if(nPos == LISTBOX_ENTRY_NOTFOUND) nPos = 0; - nTypeId = (sal_uInt16)(sal_uLong)m_pSelectionLB->GetEntryData(nPos); + nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pSelectionLB->GetEntryData(nPos)); } OUString aVal(m_pValueED->GetText()); @@ -560,14 +560,14 @@ bool SwFldDokPage::FillItemSet(SfxItemSet* ) { sal_Int32 nPos = m_pFormatLB->GetSelectEntryPos(); if(nPos != LISTBOX_ENTRY_NOTFOUND) - nFormat = (sal_uLong)m_pFormatLB->GetEntryData(nPos); + nFormat = reinterpret_cast<sal_uLong>(m_pFormatLB->GetEntryData(nPos)); } if (m_pSelectionLB->IsEnabled()) { sal_Int32 nPos = m_pSelectionLB->GetSelectEntryPos(); if(nPos != LISTBOX_ENTRY_NOTFOUND) - nSubType = (sal_uInt16)(sal_uLong)m_pSelectionLB->GetEntryData(nPos); + nSubType = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pSelectionLB->GetEntryData(nPos)); } switch (nTypeId) diff --git a/sw/source/ui/fldui/fldedt.cxx b/sw/source/ui/fldui/fldedt.cxx index 7b0820bff7a7..8a1eb1eb0690 100644 --- a/sw/source/ui/fldui/fldedt.cxx +++ b/sw/source/ui/fldui/fldedt.cxx @@ -102,7 +102,7 @@ SwFldEditDlg::SwFldEditDlg(SwView& rVw) // initialise controls void SwFldEditDlg::Init() { - SwFldPage* pTabPage = (SwFldPage*)GetTabPage(); + SwFldPage* pTabPage = static_cast<SwFldPage*>(GetTabPage()); if( pTabPage ) { @@ -239,7 +239,7 @@ IMPL_LINK( SwFldEditDlg, NextPrevHdl, Button *, pButton ) pSh->EnterStdMode(); SwFieldType *pOldTyp = 0; - SwFldPage* pTabPage = (SwFldPage*)GetTabPage(); + SwFldPage* pTabPage = static_cast<SwFldPage*>(GetTabPage()); //#112462# FillItemSet may delete the current field //that's why it has to be called before accessing the current field @@ -249,7 +249,7 @@ IMPL_LINK( SwFldEditDlg, NextPrevHdl, Button *, pButton ) SwFldMgr& rMgr = pTabPage->GetFldMgr(); SwField *pCurFld = rMgr.GetCurFld(); if (pCurFld->GetTypeId() == TYP_DBFLD) - pOldTyp = (SwDBFieldType*)pCurFld->GetTyp(); + pOldTyp = static_cast<SwDBFieldType*>(pCurFld->GetTyp()); rMgr.GoNextPrev( bNext, pOldTyp ); pCurFld = rMgr.GetCurFld(); @@ -264,7 +264,7 @@ IMPL_LINK( SwFldEditDlg, NextPrevHdl, Button *, pButton ) sal_uInt16 nGroup = rMgr.GetGroup(false, pCurFld->GetTypeId(), pCurFld->GetSubType()); if (nGroup != pTabPage->GetGroup()) - pTabPage = (SwFldPage*)CreatePage(nGroup); + pTabPage = static_cast<SwFldPage*>(CreatePage(nGroup)); pTabPage->EditNewField(); @@ -275,7 +275,7 @@ IMPL_LINK( SwFldEditDlg, NextPrevHdl, Button *, pButton ) IMPL_LINK_NOARG(SwFldEditDlg, AddressHdl) { - SwFldPage* pTabPage = (SwFldPage*)GetTabPage(); + SwFldPage* pTabPage = static_cast<SwFldPage*>(GetTabPage()); SwFldMgr& rMgr = pTabPage->GetFldMgr(); SwField *pCurFld = rMgr.GetCurFld(); diff --git a/sw/source/ui/fldui/fldfunc.cxx b/sw/source/ui/fldui/fldfunc.cxx index b96eb21b582a..df473e778b3b 100644 --- a/sw/source/ui/fldui/fldfunc.cxx +++ b/sw/source/ui/fldui/fldfunc.cxx @@ -157,7 +157,7 @@ void SwFldFuncPage::Reset(const SfxItemSet* ) if(nVal != USHRT_MAX) { for(sal_Int32 i = 0; i < m_pTypeLB->GetEntryCount(); i++) - if(nVal == (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(i)) + if(nVal == (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(i))) { m_pTypeLB->SelectEntryPos(i); break; @@ -195,7 +195,7 @@ IMPL_LINK_NOARG(SwFldFuncPage, TypeHdl) if (nOld != GetTypeSel()) { - const sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(GetTypeSel()); + const sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())); // fill Selection-Listbox UpdateSubType(); @@ -244,7 +244,7 @@ IMPL_LINK_NOARG(SwFldFuncPage, TypeHdl) { if(bDropDown) { - const SwDropDownField* pDrop = (const SwDropDownField*)GetCurField(); + const SwDropDownField* pDrop = static_cast<const SwDropDownField*>(GetCurField()); uno::Sequence<OUString> aItems = pDrop->GetItemSequence(); const OUString* pArray = aItems.getConstArray(); m_pListItemsLB->Clear(); @@ -376,7 +376,7 @@ IMPL_LINK_NOARG(SwFldFuncPage, TypeHdl) IMPL_LINK_NOARG(SwFldFuncPage, SelectHdl) { - const sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(GetTypeSel()); + const sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())); if( TYP_MACROFLD == nTypeId ) m_pNameED->SetText( m_pSelectionLB->GetSelectEntry() ); @@ -456,7 +456,7 @@ IMPL_LINK_NOARG(SwFldFuncPage, ListEnableHdl) // renew types in SelectionBox void SwFldFuncPage::UpdateSubType() { - const sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(GetTypeSel()); + const sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())); // fill Selction-Listbox m_pSelectionLB->SetUpdateMode(false); @@ -512,13 +512,13 @@ IMPL_LINK( SwFldFuncPage, MacroHdl, Button *, pBtn ) bool SwFldFuncPage::FillItemSet(SfxItemSet* ) { - const sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(GetTypeSel()); + const sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())); sal_uInt16 nSubType = 0; const sal_Int32 nEntryPos = m_pFormatLB->GetSelectEntryPos(); const sal_uLong nFormat = (nEntryPos == LISTBOX_ENTRY_NOTFOUND) - ? 0 : (sal_uLong)m_pFormatLB->GetEntryData(nEntryPos); + ? 0 : reinterpret_cast<sal_uLong>(m_pFormatLB->GetEntryData(nEntryPos)); OUString aVal(m_pValueED->GetText()); OUString aName(m_pNameED->GetText()); @@ -623,7 +623,7 @@ IMPL_LINK_NOARG(SwFldFuncPage, ModifyHdl) const sal_Int32 nLen = m_pNameED->GetText().getLength(); bool bEnable = true; - sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(GetTypeSel()); + sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())); if( TYP_COMBINED_CHARS == nTypeId && (!nLen || nLen > MAX_COMBINED_CHARACTERS )) diff --git a/sw/source/ui/fldui/fldpage.cxx b/sw/source/ui/fldui/fldpage.cxx index adbf589c066b..253032bedafa 100644 --- a/sw/source/ui/fldui/fldpage.cxx +++ b/sw/source/ui/fldui/fldpage.cxx @@ -63,7 +63,7 @@ SwFldPage::~SwFldPage() // initialise TabPage void SwFldPage::Init() { - SwDocShell* pDocSh = (SwDocShell*)SfxObjectShell::Current(); + SwDocShell* pDocSh = static_cast<SwDocShell*>(SfxObjectShell::Current()); bool bNewMode = 0 != (::GetHtmlMode(pDocSh) & HTMLMODE_ON); m_bFldEdit = 0 == GetTabDialog(); @@ -206,9 +206,9 @@ bool SwFldPage::InsertFld(sal_uInt16 nTypeId, sal_uInt16 nSubType, const OUStrin aData.nCommandType = rPar1.getToken(2, DB_DELIM).toInt32(); OUString sColumn = rPar1.getToken(3, DB_DELIM); - SwDBFieldType* pOldTyp = (SwDBFieldType*)pTmpFld->GetTyp(); - SwDBFieldType* pTyp = (SwDBFieldType*)pSh->InsertFldType( - SwDBFieldType(pSh->GetDoc(), sColumn, aData)); + SwDBFieldType* pOldTyp = static_cast<SwDBFieldType*>(pTmpFld->GetTyp()); + SwDBFieldType* pTyp = static_cast<SwDBFieldType*>(pSh->InsertFldType( + SwDBFieldType(pSh->GetDoc(), sColumn, aData))); SwIterator<SwFmtFld,SwFieldType> aIter( *pOldTyp ); @@ -226,7 +226,7 @@ bool SwFldPage::InsertFld(sal_uInt16 nTypeId, sal_uInt16 nSubType, const OUStrin case TYP_SEQFLD: { - SwSetExpFieldType* pTyp = (SwSetExpFieldType*)pTmpFld->GetTyp(); + SwSetExpFieldType* pTyp = static_cast<SwSetExpFieldType*>(pTmpFld->GetTyp()); pTyp->SetOutlineLvl( static_cast< sal_uInt8 >(nSubType & 0xff)); pTyp->SetDelimiter(OUString(cSeparator)); @@ -240,7 +240,7 @@ bool SwFldPage::InsertFld(sal_uInt16 nTypeId, sal_uInt16 nSubType, const OUStrin if (m_aMgr.GetFldType(RES_USERFLD, sPar1) == 0 && !(pTmpFld->GetSubType() & INP_TXT)) // SETEXPFLD { - SwSetExpField* pFld = (SwSetExpField*)pTmpFld; + SwSetExpField* pFld = static_cast<SwSetExpField*>(pTmpFld); pFld->SetPromptText(sPar2); sPar2 = pFld->GetPar2(); } @@ -309,7 +309,7 @@ void SwFldPage::RestorePos(ListBox* pLst1, ListBox* pLst2, ListBox* pLst3) // Insert new fields IMPL_LINK( SwFldPage, InsertHdl, Button *, pBtn ) { - SwFldDlg *pDlg = (SwFldDlg*)GetTabDialog(); + SwFldDlg *pDlg = static_cast<SwFldDlg*>(GetTabDialog()); if (pDlg) { pDlg->InsertHdl(); @@ -319,7 +319,7 @@ IMPL_LINK( SwFldPage, InsertHdl, Button *, pBtn ) } else { - SwFldEditDlg *pEditDlg = (SwFldEditDlg *)GetParentDialog(); + SwFldEditDlg *pEditDlg = static_cast<SwFldEditDlg *>(GetParentDialog()); pEditDlg->InsertHdl(); } @@ -329,7 +329,7 @@ IMPL_LINK( SwFldPage, InsertHdl, Button *, pBtn ) // enable/disable "Insert"-Button void SwFldPage::EnableInsert(bool bEnable) { - SwFldDlg *pDlg = (SwFldDlg*)GetTabDialog(); + SwFldDlg *pDlg = static_cast<SwFldDlg*>(GetTabDialog()); if (pDlg) { if (pDlg->GetCurTabPage() == this) @@ -337,7 +337,7 @@ void SwFldPage::EnableInsert(bool bEnable) } else { - SwFldEditDlg *pEditDlg = (SwFldEditDlg *)GetParentDialog(); + SwFldEditDlg *pEditDlg = static_cast<SwFldEditDlg *>(GetParentDialog()); pEditDlg->EnableInsert(bEnable); } diff --git a/sw/source/ui/fldui/fldref.cxx b/sw/source/ui/fldui/fldref.cxx index 1fd8f07aa8c3..83f1aebee4d1 100644 --- a/sw/source/ui/fldui/fldref.cxx +++ b/sw/source/ui/fldui/fldref.cxx @@ -119,7 +119,7 @@ void SwFldRefPage::SaveSelectedTxtNode() SvTreeListEntry* pEntry = m_pSelectionToolTipLB->GetCurEntry(); if ( pEntry ) { - const sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(GetTypeSel()); + const sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())); if ( nTypeId == REFFLDFLAG_HEADING ) { @@ -177,9 +177,9 @@ void SwFldRefPage::Reset(const SfxItemSet* ) // #i83479# // entries for headings and numbered items nPos = m_pTypeLB->InsertEntry(sHeadingTxt); - m_pTypeLB->SetEntryData(nPos, (void*)REFFLDFLAG_HEADING); + m_pTypeLB->SetEntryData(nPos, reinterpret_cast<void*>(REFFLDFLAG_HEADING)); nPos = m_pTypeLB->InsertEntry(sNumItemTxt); - m_pTypeLB->SetEntryData(nPos, (void*)REFFLDFLAG_NUMITEM); + m_pTypeLB->SetEntryData(nPos, reinterpret_cast<void*>(REFFLDFLAG_NUMITEM)); // fill up with the sequence types SwWrtShell *pSh = GetWrtShell(); @@ -190,31 +190,31 @@ void SwFldRefPage::Reset(const SfxItemSet* ) for (sal_uInt16 n = 0; n < nFldTypeCnt; ++n) { - SwSetExpFieldType* pType = (SwSetExpFieldType*)pSh->GetFldType(n, RES_SETEXPFLD); + SwSetExpFieldType* pType = static_cast<SwSetExpFieldType*>(pSh->GetFldType(n, RES_SETEXPFLD)); if ((nsSwGetSetExpType::GSE_SEQ & pType->GetType()) && pType->GetDepends() && pSh->IsUsed(*pType)) { nPos = m_pTypeLB->InsertEntry(pType->GetName()); - m_pTypeLB->SetEntryData(nPos, (void*)(sal_uIntPtr)(REFFLDFLAG | n)); + m_pTypeLB->SetEntryData(nPos, reinterpret_cast<void*>((sal_uIntPtr)(REFFLDFLAG | n))); } } // text marks - now always (because of globaldocuments) nPos = m_pTypeLB->InsertEntry(sBookmarkTxt); - m_pTypeLB->SetEntryData(nPos, (void*)REFFLDFLAG_BOOKMARK); + m_pTypeLB->SetEntryData(nPos, reinterpret_cast<void*>(REFFLDFLAG_BOOKMARK)); // footnotes: if( pSh->HasFtns() ) { nPos = m_pTypeLB->InsertEntry(sFootnoteTxt); - m_pTypeLB->SetEntryData(nPos, (void*)REFFLDFLAG_FOOTNOTE); + m_pTypeLB->SetEntryData(nPos, reinterpret_cast<void*>(REFFLDFLAG_FOOTNOTE)); } // endnotes: if ( pSh->HasFtns(true) ) { nPos = m_pTypeLB->InsertEntry(sEndnoteTxt); - m_pTypeLB->SetEntryData(nPos, (void*)REFFLDFLAG_ENDNOTE); + m_pTypeLB->SetEntryData(nPos, reinterpret_cast<void*>(REFFLDFLAG_ENDNOTE)); } // select old Pos @@ -236,7 +236,7 @@ void SwFldRefPage::Reset(const SfxItemSet* ) if(nVal != USHRT_MAX) { for(sal_Int32 i = 0; i < m_pTypeLB->GetEntryCount(); i++) - if(nVal == (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(i)) + if(nVal == (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(i))) { m_pTypeLB->SelectEntryPos(i); break; @@ -337,7 +337,7 @@ IMPL_LINK_NOARG(SwFldRefPage, TypeHdl) if (nOld != GetTypeSel()) { - sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(GetTypeSel()); + sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())); // fill selection-ListBox UpdateSubType(); @@ -355,7 +355,7 @@ IMPL_LINK_NOARG(SwFldRefPage, TypeHdl) switch (nTypeId) { case TYP_GETREFFLD: - if (REFFLDFLAG & (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(nOld)) + if (REFFLDFLAG & (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(nOld))) // the old one stays nFldDlgFmtSel = m_pFormatLB->GetSelectEntryPos(); bName = true; @@ -371,7 +371,7 @@ IMPL_LINK_NOARG(SwFldRefPage, TypeHdl) default: if( REFFLDFLAG & nTypeId ) { - const sal_uInt16 nOldId = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(nOld); + const sal_uInt16 nOldId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(nOld)); if( nOldId & REFFLDFLAG || nOldId == TYP_GETREFFLD ) // then the old one stays nFldDlgFmtSel = m_pFormatLB->GetSelectEntryPos(); @@ -396,7 +396,7 @@ IMPL_LINK_NOARG(SwFldRefPage, TypeHdl) IMPL_LINK_NOARG(SwFldRefPage, SubTypeHdl) { - sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(GetTypeSel()); + sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())); switch(nTypeId) { @@ -447,8 +447,8 @@ void SwFldRefPage::UpdateSubType() SwWrtShell *pSh = GetWrtShell(); if(!pSh) pSh = ::GetActiveWrtShell(); - SwGetRefField* pRefFld = (SwGetRefField*)GetCurField(); - const sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(GetTypeSel()); + SwGetRefField* pRefFld = static_cast<SwGetRefField*>(GetCurField()); + const sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())); OUString sOldSel; // #i83479# @@ -576,8 +576,8 @@ void SwFldRefPage::UpdateSubType() m_pSelectionLB->SetStyle(m_pSelectionLB->GetStyle()|WB_SORT); // get the fields to Seq-FieldType: - SwSetExpFieldType* pType = (SwSetExpFieldType*)pSh->GetFldType( - nTypeId & ~REFFLDFLAG, RES_SETEXPFLD ); + SwSetExpFieldType* pType = static_cast<SwSetExpFieldType*>(pSh->GetFldType( + nTypeId & ~REFFLDFLAG, RES_SETEXPFLD )); if( pType ) { SwSeqFldList aArr; @@ -742,7 +742,7 @@ IMPL_LINK_NOARG(SwFldRefPage, ModifyHdl) const bool bEmptyName = aName.isEmpty(); bool bEnable = true; - sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(GetTypeSel()); + sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())); if ((nTypeId == TYP_SETREFFLD && !GetFldMgr().CanInsertRefMark(aName)) || (bEmptyName && (nTypeId == TYP_GETREFFLD || nTypeId == TYP_SETREFFLD || @@ -759,12 +759,12 @@ IMPL_LINK_NOARG(SwFldRefPage, ModifyHdl) bool SwFldRefPage::FillItemSet(SfxItemSet* ) { bool bModified = false; - sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(GetTypeSel()); + sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())); sal_uInt16 nSubType = 0; const sal_Int32 nEntryPos = m_pFormatLB->GetSelectEntryPos(); const sal_uLong nFormat = (nEntryPos == LISTBOX_ENTRY_NOTFOUND) - ? 0 : (sal_uLong)m_pFormatLB->GetEntryData(nEntryPos); + ? 0 : reinterpret_cast<sal_uLong>(m_pFormatLB->GetEntryData(nEntryPos)); OUString aVal(m_pValueED->GetText()); OUString aName(m_pNameED->GetText()); @@ -788,7 +788,7 @@ bool SwFldRefPage::FillItemSet(SfxItemSet* ) } } - SwGetRefField* pRefFld = (SwGetRefField*)GetCurField(); + SwGetRefField* pRefFld = static_cast<SwGetRefField*>(GetCurField()); if (REFFLDFLAG & nTypeId) { @@ -891,8 +891,8 @@ bool SwFldRefPage::FillItemSet(SfxItemSet* ) else // SeqenceFields { // get fields for Seq-FeldType: - SwSetExpFieldType* pType = (SwSetExpFieldType*)pSh->GetFldType( - nTypeId & ~REFFLDFLAG, RES_SETEXPFLD ); + SwSetExpFieldType* pType = static_cast<SwSetExpFieldType*>(pSh->GetFldType( + nTypeId & ~REFFLDFLAG, RES_SETEXPFLD )); if( pType ) { SwSeqFldList aArr; diff --git a/sw/source/ui/fldui/fldtdlg.cxx b/sw/source/ui/fldui/fldtdlg.cxx index 1ed05cd896cf..b73dc004f163 100644 --- a/sw/source/ui/fldui/fldtdlg.cxx +++ b/sw/source/ui/fldui/fldtdlg.cxx @@ -60,7 +60,7 @@ SwFldDlg::SwFldDlg(SfxBindings* pB, SwChildWinWrapper* pCW, vcl::Window *pParent , m_nDbId(0) { SetStyle(GetStyle()|WB_STDMODELESS); - m_bHtmlMode = (::GetHtmlMode((SwDocShell*)SfxObjectShell::Current()) & HTMLMODE_ON) != 0; + m_bHtmlMode = (::GetHtmlMode(static_cast<SwDocShell*>(SfxObjectShell::Current())) & HTMLMODE_ON) != 0; GetCancelButton().SetClickHdl(LINK(this, SwFldDlg, CancelHdl)); @@ -162,7 +162,7 @@ SfxItemSet* SwFldDlg::CreateInputItemSet( sal_uInt16 nID ) { if ( nID == m_nDokInf ) { - SwDocShell* pDocSh = (SwDocShell*)SfxObjectShell::Current(); + SwDocShell* pDocSh = static_cast<SwDocShell*>(SfxObjectShell::Current()); SfxItemSet* pISet = new SfxItemSet( pDocSh->GetPool(), SID_DOCINFO, SID_DOCINFO ); using namespace ::com::sun::star; uno::Reference<document::XDocumentPropertiesSupplier> xDPS( @@ -202,7 +202,7 @@ IMPL_LINK_NOARG(SwFldDlg, CancelHdl) // newly initialise dialog after Doc-Switch void SwFldDlg::ReInitDlg() { - SwDocShell* pDocSh = (SwDocShell*)SfxObjectShell::Current(); + SwDocShell* pDocSh = static_cast<SwDocShell*>(SfxObjectShell::Current()); bool bNewMode = (::GetHtmlMode(pDocSh) & HTMLMODE_ON) != 0; if (bNewMode != m_bHtmlMode) @@ -236,7 +236,7 @@ void SwFldDlg::ReInitDlg() // newly initialise TabPage after Doc-Switch void SwFldDlg::ReInitTabPage( sal_uInt16 nPageId, bool bOnlyActivate ) { - SwFldPage* pPage = (SwFldPage* )GetTabPage(nPageId); + SwFldPage* pPage = static_cast<SwFldPage* >(GetTabPage(nPageId)); if ( pPage ) pPage->EditNewField( bOnlyActivate ); // newly initialise TabPage } @@ -247,7 +247,7 @@ void SwFldDlg::Activate() SwView* pView = ::GetActiveView(); if( pView ) { - bool bHtmlMode = (::GetHtmlMode((SwDocShell*)SfxObjectShell::Current()) & HTMLMODE_ON) != 0; + bool bHtmlMode = (::GetHtmlMode(static_cast<SwDocShell*>(SfxObjectShell::Current())) & HTMLMODE_ON) != 0; const SwWrtShell& rSh = pView->GetWrtShell(); GetOKButton().Enable( !rSh.IsReadOnlyAvailable() || !rSh.HasReadonlySel() ); @@ -288,7 +288,7 @@ void SwFldDlg::ActivateDatabasePage() SfxTabPage* pDBPage = GetTabPage(m_nDbId); if( pDBPage ) { - ((SwFldDBPage*)pDBPage)->ActivateMailMergeAddress(); + static_cast<SwFldDBPage*>(pDBPage)->ActivateMailMergeAddress(); } //remove all other pages RemoveTabPage("document"); diff --git a/sw/source/ui/fldui/fldvar.cxx b/sw/source/ui/fldui/fldvar.cxx index 79d845a7d767..526618ed7836 100644 --- a/sw/source/ui/fldui/fldvar.cxx +++ b/sw/source/ui/fldui/fldvar.cxx @@ -159,7 +159,7 @@ void SwFldVarPage::Reset(const SfxItemSet* ) if( USHRT_MAX != nVal ) { for(sal_Int32 i = 0; i < m_pTypeLB->GetEntryCount(); i++) - if(nVal == (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(i)) + if(nVal == (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(i))) { m_pTypeLB->SelectEntryPos(i); break; @@ -218,12 +218,12 @@ IMPL_LINK_NOARG(SwFldVarPage, TypeHdl) IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox ) { - sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(GetTypeSel()); + sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())); sal_Int32 nSelPos = m_pSelectionLB->GetSelectEntryPos(); sal_uInt16 nSelData = USHRT_MAX; if (nSelPos != LISTBOX_ENTRY_NOTFOUND) - nSelData = (sal_uInt16)(sal_uLong)m_pSelectionLB->GetEntryData(nSelPos); + nSelData = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pSelectionLB->GetEntryData(nSelPos)); if (IsFldEdit() && (!pBox || bInit)) { @@ -253,8 +253,8 @@ IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox ) case TYP_USERFLD: { // change or create user type - SwUserFieldType* pType = (SwUserFieldType*) - GetFldMgr().GetFldType(RES_USERFLD, nSelData); + SwUserFieldType* pType = static_cast<SwUserFieldType*>( + GetFldMgr().GetFldType(RES_USERFLD, nSelData)); if (pType) { @@ -301,7 +301,7 @@ IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox ) { m_pNumFormatLB->Clear(); sal_Int32 nPos = m_pNumFormatLB->InsertEntry(SW_RESSTR(FMT_SETVAR_TEXT), 0); - m_pNumFormatLB->SetEntryData(nPos, (void *)ULONG_MAX); + m_pNumFormatLB->SetEntryData(nPos, reinterpret_cast<void *>(ULONG_MAX)); m_pNumFormatLB->SelectEntryPos(0); } // is there a corresponding SetField @@ -319,8 +319,8 @@ IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox ) pSh = ::GetActiveWrtShell(); if(pSh) { - SwSetExpFieldType* pSetTyp = (SwSetExpFieldType*) - pSh->GetFldType(RES_SETEXPFLD, sName); + SwSetExpFieldType* pSetTyp = static_cast<SwSetExpFieldType*>( + pSh->GetFldType(RES_SETEXPFLD, sName)); if (pSetTyp && pSetTyp->GetType() == nsSwGetSetExpType::GSE_STRING) m_pNumFormatLB->SelectEntryPos(0); // textual @@ -369,8 +369,8 @@ IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox ) pSh = ::GetActiveWrtShell(); if(pSh) { - SwSetExpFieldType* pSetTyp = (SwSetExpFieldType*) - pSh->GetFldType(RES_SETEXPFLD, sName); + SwSetExpFieldType* pSetTyp = static_cast<SwSetExpFieldType*>( + pSh->GetFldType(RES_SETEXPFLD, sName)); if(pSetTyp) { @@ -407,8 +407,8 @@ IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox ) if (nInpType) // SETEXPFLD { // is there a corresponding SetField - SwSetExpFieldType* pSetTyp = (SwSetExpFieldType*) - GetFldMgr().GetFldType(RES_SETEXPFLD, sName); + SwSetExpFieldType* pSetTyp = static_cast<SwSetExpFieldType*>( + GetFldMgr().GetFldType(RES_SETEXPFLD, sName)); if(pSetTyp) { @@ -417,7 +417,7 @@ IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox ) m_pNumFormatLB->Clear(); sal_Int32 nPos = m_pNumFormatLB->InsertEntry(SW_RESSTR(FMT_USERVAR_TEXT), 0); - m_pNumFormatLB->SetEntryData(nPos, (void *)ULONG_MAX); + m_pNumFormatLB->SetEntryData(nPos, reinterpret_cast<void *>(ULONG_MAX)); m_pNumFormatLB->SelectEntryPos(0); } } @@ -437,7 +437,7 @@ IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox ) if (nSelPos != LISTBOX_ENTRY_NOTFOUND) { SwDDEFieldType* pType = - (SwDDEFieldType*) GetFldMgr().GetFldType(RES_DDEFLD, nSelData); + static_cast<SwDDEFieldType*>( GetFldMgr().GetFldType(RES_DDEFLD, nSelData) ); if(pType) { @@ -542,7 +542,7 @@ IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox ) if(m_pSelectionLB->IsCallAddSelection()) { - nTypeId = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(GetTypeSel()); + nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())); switch (nTypeId) { @@ -551,7 +551,7 @@ IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox ) nSelPos = m_pSelectionLB->GetSelectEntryPos(); if (nSelPos != LISTBOX_ENTRY_NOTFOUND) - nSelData = (sal_uInt16)(sal_uLong)m_pSelectionLB->GetEntryData(nSelPos); + nSelData = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pSelectionLB->GetEntryData(nSelPos)); else nSelData = USHRT_MAX; @@ -581,7 +581,7 @@ void SwFldVarPage::UpdateSubType() m_pSelectionLB->SetUpdateMode(false); m_pSelectionLB->Clear(); - const sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(GetTypeSel()); + const sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())); std::vector<OUString> aList; GetFldMgr().GetSubTypes(nTypeId, aList); const size_t nCount = aList.size(); @@ -729,9 +729,9 @@ sal_Int32 SwFldVarPage::FillFormatLB(sal_uInt16 nTypeId) if (!IsFldEdit() || bSpecialFmt) { sal_Int32 nPos = m_pNumFormatLB->InsertEntry(SW_RESSTR(FMT_MARK_TEXT), 0); - m_pNumFormatLB->SetEntryData(nPos, (void *)ULONG_MAX); + m_pNumFormatLB->SetEntryData(nPos, reinterpret_cast<void *>(ULONG_MAX)); nPos = m_pNumFormatLB->InsertEntry(SW_RESSTR(FMT_USERVAR_CMD), 1); - m_pNumFormatLB->SetEntryData(nPos, (void *)ULONG_MAX); + m_pNumFormatLB->SetEntryData(nPos, reinterpret_cast<void *>(ULONG_MAX)); } } break; @@ -741,7 +741,7 @@ sal_Int32 SwFldVarPage::FillFormatLB(sal_uInt16 nTypeId) if (!IsFldEdit() || bSpecialFmt) { sal_Int32 nPos = m_pNumFormatLB->InsertEntry(SW_RESSTR(FMT_SETVAR_TEXT), 0); - m_pNumFormatLB->SetEntryData(nPos, (void *)ULONG_MAX); + m_pNumFormatLB->SetEntryData(nPos, reinterpret_cast<void *>(ULONG_MAX)); } } break; @@ -749,14 +749,14 @@ sal_Int32 SwFldVarPage::FillFormatLB(sal_uInt16 nTypeId) case TYP_FORMELFLD: { sal_Int32 nPos = m_pNumFormatLB->InsertEntry(SW_RESSTR(FMT_GETVAR_NAME), 0); - m_pNumFormatLB->SetEntryData(nPos, (void *)ULONG_MAX); + m_pNumFormatLB->SetEntryData(nPos, reinterpret_cast<void *>(ULONG_MAX)); } break; case TYP_GETFLD: { sal_Int32 nPos = m_pNumFormatLB->InsertEntry(SW_RESSTR(FMT_GETVAR_NAME), 0); - m_pNumFormatLB->SetEntryData(nPos, (void *)ULONG_MAX); + m_pNumFormatLB->SetEntryData(nPos, reinterpret_cast<void *>(ULONG_MAX)); } break; } @@ -811,7 +811,7 @@ IMPL_LINK_NOARG(SwFldVarPage, ModifyHdl) { OUString sValue(m_pValueED->GetText()); bool bHasValue = !sValue.isEmpty(); - const sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(GetTypeSel()); + const sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())); bool bInsert = false, bApply = false, bDelete = false; OUString sName( m_pNameED->GetText() ); @@ -880,8 +880,8 @@ IMPL_LINK_NOARG(SwFldVarPage, ModifyHdl) if (nTypeId == TYP_SETFLD || nTypeId == TYP_SEQFLD) { - SwSetExpFieldType* pFldType = (SwSetExpFieldType*) - GetFldMgr().GetFldType(RES_SETEXPFLD, sName); + SwSetExpFieldType* pFldType = static_cast<SwSetExpFieldType*>( + GetFldMgr().GetFldType(RES_SETEXPFLD, sName)); if (pFldType) { @@ -934,7 +934,7 @@ IMPL_LINK_NOARG(SwFldVarPage, ModifyHdl) IMPL_LINK( SwFldVarPage, TBClickHdl, ToolBox *, pBox ) { - const sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(GetTypeSel()); + const sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())); const sal_uInt16 nCurId = pBox->GetCurItemId(); @@ -986,7 +986,7 @@ IMPL_LINK( SwFldVarPage, TBClickHdl, ToolBox *, pBox ) sal_uLong nFormat = m_pFormatLB->GetSelectEntryPos(); if (nFormat != LISTBOX_ENTRY_NOTFOUND) - nFormat = (sal_uLong)m_pFormatLB->GetEntryData((sal_Int32)nFormat); + nFormat = reinterpret_cast<sal_uLong>(m_pFormatLB->GetEntryData((sal_Int32)nFormat)); if (pType) // change { @@ -1100,14 +1100,14 @@ IMPL_LINK_NOARG(SwFldVarPage, SeparatorHdl) bool SwFldVarPage::FillItemSet(SfxItemSet* ) { - const sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData(GetTypeSel()); + const sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())); OUString aVal(m_pValueED->GetText()); OUString aName(m_pNameED->GetText()); const sal_Int32 nSubPos = m_pSelectionLB->GetSelectEntryPos(); sal_uInt16 nSubType = (nSubPos == LISTBOX_ENTRY_NOTFOUND) ? 0 : - (sal_uInt16)(sal_uLong)m_pSelectionLB->GetEntryData(nSubPos); + (sal_uInt16)reinterpret_cast<sal_uLong>(m_pSelectionLB->GetEntryData(nSubPos)); sal_uLong nFormat; @@ -1118,7 +1118,7 @@ bool SwFldVarPage::FillItemSet(SfxItemSet* ) if(nFormatPos == LISTBOX_ENTRY_NOTFOUND) nFormat = 0; else - nFormat = (sal_uLong)m_pFormatLB->GetEntryData(nFormatPos); + nFormat = reinterpret_cast<sal_uLong>(m_pFormatLB->GetEntryData(nFormatPos)); } else { @@ -1291,7 +1291,7 @@ void SwFldVarPage::FillUserData() if( LISTBOX_ENTRY_NOTFOUND == nTypeSel ) nTypeSel = USHRT_MAX; else - nTypeSel = (sal_uInt16)(sal_uLong)m_pTypeLB->GetEntryData( nTypeSel ); + nTypeSel = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData( nTypeSel )); sData += OUString::number( nTypeSel ); SetUserData(sData); } diff --git a/sw/source/ui/fldui/inpdlg.cxx b/sw/source/ui/fldui/inpdlg.cxx index 4498bc83f884..3346d84d9615 100644 --- a/sw/source/ui/fldui/inpdlg.cxx +++ b/sw/source/ui/fldui/inpdlg.cxx @@ -61,7 +61,7 @@ SwFldInputDlg::SwFldInputDlg( vcl::Window *pParent, SwWrtShell &rS, if( RES_INPUTFLD == pField->GetTyp()->Which() ) { // it is an input field - pInpFld = (SwInputField*)pField; + pInpFld = static_cast<SwInputField*>(pField); m_pLabelED->SetText( pInpFld->GetPar2() ); sal_uInt16 nSubType = pInpFld->GetSubType(); @@ -73,8 +73,8 @@ SwFldInputDlg::SwFldInputDlg( vcl::Window *pParent, SwWrtShell &rS, case INP_USR: // user field - if( 0 != ( pUsrType = (SwUserFieldType*)rSh.GetFldType( - RES_USERFLD, pInpFld->GetPar1() ) ) ) + if( 0 != ( pUsrType = static_cast<SwUserFieldType*>(rSh.GetFldType( + RES_USERFLD, pInpFld->GetPar1() ) ) ) ) aStr = pUsrType->GetContent(); break; } @@ -82,7 +82,7 @@ SwFldInputDlg::SwFldInputDlg( vcl::Window *pParent, SwWrtShell &rS, else { // it is a SetExpression - pSetFld = (SwSetExpField*)pField; + pSetFld = static_cast<SwSetExpField*>(pField); OUString sFormula(pSetFld->GetFormula()); //values are formatted - formulas are not CharClass aCC( LanguageTag( pSetFld->GetLanguage() )); diff --git a/sw/source/ui/fldui/javaedit.cxx b/sw/source/ui/fldui/javaedit.cxx index b3c1bae39a4d..e67d532fda94 100644 --- a/sw/source/ui/fldui/javaedit.cxx +++ b/sw/source/ui/fldui/javaedit.cxx @@ -74,7 +74,7 @@ SwJavaEditDialog::SwJavaEditDialog(vcl::Window* pParent, SwWrtShell* pWrtSh) : m_pEditED->SetFont( aFont ); pMgr = new SwFldMgr; - pFld = (SwScriptField*)pMgr->GetCurFld(); + pFld = static_cast<SwScriptField*>(pMgr->GetCurFld()); bNew = !(pFld && pFld->GetTyp()->Which() == RES_SCRIPTFLD); @@ -97,7 +97,7 @@ IMPL_LINK_NOARG_INLINE_START(SwJavaEditDialog, PrevHdl) { SetFld(); pMgr->GoPrev(); - pFld = (SwScriptField*)pMgr->GetCurFld(); + pFld = static_cast<SwScriptField*>(pMgr->GetCurFld()); CheckTravel(); RadioButtonHdl(NULL); @@ -109,7 +109,7 @@ IMPL_LINK_NOARG_INLINE_START(SwJavaEditDialog, NextHdl) { SetFld(); pMgr->GoNext(); - pFld = (SwScriptField*)pMgr->GetCurFld(); + pFld = static_cast<SwScriptField*>(pMgr->GetCurFld()); CheckTravel(); RadioButtonHdl(NULL); diff --git a/sw/source/ui/fmtui/tmpdlg.cxx b/sw/source/ui/fmtui/tmpdlg.cxx index dd3e8d72d601..f9727379f1e5 100644 --- a/sw/source/ui/fmtui/tmpdlg.cxx +++ b/sw/source/ui/fmtui/tmpdlg.cxx @@ -383,7 +383,7 @@ void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) { OSL_ENSURE(::GetActiveView(), "no active view"); - SvxFontListItem aFontListItem( *( (SvxFontListItem*)::GetActiveView()-> + SvxFontListItem aFontListItem( *static_cast<const SvxFontListItem*>(::GetActiveView()-> GetDocShell()->GetItem( SID_ATTR_CHAR_FONTLIST ) ) ); aSet.Put (SvxFontListItem( aFontListItem.GetFontList(), SID_ATTR_CHAR_FONTLIST)); |