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
SmSym * GetSymbol(const ComboBox &rComboBox);
const SmSym * GetSymbol(const ComboBox &rComboBox) const
{
return ((SmSymDefineDialog *) this)->GetSymbol(rComboBox);
return const_cast<SmSymDefineDialog *>(this)->GetSymbol(rComboBox);
}
void InitColor_Impl();
......
......@@ -149,7 +149,7 @@ public:
void RequestApplyChanges() const
{
((SmFormat *) this)->Broadcast(SfxSimpleHint(HINT_FORMATCHANGED));
const_cast<SmFormat *>(this)->Broadcast(SfxSimpleHint(HINT_FORMATCHANGED));
}
};
......
......@@ -1029,7 +1029,7 @@ public:
/** Get body (Not NULL) */
const SmNode * GetBody() const
{
return ((SmSubSupNode *) this)->GetBody();
return const_cast<SmSubSupNode *>(this)->GetBody();
}
void SetUseLimits(bool bVal) { bUseLimits = bVal; }
......@@ -1183,7 +1183,7 @@ public:
SmNode * GetSymbol();
const SmNode * GetSymbol() const
{
return ((SmOperNode *) this)->GetSymbol();
return const_cast<SmOperNode *>(this)->GetSymbol();
}
long CalcSymbolHeight(const SmNode &rSymbol, const SmFormat &rFormat) const;
......
......@@ -144,7 +144,7 @@ public:
SmSym * GetSymbolByName(const OUString& rSymbolName);
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; }
......
......@@ -608,7 +608,7 @@ bool SmGetGlyphBoundRect(const OutputDevice &rDev,
// get a device where 'OutputDevice::GetTextBoundRect' will be successful
OutputDevice *pGlyphDev;
if (rDev.GetOutDevType() != OUTDEV_PRINTER)
pGlyphDev = (OutputDevice *) &rDev;
pGlyphDev = const_cast<OutputDevice *>(&rDev);
else
{
// since we format for the printer (where GetTextBoundRect will fail)
......
......@@ -188,13 +188,13 @@ SmModule::~SmModule()
void SmModule::_CreateSysLocale() const
{
SmModule* pThis = (SmModule*)this;
SmModule* pThis = const_cast<SmModule*>(this);
pThis->pSysLocale = new SvtSysLocale;
}
void SmModule::_CreateVirtualDev() const
{
SmModule* pThis = (SmModule*)this;
SmModule* pThis = const_cast<SmModule*>(this);
pThis->pVirtualDev = new VirtualDevice;
pThis->pVirtualDev->SetReferenceDevice( VirtualDevice::REFDEV_MODE_MSO1 );
}
......@@ -249,7 +249,7 @@ SmSymbolManager & SmModule::GetSymbolManager()
SmLocalizedSymbolData & SmModule::GetLocSymbolData() const
{
if (!pLocSymbolData)
((SmModule *) this)->pLocSymbolData = new SmLocalizedSymbolData;
const_cast<SmModule *>(this)->pLocSymbolData = new SmLocalizedSymbolData;
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