493 Commits
Author SHA1 Message Date
Andrea Gelmini ebbe637cc0 Fix typos in code and comments
Change-Id: Ib4330a7696cbee7c5cdd27ddc14f0741fab7e833
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210048
Tested-by: Jenkins
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2026-08-27 20:39:06 +02:00
Jesus Solis 39dcff4a99 tdf#156931 add import support for JPEG XL image format
Change-Id: I5b8c70d5739fdc91b0ca30fbaa780a5c7004741d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208352
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-08-26 11:43:32 +02:00
Andrea Gelmini c5cc182b91 Fix typos
Change-Id: I80d258fd04aa4c268e6468c4612250e49065fdc7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209900
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2026-08-25 14:31:09 +02:00
Khaled Hosny 9061517ef3 vcl: Drop the now unused CFF charset parser
Change-Id: Idd4e33fa413b9a00391b9c1f57c29404bfa6a0aa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208914
Tested-by: Jenkins
Reviewed-by: Khaled Hosny <khaled@libreoffice.org>
2026-08-01 15:04:18 +02:00
Noel Grandin 3a46865a64 simplify MSC_VER conditionals
we require _MSC_VER >= 1930 now

Change-Id: I493a3fe4267c8ea148d411535b9de24666154722
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2887
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit adb5dce15a169d0142f40eb8efff94c6822c7dbc)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206640
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-16 01:20:43 +02:00
Armin Le Grand (collabora) 3b0aa2199e SmartArt: Calc Diagram Im/Export improvements
Calc imported Diagrams due to using mainly DrawingLayer
oox import code, but export, even of the unchanged
DomTrees, was missing (just never done). Thus in
versions before this being a Diagram was lost, it
just always was converted to a GroupHierarchy containing
the Shapes that were part of the Diagram.

Added to read the Diagram's name at Import at all for Calc
oox import, set and used now at the created Diagram.

Added to secure/save the DomTrees for the imported
ReplacementGraphic when importing oxx Calc, that was just
also never done, so it could not be exported as unchanged/
original data (and was not, so that was never noticed).

Added complete export of oox Diagram to Calc. This includes
unchanged versions, but also changed/added versions. This
may need more work, but own turn-around works already.
This mainly uses the same ExportContent, but that needed
some adaptions.

Doing this I also changed the ShapeImport of Calc to use
a single oox::drawingml::ShapeExport, before it created
a separate temporary one for every Shape that was imported.

Also added the checkMinimalDataDoms check to Calc oox
export that is already used in the other apps. As always,
there are huge differences in oox im/export for Calc
compared to the other apps, e.g. a completely different
Group ImportContext is used compared to Impress and I have
no idea why that is done.

Signed-off-by: Armin Le Grand (collabora) <Armin.LeGrand@collabora.com>
Change-Id: Ib7c1b73f7f72599f6054d0cf9203f46980eec5cf
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1887
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Armin Le Grand <armin.legrand@collabora.com>
(cherry picked from commit b1fbe49401e5e4dbe62ff25580ec7252c0376e88)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206019
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-05 12:42:07 +02:00
Tomaž Vajngerl ebe3264a9e sc: Sheet view sync - Code review fixes
Change-Id: Ia5ffa2de76859c5b9673a6ab51910e27c5a6b3cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199522
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202004
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit 8a89cc05482215de732c2d9be805d6cfce3a9949)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205397
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-20 17:01:01 +02:00
Tomaž Vajngerl d264369da3 sc: Use "sc.op" for logging of operations
It is easier to isolate the logging this way.

Change-Id: I5ab65e30257c8c8d29ae75a223ff67cb0b41c4fd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199448
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202002
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit 4d3c1de5ddbf2b315306eb0c0225fa711b648a27)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205395
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-20 17:00:43 +02:00
Stephan Bergmann 811769f009 Consistently use __EMSCRIPTEN__ instead of EMSCRIPTEN macro
...as emsdk 5.0.3 deprecated the predefined EMSCRIPTEN macro (see
<https://github.com/emscripten-core/emscripten/commit/506052bd8b4e23ded7f2351c62ca3b24d40c8cf3>
"Warn about usage of deprecated EMSCRIPTEN macro. NFC (#26381)"), causing
failures like

> In file included from static/source/unoembindhelpers/PrimaryBindings.cxx:29:
> In file included from include/sfx2/viewsh.hxx:35:
> In file included from include/editeng/outliner.hxx:32:
> In file included from include/tools/color.hxx:26:
> include/osl/endian.h:66:15: error: macro 'EMSCRIPTEN' has been marked as deprecated: use __EMSCRIPTEN__ instead [-Werror,-Wdeprecated-pragma]
>    66 | #elif defined EMSCRIPTEN
>       |               ^
> /home/sberg/emsdk/5.0.4/emsdk/emscripten/main/cache/sysroot/include/emscripten/emscripten.h:35:66: note: macro marked 'deprecated' here
>    35 | #pragma clang deprecated(EMSCRIPTEN, "use __EMSCRIPTEN__ instead")
>       |                                                                  ^

To avoid confusion, also suppress the -D$(OS) in
solenv/gbuild/platform/unxgcc.mk that would unnecessarily keep defining
EMSCRIPTEN.

Change-Id: Ic1f187cf1c6417cd95d4092e9cea01a665bd1b2f
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/34
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 50291c2ed83bdb49bb827a4a12905d94b8c42035)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205167
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-05-14 10:11:38 +02:00
Swarnadeep Paul 560efd29ea tdf#146619 Cleanup/Removal of headerfiles
Change-Id: Ic5b44d5d9e1f9b099f8dafac0ce90db3e510fb87
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203518
Reviewed-by: Jonathan Clark <jonathan@libreoffice.org>
Tested-by: Jenkins
2026-04-15 17:31:51 +02:00
Khaled Hosny 0a17b69e07 Assert less in CFF to Type 1 code
The top-level function already returns a boolean, make many of the
internal functions return false in case of failure and propagate that
instead of asserting in debug builds and continuing with bad input in
release builds.

Change-Id: I00c5f9552eb114af1f406f5f1c2ead50fe6b97e4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201228
Tested-by: Jenkins
Reviewed-by: Khaled Hosny <khaled@libreoffice.org>
2026-03-09 11:21:15 +01:00
Noel Grandin 5e627c8422 move SAL_LOG code out of line
which is beneficial when we have a --enable-sal-log release build,
since most of the time the logging stuff will not be executed.

This is restricted to GCC because clang seems to have trouble
with the lambda binding in some places. (tested with clang 12.0.1)
I get errors like:
  cppuhelper/source/servicemanager.cxx:775:40:
  error: reference to local binding 'rImpls' declared in
  enclosing function 'cppuhelper::ServiceManager::addSingletonContextEntries'
  "Arbitrarily choosing " << rImpls[0]->name

Change-Id: I3fe6deb94996542b552af1e201f5a68f0136c680
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192151
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit f6b9b77d65c70ae77fa617c53e11d149a9fee1d1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192192
Tested-by: Jenkins
2025-10-11 20:28:09 +02:00
Michael Weghorn 7d40ccfe19 rust_uno: Define + use valid log areas (loplugin:sallogareas)
As described in include/sal/log.hxx, log areas may not
contain "_", and they need to be defined:

> For all the other macros, the given area argument must be non-null and must
> match the regular expression
>
> @verbatim
>   <area> ::= <segment>("."<segment>)*
> @endverbatim
>
> with
>
> @verbatim
>   <segment> ::= [0-9a-z]+
> @endverbatim
>
> For a list of areas used see @ref sal_log_areas "SAL debug areas". Whenever
> you use a new log area, add it to the file include/sal/log-areas.dox .

This fixes errors like the following ones seen for a --enable-rust-uno
build with clang plugins enabled:

    /home/michi/development/git/libreoffice/rust_uno/uno_bootstrap.cxx:38:14: error: unknown log area 'rust_uno' (check or extend include/sal/log-areas.dox) [loplugin:sallogareas]
       38 |     SAL_INFO("rust_uno", "Initializing UNO component context for Rust binding");
          |              ^

    /home/michi/development/git/libreoffice/codemaker/source/rustmaker/cpproduce.cxx:1011:14: error: unknown log area 'codemaker' (check or extend include/sal/log-areas.dox) [loplugin:sallogareas]
     1011 |     SAL_INFO("codemaker", "Struct member " << member.name << " UNO type: " << unoType);
          |              ^

Change-Id: I4ac11fc343f340488d15607cc7262ca57b6a4850
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190847
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2025-09-12 13:56:23 +02:00
Kohei Yoshida 2e5e6c6ef3 Upgrade liborcus to 0.20.2
For Windows build, explicitly define HAVE_FILESYSTEM which forces
orcus to use std::filesystem for all filesystem related operations.

Also, pass to the ctor of orcus::file_content a filepath as
std::u16string_view on Windows to hopefully correctly handle unicode
filepaths.

Change-Id: Ie6f5403212e73c81f1a36db0413133d26a3a67f2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189892
Reviewed-by: Kohei Yoshida <kohei@libreoffice.org>
Tested-by: Jenkins
2025-08-20 05:50:12 +02:00
Caolán McNamara b15bbced0c use /*coverity[+returnsnull]*/ as fallback for SAL_RET_MAYBENULL
+returnsnull / -returnsnull

    Specifies that a function might / might not return NULL. In the
positive case, the return value must be verified to be non-NULL before
it is dereferenced.

    For example, the +returnsnull annotation in the following code
specifies that the value of fetch_ptr should always be verified.
Unverified values will be reported by the NULL_RETURNS checker (and do
not depend on statistical analysis).

//coverity[+returnsnull]
int* fetch_ptr(int idx) {
    ...
}

Change-Id: I827b665d3bc01546c8596457c50ebd860894f677
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189397
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2025-08-12 12:06:40 +02:00
Stephan Bergmann 0066897796 Allow SAL_LOG_FILE to add process ID to file name
...so that different processes (e.g., when soffice.bin gets automatically
restarted) less easily overwrite each other's log files.  The protocol (to
mostly stay backwards compatible and only use a single file name by default) is
to append a process ID iff the value of SAL_LOG_FILE ends in a hyphen, in which
case the process ID is appended to that value.

Change-Id: I516d7a286d029a16afc2f1379d5353f3f0eb5767
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188914
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-08-04 14:54:30 +02:00
Caolán McNamara a545cf4767 cid#1660813 etc, push the boat out for another coverity major cycle
Change-Id: I9077a58362423febca6e63cacc404c346d9af87b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188586
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-07-30 14:45:19 +02:00
Oscar Megía López 323598a684 tdf#157668 Upgrade to pass options to --convert-to
The user can now pass the available options
for each graphic type to export.

For example:

$ instdir/program/soffice --convert-to 'jpg:calc_jpg_Export:\
{"PixelWidth":{"type":"long","value":"1280"},\
 "PixelHeight":{"type":"long","value":"1024"},\
 "Quality":{"type":"long","value":"8"}}' --outdir /tmp Calc.ods

Change-Id: I77211805f4fd726da7d5fb0818ac422c3e9b6c96
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186287
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-06-17 08:37:11 +02:00
Mike Kaganski 145656fdff Initial Markdown export filter stub
Based on the Writer's HTML export code. For now, it doesn't export
anything yet, just creates an empty file.

Change-Id: I0d484d2b5bc549f34e674c8f858acb352e275c83
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184201
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 8e83a343a49b2053bc08326a109956f224a47ae1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185283
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-05-14 08:43:54 +02:00
Michael Stahl 4727305dd2 LOCRCT editeng,sfx2,sw: replace temporary SAL_DEBUG
Change-Id: Ib6f3b732a7eb6f2dbf423ffd2206b0474ff6c681
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185200
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2025-05-13 10:00:31 +02:00
Manish Bera 663f46379e tdf#130924 use SAL_INFO/WARN instead of f/printf
Change-Id: I43ce33f470153e9f8c69851d44d3ba05faaad8ff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179487
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2025-02-02 17:23:47 +01:00
Julien Nabet 3f0da431b3 Revert "tdf#152299 - Remove unused define(s) from C/C++ files"
This reverts commit aee4e18411.

It seems to break stable API.

Change-Id: I64b7b1b5a5f5d53649a6117de34790238313ed23
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177170
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2024-11-24 09:55:28 +01:00
Bogdan Buzea aee4e18411 tdf#152299 - Remove unused define(s) from C/C++ files
Change-Id: I7206e5ac7f525d810505230ef4dcdaa5fff3fbf3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177065
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2024-11-23 09:48:45 +01:00
Caolán McNamara 2b9e6cfc8f Log using LOK_WARN instead of std::cerr
Change-Id: I3a3cabd90154cb7293949d6a21f599417c364b9b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174370
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Attila Szűcs <attila.szucs@collabora.com>
(cherry picked from commit 4baad2222e36fe2a71b2030b1a1292310821e104)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175123
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2024-10-18 15:12:34 +02:00
Caolán McNamara 3ef8075040 version COVERITY conditionals
so there's a recheck on each major if they are still needed

Change-Id: I351f731fe4eaec0ebf735147a9a168cccba3bca5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174883
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-10-14 13:07:37 +02:00
RMZeroFour c3c7b48fa9 .NET Bindings: Native bridge for .NET
This patch includes all marshalling and proxy handling code on the
.NET side as well as the native side needed for a fully functional
UNO bridge.

It also includes some changes and corrections to net_basetypes and
netmaker needed for the bridge to work properly.

It also includes the FirstUnoContact example in C# as demonstration.

Change-Id: I406932938a4415d24408fb41ddfa7d8eeb5d1f94
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170916
Tested-by: Jenkins
Reviewed-by: Hossein <hossein@libreoffice.org>
2024-09-18 08:10:36 +02:00
Caolán McNamara 1da035600a drop unused eventtesting cmd line option
Change-Id: I90edb80f3b414cbe0a81ecccbf1080106708a131
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172933
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-09-06 12:25:32 +02:00
Stephan Bergmann 499141ecf2 Restrict SAL_RET_MAYBENULL to LIBO_INTERNAL_ONLY
...at least for now, as long as it is not needed in any published UNO include
files

Change-Id: I25a1697e1b9ffa5afce0e29cc64be66bf2ebbc57
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170637
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-07-17 21:39:22 +02:00
Andrea Gelmini aa80eaeeab Fix "lets see" -> "let's see"
Change-Id: I7aa939681720bc0dc81c8f114a3608a8cdfb4f60
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169722
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2024-06-28 22:24:50 +02:00
Andrea Gelmini 6f30afeb72 Fix typo
Change-Id: I17f474cc3b749beccc6cce7a8175f46a1f2c646f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167801
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2024-05-21 22:13:00 +02:00
Caolán McNamara 1148d6ad13 introduce SAL_RET_MAYBENULL
which for debug builds and MSVC uses _Ret_maybenull_ and -analyze to
enforce null checking

Change-Id: Id7f0ad854be7841819fdbdcd56c862d1a2df86c3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166734
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
2024-05-17 17:37:58 +02:00
Venetia a82aaae368 tdf#70526 Provide start up time measurements
Added support for measuring the start up time between each Splashscreen
update.

Change-Id: Id38058c89c8524d782bf15cd956c8fba5de056de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163965
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-05-15 08:26:57 +02:00
Noel Grandin e8b9bcf021 map SAL_DLLPUBLIC_RTTI to visibility:default for gcc
Because I want to make more symbols private, but that runs into a
problem with the special symbol "typeinfo for Foo" which is required for
dynamic_cast.

For clang, we can use SAL_DLLPUBLIC_RTTI to make just that magic
"typeinfo for Foo" symbol visible.

But for gcc, we are left with no option but to make the whole class
visible via <MODULE>_DLLPUBLIC.
(I have a feature request logged against gcc to support something like
that at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113958)

But I also don't want to use <MODULE>_DLLPUBLIC, since that blocks
progress of reducing symbol visibility for platforms other than gcc.

So map SAL_DLLPUBLIC_RTTI to visiblity:default for gcc, which means that
only gcc suffers the negative affects of not having that annotation.

However, that runs into the problem that gcc does not like
visibility:default in a couple of places, so I have to introduce some
extra preprocessor stuff.

Change-Id: Ib4fc5c1d2a1f8cf87d5159a4b5684137ec061605
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164356
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-05 14:39:06 +01:00
Mike Kaganski 6329a56f60 Implement SAL_WNODEPRECATED_DECLARATIONS_[PUSH/POP] on MSVC
Required for --disable-nss build on Windows, which needs the same fix as in
commit 71d4abc51b (-Werror,-Wdeprecated-declarations
(Emscripten), 2024-01-18).

Change-Id: I4206cbc0cb80be7ddee1c3f21de50d853828300e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163704
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-02-21 21:43:15 +01:00
Michael Stahl f0fda7ad22 tdf#105844 offapi,package,sfx2,xmlsecurity: add AEAD w/ AES GCM
... and use it in the new experimental ODF encryption mode.

https://www.w3.org/TR/xmlenc-core1/#sec-AES-GCM

Unfortunately it turned out that NSS PK11_CipherOp() does not work with
CKM_AES_GCM because it is initialized with "context->multi = PR_FALSE"
in sftk_CryptInit(), so the one-step functions PK11_Encrypt() and
PK11_Decrypt() have to be used.

NSS 3.52 also changed a parameter struct definition - see
https://fedoraproject.org/wiki/Changes/NssGCMParams - which is not a
problem for RHEL or SUSE system NSS since those are rebased, but it
is likely a problem for less well maintained Ubuntu LTS, so use
the old struct definition which evidently still works with NSS 3.94.

NSS 3.52 also added a new PK11_AEADOp() API but it looks like this
doesn't support incremental encryption either.

Change-Id: Ibd4a672db74b65b1218926ba35ff8d2f70444c7e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160505
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-12-11 20:46:40 +01:00
Michael Stahl 328b135f0d xmlsecurity: check for errors in OCipherContext::Create()
If this function returns null, storing a document will proceed without
reporting an error to the user, and lose all the data.

Change-Id: I0f9fd53702321e7997b28e12eb5bed3349bbcc13
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160435
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-12-07 21:46:00 +01:00
Michael Stahl 764e2a5a3e tdf#146386 remove references to FTP UCP code
Change-Id: I85f83c3d83f3de59a929ed053e0e92bb10bdcc5b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159498
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-11-16 19:15:01 +01:00
Sarper Akdemir cdcff8c341 tdf#157518: add password strength meter to setmasterpassworddlg
Moves PasswordStrength bits that provide utility functions from cui to svl,
merging them with PasswordHelper there.

Adds password strength bar for the set master password dialog.
(accessible via Tools -> Options -> LibreOffice -> Security -> Passwords for Web
Connections)

Change-Id: I8dc1090a041f8388c2e139beb1d0d9a0beb8acb0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159370
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir <sarper.akdemir.extern@allotropia.de>
2023-11-15 19:48:38 +01:00
Stephan Bergmann c8dfb25a77 Drop DEBUGSPRMREADER code
Change-Id: Id204eae97850ef9c99229c1316090010013b06e0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159367
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-13 14:43:49 +01:00
Yli875 2ee71dff5c tdf#130924 replace debugging printf with SAL_INFO
DEBUGSPRMREADER was added in 616adc49d6,
5f653490a4 and also in
c80a0fcdd9

Change-Id: I80ae8a75ac0f40bb633f4c0aee9bdcee0c26adfb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159090
Tested-by: Jenkins
Reviewed-by: Hossein <hossein@libreoffice.org>
2023-11-13 11:18:33 +01:00
Armin Le Grand (allotropia) ab7c81f556 ITEM: Get away from classic 'poolable' Item flag
To understand this, some look back in history will be needed to see
why it is as it is today. In some (reworked) comments 'poolable' is
described as flag to hold Items in the ItemPool, also always having
only one incarnation of each possible Item.
This is not the original intention, but a side-effect. The reason is
what the binary format in the office did: To save a document, the
Objects & the Pool were saved, *not* individual Items *together*
with the objects. The Pool was completely (binary) saved (and loaded)
in one run.
Temporary IDs were used to represent at the objects in file which
Items were referenced. This *required* to have only one incarnation
per item to have a minimal binary file size, thus this high effort
was put into this. At doc load, the pool was loaded, all Items were
set to RefCount 5000, the references from the objects were restored
and then for each Item the RefCount was lowered by 5000 again
and - if being zero - deleted. Items for UI were marked 'non-poolable'
to *not* safe them with the document, so poolable was a flag to decide
if that Info/Item was to be saved with the document - or more direct:
if it is Model Data.
Items are small, so if we prefer runtime it is okay to no longer being
strict with this, anyways does not happen often and has only marginal
memory effects - compared to runtime effects/savings.
Other problems which this caused: One example is that objects in the
UNDO stack were still in the pool, so e.g. deleted pictures were saved
with the document despite no longer being used (!). That is the reason
we have an UndoItemPool and a method MigrateItemPool to move stuff to
that Pool when objects go to the UNDO stack - all of this is also no
longer needed.
Cleaning this up means to ideally have all items in the SfxItemSet,
no longer at the Pool. The Pool should be reduced to a 'Default-Item-
Holder' and a 'Slot-to-whichId-mapper'.

This needs thorough cleanups/removals, but will be worth it because
that massive simplification(s) will increase safety an runtime and make
migrating to the goal of completely type-based ItemSet stuff easier for
the future. Hopefully only view code in the office working with items
will have to be changed for this.

In this 1st step I already found that some 'compromizes' will be
needed:
- There are still Items that have to be at the pool to make the
Surrogate-stuff working. This gives back all Items in a Pool of a type
and is used in ca. 80 cases. Each one looks at these Items *without*
context (e.g. a SfxItemSet at an Object would be a context), so if e.g.
a dialog is open that temporarily uses Items of that type you would
also get these - without knowing about it...
To make that work there is still a mechanism to have Items at the Pool,
but now just *registering* (and un-reg) them without any sort/search/
remove needs. Also only for Items that need that, so I evaluated the
GetItemSurrogates calls and added some asserts when GetItemSurrogates
tries to access an unregistered item type which needs to be added.

- Another caveat is that there are about 250 places that directly put
Items to the Pool (not all remove these, that is done at pool deletion,
so some kind of silent 'garbage-collection' is in place). To have an
overview I renamed the accessing methods to separate them from the same
functionality at the SfxItemSet, which had the same names. An
implementation does still add these directly to the pool, there is no
way to cleanup those usages for now. In principle all these should be
changed to hold the data at an SfxItemSet.

I am still hunting problems. But you can build the office, all apps
work (including chart) and you can do speed comparisons already.

There are test throwing errors, so I hunt these now. It is hard to
give an estimation about how much more changes/corrections will be
needed.

Completed adaptions to new registered Items at Pool, that reduces the
failing tests. Still many that I need to hunt.

Added stuff to work around that 'compromize' in ScDocumentPool: It
overloads ::PutImpl of the pool to implement special handling for
a single Item in SC, the ScPatternAttr. In former code that method
was used from SfxItemSet and ::PutImpl at the pool directly, so it
was only used in one place. I am not sure if it was used from
the SfxItemSet functionality, but better offer it for now. To not
waste too much runtime the callbacks depend on the boolean
'NewItemCallback' at the SfxPoolItem, it gets set for that single
Item in SC and only then the callbacks trigger. I hope to get rid
of those again, e.g. newItem_UseDirect is only needed since we have
no 'real' StaticPoolDefaults currently - another thing that needs to
be cleaned up in a next step.

Since usages of impl(Create|Cleanup)ItemEntry and
Direct(Put|Remove)ItemInPoolImpl got more and more similar I decided to
unify that: move impl(Create|Cleanup)ItemEntry to tooling, make it
globally available in svl and use it also directly for
Direct(Put|Remove)ItemInPoolImpl. This slightly increases the failing
tests again, but only since in Direct(Put|Remove)ItemInPoolImpl that
fallback (e.g. tryToGetEqualItem) was used before, thus this is the
same class of errors (SfxPoolItem ptr-compare) as the others which I
will need to find anyways. Also fixed some missing stuff.

Have now idenified and redirected all SfxPoolItem ptr-compares
to be able to debug these - one cause for the remaining errors is
probably that before with bPoolable those often were sufficient, but
are no longer. Used the [loplugin:itemcompare] and a local clang
build to do so, see https://gerrit.libreoffice.org/c/core/+/157172

Stabilized Direct(Put|Remove)ItemInPoolImpl forwards, added parameter
to implCreateItemEntry to signal that it gets called from DirectPool
stuff - currently needed. Hopefully when getting rid of that DirectPool
stuff we can remove that again

Added two more debug functionalities:
- Added a SerialNumber to allow targeted debugging for deterministic
  cases
- Added registering & listing of still-allocated SfxPoolItems at
  office shutdown

Found PtrComp error in thints.cxx - POC, thanks to
areSfxPoolItemPtrsEqual. Will hopefully help more with other tests

Found some wrong asserts/warnings where I was too careful and not
finding something/succeeding is OK, fixes some UnitTests for SC

For SC I now just tried to replace all areSfxPoolItemPtrsEqual with
the full-ptr-content compare SfxPoolItem::areSame. I also needed to
experiment/adapt the newItem_Callback solution but got it working.

Did that replacement now for SW too, found some places where the
direct ptr compare is OK.

Continued for the rest of occurrences, now all 160 places evaluated.
Also done some cleanups.

Massive cleanups of stuff no longer needed with this paradigm change.
Also decided to keep tryToGetEqualItem/ITEM_CLASSIC_MODE for now.
It is used for *one* Item (ScPatternAttr/ATTR_PATTERN) in SC that
already needs many exceptions. Also useful for testing if errors
come up on this change to test if it is related to this.

Added forwarding of target Pool for ::Clone in SvxSetItem and
SvxSetItem, simplified SfxStateCache::SetState_Impl and returned
to simple ptr compares in SfxPoolItem::areSame to not do the test
in areSfxPoolItemPtrsEqual.

Debugged through UITest_calc_tests9 and found that in tdf133629
where BoxStyle is applied to fully selected empty calc the Item-
reuse fallback has to be used not only for ATTR_PATTERN, see
comment @implCreateItemEntry. Maybe more...

Problem with test_tdf156611_insert_hyperlink_like_excel. Found that
in ScEditShell::GetFirstURLFieldFromCell the correct SvxURLField
is found and returned as ptr, but it's usage crashes. That is due to
the SfxItemSet aEditSet used there gets destroyed at function return
what again deletes the SvxFieldItem that is holding the SvxURLField
that gets returned.
This shows a more general problem: There is no 'SfxPoolItemHolder'
that safely holds a single SfxPoolItem - like a SfxItemSet for a
single Item (if Items would be shared_ptrs, that would be a safe
return value).
That will be needed in the future, but for now use another solution:
Since I see no reason why EE_FEATURE_FIELD should not be shareable
I wil change this for ow in the SfxItemInfo for EditCharAttribField.
That way the Item returned will be shared (RefCnt > 1) and thus not
be deleted.

I changed the return value for GetURLField() and
GetFirstURLFieldFromCell() in ScEditShell: At least for
GetFirstURLFieldFromCell the return type/value was not safe: The
SvxFieldItem accessed there and held in the local temporary
SfxItemSet may be deleted with it, so return value can be
corrupted/deleted. To avoid that, return a Clone of SvxFieldData
as a unique_ptr.

With all that UnitTest debugging and hunting and to get the paradigm
change working to no longer rely on shared/pooled items I lost a
little bit focus on speed, so I made an optimization round for the
two central methods implCreateItemEntry/implCleanupItemEntry to
get back to the speed improvements that I detected when starting this
change. It was mainly lost due to that 'strange' chained pool stuff
we have, so I added to detect the target pool (the one at which the
WhichID is registered) directly and only once. Next thing to cleanup
will/should be the pool and it's concept, all this is not needed
and really costs runtime.
Since implCreateItemEntry/implCleanupItemEntry are executed millions
of times, each cycle counts here.

Had an error in the last changes: pool::*_Impl methods use index
instead of WhichID - most of them. Another bad trap, I really need
to cleanup pool stuff next.

Change-Id: I6295f332325b33268ec396ed46f8d0a1026e2d69
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157559
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-11-07 18:07:13 +01:00
Sarper Akdemir b1e24664de tdf#157518: add password policy and strength meter to save with password dialog
Introduces new configuration options PasswordPolicy and
PasswordPolicyErrorMessage.

PasswordPolicy takes a regular expression. When set, it only
accepts passwords that match that regular expression.

PasswordPolicyErrorMessage is the label displayed when the
password does not meet the PasswordPolicy.
In the ideal case, it should contain an explainer of the
PasswordPolicy, so the user is aware of the requirements.

Save with password dialog had maximum password length enforcing
bits depending on the requirements of the saved file format.
These are still applicable in combination with the password
policy.

Also introduces a visual password meter under the password
entries. If the password policy isn't satisfied the password
strength meter is capped at 70%.

The entropy bits to password quality is taken as a linear range.
Where the range of [0, 112] entropy bits is mapped to percentage
[0, 100]. Entropy bits ≥ 112 are mapped to 100% since, according
to KeePass' info page, ≥ 112 entropy bits correspond to a strong
password: <https://keepass.info/help/kb/pw_quality_est.html>

Change-Id: I2e70adacf271916661219f702dfc217292a1b59f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158453
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir <sarper.akdemir.extern@allotropia.de>
2023-11-06 09:03:47 +01:00
sahil 20ce362ee2 Remove unused entry from log-areas.dox
Change-Id: I1d7bb4183c45f752cddf118411259695a294b2cb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158371
Reviewed-by: Hossein <hossein@libreoffice.org>
Tested-by: Hossein <hossein@libreoffice.org>
2023-10-24 17:53:42 +02:00
sahil c0e687edf4 tdf#130924 replace '*printf' with 'SAL_*' logging macros in pyuno
Change-Id: I2c491629f52fe0b90517c563f221d7d0345b6ee9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156452
Tested-by: Jenkins
Reviewed-by: Hossein <hossein@libreoffice.org>
2023-10-23 16:54:59 +02:00
Ilmari Lauhakangas 115c8b42b8 Revert "tdf#130924 replace '*printf' with 'SAL_*' logging macros."
My mistake, did not notice
https://bugs.documentfoundation.org/show_bug.cgi?id=130924#c5

We shouldn't hide test output.

This reverts commit df0db41324.

Change-Id: Ieac40effb57333322f8db8ead093a83765d17a09
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156479
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2023-09-03 13:22:55 +02:00
Skyler Grey 8e246331f6 Add a FunctionBasedURPConnection and a websocket URP connector
- FunctionBasedURPConnection is used to enable a client to open a URP
  connection to a fresh Kit instance in COOL.
- This URP connector can be used with that and
  https://github.com/CollaboraOnline/online/pull/6992 to use a Java Uno
  Remote Protocol client over websockets
- For interoperability with existing Collabora Online websockets a
  prefix (urp ) is added to each message sent and a similar prefix
  (urp: ) is expected on each message recieved. This allows sending over
  the same websocket as other data is being transmitted through. If you
  are writing a bridge to work with this, you will need to add/strip the
  prefixes accordingly
- This commit uses Java WebSocket
  (https://github.com/TooTallNate/Java-WebSocket) to send data over
  websockets.

Change-Id: I2bda3d0b988bef7883f9b6829eeb5b7ae8075f27
Signed-off-by: Skyler Grey <skyler.grey@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151171
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-09-01 16:55:37 +02:00
sahil df0db41324 tdf#130924 replace '*printf' with 'SAL_*' logging macros.
Change-Id: I5bb4052ded82c355f7d71e4f38ebdefe3fcc25da
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156283
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2023-08-31 19:50:23 +02:00
Mike Kaganski 76e11899e1 WNT -> _WIN32
Change-Id: I09b1744c568b39c5b4160154536730962feb3a8c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156089
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-08-25 11:12:31 +02:00
Patrick Luby ccc31ed4d9 tdf#156470 add SAL_INFO calls for debugging
In the verious LibreOffice samples attached to tdf#156470, it appears
that LibreOffice spends a lot of time the GetTextArray() calls in
SvxFont::QuickGetTextSize(). So add logging to determine if any of
the GetTextArray() calls are returning unusual sizes.

Change-Id: Ie6f0fcc85396b47342b6a93180d4bc9873420931
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155072
Tested-by: Jenkins
Reviewed-by: Patrick Luby <plubius@neooffice.org>
2023-07-31 18:11:53 +02:00
Marco Cecchetti 14b3ad0b4e lok: accessibility event listener for focused paragraph
LOKDocumentFocusListener keeps track of the currently focused
paragraph.

Also includes:

	Author: Andras Timar <andras.timar@collabora.com>
	Date:   Mon May 15 22:06:10 2023 +0200

	    fix unused exception parameter 'e'

	    Change-Id: Ibfee099e4e9b724648d7500b9ebb4e8ab84989b8

and:

	Author: Marco Cecchetti <marco.cecchetti@collabora.com>
	Date:   Thu May 4 12:11:53 2023 +0200

	    lok: a11y: focused paragraph info sent to client

	    For the currently focused paragraph the following data is notified to
	    client:
	    paragraph content, caret position, text selection start/end
	    These data is kept as an instance state so the client can request such
	    info at any time.

	    Change-Id: Ic1a3be0d93472300b1b6a91fb0de5bad87c031aa

and:

	Author: Marco Cecchetti <marco.cecchetti@collabora.com>
	Date:   Sun May 7 11:52:14 2023 +0200

	    fixup! lok: accessibility event listener for focused paragraph

	    It seems it was not a good idea using a unique_ptr as smart pointer
	    for an instance of LOKDocumentFocusListener

	    Change-Id: I8e6b0f48fee3c5db3c9b074a663f7f3fb96a601e

Change-Id: I0fa400694f3129608228ade0b96e0b4e0aee87e2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152488
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-06-02 08:04:38 +02:00