summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-03-31 13:17:08 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-03-31 13:17:08 +0200
commit4a69849e2fb50cbe3632209c28b9d638bbf878a9 (patch)
tree1204e22891cc1b8e566ad5aecf51212fe061442b /sw/source
parenta5d6cd83d7cac1fde630ac1211354242cbe4e085 (diff)
Reduce to static_cast any reinterpret_cast from void pointers
Change-Id: I83594c8b6cb1f317b55fe048111edd23f622e1ed
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/bastyp/calc.cxx22
-rw-r--r--sw/source/core/doc/docfmt.cxx2
-rw-r--r--sw/source/core/txtnode/swfntcch.cxx4
-rw-r--r--sw/source/filter/html/htmlforw.cxx24
-rw-r--r--sw/source/filter/html/htmlplug.cxx2
-rw-r--r--sw/source/filter/html/svxcss1.cxx22
-rw-r--r--sw/source/ui/envelp/mailmrge.cxx2
-rw-r--r--sw/source/ui/misc/glossary.cxx12
-rw-r--r--sw/source/ui/misc/srtdlg.cxx2
-rw-r--r--sw/source/uibase/uno/unofreg.cxx2
10 files changed, 47 insertions, 47 deletions
diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx
index 0801e37bf13e..635fa1857355 100644
--- a/sw/source/core/bastyp/calc.cxx
+++ b/sw/source/core/bastyp/calc.cxx
@@ -150,23 +150,23 @@ extern "C" {
static int SAL_CALL OperatorCompare( const void *pFirst, const void *pSecond)
{
int nRet = 0;
- if( CALC_NAME == reinterpret_cast<const _CalcOp*>(pFirst)->eOp )
+ if( CALC_NAME == static_cast<const _CalcOp*>(pFirst)->eOp )
{
- if( CALC_NAME == reinterpret_cast<const _CalcOp*>(pSecond)->eOp )
- nRet = reinterpret_cast<const _CalcOp*>(pFirst)->pUName->compareTo(
- *reinterpret_cast<const _CalcOp*>(pSecond)->pUName );
+ if( CALC_NAME == static_cast<const _CalcOp*>(pSecond)->eOp )
+ nRet = static_cast<const _CalcOp*>(pFirst)->pUName->compareTo(
+ *static_cast<const _CalcOp*>(pSecond)->pUName );
else
- nRet = reinterpret_cast<const _CalcOp*>(pFirst)->pUName->compareToAscii(
- reinterpret_cast<const _CalcOp*>(pSecond)->pName );
+ nRet = static_cast<const _CalcOp*>(pFirst)->pUName->compareToAscii(
+ static_cast<const _CalcOp*>(pSecond)->pName );
}
else
{
- if( CALC_NAME == reinterpret_cast<const _CalcOp*>(pSecond)->eOp )
- nRet = -1 * reinterpret_cast<const _CalcOp*>(pSecond)->pUName->compareToAscii(
- reinterpret_cast<const _CalcOp*>(pFirst)->pName );
+ if( CALC_NAME == static_cast<const _CalcOp*>(pSecond)->eOp )
+ nRet = -1 * static_cast<const _CalcOp*>(pSecond)->pUName->compareToAscii(
+ static_cast<const _CalcOp*>(pFirst)->pName );
else
- nRet = strcmp( reinterpret_cast<const _CalcOp*>(pFirst)->pName,
- reinterpret_cast<const _CalcOp*>(pSecond)->pName );
+ nRet = strcmp( static_cast<const _CalcOp*>(pFirst)->pName,
+ static_cast<const _CalcOp*>(pSecond)->pName );
}
return nRet;
}
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 367e3867be36..a253811a3655 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -1003,7 +1003,7 @@ static bool lcl_SetTxtFmtColl( const SwNodePtr& rpNode, void* pArgs )
if( pCNd == NULL)
return true;
- sw::DocumentContentOperationsManager::ParaRstFmt* pPara = reinterpret_cast<sw::DocumentContentOperationsManager::ParaRstFmt*>(pArgs);
+ sw::DocumentContentOperationsManager::ParaRstFmt* pPara = static_cast<sw::DocumentContentOperationsManager::ParaRstFmt*>(pArgs);
SwTxtFmtColl* pFmt = static_cast<SwTxtFmtColl*>(pPara->pFmtColl);
if ( pPara->bReset )
diff --git a/sw/source/core/txtnode/swfntcch.cxx b/sw/source/core/txtnode/swfntcch.cxx
index 109ce7af8872..b705bbfc0951 100644
--- a/sw/source/core/txtnode/swfntcch.cxx
+++ b/sw/source/core/txtnode/swfntcch.cxx
@@ -45,7 +45,7 @@ SwFontObj::~SwFontObj()
SwFontAccess::SwFontAccess( const void *pOwn, SwViewShell *pSh ) :
SwCacheAccess( *pSwFontCache, pOwn,
- reinterpret_cast<const SwTxtFmtColl*>(pOwn)->IsInSwFntCache() ),
+ static_cast<const SwTxtFmtColl*>(pOwn)->IsInSwFntCache() ),
pShell( pSh )
{
}
@@ -57,7 +57,7 @@ SwFontObj *SwFontAccess::Get( )
SwCacheObj *SwFontAccess::NewObj( )
{
- const_cast<SwTxtFmtColl*>(reinterpret_cast<const SwTxtFmtColl*>(pOwner))->SetInSwFntCache( true );
+ const_cast<SwTxtFmtColl*>(static_cast<const SwTxtFmtColl*>(pOwner))->SetInSwFntCache( true );
return new SwFontObj( pOwner, pShell );
}
diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx
index 0de130123d88..f2df878e90cf 100644
--- a/sw/source/filter/html/htmlforw.cxx
+++ b/sw/source/filter/html/htmlforw.cxx
@@ -465,7 +465,7 @@ void SwHTMLWriter::OutForm( bool bOn,
uno::Any aTmp = xFormPropSet->getPropertyValue( "Name" );
if( aTmp.getValueType() == ::cppu::UnoType<OUString>::get() &&
- !reinterpret_cast<const OUString*>(aTmp.getValue())->isEmpty() )
+ !static_cast<const OUString*>(aTmp.getValue())->isEmpty() )
{
sOut += " " + OString(OOO_STRING_SVTOOLS_HTML_O_name) + "=\"";
Strm().WriteOString( sOut );
@@ -476,7 +476,7 @@ void SwHTMLWriter::OutForm( bool bOn,
aTmp = xFormPropSet->getPropertyValue( "TargetURL" );
if( aTmp.getValueType() == ::cppu::UnoType<OUString>::get() &&
- !reinterpret_cast<const OUString*>(aTmp.getValue())->isEmpty() )
+ !static_cast<const OUString*>(aTmp.getValue())->isEmpty() )
{
sOut += " " + OString(OOO_STRING_SVTOOLS_HTML_O_action) + "=\"";
Strm().WriteOString( sOut );
@@ -524,7 +524,7 @@ void SwHTMLWriter::OutForm( bool bOn,
aTmp = xFormPropSet->getPropertyValue( "TargetFrame" );
if( aTmp.getValueType() == ::cppu::UnoType<OUString>::get()&&
- !reinterpret_cast<const OUString*>(aTmp.getValue())->isEmpty() )
+ !static_cast<const OUString*>(aTmp.getValue())->isEmpty() )
{
sOut += " " + OString(OOO_STRING_SVTOOLS_HTML_O_target) + "=\"";
Strm().WriteOString( sOut );
@@ -598,7 +598,7 @@ void SwHTMLWriter::OutHiddenControls(
aTmp = xPropSet->getPropertyValue( "Name" );
if( aTmp.getValueType() == ::cppu::UnoType<OUString>::get() &&
- !reinterpret_cast<const OUString*>(aTmp.getValue())->isEmpty() )
+ !static_cast<const OUString*>(aTmp.getValue())->isEmpty() )
{
sOut += " " + OString(OOO_STRING_SVTOOLS_HTML_O_name) + "=\"";
Strm().WriteOString( sOut );
@@ -608,7 +608,7 @@ void SwHTMLWriter::OutHiddenControls(
}
aTmp = xPropSet->getPropertyValue( "HiddenValue" );
if( aTmp.getValueType() == ::cppu::UnoType<OUString>::get() &&
- !reinterpret_cast<const OUString*>(aTmp.getValue())->isEmpty() )
+ !static_cast<const OUString*>(aTmp.getValue())->isEmpty() )
{
sOut += " " + OString(OOO_STRING_SVTOOLS_HTML_O_value) + "=\"";
Strm().WriteOString( sOut );
@@ -778,7 +778,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
aTmp = xPropSet->getPropertyValue( "Label" );
if( aTmp.getValueType() == ::cppu::UnoType<OUString>::get() &&
- !reinterpret_cast<const OUString*>(aTmp.getValue())->isEmpty() )
+ !static_cast<const OUString*>(aTmp.getValue())->isEmpty() )
{
sValue = *static_cast<OUString const *>(aTmp.getValue());
}
@@ -888,7 +888,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
{
aTmp = xPropSet->getPropertyValue( "DefaultText" );
if( aTmp.getValueType() == ::cppu::UnoType<OUString>::get() &&
- !reinterpret_cast<const OUString*>(aTmp.getValue())->isEmpty() )
+ !static_cast<const OUString*>(aTmp.getValue())->isEmpty() )
{
sValue = *static_cast<OUString const *>(aTmp.getValue());
}
@@ -935,7 +935,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
aTmp = xPropSet->getPropertyValue("Name");
if( aTmp.getValueType() == ::cppu::UnoType<OUString>::get() &&
- !reinterpret_cast<const OUString*>(aTmp.getValue())->isEmpty() )
+ !static_cast<const OUString*>(aTmp.getValue())->isEmpty() )
{
sOut += " " + OString(OOO_STRING_SVTOOLS_HTML_O_name) + "=\"";
rWrt.Strm().WriteOString( sOut );
@@ -965,7 +965,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
{
aTmp = xPropSet->getPropertyValue( "ImageURL" );
if( aTmp.getValueType() == ::cppu::UnoType<OUString>::get() &&
- !reinterpret_cast<const OUString*>(aTmp.getValue())->isEmpty() )
+ !static_cast<const OUString*>(aTmp.getValue())->isEmpty() )
{
sOut += " " + OString(OOO_STRING_SVTOOLS_HTML_O_src) + "=\"";
rWrt.Strm().WriteOString( sOut );
@@ -1073,7 +1073,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
{
aTmp = xPropSet->getPropertyValue( "FontName" );
if( aTmp.getValueType() == ::cppu::UnoType<OUString>::get() &&
- !reinterpret_cast<const OUString*>(aTmp.getValue())->isEmpty() )
+ !static_cast<const OUString*>(aTmp.getValue())->isEmpty() )
{
vcl::Font aFixedFont( OutputDevice::GetDefaultFont(
DEFAULTFONT_FIXED, LANGUAGE_ENGLISH_US,
@@ -1233,7 +1233,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
OUString sVal;
aTmp = xPropSet->getPropertyValue( "DefaultText" );
if( aTmp.getValueType() == ::cppu::UnoType<OUString>::get()&&
- !reinterpret_cast<const OUString*>(aTmp.getValue())->isEmpty() )
+ !static_cast<const OUString*>(aTmp.getValue())->isEmpty() )
{
sVal = *static_cast<OUString const *>(aTmp.getValue());
}
@@ -1256,7 +1256,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
{
aTmp = xPropSet->getPropertyValue("Label");
if( aTmp.getValueType() == ::cppu::UnoType<OUString>::get() &&
- !reinterpret_cast<const OUString*>(aTmp.getValue())->isEmpty() )
+ !static_cast<const OUString*>(aTmp.getValue())->isEmpty() )
{
sValue = *static_cast<OUString const *>(aTmp.getValue());
HTMLOutFuncs::Out_String( rWrt.Strm(), sValue,
diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx
index f6890bf16471..96670fbf770b 100644
--- a/sw/source/filter/html/htmlplug.cxx
+++ b/sw/source/filter/html/htmlplug.cxx
@@ -1290,7 +1290,7 @@ Writer& OutHTML_FrmFmtOLENodeGrf( Writer& rWrt, const SwFrmFmt& rFrmFmt,
aMediaDescriptor["FilterOptions"] <<= OUString("SkipHeaderFooter");
aMediaDescriptor["OutputStream"] <<= xOutputStream;
xStorable->storeToURL("private:stream", aMediaDescriptor.getAsConstPropertyValueList());
- OString aData(reinterpret_cast<const char*>(aStream.GetData()), aStream.GetSize());
+ OString aData(static_cast<const char*>(aStream.GetData()), aStream.GetSize());
// Wrap output in a <span> tag to avoid 'HTML parser error: Unexpected end tag: p'
HTMLOutFuncs::Out_AsciiTag(rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_span);
rWrt.Strm().WriteCharPtr(aData.getStr());
diff --git a/sw/source/filter/html/svxcss1.cxx b/sw/source/filter/html/svxcss1.cxx
index 2bea7b58fc15..2f97dc1d750e 100644
--- a/sw/source/filter/html/svxcss1.cxx
+++ b/sw/source/filter/html/svxcss1.cxx
@@ -3137,23 +3137,23 @@ extern "C"
static int SAL_CALL CSS1PropEntryCompare( const void *pFirst, const void *pSecond)
{
int nRet;
- if( reinterpret_cast<const CSS1PropEntry*>(pFirst)->pFunc )
+ if( static_cast<const CSS1PropEntry*>(pFirst)->pFunc )
{
- if( reinterpret_cast<const CSS1PropEntry*>(pSecond)->pFunc )
- nRet = strcmp( reinterpret_cast<const CSS1PropEntry*>(pFirst)->sName ,
- reinterpret_cast<const CSS1PropEntry*>(pSecond)->sName );
+ if( static_cast<const CSS1PropEntry*>(pSecond)->pFunc )
+ nRet = strcmp( static_cast<const CSS1PropEntry*>(pFirst)->sName ,
+ static_cast<const CSS1PropEntry*>(pSecond)->sName );
else
- nRet = -1 * reinterpret_cast<const CSS1PropEntry*>(pSecond)->pName->compareToAscii(
- reinterpret_cast<const CSS1PropEntry*>(pFirst)->sName );
+ nRet = -1 * static_cast<const CSS1PropEntry*>(pSecond)->pName->compareToAscii(
+ static_cast<const CSS1PropEntry*>(pFirst)->sName );
}
else
{
- if( reinterpret_cast<const CSS1PropEntry*>(pSecond)->pFunc )
- nRet = reinterpret_cast<const CSS1PropEntry*>(pFirst)->pName->compareToAscii(
- reinterpret_cast<const CSS1PropEntry*>(pSecond)->sName );
+ if( static_cast<const CSS1PropEntry*>(pSecond)->pFunc )
+ nRet = static_cast<const CSS1PropEntry*>(pFirst)->pName->compareToAscii(
+ static_cast<const CSS1PropEntry*>(pSecond)->sName );
else
- nRet = reinterpret_cast<const CSS1PropEntry*>(pFirst)->pName->compareTo(
- *reinterpret_cast<const CSS1PropEntry*>(pSecond)->pName );
+ nRet = static_cast<const CSS1PropEntry*>(pFirst)->pName->compareTo(
+ *static_cast<const CSS1PropEntry*>(pSecond)->pName );
}
return nRet;
diff --git a/sw/source/ui/envelp/mailmrge.cxx b/sw/source/ui/envelp/mailmrge.cxx
index 8808098a5c16..7316fb8022b3 100644
--- a/sw/source/ui/envelp/mailmrge.cxx
+++ b/sw/source/ui/envelp/mailmrge.cxx
@@ -397,7 +397,7 @@ SwMailMergeDlg::~SwMailMergeDlg()
for( sal_Int32 nFilter = 0; nFilter < m_pFilterLB->GetEntryCount(); ++nFilter )
{
- OUString* pData = reinterpret_cast< OUString* >( m_pFilterLB->GetEntryData(nFilter) );
+ OUString* pData = static_cast< OUString* >( m_pFilterLB->GetEntryData(nFilter) );
delete pData;
}
delete pImpl;
diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index 4e398a8f83d4..ffecd29ab37a 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -257,7 +257,7 @@ IMPL_LINK( SwGlossaryDlg, GrpSelect, SvTreeListBox *, pBox )
{
OUString aName(pBox->GetEntryText(pEntry));
m_pNameED->SetText(aName);
- m_pShortNameEdit->SetText(*reinterpret_cast<OUString*>(pEntry->GetUserData()));
+ m_pShortNameEdit->SetText(*static_cast<OUString*>(pEntry->GetUserData()));
m_pInsertBtn->Enable( !bIsDocReadOnly);
ShowAutoText(::GetCurrGlosGroup(), m_pShortNameEdit->GetText());
}
@@ -325,7 +325,7 @@ SvTreeListEntry* SwGlossaryDlg::DoesBlockExist(const OUString& rBlock,
SvTreeListEntry* pChild = m_pCategoryBox->GetEntry( pEntry, i );
if (rBlock == m_pCategoryBox->GetEntryText(pChild) &&
(rShort.isEmpty() ||
- rShort==*reinterpret_cast<OUString*>(pChild->GetUserData()))
+ rShort==*static_cast<OUString*>(pChild->GetUserData()))
)
{
return pChild;
@@ -479,7 +479,7 @@ IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn )
SvTreeListEntry* pNewEntry = m_pCategoryBox->InsertEntry(
pNewNameDlg->GetNewName(), m_pCategoryBox->GetParent(pEntry));
pNewEntry->SetUserData(new OUString(pNewNameDlg->GetNewShort()));
- delete reinterpret_cast<OUString*>(pEntry->GetUserData());
+ delete static_cast<OUString*>(pEntry->GetUserData());
m_pCategoryBox->GetModel()->Remove(pEntry);
m_pCategoryBox->Select(pNewEntry);
m_pCategoryBox->MakeVisible(pNewEntry);
@@ -830,7 +830,7 @@ void SwGlTreeListBox::Clear()
while(pEntry)
{
if(GetParent(pEntry))
- delete reinterpret_cast<OUString*>(pEntry->GetUserData());
+ delete static_cast<OUString*>(pEntry->GetUserData());
else
delete static_cast<GroupUserData*>(pEntry->GetUserData());
pEntry = Next(pEntry);
@@ -877,7 +877,7 @@ void SwGlTreeListBox::RequestHelp( const HelpEvent& rHEvt )
}
}
else
- sMsg = *reinterpret_cast<OUString*>(pEntry->GetUserData());
+ sMsg = *static_cast<OUString*>(pEntry->GetUserData());
Help::ShowQuickHelp( this, aItemRect, sMsg,
QUICKHELP_LEFT|QUICKHELP_VCENTER );
}
@@ -968,7 +968,7 @@ TriState SwGlTreeListBox::NotifyCopyingOrMoving(
pDlg->pGlossaryHdl->SetCurGroup(sSourceGroup);
OUString sTitle(GetEntryText(pEntry));
- OUString sShortName(*reinterpret_cast<OUString*>(pEntry->GetUserData()));
+ OUString sShortName(*static_cast<OUString*>(pEntry->GetUserData()));
GroupUserData* pDestData = static_cast<GroupUserData*>(pDestParent->GetUserData());
OUString sDestName = pDestData->sGroupName
diff --git a/sw/source/ui/misc/srtdlg.cxx b/sw/source/ui/misc/srtdlg.cxx
index dba258bb5d58..3c58114764b1 100644
--- a/sw/source/ui/misc/srtdlg.cxx
+++ b/sw/source/ui/misc/srtdlg.cxx
@@ -73,7 +73,7 @@ static void lcl_ClearLstBoxAndDelUserData( ListBox& rLstBox )
const sal_Int32 nEnd = rLstBox.GetEntryCount();
for( sal_Int32 n = 0; n < nEnd; ++n )
{
- delete reinterpret_cast<OUString *>(rLstBox.GetEntryData( n ));
+ delete static_cast<OUString *>(rLstBox.GetEntryData( n ));
}
rLstBox.Clear();
}
diff --git a/sw/source/uibase/uno/unofreg.cxx b/sw/source/uibase/uno/unofreg.cxx
index 4ad389bc3e09..9b455f335fcf 100644
--- a/sw/source/uibase/uno/unofreg.cxx
+++ b/sw/source/uibase/uno/unofreg.cxx
@@ -50,7 +50,7 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL sw_component_getFactory(
if( pServiceManager )
{
uno::Reference< XMultiServiceFactory > xMSF(
- reinterpret_cast< XMultiServiceFactory * >( pServiceManager ) );
+ static_cast< XMultiServiceFactory * >( pServiceManager ) );
uno::Reference< XSingleServiceFactory > xFactory;