https://bugs.documentfoundation.org/show_bug.cgi?id=125054
Armin Le Grand <[email protected]> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|[email protected] |[email protected]
|desktop.org |
--- Comment #6 from Armin Le Grand <[email protected]> ---
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._______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs