diff options
author | Noel Grandin <noel@peralex.com> | 2014-11-24 10:40:28 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-11-25 10:09:53 +0200 |
commit | 830193d1e5fd3455e8a30caffeab79e14d9d9da0 (patch) | |
tree | 62a9aa5444aedfda924b70fc77ccbf3bda15a5bc | |
parent | 9409b2eb454118eab93542d4dfb464b723b219e2 (diff) |
loplugin: cstylecast
Change-Id: I1ca8f2c4a2a6a2729fc736222055417427c72177
-rw-r--r-- | sw/source/uibase/uno/unomod.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/uno/unotxdoc.cxx | 90 | ||||
-rw-r--r-- | sw/source/uibase/uno/unotxvw.cxx | 6 | ||||
-rw-r--r-- | sw/source/uibase/utlui/bookctrl.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/utlui/glbltree.cxx | 8 | ||||
-rw-r--r-- | sw/source/uibase/utlui/navipi.cxx | 20 | ||||
-rw-r--r-- | sw/source/uibase/utlui/tmplctrl.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/utlui/uiitems.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/utlui/wordcountctrl.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/wrtsh/wrtsh1.cxx | 6 | ||||
-rw-r--r-- | sw/source/uibase/wrtsh/wrtsh2.cxx | 12 |
11 files changed, 79 insertions, 79 deletions
diff --git a/sw/source/uibase/uno/unomod.cxx b/sw/source/uibase/uno/unomod.cxx index 4ab522c0b35f..1d1e8f8cbc1b 100644 --- a/sw/source/uibase/uno/unomod.cxx +++ b/sw/source/uibase/uno/unomod.cxx @@ -228,7 +228,7 @@ Reference< XPropertySet > SwXModule::getViewSettings(void) throw( uno::RuntimeE SolarMutexGuard aGuard; if(!pxViewSettings) { - ((SwXModule*)this)->pxViewSettings = new Reference< XPropertySet > ; + static_cast<SwXModule*>(this)->pxViewSettings = new Reference< XPropertySet > ; OSL_FAIL("Web or Text?"); *pxViewSettings = static_cast < HelperBaseNoState * > ( new SwXViewSettings( false, 0 ) ); } @@ -240,7 +240,7 @@ Reference< XPropertySet > SwXModule::getPrintSettings(void) throw( uno::Runtime SolarMutexGuard aGuard; if(!pxPrintSettings) { - ((SwXModule*)this)->pxPrintSettings = new Reference< XPropertySet > ; + static_cast<SwXModule*>(this)->pxPrintSettings = new Reference< XPropertySet > ; OSL_FAIL("Web or Text?"); *pxPrintSettings = static_cast < HelperBaseNoState * > ( new SwXPrintSettings ( PRINT_SETTINGS_MODULE ) ); } diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 50dc5f895976..e6a5f9b6b9b2 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -636,7 +636,7 @@ Reference< XIndexAccess > SwXTextDocument::getNumberingRules(void) throw( Runti throw RuntimeException(); if(!pxXNumberingRules ) { - ((SwXTextDocument*)this)->pxXNumberingRules = new Reference< XIndexAccess > ; + static_cast<SwXTextDocument*>(this)->pxXNumberingRules = new Reference< XIndexAccess > ; *pxXNumberingRules = new SwXNumberingRulesCollection( pDocShell->GetDoc() ); } return *pxXNumberingRules; @@ -649,7 +649,7 @@ Reference< XIndexAccess > SwXTextDocument::getFootnotes(void) throw( RuntimeExc throw RuntimeException(); if(!pxXFootnotes) { - ((SwXTextDocument*)this)->pxXFootnotes = new Reference< XIndexAccess > ; + static_cast<SwXTextDocument*>(this)->pxXFootnotes = new Reference< XIndexAccess > ; *pxXFootnotes = new SwXFootnotes(false, pDocShell->GetDoc()); } return *pxXFootnotes; @@ -663,7 +663,7 @@ Reference< XPropertySet > SAL_CALL throw RuntimeException(); if(!pxXFootnoteSettings) { - ((SwXTextDocument*)this)->pxXFootnoteSettings = new Reference< XPropertySet > ; + static_cast<SwXTextDocument*>(this)->pxXFootnoteSettings = new Reference< XPropertySet > ; *pxXFootnoteSettings = new SwXFootnoteProperties(pDocShell->GetDoc()); } return *pxXFootnoteSettings; @@ -676,7 +676,7 @@ Reference< XIndexAccess > SwXTextDocument::getEndnotes(void) throw( RuntimeExce throw RuntimeException(); if(!pxXEndnotes) { - ((SwXTextDocument*)this)->pxXEndnotes = new Reference< XIndexAccess > ; + static_cast<SwXTextDocument*>(this)->pxXEndnotes = new Reference< XIndexAccess > ; *pxXEndnotes = new SwXFootnotes(true, pDocShell->GetDoc()); } return *pxXEndnotes; @@ -689,7 +689,7 @@ Reference< XPropertySet > SwXTextDocument::getEndnoteSettings(void) throw( Runt throw RuntimeException(); if(!pxXEndnoteSettings) { - ((SwXTextDocument*)this)->pxXEndnoteSettings = new Reference< XPropertySet > ; + static_cast<SwXTextDocument*>(this)->pxXEndnoteSettings = new Reference< XPropertySet > ; *pxXEndnoteSettings = new SwXEndnoteProperties(pDocShell->GetDoc()); } return *pxXEndnoteSettings; @@ -1225,7 +1225,7 @@ Reference< XNameAccess > SwXTextDocument::getReferenceMarks(void) throw RuntimeException(); if(!pxXReferenceMarks) { - ((SwXTextDocument*)this)->pxXReferenceMarks = new Reference< XNameAccess > ; + static_cast<SwXTextDocument*>(this)->pxXReferenceMarks = new Reference< XNameAccess > ; *pxXReferenceMarks = new SwXReferenceMarks(pDocShell->GetDoc()); } return *pxXReferenceMarks; @@ -1238,7 +1238,7 @@ Reference< XEnumerationAccess > SwXTextDocument::getTextFields(void) throw( Run throw RuntimeException(); if(!pxXTextFieldTypes) { - ((SwXTextDocument*)this)->pxXTextFieldTypes = new Reference< XEnumerationAccess > ; + static_cast<SwXTextDocument*>(this)->pxXTextFieldTypes = new Reference< XEnumerationAccess > ; *pxXTextFieldTypes = new SwXTextFieldTypes(pDocShell->GetDoc()); } return *pxXTextFieldTypes; @@ -1252,7 +1252,7 @@ Reference< XNameAccess > SwXTextDocument::getTextFieldMasters(void) throw RuntimeException(); if(!pxXTextFieldMasters) { - ((SwXTextDocument*)this)->pxXTextFieldMasters = new Reference< XNameAccess > ; + static_cast<SwXTextDocument*>(this)->pxXTextFieldMasters = new Reference< XNameAccess > ; *pxXTextFieldMasters = new SwXTextFieldMasters(pDocShell->GetDoc()); } return *pxXTextFieldMasters; @@ -1265,7 +1265,7 @@ Reference< XNameAccess > SwXTextDocument::getEmbeddedObjects(void) throw( Runti throw RuntimeException(); if(!pxXEmbeddedObjects) { - ((SwXTextDocument*)this)->pxXEmbeddedObjects = new Reference< XNameAccess > ; + static_cast<SwXTextDocument*>(this)->pxXEmbeddedObjects = new Reference< XNameAccess > ; *pxXEmbeddedObjects = new SwXTextEmbeddedObjects(pDocShell->GetDoc()); } return *pxXEmbeddedObjects; @@ -1278,7 +1278,7 @@ Reference< XNameAccess > SwXTextDocument::getBookmarks(void) throw( RuntimeExce throw RuntimeException(); if(!pxXBookmarks) { - ((SwXTextDocument*)this)->pxXBookmarks = new Reference< XNameAccess > ; + static_cast<SwXTextDocument*>(this)->pxXBookmarks = new Reference< XNameAccess > ; *pxXBookmarks = new SwXBookmarks(pDocShell->GetDoc()); } return *pxXBookmarks; @@ -1291,7 +1291,7 @@ Reference< XNameAccess > SwXTextDocument::getTextSections(void) throw( RuntimeE throw RuntimeException(); if(!pxXTextSections) { - ((SwXTextDocument*)this)->pxXTextSections = new Reference< XNameAccess > ; + static_cast<SwXTextDocument*>(this)->pxXTextSections = new Reference< XNameAccess > ; *pxXTextSections = new SwXTextSections(pDocShell->GetDoc()); } return *pxXTextSections; @@ -1304,7 +1304,7 @@ Reference< XNameAccess > SwXTextDocument::getTextTables(void) throw( RuntimeExc throw RuntimeException(); if(!pxXTextTables) { - ((SwXTextDocument*)this)->pxXTextTables = new Reference< XNameAccess > ; + static_cast<SwXTextDocument*>(this)->pxXTextTables = new Reference< XNameAccess > ; *pxXTextTables = new SwXTextTables(pDocShell->GetDoc()); } return *pxXTextTables; @@ -1317,7 +1317,7 @@ Reference< XNameAccess > SwXTextDocument::getGraphicObjects(void) throw( Runtim throw RuntimeException(); if(!pxXGraphicObjects) { - ((SwXTextDocument*)this)->pxXGraphicObjects = new Reference< XNameAccess > ; + static_cast<SwXTextDocument*>(this)->pxXGraphicObjects = new Reference< XNameAccess > ; *pxXGraphicObjects = new SwXTextGraphicObjects(pDocShell->GetDoc()); } return *pxXGraphicObjects; @@ -1330,7 +1330,7 @@ Reference< XNameAccess > SwXTextDocument::getTextFrames(void) throw( RuntimeExc throw RuntimeException(); if(!pxXTextFrames) { - ((SwXTextDocument*)this)->pxXTextFrames = new Reference< XNameAccess > ; + static_cast<SwXTextDocument*>(this)->pxXTextFrames = new Reference< XNameAccess > ; *pxXTextFrames = new SwXTextFrames(pDocShell->GetDoc()); } return *pxXTextFrames; @@ -1343,7 +1343,7 @@ Reference< XNameAccess > SwXTextDocument::getStyleFamilies(void) throw( Runtime throw RuntimeException(); if(!pxXStyleFamilies) { - ((SwXTextDocument*)this)->pxXStyleFamilies = new Reference< XNameAccess > ; + static_cast<SwXTextDocument*>(this)->pxXStyleFamilies = new Reference< XNameAccess > ; *pxXStyleFamilies = new SwXStyleFamilies(*pDocShell); } return *pxXStyleFamilies; @@ -1371,8 +1371,8 @@ Reference< drawing::XDrawPage > SwXTextDocument::getDrawPage(void) throw( Runti throw RuntimeException(); if(!pxXDrawPage) { - ((SwXTextDocument*)this)->pDrawPage = new SwXDrawPage(pDocShell->GetDoc()); - ((SwXTextDocument*)this)->pxXDrawPage = new Reference< drawing::XDrawPage >(pDrawPage); + static_cast<SwXTextDocument*>(this)->pDrawPage = new SwXDrawPage(pDocShell->GetDoc()); + static_cast<SwXTextDocument*>(this)->pxXDrawPage = new Reference< drawing::XDrawPage >(pDrawPage); // Create a Reference to trigger the complete initialization of the // object. Otherwise in some corner cases it would get initialized // at ::InitNewDoc -> which would get called during @@ -1428,7 +1428,7 @@ void SwXTextDocument::InitNewDoc() if(pxXTextTables) { XNameAccess* pTbls = pxXTextTables->get(); - ((SwXTextTables*)pTbls)->Invalidate(); + static_cast<SwXTextTables*>(pTbls)->Invalidate(); delete pxXTextTables; pxXTextTables = 0; } @@ -1436,7 +1436,7 @@ void SwXTextDocument::InitNewDoc() if(pxXTextFrames) { XNameAccess* pFrms = pxXTextFrames->get(); - ((SwXTextFrames*)pFrms)->Invalidate(); + static_cast<SwXTextFrames*>(pFrms)->Invalidate(); delete pxXTextFrames; pxXTextFrames = 0; } @@ -1444,7 +1444,7 @@ void SwXTextDocument::InitNewDoc() if(pxXGraphicObjects) { XNameAccess* pFrms = pxXGraphicObjects->get(); - ((SwXTextGraphicObjects*)pFrms)->Invalidate(); + static_cast<SwXTextGraphicObjects*>(pFrms)->Invalidate(); delete pxXGraphicObjects; pxXGraphicObjects = 0; } @@ -1452,7 +1452,7 @@ void SwXTextDocument::InitNewDoc() if(pxXEmbeddedObjects) { XNameAccess* pOLE = pxXEmbeddedObjects->get(); - ((SwXTextEmbeddedObjects*)pOLE)->Invalidate(); + static_cast<SwXTextEmbeddedObjects*>(pOLE)->Invalidate(); delete pxXEmbeddedObjects; pxXEmbeddedObjects = 0; } @@ -1483,7 +1483,7 @@ void SwXTextDocument::InitNewDoc() if(pxXTextFieldTypes) { XEnumerationAccess* pT = pxXTextFieldTypes->get(); - ((SwXTextFieldTypes*)pT)->Invalidate(); + static_cast<SwXTextFieldTypes*>(pT)->Invalidate(); delete pxXTextFieldTypes; pxXTextFieldTypes = 0; } @@ -1491,7 +1491,7 @@ void SwXTextDocument::InitNewDoc() if(pxXTextFieldMasters) { XNameAccess* pT = pxXTextFieldMasters->get(); - ((SwXTextFieldMasters*)pT)->Invalidate(); + static_cast<SwXTextFieldMasters*>(pT)->Invalidate(); delete pxXTextFieldMasters; pxXTextFieldMasters = 0; } @@ -1499,7 +1499,7 @@ void SwXTextDocument::InitNewDoc() if(pxXTextSections) { XNameAccess* pSect = pxXTextSections->get(); - ((SwXTextSections*)pSect)->Invalidate(); + static_cast<SwXTextSections*>(pSect)->Invalidate(); delete pxXTextSections; pxXTextSections = 0; } @@ -1518,7 +1518,7 @@ void SwXTextDocument::InitNewDoc() if ( pxXNumberingRules ) { XIndexAccess* pNum = pxXNumberingRules->get(); - ((SwXNumberingRulesCollection*)pNum)->Invalidate(); + static_cast<SwXNumberingRulesCollection*>(pNum)->Invalidate(); delete pxXNumberingRules; pxXNumberingRules = 0; } @@ -1526,7 +1526,7 @@ void SwXTextDocument::InitNewDoc() if(pxXFootnotes) { XIndexAccess* pFtn = pxXFootnotes->get(); - ((SwXFootnotes*)pFtn)->Invalidate(); + static_cast<SwXFootnotes*>(pFtn)->Invalidate(); delete pxXFootnotes; pxXFootnotes = 0; } @@ -1534,7 +1534,7 @@ void SwXTextDocument::InitNewDoc() if(pxXEndnotes) { XIndexAccess* pFtn = pxXEndnotes->get(); - ((SwXFootnotes*)pFtn)->Invalidate(); + static_cast<SwXFootnotes*>(pFtn)->Invalidate(); delete pxXEndnotes; pxXEndnotes = 0; } @@ -1542,7 +1542,7 @@ void SwXTextDocument::InitNewDoc() if(pxXDocumentIndexes) { XIndexAccess* pIdxs = pxXDocumentIndexes->get(); - ((SwXDocumentIndexes*)pIdxs)->Invalidate(); + static_cast<SwXDocumentIndexes*>(pIdxs)->Invalidate(); delete pxXDocumentIndexes; pxXDocumentIndexes = 0; } @@ -1550,14 +1550,14 @@ void SwXTextDocument::InitNewDoc() if(pxXStyleFamilies) { XNameAccess* pStyles = pxXStyleFamilies->get(); - ((SwXStyleFamilies*)pStyles)->Invalidate(); + static_cast<SwXStyleFamilies*>(pStyles)->Invalidate(); delete pxXStyleFamilies; pxXStyleFamilies = 0; } if(pxXAutoStyles) { XNameAccess* pStyles = pxXAutoStyles->get(); - ((SwXAutoStyles*)pStyles)->Invalidate(); + static_cast<SwXAutoStyles*>(pStyles)->Invalidate(); delete pxXAutoStyles; pxXAutoStyles = 0; } @@ -1565,7 +1565,7 @@ void SwXTextDocument::InitNewDoc() if(pxXBookmarks) { XNameAccess* pBm = pxXBookmarks->get(); - ((SwXBookmarks*)pBm)->Invalidate(); + static_cast<SwXBookmarks*>(pBm)->Invalidate(); delete pxXBookmarks; pxXBookmarks = 0; } @@ -1573,7 +1573,7 @@ void SwXTextDocument::InitNewDoc() if(pxXChapterNumbering) { XIndexReplace* pCh = pxXChapterNumbering->get(); - ((SwXChapterNumbering*)pCh)->Invalidate(); + static_cast<SwXChapterNumbering*>(pCh)->Invalidate(); delete pxXChapterNumbering; pxXChapterNumbering = 0; } @@ -1581,7 +1581,7 @@ void SwXTextDocument::InitNewDoc() if(pxXFootnoteSettings) { XPropertySet* pFntSet = pxXFootnoteSettings->get(); - ((SwXFootnoteProperties*)pFntSet)->Invalidate(); + static_cast<SwXFootnoteProperties*>(pFntSet)->Invalidate(); delete pxXFootnoteSettings; pxXFootnoteSettings = 0; } @@ -1589,7 +1589,7 @@ void SwXTextDocument::InitNewDoc() if(pxXEndnoteSettings) { XPropertySet* pEndSet = pxXEndnoteSettings->get(); - ((SwXEndnoteProperties*)pEndSet)->Invalidate(); + static_cast<SwXEndnoteProperties*>(pEndSet)->Invalidate(); delete pxXEndnoteSettings; pxXEndnoteSettings = 0; } @@ -1597,28 +1597,28 @@ void SwXTextDocument::InitNewDoc() if(pxXLineNumberingProperties) { XPropertySet* pLine = pxXLineNumberingProperties->get(); - ((SwXLineNumberingProperties*)pLine)->Invalidate(); + static_cast<SwXLineNumberingProperties*>(pLine)->Invalidate(); delete pxXLineNumberingProperties; pxXLineNumberingProperties = 0; } if(pxXReferenceMarks) { XNameAccess* pMarks = pxXReferenceMarks->get(); - ((SwXReferenceMarks*)pMarks)->Invalidate(); + static_cast<SwXReferenceMarks*>(pMarks)->Invalidate(); delete pxXReferenceMarks; pxXReferenceMarks = 0; } if(pxLinkTargetSupplier) { XNameAccess* pAccess = (*pxLinkTargetSupplier).get(); - ((SwXLinkTargetSupplier*)pAccess)->Invalidate(); + static_cast<SwXLinkTargetSupplier*>(pAccess)->Invalidate(); delete pxLinkTargetSupplier; pxLinkTargetSupplier = 0; } if(pxXRedlines) { XEnumerationAccess* pMarks = pxXRedlines->get(); - ((SwXRedlines*)pMarks)->Invalidate(); + static_cast<SwXRedlines*>(pMarks)->Invalidate(); delete pxXRedlines; pxXRedlines = 0; } @@ -1805,7 +1805,7 @@ Reference< XIndexAccess > SwXTextDocument::getDocumentIndexes(void) throw( Runt throw RuntimeException(); if(!pxXDocumentIndexes) { - ((SwXTextDocument*)this)->pxXDocumentIndexes = new Reference< XIndexAccess > ; + static_cast<SwXTextDocument*>(this)->pxXDocumentIndexes = new Reference< XIndexAccess > ; *pxXDocumentIndexes = new SwXDocumentIndexes(pDocShell->GetDoc()); } return *pxXDocumentIndexes; @@ -2442,7 +2442,7 @@ SwDoc * SwXTextDocument::GetRenderDoc( } if (xDocSh.Is()) { - pDoc = ((SwDocShell*)&xDocSh)->GetDoc(); + pDoc = static_cast<SwDocShell*>(&xDocSh)->GetDoc(); rpView = pDoc->GetDocShell()->GetView(); } } @@ -2540,10 +2540,10 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount( //create a hidden view to be able to export as PDF also in print preview //pView and pSwView are not changed intentionally! m_pHiddenViewFrame = SfxViewFrame::LoadHiddenDocument( *pRenderDocShell, 2 ); - pViewShell = ((SwView*)m_pHiddenViewFrame->GetViewShell())->GetWrtShellPtr(); + pViewShell = static_cast<SwView*>(m_pHiddenViewFrame->GetViewShell())->GetWrtShellPtr(); } else - pViewShell = ((SwPagePreview*)pView)->GetViewShell(); + pViewShell = static_cast<SwPagePreview*>(pView)->GetViewShell(); } if (!pViewShell || !pViewShell->GetLayout()) @@ -2705,7 +2705,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwXTextDocument::getRenderer( if ( pSwView ) pVwSh = pSwView->GetWrtShellPtr(); else - pVwSh = ((SwPagePreview*)pView)->GetViewShell(); + pVwSh = static_cast<SwPagePreview*>(pView)->GetViewShell(); sal_Int32 nMaxRenderer = 0; if (!bIsSwSrcView && m_pRenderData) @@ -2994,7 +2994,7 @@ void SAL_CALL SwXTextDocument::render( if ( pSwView ) pVwSh = pSwView->GetWrtShellPtr(); else - pVwSh = ((SwPagePreview*)pView)->GetViewShell(); + pVwSh = static_cast<SwPagePreview*>(pView)->GetViewShell(); } // get output device to use @@ -3021,7 +3021,7 @@ void SAL_CALL SwXTextDocument::render( // the pdf file are collected, which are evaulated during painting. SwWrtShell* pWrtShell = pView->IsA(aSwViewTypeId) ? - ((SwView*)pView)->GetWrtShellPtr() : + static_cast<SwView*>(pView)->GetWrtShellPtr() : 0; SwPrintData const& rSwPrtOptions = diff --git a/sw/source/uibase/uno/unotxvw.cxx b/sw/source/uibase/uno/unotxvw.cxx index 8d3124660032..e4fe0327d031 100644 --- a/sw/source/uibase/uno/unotxvw.cxx +++ b/sw/source/uibase/uno/unotxvw.cxx @@ -114,7 +114,7 @@ void SwXTextView::Invalidate() if(pxTextViewCursor) { text::XTextViewCursor* pCrsr = pxTextViewCursor->get(); - ((SwXTextViewCursor*)pCrsr)->Invalidate(); + static_cast<SwXTextViewCursor*>(pCrsr)->Invalidate(); DELETEZ(pxTextViewCursor); } @@ -502,7 +502,7 @@ uno::Reference< text::XTextViewCursor > SwXTextView::getViewCursor(void) throw( { if(!pxTextViewCursor) { - ((SwXTextView*)this)->pxTextViewCursor = new uno::Reference< text::XTextViewCursor > ; + static_cast<SwXTextView*>(this)->pxTextViewCursor = new uno::Reference< text::XTextViewCursor > ; *pxTextViewCursor = new SwXTextViewCursor(GetView()); } return *pxTextViewCursor; @@ -518,7 +518,7 @@ uno::Reference< beans::XPropertySet > SwXTextView::getViewSettings(void) throw( { if(!pxViewSettings) { - ((SwXTextView*)this)->pxViewSettings = new uno::Reference< beans::XPropertySet > ; + static_cast<SwXTextView*>(this)->pxViewSettings = new uno::Reference< beans::XPropertySet > ; *pxViewSettings = static_cast < HelperBaseNoState * > ( new SwXViewSettings( false, m_pView ) ); } } diff --git a/sw/source/uibase/utlui/bookctrl.cxx b/sw/source/uibase/utlui/bookctrl.cxx index 70a913fdb7a5..d3ef629cf1d1 100644 --- a/sw/source/uibase/utlui/bookctrl.cxx +++ b/sw/source/uibase/utlui/bookctrl.cxx @@ -78,12 +78,12 @@ void SwBookmarkControl::StateChanged( GetStatusBar().SetItemText( GetId(), OUString() ); else if ( pState->ISA( SfxStringItem ) ) { - sPageNumber = ((SfxStringItem*)pState)->GetValue(); + sPageNumber = static_cast<const SfxStringItem*>(pState)->GetValue(); GetStatusBar().SetItemText( GetId(), sPageNumber ); } else if ( pState->ISA( SfxBoolItem ) ) { - if (((SfxBoolItem*)pState)->GetValue()) // Indicates whether to show extended tooltip + if (static_cast<const SfxBoolItem*>(pState)->GetValue()) // Indicates whether to show extended tooltip GetStatusBar().SetQuickHelpText(GetId(), SW_RESSTR(STR_BOOKCTRL_HINT_EXTENDED)); else GetStatusBar().SetQuickHelpText(GetId(), SW_RESSTR(STR_BOOKCTRL_HINT)); diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx index 5730f82c9ca4..1176dd372f51 100644 --- a/sw/source/uibase/utlui/glbltree.cxx +++ b/sw/source/uibase/utlui/glbltree.cxx @@ -431,10 +431,10 @@ sal_uInt16 SwGlobalTree::GetEnableFlags() const if(nSelCount == 1) { nRet |= ENABLE_EDIT; - if (pEntry && ((SwGlblDocContent*)pEntry->GetUserData())->GetType() != GLBLDOC_UNKNOWN && - (!pPrevEntry || ((SwGlblDocContent*)pPrevEntry->GetUserData())->GetType() != GLBLDOC_UNKNOWN)) + if (pEntry && static_cast<SwGlblDocContent*>(pEntry->GetUserData())->GetType() != GLBLDOC_UNKNOWN && + (!pPrevEntry || static_cast<SwGlblDocContent*>(pPrevEntry->GetUserData())->GetType() != GLBLDOC_UNKNOWN)) nRet |= ENABLE_INSERT_TEXT; - if (pEntry && GLBLDOC_SECTION == ((SwGlblDocContent*)pEntry->GetUserData())->GetType()) + if (pEntry && GLBLDOC_SECTION == static_cast<SwGlblDocContent*>(pEntry->GetUserData())->GetType()) nRet |= ENABLE_EDIT_LINK; } else if(!nEntryCount) @@ -792,7 +792,7 @@ void SwGlobalTree::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry if(GLBLDOC_SECTION == pContent->GetType() && pContent->GetSection()->IsConnected()) { - ((SwSection*)pContent->GetSection())->UpdateNow(); + const_cast<SwSection*>(pContent->GetSection())->UpdateNow(); } pSelEntry = NextSelected(pSelEntry); diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index 005e20425bd3..29093856cf28 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -423,7 +423,7 @@ void SwNavHelpToolBox::MouseButtonDown(const MouseEvent &rEvt) if(rEvt.GetButtons() == MOUSE_LEFT && FN_CREATE_NAVIGATION == GetItemId(rEvt.GetPosPixel())) { - ((SwNavigationPI*)GetParent())->CreateNavigationTool(GetItemRect(FN_CREATE_NAVIGATION), false, this); + static_cast<SwNavigationPI*>(GetParent())->CreateNavigationTool(GetItemRect(FN_CREATE_NAVIGATION), false, this); } else SwHelpToolBox::MouseButtonDown(rEvt); @@ -547,8 +547,8 @@ void SwNavigationPI::_ZoomOut() bIsZoomedIn = false; Size aSz(GetOutputSizePixel()); aSz.Height() = nZoomOut; - Size aMinOutSizePixel = ((SfxDockingWindow*)GetParent())->GetMinOutputSizePixel(); - ((SfxDockingWindow*)GetParent())->SetMinOutputSizePixel(Size( + Size aMinOutSizePixel = static_cast<SfxDockingWindow*>(GetParent())->GetMinOutputSizePixel(); + static_cast<SfxDockingWindow*>(GetParent())->SetMinOutputSizePixel(Size( aMinOutSizePixel.Width(),nZoomOutInit)); if (pFloat != NULL) pFloat->SetOutputSizePixel(aSz); @@ -587,8 +587,8 @@ void SwNavigationPI::_ZoomIn() nZoomOut = ( short ) aSz.Height(); aSz.Height() = nZoomIn; - Size aMinOutSizePixel = ((SfxDockingWindow*)GetParent())->GetMinOutputSizePixel(); - ((SfxDockingWindow*)GetParent())->SetMinOutputSizePixel(Size( + Size aMinOutSizePixel = static_cast<SfxDockingWindow*>(GetParent())->GetMinOutputSizePixel(); + static_cast<SfxDockingWindow*>(GetParent())->SetMinOutputSizePixel(Size( aMinOutSizePixel.Width(), aSz.Height())); pFloat->SetOutputSizePixel(aSz); SvTreeListEntry* pFirst = aContentTree.FirstSelected(); @@ -999,7 +999,7 @@ void SwNavigationPI::Notify( SfxBroadcaster& rBrdc, const SfxHint& rHint ) { if(&rBrdc == pCreateView) { - if(dynamic_cast<const SfxSimpleHint*>(&rHint) && ((SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING) + if(dynamic_cast<const SfxSimpleHint*>(&rHint) && static_cast<const SfxSimpleHint&>(rHint).GetId() == SFX_HINT_DYING) { pCreateView = 0; } @@ -1009,11 +1009,11 @@ void SwNavigationPI::Notify( SfxBroadcaster& rBrdc, const SfxHint& rHint ) if(dynamic_cast<const SfxEventHint*>(&rHint)) { if( pxObjectShell && - ((SfxEventHint&) rHint).GetEventId() == SFX_EVENT_CLOSEAPP) + static_cast<const SfxEventHint&>( rHint).GetEventId() == SFX_EVENT_CLOSEAPP) { DELETEZ(pxObjectShell); } - else if(((SfxEventHint&) rHint).GetEventId() == SFX_EVENT_OPENDOC) + else if(static_cast<const SfxEventHint&>( rHint).GetEventId() == SFX_EVENT_OPENDOC) { SwView *pActView = GetCreateView(); @@ -1310,8 +1310,8 @@ SwView* SwNavigationPI::GetCreateView() const { if(&pView->GetViewFrame()->GetBindings() == &rBindings) { - ((SwNavigationPI*)this)->pCreateView = pView; - ((SwNavigationPI*)this)->StartListening(*pCreateView); + const_cast<SwNavigationPI*>(this)->pCreateView = pView; + const_cast<SwNavigationPI*>(this)->StartListening(*pCreateView); break; } pView = SwModule::GetNextView(pView); diff --git a/sw/source/uibase/utlui/tmplctrl.cxx b/sw/source/uibase/utlui/tmplctrl.cxx index 1046b05294c6..ab06c0dbd3c8 100644 --- a/sw/source/uibase/utlui/tmplctrl.cxx +++ b/sw/source/uibase/utlui/tmplctrl.cxx @@ -78,7 +78,7 @@ void SwTemplateControl::StateChanged( GetStatusBar().SetItemText( GetId(), OUString() ); else if ( pState->ISA( SfxStringItem ) ) { - sTemplate = ((SfxStringItem*)pState)->GetValue(); + sTemplate = static_cast<const SfxStringItem*>(pState)->GetValue(); GetStatusBar().SetItemText( GetId(), sTemplate ); } } diff --git a/sw/source/uibase/utlui/uiitems.cxx b/sw/source/uibase/utlui/uiitems.cxx index 0f7fa70cb088..cdede9c7f270 100644 --- a/sw/source/uibase/utlui/uiitems.cxx +++ b/sw/source/uibase/utlui/uiitems.cxx @@ -56,7 +56,7 @@ SfxPoolItem* SwPageFtnInfoItem::Clone( SfxItemPool * /*pPool*/ ) const bool SwPageFtnInfoItem::operator==( const SfxPoolItem& rAttr ) const { OSL_ENSURE( Which() == rAttr.Which(), "no equal attributes" ); - return ( aFtnInfo == ((SwPageFtnInfoItem&)rAttr).GetPageFtnInfo()); + return ( aFtnInfo == static_cast<const SwPageFtnInfoItem&>(rAttr).GetPageFtnInfo()); } bool SwPageFtnInfoItem::GetPresentation @@ -245,7 +245,7 @@ SfxPoolItem* SwUINumRuleItem::Clone( SfxItemPool * /*pPool*/ ) const bool SwUINumRuleItem::operator==( const SfxPoolItem& rAttr ) const { assert(SfxPoolItem::operator==(rAttr)); - return *pRule == *((SwUINumRuleItem&)rAttr).pRule; + return *pRule == *static_cast<const SwUINumRuleItem&>(rAttr).pRule; } bool SwUINumRuleItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const diff --git a/sw/source/uibase/utlui/wordcountctrl.cxx b/sw/source/uibase/utlui/wordcountctrl.cxx index 58fe4b40db37..1ca297ba67fa 100644 --- a/sw/source/uibase/utlui/wordcountctrl.cxx +++ b/sw/source/uibase/utlui/wordcountctrl.cxx @@ -30,7 +30,7 @@ void SwWordCountStatusBarControl::StateChanged( sal_uInt16 /*nSID*/, SfxItemState eState, const SfxPoolItem* pState ) { if (eState == SfxItemState::DEFAULT) // Can access pState - GetStatusBar().SetItemText( GetId(), ((SfxStringItem*)pState)->GetValue() ); + GetStatusBar().SetItemText( GetId(), static_cast<const SfxStringItem*>(pState)->GetValue() ); GetStatusBar().SetQuickHelpText(GetId(), SW_RESSTR(STR_WORDCOUNT_HINT)); } diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx index d49ce125de7e..8841f0cb333c 100644 --- a/sw/source/uibase/wrtsh/wrtsh1.cxx +++ b/sw/source/uibase/wrtsh/wrtsh1.cxx @@ -579,12 +579,12 @@ void SwWrtShell::LaunchOLEObj( long nVerb ) if ( !pCli ) pCli = new SwOleClient( &GetView(), &GetView().GetEditWin(), xRef ); - ((SwOleClient*)pCli)->SetInDoVerb( true ); + static_cast<SwOleClient*>(pCli)->SetInDoVerb( true ); CalcAndSetScale( xRef ); pCli->DoVerb( nVerb ); - ((SwOleClient*)pCli)->SetInDoVerb( false ); + static_cast<SwOleClient*>(pCli)->SetInDoVerb( false ); CalcAndSetScale( xRef ); } } @@ -1351,7 +1351,7 @@ SelectionType SwWrtShell::GetSelectionType() const if ( BasicActionPend() ) return IsSelFrmMode() ? nsSelectionType::SEL_FRM : nsSelectionType::SEL_TXT; - SwView &_rView = ((SwView&)GetView()); + SwView &_rView = const_cast<SwView&>(GetView()); if (_rView.GetPostItMgr() && _rView.GetPostItMgr()->HasActiveSidebarWin() ) return nsSelectionType::SEL_POSTIT; diff --git a/sw/source/uibase/wrtsh/wrtsh2.cxx b/sw/source/uibase/wrtsh/wrtsh2.cxx index 786ce997ad29..98f68300fa60 100644 --- a/sw/source/uibase/wrtsh/wrtsh2.cxx +++ b/sw/source/uibase/wrtsh/wrtsh2.cxx @@ -357,8 +357,8 @@ void SwWrtShell::ClickToField( const SwField& rFld ) if( sRet != sText ) { StartAllAction(); - ((SwField&)rFld).SetPar2( sRet ); - ((SwField&)rFld).GetTyp()->UpdateFlds(); + const_cast<SwField&>(rFld).SetPar2( sRet ); + const_cast<SwField&>(rFld).GetTyp()->UpdateFlds(); EndAllAction(); } } @@ -366,9 +366,9 @@ void SwWrtShell::ClickToField( const SwField& rFld ) case RES_GETREFFLD: StartAllAction(); - SwCrsrShell::GotoRefMark( ((SwGetRefField&)rFld).GetSetRefName(), - ((SwGetRefField&)rFld).GetSubType(), - ((SwGetRefField&)rFld).GetSeqNo() ); + SwCrsrShell::GotoRefMark( static_cast<const SwGetRefField&>(rFld).GetSetRefName(), + static_cast<const SwGetRefField&>(rFld).GetSubType(), + static_cast<const SwGetRefField&>(rFld).GetSeqNo() ); EndAllAction(); break; @@ -383,7 +383,7 @@ void SwWrtShell::ClickToField( const SwField& rFld ) break; case RES_SETEXPFLD: - if( ((SwSetExpField&)rFld).GetInputFlag() ) + if( static_cast<const SwSetExpField&>(rFld).GetInputFlag() ) StartInputFldDlg( (SwField*)&rFld, false ); break; case RES_DROPDOWN : |