summaryrefslogtreecommitdiff
path: root/sw/source/ui/misc
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-03-28 19:07:45 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-03-28 19:09:27 +0100
commit2828d92eee63a4a5306ef64482bc7d1db3459406 (patch)
tree0fe6e09f55f278bf9c32d36e9375fb7258b6ed0a /sw/source/ui/misc
parent85f28ec44a2c169c91dac9346e9c71feda6a6cab (diff)
Clean up C-style casts from pointers to void
Change-Id: I2ec58d0bfe13fae4fc2141f9b017b5a72e0ba2c2
Diffstat (limited to 'sw/source/ui/misc')
-rw-r--r--sw/source/ui/misc/glosbib.cxx16
-rw-r--r--sw/source/ui/misc/glossary.cxx20
-rw-r--r--sw/source/ui/misc/srtdlg.cxx8
3 files changed, 22 insertions, 22 deletions
diff --git a/sw/source/ui/misc/glosbib.cxx b/sw/source/ui/misc/glosbib.cxx
index 385ce257cfeb..11a3666236bb 100644
--- a/sw/source/ui/misc/glosbib.cxx
+++ b/sw/source/ui/misc/glosbib.cxx
@@ -131,7 +131,7 @@ void SwGlossaryGroupDlg::Apply()
if(m_pGroupTLB->GetEntryCount())
{
SvTreeListEntry* pFirst = m_pGroupTLB->First();
- GlosBibUserData* pUserData = (GlosBibUserData*)pFirst->GetUserData();
+ GlosBibUserData* pUserData = static_cast<GlosBibUserData*>(pFirst->GetUserData());
pGlosHdl->SetCurGroup(pUserData->sGroupName);
}
}
@@ -177,7 +177,7 @@ IMPL_LINK( SwGlossaryGroupDlg, SelectHdl, SvTabListBox*, EMPTYARG )
SvTreeListEntry* pFirstEntry = m_pGroupTLB->FirstSelected();
if(pFirstEntry)
{
- GlosBibUserData* pUserData = (GlosBibUserData*)pFirstEntry->GetUserData();
+ GlosBibUserData* pUserData = static_cast<GlosBibUserData*>(pFirstEntry->GetUserData());
OUString sEntry(pUserData->sGroupName);
OUString sName(m_pNameED->GetText());
bool bExists = false;
@@ -185,7 +185,7 @@ IMPL_LINK( SwGlossaryGroupDlg, SelectHdl, SvTabListBox*, EMPTYARG )
if( 0xffffffff > nPos)
{
SvTreeListEntry* pEntry = m_pGroupTLB->GetEntry(nPos);
- GlosBibUserData* pFoundData = (GlosBibUserData*)pEntry->GetUserData();
+ GlosBibUserData* pFoundData = static_cast<GlosBibUserData*>(pEntry->GetUserData());
bExists = pFoundData->sGroupName == sEntry;
}
@@ -224,7 +224,7 @@ IMPL_LINK( SwGlossaryGroupDlg, DeleteHdl, Button*, pButton )
pButton->Enable(false);
return 0;
}
- GlosBibUserData* pUserData = (GlosBibUserData*)pEntry->GetUserData();
+ GlosBibUserData* pUserData = static_cast<GlosBibUserData*>(pEntry->GetUserData());
OUString const sEntry(pUserData->sGroupName);
// if the name to be deleted is among the new ones - get rid of it
bool bDelete = true;
@@ -269,7 +269,7 @@ IMPL_LINK( SwGlossaryGroupDlg, DeleteHdl, Button*, pButton )
IMPL_LINK_NOARG(SwGlossaryGroupDlg, RenameHdl)
{
SvTreeListEntry* pEntry = m_pGroupTLB->FirstSelected();
- GlosBibUserData* pUserData = (GlosBibUserData*)pEntry->GetUserData();
+ GlosBibUserData* pUserData = static_cast<GlosBibUserData*>(pEntry->GetUserData());
OUString sEntry(pUserData->sGroupName);
const OUString sNewTitle(m_pNameED->GetText());
@@ -297,7 +297,7 @@ IMPL_LINK_NOARG(SwGlossaryGroupDlg, RenameHdl)
+ OUStringLiteral1<RENAME_TOKEN_DELIM>() + sNewTitle;
m_RenamedArr.push_back(sEntry);
}
- delete (GlosBibUserData*)pEntry->GetUserData();
+ delete static_cast<GlosBibUserData*>(pEntry->GetUserData());
m_pGroupTLB->GetModel()->Remove(pEntry);
pEntry = m_pGroupTLB->InsertEntry(m_pNameED->GetText() + "\t"
+ m_pPathLB->GetSelectEntry());
@@ -354,7 +354,7 @@ IMPL_LINK_NOARG(SwGlossaryGroupDlg, ModifyHdl)
SvTreeListEntry* pEntry = m_pGroupTLB->FirstSelected();
if(pEntry)
{
- GlosBibUserData* pUserData = (GlosBibUserData*)pEntry->GetUserData();
+ GlosBibUserData* pUserData = static_cast<GlosBibUserData*>(pEntry->GetUserData());
bEnableDel = IsDeleteAllowed(pUserData->sGroupName);
}
@@ -418,7 +418,7 @@ void SwGlossaryGroupTLB::RequestHelp( const HelpEvent& rHEvt )
aSize.Width() = GetSizePixel().Width() - aPos.X();
aPos = OutputToScreenPixel(aPos);
Rectangle aItemRect( aPos, aSize );
- GlosBibUserData* pData = (GlosBibUserData*)pEntry->GetUserData();
+ GlosBibUserData* pData = static_cast<GlosBibUserData*>(pEntry->GetUserData());
const OUString sMsg = pData->sPath + "/"
+ pData->sGroupName.getToken(0, GLOS_DELIM)
+ SwGlossaries::GetExtension();
diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index ca82a9496258..4e398a8f83d4 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -243,7 +243,7 @@ IMPL_LINK( SwGlossaryDlg, GrpSelect, SvTreeListBox *, pBox )
if(!pEntry)
return 0;
SvTreeListEntry* pParent = pBox->GetParent(pEntry) ? pBox->GetParent(pEntry) : pEntry;
- GroupUserData* pGroupData = (GroupUserData*)pParent->GetUserData();
+ GroupUserData* pGroupData = static_cast<GroupUserData*>(pParent->GetUserData());
::SetCurrGlosGroup(pGroupData->sGroupName
+ OUStringLiteral1<GLOS_DELIM>()
+ OUString::number(pGroupData->nPathIdx));
@@ -604,7 +604,7 @@ IMPL_LINK_NOARG(SwGlossaryDlg, BibHdl)
Any aAny = aTestContent.getPropertyValue( "IsReadOnly" );
if(aAny.hasValue())
{
- bIsWritable = !*(sal_Bool*)aAny.getValue();
+ bIsWritable = !*static_cast<sal_Bool const *>(aAny.getValue());
}
}
catch (const Exception&)
@@ -627,7 +627,7 @@ IMPL_LINK_NOARG(SwGlossaryDlg, BibHdl)
{
if(!m_pCategoryBox->GetParent(pEntry))
{
- GroupUserData* pGroupData = (GroupUserData*)pEntry->GetUserData();
+ GroupUserData* pGroupData = static_cast<GroupUserData*>(pEntry->GetUserData());
const OUString sGroup = pGroupData->sGroupName
+ OUStringLiteral1<GLOS_DELIM>()
+ OUString::number(pGroupData->nPathIdx);
@@ -711,7 +711,7 @@ void SwGlossaryDlg::Init()
{
if(!m_pCategoryBox->GetParent(pSearch))
{
- GroupUserData* pData = (GroupUserData*)pSearch->GetUserData();
+ GroupUserData* pData = static_cast<GroupUserData*>(pSearch->GetUserData());
if(!pData->bReadonly)
{
pSelEntry = pSearch;
@@ -832,7 +832,7 @@ void SwGlTreeListBox::Clear()
if(GetParent(pEntry))
delete reinterpret_cast<OUString*>(pEntry->GetUserData());
else
- delete (GroupUserData*)pEntry->GetUserData();
+ delete static_cast<GroupUserData*>(pEntry->GetUserData());
pEntry = Next(pEntry);
}
SvTreeListBox::Clear();
@@ -860,7 +860,7 @@ void SwGlTreeListBox::RequestHelp( const HelpEvent& rHEvt )
OUString sMsg;
if(!GetParent(pEntry))
{
- GroupUserData* pData = (GroupUserData*)pEntry->GetUserData();
+ GroupUserData* pData = static_cast<GroupUserData*>(pEntry->GetUserData());
const std::vector<OUString> & rPathArr = ::GetGlossaries()->GetPathArray();
if( !rPathArr.empty() )
{
@@ -897,7 +897,7 @@ DragDropMode SwGlTreeListBox::NotifyStartDrag(
SwGlossaryDlg* pDlg = static_cast<SwGlossaryDlg*>(GetParentDialog());
SvTreeListEntry* pParent = GetParent(pEntry);
- GroupUserData* pGroupData = (GroupUserData*)pParent->GetUserData();
+ GroupUserData* pGroupData = static_cast<GroupUserData*>(pParent->GetUserData());
OUString sEntry = pGroupData->sGroupName
+ OUStringLiteral1<GLOS_DELIM>()
+ OUString::number(pGroupData->nPathIdx);
@@ -961,7 +961,7 @@ TriState SwGlTreeListBox::NotifyCopyingOrMoving(
SwGlossaryDlg* pDlg = static_cast<SwGlossaryDlg*>(GetParentDialog());
SwWait aWait( *pDlg->pSh->GetView().GetDocShell(), true );
- GroupUserData* pGroupData = (GroupUserData*)pSrcParent->GetUserData();
+ GroupUserData* pGroupData = static_cast<GroupUserData*>(pSrcParent->GetUserData());
OUString sSourceGroup = pGroupData->sGroupName
+ OUStringLiteral1<GLOS_DELIM>()
+ OUString::number(pGroupData->nPathIdx);
@@ -970,7 +970,7 @@ TriState SwGlTreeListBox::NotifyCopyingOrMoving(
OUString sTitle(GetEntryText(pEntry));
OUString sShortName(*reinterpret_cast<OUString*>(pEntry->GetUserData()));
- GroupUserData* pDestData = (GroupUserData*)pDestParent->GetUserData();
+ GroupUserData* pDestData = static_cast<GroupUserData*>(pDestParent->GetUserData());
OUString sDestName = pDestData->sGroupName
+ OUStringLiteral1<GLOS_DELIM>()
+ OUString::number(pDestData->nPathIdx);
@@ -997,7 +997,7 @@ OUString SwGlossaryDlg::GetCurrGrpName() const
{
pEntry =
m_pCategoryBox->GetParent(pEntry) ? m_pCategoryBox->GetParent(pEntry) : pEntry;
- GroupUserData* pGroupData = (GroupUserData*)pEntry->GetUserData();
+ GroupUserData* pGroupData = static_cast<GroupUserData*>(pEntry->GetUserData());
return pGroupData->sGroupName + OUStringLiteral1<GLOS_DELIM>() + OUString::number(pGroupData->nPathIdx);
}
return OUString();
diff --git a/sw/source/ui/misc/srtdlg.cxx b/sw/source/ui/misc/srtdlg.cxx
index 093faac1f791..dba258bb5d58 100644
--- a/sw/source/ui/misc/srtdlg.cxx
+++ b/sw/source/ui/misc/srtdlg.cxx
@@ -300,7 +300,7 @@ void SwSortDlg::Apply()
if( sEntry == aNumericTxt )
sEntry.clear();
else if( 0 != (pUserData = m_pTypDLB1->GetSelectEntryData()) )
- sEntry = *(OUString*)pUserData;
+ sEntry = *static_cast<OUString*>(pUserData);
SwSortKey *pKey = new SwSortKey( nCol1, sEntry,
bAsc1 ? SRT_ASCENDING : SRT_DESCENDING );
@@ -313,7 +313,7 @@ void SwSortDlg::Apply()
if( sEntry == aNumericTxt )
sEntry.clear();
else if( 0 != (pUserData = m_pTypDLB2->GetSelectEntryData()) )
- sEntry = *(OUString*)pUserData;
+ sEntry = *static_cast<OUString*>(pUserData);
SwSortKey *pKey = new SwSortKey( nCol2, sEntry,
bAsc2 ? SRT_ASCENDING : SRT_DESCENDING );
@@ -326,7 +326,7 @@ void SwSortDlg::Apply()
if( sEntry == aNumericTxt )
sEntry.clear();
else if( 0 != (pUserData = m_pTypDLB3->GetSelectEntryData()) )
- sEntry = *(OUString*)pUserData;
+ sEntry = *static_cast<OUString*>(pUserData);
SwSortKey *pKey = new SwSortKey( nCol3, sEntry,
bAsc3 ? SRT_ASCENDING : SRT_DESCENDING );
@@ -428,7 +428,7 @@ IMPL_LINK( SwSortDlg, LanguageHdl, ListBox*, pLBox )
ListBox* pL = aLstArr[ n ];
void* pUserData = pL->GetSelectEntryData();
if (pUserData)
- aOldStrArr[ n ] = *(OUString*)pUserData;
+ aOldStrArr[ n ] = *static_cast<OUString*>(pUserData);
::lcl_ClearLstBoxAndDelUserData( *pL );
}