summaryrefslogtreecommitdiff
path: root/sw/source/uibase/utlui
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2016-07-15 10:44:32 +0200
committerJan Holesovsky <kendy@collabora.com>2016-07-15 11:40:25 +0200
commit8969af9e29bff94708093ac1a8dc15d5ef9c480b (patch)
treea7861270c8b4842af06fa1023158e5f0a4cdde12 /sw/source/uibase/utlui
parent922d67cbdb3af76b9c4ffea090b6653fe3c2112c (diff)
Simplify dynamic_cast followed by a static_cast.
Change-Id: I4bf7f85397f83554f511f80621b5086cda6ab1a9
Diffstat (limited to 'sw/source/uibase/utlui')
-rw-r--r--sw/source/uibase/utlui/content.cxx27
1 files changed, 11 insertions, 16 deletions
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index abe568f5ce76..31e2d5508611 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -394,18 +394,17 @@ void SwContentType::Init(bool* pbInvalidateWindow)
{
for(SwPostItMgr::const_iterator i = aMgr->begin(); i != aMgr->end(); ++i)
{
- if ( dynamic_cast< const SwFormatField *>( (*i)->GetBroadCaster() ) != nullptr ) // SwPostit
+ if (const SwFormatField* pFormatField = dynamic_cast<const SwFormatField *>((*i)->GetBroadCaster())) // SwPostit
{
- const SwFormatField* aFormatField = static_cast<const SwFormatField*>((*i)->GetBroadCaster());
- if (aFormatField->GetTextField() && aFormatField->IsFieldInDoc() &&
+ if (pFormatField->GetTextField() && pFormatField->IsFieldInDoc() &&
(*i)->mLayoutStatus!=SwPostItHelper::INVISIBLE )
{
- OUString sEntry = aFormatField->GetField()->GetPar2();
+ OUString sEntry = pFormatField->GetField()->GetPar2();
sEntry = RemoveNewline(sEntry);
SwPostItContent* pCnt = new SwPostItContent(
this,
sEntry,
- aFormatField,
+ pFormatField,
nMemberCount);
pMember->insert(pCnt);
nMemberCount++;
@@ -508,8 +507,7 @@ void SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged)
// with the same number and existing "pOldMember" the
// old one is compared with the new OutlinePos.
// cast for Win16
- if (nOldMemberCount > nPos &&
- static_cast<SwOutlineContent*>((*pOldMember)[nPos])->GetOutlineLevel() != nLevel)
+ if (nOldMemberCount > nPos && static_cast<SwOutlineContent*>((*pOldMember)[nPos])->GetOutlineLevel() != nLevel)
*pbLevelOrVisibilityChanged = true;
nPos++;
@@ -699,18 +697,17 @@ void SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged)
{
for(SwPostItMgr::const_iterator i = aMgr->begin(); i != aMgr->end(); ++i)
{
- if ( dynamic_cast< const SwFormatField *>( (*i)->GetBroadCaster() ) != nullptr ) // SwPostit
+ if (const SwFormatField* pFormatField = dynamic_cast<const SwFormatField *>((*i)->GetBroadCaster())) // SwPostit
{
- const SwFormatField* aFormatField = static_cast<const SwFormatField*>((*i)->GetBroadCaster());
- if (aFormatField->GetTextField() && aFormatField->IsFieldInDoc() &&
+ if (pFormatField->GetTextField() && pFormatField->IsFieldInDoc() &&
(*i)->mLayoutStatus!=SwPostItHelper::INVISIBLE )
{
- OUString sEntry = aFormatField->GetField()->GetPar2();
+ OUString sEntry = pFormatField->GetField()->GetPar2();
sEntry = RemoveNewline(sEntry);
SwPostItContent* pCnt = new SwPostItContent(
this,
sEntry,
- aFormatField,
+ pFormatField,
nMemberCount);
pMember->insert(pCnt);
nMemberCount++;
@@ -1111,8 +1108,7 @@ VclPtr<PopupMenu> SwContentTree::CreateContextMenu()
pSubPop2->InsertItem( i + 201, m_aContextStrings[
STR_HYPERLINK - STR_CONTEXT_FIRST + i]);
}
- pSubPop2->CheckItem( 201 +
- static_cast<int>(GetParentWindow()->GetRegionDropMode()));
+ pSubPop2->CheckItem(201 + static_cast<int>(GetParentWindow()->GetRegionDropMode()));
// Insert the list of the open files
sal_uInt16 nId = 301;
const SwView* pActiveView = ::GetActiveView();
@@ -2208,8 +2204,7 @@ void SwContentTree::Notify(SfxBroadcaster & rBC, SfxHint const& rHint)
return;
}
- SfxViewEventHint const*const pVEHint(
- dynamic_cast<SfxViewEventHint const*>(&rHint));
+ SfxViewEventHint const*const pVEHint(dynamic_cast<SfxViewEventHint const*>(&rHint));
SwXTextView* pDyingShell = nullptr;
if (m_pActiveShell && pVEHint && pVEHint->GetEventName() == "OnViewClosed")
pDyingShell = dynamic_cast<SwXTextView*>(pVEHint->GetController().get());