[Libreoffice-commits] core.git: starmath/source

Caolán McNamara caolanm at redhat.com
Mon Mar 2 03:21:43 PST 2015


 starmath/source/accessibility.cxx |    4 +---
 starmath/source/cfgitem.cxx       |   26 +++++++++++++-------------
 starmath/source/cfgitem.hxx       |    2 +-
 3 files changed, 15 insertions(+), 17 deletions(-)

New commits:
commit 142094e78b82b4b4417ed0ef6d6698a40ee5f96f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Mar 2 11:14:16 2015 +0000

    cppcheck: cstyleCast
    
    Change-Id: Iad1307f5362606bf911caed73aea2fd09bf7b004

diff --git a/starmath/source/accessibility.cxx b/starmath/source/accessibility.cxx
index ad4f611..1604cee 100644
--- a/starmath/source/accessibility.cxx
+++ b/starmath/source/accessibility.cxx
@@ -850,11 +850,9 @@ void SmEditSource::UpdateData()
 
 SfxBroadcaster & SmEditSource::GetBroadcaster() const
 {
-    return ((SmEditSource *) this)->aBroadCaster;
+    return const_cast<SmEditSource*>(this)->aBroadCaster;
 }
 
-
-
 SmViewForwarder::SmViewForwarder( SmEditAccessible &rAcc ) :
     rEditAcc(rAcc)
 {
diff --git a/starmath/source/cfgitem.cxx b/starmath/source/cfgitem.cxx
index 648f1b0..f2e9b81 100644
--- a/starmath/source/cfgitem.cxx
+++ b/starmath/source/cfgitem.cxx
@@ -387,7 +387,7 @@ void SmMathConfig::ReadSymbol( SmSym &rSymbol,
         rName += aTmp;
     }
 
-    const Sequence< Any > aValues = ((SmMathConfig*) this)->GetProperties( aNames );
+    const Sequence< Any > aValues = const_cast<SmMathConfig*>(this)->GetProperties(aNames);
 
     if (nProps  &&  aValues.getLength() == nProps)
     {
@@ -484,7 +484,7 @@ void SmMathConfig::Save()
 
 void SmMathConfig::GetSymbols( std::vector< SmSym > &rSymbols ) const
 {
-    Sequence< OUString > aNodes( ((SmMathConfig*) this)->GetNodeNames( SYMBOL_LIST ) );
+    Sequence< OUString > aNodes(const_cast<SmMathConfig*>(this)->GetNodeNames(SYMBOL_LIST));
     const OUString *pNode = aNodes.getConstArray();
     sal_Int32 nNodes = aNodes.getLength();
 
@@ -613,7 +613,7 @@ void SmMathConfig::ReadFontFormat( SmFontFormat &rFontFormat,
         rName += aTmp;
     }
 
-    const Sequence< Any > aValues = ((SmMathConfig*) this)->GetProperties( aNames );
+    const Sequence< Any > aValues = const_cast<SmMathConfig*>(this)->GetProperties(aNames);
 
     if (nProps  &&  aValues.getLength() == nProps)
     {
@@ -955,7 +955,7 @@ void SmMathConfig::SaveFormat()
 const SmFormat & SmMathConfig::GetStandardFormat() const
 {
     if (!pFormat)
-        ((SmMathConfig *) this)->LoadFormat();
+        const_cast<SmMathConfig*>(this)->LoadFormat();
     return *pFormat;
 }
 
@@ -983,7 +983,7 @@ void SmMathConfig::SetStandardFormat( const SmFormat &rFormat, bool bSaveFontFor
 SmPrintSize SmMathConfig::GetPrintSize() const
 {
     if (!pOther)
-        ((SmMathConfig *) this)->LoadOther();
+        const_cast<SmMathConfig*>(this)->LoadOther();
     return pOther->ePrintSize;
 }
 
@@ -1003,7 +1003,7 @@ void SmMathConfig::SetPrintSize( SmPrintSize eSize )
 sal_uInt16 SmMathConfig::GetPrintZoomFactor() const
 {
     if (!pOther)
-        ((SmMathConfig *) this)->LoadOther();
+        const_cast<SmMathConfig*>(this)->LoadOther();
     return pOther->nPrintZoomFactor;
 }
 
@@ -1033,7 +1033,7 @@ void SmMathConfig::SetOtherIfNotEqual( bool &rbItem, bool bNewVal )
 bool SmMathConfig::IsPrintTitle() const
 {
     if (!pOther)
-        ((SmMathConfig *) this)->LoadOther();
+        const_cast<SmMathConfig*>(this)->LoadOther();
     return pOther->bPrintTitle;
 }
 
@@ -1049,7 +1049,7 @@ void SmMathConfig::SetPrintTitle( bool bVal )
 bool SmMathConfig::IsPrintFormulaText() const
 {
     if (!pOther)
-        ((SmMathConfig *) this)->LoadOther();
+        const_cast<SmMathConfig*>(this)->LoadOther();
     return pOther->bPrintFormulaText;
 }
 
@@ -1064,14 +1064,14 @@ void SmMathConfig::SetPrintFormulaText( bool bVal )
 bool SmMathConfig::IsSaveOnlyUsedSymbols() const
 {
     if (!pOther)
-        ((SmMathConfig *) this)->LoadOther();
+        const_cast<SmMathConfig*>(this)->LoadOther();
     return pOther->bIsSaveOnlyUsedSymbols;
 }
 
 bool SmMathConfig::IsPrintFrame() const
 {
     if (!pOther)
-        ((SmMathConfig *) this)->LoadOther();
+        const_cast<SmMathConfig*>(this)->LoadOther();
     return pOther->bPrintFrame;
 }
 
@@ -1095,7 +1095,7 @@ void SmMathConfig::SetSaveOnlyUsedSymbols( bool bVal )
 bool SmMathConfig::IsIgnoreSpacesRight() const
 {
     if (!pOther)
-        ((SmMathConfig *) this)->LoadOther();
+        const_cast<SmMathConfig*>(this)->LoadOther();
     return pOther->bIgnoreSpacesRight;
 }
 
@@ -1111,7 +1111,7 @@ void SmMathConfig::SetIgnoreSpacesRight( bool bVal )
 bool SmMathConfig::IsAutoRedraw() const
 {
     if (!pOther)
-        ((SmMathConfig *) this)->LoadOther();
+        const_cast<SmMathConfig*>(this)->LoadOther();
     return pOther->bAutoRedraw;
 }
 
@@ -1127,7 +1127,7 @@ void SmMathConfig::SetAutoRedraw( bool bVal )
 bool SmMathConfig::IsShowFormulaCursor() const
 {
     if (!pOther)
-        ((SmMathConfig *) this)->LoadOther();
+        const_cast<SmMathConfig*>(this)->LoadOther();
     return pOther->bFormulaCursor;
 }
 
diff --git a/starmath/source/cfgitem.hxx b/starmath/source/cfgitem.hxx
index 37151e2..269a857 100644
--- a/starmath/source/cfgitem.hxx
+++ b/starmath/source/cfgitem.hxx
@@ -129,7 +129,7 @@ protected:
     SmFontFormatList &          GetFontFormatList();
     const SmFontFormatList &    GetFontFormatList() const
     {
-        return ((SmMathConfig *) this)->GetFontFormatList();
+        return const_cast<SmMathConfig*>(this)->GetFontFormatList();
     }
 
 public:


More information about the Libreoffice-commits mailing list