Kaydet (Commit) 67c19855 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

const_cast: convert some C-style casts and remove some redundant ones

Change-Id: Iee4396c5ac715e1b211c5fa6e1cb66b1e95e3f60
üst af3cb5e8
...@@ -445,7 +445,7 @@ class SmSymDefineDialog : public ModalDialog ...@@ -445,7 +445,7 @@ class SmSymDefineDialog : public ModalDialog
SmSym * GetSymbol(const ComboBox &rComboBox); SmSym * GetSymbol(const ComboBox &rComboBox);
const SmSym * GetSymbol(const ComboBox &rComboBox) const const SmSym * GetSymbol(const ComboBox &rComboBox) const
{ {
return ((SmSymDefineDialog *) this)->GetSymbol(rComboBox); return const_cast<SmSymDefineDialog *>(this)->GetSymbol(rComboBox);
} }
void InitColor_Impl(); void InitColor_Impl();
......
...@@ -149,7 +149,7 @@ public: ...@@ -149,7 +149,7 @@ public:
void RequestApplyChanges() const void RequestApplyChanges() const
{ {
((SmFormat *) this)->Broadcast(SfxSimpleHint(HINT_FORMATCHANGED)); const_cast<SmFormat *>(this)->Broadcast(SfxSimpleHint(HINT_FORMATCHANGED));
} }
}; };
......
...@@ -1029,7 +1029,7 @@ public: ...@@ -1029,7 +1029,7 @@ public:
/** Get body (Not NULL) */ /** Get body (Not NULL) */
const SmNode * GetBody() const const SmNode * GetBody() const
{ {
return ((SmSubSupNode *) this)->GetBody(); return const_cast<SmSubSupNode *>(this)->GetBody();
} }
void SetUseLimits(bool bVal) { bUseLimits = bVal; } void SetUseLimits(bool bVal) { bUseLimits = bVal; }
...@@ -1183,7 +1183,7 @@ public: ...@@ -1183,7 +1183,7 @@ public:
SmNode * GetSymbol(); SmNode * GetSymbol();
const SmNode * GetSymbol() const const SmNode * GetSymbol() const
{ {
return ((SmOperNode *) this)->GetSymbol(); return const_cast<SmOperNode *>(this)->GetSymbol();
} }
long CalcSymbolHeight(const SmNode &rSymbol, const SmFormat &rFormat) const; long CalcSymbolHeight(const SmNode &rSymbol, const SmFormat &rFormat) const;
......
...@@ -144,7 +144,7 @@ public: ...@@ -144,7 +144,7 @@ public:
SmSym * GetSymbolByName(const OUString& rSymbolName); SmSym * GetSymbolByName(const OUString& rSymbolName);
const SmSym * GetSymbolByName(const OUString& rSymbolName) const const SmSym * GetSymbolByName(const OUString& rSymbolName) const
{ {
return ((SmSymbolManager *) this)->GetSymbolByName(rSymbolName); return const_cast<SmSymbolManager *>(this)->GetSymbolByName(rSymbolName);
} }
bool IsModified() const { return m_bModified; } bool IsModified() const { return m_bModified; }
......
...@@ -608,7 +608,7 @@ bool SmGetGlyphBoundRect(const OutputDevice &rDev, ...@@ -608,7 +608,7 @@ bool SmGetGlyphBoundRect(const OutputDevice &rDev,
// get a device where 'OutputDevice::GetTextBoundRect' will be successful // get a device where 'OutputDevice::GetTextBoundRect' will be successful
OutputDevice *pGlyphDev; OutputDevice *pGlyphDev;
if (rDev.GetOutDevType() != OUTDEV_PRINTER) if (rDev.GetOutDevType() != OUTDEV_PRINTER)
pGlyphDev = (OutputDevice *) &rDev; pGlyphDev = const_cast<OutputDevice *>(&rDev);
else else
{ {
// since we format for the printer (where GetTextBoundRect will fail) // since we format for the printer (where GetTextBoundRect will fail)
......
...@@ -188,13 +188,13 @@ SmModule::~SmModule() ...@@ -188,13 +188,13 @@ SmModule::~SmModule()
void SmModule::_CreateSysLocale() const void SmModule::_CreateSysLocale() const
{ {
SmModule* pThis = (SmModule*)this; SmModule* pThis = const_cast<SmModule*>(this);
pThis->pSysLocale = new SvtSysLocale; pThis->pSysLocale = new SvtSysLocale;
} }
void SmModule::_CreateVirtualDev() const void SmModule::_CreateVirtualDev() const
{ {
SmModule* pThis = (SmModule*)this; SmModule* pThis = const_cast<SmModule*>(this);
pThis->pVirtualDev = new VirtualDevice; pThis->pVirtualDev = new VirtualDevice;
pThis->pVirtualDev->SetReferenceDevice( VirtualDevice::REFDEV_MODE_MSO1 ); pThis->pVirtualDev->SetReferenceDevice( VirtualDevice::REFDEV_MODE_MSO1 );
} }
...@@ -249,7 +249,7 @@ SmSymbolManager & SmModule::GetSymbolManager() ...@@ -249,7 +249,7 @@ SmSymbolManager & SmModule::GetSymbolManager()
SmLocalizedSymbolData & SmModule::GetLocSymbolData() const SmLocalizedSymbolData & SmModule::GetLocSymbolData() const
{ {
if (!pLocSymbolData) if (!pLocSymbolData)
((SmModule *) this)->pLocSymbolData = new SmLocalizedSymbolData; const_cast<SmModule *>(this)->pLocSymbolData = new SmLocalizedSymbolData;
return *pLocSymbolData; return *pLocSymbolData;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment