Commit Graph
3181 Commits
Author SHA1 Message Date
Noel Grandin e367e59e37 loplugin:unusedfields
Change-Id: Ie27afe4c2438c44baece4b926572584c6695dc39
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120774
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-20 11:28:46 +02:00
Caolán McNamara 88bf1749f1 undo changes to TextAlign
revert commit 8689bd5490
Author: Caolán McNamara <caolanm@redhat.com>
Date:   Thu Jul 29 20:49:29 2021 +0100

    convert TextAlign to scoped enum

lets leave this as it always was

Change-Id: Id4d2a5644974cdd2b0ed6d361d5c52629674d057
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120626
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-08-18 12:53:31 +02:00
Mike Kaganski 581b2cf796 Drop tools::Rectangle::getX/getY, which are just duplicates of Left/Top
The change allowed to simplify many places where previously this API was
used, to avoid inefficient calculations (e.g., moving rectangle keeping
its size, and then immediately changing the size).

Change-Id: Ica2dc594d91cae83e2c2740c1f4fb23f44998916
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120461
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-08-16 15:53:02 +02:00
Caolán McNamara 1aee8678c8 drop intermediate vcl::Window from Application::GetDefDialogParent
Change-Id: I96be984cbefeb8e45bf49de4c50a225a46fbefb6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120089
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-08-06 10:55:18 +02:00
Noel Grandin 14cfff500e Pass context and resource string down to boost::locale separately
because this is often on a hot path, and we can avoid the splitting and
joining of strings like this.

Change-Id: Ia36047209368ca53431178c2e8723a18cfe8260a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119220
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-05 09:39:11 +02:00
Caolán McNamara 8689bd5490 convert TextAlign to scoped enum
Change-Id: Id2c466eacb44f0ea6adba75a0ac0be8be8e7ed4c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119682
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-07-30 16:40:56 +02:00
Mike Kaganski b1668edf7f Move svl::Items to include/svl/whichranges.hxx, and unify its usage
... in WhichRangesContainer and SfxItemSet ctors. Now it's not needed
to explicitly use 'value' in WhichRangesContainer's ctor, or create an
instance for use in SfxItemSet ctor (svl::Items is already defined as
a template value of corresponding type).

Instead of

  WhichRangesContainer Foo(svl::Items<1, 2>::value);
  SfxItemSet Bar(rItemPool, svl::Items<1, 2>{});

now use:

  WhichRangesContainer Foo(svl::Items<1, 2>);
  SfxItemSet Bar(rItemPool, svl::Items<1, 2>);

Change-Id: I4681d952b6442732025e5a26768098878907a238
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119157
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-07-19 16:33:01 +02:00
Samuel Mehrbrodt 9a55b97e98 tdf#40068 Remember last directory for basic/dialog import/export
Change-Id: I9dee98a2018beb0b8d5a0e57b66dbd9d5390c71c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118883
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2021-07-14 16:29:54 +02:00
Samuel Mehrbrodt d157c1bd70 tdf#126665 Remember last used file picker directory
This introduces internal tracking of last used directories.
Each caller of the file picker can pass a "context". The selected
directory will then be saved & restored when opening the file picker
with the same context again.

After ffa636ba74 , the Windows file picker
no longer tracks the last used directory itself.
This is a replacement and an improvement at the same time, since there is not
one global last used directory, but one per context.

Change-Id: I10650cfb9359922690954fa65c89b4e47477e2c5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118597
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2021-07-12 14:31:20 +02:00
Caolán McNamara a8f97e5fca bundle the FolderPicker instantiations behind a single call
in prep to add parent support

Change-Id: I2aa4b9343f895ae866f600dd3260b7fdc4e1efec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117579
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-06-21 15:29:59 +02:00
Armin Le Grand (Allotropia) 04cd674917 tdf#130428 remove unnecessary usage of SfxItemState::UNKNOWN
Rename ::StateChanged methods using SfxItemState to allow
better analysis of SfxItemState/SfxPoolItem usage(s),
discussion see tdf#130428 comment 30

Change-Id: I736be0160ad7a9b7882c1c8a4cc05d9396ee3305
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117366
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2021-06-18 11:10:56 +02:00
Noel Grandin 0771ac00ac use string_view in the Translate API
Change-Id: I0bb0ea9d39ed623928060ffd3f2e2bc36ba33209
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117272
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-06-17 14:32:11 +02:00
Noel Grandin c83615f8c6 no need to check IsDisposed here
the call site does that

Change-Id: I8373eb4a6b87e96b211dd6bacea051d43b7ae8b4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116178
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-29 19:24:09 +02:00
Andreas Heinisch 46e924ac80 tdf#139196 - Import/export macros using utf-8 including BOM
Moved import logic to a local function, and during the import of a *.bas
file, check if it starts with BOM in order to detect the correct
charset. If there is no BOM, use the default charset of the system, since
after the change in 178adcd845, all the
newly created *.bas files have a BOM and are written using the utf-8
charset.

Change-Id: Iefdecb5762d896ce3e52fd6d212de42cf417ddac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116186
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Jenkins
2021-05-27 09:36:07 +02:00
Andreas Heinisch 178adcd845 tdf#139196 - Import/export macros using utf-8 including BOM
In addition, try to detect the charset during the import of a *.bas
file.

Change-Id: I0dfe7f1b5349db409d90ed92b2e19c9946ae50cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116004
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-05-25 22:20:10 +02:00
Caolán McNamara 9940f077fd add Toggleable as a separate thing to a Button
and inherit ToggleButton from both it and Button

Change-Id: If0e500aca8d0ffa087cb5e2bfc1786372fbff4eb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115921
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-05-21 18:19:58 +02:00
Noel Grandin 9090dc1f3b split OutputDevice from Window
as part of a longer-term goal of doing our
widget rendering only inside a top-level render-
context.

I moved all of the OutputDevice-related code that existed in vcl::Window
into a new subclass of OutputDevice called WindowOutputDevice.

Notes for further work

(*) not sure why we are getting an 1x1 surface in
    SvpSalGraphics::releaseCairoContext, but to fix it I clamp
    the size there

(*) might have to dump VCLXDevice, and move it's code down into VCLXWindow and VCLXVirtualDevice

(*) can we remove use of VCLXDevice in other places, in favour of just talking to the VCL code?

Change-Id: I105946377f5322677d6f7d0c1c23847178a720b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113204
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-17 12:56:51 +02:00
Julien Nabet 6aca0107c2 Directly initialize vectors in baside2b.cxx
since we've got all the information from the beginning.

Change-Id: I58dff3fea715af09f3027d92c0504c3e27015f1c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115584
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-05-14 20:41:33 +02:00
Noel Grandin 32b09faca5 Revert "simplify the vcl<->toolkit connection"
because it introduces a link-time dependency of vcl on toolkit,
and toolkit already depends on vcl

This reverts commit f7a86c5cdf.

Change-Id: Ibdd4f3e8221d70e2abd8fcbda67f85af3ac0396e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115547
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-13 14:48:24 +02:00
Noel Grandin f7a86c5cdf simplify the vcl<->toolkit connection
No need to store two different pointers and hide the
underlying class behind an UNO interface

Change-Id: I72c55e912caa9eae1cffa6c9d1b1d480e5668d40
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115496
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-12 19:57:24 +02:00
Tomaž Vajngerl eb6819e74a change usage of boost::hash_combine to o3tl::hash_combine
Change-Id: I840518a36ac43d36c95f38e09c7bfcfe1a25a525
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114984
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-05-11 12:28:24 +02:00
Noel Grandin c5a0b7af84 loplugin:stringadd improvement for appending numbers
I was wrong, the Concat framework already optimised appending
numbers by stack-allocating small buffers, so include
them in the plugin

Change-Id: I922edbdde273c89abfe21d51c5d25dc01c97db25
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115037
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-03 15:32:53 +02:00
Stephan Bergmann 10d29c390d throw() -> noexcept, part 2/3: Automatic loplugin:noexcept rewrite
Change-Id: I076f16d0536b534abf0ced4d76051eadb4c0e033
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114949
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-05-02 17:02:28 +02:00
Noel Grandin 39c3574b79 use string_view in INetURLObject::encode
Change-Id: Ib686c6872388b02c8939d3b65f6bd25cda348bc8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114754
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-28 15:41:02 +02:00
Noel Grandin c7c6f0af6c loplugin:stringadd convert chained append to +
which can use the more efficient *StringConcat

Also fix a crash in stringview plugin which
started happening while I working on this.

Change-Id: I91a5b9b7707d1594d27d80b73930f5afac8ae608
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114568
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-27 14:07:56 +02:00
Noel Grandin 75997f13ee no need to create temporaries when appending number to O[U]StringBuffer
Change-Id: I36d82423b5f75010552696a66cec7e53ee265ce4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114395
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-22 21:42:14 +02:00
Caolán McNamara 2577a6be55 forward decl vcl::Window in toolkit/awt/vclxwindow.hxx
Change-Id: I488f994fc890cacd20a6fdc224a098fe0caf3070
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113960
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-04-12 09:49:17 +02:00
Caolán McNamara 9b65457736 remove vcl/waitobj.hxx
create vcl/locktoplevels.hxx for the utility to set all
toplevel windows modally locked

Change-Id: I964484d238852e830e1e5c0b86b3bebb3b41a6b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113889
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-04-09 21:17:03 +02:00
Gabor Kelemen 2633d5f97f Recheck include/ with IWYU
See tdf#42949 for motivation

Change-Id: Ifc253bf800bb1468b5774663a93f4fb30bec81d3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113657
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-04-09 11:56:36 +02:00
Caolán McNamara 200626e41f remove need for an intermediate vcl::Window
Change-Id: I59f24888e47ec17e46bf651d8530fc9468f16f62
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113795
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-04-09 10:07:13 +02:00
Caolán McNamara d56dbdf3cc drop stale TODOs
Change-Id: Ia5d9666cf2b2a5f5227e727533a046ebcafbd72b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113629
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-04-06 15:11:50 +02:00
Mike Kaganski 86d298f87f Simplify some static variable initializations
Change-Id: I6cdd44aa66b9597ccc51fc3fd69b57485ccb3230
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113515
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-04-02 17:22:21 +02:00
Ahmet Hakan Çelik 0726ecd9e2 tdf#114441: Convert use of sal_uLong to better integer types
Change-Id: I173d57105429e2bdf2288678fa7911b8541a402b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112154
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-03-16 11:45:04 +01:00
Noel Grandin c880d3e304 check for quit when calling Yield in loop
so we don't get stuck threads when the main application
quits

Change-Id: Id36e99267ceb4154873b6ef8ef494622fff6c19a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112409
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2021-03-14 08:20:53 +01:00
Noel 1692998399 use strong_int for item ids in vcl::ToolBox
(*) fix bug in SfxToolBoxControl::StateChanged where it was using the slot id
    instead of the toolbox item id
(*) I left the logic in SbaTableQueryBrowser alone, but it looks suspicious,
    casting slot ids to toolbox ids

Change-Id: Ied229164c27fb4456b0515c6fdcbd1682766a1a9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112186
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-11 14:10:30 +01:00
Mike Kaganski fbaf865ffc Drop "32" from names of SbxArray methods taking 32-bit indices
... a leftover from times when there were methods for 16-bit
as well as for 32-bit indices. 16-bit indices were removed in
commit 62f3f3d92a.

Change-Id: Idf8b1160e68e8b303cf75ea79dd7dbb3bd00275d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112187
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-03-09 13:22:18 +01:00
Arnaud Versini 486258be79 BASIC : simplify BaseWindow initialization.
Change-Id: If12b32fa7cf19341a2de1a4c0efb156075ff6ec5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112122
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-08 08:20:29 +01:00
Noel 1d2773807f ref-count SdrPage
which simplifies ownership handling, particularly with regard to
undo/redo

Change-Id: Ie8f300ebfdae6db3c06f78a87e35a07497d6b825
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111991
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-07 13:24:51 +01:00
Caolán McNamara a5dbc997bf drop archaic rollable support
Change-Id: I69f94cd8013a31f8f6bcf62d703b99f659a1ebb4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111555
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-02-25 21:13:49 +01:00
Caolán McNamara f1512bb979 drop WB_ROLLABLE
as far as I can see Rollable isn't a thing anymore

Change-Id: I274e9dc88c793a5833e26bce292b4e92617ae084
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111554
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-02-25 21:13:20 +01:00
Noel 73cfa4945d loplugin:refcounting in basctl
Change-Id: I22ddaee2b97af75c710df78542c27dca0730d0bb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111352
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-23 07:31:06 +01:00
Caolán McNamara 20997b4598 factor out as a ResizableDockingWindow
Change-Id: I557ccf866cc879b3cc22fcdbca882f4413cb57d3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111334
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-02-22 15:14:04 +01:00
Caolán McNamara 40f81f1f9e move dockingwindow.ui to vcl
Change-Id: I90f18ba755da8ade247330ed102ffcc95740ebab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111265
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-02-22 15:13:41 +01:00
Caolán McNamara 7752bbe121 foward declare NotebookBarAddonsItem instead of using include
Change-Id: I57e5a8f28a40994b61ab0f554401e4f70c8ffc12
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111230
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-02-19 18:11:36 +01:00
Noel 7874cba970 loplugin:referencecasting in basctl..binaryurp
Change-Id: I3fbc287cf76e453e2c464837d2431ff19501fde3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110968
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-16 08:57:02 +01:00
Noel 09cb778b6e clean up SdrObject cloning
using operator= implies that overwriting an SdrObject is a
useful operation, but that is not at all true - they are typically
linked into and referred to by many other things.

So rather use a copy-constructor.

Also clean up a couple of weird "do some stuff after the clone"
code into the main copy constructor.

Change-Id: Iefc1481b527602748b5f3abed06e7cca66c0581c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110633
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-10 07:35:41 +01:00
Noel Grandin 1aa31294b2 avoid some ref-counting
can just return a pointer here, instead of VclPtr.

Change-Id: I9ab8962cbbe84ed4dfcfd658a6d758112914cb89
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109923
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-25 20:21:48 +01:00
Caolán McNamara 7357210723 Resolves: tdf#133345 Macros Editor IDE: no dialogbox tabs
Revert "property browser appearing as a blank area when changing modules"

This reverts commit a07f0a5737.

I no longer see a stray property browser area with this reverted anyway.

Change-Id: Icbf7c59f582172a9baef9e512c7ddbf7fba0ff85
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109752
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-01-21 20:56:37 +01:00
Noel bca1b74c07 improve some IllegalArgumentException messages
Change-Id: Id88f2a82bf2651e8b5895aa330f32b71ff5b0e48
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109546
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-20 09:03:45 +01:00
csegura c0e9bda014 tdf#124176 Use pragma once instead of include guards in basctl
pragma once instead of include guards in textwindowpeer.hxx

Change-Id: Ie0be2626863dc6a570c2146cb86bb0f1c548e91a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108643
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2021-01-19 13:08:20 +01:00