Commit Graph
3343 Commits
Author SHA1 Message Date
Mike Kaganski 1ac5353bbb Use weak reference to SfxObjectShell in SfxEventHint to avoid use-after-free
The events may be processed after the shell has been destroyed. This is
happening reliably after commit e2bfc34d14
(Reimplement OleComponentNative_Impl to use IGlobalInterfaceTable,
2024-03-11) when controlling LibreOffice from external Java scripts; but
obviously, it could happen before as well.

Now SotObject inherits from cppu::OWeakObject, instead of SvRefBase.

Change-Id: I73a3531499a3068c801c98f40de39bdf8ad90b2b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164458
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-03-11 04:43:28 +01:00
Arnaud VERSINI b7b029cd71 basctl : use OUstring literal for XServiceInfo implementation
Change-Id: Iee7585585b5e01fad4609f37a06d2aeeff492123
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164304
Tested-by: Jenkins
Reviewed-by: Arnaud Versini <arnaud.versini@pm.me>
2024-03-10 16:42:20 +01:00
seturaj c67f138ed8 tdf#114441 : sal_uLong to better integer types
Change-Id: I7c9df411775812cfea4a41e84d34782cc5a9578e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162424
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2024-02-16 10:51:13 +01:00
Armin Le Grand (allotropia) ca3c6d468f ITEM: ItemPool Rework (I)
Driving forward the Item reworks I now take the
ItemPool in focus: It now does not hold any items
anymore and should be renamed to something like
ItemInfoProvider/ItemHelper, since it's main purpose
is to provide the Defaults for the Item functionality.

There is that SfxItemInfo, only a struct and bundling
SlotID and ItemFlags. There are also the DefaultItems,
just handled as ptrs in an array. It is/was always
error-prone to keep these in sync. Remember that it's
also necessary for the order to not only being sorted
but being increments of one with no gaps allowed in
the WhichIDs to which the Items are bound.

I now bundled that to a new class ItemInfo that joins
WhichID, SlotID, ItemFlags and the default Item. This
is a pure virtual base class, it comes in three
derivations:

(1) ItemInfoStatic:
This is supposed to be global static and hosts the
Item in a std::unique_ptr to ensure cleanup. It is
designed to be constructed once during runtime and
being shared globally. It allows the ItemPtr to be
nullptr to mark as non-static (if initial static is
not possible for some reason) but still offers the
needed data. Most cases (95%+) are of that case.
The contained Item is owned by that instance. The
flag isStaticDefault() is set at the Item.

(2) ItemInfoDynamic:
This is supposed to be used for cases where the Item
cannot be static: Mainly for SfxSetItem (that needs
a Pool itself in the contained SfxItemSet, so lifetime
is bound to that Pool), but other cases showed up in
the transition. These instances live while the Pool
lives and get destructed when the Pool goes down.
Also uses std::unique_ptr for the Item instance for
as much automated cleanup as possible, the contained
Item is owned by that instance, the instance by the
Pool. The flag isDynamicDefault() is set at the Item.

(3) ItemInfoUser:
This is used for UserDefaults that can be set for
every ItemInfo entry to 'overshadow' the default
from the 'outside'. It uses a regular Item and
the central access methods implCreateItemEntry/
implCleanupItemEntry to manage the Item instance,
thus works like a SfxPoolItemHolder. The Item
instance can be globally shared and re-used even
when the Pool goes down. Instances belong to the
Pool and are cleaned up when the Pool goes down.
This Item does not need any further flag to be
set.

The ItemInfos are organized using a class
called ItemInfoPackage:

This bundles groups of ItemInfoStatic to
functional instances. There are derivations/
implementations of this e.g. for Writer ItemPool
bundling all the needed defaults for Writer,
similar for draw/impress, Calc and other usages.

These ItemInfoPackage can be 'registered' at an
ItemPool using it's method registerItemInfoPackage.
This does all the needed stuff to setup that
group of ItemInfos at the Pool (It even sets
internal vars First/LastWhich, that info can just
be derived from the buildup ItemInfo Ptrs).

The ItemInfoPackage has methods 'size()' and
'getItemInfo(index) to allow looping over it
and deliver the infos the Pool needs. The
(forced, pure virtual) overloads of getItemInfo
in the specific implementations check for the
ItemPtr being nullptr and create a exclusive
incarnation of ItemInfoDynamic for the Pool if
needed, returning that. The Pool owns the
ItemInfoDynamic incarnations and uses the
ItemInfoStatic directly. On shutdown it cleans
up the ItemInfoDynamic as needed.

The ItemInfoUser is used by the Pool when a
UserDefault is set/used: for SetUserDefaultItem,
GetUserDefaultItem, ResetUserDefaultItem. It
is not held in a 2nd list, but directly in the
list of ItemInfo'ptrs: To keep track of this
an unordered_map is used that helds the original
ItemInfo associated with the WhichID. That way
no two lookups (as before) are needed to get the
current Pool's default for any WhichID.

The derivations of ItemInfoPackage are
encapsulated and just allow access to an
ItemInfoPackage& with a single method as
return value. All use a static local instance
of a std::array<ItemInfoStatic, FIXED_SIZE>
which constructs all ItemInfoStatic and the
static Item instances - if already possible.
Sometimes it is necessary to overload the
constructor to set some static instances
for Items later than the lib init. These are
also just marked with nullptr as Item instance.
Some need to overload getItemInfo to complete
instances of ItemInfoStatic, if needed, or
create and deliver instances of ItemInfoDynamic.

The registerItemInfoPackage also offers a
optional lambda callback: there were two cases
where local data from the Pool was needed to
incarnate the item - just add that to the
call to registerItemInfoPackage if needed,
see examples in the adapted code.

For the re-use of Items this means that now
in SfxItemSet/SfxPoolItemHolder *true* static
Items can and will be used without RefCount
directly and globally. This is also the case
for dynamic Items, with the exception of
differing Pools for SfxSetItems which cannot
be done.

Future:
That design is already prepared to allow
solving that Pool-chaining problem: currently
there are master/sub-pools and all accesses
have to traverse that structure before even
doing anything.
For the future the idea is more to 'compose'
a Pool by registering ItemInfoPackages, e.g.
for Writer pool you may start with SfxItemPool,
register the writer-specific ItemInfoPackage,
then the one for DrawingLayer (if needed) and
the one for EditEngine.
It should also be possible to get to smaller
granularities of that packages. Ideas for
new ones will emerge. We might also think
about composing Pools which can e.g. run Writer
and Chart, so allowing to use Chart *without*
OLE stuff in Writer - just ideas...

More changes:
- Adapted all stuff, cleaned up old stuff/
  definitions
- Removed FreezeIdRanges, that can be done
  once per Pool on-demand (and cannot be
  forgotten to be called)
- Merged XOutdevItemPool with SdrItemPool
  and offered a ItemInfoPackage which joins
  both needed sets of Items
- All the cleanup hassle with Pools and
  defaults cleaned up
- Adapted all access methods of the pool
  to use that new stuff. Pool chaining
  currently stays, but I use a central
  method 'getTargetPool' instead of
  recursive calling to get the correct
  Pool for the action

Change-Id: I2b8d3d4c3cc80b1d0d0b3c0f4bd90d7656b4bab7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163157
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2024-02-12 10:35:33 +01:00
Rafael Lima 22b5007e27 tdf#140004 Toggle comment in the Basic IDE
This patch adds the "toggle comment" functionality to the Basic IDE.
The shortcut Ctrl + Alt + C is used to execute it.

It works similarly to other code editors such as Kate and VSCode.

Change-Id: Ifdae42b3729cc909baf87c729fe8c3cdf6428184
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162005
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
Tested-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2024-02-01 13:37:28 +01:00
Rafael Lima 7bcce4180d tdf#131641 Enter selected text in the search bar (Basic IDE)
This patch makes the selected text in the code editor be
automatically inserted in the search bar.

Change-Id: Ibbe64aa3375a5a47dedb762001ed4b99f4b22e46
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162548
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
Tested-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2024-02-01 13:37:16 +01:00
Rafael Lima df0c602aa6 Related tdf#158750 Fix line highlight for all modules when color scheme changes
Prior to this patch, if a library had multiple modules and the color scheme was changed (via View - Color Scheme), the line hightlight color would only update for the current module and remain unchanged for the other modules in the same library.

Change-Id: Idda78c07d02534dfedcd927c37116a2617500ebc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162818
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2024-01-31 22:58:22 +01:00
Mike Kaganski 0fa827dbb2 Drop std::as_const from css::uno::Sequence iterations
Obsoleted by commit 2484de6728 (Remove
non-const Sequence::begin()/end() in internal code, 2021-10-15) and
commit fb3c04bd19 (Drop non-const
Sequence::operator[] in internal code, 2021-11-05).

Change-Id: Idbafef5d34c0d4771cbbf75b9db9712e504164cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162640
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-01-27 12:43:48 +01:00
Rafael Lima 80480fb5ec tdf#153853 Line numbering and breakpoint should be on the left (RTL)
As requested by the user in the ticket, the Line Numering and Breakpoint windows should be on the left side, even on RTL locales.

Change-Id: Iad2ba8efa0a23a13cf88c2fa277c4eed45002aae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162540
Tested-by: Jenkins
Reviewed-by: Hossein <hossein@libreoffice.org>
2024-01-26 17:05:48 +01:00
Caolán McNamara 3b6f04ea70 Resolves: tdf#159368 crash on tools, macros, edit
when launched from startcenter

Change-Id: I362bfe27914445c3027b6e8a125a75cc31679678
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162557
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-01-25 12:09:28 +01:00
Rafael Lima d9d9ec7039 tdf#158749 Open "Go to Line" dialog from the statusbar in Basic IDE
With this change, if the user clicks the StatusGetPosition item in the status bar, the Go To Line dialog will be shown.

Change-Id: Iba75e2dbf6ba83fce24e1af237bdf9813d4ecb69
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162108
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2024-01-23 12:11:33 +01:00
Rafael Lima c4e5b1b934 tdf#159247 Fix crash while adding control with default properties (Dialog Editor)
Controls created using the Ctrl+toolbar (which adds a control with default properties) did not have a parent form, which causes the crash.

Change-Id: Ic2f469e6656a93bbed25d86092384f81b21aaca5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162217
Tested-by: Jenkins
Reviewed-by: Patrick Luby <plubius@libreoffice.org>
Reviewed-by: Rafael Lima <rafael.palma.lima@gmail.com>
2024-01-19 13:23:55 +01:00
Caolán McNamara 3808ef2b27 cid#1545535 COPY_INSTEAD_OF_MOVE
and

cid#1545526 COPY_INSTEAD_OF_MOVE
cid#1545442 COPY_INSTEAD_OF_MOVE
cid#1545426 COPY_INSTEAD_OF_MOVE
cid#1545425 COPY_INSTEAD_OF_MOVE
cid#1545387 COPY_INSTEAD_OF_MOVE
cid#1545379 COPY_INSTEAD_OF_MOVE
cid#1545337 COPY_INSTEAD_OF_MOVE
cid#1545334 COPY_INSTEAD_OF_MOVE
cid#1545289 COPY_INSTEAD_OF_MOVE
cid#1545282 COPY_INSTEAD_OF_MOVE
cid#1545270 COPY_INSTEAD_OF_MOVE
cid#1545237 COPY_INSTEAD_OF_MOVE

Change-Id: Iae44a7347c85ae2e367bf672214b2013f30466f6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161968
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-01-12 20:21:35 +01:00
Rafael Lima bf410be450 tdf#158750 Highlight the line where the cursor is positioned (Basic IDE)
This patch implements support for highlighting the selected line in the code editor, similar to what Kate, VSCode, etc do.

If the cursor is positioned in a single line and nothing is selected, then a highlight color is applied to the line. The line number window also highlights the selected line.

Change-Id: I2047d79500cd783b122b6752bb00996de0a7c702
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161861
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2024-01-11 19:56:08 +01:00
Rafael Lima c0075bf84e tdf#155381 Remember the visibility of UI components in the Basic IDE
This patch remembers the visibility of the Object Catalog, Watched Expressions and Stack Window in the Basic IDE.

Change-Id: I2fea038ffc56af45cd6570feeb14ab84307f8cef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161852
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2024-01-11 19:49:28 +01:00
Caolán McNamara 52f920ebf7 cid#1583747 COPY_INSTEAD_OF_MOVE
and

cid#1583746 COPY_INSTEAD_OF_MOVE
cid#1583745 COPY_INSTEAD_OF_MOVE
cid#1583744 COPY_INSTEAD_OF_MOVE

Change-Id: Ib63c469844925723645f01720f8cebc60388ae29
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161875
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-01-10 11:18:46 +01:00
Andrea Gelmini 6a0dc770f8 Fix typo
Change-Id: I75bcd6459f0bb8d0dcaf4d5646e31da2b71fb78f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161804
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2024-01-09 18:46:46 +01:00
Andrea Gelmini 833b8bd3d1 Fix typo
Change-Id: Icf3d2feb84f287e3e75f1eab488ec2804cd22a40
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161803
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2024-01-09 18:46:20 +01:00
Rafael Lima 076e21f4e3 tdf#156925 Add Color Scheme selector to the Basic IDE
This patch implements a color scheme selector for the Basic IDE. With this new feature the user can either:
1) Choose to stick with "Application Colors", meaning that the colors defined in "Tools - Options - Application Colors" are applied.
2) Use one of the available color schemes in the dialog

To access the color scheme dialog, go to View - Color Scheme.

A color schema was defined in the "BasicIDE.xcs" file and six color schemes were defined in "BasicIDE.xcu" to be shipped with LibreOffice.

This way, it is possible to install more color schemes via extensions;

Change-Id: I5d382d19f982d02ba3c0fda5d1596aed2c38f13c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155928
Tested-by: Jenkins
Tested-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
Reviewed-by: Rafael Lima <rafael.palma.lima@gmail.com>
2024-01-08 19:13:38 +01:00
Caolán McNamara fe25701ae9 cid#1545421 COPY_INSTEAD_OF_MOVE
and

cid#1545403 COPY_INSTEAD_OF_MOVE
cid#1545397 COPY_INSTEAD_OF_MOVE
cid#1545376 COPY_INSTEAD_OF_MOVE
cid#1545339 COPY_INSTEAD_OF_MOVE
cid#1545288 COPY_INSTEAD_OF_MOVE

Change-Id: I0e24a3fc7148d0b7ff8126debe3cddbb4fbdd713
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161453
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-30 22:07:47 +01:00
Caolán McNamara 80b5041ea5 cid#1545970 COPY_INSTEAD_OF_MOVE
Change-Id: Ifbec5f91dd11a495fcf01ad95fcdcc867e882f70
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161293
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-26 11:53:19 +01:00
Caolán McNamara 9a6298aedb cid#1546006 COPY_INSTEAD_OF_MOVE
and

cid#1545999 COPY_INSTEAD_OF_MOVE
cid#1545995 COPY_INSTEAD_OF_MOVE
cid#1545994 COPY_INSTEAD_OF_MOVE
cid#1545989 COPY_INSTEAD_OF_MOVE
cid#1545982 COPY_INSTEAD_OF_MOVE
cid#1545977 COPY_INSTEAD_OF_MOVE
cid#1545970 COPY_INSTEAD_OF_MOVE
cid#1545856 COPY_INSTEAD_OF_MOVE
cid#1545845 COPY_INSTEAD_OF_MOVE
cid#1545838 COPY_INSTEAD_OF_MOVE
cid#1545776 COPY_INSTEAD_OF_MOVE
cid#1545774 COPY_INSTEAD_OF_MOVE
cid#1545744 COPY_INSTEAD_OF_MOVE
cid#1545719 COPY_INSTEAD_OF_MOVE
cid#1545716 COPY_INSTEAD_OF_MOVE
cid#1545687 COPY_INSTEAD_OF_MOVE
cid#1545648 COPY_INSTEAD_OF_MOVE
cid#1545643 COPY_INSTEAD_OF_MOVE
cid#1545641 COPY_INSTEAD_OF_MOVE
cid#1545604 COPY_INSTEAD_OF_MOVE
cid#1545531 COPY_INSTEAD_OF_MOVE
cid#1545530 COPY_INSTEAD_OF_MOVE
cid#1545524 COPY_INSTEAD_OF_MOVE
cid#1545516 COPY_INSTEAD_OF_MOVE
cid#1545501 COPY_INSTEAD_OF_MOVE
cid#1545486 COPY_INSTEAD_OF_MOVE

Change-Id: Idcf3e27bb9e81b6a77d5ef75c9376eb1d6aff8c9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161245
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-23 19:52:50 +01:00
Armin Le Grand (allotropia) 789a737ac9 Remove DeleteItemOnIdlex
There are some CrashReports in 7.6 which have
DeleteItemOnIdle on the stack, but there is nothing
reproducable. So I took a look...

I first thought it's a MCGR regression, due to classes
on the stack. But the Item involved is just random, can
happen with any Item.

Then I thought it may have to do with ITEM refactorings,
but it happens with DeleteItemOnIdle involved, so also
not the case. I already saw DeleteItemOnIdle when doing
these and qualified as 'hack' in the way. already

It is only on Windows and DeleteItemOnIdle is involved.
This again (took a deeper look now) is an old hack to
keep an SfxPoolItem 'alive' for some 'time'. For that,
it triggers an async reschedule which then deletes the
Item when being called. If the Item will be used after
that is pure coincidence - seems to work in most cases.

It seems as if for Windows the timing slightly changed
for some scenarios, so a reschedule is too early. This
can happen with this hack anytime.

DeleteItemOnIdle is used in scenarios where SfxPoolItem*
is e.g. returned, but is *not* anchored, so e.g. not
member of an SfxItemSet. Or in short: Lifetime is not
safe.

DeleteItemOnIdle exists since 1st import, but was
changed to AsyncEvent ca. 4 months ago (see
57145acf9e), so that may
have caused it. It is possible that these errors happen
on Windows since then. Before something more complicated
was used to delete it late, but surely also not really
safe.

Due to ITEM refactor I have the knowledge/tooling to
solve this. It will not be a 1-5 lines fix, but it is
a hack and in the way for further ITEM refactor anyways.
What we have nowadays is a SfxPoolItemHolder -> it's
like an SfxItemSet for a single Item. It safely holds/
controls the lifetime of an SfxPoolItem. It is already
used in quite some places. It helps to solve many hacks,
also the ones putting Items directly to the Pool - due
to there never was an alternative for that. In principle
the ItemPool/ItemSet/Item paradigm was never complete
without SfxPoolItemHolder.

Thus I started to fix that (and remove that hack for
good, sooo many changes over the years, sigh), but as
said is not straightforward. Will have to change
retvals of involved stuff to SfxPoolItemHolder - it's
just two pointers and designed to be copied (one is a
Pool, needed to cleanup when destructing).
CopyConstruct/destroy just counts the RefCnt up/down,
so cheap.

1st version compiling, let's check on gerrit...
Corrected one error in QueryState for securitypage, also
added some security features/asserts.

Change-Id: Ida49fd35ca88ead84b11d93e18b978cb9e395090
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161083
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-12-21 21:13:55 +01:00
Caolán McNamara c905505348 capture these explicitly by name
Change-Id: I0908aedada9c59426373080d7d3894b452693939
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161076
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-20 20:22:30 +01:00
Caolán McNamara de4b3a135f cid#1545970 COPY_INSTEAD_OF_MOVE
and

cid#1545957 COPY_INSTEAD_OF_MOVE
cid#1545944 COPY_INSTEAD_OF_MOVE
cid#1545939 COPY_INSTEAD_OF_MOVE
cid#1545931 COPY_INSTEAD_OF_MOVE
cid#1545926 COPY_INSTEAD_OF_MOVE
cid#1545909 COPY_INSTEAD_OF_MOVE
cid#1545899 COPY_INSTEAD_OF_MOVE
cid#1545896 COPY_INSTEAD_OF_MOVE
cid#1545894 COPY_INSTEAD_OF_MOVE
cid#1545858 COPY_INSTEAD_OF_MOVE
cid#1545823 COPY_INSTEAD_OF_MOVE
cid#1545820 COPY_INSTEAD_OF_MOVE
cid#1545819 COPY_INSTEAD_OF_MOVE
cid#1545772 COPY_INSTEAD_OF_MOVE
cid#1545749 COPY_INSTEAD_OF_MOVE
cid#1545743 COPY_INSTEAD_OF_MOVE
cid#1545739 COPY_INSTEAD_OF_MOVE
cid#1545635 COPY_INSTEAD_OF_MOVE
cid#1545603 COPY_INSTEAD_OF_MOVE
cid#1545602 COPY_INSTEAD_OF_MOVE
cid#1545592 COPY_INSTEAD_OF_MOVE
cid#1545544 COPY_INSTEAD_OF_MOVE
cid#1545532 COPY_INSTEAD_OF_MOVE
cid#1545520 COPY_INSTEAD_OF_MOVE
cid#1545512 COPY_INSTEAD_OF_MOVE
cid#1545490 COPY_INSTEAD_OF_MOVE
cid#1545483 COPY_INSTEAD_OF_MOVE
cid#1545467 COPY_INSTEAD_OF_MOVE
cid#1545461 COPY_INSTEAD_OF_MOVE
cid#1545458 COPY_INSTEAD_OF_MOVE
cid#1545428 COPY_INSTEAD_OF_MOVE
cid#1545394 COPY_INSTEAD_OF_MOVE
cid#1545385 COPY_INSTEAD_OF_MOVE
cid#1545383 COPY_INSTEAD_OF_MOVE
cid#1545366 COPY_INSTEAD_OF_MOVE
cid#1545357 COPY_INSTEAD_OF_MOVE

Change-Id: I76224326977b4067b94ca3176cad1ca6de17930a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160847
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-16 22:39:20 +01:00
Caolán McNamara cb18b12953 cid#1545617 COPY_INSTEAD_OF_MOVE
and

cid#1545748 COPY_INSTEAD_OF_MOVE
cid#1545741 COPY_INSTEAD_OF_MOVE
cid#1545698 COPY_INSTEAD_OF_MOVE
cid#1545594 COPY_INSTEAD_OF_MOVE
cid#1545588 COPY_INSTEAD_OF_MOVE
cid#1545558 COPY_INSTEAD_OF_MOVE
cid#1545545 COPY_INSTEAD_OF_MOVE

Change-Id: I5dfec77a68959b9384fc71a2fc0908c5d1b42869
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160448
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-08 09:34:29 +01:00
Caolán McNamara 6aba194067 Resolves: tdf#158441 we don't want to return early for all handled keys
a problem since:

commit c39bd1f669
Author: Caolán McNamara <caolanm@redhat.com>
Date:   Wed Feb 19 10:13:15 2020 +0000

    weld CodeCompleteWindow

Change-Id: I520a591bad89515c973098f4200f01ae0ddbdc34
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160337
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-05 14:43:04 +01:00
Julien Nabet c05595d242 c++20: use std::erase instead of std::removed followed by erase (part 1)
Change-Id: I8d038fc37a4de25bdeff2e2cc55775e3981240b7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159610
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-11-18 18:38:01 +01:00
Stephan Bergmann c0e516609b loplugin:stringstatic, lopluign:ostr (clang-cl)
Change-Id: I7a928a2385286f6d1ab3887c8d315af3f47c052d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159135
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-08 18:58:40 +01:00
Stephan Bergmann bd6fb0cd3e Extended loplugin:ostr: Rewrite some O[U]StringLiteral -> O[U]String
...in include files.  This is a mix of automatic rewriting in include files and
manual fixups (mostly addressing loplugin:redundantfcast) in source files that
include those.

Change-Id: I1f3cc1e67b9cabd2e9d61a4d9e9a01e587ea35cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158337
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-23 11:04:42 +02:00
Stephan Bergmann 8c230395bc Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: basctl
Change-Id: I771d90376e3497cd28abeda2c8c794c049a80d84
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158143
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-19 15:29:04 +02:00
Noel Grandin 358b480be5 use more SdrObjList::begin/end in various
Change-Id: If054626a10d3cbd3b168dd4e66ec7f08344d2c2d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158131
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-10-19 09:06:06 +02:00
Hossein e94cbd7dbf Remove obsolete comments in basctl
First comment was last updated with USHORT -> sal_uInt16 in
a2242be9c3 but with the newer commit
68ec95b3f8 there is no remaining sal_uInt16
left, and thus the comment is no longer relevant.

Second comment was added in 1fac87f847,
but with changes in 444c242c51 it is no
longer relevant.

Third comment was also last updated with USHORT -> sal_uInt16 in
a2242be9c3 but with the newer commit
444c242c51 it is no longer relevant.

Change-Id: I9ed383f15a5b403740c0b8bcdd153d04bb1a2b0c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158111
Tested-by: Jenkins
Reviewed-by: Hossein <hossein@libreoffice.org>
2023-10-18 17:41:52 +02:00
Noel Grandin d9e322d60f replace ErrorInfo with simpler mechanism
Instead of returning ErrCode class everywhere, return a new
class ErrrCodeMsg, which combines an ErrCode with the other
parameters that are used to control the error reporting.

I do not change everything that uses ErrCode here, I started
from SfxBaseController/SfxMedium and worked outwards.

This change serves two purposes

(1) Replace the extremely whacky ErrorInfo mechanism we were
using to smuggle information into the error handler reporting
mechanism with a very straightforward approach of just combining it
into the error class.
(2) Allow us to capture the source location that produced the error,
which makes debugging the source of a problem soooo much easier.

Change-Id: I978b8f00c9851b41a216c7ebdef2ef94251d5519
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157440
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-10-03 10:12:41 +02:00
Noel Grandin ed774e9fb5 rename SfxMedium::GetError -> GetErrorIgnoreWarning
to distinguish it from the very similar GetErrorCode()

Change-Id: I937e3dcfd6ce116046ac7b1c98cf79479b322f1d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157388
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-09-29 08:02:55 +02:00
Noel Grandin b58aeda083 use concrete type for ChildDescriptor::mxAccessible
avoid some unnecessary casting

Change-Id: I23e0257d1831c1c43d2d646d4ff8e1d654c0b528
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156289
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-30 21:36:17 +02:00
Noel Grandin ab38a8d13d tdf#156721 Crash if cursor in Basic IDE is in a macro from a document..
.. and that document is closed

regression from
    commit f3e127217d
    Author: Noel Grandin <noel.grandin@collabora.co.uk>
    Date:   Tue May 9 15:21:20 2023 +0200
use comphelper::WeakComponentImplHelper in
DocumentEventNotifier::Impl

Change-Id: I5c8e68cd222ee1d66dc832700c4a39fd74223643
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155889
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-21 14:04:43 +02:00
Andrea Gelmini f128fc5dbb Remove triplicated include
Change-Id: I345a6e87ebf27188e9bdfe82ee364c2363b48efd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152197
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2023-05-24 15:02:38 +02:00
Noel Grandin 3168d1ab07 use more optional for SdrObjListIter
Change-Id: Iffd99d820889a1a5be514d46191ffaa2a6fa6910
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151721
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-05-13 14:55:56 +02:00
Supriyo Paul e08c910f9e tdf#145538: traditional for loops to range-based for loops
changes traditional for to ranged based for in localizationmgr.cxx
goal: better readability for programmers

Change-Id: Ifde48037b27a794a9cdc3b1183f825651896cafb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148127
Tested-by: Jenkins
Reviewed-by: Hossein <hossein@libreoffice.org>
2023-05-13 00:54:00 +02:00
Noel Grandin f3e127217d use comphelper::WeakComponentImplHelper in DocumentEventNotifier::Impl
Change-Id: Ife4222b3f485969351565145554a51e4bed199df
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151584
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-05-10 13:28:09 +02:00
Aman Jha 53c641702a tdf#114441 Convert sal_uLong to better integer types
* Use tools::Long for nY as it stores calculations with result values
  that can be sometimes negative
* Cast nLine to sal_uInt16 as rModulWindow.ToggleBreakPoint() takes
  parameter of type sal_uInt16

Change-Id: Ibfdee40f37714406ee0f089c9a87f8b9a650e492
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145210
Tested-by: Jenkins
Reviewed-by: Hossein <hossein@libreoffice.org>
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2023-05-02 12:30:27 +02:00
Mike Kaganski c395fc2ba5 These are not applicable to FILEOPEN_SIMPLE
Change-Id: Id2668a6b30f7062e42ec60b3664b9a7490feccd1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151128
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-04-29 21:32:11 +02:00
Mike Kaganski 5d56733bbc Simplify a bit
Change-Id: I5b39a16479a69c0683d8e04497ad24421112751c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151126
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-04-29 15:12:08 +02:00
Mike Kaganski 90ac25f12c Simplify a bit
Change-Id: Id768a3e10eb593af84bdea423ddfd090df33eef2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151182
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-04-29 14:30:27 +02:00
Mike Kaganski 5f303eaaea tdf#155077: use the selected URL when writing languages
Regression after commit 9a55b97e98
(tdf#40068 Remember last directory for basic/dialog import/export,
2021-07-14).

Change-Id: I6ddb88cbe8a08128c451169de7e9ed4597dc4356
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151181
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-04-29 14:23:50 +02:00
Radhey Parekh f43c365fdd tdf#145538 Use range based for loops
Change-Id: I6a393526d96fc5c7bee88fc03fc254dbdbe975cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138157
Tested-by: Jenkins
Reviewed-by: Hossein <hossein@libreoffice.org>
2023-04-28 21:52:00 +02:00
Caolán McNamara 8550aff56c Resolves: tdf#104011 add a default CellRange argument in dialog editor
so the form combo box can be added without exception, likely either a problem
from:

commit 9cff030fa1
Date:   Mon Dec 5 09:56:17 2011 +0000

    add some form control support for basic dialogs

or:

commit c0d6bc75b2
Date:   Fri Jun 5 14:52:44 2015 +0100

    Resolves: tdf#90361 CellValueBinding/CellRangeListSource need WithArguments

Change-Id: I80e670840195a6725a9fdedc024f9763ad12ffe7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150599
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-04-19 13:52:23 +02:00
Xisco Fauli 7ec4e29ec5 basctl: fix crash in EditorWindow::Command
GetWheelData returns nullptr if  mnCommand != CommandEventId::Wheel

Change-Id: I57b30cc137b2f56e4295d49d0163ad95323201ce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150598
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-04-19 12:57:52 +02:00
Noel Grandin 9f463511fb loplugin:stringview and stringviewparam, whitelist equalsAsciiL
since we have a o3tl::equalsAscii that can handle that

Change-Id: I0ae3b81cd5b4d97a0aef92cb6586cf365ee042b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150239
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-12 10:49:50 +02:00