[Libreoffice-bugs] [Bug 125054] Font changed when typing into cell, in edit mode, with redline
bugzilla-daemon at bugs.documentfoundation.org
bugzilla-daemon at bugs.documentfoundation.org
Wed May 15 14:20:13 UTC 2019
https://bugs.documentfoundation.org/show_bug.cgi?id=125054
Armin Le Grand <Armin.Le.Grand at me.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|libreoffice-bugs at lists.free |Armin.Le.Grand at me.com
|desktop.org |
--- Comment #6 from Armin Le Grand <Armin.Le.Grand at me.com> ---
I think I have found the source for the error: The before used ::operator=() of
SfxPoolItems did *not* copy the WhichID. There were places like in
ScPatternAttr::FillToEditItemSet which prepared a new Item which is now
std::shared_ptr<SvxColorItem>
aColorItem(std::make_shared<SvxColorItem>(EE_CHAR_COLOR)); // use
item as-is
then used ::operator=() to copy something to it which is now
aColorItem.reset(static_cast<SvxColorItem*>(pItem->Clone()));
and then used it in calls to e.g.
rEditSet.Put( *aColorItem, EE_CHAR_COLOR );
which in effect *changed* the WhichID of the item. The ::Clone() call to the
SfxPoolItem which is used now to work with an instance of the Item will - of
course - also clone the WhichID.
Thus the up-to-now indirectly 'used' functionality is that the ::operator=()
did *not* change the evtl. already set WhichID of the target item. This is
usage of very hidden functionality, it would be perfectly OK to assume that
::operator= copies everything and thus is equal in that respect to ::Clone() -
but it is *not*.
Checking my changes for that aspect...
--
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/20190515/96a413d9/attachment-0001.html>
More information about the Libreoffice-bugs
mailing list