summaryrefslogtreecommitdiff
path: root/sw/source/uibase/app
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-11-24 10:40:08 +0200
committerNoel Grandin <noel@peralex.com>2014-11-25 10:09:52 +0200
commit88aaa3496161339d504876a2e84dc03e4d6191d9 (patch)
tree5ffc860b837f28737c85f182af1360d111fd3693 /sw/source/uibase/app
parent1f1c7a4b0d582dffa920c7a51a55ea32c4d203fe (diff)
loplugin: cstylecast
Change-Id: I0607afad59068e3d94494f971990fb45c2b79443
Diffstat (limited to 'sw/source/uibase/app')
-rw-r--r--sw/source/uibase/app/appopt.cxx2
-rw-r--r--sw/source/uibase/app/docsh.cxx8
-rw-r--r--sw/source/uibase/app/docsh2.cxx18
-rw-r--r--sw/source/uibase/app/docshini.cxx8
-rw-r--r--sw/source/uibase/app/docst.cxx8
-rw-r--r--sw/source/uibase/app/docstyle.cxx54
-rw-r--r--sw/source/uibase/app/swmodul1.cxx2
7 files changed, 50 insertions, 50 deletions
diff --git a/sw/source/uibase/app/appopt.cxx b/sw/source/uibase/app/appopt.cxx
index cb6a1652a23c..f1aef7182750 100644
--- a/sw/source/uibase/app/appopt.cxx
+++ b/sw/source/uibase/app/appopt.cxx
@@ -388,7 +388,7 @@ void SwModule::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet )
if( SfxItemState::SET == rSet.GetItemState( FN_PARAM_SHADOWCURSOR, false, &pItem ))
{
- ((SwShadowCursorItem*)pItem)->FillViewOptions( aViewOpt );
+ static_cast<const SwShadowCursorItem*>(pItem)->FillViewOptions( aViewOpt );
if(pBindings)
pBindings->Invalidate(FN_SHADOWCURSOR);
}
diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx
index 1879e7e00d5c..23e315555c50 100644
--- a/sw/source/uibase/app/docsh.cxx
+++ b/sw/source/uibase/app/docsh.cxx
@@ -956,7 +956,7 @@ void SwDocShell::GetState(SfxItemSet& rSet)
while (pTmpFrm) // Look for Preview
{
if ( PTR_CAST(SwView, pTmpFrm->GetViewShell()) &&
- ((SwView*)pTmpFrm->GetViewShell())->GetWrtShell().GetViewOptions()->getBrowseMode() )
+ static_cast<SwView*>(pTmpFrm->GetViewShell())->GetWrtShell().GetViewOptions()->getBrowseMode() )
{
bDisable = true;
break;
@@ -1120,7 +1120,7 @@ void SwDocShell::LoadingFinished()
{
SfxViewShell* pShell = pVFrame->GetViewShell();
if(PTR_CAST(SwSrcView, pShell))
- ((SwSrcView*)pShell)->Load(this);
+ static_cast<SwSrcView*>(pShell)->Load(this);
}
// #i38810#
@@ -1294,7 +1294,7 @@ bool SwDocShell::SetProtectionPassword( const OUString &rNewPassword )
IDocumentRedlineAccess* pIDRA = mpWrtShell->getIDocumentRedlineAccess();
Sequence< sal_Int8 > aPasswd = pIDRA->GetRedlinePassword();
if (pArgs && SfxItemState::SET == pArgs->GetItemState( FN_REDLINE_PROTECT, false, &pItem )
- && ((SfxBoolItem*)pItem)->GetValue() == (aPasswd.getLength() > 0))
+ && static_cast<const SfxBoolItem*>(pItem)->GetValue() == (aPasswd.getLength() > 0))
return false;
bool bRes = false;
@@ -1329,7 +1329,7 @@ bool SwDocShell::GetProtectionHash( /*out*/ ::com::sun::star::uno::Sequence< sal
IDocumentRedlineAccess* pIDRA = mpWrtShell->getIDocumentRedlineAccess();
Sequence< sal_Int8 > aPasswdHash( pIDRA->GetRedlinePassword() );
if (pArgs && SfxItemState::SET == pArgs->GetItemState( FN_REDLINE_PROTECT, false, &pItem )
- && ((SfxBoolItem*)pItem)->GetValue() == (aPasswdHash.getLength() != 0))
+ && static_cast<const SfxBoolItem*>(pItem)->GetValue() == (aPasswdHash.getLength() != 0))
return false;
rPasswordHash = aPasswdHash;
bRes = true;
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index a554ebd78ccf..bab7224ae7e8 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -184,7 +184,7 @@ void SwDocShell::ToggleBrowserMode(bool bSet, SwView* _pView )
{
const SvxZoomType eType = (SvxZoomType)rViewOptions.GetZoomType();
if ( SVX_ZOOM_PERCENT != eType)
- ((SwView*)GetView())->SetZoom( eType );
+ static_cast<SwView*>(GetView())->SetZoom( eType );
}
pTempView->InvalidateBorder();
pTempView->SetNewWindowAllowed(!bSet);
@@ -220,7 +220,7 @@ static void lcl_processCompatibleSfxHint( const uno::Reference< script::vba::XVB
if ( dynamic_cast<const SfxEventHint*>(&rHint) )
{
uno::Sequence< uno::Any > aArgs;
- sal_uLong nEventId = ((SfxEventHint&)rHint).GetEventId();
+ sal_uLong nEventId = static_cast<const SfxEventHint&>(rHint).GetEventId();
switch( nEventId )
{
case SFX_EVENT_CREATEDOC:
@@ -249,7 +249,7 @@ void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
if( dynamic_cast<const SfxSimpleHint*>(&rHint) )
{
// switch for more actions
- switch( ((SfxSimpleHint&) rHint).GetId() )
+ switch( static_cast<const SfxSimpleHint&>( rHint).GetId() )
{
case SFX_HINT_TITLECHANGED:
if( GetMedium() )
@@ -258,7 +258,7 @@ void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
}
}
else if( dynamic_cast<const SfxEventHint*>(&rHint) &&
- ((SfxEventHint&) rHint).GetEventId() == SFX_EVENT_LOADFINISHED )
+ static_cast<const SfxEventHint&>( rHint).GetEventId() == SFX_EVENT_LOADFINISHED )
{
// #i38126# - own action id
nAction = 3;
@@ -429,7 +429,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
if( pArgs && SfxItemState::SET ==
pArgs->GetItemState( SID_PRINTPREVIEW, false, &pItem ))
- bSet = ((SfxBoolItem*)pItem)->GetValue();
+ bSet = static_cast<const SfxBoolItem*>(pItem)->GetValue();
else
bSet = !bCurrent;
@@ -1100,7 +1100,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
if ( pArgs && SfxItemState::SET == pArgs->GetItemState( nWhich , false, &pItem ))
{
OSL_ENSURE(pItem->ISA(SfxUInt16Item), "wrong Item");
- sal_uInt16 nYear2K = ((SfxUInt16Item*)pItem)->GetValue();
+ sal_uInt16 nYear2K = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
// iterate over Views and put the State to FormShells
SfxViewFrame* pVFrame = SfxViewFrame::GetFirst( this );
@@ -1146,7 +1146,7 @@ void lcl_processCompatibleSfxHint( const uno::Reference< document::XVbaEventsHel
if ( rHint.ISA( SfxEventHint ) )
{
uno::Sequence< uno::Any > aArgs;
- sal_uLong nEventId = ((SfxEventHint&)rHint).GetEventId();
+ sal_uLong nEventId = static_cast<SfxEventHint&>(rHint).GetEventId();
switch( nEventId )
{
case SFX_EVENT_CREATEDOC:
@@ -1338,7 +1338,7 @@ void SwDocShell::ReloadFromHtml( const OUString& rStreamName, SwSrcView* pSrcVie
// now also the UNO-Model has to be informed about the new Doc #51535#
uno::Reference<text::XTextDocument> xDoc(GetBaseModel(), uno::UNO_QUERY);
text::XTextDocument* pxDoc = xDoc.get();
- ((SwXTextDocument*)pxDoc)->InitNewDoc();
+ static_cast<SwXTextDocument*>(pxDoc)->InitNewDoc();
AddLink();
//#116402# update font list when new document is created
@@ -1533,7 +1533,7 @@ int SwFindDocShell( SfxObjectShellRef& xDocSh,
const SfxPoolItem* pItem;
if( ( SfxItemState::SET == pMed->GetItemSet()->GetItemState(
SID_VERSION, false, &pItem ) )
- ? (nVersion == ((SfxInt16Item*)pItem)->GetValue())
+ ? (nVersion == static_cast<const SfxInt16Item*>(pItem)->GetValue())
: !nVersion )
{
// Found, thus return
diff --git a/sw/source/uibase/app/docshini.cxx b/sw/source/uibase/app/docshini.cxx
index 3f978cf981fc..6c35085c71cf 100644
--- a/sw/source/uibase/app/docshini.cxx
+++ b/sw/source/uibase/app/docshini.cxx
@@ -412,7 +412,7 @@ void SwDocShell::AddLink()
mpDoc->acquire();
mpDoc->SetDocShell( this ); // set the DocShell-Pointer for Doc
uno::Reference< text::XTextDocument > xDoc(GetBaseModel(), uno::UNO_QUERY);
- ((SwXTextDocument*)xDoc.get())->Reactivate(this);
+ static_cast<SwXTextDocument*>(xDoc.get())->Reactivate(this);
SetPool(&mpDoc->GetAttrPool());
@@ -441,7 +441,7 @@ void SwDocShell::RemoveLink()
{
// disconnect Uno-Object
uno::Reference< text::XTextDocument > xDoc(GetBaseModel(), uno::UNO_QUERY);
- ((SwXTextDocument*)xDoc.get())->Invalidate();
+ static_cast<SwXTextDocument*>(xDoc.get())->Invalidate();
aFinishedTimer.Stop();
if (mpDoc)
{
@@ -462,13 +462,13 @@ void SwDocShell::InvalidateModel()
{
// disconnect Uno-Object
uno::Reference< text::XTextDocument > xDoc(GetBaseModel(), uno::UNO_QUERY);
- ((SwXTextDocument*)xDoc.get())->Invalidate();
+ static_cast<SwXTextDocument*>(xDoc.get())->Invalidate();
}
void SwDocShell::ReactivateModel()
{
// disconnect Uno-Object
uno::Reference< text::XTextDocument > xDoc(GetBaseModel(), uno::UNO_QUERY);
- ((SwXTextDocument*)xDoc.get())->Reactivate(this);
+ static_cast<SwXTextDocument*>(xDoc.get())->Reactivate(this);
}
// Load, Default-Format
diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx
index 8307399540e2..aebf6ede5e90 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 = ((const SfxUInt16Item*)pItem)->GetValue();
if( SfxItemState::SET == pArgs->GetItemState(FN_PARAM_WRTSHELL,
false, &pItem ))
- pActShell = pShell = (SwWrtShell*)((SwPtrItem*)pItem)->GetValue();
+ pActShell = pShell = (SwWrtShell*)static_cast<const SwPtrItem*>(pItem)->GetValue();
if( nSlot == SID_STYLE_UPDATE_BY_EXAMPLE )
{
@@ -1258,7 +1258,7 @@ void SwDocShell::_LoadStyles( SfxObjectShell& rSource, bool bPreserveCurrentDocu
// of the template, update all the Source's
// FixFields once.
if(!bPreserveCurrentDocument)
- ((SwDocShell&)rSource).mpDoc->getIDocumentFieldsAccess().SetFixFields(false, NULL);
+ static_cast<SwDocShell&>(rSource).mpDoc->getIDocumentFieldsAccess().SetFixFields(false, NULL);
if( mpWrtShell )
{
// rhbz#818557, fdo#58893: EndAllAction will call SelectShell(),
@@ -1267,13 +1267,13 @@ void SwDocShell::_LoadStyles( SfxObjectShell& rSource, bool bPreserveCurrentDocu
// setting bNoInterrupt appears to avoid the problem.
::comphelper::FlagRestorationGuard g(bNoInterrupt, true);
mpWrtShell->StartAllAction();
- mpDoc->ReplaceStyles( *((SwDocShell&)rSource).mpDoc );
+ mpDoc->ReplaceStyles( *static_cast<SwDocShell&>(rSource).mpDoc );
mpWrtShell->EndAllAction();
}
else
{
bool bModified = mpDoc->getIDocumentState().IsModified();
- mpDoc->ReplaceStyles( *((SwDocShell&)rSource).mpDoc );
+ mpDoc->ReplaceStyles( *static_cast<SwDocShell&>(rSource).mpDoc );
if( !bModified && mpDoc->getIDocumentState().IsModified() && !mpView )
{
// the View is created later, but overwrites the Modify-Flag.
diff --git a/sw/source/uibase/app/docstyle.cxx b/sw/source/uibase/app/docstyle.cxx
index 92c8dabb4c97..64602029cb70 100644
--- a/sw/source/uibase/app/docstyle.cxx
+++ b/sw/source/uibase/app/docstyle.cxx
@@ -1007,7 +1007,7 @@ bool SwDocStyleSheet::SetName(const OUString& rStr, bool bReindexNow)
// Set PageDesc - copy with earlier one - probably not
// necessary for setting the name. So here we allow a
// cast.
- SwPageDesc aPageDesc(*((SwPageDesc*)pDesc));
+ SwPageDesc aPageDesc(*const_cast<SwPageDesc*>(pDesc));
const OUString aOldName(aPageDesc.GetName());
aPageDesc.SetName( rStr );
@@ -1042,7 +1042,7 @@ bool SwDocStyleSheet::SetName(const OUString& rStr, bool bReindexNow)
else
{
// #i91400#
- ((SwNumRule*)pNumRule)->SetName( rStr, rDoc.getIDocumentListsAccess() );
+ const_cast<SwNumRule*>(pNumRule)->SetName( rStr, rDoc.getIDocumentListsAccess() );
rDoc.getIDocumentState().SetModified();
bChg = true;
@@ -1240,7 +1240,7 @@ SfxItemSet& SwDocStyleSheet::GetItemSet()
}
OSL_ENSURE(pDesc, "No PageDescriptor");
- ::PageDescToItemSet(*((SwPageDesc*)pDesc), aCoreSet);
+ ::PageDescToItemSet(*const_cast<SwPageDesc*>(pDesc), aCoreSet);
}
break;
@@ -1344,7 +1344,7 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet,
for(sal_uInt16 i = 0; i < COND_COMMAND_COUNT; i++)
{
SwCollCondition aCond( 0, pCmds[ i ].nCnd, pCmds[ i ].nSubCond );
- ((SwConditionTxtFmtColl*)pColl)->RemoveCondition( aCond );
+ static_cast<SwConditionTxtFmtColl*>(pColl)->RemoveCondition( aCond );
const OUString sStyle = pCondItem->GetStyle( i );
if (sStyle.isEmpty())
continue;
@@ -1352,7 +1352,7 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet,
if (pFindFmt)
{
aCond.RegisterToFormat( *pFindFmt );
- ((SwConditionTxtFmtColl*)pColl)->InsertCondition( aCond );
+ static_cast<SwConditionTxtFmtColl*>(pColl)->InsertCondition( aCond );
}
}
@@ -1406,7 +1406,7 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet,
const SfxPoolItem* pNumRuleItem = 0;
if( SfxItemState::SET == rSet.GetItemState( RES_PARATR_NUMRULE, false, &pNumRuleItem ) )
{ // Setting a numbering rule?
- const OUString sNumRule = ((SwNumRuleItem*)pNumRuleItem)->GetValue();
+ const OUString sNumRule = static_cast<const SwNumRuleItem*>(pNumRuleItem)->GetValue();
if (!sNumRule.isEmpty())
{
SwNumRule* pRule = rDoc.FindNumRulePtr( sNumRule );
@@ -1490,7 +1490,7 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet,
{
case SfxItemState::SET:
{
- SvxNumRule* pSetRule = ((SvxNumBulletItem*)pItem)->GetNumRule();
+ SvxNumRule* pSetRule = static_cast<const SvxNumBulletItem*>(pItem)->GetNumRule();
pSetRule->UnLinkGraphics();
SwNumRule aSetRule(*pNumRule);
aSetRule.SetSvxRule(*pSetRule, &rDoc);
@@ -2169,13 +2169,13 @@ void SwDocStyleSheet::SetHelpId( const OUString& r, sal_uLong nId )
case SFX_STYLE_FAMILY_PARA : pTmpFmt = pColl; break;
case SFX_STYLE_FAMILY_FRAME: pTmpFmt = pFrmFmt; break;
case SFX_STYLE_FAMILY_PAGE :
- ((SwPageDesc*)pDesc)->SetPoolHelpId( nHId );
- ((SwPageDesc*)pDesc)->SetPoolHlpFileId( nFileId );
+ const_cast<SwPageDesc*>(pDesc)->SetPoolHelpId( nHId );
+ const_cast<SwPageDesc*>(pDesc)->SetPoolHlpFileId( nFileId );
break;
case SFX_STYLE_FAMILY_PSEUDO:
- ((SwNumRule*)pNumRule)->SetPoolHelpId( nHId );
- ((SwNumRule*)pNumRule)->SetPoolHlpFileId( nFileId );
+ const_cast<SwNumRule*>(pNumRule)->SetPoolHelpId( nHId );
+ const_cast<SwNumRule*>(pNumRule)->SetPoolHlpFileId( nFileId );
break;
default:
@@ -2272,9 +2272,9 @@ void SwDocStyleSheetPool::Replace( SfxStyleSheetBase& rSource,
{
// deal with separately!
SwPageDesc* pDestDsc =
- (SwPageDesc*)((SwDocStyleSheet&)rTarget).GetPageDesc();
+ (SwPageDesc*)static_cast<SwDocStyleSheet&>(rTarget).GetPageDesc();
SwPageDesc* pCpyDsc =
- (SwPageDesc*)((SwDocStyleSheet&)rSource).GetPageDesc();
+ (SwPageDesc*)static_cast<SwDocStyleSheet&>(rSource).GetPageDesc();
rDoc.CopyPageDesc( *pCpyDsc, *pDestDsc );
}
else
@@ -2286,23 +2286,23 @@ void SwDocStyleSheetPool::Replace( SfxStyleSheetBase& rSource,
{
case SFX_STYLE_FAMILY_CHAR :
if( bSwSrcPool )
- pSourceFmt = ((SwDocStyleSheet&)rSource).GetCharFmt();
- pTargetFmt = ((SwDocStyleSheet&)rTarget).GetCharFmt();
+ pSourceFmt = static_cast<SwDocStyleSheet&>(rSource).GetCharFmt();
+ pTargetFmt = static_cast<SwDocStyleSheet&>(rTarget).GetCharFmt();
break;
case SFX_STYLE_FAMILY_PARA :
if( bSwSrcPool )
- pSourceFmt = ((SwDocStyleSheet&)rSource).GetCollection();
- pTargetFmt = ((SwDocStyleSheet&)rTarget).GetCollection();
+ pSourceFmt = static_cast<SwDocStyleSheet&>(rSource).GetCollection();
+ pTargetFmt = static_cast<SwDocStyleSheet&>(rTarget).GetCollection();
break;
case SFX_STYLE_FAMILY_FRAME:
if( bSwSrcPool )
- pSourceFmt = ((SwDocStyleSheet&)rSource).GetFrmFmt();
- pTargetFmt = ((SwDocStyleSheet&)rTarget).GetFrmFmt();
+ pSourceFmt = static_cast<SwDocStyleSheet&>(rSource).GetFrmFmt();
+ pTargetFmt = static_cast<SwDocStyleSheet&>(rTarget).GetFrmFmt();
break;
case SFX_STYLE_FAMILY_PAGE:
{
SwPageDesc *pDesc = rDoc.FindPageDesc(
- ((SwDocStyleSheet&)rTarget).GetPageDesc()->GetName(),
+ static_cast<SwDocStyleSheet&>(rTarget).GetPageDesc()->GetName(),
&nPgDscPos );
if( pDesc )
@@ -2331,7 +2331,7 @@ void SwDocStyleSheetPool::Replace( SfxStyleSheetBase& rSource,
rDoc.ChgPageDesc( nPgDscPos,
rDoc.GetPageDesc(nPgDscPos) );
}
- ((SwDocStyleSheet&)rTarget).SetItemSet( rSource.GetItemSet() );
+ static_cast<SwDocStyleSheet&>(rTarget).SetItemSet( rSource.GetItemSet() );
}
}
@@ -2443,7 +2443,7 @@ bool SwDocStyleSheetPool::SetParent( SfxStyleFamily eFam,
mxStyleSheet->PresetName( rStyle );
mxStyleSheet->PresetParent( rParent );
if( SFX_STYLE_FAMILY_PARA == eFam )
- mxStyleSheet->PresetFollow( ((SwTxtFmtColl*)pFmt)->
+ mxStyleSheet->PresetFollow( static_cast<SwTxtFmtColl*>(pFmt)->
GetNextTxtFmtColl().GetName() );
else
mxStyleSheet->PresetFollow( OUString() );
@@ -2522,8 +2522,8 @@ SfxStyleSheetBase* SwDocStyleSheetPool::Find( const OUString& rName,
if( pMod && !bSearchUsed )
{
const sal_uInt16 nId = SFX_STYLE_FAMILY_PAGE == eFam
- ? ((SwPageDesc*)pMod)->GetPoolFmtId()
- : ((SwFmt*)pMod)->GetPoolFmtId();
+ ? static_cast<const SwPageDesc*>(pMod)->GetPoolFmtId()
+ : static_cast<const SwFmt*>(pMod)->GetPoolFmtId();
if( ( nSMask & ~SFXSTYLEBIT_USED) == SFXSTYLEBIT_USERDEF
? !(nId & USER_FMT)
@@ -2580,14 +2580,14 @@ SfxStyleSheetBase* SwStyleSheetIterator::First()
// Delete current
mxIterSheet->Reset();
- SwDoc& rDoc = ((SwDocStyleSheetPool*)pBasePool)->GetDoc();
+ SwDoc& rDoc = static_cast<SwDocStyleSheetPool*>(pBasePool)->GetDoc();
const sal_uInt16 nSrchMask = nMask;
const bool bIsSearchUsed = SearchUsed();
bool bSearchHidden = ( nMask & SFXSTYLEBIT_HIDDEN );
bool bOnlyHidden = nMask == SFXSTYLEBIT_HIDDEN;
- const bool bOrganizer = ((SwDocStyleSheetPool*)pBasePool)->IsOrganizerMode();
+ const bool bOrganizer = static_cast<SwDocStyleSheetPool*>(pBasePool)->IsOrganizerMode();
bool bAll = ( nSrchMask & SFXSTYLEBIT_ALL_VISIBLE ) == SFXSTYLEBIT_ALL_VISIBLE;
if( nSearchFamily == SFX_STYLE_FAMILY_CHAR
@@ -2967,7 +2967,7 @@ void SwStyleSheetIterator::AppendStyleList(const ::std::vector<OUString>& rList,
bool bTestUsed, bool bTestHidden, bool bOnlyHidden,
sal_uInt16 nSection, char cType )
{
- SwDoc& rDoc = ((SwDocStyleSheetPool*)pBasePool)->GetDoc();
+ SwDoc& rDoc = static_cast<SwDocStyleSheetPool*>(pBasePool)->GetDoc();
bool bUsed = false;
for ( sal_uInt16 i=0; i < rList.size(); ++i )
{
diff --git a/sw/source/uibase/app/swmodul1.cxx b/sw/source/uibase/app/swmodul1.cxx
index bf80bc0e9733..7d58b43f8d0a 100644
--- a/sw/source/uibase/app/swmodul1.cxx
+++ b/sw/source/uibase/app/swmodul1.cxx
@@ -194,7 +194,7 @@ void SwModule::ApplyUsrPref(const SwViewOption &rUsrPref, SwView* pActView,
//is maybe only a SwViewShell
pSh->StartAction();
pSh->ApplyViewOptions( *xViewOpt );
- ((SwWrtShell*)pSh)->SetReadOnlyAvailable(xViewOpt->IsCursorInProtectedArea());
+ static_cast<SwWrtShell*>(pSh)->SetReadOnlyAvailable(xViewOpt->IsCursorInProtectedArea());
pSh->EndAction();
}
if ( pSh->GetViewOptions()->IsReadonly() != bReadonly )