Commit Graph

3102 Commits

Author SHA1 Message Date
33ecd0d5c4 Change OUStringLiteral from char[] to char16_t[]
This is a prerequisite for making conversion from OUStringLiteral to OUString
more efficient at least for C++20 (by replacing its internals with a constexpr-
generated sal_uString-compatible layout with a SAL_STRING_STATIC_FLAG refCount,
conditionally for C++20 for now).

For a configure-wise bare-bones build on Linux, size reported by `du -bs
instdir` grew by 118792 bytes from 1155636636 to 1155755428.

In most places just a u"..." string literal prefix had to be added.  In some
places

  char const a[] = "...";

variables have been changed to char16_t, and a few places required even further
changes to code (which prompted the addition of include/o3tl/string_view.hxx
helper function o3tl::equalsIgnoreAsciiCase and the additional
OUString::createFromAscii overload).

For all uses of macros expanding to string literals, the relevant uses have been
rewritten as

  u"" MACRO

instead of changing the macro definitions.  It should be possible to change at
least some of those macro definitions (and drop the u"" from their call sites)
in follow-up commits.

Change-Id: Iec4ef1a057d412d22443312d40c6a8a290dc6144
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101483
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-28 08:07:09 +02:00
fce9d818e7 add a DisableCycleFocusOut flag for an all-welded hierarchy
so we can differentiate the case of embedded welded widgets co-sharing the
tab-cycle sequence with vcl widgets vs the case its all welded widgets

Change-Id: I5c57b4e98d2f5c543522a72e31d554a67c259307
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101485
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-08-27 20:13:42 +02:00
d762aa9804 Fix a nonsense change
... from commit 9ad4eeb4fa413b1a3e084d141c6eb01795f95b7f.

Change-Id: Ib8ed2fd638b393180860c549f432651f34878f5c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101452
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-08-27 14:24:32 +02:00
660e82ee8c move TextWindowPeer to its only user
Change-Id: I16cc2f75c3e639915c90edc626829e455bda4383
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100889
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-08-18 12:40:51 +02:00
e67657d521 loplugin:simplifybool more
look for expressions like
    !(a && !b)
which can be expanded out

Change-Id: I72515a9638762b050f9a258c08da39ebfa2ef8e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100579
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-14 18:03:06 +02:00
3457da6abe loplugin:stringstatic also look for local statics
Add some API to O*StringLiteral, to make it easier
to use in some places that were using O*String

Change-Id: I1fb93bd47ac2065c9220d509aad3f4320326d99e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100270
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-13 08:16:03 +02:00
b71815a8d4 tdf#135639: check the return value of GetDim32
... to avoid crash accessing non-existing element of pChildItem->vIndices

Change-Id: I248a9301abd69883f940051d9d9671298dcc8453
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100540
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-08-11 21:37:04 +02:00
ba6ab05a2a tdf#134604 library created in the wrong tree
Change-Id: Iee526422a18aef8ef25289041b26ff1e4a6b39b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100494
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-08-11 16:36:44 +02:00
5d47604c0a use std::string_view
Change-Id: Iac8367a1ea3ec603b5db8b3dd8bdc7dd7265eb83
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100377
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-08 12:58:29 +02:00
2446fdba3e tdf#134887 Rework last item handling in NewToolbarController
Just store the last used menu id, and consistently get all the
information (command name, image id, target frame etc.) from the menu
instance. Also implement the XSubToolbarController interface, so we get
a chance to update the image on icon size or theme change.

The initial action and icon of the button are based on the url passed
by the .uno:AddDirect status update, given that there is a corresponding
menu item. The only defined fallback now is to .uno:AddDirect itself for
both executing and getting the icon, but this shouldn't happen normally,
as I fixed all the affected cases I found so far, namely Base (including
windows like table design etc.) and the Basic IDE.

Actually these cases were partially broken anyway, and as a result now
completely fixed:

- In Base main app window, the button used to default to a new Writer
document, although its tooltip advertises Ctrl+N as the kb shortcut, and
pressing that shortcut actually opens the database creation wizard (as
expected).

- In the Basic IDE, the button was working, but not the Ctrl+N shortcut.

Change-Id: I6537b3f38e7d7001ec1b39d78285445464fd8cbe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99514
Tested-by: Jenkins
Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
2020-07-28 00:44:46 +02:00
9d548868c6 move getUIRootDir to AllSettings
Change-Id: I3b7774a043a2c99531e1c76b531df4358699bba7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99440
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-07-25 17:23:48 +02:00
84522fc879 merge duplicate GetFocus implementations
Change-Id: Ifc2e3fab6dacb3b0bca74c0584c16170b8b97de4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99234
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-07-22 20:48:24 +02:00
d299dc4540 Resolves: tdf#134551 ModulWindow deleted when last module removed
leaving a dangling reference to m_aName. Hold a reference until
ExecuteCommand is finished.

Change-Id: I82ac5cc73427a945c78b9317dee9edf6129bb975
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98214
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-07-06 20:46:32 +02:00
a2d844ca71 basctl: create instances with uno constructors
See tdf#74608 for motivation

Change-Id: Ibada6b9b7e6c754487c90ce1a37c17019db55370
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97932
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-05 10:20:16 +02:00
14b8c17613 tdf#127680 Add the option to print even or odd values from a particular range
Added a box besides the pages option that lets the user choose between left and right pages/left pages/right pages.

Change-Id: Iee0386f4f3cfd2dac3fcf898a3fefb5434cb27a8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96612
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-07-02 12:12:02 +02:00
81bfb3c727 Upcoming improved loplugin:staticanonymous -> redundantstatic: basctl
Change-Id: I316331cee15bbb87ecfbda84f3195759e521df6a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97520
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-06-30 18:30:02 +02:00
50c40b5c41 Upcoming improved loplugin:elidestringvar: basctl
Change-Id: I3b570313cd04c3af92e1e30ec4539de34398104f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97192
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-06-26 10:44:12 +02:00
a2fc883173 use more std::container::insert instead of std::copy
which is both more compact code, and more efficient, since the insert
method can do smarter resizing

Change-Id: I17f226660f87cdf002edccc29b4af8fd59a25f91
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96948
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-06-24 08:43:55 +02:00
573138efec distinguish active dnd-operation case from simple query case
Change-Id: I1d8e95e46b45c71c0c83316ab4f19ba85eddcf75
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96598
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-06-18 16:05:42 +02:00
cd384e2d31 rework treeview initial toggle button col to be like expander col
cause this assumption is baked into the vcl one making it hard
to adapt remaining cases

Change-Id: I75dd5264c65b1ffbf4d26c9a86f6d4d08b400d90
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95622
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-06-08 20:21:35 +02:00
68db2d42c1 have just one way to set expander image
Change-Id: Ic07709a864620c6146616c8e0a1417343c0937de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95590
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-06-05 20:33:28 +02:00
e1958c3460 drop unused inline method
Change-Id: Ie0a861106341f8a838b19eff405a99c6f234e93f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95500
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-06-04 17:17:52 +02:00
1c5d8e0e77 Upcoming loplugin:elidestringvar: basctl
Change-Id: Ia0411cad22c23f16d5d85b7cb65822d19f923b4f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95373
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-06-03 09:18:09 +02:00
e84d05483c Make loplugin:simplifypointertobool handle parenthesized expressions
...as discussed as an open TODO in the commit message of
fe6cce01c88d045a1fcf09acf049c34c22299b02 "Fix loplugin:simplifypointertobool for
libstdc++ std::shared_ptr".  The necessary changes across the code base have
been done fully automatically with the rewriting plugin on Linux.  (All those
changes apparently involve uses of macro arguments wrapped in parentheses in the
macro body, but always in conditionally-converted-to-bool contexts.  In other
contexts, such automatic rewriting would add the "bool" to the macro body, which
would be wrong in general, but we apparently get away with that sloppy coding
for now.)

The parenExprs_ stack that fe6cce01c88d045a1fcf09acf049c34c22299b02 had
introduced to treat such (then-undetected, it had turned out) parenthesized
cases now turns out to not be needed after all.

Change-Id: I2021f61c2e2805be7e18b38edf8744d186cac3cb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95010
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-05-28 09:48:09 +02:00
5f19287a9c loplugin:simplifybool in accessibility..basic
Change-Id: Ibf6cef4baa2d3d400d953ac8bc97a66b5901def9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94972
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-28 09:05:11 +02:00
3cf6d908c2 nospin hack no longer in use
Change-Id: Ib855c429ac936f9b7bb219ad4729f99b0625ec37
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94734
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-05-23 22:43:49 +02:00
1668d38a14 uitest: add wrapper for macro editor
Change-Id: I729c5cdbc3ba925a0c08750eba199a400babba1e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94445
Tested-by: Jenkins
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2020-05-23 10:02:59 +02:00
78b7e1dfba move InterimItemWindow to vcl
Change-Id: If0a4a14708810c44d087b51961f2ecb3fda4df23
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94649
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-05-22 13:27:41 +02:00
1f209723cb Resolves: tdf#114258 defer LoseFocus treeview update
until the next event cycle in cas the LoseFocus is happening due to an
in-progress selection event from a  mouse down in the treeview that would be
updated

Change-Id: Ia4448aa798a8af7cd35bc17215891f6c5ca8678a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94494
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-05-19 13:57:16 +02:00
8209c2569f tdf#88205 EasyHack change css::uno::Sequence initializations
1st commit. Use initializer lists for uno::Sequence in 4 files

Change-Id: I0192b4b8f023fb8d606dff81c4b910c8c7c2a9a2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93900
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Tested-by: Jenkins
2020-05-19 09:40:05 +02:00
898cbb22f0 use for-range on Sequence in basctl..canvas
Change-Id: Idad3d8fbe785c7b1b8b287a3227372adb2757de8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94260
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-15 14:00:48 +02:00
943fbfad66 expand out some namespace aliases
Change-Id: I5fdb554a1b116824843f35645bc1cea3ca91e0f2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94093
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-13 15:47:06 +02:00
366d08f2f6 new loplugin:simplifypointertobool
Change-Id: Iff68e8f379614a6ab6a6e0d1bad18e70bc76d76a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91907
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-10 12:02:44 +02:00
3eed231541 compact namespace in avmedia..bridges
Change-Id: Iba1282caadab91a0c6e1c044dbab5e6e15f3707b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93705
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-08 12:16:54 +02:00
305dab19f8 Use pragma once instead of include guards
Change-Id: Ife31f595e7b704903f65eb8ba327da12a8fcf4d0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92786
Tested-by: Jenkins
Reviewed-by: Yusuf Keten <ketenyusuf@gmail.com>
Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
2020-05-04 12:33:08 +02:00
b512ce255f Make upcasting css::uno::Reference ctor require complete types
The main reason for the "home-grown" UpCast introduced with
904b3d1fceee5827076758ed2a81f80cb73493ca "Up-cast conversion constructor for
css::uno::Reference" in 2013 was probably that we could not yet rely on C++11
std::is_base_of back then.  A (welcome) side effect was that the derived class
could be incomplete.

However, specializations of UpCast relying on whether or not T2 is incomplete
are obviously an ODR violation if the type is incomplete in some TUs and
complete (and derived from T1) in others.  And even if UpCast had internal
linkage, it would still be brittle that its behavior depends on the completeness
of T2 at the point of the template's instantiation, and not necessarily at the
point of use.

That means we should better base that ctor on std::is_base_of (which we can do
now since 39a1edd6fec902ef378acce8af42c4d7fba280d0 "Make css::uno::Reference
upcast ctor LIBO_INTERNAL_ONLY"), which causes a compilation error at least on
Clang and GCC if the completeness requirements are not met.  This change fixes
all the cases where types need to be complete now, plus any resulting
loplugin:referencecasting warnings ("the source reference is already a subtype
of the destination reference").

Change-Id: Ieb9e3552e90adbf2c5a5af933dcb872e20661a2f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92950
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-04-27 07:19:30 +02:00
61391c43f5 all ItemWindows are now welded
where native widgetery is hostable in a vcl toolbar or a native one

Change-Id: I942ada335bb4bd6ced0f3352f632e25787f68597
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88598
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-04-26 15:33:47 +02:00
a9ea920dfb move InterimItemWindow to svtools
Change-Id: I058b1d96a3ddfaa1aa96f66d0ebc6fa68900a48c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92697
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-04-22 18:27:24 +02:00
e12fa18c69 tdf#42949 Simplify use of rtl::math::approxEqual in include/basegfx/
Turns out we can save about 500Mb of preprocessor input if we use
rtl_math_approxEqual from rtl/math.h instead of its C++ wrapper
rtl::math::approxEqual from rtl/math.hxx

and manage the fallout accordingly.

Before:
bin/includebloat.awk | head
sum total bytes included (excluding system headers): 19017296671

After:
$ bin/includebloat.awk | head
sum total bytes included (excluding system headers): 18535432672

Change-Id: I1691171f3a309405a7099882ad9989d147f59118
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92508
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-04-22 15:36:50 +02:00
cd0ab2cf50 loplugin:flatten in basctl
Change-Id: I66e3f46fcaae4e15d230a5a7c98c1b20cfb4dbda
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92485
Tested-by: Jenkins
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-18 21:48:16 +02:00
cac8694fea tdf#126828 hide macro organize dialog before launching macro editing
so the macro editor isn't forced behind the window with an active dialog

Change-Id: Iae89f6910a8183bcf01872eef71c04bc993f1550
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92307
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-04-15 20:13:48 +02:00
e58edeb2aa set cursor after thawed
Change-Id: I3e9ebee84c8a65b7231b0947e1044445b656780c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92282
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-04-15 17:58:46 +02:00
be53f32655 rename vcl::Window::Update to PaintImmediately
To make the code easier to read.

Change-Id: Iebc648150391939fba5d1cd815c72dbcf02ceec6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90378
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-11 17:56:01 +02:00
80948ae6a2 OSL_ASSERT->assert in basctl
and simplify the surrounding code, assuming the asserts to hold

Change-Id: I9152402f267c17a39f4af275a0de79e9529375c6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91331
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-29 19:38:19 +02:00
fd1cd55222 tdf#124176: Use pragma once instead of include guards
Change-Id: Ia4a6b35a9a734e9fa1dc9dea702fc1ec370021f2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90901
Tested-by: Jenkins
Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
2020-03-23 12:35:57 +01:00
a7de363cea remove unnecessary Window::Update() calls, which immediately follow Invalidate
Update() is effectively "paint immediately". Rather just let the
invalidate do it's thing and have the widget paint on the next paint
loop, along with the rest of the stuff.

This is probably mostly cargo-cult, from the days when our
invalidate/paint timer could take a long time to kick in.

Change-Id: Idff06526e9a2892244cfd8ce6947916032b0d1a9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90567
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2020-03-16 19:09:02 +01:00
3e0c5113a2 tdf#114441: Convert use of sal_uLong to better integer types
Change-Id: I484cc39ebde5bfefa8ea26f3e6351ef12e303f1a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89755
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-03-04 11:21:28 +01:00
32d08f86d2 tdf#124176: Use pragma once instead of include guards
Change-Id: I548c21fab001217095e7ad603f42e4495d19505d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89729
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-02-29 11:07:05 +01:00
9f6be5d9ce explicitly call ActivatePageHdl when programatically calling set_current_page
Change-Id: I6113e51565cf4f89e77829f56e08f6b98f2fe244
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89462
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-02-26 09:51:34 +01:00
ca79c018f1 tdf#130925 use the maximum document line number for the width calculation
not the max line number in the range currently getting rendered

Change-Id: I447e4152ef6a1ec327a95a8260d1616940e5d6c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89467
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-02-26 09:51:11 +01:00