summaryrefslogtreecommitdiff
path: root/sw/source/ui/fldui
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-01-12 20:13:41 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-01-12 20:13:41 +0100
commit0ae2d98d1f6d29c80bd1ee830db4c333e4ee1e1d (patch)
treed9b77eece17b7b144a4ea50592b639b9f7c87095 /sw/source/ui/fldui
parent506856ca50e676520bcc80a8b498355663d0388f (diff)
More loplugin:cstylecast: sw
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I0f49d21dfdf82742f11b27709f74294feb1e419e
Diffstat (limited to 'sw/source/ui/fldui')
-rw-r--r--sw/source/ui/fldui/changedb.cxx2
-rw-r--r--sw/source/ui/fldui/flddb.cxx14
-rw-r--r--sw/source/ui/fldui/flddinf.cxx18
-rw-r--r--sw/source/ui/fldui/flddok.cxx30
-rw-r--r--sw/source/ui/fldui/fldfunc.cxx12
-rw-r--r--sw/source/ui/fldui/fldref.cxx20
-rw-r--r--sw/source/ui/fldui/fldvar.cxx22
7 files changed, 59 insertions, 59 deletions
diff --git a/sw/source/ui/fldui/changedb.cxx b/sw/source/ui/fldui/changedb.cxx
index 790b1a187330..21cfda853898 100644
--- a/sw/source/ui/fldui/changedb.cxx
+++ b/sw/source/ui/fldui/changedb.cxx
@@ -192,7 +192,7 @@ void SwChangeDBDlg::UpdateFields()
{
OUString sTmp(m_pUsedDBTLB->GetEntryText( m_pUsedDBTLB->GetParent( pEntry )) +
OUStringLiteral1(DB_DELIM) + m_pUsedDBTLB->GetEntryText( pEntry ) + OUStringLiteral1(DB_DELIM) +
- OUString::number((int)reinterpret_cast<sal_uLong>(pEntry->GetUserData())));
+ OUString::number(static_cast<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 cb2763b475a6..fe699d92475a 100644
--- a/sw/source/ui/fldui/flddb.cxx
+++ b/sw/source/ui/fldui/flddb.cxx
@@ -167,11 +167,11 @@ void SwFieldDBPage::Reset(const SfxItemSet*)
OUString sUserData = GetUserData();
if (sUserData.getToken(0, ';').equalsIgnoreAsciiCase(USER_DATA_VERSION_1))
{
- const sal_uInt16 nVal = (sal_uInt16)sUserData.getToken(1, ';').toInt32();
+ const sal_uInt16 nVal = static_cast<sal_uInt16>(sUserData.getToken(1, ';').toInt32());
if(nVal != USHRT_MAX)
{
for (sal_Int32 i = 0; i < m_pTypeLB->GetEntryCount(); ++i)
- if(nVal == (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(i)))
+ if(nVal == static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(i))))
{
m_pTypeLB->SelectEntryPos(i);
break;
@@ -213,7 +213,7 @@ bool SwFieldDBPage::FillItemSet(SfxItemSet* )
if(!aData.sDataSource.isEmpty()) // without database no new field command
{
- const sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel()));
+ const sal_uInt16 nTypeId = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())));
sal_uLong nFormat = 0;
sal_uInt16 nSubType = 0;
@@ -300,7 +300,7 @@ void SwFieldDBPage::TypeHdl( ListBox const * pBox )
if(!pSh)
pSh = ::GetActiveWrtShell();
bool bCond = false, bSetNo = false, bFormat = false, bDBFormat = false;
- const sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel()));
+ const sal_uInt16 nTypeId = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())));
m_pDatabaseTLB->ShowColumns(nTypeId == TYP_DBFLD);
@@ -409,7 +409,7 @@ IMPL_LINK( SwFieldDBPage, NumSelectHdl, ListBox&, rLB, void )
void SwFieldDBPage::CheckInsert()
{
bool bInsert = true;
- const sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel()));
+ const sal_uInt16 nTypeId = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())));
SvTreeListEntry* pEntry = m_pDatabaseTLB->GetCurEntry();
@@ -440,7 +440,7 @@ IMPL_LINK( SwFieldDBPage, TreeSelectHdl, SvTreeListBox *, pBox, void )
SvTreeListEntry* pEntry = pBox->GetCurEntry();
if (pEntry)
{
- const sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel()));
+ const sal_uInt16 nTypeId = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())));
pEntry = m_pDatabaseTLB->GetParent(pEntry);
@@ -494,7 +494,7 @@ void SwFieldDBPage::FillUserData()
{
const sal_Int32 nEntryPos = m_pTypeLB->GetSelectedEntryPos();
const sal_uInt16 nTypeSel = ( LISTBOX_ENTRY_NOTFOUND == nEntryPos )
- ? USHRT_MAX : (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData( nEntryPos ));
+ ? USHRT_MAX : static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData( nEntryPos )));
SetUserData(USER_DATA_VERSION ";" + OUString::number( nTypeSel ));
}
diff --git a/sw/source/ui/fldui/flddinf.cxx b/sw/source/ui/fldui/flddinf.cxx
index 6943b0319cd5..a8011b87a3f8 100644
--- a/sw/source/ui/fldui/flddinf.cxx
+++ b/sw/source/ui/fldui/flddinf.cxx
@@ -193,12 +193,12 @@ void SwFieldDokInfPage::Reset(const SfxItemSet* )
if (pSelEntry != nullptr)
{
m_pTypeTLB->Select(pSelEntry);
- nSubType = (sal_uInt16)reinterpret_cast<sal_uLong>(pSelEntry->GetUserData());
+ nSubType = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(pSelEntry->GetUserData()));
}
else if ( m_pTypeTLB->GetEntry(0) )
{
pSelEntry = m_pTypeTLB->GetEntry(0);
- nSubType = (sal_uInt16)reinterpret_cast<sal_uLong>(pSelEntry->GetUserData());
+ nSubType = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(pSelEntry->GetUserData()));
}
FillSelectionLB(nSubType);
@@ -234,14 +234,14 @@ IMPL_LINK_NOARG(SwFieldDokInfPage, TypeHdl, SvTreeListBox*, void)
m_pTypeTLB->Select(pSelEntry);
}
else if (pOldEntry != pSelEntry)
- FillSelectionLB((sal_uInt16)reinterpret_cast<sal_uLong>(pSelEntry->GetUserData()));
+ FillSelectionLB(static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(pSelEntry->GetUserData())));
SubTypeHdl(*m_pSelectionLB);
}
IMPL_LINK_NOARG(SwFieldDokInfPage, SubTypeHdl, ListBox&, void)
{
- sal_uInt16 nSubType = (sal_uInt16)reinterpret_cast<sal_uLong>(pSelEntry->GetUserData());
+ sal_uInt16 nSubType = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(pSelEntry->GetUserData()));
sal_Int32 nPos = m_pSelectionLB->GetSelectedEntryPos();
sal_uInt16 nExtSubType;
SvNumFormatType nNewType = SvNumFormatType::ALL;
@@ -285,7 +285,7 @@ IMPL_LINK_NOARG(SwFieldDokInfPage, SubTypeHdl, ListBox&, void)
nPos = 0;
}
- nExtSubType = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pSelectionLB->GetEntryData(nPos));
+ nExtSubType = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pSelectionLB->GetEntryData(nPos)));
}
else
nExtSubType = DI_SUB_TIME;
@@ -335,7 +335,7 @@ IMPL_LINK_NOARG(SwFieldDokInfPage, SubTypeHdl, ListBox&, void)
nPos = m_pSelectionLB->GetSelectedEntryPos();
if (nPos != LISTBOX_ENTRY_NOTFOUND )
{
- nSubType = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pSelectionLB->GetEntryData(nPos));
+ nSubType = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pSelectionLB->GetEntryData(nPos)));
nOldSubType &= ~DI_SUB_FIXED;
if (nOldSubType == nSubType)
@@ -425,10 +425,10 @@ sal_Int32 SwFieldDokInfPage::FillSelectionLB(sal_uInt16 nSubType)
bool SwFieldDokInfPage::FillItemSet(SfxItemSet* )
{
- if (!pSelEntry || (sal_uInt16)reinterpret_cast<sal_uLong>(pSelEntry->GetUserData()) == USHRT_MAX)
+ if (!pSelEntry || static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(pSelEntry->GetUserData())) == USHRT_MAX)
return false;
- sal_uInt16 nSubType = (sal_uInt16)reinterpret_cast<sal_uLong>(pSelEntry->GetUserData());
+ sal_uInt16 nSubType = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(pSelEntry->GetUserData()));
sal_uInt32 nFormat = 0;
@@ -439,7 +439,7 @@ bool SwFieldDokInfPage::FillItemSet(SfxItemSet* )
aName = m_pTypeTLB->GetEntryText(pSelEntry);
if (nPos != LISTBOX_ENTRY_NOTFOUND)
- nSubType |= (sal_uInt16)reinterpret_cast<sal_uLong>(m_pSelectionLB->GetEntryData(nPos));
+ nSubType |= static_cast<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 628b037b6077..fe827cf1f560 100644
--- a/sw/source/ui/fldui/flddok.cxx
+++ b/sw/source/ui/fldui/flddok.cxx
@@ -182,7 +182,7 @@ void SwFieldDokPage::Reset(const SfxItemSet* )
if(nVal != USHRT_MAX)
{
for(sal_Int32 i = 0; i < m_pTypeLB->GetEntryCount(); i++)
- if(nVal == (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(i)))
+ if(nVal == static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(i))))
{
m_pTypeLB->SelectEntryPos(i);
break;
@@ -225,7 +225,7 @@ IMPL_LINK_NOARG(SwFieldDokPage, TypeHdl, ListBox&, void)
m_pDateFT->Hide();
m_pTimeFT->Hide();
- sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel()));
+ sal_uInt16 nTypeId = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())));
// fill Selection-Listbox
m_pSelectionLB->Clear();
@@ -306,7 +306,7 @@ IMPL_LINK_NOARG(SwFieldDokPage, TypeHdl, ListBox&, void)
AddSubType(TYP_PAGENUMBERFLD);
AddSubType(TYP_PREVPAGEFLD);
AddSubType(TYP_NEXTPAGEFLD);
- nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pSelectionLB->GetEntryData(0));
+ nTypeId = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pSelectionLB->GetEntryData(0)));
nCount = 3;
m_pSelectionLB->SetSelectHdl(LINK(this, SwFieldDokPage, SubTypeHdl));
}
@@ -361,8 +361,8 @@ IMPL_LINK_NOARG(SwFieldDokPage, TypeHdl, ListBox&, void)
case TYP_NEXTPAGEFLD:
if (IsFieldEdit())
{
- const sal_uInt16 nTmp = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pFormatLB->GetEntryData(
- m_pFormatLB->GetSelectedEntryPos() ));
+ const sal_uInt16 nTmp = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pFormatLB->GetEntryData(
+ m_pFormatLB->GetSelectedEntryPos() )));
if(SVX_NUM_CHAR_SPECIAL != nTmp)
{
@@ -463,7 +463,7 @@ IMPL_LINK_NOARG(SwFieldDokPage, SubTypeHdl, ListBox&, void)
if(nPos == LISTBOX_ENTRY_NOTFOUND)
nPos = 0;
- const sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pSelectionLB->GetEntryData(nPos));
+ const sal_uInt16 nTypeId = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pSelectionLB->GetEntryData(nPos)));
FillFormatLB(nTypeId);
const char* pTextRes = nullptr;
@@ -475,8 +475,8 @@ IMPL_LINK_NOARG(SwFieldDokPage, SubTypeHdl, ListBox&, void)
case TYP_PREVPAGEFLD:
case TYP_NEXTPAGEFLD:
- pTextRes = SVX_NUM_CHAR_SPECIAL == (sal_uInt16)reinterpret_cast<sal_uLong>(m_pFormatLB->GetEntryData(
- m_pFormatLB->GetSelectedEntryPos() ))
+ pTextRes = SVX_NUM_CHAR_SPECIAL == static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pFormatLB->GetEntryData(
+ m_pFormatLB->GetSelectedEntryPos() )))
? STR_VALUE : STR_OFFSET;
break;
@@ -526,7 +526,7 @@ sal_Int32 SwFieldDokPage::FillFormatLB(sal_uInt16 nTypeId)
IMPL_LINK_NOARG(SwFieldDokPage, FormatHdl, ListBox&, void)
{
- sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel()));
+ sal_uInt16 nTypeId = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())));
if (nTypeId == USHRT_MAX)
{
@@ -534,14 +534,14 @@ IMPL_LINK_NOARG(SwFieldDokPage, FormatHdl, ListBox&, void)
if(nPos == LISTBOX_ENTRY_NOTFOUND)
nPos = 0;
- nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pSelectionLB->GetEntryData(nPos));
+ nTypeId = static_cast<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)reinterpret_cast<sal_uLong>(m_pFormatLB->GetEntryData(
- m_pFormatLB->GetSelectedEntryPos() ));
+ sal_uInt16 nTmp = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pFormatLB->GetEntryData(
+ m_pFormatLB->GetSelectedEntryPos() )));
const OUString sOldText( m_pValueFT->GetText() );
const OUString sNewText( SwResId( SVX_NUM_CHAR_SPECIAL == nTmp ? STR_VALUE
: STR_OFFSET ));
@@ -556,14 +556,14 @@ IMPL_LINK_NOARG(SwFieldDokPage, FormatHdl, ListBox&, void)
bool SwFieldDokPage::FillItemSet(SfxItemSet* )
{
- sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel()));
+ sal_uInt16 nTypeId = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())));
if (nTypeId == USHRT_MAX)
{
sal_Int32 nPos = m_pSelectionLB->GetSelectedEntryPos();
if(nPos == LISTBOX_ENTRY_NOTFOUND)
nPos = 0;
- nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pSelectionLB->GetEntryData(nPos));
+ nTypeId = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pSelectionLB->GetEntryData(nPos)));
}
OUString aVal(m_pValueED->GetText());
@@ -581,7 +581,7 @@ bool SwFieldDokPage::FillItemSet(SfxItemSet* )
{
sal_Int32 nPos = m_pSelectionLB->GetSelectedEntryPos();
if(nPos != LISTBOX_ENTRY_NOTFOUND)
- nSubType = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pSelectionLB->GetEntryData(nPos));
+ nSubType = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pSelectionLB->GetEntryData(nPos)));
}
switch (nTypeId)
diff --git a/sw/source/ui/fldui/fldfunc.cxx b/sw/source/ui/fldui/fldfunc.cxx
index 74da178e3514..6842d030d471 100644
--- a/sw/source/ui/fldui/fldfunc.cxx
+++ b/sw/source/ui/fldui/fldfunc.cxx
@@ -188,7 +188,7 @@ void SwFieldFuncPage::Reset(const SfxItemSet* )
if(nVal != USHRT_MAX)
{
for(sal_Int32 i = 0; i < m_pTypeLB->GetEntryCount(); i++)
- if(nVal == (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(i)))
+ if(nVal == static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(i))))
{
m_pTypeLB->SelectEntryPos(i);
break;
@@ -236,7 +236,7 @@ IMPL_LINK_NOARG(SwFieldFuncPage, TypeHdl, ListBox&, void)
if (nOld == GetTypeSel())
return;
- const sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel()));
+ const sal_uInt16 nTypeId = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())));
// fill Selection-Listbox
UpdateSubType();
@@ -415,7 +415,7 @@ IMPL_LINK_NOARG(SwFieldFuncPage, TypeHdl, ListBox&, void)
IMPL_LINK_NOARG(SwFieldFuncPage, SelectHdl, ListBox&, void)
{
- const sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel()));
+ const sal_uInt16 nTypeId = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())));
if( TYP_MACROFLD == nTypeId )
m_pNameED->SetText( m_pSelectionLB->GetSelectedEntry() );
@@ -500,7 +500,7 @@ IMPL_LINK_NOARG(SwFieldFuncPage, ListEnableHdl, Edit&, void)
// renew types in SelectionBox
void SwFieldFuncPage::UpdateSubType()
{
- const sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel()));
+ const sal_uInt16 nTypeId = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())));
// fill Selection-Listbox
m_pSelectionLB->SetUpdateMode(false);
@@ -549,7 +549,7 @@ IMPL_LINK_NOARG( SwFieldFuncPage, MacroHdl, Button *, void)
bool SwFieldFuncPage::FillItemSet(SfxItemSet* )
{
- const sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel()));
+ const sal_uInt16 nTypeId = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())));
sal_uInt16 nSubType = 0;
@@ -636,7 +636,7 @@ IMPL_LINK_NOARG(SwFieldFuncPage, ModifyHdl, Edit&, void)
const sal_Int32 nLen = m_pNameED->GetText().getLength();
bool bEnable = true;
- sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel()));
+ sal_uInt16 nTypeId = static_cast<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/fldref.cxx b/sw/source/ui/fldui/fldref.cxx
index 75e8bf794f34..11044773dde1 100644
--- a/sw/source/ui/fldui/fldref.cxx
+++ b/sw/source/ui/fldui/fldref.cxx
@@ -145,7 +145,7 @@ void SwFieldRefPage::SaveSelectedTextNode()
SvTreeListEntry* pEntry = m_pSelectionToolTipLB->GetCurEntry();
if ( pEntry )
{
- const sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel()));
+ const sal_uInt16 nTypeId = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())));
if ( nTypeId == REFFLDFLAG_HEADING )
{
@@ -226,7 +226,7 @@ void SwFieldRefPage::Reset(const SfxItemSet* )
if ((nsSwGetSetExpType::GSE_SEQ & pType->GetType()) && pType->HasWriterListeners() && pSh->IsUsed(*pType))
{
nPos = m_pTypeLB->InsertEntry(pType->GetName());
- m_pTypeLB->SetEntryData(nPos, reinterpret_cast<void*>((sal_uIntPtr)(REFFLDFLAG | n)));
+ m_pTypeLB->SetEntryData(nPos, reinterpret_cast<void*>(static_cast<sal_uIntPtr>(REFFLDFLAG | n)));
}
}
@@ -269,7 +269,7 @@ void SwFieldRefPage::Reset(const SfxItemSet* )
{
for(sal_Int32 i = 0; i < m_pTypeLB->GetEntryCount(); i++)
{
- if(nVal == (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(i)))
+ if(nVal == static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(i))))
{
m_pTypeLB->SelectEntryPos(i);
break;
@@ -381,7 +381,7 @@ IMPL_LINK_NOARG(SwFieldRefPage, TypeHdl, ListBox&, void)
if (nOld == GetTypeSel())
return;
- sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel()));
+ sal_uInt16 nTypeId = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())));
// fill selection-ListBox
OUString sFilter = comphelper::string::strip(m_pFilterED->GetText(), ' ');
@@ -401,7 +401,7 @@ IMPL_LINK_NOARG(SwFieldRefPage, TypeHdl, ListBox&, void)
switch (nTypeId)
{
case TYP_GETREFFLD:
- if (REFFLDFLAG & (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(nOld)))
+ if (REFFLDFLAG & static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(nOld))))
// the old one stays
nFieldDlgFormatSel = m_pFormatLB->GetSelectedEntryPos();
bName = true;
@@ -417,7 +417,7 @@ IMPL_LINK_NOARG(SwFieldRefPage, TypeHdl, ListBox&, void)
default:
if( REFFLDFLAG & nTypeId )
{
- const sal_uInt16 nOldId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(nOld));
+ const sal_uInt16 nOldId = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(nOld)));
if( nOldId & REFFLDFLAG || nOldId == TYP_GETREFFLD )
// then the old one stays
nFieldDlgFormatSel = m_pFormatLB->GetSelectedEntryPos();
@@ -449,7 +449,7 @@ IMPL_LINK_NOARG(SwFieldRefPage, SubTypeListBoxHdl, ListBox&, void)
}
void SwFieldRefPage::SubTypeHdl()
{
- sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel()));
+ sal_uInt16 nTypeId = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())));
switch(nTypeId)
{
@@ -499,7 +499,7 @@ void SwFieldRefPage::UpdateSubType(const OUString& filterString)
if(!pSh)
pSh = ::GetActiveWrtShell();
SwGetRefField* pRefField = static_cast<SwGetRefField*>(GetCurField());
- const sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel()));
+ const sal_uInt16 nTypeId = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())));
OUString sOldSel;
// #i83479#
@@ -862,7 +862,7 @@ IMPL_LINK_NOARG(SwFieldRefPage, ModifyHdl, Edit&, void)
const bool bEmptyName = aName.isEmpty();
bool bEnable = true;
- sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel()));
+ sal_uInt16 nTypeId = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())));
if ((nTypeId == TYP_SETREFFLD && !GetFieldMgr().CanInsertRefMark(aName)) ||
(bEmptyName && (nTypeId == TYP_GETREFFLD || nTypeId == TYP_SETREFFLD ||
@@ -877,7 +877,7 @@ IMPL_LINK_NOARG(SwFieldRefPage, ModifyHdl, Edit&, void)
bool SwFieldRefPage::FillItemSet(SfxItemSet* )
{
bool bModified = false;
- sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel()));
+ sal_uInt16 nTypeId = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())));
sal_uInt16 nSubType = 0;
const sal_Int32 nEntryPos = m_pFormatLB->GetSelectedEntryPos();
diff --git a/sw/source/ui/fldui/fldvar.cxx b/sw/source/ui/fldui/fldvar.cxx
index c4a7b6ffe580..cce918d0da8a 100644
--- a/sw/source/ui/fldui/fldvar.cxx
+++ b/sw/source/ui/fldui/fldvar.cxx
@@ -179,11 +179,11 @@ void SwFieldVarPage::Reset(const SfxItemSet* )
if(!IsRefresh() && sUserData.getToken(0, ';').equalsIgnoreAsciiCase(USER_DATA_VERSION_1))
{
OUString sVal = sUserData.getToken(1, ';');
- sal_uInt16 nVal = (sal_uInt16)sVal.toInt32();
+ sal_uInt16 nVal = static_cast<sal_uInt16>(sVal.toInt32());
if( USHRT_MAX != nVal )
{
for(sal_Int32 i = 0; i < m_pTypeLB->GetEntryCount(); i++)
- if(nVal == (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(i)))
+ if(nVal == static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(i))))
{
m_pTypeLB->SelectEntryPos(i);
break;
@@ -245,7 +245,7 @@ IMPL_LINK( SwFieldVarPage, SubTypeListBoxHdl, ListBox&, rBox, void )
void SwFieldVarPage::SubTypeHdl(ListBox const * pBox)
{
- sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel()));
+ sal_uInt16 nTypeId = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())));
sal_Int32 nSelPos = m_pSelectionLB->GetSelectedEntryPos();
size_t nSelData = SIZE_MAX;
@@ -569,7 +569,7 @@ void SwFieldVarPage::SubTypeHdl(ListBox const * pBox)
if(m_pSelectionLB->IsCallAddSelection())
{
- nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel()));
+ nTypeId = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())));
switch (nTypeId)
{
@@ -606,7 +606,7 @@ void SwFieldVarPage::UpdateSubType()
m_pSelectionLB->SetUpdateMode(false);
m_pSelectionLB->Clear();
- const sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel()));
+ const sal_uInt16 nTypeId = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())));
std::vector<OUString> aList;
GetFieldMgr().GetSubTypes(nTypeId, aList);
const size_t nCount = aList.size();
@@ -834,7 +834,7 @@ IMPL_LINK_NOARG(SwFieldVarPage, ModifyHdl, Edit&, void)
{
OUString sValue(m_pValueED->GetText());
bool bHasValue = !sValue.isEmpty();
- const sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel()));
+ const sal_uInt16 nTypeId = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())));
bool bInsert = false, bApply = false, bDelete = false;
OUString sName( m_pNameED->GetText() );
@@ -955,7 +955,7 @@ IMPL_LINK_NOARG(SwFieldVarPage, ModifyHdl, Edit&, void)
IMPL_LINK( SwFieldVarPage, TBClickHdl, ToolBox *, pBox, void )
{
- const sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel()));
+ const sal_uInt16 nTypeId = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())));
const sal_uInt16 nCurId = pBox->GetCurItemId();
@@ -1007,7 +1007,7 @@ IMPL_LINK( SwFieldVarPage, TBClickHdl, ToolBox *, pBox, void )
sal_uLong nFormat = m_pFormatLB->GetSelectedEntryPos();
if (nFormat != LISTBOX_ENTRY_NOTFOUND)
- nFormat = reinterpret_cast<sal_uLong>(m_pFormatLB->GetEntryData((sal_Int32)nFormat));
+ nFormat = reinterpret_cast<sal_uLong>(m_pFormatLB->GetEntryData(static_cast<sal_Int32>(nFormat)));
if (pType) // change
{
@@ -1115,14 +1115,14 @@ IMPL_LINK_NOARG(SwFieldVarPage, SeparatorHdl, Edit&, void)
bool SwFieldVarPage::FillItemSet(SfxItemSet* )
{
- const sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel()));
+ const sal_uInt16 nTypeId = static_cast<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->GetSelectedEntryPos();
sal_uInt16 nSubType = (nSubPos == LISTBOX_ENTRY_NOTFOUND) ? 0 :
- (sal_uInt16)reinterpret_cast<sal_uLong>(m_pSelectionLB->GetEntryData(nSubPos));
+ static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pSelectionLB->GetEntryData(nSubPos)));
sal_uInt32 nFormat;
@@ -1305,7 +1305,7 @@ void SwFieldVarPage::FillUserData()
if( LISTBOX_ENTRY_NOTFOUND == nTypeSel )
nTypeSel = USHRT_MAX;
else
- nTypeSel = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData( nTypeSel ));
+ nTypeSel = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData( nTypeSel )));
sData += OUString::number( nTypeSel );
SetUserData(sData);
}