Commit graph

502307 commits

Author SHA1 Message Date
Michael Weghorn
57d532057b weld: Rename weld::Treeview selection signal/connect
Rename weld::TreeView member + methods to clarify
that these are about selection changes:

* m_aChangeHdl to m_aSelectionChangedHdl,
* signal_changed to signal_selection_changed
* connect_changed to connect_selection_changed

In GtkInstanceTreeview, also rename the
related methods calling signal_selection_changed
accordingly for consistency.

Change-Id: I299d7930484677395a0bdd0ff105df18688f2e04
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178023
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-12-07 11:15:03 +01:00
Mike Kaganski
4b9bf0a2b9 SfxLibraryContainer: use std::mutex, and pass it to NameContainer
... to avoid own mutexes in own name container implementation.

Change-Id: I29ff6ef987154359c35d0628d529b0606ef08c5c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177637
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-12-07 08:48:53 +01:00
Bogdan Buzea
18b55add5e tdf#152299 - Remove unused define(s) from C/C++ files
Change-Id: I54460a95759ab8e2073c8ecab4e37ff15193a4e9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177176
Tested-by: Jenkins
Reviewed-by: Simon Chenery <simon_chenery@yahoo.com>
Reviewed-by: Hossein   <hossein@libreoffice.org>
2024-12-07 02:37:15 +01:00
Simon Chenery
1eb5e36521 tdf#163738 use insert function instead of for loop
Change-Id: I57c1ec3e580f4df22852dfaf7c75019e12fe352c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177898
Tested-by: Jenkins
Reviewed-by: Hossein   <hossein@libreoffice.org>
2024-12-07 02:24:55 +01:00
Caolán McNamara
7292bc192c increase rtf2pdffuzzer max_len
Change-Id: I99b48a7b38c8a53f6908137bfa3e4cee0231c4d9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178015
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-12-06 21:33:16 +01:00
Caolán McNamara
a8727bba7d GetRootURL is always used to ctor a INetURLObject
Change-Id: Ic532e92e20bfff75b6d68c670ce21b0157034bd5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177596
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-12-06 21:26:06 +01:00
Caolán McNamara
5a251b6f55 crashtesting: failure to reimport forum-it-2308.odt rtf export
Change-Id: I9908dea4aa822b7793ece91874de0282239bd17b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177988
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-12-06 21:25:51 +01:00
Sahil Gautam
f77bff02ed remove unused header in vcl/settings.hxx
Change-Id: I93ab70526cbbbcc690d45fd9dacf7e6e110e7e56
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177958
Tested-by: Jenkins
Reviewed-by: Sahil Gautam <sahil.gautam.extern@allotropia.de>
2024-12-06 19:47:42 +01:00
Noel Grandin
a60617b1f2 tdf#163221 crash in dialog editor
regression from
commit 65d52af42f
clang-tidy: performance-unnecessary-copy-initialization in svx

Change-Id: I48428fe08acdf9590a533c7ea91abe905713b292
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177979
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-12-06 18:20:16 +01:00
Michael Stahl
afab0fa906 sw: layout: ignore Keep-With-Next on hidden frames, part3
SwTabFrame: :MakeAll(), SwRowFrame::ShouldRowKeepWithNext()
Change-Id: I7cb6e558dc05736658a9bc75d6c735e6a47062b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177977
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Tested-by: Jenkins
2024-12-06 18:07:45 +01:00
Michael Stahl
a08b8fa2d0 sw: layout: ignore Keep-With-Next on hidden frames, part2
SwFrame::PrepareMake(), SwContentFrame::MakeAll(),
SwContentFrame::WouldFit_()

Change-Id: I2a909ac6d147668dddece97bd99e31fdddcf20eb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177976
Tested-by: Michael Stahl <michael.stahl@allotropia.de>
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2024-12-06 18:07:39 +01:00
Michael Stahl
cd8468bcba sw: layout: ignore Keep-With-Next on hidden frames, part1
When a frame is hidden, don't consider it when evaluating keep-with-next
attributes - this was the case for content in hidden sections before
commit 0c96119895

~SwFrameNotify() invalidating position of hidden frame with keep
attribute causes layout loops.

Also skip hidden frames in SwFlowFrame::IsKeepFwdMoveAllowed(),
SwFlowFrame::CheckKeep(), SwFlowFrame::IsPrevObjMove(),
SwFlowFrame::MoveBwd(), CalcContent().

Change-Id: I68556ba0a8e016d962399f3ce199e5eda0378867
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177975
Tested-by: Michael Stahl <michael.stahl@allotropia.de>
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2024-12-06 18:07:35 +01:00
Caolán McNamara
59891cd398 look at 'embedded' protocols for protocols that support them
Change-Id: Ie99f5f5a390639bdc69397c831e0a32594a5030c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177981
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-12-06 17:09:51 +01:00
Miklos Vajna
ae7900dd42 tdf#164095 sw: fix missing top margin on paragraph after changing page style
Open the bugdoc, go to the page after the section break, there is a top
margin for the first paragraph there in Word, but not in Writer.

This went wrong in commit abd90828cf
(tdf#160952 sw: ignore top margin of para on non-first pages with newer
DOCX, 2024-05-14), where it seemed that all implicit and explicit page
breaks want to ignore that top margin for the first paragraph.

Turns out this is more complex: implicit breaks and page breaks should
be followed by an ignore, but not paragraphs after "section break (next
page)". So restore the margins for the RES_PAGEDESC, but continue to
have them for RES_BREAK & implicit breaks.

Change-Id: If1fcf3077b81a705d3587bdae422dcfa16f1c17c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177973
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-12-06 16:16:18 +01:00
Simon Chenery
7bd7adc338 tdf#145538: Use range based for loops
Change-Id: I6f8539869b991c2c71044e1a18dba69641ffabe8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177505
Tested-by: Jenkins
Reviewed-by: Hossein   <hossein@libreoffice.org>
2024-12-06 16:14:29 +01:00
Mohamed Ali
6fa141074b tdf#145538 Use range based for loops
Change-Id: Iee3052f2fcc693b78c32fbae581f22527d64ffbd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177082
Tested-by: Jenkins
Reviewed-by: Hossein   <hossein@libreoffice.org>
2024-12-06 15:40:17 +01:00
Szymon Kłos
8203f31040 slideshow: use unified hash for animations and layers
Change-Id: I98d048f933469a63295776f689e96ce84d0c4f49
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177969
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-12-06 15:19:10 +01:00
Patrick Luby
cd983f0af4 Related: tdf#152703 Reuse existing CAMetalLayer to stop flicker
When live resizing a window, replacing the CAMetalLayer with each
resize event repaints the window's background which causes a
noticeable flicker. So reuse any existing CAMetalLayer already
assigned to the native view.

Change-Id: I03bda5f0d40b84606b6602961e5f0d3b0dfcc6ba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177921
Tested-by: Jenkins
Reviewed-by: Patrick Luby <guibomacdev@gmail.com>
2024-12-06 15:06:13 +01:00
Oliver Specht
add6efb409 tdf#160621 Variable field dialog size of value field
The size of the value field is now set to 5 rows.

Change-Id: I808ffbb64d71a0707857cf80d1c0b73419ac7b90
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177893
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2024-12-06 14:26:03 +01:00
Michael Stahl
bd727654ec tdf#159549 sw: fix ODF import of newly colliding Body Text styles
Commit c83d241eff "tdf#154933 Rename "Text
Body" para style to "Body Text"" introduced a regression when importing
certain ODF documents, but the problem is actually pre-existing.

What happens is that first the built-in "Text body" style is created,
and then a non-built-in style with the same translated name as "Text
body" is imported, and instead of creating a new style, the built-in one
is found and used, and so its properties are overwritten.

The root cause is that SwStyleNameMapper::FillProgName() and in
particular SwStyleNameMapper::FillUIName() are defined poorly, ever
since they were introduced in 2001 in commit
4fbc9dd48b

It becomes obvious relatively quickly that the way style names work is
that at the UNO API level, the "ProgName" (internal, non-localised)
names are used, and at the core document level, the "UIName" (localised)
names are used.

This is in itself questionable - why is the translation from ProgName to
UIName not done in the UI? - but also very expensive to change now.

So then the UNO services are responsible for translating between
ProgName and UIName.

But the 2 functions don't do that properly; both need to check if the
given name is a known ProgName *or* a known UIName, and rename it in
case it collides with a known target name; also the 2 functions need to
cancel each other out, not add " (user)" at the end in both directions.

Fixing this causes numerous tests to fail, due to:

1. the UNO services calling themselves with already converted style
   names, which are then translated a second time, which fails now.
   (or calling the wrong function like SwXStyleFamily::getByIndex())

2. many tests call the UNO API with UINames instead of ProgNames

3. somehow the writerfilter import is also changed, causing failures in
   e.g. testTdf113182 and testTdf104492

4. buggy code elsewhere (lcl_getUsedPageStyles()), problem similar to
   1., for PageDescs

5. potentially more buggy code yet to be discovered (definitely table
   styles, forgot which test that was)

So limit this fix for now to only paragraph styles, and don't do it in
writerfilter import, now at least sw.check passes.

Change-Id: I5cbdf3e174622e83f9af8787c3671b88c0e37bac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177858
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Tested-by: Jenkins
2024-12-06 14:24:32 +01:00
dtm
418a55e0dc tdf#157794 refactor Complex to use std::complex where possible
Change-Id: Ie583399977caf266e3cc0a3cb78462be4cd63151
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160394
Tested-by: Jenkins
Reviewed-by: Eike Rathke <erack@redhat.com>
2024-12-06 14:14:03 +01:00
Bogdan Buzea
0a7b9ba8a4 tdf#163486: PVS: The 'eAggFunc' variable was assigned the same value
V1048 The 'eAggFunc' variable was assigned the same value. Will be assigned after the switch.

Change-Id: I21d4cb4b0e7427bea56598476ca176cc0a4f7124
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175902
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
2024-12-06 12:26:24 +01:00
Michael Weghorn
26b24e181c tdf#130857 qt weld: Support printer properties dialog
Declare support for the "Insert Breaks"
"File" -> Printer Settings" -> "Properties" dialog.

This means that native Qt widgets are used for that dialog
now when using the qt5 or qt6 VCL plugin and starting LO with
environment variable SAL_VCL_QT_USE_WELDED_WIDGETS=1 set.

Since this dialog contains tab pages, their .ui files
need to be declared as supported as well.

Change-Id: Ia4360eebf3fed6ab5f78510c866a1703b0db8998
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177923
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-12-06 12:17:33 +01:00
Michael Weghorn
42f8227fdd tdf#130857 qt weld: Return selected item when requested in callback
The current item and the selected item(s) are
not necessarily the same.

Looking into the gtk and VCL implementations,
weld::TreeView::signal_changed is called
when the selection (not the current item) changes, so
connect to the QItemSelectionModel::selectionChanged signal
instead of the  QItemSelectionModel::currentChanged one
in the Qt implementation.

At the point in time that the QItemSelectionModel::selectionChanged
signal gets emitted, QItemSelectionModel::selectedIndexes
returns the newly selected indices while that was not
yet the case with QItemSelectionModel::currentChanged.

For the "Device" tab in the "File" -> "Printer Settings" -> "Properties"
dialog (for which support will be added in an upcoming commit),
this resulted in the PPD values (in the tree view
on the right) not being shown for the actually selected PPD
option/key (in the left tree view), but for the
one selected previously.
(See RTSDevicePage::SelectHdl for the logic filling
the tree view with items, which gets triggered when
weld::TreeView::signal_changed gets called.)

Change-Id: I31ec5aaaa47cd3d4704f25086b24645fb708be0a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177922
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2024-12-06 12:17:26 +01:00
Noel Grandin
31d0c99c31 add assert in SwNodes::ForEach
to catch any dodgy code

Change-Id: Iffd0612b28871c864f103634a40d13b82160d1ce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177955
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2024-12-06 12:14:11 +01:00
Noel Grandin
e7268b7d9e tdf#119840 small tweaks
Change-Id: Ie2c7a9633ee62bc1c4c0ad821d5ff1ace71fc15d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177928
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2024-12-06 12:14:02 +01:00
Mike Kaganski
5950fe86b8 tdf#164213: don't activate OLE objects in read-only mode
Similar to the check done in SwEditWin::MouseButtonDown.

Change-Id: I1a1b8966502a6b1557d424f28cfc1c1ecdf4b65e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177930
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-12-06 11:09:38 +01:00
Christopher Sherlock
aefc769e62 vcl: make Color parameters const in BitmapEx::createAlphaBlendFrame()
Change-Id: I6d71552f4d5004477b5980fe6c8de710dd4aea9d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177565
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2024-12-06 10:17:28 +01:00
Andrea Gelmini
50bf9a5e97 Fix typo
Change-Id: I93f5238a1e18f9a9335e6cdafc48711eb049e8dd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177786
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2024-12-06 09:36:50 +01:00
Jonathan Clark
9b2eaa37ba tdf#164106 Fix reordered glyph positioning with split grapheme clusters
Due to formatting, grapheme clusters can possibly be split across
multiple layouts. Layouts containing split grapheme clusters are created
by laying out the complete string, and extracting only the necessary
glyphs based on source codepoint index.

This approach is good enough for most diacritic cases, but it cannot
handle certain substitution cases where glyphs with advances would be
interleaved with other layouts. Sub-layouts must be contiguous.

This change introduces code to disable grapheme cluster splitting in
these cases that cannot be handled correctly.

Change-Id: I122abbf9c3f8a5efa4c72ad47991d0ad9ff8a8c0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177927
Tested-by: Jenkins
Reviewed-by: Jonathan Clark <jonathan@libreoffice.org>
2024-12-06 09:25:47 +01:00
Michael Weghorn
00df9cec57 tdf#130857 qt weld: Implement QtInstanceTreeView::clear
Used e.g. in RTSDevicePage::FillValueBox
(i.e. in the "File" -> "Printer Settings" -> "Properties"
dialog).

Change-Id: Ice39b266b366a6fd6b37b6ece28cee529990dc80
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177909
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2024-12-06 08:50:35 +01:00
Eike Rathke
6926c820ce Resolves: tdf#164124 Do not trap incomplete date 2021-6/1 as fraction
In fact do not accept anything else than blanks after integer
portion for a fraction.

Change-Id: I29746bb7cd78ecc6a7810e8841bee748589a36e9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177899
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
2024-12-06 02:04:45 +01:00
Caolán McNamara
f232952e72 crashtesting: HLINK_MARK embedded null import from forum-mso-en4-7137.doc
which causes problems on export to docx. Sanitize at the original
import.

Change-Id: I8b9fa86465c455fe872c41386889dc54e38eb9ec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177904
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-12-05 22:34:11 +01:00
Szymon Kłos
2d7ab2b66b jsdialog: weld::Menu
- weld::Menu doesn't have base with weld::Widget
- use separate container, only one menu per WindowId
- first only send menu and cancel, when user activates
  option we will send another request and execute entry
  as menu can be blocking
- there is connect_activated way of async setup too

Change-Id: Iea03f82a91ecc19af67b91f85364675c119056ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177722
(cherry picked from commit efeb511607dacce991866bcf328c96a01ab594f9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177852
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2024-12-05 22:31:30 +01:00
Michael Weghorn
f975b84185 a11y: Drop SAL_LOPLUGIN_ANNOTATE("crosscast")
Added in:

    commit d66a97d562
    Date:   Thu Jan 12 08:29:24 2023 +0100

        loplugin:crosscast (clang-cl)

        > winaccessibility/source/service/AccTopWindowListener.cxx(47,36): error: suspicious dynamic cross cast from 'css::accessibility::XAccessible *' to 'VCLXAccessibleComponent *' [loplugin:crosscast]
        >     else if (auto pvclxcomponent = dynamic_cast<VCLXAccessibleComponent*>(pAccessible))
        >                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        Change-Id: Iee7585dd2fa0d92af3be6b89d7d08326de3d1e7b
        Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145380
        Tested-by: Jenkins
        Reviewed-by: Stephan Bergmann <sbergman@redhat.com>

AccTopWindowListener::HandleWindowOpened no longer does
that crosscast now, see

    Change-Id: Ic96d2c95128af144c7769aac40707299b1c80f8c
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Thu Dec 5 14:07:52 2024 +0000

        tdf#164093 tdf#157001 wina11y: Use vcl::Window's actual XAccessible

Change-Id: Ifca76a5d519099f9cbe06f8bde606e01871363fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177891
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2024-12-05 20:12:47 +01:00
Michael Weghorn
b608604d0b tdf#164093 tdf#157001 wina11y: Use vcl::Window's actual XAccessible
By default, a vcl::Window's XAccessible is its
VCLXWindow (toolkit peer):

    css::uno::Reference< css::accessibility::XAccessible > Window::CreateAccessible()
    {
        css::uno::Reference< css::accessibility::XAccessible > xAcc( GetComponentInterface(), css::uno::UNO_QUERY );
        return xAcc;
    }

However, that's a virtual method and subclasses can
return a different XAccessible.
MenuFloatingWindow::CreateAccessible returns the
accessible of its menu.

However, winaccessibility's AccTopWindowListener
code was relying on the Window's XAccessible always
being its VCLXWindow.

The VLCXWindow is passed as a param in the
XTopWindowListener methods, and AccTopWindowListener
was querying it for the XAccessible interface, and
then calling XAccessible::getAccessibleContext in
order to retrieve the XAccessibleContext for the
window.

This is incorrect if the Window actually has another
XAccessible.

For the df#164093 scenario with NVDA running, opening and
closing the sidebar popup menu would result in the
VCLXWindow's VCLXWindow::getAccessibleContext menu
getting called, which calls VCLXWindow::CreateAccessibleContext
and the VCLXWindow would keep a reference to the
returned XAccessibleContext and dispose it when
the VLCXWindow itself gets disposed.
However, AccessibleFactory::createAccessibleContext
(called by VCLXWindow::CreateAccessibleContext)
doesn't actually create a new object for the
MenuFloatingWindow's accessible, but returns the
existing accessible object of the PopupMenu, which is
owned by the PopupMenu, not the MenuFloatingWindow,
s.a. previous commit

    Change-Id: Ia2931bee23204395e8b3396927acf4fa1d0f077c
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Thu Dec 5 11:06:48 2024 +0000

        tdf#164093 tdf#157001 a11y: Improve menu window disposal

for more details.

Backtrace of how that accessible context was returned:

    1 `anonymous namespace'::AccessibleFactory::createAccessibleContext acc_factory.cxx 305 0x7fffbc160767
    2 VCLXWindow::CreateAccessibleContext vclxwindow.cxx 879 0x7fffc0b1bc67
    3 VCLXWindow::getAccessibleContext vclxwindow.cxx 2418 0x7fffc0b2670b
    4 AccTopWindowListener::HandleWindowOpened AccTopWindowListener.cxx 60 0x7fffe5c32ab6
    5 AccTopWindowListener::windowOpened AccTopWindowListener.cxx 119 0x7fffe5c3375e
    6 ``anonymous namespace'::VCLXToolkit::callTopWindowListeners'::`2'::<lambda_1>::operator() vclxtoolkit.cxx 2364 0x7fffc0af27ef
    7 comphelper::OInterfaceContainerHelper4<com::sun::awt::XTopWindowListener>::forEach<``anonymous namespace'::VCLXToolkit::callTopWindowListeners'::`2'::<lambda_1>> interfacecontainer4.hxx 349 0x7fffc0ae7f9e
    8 `anonymous namespace'::VCLXToolkit::callTopWindowListeners vclxtoolkit.cxx 2359 0x7fffc0afeaed
    9 `anonymous namespace'::VCLXToolkit::eventListenerHandler vclxtoolkit.cxx 2295 0x7fffc0b02492
    10 `anonymous namespace'::VCLXToolkit::LinkStubeventListenerHandler vclxtoolkit.cxx 2288 0x7fffc0afbdf6
    11 Link<VclSimpleEvent &,void>::Call link.hxx 111 0x7fffbfba33d3
    12 VclEventListeners::Call vclevent.cxx 47 0x7fffbfba35f1
    13 Application::ImplCallEventListeners svapp.cxx 733 0x7fffbfb76dbb
    14 vcl::Window::CallEventListeners event.cxx 229 0x7fffbf45f841
    15 vcl::Window::ImplSetReallyVisible window.cxx 1331 0x7fffbf566bad
    16 vcl::Window::ImplSetReallyVisible window.cxx 1344 0x7fffbf566c7d
    17 vcl::Window::Show window.cxx 2336 0x7fffbf56a8d1
    18 vcl::Window::Show window.cxx 2349 0x7fffbf56a9ce
    19 FloatingWindow::StartPopupMode floatwin.cxx 825 0x7fffbf46a702
    20 PopupMenu::Run menu.cxx 3018 0x7fffbf4a6f02
    ... <More>

When the MenuFloatingWindow gets disposed, its
VCLXWindow is also disposed. Since it incorrectly
assumes it (or its Window) owns the XAccessibleContext,
it disposes that as well:

    1 OAccessibleMenuBaseComponent::disposing accessiblemenubasecomponent.cxx 608 0x7fffbf300c82
    2 cppu::WeakComponentImplHelperBase::dispose implbase.cxx 104 0x7fffe199964a
    3 cppu::PartialWeakComponentImplHelper<com::sun::accessibility::XAccessibleContext2,com::sun::accessibility::XAccessibleEventBroadcaster>::dispose compbase.hxx 90 0x7fffdb8d1820
    4 VCLXWindow::dispose vclxwindow.cxx 938 0x7fffc0b24012
    5 UnoWrapper::WindowDestroyed unowrapper.cxx 302 0x7fffc0cfddc6
    6 vcl::Window::dispose window.cxx 220 0x7fffbf56e68f
    7 SystemWindow::dispose syswin.cxx 107 0x7fffbf515606
    8 FloatingWindow::dispose floatwin.cxx 225 0x7fffbf46b751
    9 MenuFloatingWindow::dispose menufloatingwindow.cxx 134 0x7fffbf4bd766
    10 VclReferenceBase::disposeOnce vclreferencebase.cxx 39 0x7fffbf7520d9
    11 VclPtr<vcl::Window>::disposeAndClear vclptr.hxx 207 0x7fffbf3f98d2
    12 PopupMenu::ImplExecute menu.cxx 2947 0x7fffbf4a0ee7
    13 PopupMenu::Execute menu.cxx 2834 0x7fffbf49c392
    14 MenuButton::ExecuteMenu menubtn.cxx 77 0x7fffbf639f1d
    15 MenuButton::MouseButtonDown menubtn.cxx 214 0x7fffbf63a847
    16 ImplHandleMouseEvent winproc.cxx 708 0x7fffbf57ca27
    17 ImplHandleSalMouseButtonDown winproc.cxx 2338 0x7fffbf57e1af
    18 ImplWindowFrameProc winproc.cxx 2683 0x7fffbf57fc07
    19 SalFrame::CallCallback salframe.hxx 312 0x7fffbf3443c6
    20 ImplHandleMouseMsg salframe.cxx 3415 0x7fffbc818e8f
    ... <More>

However, the Menu that actually owns the accessible may
still be alive, and then opening the menu again results
in an attempt to make use of the already disposed object,
triggering a crash due to a DisposedException being thrown:

    1   RaiseException                                            KERNELBASE                           0x7ff808e8b699
    2   CxxThrowException                                         VCRUNTIME140                         0x7fffef535267
    3   comphelper::OCommonAccessibleComponent::ensureAlive       accessiblecomponenthelper.cxx   141  0x7fffdb8d1937
    4   comphelper::OContextEntryGuard::OContextEntryGuard        accessiblecontexthelper.hxx     64   0x7fffbf2fb8eb
    5   comphelper::OExternalLockGuard::OExternalLockGuard        accessiblecontexthelper.hxx     81   0x7fffbf2fb948
    6   OAccessibleMenuBaseComponent::getAccessibleContext        accessiblemenubasecomponent.cxx 641  0x7fffbf301337
    7   VCLXAccessibleComponent::ProcessWindowChildEvent          vclxaccessiblecomponent.cxx     165  0x7fffc0a9596d
    8   VCLXAccessibleComponent::WindowChildEventListener         vclxaccessiblecomponent.cxx     124  0x7fffc0a96669
    9   VCLXAccessibleComponent::LinkStubWindowChildEventListener vclxaccessiblecomponent.cxx     114  0x7fffc0a957f6
    10  Link<VclWindowEvent &,void>::Call                         link.hxx                        111  0x7fffbf45f7d3
    11  vcl::Window::CallEventListeners                           event.cxx                       300  0x7fffbf45fe0c
    12  vcl::Window::ImplSetReallyVisible                         window.cxx                      1331 0x7fffbf566bad
    13  vcl::Window::ImplSetReallyVisible                         window.cxx                      1344 0x7fffbf566c7d
    14  vcl::Window::Show                                         window.cxx                      2336 0x7fffbf56a8d1
    15  vcl::Window::Show                                         window.cxx                      2349 0x7fffbf56a9ce
    16  FloatingWindow::StartPopupMode                            floatwin.cxx                    825  0x7fffbf46a702
    17  PopupMenu::Run                                            menu.cxx                        3018 0x7fffbf4a6f02
    18  PopupMenu::ImplExecute                                    menu.cxx                        3005 0x7fffbf4a1707
    19  PopupMenu::Execute                                        menu.cxx                        2834 0x7fffbf49c392
    20  MenuButton::ExecuteMenu                                   menubtn.cxx                     77   0x7fffbf639f1d
    ... <More>

To fix that, adjust winaccessibility's
AccTopWindowListener to no longer just use
the VCLXWindow for the accessible, but
get the vcl::Window for the VCLXWindow and
query it's actual XAccessible using
vcl::Window::GetAccessible().

This fixes the tdf#164093 crash. The problem of
tdf#157001 where items in the popup menu of Calc's organize
template dialog are only announced the first time the menu
is opened still remains for now, but is also somehow
related to the MenuFloatingWindow being disposed.
(No longer reproducible when no longer calling
the base class FloatingWindow::dispose from
MenuFloatingWindow::dispose in a local test,
still needs further analysis.)

Change-Id: Ic96d2c95128af144c7769aac40707299b1c80f8c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177889
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-12-05 20:12:40 +01:00
Michael Weghorn
eed855d703 wina11y: Use existing references + drop duplicate checks
There's no need to have local raw pointer variables
in addition to the existing References.
Replace all uses of the former by using the latter
and drop duplicate checks.

Change-Id: I1339dabecbe8e1652e49df8ecd5ce2749b897f47
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177888
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-12-05 20:12:29 +01:00
Michael Weghorn
f40a68f58d wina11y: Drop unnecessary exception handling
Window::GetSystemData should never throw an
exception, so there's no need for exception
handling here. Also, return early if the
system data is null.

Change-Id: I65794f10019d0c2fb5cc7150500b551c31cc2a08
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177887
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2024-12-05 20:12:21 +01:00
Michael Weghorn
c82a5669bc vcl: Return reference in SalFrame::GetSystemData
... instead of a pointer, to make clear
that this is always non-null.

Change-Id: I4c8676913b2507f077d8a66973ab5f95e73cb497
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177886
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-12-05 20:12:14 +01:00
Michael Weghorn
4453b2f65b vcl: Return reference in SalObject::GetSystemData
... instead of a pointer, to make clear
that this is always non-null.

Change-Id: Ic0f92e672b08494cf3bfaa9a956cb78170bc1ad5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177885
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-12-05 20:12:08 +01:00
Michael Weghorn
070b198961 wina11y: Drop duplicate variable + check
No need to have `pAccessibleContext` as a raw
pointer, just use the `xContext`. And that one
has already been checked for being a non-empty
Reference above.

Change-Id: I15d7e70ddbc8b260e5e1bc0eb4e190c54d6a2ea2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177884
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2024-12-05 20:11:59 +01:00
Michael Weghorn
6708246e20 tdf#164093 tdf#157001 a11y: Improve menu window disposal
In MenuFloatingWindow::dispose, unset the accessible
before calling the base class implementation, to prevent
the accessible from getting disposed there as well.
This is necessary because the MenuFloatingWindow
doesn't create (and therefore own) its accessible
object, but returns that from its menu in
MenuFloatingWindow::CreateAccessible. Therefore,
the PopupMenu as the owner is responsible for disposing the
accessible as well, not the MenuFloatingWindow.

This logic was already implemented in Menu::dispose,
but that doesn't help in cases where the MenuFloatingWindow
gets disposed independently.

In Menu::dispose, drop the extra logic
and just call `m_pWindow.disposeAndClear`
so that MenuFloatingWindow::dispose can
take care of everything that's needed.
(For the MenuBar case, MenuBar::dispose
calls MenuBar::ImplDestroy, which unsets
Menu::m_pWindow, so other than for PopupMenu,
this change to MenuBar::ImplDestroy method doesn't
make a difference for that class.)

Don't dispose the current Menu::m_pWindow in
PopupMenu::FinishRun, but instead in
PopupMenu::ImplExecute (if set) before assigning
a new one, to ensure that the old one gets disposed.
Drop the

    SAL_WARN_IF(GetWindow(), "vcl", "Win?!");

because that case is handled fine now. Without this
change in place, I saw that warning getting triggered
while debugging (potentially because PopupMenu::FinishRun
never got reached as the menu didn't show,  maybe due to
switching focus to the IDE when reaching a breakpoint
or different timing,...).

This commit by itself doesn't yet fix the crash
from tdf#164093 seen on Windows with NVDA running
because the menu's accessible still incorrectly gets
disposed by the MenuFloatingWindow's VCLXWindow
(toolkit window peer). That will be addressed
in a separate commit.

Change-Id: Ia2931bee23204395e8b3396927acf4fa1d0f077c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177883
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-12-05 20:11:51 +01:00
Michael Weghorn
13a9a236ad wina11y: Drop special combobox handling in AccessBridgeHandleExistingWindow
It's unclear to me why the list child's accessible should
be passed instead of the window's here.

In addition, AccessBridgeHandleExistingWindow is only relevant
when the AT brigde is started, i.e. for example when starting
a screen reader while LO has been running already. This makes
this look even less relevant and unclear to me why special handling
would be applied for that case, but not when a combobox popup
is shown when a11y has been active before already.

Change-Id: Ie7b16de36889e2432f6ac9455ab297ca16d3b26e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177882
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2024-12-05 20:11:43 +01:00
Michael Weghorn
9084c484c0 wina11y: Drop always true bShow param
Change-Id: I794e486b3e5e7d341a05cec20cc218dd2cd7e242
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177881
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-12-05 20:11:34 +01:00
Michael Weghorn
db366ebcde wina11y: Replace condition by by assert in AccessBridgeHandleExistingWindow
The method only gets called from AccessBridgeUpdateOldTopWindows
which always passes a non-null window.

Change-Id: I7d6d4effb75c722af6176257b8f296b5a77734cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177880
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-12-05 20:11:25 +01:00
Michael Weghorn
5ce6b81d4d wina11y: Drop unnecessary cast to sal_uInt16
Application::GetTopWindow also takes a tools::Long param,
so there's no reason to cast to sal_uInt16.

Change-Id: Ic592262bee8173329986ccb83298a26deb3586b2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177879
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2024-12-05 20:11:18 +01:00
Michael Weghorn
d1c40cfda5 wina11y: Make these 2 methods non-virtual
Change-Id: I791ec6d822573e18c981343d3ce8371acf0b3b38
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177878
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-12-05 20:11:10 +01:00
Michael Weghorn
8a762c35ea a11y: Update comment wrt reference being (not) weak
This was using a weak reference when the comment
was added in

    commit 9b34eb7c85
    Author: Frank Schönheit <fs@openoffice.org>
    Date:   Thu Apr 25 10:24:33 2002 +0000

        #98750# be an XEventListener at the AccessibleContext

, but later changed to be a hard reference in

    commit 23d689d4e4
    Author: Thomas Benisch <tbe@openoffice.org>
    Date:   Thu Nov 7 16:19:24 2002 +0000

        #103674# change the reference to the accessible context from weak to hard

. Unfortunately that commit only references a StarDivision
internal ticket, so the exact reason remains unclear,
but at least update the comment.

Change-Id: Icdc9aec97647ae05ae7fb3f2bdc1be43c3a62619
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177848
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-12-05 20:10:59 +01:00
Michael Weghorn
ab38826d90 vcl a11y: Use comphelper::disposeComponent
Change-Id: Ifc63db272484e9a7986e6113989f2f6274f40349
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177846
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-12-05 20:10:46 +01:00
Mike Saunders
0e88a69ff0 Change infobar donate message after discussions in Marketing
Telegram group.

Change-Id: Ib0ab77fafde0a7a5abc719a7eec9ef32615f15c0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177853
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2024-12-05 19:01:48 +01:00