[Libreoffice-commits] core.git: 2 commits - starmath/inc starmath/source sw/source
Noel Grandin
noel at peralex.com
Wed Dec 3 00:45:18 PST 2014
starmath/inc/caret.hxx | 2 -
starmath/inc/cursor.hxx | 2 -
starmath/inc/view.hxx | 5 +--
starmath/source/ElementsDockingWindow.cxx | 2 -
starmath/source/config.cxx | 16 +++++-----
starmath/source/cursor.cxx | 40 +++++++++++++-------------
starmath/source/dialog.cxx | 18 +++++------
starmath/source/document.cxx | 8 ++---
starmath/source/edit.cxx | 4 +-
starmath/source/mathmlimport.cxx | 6 +--
starmath/source/mathtype.cxx | 10 +++---
starmath/source/node.cxx | 10 +++---
starmath/source/ooxmlexport.cxx | 2 -
starmath/source/parse.cxx | 2 -
starmath/source/rtfexport.cxx | 2 -
starmath/source/smmod.cxx | 2 -
starmath/source/tmpdevice.cxx | 2 -
starmath/source/toolbox.cxx | 2 -
starmath/source/view.cxx | 20 ++++++-------
starmath/source/visitors.cxx | 4 +-
sw/source/ui/dbui/createaddresslistdialog.cxx | 4 +-
sw/source/ui/dbui/mmaddressblockpage.cxx | 20 ++++++-------
sw/source/ui/dbui/selectdbtabledialog.cxx | 2 -
sw/source/ui/misc/glosbib.cxx | 8 ++---
sw/source/ui/misc/pgfnote.cxx | 18 +++++------
25 files changed, 106 insertions(+), 105 deletions(-)
New commits:
commit 0e2927ed2cffdc718085cadce3cc41e34cd6a04f
Author: Noel Grandin <noel at peralex.com>
Date: Wed Dec 3 10:43:11 2014 +0200
loplugin: cstylecast
Change-Id: Ic48a59c209e77382a0e431a5502c24a62407334b
diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx
index b398105..b331a8e 100644
--- a/sw/source/ui/dbui/createaddresslistdialog.cxx
+++ b/sw/source/ui/dbui/createaddresslistdialog.cxx
@@ -179,7 +179,7 @@ void SwAddressControl_Impl::SetData(SwCSVData& rDBData)
FixedText* pNewFT = new FixedText(m_pWindow, WB_RIGHT);
Edit* pNewED = new Edit(m_pWindow, WB_BORDER);
//set nLines a position identifier - used in the ModifyHdl
- pNewED->SetData((void*)nLines);
+ pNewED->SetData(reinterpret_cast<void*>(nLines));
pNewED->SetGetFocusHdl(aFocusLink);
pNewED->SetModifyHdl(aEditModifyLink);
@@ -299,7 +299,7 @@ void SwAddressControl_Impl::MakeVisible(const Rectangle & rRect)
IMPL_LINK(SwAddressControl_Impl, EditModifyHdl_Impl, Edit*, pEdit)
{
//get the data element number of the current set
- sal_Int32 nIndex = (sal_Int32)(sal_IntPtr)pEdit->GetData();
+ sal_Int32 nIndex = (sal_Int32)reinterpret_cast<sal_IntPtr>(pEdit->GetData());
//get the index of the set
OSL_ENSURE(m_pData->aDBData.size() > m_nCurrentDataSet, "wrong data set index" );
if(m_pData->aDBData.size() > m_nCurrentDataSet)
diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx
index 675b1e8..f0868a7 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.cxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.cxx
@@ -483,11 +483,11 @@ SwCustomizeAddressBlockDialog::SwCustomizeAddressBlockDialog(
m_pFieldFT->Show();
m_pFieldCB->Show();
SvTreeListEntry* pEntry = m_pAddressElementsLB->InsertEntry(SW_RESSTR(ST_SALUTATION));
- pEntry->SetUserData((void*)(sal_Int32)USER_DATA_SALUTATION );
+ pEntry->SetUserData(reinterpret_cast<void*>((sal_Int32)USER_DATA_SALUTATION) );
pEntry = m_pAddressElementsLB->InsertEntry(SW_RESSTR(ST_PUNCTUATION));
- pEntry->SetUserData((void*)(sal_Int32)USER_DATA_PUNCTUATION );
+ pEntry->SetUserData(reinterpret_cast<void*>((sal_Int32)USER_DATA_PUNCTUATION) );
pEntry = m_pAddressElementsLB->InsertEntry(SW_RESSTR(ST_TEXT));
- pEntry->SetUserData((void*)(sal_Int32)USER_DATA_TEXT );
+ pEntry->SetUserData(reinterpret_cast<void*>((sal_Int32)USER_DATA_TEXT) );
ResStringArray aSalutArr(SW_RES(RA_SALUTATION));
for(sal_uInt32 i = 0; i < aSalutArr.Count(); ++i)
m_aSalutations.push_back(aSalutArr.GetString(i));
@@ -512,7 +512,7 @@ SwCustomizeAddressBlockDialog::SwCustomizeAddressBlockDialog(
for(sal_uInt32 i = 0; i < rHeaders.Count(); ++i)
{
SvTreeListEntry* pEntry = m_pAddressElementsLB->InsertEntry(rHeaders.GetString( i ));
- pEntry->SetUserData((void*)(sal_IntPtr)i);
+ pEntry->SetUserData(reinterpret_cast<void*>((sal_IntPtr)i));
}
m_pOK->SetClickHdl(LINK(this, SwCustomizeAddressBlockDialog, OKHdl_Impl));
m_pAddressElementsLB->SetSelectHdl(LINK(this, SwCustomizeAddressBlockDialog, ListBoxSelectHdl_Impl ));
@@ -543,7 +543,7 @@ IMPL_LINK_NOARG(SwCustomizeAddressBlockDialog, OKHdl_Impl)
IMPL_LINK(SwCustomizeAddressBlockDialog, ListBoxSelectHdl_Impl, DDListBox*, pBox)
{
- sal_Int32 nUserData = (sal_Int32)(sal_IntPtr)pBox->FirstSelected()->GetUserData();
+ sal_Int32 nUserData = (sal_Int32)reinterpret_cast<sal_IntPtr>(pBox->FirstSelected()->GetUserData());
// Check if the selected entry is already in the address and then forbid inserting
m_pInsertFieldIB->Enable(nUserData >= 0 || !HasItem_Impl(nUserData));
return 0;
@@ -596,7 +596,7 @@ sal_Int32 SwCustomizeAddressBlockDialog::GetSelectedItem_Impl()
const OUString sEntry = m_pAddressElementsLB->GetEntryText(pEntry);
if( sEntry == sSelected.copy( 1, sSelected.getLength() - 2 ) )
{
- nRet = (sal_Int32)(sal_IntPtr)pEntry->GetUserData();
+ nRet = (sal_Int32)reinterpret_cast<sal_IntPtr>(pEntry->GetUserData());
break;
}
}
@@ -610,7 +610,7 @@ bool SwCustomizeAddressBlockDialog::HasItem_Impl(sal_Int32 nUserData)
for(sal_uLong i = 0; i < m_pAddressElementsLB->GetEntryCount(); ++i)
{
SvTreeListEntry* pEntry = m_pAddressElementsLB->GetEntry(i);
- if((sal_Int32)(sal_IntPtr)pEntry->GetUserData() == nUserData)
+ if((sal_Int32)reinterpret_cast<sal_IntPtr>(pEntry->GetUserData()) == nUserData)
{
sEntry = m_pAddressElementsLB->GetEntryText(pEntry);
break;
@@ -705,7 +705,7 @@ void SwCustomizeAddressBlockDialog::UpdateImageButtons_Impl()
m_pRemoveFieldIB->Enable(m_pDragED->HasCurrentItem());
SvTreeListEntry* pEntry = m_pAddressElementsLB->GetCurEntry();
m_pInsertFieldIB->Enable( pEntry &&
- (0 < (sal_Int32)(sal_IntPtr)pEntry->GetUserData() || !m_pFieldCB->GetText().isEmpty()));
+ (0 < (sal_Int32)reinterpret_cast<sal_IntPtr>(pEntry->GetUserData()) || !m_pFieldCB->GetText().isEmpty()));
}
void SwCustomizeAddressBlockDialog::SetAddress(const OUString& rAddress)
@@ -725,7 +725,7 @@ OUString SwCustomizeAddressBlockDialog::GetAddress()
{
SvTreeListEntry* pEntry = m_pAddressElementsLB->GetEntry(i);
const OUString sEntry = "<" + m_pAddressElementsLB->GetEntryText(pEntry) + ">";
- sal_Int32 nUserData = (sal_Int32)(sal_IntPtr)pEntry->GetUserData();
+ sal_Int32 nUserData = (sal_Int32)reinterpret_cast<sal_IntPtr>(pEntry->GetUserData());
switch(nUserData)
{
case USER_DATA_SALUTATION:
@@ -1227,7 +1227,7 @@ void DDListBox::StartDrag( sal_Int8 /*nAction*/, const Point& /*rPosPixel*/ )
uno::Reference<
datatransfer::XTransferable > xRef( pContainer );
- sal_Int32 nUserData = (sal_Int32)(sal_IntPtr)pEntry->GetUserData();
+ sal_Int32 nUserData = (sal_Int32)reinterpret_cast<sal_IntPtr>(pEntry->GetUserData());
//special entries can only be once in the address / greeting
if(nUserData >= 0 || !m_pParentDialog->HasItem_Impl(nUserData))
{
diff --git a/sw/source/ui/dbui/selectdbtabledialog.cxx b/sw/source/ui/dbui/selectdbtabledialog.cxx
index 949368c..9978bd2 100644
--- a/sw/source/ui/dbui/selectdbtabledialog.cxx
+++ b/sw/source/ui/dbui/selectdbtabledialog.cxx
@@ -140,7 +140,7 @@ SwSelectDBTableDialog::SwSelectDBTableDialog(vcl::Window* pParent,
sEntry += "\t";
sEntry += m_sQuery;
SvTreeListEntry* pEntry = m_pTable->InsertEntry(sEntry);
- pEntry->SetUserData((void*)1);
+ pEntry->SetUserData(reinterpret_cast<void*>(1));
}
}
}
diff --git a/sw/source/ui/misc/glosbib.cxx b/sw/source/ui/misc/glosbib.cxx
index 9aab2ff..6f93bc1 100644
--- a/sw/source/ui/misc/glosbib.cxx
+++ b/sw/source/ui/misc/glosbib.cxx
@@ -87,7 +87,7 @@ SwGlossaryGroupDlg::SwGlossaryGroupDlg(vcl::Window * pParent,
nCaseReadonly |= PATH_READONLY;
else if( SWUnoHelper::UCB_IsCaseSensitiveFileName( aTempFile.GetURL()))
nCaseReadonly |= PATH_CASE_SENSITIVE;
- m_pPathLB->SetEntryData(i, (void*)nCaseReadonly);
+ m_pPathLB->SetEntryData(i, reinterpret_cast<void*>(nCaseReadonly));
}
m_pPathLB->SelectEntryPos(0);
m_pPathLB->Enable(true);
@@ -318,7 +318,7 @@ IMPL_LINK_NOARG(SwGlossaryGroupDlg, ModifyHdl)
bool bEnableNew = true;
bool bEnableDel = false;
sal_uLong nCaseReadonly =
- (sal_uLong)m_pPathLB->GetEntryData(m_pPathLB->GetSelectEntryPos());
+ reinterpret_cast<sal_uLong>(m_pPathLB->GetEntryData(m_pPathLB->GetSelectEntryPos()));
bool bDirReadonly = 0 != (nCaseReadonly&PATH_READONLY);
if(sEntry.isEmpty() || bDirReadonly)
@@ -333,8 +333,8 @@ IMPL_LINK_NOARG(SwGlossaryGroupDlg, ModifyHdl)
for(sal_uLong i = 0; i < m_pGroupTLB->GetEntryCount(); i++)
{
OUString sTemp = m_pGroupTLB->GetEntryText( i, 0 );
- nCaseReadonly = (sal_uLong)m_pPathLB->GetEntryData(
- m_pPathLB->GetEntryPos(m_pGroupTLB->GetEntryText(i,1)));
+ nCaseReadonly = reinterpret_cast<sal_uLong>(m_pPathLB->GetEntryData(
+ m_pPathLB->GetEntryPos(m_pGroupTLB->GetEntryText(i,1))));
bool bCase = 0 != (nCaseReadonly & PATH_CASE_SENSITIVE);
if( !bCase && rSCmp.isEqual( sTemp, sEntry ))
diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx
index bf3632e..cd0d81b 100644
--- a/sw/source/ui/misc/pgfnote.cxx
+++ b/sw/source/ui/misc/pgfnote.cxx
@@ -150,7 +150,7 @@ void SwFootNotePage::Reset(const SfxItemSet *rSet)
const SfxPoolItem* pItem = SfxTabPage::GetItem(*rSet, FN_PARAM_FTN_INFO);
if( pItem )
{
- pFtnInfo = &((const SwPageFtnInfoItem*)pItem)->GetPageFtnInfo();
+ pFtnInfo = &static_cast<const SwPageFtnInfoItem*>(pItem)->GetPageFtnInfo();
}
else
{
@@ -212,7 +212,7 @@ void SwFootNotePage::Reset(const SfxItemSet *rSet)
{
const SfxPoolItem* pColorItem = pDocSh->GetItem( SID_COLOR_TABLE );
if ( pColorItem != NULL )
- pColorList = ( (SvxColorListItem*)pColorItem )->GetColorList();
+ pColorList = static_cast<const SvxColorListItem*>(pColorItem)->GetColorList();
}
OSL_ENSURE( pColorList.is(), "ColorTable not found!" );
@@ -257,7 +257,7 @@ void SwFootNotePage::Reset(const SfxItemSet *rSet)
// stuff attributes into the set, when OK
bool SwFootNotePage::FillItemSet(SfxItemSet *rSet)
{
- SwPageFtnInfoItem aItem((const SwPageFtnInfoItem&)GetItemSet().Get(FN_PARAM_FTN_INFO));
+ SwPageFtnInfoItem aItem(static_cast<const SwPageFtnInfoItem&>(GetItemSet().Get(FN_PARAM_FTN_INFO)));
// that's the original
SwPageFtnInfo &rFtnInfo = aItem.GetPageFtnInfo();
@@ -304,7 +304,7 @@ bool SwFootNotePage::FillItemSet(SfxItemSet *rSet)
void SwFootNotePage::ActivatePage(const SfxItemSet& rSet)
{
- const SvxSizeItem& rSize = (const SvxSizeItem&)rSet.Get( RES_FRM_SIZE );
+ const SvxSizeItem& rSize = static_cast<const SvxSizeItem&>(rSet.Get( RES_FRM_SIZE ));
lMaxHeight = rSize.GetSize().Height();
const SfxPoolItem* pItem;
@@ -312,12 +312,12 @@ void SwFootNotePage::ActivatePage(const SfxItemSet& rSet)
{
const SfxItemSet& rHeaderSet = static_cast<const SvxSetItem*>(pItem)->GetItemSet();
const SfxBoolItem& rHeaderOn =
- (const SfxBoolItem&)rHeaderSet.Get( rSet.GetPool()->GetWhich( SID_ATTR_PAGE_ON ) );
+ static_cast<const SfxBoolItem&>(rHeaderSet.Get( rSet.GetPool()->GetWhich( SID_ATTR_PAGE_ON ) ));
if ( rHeaderOn.GetValue() )
{
const SvxSizeItem& rSizeItem =
- (const SvxSizeItem&)rHeaderSet.Get(rSet.GetPool()->GetWhich(SID_ATTR_PAGE_SIZE));
+ static_cast<const SvxSizeItem&>(rHeaderSet.Get(rSet.GetPool()->GetWhich(SID_ATTR_PAGE_SIZE)));
lMaxHeight -= rSizeItem.GetSize().Height();
}
}
@@ -327,19 +327,19 @@ void SwFootNotePage::ActivatePage(const SfxItemSet& rSet)
{
const SfxItemSet& rFooterSet = static_cast<const SvxSetItem*>(pItem)->GetItemSet();
const SfxBoolItem& rFooterOn =
- (const SfxBoolItem&)rFooterSet.Get( SID_ATTR_PAGE_ON );
+ static_cast<const SfxBoolItem&>(rFooterSet.Get( SID_ATTR_PAGE_ON ));
if ( rFooterOn.GetValue() )
{
const SvxSizeItem& rSizeItem =
- (const SvxSizeItem&)rFooterSet.Get( rSet.GetPool()->GetWhich( SID_ATTR_PAGE_SIZE ) );
+ static_cast<const SvxSizeItem&>(rFooterSet.Get( rSet.GetPool()->GetWhich( SID_ATTR_PAGE_SIZE ) ));
lMaxHeight -= rSizeItem.GetSize().Height();
}
}
if ( rSet.GetItemState( RES_UL_SPACE , false ) == SfxItemState::SET )
{
- const SvxULSpaceItem &rUL = (const SvxULSpaceItem&)rSet.Get( RES_UL_SPACE );
+ const SvxULSpaceItem &rUL = static_cast<const SvxULSpaceItem&>(rSet.Get( RES_UL_SPACE ));
lMaxHeight -= rUL.GetUpper() + rUL.GetLower();
}
commit 0b30d5344cad60967aa79bad86916debbf4371e9
Author: Noel Grandin <noel at peralex.com>
Date: Wed Dec 3 10:43:00 2014 +0200
loplugin: cstylecast
Change-Id: I759f55218538c8d39018626f14e78cd56341d44b
diff --git a/starmath/inc/caret.hxx b/starmath/inc/caret.hxx
index 411781f..d35ca20 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 3e9c70a..6a523cf 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 e35cb24..fa09ba3 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 e229828..3aaac1e 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 e8643fd..8b47ce5 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 60c0ed9..daf16dd 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 03d26cc..55be81e 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 4b460ae..ca641e8 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 681789b..ebdc37e 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 9d28455..cfdf492 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 bd2812d..21800ce 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 bb2006a..e7c01e3 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 7110c81..9cccd74 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 4898cf8..711f206 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 0167c19..5c38a4e 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 7373ae6..8f0ef42 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 934bff4..b6232bd 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 7b64e3c..48be0fd 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 12e67f9..c5448d0 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 5105079..e929837 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( );
More information about the Libreoffice-commits
mailing list