summaryrefslogtreecommitdiff
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
parent85f28ec44a2c169c91dac9346e9c71feda6a6cab (diff)
Clean up C-style casts from pointers to void
Change-Id: I2ec58d0bfe13fae4fc2141f9b017b5a72e0ba2c2
-rw-r--r--sw/inc/swmodule.hxx2
-rw-r--r--sw/source/core/attr/format.cxx2
-rw-r--r--sw/source/core/bastyp/calc.cxx4
-rw-r--r--sw/source/core/doc/DocumentContentOperationsManager.cxx2
-rw-r--r--sw/source/core/doc/doc.cxx2
-rw-r--r--sw/source/core/doc/docedt.cxx2
-rw-r--r--sw/source/core/doc/docfmt.cxx2
-rw-r--r--sw/source/core/doc/swserv.cxx2
-rw-r--r--sw/source/core/docnode/ndtbl.cxx2
-rw-r--r--sw/source/core/docnode/nodes.cxx2
-rw-r--r--sw/source/core/edit/edglss.cxx2
-rw-r--r--sw/source/core/edit/edlingu.cxx4
-rw-r--r--sw/source/core/fields/authfld.cxx6
-rw-r--r--sw/source/core/fields/cellfml.cxx14
-rw-r--r--sw/source/core/fields/dbfld.cxx2
-rw-r--r--sw/source/core/fields/ddefld.cxx2
-rw-r--r--sw/source/core/fields/docufld.cxx20
-rw-r--r--sw/source/core/fields/expfld.cxx10
-rw-r--r--sw/source/core/fields/flddat.cxx4
-rw-r--r--sw/source/core/fields/scrptfld.cxx2
-rw-r--r--sw/source/core/fields/tblcalc.cxx2
-rw-r--r--sw/source/core/fields/usrfld.cxx6
-rw-r--r--sw/source/core/frmedt/fefly1.cxx2
-rw-r--r--sw/source/core/graphic/grfatr.cxx2
-rw-r--r--sw/source/core/layout/atrfrm.cxx34
-rw-r--r--sw/source/core/layout/dbg_lay.cxx16
-rw-r--r--sw/source/core/layout/dumpfilter.cxx4
-rw-r--r--sw/source/core/layout/frmtool.cxx6
-rw-r--r--sw/source/core/para/paratr.cxx4
-rw-r--r--sw/source/core/text/porfly.cxx2
-rw-r--r--sw/source/core/text/porfly.hxx8
-rw-r--r--sw/source/core/text/txtcache.cxx4
-rw-r--r--sw/source/core/text/txtfrm.cxx6
-rw-r--r--sw/source/core/txtnode/fmtatr2.cxx2
-rw-r--r--sw/source/core/txtnode/fntcache.cxx12
-rw-r--r--sw/source/core/txtnode/swfntcch.cxx4
-rw-r--r--sw/source/core/unocore/swunohelper.cxx2
-rw-r--r--sw/source/core/unocore/unodraw.cxx24
-rw-r--r--sw/source/core/unocore/unofield.cxx4
-rw-r--r--sw/source/core/unocore/unoframe.cxx6
-rw-r--r--sw/source/core/unocore/unoobj.cxx8
-rw-r--r--sw/source/core/unocore/unosett.cxx22
-rw-r--r--sw/source/core/unocore/unosrch.cxx2
-rw-r--r--sw/source/core/unocore/unostyle.cxx14
-rw-r--r--sw/source/core/unocore/unotbl.cxx26
-rw-r--r--sw/source/filter/basflt/fltini.cxx2
-rw-r--r--sw/source/filter/html/htmlcss1.cxx2
-rw-r--r--sw/source/filter/html/htmlforw.cxx100
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.cxx12
-rw-r--r--sw/source/filter/ww8/rtfsdrexport.cxx2
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx12
-rw-r--r--sw/source/filter/ww8/wrtw8sty.cxx18
-rw-r--r--sw/source/filter/ww8/ww8graf.cxx4
-rw-r--r--sw/source/filter/ww8/ww8par.cxx8
-rw-r--r--sw/source/filter/ww8/ww8par2.cxx4
-rw-r--r--sw/source/filter/ww8/ww8par6.cxx2
-rw-r--r--sw/source/filter/ww8/ww8scan.cxx56
-rw-r--r--sw/source/filter/xml/XMLRedlineImportHelper.cxx8
-rw-r--r--sw/source/filter/xml/swxml.cxx6
-rw-r--r--sw/source/filter/xml/wrtxml.cxx2
-rw-r--r--sw/source/filter/xml/xmlexp.cxx4
-rw-r--r--sw/source/filter/xml/xmlimp.cxx4
-rw-r--r--sw/source/filter/xml/xmltble.cxx2
-rw-r--r--sw/source/filter/xml/xmltexti.cxx4
-rw-r--r--sw/source/ui/chrdlg/swuiccoll.cxx4
-rw-r--r--sw/source/ui/config/optload.cxx10
-rw-r--r--sw/source/ui/config/optpage.cxx16
-rw-r--r--sw/source/ui/dbui/dbinsdlg.cxx12
-rw-r--r--sw/source/ui/dialog/uiregionsw.cxx40
-rw-r--r--sw/source/ui/envelp/label1.cxx18
-rw-r--r--sw/source/ui/envelp/labelexp.cxx8
-rw-r--r--sw/source/ui/frmdlg/frmpage.cxx18
-rw-r--r--sw/source/ui/index/cnttab.cxx8
-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
-rw-r--r--sw/source/ui/table/tabledlg.cxx4
-rw-r--r--sw/source/uibase/app/docsh2.cxx4
-rw-r--r--sw/source/uibase/app/docst.cxx2
-rw-r--r--sw/source/uibase/app/swdll.cxx2
-rw-r--r--sw/source/uibase/config/modcfg.cxx28
-rw-r--r--sw/source/uibase/config/prtopt.cxx32
-rw-r--r--sw/source/uibase/config/usrpref.cxx6
-rw-r--r--sw/source/uibase/dochdl/swdtflvr.cxx8
-rw-r--r--sw/source/uibase/docvw/SidebarWin.cxx2
-rw-r--r--sw/source/uibase/envelp/envimg.cxx4
-rw-r--r--sw/source/uibase/envelp/labimg.cxx8
-rw-r--r--sw/source/uibase/misc/redlndlg.cxx4
-rw-r--r--sw/source/uibase/shells/tabsh.cxx2
-rw-r--r--sw/source/uibase/shells/textidx.cxx2
-rw-r--r--sw/source/uibase/uiview/view.cxx4
-rw-r--r--sw/source/uibase/uiview/view2.cxx4
-rw-r--r--sw/source/uibase/uno/SwXDocumentSettings.cxx88
-rw-r--r--sw/source/uibase/uno/unomod.cxx36
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx14
-rw-r--r--sw/source/uibase/uno/unotxvw.cxx2
-rw-r--r--sw/source/uibase/utlui/content.cxx124
-rw-r--r--sw/source/uibase/utlui/glbltree.cxx22
-rw-r--r--sw/source/uibase/utlui/navicfg.cxx4
-rw-r--r--sw/source/uibase/wrtsh/select.cxx2
100 files changed, 574 insertions, 574 deletions
diff --git a/sw/inc/swmodule.hxx b/sw/inc/swmodule.hxx
index 0750261574ac..dfcc4b189a30 100644
--- a/sw/inc/swmodule.hxx
+++ b/sw/inc/swmodule.hxx
@@ -262,7 +262,7 @@ inline void SwModule::SetLngSvcEvtListener(
// Access to SwModule, the View and the shell.
-#define SW_MOD() ( *(SwModule**) GetAppData(SHL_WRITER))
+#define SW_MOD() ( *reinterpret_cast<SwModule**>(GetAppData(SHL_WRITER)))
SW_DLLPUBLIC SwView* GetActiveView();
SW_DLLPUBLIC SwWrtShell* GetActiveWrtShell();
diff --git a/sw/source/core/attr/format.cxx b/sw/source/core/attr/format.cxx
index 4f4fe078c40b..3e32dfef9713 100644
--- a/sw/source/core/attr/format.cxx
+++ b/sw/source/core/attr/format.cxx
@@ -265,7 +265,7 @@ void SwFmt::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue )
{
// If the dying object is the parent format of this format so
// attach this to the parent of the parent
- SwFmt* pFmt = (SwFmt*) static_cast<const SwPtrMsgPoolItem*>(pNewValue)->pObject;
+ SwFmt* pFmt = static_cast<SwFmt*>(static_cast<const SwPtrMsgPoolItem*>(pNewValue)->pObject);
// do not move if this is the topmost format
if( GetRegisteredIn() && GetRegisteredIn() == pFmt )
diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx
index 0bcc24ca2251..0801e37bf13e 100644
--- a/sw/source/core/bastyp/calc.cxx
+++ b/sw/source/core/bastyp/calc.cxx
@@ -178,11 +178,11 @@ _CalcOp* FindOperator( const OUString& rSrch )
aSrch.pUName = &rSrch;
aSrch.eOp = CALC_NAME;
- return (_CalcOp*)bsearch( (void*) &aSrch,
+ return static_cast<_CalcOp*>(bsearch( (void*) &aSrch,
(void*) aOpTable,
sizeof( aOpTable ) / sizeof( _CalcOp ),
sizeof( _CalcOp ),
- OperatorCompare );
+ OperatorCompare ));
}
SwHash* Find( const OUString& rStr, SwHash* const * ppTable,
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index d6e1c163e1f1..136d3c6490f9 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -3434,7 +3434,7 @@ void DocumentContentOperationsManager::CopyFlyInFlyImpl(
*/
bool DocumentContentOperationsManager::lcl_RstTxtAttr( const SwNodePtr& rpNd, void* pArgs )
{
- ParaRstFmt* pPara = (ParaRstFmt*)pArgs;
+ ParaRstFmt* pPara = static_cast<ParaRstFmt*>(pArgs);
SwTxtNode * pTxtNode = (SwTxtNode*)rpNd->GetTxtNode();
if( pTxtNode && pTxtNode->GetpSwpHints() )
{
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index bff85d071105..505f284ff676 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -1089,7 +1089,7 @@ sal_uInt16 SwDoc::GetRefMarks( std::vector<OUString>* pNames ) const
static bool lcl_SpellAndGrammarAgain( const SwNodePtr& rpNd, void* pArgs )
{
SwTxtNode *pTxtNode = (SwTxtNode*)rpNd->GetTxtNode();
- bool bOnlyWrong = *(sal_Bool*)pArgs;
+ bool bOnlyWrong = *static_cast<sal_Bool*>(pArgs);
if( pTxtNode )
{
if( bOnlyWrong )
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index 2c090460a8a5..4a59df7c5ae0 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -731,7 +731,7 @@ static bool lcl_HyphenateNode( const SwNodePtr& rpNd, void* pArgs )
{
// Hyphenate returns true if there is a hyphenation point and sets pPam
SwTxtNode *pNode = rpNd->GetTxtNode();
- SwHyphArgs *pHyphArgs = (SwHyphArgs*)pArgs;
+ SwHyphArgs *pHyphArgs = static_cast<SwHyphArgs*>(pArgs);
if( pNode )
{
SwCntntFrm* pCntFrm = pNode->getLayoutFrm( pNode->GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout() );
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 6b339cb4f26a..367e3867be36 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -98,7 +98,7 @@ static void SetTxtFmtCollNext( SwTxtFmtColl* pTxtColl, const SwTxtFmtColl* pDel
static bool lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs )
{
- const sw::DocumentContentOperationsManager::ParaRstFmt* pPara = (sw::DocumentContentOperationsManager::ParaRstFmt*)pArgs;
+ const sw::DocumentContentOperationsManager::ParaRstFmt* pPara = static_cast<sw::DocumentContentOperationsManager::ParaRstFmt*>(pArgs);
SwCntntNode* pNode = (SwCntntNode*)rpNd->GetCntntNode();
if( pNode && pNode->HasSwAttrSet() )
{
diff --git a/sw/source/core/doc/swserv.cxx b/sw/source/core/doc/swserv.cxx
index c98632080061..9a874c68062a 100644
--- a/sw/source/core/doc/swserv.cxx
+++ b/sw/source/core/doc/swserv.cxx
@@ -95,7 +95,7 @@ bool SwServerObject::GetData( uno::Any & rData,
{
aMemStm.WriteChar( '\0' ); // append a zero char
rData <<= uno::Sequence< sal_Int8 >(
- (sal_Int8*)aMemStm.GetData(),
+ static_cast<sal_Int8 const *>(aMemStm.GetData()),
aMemStm.Seek( STREAM_SEEK_TO_END ) );
bRet = true;
}
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 0c075b2a4b1c..876b5803515d 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -2984,7 +2984,7 @@ bool SwCollectTblLineBoxes::Resize( sal_uInt16 nOffset, sal_uInt16 nOldWidth )
bool sw_Line_CollectBox( const SwTableLine*& rpLine, void* pPara )
{
- SwCollectTblLineBoxes* pSplPara = (SwCollectTblLineBoxes*)pPara;
+ SwCollectTblLineBoxes* pSplPara = static_cast<SwCollectTblLineBoxes*>(pPara);
if( pSplPara->IsGetValues() )
for( SwTableBoxes::iterator it = const_cast<SwTableLine*>(rpLine)->GetTabBoxes().begin();
it != const_cast<SwTableLine*>(rpLine)->GetTabBoxes().end(); ++it)
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index 587e748185f2..d0ba45661522 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -1415,7 +1415,7 @@ struct HighLevel
static bool lcl_HighestLevel( const SwNodePtr& rpNode, void * pPara )
{
- HighLevel * pHL = (HighLevel*)pPara;
+ HighLevel * pHL = static_cast<HighLevel*>(pPara);
if( rpNode->GetStartNode() )
pHL->nLevel++;
else if( rpNode->GetEndNode() )
diff --git a/sw/source/core/edit/edglss.cxx b/sw/source/core/edit/edglss.cxx
index 281c3e55ae7e..80c5729906f1 100644
--- a/sw/source/core/edit/edglss.cxx
+++ b/sw/source/core/edit/edglss.cxx
@@ -325,7 +325,7 @@ bool SwEditShell::GetSelectedText( OUString &rBuf, int nHndlParaBrk )
{
aStream.WriteUInt16( '\0' );
- const sal_Unicode *p = (sal_Unicode*)aStream.GetBuffer();
+ const sal_Unicode *p = static_cast<sal_Unicode const *>(aStream.GetBuffer());
if (p)
rBuf = OUString(p);
else
diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx
index de71ac62a82f..e3d1572c3b40 100644
--- a/sw/source/core/edit/edlingu.cxx
+++ b/sw/source/core/edit/edlingu.cxx
@@ -414,8 +414,8 @@ uno::Any SwConvIter::Continue( sal_uInt16* pPageCnt, sal_uInt16* pPageSt )
bool SwHyphIter::IsAuto()
{
uno::Reference< beans::XPropertySet > xProp( ::GetLinguPropertySet() );
- return xProp.is() && *(sal_Bool*)xProp->getPropertyValue(
- OUString(UPN_IS_HYPH_AUTO) ).getValue();
+ return xProp.is() && *static_cast<sal_Bool const *>(xProp->getPropertyValue(
+ OUString(UPN_IS_HYPH_AUTO) ).getValue());
}
void SwHyphIter::ShowSelection()
diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx
index 2e9ce09de4d1..bb17fbe50b0c 100644
--- a/sw/source/core/fields/authfld.cxx
+++ b/sw/source/core/fields/authfld.cxx
@@ -438,10 +438,10 @@ bool SwAuthorityFieldType::PutValue( const Any& rAny, sal_uInt16 nWhichId )
break;
}
case FIELD_PROP_BOOL1:
- m_bIsSequence = *(sal_Bool*)rAny.getValue();
+ m_bIsSequence = *static_cast<sal_Bool const *>(rAny.getValue());
break;
case FIELD_PROP_BOOL2:
- m_bSortByDocument = *(sal_Bool*)rAny.getValue();
+ m_bSortByDocument = *static_cast<sal_Bool const *>(rAny.getValue());
break;
case FIELD_PROP_LOCALE:
@@ -475,7 +475,7 @@ bool SwAuthorityFieldType::PutValue( const Any& rAny, sal_uInt16 nWhichId )
}
else if(pValue[j].Name == UNO_NAME_IS_SORT_ASCENDING)
{
- pSortKey->bSortAscending = *(sal_Bool*)pValue[j].Value.getValue();
+ pSortKey->bSortAscending = *static_cast<sal_Bool const *>(pValue[j].Value.getValue());
}
}
m_SortKeyArr.push_back(pSortKey);
diff --git a/sw/source/core/fields/cellfml.cxx b/sw/source/core/fields/cellfml.cxx
index 06448d60cdf7..a75c57d6d7fa 100644
--- a/sw/source/core/fields/cellfml.cxx
+++ b/sw/source/core/fields/cellfml.cxx
@@ -313,7 +313,7 @@ SwTableFormula::~SwTableFormula()
void SwTableFormula::_MakeFormula( const SwTable& rTbl, OUString& rNewStr,
OUString& rFirstBox, OUString* pLastBox, void* pPara ) const
{
- SwTblCalcPara* pCalcPara = (SwTblCalcPara*)pPara;
+ SwTblCalcPara* pCalcPara = static_cast<SwTblCalcPara*>(pPara);
if( pCalcPara->rCalc.IsCalcError() ) // stop if there is already an error set
return;
@@ -379,7 +379,7 @@ void SwTableFormula::RelNmsToBoxNms( const SwTable& rTbl, OUString& rNewStr,
OUString& rFirstBox, OUString* pLastBox, void* pPara ) const
{
// relative name w.r.t. box name (external presentation)
- SwNode* pNd = (SwNode*)pPara;
+ SwNode* pNd = static_cast<SwNode*>(pPara);
OSL_ENSURE( pNd, "Feld steht in keinem TextNode" );
const SwTableBox *pBox = rTbl.GetTblBox(
pNd->FindTableBoxStartNode()->GetIndex() );
@@ -412,7 +412,7 @@ void SwTableFormula::RelBoxNmsToPtr( const SwTable& rTbl, OUString& rNewStr,
OUString& rFirstBox, OUString* pLastBox, void* pPara ) const
{
// relative name w.r.t. box name (internal presentation)
- SwNode* pNd = (SwNode*)pPara;
+ SwNode* pNd = static_cast<SwNode*>(pPara);
OSL_ENSURE( pNd, "Field not placed in any Node" );
const SwTableBox *pBox = rTbl.GetTblBox(
pNd->FindTableBoxStartNode()->GetIndex() );
@@ -444,7 +444,7 @@ void SwTableFormula::BoxNmsToRelNm( const SwTable& rTbl, OUString& rNewStr,
OUString& rFirstBox, OUString* pLastBox, void* pPara ) const
{
// box name (external presentation) w.r.t. relative name
- SwNode* pNd = (SwNode*)pPara;
+ SwNode* pNd = static_cast<SwNode*>(pPara);
OSL_ENSURE( pNd, "Field not placed in any Node" );
const SwTableNode* pTblNd = pNd->FindTableNode();
@@ -883,7 +883,7 @@ void SwTableFormula::GetBoxesOfFormula( const SwTable& rTbl,
void SwTableFormula::_GetFmlBoxes( const SwTable& rTbl, OUString& ,
OUString& rFirstBox, OUString* pLastBox, void* pPara ) const
{
- SwSelBoxes* pBoxes = (SwSelBoxes*)pPara;
+ SwSelBoxes* pBoxes = static_cast<SwSelBoxes*>(pPara);
SwTableBox* pEndBox = 0;
rFirstBox = rFirstBox.copy(1); // delete box label
@@ -973,7 +973,7 @@ void SwTableFormula::GetBoxes( const SwTableBox& rSttBox,
void SwTableFormula::_HasValidBoxes( const SwTable& rTbl, OUString& ,
OUString& rFirstBox, OUString* pLastBox, void* pPara ) const
{
- bool* pBValid = (bool*)pPara;
+ bool* pBValid = static_cast<bool*>(pPara);
if( *pBValid ) // wrong is wrong
{
SwTableBox* pSttBox = 0, *pEndBox = 0;
@@ -1044,7 +1044,7 @@ sal_uInt16 SwTableFormula::GetLnPosInTbl( const SwTable& rTbl, const SwTableBox*
void SwTableFormula::_SplitMergeBoxNm( const SwTable& rTbl, OUString& rNewStr,
OUString& rFirstBox, OUString* pLastBox, void* pPara ) const
{
- SwTableFmlUpdate& rTblUpd = *(SwTableFmlUpdate*)pPara;
+ SwTableFmlUpdate& rTblUpd = *static_cast<SwTableFmlUpdate*>(pPara);
rNewStr += OUString(rFirstBox[0]); // get label for the box
rFirstBox = rFirstBox.copy(1);
diff --git a/sw/source/core/fields/dbfld.cxx b/sw/source/core/fields/dbfld.cxx
index 0d2f01a3668d..ae66fb925b67 100644
--- a/sw/source/core/fields/dbfld.cxx
+++ b/sw/source/core/fields/dbfld.cxx
@@ -391,7 +391,7 @@ bool SwDBField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
switch( nWhichId )
{
case FIELD_PROP_BOOL1:
- if( *(sal_Bool*)rAny.getValue() )
+ if( *static_cast<sal_Bool const *>(rAny.getValue()) )
SetSubType(GetSubType()&~nsSwExtendedSubType::SUB_OWN_FMT);
else
SetSubType(GetSubType()|nsSwExtendedSubType::SUB_OWN_FMT);
diff --git a/sw/source/core/fields/ddefld.cxx b/sw/source/core/fields/ddefld.cxx
index 025ecc3deb82..376f7ac2d7c4 100644
--- a/sw/source/core/fields/ddefld.cxx
+++ b/sw/source/core/fields/ddefld.cxx
@@ -341,7 +341,7 @@ bool SwDDEFieldType::PutValue( const uno::Any& rVal, sal_uInt16 nWhichId )
case FIELD_PROP_PAR4: nPart = 1; break;
case FIELD_PROP_SUBTYPE: nPart = 0; break;
case FIELD_PROP_BOOL1:
- SetType( *(sal_Bool*)rVal.getValue() ?
+ SetType( *static_cast<sal_Bool const *>(rVal.getValue()) ?
SfxLinkUpdateMode::ALWAYS :
SfxLinkUpdateMode::ONCALL );
break;
diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx
index 27848b0aa771..f99ad3eb3899 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -385,11 +385,11 @@ bool SwAuthorField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
switch( nWhichId )
{
case FIELD_PROP_BOOL1:
- SetFormat( *(sal_Bool*)rAny.getValue() ? AF_NAME : AF_SHORTCUT );
+ SetFormat( *static_cast<sal_Bool const *>(rAny.getValue()) ? AF_NAME : AF_SHORTCUT );
break;
case FIELD_PROP_BOOL2:
- if( *(sal_Bool*)rAny.getValue() )
+ if( *static_cast<sal_Bool const *>(rAny.getValue()) )
SetFormat( GetFormat() | AF_FIXED);
else
SetFormat( GetFormat() & ~AF_FIXED);
@@ -561,7 +561,7 @@ bool SwFileNameField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
break;
case FIELD_PROP_BOOL2:
- if( *(sal_Bool*)rAny.getValue() )
+ if( *static_cast<sal_Bool const *>(rAny.getValue()) )
SetFormat( GetFormat() | FF_FIXED);
else
SetFormat( GetFormat() & ~FF_FIXED);
@@ -1229,7 +1229,7 @@ bool SwDocInfoField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
break;
case FIELD_PROP_BOOL1:
- if(*(sal_Bool*)rAny.getValue())
+ if(*static_cast<sal_Bool const *>(rAny.getValue()))
nSubType |= DI_SUB_FIXED;
else
nSubType &= ~DI_SUB_FIXED;
@@ -1247,7 +1247,7 @@ bool SwDocInfoField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
break;
case FIELD_PROP_BOOL2:
nSubType &= 0xf0ff;
- if(*(sal_Bool*)rAny.getValue())
+ if(*static_cast<sal_Bool const *>(rAny.getValue()))
nSubType |= DI_SUB_DATE;
else
nSubType |= DI_SUB_TIME;
@@ -1506,7 +1506,7 @@ bool SwHiddenTxtField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
rAny >>= aFALSETxt;
break;
case FIELD_PROP_BOOL1:
- bIsHidden = *(sal_Bool*)rAny.getValue();
+ bIsHidden = *static_cast<sal_Bool const *>(rAny.getValue());
break;
case FIELD_PROP_PAR4:
rAny >>= aContent;
@@ -1605,7 +1605,7 @@ bool SwHiddenParaField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
rAny >>= aCond;
break;
case FIELD_PROP_BOOL1:
- bIsHidden = *(sal_Bool*)rAny.getValue();
+ bIsHidden = *static_cast<sal_Bool const *>(rAny.getValue());
break;
default:
@@ -1815,7 +1815,7 @@ bool SwPostItField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
case FIELD_PROP_DATE:
if( rAny.getValueType() == ::cppu::UnoType<util::Date>::get() )
{
- util::Date aSetDate = *(util::Date*)rAny.getValue();
+ util::Date aSetDate = *static_cast<util::Date const *>(rAny.getValue());
aDateTime = Date(aSetDate.Day, aSetDate.Month, aSetDate.Year);
}
break;
@@ -1952,7 +1952,7 @@ bool SwExtUserField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
}
break;
case FIELD_PROP_BOOL1:
- if( *(sal_Bool*)rAny.getValue() )
+ if( *static_cast<sal_Bool const *>(rAny.getValue()) )
SetFormat(GetFormat() | AF_FIXED);
else
SetFormat(GetFormat() & ~AF_FIXED);
@@ -2029,7 +2029,7 @@ bool SwRefPageSetField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
switch( nWhichId )
{
case FIELD_PROP_BOOL1:
- bOn = *(sal_Bool*)rAny.getValue();
+ bOn = *static_cast<sal_Bool const *>(rAny.getValue());
break;
case FIELD_PROP_USHORT1:
rAny >>=nOffset;
diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx
index 3d8eb129bb4a..94b99af0d08a 100644
--- a/sw/source/core/fields/expfld.cxx
+++ b/sw/source/core/fields/expfld.cxx
@@ -443,7 +443,7 @@ bool SwGetExpField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
switch( nWhichId )
{
case FIELD_PROP_DOUBLE:
- SwValueField::SetValue(*(double*) rAny.getValue());
+ SwValueField::SetValue(*static_cast<double const *>(rAny.getValue()));
break;
case FIELD_PROP_FORMAT:
rAny >>= nTmp;
@@ -466,7 +466,7 @@ bool SwGetExpField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
SetSubType( static_cast<sal_uInt16>((GetSubType() & 0xff00) | nTmp));
break;
case FIELD_PROP_BOOL2:
- if(*(sal_Bool*) rAny.getValue())
+ if(*static_cast<sal_Bool const *>(rAny.getValue()))
nSubType |= nsSwExtendedSubType::SUB_CMD;
else
nSubType &= (~nsSwExtendedSubType::SUB_CMD);
@@ -967,7 +967,7 @@ bool SwSetExpField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
switch( nWhichId )
{
case FIELD_PROP_BOOL2:
- if(*(sal_Bool*)rAny.getValue())
+ if(*static_cast<sal_Bool const *>(rAny.getValue()))
nSubType &= ~nsSwExtendedSubType::SUB_INVISIBLE;
else
nSubType |= nsSwExtendedSubType::SUB_INVISIBLE;
@@ -1025,13 +1025,13 @@ bool SwSetExpField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
rAny >>= aPText;
break;
case FIELD_PROP_BOOL3:
- if(*(sal_Bool*) rAny.getValue())
+ if(*static_cast<sal_Bool const *>(rAny.getValue()))
nSubType |= nsSwExtendedSubType::SUB_CMD;
else
nSubType &= (~nsSwExtendedSubType::SUB_CMD);
break;
case FIELD_PROP_BOOL1:
- SetInputFlag(*(sal_Bool*) rAny.getValue());
+ SetInputFlag(*static_cast<sal_Bool const *>(rAny.getValue()));
break;
case FIELD_PROP_PAR4:
{
diff --git a/sw/source/core/fields/flddat.cxx b/sw/source/core/fields/flddat.cxx
index 2df1dd1afc53..0b23799b5b34 100644
--- a/sw/source/core/fields/flddat.cxx
+++ b/sw/source/core/fields/flddat.cxx
@@ -193,14 +193,14 @@ bool SwDateTimeField::PutValue( const uno::Any& rVal, sal_uInt16 nWhichId )
switch( nWhichId )
{
case FIELD_PROP_BOOL1:
- if(*(sal_Bool*)rVal.getValue())
+ if(*static_cast<sal_Bool const *>(rVal.getValue()))
nSubType |= FIXEDFLD;
else
nSubType &= ~FIXEDFLD;
break;
case FIELD_PROP_BOOL2:
nSubType &= ~(DATEFLD|TIMEFLD);
- nSubType |= *(sal_Bool*)rVal.getValue() ? DATEFLD : TIMEFLD;
+ nSubType |= *static_cast<sal_Bool const *>(rVal.getValue()) ? DATEFLD : TIMEFLD;
break;
case FIELD_PROP_FORMAT:
rVal >>= nTmp;
diff --git a/sw/source/core/fields/scrptfld.cxx b/sw/source/core/fields/scrptfld.cxx
index 17473b5926ce..e746c822420f 100644
--- a/sw/source/core/fields/scrptfld.cxx
+++ b/sw/source/core/fields/scrptfld.cxx
@@ -107,7 +107,7 @@ bool SwScriptField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
rAny >>= sCode;
break;
case FIELD_PROP_BOOL1:
- bCodeURL = *(sal_Bool*)rAny.getValue();
+ bCodeURL = *static_cast<sal_Bool const *>(rAny.getValue());
break;
default:
OSL_FAIL("illegal property");
diff --git a/sw/source/core/fields/tblcalc.cxx b/sw/source/core/fields/tblcalc.cxx
index ec822963c409..29d878eab40b 100644
--- a/sw/source/core/fields/tblcalc.cxx
+++ b/sw/source/core/fields/tblcalc.cxx
@@ -188,7 +188,7 @@ bool SwTblField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
}
break;
case FIELD_PROP_BOOL1:
- if(*(sal_Bool*)rAny.getValue())
+ if(*static_cast<sal_Bool const *>(rAny.getValue()))
nSubType = nsSwGetSetExpType::GSE_FORMULA|nsSwExtendedSubType::SUB_CMD;
else
nSubType = nsSwGetSetExpType::GSE_FORMULA;
diff --git a/sw/source/core/fields/usrfld.cxx b/sw/source/core/fields/usrfld.cxx
index 90503cc4e3ff..b8aad8a1b1f0 100644
--- a/sw/source/core/fields/usrfld.cxx
+++ b/sw/source/core/fields/usrfld.cxx
@@ -127,13 +127,13 @@ bool SwUserField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
switch( nWhichId )
{
case FIELD_PROP_BOOL1:
- if(*(sal_Bool*) rAny.getValue())
+ if(*static_cast<sal_Bool const *>(rAny.getValue()))
nSubType &= (~nsSwExtendedSubType::SUB_INVISIBLE);
else
nSubType |= nsSwExtendedSubType::SUB_INVISIBLE;
break;
case FIELD_PROP_BOOL2:
- if(*(sal_Bool*) rAny.getValue())
+ if(*static_cast<sal_Bool const *>(rAny.getValue()))
nSubType |= nsSwExtendedSubType::SUB_CMD;
else
nSubType &= (~nsSwExtendedSubType::SUB_CMD);
@@ -312,7 +312,7 @@ bool SwUserFieldType::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
rAny >>= aContent;
break;
case FIELD_PROP_BOOL1:
- if(*(sal_Bool*)rAny.getValue())
+ if(*static_cast<sal_Bool const *>(rAny.getValue()))
{
nType |= nsSwGetSetExpType::GSE_EXPR;
nType &= ~nsSwGetSetExpType::GSE_STRING;
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index a3555a2fe8b6..80fd4d1487a0 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -1647,7 +1647,7 @@ ObjCntType SwFEShell::GetObjCntType( const SdrObject& rObj ) const
{
beans::Property xProperty = xInfo->getPropertyByName( sName );
aVal = xSet->getPropertyValue( sName );
- if( aVal.getValue() && form::FormButtonType_URL == *((form::FormButtonType*)aVal.getValue()) )
+ if( aVal.getValue() && form::FormButtonType_URL == *static_cast<form::FormButtonType const *>(aVal.getValue()) )
eType = OBJCNT_URLBUTTON;
}
}
diff --git a/sw/source/core/graphic/grfatr.cxx b/sw/source/core/graphic/grfatr.cxx
index 55c732191bf1..8f8a577e2f76 100644
--- a/sw/source/core/graphic/grfatr.cxx
+++ b/sw/source/core/graphic/grfatr.cxx
@@ -102,7 +102,7 @@ bool SwMirrorGrf::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
bool SwMirrorGrf::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
bool bRet = true;
- bool bVal = *(sal_Bool*)rVal.getValue();
+ bool bVal = *static_cast<sal_Bool const *>(rVal.getValue());
// vertical and horizontal were swapped at some point
nMemberId &= ~CONVERT_TWIPS;
switch ( nMemberId )
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index fbe2e323b54c..7f47dd7a3bf8 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -328,7 +328,7 @@ bool SwFmtFrmSize::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
break;
case MID_FRMSIZE_IS_SYNC_HEIGHT_TO_WIDTH:
{
- bool bSet = *(sal_Bool*)rVal.getValue();
+ bool bSet = *static_cast<sal_Bool const *>(rVal.getValue());
if(bSet)
SetHeightPercent(0xff);
else if( 0xff == GetHeightPercent() )
@@ -337,7 +337,7 @@ bool SwFmtFrmSize::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
break;
case MID_FRMSIZE_IS_SYNC_WIDTH_TO_HEIGHT:
{
- bool bSet = *(sal_Bool*)rVal.getValue();
+ bool bSet = *static_cast<sal_Bool const *>(rVal.getValue());
if(bSet)
SetWidthPercent(0xff);
else if( 0xff == GetWidthPercent() )
@@ -387,7 +387,7 @@ bool SwFmtFrmSize::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
break;
case MID_FRMSIZE_IS_AUTO_HEIGHT:
{
- bool bSet = *(sal_Bool*)rVal.getValue();
+ bool bSet = *static_cast<sal_Bool const *>(rVal.getValue());
SetHeightSizeType(bSet ? ATT_VAR_SIZE : ATT_FIX_SIZE);
}
break;
@@ -1270,13 +1270,13 @@ bool SwFmtSurround::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
break;
case MID_SURROUND_ANCHORONLY:
- SetAnchorOnly( *(sal_Bool*)rVal.getValue() );
+ SetAnchorOnly( *static_cast<sal_Bool const *>(rVal.getValue()) );
break;
case MID_SURROUND_CONTOUR:
- SetContour( *(sal_Bool*)rVal.getValue() );
+ SetContour( *static_cast<sal_Bool const *>(rVal.getValue()) );
break;
case MID_SURROUND_CONTOUROUTSIDE:
- SetOutside( *(sal_Bool*)rVal.getValue() );
+ SetOutside( *static_cast<sal_Bool const *>(rVal.getValue()) );
break;
default:
OSL_ENSURE( false, "unknown MemberId" );
@@ -1506,7 +1506,7 @@ bool SwFmtHoriOrient::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
}
break;
case MID_HORIORIENT_PAGETOGGLE:
- SetPosToggle( *(sal_Bool*)rVal.getValue());
+ SetPosToggle( *static_cast<sal_Bool const *>(rVal.getValue()));
break;
default:
OSL_ENSURE( false, "unknown MemberId" );
@@ -1895,7 +1895,7 @@ bool SwFmtURL::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
}
break;
case MID_URL_SERVERMAP:
- bIsServerMap = *(sal_Bool*)rVal.getValue();
+ bIsServerMap = *static_cast<sal_Bool const *>(rVal.getValue());
break;
default:
OSL_ENSURE( false, "unknown MemberId" );
@@ -1991,7 +1991,7 @@ bool SwFmtFtnEndAtTxtEnd::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
case MID_COLLECT :
{
- bool bVal = *(sal_Bool*)rVal.getValue();
+ bool bVal = *static_cast<sal_Bool const *>(rVal.getValue());
if(!bVal && GetValue() >= FTNEND_ATTXTEND)
SetValue(FTNEND_ATPGORDOCEND);
else if(bVal && GetValue() < FTNEND_ATTXTEND)
@@ -2000,7 +2000,7 @@ bool SwFmtFtnEndAtTxtEnd::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
break;
case MID_RESTART_NUM :
{
- bool bVal = *(sal_Bool*)rVal.getValue();
+ bool bVal = *static_cast<sal_Bool const *>(rVal.getValue());
if(!bVal && GetValue() >= FTNEND_ATTXTEND_OWNNUMSEQ)
SetValue(FTNEND_ATTXTEND);
else if(bVal && GetValue() < FTNEND_ATTXTEND_OWNNUMSEQ)
@@ -2019,7 +2019,7 @@ bool SwFmtFtnEndAtTxtEnd::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
break;
case MID_OWN_NUM :
{
- bool bVal = *(sal_Bool*)rVal.getValue();
+ bool bVal = *static_cast<sal_Bool const *>(rVal.getValue());
if(!bVal && GetValue() >= FTNEND_ATTXTEND_OWNNUMANDFMT)
SetValue(FTNEND_ATTXTEND_OWNNUMSEQ);
else if(bVal && GetValue() < FTNEND_ATTXTEND_OWNNUMANDFMT)
@@ -2191,7 +2191,7 @@ bool SwFmtLineNumber::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
switch ( nMemberId )
{
case MID_LINENUMBER_COUNT:
- SetCountLines( *(sal_Bool*)rVal.getValue() );
+ SetCountLines( *static_cast<sal_Bool const *>(rVal.getValue()) );
break;
case MID_LINENUMBER_STARTVALUE:
{
@@ -2353,13 +2353,13 @@ bool SwTextGridItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
}
break;
case MID_GRID_RUBY_BELOW:
- SetRubyTextBelow( *(sal_Bool*)rVal.getValue() );
+ SetRubyTextBelow( *static_cast<sal_Bool const *>(rVal.getValue()) );
break;
case MID_GRID_PRINT:
- SetPrintGrid( *(sal_Bool*)rVal.getValue() );
+ SetPrintGrid( *static_cast<sal_Bool const *>(rVal.getValue()) );
break;
case MID_GRID_DISPLAY:
- SetDisplayGrid( *(sal_Bool*)rVal.getValue() );
+ SetDisplayGrid( *static_cast<sal_Bool const *>(rVal.getValue()) );
break;
case MID_GRID_BASEHEIGHT:
case MID_GRID_BASEWIDTH:
@@ -2418,11 +2418,11 @@ bool SwTextGridItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
break;
}
case MID_GRID_SNAPTOCHARS:
- SetSnapToChars( *(sal_Bool*)rVal.getValue() );
+ SetSnapToChars( *static_cast<sal_Bool const *>(rVal.getValue()) );
break;
case MID_GRID_STANDARD_MODE:
{
- bool bStandard = *(sal_Bool*)rVal.getValue();
+ bool bStandard = *static_cast<sal_Bool const *>(rVal.getValue());
SetSquaredMode( !bStandard );
break;
}
diff --git a/sw/source/core/layout/dbg_lay.cxx b/sw/source/core/layout/dbg_lay.cxx
index aae12b31e760..c24d63771381 100644
--- a/sw/source/core/layout/dbg_lay.cxx
+++ b/sw/source/core/layout/dbg_lay.cxx
@@ -549,7 +549,7 @@ void SwImplProtocol::_Record( const SwFrm* pFrm, sal_uLong nFunction, sal_uLong
if( pParam )
{
aOut.append(' ');
- aOut.append(static_cast<sal_Int32>(*((sal_uInt16*)pParam)));
+ aOut.append(static_cast<sal_Int32>(*static_cast<sal_uInt16*>(pParam)));
}
break;
case PROT_GROW_TST: if( ACT_START != nAct )
@@ -576,7 +576,7 @@ void SwImplProtocol::_Record( const SwFrm* pFrm, sal_uLong nFunction, sal_uLong
if( pParam )
{
aOut.append(' ');
- aOut.append(static_cast<sal_Int64>(*((long*)pParam)));
+ aOut.append(static_cast<sal_Int64>(*static_cast<long*>(pParam)));
}
break;
case PROT_POS: break;
@@ -594,7 +594,7 @@ void SwImplProtocol::_Record( const SwFrm* pFrm, sal_uLong nFunction, sal_uLong
if( pParam )
{
aOut.append(' ');
- aOut.append(static_cast<sal_Int64>(lcl_GetFrameId((SwFrm*)pParam)));
+ aOut.append(static_cast<sal_Int64>(lcl_GetFrameId(static_cast<SwFrm*>(pParam))));
}
break;
case PROT_FILE_INIT: FileInit();
@@ -608,7 +608,7 @@ void SwImplProtocol::_Record( const SwFrm* pFrm, sal_uLong nFunction, sal_uLong
aOut.append("Cut from ");
else
aOut.append("Paste to ");
- aOut.append(static_cast<sal_Int64>(lcl_GetFrameId((SwFrm*)pParam)));
+ aOut.append(static_cast<sal_Int64>(lcl_GetFrameId(static_cast<SwFrm*>(pParam))));
break;
case PROT_TESTFORMAT:
aOut.append("Test");
@@ -620,7 +620,7 @@ void SwImplProtocol::_Record( const SwFrm* pFrm, sal_uLong nFunction, sal_uLong
break;
case PROT_FRMCHANGES:
{
- SwRect& rFrm = *((SwRect*)pParam);
+ SwRect& rFrm = *static_cast<SwRect*>(pParam);
if( pFrm->Frm().Pos() != rFrm.Pos() )
{
aOut.append("PosChg: (");
@@ -666,7 +666,7 @@ void SwImplProtocol::SectFunc(OStringBuffer &rOut, const SwFrm* , sal_uLong nAct
switch( nAct )
{
case ACT_MERGE: rOut.append("Merge Section ");
- rOut.append(static_cast<sal_Int64>(lcl_GetFrameId((SwFrm*)pParam)));
+ rOut.append(static_cast<sal_Int64>(lcl_GetFrameId(static_cast<SwFrm*>(pParam))));
break;
case ACT_CREATE_MASTER: bTmp = true; // NoBreak
case ACT_CREATE_FOLLOW: rOut.append("Create Section ");
@@ -674,7 +674,7 @@ void SwImplProtocol::SectFunc(OStringBuffer &rOut, const SwFrm* , sal_uLong nAct
rOut.append("Master to ");
else
rOut.append("Follow from ");
- rOut.append(static_cast<sal_Int64>(lcl_GetFrameId((SwFrm*)pParam)));
+ rOut.append(static_cast<sal_Int64>(lcl_GetFrameId(static_cast<SwFrm*>(pParam))));
break;
case ACT_DEL_MASTER: bTmp = true; // NoBreak
case ACT_DEL_FOLLOW: rOut.append("Delete Section ");
@@ -682,7 +682,7 @@ void SwImplProtocol::SectFunc(OStringBuffer &rOut, const SwFrm* , sal_uLong nAct
rOut.append("Master to ");
else
rOut.append("Follow from ");
- rOut.append(static_cast<sal_Int64>(lcl_GetFrameId((SwFrm*)pParam)));
+ rOut.append(static_cast<sal_Int64>(lcl_GetFrameId(static_cast<SwFrm*>(pParam))));
break;
}
}
diff --git a/sw/source/core/layout/dumpfilter.cxx b/sw/source/core/layout/dumpfilter.cxx
index 326491aa9bc1..9060836952c7 100644
--- a/sw/source/core/layout/dumpfilter.cxx
+++ b/sw/source/core/layout/dumpfilter.cxx
@@ -30,7 +30,7 @@ namespace
// Actually write bytes to XOutputSream
try
{
- uno::XInterface* pObj = ( uno::XInterface* )pContext;
+ uno::XInterface* pObj = static_cast<uno::XInterface*>(pContext);
uno::Reference< io::XOutputStream > xOut( pObj, uno::UNO_QUERY_THROW );
// Don't output the terminating \0 to the xml or the file will be invalid
@@ -51,7 +51,7 @@ namespace
int result = 0;
try
{
- uno::XInterface* pObj = ( uno::XInterface* )pContext;
+ uno::XInterface* pObj = static_cast<uno::XInterface*>(pContext);
uno::Reference< io::XOutputStream > xOut( pObj, uno::UNO_QUERY_THROW );
xOut->closeOutput( );
}
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index e96ad045c128..7e4bc12d0000 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -1869,7 +1869,7 @@ SwBorderAttrs::SwBorderAttrs(const SwModify *pMod, const SwFrm *pConstructor)
SwBorderAttrs::~SwBorderAttrs()
{
- ((SwModify*)pOwner)->SetInCache( false );
+ const_cast<SwModify *>(static_cast<SwModify const *>(pOwner))->SetInCache( false );
}
/* All calc methods calculate a safety distance in addition to the values given by the attributes.
@@ -2218,8 +2218,8 @@ SwBorderAttrAccess::SwBorderAttrAccess( SwCache &rCach, const SwFrm *pFrm ) :
SwCacheObj *SwBorderAttrAccess::NewObj()
{
- ((SwModify*)pOwner)->SetInCache( true );
- return new SwBorderAttrs( (SwModify*)pOwner, pConstructor );
+ const_cast<SwModify *>(static_cast<SwModify const *>(pOwner))->SetInCache( true );
+ return new SwBorderAttrs( static_cast<SwModify const *>(pOwner), pConstructor );
}
SwBorderAttrs *SwBorderAttrAccess::Get()
diff --git a/sw/source/core/para/paratr.cxx b/sw/source/core/para/paratr.cxx
index 9fa844661079..1c8657d66c9c 100644
--- a/sw/source/core/para/paratr.cxx
+++ b/sw/source/core/para/paratr.cxx
@@ -188,7 +188,7 @@ bool SwFmtDrop::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
if(rVal.getValueType() == ::cppu::UnoType<style::DropCapFormat>::get())
{
- const style::DropCapFormat* pDrop = (const style::DropCapFormat*)rVal.getValue();
+ const style::DropCapFormat* pDrop = static_cast<const style::DropCapFormat*>(rVal.getValue());
nLines = pDrop->Lines;
nChars = pDrop->Count;
nDistance = convertMm100ToTwip(pDrop->Distance);
@@ -198,7 +198,7 @@ bool SwFmtDrop::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
}
break;
case MID_DROPCAP_WHOLE_WORD:
- bWholeWord = *(sal_Bool*)rVal.getValue();
+ bWholeWord = *static_cast<sal_Bool const *>(rVal.getValue());
break;
case MID_DROPCAP_CHAR_STYLE_NAME :
OSL_FAIL("char format cannot be set in PutValue()!");
diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx
index c756fce12780..312e3cc4db9f 100644
--- a/sw/source/core/text/porfly.cxx
+++ b/sw/source/core/text/porfly.cxx
@@ -207,7 +207,7 @@ void SwFlyCntPortion::Paint( const SwTxtPaintInfo &rInf ) const
{
if( bDraw )
{
- if( !((SwDrawContact*)pContact)->GetAnchorFrm() )
+ if( !static_cast<SwDrawContact*>(pContact)->GetAnchorFrm() )
{
// No direct positioning of the drawing object is needed
SwDrawContact* pDrawContact = static_cast<SwDrawContact*>(pContact);
diff --git a/sw/source/core/text/porfly.hxx b/sw/source/core/text/porfly.hxx
index 31be954e9e1d..c4db0a6e0e93 100644
--- a/sw/source/core/text/porfly.hxx
+++ b/sw/source/core/text/porfly.hxx
@@ -63,12 +63,12 @@ public:
long nAscent, long nDescent, long nFlyAsc, long nFlyDesc,
objectpositioning::AsCharFlags nFlags );
inline const Point& GetRefPoint() const { return aRef; }
- inline SwFlyInCntFrm *GetFlyFrm() { return (SwFlyInCntFrm*)pContact; }
+ inline SwFlyInCntFrm *GetFlyFrm() { return static_cast<SwFlyInCntFrm*>(pContact); }
inline const SwFlyInCntFrm *GetFlyFrm() const
- { return (SwFlyInCntFrm*)pContact; }
- inline SwDrawContact *GetDrawContact() { return (SwDrawContact*)pContact; }
+ { return static_cast<SwFlyInCntFrm*>(pContact); }
+ inline SwDrawContact *GetDrawContact() { return static_cast<SwDrawContact*>(pContact); }
inline const SwDrawContact* GetDrawContact() const
- { return (SwDrawContact*)pContact; }
+ { return static_cast<SwDrawContact*>(pContact); }
inline bool IsDraw() const { return bDraw; }
inline bool IsMax() const { return bMax; }
inline sal_uInt8 GetAlign() const { return nAlign; }
diff --git a/sw/source/core/text/txtcache.cxx b/sw/source/core/text/txtcache.cxx
index 972b68e763a3..51d442cb1ab1 100644
--- a/sw/source/core/text/txtcache.cxx
+++ b/sw/source/core/text/txtcache.cxx
@@ -34,7 +34,7 @@ SwTxtLine::~SwTxtLine()
SwCacheObj *SwTxtLineAccess::NewObj()
{
- return new SwTxtLine( (SwTxtFrm*)pOwner );
+ return new SwTxtLine( const_cast<SwTxtFrm *>(static_cast<SwTxtFrm const *>(pOwner)) );
}
SwParaPortion *SwTxtLineAccess::GetPara()
@@ -45,7 +45,7 @@ SwParaPortion *SwTxtLineAccess::GetPara()
else
{
pRet = static_cast<SwTxtLine*>(Get());
- ((SwTxtFrm*)pOwner)->SetCacheIdx( pRet->GetCachePos() );
+ const_cast<SwTxtFrm *>(static_cast<SwTxtFrm const *>(pOwner))->SetCacheIdx( pRet->GetCachePos() );
}
if ( !pRet->GetPara() )
pRet->SetPara( new SwParaPortion );
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index 11eb66c57d7b..ca4b6e3b951c 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -1539,12 +1539,12 @@ void SwTxtFrm::Prepare( const PrepareHint ePrep, const void* pVoid,
if( pPara->IsPrepMustFit() )
return;
// see comment in WidowsAndOrphans::FindOrphans and CalcPreps()
- PrepWidows( *(const sal_uInt16 *)pVoid, bNotify );
+ PrepWidows( *static_cast<const sal_uInt16 *>(pVoid), bNotify );
break;
case PREP_FTN :
{
- SwTxtFtn *pFtn = (SwTxtFtn *)pVoid;
+ SwTxtFtn const *pFtn = static_cast<SwTxtFtn const *>(pVoid);
if( IsInFtn() )
{
// Am I the first TxtFrm of a footnote?
@@ -1764,7 +1764,7 @@ void SwTxtFrm::Prepare( const PrepareHint ePrep, const void* pVoid,
{
if( pVoid )
{
- sal_Int32 nWhere = CalcFlyPos( (SwFrmFmt*)pVoid );
+ sal_Int32 nWhere = CalcFlyPos( const_cast<SwFrmFmt *>(static_cast<SwFrmFmt const *>(pVoid)) );
OSL_ENSURE( COMPLETE_STRING != nWhere, "Prepare: Why me?" );
InvalidateRange( SwCharRange( nWhere, 1 ) );
return;
diff --git a/sw/source/core/txtnode/fmtatr2.cxx b/sw/source/core/txtnode/fmtatr2.cxx
index bfba29307670..8922211b3c09 100644
--- a/sw/source/core/txtnode/fmtatr2.cxx
+++ b/sw/source/core/txtnode/fmtatr2.cxx
@@ -499,7 +499,7 @@ bool SwFmtRuby::PutValue( const uno::Any& rVal,
const uno::Type& rType = ::getBooleanCppuType();
if(rVal.hasValue() && rVal.getValueType() == rType)
{
- bool bAbove = *(sal_Bool*)rVal.getValue();
+ bool bAbove = *static_cast<sal_Bool const *>(rVal.getValue());
nPosition = bAbove ? 0 : 1;
}
}
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index 9ba646dcd282..05230811b4dc 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -2229,7 +2229,7 @@ SwFntAccess::SwFntAccess( const void* &rMagic,
if ( ( pFntObj->GetZoom( ) == nZoom ) &&
( pFntObj->pPrinter == pOut ) &&
pFntObj->GetPropWidth() ==
- ((SwSubFont*)pOwn)->GetPropWidth() )
+ static_cast<SwSubFont const *>(pOwn)->GetPropWidth() )
{
return; // result of Check: Drucker+Zoom okay.
}
@@ -2240,10 +2240,10 @@ SwFntAccess::SwFntAccess( const void* &rMagic,
// Search by font comparison, quite expensive!
// Look for same font and same printer
pFntObj = pFntCache->First();
- while ( pFntObj && !( pFntObj->aFont == *(vcl::Font *)pOwn &&
+ while ( pFntObj && !( pFntObj->aFont == *static_cast<vcl::Font const *>(pOwn) &&
pFntObj->GetZoom() == nZoom &&
pFntObj->GetPropWidth() ==
- ((SwSubFont*)pOwn)->GetPropWidth() &&
+ static_cast<SwSubFont const *>(pOwn)->GetPropWidth() &&
( !pFntObj->pPrinter || pFntObj->pPrinter == pOut ) ) )
pFntObj = pFntCache->Next( pFntObj );
@@ -2252,10 +2252,10 @@ SwFntAccess::SwFntAccess( const void* &rMagic,
// found one without printer, let's see if there is one with
// the same printer as well
SwFntObj *pTmpObj = pFntObj;
- while( pTmpObj && !( pTmpObj->aFont == *(vcl::Font *)pOwn &&
+ while( pTmpObj && !( pTmpObj->aFont == *static_cast<vcl::Font const *>(pOwn) &&
pTmpObj->GetZoom()==nZoom && pTmpObj->pPrinter==pOut &&
pTmpObj->GetPropWidth() ==
- ((SwSubFont*)pOwn)->GetPropWidth() ) )
+ static_cast<SwSubFont const *>(pOwn)->GetPropWidth() ) )
pTmpObj = pFntCache->Next( pTmpObj );
if( pTmpObj )
pFntObj = pTmpObj;
@@ -2298,7 +2298,7 @@ SwFntAccess::SwFntAccess( const void* &rMagic,
SwCacheObj *SwFntAccess::NewObj( )
{
// a new Font, a new "MagicNumber".
- return new SwFntObj( *(SwSubFont *)pOwner, ++pMagicNo, pShell );
+ return new SwFntObj( *static_cast<SwSubFont const *>(pOwner), ++pMagicNo, pShell );
}
sal_Int32 SwFont::GetTxtBreak( SwDrawTextInfo& rInf, long nTextWidth )
diff --git a/sw/source/core/txtnode/swfntcch.cxx b/sw/source/core/txtnode/swfntcch.cxx
index cdad0bcd579e..058b071fd29c 100644
--- a/sw/source/core/txtnode/swfntcch.cxx
+++ b/sw/source/core/txtnode/swfntcch.cxx
@@ -31,10 +31,10 @@ SwFontCache *pSwFontCache = NULL;
SwFontObj::SwFontObj( const void *pOwn, SwViewShell *pSh ) :
SwCacheObj( (void*)pOwn ),
- aSwFont( &((SwTxtFmtColl *)pOwn)->GetAttrSet(), pSh ? pSh->getIDocumentSettingAccess() : 0 )
+ aSwFont( &static_cast<SwTxtFmtColl const *>(pOwn)->GetAttrSet(), pSh ? pSh->getIDocumentSettingAccess() : 0 )
{
aSwFont.GoMagic( pSh, aSwFont.GetActual() );
- const SwAttrSet& rAttrSet = ((SwTxtFmtColl *)pOwn)->GetAttrSet();
+ const SwAttrSet& rAttrSet = static_cast<SwTxtFmtColl const *>(pOwn)->GetAttrSet();
for (sal_uInt16 i = RES_CHRATR_BEGIN; i < RES_CHRATR_END; i++)
pDefaultArray[ StackPos[ i ] ] = &rAttrSet.Get( i, true );
}
diff --git a/sw/source/core/unocore/swunohelper.cxx b/sw/source/core/unocore/swunohelper.cxx
index 8a1bd2a618b7..8f5c89dbed4e 100644
--- a/sw/source/core/unocore/swunohelper.cxx
+++ b/sw/source/core/unocore/swunohelper.cxx
@@ -149,7 +149,7 @@ bool UCB_IsReadOnlyFileName( const OUString& rURL )
ucbhelper::Content aCnt( rURL, ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >(), comphelper::getProcessComponentContext() );
::com::sun::star::uno::Any aAny = aCnt.getPropertyValue("IsReadOnly");
if(aAny.hasValue())
- bIsReadOnly = *(sal_Bool*)aAny.getValue();
+ bIsReadOnly = *static_cast<sal_Bool const *>(aAny.getValue());
}
catch( ::com::sun::star::uno::Exception& )
{
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index 5f62146a7731..3cf4b01a8464 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -858,7 +858,7 @@ SwFmDrawPage* SwXDrawPage::GetSvxPage()
uno::Reference< drawing::XDrawPage > xPage = pDrawPage;
uno::Any aAgg = xPage->queryInterface(cppu::UnoType<uno::XAggregation>::get());
if(aAgg.getValueType() == cppu::UnoType<uno::XAggregation>::get())
- xPageAgg = *(uno::Reference< uno::XAggregation >*)aAgg.getValue();
+ xPageAgg = *static_cast<uno::Reference< uno::XAggregation > const *>(aAgg.getValue());
}
if( xPageAgg.is() )
xPageAgg->setDelegator( (cppu::OWeakObject*)this );
@@ -908,7 +908,7 @@ sal_Int64 SAL_CALL SwXShape::getSomething( const uno::Sequence< sal_Int8 >& rId
if(aAgg.getValueType() == rTunnelType)
{
uno::Reference<lang::XUnoTunnel> xAggTunnel =
- *(uno::Reference<lang::XUnoTunnel>*)aAgg.getValue();
+ *static_cast<uno::Reference<lang::XUnoTunnel> const *>(aAgg.getValue());
if(xAggTunnel.is())
return xAggTunnel->getSomething(rId);
}
@@ -937,7 +937,7 @@ SwXShape::SwXShape(uno::Reference< uno::XInterface > & xShape) :
{
uno::Any aAgg = xShape->queryInterface(rAggType);
if(aAgg.getValueType() == rAggType)
- xShapeAgg = *(uno::Reference< uno::XAggregation >*)aAgg.getValue();
+ xShapeAgg = *static_cast<uno::Reference< uno::XAggregation > const *>(aAgg.getValue());
// #i31698#
if ( xShapeAgg.is() )
{
@@ -1075,7 +1075,7 @@ uno::Reference< beans::XPropertySetInfo > SwXShape::getPropertySetInfo(void) th
if(aPSet.getValueType() == rPropSetType && aPSet.getValue())
{
uno::Reference< beans::XPropertySet > xPrSet =
- *(uno::Reference< beans::XPropertySet >*)aPSet.getValue();
+ *static_cast<uno::Reference< beans::XPropertySet > const *>(aPSet.getValue());
uno::Reference< beans::XPropertySetInfo > xInfo = xPrSet->getPropertySetInfo();
// Expand PropertySetInfo!
const uno::Sequence<beans::Property> aPropSeq = xInfo->getProperties();
@@ -1148,7 +1148,7 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a
bool bIsVisible = pDoc->getIDocumentDrawModelAccess().IsVisibleLayerId( pObj->GetLayer() );
if(FmFormInventor != pObj->GetObjInventor())
{
- pObj->SetLayer( *(sal_Bool*)aValue.getValue()
+ pObj->SetLayer( *static_cast<sal_Bool const *>(aValue.getValue())
? ( bIsVisible ? pDoc->getIDocumentDrawModelAccess().GetHeavenId() : pDoc->getIDocumentDrawModelAccess().GetInvisibleHeavenId() )
: ( bIsVisible ? pDoc->getIDocumentDrawModelAccess().GetHellId() : pDoc->getIDocumentDrawModelAccess().GetInvisibleHellId() ));
}
@@ -1420,12 +1420,12 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a
if(aValue.getValueType() == rTextRangeType)
{
uno::Reference< text::XTextRange > & rRange = pImpl->GetTextRange();
- rRange = *(uno::Reference< text::XTextRange > *)aValue.getValue();
+ rRange = *static_cast<uno::Reference< text::XTextRange > const *>(aValue.getValue());
}
}
break;
case RES_OPAQUE :
- pImpl->SetOpaque(*(sal_Bool*)aValue.getValue());
+ pImpl->SetOpaque(*static_cast<sal_Bool const *>(aValue.getValue()));
break;
// #i26791#
case RES_FOLLOW_TEXT_FLOW:
@@ -1460,7 +1460,7 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a
uno::Any aPSet = xShapeAgg->queryAggregation(rPSetType);
if(aPSet.getValueType() != rPSetType || !aPSet.getValue())
throw uno::RuntimeException();
- xPrSet = *(uno::Reference< beans::XPropertySet >*)aPSet.getValue();
+ xPrSet = *static_cast<uno::Reference< beans::XPropertySet > const *>(aPSet.getValue());
// #i31698# - setting the caption point of a
// caption object doesn't have to change the object position.
// Thus, keep the position, before the caption point is set and
@@ -1796,7 +1796,7 @@ uno::Any SwXShape::_getPropAtAggrObj( const OUString& _rPropertyName )
{
throw uno::RuntimeException();
}
- xPrSet = *(uno::Reference< beans::XPropertySet >*)aPSet.getValue();
+ xPrSet = *static_cast<uno::Reference< beans::XPropertySet > const *>(aPSet.getValue());
aRet = xPrSet->getPropertyValue( _rPropertyName );
return aRet;
@@ -1916,7 +1916,7 @@ uno::Sequence< beans::PropertyState > SwXShape::getPropertyStates(
uno::Any aPState = xShapeAgg->queryAggregation(rPStateType);
if(aPState.getValueType() != rPStateType || !aPState.getValue())
throw uno::RuntimeException();
- xShapePrState = *(uno::Reference< XPropertyState >*)aPState.getValue();
+ xShapePrState = *static_cast<uno::Reference< XPropertyState > const *>(aPState.getValue());
}
pRet[nProperty] = xShapePrState->getPropertyState(pNames[nProperty]);
}
@@ -1981,7 +1981,7 @@ void SwXShape::setPropertyToDefault( const OUString& rPropertyName )
uno::Any aPState = xShapeAgg->queryAggregation(rPStateType);
if(aPState.getValueType() != rPStateType || !aPState.getValue())
throw uno::RuntimeException();
- uno::Reference< XPropertyState > xShapePrState = *(uno::Reference< XPropertyState >*)aPState.getValue();
+ uno::Reference< XPropertyState > xShapePrState = *static_cast<uno::Reference< XPropertyState > const *>(aPState.getValue());
xShapePrState->setPropertyToDefault( rPropertyName );
}
}
@@ -2016,7 +2016,7 @@ uno::Any SwXShape::getPropertyDefault( const OUString& rPropertyName )
uno::Any aPState = xShapeAgg->queryAggregation(rPStateType);
if(aPState.getValueType() != rPStateType || !aPState.getValue())
throw uno::RuntimeException();
- uno::Reference< XPropertyState > xShapePrState = *(uno::Reference< XPropertyState >*)aPState.getValue();
+ uno::Reference< XPropertyState > xShapePrState = *static_cast<uno::Reference< XPropertyState > const *>(aPState.getValue());
xShapePrState->getPropertyDefault( rPropertyName );
}
}
diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx
index 1d38d50779db..380b4742c167 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -2262,7 +2262,7 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException,
if(rValue.getValueType() != ::cppu::UnoType<util::Date>::get())
throw lang::IllegalArgumentException();
- util::Date aTemp = *(const util::Date*)rValue.getValue();
+ util::Date aTemp = *static_cast<const util::Date*>(rValue.getValue());
m_pImpl->m_pProps->aDate = Date(aTemp.Day, aTemp.Month, aTemp.Year);
}
break;
@@ -2301,7 +2301,7 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException,
if (pBool)
{
if( rValue.getValueType() == getCppuBooleanType() )
- *pBool = *(sal_Bool*)rValue.getValue();
+ *pBool = *static_cast<sal_Bool const *>(rValue.getValue());
else
throw lang::IllegalArgumentException();
}
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index 6a5b6d8b67c4..2bef739cf03d 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -1460,7 +1460,7 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::
}
else if(pEntry->nWID == FN_UNO_IS_AUTOMATIC_CONTOUR )
{
- pNoTxt->SetAutomaticContour( *(sal_Bool *)aValue.getValue() );
+ pNoTxt->SetAutomaticContour( *static_cast<sal_Bool const *>(aValue.getValue()) );
}
else if(pEntry->nWID == FN_UNO_IS_PIXEL_CONTOUR )
{
@@ -1470,7 +1470,7 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::
// used already).
if( !pNoTxt->_HasContour() ||
!pNoTxt->IsContourMapModeValid() )
- pNoTxt->SetPixelContour( *(sal_Bool *)aValue.getValue() );
+ pNoTxt->SetPixelContour( *static_cast<sal_Bool const *>(aValue.getValue()) );
else
throw lang::IllegalArgumentException();
}
@@ -3064,7 +3064,7 @@ void SwXFrame::setPosition(const awt::Point& /*aPosition*/) throw( uno::RuntimeE
awt::Size SwXFrame::getSize(void) throw( uno::RuntimeException, std::exception )
{
const ::uno::Any aVal = getPropertyValue("Size");
- awt::Size* pRet = (awt::Size*)aVal.getValue();
+ awt::Size const * pRet = static_cast<awt::Size const *>(aVal.getValue());
return *pRet;
}
diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx
index 856f3a1218cf..52f120d0e8fd 100644
--- a/sw/source/core/unocore/unoobj.cxx
+++ b/sw/source/core/unocore/unoobj.cxx
@@ -2730,7 +2730,7 @@ bool SwUnoCursorHelper::ConvertSortProperties(
{
if (aValue.getValueType() == ::getBooleanCppuType())
{
- rSortOpt.bTable = *(sal_Bool*)aValue.getValue();
+ rSortOpt.bTable = *static_cast<sal_Bool const *>(aValue.getValue());
}
else
{
@@ -2837,7 +2837,7 @@ bool SwUnoCursorHelper::ConvertSortProperties(
nIndex = nIndex - '0';
if (aValue.getValueType() == ::getBooleanCppuType() && nIndex < 3)
{
- bool bTemp = *(sal_Bool*)aValue.getValue();
+ bool bTemp = *static_cast<sal_Bool const *>(aValue.getValue());
aKeys[nIndex]->bIsNumeric = bTemp;
}
else
@@ -2854,7 +2854,7 @@ bool SwUnoCursorHelper::ConvertSortProperties(
nIndex -= '0';
if (aValue.getValueType() == ::getBooleanCppuType() && nIndex < 3)
{
- bool bTemp = *(sal_Bool*)aValue.getValue();
+ bool bTemp = *static_cast<sal_Bool const *>(aValue.getValue());
aKeys[nIndex]->eSortOrder = (bTemp)
? SRT_ASCENDING : SRT_DESCENDING;
}
@@ -2869,7 +2869,7 @@ bool SwUnoCursorHelper::ConvertSortProperties(
bNewSortdescriptor = true;
if (aValue.getValueType() == ::getBooleanCppuType())
{
- bool bTemp = *(sal_Bool*)aValue.getValue();
+ bool bTemp = *static_cast<sal_Bool const *>(aValue.getValue());
rSortOpt.eDirection = bTemp ? SRT_COLUMNS : SRT_ROWS;
}
else
diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx
index a565dceb9266..76aa4b404a16 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -392,7 +392,7 @@ void SwXFootnoteProperties::setPropertyValue(const OUString& rPropertyName, cons
break;
case WID_POSITION_END_OF_DOC:
{
- bool bVal = *(sal_Bool*)aValue.getValue();
+ bool bVal = *static_cast<sal_Bool const *>(aValue.getValue());
aFtnInfo.ePos = bVal ? FTNPOS_CHAPTER : FTNPOS_PAGE;
}
break;
@@ -844,7 +844,7 @@ void SwXLineNumberingProperties::setPropertyValue(
{
case WID_NUM_ON:
{
- bool bVal = *(sal_Bool*)aValue.getValue();
+ bool bVal = *static_cast<sal_Bool const *>(aValue.getValue());
aInfo.SetPaintLineNumbers(bVal);
}
break;
@@ -920,19 +920,19 @@ void SwXLineNumberingProperties::setPropertyValue(
break;
case WID_COUNT_EMPTY_LINES :
{
- bool bVal = *(sal_Bool*)aValue.getValue();
+ bool bVal = *static_cast<sal_Bool const *>(aValue.getValue());
aInfo.SetCountBlankLines(bVal);
}
break;
case WID_COUNT_LINES_IN_FRAMES :
{
- bool bVal = *(sal_Bool*)aValue.getValue();
+ bool bVal = *static_cast<sal_Bool const *>(aValue.getValue());
aInfo.SetCountInFlys(bVal);
}
break;
case WID_RESTART_AT_EACH_PAGE :
{
- bool bVal = *(sal_Bool*)aValue.getValue();
+ bool bVal = *static_cast<sal_Bool const *>(aValue.getValue());
aInfo.SetRestartEachPage(bVal);
}
break;
@@ -1184,7 +1184,7 @@ void SwXNumberingRules::replaceByIndex(sal_Int32 nIndex, const uno::Any& rElemen
if(rElement.getValueType().getTypeClass() != uno::TypeClass_SEQUENCE)
throw lang::IllegalArgumentException();
const uno::Sequence<beans::PropertyValue>& rProperties =
- *(const uno::Sequence<beans::PropertyValue>*)rElement.getValue();
+ *static_cast<const uno::Sequence<beans::PropertyValue>*>(rElement.getValue());
SwNumRule* pRule = 0;
if(pNumRule)
SwXNumberingRules::SetNumberingRuleByIndex( *pNumRule,
@@ -2136,13 +2136,13 @@ void SwXNumberingRules::setPropertyValue( const OUString& rPropertyName, const A
if(rPropertyName == UNO_NAME_IS_AUTOMATIC)
{
- bool bVal = *(sal_Bool*)rValue.getValue();
+ bool bVal = *static_cast<sal_Bool const *>(rValue.getValue());
if(!pCreatedRule)
pDocRule ? pDocRule->SetAutoRule(bVal) : pNumRule->SetAutoRule(bVal);
}
else if(rPropertyName == UNO_NAME_IS_CONTINUOUS_NUMBERING)
{
- bool bVal = *(sal_Bool*)rValue.getValue();
+ bool bVal = *static_cast<sal_Bool const *>(rValue.getValue());
pDocRule ? pDocRule->SetContinusNum(bVal) :
pCreatedRule ? pCreatedRule->SetContinusNum(bVal) : pNumRule->SetContinusNum(bVal);
}
@@ -2153,13 +2153,13 @@ void SwXNumberingRules::setPropertyValue( const OUString& rPropertyName, const A
}
else if(rPropertyName == UNO_NAME_IS_ABSOLUTE_MARGINS)
{
- bool bVal = *(sal_Bool*)rValue.getValue();
+ bool bVal = *static_cast<sal_Bool const *>(rValue.getValue());
pDocRule ? pDocRule->SetAbsSpaces(bVal) :
pCreatedRule ? pCreatedRule->SetAbsSpaces(bVal) : pNumRule->SetAbsSpaces(bVal);
}
else if(rPropertyName == UNO_NAME_NUMBERING_IS_OUTLINE)
{
- bool bVal = *(sal_Bool*)rValue.getValue();
+ bool bVal = *static_cast<sal_Bool const *>(rValue.getValue());
SwNumRuleType eNumRuleType = bVal ? OUTLINE_RULE : NUM_RULE;
pDocRule ? pDocRule->SetRuleType(eNumRuleType) :
pCreatedRule ? pCreatedRule->SetRuleType(eNumRuleType) : pNumRule->SetRuleType(eNumRuleType);
@@ -2514,7 +2514,7 @@ void SwXTextColumns::setPropertyValue( const OUString& rPropertyName, const Any&
}
break;
case WID_TXTCOL_LINE_IS_ON:
- bSepLineIsOn = *(sal_Bool*)aValue.getValue();
+ bSepLineIsOn = *static_cast<sal_Bool const *>(aValue.getValue());
break;
case WID_TXTCOL_AUTO_DISTANCE:
{
diff --git a/sw/source/core/unocore/unosrch.cxx b/sw/source/core/unocore/unosrch.cxx
index 0cd1edf9088c..923bbeb1af02 100644
--- a/sw/source/core/unocore/unosrch.cxx
+++ b/sw/source/core/unocore/unosrch.cxx
@@ -563,7 +563,7 @@ void SwXTextSearch::setPropertyValue(const OUString& rPropertyName, const uno::A
throw beans::PropertyVetoException ("Property is read-only: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
bool bVal = false;
if(aValue.getValueType() == ::getBooleanCppuType())
- bVal = *(sal_Bool*)aValue.getValue();
+ bVal = *static_cast<sal_Bool const *>(aValue.getValue());
switch(pEntry->nWID)
{
case WID_SEARCH_ALL : bAll = bVal; break;
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index 886c37158277..53b96224db35 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -345,7 +345,7 @@ void SwXStyleFamilies::loadStylesFromURL(const OUString& rURL,
if( pVal->getValueType() == ::getBooleanCppuType() )
{
const OUString sName = pArray[i].Name;
- bool bVal = *(sal_Bool*)pVal->getValue();
+ bool bVal = *static_cast<sal_Bool const *>(pVal->getValue());
if( sName == UNO_NAME_OVERWRITE_STYLES )
bLoadStyleOverwrite = bVal;
else if( sName == UNO_NAME_LOAD_NUMBERING_STYLES )
@@ -833,8 +833,8 @@ void SwXStyleFamily::insertByName(const OUString& rName, const uno::Any& rElemen
if(rElement.getValueType().getTypeClass() ==
uno::TypeClass_INTERFACE)
{
- uno::Reference< uno::XInterface > * pxRef =
- (uno::Reference< uno::XInterface > *)rElement.getValue();
+ uno::Reference< uno::XInterface > const * pxRef =
+ static_cast<uno::Reference< uno::XInterface > const *>(rElement.getValue());
uno::Reference<lang::XUnoTunnel> xStyleTunnel( *pxRef, uno::UNO_QUERY);
@@ -1836,8 +1836,8 @@ static void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
{
if(aValue.getValueType() == cppu::UnoType<container::XIndexReplace>::get())
{
- uno::Reference< container::XIndexReplace > * pxRulesRef =
- (uno::Reference< container::XIndexReplace > *)aValue.getValue();
+ uno::Reference< container::XIndexReplace > const * pxRulesRef =
+ static_cast<uno::Reference< container::XIndexReplace > const *>(aValue.getValue());
uno::Reference<lang::XUnoTunnel> xNumberTunnel( *pxRulesRef, uno::UNO_QUERY);
@@ -1991,7 +1991,7 @@ static void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
}
case FN_UNO_IS_AUTO_UPDATE:
{
- bool bAuto = *(sal_Bool*)aValue.getValue();
+ bool bAuto = *static_cast<sal_Bool const *>(aValue.getValue());
if(SFX_STYLE_FAMILY_PARA == eFamily)
rBase.getNewBase()->GetCollection()->SetAutoUpdateFmt(bAuto);
else if(SFX_STYLE_FAMILY_FRAME == eFamily)
@@ -3458,7 +3458,7 @@ void SAL_CALL SwXPageStyle::SetPropertyValues_Impl(
}
else if(pEntry->nWID == SID_ATTR_PAGE_ON)
{
- bool bVal = *(sal_Bool*)pValues[nProp].getValue();
+ bool bVal = *static_cast<sal_Bool const *>(pValues[nProp].getValue());
if(bVal)
{
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index 7b667a19a801..25ffd67a613b 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -164,7 +164,7 @@ static void lcl_SetSpecialProperty(SwFrmFmt* pFmt,
UnoActionContext aAction(pFmt->GetDoc());
if( pEntry->nWID == FN_TABLE_HEADLINE_REPEAT)
{
- bool bVal = *(sal_Bool*)aValue.getValue();
+ bool bVal = *static_cast<sal_Bool const *>(aValue.getValue());
pFmt->GetDoc()->SetRowsToRepeat( *pTable, bVal ? 1 : 0 );
}
else
@@ -199,7 +199,7 @@ static void lcl_SetSpecialProperty(SwFrmFmt* pFmt,
}
else if(FN_TABLE_IS_RELATIVE_WIDTH == pEntry->nWID)
{
- bool bPercent = *(sal_Bool*)aValue.getValue();
+ bool bPercent = *static_cast<sal_Bool const *>(aValue.getValue());
if(!bPercent)
aSz.SetWidthPercent(0);
else
@@ -679,7 +679,7 @@ static void lcl_SetTblSeparators(const uno::Any& rVal, SwTable* pTable, SwTableB
return;
const uno::Sequence< text::TableColumnSeparator>* pSepSeq =
- (uno::Sequence< text::TableColumnSeparator>*) rVal.getValue();
+ static_cast<uno::Sequence< text::TableColumnSeparator> const *>(rVal.getValue());
if(pSepSeq && static_cast<size_t>(pSepSeq->getLength()) == nOldCount)
{
SwTabCols aCols(aOldCols);
@@ -1411,7 +1411,7 @@ void SwXTextTableRow::setPropertyValue(const OUString& rPropertyName, const uno:
SwFmtFrmSize aFrmSize(pLn->GetFrmFmt()->GetFrmSize());
if(FN_UNO_ROW_AUTO_HEIGHT== pEntry->nWID)
{
- bool bSet = *(sal_Bool*)aValue.getValue();
+ bool bSet = *static_cast<sal_Bool const *>(aValue.getValue());
aFrmSize.SetHeightSizeType(bSet ? ATT_VAR_SIZE : ATT_FIX_SIZE);
}
else
@@ -2015,7 +2015,7 @@ void SwTableProperties_Impl::ApplyTblAttr(const SwTable& rTbl, SwDoc& rDoc)
const SwFrmFmt &rFrmFmt = *rTbl.GetFrmFmt();
if(GetProperty(FN_TABLE_HEADLINE_REPEAT, 0xff, pRepHead ))
{
- bool bVal = *(sal_Bool*)pRepHead->getValue();
+ bool bVal = *static_cast<sal_Bool const *>(pRepHead->getValue());
((SwTable&)rTbl).SetRowsToRepeat( bVal ? 1 : 0 ); // TODO: MULTIHEADER
}
@@ -2116,7 +2116,7 @@ void SwTableProperties_Impl::ApplyTblAttr(const SwTable& rTbl, SwDoc& rDoc)
((SfxPoolItem&)aSz).PutValue(*pWidth, MID_FRMSIZE_WIDTH);
bPutSize = true;
}
- bool bTemp = pSzRel && *(sal_Bool*)pSzRel->getValue();
+ bool bTemp = pSzRel && *static_cast<sal_Bool const *>(pSzRel->getValue());
if(pSzRel && bTemp && pRelWidth)
{
((SfxPoolItem&)aSz).PutValue(*pRelWidth, MID_FRMSIZE_REL_WIDTH|CONVERT_TWIPS);
@@ -2157,7 +2157,7 @@ void SwTableProperties_Impl::ApplyTblAttr(const SwTable& rTbl, SwDoc& rDoc)
const::uno::Any* pSplit;
if(GetProperty(RES_LAYOUT_SPLIT, 0, pSplit ))
{
- bool bTmp = *(sal_Bool*)pSplit->getValue();
+ bool bTmp = *static_cast<sal_Bool const *>(pSplit->getValue());
SwFmtLayoutSplit aSp(bTmp);
aSet.Put(aSp);
}
@@ -2706,7 +2706,7 @@ void SAL_CALL SwXTextTable::setDataArray(
{
const uno::Any &rAny = pColArray[nCol];
if (uno::TypeClass_STRING == rAny.getValueTypeClass())
- sw_setString( *pXCell, *(OUString *) rAny.getValue() );
+ sw_setString( *pXCell, *static_cast<OUString const *>(rAny.getValue()) );
else
{
double d = 0;
@@ -3109,7 +3109,7 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName, const uno::An
case FN_UNO_RANGE_ROW_LABEL:
{
- bool bTmp = *(sal_Bool*)aValue.getValue();
+ bool bTmp = *static_cast<sal_Bool const *>(aValue.getValue());
if(bFirstRowAsLabel != bTmp)
{
lcl_SendChartEvent(*this, m_pImpl->m_Listeners);
@@ -3120,7 +3120,7 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName, const uno::An
case FN_UNO_RANGE_COL_LABEL:
{
- bool bTmp = *(sal_Bool*)aValue.getValue();
+ bool bTmp = *static_cast<sal_Bool const *>(aValue.getValue());
if(bFirstColumnAsLabel != bTmp)
{
lcl_SendChartEvent(*this, m_pImpl->m_Listeners);
@@ -3978,7 +3978,7 @@ void SwXCellRange::setPropertyValue(const OUString& rPropertyName, const uno::An
break;
case FN_UNO_RANGE_ROW_LABEL:
{
- bool bTmp = *(sal_Bool*)aValue.getValue();
+ bool bTmp = *static_cast<sal_Bool const *>(aValue.getValue());
if(bFirstRowAsLabel != bTmp)
{
lcl_SendChartEvent(*this, m_ChartListeners);
@@ -3988,7 +3988,7 @@ void SwXCellRange::setPropertyValue(const OUString& rPropertyName, const uno::An
break;
case FN_UNO_RANGE_COL_LABEL:
{
- bool bTmp = *(sal_Bool*)aValue.getValue();
+ bool bTmp = *static_cast<sal_Bool const *>(aValue.getValue());
if(bFirstColumnAsLabel != bTmp)
{
lcl_SendChartEvent(*this, m_ChartListeners);
@@ -4359,7 +4359,7 @@ void SAL_CALL SwXCellRange::setDataArray(
{
const uno::Any &rAny = pColArray[nCol];
if (uno::TypeClass_STRING == rAny.getValueTypeClass())
- sw_setString( *pXCell, *(OUString *) rAny.getValue() );
+ sw_setString( *pXCell, *static_cast<OUString const *>(rAny.getValue()) );
else
{
double d = 0;
diff --git a/sw/source/filter/basflt/fltini.cxx b/sw/source/filter/basflt/fltini.cxx
index e372a70da2ab..0cdd5cbf9138 100644
--- a/sw/source/filter/basflt/fltini.cxx
+++ b/sw/source/filter/basflt/fltini.cxx
@@ -257,7 +257,7 @@ void SwFilterOptions::GetValues( sal_uInt16 nCnt, const sal_Char** ppNames,
const Any* pAnyValues = aValues.getConstArray();
for( n = 0; n < nCnt; ++n )
pValues[ n ] = pAnyValues[ n ].hasValue()
- ? *(sal_uInt32*)pAnyValues[ n ].getValue()
+ ? *static_cast<sal_uInt32 const *>(pAnyValues[ n ].getValue())
: 0;
}
else
diff --git a/sw/source/filter/html/htmlcss1.cxx b/sw/source/filter/html/htmlcss1.cxx
index f026033d4fe9..93abca315423 100644
--- a/sw/source/filter/html/htmlcss1.cxx
+++ b/sw/source/filter/html/htmlcss1.cxx
@@ -1715,7 +1715,7 @@ bool SwHTMLParser::FileDownload( const OUString& rURL,
aStream.WriteStream( *pStream );
aStream.Seek( STREAM_SEEK_TO_END );
- rStr = OUString((const sal_Char *)aStream.GetData(), aStream.Tell(),
+ rStr = OUString(static_cast<const sal_Char *>(aStream.GetData()), aStream.Tell(),
GetSrcEncoding());
}
diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx
index 3cff8a21a022..0de130123d88 100644
--- a/sw/source/filter/html/htmlforw.cxx
+++ b/sw/source/filter/html/htmlforw.cxx
@@ -112,14 +112,14 @@ static void lcl_html_outEvents( SvStream& rStrm,
{
if( rFormComp ==
- *(uno::Reference< form::XFormComponent > *)aTmp.getValue() )
+ *static_cast<uno::Reference< form::XFormComponent > const *>(aTmp.getValue()) )
break;
}
else if( aTmp.getValueType() ==
cppu::UnoType<form::XForm>::get())
{
uno::Reference< form::XFormComponent > xFC(
- *(uno::Reference< form::XForm > *)aTmp.getValue(), uno::UNO_QUERY );
+ *static_cast<uno::Reference< form::XForm > const *>(aTmp.getValue()), uno::UNO_QUERY );
if( rFormComp == xFC )
break;
}
@@ -383,7 +383,7 @@ void SwHTMLWriter::OutHiddenForms()
"OutHiddenForms: falsche Reflection" );
if( aTmp.getValueType() ==
cppu::UnoType<form::XForm>::get())
- OutHiddenForm( *(uno::Reference< form::XForm > *)aTmp.getValue() );
+ OutHiddenForm( *static_cast<uno::Reference< form::XForm > const *>(aTmp.getValue()) );
}
}
@@ -406,7 +406,7 @@ void SwHTMLWriter::OutHiddenForm( const uno::Reference< form::XForm > & rForm )
continue;
uno::Reference< form::XFormComponent > xFormComp =
- *(uno::Reference< form::XFormComponent > *)aTmp.getValue();
+ *static_cast<uno::Reference< form::XFormComponent > const *>(aTmp.getValue());
uno::Reference< form::XForm > xForm( xFormComp, uno::UNO_QUERY );
if( xForm.is() )
OutHiddenForm( xForm );
@@ -421,10 +421,10 @@ void SwHTMLWriter::OutHiddenForm( const uno::Reference< form::XForm > & rForm )
if( aAny2.getValueType() == ::cppu::UnoType<sal_Int16>::get() )
{
if( form::FormComponentType::HIDDENCONTROL ==
- *(sal_Int16*)aAny2.getValue() )
+ *static_cast<sal_Int16 const *>(aAny2.getValue()) )
bHidden = true;
else if( lcl_html_isHTMLControl(
- *(sal_Int16*)aAny2.getValue() ) )
+ *static_cast<sal_Int16 const *>(aAny2.getValue()) ) )
bHiddenOnly = false;
}
}
@@ -469,7 +469,7 @@ void SwHTMLWriter::OutForm( bool bOn,
{
sOut += " " + OString(OOO_STRING_SVTOOLS_HTML_O_name) + "=\"";
Strm().WriteOString( sOut );
- HTMLOutFuncs::Out_String( Strm(), *(OUString*)aTmp.getValue(),
+ HTMLOutFuncs::Out_String( Strm(), *static_cast<OUString const *>(aTmp.getValue()),
eDestEnc, &aNonConvertableCharacters );
sOut = "\"";
}
@@ -480,7 +480,7 @@ void SwHTMLWriter::OutForm( bool bOn,
{
sOut += " " + OString(OOO_STRING_SVTOOLS_HTML_O_action) + "=\"";
Strm().WriteOString( sOut );
- OUString aURL( *(OUString*)aTmp.getValue() );
+ OUString aURL( *static_cast<OUString const *>(aTmp.getValue()) );
aURL = URIHelper::simpleNormalizedMakeRelative( GetBaseURL(), aURL);
HTMLOutFuncs::Out_String( Strm(), aURL, eDestEnc, &aNonConvertableCharacters );
sOut = "\"";
@@ -490,7 +490,7 @@ void SwHTMLWriter::OutForm( bool bOn,
if( aTmp.getValueType() == cppu::UnoType<form::FormSubmitMethod>::get())
{
form::FormSubmitMethod eMethod =
- *( form::FormSubmitMethod*)aTmp.getValue();
+ *static_cast<form::FormSubmitMethod const *>(aTmp.getValue());
if( form::FormSubmitMethod_POST==eMethod )
{
sOut += " " + OString(OOO_STRING_SVTOOLS_HTML_O_method) + "=\"" +
@@ -501,7 +501,7 @@ void SwHTMLWriter::OutForm( bool bOn,
if( aTmp.getValueType()==cppu::UnoType<form::FormSubmitEncoding>::get())
{
form::FormSubmitEncoding eEncType =
- *( form::FormSubmitEncoding*)aTmp.getValue();
+ *static_cast<form::FormSubmitEncoding const *>(aTmp.getValue());
const sal_Char *pStr = 0;
switch( eEncType )
{
@@ -528,7 +528,7 @@ void SwHTMLWriter::OutForm( bool bOn,
{
sOut += " " + OString(OOO_STRING_SVTOOLS_HTML_O_target) + "=\"";
Strm().WriteOString( sOut );
- HTMLOutFuncs::Out_String( Strm(), *(OUString*)aTmp.getValue(),
+ HTMLOutFuncs::Out_String( Strm(), *static_cast<OUString const *>(aTmp.getValue()),
eDestEnc, &aNonConvertableCharacters );
sOut = "\"";
}
@@ -561,7 +561,7 @@ void SwHTMLWriter::OutHiddenControls(
"OutHiddenControls: falsche Reflection" );
bDone = aTmp.getValueType() ==
cppu::UnoType<form::XFormComponent>::get()&&
- *(uno::Reference< form::XFormComponent > *)aTmp.getValue() ==
+ *static_cast<uno::Reference< form::XFormComponent > const *>(aTmp.getValue()) ==
xFC;
}
}
@@ -576,7 +576,7 @@ void SwHTMLWriter::OutHiddenControls(
cppu::UnoType<form::XFormComponent>::get())
continue;
uno::Reference< form::XFormComponent > xFC =
- *(uno::Reference< form::XFormComponent > *)aTmp.getValue();
+ *static_cast<uno::Reference< form::XFormComponent > const *>(aTmp.getValue());
uno::Reference< beans::XPropertySet > xPropSet( xFC, uno::UNO_QUERY );
OUString sPropName = "ClassId";
@@ -588,7 +588,7 @@ void SwHTMLWriter::OutHiddenControls(
continue;
if( form::FormComponentType::HIDDENCONTROL ==
- *(sal_Int16*) aTmp.getValue() )
+ *static_cast<sal_Int16 const *>(aTmp.getValue()) )
{
if( bLFPossible )
OutNewLine( true );
@@ -602,7 +602,7 @@ void SwHTMLWriter::OutHiddenControls(
{
sOut += " " + OString(OOO_STRING_SVTOOLS_HTML_O_name) + "=\"";
Strm().WriteOString( sOut );
- HTMLOutFuncs::Out_String( Strm(), *(OUString*)aTmp.getValue(),
+ HTMLOutFuncs::Out_String( Strm(), *static_cast<OUString const *>(aTmp.getValue()),
eDestEnc, &aNonConvertableCharacters );
sOut = "\"";
}
@@ -612,7 +612,7 @@ void SwHTMLWriter::OutHiddenControls(
{
sOut += " " + OString(OOO_STRING_SVTOOLS_HTML_O_value) + "=\"";
Strm().WriteOString( sOut );
- HTMLOutFuncs::Out_String( Strm(), *(OUString*)aTmp.getValue(),
+ HTMLOutFuncs::Out_String( Strm(), *static_cast<OUString const *>(aTmp.getValue()),
eDestEnc, &aNonConvertableCharacters );
sOut = "\"";
}
@@ -621,7 +621,7 @@ void SwHTMLWriter::OutHiddenControls(
nFormCntrlCnt++;
}
- else if( lcl_html_isHTMLControl( *(sal_Int16*) aTmp.getValue() ) )
+ else if( lcl_html_isHTMLControl( *static_cast<sal_Int16 const *>(aTmp.getValue()) ) )
{
break;
}
@@ -657,7 +657,7 @@ const SdrObject *SwHTMLWriter::GetHTMLControl( const SwDrawFrmFmt& rFmt )
uno::Any aTmp = xPropSet->getPropertyValue( sPropName );
if( aTmp.getValueType() == ::cppu::UnoType<sal_Int16>::get()&&
- lcl_html_isHTMLControl( *(sal_Int16*) aTmp.getValue() ) )
+ lcl_html_isHTMLControl( *static_cast<sal_Int16 const *>(aTmp.getValue()) ) )
{
return pObj;
}
@@ -725,7 +725,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
OString sOptions;
bool bEmptyValue = false;
uno::Any aTmp = xPropSet->getPropertyValue( "ClassId" );
- sal_Int16 nClassId = *(sal_Int16*) aTmp.getValue();
+ sal_Int16 nClassId = *static_cast<sal_Int16 const *>(aTmp.getValue());
sal_uInt32 nFrmOpts = HTML_FRMOPTS_CONTROL;
switch( nClassId )
{
@@ -735,7 +735,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
? TYPE_CHECKBOX : TYPE_RADIO);
aTmp = xPropSet->getPropertyValue( "DefaultState" );
if( aTmp.getValueType() == ::cppu::UnoType<sal_Int16>::get() &&
- TRISTATE_FALSE != *(sal_Int16*) aTmp.getValue() )
+ TRISTATE_FALSE != *static_cast<sal_Int16 const *>(aTmp.getValue()) )
{
sOptions += " " + OString(OOO_STRING_SVTOOLS_HTML_O_checked);
sOptions += "=\"";
@@ -747,7 +747,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
if( aTmp.getValueType() == ::cppu::UnoType<OUString>::get() )
{
- const OUString& rVal = *(OUString*)aTmp.getValue();
+ const OUString& rVal = *static_cast<OUString const *>(aTmp.getValue());
if( rVal.isEmpty() )
bEmptyValue = true;
else if( rVal != OOO_STRING_SVTOOLS_HTML_on )
@@ -761,7 +761,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
aTmp = xPropSet->getPropertyValue( "ButtonType" );
if( aTmp.getValueType() ==
::cppu::UnoType<form::FormButtonType>::get() )
- eButtonType = *( form::FormButtonType*)aTmp.getValue();
+ eButtonType = *static_cast<form::FormButtonType const *>(aTmp.getValue());
switch( eButtonType )
{
@@ -780,7 +780,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
if( aTmp.getValueType() == ::cppu::UnoType<OUString>::get() &&
!reinterpret_cast<const OUString*>(aTmp.getValue())->isEmpty() )
{
- sValue = *(OUString*)aTmp.getValue();
+ sValue = *static_cast<OUString const *>(aTmp.getValue());
}
}
break;
@@ -791,7 +791,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
eTag = TAG_SELECT;
aTmp = xPropSet->getPropertyValue( "Dropdown" );
if( aTmp.getValueType() == ::getBooleanCppuType() &&
- !*(sal_Bool*)aTmp.getValue() )
+ !*static_cast<sal_Bool const *>(aTmp.getValue()) )
{
Size aSz( 0, 0 );
GetControlSize( rFormObj, aSz, rWrt.pDoc );
@@ -805,7 +805,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
aTmp = xPropSet->getPropertyValue( "MultiSelection" );
if( aTmp.getValueType() == ::getBooleanCppuType() &&
- *(sal_Bool*)aTmp.getValue() )
+ *static_cast<sal_Bool const *>(aTmp.getValue()) )
{
sOptions += " " + OString(OOO_STRING_SVTOOLS_HTML_O_multiple);
}
@@ -823,7 +823,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
{
aTmp = xPropSet->getPropertyValue( sMultiLine );
bMultiLine = aTmp.getValueType() == ::getBooleanCppuType() &&
- *(sal_Bool*)aTmp.getValue();
+ *static_cast<sal_Bool const *>(aTmp.getValue());
}
if( bMultiLine )
@@ -846,13 +846,13 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
aTmp = xPropSet->getPropertyValue( "HScroll" );
if( aTmp.getValueType() == ::getVoidCppuType() ||
(aTmp.getValueType() == ::getBooleanCppuType() &&
- !*(sal_Bool*)aTmp.getValue()) )
+ !*static_cast<sal_Bool const *>(aTmp.getValue())) )
{
const sal_Char *pWrapStr = 0;
aTmp = xPropSet->getPropertyValue( "HardLineBreaks" );
pWrapStr =
(aTmp.getValueType() == ::getBooleanCppuType() &&
- *(sal_Bool*)aTmp.getValue()) ? OOO_STRING_SVTOOLS_HTML_WW_hard
+ *static_cast<sal_Bool const *>(aTmp.getValue())) ? OOO_STRING_SVTOOLS_HTML_WW_hard
: OOO_STRING_SVTOOLS_HTML_WW_soft;
sOptions += " " + OString(OOO_STRING_SVTOOLS_HTML_O_wrap) + "=\"" +
OString(pWrapStr) + "\"";
@@ -866,7 +866,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
{
aTmp = xPropSet->getPropertyValue( sEchoChar );
if( aTmp.getValueType() == ::cppu::UnoType<sal_Int16>::get() &&
- *(sal_Int16*)aTmp.getValue() != 0 )
+ *static_cast<sal_Int16 const *>(aTmp.getValue()) != 0 )
eType = TYPE_PASSWORD;
}
@@ -878,10 +878,10 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
aTmp = xPropSet->getPropertyValue( "MaxTextLen" );
if( aTmp.getValueType() == ::cppu::UnoType<sal_Int16>::get() &&
- *(sal_Int16*) aTmp.getValue() != 0 )
+ *static_cast<sal_Int16 const *>(aTmp.getValue()) != 0 )
{
sOptions += " " + OString(OOO_STRING_SVTOOLS_HTML_O_maxlength) + "=\"" +
- OString::number(static_cast<sal_Int32>(*(sal_Int16*) aTmp.getValue())) + "\"";
+ OString::number(static_cast<sal_Int32>(*static_cast<sal_Int16 const *>(aTmp.getValue()))) + "\"";
}
if( xPropSetInfo->hasPropertyByName( "DefaultText" ) )
@@ -890,7 +890,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
if( aTmp.getValueType() == ::cppu::UnoType<OUString>::get() &&
!reinterpret_cast<const OUString*>(aTmp.getValue())->isEmpty() )
{
- sValue = *(OUString*)aTmp.getValue();
+ sValue = *static_cast<OUString const *>(aTmp.getValue());
}
}
}
@@ -939,14 +939,14 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
{
sOut += " " + OString(OOO_STRING_SVTOOLS_HTML_O_name) + "=\"";
rWrt.Strm().WriteOString( sOut );
- HTMLOutFuncs::Out_String( rWrt.Strm(), *(OUString*)aTmp.getValue(),
+ HTMLOutFuncs::Out_String( rWrt.Strm(), *static_cast<OUString const *>(aTmp.getValue()),
rHTMLWrt.eDestEnc, &rHTMLWrt.aNonConvertableCharacters );
sOut = "\"";
}
aTmp = xPropSet->getPropertyValue("Enabled");
if( aTmp.getValueType() == ::getBooleanCppuType() &&
- !*(sal_Bool*)aTmp.getValue() )
+ !*static_cast<sal_Bool const *>(aTmp.getValue()) )
{
sOut += " " + OString(OOO_STRING_SVTOOLS_HTML_O_disabled);
}
@@ -971,7 +971,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
rWrt.Strm().WriteOString( sOut );
HTMLOutFuncs::Out_String( rWrt.Strm(),
- URIHelper::simpleNormalizedMakeRelative( rWrt.GetBaseURL(), *(OUString*)aTmp.getValue()),
+ URIHelper::simpleNormalizedMakeRelative( rWrt.GetBaseURL(), *static_cast<OUString const *>(aTmp.getValue())),
rHTMLWrt.eDestEnc, &rHTMLWrt.aNonConvertableCharacters );
sOut = "\"";
}
@@ -1006,7 +1006,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
aTmp = xPropSet->getPropertyValue( "TabIndex" );
if( aTmp.getValueType() == ::cppu::UnoType<sal_Int16>::get() )
{
- sal_Int16 nTabIndex = *(sal_Int16*) aTmp.getValue();
+ sal_Int16 nTabIndex = *static_cast<sal_Int16 const *>(aTmp.getValue());
if( nTabIndex > 0 )
{
if( nTabIndex >= 32767 )
@@ -1045,7 +1045,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
aTmp = xPropSet->getPropertyValue( "BackgroundColor" );
if( aTmp.getValueType() == ::cppu::UnoType<sal_Int32>::get() )
{
- Color aCol(*(sal_Int32*)aTmp .getValue());
+ Color aCol(*static_cast<sal_Int32 const *>(aTmp .getValue()));
aItemSet.Put( SvxBrushItem( aCol, RES_CHRATR_BACKGROUND ) );
}
}
@@ -1054,7 +1054,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
aTmp = xPropSet->getPropertyValue( "TextColor" );
if( aTmp.getValueType() == ::cppu::UnoType<sal_Int32>::get() )
{
- Color aColor( *(sal_Int32*)aTmp .getValue() );
+ Color aColor( *static_cast<sal_Int32 const *>(aTmp .getValue()) );
aItemSet.Put( SvxColorItem( aColor, RES_CHRATR_COLOR ) );
}
}
@@ -1064,7 +1064,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
if( aTmp.getValueType() == cppu::UnoType<float>::get())
{
- float nHeight = *(float*)aTmp.getValue();
+ float nHeight = *static_cast<float const *>(aTmp.getValue());
if( nHeight > 0 && (!bEdit || nHeight != 10.) )
aItemSet.Put( SvxFontHeightItem( sal_Int16(nHeight * 20.), 100, RES_CHRATR_FONTSIZE ) );
}
@@ -1078,7 +1078,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
vcl::Font aFixedFont( OutputDevice::GetDefaultFont(
DEFAULTFONT_FIXED, LANGUAGE_ENGLISH_US,
DEFAULTFONT_FLAGS_ONLYONE ) );
- OUString aFName( *(OUString*)aTmp.getValue() );
+ OUString aFName( *static_cast<OUString const *>(aTmp.getValue()) );
if( !bEdit || aFName != aFixedFont.GetName() )
{
FontFamily eFamily = FAMILY_DONTKNOW;
@@ -1086,7 +1086,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
{
aTmp = xPropSet->getPropertyValue( "FontFamily" );
if( aTmp.getValueType() == ::cppu::UnoType<sal_Int16>::get())
- eFamily = (FontFamily)*(sal_Int16*) aTmp.getValue();
+ eFamily = (FontFamily)*static_cast<sal_Int16 const *>(aTmp.getValue());
}
SvxFontItem aItem( eFamily, aFName, aEmptyOUStr, PITCH_DONTKNOW, RTL_TEXTENCODING_DONTKNOW, RES_CHRATR_FONT );
aItemSet.Put( aItem );
@@ -1099,7 +1099,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
if( aTmp.getValueType() == cppu::UnoType<float>::get())
{
FontWeight eWeight =
- VCLUnoHelper::ConvertFontWeight( *(float*)aTmp.getValue() );
+ VCLUnoHelper::ConvertFontWeight( *static_cast<float const *>(aTmp.getValue()) );
if( eWeight != WEIGHT_DONTKNOW && eWeight != WEIGHT_NORMAL )
aItemSet.Put( SvxWeightItem( eWeight, RES_CHRATR_WEIGHT ) );
}
@@ -1109,7 +1109,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
aTmp = xPropSet->getPropertyValue( "FontSlant" );
if( aTmp.getValueType() == ::cppu::UnoType<sal_Int16>::get())
{
- FontItalic eItalic = (FontItalic)*(sal_Int16*)aTmp.getValue();
+ FontItalic eItalic = (FontItalic)*static_cast<sal_Int16 const *>(aTmp.getValue());
if( eItalic != ITALIC_DONTKNOW && eItalic != ITALIC_NONE )
aItemSet.Put( SvxPostureItem( eItalic, RES_CHRATR_POSTURE ) );
}
@@ -1120,7 +1120,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
if( aTmp.getValueType() == ::cppu::UnoType<sal_Int16>::get() )
{
FontUnderline eUnderline =
- (FontUnderline)*(sal_Int16*)aTmp.getValue();
+ (FontUnderline)*static_cast<sal_Int16 const *>(aTmp.getValue());
if( eUnderline != UNDERLINE_DONTKNOW &&
eUnderline != UNDERLINE_NONE )
aItemSet.Put( SvxUnderlineItem( eUnderline, RES_CHRATR_UNDERLINE ) );
@@ -1132,7 +1132,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
if( aTmp.getValueType() == ::cppu::UnoType<sal_Int16>::get())
{
FontStrikeout eStrikeout =
- (FontStrikeout)*(sal_Int16*)aTmp.getValue();
+ (FontStrikeout)*static_cast<sal_Int16 const *>(aTmp.getValue());
if( eStrikeout != STRIKEOUT_DONTKNOW &&
eStrikeout != STRIKEOUT_NONE )
aItemSet.Put( SvxCrossedOutItem( eStrikeout, RES_CHRATR_CROSSEDOUT ) );
@@ -1156,7 +1156,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
{
rHTMLWrt.IncIndentLevel(); // der Inhalt von Select darf
// eingerueckt werden
- uno::Sequence<OUString> aList( *(uno::Sequence<OUString>*)aTmp.getValue() );
+ uno::Sequence<OUString> aList( *static_cast<uno::Sequence<OUString> const *>(aTmp.getValue()) );
sal_Int32 nCnt = aList.getLength();
const OUString *pStrings = aList.getConstArray();
@@ -1166,7 +1166,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
uno::Sequence<OUString> aValList;
if( aTmp.getValueType() == ::getCppuType((uno::Sequence<OUString>*)0) )
{
- aValList = *(uno::Sequence<OUString>*)aTmp.getValue();
+ aValList = *static_cast<uno::Sequence<OUString> const *>(aTmp.getValue());
nValCnt = aValList.getLength();
pValues = aValList.getConstArray();
}
@@ -1178,7 +1178,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
uno::Sequence<sal_Int16> aSelList;
if( aSelTmp.getValueType() ==::getCppuType((uno::Sequence<sal_Int16>*)0))
{
- aSelList = *(uno::Sequence<sal_Int16>*)aSelTmp.getValue();
+ aSelList = *static_cast<uno::Sequence<sal_Int16> const *>(aSelTmp.getValue());
nSelCnt = aSelList.getLength();
pSels = aSelList.getConstArray();
}
@@ -1235,7 +1235,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
if( aTmp.getValueType() == ::cppu::UnoType<OUString>::get()&&
!reinterpret_cast<const OUString*>(aTmp.getValue())->isEmpty() )
{
- sVal = *(OUString*)aTmp.getValue();
+ sVal = *static_cast<OUString const *>(aTmp.getValue());
}
if( !sVal.isEmpty() )
{
@@ -1258,7 +1258,7 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt,
if( aTmp.getValueType() == ::cppu::UnoType<OUString>::get() &&
!reinterpret_cast<const OUString*>(aTmp.getValue())->isEmpty() )
{
- sValue = *(OUString*)aTmp.getValue();
+ sValue = *static_cast<OUString const *>(aTmp.getValue());
HTMLOutFuncs::Out_String( rWrt.Strm(), sValue,
rHTMLWrt.eDestEnc, &rHTMLWrt.aNonConvertableCharacters ).WriteChar( ' ' );
}
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index d8d87428a805..61405e0359c8 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -3639,7 +3639,7 @@ void RtfAttributeOutput::FlyFrameOLEReplacement(const SwFlyFrmFmt* pFlyFrmFmt, S
SAL_WARN("sw.rtf", "failed to export the graphic");
aStream.Seek(STREAM_SEEK_TO_END);
sal_uInt32 nSize = aStream.Tell();
- pGraphicAry = (sal_uInt8*)aStream.GetData();
+ pGraphicAry = static_cast<sal_uInt8 const *>(aStream.GetData());
m_aRunText->append(ExportPICT(pFlyFrmFmt, aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize, m_rExport));
m_aRunText->append("}"); // shppict
m_aRunText->append("{" OOO_STRING_SVTOOLS_RTF_NONSHPPICT);
@@ -3649,7 +3649,7 @@ void RtfAttributeOutput::FlyFrameOLEReplacement(const SwFlyFrmFmt* pFlyFrmFmt, S
SAL_WARN("sw.rtf", "failed to export the graphic");
aWmfStream.Seek(STREAM_SEEK_TO_END);
nSize = aWmfStream.Tell();
- pGraphicAry = (sal_uInt8*)aWmfStream.GetData();
+ pGraphicAry = static_cast<sal_uInt8 const *>(aWmfStream.GetData());
m_aRunText->append(ExportPICT(pFlyFrmFmt, aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize, m_rExport));
m_aRunText->append("}"); // nonshppict
}
@@ -3753,7 +3753,7 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrmFmt* pFlyFrmFmt, const Sw
OOO_STRING_SVTOOLS_RTF_PNGBLIP : OOO_STRING_SVTOOLS_RTF_WMETAFILE;
aStream.Seek(STREAM_SEEK_TO_END);
nSize = aStream.Tell();
- pGraphicAry = (sal_uInt8*)aStream.GetData();
+ pGraphicAry = static_cast<sal_uInt8 const *>(aStream.GetData());
}
}
@@ -3851,7 +3851,7 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrmFmt* pFlyFrmFmt, const Sw
pBLIPType = OOO_STRING_SVTOOLS_RTF_WMETAFILE;
aStream.Seek(STREAM_SEEK_TO_END);
nSize = aStream.Tell();
- pGraphicAry = (sal_uInt8*)aStream.GetData();
+ pGraphicAry = static_cast<sal_uInt8 const *>(aStream.GetData());
ExportPICT(pFlyFrmFmt, aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize, m_rExport, &m_rExport.Strm(), bWritePicProp);
}
@@ -3868,7 +3868,7 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrmFmt* pFlyFrmFmt, const Sw
pBLIPType = OOO_STRING_SVTOOLS_RTF_WMETAFILE;
aStream.Seek(STREAM_SEEK_TO_END);
nSize = aStream.Tell();
- pGraphicAry = (sal_uInt8*)aStream.GetData();
+ pGraphicAry = static_cast<sal_uInt8 const *>(aStream.GetData());
ExportPICT(pFlyFrmFmt, aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize, m_rExport, &m_rExport.Strm());
@@ -3898,7 +3898,7 @@ void RtfAttributeOutput::BulletDefinition(int /*nId*/, const Graphic& rGraphic,
SAL_WARN("sw.rtf", "failed to export the numbering picture bullet");
aStream.Seek(STREAM_SEEK_TO_END);
sal_uInt32 nSize = aStream.Tell();
- pGraphicAry = (sal_uInt8*)aStream.GetData();
+ pGraphicAry = static_cast<sal_uInt8 const *>(aStream.GetData());
RtfAttributeOutput::WriteHex(pGraphicAry, nSize, &m_rExport.Strm());
m_rExport.Strm().WriteCharPtr("}}"); // pict, shppict
}
diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx b/sw/source/filter/ww8/rtfsdrexport.cxx
index 49fb11177c30..1c612226c01b 100644
--- a/sw/source/filter/ww8/rtfsdrexport.cxx
+++ b/sw/source/filter/ww8/rtfsdrexport.cxx
@@ -459,7 +459,7 @@ void RtfSdrExport::impl_writeGraphic()
GraphicConverter::Export(aStream, aGraphic, CVT_PNG);
aStream.Seek(STREAM_SEEK_TO_END);
sal_uInt32 nSize = aStream.Tell();
- const sal_uInt8* pGraphicAry = (sal_uInt8*)aStream.GetData();
+ const sal_uInt8* pGraphicAry = static_cast<sal_uInt8 const *>(aStream.GetData());
Size aMapped(aGraphic.GetPrefSize());
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index d88ddfd907df..c8142983635d 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -292,9 +292,9 @@ void SwBasicEscherEx::PreWriteHyperlinkWithinFly(const SwFrmFmt& rFmt,EscherProp
{
SvMemoryStream *rStrm = new SvMemoryStream ;
WriteHyperlinkWithinFly( *rStrm, pINetFmt );
- sal_uInt8* pBuf = (sal_uInt8*) rStrm->GetData();
+ sal_uInt8 const * pBuf = static_cast<sal_uInt8 const *>(rStrm->GetData());
sal_uInt32 nSize = rStrm->Seek( STREAM_SEEK_TO_END );
- rPropOpt.AddOpt( ESCHER_Prop_pihlShape, true, nSize, pBuf, nSize );
+ rPropOpt.AddOpt( ESCHER_Prop_pihlShape, true, nSize, const_cast<sal_uInt8 *>(pBuf), nSize );
sal_uInt32 nValue;
OUString aNamestr = pINetFmt->GetName();
if (!aNamestr.isEmpty())
@@ -400,7 +400,7 @@ void WW8Export::DoComboBox(uno::Reference<beans::XPropertySet> xPropSet)
if (nNoStrings)
{
uno::Any aTmp = xPropSet->getPropertyValue("DefaultText");
- const OUString *pStr = (const OUString *)aTmp.getValue();
+ const OUString *pStr = static_cast<const OUString *>(aTmp.getValue());
if (pStr)
sSelected = *pStr;
}
@@ -408,7 +408,7 @@ void WW8Export::DoComboBox(uno::Reference<beans::XPropertySet> xPropSet)
OUString sName;
{
uno::Any aTmp = xPropSet->getPropertyValue("Name");
- const OUString *pStr = (const OUString *)aTmp.getValue();
+ const OUString *pStr = static_cast<const OUString *>(aTmp.getValue());
if (pStr)
sName = *pStr;
}
@@ -419,7 +419,7 @@ void WW8Export::DoComboBox(uno::Reference<beans::XPropertySet> xPropSet)
try
{
uno::Any aTmp = xPropSet->getPropertyValue("HelpText");
- const OUString *pStr = (const OUString *)aTmp.getValue();
+ const OUString *pStr = static_cast<const OUString *>(aTmp.getValue());
if (pStr)
sHelp = *pStr;
}
@@ -430,7 +430,7 @@ void WW8Export::DoComboBox(uno::Reference<beans::XPropertySet> xPropSet)
OUString sToolTip;
{
uno::Any aTmp = xPropSet->getPropertyValue("Name");
- const OUString *pStr = (const OUString *)aTmp.getValue();
+ const OUString *pStr = static_cast<const OUString *>(aTmp.getValue());
if (pStr)
sToolTip = *pStr;
}
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index 3f853e516fb9..d3c0488c4870 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -2115,7 +2115,7 @@ bool WW8_WrPlcAnnotations::IsNewRedlineComment( const SwRedlineData *pRedline )
WW8_WrPlcAnnotations::~WW8_WrPlcAnnotations()
{
for( sal_uInt16 n=0; n < aCntnt.size(); n++ )
- delete (WW8_Annotation*)aCntnt[n];
+ delete static_cast<WW8_Annotation const *>(aCntnt[n]);
}
bool WW8_WrPlcSubDoc::WriteGenericTxt( WW8Export& rWrt, sal_uInt8 nTTyp,
@@ -2138,7 +2138,7 @@ bool WW8_WrPlcSubDoc::WriteGenericTxt( WW8Export& rWrt, sal_uInt8 nTTyp,
pTxtPos->Append( rWrt.Fc2Cp( rWrt.Strm().Tell() ));
rWrt.WritePostItBegin();
- const WW8_Annotation& rAtn = *(const WW8_Annotation*)aCntnt[i];
+ const WW8_Annotation& rAtn = *static_cast<const WW8_Annotation*>(aCntnt[i]);
if (rAtn.mpRichText)
rWrt.WriteOutliner(*rAtn.mpRichText, nTTyp);
else
@@ -2161,7 +2161,7 @@ bool WW8_WrPlcSubDoc::WriteGenericTxt( WW8Export& rWrt, sal_uInt8 nTTyp,
if( aCntnt[ i ] != NULL )
{
// is it an writer or sdr - textbox?
- const SdrObject& rObj = *(SdrObject*)aCntnt[ i ];
+ const SdrObject& rObj = *static_cast<SdrObject const *>(aCntnt[ i ]);
if (rObj.GetObjInventor() == FmFormInventor)
{
sal_uInt8 nOldTyp = rWrt.nTxtTyp;
@@ -2230,7 +2230,7 @@ bool WW8_WrPlcSubDoc::WriteGenericTxt( WW8Export& rWrt, sal_uInt8 nTTyp,
pTxtPos->Append( rWrt.Fc2Cp( rWrt.Strm().Tell() ));
// Note content
- const SwFmtFtn* pFtn = (SwFmtFtn*)aCntnt[ i ];
+ const SwFmtFtn* pFtn = static_cast<SwFmtFtn const *>(aCntnt[ i ]);
rWrt.WriteFtnBegin( *pFtn );
const SwNodeIndex* pIdx = pFtn->GetTxtFtn()->GetStartNode();
OSL_ENSURE( pIdx, "wo ist der StartNode der Fuss-/EndNote?" );
@@ -2295,7 +2295,7 @@ void WW8_WrPlcSubDoc::WriteGenericPlc( WW8Export& rWrt, sal_uInt8 nTTyp,
int nIdx = 0;
for ( i = 0; i < nLen; ++i )
{
- const WW8_Annotation& rAtn = *(const WW8_Annotation*)aCntnt[i];
+ const WW8_Annotation& rAtn = *static_cast<const WW8_Annotation*>(aCntnt[i]);
aStrArr.push_back(std::pair<OUString,OUString>(rAtn.msOwner,rAtn.m_sInitials));
// record start and end positions for ranges
if( rAtn.m_nRangeStart != rAtn.m_nRangeEnd )
@@ -2409,7 +2409,7 @@ void WW8_WrPlcSubDoc::WriteGenericPlc( WW8Export& rWrt, sal_uInt8 nTTyp,
{
for( i = 0; i < nLen; ++i )
{
- const WW8_Annotation& rAtn = *(const WW8_Annotation*)aCntnt[i];
+ const WW8_Annotation& rAtn = *static_cast<const WW8_Annotation*>(aCntnt[i]);
sal_uInt32 nDTTM = sw::ms::DateTime2DTTM(rAtn.maDateTime);
@@ -2439,7 +2439,7 @@ void WW8_WrPlcSubDoc::WriteGenericPlc( WW8Export& rWrt, sal_uInt8 nTTyp,
{
// write textbox story - FTXBXS
// is it an writer or sdr - textbox?
- const SdrObject* pObj = (SdrObject*)aCntnt[ i ];
+ const SdrObject* pObj = static_cast<SdrObject const *>(aCntnt[ i ]);
sal_Int32 nCnt = 1;
if (pObj && !pObj->ISA( SdrTextObj ) )
{
@@ -2507,7 +2507,7 @@ void WW8_WrPlcSubDoc::WriteGenericPlc( WW8Export& rWrt, sal_uInt8 nTTyp,
sal_uInt16 nlTag = 0;
for ( i = 0; i < nLen; ++i )
{
- const WW8_Annotation& rAtn = *(const WW8_Annotation*)aCntnt[i];
+ const WW8_Annotation& rAtn = *static_cast<const WW8_Annotation*>(aCntnt[i]);
//aStrArr is sorted
myiter aIter = ::std::lower_bound(aStrArr.begin(),
@@ -2567,7 +2567,7 @@ void WW8_WrPlcSubDoc::WriteGenericPlc( WW8Export& rWrt, sal_uInt8 nTTyp,
sal_uInt16 nNo = 0;
for ( i = 0; i < nLen; ++i ) // write Flags
{
- const SwFmtFtn* pFtn = (SwFmtFtn*)aCntnt[ i ];
+ const SwFmtFtn* pFtn = static_cast<SwFmtFtn const *>(aCntnt[ i ]);
SwWW8Writer::WriteShort( *rWrt.pTableStrm,
!pFtn->GetNumStr().isEmpty() ? 0 : ++nNo );
}
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index 3fbb88083f1e..3bf4b146133e 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -1372,7 +1372,7 @@ void SwWW8ImplReader::ReadGrafLayer1( WW8PLCFspecial* pPF, long nGrafAnchorCp )
OSL_ENSURE( false, "+Wo ist die Grafik (2) ?" );
return;
}
- WW8_FDOA* pF = (WW8_FDOA*)pF0;
+ WW8_FDOA* pF = static_cast<WW8_FDOA*>(pF0);
if( !SVBT32ToUInt32( pF->fc ) )
{
OSL_ENSURE( false, "+Wo ist die Grafik (3) ?" );
@@ -2407,7 +2407,7 @@ SwFrmFmt* SwWW8ImplReader::Read_GrafLayer( long nGrafAnchorCp )
return 0;
}
- WW8_FSPA_SHADOW* pFS = (WW8_FSPA_SHADOW*)pF0;
+ WW8_FSPA_SHADOW* pFS = static_cast<WW8_FSPA_SHADOW*>(pF0);
WW8_FSPA* pF;
WW8_FSPA aFSFA;
pF = &aFSFA;
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index c49cba55e50c..e2446d1c2ef3 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -646,7 +646,7 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt,
{
if( !rTextRect.IsEmpty() )
{
- SvxMSDffImportData& rImportData = *(SvxMSDffImportData*)pData;
+ SvxMSDffImportData& rImportData = *static_cast<SvxMSDffImportData*>(pData);
SvxMSDffImportRec* pImpRec = new SvxMSDffImportRec;
// fill Import Record with data
@@ -2165,7 +2165,7 @@ long SwWW8ImplReader::Read_And(WW8PLCFManResult* pRes)
OUString sInitials;
if( bVer67 )
{
- const WW67_ATRD* pDescri = (const WW67_ATRD*)pSD->GetData();
+ const WW67_ATRD* pDescri = static_cast<const WW67_ATRD*>(pSD->GetData());
const OUString* pA = GetAnnotationAuthor(SVBT16ToShort(pDescri->ibst));
if (pA)
sAuthor = *pA;
@@ -2175,7 +2175,7 @@ long SwWW8ImplReader::Read_And(WW8PLCFManResult* pRes)
}
else
{
- const WW8_ATRD* pDescri = (const WW8_ATRD*)pSD->GetData();
+ const WW8_ATRD* pDescri = static_cast<const WW8_ATRD*>(pSD->GetData());
{
const sal_uInt16 nLen = SVBT16ToShort(pDescri->xstUsrInitl[0]);
@@ -3643,7 +3643,7 @@ bool SwWW8ImplReader::ReadChar(long nPosCp, long nCpOfs)
WW8_FC nPos;
void *pData;
pTest->Get(nPos, pData);
- sal_uInt32 nData = SVBT32ToUInt32(*(SVBT32*)pData);
+ sal_uInt32 nData = SVBT32ToUInt32(*static_cast<SVBT32*>(pData));
if (nData & 0x2) // Might be how it works
{
TabCellEnd();
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index c0c8205ca231..e91c18987d04 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -390,13 +390,13 @@ long SwWW8ImplReader::Read_Ftn(WW8PLCFManResult* pRes)
{
aDesc.meType = MAN_EDN;
if (pPlcxMan->GetEdn())
- aDesc.mbAutoNum = 0 != *(short*)pPlcxMan->GetEdn()->GetData();
+ aDesc.mbAutoNum = 0 != *static_cast<short const *>(pPlcxMan->GetEdn()->GetData());
}
else
{
aDesc.meType = MAN_FTN;
if (pPlcxMan->GetFtn())
- aDesc.mbAutoNum = 0 != *(short*)pPlcxMan->GetFtn()->GetData();
+ aDesc.mbAutoNum = 0 != *static_cast<short const *>(pPlcxMan->GetFtn()->GetData());
}
aDesc.mnStartCp = pRes->nCp2OrIdx;
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 15a17a8d0199..5081e7abe48d 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -821,7 +821,7 @@ void wwSectionManager::CreateSep(const long nTxtPos, bool /*bMustHaveBreak*/)
bool bSuccess = pWkb->Get(nTest, pData);
if (!bSuccess)
return;
- OUString sSectionName = mrReader.aLinkStringMap[SVBT16ToShort( ((WW8_WKB*)pData)->nLinkId) ];
+ OUString sSectionName = mrReader.aLinkStringMap[SVBT16ToShort( static_cast<WW8_WKB*>(pData)->nLinkId) ];
sSectionName = mrReader.ConvertFFileName(sSectionName);
SwSectionData aSection(FILE_LINK_SECTION, sSectionName);
aSection.SetLinkFileName( sSectionName );
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 8c4f8287708a..11c117b8fa83 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -981,7 +981,7 @@ void WW8PLCFx_PCDAttrs::GetSprms(WW8PLCFxDesc* p)
return;
}
- const sal_uInt16 nPrm = SVBT16ToShort( ( (WW8_PCD*)pData )->prm );
+ const sal_uInt16 nPrm = SVBT16ToShort( static_cast<WW8_PCD*>(pData)->prm );
if ( nPrm & 1 )
{
// PRM Variant 2
@@ -1203,7 +1203,7 @@ WW8_FC WW8PLCFx_PCD::AktPieceStartCp2Fc( WW8_CP nCp )
nCp = nCpEnd - 1;
bool bIsUnicode = false;
- WW8_FC nFC = SVBT32ToUInt32( ((WW8_PCD*)pData)->fc );
+ WW8_FC nFC = SVBT32ToUInt32( static_cast<WW8_PCD*>(pData)->fc );
if( !bVer67 )
nFC = WW8PLCFx_PCD::TransformPieceAddress( nFC, bIsUnicode );
@@ -1231,7 +1231,7 @@ WW8_CP WW8PLCFx_PCD::AktPieceStartFc2Cp( WW8_FC nStartPos )
return WW8_CP_MAX;
}
bool bIsUnicode = false;
- sal_Int32 nFcStart = SVBT32ToUInt32( ((WW8_PCD*)pData)->fc );
+ sal_Int32 nFcStart = SVBT32ToUInt32( static_cast<WW8_PCD*>(pData)->fc );
if( !bVer67 )
nFcStart = WW8PLCFx_PCD::TransformPieceAddress( nFcStart, bIsUnicode );
@@ -1404,7 +1404,7 @@ WW8_CP WW8ScannerBase::WW8Fc2Cp( WW8_FC nFcPos ) const
OSL_ENSURE( false, "PLCFpcd-WW8Fc2Cp() went wrong" );
break;
}
- sal_Int32 nFcStart = SVBT32ToUInt32( ((WW8_PCD*)pData)->fc );
+ sal_Int32 nFcStart = SVBT32ToUInt32( static_cast<WW8_PCD*>(pData)->fc );
if (pWw8Fib->nVersion >= 8)
{
nFcStart = WW8PLCFx_PCD::TransformPieceAddress( nFcStart,
@@ -1503,7 +1503,7 @@ WW8_FC WW8ScannerBase::WW8Cp2Fc(WW8_CP nCpPos, bool* pIsUnicode,
if( pNextPieceCp )
*pNextPieceCp = nCpEnd;
- WW8_FC nRet = SVBT32ToUInt32( ((WW8_PCD*)pData)->fc );
+ WW8_FC nRet = SVBT32ToUInt32( static_cast<WW8_PCD*>(pData)->fc );
if (pWw8Fib->nVersion >= 8)
nRet = WW8PLCFx_PCD::TransformPieceAddress( nRet, *pIsUnicode );
else
@@ -1802,13 +1802,13 @@ static bool WW8SkipField(WW8PLCFspecial& rPLCF)
rPLCF.advance();
- if((((sal_uInt8*)pData)[0] & 0x1f ) != 0x13 ) // No beginning?
+ if((static_cast<sal_uInt8*>(pData)[0] & 0x1f ) != 0x13 ) // No beginning?
return true; // Do not terminate on error
if( !rPLCF.Get( nP, pData ) )
return false;
- while((((sal_uInt8*)pData)[0] & 0x1f ) == 0x13 )
+ while((static_cast<sal_uInt8*>(pData)[0] & 0x1f ) == 0x13 )
{
// still new (nested) beginnings ?
WW8SkipField( rPLCF ); // nested Field in description
@@ -1816,7 +1816,7 @@ static bool WW8SkipField(WW8PLCFspecial& rPLCF)
return false;
}
- if((((sal_uInt8*)pData)[0] & 0x1f ) == 0x14 )
+ if((static_cast<sal_uInt8*>(pData)[0] & 0x1f ) == 0x14 )
{
// Field Separator ?
@@ -1825,7 +1825,7 @@ static bool WW8SkipField(WW8PLCFspecial& rPLCF)
if( !rPLCF.Get( nP, pData ) )
return false;
- while ((((sal_uInt8*)pData)[0] & 0x1f ) == 0x13)
+ while ((static_cast<sal_uInt8*>(pData)[0] & 0x1f ) == 0x13)
{
// still new (nested) beginnings?
WW8SkipField( rPLCF ); // nested Field in Results
@@ -1850,10 +1850,10 @@ static bool WW8GetFieldPara(WW8PLCFspecial& rPLCF, WW8FieldDesc& rF)
rPLCF.advance();
- if (!pData || (((sal_uInt8*)pData)[0] & 0x1f) != 0x13) // No beginning?
+ if (!pData || (static_cast<sal_uInt8*>(pData)[0] & 0x1f) != 0x13) // No beginning?
goto Err;
- rF.nId = ((sal_uInt8*)pData)[1];
+ rF.nId = static_cast<sal_uInt8*>(pData)[1];
if( !rPLCF.Get( rF.nLCode, pData ) )
goto Err;
@@ -1862,7 +1862,7 @@ static bool WW8GetFieldPara(WW8PLCFspecial& rPLCF, WW8FieldDesc& rF)
rF.nSCode++; // without markers
rF.nLCode -= rF.nSCode; // Pos -> length
- while((((sal_uInt8*)pData)[0] & 0x1f ) == 0x13 )
+ while((static_cast<sal_uInt8*>(pData)[0] & 0x1f ) == 0x13 )
{
// still new (nested) beginnings ?
WW8SkipField( rPLCF ); // nested Field in description
@@ -1871,14 +1871,14 @@ static bool WW8GetFieldPara(WW8PLCFspecial& rPLCF, WW8FieldDesc& rF)
goto Err;
}
- if ((((sal_uInt8*)pData)[0] & 0x1f ) == 0x14 ) // Field Separator?
+ if ((static_cast<sal_uInt8*>(pData)[0] & 0x1f ) == 0x14 ) // Field Separator?
{
rPLCF.advance();
if( !rPLCF.Get( rF.nLRes, pData ) )
goto Err;
- while((((sal_uInt8*)pData)[0] & 0x1f ) == 0x13 )
+ while((static_cast<sal_uInt8*>(pData)[0] & 0x1f ) == 0x13 )
{
// still new (nested) beginnings ?
WW8SkipField( rPLCF ); // nested Field in results
@@ -1896,11 +1896,11 @@ static bool WW8GetFieldPara(WW8PLCFspecial& rPLCF, WW8FieldDesc& rF)
}
rPLCF.advance();
- if((((sal_uInt8*)pData)[0] & 0x1f ) == 0x15 )
+ if((static_cast<sal_uInt8*>(pData)[0] & 0x1f ) == 0x15 )
{
// Field end ?
// INDEX-Fld has set Bit7?
- rF.nOpt = ((sal_uInt8*)pData)[1]; // yes -> copy flags
+ rF.nOpt = static_cast<sal_uInt8*>(pData)[1]; // yes -> copy flags
}else{
rF.nId = 0; // no -> Field invalid
}
@@ -2869,7 +2869,7 @@ bool WW8PLCFx_Fc_FKP::NewFkp()
return false; // PLCF completely processed
}
pPLCF->advance();
- long nPo = SVBT16ToShort( (sal_uInt8 *)pPage );
+ long nPo = SVBT16ToShort( static_cast<sal_uInt8 *>(pPage) );
nPo <<= 9; // shift as LONG
long nAktFkpFilePos = pFkp ? pFkp->GetFilePos() : -1;
@@ -2970,7 +2970,7 @@ bool WW8PLCFx_Fc_FKP::SeekPos(WW8_FC nFcPos)
void* pPage;
if( pFkp && pPLCF->Get( nPLCFStart, nPLCFEnd, pPage ) )
{
- long nPo = SVBT16ToShort( (sal_uInt8 *)pPage );
+ long nPo = SVBT16ToShort( static_cast<sal_uInt8 *>(pPage) );
nPo <<= 9; // shift as LONG
if (nPo != pFkp->GetFilePos())
pFkp = 0;
@@ -3274,7 +3274,7 @@ void WW8PLCFx_Cp_FKP::GetSprms(WW8PLCFxDesc* p)
return;
}
- WW8_FC nLimitFC = SVBT32ToUInt32( ((WW8_PCD*)pData)->fc );
+ WW8_FC nLimitFC = SVBT32ToUInt32( static_cast<WW8_PCD*>(pData)->fc );
WW8_FC nBeginLimitFC = nLimitFC;
if (IsEightPlus(GetFIBVersion()))
{
@@ -3326,7 +3326,7 @@ void WW8PLCFx_Cp_FKP::GetSprms(WW8PLCFxDesc* p)
break;
}
bIsUnicode = false;
- sal_Int32 nFcStart=SVBT32ToUInt32(((WW8_PCD*)pData)->fc);
+ sal_Int32 nFcStart=SVBT32ToUInt32(static_cast<WW8_PCD*>(pData)->fc);
if (IsEightPlus(GetFIBVersion()))
{
@@ -3456,7 +3456,7 @@ void WW8PLCFx_SEPX::GetSprms(WW8PLCFxDesc* p)
}
else
{
- sal_uInt32 nPo = SVBT32ToUInt32( (sal_uInt8*)pData+2 );
+ sal_uInt32 nPo = SVBT32ToUInt32( static_cast<sal_uInt8*>(pData)+2 );
if (nPo == 0xFFFFFFFF)
{
p->nStartPos = p->nEndPos = WW8_CP_MAX; // Sepx empty
@@ -3751,7 +3751,7 @@ bool WW8PLCFx_FLD::StartPosIsFieldStart()
sal_Int32 nTest;
if (
(!pPLCF || !pPLCF->Get(nTest, pData) ||
- ((((sal_uInt8*)pData)[0] & 0x1f) != 0x13))
+ ((static_cast<sal_uInt8*>(pData)[0] & 0x1f) != 0x13))
)
return false;
return true;
@@ -3769,7 +3769,7 @@ bool WW8PLCFx_FLD::EndPosIsFieldEnd(WW8_CP& nCP)
void* pData;
sal_Int32 nTest;
- if ( pPLCF->Get(nTest, pData) && ((((sal_uInt8*)pData)[0] & 0x1f) == 0x15) )
+ if ( pPLCF->Get(nTest, pData) && ((static_cast<sal_uInt8*>(pData)[0] & 0x1f) == 0x15) )
{
nCP = nTest;
bRet = true;
@@ -4102,7 +4102,7 @@ void WW8PLCFx_Book::advance()
else
{
const void * p = pBook[0]->GetData(pBook[0]->GetIdx());
- long nPairFor = (p == NULL)? 0L : SVBT16ToShort(*((SVBT16*) p));
+ long nPairFor = (p == NULL)? 0L : SVBT16ToShort(*static_cast<SVBT16 const *>(p));
if (nPairFor == pBook[1]->GetIdx())
nIsEnd = 0;
else
@@ -4125,7 +4125,7 @@ long WW8PLCFx_Book::GetLen() const
OSL_ENSURE( false, "Incorrect call (2) of PLCF_Book::GetLen()" );
return 0;
}
- const sal_uInt16 nEndIdx = SVBT16ToShort( *((SVBT16*)p) );
+ const sal_uInt16 nEndIdx = SVBT16ToShort( *static_cast<SVBT16*>(p) );
long nNum = pBook[1]->GetPos( nEndIdx );
nNum -= nStartPos;
return nNum;
@@ -4155,7 +4155,7 @@ long WW8PLCFx_Book::GetHandle() const
else
{
if (const void* p = pBook[0]->GetData(pBook[0]->GetIdx()))
- return SVBT16ToShort( *((SVBT16*)p) );
+ return SVBT16ToShort( *static_cast<SVBT16 const *>(p) );
else
return LONG_MAX;
}
@@ -4174,7 +4174,7 @@ OUString WW8PLCFx_Book::GetBookmark(long nStart,long nEnd, sal_uInt16 &nIndex)
sal_uInt16 nEndIdx;
if( pBook[0]->GetData( i, nStartAkt, p ) && p )
- nEndIdx = SVBT16ToShort( *((SVBT16*)p) );
+ nEndIdx = SVBT16ToShort( *static_cast<SVBT16*>(p) );
else
{
OSL_ENSURE( false, "Bookmark-EndIdx not readable" );
@@ -4347,7 +4347,7 @@ void WW8PLCFx_AtnBook::advance()
else
{
const void * p = m_pBook[0]->GetData(m_pBook[0]->GetIdx());
- long nPairFor = (p == NULL)? 0L : SVBT16ToShort(*((SVBT16*) p));
+ long nPairFor = (p == NULL)? 0L : SVBT16ToShort(*static_cast<SVBT16 const *>(p));
if (nPairFor == m_pBook[1]->GetIdx())
m_bIsEnd = false;
else
diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
index 2bf19fd5a95b..5534068aeb3d 100644
--- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx
+++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
@@ -273,12 +273,12 @@ XMLRedlineImportHelper::XMLRedlineImportHelper(
}
// get redline mode
- bShowChanges = *(sal_Bool*)
+ bShowChanges = *static_cast<sal_Bool const *>(
( bHandleShowChanges ? xModelPropertySet : xImportInfoPropertySet )
- ->getPropertyValue( sShowChanges ).getValue();
- bRecordChanges = *(sal_Bool*)
+ ->getPropertyValue( sShowChanges ).getValue());
+ bRecordChanges = *static_cast<sal_Bool const *>(
( bHandleRecordChanges ? xModelPropertySet : xImportInfoPropertySet )
- ->getPropertyValue( sRecordChanges ).getValue();
+ ->getPropertyValue( sRecordChanges ).getValue());
{
Any aAny = (bHandleProtectionKey ? xModelPropertySet
: xImportInfoPropertySet )
diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx
index b3854f81234f..9b028d38690f 100644
--- a/sw/source/filter/xml/swxml.cxx
+++ b/sw/source/filter/xml/swxml.cxx
@@ -343,7 +343,7 @@ sal_Int32 ReadThroughComponent(
Any aAny = xProps->getPropertyValue("Encrypted");
bool bEncrypted = aAny.getValueType() == ::getBooleanCppuType() &&
- *(sal_Bool *)aAny.getValue();
+ *static_cast<sal_Bool const *>(aAny.getValue());
uno::Reference <io::XInputStream> xInputStream = xStream->getInputStream();
@@ -905,10 +905,10 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, c
// restore redline mode from import info property set
sal_Int16 nRedlineMode = nsRedlineMode_t::REDLINE_SHOW_INSERT;
aAny = xInfoSet->getPropertyValue( sShowChanges );
- if ( *(sal_Bool*)aAny.getValue() )
+ if ( *static_cast<sal_Bool const *>(aAny.getValue()) )
nRedlineMode |= nsRedlineMode_t::REDLINE_SHOW_DELETE;
aAny = xInfoSet->getPropertyValue( sRecordChanges );
- if ( *(sal_Bool*)aAny.getValue() || (aKey.getLength() > 0) )
+ if ( *static_cast<sal_Bool const *>(aAny.getValue()) || (aKey.getLength() > 0) )
nRedlineMode |= nsRedlineMode_t::REDLINE_ON;
else
nRedlineMode |= nsRedlineMode_t::REDLINE_NONE;
diff --git a/sw/source/filter/xml/wrtxml.cxx b/sw/source/filter/xml/wrtxml.cxx
index 221e4fb9022b..61eaa7f775ee 100644
--- a/sw/source/filter/xml/wrtxml.cxx
+++ b/sw/source/filter/xml/wrtxml.cxx
@@ -406,7 +406,7 @@ sal_uInt32 SwXMLWriter::_Write( const uno::Reference < task::XStatusIndicator >&
nRedlineMode = pDoc->getIDocumentRedlineAccess().GetRedlineMode();
nRedlineMode &= ~nsRedlineMode_t::REDLINE_SHOW_MASK;
nRedlineMode |= nsRedlineMode_t::REDLINE_SHOW_INSERT;
- if ( *(sal_Bool*)aAny.getValue() )
+ if ( *static_cast<sal_Bool const *>(aAny.getValue()) )
nRedlineMode |= nsRedlineMode_t::REDLINE_SHOW_DELETE;
pDoc->getIDocumentRedlineAccess().SetRedlineMode((RedlineMode_t)( nRedlineMode ));
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index 237ab8e8bf1a..07a35f94524a 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -388,8 +388,8 @@ void SwXMLExport::GetViewSettings(Sequence<PropertyValue>& aProps)
const OUString sShowChanges( "ShowChanges" );
if( xInfoSet->getPropertySetInfo()->hasPropertyByName( sShowChanges ) )
{
- bShowRedlineChanges = *(sal_Bool*) xInfoSet->
- getPropertyValue( sShowChanges ).getValue();
+ bShowRedlineChanges = *static_cast<sal_Bool const *>(xInfoSet->
+ getPropertyValue( sShowChanges ).getValue());
}
}
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index a7747541d405..c1f846334ac3 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -1044,13 +1044,13 @@ void SwXMLImport::SetViewSettings(const Sequence < PropertyValue > & aViewProps)
}
else if ( pValue->Name == "ShowRedlineChanges" )
{
- bShowRedlineChanges = *(sal_Bool *)(pValue->Value.getValue());
+ bShowRedlineChanges = *static_cast<sal_Bool const *>(pValue->Value.getValue());
bChangeShowRedline = true;
}
// Headers and footers are not displayed in BrowseView anymore
else if ( pValue->Name == "InBrowseMode" )
{
- bBrowseMode = *(sal_Bool *)(pValue->Value.getValue());
+ bBrowseMode = *static_cast<sal_Bool const *>(pValue->Value.getValue());
bChangeBrowseMode = true;
}
pValue++;
diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx
index 2efe361f7693..e700b133cf88 100644
--- a/sw/source/filter/xml/xmltble.cxx
+++ b/sw/source/filter/xml/xmltble.cxx
@@ -816,7 +816,7 @@ void SwXMLExport::ExportTableBox( const SwTableBox& rBox,
// cell protection
aAny = xCellPropertySet->getPropertyValue(sIsProtected);
- if (*(sal_Bool*)aAny.getValue())
+ if (*static_cast<sal_Bool const *>(aAny.getValue()))
{
AddAttribute( XML_NAMESPACE_TABLE, XML_PROTECTED,
XML_TRUE );
diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx
index a9307b60a993..5a70eb307cc9 100644
--- a/sw/source/filter/xml/xmltexti.cxx
+++ b/sw/source/filter/xml/xmltexti.cxx
@@ -802,13 +802,13 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertFloatingFra
{
case CTF_FRAME_DISPLAY_SCROLLBAR:
{
- bool bYes = *(sal_Bool *)rProp.maValue.getValue();
+ bool bYes = *static_cast<sal_Bool const *>(rProp.maValue.getValue());
eScrollMode = bYes ? ScrollingYes : ScrollingNo;
}
break;
case CTF_FRAME_DISPLAY_BORDER:
{
- bHasBorder = *(sal_Bool *)rProp.maValue.getValue();
+ bHasBorder = *static_cast<sal_Bool const *>(rProp.maValue.getValue());
bIsBorderSet = true;
}
break;
diff --git a/sw/source/ui/chrdlg/swuiccoll.cxx b/sw/source/ui/chrdlg/swuiccoll.cxx
index 0422bbcc7aa8..610fc9f6305c 100644
--- a/sw/source/ui/chrdlg/swuiccoll.cxx
+++ b/sw/source/ui/chrdlg/swuiccoll.cxx
@@ -125,7 +125,7 @@ SwCondCollPage::SwCondCollPage(vcl::Window *pParent, const SfxItemSet &rSet)
SwCondCollPage::~SwCondCollPage()
{
for(sal_Int32 i = 0; i < m_pFilterLB->GetEntryCount(); ++i)
- delete (sal_uInt16*)m_pFilterLB->GetEntryData(i);
+ delete static_cast<sal_uInt16*>(m_pFilterLB->GetEntryData(i));
}
@@ -247,7 +247,7 @@ IMPL_LINK( SwCondCollPage, SelectHdl, ListBox*, pBox)
{
m_pStyleLB->Clear();
const sal_Int32 nSelPos = pBox->GetSelectEntryPos();
- const sal_uInt16 nSearchFlags = *(sal_uInt16*)m_pFilterLB->GetEntryData(nSelPos);
+ const sal_uInt16 nSearchFlags = *static_cast<sal_uInt16*>(m_pFilterLB->GetEntryData(nSelPos));
SfxStyleSheetBasePool* pPool = rSh.GetView().GetDocShell()->GetStyleSheetPool();
pPool->SetSearchMask(SFX_STYLE_FAMILY_PARA, nSearchFlags);
const SfxStyleSheetBase* pBase = pPool->First();
diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx
index 7915bc90efb2..05adb529f089 100644
--- a/sw/source/ui/config/optload.cxx
+++ b/sw/source/ui/config/optload.cxx
@@ -252,7 +252,7 @@ void SwLoadOptPage::Reset( const SfxItemSet* rSet)
const SfxPoolItem* pItem;
if(SfxItemState::SET == rSet->GetItemState(FN_PARAM_WRTSHELL, false, &pItem))
- m_pWrtShell = (SwWrtShell*)static_cast<const SwPtrItem*>(pItem)->GetValue();
+ m_pWrtShell = static_cast<SwWrtShell*>(static_cast<const SwPtrItem*>(pItem)->GetValue());
SwFldUpdateFlags eFldFlags = AUTOUPD_GLOBALSETTING;
m_nOldLinkMode = GLOBALSETTING;
@@ -538,7 +538,7 @@ bool SwCaptionOptPage::FillItemSet( SfxItemSet* )
while (pEntry)
{
- InsCaptionOpt* pData = (InsCaptionOpt*)pEntry->GetUserData();
+ InsCaptionOpt* pData = static_cast<InsCaptionOpt*>(pEntry->GetUserData());
bRet |= pModOpt->SetCapOption(bHTMLMode, pData);
pEntry = m_pCheckLB->Next(pEntry);
}
@@ -621,7 +621,7 @@ void SwCaptionOptPage::DelUserData()
while (pEntry)
{
- delete (InsCaptionOpt*)pEntry->GetUserData();
+ delete static_cast<InsCaptionOpt*>(pEntry->GetUserData());
pEntry->SetUserData(0);
pEntry = m_pCheckLB->Next(pEntry);
}
@@ -646,7 +646,7 @@ IMPL_LINK_NOARG(SwCaptionOptPage, ShowEntryHdl)
SwWrtShell *pSh = ::GetActiveWrtShell();
- InsCaptionOpt* pOpt = (InsCaptionOpt*)pSelEntry->GetUserData();
+ InsCaptionOpt* pOpt = static_cast<InsCaptionOpt*>(pSelEntry->GetUserData());
m_pCategoryBox->Clear();
m_pCategoryBox->InsertEntry(m_sNone);
@@ -752,7 +752,7 @@ void SwCaptionOptPage::SaveEntry(SvTreeListEntry* pEntry)
{
if (pEntry)
{
- InsCaptionOpt* pOpt = (InsCaptionOpt*)pEntry->GetUserData();
+ InsCaptionOpt* pOpt = static_cast<InsCaptionOpt*>(pEntry->GetUserData());
pOpt->UseCaption() = m_pCheckLB->IsChecked(m_pCheckLB->GetModel()->GetAbsPos(pEntry));
const OUString aName( m_pCategoryBox->GetText() );
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index ae130f3514c2..eba0445ab18d 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -763,7 +763,7 @@ void SwStdFontTabPage::Reset( const SfxItemSet* rSet)
if(SfxItemState::SET == rSet->GetItemState(FN_PARAM_PRINTER, false, &pItem))
{
- pPrt = (SfxPrinter*)static_cast<const SwPtrItem*>(pItem)->GetValue();
+ pPrt = static_cast<SfxPrinter*>(static_cast<const SwPtrItem*>(pItem)->GetValue());
}
else
{
@@ -800,12 +800,12 @@ void SwStdFontTabPage::Reset( const SfxItemSet* rSet)
}
if(SfxItemState::SET == rSet->GetItemState(FN_PARAM_STDFONTS, false, &pItem))
{
- pFontConfig = (SwStdFontConfig*)static_cast<const SwPtrItem*>(pItem)->GetValue();
+ pFontConfig = static_cast<SwStdFontConfig*>(static_cast<const SwPtrItem*>(pItem)->GetValue());
}
if(SfxItemState::SET == rSet->GetItemState(FN_PARAM_WRTSHELL, false, &pItem))
{
- pWrtShell = (SwWrtShell*)static_cast<const SwPtrItem*>(pItem)->GetValue();
+ pWrtShell = static_cast<SwWrtShell*>(static_cast<const SwPtrItem*>(pItem)->GetValue());
}
OUString sStdBackup;
OUString sOutBackup;
@@ -1745,7 +1745,7 @@ bool SwRedlineOptionsTabPage::FillItemSet( SfxItemSet* )
sal_Int32 nPos = pInsertLB->GetSelectEntryPos();
if (nPos != LISTBOX_ENTRY_NOTFOUND)
{
- pAttr = (CharAttr *)pInsertLB->GetEntryData(nPos);
+ pAttr = static_cast<CharAttr *>(pInsertLB->GetEntryData(nPos));
aInsertedAttr.nItemId = pAttr->nItemId;
aInsertedAttr.nAttr = pAttr->nAttr;
@@ -1771,7 +1771,7 @@ bool SwRedlineOptionsTabPage::FillItemSet( SfxItemSet* )
nPos = pDeletedLB->GetSelectEntryPos();
if (nPos != LISTBOX_ENTRY_NOTFOUND)
{
- pAttr = (CharAttr *)pDeletedLB->GetEntryData(nPos);
+ pAttr = static_cast<CharAttr *>(pDeletedLB->GetEntryData(nPos));
aDeletedAttr.nItemId = pAttr->nItemId;
aDeletedAttr.nAttr = pAttr->nAttr;
@@ -1797,7 +1797,7 @@ bool SwRedlineOptionsTabPage::FillItemSet( SfxItemSet* )
nPos = pChangedLB->GetSelectEntryPos();
if (nPos != LISTBOX_ENTRY_NOTFOUND)
{
- pAttr = (CharAttr *)pChangedLB->GetEntryData(nPos);
+ pAttr = static_cast<CharAttr *>(pChangedLB->GetEntryData(nPos));
aChangedAttr.nItemId = pAttr->nItemId;
aChangedAttr.nAttr = pAttr->nAttr;
@@ -2028,7 +2028,7 @@ IMPL_LINK( SwRedlineOptionsTabPage, AttribHdl, ListBox *, pLB )
if( nPos == LISTBOX_ENTRY_NOTFOUND )
nPos = 0;
- CharAttr* pAttr = ( CharAttr* ) pLB->GetEntryData( nPos );
+ CharAttr* pAttr = static_cast<CharAttr*>(pLB->GetEntryData( nPos ));
//switch off preview background color
pPrev->ResetColor();
switch (pAttr->nItemId)
@@ -2104,7 +2104,7 @@ IMPL_LINK( SwRedlineOptionsTabPage, ColorHdl, ColorListBox *, pColorLB )
if( nPos == LISTBOX_ENTRY_NOTFOUND )
nPos = 0;
- CharAttr* pAttr = ( CharAttr* ) pLB->GetEntryData( nPos );
+ CharAttr* pAttr = static_cast<CharAttr*>(pLB->GetEntryData( nPos ));
if( pAttr->nItemId == SID_ATTR_BRUSH )
{
diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx
index c676590ef5a6..daf8855fd5b6 100644
--- a/sw/source/ui/dbui/dbinsdlg.cxx
+++ b/sw/source/ui/dbui/dbinsdlg.cxx
@@ -1648,13 +1648,13 @@ void SwInsertDBColAutoPilot::Load()
pDataSourceProps[5] >>= pNewData->sTmplNm;
pDataSourceProps[6] >>= pNewData->sTAutoFmtNm;
if(pDataSourceProps[7].hasValue())
- pNewData->bIsTable = *(sal_Bool*)pDataSourceProps[7].getValue();
+ pNewData->bIsTable = *static_cast<sal_Bool const *>(pDataSourceProps[7].getValue());
if(pDataSourceProps[8].hasValue())
- pNewData->bIsField = *(sal_Bool*)pDataSourceProps[8].getValue();
+ pNewData->bIsField = *static_cast<sal_Bool const *>(pDataSourceProps[8].getValue());
if(pDataSourceProps[9].hasValue())
- pNewData->bIsHeadlineOn = *(sal_Bool*)pDataSourceProps[9].getValue();
+ pNewData->bIsHeadlineOn = *static_cast<sal_Bool const *>(pDataSourceProps[9].getValue());
if(pDataSourceProps[10].hasValue())
- pNewData->bIsEmptyHeadln = *(sal_Bool*)pDataSourceProps[10].getValue();
+ pNewData->bIsEmptyHeadln = *static_cast<sal_Bool const *>(pDataSourceProps[10].getValue());
const OUString sSubNodeName(pNames[nNode] + "/ColumnSet/");
Sequence <OUString> aSubNames = GetNodeNames(sSubNodeName);
@@ -1684,9 +1684,9 @@ void SwInsertDBColAutoPilot::Load()
pSubProps[1] >>= nIndex;
SwInsDBColumn* pInsDBColumn = new SwInsDBColumn(sColumn, nIndex);
if(pSubProps[2].hasValue())
- pInsDBColumn->bHasFmt = *(sal_Bool*)pSubProps[2].getValue();
+ pInsDBColumn->bHasFmt = *static_cast<sal_Bool const *>(pSubProps[2].getValue());
if(pSubProps[3].hasValue())
- pInsDBColumn->bIsDBFmt = *(sal_Bool*)pSubProps[3].getValue();
+ pInsDBColumn->bIsDBFmt = *static_cast<sal_Bool const *>(pSubProps[3].getValue());
pSubProps[4] >>= pInsDBColumn->sUsrNumFmt;
OUString sNumberFormatLocale;
diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx
index cd8af756ab45..9210d30effe9 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -398,7 +398,7 @@ bool SwEditRegionDlg::CheckPasswd(CheckBox* pBox)
SvTreeListEntry* pEntry = m_pTree->FirstSelected();
while( pEntry )
{
- SectReprPtr pRepr = (SectReprPtr)pEntry->GetUserData();
+ SectReprPtr pRepr = static_cast<SectReprPtr>(pEntry->GetUserData());
if (!pRepr->GetTempPasswd().getLength()
&& pRepr->GetSectionData().GetPassword().getLength())
{
@@ -519,7 +519,7 @@ SwEditRegionDlg::~SwEditRegionDlg( )
SvTreeListEntry* pEntry = m_pTree->First();
while( pEntry )
{
- delete (SectRepr*)pEntry->GetUserData();
+ delete static_cast<SectRepr*>(pEntry->GetUserData());
pEntry = m_pTree->Next( pEntry );
}
@@ -531,7 +531,7 @@ void SwEditRegionDlg::SelectSection(const OUString& rSectionName)
SvTreeListEntry* pEntry = m_pTree->First();
while(pEntry)
{
- SectReprPtr pRepr = (SectReprPtr)pEntry->GetUserData();
+ SectReprPtr pRepr = static_cast<SectReprPtr>(pEntry->GetUserData());
if (pRepr->GetSectionData().GetSectionName() == rSectionName)
break;
pEntry = m_pTree->Next(pEntry);
@@ -583,7 +583,7 @@ IMPL_LINK( SwEditRegionDlg, GetFirstEntryHdl, SvTreeListBox *, pBox )
while( pEntry )
{
- SectRepr* pRepr=(SectRepr*) pEntry->GetUserData();
+ SectRepr* pRepr=static_cast<SectRepr*>(pEntry->GetUserData());
SwSectionData const& rData( pRepr->GetSectionData() );
if(bFirst)
{
@@ -655,7 +655,7 @@ IMPL_LINK( SwEditRegionDlg, GetFirstEntryHdl, SvTreeListBox *, pBox )
{
m_pCurName->Enable(true);
m_pOptionsPB->Enable(true);
- SectRepr* pRepr=(SectRepr*) pEntry->GetUserData();
+ SectRepr* pRepr=static_cast<SectRepr*>(pEntry->GetUserData());
SwSectionData const& rData( pRepr->GetSectionData() );
m_pConditionED->SetText(rData.GetCondition());
m_pHideCB->Enable();
@@ -750,7 +750,7 @@ IMPL_LINK_NOARG(SwEditRegionDlg, OkHdl)
while( pEntry )
{
- SectReprPtr pRepr = (SectReprPtr) pEntry->GetUserData();
+ SectReprPtr pRepr = static_cast<SectReprPtr>(pEntry->GetUserData());
SwSectionFmt* pFmt = aOrigArray[ pRepr->GetArrPos() ];
if (!pRepr->GetSectionData().IsProtectFlag())
{
@@ -819,7 +819,7 @@ IMPL_LINK( SwEditRegionDlg, ChangeProtectHdl, TriStateBox *, pBox )
bool bCheck = TRISTATE_TRUE == pBox->GetState();
while( pEntry )
{
- SectReprPtr pRepr = (SectReprPtr) pEntry->GetUserData();
+ SectReprPtr pRepr = static_cast<SectReprPtr>(pEntry->GetUserData());
pRepr->GetSectionData().SetProtectFlag(bCheck);
Image aImage = BuildBitmap(bCheck,
TRISTATE_TRUE == m_pHideCB->GetState());
@@ -842,7 +842,7 @@ IMPL_LINK( SwEditRegionDlg, ChangeHideHdl, TriStateBox *, pBox )
OSL_ENSURE(pEntry,"no entry found");
while( pEntry )
{
- SectReprPtr pRepr = (SectReprPtr) pEntry->GetUserData();
+ SectReprPtr pRepr = static_cast<SectReprPtr>(pEntry->GetUserData());
pRepr->GetSectionData().SetHidden(TRISTATE_TRUE == pBox->GetState());
Image aImage = BuildBitmap(TRISTATE_TRUE == m_pProtectCB->GetState(),
@@ -869,7 +869,7 @@ IMPL_LINK( SwEditRegionDlg, ChangeEditInReadonlyHdl, TriStateBox *, pBox )
OSL_ENSURE(pEntry,"no entry found");
while( pEntry )
{
- SectReprPtr pRepr = (SectReprPtr) pEntry->GetUserData();
+ SectReprPtr pRepr = static_cast<SectReprPtr>(pEntry->GetUserData());
pRepr->GetSectionData().SetEditInReadonlyFlag(
TRISTATE_TRUE == pBox->GetState());
pEntry = m_pTree->NextSelected(pEntry);
@@ -889,7 +889,7 @@ IMPL_LINK_NOARG(SwEditRegionDlg, ChangeDismissHdl)
// at first mark all selected
while(pEntry)
{
- const SectReprPtr pSectRepr = (SectRepr*)pEntry->GetUserData();
+ const SectReprPtr pSectRepr = static_cast<SectRepr*>(pEntry->GetUserData());
pSectRepr->SetSelected();
pEntry = m_pTree->NextSelected(pEntry);
}
@@ -897,7 +897,7 @@ IMPL_LINK_NOARG(SwEditRegionDlg, ChangeDismissHdl)
// then delete
while(pEntry)
{
- const SectReprPtr pSectRepr = (SectRepr*)pEntry->GetUserData();
+ const SectReprPtr pSectRepr = static_cast<SectRepr*>(pEntry->GetUserData());
SvTreeListEntry* pRemove = 0;
bool bRestart = false;
if(pSectRepr->IsSelected())
@@ -956,7 +956,7 @@ IMPL_LINK( SwEditRegionDlg, UseFileHdl, CheckBox *, pBox )
{
while(pEntry)
{
- const SectReprPtr pSectRepr = (SectRepr*)pEntry->GetUserData();
+ const SectReprPtr pSectRepr = static_cast<SectRepr*>(pEntry->GetUserData());
bool bContent = pSectRepr->IsContent();
if( pBox->IsChecked() && bContent && rSh.HasSelection() )
{
@@ -1022,7 +1022,7 @@ IMPL_LINK_NOARG(SwEditRegionDlg, OptionsHdl)
if(pEntry)
{
- SectReprPtr pSectRepr = (SectRepr*)pEntry->GetUserData();
+ SectReprPtr pSectRepr = static_cast<SectRepr*>(pEntry->GetUserData());
SfxItemSet aSet(rSh.GetView().GetPool(),
RES_COL, RES_COL,
RES_COLUMNBALANCE, RES_FRAMEDIR,
@@ -1088,7 +1088,7 @@ IMPL_LINK_NOARG(SwEditRegionDlg, OptionsHdl)
SvTreeListEntry* pSelEntry = m_pTree->FirstSelected();
while( pSelEntry )
{
- SectReprPtr pRepr = (SectReprPtr)pSelEntry->GetUserData();
+ SectReprPtr pRepr = static_cast<SectReprPtr>(pSelEntry->GetUserData());
if( SfxItemState::SET == eColState )
pRepr->GetCol() = *static_cast<const SwFmtCol*>(pColItem);
if( SfxItemState::SET == eBrushState )
@@ -1123,7 +1123,7 @@ IMPL_LINK( SwEditRegionDlg, FileNameHdl, Edit *, pEdit )
pEdit->SetSelection(aSelect);
SvTreeListEntry* pEntry = m_pTree->FirstSelected();
OSL_ENSURE(pEntry,"no entry found");
- SectReprPtr pSectRepr = (SectRepr*)pEntry->GetUserData();
+ SectReprPtr pSectRepr = static_cast<SectRepr*>(pEntry->GetUserData());
if (pEdit == m_pFileNameED)
{
m_bSubRegionsFilled = false;
@@ -1172,7 +1172,7 @@ IMPL_LINK( SwEditRegionDlg, DDEHdl, CheckBox*, pBox )
if(pEntry)
{
bool bFile = m_pFileCB->IsChecked();
- SectReprPtr pSectRepr = (SectRepr*)pEntry->GetUserData();
+ SectReprPtr pSectRepr = static_cast<SectRepr*>(pEntry->GetUserData());
SwSectionData & rData( pSectRepr->GetSectionData() );
bool bDDE = pBox->IsChecked();
if(bDDE)
@@ -1227,7 +1227,7 @@ IMPL_LINK( SwEditRegionDlg, ChangePasswdHdl, Button *, pBox )
OSL_ENSURE(pEntry,"no entry found");
while( pEntry )
{
- SectReprPtr pRepr = (SectReprPtr)pEntry->GetUserData();
+ SectReprPtr pRepr = static_cast<SectReprPtr>(pEntry->GetUserData());
if(bSet)
{
if(!pRepr->GetTempPasswd().getLength() || bChange)
@@ -1278,7 +1278,7 @@ IMPL_LINK_NOARG(SwEditRegionDlg, NameEditHdl)
{
const OUString aName = m_pCurName->GetText();
m_pTree->SetEntryText(pEntry,aName);
- SectReprPtr pRepr = (SectReprPtr) pEntry->GetUserData();
+ SectReprPtr pRepr = static_cast<SectReprPtr>(pEntry->GetUserData());
pRepr->GetSectionData().SetSectionName(aName);
m_pOK->Enable(!aName.isEmpty());
@@ -1296,7 +1296,7 @@ IMPL_LINK( SwEditRegionDlg, ConditionEditHdl, Edit *, pEdit )
OSL_ENSURE(pEntry,"no entry found");
while( pEntry )
{
- SectReprPtr pRepr = (SectReprPtr)pEntry->GetUserData();
+ SectReprPtr pRepr = static_cast<SectReprPtr>(pEntry->GetUserData());
pRepr->GetSectionData().SetCondition(pEdit->GetText());
pEntry = m_pTree->NextSelected(pEntry);
}
@@ -1324,7 +1324,7 @@ IMPL_LINK( SwEditRegionDlg, DlgClosedHdl, sfx2::FileDialogHelper *, _pFileDlg )
OSL_ENSURE( pEntry, "no entry found" );
if ( pEntry )
{
- SectReprPtr pSectRepr = (SectRepr*)pEntry->GetUserData();
+ SectReprPtr pSectRepr = static_cast<SectRepr*>(pEntry->GetUserData());
pSectRepr->SetFile( sFileName );
pSectRepr->SetFilter( sFilterName );
pSectRepr->GetSectionData().SetLinkFilePassword(sPassword);
diff --git a/sw/source/ui/envelp/label1.cxx b/sw/source/ui/envelp/label1.cxx
index 9856c170a97d..363775d54d69 100644
--- a/sw/source/ui/envelp/label1.cxx
+++ b/sw/source/ui/envelp/label1.cxx
@@ -546,7 +546,7 @@ void SwVisitingCardPage::ClearUserData()
SvTreeListEntry* pEntry = m_pAutoTextLB->First();
while(pEntry)
{
- delete (OUString*)pEntry->GetUserData();
+ delete static_cast<OUString*>(pEntry->GetUserData());
pEntry = m_pAutoTextLB->Next(pEntry);
}
}
@@ -587,7 +587,7 @@ SwVisitingCardPage::SwVisitingCardPage(vcl::Window* pParent, const SfxItemSet& r
SwVisitingCardPage::~SwVisitingCardPage()
{
for(sal_Int32 i = 0; i < m_pAutoTextGroupLB->GetEntryCount(); ++i)
- delete (OUString*)m_pAutoTextGroupLB->GetEntryData( i );
+ delete static_cast<OUString*>(m_pAutoTextGroupLB->GetEntryData( i ));
m_xAutoText = 0;
ClearUserData();
@@ -614,7 +614,7 @@ int SwVisitingCardPage::DeactivatePage(SfxItemSet* _pSet)
bool SwVisitingCardPage::FillItemSet(SfxItemSet* rSet)
{
- const OUString* pGroup = (const OUString*)m_pAutoTextGroupLB->GetSelectEntryData();
+ const OUString* pGroup = static_cast<const OUString*>(m_pAutoTextGroupLB->GetSelectEntryData());
OSL_ENSURE(pGroup, "no group selected?");
if (pGroup)
@@ -622,7 +622,7 @@ bool SwVisitingCardPage::FillItemSet(SfxItemSet* rSet)
SvTreeListEntry* pSelEntry = m_pAutoTextLB->FirstSelected();
if(pSelEntry)
- aLabItem.sGlossaryBlockName = *(OUString*)pSelEntry->GetUserData();
+ aLabItem.sGlossaryBlockName = *static_cast<OUString*>(pSelEntry->GetUserData());
rSet->Put(aLabItem);
return true;
}
@@ -632,7 +632,7 @@ static void lcl_SelectBlock(SvTreeListBox& rAutoTextLB, const OUString& rBlockNa
SvTreeListEntry* pEntry = rAutoTextLB.First();
while(pEntry)
{
- if(*(OUString*)pEntry->GetUserData() == rBlockName)
+ if(*static_cast<OUString*>(pEntry->GetUserData()) == rBlockName)
{
rAutoTextLB.Select(pEntry);
rAutoTextLB.MakeVisible(pEntry);
@@ -647,7 +647,7 @@ static bool lcl_FindBlock(SvTreeListBox& rAutoTextLB, const OUString& rBlockName
SvTreeListEntry* pEntry = rAutoTextLB.First();
while(pEntry)
{
- if(*(OUString*)pEntry->GetUserData() == rBlockName)
+ if(*static_cast<OUString*>(pEntry->GetUserData()) == rBlockName)
{
rAutoTextLB.Select(pEntry);
return true;
@@ -664,7 +664,7 @@ void SwVisitingCardPage::Reset(const SfxItemSet* rSet)
bool bFound = false;
sal_Int32 i;
for(i = 0; i < m_pAutoTextGroupLB->GetEntryCount(); i++)
- if( aLabItem.sGlossaryGroup == *(const OUString*)m_pAutoTextGroupLB->GetEntryData( i ))
+ if( aLabItem.sGlossaryGroup == *static_cast<const OUString*>(m_pAutoTextGroupLB->GetEntryData( i )))
{
bFound = true;
break;
@@ -675,7 +675,7 @@ void SwVisitingCardPage::Reset(const SfxItemSet* rSet)
// initially search for a group starting with "crd" which is the name of the
// business card AutoTexts
for(i = 0; i < m_pAutoTextGroupLB->GetEntryCount(); i++)
- if (((const OUString*)m_pAutoTextGroupLB->GetEntryData(i))->startsWith("crd"))
+ if (static_cast<const OUString*>(m_pAutoTextGroupLB->GetEntryData(i))->startsWith("crd"))
{
bFound = true;
break;
@@ -692,7 +692,7 @@ void SwVisitingCardPage::Reset(const SfxItemSet* rSet)
{
SvTreeListEntry* pSelEntry = m_pAutoTextLB->FirstSelected();
if( pSelEntry &&
- *(OUString*)pSelEntry->GetUserData() != aLabItem.sGlossaryBlockName)
+ *static_cast<OUString*>(pSelEntry->GetUserData()) != aLabItem.sGlossaryBlockName)
{
lcl_SelectBlock(*m_pAutoTextLB, aLabItem.sGlossaryBlockName);
AutoTextSelectHdl(m_pAutoTextLB);
diff --git a/sw/source/ui/envelp/labelexp.cxx b/sw/source/ui/envelp/labelexp.cxx
index 0babacb2b69c..bfcbb44dc61d 100644
--- a/sw/source/ui/envelp/labelexp.cxx
+++ b/sw/source/ui/envelp/labelexp.cxx
@@ -79,7 +79,7 @@ void SwVisitingCardPage::InitFrameControl()
if(LISTBOX_ENTRY_NOTFOUND == m_pAutoTextGroupLB->GetSelectEntryPos())
m_pAutoTextGroupLB->SelectEntryPos(0);
const OUString *pCurGroupName(
- (const OUString*)m_pAutoTextGroupLB->GetSelectEntryData());
+ static_cast<const OUString*>(m_pAutoTextGroupLB->GetSelectEntryData()));
if(m_xAutoText->hasByName(*pCurGroupName))
{
uno::Any aGroup = m_xAutoText->getByName(*pCurGroupName);
@@ -106,13 +106,13 @@ IMPL_LINK_NOARG(SwVisitingCardPage, FrameControlInitializedHdl)
SvTreeListEntry* pSel = m_pAutoTextLB->FirstSelected();
OUString sEntry;
if( pSel )
- sEntry = *(OUString*)pSel->GetUserData();
+ sEntry = *static_cast<OUString*>(pSel->GetUserData());
uno::Reference< text::XTextCursor > & xCrsr = pExampleFrame->GetTextCursor();
OUString uEntry(sEntry);
if(LISTBOX_ENTRY_NOTFOUND != m_pAutoTextGroupLB->GetSelectEntryPos())
{
- const OUString *pGroup( (const OUString*)m_pAutoTextGroupLB->GetSelectEntryData() );
+ const OUString *pGroup( static_cast<const OUString*>(m_pAutoTextGroupLB->GetSelectEntryData()) );
uno::Any aGroup = m_xAutoText->getByName(*pGroup);
uno::Reference< text::XAutoTextGroup > xGroup;
aGroup >>= xGroup;
@@ -139,7 +139,7 @@ IMPL_LINK( SwVisitingCardPage, AutoTextSelectHdl, void*, pBox )
{
if (m_pAutoTextGroupLB == pBox)
{
- const OUString *pGroup( (const OUString*)m_pAutoTextGroupLB->GetSelectEntryData());
+ const OUString *pGroup( static_cast<const OUString*>(m_pAutoTextGroupLB->GetSelectEntryData()));
uno::Any aGroup = m_xAutoText->getByName(*pGroup);
uno::Reference< text::XAutoTextGroup > xGroup;
aGroup >>= xGroup;
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index cece56081bd1..94e4b02b6b23 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -1231,7 +1231,7 @@ void SwFrmPage::InitPos(RndStdIds eId,
nPos = m_pVertRelationLB->GetSelectEntryPos();
if (nPos != LISTBOX_ENTRY_NOTFOUND)
- nOldVRel = ((RelationMap *)m_pVertRelationLB->GetEntryData(nPos))->nRelation;
+ nOldVRel = static_cast<RelationMap *>(m_pVertRelationLB->GetEntryData(nPos))->nRelation;
}
nPos = m_pHorizontalDLB->GetSelectEntryPos();
@@ -1241,7 +1241,7 @@ void SwFrmPage::InitPos(RndStdIds eId,
nPos = m_pHoriRelationLB->GetSelectEntryPos();
if (nPos != LISTBOX_ENTRY_NOTFOUND)
- nOldHRel = ((RelationMap *)m_pHoriRelationLB->GetEntryData(nPos))->nRelation;
+ nOldHRel = static_cast<RelationMap *>(m_pHoriRelationLB->GetEntryData(nPos))->nRelation;
}
bool bEnable = true;
@@ -1464,7 +1464,7 @@ sal_uLong SwFrmPage::FillRelLB( const FrmMap* _pMap,
{
for (sal_Int32 i = 0; i < _rLB.GetEntryCount(); i++)
{
- RelationMap *pEntry = (RelationMap *)_rLB.GetEntryData(i);
+ RelationMap *pEntry = static_cast<RelationMap *>(_rLB.GetEntryData(i));
if (pEntry->nLBRelation == LB_REL_CHAR) // default
{
_rLB.SelectEntryPos(i);
@@ -1554,7 +1554,7 @@ sal_uLong SwFrmPage::FillRelLB( const FrmMap* _pMap,
default:
if (_rLB.GetEntryCount())
{
- RelationMap *pEntry = (RelationMap *)_rLB.GetEntryData(_rLB.GetEntryCount() - 1);
+ RelationMap *pEntry = static_cast<RelationMap *>(_rLB.GetEntryData(_rLB.GetEntryCount() - 1));
nSimRel = pEntry->nRelation;
}
break;
@@ -1562,7 +1562,7 @@ sal_uLong SwFrmPage::FillRelLB( const FrmMap* _pMap,
for (sal_Int32 i = 0; i < _rLB.GetEntryCount(); i++)
{
- RelationMap *pEntry = (RelationMap *)_rLB.GetEntryData(i);
+ RelationMap *pEntry = static_cast<RelationMap *>(_rLB.GetEntryData(i));
if (pEntry->nRelation == nSimRel)
{
_rLB.SelectEntryPos(i);
@@ -1592,7 +1592,7 @@ sal_Int16 SwFrmPage::GetRelation(FrmMap * /*pMap*/, ListBox &rRelationLB)
if (nPos != LISTBOX_ENTRY_NOTFOUND)
{
- RelationMap *pEntry = (RelationMap *)rRelationLB.GetEntryData(nPos);
+ RelationMap *pEntry = static_cast<RelationMap *>(rRelationLB.GetEntryData(nPos));
return pEntry->nRelation;
}
@@ -1618,8 +1618,8 @@ sal_Int16 SwFrmPage::GetAlignment(FrmMap *pMap, sal_Int32 nMapPos,
if (rRelationLB.GetSelectEntryPos() == LISTBOX_ENTRY_NOTFOUND)
return 0;
- const RelationMap *const pRelationMap = (const RelationMap *const )
- rRelationLB.GetSelectEntryData();
+ const RelationMap *const pRelationMap = static_cast<const RelationMap *>(
+ rRelationLB.GetSelectEntryData());
const sal_uLong nRel = pRelationMap->nLBRelation;
const SvxSwFramePosString::StringId eStrId = pMap[nMapPos].eStrId;
@@ -1937,7 +1937,7 @@ IMPL_LINK( SwFrmPage, PosHdl, ListBox *, pLB )
{
if (pRelLB->GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND)
- nRel = ((RelationMap *)pRelLB->GetSelectEntryData())->nRelation;
+ nRel = static_cast<RelationMap *>(pRelLB->GetSelectEntryData())->nRelation;
FillRelLB(pMap, nMapPos, nAlign, nRel, *pRelLB, *pRelFT);
}
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index fd7a35b92e1b..5361bcd72cd4 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -1067,7 +1067,7 @@ void SwTOXSelectTabPage::ApplyTOXDescription()
LanguageHdl(0);
for( sal_Int32 nCnt = 0; nCnt < m_pSortAlgorithmLB->GetEntryCount(); ++nCnt )
{
- const OUString* pEntryData = (const OUString*)m_pSortAlgorithmLB->GetEntryData( nCnt );
+ const OUString* pEntryData = static_cast<const OUString*>(m_pSortAlgorithmLB->GetEntryData( nCnt ));
OSL_ENSURE(pEntryData, "no entry data available");
if( pEntryData && *pEntryData == rDesc.GetSortAlgorithm())
{
@@ -1184,7 +1184,7 @@ void SwTOXSelectTabPage::FillTOXDescription()
rDesc.SetStyleNames(aStyleArr[i], i);
rDesc.SetLanguage(m_pLanguageLB->GetSelectLanguage());
- const OUString* pEntryData = (const OUString*)m_pSortAlgorithmLB->GetSelectEntryData();
+ const OUString* pEntryData = static_cast<const OUString*>(m_pSortAlgorithmLB->GetSelectEntryData());
OSL_ENSURE(pEntryData, "no entry data available");
if(pEntryData)
rDesc.SetSortAlgorithm(*pEntryData);
@@ -1379,13 +1379,13 @@ IMPL_LINK(SwTOXSelectTabPage, LanguageHdl, ListBox*, pBox)
OUString sOldString;
void* pUserData;
if( 0 != (pUserData = m_pSortAlgorithmLB->GetSelectEntryData()) )
- sOldString = *(OUString*)pUserData;
+ sOldString = *static_cast<OUString*>(pUserData);
sal_Int32 nEnd = m_pSortAlgorithmLB->GetEntryCount();
for( sal_Int32 n = 0; n < nEnd; ++n )
{
void* pDel = m_pSortAlgorithmLB->GetEntryData( n );
if( 0 != pDel )
- delete (OUString*)pDel;
+ delete static_cast<OUString*>(pDel);
}
m_pSortAlgorithmLB->Clear();
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 );
}
diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx
index 0a0bd7e9c64d..0f4930909dec 100644
--- a/sw/source/ui/table/tabledlg.cxx
+++ b/sw/source/ui/table/tabledlg.cxx
@@ -453,7 +453,7 @@ void SwFormatTablePage::Reset( const SfxItemSet* )
if(SfxItemState::SET == rSet.GetItemState( FN_TABLE_REP, false, &pItem ))
{
- pTblData = (SwTableRep*)static_cast<const SwPtrItem*>( pItem)->GetValue();
+ pTblData = static_cast<SwTableRep*>(static_cast<const SwPtrItem*>( pItem)->GetValue());
nMinTableWidth = pTblData->GetColCount() * MINLAY;
if(pTblData->GetWidthPercent())
@@ -767,7 +767,7 @@ void SwTableColumnPage::Reset( const SfxItemSet* )
const SfxPoolItem* pItem;
if(SfxItemState::SET == rSet.GetItemState( FN_TABLE_REP, false, &pItem ))
{
- pTblData = (SwTableRep*)static_cast<const SwPtrItem*>( pItem)->GetValue();
+ pTblData = static_cast<SwTableRep*>(static_cast<const SwPtrItem*>( pItem)->GetValue());
nNoOfVisibleCols = pTblData->GetColCount();
nNoOfCols = pTblData->GetAllColCount();
nTableWidth = pTblData->GetAlign() != text::HoriOrientation::FULL &&
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index 47ede5c4a0c8..f264775577ba 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -812,8 +812,8 @@ void SwDocShell::Execute(SfxRequest& rReq)
::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >
xRef( pClipCntnr );
- pClipCntnr->CopyAnyData( SotClipboardFormatId::RTF, (sal_Char*)
- pStrm->GetData(), pStrm->GetEndOfData() );
+ pClipCntnr->CopyAnyData( SotClipboardFormatId::RTF, static_cast<sal_Char const *>(
+ pStrm->GetData()), pStrm->GetEndOfData() );
pClipCntnr->CopyToClipboard(
GetView()? &GetView()->GetEditWin() : 0 );
delete pStrm;
diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx
index 6583dafb5d88..de99a36e8e97 100644
--- a/sw/source/uibase/app/docst.cxx
+++ b/sw/source/uibase/app/docst.cxx
@@ -415,7 +415,7 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq )
nMask = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
if( SfxItemState::SET == pArgs->GetItemState(FN_PARAM_WRTSHELL,
false, &pItem ))
- pActShell = pShell = (SwWrtShell*)static_cast<const SwPtrItem*>(pItem)->GetValue();
+ pActShell = pShell = static_cast<SwWrtShell*>(static_cast<const SwPtrItem*>(pItem)->GetValue());
if( nSlot == SID_STYLE_UPDATE_BY_EXAMPLE )
{
diff --git a/sw/source/uibase/app/swdll.cxx b/sw/source/uibase/app/swdll.cxx
index cd26bf9d9765..7a12f244e286 100644
--- a/sw/source/uibase/app/swdll.cxx
+++ b/sw/source/uibase/app/swdll.cxx
@@ -81,7 +81,7 @@ namespace SwGlobals
SwDLL::SwDLL()
{
// the SdModule must be created
- SwModule** ppShlPtr = (SwModule**) GetAppData(SHL_WRITER);
+ SwModule** ppShlPtr = reinterpret_cast<SwModule**>(GetAppData(SHL_WRITER));
if ( *ppShlPtr )
return;
diff --git a/sw/source/uibase/config/modcfg.cxx b/sw/source/uibase/config/modcfg.cxx
index 52a97e248d01..94a651f58ee2 100644
--- a/sw/source/uibase/config/modcfg.cxx
+++ b/sw/source/uibase/config/modcfg.cxx
@@ -807,7 +807,7 @@ static void lcl_ReadOpt(InsCaptionOpt& rOpt, const Any* pValues, sal_Int32 nProp
switch(nOffset)
{
case 0:
- rOpt.UseCaption() = *(sal_Bool*)pValues[nProp].getValue();
+ rOpt.UseCaption() = *static_cast<sal_Bool const *>(pValues[nProp].getValue());
break;//Enable
case 1:
{
@@ -904,7 +904,7 @@ void SwInsertConfig::Load()
{
if(pValues[nProp].hasValue())
{
- bool bBool = nProp < INS_PROP_CAP_OBJECT_TABLE_ENABLE && *(sal_Bool*)pValues[nProp].getValue();
+ bool bBool = nProp < INS_PROP_CAP_OBJECT_TABLE_ENABLE && *static_cast<sal_Bool const *>(pValues[nProp].getValue());
switch(nProp)
{
case INS_PROP_TABLE_HEADER:
@@ -1177,9 +1177,9 @@ void SwTableConfig::Load()
case 2 : pValues[nProp] >>= nTemp; nTblHInsert = (sal_uInt16)convertMm100ToTwip(nTemp); break; //"Insert/Row",
case 3 : pValues[nProp] >>= nTemp; nTblVInsert = (sal_uInt16)convertMm100ToTwip(nTemp); break; //"Insert/Column",
case 4 : pValues[nProp] >>= nTemp; eTblChgMode = (TblChgMode)nTemp; break; //"Change/Effect",
- case 5 : bInsTblFormatNum = *(sal_Bool*)pValues[nProp].getValue(); break; //"Input/NumberRecognition",
- case 6 : bInsTblChangeNumFormat = *(sal_Bool*)pValues[nProp].getValue(); break; //"Input/NumberFormatRecognition",
- case 7 : bInsTblAlignNum = *(sal_Bool*)pValues[nProp].getValue(); break; //"Input/Alignment"
+ case 5 : bInsTblFormatNum = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break; //"Input/NumberRecognition",
+ case 6 : bInsTblChangeNumFormat = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break; //"Input/NumberFormatRecognition",
+ case 7 : bInsTblAlignNum = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break; //"Input/Alignment"
}
}
}
@@ -1284,16 +1284,16 @@ void SwMiscConfig::Load()
case 0 : pValues[nProp] >>= sTmp;
sWordDelimiter = SwModuleOptions::ConvertWordDelimiter(sTmp, true);
break;
- case 1 : bDefaultFontsInCurrDocOnly = *(sal_Bool*)pValues[nProp].getValue(); break;
- case 2 : bShowIndexPreview = *(sal_Bool*)pValues[nProp].getValue(); break;
- case 3 : bGrfToGalleryAsLnk = *(sal_Bool*)pValues[nProp].getValue(); break;
- case 4 : bNumAlignSize = *(sal_Bool*)pValues[nProp].getValue(); break;
- case 5 : bSinglePrintJob = *(sal_Bool*)pValues[nProp].getValue(); break;
+ case 1 : bDefaultFontsInCurrDocOnly = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
+ case 2 : bShowIndexPreview = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
+ case 3 : bGrfToGalleryAsLnk = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
+ case 4 : bNumAlignSize = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
+ case 5 : bSinglePrintJob = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
case 6 : pValues[nProp] >>= nMailingFormats; ; break;
case 7 : pValues[nProp] >>= sTmp; sNameFromColumn = sTmp; break;
case 8 : pValues[nProp] >>= sTmp; sMailingPath = sTmp; break;
case 9 : pValues[nProp] >>= sTmp; sMailName = sTmp; break;
- case 10: bIsNameFromColumn = *(sal_Bool*)pValues[nProp].getValue(); break;
+ case 10: bIsNameFromColumn = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
case 11: pValues[nProp] >>= bAskForMailMergeInPrint; break;
}
}
@@ -1373,10 +1373,10 @@ void SwCompareConfig::Load()
switch(nProp)
{
case 0 : eCmpMode = (SvxCompareMode) nVal; break;;
- case 1 : bUseRsid = *(sal_Bool*)pValues[nProp].getValue(); break;
- case 2 : bIgnorePieces = *(sal_Bool*)pValues[nProp].getValue(); break;
+ case 1 : bUseRsid = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
+ case 2 : bIgnorePieces = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
case 3 : nPieceLen = nVal; break;
- case 4 : m_bStoreRsid = *(sal_Bool*)pValues[nProp].getValue(); break;
+ case 4 : m_bStoreRsid = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
}
}
}
diff --git a/sw/source/uibase/config/prtopt.cxx b/sw/source/uibase/config/prtopt.cxx
index e3c8cb2a0cb3..39672cfba3ce 100644
--- a/sw/source/uibase/config/prtopt.cxx
+++ b/sw/source/uibase/config/prtopt.cxx
@@ -85,11 +85,11 @@ SwPrintOptions::SwPrintOptions(bool bWeb) :
{
switch(nProp)
{
- case 0: bPrintGraphic = *(sal_Bool*)pValues[nProp].getValue(); break;
- case 1: bPrintTable = *(sal_Bool*)pValues[nProp].getValue(); break;
- case 2: bPrintControl = *(sal_Bool*)pValues[nProp].getValue() ; break;
- case 3: bPrintPageBackground= *(sal_Bool*)pValues[nProp].getValue(); break;
- case 4: bPrintBlackFont = *(sal_Bool*)pValues[nProp].getValue(); break;
+ case 0: bPrintGraphic = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
+ case 1: bPrintTable = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
+ case 2: bPrintControl = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
+ case 3: bPrintPageBackground= *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
+ case 4: bPrintBlackFont = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
case 5:
{
sal_Int32 nTmp = 0;
@@ -97,18 +97,18 @@ SwPrintOptions::SwPrintOptions(bool bWeb) :
nPrintPostIts = (sal_Int16)nTmp;
}
break;
- case 6: bPrintReverse = *(sal_Bool*)pValues[nProp].getValue(); break;
- case 7: bPrintProspect = *(sal_Bool*)pValues[nProp].getValue(); break;
- case 8: bPrintProspectRTL = *(sal_Bool*)pValues[nProp].getValue(); break;
- case 9: bPrintSingleJobs = *(sal_Bool*)pValues[nProp].getValue(); break;
+ case 6: bPrintReverse = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
+ case 7: bPrintProspect = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
+ case 8: bPrintProspectRTL = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
+ case 9: bPrintSingleJobs = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
case 10: pValues[nProp] >>= sFaxName; break;
- case 11: bPaperFromSetup = *(sal_Bool*)pValues[nProp].getValue(); break;
- case 12: bPrintDraw = *(sal_Bool*)pValues[nProp].getValue() ; break;
- case 13: bPrintLeftPages = *(sal_Bool*)pValues[nProp].getValue(); break;
- case 14: bPrintRightPages = *(sal_Bool*)pValues[nProp].getValue(); break;
- case 15: bPrintEmptyPages = *(sal_Bool*)pValues[nProp].getValue(); break;
- case 16: bPrintTextPlaceholder = *(sal_Bool*)pValues[nProp].getValue(); break;
- case 17: bPrintHiddenText = *(sal_Bool*)pValues[nProp].getValue(); break;
+ case 11: bPaperFromSetup = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
+ case 12: bPrintDraw = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
+ case 13: bPrintLeftPages = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
+ case 14: bPrintRightPages = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
+ case 15: bPrintEmptyPages = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
+ case 16: bPrintTextPlaceholder = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
+ case 17: bPrintHiddenText = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
}
}
}
diff --git a/sw/source/uibase/config/usrpref.cxx b/sw/source/uibase/config/usrpref.cxx
index 017d885ced7e..757d3fd76420 100644
--- a/sw/source/uibase/config/usrpref.cxx
+++ b/sw/source/uibase/config/usrpref.cxx
@@ -177,7 +177,7 @@ void SwContentViewConfig::Load()
{
if(pValues[nProp].hasValue())
{
- bool bSet = nProp != 16 && *(sal_Bool*)pValues[nProp].getValue();
+ bool bSet = nProp != 16 && *static_cast<sal_Bool const *>(pValues[nProp].getValue());
switch(nProp)
{
case 0: rParent.SetGraphic(bSet); break;// "Display/GraphicObject",
@@ -430,7 +430,7 @@ void SwGridConfig::Load()
{
if(pValues[nProp].hasValue())
{
- bool bSet = nProp < 3 && *(sal_Bool*)pValues[nProp].getValue();
+ bool bSet = nProp < 3 && *static_cast<sal_Bool const *>(pValues[nProp].getValue());
sal_Int32 nSet = 0;
if(nProp >= 3)
pValues[nProp] >>= nSet;
@@ -514,7 +514,7 @@ void SwCursorConfig::Load()
bool bSet = false;
sal_Int32 nSet = 0;
if(nProp != 1 )
- bSet = *(sal_Bool*)pValues[nProp].getValue();
+ bSet = *static_cast<sal_Bool const *>(pValues[nProp].getValue());
else
pValues[nProp] >>= nSet;
switch(nProp)
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx
index 2e8d988be0ad..ed4c180dcb47 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -620,7 +620,7 @@ bool SwTransferable::WriteObject( SotStorageStreamRef& xStream,
case SWTRANSFER_OBJECTTYPE_DRAWMODEL:
{
// don't change the sequence of commands
- SdrModel *pModel = (SdrModel*)pObject;
+ SdrModel *pModel = static_cast<SdrModel*>(pObject);
xStream->SetBufferSize( 16348 );
// for the changed pool defaults from drawing layer pool set those
@@ -660,7 +660,7 @@ bool SwTransferable::WriteObject( SotStorageStreamRef& xStream,
case SWTRANSFER_OBJECTTYPE_SWOLE:
{
- SfxObjectShell* pEmbObj = (SfxObjectShell*) pObject;
+ SfxObjectShell* pEmbObj = static_cast<SfxObjectShell*>(pObject);
try
{
::utl::TempFile aTempFile;
@@ -704,7 +704,7 @@ bool SwTransferable::WriteObject( SotStorageStreamRef& xStream,
case SWTRANSFER_OBJECTTYPE_DDE:
{
xStream->SetBufferSize( 1024 );
- SwTrnsfrDdeLink* pDdeLnk = (SwTrnsfrDdeLink*)pObject;
+ SwTrnsfrDdeLink* pDdeLnk = static_cast<SwTrnsfrDdeLink*>(pObject);
if( pDdeLnk->WriteData( *xStream ) )
{
xStream->Commit();
@@ -738,7 +738,7 @@ bool SwTransferable::WriteObject( SotStorageStreamRef& xStream,
if( xWrt.Is() )
{
- SwDoc* pDoc = (SwDoc*)pObject;
+ SwDoc* pDoc = static_cast<SwDoc*>(pObject);
xWrt->bWriteClipboardDoc = true;
xWrt->bWriteOnlyFirstTable = 0 != (TRNSFR_TABELLE & eBufferType);
xWrt->SetShowProgress( false );
diff --git a/sw/source/uibase/docvw/SidebarWin.cxx b/sw/source/uibase/docvw/SidebarWin.cxx
index 9b254f5bf4ea..d60987bc5d10 100644
--- a/sw/source/uibase/docvw/SidebarWin.cxx
+++ b/sw/source/uibase/docvw/SidebarWin.cxx
@@ -1119,7 +1119,7 @@ IMPL_LINK( SwSidebarWin, WindowEventListener, VclSimpleEvent*, pEvent )
{
if ( pWinEvent->GetId() == VCLEVENT_WINDOW_MOUSEMOVE )
{
- MouseEvent* pMouseEvt = (MouseEvent*)pWinEvent->GetData();
+ MouseEvent* pMouseEvt = static_cast<MouseEvent*>(pWinEvent->GetData());
if ( pMouseEvt->IsEnterWindow() )
{
mbMouseOver = true;
diff --git a/sw/source/uibase/envelp/envimg.cxx b/sw/source/uibase/envelp/envimg.cxx
index d215a2d32cb6..f7dfd094de0e 100644
--- a/sw/source/uibase/envelp/envimg.cxx
+++ b/sw/source/uibase/envelp/envimg.cxx
@@ -187,7 +187,7 @@ SwEnvCfgItem::SwEnvCfgItem() :
{
case 0: pValues[nProp] >>= aEnvItem.aAddrText; break;// "Inscription/Addressee",
case 1: pValues[nProp] >>= aEnvItem.aSendText; break;// "Inscription/Sender",
- case 2: aEnvItem.bSend = *(sal_Bool*)pValues[nProp].getValue(); break;// "Inscription/UseSender",
+ case 2: aEnvItem.bSend = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;// "Inscription/UseSender",
case 3:
pValues[nProp] >>= aEnvItem.lAddrFromLeft;// "Format/AddresseeFromLeft",
aEnvItem.lAddrFromLeft = convertMm100ToTwip(aEnvItem.lAddrFromLeft);
@@ -217,7 +217,7 @@ SwEnvCfgItem::SwEnvCfgItem() :
sal_Int32 nTemp = 0;
pValues[nProp] >>= nTemp; aEnvItem.eAlign = (SwEnvAlign)nTemp; break;// "Print/Alignment",
}
- case 10: aEnvItem.bPrintFromAbove = *(sal_Bool*)pValues[nProp].getValue(); break;// "Print/FromAbove",
+ case 10: aEnvItem.bPrintFromAbove = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;// "Print/FromAbove",
case 11:
pValues[nProp] >>= aEnvItem.lShiftRight;
aEnvItem.lShiftRight = convertMm100ToTwip(aEnvItem.lShiftRight);// "Print/Right",
diff --git a/sw/source/uibase/envelp/labimg.cxx b/sw/source/uibase/envelp/labimg.cxx
index 067107570e1c..c295f5eb981a 100644
--- a/sw/source/uibase/envelp/labimg.cxx
+++ b/sw/source/uibase/envelp/labimg.cxx
@@ -287,7 +287,7 @@ SwLabCfgItem::SwLabCfgItem(bool bLabel) :
bNoConfigValues = false;
switch(nProperty)
{
- case 0: aItem.bCont = *(sal_Bool*)pValues[nProp].getValue(); break;// "Medium/Continuous",
+ case 0: aItem.bCont = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;// "Medium/Continuous",
case 1: pValues[nProp] >>= aItem.aMake; break;// "Medium/Brand",
case 2: pValues[nProp] >>= aItem.aType; break;// "Medium/Type",
case 3: pValues[nProp] >>= aItem.nCols; break;// "Format/Column",
@@ -324,11 +324,11 @@ SwLabCfgItem::SwLabCfgItem(bool bLabel) :
pValues[nProp] >>= aItem.lPHeight;
aItem.lPHeight = convertMm100ToTwip(aItem.lPHeight);
break;// "Format/PageHeight",
- case 13: aItem.bSynchron = *(sal_Bool*)pValues[nProp].getValue(); break;// "Option/Synchronize",
- case 14: aItem.bPage = *(sal_Bool*)pValues[nProp].getValue(); break;// "Option/Page",
+ case 13: aItem.bSynchron = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;// "Option/Synchronize",
+ case 14: aItem.bPage = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;// "Option/Page",
case 15: pValues[nProp] >>= aItem.nCol; break;// "Option/Column",
case 16: pValues[nProp] >>= aItem.nRow; break;// "Option/Row"
- case 17: aItem.bAddr = *(sal_Bool*)pValues[nProp].getValue(); break;// "Inscription/UseAddress",
+ case 17: aItem.bAddr = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;// "Inscription/UseAddress",
case 18: pValues[nProp] >>= aItem.aWriting; break;// "Inscription/Address",
case 19: pValues[nProp] >>= aItem.sDBName; break;// "Inscription/Database"
case 20: pValues[nProp] >>= aItem.aPrivFirstName; break;// "PrivateAddress/FirstName",
diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx
index 7fa6e73ef0d6..63847a49c35f 100644
--- a/sw/source/uibase/misc/redlndlg.cxx
+++ b/sw/source/uibase/misc/redlndlg.cxx
@@ -789,7 +789,7 @@ void SwRedlineAcceptDlg::CallAcceptReject( bool bSelect, bool bAccept )
if( bSelect && LONG_MAX == nPos )
nPos = pTable->GetModel()->GetAbsPos( pEntry );
- RedlinData *pData = (RedlinData *)pEntry->GetUserData();
+ RedlinData *pData = static_cast<RedlinData *>(pEntry->GetUserData());
if( !pData->bDisabled )
aRedlines.push_back( pEntry );
@@ -869,7 +869,7 @@ void SwRedlineAcceptDlg::CallAcceptReject( bool bSelect, bool bAccept )
sal_uInt16 SwRedlineAcceptDlg::GetRedlinePos( const SvTreeListEntry& rEntry ) const
{
SwWrtShell* pSh = ::GetActiveView()->GetWrtShellPtr();
- return pSh->FindRedlineOfData( *static_cast<SwRedlineDataParent*>(((RedlinData *)
+ return pSh->FindRedlineOfData( *static_cast<SwRedlineDataParent*>(static_cast<RedlinData *>(
rEntry.GetUserData())->pData)->pData );
}
diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx
index f9f4fc7bbad2..4ab605313a44 100644
--- a/sw/source/uibase/shells/tabsh.cxx
+++ b/sw/source/uibase/shells/tabsh.cxx
@@ -358,7 +358,7 @@ void ItemSetToTableParam( const SfxItemSet& rSet,
SfxItemSet aSet( rSh.GetAttrPool(), RES_FRMATR_BEGIN, RES_FRMATR_END-1 );
if(SfxItemState::SET == rSet.GetItemState( FN_TABLE_REP, false, &pItem ))
{
- pRep = (SwTableRep*)static_cast<const SwPtrItem*>(pItem)->GetValue();
+ pRep = static_cast<SwTableRep*>(static_cast<const SwPtrItem*>(pItem)->GetValue());
const SwTwips nWidth = pRep->GetWidth();
if ( text::HoriOrientation::FULL == pRep->GetAlign() )
diff --git a/sw/source/uibase/shells/textidx.cxx b/sw/source/uibase/shells/textidx.cxx
index a87dcb460f9e..f4647448d94f 100644
--- a/sw/source/uibase/shells/textidx.cxx
+++ b/sw/source/uibase/shells/textidx.cxx
@@ -125,7 +125,7 @@ void SwTextShell::ExecIdx(SfxRequest &rReq)
bool bGlobal = false;
if(pItem)
{
- pCurTOX = (const SwTOXBase* )static_cast<const SwPtrItem*>(pItem)->GetValue();
+ pCurTOX = static_cast<const SwTOXBase*>(static_cast<const SwPtrItem*>(pItem)->GetValue());
bGlobal = true;
}
else
diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx
index 7d119b63e553..fb92a818d428 100644
--- a/sw/source/uibase/uiview/view.cxx
+++ b/sw/source/uibase/uiview/view.cxx
@@ -466,7 +466,7 @@ extern "C"
{
static int lcl_CmpIds( const void *pFirst, const void *pSecond)
{
- return (*(sal_uInt16*)pFirst) - (*(sal_uInt16*)pSecond);
+ return *static_cast<sal_uInt16 const *>(pFirst) - *static_cast<sal_uInt16 const *>(pSecond);
}
}
@@ -1318,7 +1318,7 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue >
}
else if ( pValue->Name == "ViewLayoutBookMode" )
{
- bViewLayoutBookMode = * (sal_Bool *) pValue->Value.getValue();
+ bViewLayoutBookMode = * static_cast<sal_Bool const *>(pValue->Value.getValue());
bGotViewLayoutBookMode = true;
}
else if ( pValue->Name == "IsSelectedFrame" )
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index fc58b26861cd..e1f7b37f8017 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -389,7 +389,7 @@ bool SwView::InsertGraphicDlg( SfxRequest& rReq )
{
Any aVal = xCtrlAcc->getValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0);
OSL_ENSURE(aVal.hasValue(), "Value CBX_INSERT_AS_LINK not found");
- bAsLink = !aVal.hasValue() || *(sal_Bool*) aVal.getValue();
+ bAsLink = !aVal.hasValue() || *static_cast<sal_Bool const *>(aVal.getValue());
Any aTemplateValue = xCtrlAcc->getValue(
ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE,
ListboxControlActions::GET_SELECTED_ITEM );
@@ -424,7 +424,7 @@ bool SwView::InsertGraphicDlg( SfxRequest& rReq )
{
Any aVal = xCtrlAcc->getValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0);
OSL_ENSURE(aVal.hasValue(), "Value CBX_INSERT_AS_LINK not found");
- bAsLink = !aVal.hasValue() || *(sal_Bool*) aVal.getValue();
+ bAsLink = !aVal.hasValue() || *static_cast<sal_Bool const *>(aVal.getValue());
Any aTemplateValue = xCtrlAcc->getValue(
ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE,
ListboxControlActions::GET_SELECTED_ITEM );
diff --git a/sw/source/uibase/uno/SwXDocumentSettings.cxx b/sw/source/uibase/uno/SwXDocumentSettings.cxx
index 3cd2506da44f..990c20a25f98 100644
--- a/sw/source/uibase/uno/SwXDocumentSettings.cxx
+++ b/sw/source/uibase/uno/SwXDocumentSettings.cxx
@@ -337,7 +337,7 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
break;
case HANDLE_FIELD_AUTO_UPDATE:
{
- bool bUpdateField = *(sal_Bool*)rValue.getValue();
+ bool bUpdateField = *static_cast<sal_Bool const *>(rValue.getValue());
SwFldUpdateFlags nFlag = mpDoc->getIDocumentSettingAccess().getFieldUpdateFlags(true);
mpDoc->getIDocumentSettingAccess().setFieldUpdateFlags( bUpdateField ?
nFlag == AUTOUPD_FIELD_AND_CHARTS ?
@@ -348,7 +348,7 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
break;
case HANDLE_CHART_AUTO_UPDATE:
{
- bool bUpdateChart = *(sal_Bool*)rValue.getValue();
+ bool bUpdateChart = *static_cast<sal_Bool const *>(rValue.getValue());
SwFldUpdateFlags nFlag = mpDoc->getIDocumentSettingAccess().getFieldUpdateFlags(true);
mpDoc->getIDocumentSettingAccess().setFieldUpdateFlags( (nFlag == AUTOUPD_FIELD_ONLY || nFlag == AUTOUPD_FIELD_AND_CHARTS ) ?
bUpdateChart ?
@@ -373,7 +373,7 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
break;
case HANDLE_ALIGN_TAB_STOP_POSITION:
{
- bool bAlignTab = *(sal_Bool*)rValue.getValue();
+ bool bAlignTab = *static_cast<sal_Bool const *>(rValue.getValue());
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::TAB_COMPAT, bAlignTab);
}
break;
@@ -438,7 +438,7 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
break;
case HANDLE_IS_KERN_ASIAN_PUNCTUATION:
{
- bool bIsKern = *(sal_Bool*)(rValue).getValue();
+ bool bIsKern = *static_cast<sal_Bool const *>(rValue.getValue());
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::KERN_ASIAN_PUNCTUATION, bIsKern);
SwEditShell* pEditSh = mpDoc->GetEditShell();
if(pEditSh)
@@ -463,12 +463,12 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
break;
case HANDLE_APPLY_USER_DATA:
{
- mpDocSh->SetUseUserData( *(sal_Bool*)rValue.getValue() );
+ mpDocSh->SetUseUserData( *static_cast<sal_Bool const *>(rValue.getValue()) );
}
break;
case HANDLE_SAVE_GLOBAL_DOCUMENT_LINKS:
{
- bool bSaveGlobal = *(sal_Bool*)rValue.getValue();
+ bool bSaveGlobal = *static_cast<sal_Bool const *>(rValue.getValue());
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::GLOBAL_DOCUMENT_SAVE_LINKS, bSaveGlobal );
}
break;
@@ -503,12 +503,12 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
break;
case HANDLE_SAVE_VERSION_ON_CLOSE:
{
- mpDocSh->SetSaveVersionOnClose( *(sal_Bool*)rValue.getValue() );
+ mpDocSh->SetSaveVersionOnClose( *static_cast<sal_Bool const *>(rValue.getValue()) );
}
break;
case HANDLE_UPDATE_FROM_TEMPLATE:
{
- mpDocSh->SetQueryLoadTemplate( *(sal_Bool*)rValue.getValue() );
+ mpDocSh->SetQueryLoadTemplate( *static_cast<sal_Bool const *>(rValue.getValue()) );
}
break;
case HANDLE_PRINTER_INDEPENDENT_LAYOUT:
@@ -538,25 +538,25 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
break;
case HANDLE_IS_ADD_FLY_OFFSET:
{
- bool bTmp = *(sal_Bool*)rValue.getValue();
+ bool bTmp = *static_cast<sal_Bool const *>(rValue.getValue());
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::ADD_FLY_OFFSETS, bTmp);
}
break;
case HANDLE_IS_ADD_EXTERNAL_LEADING:
{
- bool bTmp = *(sal_Bool*)rValue.getValue();
+ bool bTmp = *static_cast<sal_Bool const *>(rValue.getValue());
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::ADD_EXT_LEADING, bTmp);
}
break;
case HANDLE_OLD_NUMBERING: // #111955#
{
- bool bTmp = *(sal_Bool*)rValue.getValue();
+ bool bTmp = *static_cast<sal_Bool const *>(rValue.getValue());
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::OLD_NUMBERING, bTmp);
}
break;
case HANDLE_OUTLINELEVEL_YIELDS_NUMBERING:
{
- bool bTmp = *(sal_Bool*)rValue.getValue();
+ bool bTmp = *static_cast<sal_Bool const *>(rValue.getValue());
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::OUTLINE_LEVEL_YIELDS_OUTLINE_RULE, bTmp);
}
break;
@@ -570,25 +570,25 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
break;
case HANDLE_USE_FORMER_LINE_SPACING:
{
- bool bTmp = *(sal_Bool*)rValue.getValue();
+ bool bTmp = *static_cast<sal_Bool const *>(rValue.getValue());
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::OLD_LINE_SPACING, bTmp);
}
break;
case HANDLE_ADD_PARA_SPACING_TO_TABLE_CELLS:
{
- bool bTmp = *(sal_Bool*)rValue.getValue();
+ bool bTmp = *static_cast<sal_Bool const *>(rValue.getValue());
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::ADD_PARA_SPACING_TO_TABLE_CELLS, bTmp);
}
break;
case HANDLE_USE_FORMER_OBJECT_POSITIONING:
{
- bool bTmp = *(sal_Bool*)rValue.getValue();
+ bool bTmp = *static_cast<sal_Bool const *>(rValue.getValue());
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::USE_FORMER_OBJECT_POS, bTmp);
}
break;
case HANDLE_USE_FORMER_TEXT_WRAPPING:
{
- bool bTmp = *(sal_Bool*)rValue.getValue();
+ bool bTmp = *static_cast<sal_Bool const *>(rValue.getValue());
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::USE_FORMER_TEXT_WRAPPING, bTmp);
}
break;
@@ -609,60 +609,60 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
break;
case HANDLE_CONSIDER_WRAP_ON_OBJPOS:
{
- bool bTmp = *(sal_Bool*)rValue.getValue();
+ bool bTmp = *static_cast<sal_Bool const *>(rValue.getValue());
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::CONSIDER_WRAP_ON_OBJECT_POSITION, bTmp );
}
break;
case HANDLE_IGNORE_FIRST_LINE_INDENT_IN_NUMBERING:
{
- bool bTmp = *(sal_Bool*)rValue.getValue();
+ bool bTmp = *static_cast<sal_Bool const *>(rValue.getValue());
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING, bTmp);
}
break;
case HANDLE_DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK:
{
- bool bTmp = *(sal_Bool*)rValue.getValue();
+ bool bTmp = *static_cast<sal_Bool const *>(rValue.getValue());
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK, bTmp);
}
break;
case HANDLE_DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT:
{
- bool bTmp = *(sal_Bool*)rValue.getValue();
+ bool bTmp = *static_cast<sal_Bool const *>(rValue.getValue());
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT, bTmp);
}
break;
case HANDLE_TABLE_ROW_KEEP:
{
- bool bTmp = *(sal_Bool*)rValue.getValue();
+ bool bTmp = *static_cast<sal_Bool const *>(rValue.getValue());
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::TABLE_ROW_KEEP, bTmp);
}
break;
case HANDLE_IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION:
{
- bool bTmp = *(sal_Bool*)rValue.getValue();
+ bool bTmp = *static_cast<sal_Bool const *>(rValue.getValue());
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION, bTmp);
}
break;
case HANDLE_LOAD_READONLY:
{
- mpDocSh->SetLoadReadonly( *(sal_Bool*)rValue.getValue() );
+ mpDocSh->SetLoadReadonly( *static_cast<sal_Bool const *>(rValue.getValue()) );
}
break;
case HANDLE_DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE:
{
- bool bTmp = *(sal_Bool*)rValue.getValue();
+ bool bTmp = *static_cast<sal_Bool const *>(rValue.getValue());
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, bTmp);
}
break;
case HANDLE_CLIP_AS_CHARACTER_ANCHORED_WRITER_FLY_FRAMES:
{
- bool bTmp = *(sal_Bool*)rValue.getValue();
+ bool bTmp = *static_cast<sal_Bool const *>(rValue.getValue());
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::CLIP_AS_CHARACTER_ANCHORED_WRITER_FLY_FRAME, bTmp);
}
break;
case HANDLE_UNIX_FORCE_ZERO_EXT_LEADING:
{
- bool bTmp = *(sal_Bool*)rValue.getValue();
+ bool bTmp = *static_cast<sal_Bool const *>(rValue.getValue());
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::UNIX_FORCE_ZERO_EXT_LEADING, bTmp);
}
break;
@@ -671,7 +671,7 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
break;
case HANDLE_TABS_RELATIVE_TO_INDENT:
{
- bool bTmp = *(sal_Bool*)rValue.getValue();
+ bool bTmp = *static_cast<sal_Bool const *>(rValue.getValue());
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::TABS_RELATIVE_TO_INDENT, bTmp);
}
break;
@@ -691,14 +691,14 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
break;
case HANDLE_PROTECT_FORM:
{
- bool bTmp = *(sal_Bool*)rValue.getValue();
+ bool bTmp = *static_cast<sal_Bool const *>(rValue.getValue());
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::PROTECT_FORM, bTmp);
}
break;
// #i89181#
case HANDLE_TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST:
{
- bool bTmp = *(sal_Bool*)rValue.getValue();
+ bool bTmp = *static_cast<sal_Bool const *>(rValue.getValue());
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST, bTmp);
}
break;
@@ -719,91 +719,91 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
break;
case HANDLE_MATH_BASELINE_ALIGNMENT:
{
- bool bTmp = *(sal_Bool*)rValue.getValue();
+ bool bTmp = *static_cast<sal_Bool const *>(rValue.getValue());
mpDoc->getIDocumentSettingAccess().set( DocumentSettingId::MATH_BASELINE_ALIGNMENT, bTmp );
}
break;
case HANDLE_INVERT_BORDER_SPACING:
{
- bool bTmp = *(sal_Bool*)rValue.getValue();
+ bool bTmp = *static_cast<sal_Bool const *>(rValue.getValue());
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::INVERT_BORDER_SPACING, bTmp);
}
break;
case HANDLE_COLLAPSE_EMPTY_CELL_PARA:
{
- bool bTmp = *(sal_Bool*)rValue.getValue();
+ bool bTmp = *static_cast<sal_Bool const *>(rValue.getValue());
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::COLLAPSE_EMPTY_CELL_PARA, bTmp);
}
break;
case HANDLE_SMALL_CAPS_PERCENTAGE_66:
{
- bool bTmp = *(sal_Bool*)rValue.getValue();
+ bool bTmp = *static_cast<sal_Bool const *>(rValue.getValue());
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::SMALL_CAPS_PERCENTAGE_66, bTmp);
}
break;
case HANDLE_TAB_OVERFLOW:
{
- bool bTmp = *(sal_Bool*)rValue.getValue();
+ bool bTmp = *static_cast<sal_Bool const *>(rValue.getValue());
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::TAB_OVERFLOW, bTmp);
}
break;
case HANDLE_UNBREAKABLE_NUMBERINGS:
{
- bool bTmp = *(sal_Bool*)rValue.getValue();
+ bool bTmp = *static_cast<sal_Bool const *>(rValue.getValue());
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::UNBREAKABLE_NUMBERINGS, bTmp);
}
break;
case HANDLE_STYLES_NODEFAULT:
{
- bool bTmp = *(sal_Bool*)rValue.getValue();
+ bool bTmp = *static_cast<sal_Bool const *>(rValue.getValue());
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::STYLES_NODEFAULT, bTmp);
}
break;
case HANDLE_FLOATTABLE_NOMARGINS:
{
- bool bTmp = *(sal_Bool*)rValue.getValue();
+ bool bTmp = *static_cast<sal_Bool const *>(rValue.getValue());
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::FLOATTABLE_NOMARGINS, bTmp);
}
break;
case HANDLE_CLIPPED_PICTURES:
{
- bool bTmp = *(sal_Bool*)rValue.getValue();
+ bool bTmp = *static_cast<sal_Bool const *>(rValue.getValue());
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::CLIPPED_PICTURES, bTmp);
}
break;
case HANDLE_BACKGROUND_PARA_OVER_DRAWINGS:
{
- bool bTmp = *(sal_Bool*)rValue.getValue();
+ bool bTmp = *static_cast<sal_Bool const *>(rValue.getValue());
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::BACKGROUND_PARA_OVER_DRAWINGS, bTmp);
}
break;
case HANDLE_EMBED_FONTS:
{
- bool bTmp = *(sal_Bool*)rValue.getValue();
+ bool bTmp = *static_cast<sal_Bool const *>(rValue.getValue());
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::EMBED_FONTS, bTmp);
}
break;
case HANDLE_EMBED_SYSTEM_FONTS:
{
- bool bTmp = *(sal_Bool*)rValue.getValue();
+ bool bTmp = *static_cast<sal_Bool const *>(rValue.getValue());
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::EMBED_SYSTEM_FONTS, bTmp);
}
break;
case HANDLE_TAB_OVER_MARGIN:
{
- bool bTmp = *(sal_Bool*)rValue.getValue();
+ bool bTmp = *static_cast<sal_Bool const *>(rValue.getValue());
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::TAB_OVER_MARGIN, bTmp);
}
break;
case HANDLE_SURROUND_TEXT_WRAP_SMALL:
{
- bool bTmp = *(sal_Bool*)rValue.getValue();
+ bool bTmp = *static_cast<sal_Bool const *>(rValue.getValue());
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::SURROUND_TEXT_WRAP_SMALL, bTmp);
}
break;
case HANDLE_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING:
{
- bool bTmp = *(sal_Bool*)rValue.getValue();
+ bool bTmp = *static_cast<sal_Bool const *>(rValue.getValue());
mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING, bTmp);
}
break;
diff --git a/sw/source/uibase/uno/unomod.cxx b/sw/source/uibase/uno/unomod.cxx
index 52444be8911a..b66cf6e1a7bb 100644
--- a/sw/source/uibase/uno/unomod.cxx
+++ b/sw/source/uibase/uno/unomod.cxx
@@ -287,79 +287,79 @@ void SwXPrintSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo,
bool bVal;
if ( rInfo.mnHandle != HANDLE_PRINTSET_ANNOTATION_MODE &&
rInfo.mnHandle != HANDLE_PRINTSET_FAX_NAME )
- bVal = *(sal_Bool*)rValue.getValue();
+ bVal = *static_cast<sal_Bool const *>(rValue.getValue());
switch( rInfo.mnHandle )
{
case HANDLE_PRINTSET_LEFT_PAGES:
{
- bVal = *(sal_Bool*)rValue.getValue();
+ bVal = *static_cast<sal_Bool const *>(rValue.getValue());
mpPrtOpt->SetPrintLeftPage(bVal);
}
break;
case HANDLE_PRINTSET_RIGHT_PAGES:
{
- bVal = *(sal_Bool*)rValue.getValue();
+ bVal = *static_cast<sal_Bool const *>(rValue.getValue());
mpPrtOpt->SetPrintRightPage(bVal);
}
break;
case HANDLE_PRINTSET_REVERSED:
{
- bVal = *(sal_Bool*)rValue.getValue();
+ bVal = *static_cast<sal_Bool const *>(rValue.getValue());
mpPrtOpt->SetPrintReverse(bVal);
}
break;
case HANDLE_PRINTSET_PROSPECT:
{
- bVal = *(sal_Bool*)rValue.getValue();
+ bVal = *static_cast<sal_Bool const *>(rValue.getValue());
mpPrtOpt->SetPrintProspect(bVal);
}
break;
case HANDLE_PRINTSET_GRAPHICS:
{
- bVal = *(sal_Bool*)rValue.getValue();
+ bVal = *static_cast<sal_Bool const *>(rValue.getValue());
mpPrtOpt->SetPrintGraphic(bVal);
}
break;
case HANDLE_PRINTSET_TABLES:
{
- bVal = *(sal_Bool*)rValue.getValue();
+ bVal = *static_cast<sal_Bool const *>(rValue.getValue());
mpPrtOpt->SetPrintTable(bVal);
}
break;
case HANDLE_PRINTSET_DRAWINGS:
{
- bVal = *(sal_Bool*)rValue.getValue();
+ bVal = *static_cast<sal_Bool const *>(rValue.getValue());
mpPrtOpt->SetPrintDraw(bVal);
}
break;
case HANDLE_PRINTSET_CONTROLS:
{
- bVal = *(sal_Bool*)rValue.getValue();
+ bVal = *static_cast<sal_Bool const *>(rValue.getValue());
mpPrtOpt->SetPrintControl(bVal);
}
break;
case HANDLE_PRINTSET_PAGE_BACKGROUND:
{
- bVal = *(sal_Bool*)rValue.getValue();
+ bVal = *static_cast<sal_Bool const *>(rValue.getValue());
mpPrtOpt->SetPrintPageBackground(bVal);
}
break;
case HANDLE_PRINTSET_BLACK_FONTS:
{
- bVal = *(sal_Bool*)rValue.getValue();
+ bVal = *static_cast<sal_Bool const *>(rValue.getValue());
mpPrtOpt->SetPrintBlackFont(bVal);
}
break;
case HANDLE_PRINTSET_SINGLE_JOBS:
{
- bVal = *(sal_Bool*)rValue.getValue();
+ bVal = *static_cast<sal_Bool const *>(rValue.getValue());
mpPrtOpt->SetPrintSingleJobs(bVal);
}
break;
case HANDLE_PRINTSET_PAPER_FROM_SETUP:
{
- bVal = *(sal_Bool*)rValue.getValue();
+ bVal = *static_cast<sal_Bool const *>(rValue.getValue());
mpPrtOpt->SetPaperFromSetup(bVal);
}
break;
@@ -375,7 +375,7 @@ void SwXPrintSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo,
break;
case HANDLE_PRINTSET_EMPTY_PAGES:
{
- bVal = *(sal_Bool*)rValue.getValue();
+ bVal = *static_cast<sal_Bool const *>(rValue.getValue());
mpPrtOpt->SetPrintEmptyPages(bVal);
}
break;
@@ -390,19 +390,19 @@ void SwXPrintSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo,
break;
case HANDLE_PRINTSET_PROSPECT_RTL:
{
- bVal = *(sal_Bool*)rValue.getValue();
+ bVal = *static_cast<sal_Bool const *>(rValue.getValue());
mpPrtOpt->SetPrintProspect_RTL(bVal);
}
break;
case HANDLE_PRINTSET_PLACEHOLDER:
{
- bVal = *(sal_Bool*)rValue.getValue();
+ bVal = *static_cast<sal_Bool const *>(rValue.getValue());
mpPrtOpt->SetPrintTextPlaceholder(bVal);
}
break;
case HANDLE_PRINTSET_HIDDEN_TEXT:
{
- bVal = *(sal_Bool*)rValue.getValue();
+ bVal = *static_cast<sal_Bool const *>(rValue.getValue());
mpPrtOpt->SetPrintHiddenText(bVal);
}
break;
@@ -591,7 +591,7 @@ void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, c
IllegalArgumentException, WrappedTargetException,
RuntimeException, std::exception)
{
- bool bVal = HANDLE_VIEWSET_ZOOM != rInfo.mnHandle && *(sal_Bool*)rValue.getValue();
+ bool bVal = HANDLE_VIEWSET_ZOOM != rInfo.mnHandle && *static_cast<sal_Bool const *>(rValue.getValue());
// the API flag should not be set to the application's view settings
switch( rInfo.mnHandle )
{
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index d9d01b7cb068..02c603cdddbf 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -1125,7 +1125,7 @@ void SwXTextDocument::setPagePrintSettings(const Sequence< beans::PropertyValue
else if(sName == "IsLandscape")
{
bException = (::getBooleanCppuType() != rVal.getValueType());
- aData.SetLandscape(*(sal_Bool*)rVal.getValue());
+ aData.SetLandscape(*static_cast<sal_Bool const *>(rVal.getValue()));
}
else
bException = true;
@@ -1183,7 +1183,7 @@ void SwXTextDocument::printPages(const Sequence< beans::PropertyValue >& xOption
{
if ( rProp.Value.getValueType() == ::getBooleanCppuType())
- aReq.AppendItem(SfxBoolItem( SID_PRINT_COLLATE, *(sal_Bool*)rProp.Value.getValue() ) );
+ aReq.AppendItem(SfxBoolItem( SID_PRINT_COLLATE, *static_cast<sal_Bool const *>(rProp.Value.getValue()) ) );
else
throw IllegalArgumentException();
}
@@ -1192,7 +1192,7 @@ void SwXTextDocument::printPages(const Sequence< beans::PropertyValue >& xOption
else if ( rProp.Name == UNO_NAME_SORT )
{
if ( rProp.Value.getValueType() == ::getBooleanCppuType() )
- aReq.AppendItem(SfxBoolItem( SID_PRINT_SORT, *(sal_Bool*)rProp.Value.getValue() ) );
+ aReq.AppendItem(SfxBoolItem( SID_PRINT_SORT, *static_cast<sal_Bool const *>(rProp.Value.getValue()) ) );
else
throw IllegalArgumentException();
}
@@ -1859,7 +1859,7 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName, const Any&
case WID_DOC_CHANGES_RECORD:
case WID_DOC_CHANGES_SHOW:
{
- bool bSet = *(sal_Bool*)aValue.getValue();
+ bool bSet = *static_cast<sal_Bool const *>(aValue.getValue());
sal_uInt16 eMode = pDocShell->GetDoc()->getIDocumentRedlineAccess().GetRedlineMode();
if(WID_DOC_CHANGES_SHOW == pEntry->nWID)
{
@@ -1899,7 +1899,7 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName, const Any&
}
break;
case WID_DOC_HIDE_TIPS :
- SW_MOD()->GetModuleConfig()->SetHideFieldTips(*(sal_Bool*)aValue.getValue());
+ SW_MOD()->GetModuleConfig()->SetHideFieldTips(*static_cast<sal_Bool const *>(aValue.getValue()));
break;
case WID_DOC_REDLINE_DISPLAY:
{
@@ -1932,7 +1932,7 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName, const Any&
case WID_DOC_AUTOMATIC_CONTROL_FOCUS:
{
SwDrawModel * pDrawDoc;
- bool bAuto = *(sal_Bool*) aValue.getValue();
+ bool bAuto = *static_cast<sal_Bool const *>(aValue.getValue());
if ( 0 != ( pDrawDoc = pDocShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel() ) )
pDrawDoc->SetAutoControlFocus( bAuto );
@@ -1952,7 +1952,7 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName, const Any&
case WID_DOC_APPLY_FORM_DESIGN_MODE:
{
SwDrawModel * pDrawDoc;
- bool bMode = *(sal_Bool*)aValue.getValue();
+ bool bMode = *static_cast<sal_Bool const *>(aValue.getValue());
if ( 0 != ( pDrawDoc = pDocShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel() ) )
pDrawDoc->SetOpenInDesignMode( bMode );
diff --git a/sw/source/uibase/uno/unotxvw.cxx b/sw/source/uibase/uno/unotxvw.cxx
index fff7af2313b7..08a0564cc002 100644
--- a/sw/source/uibase/uno/unotxvw.cxx
+++ b/sw/source/uibase/uno/unotxvw.cxx
@@ -633,7 +633,7 @@ void SAL_CALL SwXTextView::setRubyList(
else if(pProperties[nProp].Name == UNO_NAME_RUBY_IS_ABOVE)
{
bool bValue = !pProperties[nProp].Value.hasValue() ||
- *(sal_Bool*)pProperties[nProp].Value.getValue();
+ *static_cast<sal_Bool const *>(pProperties[nProp].Value.getValue());
pEntry->GetRubyAttr().SetPosition(bValue ? 0 : 1);
}
}
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index 57fda8308bf8..7e82523886a5 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -860,7 +860,7 @@ OUString SwContentTree::GetEntryAltText( SvTreeListEntry* pEntry ) const
if( pEntry == NULL)
return OUString();
- SwContent* pCnt = (SwContent*)pEntry->GetUserData();
+ SwContent* pCnt = static_cast<SwContent*>(pEntry->GetUserData());
if( pCnt == NULL || pCnt->GetParent() == NULL)
return OUString();
@@ -953,7 +953,7 @@ OUString SwContentTree::GetEntryLongDescription( SvTreeListEntry* pEntry ) const
if( pEntry == NULL)
return OUString();
- SwContent* pCnt = (SwContent*)pEntry->GetUserData();
+ SwContent* pCnt = static_cast<SwContent*>(pEntry->GetUserData());
if( pCnt == NULL || pCnt->GetParent() == NULL)
return OUString();
@@ -1093,7 +1093,7 @@ sal_Int8 SwContentTree::ExecuteDrop( const ExecuteDropEvent& rEvt )
SvTreeListEntry* pEntry = pTargetEntry;
if( pEntry && ( nRootType == CONTENT_TYPE_OUTLINE ) && lcl_IsContent( pEntry ) )
{
- SwOutlineContent* pOutlineContent = ( SwOutlineContent* )( pEntry->GetUserData() );
+ SwOutlineContent* pOutlineContent = static_cast<SwOutlineContent*>(pEntry->GetUserData());
if( pOutlineContent )
{
void* key = lcl_GetOutlineKey(this, pOutlineContent);
@@ -1182,11 +1182,11 @@ PopupMenu* SwContentTree::CreateContextMenu( void )
if((bIsActive || pActiveShell == pActiveView->GetWrtShellPtr())
&& 0 != (pEntry = FirstSelected()) && lcl_IsContent(pEntry))
{
- const SwContentType* pContType = ((SwContent*)pEntry->GetUserData())->GetParent();
+ const SwContentType* pContType = static_cast<SwContent*>(pEntry->GetUserData())->GetParent();
const sal_uInt16 nContentType = pContType->GetType();
bool bReadonly = pActiveShell->GetView().GetDocShell()->IsReadOnly();
- bool bVisible = !((SwContent*)pEntry->GetUserData())->IsInvisible();
- bool bProtected = ((SwContent*)pEntry->GetUserData())->IsProtect();
+ bool bVisible = !static_cast<SwContent*>(pEntry->GetUserData())->IsInvisible();
+ bool bProtected = static_cast<SwContent*>(pEntry->GetUserData())->IsProtect();
bool bEditable = pContType->IsEditable() &&
((bVisible && !bProtected) ||CONTENT_TYPE_REGION == nContentType);
bool bDeletable = pContType->IsDeletable() &&
@@ -1209,7 +1209,7 @@ PopupMenu* SwContentTree::CreateContextMenu( void )
pSubPop4->InsertItem(401, sRemoveIdx);
pSubPop4->InsertItem(402, sUpdateIdx);
- const SwTOXBase* pBase = ((SwTOXBaseContent*)pEntry->GetUserData())->GetTOXBase();
+ const SwTOXBase* pBase = static_cast<SwTOXBaseContent*>(pEntry->GetUserData())->GetTOXBase();
if(!pBase->IsTOXBaseInReadonly())
pSubPop4->InsertItem(403, aContextStrings[ST_EDIT_ENTRY - ST_CONTEXT_FIRST]);
pSubPop4->InsertItem(405, sReadonlyIdx);
@@ -1223,7 +1223,7 @@ PopupMenu* SwContentTree::CreateContextMenu( void )
pSubPop4->InsertItem(403, aContextStrings[ST_EDIT_ENTRY - ST_CONTEXT_FIRST]);
pSubPop4->InsertItem(404, sUnprotTbl);
bool bFull = false;
- OUString sTblName = ((SwContent*)pEntry->GetUserData())->GetName();
+ OUString sTblName = static_cast<SwContent*>(pEntry->GetUserData())->GetName();
bool bProt = pActiveShell->HasTblAnyProtection( &sTblName, &bFull );
pSubPop4->EnableItem(403, !bFull );
pSubPop4->EnableItem(404, bProt );
@@ -1263,7 +1263,7 @@ PopupMenu* SwContentTree::CreateContextMenu( void )
}
else if( pEntry )
{
- SwContentType* pType = (SwContentType*)pEntry->GetUserData();
+ SwContentType* pType = static_cast<SwContentType*>(pEntry->GetUserData());
if ( (pType->GetType() == CONTENT_TYPE_POSTIT) && (!pActiveShell->GetView().GetDocShell()->IsReadOnly()) && ( pType->GetMemberCount() > 0) )
{
pSubPop4->InsertItem(600, sPostItShow );
@@ -1289,7 +1289,7 @@ sal_IntPtr SwContentTree::GetTabPos( SvTreeListEntry* pEntry, SvLBoxTab* pTab)
if(lcl_IsContent(pEntry))
{
nLevel++;
- SwContent* pCnt = (SwContent *) pEntry->GetUserData();
+ SwContent* pCnt = static_cast<SwContent *>(pEntry->GetUserData());
const SwContentType* pParent;
if(pCnt && 0 != (pParent = pCnt->GetParent()))
{
@@ -1313,7 +1313,7 @@ void SwContentTree::RequestingChildren( SvTreeListEntry* pParent )
if(!pParent->HasChildren())
{
OSL_ENSURE(pParent->GetUserData(), "no UserData?");
- SwContentType* pCntType = (SwContentType*)pParent->GetUserData();
+ SwContentType* pCntType = static_cast<SwContentType*>(pParent->GetUserData());
const sal_uInt16 nCount = pCntType->GetMemberCount();
// Add for outline plus/minus
@@ -1343,7 +1343,7 @@ void SwContentTree::RequestingChildren( SvTreeListEntry* pParent )
pChild = Prev(pChild);
while(pChild &&
lcl_IsContent(pChild) &&
- !(((SwOutlineContent*)pChild->GetUserData())->GetOutlineLevel() < nLevel)
+ !(static_cast<SwOutlineContent*>(pChild->GetUserData())->GetOutlineLevel() < nLevel)
)
{
pChild = Prev(pChild);
@@ -1435,12 +1435,12 @@ SdrObject* SwContentTree::GetDrawingObjectsByContent(const SwContent *pCnt)
bool SwContentTree::Expand( SvTreeListEntry* pParent )
{
- if(!bIsRoot || (((SwContentType*)pParent->GetUserData())->GetType() == CONTENT_TYPE_OUTLINE) ||
+ if(!bIsRoot || (static_cast<SwContentType*>(pParent->GetUserData())->GetType() == CONTENT_TYPE_OUTLINE) ||
(nRootType == CONTENT_TYPE_OUTLINE))
{
if(lcl_IsContentType(pParent))
{
- SwContentType* pCntType = (SwContentType*)pParent->GetUserData();
+ SwContentType* pCntType = static_cast<SwContentType*>(pParent->GetUserData());
const sal_Int32 nOr = 1 << pCntType->GetType(); //linear -> Bitposition
if(bIsActive || bIsConstant)
{
@@ -1460,7 +1460,7 @@ bool SwContentTree::Expand( SvTreeListEntry* pParent )
{
if(pChild->HasChildren())
{
- sal_Int32 nPos = ((SwContent*)pChild->GetUserData())->GetYPos();
+ sal_Int32 nPos = static_cast<SwContent*>(pChild->GetUserData())->GetYPos();
void* key = (void*)pShell->getIDocumentOutlineNodesAccess()->getOutlineNode( nPos );
mCurrOutLineNodeMap.insert(std::map<void*, bool>::value_type( key, false ) );
std::map<void*, bool>::iterator iter = mOutLineNodeMap.find( key );
@@ -1480,7 +1480,7 @@ bool SwContentTree::Expand( SvTreeListEntry* pParent )
else if( lcl_IsContent(pParent) )
{
SwWrtShell* pShell = GetWrtShell();
- sal_Int32 nPos = ((SwContent*)pParent->GetUserData())->GetYPos();
+ sal_Int32 nPos = static_cast<SwContent*>(pParent->GetUserData())->GetYPos();
void* key = (void*)pShell->getIDocumentOutlineNodesAccess()->getOutlineNode( nPos );
mOutLineNodeMap[key] = true;
}
@@ -1493,14 +1493,14 @@ bool SwContentTree::Expand( SvTreeListEntry* pParent )
bool SwContentTree::Collapse( SvTreeListEntry* pParent )
{
bool bRet(false);
- if(!bIsRoot || (((SwContentType*)pParent->GetUserData())->GetType() == CONTENT_TYPE_OUTLINE) ||
+ if(!bIsRoot || (static_cast<SwContentType*>(pParent->GetUserData())->GetType() == CONTENT_TYPE_OUTLINE) ||
(nRootType == CONTENT_TYPE_OUTLINE))
{
if(lcl_IsContentType(pParent))
{
if(bIsRoot)
return bRet = false;
- SwContentType* pCntType = (SwContentType*)pParent->GetUserData();
+ SwContentType* pCntType = static_cast<SwContentType*>(pParent->GetUserData());
const sal_Int32 nAnd = ~(1 << pCntType->GetType());
if(bIsActive || bIsConstant)
{
@@ -1513,7 +1513,7 @@ bool SwContentTree::Collapse( SvTreeListEntry* pParent )
else if( lcl_IsContent(pParent) )
{
SwWrtShell* pShell = GetWrtShell();
- sal_Int32 nPos = ((SwContent*)pParent->GetUserData())->GetYPos();
+ sal_Int32 nPos = static_cast<SwContent*>(pParent->GetUserData())->GetYPos();
void* key = (void*)pShell->getIDocumentOutlineNodesAccess()->getOutlineNode( nPos );
mOutLineNodeMap[key] = false;
}
@@ -1542,7 +1542,7 @@ IMPL_LINK_NOARG(SwContentTree, ContentDoubleClickHdl)
pActiveShell->GetView().GetViewFrame()->GetWindow().ToTop();
}
//Jump to content type:
- SwContent* pCnt = (SwContent*)pEntry->GetUserData();
+ SwContent* pCnt = static_cast<SwContent*>(pEntry->GetUserData());
OSL_ENSURE( pCnt, "no UserData");
GotoContent(pCnt);
if(pCnt->GetParent()->GetType() == CONTENT_TYPE_FRAME)
@@ -1713,7 +1713,7 @@ void SwContentTree::Display( bool bActive )
while( 0 != (pEntry = Next(pEntry)) )
{
- if(((SwOutlineContent*)pEntry->GetUserData())->GetPos() == nActPos)
+ if(static_cast<SwOutlineContent*>(pEntry->GetUserData())->GetPos() == nActPos)
{
MakeVisible(pEntry);
Select(pEntry);
@@ -1780,7 +1780,7 @@ bool SwContentTree::FillTransferData( TransferDataContainer& rTransfer,
if(!pEntry || lcl_IsContentType(pEntry) || !pWrtShell)
return false;
OUString sEntry;
- SwContent* pCnt = ((SwContent*)pEntry->GetUserData());
+ SwContent* pCnt = static_cast<SwContent*>(pEntry->GetUserData());
const sal_uInt16 nActType = pCnt->GetParent()->GetType();
OUString sUrl;
@@ -1920,9 +1920,9 @@ bool SwContentTree::ToggleToRoot()
if(pEntry)
{
if(lcl_IsContentType(pEntry))
- pCntType = (SwContentType*)pEntry->GetUserData();
+ pCntType = static_cast<SwContentType*>(pEntry->GetUserData());
else
- pCntType = ((SwContent*)pEntry->GetUserData())->GetParent();
+ pCntType = static_cast<SwContent*>(pEntry->GetUserData())->GetParent();
nRootType = pCntType->GetType();
bIsRoot = true;
Display(bIsActive || bIsConstant);
@@ -1981,7 +1981,7 @@ bool SwContentTree::HasContentChanged()
bRepaint = true;
else
{
- const sal_uInt16 nType = ((SwContentType*)pEntry->GetUserData())->GetType();
+ const sal_uInt16 nType = static_cast<SwContentType*>(pEntry->GetUserData())->GetType();
bOutline = nRootType == CONTENT_TYPE_OUTLINE;
SwContentType* pArrType = aActiveContentArr[nType];
if(!pArrType)
@@ -1994,7 +1994,7 @@ bool SwContentTree::HasContentChanged()
lcl_IsContent(pFirstSel))
{
const sal_uInt16 nSelLevel =
- ((SwOutlineContent*)pFirstSel->GetUserData())->GetOutlineLevel();
+ static_cast<SwOutlineContent*>(pFirstSel->GetUserData())->GetOutlineLevel();
SwWrtShell* pSh = GetWrtShell();
const sal_uInt16 nOutlinePos = pSh->GetOutlinePos(MAXLEVEL);
if (nOutlinePos != USHRT_MAX &&
@@ -2034,7 +2034,7 @@ bool SwContentTree::HasContentChanged()
while( 0 != (pFirstEntry = Next(pFirstEntry)) )
{
- if(((SwOutlineContent*)pFirstEntry->GetUserData())->GetPos() == nActPos)
+ if(static_cast<SwOutlineContent*>(pFirstEntry->GetUserData())->GetPos() == nActPos)
{
if(FirstSelected() != pFirstEntry)
{
@@ -2053,7 +2053,7 @@ bool SwContentTree::HasContentChanged()
while ( pEntry )
{
bool bNext = true; // at least a next must be
- SwContentType* pTreeType = (SwContentType*)pEntry->GetUserData();
+ SwContentType* pTreeType = static_cast<SwContentType*>(pEntry->GetUserData());
const sal_uInt16 nTreeCount = pTreeType->GetMemberCount();
const sal_uInt16 nType = pTreeType->GetType();
SwContentType* pArrType = aActiveContentArr[nType];
@@ -2175,7 +2175,7 @@ void SwContentTree::FindActiveTypeAndRemoveUserData()
while(0 != (pParent = GetParent(pEntry)))
pEntry = pParent;
if(pEntry->GetUserData() && lcl_IsContentType(pEntry))
- nLastSelType = ((SwContentType*)pEntry->GetUserData())->GetType();
+ nLastSelType = static_cast<SwContentType*>(pEntry->GetUserData())->GetType();
}
pEntry = First();
while(pEntry)
@@ -2313,10 +2313,10 @@ void SwContentTree::ExecCommand(sal_uInt16 nCmd, bool bModifier)
if (pFirstEntry && lcl_IsContent(pFirstEntry))
{
if ( (bIsRoot && nRootType == CONTENT_TYPE_OUTLINE) ||
- ((SwContent*)pFirstEntry->GetUserData())->GetParent()->GetType()
+ static_cast<SwContent*>(pFirstEntry->GetUserData())->GetParent()->GetType()
== CONTENT_TYPE_OUTLINE)
{
- nActPos = ((SwOutlineContent*)pFirstEntry->GetUserData())->GetPos();
+ nActPos = static_cast<SwOutlineContent*>(pFirstEntry->GetUserData())->GetPos();
}
}
if ( nActPos < USHRT_MAX &&
@@ -2341,13 +2341,13 @@ void SwContentTree::ExecCommand(sal_uInt16 nCmd, bool bModifier)
{
sal_uInt16 nActEndPos = nActPos;
SvTreeListEntry* pEntry = pFirstEntry;
- sal_uInt16 nActLevel = ((SwOutlineContent*)
+ sal_uInt16 nActLevel = static_cast<SwOutlineContent*>(
pFirstEntry->GetUserData())->GetOutlineLevel();
pEntry = Next(pEntry);
while( pEntry && CONTENT_TYPE_OUTLINE ==
- ((SwTypeNumber*)pEntry->GetUserData())->GetTypeId() )
+ static_cast<SwTypeNumber*>(pEntry->GetUserData())->GetTypeId() )
{
- if(nActLevel >= ((SwOutlineContent*)
+ if(nActLevel >= static_cast<SwOutlineContent*>(
pEntry->GetUserData())->GetOutlineLevel())
break;
pEntry = Next(pEntry);
@@ -2357,7 +2357,7 @@ void SwContentTree::ExecCommand(sal_uInt16 nCmd, bool bModifier)
{
// If the last entry is to be moved it is over!
if(pEntry && CONTENT_TYPE_OUTLINE ==
- ((SwTypeNumber*)pEntry->GetUserData())->GetTypeId())
+ static_cast<SwTypeNumber*>(pEntry->GetUserData())->GetTypeId())
{
// pEntry now points to the following entry of the last
// selected entry.
@@ -2369,8 +2369,8 @@ void SwContentTree::ExecCommand(sal_uInt16 nCmd, bool bModifier)
pEntry = Next(pEntry);
// nDest++ may only executed if pEntry != 0
if(pEntry && nDest++ &&
- ( nActLevel >= ((SwOutlineContent*)pEntry->GetUserData())->GetOutlineLevel()||
- CONTENT_TYPE_OUTLINE != ((SwTypeNumber*)pEntry->GetUserData())->GetTypeId()))
+ ( nActLevel >= static_cast<SwOutlineContent*>(pEntry->GetUserData())->GetOutlineLevel()||
+ CONTENT_TYPE_OUTLINE != static_cast<SwTypeNumber*>(pEntry->GetUserData())->GetTypeId()))
{
nDest--;
break;
@@ -2392,9 +2392,9 @@ void SwContentTree::ExecCommand(sal_uInt16 nCmd, bool bModifier)
nDest--;
pEntry = Prev(pEntry);
if(pEntry &&
- (nActLevel >= ((SwOutlineContent*)pEntry->GetUserData())->GetOutlineLevel()||
+ (nActLevel >= static_cast<SwOutlineContent*>(pEntry->GetUserData())->GetOutlineLevel()||
CONTENT_TYPE_OUTLINE !=
- ((SwTypeNumber*)pEntry->GetUserData())->GetTypeId()))
+ static_cast<SwTypeNumber*>(pEntry->GetUserData())->GetTypeId()))
{
break;
}
@@ -2428,7 +2428,7 @@ void SwContentTree::ExecCommand(sal_uInt16 nCmd, bool bModifier)
while( 0 != (pFirst = Next(pFirst)) && lcl_IsContent(pFirst))
{
- if(((SwOutlineContent*)pFirst->GetUserData())->GetPos() == nCurrPos)
+ if(static_cast<SwOutlineContent*>(pFirst->GetUserData())->GetPos() == nCurrPos)
{
Select(pFirst);
MakeVisible(pFirst);
@@ -2526,17 +2526,17 @@ TriState SwContentTree::NotifyMoving( SvTreeListEntry* pTarget,
if(!bDocChgdInDragging)
{
sal_uInt16 nTargetPos = 0;
- sal_uInt16 nSourcePos = (( SwOutlineContent* )pEntry->GetUserData())->GetPos();
+ sal_uInt16 nSourcePos = static_cast<SwOutlineContent*>(pEntry->GetUserData())->GetPos();
if(!lcl_IsContent(pTarget))
nTargetPos = USHRT_MAX;
else
- nTargetPos = (( SwOutlineContent* )pTarget->GetUserData())->GetPos();
+ nTargetPos = static_cast<SwOutlineContent*>(pTarget->GetUserData())->GetPos();
if( MAXLEVEL > nOutlineLevel && // Not all layers are displayed.
nTargetPos != USHRT_MAX)
{
SvTreeListEntry* pNext = Next(pTarget);
if(pNext)
- nTargetPos = (( SwOutlineContent* )pNext->GetUserData())->GetPos() -1;
+ nTargetPos = static_cast<SwOutlineContent*>(pNext->GetUserData())->GetPos() -1;
else
nTargetPos = static_cast<sal_uInt16>(GetWrtShell()->getIDocumentOutlineNodesAccess()->getOutlineNodesCount())- 1;
@@ -2563,18 +2563,18 @@ TriState SwContentTree::NotifyCopying( SvTreeListEntry* pTarget,
if(!bDocChgdInDragging)
{
sal_uInt16 nTargetPos = 0;
- sal_uInt16 nSourcePos = (( SwOutlineContent* )pEntry->GetUserData())->GetPos();
+ sal_uInt16 nSourcePos = static_cast<SwOutlineContent*>(pEntry->GetUserData())->GetPos();
if(!lcl_IsContent(pTarget))
nTargetPos = USHRT_MAX;
else
- nTargetPos = (( SwOutlineContent* )pTarget->GetUserData())->GetPos();
+ nTargetPos = static_cast<SwOutlineContent*>(pTarget->GetUserData())->GetPos();
if( MAXLEVEL > nOutlineLevel && // Not all layers are displayed.
nTargetPos != USHRT_MAX)
{
SvTreeListEntry* pNext = Next(pTarget);
if(pNext)
- nTargetPos = (( SwOutlineContent* )pNext->GetUserData())->GetPos() - 1;
+ nTargetPos = static_cast<SwOutlineContent*>(pNext->GetUserData())->GetPos() - 1;
else
nTargetPos = static_cast<sal_uInt16>(GetWrtShell()->getIDocumentOutlineNodesAccess()->getOutlineNodesCount()) - 1;
@@ -2673,7 +2673,7 @@ void SwContentTree::KeyInput(const KeyEvent& rEvent)
SvTreeListEntry* pEntry = FirstSelected();
if(pEntry &&
lcl_IsContent(pEntry) &&
- ((SwContent*)pEntry->GetUserData())->GetParent()->IsDeletable() &&
+ static_cast<SwContent*>(pEntry->GetUserData())->GetParent()->IsDeletable() &&
!pActiveShell->GetView().GetDocShell()->IsReadOnly())
{
EditEntry(pEntry, EDIT_MODE_DELETE);
@@ -2703,7 +2703,7 @@ void SwContentTree::KeyInput(const KeyEvent& rEvent)
pActiveShell->GetView().GetViewFrame()->GetWindow().ToTop();
}
- SwContent* pCnt = (SwContent*)pEntry->GetUserData();
+ SwContent* pCnt = static_cast<SwContent*>(pEntry->GetUserData());
switch(pCnt->GetParent()->GetType())
{
@@ -2810,10 +2810,10 @@ void SwContentTree::RequestHelp( const HelpEvent& rHEvt )
bool bContent = false;
void* pUserData = pEntry->GetUserData();
if(lcl_IsContentType(pEntry))
- nType = ((SwContentType*)pUserData)->GetType();
+ nType = static_cast<SwContentType*>(pUserData)->GetType();
else
{
- nType = ((SwContent*)pUserData)->GetParent()->GetType();
+ nType = static_cast<SwContent*>(pUserData)->GetParent()->GetType();
bContent = true;
}
OUString sEntry;
@@ -2823,22 +2823,22 @@ void SwContentTree::RequestHelp( const HelpEvent& rHEvt )
switch( nType )
{
case CONTENT_TYPE_URLFIELD:
- sEntry = ((SwURLFieldContent*)pUserData)->GetURL();
+ sEntry = static_cast<SwURLFieldContent*>(pUserData)->GetURL();
bRet = true;
break;
case CONTENT_TYPE_POSTIT:
- sEntry = ((SwPostItContent*)pUserData)->GetName();
+ sEntry = static_cast<SwPostItContent*>(pUserData)->GetName();
bRet = true;
if(Help::IsBalloonHelpEnabled())
bBalloon = true;
break;
case CONTENT_TYPE_OUTLINE:
- sEntry = ((SwOutlineContent*)pUserData)->GetName();
+ sEntry = static_cast<SwOutlineContent*>(pUserData)->GetName();
bRet = true;
break;
case CONTENT_TYPE_GRAPHIC:
- sEntry = ((SwGraphicContent*)pUserData)->GetLink();
+ sEntry = static_cast<SwGraphicContent*>(pUserData)->GetLink();
#if OSL_DEBUG_LEVEL > 1
sEntry += " ";
sEntry += OUString::number(
@@ -2855,7 +2855,7 @@ void SwContentTree::RequestHelp( const HelpEvent& rHEvt )
break;
#endif
}
- if(((SwContent*)pUserData)->IsInvisible())
+ if(static_cast<SwContent*>(pUserData)->IsInvisible())
{
if(!sEntry.isEmpty())
sEntry += ", ";
@@ -2865,12 +2865,12 @@ void SwContentTree::RequestHelp( const HelpEvent& rHEvt )
}
else
{
- const sal_uInt16 nMemberCount = ((SwContentType*)pUserData)->GetMemberCount();
+ const sal_uInt16 nMemberCount = static_cast<SwContentType*>(pUserData)->GetMemberCount();
sEntry = OUString::number(nMemberCount);
sEntry += " ";
sEntry += nMemberCount == 1
- ? ((SwContentType*)pUserData)->GetSingleName()
- : ((SwContentType*)pUserData)->GetName();
+ ? static_cast<SwContentType*>(pUserData)->GetSingleName()
+ : static_cast<SwContentType*>(pUserData)->GetName();
bRet = true;
}
if(bRet)
@@ -2949,7 +2949,7 @@ void SwContentTree::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry
break;
case 405 :
{
- const SwTOXBase* pBase = ((SwTOXBaseContent*)pFirst->GetUserData())
+ const SwTOXBase* pBase = static_cast<SwTOXBaseContent*>(pFirst->GetUserData())
->GetTOXBase();
pActiveShell->SetTOXBaseReadonly(*pBase, !pActiveShell->IsTOXBaseReadonly(*pBase));
}
@@ -3057,7 +3057,7 @@ bool SwContentTree::Select( SvTreeListEntry* pEntry, bool bSelect )
{
if ((bIsRoot && nRootType == CONTENT_TYPE_OUTLINE) ||
(lcl_IsContent(pEntry) &&
- ((SwContentType*)pParentEntry->GetUserData())->GetType() == CONTENT_TYPE_OUTLINE))
+ static_cast<SwContentType*>(pParentEntry->GetUserData())->GetType() == CONTENT_TYPE_OUTLINE))
{
bEnable = true;
}
@@ -3094,7 +3094,7 @@ OUString SwContentType::RemoveNewline(const OUString& rEntry)
void SwContentTree::EditEntry(SvTreeListEntry* pEntry, sal_uInt8 nMode)
{
- SwContent* pCnt = (SwContent*)pEntry->GetUserData();
+ SwContent* pCnt = static_cast<SwContent*>(pEntry->GetUserData());
GotoContent(pCnt);
const sal_uInt16 nType = pCnt->GetParent()->GetType();
sal_uInt16 nSlot = 0;
@@ -3492,7 +3492,7 @@ void SwContentLBoxString::Paint(
const SvTreeListEntry* pEntry)
{
if(lcl_IsContent(pEntry) &&
- ((SwContent *)pEntry->GetUserData())->IsInvisible())
+ static_cast<SwContent *>(pEntry->GetUserData())->IsInvisible())
{
vcl::Font aOldFont( rDev.GetFont());
vcl::Font aFont(aOldFont);
diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx
index 4cbbc3f48835..e794c98b3687 100644
--- a/sw/source/uibase/utlui/glbltree.cxx
+++ b/sw/source/uibase/utlui/glbltree.cxx
@@ -211,7 +211,7 @@ sal_Int8 SwGlobalTree::ExecuteDrop( const ExecuteDropEvent& rEvt )
OUString sFileName;
const SwGlblDocContent* pCnt = pDropEntry ?
- (const SwGlblDocContent*)pDropEntry->GetUserData() :
+ static_cast<const SwGlblDocContent*>(pDropEntry->GetUserData()) :
0;
if( aData.HasFormat( SotClipboardFormatId::FILE_LIST ))
{
@@ -458,7 +458,7 @@ void SwGlobalTree::RequestHelp( const HelpEvent& rHEvt )
Point aPos( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ));
SvTreeListEntry* pEntry = GetEntry( aPos );
const SwGlblDocContent* pCont = pEntry ?
- (const SwGlblDocContent*)pEntry->GetUserData() : 0;
+ static_cast<const SwGlblDocContent*>(pEntry->GetUserData()) : 0;
if( pCont && GLBLDOC_SECTION == pCont->GetType())
{
bParent = false;
@@ -770,7 +770,7 @@ IMPL_LINK( SwGlobalTree, PopupHdl, Menu* , pMenu)
void SwGlobalTree::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry )
{
SvTreeListEntry* pEntry = FirstSelected();
- SwGlblDocContent* pCont = pEntry ? (SwGlblDocContent*)pEntry->GetUserData() : 0;
+ SwGlblDocContent* pCont = pEntry ? static_cast<SwGlblDocContent*>(pEntry->GetUserData()) : 0;
// If a RequestHelp is called during the dialogue,
// then the content gets lost. Because of that a copy
// is created in which only the DocPos is set correctly.
@@ -788,7 +788,7 @@ void SwGlobalTree::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry
SvTreeListEntry* pSelEntry = FirstSelected();
while( pSelEntry )
{
- SwGlblDocContent* pContent = (SwGlblDocContent*)pSelEntry->GetUserData();
+ SwGlblDocContent* pContent = static_cast<SwGlblDocContent*>(pSelEntry->GetUserData());
if(GLBLDOC_SECTION == pContent->GetType() &&
pContent->GetSection()->IsConnected())
{
@@ -800,7 +800,7 @@ void SwGlobalTree::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry
pSelEntry = FirstSelected();
while( pSelEntry )
{
- SwGlblDocContent* pContent = (SwGlblDocContent*)pSelEntry->GetUserData();
+ SwGlblDocContent* pContent = static_cast<SwGlblDocContent*>(pSelEntry->GetUserData());
if(GLBLDOC_TOXBASE == pContent->GetType())
pActiveShell->UpdateTableOf(*pContent->GetTOX());
pSelEntry = NextSelected(pSelEntry);
@@ -947,7 +947,7 @@ void SwGlobalTree::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry
Display();
Select(GetModel()->GetEntryAtAbsPos(nEntryPos));
pEntry = FirstSelected();
- pCont = pEntry ? (SwGlblDocContent*)pEntry->GetUserData() : 0;
+ pCont = pEntry ? static_cast<SwGlblDocContent*>(pEntry->GetUserData()) : 0;
}
else
{
@@ -1046,8 +1046,8 @@ void SwGlobalTree::ExecCommand(sal_uInt16 nCmd)
OSL_ENSURE(pEntry, "It explodes in the next moment");
if(FN_GLOBAL_EDIT == nCmd)
{
- const SwGlblDocContent* pCont = (const SwGlblDocContent*)
- pEntry->GetUserData();
+ const SwGlblDocContent* pCont = static_cast<const SwGlblDocContent*>(
+ pEntry->GetUserData());
EditContent(pCont);
}
else
@@ -1192,7 +1192,7 @@ void SwGlobalTree::OpenDoc(const SwGlblDocContent* pCont)
IMPL_LINK_NOARG( SwGlobalTree, DoubleClickHdl)
{
SvTreeListEntry* pEntry = GetCurEntry();
- SwGlblDocContent* pCont = (SwGlblDocContent*)pEntry->GetUserData();
+ SwGlblDocContent* pCont = static_cast<SwGlblDocContent*>(pEntry->GetUserData());
if(pCont->GetType() == GLBLDOC_SECTION)
OpenDoc(pCont);
else
@@ -1233,7 +1233,7 @@ void SwLBoxString::Paint(
const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* pView,
const SvTreeListEntry* pEntry)
{
- SwGlblDocContent* pCont = (SwGlblDocContent*)pEntry->GetUserData();
+ SwGlblDocContent* pCont = static_cast<SwGlblDocContent*>(pEntry->GetUserData());
if(pCont->GetType() == GLBLDOC_SECTION &&
!(pCont->GetSection())->IsConnectFlag() )
{
@@ -1269,7 +1269,7 @@ void SwGlobalTree::InsertRegion( const SwGlblDocContent* _pContent, const Sequen
if ( !_pContent )
{
SvTreeListEntry* pLast = (SvTreeListEntry*)LastVisible();
- _pContent = (SwGlblDocContent*)pLast->GetUserData();
+ _pContent = static_cast<SwGlblDocContent*>(pLast->GetUserData());
bMove = true;
}
OUString sFilePassword;
diff --git a/sw/source/uibase/utlui/navicfg.cxx b/sw/source/uibase/utlui/navicfg.cxx
index 6ae84e5050b4..1339a9eddb87 100644
--- a/sw/source/uibase/utlui/navicfg.cxx
+++ b/sw/source/uibase/utlui/navicfg.cxx
@@ -78,8 +78,8 @@ SwNavigationConfig::SwNavigationConfig() :
case 2: pValues[nProp] >>= nOutlineLevel; break;
case 3: pValues[nProp] >>= nRegionMode; break;
case 4: pValues[nProp] >>= nActiveBlock; break;
- case 5: bIsSmall = *(sal_Bool*)pValues[nProp].getValue(); break;
- case 6: bIsGlobalActive = *(sal_Bool*)pValues[nProp].getValue(); break;
+ case 5: bIsSmall = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
+ case 6: bIsGlobalActive = *static_cast<sal_Bool const *>(pValues[nProp].getValue()); break;
}
}
}
diff --git a/sw/source/uibase/wrtsh/select.cxx b/sw/source/uibase/wrtsh/select.cxx
index 439c945468a9..2577dcae8f60 100644
--- a/sw/source/uibase/wrtsh/select.cxx
+++ b/sw/source/uibase/wrtsh/select.cxx
@@ -707,7 +707,7 @@ void SwWrtShell::LeaveSelFrmMode()
IMPL_LINK( SwWrtShell, ExecFlyMac, void *, pFlyFmt )
{
- const SwFrmFmt *pFmt = pFlyFmt ? (SwFrmFmt*)pFlyFmt : GetFlyFrmFmt();
+ const SwFrmFmt *pFmt = pFlyFmt ? static_cast<SwFrmFmt*>(pFlyFmt) : GetFlyFrmFmt();
OSL_ENSURE(pFmt, "no frame format");
const SvxMacroItem &rFmtMac = pFmt->GetMacro();