We don't use it yet from any C source file, but the plan is to do
that. Mainly from freetype, fontconfig, and cairo, when these are
built for Windows when the --enable-headless options is used (for the
new Collabora Office).
Also some cleanups, sorting #include lines, avoiding warnings, etc.
Change-Id: Ifef3588d06fdcceaeaeb3482399737faaf558d7d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195602
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
Of course, LibreOffice has tons of APIs from before whose whole point
is to hide system dependencies behind a cross-platform API. All the
"sal" and "osl" stuff, for starters. The wrappers in this file is not
intended to replace those. The point with these wrappers is to quickly
port code that was written for Unix *only* to Windows, with minimal
changes to the source code. Basically you just need to prefix calls to
functions like open() and stat() with wrap_.
In Windows, "file descriptors" are a thing in the C library, not the
operating system. But the C library does provide the same core set of
functionality as Unix-like systems do. The functions use almost the
same names, except that for some reason, to avoid compilation
warnings, you need to call variants with names preceded by an
underscore, like _close().
Another Windows complication is that the file system is based on
UTF-16 names. You can't just pass file names as eight-bit characters
to _open() and expect it to work for all file names. Instead, you need
to call a function with a "w" prefix, like _wopen(), that takes a wide
character string (UTF-16).
This header is in C, not C++, because we want it to be usable from
some external libraries written in C that we compile as part of
LibreOffice in some circumstances, particularly for Windows.
All functions behave like the wrapped ones, set errno on errors.
Change-Id: Ia093ccf976659ceabbef6e0071da73d4df0b63b7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195422
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
So we can use it in dumpAsXml functions and eventually use it as
a replacement to directly using libxml.
Change-Id: I204d487b52343f69224fec2fd480657785bc0a69
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195167
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
LOK_HOST_ALLOWLIST allows to pass a restricted list of hosts that
curlsession will be allowed to download from.
LOK_HOST_ALLOWLIST_EXEMPT_VERIFY_HOST reuses this list for the use case
of not verifying SSL host additionaly for them. This is useful for say
developpement environement.
Change-Id: I75ac26a4bfe1c33ff183c4ad12391b2da08593cb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193961
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit 8688e9d8c94a21a7a0abc9edfe632e6fa0e94281)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194187
Tested-by: Jenkins
Reviewed-by: Méven Car <meven.car@collabora.com>
No need to re-invent std::abs. Also drop some static_casts, to
allow warnings in case there will be unexpected values.
Change-Id: Iad1bc7fd22a1c517e4cdce28d156aa42fc5e6ec6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193507
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
...and use it in one place for the experimental Emscripten Qt6
JSPI/non-PROXY_TO_PTHREAD mode (where I have a hunch that some of the deadlocks
I experience in that experimental mode are due to a mis-locked SolarMutex)
Change-Id: Ifb335202569b7d2beecd7a502064ebcfdaaddbab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181872
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
The function was introduced specifically to speed up the common case
of null date value, and we can make use of that.
Change-Id: I26ccd2a4abce7a9d9dcd828a62c700c7319b30ae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181700
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
...so that they don't report "unknown" (and make empty links report "empty"
instead, for clarification). This introduces a new LINK_NONMEMBER macro; the
non-default Link ctor should no longer be used directly, so make it private.
Change-Id: I4ae99758de57adb8569ce98cb3824e875b26c959
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180593
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
We use the same funciton all over the place, so create a common
function in o3tl and use that in all instances where we duplicated
the code.
Change-Id: I74091fbbde8c2ba8c7e4ab30194ab53e2a338e52
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180372
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
This change includes GUI element changes to support viewing and editing
first-line indent values with font-relative units in the paragraph style
dialog.
Change-Id: I72ada2565f51d70475eb17096a1317be9316b770
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176595
Reviewed-by: Jonathan Clark <jonathan@libreoffice.org>
Tested-by: Jenkins
This ctor is meant to set the value of nTime directly; and that value
is not nanoseconds, but an encoded value, using SEC_/MIN_/HOUR_MASK.
But in some places, this ctor was misused for setting of nanoseconds,
which would only accidentally work for values less than one second.
All places that initialized tools::Time with 0, now use EMPTY.
This makes the ctor private; and for the very few cases where really
the encoded value of nTime is stored / restored, fromEncodedTime is
introduced.
Change-Id: I1f1994bd9aab1b51a41b1de637619049fe820da4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175283
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit adds a sidebar deck for comments.
It has all the functionalities of the old comments
shown via annotation window.
Change-Id: Ibab0e21a54c097d0f42bddb1d07da74319970135
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167840
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir <sarper.akdemir@allotropia.de>
* COL_AUTHOR<1..>_DARK/LIGHT/NORMAL removed Author1..9 added
* dark variants calculated from light with 50% brightness
* light does In/DecreaseLuminance(30) and dark (sd) resp. anchor (sw) In/DecreaseLuminance(80) depending on GetUseDarkMode()
* sw: font color depends on outline background, which now picks up DOCCOLOR; this does not work for dark colors in light mode, for example
* sd does not update on changes and requires a restart
Change-Id: I773793de8cfbdc0d23124db790604b93030375c2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171523
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Tested-by: Jenkins
This patch allows tools::PolyPolygon to be iterated using c++11's
fancy range-based for-loops. It also upgrades a bunch of old-style
for-loops iterating over polypolygons to the new style to make code
more readable.
Note that not all for-loops iterating over polypolygons have been
upgraded, as I didn't find a way to automatically find those. I just
did a few I found manually.
Change-Id: Ifa8d0d44e6f0aa28fdcfd87d70058b12f48c1349
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168730
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
The presentation info includes properties like document size, if the
slide is visible, master slide information and similar.
[ Miklos: don't refer to removed tools::ScopedJsonWriterArray. ]
Change-Id: I5b0acff2ee0df351dd1859e02695ca249e17c391
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170155
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
In the tools module it can be used in more other modules.
Changed the instantiation to increase the counter already in the
constructor, so no need to check if the ID is 0.
Also test for UniqueID
Change-Id: I77c80461875c69496a7e218534d16d6550c168c2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170061
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
For some reason, MSVC fails to find the o3tl::convert overload for Size
defined in <tools/gen.hxx>, unless the call to convert is unqualified,
accompanied by a 'using namespace o3tl' in convertTwipToMm100.
Change-Id: I7100ef55156b6944b5adc5aefa52eee38b3fe69e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169751
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
Use std::copy / std::reverse_copy for double serialization. Also
remove __cplusplus conditions, because the header is not included
in any C files. And simplify the functions uses, where casts were
unneeded.
Change-Id: I1d8375e601851231fdffcf52e3f3e3bdcbcbde7f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169706
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Align the implementation of the now function in basic with the now function in calc to include the also nanoseconds. The precision is limited to milliseconds to avoid comparision inaccuracies.
Change-Id: Ia85b653898f5849f67a171749725faab976b2a8a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168706
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins