summaryrefslogtreecommitdiff
path: root/sw/source/uibase
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-03-28 19:07:45 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-03-28 19:09:27 +0100
commit2828d92eee63a4a5306ef64482bc7d1db3459406 (patch)
tree0fe6e09f55f278bf9c32d36e9375fb7258b6ed0a /sw/source/uibase
parent85f28ec44a2c169c91dac9346e9c71feda6a6cab (diff)
Clean up C-style casts from pointers to void
Change-Id: I2ec58d0bfe13fae4fc2141f9b017b5a72e0ba2c2
Diffstat (limited to 'sw/source/uibase')
-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
23 files changed, 202 insertions, 202 deletions
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();