Commit Graph
100 Commits
Author SHA1 Message Date
Neil Roberts d926f62338 lokdocview: Use m_pTileBuffer.get instead of &*m_pTileBuffer on unique_ptr
Using &* can be problematic if the pointer is null. In this case it
probably doesn’t matter, but using unique_ptr::get() is probably easier
to understand anyway. This also paves the way for a later compiler
plugin to check for this.

Change-Id: If0ece4548b44080acf6db7f8c0ac37922d1a197c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211749
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-10-07 08:40:46 +02:00
Neil Roberts 0ac807366d redlndlg: Use unique_ptr::get() instead of &*ptr
Using &* to get the pointer out of a unique_ptr can be problematic if
the pointer is null. In this case that probably can’t happen, but either
way using get() makes the code easier to understand. This also paves the
way for a compiler plugin to detect this in a later patch.

Change-Id: Ib5291002581565e227dd6ca30570ecee63ef7cba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211748
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
Tested-by: Jenkins
2026-10-07 08:40:25 +02:00
Neil Roberts 6804c10b45 SwXCellRange: Use UnoCursorPointer::get() instead of &*
Using &* can be problematic if the pointer is null. In this case I don’t
think it matters, but using UnoCursorPointer::get() is probably easier
to understand anyway. This also paves the way for a later compiler
plugin to check for this.

Change-Id: I01f77acc36cd1f96c6b438b9d6db005d0b08416a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211755
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-10-06 10:02:46 +02:00
Neil Roberts 24e58dc2c2 SwXTextPortionEnumeration: Use UnoCursorPointer::get() instead of &*
Using &* can be problematic if the pointer is null. In this case I don’t
think it matters, but using UnoCursorPointer::get() is probably easier
to understand anyway. This also paves the way for a later compiler
plugin to check for this.

Change-Id: Ic825149a64e945ad623d1a23ee8ca24655182b3e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211754
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-10-06 09:57:39 +02:00
Neil Roberts 6839513b30 unochart: Use m_pTableCursor.get() instead of &*m_pTableCursor
If m_pTableCursor is null then the initial deref in &* is undefined
behaviour, even though the resulting reference is only used to get an
address. The compiler might take advantage of this to assume that the
pointer is never null. For the dynamic_cast it might then always deref
the pointer to access the vtable without checking for null.
m_pTableCursor can be null if the SwChartDataSequence is disposed.

I don’t know whether this results in any bugs in practice, but either
way using get() is easier to understand and shouldn’t have any
performance impact, so we might as well use it.

Change-Id: I9566f4be3345dacb0af3add88cbb3fe2680ff0ce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211747
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-10-05 14:12:18 +02:00
Neil Roberts dfbde789ee tdf#173819 Remove another checkbox indeterminate state when becoming active
The split compound words checkbox in the edit style dialog is initially
set to an indeterminate state when the alignment is something other than
justify, presumably because its value is irrelevant in that case.
However, if the the user then sets the alignment to justify then nothing
was removing the that state. With the GTK plugin it was then not
possible to change the value. With the gen plugin however you could
still click it to give it a value.

This patch just makes the button inactive whenever justify is selected.
Weld then also removes the indeterminate state in that case.

This patch is similar to the previous one that does the same thing for
the paragraph composer checkbox. It is split into a separate patch to
make it easier to backport the other patch to the 26.8 branch.

Change-Id: Ib55b7a9675ba2c8234e758585d5933cbd39bfdd7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211677
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
Tested-by: László Németh <nemeth@numbertext.org>
2026-10-05 10:33:22 +02:00
Neil Roberts 8008829465 tdf#173819 Remove checkbox indeterminate state when becoming active
The paragraph composer checkbox in the edit style dialog is initially
set to an indeterminate state when the alignment is something other than
justify, presumably because its value is irrelevant in that case.
However, if the the user then sets the alignment to justify then nothing
was removing the that state. With the GTK plugin it was then not
possible to change the value. With the gen plugin however you could
still click it to give it a value.

This patch just makes the button inactive whenever justify is selected.
Weld then also removes the indeterminate state in that case.

Change-Id: I9c7bebb168f526497d406b1b93b9d5161e251cfa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211676
Reviewed-by: László Németh <nemeth@numbertext.org>
Tested-by: Jenkins
Tested-by: László Németh <nemeth@numbertext.org>
2026-10-05 10:33:12 +02:00
Neil Roberts 73415deaf4 Related tdf#173389 Improve wording in tooltip
“If you want to prefer” makes it sound like the user would be doing the
preferring, but for some reason they don’t quite dare actually do it and
instead they only “want” to do it. I think the intention is probably
that the justification algorithm should be doing the preferring. This
patch puts the preferring in the passive voice so that the subject
of the verb doesn’t have to be mentioned.

Change-Id: If6de27be688ccb03d80fa559c6027af08aea7c6c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211669
Reviewed-by: László Németh <nemeth@numbertext.org>
Tested-by: Jenkins
2026-10-05 10:15:46 +02:00
Neil Roberts a18375bf84 tdf#173818 Update sensitivity of letter spacing label when change alignment
The justification section of the dialog is all disabled whenever the
chosen alignment is something other than “justify”. When the value is
changed the sensitivity of all of the controls is updated, except that
the update for the label for letter spacing was missing. This looked
weird on the dialog.

Change-Id: Ibc774402ce72f820f14ea8265b20cb0113f84be9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211675
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-10-02 08:24:44 +02:00
Neil Roberts b4a5600843 Related tdf#173585 Assert that pointer is not null when deref SwUnoCursor
Changes SwUnoCursor::operator* to use shared_ptr::operator* so that it
will assert that the pointer is not null. This should help catch cases
that were relying on undefined behaviour to get a pointer to the
returned reference.

Change-Id: If90db9404a34fb08bfef506eb00ebd99fb82406b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211698
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-10-02 08:23:55 +02:00
Neil Roberts 0e64bd4f89 tdf#173585 sw: Add a unit test for when findAll finds no results
The test replicates the instructions in the bug report. Jenkins is
building with optimisations for MacOS so the test should be able to
catch the original problem if it were to regress.

Change-Id: Ia8fd381be15ef3986fdb1f515be45097abf614ff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211377
Tested-by: Jenkins
Reviewed-by: Dan Williams <dcbw@libreoffice.org>
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-10-01 18:46:08 +02:00
Neil Roberts b991ec6042 tdf#173293 Use InvocationHelper in ooo.vba.excel.Application
ScVbaApplication now contains a comphelper::InvocationHelper member
which it forwards methods and properties to when ScVbaSWFunction doesn’t
recognise them. This makes it possible to access methods such as
getSelection when via the XInvocation such as when accessing the object
via pyuno.

Change-Id: I1481d4f2e613037ae9283bd86844bd4d805cd2bf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210131
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-09-25 10:39:30 +02:00
Neil Roberts 6154aa313c Related tdf#173293 comphelper: Add helper class for XInvocation
Lots of classes implement XInvocation in order to add extra methods and
properties that are determined at runtime. One problem with this is that
when such an object is introspected with the css.script.Invocation
service then that service uses the XInvocation interface directly to
query what methods and properties are supported instead of creating an
XIntrospectionAccess via the css.beans.Introspection service. It looks
like probably all of the current implementations of XInvocation only use
it to advertise the dynamic methods and don’t advertise any concrete
methods provided by any interfaces that the object implements. This
means for example that when the object is accessed by pyuno, only the
dynamic methods and properties can be used.

This patch adds a helper class that can be used to help implement
XInvocation in such a way that if a requested method isn’t found as a
dynamic method, it can pass the method call on to the helper which will
use the normal Introspection service to query the available methods and
properties.

Change-Id: Ia4363594ee274c36249a0d1c94f16a829ace4647
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210130
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-09-25 10:39:19 +02:00
Neil Roberts 1f917206a1 tdf#169387 Add a unit test to check the Python home
Adds a unit test that loads a Python module through the Python loader.
The module contains an XJob that checks whether sys.prefix is a
subdirectory of the LibreOffice install directory.

Change-Id: I095ac0dfb835ce47c5ad28807d47fc96b9f10266
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211360
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2026-09-24 08:37:49 +02:00
Neil Roberts bf12f2ae46 Update git submodules
* Update helpcontent2 from branch 'master'
  to f278ad6cec7ac36994fd1ebcdc277185cd0e4090
  - tdf#157170 Update name of angle quote option in page for localised options
    
    The label for the option changed in the commit below.
    
    commit 63a5c6350f
    Author: Stéphane Guillou <stephane.guillou@member.fsf.org>
    Date:   Tue Sep 26 22:27:03 2023 +0200
    
        tdf#157170: clarify angle quotes autocorrect rule
    
        Change-Id: Idb514e0e0487a65e3057328a13d34659d706ab90
        Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157300
    
    Change-Id: Ieb932d6bd2a1984825019b77da8afdaf58cddb56
    Reviewed-on: https://gerrit.libreoffice.org/c/help/+/211068
    Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
    Tested-by: Jenkins
2026-09-22 19:15:05 +02:00
Neil Roberts 8f079ccb72 Update git submodules
* Update helpcontent2 from branch 'master'
  to 62f69099ad2e27830783e7c478c7bd7624ac2893
  - tdf#172042 Add help for the Esperanto AutoCorrect option
    
    Add’s help for the auto correct option to replace x’s with circumflexes.
    
    Change-Id: I6e8969a806b52905404a21fbe718981e7b2975a8
    Reviewed-on: https://gerrit.libreoffice.org/c/help/+/211070
    Tested-by: Jenkins
    Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
2026-09-22 19:10:48 +02:00
Neil Roberts d0d4b02157 tdf#173585 sw/unoobj2: Don’t dereference a potentially null pointer
SwXTextRangesImpl::GetCursor was extracting the pointer out of
sw::UnoCursorPointer by getting a reference to the cursor with
operator*() and then taking a pointer to that. However, the cursor
pointer can be null, so in that case the method was relying on being
able to return a reference to a dereferenced null pointer. Dereferencing
nullptr is undefined behaviour. The code was probably getting away with
that because the reference is only used to immediately take a pointer.
However it looks like whatever compiler is used to make release builds
for MacOS was taking advantage of the undefined behaviour to assume that
the cursor pointer is never null. This was making it optimise out the
check for !GetCursor() at the top of SwXTextRangesImpl::MakeRanges, so a
crash ensued.

This patch just makes it use UnoCursorPointer::get instead which
directly returns a pointer without going through a reference.

Change-Id: I67169165e8d2da0f6500ca40db7c38e7b2890826
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211318
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-09-22 19:03:01 +02:00
Neil Roberts 7b431c1688 pythonloader: Remove redundant checks for old python versions
Since the commit below, the minimum required Python version is 3.11 so
any #ifdefs for handling previous versions are no longer needed.
Removing them makes the code easier to maintain.

commit 39cb96f0b6
Author: Neil Roberts <nroberts@libreoffice.org>
Date:   Thu Jun 11 18:25:02 2026 +0200

    configure: Update the required Python version to 3.11

Change-Id: I40ce6b7453243ec76860a659e7bc087c7d257f87
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211290
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Tested-by: Jenkins
2026-09-21 20:48:15 +02:00
Neil Roberts e11160b50b tdf#169387 tdf#168461 Use Py_InitializeFromConfig
The commit below tried to change pythonloader to set the Python home
using PyConfig instead of setting PYTHONHOME. However, it only built up
the PyConfig locally on the stack and never actually passed it to
Python. This meant that when building with Python versions >= 3.8 the
Python home was never actually set. When using an internal Python, it
ended up printing an error message about not being able to find platform
independent libraries.

commit da0e9240bf
Author: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Date:   Thu Dec 21 12:01:50 2023 +0200

    tdf#158447 Use PyConfig for setting Python home directory with Python >= 3.8

    Change-Id: Ic5b7c60613b22f5215cb1a2a13fecf3e0946ca49
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161089

Change-Id: Icda3b0e538b958a04357027c486fd3af17a8fca1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211289
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2026-09-21 20:47:35 +02:00
Neil Roberts fe40f03933 tdf#173575 Fix mnemonic in Range for %VALUETYPE label
The character to indicate a mnemonic with VCL widgets is ~, not _. I
didn’t notice this because it was working fine with the GTK plugin,
presumably because it ends up accepting either character internally. The
previous string was copied from a UI file where the mnemonic character
does need to be _. Now that the string has changed I’ve changed the
context too because it will end up as a new string for translators now
anyway.

Change-Id: I5e52926ea4cdfd50bed6dda5d4cd6a5a5f550b4f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211226
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
Tested-by: Jenkins
2026-09-19 18:11:44 +02:00
Neil Roberts 643aab12aa tdf#173575 Don’t display “%VALUETYPE” if range is too small
If the selected range is too small when Insert->Chart is used then most
of the controls in the “Data Series” tab are disabled. Additionally,
nothing was updating the “Range for %VALUETYPE” label defined in the UI
file so it would be left with this stub visible in the UI. This patch
makes the default label instead just be “Range”. The previous string is
now defined in strings.hrc instead of reading from the label value when
creating the dialog so that it can be updated when a valid range is
selected.

Change-Id: Ib926383825f32042dc0c6d33a115d139a50c5aa6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211102
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-09-18 14:42:31 +02:00
Neil Roberts 03878c973c Update git submodules
* Update helpcontent2 from branch 'master'
  to 7076b3f10fdfca1b9b4ecf01601dfb7c24588495
  - tdf#173271 The --language option now overrides the config
    
    Updates the help to reflect the new behaviour of the --language option
    which now overrides the config.
    
    Change-Id: Ie2394e96636cab06ab4862da7b31854d7ef8eef9
    Reviewed-on: https://gerrit.libreoffice.org/c/help/+/210241
    Tested-by: Jenkins
    Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
2026-08-28 14:58:04 +02:00
Neil Roberts ea5ca8254e Update git submodules
* Update helpcontent2 from branch 'master'
  to 903af3b41f5931fdd288b469a812e7a1610f0d18
  - Fix instructions for editing paragraph style from context menu
    
    Since the commit below, the context menu option to edit the paragraph
    style is in a nested paragraph menu instead of directly being on the
    main context menu.
    
    commit 140fd0a1b1
    Author: andreas kainz <kainz.a@gmail.com>
    Date:   Thu Feb 21 18:19:56 2019 +0100
    
        sync swform ui files with swriter ui files
    
        Change-Id: I1657c495928f8c7b86032c974a218f8db4f9b6ba
        Reviewed-on: https://gerrit.libreoffice.org/68170
        Tested-by: Jenkins
        Reviewed-by: andreas_kainz <kainz.a@gmail.com>
    
    Change-Id: I943eaeb6fa84cfdf5ed60ad228b989c8261a8b8a
    Reviewed-on: https://gerrit.libreoffice.org/c/help/+/210233
    Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
    Tested-by: Jenkins
2026-08-28 14:56:52 +02:00
Neil Roberts 7fe6fc9210 tdf#173271 Make the --language option override the config
Previously if the user has configured a language preference in the
config then that choice took precedence over the --language option. It
seems like the --language option is intended for temporary testing of a
language so it would be more useful if it overrode the language choice
in the config.

Change-Id: I30d027b685b9fabda42f40c12599310dfbfc7cfa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209982
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-08-28 13:46:13 +02:00
Neil Roberts 43c9f0fbab Add translator comments to “View” and “Edit” buttons of style dialog
Without any context on Weblate, it is easy to use the automatic
suggestions to translate “view” as in “a view” like in the view menu.
This might look weird when the button is meant to be paired with the
“edit” button which is more likely to be translated as an action. For
example, the French translations are currently “affichage” (noun) and
“modifier” (verb).

This patch adds translator comments to make the strings clearer.

Change-Id: I45bab89ffaf2e0f42a208a9ee1924a6f7f358b07
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209990
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-08-26 08:34:28 +02:00
Neil Roberts 66dfcf9803 tdf#173170 Don’t show the “resize all pages” checkbox if not requested
If the caller of the dialog doesn’t request the
SID_ATTR_RESIZE_ALL_PAGES attribute then the checkbox to configure
whether to resize all pages will now be hidden. This fixes the problem
that the checkbox was shown in Writer and Calc but it actually only has
any effect in Draw and Impress.

Change-Id: I47a0d5320071c00830f5e95ad3d6753c56ecc0f1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209413
Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
Tested-by: Jenkins
2026-08-21 08:07:02 +02:00
Neil Roberts 5b684e2133 tdf#173192: Make separate strings for the Create from X label
The insert table of contents dialog box has a label used as a section
header which contains “Create %s from” where %s is replaced by the
currently selected ToC or index type. Previously this was generated by
replacing the %s part with the text from the drop down box to select the
type. This is difficult to translate for a lot of languages. Instead,
this patch adds a different string for each possible type.

Change-Id: I6a906be6ae88373e8f79b32d7bff87b77680f280
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209363
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2026-08-20 07:44:50 +02:00
Neil Roberts a036d7a379 tdf#173193 Don’t set label-xalign and shadow-type properties on GtkBox
Those are properties of GtkFrame, not GtkBox. This was causing the table
of contents dialog to crash when using the GTK backend because
GtkBuilder rejected the UI file. I suspect this was a cut-and-paste
mistake in the patch below:

commit 2ad2d0e524
Author: Marios <xrteach@gmail.com>
Date:   Tue Jul 28 22:00:06 2026 +0300

    tdf#153770 Clarified the Create From section in ToC/Index dialog and reordered

Change-Id: I85cd26ffd874f57d0407ab7b45daa69fd7190af6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209355
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-08-19 23:24:44 +02:00
Neil Roberts 365de006d1 tdf#173160 Maintain order of arguments to macro
The arguments for a macro when invoked by the dispatch provider get
converted from a set of PropertyValues to a sequence of Anys containing
just the values. Since the commit below, the TransformItems step was
changed to store the PropertyValues in an unordered_map which makes the
order of the values unpredictable. If the dispatch provider is used to
execute a macro then the order of the arguments becomes important
because the macro has no other way to determine which argument
represents which property. In order to maintain the previous behaviour,
the dispatch method now reorders the arguments so that they have the
same order as before. The previous order was determined by the order the
properties were handled in TransformItems.

commit e8d73d5307
Author: Mike Kaganski <mike.kaganski@collabora.com>
Date:   Wed Dec 3 10:45:35 2025 +0500

    Let TransformItems return comphelper::SequenceAsHashMap

    Simplifies its usage in all places where the result needs to be
    modified.

    Change-Id: I37f8d99827e0f1cb2b6e4f4f7735e26fb87f6703
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195162

Change-Id: Iacf64650842eb62c0a2bd266784aa9c7accf45bd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209231
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
Tested-by: Jenkins
2026-08-18 18:31:55 +02:00
Neil Roberts 3a0fabe6d9 sc: Fix typo in strings for the BYROW and BYCOL funcs
Change-Id: Iea0a266647a8d568470ba27b2375588114fdcc15
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209131
Reviewed-by: Benjamin Urban <urbanben2513@gmail.com>
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-08-15 09:04:48 +02:00
Neil Roberts 317f8e9dff tdf#173124 Split string for CSV column types into separate strings
This string is a confusing mix of several strings seperated by
semicolons. It seems quite easy for translators to misunderstand so
let’s just split them out into actual separate strings and add a
comment.

The patch below recently changed the string so it will now have to be
translated again. For the previous string, it looks like there are
mistakes in the translation for Persian and Tibetan which seem to have
replaced the semicolons with a different symbol.

commit 77ea61b986
Author: Heiko Tietze <tietze.heiko@gmail.com>
Date:   Fri Aug 7 08:02:20 2026 +0200

    Resolves tdf#172980 - Rename 'Hide' to 'Skip' in CSV import dialog

Change-Id: Ic05abf5943d75ecadf312d898b46b9a79bb6bbac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209108
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-08-13 14:22:10 +02:00
Neil Roberts aed5ae5d21 tdf#173114 pyuno: Add unit test for objects with XInvocation
Adds a service to embindtest that implements XInvocation to handle all
possible method names and returns the name as a string. A Python unit
test then uses this. Without the fix pyuno would throw an exception when
it tries to use the XInvocation object that doesn’t also implement
XInvocation2 and return a valid reference for getIntrospection.

Change-Id: Icb3359c788acd5eda37980252e5fc5c956b38100
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209087
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-08-13 12:43:09 +02:00
Neil Roberts 97302647ba tdf#173114 pyuno: Don’t require XInvocation2
If an object implements XInvocation then the Invocation service will
directly return the object instead of creating its own invocation
wrapper. In that case the object isn’t guaranteed to also implement
XInvocation2. Previously, this was making pyuno just throw an exception
whenever it encounters one of these objects.

The only case where XInvocation2 is actually used is the implementation
of the __dir__ method. I don’t think this method is used very often so
it’s probably OK to just make it return an empty list if XInvocation2
isn’t supported. That way we can just store a reference to XInvocation
instead of XInvocation2.

This change makes it possible to use objects that implement XInvocation
from Python, for example ooo.vba.excel.Application.

Change-Id: I822c4ffa760f52d6488b9c1009435d059fc19fdd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209086
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-08-13 12:43:01 +02:00
Neil Roberts dcc46669fa tdf#173114 pyuno: Handle XInvocation::getIntrospection returning null
Many implementations of XInvocation for internal objects return null for
the getIntrospection method. In pyuno this method is only used in one
place to try and catch the case where the wrapped object is already a
PyUNO adapter. Let’s check for null in that case and assume the object
isn’t an adapter so that it won’t crash when handling objects that
implement XInvocation.

Change-Id: I26576a1a9fec92c679373d9ab47824d992065041
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209085
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
Tested-by: Jenkins
2026-08-13 12:42:53 +02:00
Neil Roberts 935803f2f1 pyuno: Combine two implementations of PyUNO_dir into one
PyUNOStruct_dir is an almost exact copy of PyUNO_dir. This deletes the
first one and makes the struct code instead directly use PyUNO_dir. The
object version has the small advantage that it pre-allocates the Python
list to the right size so the struct code can now take advantage of that
too.

This will make it easier to modify the dir implementation for both use
cases in a later patch.

Change-Id: I7ebe2e6d547fd27c228842effd534e8d71d634ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209084
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-08-13 12:42:45 +02:00
Neil Roberts 7d2d7e7738 tdf#173116 Translator comments for Calc print preview notebook strings
These strings are kind of hard for translators to find so let’s give a
hint in the description.

Change-Id: I8387b54226c757d6af664c09573cc3387b69cc09
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209089
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-08-12 17:46:57 +02:00
Neil Roberts 2756d38adf [API CHANGE] tdf#172967 SwXTextView: Allow selecting multiple ranges
The select method of XSelectionSupplier can now accept a Sequence of
Anys containing XTextRanges to select at the same time. If any of the
ranges overlap then the whole sequence is rejected.

Change-Id: Ib4930b3144e92285cb504d1ae2ac27263d30d440
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208898
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-08-12 11:05:36 +02:00
Neil Roberts a3c8270e51 tdf#173043 Fix translator comments in xcu files
The commit below tried to add translator comments to a bunch of strings
containing “outline”. This wasn’t done correctly for xcu files because
in that case XML comments are ignored and instead the comment can be
added with a pseudo-language tag called “x-comment”.

commit 9dd7345159
Author: Neil Roberts <nroberts@libreoffice.org>
Date:   Fri Aug 7 17:35:49 2026 +0200

    tdf#173043 Add translator comments to strings containing “outline”

Change-Id: I1a4e21b98ebbaba5072a8064b67d0ab8fe583e1a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209076
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-08-11 16:29:37 +02:00
Neil Roberts 9dd7345159 tdf#173043 Add translator comments to strings containing “outline”
The word “outline” in LibreOffice can refer to either the lines of the
shape of something or an overview of something. When the string is quite
short it’s difficult for translators to know which meaning is intended.
There seems to be quite a lot of cases where the translators have got
this wrong. In order to help them this patch adds translator comments to
a bunch of the strings to explain which meaning should be used.

Change-Id: I4b75cc829128633bc9382817fc574d55a09af8a4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209037
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-08-09 12:12:44 +02:00
Neil Roberts 0066e963bc cui: Add a translator comment for the “No Bold/Italic” strings
The string in Weblate is presented just as “No %1”. The %1 is replaced
with the name of a font style. Without the context it’s easy to
misunderstand this as being an abbreviation for “number”. At least the
Dutch and Esperanto translations seem to have done this.

Change-Id: I220db88346a84e67b0e34affb1b8e7023cfbb90d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209053
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
Tested-by: Jenkins
2026-08-09 11:28:20 +02:00
Neil Roberts 6685fe38e0 Use “allows X-ing” instead of “allows to X” in UI
“Allows to X” sounds wrong if it doesn’t also have the person it is
allowing as the object of the sentence. See this:

https://english.stackexchange.com/questions/60271/grammatical-complements-for-allow

For the text in the tooltip it is describing what the widget does rather
than giving a command so it should have an “s”, like “[this widget]
allows selecting…”.

Change-Id: I39883bfcd7b8f8e3392b3bf564130720fa6daaf2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208986
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
Tested-by: Jenkins
2026-08-06 16:24:00 +02:00
Neil Roberts dbbac9fbfe provider_expandall: Don’t skip test if QuickJS provider isn’t built
The commit below changed the unit test so that if the QuickJS provider
isn’t available then the entire test is skipped. Even if the provider is
available, it also changed the check condition so that the test is
skipped if the dummy JavaScript macro was not found. This makes creating
the dummy macro a bit pointless.

The idea of the test is to make sure that all of the script providers
return nodes that can be handled from Python. If the QuickJS provider
isn’t available then it’s still interesting to test the other providers.
If it is available then we want to make sure the dummy script is found
otherwise the test won’t be checking that the nodes returned by the
singleprov code can be handled by Python.

This patch changes the logic so that it will continue the test even if
the QuickJS provider isn’t built but in that case it will skip the
assert that the dummy macro is found.

commit feddb7e827
Author: Christopher Sherlock <chris.sherlock79@gmail.com>
Date:   Sat Jul 25 17:17:33 2026 +1000

    tdf#172532 scripting: fix --without-java builds in provider_expandall.py

Change-Id: I81b83e6b5504d452c7ab05754c1296ff90d364e9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208991
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
Tested-by: Jenkins
2026-08-06 15:49:05 +02:00
Neil Roberts 95959da85b tdf#172199: Don’t skip disabling read-only when already in read-only mode
When a read-only document is saved to a new file using the SaveAs
command it is supposed to become editable. The commit below added a
check whether the document is currently read-only before proceeding to
remove the read-only status. The patch also makes the read-only method
true if the document has restricted fonts, so presumably the intention
was to avoid removing the read-only status in that case. However it
ended up making the condition so that read-only status is only removed
if the document isn’t read-only, which of course doesn’t make sense.

This patch instead extracts the part from IsReadOnly that checks whether
the document has restricted fonts and only checks for that instead.

commit fdd24dabb6
Author: Mike Kaganski <mike.kaganski@collabora.com>
Date:   Mon Aug 11 17:55:27 2025 +0500

    tdf#145967: Initial support for docs with restricted embedded fonts

Change-Id: I7e59bf53e759110a636c398dc8f5af56b1e2da8c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208746
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-08-01 13:22:58 +02:00
Neil Roberts dce6dcd302 tdf#172952 uitabpage: Use separate strings for the Apply to X button
The dialog for choosing a UI has a button at the bottom to apply the
setting only to the current module and it has the text “Apply to
%MODULE” where %MODULE gets replaced with a non-translatable name for
the module.

For better or worse, some translations (such as Esperanto) have
different names for the modules. For example Writer is Verkilo. For the
sake of consistency, it would be nice to be able to translate these
strings.

It is also difficult translate this string in languages that have a lot
of grammatical cases. For example, in Slovakian the translator might
ideally want to translate the string as “Použiť vo Writeri” and “Použiť
v Calcu” etc, but they currently can’t do this because they would need
to be able to add a different suffix depending on which module is being
used.

In order to fix both problems there is now a specific string with the
whole text for each module.

Change-Id: I7c478790d89bf33f26b53642a076f9e308d1e64a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208800
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2026-07-31 12:39:05 +02:00
Neil Roberts 33cdc558f9 uitabpage: Split part of GetCurrentApp into version to get the enum
The part of GetCurrentApp that gets the enum of the current app is now
split out into a separate function so that it can be used in a later
patch.

Change-Id: Iee2d00cc8384c6c05cd36c5ebcfe5df3174dfd21
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208859
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-07-31 12:38:33 +02:00
Neil Roberts fcf0f1e680 tdf#167864 tdf#167927 Don’t toggle resize/rotate handles if mouse moved
When clicking on a draw object, instead of storing the position of the
object to detect whether it has moved on mouse up, the position of the
mouse is stored instead. That way it will skip toggling the
resize/rotate handles if the mouse moves outside of a threshold for any
reason not just if the object is dragged to a new position. This fixes
the problem that dragging to resize the shape or moving an edit handle
without changing the shape’s position was causing the handles to be
toggled. This is similar to check used in
sd::FuSelection::MouseButtonUp.

This partially replaces the fix in the commit below:

commit 677e40c8b8
Author: Oliver Specht <oliver.specht@cib.de>
Date:   Mon Apr 14 11:59:22 2025 +0200

    tdf#166177 Fixes unintended switch to rotate mode

Change-Id: Id97266fd89f40fc2e9351771fd555c620d66ba84
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208498
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-07-24 09:13:57 +02:00
Neil Roberts 6a4bf34e5a singleprov/ScriptFile: Implement XCopyableBrowseNode
Implements XCopyableBrowseNode on the ScriptFile class so that all
script providers based on the single-file provider can support copying.

Change-Id: I14aa057ac432ff80e4a4841fbe5c19be082aa099
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208161
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-07-23 15:18:33 +02:00
Neil Roberts 54ba86b578 scripting: Replace XAggregation of XBrowseNode with helper function
The browse node factory had a wrapper using XAggregation that wraps
every XBrowseNode. As far as I can tell this was used to replace the
implementation of getChildNodes with one that checks for exceptions from
the underlying provider and then sorts all of the resulting nodes by
name. The trouble with this is that it prevents the script providers
from detecting when a node is one from the same script provider and thus
makes it difficult to implement the XCopyableBrowseNode interface. The
documentation for XAggregation mentions this problem and also states
that the interface is deprecated.

To avoid this overhead, this patch replaces the aggregation with a
helper function in comphelper that should be used to retrieve children
from a browse node. That takes care of catching exceptions and sorting
the results.

Change-Id: I319888fee1b84ddcef397317d2cf7e72bd2867cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208160
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-07-23 15:18:22 +02:00
Neil Roberts f213860e49 basic/sbxmod: Combine two impls of CutLines into helper method
Previously there were two copies of a function called CutLines which
were used to remove a method from a string containing BASIC source code.
These have both been replaced with a helper method on SbModule that
returns the source without the given method.

Change-Id: I70c4a4ffe40085bd090ee6823c46154c057468e4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207062
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-07-22 15:59:07 +02:00
Neil Roberts 0b7d925276 sbutil/searchEOL: Fix mixed endings with first one \r
Fixes the case when the string to be searched contains mixed ending
types and the first one is “\r”. Previously it would have searched for
the “\n” first and skipped over the “\r”.

Change-Id: I945087f2b93d92e73781c07b9b3cdaf9064d1122
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207061
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-07-22 15:59:00 +02:00
Neil Roberts af830cc577 Move searchEOL from basicide to a general basic utility
Moves the searchEOL function from basicide to a general purpose utility
function in the basic module. This also adds some unit tests for it.

Change-Id: I8f446990654415a994b7964dd62706f3204d817a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207060
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-07-22 15:58:49 +02:00
Neil Roberts 9b60447481 Make SbMethod::GetLineRange const
This method doesn’t modify any state so I don’t think there’s any reason
not to make it const.

Change-Id: I51748ce2d95b2967ae76b9c5015a49df99d7fa07
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207059
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
Tested-by: Jenkins
2026-07-22 15:58:39 +02:00
Neil Roberts 8d77a6a77d officecfg: Add a unit test to execute macro in AcceleratorKeyChecker.fodt
Adds a unit test which executes the macro in the utility document
AcceleratorKeyChecker.fodt. This should help make sure it doesn’t bit
rot if there are API changes in the core source code.

Change-Id: Id972dda31d0c8a09904e76dd6fd9760c9f2ad739
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208220
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-07-20 10:01:40 +02:00
Neil Roberts b42b3d5c64 AcceleratorKeyChecker: Fix retrieving the accessibility context
The macro in the document was relying on the document window directly
implementing the XAcessible interface. This is no longer the case so the
macro was hitting an error. This fix is based on the changes in the
commit below:

commit d1a25112bb
Author: Michael Weghorn <m.weghorn@posteo.de>
Date:   Wed Jun 18 17:49:48 2025 +0200

    java a11y tests: Don't rely on XWindow being XAccessible

Change-Id: Ie8cede2108f26e9d36cf1cf16e47f7ec5feab722
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208207
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-07-20 10:01:10 +02:00
Neil Roberts c8dc49153b scripting/qa/provider_expandall: Disable the Java-based JavaScript provider
The build configuration on the build bots enables both script providers
for JavaScript. One of them will end up being chosen for the
provider_expandall test and that probably depends on non-deterministic
factors such as the order of files on the disk. If the Java-based one is
chosen then the test will fail because it will ignore the temporary
JavaScript macro file created for the test. We do specifically want to
test the QuickJS-based provider in this test case because we want to
make sure the singleprov code is compatible with Python. The Java-based
script provider code will already be tested because of the Beanshell
provider. This patch therefore uses the remove method of the service
manager to just disable the Java-based JavaScript provider.

Change-Id: I265f4cf2191c0c5d08894c700be346ed93d12898
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208226
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
Tested-by: Jenkins
2026-07-19 09:52:31 +02:00
Neil Roberts cff7386f71 testofficehelper: Don’t assert the context is true after terminating
Once XDesktop.terminate is called, there is a race condition where if
the termination completes before the truthiness of the context is
checked then it will end up checking on a disposed object and the test
will fail. The check for truthiness ends up calling __len__ on the UNO
wrapper which tries to query some interfaces on the object. This might
be the cause of some failures on Jenkins. I can replicate it if I put a
short sleep after calling terminate. This patch just makes it check the
truthiness immediately instead of waiting until after terminate is
called.

Change-Id: I41f93ca15a52dd45fc304dfd7d4c6d954ca26e42
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208225
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
Tested-by: Jenkins
2026-07-18 12:14:32 +02:00
Neil Roberts becb1c338e tdf#165689 MacroManagerDialog: Add copy/paste buttons
Adds copy and paste buttons to the Macro Manager dialog so that script
files can be copied with script providers that support the
XCopyableBrowseNode interface. The “copy” button selects the file to be
copied and then the “paste” button works when a destination is selected.

Change-Id: I058b7ed53c837d17723b5f1b4e69f0bc7ae2594f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207738
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-07-15 12:28:50 +02:00
Neil Roberts 25458311e0 pythonscript: Implement the XCopyableBrowseNode interface
Implements the XCopyableBrowseNode interface on the Python script
provider.

Change-Id: I17c6916567518fd9f28d11724def4a0d98f53ed9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207737
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-07-15 09:09:36 +02:00
Neil Roberts d2429a3c46 pyuno: Reuse wrapped object when converting Python obj through UNO and back
When any2PyObject is given an interface which is actually an adapter for
a Python object, it now returns the original Python object instead of a
new wrapper for the object. This means that calling methods on the
returned object will be faster because they won’t involve UNO bridging.
It also means that Python implementations of UNO interfaces can detect
when they are given Python objects as a parameter and take advantage of
any internal private data attached to the object.

Change-Id: Ie13d0612f48e70973bd523e68710ec33a7875a16
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207507
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-07-15 09:09:22 +02:00
Neil Roberts 63e28543e7 [API CHANGE] Add an interface to make a browse node copyable
Adds an optional interface to BrowseNode that can be used to query
whether a node can be copied and also invoke the actual copy. The goal
is to use this from the macro dialogs in later patches to support drag
and drop of script files.

Change-Id: I396a493d704d481b8f0d52c16a77f6452159d76e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207736
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-07-15 09:09:03 +02:00
Neil Roberts dfb49f33f6 tdf#172532 scripting: Add Python unit test accessing all provider nodes
Adds a Python unit test that just tries to retrieve all child nodes from
the master script provider in order to check that they are all
accessible from Python.

Change-Id: I97185b7f21f38a79fdda4078a69d8e88b10cbaed
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207349
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-07-15 09:08:38 +02:00
Neil Roberts be27055b34 tdf#172532 basprov: Use new concrete interfaces for optional methods
Instead of using XInvocation and XPropertySet to expose the optional
edit method, the BASIC script provider now uses the new concrete
interface XEditableBrowseNode.

Change-Id: I7a99a1c335f408da9b0ac26c741577eb449e63c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207348
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
Tested-by: Jenkins
2026-07-15 09:08:17 +02:00
Neil Roberts b447e5d7b2 tdf#172532 singleprov: Use new concrete interfaces for optional methods
Instead of using XInvocation and XPropertySet to expose the optional
create and edit methods, the script providers based on singleprov now
use the new concrete interfaces XCreatableBrowseNode and
XEditableBrowseNode.

Change-Id: Iae966e554f436b8708699c7d86311f165db2d19f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207347
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-07-15 09:07:55 +02:00
Neil Roberts f67727b46c tdf#172532 Java provider: Use new concrete interfaces for optional methods
Instead of using XInvocation and XPropertySet to expose the optional
create and edit methods, the script providers based on Java now use the
new concrete interfaces XCreatableBrowseNode and XEditableBrowseNode.

Change-Id: Ibc72c434544eb129e30b406d527bef4bb6eea264
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207346
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
Tested-by: Jenkins
2026-07-15 09:07:21 +02:00
Neil Roberts e0fb7f2466 tdf#172532 pythonscript: Use new concrete interfaces for optional methods
Instead of using XInvocation and XPropertySet to expose the optional
create and edit methods, the script provider for Python now uses the new
concrete interfaces XCreatableBrowseNode and XEditableBrowseNode.

Change-Id: Ic5944f2ade291598bac6f39411e86b351ffb0082
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207345
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
Tested-by: Jenkins
2026-07-15 09:06:29 +02:00
Neil Roberts ca34fab9cc [API CHANGE] tdf#172532 Add concrete interfaces for manipulating scripts
Adds optional concrete interfaces that can be added to implementations
of XBrowseNode to create, delete, edit or rename nodes. The comphelper
abstraction now uses these if the interface is implemented otherwise it
will fall back to the old method using XPropertySet and XInvocation so
that existing script providers will continue to work.

The goal is to avoid using XInvocation for duck-typed methods because
that breaks pyuno. It is also easier to implement the optional
interfaces than to use the previous approach.

Change-Id: Id59136152941fd232673ec4b9082a0be0cb6ca8d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207344
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
Tested-by: Jenkins
2026-07-15 09:05:46 +02:00
Neil Roberts 2365c64aa3 comphelper: Add helpers for accessing duck-typed methods of XBrowseNode
Implementations of XBrowseNode have a bunch of extra methods which are
accessed by using XPropertySet::getPropertyValue to determine if the
action is possible and then XInvocation::invoke to invoke it. This patch
adds wrappers around checking and invoking these methods. The idea is to
abstract away the actual implementation so that the approach can be
changed in a later patch.

Change-Id: I117ab848391dbb1277f9331d6a93f71c2cb556ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207343
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
Tested-by: Jenkins
2026-07-15 09:05:13 +02:00
Neil Roberts 785bff8f88 objectbrowser: Use locale-dependant decimal separator
It now uses LocaleDataWrapper::getNum to format the number of seconds so
that the right decimal separator can be used.

Change-Id: Ic433e6b9f91619bf32526befce00006a6021f79e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206349
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
Tested-by: Jenkins
2026-07-12 10:38:34 +02:00
Neil Roberts 7f8a06f4d2 objectbrowser: Add a translator comment to “Returns”
I noticed that the French translation misunderstood it so maybe it needs
a comment.

Change-Id: I84e41252a7cf6607d29faadf2a498fe4cc1fb6e5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206348
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-07-12 10:38:11 +02:00
Neil Roberts e0620bd443 objectbrowser: Use pluralisable strings in the description pane
This avoids having ungrammatical text like “1 items”.

Change-Id: I292f398bcfd2375f7b838e99230f6493840ccedb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206347
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-07-12 10:38:02 +02:00
Neil Roberts 715da59c42 testofficehelper: Retry connecting indefinitely
This test is sporadically failing on Jenkins. The test_default_config
test effectively only waits a total of 16 seconds for LibreOffice to
start up before giving up. The assumption is that this isn’t long enough
when the build bots are under heavy load from parallel testing.

This patch removes test_default_config and replaces the delays in the
other two tests with an infinite iterator so that it will keep trying to
connect every second forever. If there is a real problem launching
LibreOffice on Jenkins then eventually the kill-wrapper will kick in to
make the test fail.

Change-Id: I31c223892b7c5329c253c90703ec587874029d56
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207771
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-07-09 10:46:55 +02:00
Neil Roberts 64df8d7617 tdf#172670 TreeView: Make iter_n_children return 0 with children on demand
On at least the GTK and gen plugins, iter_n_children was returning 1
when the node has children on demand but then iter_children will return
false in order to ignore the dummy node. This was causing an infinite
recursion when iter_previous is called and the previous node has
on-demand children because that uses the result of iter_n_children to
determine if the node has children and then uses iter_children to move
to a child node without checking the return value. That meant the
iterator wouldn’t move and it would keep searching from the same place
forever.

This patch fixes it by making iter_n_children non-virtual and making it
bail out early with 0 if the node has children on demand. Otherwise it
will ask the backend via a virtual function which has been renamed to
do_iter_n_children so that it is similar to how do_iter_children works.

Change-Id: Ie9a3d5d51c9eae0789048fa5240441663642595d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207589
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2026-07-08 09:48:49 +02:00
Neil Roberts 8b44be318a singleprov: Fix testing properties on directories in unit test
The test that checks the editable and creatable properties in nested
directories was always checking them on the provider node instead of the
nested directory node. This was probably due to a cut-and-paste
kerfuffle.

Change-Id: I083c84fff1229553ddaedd99b4f6c11f5127ed70
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207342
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-06-27 21:17:16 +02:00
Neil Roberts 775587d503 Related tdf#171924 Make macro manager dialog track document like run dialog
The Macro Manager dialog now keeps track of which XModel every node in
the tree is coming from just like the Run Macro and Organize Macros
dialogs. That way it can determine whether a macro should be runnable
based on whether it’s in a document rather than whether the user happens
to be looking at a document that has macros. This also fixes a problem
where the run button would not work from the start center.

The UI test is heavily copied from the UI test for the run macro dialog.

Change-Id: I8a47234511fa78ba7d2f97f78f42df8f58416cbc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207244
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
Tested-by: Jenkins
2026-06-25 10:55:05 +02:00
Neil Roberts 55937ed56e Related tdf#168623 MacroManager: Implement Delete for BASIC macros
The delete button is now enabled when a BASIC macro is selected and it
causes the macro to be deleted using the new shared helper function.

Change-Id: I22ce8787eb753254a94e385d11684e0f0de8a677
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207058
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
Tested-by: Jenkins
2026-06-24 14:37:01 +02:00
Neil Roberts c9ef750019 MacroManager: Add methods to get selected BASIC module and method
Adds GetSelectedBasicModule and GetSelectedBasicMethod to get the
selected SbModule or SbMethod when a node in the BASIC branch of the
tree is selected.

Change-Id: Id97634698b1c838a20026b249720901490de9f52
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207057
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
Tested-by: Jenkins
2026-06-24 14:36:49 +02:00
Neil Roberts 00bd4b4aef basctl: Make QueryDelMacro a DLL public function
That way in can be used by the Macro Manager in a future patch.

Change-Id: Ifafcc360fa5ad8319b25593ca3b170e96d4ac8e8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207056
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-06-24 14:36:41 +02:00
Neil Roberts bc67811c52 basctl: Move DeleteMacro to a common helper function
Moves the DeleteMacro method from MacroChooser to a common helper
function so that it can later be used in other dialogs too.

Change-Id: Ibc909f0411de9db54f4aed5e1c71659c017287aa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207055
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-06-24 14:36:33 +02:00
Neil Roberts 14aadcd280 tdf#172556 Show dialog from Macro Organizer when script can’t run
When the run button in the Macro Organizer is pressed for an embedded
script with macros disabled in the security settings it now displays a
dialog box instead of silently doing nothing.

Change-Id: I5bae91570a19e444881d56efc29f3dd735a22a78
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207231
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
Tested-by: Jenkins
2026-06-24 14:28:41 +02:00
Neil Roberts 8d31bbc003 tdf#172556 Show a dialog box when macro can’t be run for security
The code to invoke a macro selected from the Run Macro and Macro Manager
dialogs has now been moved to a shared helper function. The function
additionally checks the return value and shows an error dialog if the
macro can’t be run because of the security settings.

Change-Id: Ie46ae295269e63dfec0236030ee9d2e12e04329e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207214
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-06-24 14:28:33 +02:00
Neil Roberts ff9899db6e Move string for macro security denied from basctl to sfx2
That way it can be used by other modules in later patches.

Change-Id: I5ea8ab0d835276e68de761d7e9b8924753388e6d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207213
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-06-24 14:28:25 +02:00
Neil Roberts 43bae78c12 DocumentRedlineManager: Search for types using ContainsType
The methods GetRedlinePos, GetRedlineEndPos and HasRedline try to find
redlines that match a specific type. However, they weren’t considering
stacked entries in an SwRedlineRange so they would only find the entries
if it’s the top one.

This fixes the “weird thing” in tdf#172185. Marking the entire text as
bold ends up putting the delete redline as the second entry in the stack
so it wasn’t being found.

Change-Id: I719dc67f98094390152b8492cb2daf10428d6c3c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205478
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
Tested-by: Jenkins
2026-06-24 09:24:09 +02:00
Neil Roberts 6d0b80fdf2 SwRedlineRange: Add a method to check if the stack contains type
A few places in the code try to find redlines of a particular type by
iterating over the SwRedlineRanges and comparing the type with
GetType(). However, SwRedlineRange can actually have a stack of
redlines, so comparing this way only checks whether the topmost stack
entry has the type. This patch adds a method to search the whole stack
for the given type. This will be used a later patch.

Change-Id: Ic1852c67428b62e12df59ddade0c3fb58d9aa0cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205477
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-06-24 09:24:00 +02:00
Neil Roberts 9bda674e65 tmpdlg: Don’t try to remove dialog tabs that were never added
If you open the Format->Page style dialog when looking at an HTML
document the code tries to remove a bunch of tabs that were never added.
The code that would add them is already gated on !html_mode. On a debug
build with the gtk backed this causes an assert failure. It looks like
it has always been like this since the code was added in the patch
below:

commit a2304f62e9
Author: Caolán McNamara <caolanm@redhat.com>
Date:   Thu Aug 30 09:43:59 2018 +0100

    weld writer page style dialog and SvxBorderBackgroundDlg

Change-Id: Ib650b2d5a4d8788f1159a5058a1651a7eb5c8303
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207173
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-06-23 22:40:30 +02:00
Neil Roberts 049f332965 tmpdlg: Don’t try to remove non-existant background tab
When Styles->Edit Style is clicked for an HTML document the code was
trying to remove a tab called “background” but this is never added
anywhere. This was causing an assert failure when using a debug build
with the GTK plugin. It looks like this has always been there since the
code was added in the patch below:

commit b78edeca86
Author: Caolán McNamara <caolanm@redhat.com>
Date:   Mon Oct 1 20:20:51 2018 +0100

    weld writer parastyle dialog

Change-Id: I9d02d99d596ab301e6c4e8ebd32f78b443649502
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207196
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-06-23 17:12:25 +02:00
Neil Roberts 58efdfd898 Related tdf#168623 Fix renaming empty Java/BeanShell libraries
The base script provider in Java for several languages was throwing an
exception when trying to rename an empty library. The browsenodes member
variable was being lazily created when getChildNodes was called but in
the case where there were no children it was being left as null which
was causing a Java runtime exception.

Change-Id: I0d9eac2006bc26d47c22f2e1a7a4424fd67a512f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207152
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-06-23 08:16:16 +02:00
Neil Roberts 5e3784870e pyuno/officehelper: Use f-strings instead of ''.join
This is probably slightly easier to understand.

Change-Id: If41ee1b3fd21d246447638056657d2ee56274ad8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206261
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
Tested-by: Jenkins
2026-06-22 12:21:28 +02:00
Neil Roberts 8fa45b9f69 Related tdf#171441 idedataprovider: Lazily load libraries on demand
Instead of loading all of the scripting libraries when IdeDataProvider
is initialised, it now only loads them when the children are requested.
This is probably a good idea for efficiency anyway, but it also
partially fixes the problem described in tdf#171441. Loading a library
ends up making the members of the library accessible in the global
namespace of a running script. That meant that just openining the macro
editor would cause the IdeDataProvider to make all members of all
libraries available to the current script. If we lazily load them then
they are instead only available if the object browser is manipulated.
This is still a problem, but it’s no worse than the existing object
catalog and macro dialogs which also have the same problem (see comments
4&5 of the bug).

Change-Id: I43ccd06cee45e53e6575f768fa24fe4befeefc20
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206473
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-06-22 10:24:38 +02:00
Neil Roberts 39cb96f0b6 configure: Update the required Python version to 3.11
Updates the configure script to explicitly require the same version of
Python as mentioned as the baseline in the README. This is for both the
version required for building and the version for pyuno.

All versions less than 3.9 are already end-of-life and version 3.11 is
currently in security-fix-only mode so it is probably quite reasonable
to require that.

Previously the configure script only checked for version 3.3, or 3.7 if
internal Harfbuzz is being used. In practice it probably hasn’t worked
to build with anything less than 3.6 since desktop-translate.py started
using f-strings in 2022.

Change-Id: Ice26324f4e7805bc37a0dd07d984451460529249
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206368
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-06-19 15:58:00 +02:00
Neil Roberts ef2cee37c5 pyuno: Set UNO_PATH when running testofficehelper
Otherwise the bootstrap function will just run whatever soffice
executable it finds in the PATH instead of the one built in the build
directory.

Change-Id: I122ca8efc80a7f134f7d06fb248ca1bc1108b0b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206949
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-06-18 13:16:23 +02:00
Neil Roberts c1f4dc187b pyuno/officehelper: Let UNO_PATH work on macOS
On macOS a hard-coded path is used for the soffice binary. It probably
makes sense to avoid doing this if the UNO_PATH environment variable is
set.

Change-Id: I160bbec8a7ddffbb7032b55a61a3004e9d42bf18
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206263
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-06-12 09:30:42 +02:00
Neil Roberts 40034e4b49 pyuno/officehelper: Simplify handling of UNO_PATH a little bit
Instead of calling os.path.join with an empty string when UNO_PATH is
not set, it is now only called when UNO_PATH is set.

Change-Id: I8ebf99d1849e62634860686c0bb4c9d0c2a9c0d6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206262
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-06-12 09:30:16 +02:00
Neil Roberts b7224c8628 pyuno/officehelper: Let python quote process args instead of shell
subprocess.Popen can take an array argument with the arguments. If we do
this instead of trying to build up a single argument to pass to the
shell then we can let Python handle quoting the arguments on Windows.
This also means the executable path could contain spaces on platforms
other than Windows too.

Change-Id: I7779c5bab431b65cf4a602047c184fe78d802d77
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206260
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-06-12 09:29:33 +02:00
Neil Roberts 3cddd0bb95 sdext: Use Translate::nget for two strings with numbers
Two strings used in the Presentation Optimizer were using a count
without using pluralisable strings. They are only used with counts > 1
so maybe the assumption was that there is only one possible plural form,
but of course some languages have several plural forms that need
differing strings even for larger numbers.

I noticed this because the French translation was incorrect for
STR_DELETE_SLIDES as if %SLIDES was going to be replaced by a type of
slide rather than a number. Maybe if the string had plural forms that
would have been more obvious.

Change-Id: Icf2df1bfed3907226e45e819ad0c14c4a33e8bfe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206314
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-06-11 13:36:08 +02:00
Neil Roberts 14c0e370dc objectbrowser: Don’t mark Basic and IDL keywords as translatable
These strings are being used to build up a declaration for either a
Basic subroutine or a method from an IDL file. In the English original
they are the actual keywords used by the code. If they get translated it
is confusing because it looks like a new programming language. For
example in French the acess2base.Module.ProcOfLine function looks like
this in the description pane:

ProcOfLine(Facultatif pvLine Comme Variant,
           Facultatif pvProcType Comme Variant) Comme String

The “Facultatif” and “Comme” are translations of the “Optional” and “As”
keywords.

This patch just replaces them with string literals.

Change-Id: Icb427ebaa587f99ee2ce81a2e6997787a535001e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206335
Tested-by: Jenkins
Reviewed-by: Jonathan Clark <jonathan@libreoffice.org>
2026-06-11 10:26:46 +02:00
Neil Roberts 3223245186 pyuno: Don’t use PyObject_CallOneArg
That function was added in Python 3.9. Even though the LibreOffice
README says the baseline is 3.11, the configure script actually lets you
build with 3.3. I tested with Python 3.5 and it does work apart from
that function call and the fact that desktop-translate.py is using
f-strings. The call to PyObject_CallOneArg was added in the patch below
after the 26.2 branch point so it hasn’t been battle-tested in a release
version yet. Seeing as it’s easy to use an alternative let’s do that in
case someone is using a really old version of Python with pyuno for some
reason.

commit 45d2412c78
Author: Neil Roberts <bpeeluk@yahoo.co.uk>
Date:   Wed Feb 11 16:40:48 2026 +0100

    tdf#171122 pyuno: Add class getter methods for singletons

Change-Id: Ic6f7cf8d0005f59e8cbfd1f9703d393b7e30dabe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206333
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-06-11 08:23:25 +02:00
Neil Roberts 5e3838839d pyuno: Add testofficehelper to the pyuno module
Otherwise the tests aren’t actually run.

Change-Id: I781bcfe42726a7109e0494e02124690d34395232
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206259
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-06-10 10:22:59 +02:00
Neil Roberts fa05a80aae [API CHANGE] tdf#171950 Add API to create 2- and 3- color scales
The existing API allows creating a color scale conditional format but it
has no entries and there is no API to create an instance of
XColorScaleEntry in order to add one. For data bars the existing API
instead creates a conditional format with two existing entries and then
you can use the XDataBarEntry interface to modify them. This patch makes
the color scale API work like the databar one. It adds constants to
ConditionEntryType to create a 2-color or 3-color scale which have the
entries pre-created.

This is an API change because it adds constants to an unpublished
constant group. It also makes it so that the getType method on the
conditional format will now return either COLORSCALE2 or COLORSCALE3
depending on the number of entries. In practice I think this is very
unlikely to break any existing code.

Change-Id: I28faa6c66ac3963220786e8da45a2d550058f095
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205944
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-06-09 13:11:16 +02:00
Neil Roberts 599d616d3e tdf#172333 Call AddCondFormatData after creating condformat with API
Without this the conditional formatting isn’t immediately visible in the
document after creating it with the API until the document is saved and
reloaded. This call seems to be the missing piece that sets the
ATTR_CONDITIONAL attribute on the cells. It is also called from
ScDocFunc::ReplaceConditionalFormat when creating a conditional format
with the UI.

Change-Id: I4a4e48a9ada62c8635e13ac47f94f7d7dc76b4b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206224
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-06-09 13:11:08 +02:00
Neil Roberts 745a783a7e customisation: Don’t try to remove non-existant notebookbar tab
Since the commit below the notebookbar tab no longer exists on the
customisation dialog. If you open the dialog from the start center the
code tries to remove this tab by name. At least on the GTK backend, this
ends up hitting an assert failure. This patch just removes that code.

commit 7312d7d3c9
Author: Heiko Tietze <tietze.heiko@gmail.com>
Date:   Wed May 20 15:28:42 2026 +0200

    Relates tdf#166641 - Add category labels to Writer's Tabbed Notebookbar

Change-Id: Id430ef85bba5fb748108b89987bf73ee2acc4257
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206003
Reviewed-by: Dan Williams <dcbw@libreoffice.org>
Tested-by: Jenkins
2026-06-09 12:01:13 +02:00