The accelerator cache maintains a 1:1 mapping for key→command and a
1:n mapping for command→keys. When a new command is set for a key it was
previously only updating the key→command map and then adding the key to
the command→keys map. It never removed the key from the command→keys map
for the old command. When the menus are eventually updated, it looks up
whether each item has a shortcut based on the item’s command. Because
the old command was never removed, this ended up making it display the
same key binding on multiple menu items.
Change-Id: I6d75834f4c49b1f5c105ec40cb27b8e73006152d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190928
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
and
cid#1665187 Variable copied when it could be moved
cid#1665186 Variable copied when it could be moved
cid#1665184 Variable copied when it could be moved
Change-Id: If36872293c53263ad2a42b06463c9b50c243068d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190441
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
to move the logic of constructing a new Bitmap from an existing Bitmap and an AlphaMask,
into vcl, where it can later be optimised
Change-Id: I2af1c6d1a35d968abdd07546448f7e211772e70b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190366
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
places where we are constructing a Graphic by first
converting to BitmapEx, which is unnecessary, rather pass a
Bitmap to Graphic.
Change-Id: I386f68e7f5bc6ef9509352187dbe9a0774defaac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190307
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
and
cid#1659793 Variable copied when it could be moved
cid#1659830 Variable copied when it could be moved
cid#1659841 Variable copied when it could be moved
cid#1659856 Variable copied when it could be moved
cid#1659863 Variable copied when it could be moved
cid#1659864 Variable copied when it could be moved
cid#1659865 Variable copied when it could be moved
cid#1659903 Variable copied when it could be moved
cid#1659909 Variable copied when it could be moved
cid#1659917 Variable copied when it could be moved
cid#1659924 Variable copied when it could be moved
cid#1659929 Variable copied when it could be moved
cid#1659930 Variable copied when it could be moved
cid#1659932 Variable copied when it could be moved
cid#1660056 Variable copied when it could be moved
cid#1660112 Variable copied when it could be moved
cid#1660169 Variable copied when it could be moved
Change-Id: I623009beb8e4a61b2253a17f356576bd3ac3f06c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189402
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
and
cid#1659754 Variable copied when it could be moved
cid#1659755 Variable copied when it could be moved
cid#1659756 Variable copied when it could be moved
cid#1659766 Variable copied when it could be moved
cid#1659767 Variable copied when it could be moved
cid#1659769 Variable copied when it could be moved
cid#1659770 Variable copied when it could be moved
cid#1659777 Variable copied when it could be moved
cid#1659787 Variable copied when it could be moved
cid#1659790 Variable copied when it could be moved
cid#1659793 Variable copied when it could be moved
cid#1659802 Variable copied when it could be moved
cid#1659818 Variable copied when it could be moved
cid#1659822 Variable copied when it could be moved
cid#1659824 Variable copied when it could be moved
cid#1659825 Variable copied when it could be moved
cid#1659826 Variable copied when it could be moved
cid#1659842 Variable copied when it could be moved
cid#1659849 Variable copied when it could be moved
cid#1659850 Variable copied when it could be moved
Change-Id: I70729aaf6e229518a9a50ac18311286ab5b05b53
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189348
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
cid#1659641 Variable copied when it could be moved
cid#1659647 Variable copied when it could be moved
cid#1659650 Variable copied when it could be moved
cid#1659663 Variable copied when it could be moved
cid#1659685 Variable copied when it could be moved
cid#1659698 Variable copied when it could be moved
cid#1659703 Variable copied when it could be moved
cid#1659705 Variable copied when it could be moved
Change-Id: If0d399dcce73d47be105ac4b1c342bcc010c56c5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189181
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
and
cid#1662041 Variable copied when it could be moved
cid#1662040 Variable copied when it could be moved
cid#1662038 Variable copied when it could be moved
cid#1660211 Variable copied when it could be moved
cid#1660147 Variable copied when it could be moved
cid#1660117 Variable copied when it could be moved
cid#1660071 Variable copied when it could be moved
cid#1660046 Variable copied when it could be moved
cid#1660046 Variable copied when it could be moved
cid#1659985 Variable copied when it could be moved
Change-Id: I34627585e593f9de6bfa195ee0617848d9ed6135
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189157
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
and
cid#1660225 Variable copied when it could be moved
cid#1660211 Variable copied when it could be moved
cid#1660185 Variable copied when it could be moved
cid#1660173 Variable copied when it could be moved
cid#1660168 Variable copied when it could be moved
cid#1660166 Variable copied when it could be moved
cid#1660165 Variable copied when it could be moved
cid#1660163 Variable copied when it could be moved
cid#1660152 Variable copied when it could be moved
cid#1660149 Variable copied when it could be moved
cid#1660147 Variable copied when it could be moved
cid#1660145 Variable copied when it could be moved
cid#1660142 Variable copied when it could be moved
cid#1660140 Variable copied when it could be moved
cid#1660137 Variable copied when it could be moved
cid#1660136 Variable copied when it could be moved
cid#1660135 Variable copied when it could be moved
cid#1660128 Variable copied when it could be moved
cid#1660124 Variable copied when it could be moved
cid#1660122 Variable copied when it could be moved
cid#1660117 Variable copied when it could be moved
cid#1660114 Variable copied when it could be moved
cid#1660110 Variable copied when it could be moved
cid#1660109 Variable copied when it could be moved
cid#1660105 Variable copied when it could be moved
cid#1660104 Variable copied when it could be moved
cid#1660102 Variable copied when it could be moved
cid#1660100 Variable copied when it could be moved
cid#1660098 Variable copied when it could be moved
cid#1660080 Variable copied when it could be moved
cid#1660079 Variable copied when it could be moved
cid#1660078 Variable copied when it could be moved
cid#1660075 Variable copied when it could be moved
cid#1660071 Variable copied when it could be moved
cid#1660070 Variable copied when it could be moved
cid#1660064 Variable copied when it could be moved
cid#1660063 Variable copied when it could be moved
cid#1660060 Variable copied when it could be moved
cid#1660058 Variable copied when it could be moved
cid#1660053 Variable copied when it could be moved
cid#1660050 Variable copied when it could be moved
cid#1660049 Variable copied when it could be moved
cid#1660046 Variable copied when it could be moved
cid#1660042 Variable copied when it could be moved
cid#1660028 Variable copied when it could be moved
cid#1660023 Variable copied when it could be moved
cid#1660022 Variable copied when it could be moved
cid#1660021 Variable copied when it could be moved
cid#1660020 Variable copied when it could be moved
cid#1660017 Variable copied when it could be moved
cid#1660013 Variable copied when it could be moved
cid#1660005 Variable copied when it could be moved
cid#1660003 Variable copied when it could be moved
cid#1659999 Variable copied when it could be moved
cid#1659998 Variable copied when it could be moved
cid#1659995 Variable copied when it could be moved
cid#1659993 Variable copied when it could be moved
cid#1659989 Variable copied when it could be moved
cid#1659988 Variable copied when it could be moved
Change-Id: I2a30c8a2ac8785050d49b98635b0b406535b185a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189056
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
and
cid#1660211 Variable copied when it could be moved
cid#1660204 Variable copied when it could be moved
cid#1660195 Variable copied when it could be moved
cid#1660194 Variable copied when it could be moved
cid#1660193 Variable copied when it could be moved
cid#1660191 Variable copied when it could be moved
cid#1660188 Variable copied when it could be moved
cid#1660187 Variable copied when it could be moved
Change-Id: Ifcb179f73723e2d43144e242fa9c1b5ac332cd4f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188965
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
and
cid#1555637 Variable copied when it could be moved
cid#1555640 Variable copied when it could be moved
cid#1555863 Variable copied when it could be moved
cid#1556471 Variable copied when it could be moved
cid#1556634 Variable copied when it could be moved
cid#1556731 Variable copied when it could be moved
cid#1556751 Variable copied when it could be moved
cid#1556807 Variable copied when it could be moved
cid#1557366 Variable copied when it could be moved
cid#1558026 Variable copied when it could be moved
Change-Id: I187cb364877d35acd843d8391e5b376437ec96f2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188935
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
and
cid#1660483 Variable copied when it could be moved
cid#1660480 Variable copied when it could be moved
cid#1660473 Variable copied when it could be moved
cid#1660472 Variable copied when it could be moved
cid#1660471 Variable copied when it could be moved
cid#1660468 Variable copied when it could be moved
cid#1660464 Variable copied when it could be moved
cid#1660463 Variable copied when it could be moved
cid#1660462 Variable copied when it could be moved
Change-Id: I6380e6a6c2a63a5d6f2052264c54f250703e77fb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188825
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
and
cid#1660535 Variable copied when it could be moved
cid#1660533 Variable copied when it could be moved
cid#1660519 Variable copied when it could be moved
cid#1660518 Variable copied when it could be moved
cid#1660516 Variable copied when it could be moved
cid#1660504 Variable copied when it could be moved
cid#1660497 Variable copied when it could be moved
cid#1660493 Variable copied when it could be moved
cid#1660490 Variable copied when it could be moved
cid#1660489 Variable copied when it could be moved
Change-Id: I44be3d401c56fd6d5183dcd1ee6f8efef52b305e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188821
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
and
cid#1659624 Variable copied when it could be moved
cid#1659632 Variable copied when it could be moved
cid#1659637 Variable copied when it could be moved
cid#1659656 Variable copied when it could be moved
cid#1659662 Variable copied when it could be moved
Change-Id: I20179a4ff699af546694b8a4796ab2f0cfae1903
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188708
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
The special case for .uno:Paste*, even if still needed (?), is for
system clipboard deficiency, which is not relevant for LOK.
Change-Id: I85a78ad6ce6be7413c405e3dfa7a42589d4eafaa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187614
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
Instead of doing that command by command, this change tries to do it
globally, posting user event with the command data; it will run when
event loop gets to it; the menu gets closed by that time.
Change-Id: Ifdea666be8557a576dd6cd934898343631a3a95e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186470
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This change stops the creation of empty Configurations2/accelerator
dirs on new documents that do not have anything that needs to be stored
there. Previously, LibreOffice would always create this directory.
Whenever an XStorage is opened readwrite on a path, it will immediately
create that path. LibreOffice was opening all of these paths readwrite.
So, the solution is to always open these paths as readonly, and then
when we need to write data to them we close them and re-open them as
readwrite. If we never need to write data to a path, then it won't be
created.
This patch specifically stops the creation of subdirectories that were
being created by DocumentAcceleratorConfiguration.
Other patches in the relation chain handle paths created by
UIConfigurationManager and ImageManager.
Test coverage was added in b9054fed37
$ CPPUNIT_TEST_NAME="Test testTdf60700_accelerators" make CppunitTest_sw_odfexport
As far as I can tell, there is no way to actually attach custom
accelerators to a document at this time using the UI, so I did not do
any manual testing for this change.
(The closest thing to storing accelerators in the document is the work
from 65d2c9ca4d, but the macros don't
yet continue to work when you save the document in ODF)
With this change, a fresh document looks like this:
$ unzip -l Untitled\ 1.odt
Archive: Untitled 1.odt
Length Date Time Name
--------- ---------- ----- ----
39 2025-05-17 15:57 mimetype
0 2025-05-17 15:57 Configurations2/
12645 2025-05-17 15:57 styles.xml
899 2025-05-17 15:57 manifest.rdf
3563 2025-05-17 15:57 content.xml
866 2025-05-17 15:57 meta.xml
14745 2025-05-17 15:57 settings.xml
318 2025-05-17 15:57 Thumbnails/thumbnail.png
1061 2025-05-17 15:57 META-INF/manifest.xml
--------- -------
34136 9 files
Change-Id: I5e032d55e94114333ea7778afcc3df0fefe0a30f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185451
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
This change stops the creation of empty Configurations2/images dirs
on new documents that do not have anything that needs to be stored
there. Previously, LibreOffice would always create this directory.
Whenever an XStorage is opened readwrite on a path, it will immediately
create that path. LibreOffice was opening all of these paths readwrite.
So, the solution is to always open these paths as readonly, and then
when we need to write data to them we close them and re-open them as
readwrite. If we never need to write data to a path, then it won't be
created.
This patch specifically stops the creation of subdirectories that were
being created by ImageManager.
Other patches in the relation chain handle paths created by
UIConfigurationManager and DocumentAcceleratorConfiguration.
Test coverage was added in b9054fed37
$ CPPUNIT_TEST_NAME="Test testTdf60700_images" make CppunitTest_sw_odfexport
I also manually tested with the following procedure:
1. Open a new document in writer.
2. Tools > Customize > Toolbars.
3. Set scope to "Untitled 1".
4. Add a new toolbar "New Toolbar 1".
5. Add any command from Available Commands to the new toolbar.
6. Add any icon
7. OK.
8. Visually verify that the toolbar is present with the custom icon.
9. Save the document.
10. Verify that the custom icon is saved correctly inside the file.
$ unzip -l Untitled\ 1.odt
Archive: Untitled 1.odt
Length Date Time Name
--------- ---------- ----- ----
39 2025-05-17 16:01 mimetype
353 2025-05-17 16:01 Configurations2/toolbar/custom_toolbar_cba48a4e.xml
444 2025-05-17 16:01 Configurations2/images/lc_imagelist.xml
469 2025-05-17 16:01 Configurations2/images/Bitmaps/lc_userimages.png
0 2025-05-17 16:01 Configurations2/accelerator/
13358 2025-05-17 16:01 styles.xml
899 2025-05-17 16:01 manifest.rdf
3771 2025-05-17 16:01 content.xml
1011 2025-05-17 16:01 meta.xml
14746 2025-05-17 16:01 settings.xml
318 2025-05-17 16:01 Thumbnails/thumbnail.png
1406 2025-05-17 16:01 META-INF/manifest.xml
--------- -------
36814 12 files
10. Close and reopen the document.
11. Visually verify that the toolbar with the custom icon is present.
Change-Id: I48b2b8f540f7640ae25da6f27065e7b07f955c7e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185450
Tested-by: Jenkins
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
We used to have two duplicating sets: smart pointer-like VclPtr::reset,
and Reference-style VclPtr::set / VclPtr::clear. There is no need in
this duplication. Further, in ScopedVclPtr, reset is hidden / removed
to avoid skipping disposeAndClear; but the twin functions are kept
accessible, possibly as an overlook.
This change drops Reference-style VclPtr::set / VclPtr::clear, and
unifies on VclPtr::reset, which looks more consistent with the class
nature (it is closer to shared_ptr, than to uno::Reference). Doing
that uncovered one place, where a ScopedVclPtr was used incorrectly:
clear() was used for NotebookbarPopup::m_pParent in NotebookbarPopup
dtor. I assume then, that the correct class needed here is VclPtr.
Change-Id: I0746075c58d793fabdce1bc357afea8ee455cd8a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185553
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
This change stops the creation of various subdirectories of the
Configurations2/ directory on new documents that do not have anything
that needs to be stored in those subdirectories. Previously, LibreOffice
would always create a bunch of empty subdirectories that were not
necessary.
Whenever an XStorage is opened readwrite on a path, it will immediately
create that path. LibreOffice was opening all of these paths readwrite.
So, the solution is to always open these paths as readonly, and then
when we need to write data to them we close them and re-open them as
readwrite. If we never need to write data to a path, then it won't be
created.
This patch specifically stops the creation of subdirectories that were
being created directly by UIConfigurationManager. There are other paths
that were being created by ImageManager and
DocumentAcceleratorConfiguration, and those paths will be handled by
other patches.
Test coverage was added in aaed16eef8
$ CPPUNIT_TEST_NAME="Test testTdf69500" make CppunitTest_sw_odfexport
I also manually tested with the following procedure:
1. Open a new document in writer.
2. Tools > Customize > Toolbars.
3. Set scope to "Untitled 1".
4. Add a new toolbar "New Toolbar 1".
5. Add any command from Available Commands to the new toolbar.
6. OK.
7. Visually verify that the toolbar is present.
8. Save the document.
9. Verify that the toolbar is saved correctly inside the file.
$ unzip -l Untitled\ 1.odt
Archive: Untitled 1.odt
Length Date Time Name
--------- ---------- ----- ----
39 2025-04-25 23:35 mimetype
353 2025-04-25 23:35 Configurations2/toolbar/custom_toolbar_2a773c3.xml
0 2025-04-25 23:35 Configurations2/accelerator/
0 2025-04-25 23:35 Configurations2/images/Bitmaps/
12645 2025-04-25 23:35 styles.xml
899 2025-04-25 23:35 manifest.rdf
3563 2025-04-25 23:35 content.xml
1012 2025-04-25 23:35 meta.xml
14748 2025-04-25 23:35 settings.xml
318 2025-04-25 23:35 Thumbnails/thumbnail.png
1180 2025-04-25 23:35 META-INF/manifest.xml
--------- -------
34757 11 files
10. Close and reopen the document.
11. Visually verify that the toolbar is present.
Change-Id: If0a93675204576b3b6f7fe9113cada398e4da2ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184655
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
When a window enters LibreOffice's internal full screen mode,
the vcl code will hide the macOS menubar. However, if the
window is also in native full screen mode, macOS will force
the menubar to be visible.
While the vcl code already partially handles this case by
disabling all menu items when in LibreOffice's internal full
screen mode, the problem is that any submenus that were not
displayed before setting the menubar to null will show all
menu items with no title.
A simple way to reproduce this bug is to open a new Writer
or Calc document and do the following:
- Switch the window to LibreOffice's internal full screen
mode by manually selecting the View > Full Screen menu
item (the bug does not occur if its key shortcut is
pressed)
- Switch the window to native full screen mode
- Click on the menubar and note that many of the submenus
are displayed with menu items, but none of the menu items
have a title
So, we need to keep the menubar visible and rely on the vcl
code to disable all menu items.
Change-Id: I97fc63a8cd028c029a71899090185bc09d4aa492
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183508
Reviewed-by: Patrick Luby <guibomacdev@gmail.com>
Tested-by: Jenkins