summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-12-03 10:43:00 +0200
committerNoel Grandin <noel@peralex.com>2014-12-03 10:43:53 +0200
commit0b30d5344cad60967aa79bad86916debbf4371e9 (patch)
tree1ddd7b583532b55e155f761aa5e97f818492ad6d /starmath
parent57fe57677887dd951000d3317690f8c628a58e02 (diff)
loplugin: cstylecast
Change-Id: I759f55218538c8d39018626f14e78cd56341d44b
Diffstat (limited to 'starmath')
-rw-r--r--starmath/inc/caret.hxx2
-rw-r--r--starmath/inc/cursor.hxx2
-rw-r--r--starmath/inc/view.hxx5
-rw-r--r--starmath/source/ElementsDockingWindow.cxx2
-rw-r--r--starmath/source/config.cxx16
-rw-r--r--starmath/source/cursor.cxx40
-rw-r--r--starmath/source/dialog.cxx18
-rw-r--r--starmath/source/document.cxx8
-rw-r--r--starmath/source/edit.cxx4
-rw-r--r--starmath/source/mathmlimport.cxx6
-rw-r--r--starmath/source/mathtype.cxx10
-rw-r--r--starmath/source/node.cxx10
-rw-r--r--starmath/source/ooxmlexport.cxx2
-rw-r--r--starmath/source/parse.cxx2
-rw-r--r--starmath/source/rtfexport.cxx2
-rw-r--r--starmath/source/smmod.cxx2
-rw-r--r--starmath/source/tmpdevice.cxx2
-rw-r--r--starmath/source/toolbox.cxx2
-rw-r--r--starmath/source/view.cxx20
-rw-r--r--starmath/source/visitors.cxx4
20 files changed, 80 insertions, 79 deletions
diff --git a/starmath/inc/caret.hxx b/starmath/inc/caret.hxx
index 411781ffafb7..d35ca20d9de7 100644
--- a/starmath/inc/caret.hxx
+++ b/starmath/inc/caret.hxx
@@ -45,7 +45,7 @@ struct SmCaretPos{
*/
static SmCaretPos GetPosAfter(SmNode* pNode) {
if(pNode && pNode->GetType() == NTEXT)
- return SmCaretPos(pNode, ((SmTextNode*)pNode)->GetText().getLength());
+ return SmCaretPos(pNode, static_cast<SmTextNode*>(pNode)->GetText().getLength());
return SmCaretPos(pNode, 1);
}
};
diff --git a/starmath/inc/cursor.hxx b/starmath/inc/cursor.hxx
index 3e9c70a2800f..6a523cfd7405 100644
--- a/starmath/inc/cursor.hxx
+++ b/starmath/inc/cursor.hxx
@@ -279,7 +279,7 @@ private:
rpNode = NULL;
//Create line from node
if(pNode && IsLineCompositionNode(pNode))
- return LineToList((SmStructureNode*)pNode, pList);
+ return LineToList(static_cast<SmStructureNode*>(pNode), pList);
if(pNode)
pList->push_front(pNode);
return pList;
diff --git a/starmath/inc/view.hxx b/starmath/inc/view.hxx
index e35cb244b485..fa09ba35b791 100644
--- a/starmath/inc/view.hxx
+++ b/starmath/inc/view.hxx
@@ -32,6 +32,7 @@
#include <sfx2/viewfrm.hxx>
#include <vcl/timer.hxx>
#include <svtools/colorcfg.hxx>
+#include "document.hxx"
#include "edit.hxx"
#include "node.hxx"
@@ -213,7 +214,7 @@ public:
SmEditWindow& GetEditWindow()
{
- return (((SmCmdBoxWindow *)pWindow)->GetEditWindow());
+ return static_cast<SmCmdBoxWindow *>(pWindow)->GetEditWindow();
}
};
@@ -286,7 +287,7 @@ public:
SmDocShell * GetDoc()
{
- return (SmDocShell *) GetViewFrame()->GetObjectShell();
+ return static_cast<SmDocShell *>( GetViewFrame()->GetObjectShell() );
}
SmEditWindow * GetEditWindow();
diff --git a/starmath/source/ElementsDockingWindow.cxx b/starmath/source/ElementsDockingWindow.cxx
index e22982817dbf..3aaac1e4f9c7 100644
--- a/starmath/source/ElementsDockingWindow.cxx
+++ b/starmath/source/ElementsDockingWindow.cxx
@@ -745,7 +745,7 @@ SmElementsDockingWindowWrapper::SmElementsDockingWindowWrapper(
SfxChildWindow(pParentWindow, nId)
{
pWindow = new SmElementsDockingWindow(pBindings, this, pParentWindow);
- SmElementsDockingWindow* pDialog = (SmElementsDockingWindow*) pWindow;
+ SmElementsDockingWindow* pDialog = static_cast<SmElementsDockingWindow*>(pWindow);
pDialog->SetPosSizePixel(Point(0, 0), Size(300, 0));
pDialog->Show();
diff --git a/starmath/source/config.cxx b/starmath/source/config.cxx
index e8643fdd5999..8b47ce51444a 100644
--- a/starmath/source/config.cxx
+++ b/starmath/source/config.cxx
@@ -53,31 +53,31 @@ void SmConfig::ItemSetToConfig(const SfxItemSet &rSet)
sal_uInt16 nU16;
bool bVal;
if (rSet.GetItemState(SID_PRINTSIZE, true, &pItem) == SfxItemState::SET)
- { nU16 = ((const SfxUInt16Item *) pItem)->GetValue();
+ { nU16 = static_cast<const SfxUInt16Item *>(pItem)->GetValue();
SetPrintSize( (SmPrintSize) nU16 );
}
if (rSet.GetItemState(SID_PRINTZOOM, true, &pItem) == SfxItemState::SET)
- { nU16 = ((const SfxUInt16Item *) pItem)->GetValue();
+ { nU16 = static_cast<const SfxUInt16Item *>(pItem)->GetValue();
SetPrintZoomFactor( nU16 );
}
if (rSet.GetItemState(SID_PRINTTITLE, true, &pItem) == SfxItemState::SET)
- { bVal = ((const SfxBoolItem *) pItem)->GetValue();
+ { bVal = static_cast<const SfxBoolItem *>(pItem)->GetValue();
SetPrintTitle( bVal );
}
if (rSet.GetItemState(SID_PRINTTEXT, true, &pItem) == SfxItemState::SET)
- { bVal = ((const SfxBoolItem *) pItem)->GetValue();
+ { bVal = static_cast<const SfxBoolItem *>(pItem)->GetValue();
SetPrintFormulaText( bVal );
}
if (rSet.GetItemState(SID_PRINTFRAME, true, &pItem) == SfxItemState::SET)
- { bVal = ((const SfxBoolItem *) pItem)->GetValue();
+ { bVal = static_cast<const SfxBoolItem *>(pItem)->GetValue();
SetPrintFrame( bVal );
}
if (rSet.GetItemState(SID_AUTOREDRAW, true, &pItem) == SfxItemState::SET)
- { bVal = ((const SfxBoolItem *) pItem)->GetValue();
+ { bVal = static_cast<const SfxBoolItem *>(pItem)->GetValue();
SetAutoRedraw( bVal );
}
if (rSet.GetItemState(SID_NO_RIGHT_SPACES, true, &pItem) == SfxItemState::SET)
- { bVal = ((const SfxBoolItem *) pItem)->GetValue();
+ { bVal = static_cast<const SfxBoolItem *>(pItem)->GetValue();
if (IsIgnoreSpacesRight() != bVal)
{
SetIgnoreSpacesRight( bVal );
@@ -87,7 +87,7 @@ void SmConfig::ItemSetToConfig(const SfxItemSet &rSet)
}
}
if (rSet.GetItemState(SID_SAVE_ONLY_USED_SYMBOLS, true, &pItem) == SfxItemState::SET)
- { bVal = ((const SfxBoolItem *) pItem)->GetValue();
+ { bVal = static_cast<const SfxBoolItem *>(pItem)->GetValue();
SetSaveOnlyUsedSymbols( bVal );
}
diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx
index 60c0ed97337e..daf16dd454e0 100644
--- a/starmath/source/cursor.cxx
+++ b/starmath/source/cursor.cxx
@@ -324,7 +324,7 @@ void SmCursor::InsertNodes(SmNodeList* pNewNodes){
if(newIt == pNewNodes->begin())
patchIt = insIt;
if((*newIt)->GetType() == NTEXT)
- PosAfterInsert = SmCaretPos(*newIt, ((SmTextNode*)*newIt)->GetText().getLength());
+ PosAfterInsert = SmCaretPos(*newIt, static_cast<SmTextNode*>(*newIt)->GetText().getLength());
else
PosAfterInsert = SmCaretPos(*newIt, 1);
}
@@ -347,7 +347,7 @@ SmNodeList::iterator SmCursor::FindPositionInLineList(SmNodeList* pLineList, SmC
if((*it)->GetType() == NTEXT){
//Split textnode if needed
if(aCaretPos.Index > 0){
- SmTextNode* pText = (SmTextNode*)aCaretPos.pSelectedNode;
+ SmTextNode* pText = static_cast<SmTextNode*>(aCaretPos.pSelectedNode);
OUString str1 = pText->GetText().copy(0, aCaretPos.Index);
OUString str2 = pText->GetText().copy(aCaretPos.Index);
pText->ChangeText(str1);
@@ -389,8 +389,8 @@ SmCaretPos SmCursor::PatchLineList(SmNodeList* pLineList, SmNodeList::iterator a
next->GetType() == NTEXT &&
( prev->GetToken().eType != TNUMBER ||
next->GetToken().eType == TNUMBER) ){
- SmTextNode *pText = (SmTextNode*)prev,
- *pOldN = (SmTextNode*)next;
+ SmTextNode *pText = static_cast<SmTextNode*>(prev),
+ *pOldN = static_cast<SmTextNode*>(next);
SmCaretPos retval(pText, pText->GetText().getLength());
OUString newText;
newText += pText->GetText();
@@ -412,14 +412,14 @@ SmCaretPos SmCursor::PatchLineList(SmNodeList* pLineList, SmNodeList::iterator a
if(aIter == pLineList->begin())
return SmCaretPos();
if((*aIter)->GetType() == NTEXT)
- return SmCaretPos(*aIter, ((SmTextNode*)*aIter)->GetText().getLength());
+ return SmCaretPos(*aIter, static_cast<SmTextNode*>(*aIter)->GetText().getLength());
return SmCaretPos(*aIter, 1);
}
if(prev && next && next->GetType() == NPLACE && !SmNodeListParser::IsOperator(prev->GetToken())){
aIter = pLineList->erase(aIter);
delete next;
if(prev->GetType() == NTEXT)
- return SmCaretPos(prev, ((SmTextNode*)prev)->GetText().getLength());
+ return SmCaretPos(prev, static_cast<SmTextNode*>(prev)->GetText().getLength());
return SmCaretPos(prev, 1);
}
@@ -427,7 +427,7 @@ SmCaretPos SmCursor::PatchLineList(SmNodeList* pLineList, SmNodeList::iterator a
if(!prev) //return an invalid to indicate we're in front of line
return SmCaretPos();
if(prev->GetType() == NTEXT)
- return SmCaretPos(prev, ((SmTextNode*)prev)->GetText().getLength());
+ return SmCaretPos(prev, static_cast<SmTextNode*>(prev)->GetText().getLength());
return SmCaretPos(prev, 1);
}
@@ -439,7 +439,7 @@ SmNodeList::iterator SmCursor::TakeSelectedNodesFromList(SmNodeList *pLineList,
if((*it)->IsSelected()){
//Split text nodes
if((*it)->GetType() == NTEXT) {
- SmTextNode* pText = (SmTextNode*)*it;
+ SmTextNode* pText = static_cast<SmTextNode*>(*it);
OUString aText = pText->GetText();
//Start and lengths of the segments, 2 is the selected segment
int start2 = pText->GetSelectionStart(),
@@ -549,7 +549,7 @@ void SmCursor::InsertSubSup(SmSubSup eSubSup) {
*(--it) = pSubSup;
++it;
}else
- pSubSup = (SmSubSupNode*)pSubject;
+ pSubSup = static_cast<SmSubSupNode*>(pSubject);
//pSubject shouldn't be referenced anymore, pSubSup is the SmSubSupNode in pLineList we wish to edit.
//and it pointer to the element following pSubSup in pLineList.
pSubject = NULL;
@@ -597,12 +597,12 @@ bool SmCursor::InsertLimit(SmSubSup eSubSup, bool bMoveCaret) {
SmOperNode *pSubject = NULL;
//Check if pSelectedNode might be a subject
if(position->CaretPos.pSelectedNode->GetType() == NOPER)
- pSubject = (SmOperNode*)position->CaretPos.pSelectedNode;
+ pSubject = static_cast<SmOperNode*>(position->CaretPos.pSelectedNode);
else {
//If not, check if parent of the current line is a SmOperNode
SmNode *pLineNode = FindTopMostNodeInLine(position->CaretPos.pSelectedNode, false);
if(pLineNode->GetParent() && pLineNode->GetParent()->GetType() == NOPER)
- pSubject = (SmOperNode*)pLineNode->GetParent();
+ pSubject = static_cast<SmOperNode*>(pLineNode->GetParent());
}
//Abort operation if we're not in the appropriate context
@@ -615,7 +615,7 @@ bool SmCursor::InsertLimit(SmSubSup eSubSup, bool bMoveCaret) {
SmSubSupNode *pSubSup = NULL;
//Check if there's already one there...
if(pSubject->GetSubNode(0)->GetType() == NSUBSUP)
- pSubSup = (SmSubSupNode*)pSubject->GetSubNode(0);
+ pSubSup = static_cast<SmSubSupNode*>(pSubject->GetSubNode(0));
else { //if not create a new SmSubSupNode
SmToken token;
token.nGroup = TGLIMIT;
@@ -820,18 +820,18 @@ bool SmCursor::InsertRow() {
SmMatrixNode *pMatrix = NULL;
int nTableIndex = nParentIndex;
if(pLineParent->GetType() == NTABLE)
- pTable = (SmTableNode*)pLineParent;
+ pTable = static_cast<SmTableNode*>(pLineParent);
//If it's warped in a SmLineNode, we can still insert a newline
else if(pLineParent->GetType() == NLINE &&
pLineParent->GetParent() &&
pLineParent->GetParent()->GetType() == NTABLE) {
//NOTE: This hack might give problems if we stop ignoring SmAlignNode
- pTable = (SmTableNode*)pLineParent->GetParent();
+ pTable = static_cast<SmTableNode*>(pLineParent->GetParent());
nTableIndex = pTable->IndexOfSubNode(pLineParent);
OSL_ENSURE(nTableIndex != -1, "pLineParent must be a child of its parent!");
}
if(pLineParent->GetType() == NMATRIX)
- pMatrix = (SmMatrixNode*)pLineParent;
+ pMatrix = static_cast<SmMatrixNode*>(pLineParent);
//If we're not in a context that supports InsertRow, return sal_False
if(!pTable && !pMatrix)
@@ -1184,12 +1184,12 @@ void SmCursor::Copy(){
//Clone selected nodes
SmNodeList* pList;
if(IsLineCompositionNode(pLine))
- pList = CloneLineToList((SmStructureNode*)pLine, true);
+ pList = CloneLineToList(static_cast<SmStructureNode*>(pLine), true);
else{
pList = new SmNodeList();
//Special care to only clone selected text
if(pLine->GetType() == NTEXT) {
- SmTextNode *pText = (SmTextNode*)pLine;
+ SmTextNode *pText = static_cast<SmTextNode*>(pLine);
SmTextNode *pClone = new SmTextNode( pText->GetToken(), pText->GetFontDesc() );
int start = pText->GetSelectionStart(),
length = pText->GetSelectionEnd() - pText->GetSelectionStart();
@@ -1287,7 +1287,7 @@ SmNodeList* SmCursor::LineToList(SmStructureNode* pLine, SmNodeList* list){
case NBINHOR:
case NALIGN:
case NFONT:
- LineToList((SmStructureNode*)it.Current(), list);
+ LineToList(static_cast<SmStructureNode*>(it.Current()), list);
break;
case NERROR:
delete it.Current();
@@ -1307,11 +1307,11 @@ SmNodeList* SmCursor::CloneLineToList(SmStructureNode* pLine, bool bOnlyIfSelect
SmNodeIterator it(pLine);
while(it.Next()){
if( IsLineCompositionNode( it.Current() ) )
- CloneLineToList( (SmStructureNode*)it.Current(), bOnlyIfSelected, pList );
+ CloneLineToList( static_cast<SmStructureNode*>(it.Current()), bOnlyIfSelected, pList );
else if( (!bOnlyIfSelected || it->IsSelected()) && it->GetType() != NERROR ) {
//Only clone selected text from SmTextNode
if(it->GetType() == NTEXT) {
- SmTextNode *pText = (SmTextNode*)it.Current();
+ SmTextNode *pText = static_cast<SmTextNode*>(it.Current());
SmTextNode *pClone = new SmTextNode( it->GetToken(), pText->GetFontDesc() );
int start = pText->GetSelectionStart(),
length = pText->GetSelectionEnd() - pText->GetSelectionStart();
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index 03d26ccc9baa..55be81ef6938 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -202,7 +202,7 @@ bool SmPrintOptionsTabPage::FillItemSet(SfxItemSet* rSet)
void SmPrintOptionsTabPage::Reset(const SfxItemSet* rSet)
{
- SmPrintSize ePrintSize = (SmPrintSize)((const SfxUInt16Item &)rSet->Get(GetWhich(SID_PRINTSIZE))).GetValue();
+ SmPrintSize ePrintSize = (SmPrintSize)static_cast<const SfxUInt16Item &>(rSet->Get(GetWhich(SID_PRINTSIZE))).GetValue();
m_pSizeNormal->Check(ePrintSize == PRINT_SIZE_NORMAL);
m_pSizeScaled->Check(ePrintSize == PRINT_SIZE_SCALED);
@@ -210,13 +210,13 @@ void SmPrintOptionsTabPage::Reset(const SfxItemSet* rSet)
m_pZoom->Enable(m_pSizeZoomed->IsChecked());
- m_pZoom->SetValue(((const SfxUInt16Item &)rSet->Get(GetWhich(SID_PRINTZOOM))).GetValue());
+ m_pZoom->SetValue(static_cast<const SfxUInt16Item &>(rSet->Get(GetWhich(SID_PRINTZOOM))).GetValue());
- m_pTitle->Check(((const SfxBoolItem &)rSet->Get(GetWhich(SID_PRINTTITLE))).GetValue());
- m_pText->Check(((const SfxBoolItem &)rSet->Get(GetWhich(SID_PRINTTEXT))).GetValue());
- m_pFrame->Check(((const SfxBoolItem &)rSet->Get(GetWhich(SID_PRINTFRAME))).GetValue());
- m_pNoRightSpaces->Check(((const SfxBoolItem &)rSet->Get(GetWhich(SID_NO_RIGHT_SPACES))).GetValue());
- m_pSaveOnlyUsedSymbols->Check(((const SfxBoolItem &)rSet->Get(GetWhich(SID_SAVE_ONLY_USED_SYMBOLS))).GetValue());
+ m_pTitle->Check(static_cast<const SfxBoolItem &>(rSet->Get(GetWhich(SID_PRINTTITLE))).GetValue());
+ m_pText->Check(static_cast<const SfxBoolItem &>(rSet->Get(GetWhich(SID_PRINTTEXT))).GetValue());
+ m_pFrame->Check(static_cast<const SfxBoolItem &>(rSet->Get(GetWhich(SID_PRINTFRAME))).GetValue());
+ m_pNoRightSpaces->Check(static_cast<const SfxBoolItem &>(rSet->Get(GetWhich(SID_NO_RIGHT_SPACES))).GetValue());
+ m_pSaveOnlyUsedSymbols->Check(static_cast<const SfxBoolItem &>(rSet->Get(GetWhich(SID_SAVE_ONLY_USED_SYMBOLS))).GetValue());
}
@@ -788,8 +788,8 @@ void SmDistanceDialog::SetCategory(sal_uInt16 nCategory)
bool bActive;
for (sal_uInt16 i = 0; i < 4; i++)
{
- FixedText *pFT = (FixedText * const) aWin[i][0];
- MetricField *pMF = (MetricField * const) aWin[i][1];
+ FixedText *pFT = static_cast<FixedText *> ( aWin[i][0] );
+ MetricField *pMF = static_cast<MetricField *>( aWin[i][1] );
// To determine which Controls should be active, the existence
// of an associated HelpID is checked
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index 4b460aee957b..ca641e88159a 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -120,7 +120,7 @@ SFX_IMPL_OBJECTFACTORY(SmDocShell, SvGlobalName(SO3_SM_CLASSID), SFXOBJECTSHELL_
void SmDocShell::SFX_NOTIFY(SfxBroadcaster&, const TypeId&,
const SfxHint& rHint, const TypeId&)
{
- switch (((SfxSimpleHint&)rHint).GetId())
+ switch (static_cast<const SfxSimpleHint&>(rHint).GetId())
{
case HINT_FORMATCHANGED:
SetFormulaArranged(false);
@@ -432,7 +432,7 @@ void SmDocShell::DrawFormula(OutputDevice &rDev, Point &rPosition, bool bDrawSel
sal_uLong nOldDrawMode = DRAWMODE_DEFAULT;
bool bRestoreDrawMode = false;
if (OUTDEV_WINDOW == rDev.GetOutDevType() &&
- ((vcl::Window &) rDev).GetSettings().GetStyleSettings().GetHighContrastMode())
+ static_cast<vcl::Window &>(rDev).GetSettings().GetStyleSettings().GetHighContrastMode())
{
nOldDrawMode = rDev.GetDrawMode();
rDev.SetDrawMode( DRAWMODE_DEFAULT );
@@ -1093,7 +1093,7 @@ void SmDocShell::Execute(SfxRequest& rReq)
case SID_TEXT:
{
- const SfxStringItem& rItem = (const SfxStringItem&)rReq.GetArgs()->Get(SID_TEXT);
+ const SfxStringItem& rItem = static_cast<const SfxStringItem&>(rReq.GetArgs()->Get(SID_TEXT));
if (GetText() != OUString(rItem.GetValue()))
SetText(rItem.GetValue());
}
@@ -1109,7 +1109,7 @@ void SmDocShell::Execute(SfxRequest& rReq)
const SfxItemSet* pArgs = rReq.GetArgs();
const SfxPoolItem* pItem;
if( pArgs && SfxItemState::SET == pArgs->GetItemState( nId, false, &pItem ))
- nCnt = ((SfxUInt16Item*)pItem)->GetValue();
+ nCnt = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
bool (::svl::IUndoManager:: *fnDo)();
diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx
index 681789b896be..ebdc37e08488 100644
--- a/starmath/source/edit.cxx
+++ b/starmath/source/edit.cxx
@@ -350,7 +350,7 @@ void SmEditWindow::Command(const CommandEvent& rCEvt)
{
if ( pMenu )
{
- pPopupMenu.reset((PopupMenu*) pMenu);
+ pPopupMenu.reset(static_cast<PopupMenu*>(pMenu));
}
}
@@ -477,7 +477,7 @@ void SmEditWindow::KeyInput(const KeyEvent& rKEvt)
// set the focus to the view
SfxViewShell* pVShell = GetView();
if ( pVShell && pVShell->ISA(SmViewShell) &&
- ((SmViewShell*)pVShell)->GetGraphicWindow().HasFocus() )
+ static_cast<SmViewShell*>(pVShell)->GetGraphicWindow().HasFocus() )
{
GrabFocus();
}
diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx
index 9d284559ea39..cfdf492e3fa7 100644
--- a/starmath/source/mathmlimport.cxx
+++ b/starmath/source/mathmlimport.cxx
@@ -553,7 +553,7 @@ public:
SmXMLImport& GetSmImport()
{
- return (SmXMLImport&)GetImport();
+ return static_cast<SmXMLImport&>(GetImport());
}
virtual void TCharacters(const OUString & /*rChars*/);
@@ -2495,7 +2495,7 @@ void SmXMLTableContext_Impl::EndElement()
for (sal_uLong i=nRows;i > 0;i--)
{
auto pNode = rNodeStack.pop_front();
- pArray = (SmStructureNode *)pNode.release();
+ pArray = static_cast<SmStructureNode *>(pNode.release());
if (pArray->GetNumSubNodes() == 0)
{
//This is a little tricky, it is possible that there was
@@ -2523,7 +2523,7 @@ void SmXMLTableContext_Impl::EndElement()
while ( !aReverseStack.empty() )
{
auto pNode = aReverseStack.pop_front();
- pArray = (SmStructureNode *)pNode.release();
+ pArray = static_cast<SmStructureNode *>(pNode.release());
for (sal_uInt16 i=0;i<pArray->GetNumSubNodes();i++)
aExpressionArray[j++] = pArray->GetSubNode(i);
}
diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx
index bd2812d161b3..21800ce0e331 100644
--- a/starmath/source/mathtype.cxx
+++ b/starmath/source/mathtype.cxx
@@ -1988,7 +1988,7 @@ sal_uInt8 MathType::HandleNodes(SmNode *pNode,int nLevel)
break;
case NSPECIAL:
{
- SmTextNode *pText=(SmTextNode *)pNode;
+ SmTextNode *pText = static_cast<SmTextNode *>(pNode);
//if the token str and the result text are the same then this
//is to be seen as text, else assume it's a mathchar
if (pText->GetText() == pText->GetToken().aText)
@@ -2017,7 +2017,7 @@ sal_uInt8 MathType::HandleNodes(SmNode *pNode,int nLevel)
HandleTable(pNode,nLevel);
break;
case NMATRIX:
- HandleSmMatrix((SmMatrixNode *)pNode,nLevel);
+ HandleSmMatrix(static_cast<SmMatrixNode *>(pNode),nLevel);
break;
case NLINE:
{
@@ -3074,7 +3074,7 @@ void MathType::HandleMath(SmNode *pNode, int /*nLevel*/)
bIsReInterpBrace=true;
return;
}
- SmMathSymbolNode *pTemp=(SmMathSymbolNode *)pNode;
+ SmMathSymbolNode *pTemp = static_cast<SmMathSymbolNode *>(pNode);
for(sal_Int32 i=0;i<pTemp->GetText().getLength();i++)
{
sal_Unicode nArse = SmTextNode::ConvertSymbolToUnicode(pTemp->GetText()[i]);
@@ -3181,7 +3181,7 @@ void MathType::HandleAttributes(SmNode *pNode,int nLevel)
if (NULL != (pTemp = pNode->GetSubNode(0)))
{
- pIsText = (SmTextNode *)pNode->GetSubNode(1);
+ pIsText = static_cast<SmTextNode *>(pNode->GetSubNode(1));
switch (pTemp->GetToken().eType)
{
@@ -3298,7 +3298,7 @@ void MathType::HandleAttributes(SmNode *pNode,int nLevel)
void MathType::HandleText(SmNode *pNode, int /*nLevel*/)
{
- SmTextNode *pTemp=(SmTextNode *)pNode;
+ SmTextNode *pTemp = static_cast<SmTextNode *>(pNode);
for(sal_Int32 i=0;i<pTemp->GetText().getLength();i++)
{
if ((nPendingAttributes) &&
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index bb2006a6428a..e7c01e345048 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -671,11 +671,11 @@ void SmStructureNode::GetAccessibleText( OUStringBuffer &rText ) const
sal_uInt16 nNodes = GetNumSubNodes();
for (sal_uInt16 i = 0; i < nNodes; ++i)
{
- const SmNode *pNode = ((SmStructureNode *) this)->GetSubNode(i);
+ SmNode *pNode = const_cast<SmStructureNode *>(this)->GetSubNode(i);
if (pNode)
{
if (pNode->IsVisible())
- ((SmStructureNode *) pNode)->nAccIndex = rText.getLength();
+ static_cast<SmStructureNode *>(pNode)->nAccIndex = rText.getLength();
pNode->GetAccessibleText( rText );
}
}
@@ -1401,7 +1401,7 @@ void SmBinDiagonalNode::Arrange(const OutputDevice &rDev, const SmFormat &rForma
OSL_ENSURE(pRight, "Sm : NULL pointer");
OSL_ENSURE(GetSubNode(2)->GetType() == NPOLYLINE, "Sm : wrong node type");
- SmPolyLineNode *pOper = (SmPolyLineNode *) GetSubNode(2);
+ SmPolyLineNode *pOper = static_cast<SmPolyLineNode *>(GetSubNode(2));
OSL_ENSURE(pOper, "Sm : NULL pointer");
//! some routines being called extract some info from the OutputDevice's
@@ -1692,7 +1692,7 @@ void SmBraceNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat)
if (bScale)
{
nBraceHeight = pBody->GetType() == NBRACEBODY ?
- ((SmBracebodyNode *) pBody)->GetBodyHeight()
+ static_cast<SmBracebodyNode *>(pBody)->GetBodyHeight()
: pBody->GetHeight();
nBraceHeight += 2 * (nBraceHeight * nPerc / 100L);
}
@@ -1885,7 +1885,7 @@ SmNode * SmOperNode::GetSymbol()
OSL_ENSURE(pNode, "Sm: NULL pointer!");
if (pNode->GetType() == NSUBSUP)
- pNode = ((SmSubSupNode *) pNode)->GetBody();
+ pNode = static_cast<SmSubSupNode *>(pNode)->GetBody();
OSL_ENSURE(pNode, "Sm: NULL pointer!");
return pNode;
diff --git a/starmath/source/ooxmlexport.cxx b/starmath/source/ooxmlexport.cxx
index 7110c81a492c..9cccd7431a21 100644
--- a/starmath/source/ooxmlexport.cxx
+++ b/starmath/source/ooxmlexport.cxx
@@ -71,7 +71,7 @@ void SmOoxmlExport::HandleText( const SmNode* pNode, int /*nLevel*/)
m_pSerializer->endElementNS( XML_w, XML_rPr );
}
m_pSerializer->startElementNS( XML_m, XML_t, FSNS( XML_xml, XML_space ), "preserve", FSEND );
- SmTextNode* pTemp=(SmTextNode* )pNode;
+ const SmTextNode* pTemp = static_cast<const SmTextNode* >(pNode);
SAL_INFO( "starmath.ooxml", "Text:" << OUStringToOString( pTemp->GetText(), RTL_TEXTENCODING_UTF8 ).getStr());
for(sal_Int32 i=0;i<pTemp->GetText().getLength();i++)
{
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index 4898cf89da9d..711f206af813 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -1533,7 +1533,7 @@ void SmParser::Term(bool bGroupNumberIdent)
// check if casting in following line is ok
OSL_ENSURE(pTmp && !pTmp->IsVisible(), "Sm : Ooops...");
- aArray[n] = (SmStructureNode *) pTmp;
+ aArray[n] = static_cast<SmStructureNode *>(pTmp);
n++;
}
diff --git a/starmath/source/rtfexport.cxx b/starmath/source/rtfexport.cxx
index 0167c199c0d0..5c38a4eead8f 100644
--- a/starmath/source/rtfexport.cxx
+++ b/starmath/source/rtfexport.cxx
@@ -55,7 +55,7 @@ void SmRtfExport::HandleText(const SmNode* pNode, int /*nLevel*/)
if (pNode->GetToken().eType == TTEXT) // literal text
m_pBuffer->append(LO_STRING_SVTOOLS_RTF_MNOR " ");
- SmTextNode* pTemp=(SmTextNode*)pNode;
+ const SmTextNode* pTemp = static_cast<const SmTextNode*>(pNode);
SAL_INFO("starmath.rtf", "Text: " << pTemp->GetText());
for (sal_Int32 i = 0; i < pTemp->GetText().getLength(); i++)
{
diff --git a/starmath/source/smmod.cxx b/starmath/source/smmod.cxx
index 7373ae6089d5..8f0ef42657a0 100644
--- a/starmath/source/smmod.cxx
+++ b/starmath/source/smmod.cxx
@@ -208,7 +208,7 @@ void SmModule::ApplyColorConfigValues( const svtools::ColorConfig &rColorCfg )
{
if ((pViewShell->IsA(aSmViewTypeId)))
{
- SmViewShell *pSmView = (SmViewShell *) pViewShell;
+ SmViewShell *pSmView = static_cast<SmViewShell *>(pViewShell);
pSmView->GetGraphicWindow().ApplyColorConfigValues( rColorCfg );
SmEditWindow *pEditWin = pSmView->GetEditWindow();
if (pEditWin)
diff --git a/starmath/source/tmpdevice.cxx b/starmath/source/tmpdevice.cxx
index 934bff4030f1..b6232bd3a013 100644
--- a/starmath/source/tmpdevice.cxx
+++ b/starmath/source/tmpdevice.cxx
@@ -54,7 +54,7 @@ Color SmTmpDevice::Impl_GetColor( const Color& rColor )
{
Color aBgCol( rOutDev.GetBackground().GetColor() );
if (OUTDEV_WINDOW == rOutDev.GetOutDevType())
- aBgCol = ((vcl::Window &) rOutDev).GetDisplayBackground().GetColor();
+ aBgCol = static_cast<vcl::Window &>(rOutDev).GetDisplayBackground().GetColor();
nNewCol = SM_MOD()->GetColorConfig().GetColorValue(svtools::FONTCOLOR).nColor;
diff --git a/starmath/source/toolbox.cxx b/starmath/source/toolbox.cxx
index 7b64e3c09516..48be0fd72177 100644
--- a/starmath/source/toolbox.cxx
+++ b/starmath/source/toolbox.cxx
@@ -352,7 +352,7 @@ SmToolBoxWrapper::SmToolBoxWrapper(vcl::Window *pParentWindow,
eChildAlignment = SFX_ALIGN_NOALIGNMENT;
pWindow = new SmToolBoxWindow(pBindings, this, pParentWindow);
- ((SfxFloatingWindow *)pWindow)->Initialize(pInfo);
+ static_cast<SfxFloatingWindow *>(pWindow)->Initialize(pInfo);
}
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 12e67f9b25da..c5448d0e042e 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -896,7 +896,7 @@ SmCmdBoxWrapper::SmCmdBoxWrapper(vcl::Window *pParentWindow, sal_uInt16 nId,
// make window docked to the bottom initially (after first start)
eChildAlignment = SFX_ALIGN_BOTTOM;
- ((SfxDockingWindow *)pWindow)->Initialize(pInfo);
+ static_cast<SfxDockingWindow *>(pWindow)->Initialize(pInfo);
}
@@ -1369,8 +1369,8 @@ SfxTabPage* SmViewShell::CreatePrintOptionsPage(vcl::Window *pParent,
SmEditWindow *SmViewShell::GetEditWindow()
{
- SmCmdBoxWrapper *pWrapper = (SmCmdBoxWrapper *) GetViewFrame()->
- GetChildWindow( SmCmdBoxWrapper::GetChildWindowId() );
+ SmCmdBoxWrapper *pWrapper = static_cast<SmCmdBoxWrapper *>( GetViewFrame()->
+ GetChildWindow( SmCmdBoxWrapper::GetChildWindowId() ) );
if (pWrapper != NULL)
{
@@ -1510,7 +1510,7 @@ void SmViewShell::Execute(SfxRequest& rReq)
bool bVal;
if ( pArgs &&
SfxItemState::SET == pArgs->GetItemState( SID_FORMULACURSOR, false, &pItem))
- bVal = ((SfxBoolItem *) pItem)->GetValue();
+ bVal = static_cast<const SfxBoolItem *>(pItem)->GetValue();
else
bVal = !pp->GetConfig()->IsShowFormulaCursor();
@@ -1648,7 +1648,7 @@ void SmViewShell::Execute(SfxRequest& rReq)
case SID_INSERTCOMMAND:
{
const SfxInt16Item& rItem =
- (const SfxInt16Item&)rReq.GetArgs()->Get(SID_INSERTCOMMAND);
+ static_cast<const SfxInt16Item&>(rReq.GetArgs()->Get(SID_INSERTCOMMAND));
if (pWin && (bInsertIntoEditWindow || !IsInlineEditEnabled()))
pWin->InsertCommand(rItem.GetValue());
@@ -1661,7 +1661,7 @@ void SmViewShell::Execute(SfxRequest& rReq)
case SID_INSERTCOMMANDTEXT:
{
- const SfxStringItem& rItem = (const SfxStringItem&)rReq.GetArgs()->Get(SID_INSERTCOMMANDTEXT);
+ const SfxStringItem& rItem = static_cast<const SfxStringItem&>(rReq.GetArgs()->Get(SID_INSERTCOMMANDTEXT));
if (pWin && (bInsertIntoEditWindow || !IsInlineEditEnabled()))
{
@@ -1679,7 +1679,7 @@ void SmViewShell::Execute(SfxRequest& rReq)
case SID_INSERTSYMBOL:
{
const SfxStringItem& rItem =
- (const SfxStringItem&)rReq.GetArgs()->Get(SID_INSERTSYMBOL);
+ static_cast<const SfxStringItem&>(rReq.GetArgs()->Get(SID_INSERTSYMBOL));
if (pWin && (bInsertIntoEditWindow || !IsInlineEditEnabled()))
pWin->InsertText(rItem.GetValue());
@@ -1732,7 +1732,7 @@ void SmViewShell::Execute(SfxRequest& rReq)
if (rReq.GetArgs() != NULL)
{
const SfxStringItem& rItem =
- (const SfxStringItem&)rReq.GetArgs()->Get(SID_TEXTSTATUS);
+ static_cast<const SfxStringItem&>(rReq.GetArgs()->Get(SID_TEXTSTATUS));
SetStatusText(rItem.GetValue());
}
@@ -1767,7 +1767,7 @@ void SmViewShell::Execute(SfxRequest& rReq)
}
if ( pSet )
{
- const SvxZoomItem &rZoom = (const SvxZoomItem &)pSet->Get(SID_ATTR_ZOOM);
+ const SvxZoomItem &rZoom = static_cast<const SvxZoomItem &>(pSet->Get(SID_ATTR_ZOOM));
switch( rZoom.GetType() )
{
case SVX_ZOOM_PERCENT:
@@ -1808,7 +1808,7 @@ void SmViewShell::Execute(SfxRequest& rReq)
if ( pArgs && SfxItemState::SET == pArgs->GetItemState(SID_ATTR_ZOOMSLIDER, true, &pItem ) )
{
- const sal_uInt16 nCurrentZoom = ((const SvxZoomSliderItem *)pItem)->GetValue();
+ const sal_uInt16 nCurrentZoom = static_cast<const SvxZoomSliderItem *>(pItem)->GetValue();
aGraphic.SetZoom( nCurrentZoom );
}
}
diff --git a/starmath/source/visitors.cxx b/starmath/source/visitors.cxx
index 5105079790e8..e929837bf9ba 100644
--- a/starmath/source/visitors.cxx
+++ b/starmath/source/visitors.cxx
@@ -992,7 +992,7 @@ void SmCaretPosGraphBuildingVisitor::Visit( SmOperNode* pNode )
bodyRight->SetRight( right );
//Get subsup pNode if any
- SmSubSupNode* pSubSup = pOper->GetType( ) == NSUBSUP ? ( SmSubSupNode* )pOper : NULL;
+ SmSubSupNode* pSubSup = pOper->GetType( ) == NSUBSUP ? static_cast<SmSubSupNode*>(pOper) : NULL;
SmNode* pChild;
SmCaretPosGraphEntry *childLeft;
@@ -2029,7 +2029,7 @@ void SmNodeToTextVisitor::Visit( SmOperNode* pNode )
Append( pNode->GetSubNode( 0 )->GetToken( ).aText );
}
if( pNode->GetSubNode( 0 )->GetType( ) == NSUBSUP ) {
- SmSubSupNode *pSubSup = ( SmSubSupNode* )pNode->GetSubNode( 0 );
+ SmSubSupNode *pSubSup = static_cast<SmSubSupNode*>( pNode->GetSubNode( 0 ) );
SmNode* pChild;
if( ( pChild = pSubSup->GetSubSup( LSUP ) ) ) {
Separate( );