Files
odfstudio/desktop
Michael Weghorn 2826c3087f tdf#172885 qt: Support '-style=...' and '-stylesheet=...' command line args
Quoting from the QApplication ctor doc [1]:

> All Qt programs automatically support the following command line options:
>
> * -style= style, sets the application GUI style. Possible values depend on
    your system configuration. If you compiled Qt with additional styles or
    have additional styles as plugins these will be available to the
    -style command line option. You can also set the style for all Qt
    applications by setting the QT_STYLE_OVERRIDE environment variable.
> * -style style, is the same as listed above.
> * -stylesheet= stylesheet, sets the application styleSheet. The value must
    be a path to a file that contains the Style Sheet.
    Note: Relative URLs in the Style Sheet file are relative to the
    Style Sheet file's path.
> * -stylesheet stylesheet, is the same as listed above.

So far, LibreOffice's command line argument
processing/evaluation would prevent passing these
options as they were considered invalid arguments
for LibreOffice.

Adjust this to simply ignore the "-stylesheet=..."
and "-style=..." variants when validating command
line arguments, and pass these on to the QApplication
in QtInstance::CreateQApplication.

Notes:

* For now, only the single-arg variants using "=" are supported,
  i.e. "-style=<somestyle" and "-stylesheet=<somestylesheet>", but
  not "-style <somestyle>" or "-stylesheet <mystylesheet>".
  The logic could be extended as needed in the future.

* At the point in time that the command line argument processing
  happens in LO, the vcl plugin hasn't been created yet, so there
  is no good way to tell whether one of the Qt-based vcl plugins
  is actually going to be used. Just allow the arguments if one
  of them was enabled at build time. If another vcl plugin (e.g. gtk3)
  is used, those arguments are simply ignored.

[1] https://doc.qt.io/qt-6/qapplication.html#QApplication

Change-Id: I3a4bf2071eaf875e45bdd9cd5b5f928118412cb2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208833
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2026-07-30 21:45:15 +02:00
..
2026-06-09 14:49:09 +02:00
2025-03-17 08:35:00 +01:00
2025-02-12 16:45:56 +01:00
…
…

LibreOffice Binary

Code for the LibreOffice main binary (soffice) resides here. The soffice_main function for the soffice binary can be found here.

Stable Interface

Some of the artifacts built here are part of a LibreOffice installation set's stable interface, which (programmatic) clients can depend on. Among them are:

soffice

In the program directory (program/ on Linux and Windows, Contents/MacOS/ on macOS).

unoinfo

In the program directory (program/ on Linux and Windows, Contents/MacOS/ on macOS).

When called with a sole argument of c++, it prints to stdout an absolute pathname denoting the directory where the public URE libraries are found.

When called with a sole argument of java, it prints to stdout a marker character (either an ASCII '0' or '1') followed by a sequence of zero or more absolute pathnames denoting jars or directories that need to be included in a class loader's search locations.

If the marker character is '0' (on Linux and macOS), the pathnames are encoded as bytes, and any two pathnames in the sequence are separated from each other by NUL bytes.

If the marker character is '1' (on Windows), the pathnames are encoded as UTF-16-LE two-byte code units, and any two pathnames in the sequence are separated from each other by two-byte NUL code units.

Other Binaries

oosplash

Splash screen for the LibreOffice soffice binary.

Extensions

The directory test/deployment contains some extensions to be used for testing:

  • test/deployment/crashextension: C++ extension to make LibreOffice crash. Useful for testing Crashreporter.
    • Build with Extension_test-crashextension.
    • Extension can be found in workdir/Extension/test-crashextension.oxt
  • test/deployment/passive: C++, Java and Python extension samples with passive registration.
    • Build with make Extension_test-passive.
    • Extension can be found in workdir/Extension/test-passive.oxt
  • test/deployment/active: C++, Java and Python extension samples with active registration.
    • Build with make Extension_test-active.
    • Extension can be found in workdir/Extension/test-active.oxt