Commit Graph

3165 Commits

Author SHA1 Message Date
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
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
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 f7a86c5cdf4323c99d26512bf78de7f7c380667d.

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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 62f3f3d92aa204eaaa063b30d7ade44df501b997.

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
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
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
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
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
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
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
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
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
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
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
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
7357210723 Resolves: tdf#133345 Macros Editor IDE: no dialogbox tabs
Revert "property browser appearing as a blank area when changing modules"

This reverts commit a07f0a57378a8901d647e3e5de8347445a82ea17.

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
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
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
3fff050a34 loplugin:stringliteralvar (clang-cl)
Change-Id: I79949789634242eb95cc722bab83e0348775f274
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109174
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-01-13 07:36:36 +01:00
117ecc9870 fix coverity parse errors
Change-Id: I4884bfb67a061b865e8cf38b2fea6de0cb1bc3d6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109057
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-01-10 21:01:05 +01:00
ac396f2f6b fix coverity parse errors
Change-Id: I3a1179947704452e3ffec02be59d0f7bf0b75ab0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109017
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-01-09 13:01:49 +01:00
cb234d3103 BASCTL : remove useless impl pattern
Change-Id: Ib3a3bfe8677a6eec56f6f1d799fd484f65ab6b73
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108568
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-05 17:44:56 +01:00
c34e8bd713 loplugin:stringviewparam: operator +=
Change-Id: I30ce1b5bd8fb168da7067c1967c5af2569df2653
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108512
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-01-04 15:29:54 +01:00
042033f1e6 loplugin:stringviewparam: operator +
Change-Id: I044dd21b63d7eb03224675584fa143009c6b6008
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108418
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-29 16:42:33 +01:00
a3d0091d18 New loplugin:stringliteralvar
See the comment at the top of compilerplugins/clang/stringliteralvar.cxx for
details.

(Turned some affected variables in included files into inline variables, to
avoid GCC warnings about unused variables.)

Change-Id: Ie77219e6adfdaaceaa8b4e590b08971f2f04c83a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108239
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-26 14:51:15 +01:00
46c5de8328 make *String(string_view) constructors explicit
to make it more obvious when we are constructing heap OUStrings
code and potentially inadvertently throwing away performance.

And fix a handful of places so revealed.

Change-Id: I0cf390f78026f8a670aaab53424cd31510633051
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107923
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-19 17:53:06 +01:00
f3c63fc602 weld basctl popup menus
Change-Id: I28b18df7a27cd65e81f9e2e6f1ab96b5f1938e6f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107975
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-18 21:58:37 +01:00
25214daa34 don't need to include vcl/menu.hxx here
Change-Id: I16c4c2fd84ea8af6b7601e49c38630bbbfdb2cb6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107746
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-15 13:41:42 +01:00
35e471bb4d Adapt the remaining OUString functions to std string_view
...for LIBO_INTERNAL_ONLY.  These had been missed by
1b43cceaea2084a0489db68cd0113508f34b6643 "Make many OUString functions take
std::u16string_view parameters" because they did not match the multi-overload
pattern that was addressed there, but they nevertheless benefit from being
changed just as well (witness e.g. the various resulting changes from copy() to
subView()).

This showed a conversion from OStringChar to std::string_view to be missing
(while the corresponding conversion form OUStringChar to std::u16string_view was
already present).

The improvement to loplugin:stringadd became necessary to fix

> [CPT] compilerplugins/clang/test/stringadd.cxx
> error: 'error' diagnostics expected but not seen:
>   File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 43 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:42): simplify by merging with the preceding assignment [loplugin:stringadd]
>   File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 61 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:60): simplify by merging with the preceding assignment [loplugin:stringadd]
> 2 errors generated.

Change-Id: Ie40de0616a66e60e289c1af0ca60aed6f9ecc279
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107602
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-11 21:25:10 +01:00
bb06f51308 loplugin:stringviewparam extend to comparison operators
which means that some call sites have to change to use
unicode string literals i.e. u"foo" instead of "foo"

Change-Id: Ie51c3adf56d343dd1d1710777f9d2a43ee66221c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106125
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-24 09:45:04 +01:00
78091a860a remove non-functional resize grip at right of basic ide tabbar
left behind after....

commit 867af25bd8d36c7e5ef6f16c2876ac82e63648cc
Date:   Fri Jan 22 12:04:05 2016 +0100

    tdf#96683 Move tabs in Basic IDE to an own row

before that it could be used to assign sizes to the tabbar vs
scrollbar when they were on the same line. Now that they are on
different lines it shouldn't be there.

See tdf#87684 for the similar calc case where
Office::Calc::Layout::Other::TabbarInlineWithScrollbar exists to
re-enable this feature for calc.

Change-Id: I6430e13ab79f4c424ae35f7b8e3ad7bd47ec201b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106275
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-11-21 21:20:32 +01:00
6da61d5fa7 tdf#123936 Formatting files in module basctl with clang-format
Change-Id: I428d5642a19588456ff4af09e2f9f39ae17b2e4d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105644
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2020-11-13 15:11:13 +01:00
f34ac579fa New loplugin:stringviewparam
...to "Find functions that take rtl::O[U]String parameters that can be
generalized to take std::[u16]string_view instead."  (Which in turn can avoid
costly O[U]String constructions, see e.g. loplugin:stringview and subView.)

Some of those functions' call sites, passing plain char string literals, needed
to be adapted when converting them.

Change-Id: I644ab546d7a0ce9e470ab9b3196e3e60d1e812bc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105622
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-11-12 16:53:30 +01:00
c45753847d Revert "remove Fraction::operator tools::Long()"
This reverts commit 48b667a7e7d25f835f95df89162a7849d6972531.

Reason for revert: some discussion required

Change-Id: Ia0990d280837fb68b7ddc9f472ec78b1467b4311
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105540
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-12 16:53:22 +01:00