office-gobmx/include
Armin Le Grand (allotropia) b8e393686c ITEM: Remove suspicious extra-Which in ::Put
The ::Put methods at SfxItemSet had an extra WhichID
parameter that was not really documented, but I would
guess often asked why it exists: An extra WhichID, just
called 'nWhich' (which makes things NOT clearer). That
is 'strange' since the Item given to be put already
internally has a WhichID, so why a 2nd one?

If you were really interested and read all that code
(no, no comments on that anywhere) you might know
that this a kind of 'Target-WhichID' under which
the Item shall be put to the ItemSet. Since this
is unclear for most people it is even dangerous and
explains why so many code places just hand over the
WhichID requsted from the Item that already gets
handed over.

To make it short: I removed that. For the 19 places
where this was really needed I added a new method
besides ::Put called ::PutAsTargetWhich that takes that
extra WhichID (now called TargetWhich) and takes the
needed actions. These are quite some because that may
be combined with the bPassingOwnership flag, see new
SfxItemSet::PutImplAsTargetWhich method.

This makes usage of ItemSets/Items less dangerous. It
also simplifies and thus makes safer the central helpers
implCreateItemEntry/implCleanupItemEntry which have some
less cases to handle.

Debugged the failing UnitTests showed that there is
an incarnate Item != SfxVoidItem that causes problems.
I checked for errors in the change, but no luck.
Afterr some time I found out that a ::Clone
implementation caused the problem: These need to
also copy the WichID of the original, but the
SfxFrameItem failed to do so. This did not cause
problems in the former version because
implCreateItemEntry was designed to set a missing/
different WhichID.
I corrected that in SfxFrameItem, also removed not
needed costructor that caused that. Also added a
SAL_WARN and a correction in implCreateItemEntry.
I could have added an assert (did so for running
local UnitTests), but should be enough.

NOTE: When hunting for Items except SfxVoidItem
that get crerated using a WhichID '0' i learned
that this indeed happens: There are some (5) calls
to SfxRequest::SetReturnValue that incarnate an
SfxBoolItem with WhichID '0' (ZERO). This is not
good and I think about how to change that...

Change-Id: I9854a14cdc42d1cc19c7b9df65ce74147d680825
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162124
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2024-01-17 01:56:01 +01:00
..
android
animations
apple_remote
avmedia
basegfx A base B3DTuple can no longer stand in for a derived BColor 2024-01-16 22:54:11 +01:00
basic loplugin:unusedfields 2023-12-13 18:09:16 +01:00
canvas
codemaker
com/sun/star/uno
comphelper improve loplugin:cow_wrapper 2024-01-16 13:20:10 +01:00
connectivity cid#1545421 COPY_INSTEAD_OF_MOVE 2023-12-30 22:07:47 +01:00
cppcanvas
cppu
cppuhelper
cppunittester
cui
dbaccess
desktop
docmodel
drawinglayer chart2: Make automatic area coloring for charts work for tiled rendering 2024-01-16 14:19:56 +01:00
editeng editeng: change the ParaPortion parameter from pointer to ref. 2024-01-14 16:06:17 +01:00
embeddedobj
filter
formula
fpicker
framework Rewrite bin/find-unusedheaders.py 2023-12-24 11:50:26 +01:00
helpcompiler
i18nlangtag
i18npool
i18nutil
jvmaccess
jvmfwk
LibreOfficeKit Send tooltip text to LOK 2024-01-04 14:12:23 +01:00
linguistic tdf#158885 sw: don't hyphenate right after a stem boundary 2024-01-01 00:42:35 +01:00
o3tl std::list::size() can still be implemented as std::distance() 2023-12-21 17:13:28 +01:00
oox cid#1546354 COPY_INSTEAD_OF_MOVE 2024-01-13 22:53:50 +01:00
opencl
osl
package
registry
rtl tdf#159018: make 64-bit hash algorithm similar to 32-bit one 2024-01-07 14:50:10 +01:00
sal
salhelper
sax tdf#146619 Recheck include/ with find-unneeded-includes --noexclude 2023-12-24 12:14:14 +01:00
sfx2 ITEM: Remove suspicious extra-Which in ::Put 2024-01-17 01:56:01 +01:00
sot
store
svl ITEM: Remove suspicious extra-Which in ::Put 2024-01-17 01:56:01 +01:00
svtools loplugin:unusedmethods 2024-01-16 13:01:25 +01:00
svx Use correct type when getting document colors 2024-01-16 12:23:49 +01:00
systools
test cool#7492 sfx2 lok: set language/locale on async sidebar update 2024-01-11 12:06:52 +01:00
toolkit
tools chart2: Make automatic area coloring for charts work for tiled rendering 2024-01-16 14:19:56 +01:00
typelib
ucbhelper
uno
unoidl
unotest
unotools loplugin:unusedmethods 2024-01-16 13:01:25 +01:00
vbahelper cid#1545470 COPY_INSTEAD_OF_MOVE 2023-12-24 13:23:45 +01:00
vcl loplugin:unusedmethods 2024-01-16 13:01:25 +01:00
xmloff tdf#146619 Recheck include/ with find-unneeded-includes --noexclude 2023-12-24 12:14:14 +01:00
xmlreader
xmlscript
default.rc
IwyuFilter_include.yaml tdf#146619 Recheck include/ with find-unneeded-includes --noexclude 2023-12-24 12:14:14 +01:00
postmac.h
postwin.h
premac.h
prewin.h
version.hrc