[Libreoffice-bugs] [Bug 90341] Clean up excessive const_cast'ing

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Tue May 5 14:53:23 UTC 2020


https://bugs.documentfoundation.org/show_bug.cgi?id=90341

--- Comment #6 from mesutcfc <mesutcifci97 at gmail.com> ---
Hi Stephan. I tried fix this issue but jenkins says something went wrong. 
This is my patch : https://gerrit.libreoffice.org/c/core/+/93472
And this is error:

"error "binding value of type "const DbGridControl" to reference to type
"DbGridControl" drops "const" qualifier" triggered in included file
/home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/svx/source/inc/gridcell.hxx:136:46"

1)I can remove this const keyword 
gridcell.hxx:136
DbGridControl& GetParent() const {return m_rParent;}

2)Or i can ignore changes that i made before and only I can change this
function.

std::unique_ptr<DbGridColumn> DbGridControl::CreateColumn(sal_uInt16 nId) const
{
    return std::unique_ptr<DbGridColumn>(new DbGridColumn(nId,
*const_cast<DbGridControl*>(this)));
}

with this

std::unique_ptr<DbGridColumn> DbGridControl::CreateColumn(sal_uInt16 nId)
{
    return std::unique_ptr<DbGridColumn>(new DbGridColumn(nId, *this));
}

But i'm confused. What the logic in here? One of these ways is right? İf right.
Which and why? I am really curious? Can you help me?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20200505/a7db65fc/attachment.htm>


More information about the Libreoffice-bugs mailing list