Commit graph

501361 commits

Author SHA1 Message Date
Michael Stahl
80cda6954a tdf#163818 package: fix recovery of zip entry local header with ...
... compressed size = 0.

The problem is that vector::data() on a vector of size 0 returns
nullptr, and osl_readFile into a nullptr buffer returns E_INVAL, which
causes an exception to be thrown.

Catch the exception, so that there is a chance to read the values from
the data descriptor instead.

(regression from commit 32cad89592
 and/or commit a6ad198d09)

Change-Id: I9b2d9a930997146faf224d8033955b142fe93f58
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176289
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Tested-by: Jenkins
2024-11-11 10:16:15 +01:00
Noel Grandin
950cd20f5f clang-tidy: performance-unnecessary-copy-initialization in chart2
Change-Id: I6f84cfea6390d6a263e5e43ec5a638260c10c00d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176374
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-11 10:10:51 +01:00
Noel Grandin
0879fd8ea4 clang-tidy: performance-unnecessary-copy-initialization in cui
Change-Id: Idbce2978dee6c485e50dc6ceccf67d7d3722bb17
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176375
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-11 10:10:38 +01:00
Miklos Vajna
1f7e854887 svx: prefix members of E3dScene
See tdf#94879 for motivation.

Change-Id: Ia235f420f9ae00ad25be4ca2c06ee942ffc3e6e4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176369
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-11-11 09:49:49 +01:00
Michael Weghorn
719bb5c719 vcl: Return unique_ptr in weld::Dialog::weld_content_area
This is effectively the weld::Dialog equivalent of

    Change-Id: Ia839fac90ea93b9ac6be5819aa4bb3261a775f33
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Sun Nov 10 23:01:07 2024 +0100

        vcl: Return unique_ptr in weld::MessageDialog::weld_message_area

Change-Id: I3eee2d3617c3576b442a5578090cd5de53e17f33
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176365
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2024-11-11 09:34:46 +01:00
Arnaud VERSINI
f39f318a6f vcl pdf : use frozen unordered_map instead of frozen map
Change-Id: I6e9c3562fa13bf5e1adf7de55c48d1e7326d288e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175969
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-11 09:06:06 +01:00
Andreas Heinisch
caeb32875a tdf#162753 - Propose clipboard content only for option internet
Change-Id: I030bc4c824ba8946104fe2e6adfd3b445de2b238
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176348
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2024-11-11 08:00:19 +01:00
Michael Weghorn
46009c8517 vcl: Return unique_ptr in weld::MessageDialog::weld_message_area
The returned weld::Container* (but not the associated toolkit
widget) is owned by the caller.
Make that more obvious by returning a unique_ptr<weld::Container>
instead of a raw pointer.

This is also consistent with what other methods returning
instances for which the caller takes over ownership
(like weld::Widget::weld_parent) do, whereas
e.g. weld::Notebook::get_page returns a weld::Container*
that is owned by the weld::Notebook instance, not the caller.

Change-Id: Ia839fac90ea93b9ac6be5819aa4bb3261a775f33
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176363
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-11-11 01:51:55 +01:00
Michael Weghorn
774786a019 tdf#130857 VclBuilder: Complete moving XML parsing to base classes
Move VclBuilder::handleMenuObject to the WidgetBuilder template
base class, and add a new purely virtual WidgetBuilder::insertMenuObject
that the existing VclBuilder equivalent now overrides.

This moves the remaining XML parsing logic from VclBuilder
to one of the base classes (WidgetBuilder, BuilderBase),
following the approach outlined in

    commit f61ecf2563
    Author: OmkarAcharekar <omkaracharekar12@gmail.com>
    Date:   Fri Sep 20 13:33:01 2024 +0200

        tdf#130857 refactor VclBuilder: Extract template base class

Update the source code comments accordingly.

For QtBuilder, initially add a dummy implementation
that simply triggers an assert, but can be adjusted
in the future to create native Qt menus.

Change-Id: I3147cac28c7273cd4c4ea7344a083cd66af8337f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176362
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-11-11 01:51:47 +01:00
Michael Weghorn
73bb40c274 tdf#130857 Move VclBuilder::handleMenu{,Child} to WidgetBuilder
Move VclBuilder::handleMenu and VclBuilder::handleMenuChild
to the base class WidgetBuilder and add a new virtual
WidgetBuilder::handleMenuObject method (used by
WidgetBuilder::handleMenuChild) that
the existing VclBuilder implementation now overrides.

This prepares for allowing to use this by subclasses
that create menus other than the VCL PopupMenu and
continues the intended separation between XML parsing
done in WidgetBuilder and actual widget creation
(in subclasses implementing the vcl::Window or toolkit
specific logic.)

Change-Id: Idc896570e4b21f6997e548b7bdab8a9610042bff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176361
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-11-11 01:51:39 +01:00
Michael Weghorn
5323a78637 tdf#130857 Add WidgetBuilder::createMenu, use to abstract from VCL-specifics
Add a new purely virtual WidgetBuilder::createMenu
and use that in VclBuilder::handleMenu instead
of directly calling VclPtr<PopupMenu>::Create there.

This is in preparation of moving
VclBuilder::handleMenu to WidgetBuilder as well,
to make it reusable for other child classes, in
particular QtBuilder.

Change-Id: Icf3f937ea8e876c8393185e41a95e0f66458ce11
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176360
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2024-11-11 01:51:28 +01:00
Michael Weghorn
df3483fa74 tdf#130857 VclBuilder: Make MenuAndId a template
Move the MenuAndId struct and the `m_aMenus` member from
VclBuilder to the WidgetBuilder base class and add two template
parameters `MenuClass` and `MenuPtr`, which VclBuilder
specializes with `PopupMenu` and `VclPtr<PopupMenu>`,
effectively leaving the logic unchanged.

Move VclBuilder::get_menu accordingly.

For QtBuilder, use `QMenu` and `QMenu*` for
the new template class parameters.
This can be used to implement support for
native Qt menus in the future.

Change-Id: Ib015b1b1e6968338ed7419b1822665a521ca748d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176359
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-11-11 01:50:43 +01:00
Michael Weghorn
c88cd599d4 VClBuilder: Avoid casting by using PopupMenu directly
Now that GtkMenuBar support was dropped in

    Change-Id: I550c83c6d5d13a5e45dc9332e981bae8b0f0a9a3

    commit fa245e4eea218b3c707998e597c526b9d1fdb508
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Sun Nov 10 20:24:11 2024 +0100

        tdf#130857 VclBuilder: Drop unused "GtkMenuBar" support

, use PopupMenu directly in MenuAndId instead of just the
Menu base class, which makes it unnecessary to cast when
a PopupMenu is wanted.

Change-Id: I51a44f219970f29a12aa15ee58e8512c62fca43e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176358
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-11-11 01:50:22 +01:00
Michael Weghorn
3bdcd536db tdf#130857 VclBuilder: Drop unused "GtkMenuBar" support
The last use of a "GtkMenuBar" object in .ui files
was dropped in

    commit 7b4169c9d5
    Date:   Wed Jun 9 01:56:48 2021 +0530

        Implement Interface for Data Providers.

Drop the code handling it, to simplify the existing code
and an upcoming refactoring.

Change-Id: I550c83c6d5d13a5e45dc9332e981bae8b0f0a9a3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176357
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-11-11 01:49:55 +01:00
Michael Weghorn
d4edde13e8 tdf#130857 qt weld: Call handlers when tab page changes
Call the corresponding handlers to notify about
the previous and current tab page when switching
the tab page in QtInstanceNotebook, by remembering
the identifier of the current page and using that
in a slot connected to the QTabWidget::currentChanged
signal.

Change-Id: I387c75b3af138cf9b89f169f0a3c223c262c2a92
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176356
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2024-11-11 01:49:34 +01:00
Michael Weghorn
5000c5bdfe tdf#130857 qt weld: Hold SolarMutex in QtInstanceButton::buttonClicked
Hold the SolarMutex when calling the button clicked
handler.

Otherwise, opening Writer's "Tools" -> "Footnote/Endnote Settings"
dialog and closing with the "OK" button triggers an assert when
using native Qt widgets (i.e. with env var
SAL_VCL_QT_USE_WELDED_WIDGETS=1 set).

Backtrace:

    1 __pthread_kill_implementation pthread_kill.c 44 0x7ffff789de5c
    2 __pthread_kill_internal pthread_kill.c 78 0x7ffff789debf
    3 __GI_raise raise.c 26 0x7ffff7849c82
    4 __GI_abort abort.c 79 0x7ffff78324f0
    5 __assert_fail_base assert.c 94 0x7ffff7832418
    6 __assert_fail assert.c 103 0x7ffff7842592
    7 ImplDbgTestSolarMutex dbggui.cxx 35 0x7fffeec2eb1e
    8 DbgTestSolarMutex debug.cxx 54 0x7ffff6d2bee0
    9 SwModify::Add calbck.cxx 174 0x7fffbe3b9f49
    10 SwClient::SwClient calbck.hxx 428 0x7fffbe3be8bb
    11 sw::ListenerEntry::ListenerEntry calbck.hxx 241 0x7fffbe3be845
    12 std::construct_at<sw::ListenerEntry, SwClient *, SwModify *&> stl_construct.h 97 0x7fffbe3be80f
    13 std::allocator_traits<std::allocator<sw::ListenerEntry>>::construct<sw::ListenerEntry, SwClient *, SwModify *&> alloc_traits.h 571 0x7fffbe3be5ec
    14 std::__cxx1998::vector<sw::ListenerEntry>::_M_realloc_append<SwClient *, SwModify *&> vector.tcc 634 0x7fffbe3be5ec
    15 std::__cxx1998::vector<sw::ListenerEntry>::emplace_back<SwClient *, SwModify *&> vector.tcc 123 0x7fffbe3be3ca
    16 std::vector<sw::ListenerEntry>::emplace_back<SwClient *, SwModify *&> vector 599 0x7fffbe3bd80a
    17 sw::WriterMultiListener::StartListening calbck.cxx 262 0x7fffbe3bb65d
    18 SwEndNoteInfo::GetCharFormat docftn.cxx 166 0x7fffbe6911c1
    19 (anonymous namespace)::lcl_ResetPoolIdForDocAndSync docftn.cxx 186 0x7fffbe69130b
    20 SwEndNoteInfo::SetCharFormat docftn.cxx 193 0x7fffbe691223
    21 SwEndNoteOptionPage::FillItemSet docfnote.cxx 342 0x7fffa88bdb58
    22 SwFootNoteOptionDlg::OkHdl docfnote.cxx 60 0x7fffa88bb484
    23 SwFootNoteOptionDlg::LinkStubOkHdl docfnote.cxx 55 0x7fffa88bb19d
    24 Link<weld::Button&, void>::Call link.hxx 111 0x7fffe4732de1
    25 weld::Button::signal_clicked weld.hxx 1519 0x7fffe47323ac
    26 QtInstanceButton::buttonClicked QtInstanceButton.cxx 102 0x7fffe473076c
    27 QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, void (QtInstanceButton:: *)()>::call(void (QtInstanceButton:: *)(), QtInstanceButton *, void * *)::{lambda()#1}::operator()() const qobjectdefs_impl.h 127 0x7fffe47332b1
    28 QtPrivate::FunctorCallBase::call_internal<void, QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, void (QtInstanceButton:: *)()>::call(void (QtInstanceButton:: *)(), QtInstanceButton *, void * *)::{lambda()#1}>(void * *, QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, void (QtInstanceButton:: *)()>::call(void (QtInstanceButton:: *)(), QtInstanceButton *, void * *)::{lambda()#1}&&) qobjectdefs_impl.h 65 0x7fffe47331e9
    29 QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, void (QtInstanceButton:: *)()>::call(void (QtInstanceButton:: *)(), QtInstanceButton *, void * *) qobjectdefs_impl.h 126 0x7fffe473311b
    30 QtPrivate::FunctionPointer<void (QtInstanceButton:: *)()>::call<QtPrivate::List<>, void>(void (QtInstanceButton:: *)(), QtInstanceButton *, void * *) qobjectdefs_impl.h 174 0x7fffe473309d
    31 QtPrivate::QCallableObject<void (QtInstanceButton:: *)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void * *, bool *) qobjectdefs_impl.h 545 0x7fffe4732fc6
    32 QtPrivate::QSlotObjectBase::call qobjectdefs_impl.h 461 0x7fffe385ace2
    33 doActivate<false> qobject.cpp 4127 0x7fffe3919054
    34 QMetaObject::activate qobject.cpp 4187 0x7fffe390ecf3
    35 QAbstractButton::clicked moc_qabstractbutton.cpp 396 0x7fffe1a24d79
    36 QAbstractButtonPrivate::emitClicked qabstractbutton.cpp 381 0x7fffe1a24c77
    37 QAbstractButtonPrivate::click qabstractbutton.cpp 374 0x7fffe1a24ad1
    38 QAbstractButton::mouseReleaseEvent qabstractbutton.cpp 976 0x7fffe1a25fbf
    39 QWidget::event qwidget.cpp 8967 0x7fffe189d44d
    40 QAbstractButton::event qabstractbutton.cpp 933 0x7fffe1a25ddc
    41 QPushButton::event qpushbutton.cpp 684 0x7fffe1b9c251
    42 QApplicationPrivate::notify_helper qapplication.cpp 3296 0x7fffe17e1989
    43 QApplication::notify qapplication.cpp 2774 0x7fffe17e366d
    44 QCoreApplication::notifyInternal2 qcoreapplication.cpp 1124 0x7fffe3843cca
    45 QCoreApplication::sendSpontaneousEvent qcoreapplication.cpp 1582 0x7fffe3844c09
    46 QApplicationPrivate::sendMouseEvent qapplication.cpp 2355 0x7fffe17e22a7
    47 QWidgetWindow::handleMouseEvent qwidgetwindow.cpp 667 0x7fffe18dc2ff
    48 QWidgetWindow::event qwidgetwindow.cpp 299 0x7fffe18daab5
    49 QApplicationPrivate::notify_helper qapplication.cpp 3296 0x7fffe17e1989
    50 QApplication::notify qapplication.cpp 3247 0x7fffe17e58bd
    51 QCoreApplication::notifyInternal2 qcoreapplication.cpp 1124 0x7fffe3843cca
    52 QCoreApplication::sendSpontaneousEvent qcoreapplication.cpp 1582 0x7fffe3844c09
    53 QGuiApplicationPrivate::processMouseEvent qguiapplication.cpp 2465 0x7fffe267ee7a
    54 QGuiApplicationPrivate::processWindowSystemEvent qguiapplication.cpp 2192 0x7fffe267e036
    55 QWindowSystemInterface::sendWindowSystemEvents qwindowsysteminterface.cpp 1113 0x7fffe27640ed
    56 QWindowSystemInterface::flushWindowSystemEvents qwindowsysteminterface.cpp 1082 0x7fffe2763f9e
    57 QtWaylandClient::QWaylandDisplay::flushRequests qwaylanddisplay.cpp 511 0x7fffdfea8575
    58 QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, void (QtWaylandClient::QWaylandDisplay:: *)()>::call(void (QtWaylandClient::QWaylandDisplay:: *)(), QtWaylandClient::QWaylandDisplay *, void * *)::{lambda()#1}::operator()() const qobjectdefs_impl.h 127 0x7fffdfec3cf5
    59 QtPrivate::FunctorCallBase::call_internal<void, QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, void (QtWaylandClient::QWaylandDisplay:: *)()>::call(void (QtWaylandClient::QWaylandDisplay:: *)(), QtWaylandClient::QWaylandDisplay *, void * *)::{lambda()#1}>(void * *, QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, void (QtWaylandClient::QWaylandDisplay:: *)()>::call(void (QtWaylandClient::QWaylandDisplay:: *)(), QtWaylandClient::QWaylandDisplay *, void * *)::{lambda()#1}&&) qobjectdefs_impl.h 65 0x7fffdfec3c1d
    60 QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, void (QtWaylandClient::QWaylandDisplay:: *)()>::call(void (QtWaylandClient::QWaylandDisplay:: *)(), QtWaylandClient::QWaylandDisplay *, void * *) qobjectdefs_impl.h 126 0x7fffdfec3b3f
    61 QtPrivate::FunctionPointer<void (QtWaylandClient::QWaylandDisplay:: *)()>::call<QtPrivate::List<>, void>(void (QtWaylandClient::QWaylandDisplay:: *)(), QtWaylandClient::QWaylandDisplay *, void * *) qobjectdefs_impl.h 174 0x7fffdfec3ab1
    62 QtPrivate::QCallableObject<void (QtWaylandClient::QWaylandDisplay:: *)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void * *, bool *) qobjectdefs_impl.h 545 0x7fffdfec39db
    63 QtPrivate::QSlotObjectBase::call qobjectdefs_impl.h 461 0x7fffe385ace2
    64 QMetaCallEvent::placeMetaCall qobject.cpp 621 0x7fffe390376c
    65 QObject::event qobject.cpp 1420 0x7fffe39055c0
    66 QApplicationPrivate::notify_helper qapplication.cpp 3296 0x7fffe17e1989
    67 QApplication::notify qapplication.cpp 3247 0x7fffe17e58bd
    68 QCoreApplication::notifyInternal2 qcoreapplication.cpp 1124 0x7fffe3843cca
    69 QCoreApplication::sendEvent qcoreapplication.cpp 1568 0x7fffe3844b79
    70 QCoreApplicationPrivate::sendPostedEvents qcoreapplication.cpp 1923 0x7fffe38464b4
    71 QCoreApplication::sendPostedEvents qcoreapplication.cpp 1755 0x7fffe38449a1
    72 postEventSourceDispatch qeventdispatcher_glib.cpp 246 0x7fffe3e2e311
    73 ?? 0x7fffea30c7df
    74 ?? 0x7fffea30ea17
    75 g_main_context_iteration 0x7fffea30f180
    76 QEventDispatcherGlib::processEvents qeventdispatcher_glib.cpp 399 0x7fffe3e2d50b
    77 QPAEventDispatcherGlib::processEvents qeventdispatcher_glib.cpp 89 0x7fffe2f59238
    78 QtInstance::ImplYield QtInstance.cxx 464 0x7fffe4709672
    79 QtInstance::DoYield QtInstance.cxx 475 0x7fffe470c6f1
    80 ImplYield svapp.cxx 385 0x7fffeed0fed6
    81 Application::Yield svapp.cxx 473 0x7fffeed0f86f
    82 Application::Execute svapp.cxx 360 0x7fffeed0f650
    83 desktop::Desktop::Main app.cxx 1679 0x7ffff7b2696b
    84 ImplSVMain svmain.cxx 228 0x7fffeed30756
    85 SVMain svmain.cxx 246 0x7fffeed32349
    86 soffice_main sofficemain.cxx 121 0x7ffff7ba04ba
    87 sal_main main.c 51 0x555555555a6d
    88 main main.c 49 0x555555555a47

Change-Id: I23aab31c981483830245130cbd06991c1732fc5c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176355
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-11-11 01:49:08 +01:00
Michael Weghorn
a7a9acc2ce tdf#130857 qt weld: Support "Footnote/Endnote Settings" dlg
Declare support for the Writer "Tools" ->
"Footnote/Endnote Settings" 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.

This is the first supported dialog making use of "GtkNotebook"/
QtInstanceNotebook, i.e. of what was implemented in previous commit

    Change-Id: I52e11ecf053a48940b88b7e6d1e6f9ba8778d9bb
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Sun Nov 10 18:54:28 2024 +0100

        tdf#130857 qt weld: Implement QtInstanceNotebook logic

For such dialogs, support doesn't only need to be declared for
the dialog's top-level .ui file ("modules/swriter/ui/footendnotedialog.ui"),
but also for the .ui files of the single tab pages
(s. SwEndNoteOptionPage::SwEndNoteOptionPage), otherwise
the tab page content isn't shown.

Change-Id: Icb8c05cf0616651ae811185095232716bea21bcf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176354
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-11-11 01:48:52 +01:00
Michael Weghorn
2f942db0c1 tdf#130857 tdf#142608 qt weld: Implement QtInstanceNotebook logic
Implement all of the QtInstanceNotebook methods,
see also GtkInstanceNotebook and SalInstanceNotebook
for the gtk3 and VCL implementations for comparison.

Unlike weld::Notebook, QTabWidget doesn't have the
concept of IDs for tabs in addition to indices.
Introduce a PROPERTY_TAB_PAGE_ID property that
gets set on the widget of the corresponding tabs
and holds the tab identifier in order to support
that.

Implement QtBuilder::applyTabChildProperties
to set the tab label and ID property by using
the newly introduced QtInstanceNotebook::setTabIdAndLabel,
so only QtInstanceNotebook needs to handle that
property.

The weld::Container* returned by QtInstanceNotebook::get_page
is owned by QtInstanceNotebook, so keep create one
on demand and keep a mapping between tab pages and
the corresponding weld::Container.

In QtInstanceNotebook::insert_page, create a new
widget and set a QVBoxLayout for now. That could
be changed to use a different QLayout class in the
future if that turns out to be more useful.

In QtBuilder::makeObject, as the tab pages are children
of the "GtkNotebook" in the .ui file, they are initially
created as child widgets of the QTabWidget.
However, they need to be set via QTabWidget::setTab instead,
so add special handling for that case towards the end and
unset the parent relationship and call that method.

Change-Id: I52e11ecf053a48940b88b7e6d1e6f9ba8778d9bb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176353
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-11-11 01:48:36 +01:00
Michael Weghorn
632b211dfc tdf#130857 qt weld: Implement QtInstanceWindow::get_resizable
Change-Id: If8814188ae5cfeabaf077f31f0ab43157ec71d7e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176352
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-11-11 01:48:18 +01:00
Michael Weghorn
fc53fdc8c3 tdf#130857 qt weld: Assert in more unimplemented methods
Add asserts, so that it becomes clear if any dialog
wants to use logic that's not implemented yet, rather
than just not doing what was requested.

This helps prioritize what to implement while
adding support for more dialogs.

Change-Id: Iee708d96260d836879974b65e240ba7343b205f6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176351
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-11-11 01:47:53 +01:00
Michael Weghorn
343c63fd02 tdf#130857 qt weld: Implement QtInstanceWindow::has_toplevel_focus
Change-Id: I62099b15349c6fec52a79c3f59f85492ec325dff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176350
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-11-11 01:47:42 +01:00
Patrick Luby
62baf23796 tdf#163764 Force pending timers to run after marked text changes
During native dictation, waiting for the next native event is
blocked while dictation runs in a loop within a native callback.

Because of this, LibreOffice's painting timers won't fire until
dictation is cancelled or the user pauses speaking. So, force
any pending timers to fire after the marked text changes.

Also, remove the fix for OpenOffice bug 106901 as causes any
key down events to cancel dictation and removing the fix does
not appear to cause the original crashing bug to reoccur.

Note: inserting a character from the system Character Viewer
window causes dictation to stop responding and the only way
I have found to restart dictation is by toggling dictation off
and then back on again. This same behavior occurs in Apple's
TextEdit application so this appears to be a macOS bug.

Change-Id: Iad2b54870ff1a315f2f71d72bef24af3cea808e6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176100
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Reviewed-by: Patrick Luby <guibomacdev@gmail.com>
2024-11-11 01:17:25 +01:00
Bogdan Buzea
e064452b8f tdf#163486: PVS: The variable was asign the same value.
V1048 The 'bNumeric' variable was assigned the same value. See line 205 and 232.

Change-Id: If047644a491c8c52933e9bc25d8d85dcbd3565c6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175154
Reviewed-by: David Gilbert <freedesktop@treblig.org>
Tested-by: Jenkins
2024-11-10 23:02:16 +01:00
Bogdan Buzea
7feaecc98a tdf#163486: PVS: The variable was asign the same value.
V1048 The 'eEnableChildren' variable was assigned the same value. See lines 2537 and 2542.

Change-Id: If1e7630ea3fc3bec8401977a011f29380c70da0c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175156
Reviewed-by: David Gilbert <freedesktop@treblig.org>
Tested-by: Jenkins
2024-11-10 22:59:51 +01:00
Bogdan Buzea
3a513d1ba4 tdf#163486: PVS: Identical branches
Change-Id: If68fa2c871472a21d9404370351828753db37ee4
V1037: Two or more case-branches perform the same actions. Check lines: 727, 731
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175159
Tested-by: Jenkins
Reviewed-by: David Gilbert <freedesktop@treblig.org>
2024-11-10 22:58:57 +01:00
Dione Maddern
c57d6827da Update git submodules
* Update helpcontent2 from branch 'master'
  to 4c8d7f27a01462bf8e05b6fd5cdc979433d62412
  - Remove empty paragraph at line 78
    
    Removed empty paragraph at line 78 to avoid warnings and translation problems.
    
    Change-Id: I6d28f08bed4ec68921c1b8640504eff966cf517c
    Reviewed-on: https://gerrit.libreoffice.org/c/help/+/176349
    Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
    Tested-by: Jenkins
2024-11-10 22:55:09 +01:00
Dione Maddern
f93681a70a Update git submodules
* Update helpcontent2 from branch 'master'
  to 9e9a188e016b3126a9b07d50084338dfead65bf6
  - Fix empty heading in 'Edit module' help page
    
    Added text to the heading in line 77, so that in now reads "Reset", to avoid the warning:
    > Helpex warning: invalid po attributes extracted from /home/timar/libreoffice-master/helpcontent2/source/text/shared/optionen/01010401.xhp
    > No string specified!> 
    > GroupID: hd_id3161832
    - and problems with translation.
    Change-Id: Ia5936a110fa1bbe663032f5fc36b07b7e1af210c
    Reviewed-on: https://gerrit.libreoffice.org/c/help/+/176347
    Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
    Tested-by: Jenkins
2024-11-10 22:54:29 +01:00
Regina Henschel
1b7bdc2955 tdf#162686 tdf#162687 ODF 1.4 extrusion-metal-type
and extrusion-specularity.

In ODF strict always value 'draw:MetalODF' was written. Changed the
logic to write 'loext:MetalMSCompatible' too, depending on eMetalType.
Using a QName as value requires a namespace declaration for the prefix
'loext'. That is now written directly at the element, not as global
declaration, to restrict its scope to the element. A global declaration
would hide when attributes or elements are accidentially written in
'loext' namespace.

The pattern for nonNegativePercent had missed the percent sign.
The export is adapted to write the percent sign.

Validation is skipped for save to ODF 1.3, because currently the
implicit validation uses always latest ODF version, see tdf#163806.

Tests are extended to cover ODF 1.4 and value draw:MetalODF.

Change-Id: I836d11b9cd327b9772e800d9797e04e1613ab2f9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176246
Tested-by: Jenkins
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
2024-11-10 18:50:37 +01:00
Caolán McNamara
873b814660 drop a static
Change-Id: Ic4eeb87e680cec3667f305e57de2f4688e1ea138
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176321
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2024-11-10 15:19:38 +01:00
Patrick Luby
5a38e4f979 tdf#163734 Revert commit f4c2c7c79c
Commit f4c2c7c79c lowered the Skia
flushing priority to solve tdf#157312. But the commit caused the
"window will dock in rectangle" border to not be drawn when dragging
a dockable window over a dockable position.

Surprisingly, tdf#157312 does not reoccur without the commit so
it appears that the commit is now unnecessary.

Change-Id: Ibd74ef94e8448cf32fd690d7a26dd098191040b8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176341
Tested-by: Jenkins
Reviewed-by: Patrick Luby <guibomacdev@gmail.com>
2024-11-10 14:49:01 +01:00
Caolán McNamara
4aae5b2c3c rRedlTable is rDoc.getIDocumentRedlineAccess().GetRedlineTable()
so make this less confusing

Change-Id: Icc4d4c43f0d35963bb71cdcd64bdd78b00ed9632
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176324
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-11-10 12:51:11 +01:00
Caolán McNamara
bc173a20ab cid#1607160 Overflowed return value
and

cid#1606794 Overflowed return value

Change-Id: I222f5fa18ed26ee92d970c744682bf21147265ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176313
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-11-10 12:50:59 +01:00
Michael Weghorn
6c957f1b49 tdf#130857 qt weld: Add QtInstanceNotebook skeleton
Add a new QtInstanceNotebook class that is the
weld::Notebook implementation using a native
Qt widget. It uses a QTabWidget.

Initially, all methods trigger an assert;
the actual logic still needs to be implemented
in future commits.

Let QtBuilder handle "GtkNotebook" objects by
creating a QTabWidget and let
QtInstanceBuilder::weld_notebook return
an instance of the new class.

Change-Id: I5a0671a1ba98bea3e0659e4f280706179bfb4d47
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176322
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-11-10 12:28:51 +01:00
Michael Weghorn
7270c44e43 tdf#130857 VclBuilder: Split XML parsing + applying tab child props
Split the existing VclBuilder::handleTabChild into two
methods and make the logic not specific to vcl::Window
available to other subclasses as well, to make it
available for reuse by QtBuilder in the future.

In order to do that, move the existing XML parsing logic
from the beginning of VclBuilder::handleTabChild to the base
class into WidgetBuilder::handleTabChild.

Add a new purely virtual method `applyTabChildProperties`
to WidgetBuilder and move the corresponding logic for
vcl::Window to the new VclBuilder override of this method.

Call that method at the end of WidgetBuilder::handleTabChild.

For QtBuilder, just add a dummy implementation that
triggers an assert initially, which matches what
would have happened right at the beginning
of the previous WidgetBuilder::handleTabChild
implementation without this commit in place.

Change-Id: Ie5664bd341182fa51035b547accf9393d65a0702
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176320
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-11-10 12:28:38 +01:00
Michael Weghorn
d18d05e2f7 tdf#130857 VclBuilder: Abstract tab control check from VCL details
In VclBuilder::handleTabChild, move casting the vcl::Window to
TabControl further down to avoid vcl::Window specific code in
the XML parsing logic.
Introduce a new purely virtual helper method
WidgetBuilder::isHorizontalTabControl,
implement for VclBuilder and QtBuilder and
use that in the XML parsing logic instead
of directly checking whether the parent is
a TabControl widget.

This  gets rid of one detail specific to the VCL
implementation in the XML parsing part and is in
preparation of further refactoring of
VclBuilder::handleTabChild for reuse with QtBuilder.

Change-Id: I05c637f81bce4a5cdd443960a1ad096c347df560
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176319
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-11-10 12:28:32 +01:00
Xisco Fauli
fa0df21584 Update git submodules
* Update dictionaries from branch 'master'
  to 1ca6cb9f31503623a5efdab58dc17cf788989ecd
  - Update Danish dictionaries to v2.8.140
    
    Change-Id: I3e3260a3e6080949a7e09f00441a062d58206306
    Reviewed-on: https://gerrit.libreoffice.org/c/dictionaries/+/176344
    Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
    Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-11-10 11:45:27 +01:00
Andreas Heinisch
bb42adb99a tdf#162753 - Propose clipboard content only for options internet and mail
Change-Id: I11ac10ac4321f15cdd9f5096457f6ea4ab8204b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176269
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
Tested-by: Jenkins
2024-11-10 11:08:08 +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
Bogdan Buzea
7713d916e0 tdf#163486: PVS: Identical branches
V1037 Two or more case-branches perform the same actions. Check lines: 94, 97

Change-Id: If4eeadad5a9985a2d4e8336ab4cba9188655b6ba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175227
Tested-by: Jenkins
Reviewed-by: David Gilbert <freedesktop@treblig.org>
2024-11-10 01:09:02 +01:00
Bogdan Buzea
0488beff8b tdf#163486: PVS: Identical branches
V1037 Two or more case-branches perform the same actions. Check lines: 94, 99

Change-Id: I406b94c79426cebbd4813a019389d0cac0616bbf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175226
Tested-by: Jenkins
Reviewed-by: David Gilbert <freedesktop@treblig.org>
2024-11-10 01:07:48 +01:00
Bogdan Buzea
cd398f3e74 tdf#163486: PVS: Identical branches
V1037 Two or more case-branches perform the same actions. Check lines: 999, 1003
V1037 Two or more case-branches perform the same actions. Check lines: 1557, 1566, 1595
V1037 Two or more case-branches perform the same actions. Check lines: 2593, 2689

Change-Id: I0a3ab375e9e8c72802615108948c96808a2ec0b4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175208
Tested-by: Jenkins
Reviewed-by: David Gilbert <freedesktop@treblig.org>
2024-11-10 01:04:19 +01:00
Caolán McNamara
c4052eaa4e cid#1607142 Overflowed constant
Change-Id: I840fbf1b472dbf0a41dc9032e4e75839dec8dc2d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176314
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-11-09 21:35:58 +01:00
Caolán McNamara
9c3133fc33 cid#1634585 Use of auto that causes a copy
and

cid#1634580 Use of auto that causes a copy
cid#1634578 Use of auto that causes a copy

Change-Id: Iad2ec6285b1eb923f3f30e8b18ee577d53ca140b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176312
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-11-09 20:21:51 +01:00
Caolán McNamara
6e9f865789 cid#1634574 COPY_INSTEAD_OF_MOVE
and

cid#1634579 COPY_INSTEAD_OF_MOVE
cid#1634583 COPY_INSTEAD_OF_MOVE
cid#1634586 COPY_INSTEAD_OF_MOVE

Change-Id: I24f4f0edf90546fe89ebecf0652f27298b5dd2a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176311
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-11-09 20:21:43 +01:00
Mike Kaganski
dcd7be141f XTopWindowListener is unused here
Change-Id: Ib4c1464d709c41f019d1910000e71075c9f5e037
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176310
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2024-11-09 19:33:09 +01:00
Mike Kaganski
ce310aa33a Use OInterfaceContainerHelper4 per listener class for type safety
Change-Id: I919fef7e981d2dbdd69eb3cce34b3236dd6ed7ad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176309
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-11-09 19:33:03 +01:00
Michael Weghorn
d0ea15aace tdf#130857 qt weld: Add QtInstanceTreeView skeleton
Add a new QtInstanceTreeView class that is the
weld::TreeView implementation using a native
Qt widget. It uses a QTreeView.

Initially, all methods trigger an assert;
the actual logic still needs to be implemented
in future commits.

Let QtBuilder handle "GtkTreeView" objects by
creating a QTreeView.

Let QtInstanceBuilder::weld_treeview return
an instance of the new class.

Change-Id: Ia3e694dbef9033fe45a6d2bdbe09fc021cd47c58
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176307
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-11-09 19:05:28 +01:00
Michael Weghorn
99b465fc3c tdf#130857 qt weld: Implement QtInstanceWidget::get_approximate_digit_width
Similar to how OutputDevice::approximate_digit_width, used
by SalInstanceWidget::get_approximate_digit_width does it,
get the width for all a text containing all of of the 10 digits
and divide by 10 to get the average/approximate width of a digit.

This method e.g. gets called by the print progress dialog.

Change-Id: Ib1779a0a211f571c10714a291fed8f84ae5906ee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176306
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2024-11-09 19:05:18 +01:00
Michael Weghorn
c74924f0fe tdf#130857 qt weld: Assert in unimplemented methods
Trigger asserts in more currently not (yet)
implemented methods, so anything missing becomes
clear more easily when working on adding support for another
dialog in the future, rather than some functionality
just not working as expected.

None of the newly added asserts was triggered
in a quick test of opening all of the dialogs
currently listed in QtInstanceBuilder::IsUIFileSupported.

Change-Id: Iea0c7aa22744cd7652ca6cbc2fbb287bfeaa4ef7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176305
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-11-09 19:05:07 +01:00
Michael Weghorn
43da735182 tdf#130857 qt weld: Implement QtInstanceWindow::present
The gtk_window_present doc says:

> Presents a window to the user.
>
> This may mean raising the window in the stacking order, unminimizing it,
> moving it to the current desktop and/or giving it the keyboard
> focus (possibly dependent on the user’s platform, window manager
> and preferences).

Therefore, call QWindow::requestActivate [2] for the Qt
implementation of weld::Window::present.

[1] https://docs.gtk.org/gtk4/method.Window.present.html
[2] https://doc.qt.io/qt-6/qwindow.html#requestActivate

Change-Id: I1c73dba1675523171a92c760836c6702a81f4c12
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176303
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2024-11-09 19:04:59 +01:00