Commit Graph
13539 Commits
Author SHA1 Message Date
Noel Grandin 193207c5ab improve loplugin passparamsbyref
I think I managed to disable this when I converted it to
use the shared plugin infrastructure.

So fix that, and then make it much smarter to avoid various
false positives.

Change-Id: I0a4657cff3b40a00434924bf764d024dbfd7d5b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176646
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-19 07:46:25 +01:00
Eike Rathke 6acaa43376 Related: tdf#163903 Add French (Republic of Guinea) {fr-GN} [0x940C]
Change-Id: I2ebea83a757533088fc49a3c849e6b7890277d1e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176734
Tested-by: Jenkins
Reviewed-by: Eike Rathke <erack@redhat.com>
2024-11-18 22:45:45 +01:00
Caolán McNamara a025eef003 cid#1606638 silence Overflowed integer argument
and

cid#1608572 Overflowed integer argument
cid#1607772 Overflowed integer argument
cid#1607196 Overflowed integer argument
cid#1606568 Overflowed return value
cid#1607573 Overflowed return value

Change-Id: I9a701b19026572127399712c3b660094f2a0bd40
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176740
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-11-18 22:24:40 +01:00
Xisco Fauli 5621b4b488 tdf#163486: PVS: Expression can be simplified
Since
commit 8ab086b6cc
Author: Jens-Heiner Rechtien <hr@openoffice.org>
Date:   Mon Sep 18 16:07:07 2000 +0000

    initial import

V1065 	Expression can be simplified, check 'nRowCount' and similar operands.

Change-Id: Icd9cdd82cb083e2b40498a21de44a814169977ef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176524
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-11-13 12:50:43 +01:00
Oromidayo Owolabi 7a7ba9cbee tdf#145614 Convert #define to enum class
Converted #define to enum class

Change-Id: I16195a439643bcf0111c591a829272b5bf70179d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175027
Reviewed-by: Hossein   <hossein@libreoffice.org>
Tested-by: Jenkins
2024-11-12 15:27:34 +01:00
Noel Grandin 65d52af42f clang-tidy: performance-unnecessary-copy-initialization in svx
Change-Id: I80bdcae1db64f7693600178d86c122c5875369b2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176440
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-12 08:41:41 +01:00
Mike Kaganski 1180b3473a com::sun::star -> css
Change-Id: I890ec73e30d3cc6b210903ecee29431f3cb5f635
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175979
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-11-10 10:50:15 +01:00
Noel Grandin ed0b12f4ea no need to take a copy of the getProcessComponentContext return value
we can just take a "const &".

(found by running clang-tidy with the
performance-unnecessary-copy-initialization warning)

Change-Id: I20fd208c65303da78170b1ac06c638fdf3aa094b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176267
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2024-11-08 15:23:52 +01:00
Patrick Luby 1e99b33b9a Revert commit 2fe53b2e43
Commit 709b1f3ddb fixes the
root cause of the crash during a dynamic_cast so revert
commit 709b1f3ddb as it was
merely a workaround and is no longer needed.

Change-Id: Ia052913eba7fd4d979054ea6a644f4ff9791277c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176217
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-08 10:16:43 +01:00
Noel Grandin 8d5d06da8d loplugin:passstuffbyref in svtools
Change-Id: I4e3d7d5fb6be857efc8327eb5113f874169bf778
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176155
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-07 06:58:12 +01:00
Sahil Gautam 4bdb421440 Libreoffice Theme Part 1.0: Make registry colors accessible from VCL
Enable UI color customization via an extension. This patch doesn't
include any UI changes as that needs to be discussed with the community
first (ticket: https://bugs.documentfoundation.org/show_bug.cgi?id=163620)

Part 1.0 (this change) is responsible for loading all the ThemeColors
from the registry into a `static ThemeColors` object, which then is
accessed in various VCL_PLUGINS as a source for the application colors.

The user now has to go to the registry (expert configuration), and
enable the theme by setting "LibreofficeTheme" to "true". It can also be
enabled via an extension (demonstrated in the Theme Template).

`testGetViewRenderState` changes to  "Dark" scheme which is  not present.
Changes in  this patch don't allow  that and use 'Automatic' as the
fallback. This caused the unit test to fail. So the test was changed to
have "Dark" scheme before changing to it.

Theme Template: https://github.com/printfdebugging/libreoffice-theme-template
Project Report: https://printfdebugging.in/libreoffice/01-themes-gsoc-2024/

Change-Id: I5193d4d34fcd2f4c5d6f124a871bd5c7f14e95a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168016
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2024-11-06 20:49:31 +01:00
Caolán McNamara 92f5913aef cid#1556442 COPY_INSTEAD_OF_MOVE
and

cid#1607753 COPY_INSTEAD_OF_MOVE
cid#1554790 COPY_INSTEAD_OF_MOVE
cid#1556463 COPY_INSTEAD_OF_MOVE
cid#1554838 COPY_INSTEAD_OF_MOVE
cid#1556231 COPY_INSTEAD_OF_MOVE
cid#1556878 COPY_INSTEAD_OF_MOVE
cid#1554913 COPY_INSTEAD_OF_MOVE
cid#1558064 COPY_INSTEAD_OF_MOVE
cid#1557043 COPY_INSTEAD_OF_MOVE
cid#1556985 COPY_INSTEAD_OF_MOVE
cid#1556766 COPY_INSTEAD_OF_MOVE
cid#1557351 COPY_INSTEAD_OF_MOVE
cid#1554863 COPY_INSTEAD_OF_MOVE
cid#1556764 COPY_INSTEAD_OF_MOVE
cid#1556279 COPY_INSTEAD_OF_MOVE
cid#1555970 COPY_INSTEAD_OF_MOVE
cid#1556942 COPY_INSTEAD_OF_MOVE
cid#1557964 COPY_INSTEAD_OF_MOVE
cid#1555166 COPY_INSTEAD_OF_MOVE
cid#1556496 COPY_INSTEAD_OF_MOVE
cid#1557175 COPY_INSTEAD_OF_MOVE
cid#1558054 COPY_INSTEAD_OF_MOVE
cid#1557392 COPY_INSTEAD_OF_MOVE
cid#1557850 COPY_INSTEAD_OF_MOVE
cid#1555118 COPY_INSTEAD_OF_MOVE
cid#1557131 COPY_INSTEAD_OF_MOVE
cid#1556614 COPY_INSTEAD_OF_MOVE
cid#1609650 COPY_INSTEAD_OF_MOVE
cid#1555114 COPY_INSTEAD_OF_MOVE
cid#1555241 COPY_INSTEAD_OF_MOVE
cid#1555442 COPY_INSTEAD_OF_MOVE
cid#1556473 COPY_INSTEAD_OF_MOVE
cid#1557654 COPY_INSTEAD_OF_MOVE
cid#1554689 COPY_INSTEAD_OF_MOVE
cid#1556316 COPY_INSTEAD_OF_MOVE
cid#1557929 COPY_INSTEAD_OF_MOVE
cid#1554807 COPY_INSTEAD_OF_MOVE
cid#1554858 COPY_INSTEAD_OF_MOVE
cid#1555103 COPY_INSTEAD_OF_MOVE
cid#1555517 COPY_INSTEAD_OF_MOVE
cid#1556424 COPY_INSTEAD_OF_MOVE
cid#1557252 COPY_INSTEAD_OF_MOVE
cid#1557566 COPY_INSTEAD_OF_MOVE
cid#1608020 COPY_INSTEAD_OF_MOVE
cid#1557742 COPY_INSTEAD_OF_MOVE
cid#1555884 COPY_INSTEAD_OF_MOVE
cid#1554809 COPY_INSTEAD_OF_MOVE
cid#1555336 COPY_INSTEAD_OF_MOVE
cid#1555173 COPY_INSTEAD_OF_MOVE
cid#1556067 COPY_INSTEAD_OF_MOVE
cid#1557040 COPY_INSTEAD_OF_MOVE
cid#1556235 COPY_INSTEAD_OF_MOVE
cid#1557366 COPY_INSTEAD_OF_MOVE
cid#1555910 COPY_INSTEAD_OF_MOVE
cid#1556716 COPY_INSTEAD_OF_MOVE
cid#1558022 COPY_INSTEAD_OF_MOVE
cid#1555769 COPY_INSTEAD_OF_MOVE
cid#1555940 COPY_INSTEAD_OF_MOVE
cid#1557077 COPY_INSTEAD_OF_MOVE
cid#1555270 COPY_INSTEAD_OF_MOVE
cid#1555660 COPY_INSTEAD_OF_MOVE
cid#1556302 COPY_INSTEAD_OF_MOVE
cid#1555678 COPY_INSTEAD_OF_MOVE
cid#1556538 COPY_INSTEAD_OF_MOVE
cid#1557689 COPY_INSTEAD_OF_MOVE
cid#1555009 COPY_INSTEAD_OF_MOVE
cid#1555433 COPY_INSTEAD_OF_MOVE
cid#1555671 COPY_INSTEAD_OF_MOVE
cid#1555255 COPY_INSTEAD_OF_MOVE
cid#1557681 COPY_INSTEAD_OF_MOVE
cid#1557512 COPY_INSTEAD_OF_MOVE
cid#1554958 COPY_INSTEAD_OF_MOVE
cid#1555758 COPY_INSTEAD_OF_MOVE
cid#1555597 COPY_INSTEAD_OF_MOVE
cid#1558040 COPY_INSTEAD_OF_MOVE
cid#1556476 COPY_INSTEAD_OF_MOVE
cid#1557646 COPY_INSTEAD_OF_MOVE
cid#1557950 COPY_INSTEAD_OF_MOVE
cid#1557019 COPY_INSTEAD_OF_MOVE
cid#1557885 COPY_INSTEAD_OF_MOVE
cid#1556402 COPY_INSTEAD_OF_MOVE
cid#1557906 COPY_INSTEAD_OF_MOVE
cid#1556619 COPY_INSTEAD_OF_MOVE
cid#1554683 COPY_INSTEAD_OF_MOVE
cid#1556549 COPY_INSTEAD_OF_MOVE
cid#1554747 COPY_INSTEAD_OF_MOVE
cid#1554929 COPY_INSTEAD_OF_MOVE
cid#1555362 COPY_INSTEAD_OF_MOVE
cid#1557053 COPY_INSTEAD_OF_MOVE
cid#1557891 COPY_INSTEAD_OF_MOVE
cid#1555043 COPY_INSTEAD_OF_MOVE
cid#1555107 COPY_INSTEAD_OF_MOVE
cid#1557203 COPY_INSTEAD_OF_MOVE
cid#1556728 COPY_INSTEAD_OF_MOVE
cid#1557773 COPY_INSTEAD_OF_MOVE
cid#1556845 COPY_INSTEAD_OF_MOVE

Change-Id: I001fb67e597b096e992fd8a0cd6f3ec577767c33
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176098
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2024-11-06 13:58:54 +01:00
Patrick Luby 2fe53b2e43 Fix crash due to unexpected dynamic_cast failures in optimized build
When an optimized build of this branch is compiled on Silicon Mac,
a dynamic_cast from com.sun.star.awt.XPopupMenu to VCLXPopupMenu
will fail.

The pointer being casted has not been deleted and is an undeleted
instance yet dynamic_cast fails. However, a dynamic_cast to
VCLXPopupMenu's superclass VCLXMenu succeeds so cast to that class
instead.

Change-Id: Ie9ab79df109eece46351545a71325d1e37bde94d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175992
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Patrick Luby <guibomacdev@gmail.com>
2024-11-05 09:42:12 +01:00
Mike Kaganski 9732a89b6b Drop GraphicFilter's bUseConfig
It controlled how the FilterConfigCache initialized, and also how
the unused aFilterPath was initialized. The FilterConfigCache is
reused, when there are other instances of GraphicFilter - so that
means, that the "bUseConfig" flag doesn't necessarily mean that
the initialization will happen as intended: the existing instance
could have been initialized using the other value.

Avoid this indeterministic behavior, and always use the config,
except in fuzzing. The VCL tests, that could possibly once depend
on that, now use config, so this is not an issue - and that means
testing the same thing as used in the working code, not something
different.

Change-Id: I6555dc47328b362e020138cf454f5ede7f39d063
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175894
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-11-01 09:54:03 +01:00
Caolán McNamara 8c200de995 cid#1606874 silence Data race condition
Change-Id: I6703ee228ac0717b04f58e14eedd02ab0722edf4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175861
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2024-10-31 14:23:00 +01:00
Mike Kaganski 61dea43909 Simplify a bit
Change-Id: I92f7d39e449610609f8740c83e221e28eb018d4b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175697
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2024-10-27 19:43:17 +01:00
Caolán McNamara 6f1508f4de cid#1555767 COPY_INSTEAD_OF_MOVE
and

cid#1555770 COPY_INSTEAD_OF_MOVE
cid#1555788 COPY_INSTEAD_OF_MOVE
cid#1555789 COPY_INSTEAD_OF_MOVE
cid#1555798 COPY_INSTEAD_OF_MOVE
cid#1555816 COPY_INSTEAD_OF_MOVE
cid#1555822 COPY_INSTEAD_OF_MOVE
cid#1555835 COPY_INSTEAD_OF_MOVE
cid#1555845 COPY_INSTEAD_OF_MOVE
cid#1555859 COPY_INSTEAD_OF_MOVE
cid#1555864 COPY_INSTEAD_OF_MOVE
cid#1555868 COPY_INSTEAD_OF_MOVE
cid#1555892 COPY_INSTEAD_OF_MOVE
cid#1555896 COPY_INSTEAD_OF_MOVE
cid#1555921 COPY_INSTEAD_OF_MOVE
cid#1555932 COPY_INSTEAD_OF_MOVE
cid#1555935 COPY_INSTEAD_OF_MOVE
cid#1555944 COPY_INSTEAD_OF_MOVE
cid#1555952 COPY_INSTEAD_OF_MOVE
cid#1555985 COPY_INSTEAD_OF_MOVE
cid#1556024 COPY_INSTEAD_OF_MOVE
cid#1556038 COPY_INSTEAD_OF_MOVE
cid#1556042 COPY_INSTEAD_OF_MOVE
cid#1556044 COPY_INSTEAD_OF_MOVE
cid#1556060 COPY_INSTEAD_OF_MOVE
cid#1556083 COPY_INSTEAD_OF_MOVE
cid#1556085 COPY_INSTEAD_OF_MOVE
cid#1556090 COPY_INSTEAD_OF_MOVE
cid#1556136 COPY_INSTEAD_OF_MOVE
cid#1556157 COPY_INSTEAD_OF_MOVE
cid#1556159 COPY_INSTEAD_OF_MOVE
cid#1556172 COPY_INSTEAD_OF_MOVE
cid#1556179 COPY_INSTEAD_OF_MOVE
cid#1556187 COPY_INSTEAD_OF_MOVE
cid#1556255 COPY_INSTEAD_OF_MOVE
cid#1556256 COPY_INSTEAD_OF_MOVE
cid#1556266 COPY_INSTEAD_OF_MOVE
cid#1556275 COPY_INSTEAD_OF_MOVE
cid#1556290 COPY_INSTEAD_OF_MOVE
cid#1556294 COPY_INSTEAD_OF_MOVE
cid#1556301 COPY_INSTEAD_OF_MOVE
cid#1556311 COPY_INSTEAD_OF_MOVE
cid#1556318 COPY_INSTEAD_OF_MOVE
cid#1556326 COPY_INSTEAD_OF_MOVE
cid#1556369 COPY_INSTEAD_OF_MOVE
cid#1556374 COPY_INSTEAD_OF_MOVE
cid#1556387 COPY_INSTEAD_OF_MOVE
cid#1556388 COPY_INSTEAD_OF_MOVE
cid#1556417 COPY_INSTEAD_OF_MOVE
cid#1556425 COPY_INSTEAD_OF_MOVE
cid#1556435 COPY_INSTEAD_OF_MOVE
cid#1556495 COPY_INSTEAD_OF_MOVE
cid#1556497 COPY_INSTEAD_OF_MOVE
cid#1556501 COPY_INSTEAD_OF_MOVE
cid#1556503 COPY_INSTEAD_OF_MOVE
cid#1556520 COPY_INSTEAD_OF_MOVE
cid#1556523 COPY_INSTEAD_OF_MOVE
cid#1556562 COPY_INSTEAD_OF_MOVE
cid#1556573 COPY_INSTEAD_OF_MOVE
cid#1556576 COPY_INSTEAD_OF_MOVE
cid#1556598 COPY_INSTEAD_OF_MOVE
cid#1556615 COPY_INSTEAD_OF_MOVE
cid#1556626 COPY_INSTEAD_OF_MOVE
cid#1556671 COPY_INSTEAD_OF_MOVE
cid#1556689 COPY_INSTEAD_OF_MOVE
cid#1556701 COPY_INSTEAD_OF_MOVE
cid#1556713 COPY_INSTEAD_OF_MOVE
cid#1556758 COPY_INSTEAD_OF_MOVE
cid#1556759 COPY_INSTEAD_OF_MOVE
cid#1556788 COPY_INSTEAD_OF_MOVE
cid#1556811 COPY_INSTEAD_OF_MOVE
cid#1556821 COPY_INSTEAD_OF_MOVE
cid#1556824 COPY_INSTEAD_OF_MOVE
cid#1556825 COPY_INSTEAD_OF_MOVE
cid#1556862 COPY_INSTEAD_OF_MOVE

Change-Id: I4925a79688a983bb07252600430039ec0bcb75b8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175678
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2024-10-26 19:25:03 +02:00
Noel Grandin 621caf93ce speedup saving large XLS file with lots of query formula(2)
reduce cost of OUString construction by avoiding
initialising a temporary and then overwriting it.

12s to 10s

Change-Id: I889152ba71947004ca7d5c96f073182c94d95ed5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175539
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-10-25 08:21:10 +02:00
Michael Weghorn 0fe7b3cebc tdf#130857 printersetupdialog.ui: Define focusable widgets in order
Align the order in which the focusable widgets (combobox, "Properties"
button) are defined in the .ui (XML) file with the order in which they
should receive focus. While the position in the GtkGrid is defined
by the "left-attach" and "top-attach" packing properties and
QtBuilder evaluates those, the tab order in Qt by default matches
the order in which widgets are created (s. e.g. [1]).

Without this commit in place the "properties" button was constructed
before the "name" combobox (because it was further up in
the .ui file, i.e. the XML parser processed it earlier), resulting
in an unexpected order when using the Tab key to navigate through
the "Tools" -> "Printer Settings" dialog:

From the "Options" button in the button box, focus would jump
to the "Properties" button, and only then to the combobox, and
from there, it would jump to the "Help" button in the button box.

Now, it jumps from the "Options" button to the combobox,
and after selecting the printer there, pressing Tab another
time moves focus to the "Properties" button as expected, which
can be used to open another dialog that allows to change properties
of the previously selected printer.

A potential alternative to adjusting the .ui file could be to
explicitly set the tab order using QWidget::setTabOrder [2]
in QtBuilder.

[1] https://doc.qt.io/qt-6/designer-tab-order.html
[2] https://doc.qt.io/qt-6/qwidget.html#setTabOrder

Change-Id: If3aa014e20b97fe8bb772ef212741af1433b0244
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175523
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-10-24 09:09:50 +02:00
Caolán McNamara ee4554b0ac cid#1555259 COPY_INSTEAD_OF_MOVE
and

cid#1555264 COPY_INSTEAD_OF_MOVE
cid#1555280 COPY_INSTEAD_OF_MOVE
cid#1555303 COPY_INSTEAD_OF_MOVE
cid#1555313 COPY_INSTEAD_OF_MOVE
cid#1555314 COPY_INSTEAD_OF_MOVE
cid#1555323 COPY_INSTEAD_OF_MOVE
cid#1555333 COPY_INSTEAD_OF_MOVE
cid#1555338 COPY_INSTEAD_OF_MOVE
cid#1555349 COPY_INSTEAD_OF_MOVE
cid#1555364 COPY_INSTEAD_OF_MOVE
cid#1555379 COPY_INSTEAD_OF_MOVE
cid#1555398 COPY_INSTEAD_OF_MOVE
cid#1555410 COPY_INSTEAD_OF_MOVE
cid#1555411 COPY_INSTEAD_OF_MOVE
cid#1555416 COPY_INSTEAD_OF_MOVE
cid#1555429 COPY_INSTEAD_OF_MOVE
cid#1555434 COPY_INSTEAD_OF_MOVE
cid#1555441 COPY_INSTEAD_OF_MOVE
cid#1555446 COPY_INSTEAD_OF_MOVE
cid#1555480 COPY_INSTEAD_OF_MOVE
cid#1555490 COPY_INSTEAD_OF_MOVE
cid#1555524 COPY_INSTEAD_OF_MOVE
cid#1555527 COPY_INSTEAD_OF_MOVE
cid#1555531 COPY_INSTEAD_OF_MOVE
cid#1555578 COPY_INSTEAD_OF_MOVE
cid#1555581 COPY_INSTEAD_OF_MOVE
cid#1555591 COPY_INSTEAD_OF_MOVE
cid#1555614 COPY_INSTEAD_OF_MOVE
cid#1555619 COPY_INSTEAD_OF_MOVE
cid#1555633 COPY_INSTEAD_OF_MOVE
cid#1555654 COPY_INSTEAD_OF_MOVE
cid#1555707 COPY_INSTEAD_OF_MOVE
cid#1555712 COPY_INSTEAD_OF_MOVE
cid#1555746 COPY_INSTEAD_OF_MOVE
cid#1555763 COPY_INSTEAD_OF_MOVE

Change-Id: Ibcc1a3649c5663328e60474c06e51902aa74db52
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175407
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2024-10-22 17:53:07 +02:00
Mike Kaganski 7e5f69aa33 Make tools::Time ctor taking sal_Int64 private
This ctor is meant to set the value of nTime directly; and that value
is not nanoseconds, but an encoded value, using SEC_/MIN_/HOUR_MASK.
But in some places, this ctor was misused for setting of nanoseconds,
which would only accidentally work for values less than one second.
All places that initialized tools::Time with 0, now use EMPTY.

This makes the ctor private; and for the very few cases where really
the encoded value of nTime is stored / restored, fromEncodedTime is
introduced.

Change-Id: I1f1994bd9aab1b51a41b1de637619049fe820da4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175283
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-10-21 10:30:58 +02:00
Justin Luth 2bbd247f16 tdf#156505 sw: reset view options after export as graphic
When creating an export graphic,
the view options are changed to hide hidden stuff,
not show the formatting marks etc.

However, the user's view settings were not being restored
after the export was done.

Change-Id: I3e236e5ef47eddca487621c92ec639f7bac073de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175185
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
2024-10-19 13:36:06 +02:00
Michael Weghorn a84f4ef9a8 svtools a11y: Set underline/mnemonic char for "Restart" dialog
Set the "use-underline" property for the buttons in the
"Restart %PRODUCTNAME" dialog and specify the accelerators.

This way, the dialog can easily be closed using Alt+[accelerator]
with the gtk3 and qt5/qt6 VCL plugin as well.

Use those characters that the VCL logic was using as well.
(The VCL implementation seems to have some way to auto-generate
mnemonic characters if none is set automatically.)

This dialog is e.g. seen when toggling experimental mode in
"Tools" -> "Options" and closing the options dialog with the
"OK" button.

Change-Id: I50c3402fb89d5fbfc0e610c0e41f5f035cf0b0e1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175137
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-10-18 18:59:30 +02:00
Caolán McNamara 7b218d6b4f cid#1555697 Data race condition
Change-Id: Ib022e1fbccf456e89f16a26efb50e6c8d98372ad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175065
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2024-10-17 20:25:29 +02:00
Noel Grandin 5c4fac1e9f loplugin:unusedmethods
Change-Id: I6ba4b4046190b701d4a15c6fa90b6009ecf4ab1c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175014
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-10-16 15:52:02 +02:00
Eike Rathke 8afc6cb5aa Add Santali, Ol Chiki {sat-Olck-IN} [0x06B3] to language list
Change-Id: I3924672759bc12f1ee8a022e8b35c862aefff06d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174901
Tested-by: Jenkins
Reviewed-by: Eike Rathke <erack@redhat.com>
2024-10-14 18:36:38 +02:00
Deepanshu Sharma 1b648b3705 tdf#114441 change the sal_uLong to tools::Long and sal_Int32 in svtools
Change-Id: I1f5e2233b34e115723f3c1b49b7f0f982e16cfcb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174264
Tested-by: Jenkins
Reviewed-by: Hossein   <hossein@libreoffice.org>
2024-10-14 16:36:54 +02:00
Noel Grandin 9b26255f03 use more concrete UNO class in ValueSetAcc
Change-Id: I9d6c31ccda4ff05f33d437ab064a2a55d84627b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174411
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-10-03 14:07:57 +02:00
Michael Weghorn 09b4991701 a11y: Only send active-desc-changed event when ValueSet has focus
When the selected item in a ValueSet changes,
only send an AccessibleEventId::ACTIVE_DESCENDANT_CHANGED
event for the newly selected item if the ValueSet itself
has focus, as the active descendant is the currently
active child of the current focus object.

This prevents incorrect events that e.g. broke Orca's
focus tracking and thus announcement of the current slide
in Impress when moving between slides in the "Slides" panel:

1) start Impress
2) select the "Beehive" presentation template
3) move focus to "Slides" panel
4) use up and down key to navigate between slides

Instead of saying "Slide 1" and "Slide 2" respectively,
Orca sometimes announced "Layout, list with 16 items", as
the 2 slides use a different layout, and thus switching
between slides implicitly leads to the selection of the
corresponding item in the "Layout" deck in the sidebar,
which resulted in a corresponding ACTIVE_DESCENDANT_CHANGED
event being sent prior to this commit, making Orca think
that that item received keyboard focus.

With this commit in place, Orca now announces "Slide 1"
and "Slide 2" according to the newly selected slide
in the "Slides" view.

Change-Id: I543a4c94bae75dede7274a8b35f183ccd2ac0515
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174342
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-10-01 15:53:25 +02:00
Noel Grandin ccef1a40d4 cid#1607958 Data race condition
Change-Id: I1d5d0c9eae073f69e4308163dcc62371c31e0d78
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174292
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2024-10-01 11:15:52 +02:00
Mike Kaganski 7749f93138 Make replacement graphic management more atomic
Commit 8872f7121b (crashtesting: crash
on exporting kde274105-6.docx to .rtf, 2024-03-27) added some safety
code in EmbeddedObjectRef::GetReplacement. It mentioned, that there
are likely some bugs in the management of the graphic.

This tries to fix this management, avoiding the intermediate states,
and only changing the graphic when all the data is ready. This also
reverts the changes of the mentioned commit, obsoleted now; and of
commit 8780fa41dc (svtools: fix lost
replacement grpahic when updating it via OLE fails, 2018-10-30);
but keeps commit 24231f2a33 (svtools:
fix lost replacement non-rendered graphic when updating it fails,
2022-02-17).

This has revealed that the second part of unit test for tdf#143222
("Check export of embedded worksheet in slide"), introduced in
commit 92a407b7f9 (tdf143222 Handle
alternate content of graphicData element., 2021-07-08), has never
really worked: the "pGraphic != nullptr" check would never fail;
in fact, that used to always return an empty graphic. The problem
was filed as tdf#163064, and the test was modified accordingly.

Commit 5d997c029e (sw XHTML export:
improve dummy OLE object handling, 2018-08-30) made ReqIF export
handle missing replacement graphic. However, it had assumed that
SwOLENode::GetGraphic always returns a valid pointer even for the
missing data. That is fixed here in OutHTML_FrameFormatOLENodeGrf.

Other places, where the pointer was dereferenced unconditionally,
were fixed (keeping current behavior).

Change-Id: Ica97a691ecc11b856bdb003f89467ea3392684bd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173716
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-09-21 14:57:52 +02:00
Mike Kaganski 2469e69af8 Make sure to have a graphic here
Commit 8872f7121b (crashtesting: crash
on exporting kde274105-6.docx to .rtf, 2024-03-27) made sure to provide
a graphic in all cases, to avoid crashes revealed by crashtesting.
In commit f317746f55, I removed that.
This reinstates the safety measure for cases when there's no graphic
yet.

Change-Id: Ida3eecd5c7ccff087c2ca8b6076ca01b8a145adc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173697
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-09-20 13:23:59 +02:00
Noel Grandin 66cf208718 use more concrete UNO types in various
Change-Id: Ia28cffdeae8ced2e19dcf695ee5c3417d4f97d64
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173698
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-09-20 12:46:10 +02:00
Mike Kaganski f317746f55 Avoid wrong "no replacement graphic" state when updating OLE graphic
Connecting from an external Java process on Windows, and running a
code similar to this:

 XComponent xComponent = xComponentLoader.loadComponentFromURL(url, "_default", FrameSearchFlag.ALL, args);
 XTextEmbeddedObjectsSupplier textEmbeddedObjectSupplier = cast(XTextEmbeddedObjectsSupplier.class, xComponent);
 XIndexAccess embeddedObjectsAccess = cast(XIndexAccess.class, textEmbeddedObjectSupplier.getEmbeddedObjects());
 XEmbeddedObjectSupplier2 embeddedObjectSupplier = cast(XEmbeddedObjectSupplier2.class, embeddedObjectsAccess.getByIndex(0));
 for (int i = 0; i < 100; i++)
 {
   XGraphic replacementGraphic = embeddedObjectSupplier.getReplacementGraphic();
   String graphicStatus = replacementGraphic == null ? "missing" : "present";
   System.out.println("The replacement graphic is: " + graphicStatus);
 }

(when 'url' points to a file with OLE) could produce output like this:

 The replacement graphic is: present
 The replacement graphic is: present
 The replacement graphic is: missing
 ... 94 more copies of "missing"
 The replacement graphic is: missing
 The replacement graphic is: present
 The replacement graphic is: present

i.e., the replacement graphic suddenly disappears, and then re-appears.
This happens when some idle needs to update the replacement graphic,
e.g. when generating a thumbnail. This happened because the code in
EmbeddedObjectRef::GetReplacement cleared the graphic prior to calls
to OLE object's async methods to get the graphic stream.

The code does not depend on the current content of mpImpl->oGraphic,
so this change takes care to avoid this transient "no graphic" state.

Change-Id: Ia825185a6e9b749697209443ee5db187b5ddbd16
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173690
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2024-09-20 09:50:56 +02:00
Caolán McNamara ceff75b533 Resolves: tdf#141577 explicitly set current frame as active frame
of the current frame window. Creating the popup will grab focus
into the dropdown, making the embedded frame lose focus, so it considers
itself inactive (like right clicking in main frame area makes the
embedded frame lose focus), so for this embedded object in another frame
case make the original frame the active child of its parent after
the popup has been created.

Change-Id: Id6e12babcf4ebce05c297888b7b04756f2a12ccf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173624
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-09-19 09:21:09 +02:00
Caolán McNamara 22cb250074 Resolves: tdf#162113 prefer restoring explicit font style selection
so when scrolling through fonts that might not have the original or
explicitly picked style, then on moving to the next font that does have
that style, then the original bold/italic/etc gets picked again.

Change-Id: If818a116ed4ab248cb67f60845acad2cd4eeb8ed
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173071
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2024-09-09 16:07:58 +02:00
Caolán McNamara 9626fe5447 cid#1607370 Check of thread-shared field evades lock acquisition
apparently since:

commit 8228227168
CommitDate: Thu Dec 8 17:27:05 2016 +0000

    convert OSL_ENSURE to assert in AccessibleEventNotifier

Change-Id: If4ad0459e39e44a9417dd074560538f2a87586b8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172615
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-08-29 22:39:19 +02:00
Skyler Grey 4e04e96334 fix(invert): Avoid spurious LOK invalidations
Using the same mechanism as with theme changes, we can avoid LOK getting
invalidations if we have an invert-background change that doesn't apply.

The trouble is that this method of inverting the background causes *lots
of* properties to change, so there's no single "If we inverted the
background" to check...

To get there, I've checked if all of the following are true
- We didn't change the color scheme
- We didn't have any new colors after this change
- All of the properties we were changing should have been within this
  color scheme

While they don't necessarily mean "there was a background inversion",
they do mean "something changed in your theme but no action is needed
from you" - which should only be a background inversion - and if we
added anything else that could fit in that category, it should also
avoid LOK invalidations

Change-Id: Idb680d5241db7879d9be834268ab616848c1f165
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172505
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2024-08-28 09:41:18 +02:00
Heiko Tietze 64ae1fd48a Resolves tdf#143848 - Adjust boundary color for dark mode
TABLEBOUNDARIES and WRITERSECTIONBOUNDARIES now visible on dark backgrounds

Change-Id: I25bad39e503665cef486f197bbeaa34374f22c5e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172096
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2024-08-20 11:37:04 +02:00
Heiko Tietze aabb5be81a Resolves tdf#80054 - Customization for non-printable character color
Change-Id: I82783a49d3a1c2096dcfa7c97a3fce14c555c988
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171814
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2024-08-14 09:24:29 +02:00
Heiko Tietze afea67b1d3 Resolves tdf#162435 - TC author colors inherit anchor colors
Fix to regression from I773793de8cfbdc0d23124db790604b93030375c2

* base color is now anchor, light/dark calculated as luminance
* default colors adjusted respectively

Change-Id: I9872a959d51714c736cd2adb216d76a0846aeec6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171753
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Tested-by: Jenkins
2024-08-13 11:31:54 +02:00
Heiko Tietze 919e13fb3b Resolves tdf#61242 - Customization of comment background color
* COL_AUTHOR<1..>_DARK/LIGHT/NORMAL removed Author1..9 added
* dark variants calculated from light with 50% brightness
* light does In/DecreaseLuminance(30) and dark (sd) resp. anchor (sw) In/DecreaseLuminance(80) depending on GetUseDarkMode()
* sw: font color depends on outline background, which now picks up DOCCOLOR; this does not work for dark colors in light mode, for example
* sd does not update on changes and requires a restart

Change-Id: I773793de8cfbdc0d23124db790604b93030375c2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171523
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Tested-by: Jenkins
2024-08-11 08:26:23 +02:00
Gülşah Köse e0daa8a142 ONLINE: Add Invert document background color command.
Change-Id: Ia8868a80e4eba9a9a1c0b31077d9eca0c5b00466
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171633
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-08-08 16:43:43 +02:00
Julien Nabet 3bb3052ee9 tdf#162139: make 2 buttons in the date form control translatable
Context modified because the same strings are in svtools/uiconfig/ui/calendar.ui
Don't know at all if these could be merged.

Change-Id: I72e37b54b53e4717f513dd313757af7318bbc4f8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170898
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2024-07-23 19:56:04 +02:00
Mike Kaganski 68a96f7473 Use IsRunningUnitTest / IsRunningUITest consistently
The functions are moved to o3tl as inline functions.

Change-Id: Ief7d7e292ef15e055ad04ab5707e5e6a2a05b916
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170636
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-07-17 19:15:31 +02:00
Noel Grandin 69e7000ed4 Simplify checking for "running under unit/ui test"
In various places, the code checks if we are running as a unit test or a
UI test. This code grew organically, and is most re-using environment
variables that were designed for narrower purposes.

Rather than being clever, just add two new explicit and simple
environment variables in the natural place (the command that runs them),
and check for those variables in the code.

Change-Id: Icce0997914fa0be30a5ac1f29bd870bdb5893a8b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170618
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2024-07-17 15:21:57 +02:00
HakimOttey 63fe0d6c07 tdf#114441 replace sal_uLong with tools::Long
Make variable nHScrX have tools::Long data type as it is expected to be tools::Long when used in SetPostSizePixel

Change-Id: If7e0c1ee1a9832b215c766cbf8bf916c731edfd9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167804
Tested-by: Jenkins
Reviewed-by: Hossein <hossein@libreoffice.org>
2024-07-14 09:33:38 +02:00
Michael Weghorn 2fdee9fd60 Unify/Port to use VCLUnoHelper for AWT <-> VCL conversions
Following

    Change-Id: Id48f81deb05aee2026509037f7d14575735e5be0
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Wed Jul 10 14:49:03 2024 +0200

        VCLUnoHelper: Align AWT <-> VCL helpers with convert.hxx impl

, port all uses of the helper functions defined in
`include/toolkit/helper/convert.hxx` to use the
`VCLUnoHelper` equivalents instead, to unify usage
and avoid duplication.

Drop `include/toolkit/helper/convert.hxx` now that
it's unused.

Change-Id: I22695a93e40e47bb2b14d191a2e0a4eb7c856895
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170317
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-07-11 06:44:48 +02:00
Bogdan Buzea fddc381856 Resave with newer Glade version
Change-Id: I427437cf861ea75413d5bee14cca2dba73add1a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169603
Tested-by: Jenkins
Reviewed-by: Taichi Haradaguchi <20001722@ymail.ne.jp>
2024-07-01 09:39:26 +02:00
Andrea Gelmini f07af61f6b Fix translation
Change-Id: Iedd595952eca24083068c33a5ec7391c125d2934
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169524
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2024-06-26 09:01:02 +02:00