239 Commits
Author SHA1 Message Date
Andrea Gelmini 467e3b4f49 Fix typos
Change-Id: I8000ee277d51b91e8e04c99afa4327a4245e435f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209475
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2026-08-22 10:26:48 +02:00
Michael Weghorn d236763a6a o3tl: Drop unused lazy_update.hxx
This was only used in the simplecanvas library
that was dropped in

    Change-Id: I301b3a42dfb6eacf6a9ef3a4851ed1d38f16ec66
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Thu Jul 30 15:31:11 2026 +0200

        canvas: Drop unused simplecanvas library/component

Change-Id: I576c8e954d5ada273f49e9eba45dd71e65d49310
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208854
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-08-01 07:37:00 +02:00
Mihnea Jianu 48b9430f1b tdf#157664 Drop operator !=, where respective operator == is defined
Change-Id: Ida00a99aa47ec70a1ffad39fde20a6476249ecc8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204726
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Tested-by: Jenkins
2026-05-12 11:31:47 +02:00
Muhammad Naeem 5c812142b2 tdf#143148: Use pragma once instead of include guards
- Convert include guards to #pragma once in salhelper, starmath, tools, ucb, and o3tl.
- Kept changes minimal to a small cross-module batch as requested by the easyHack guidance.
- Verified with: container=1 make -j4 o3tl.build salhelper.build starmath.build tools.build ucb.build

Change-Id: Ic047061433985e12be41bdb6463ac4c8e8969ddd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204555
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2026-05-02 13:12:13 +02:00
Noel Grandin 4b10710e09 loplugin:passstuffbyref
Change-Id: I559d246b25c99e5cb7a28ba94e04a2acedd3e720
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200943
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2026-03-04 19:22:19 +01:00
Noel Grandin 5505d3bc4d loplugin:constparams
Change-Id: I33c701be5a441c1121b797f1eb5a8bda6fc3f89b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200927
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2026-03-04 11:29:39 +01:00
Tomaž Vajngerl ff2b5cfed6 use std::to_array when constexpr std::array is used
So it is not needed to write the number of elements in the array,
as this is done by the compiler.

This is similar to frozen::make_* functions (or better, those
functions are similar to to_array).

Change-Id: Ie589607fae0326ac8a01ebaee2e1b1cbec35bfdc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189322
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Jenkins
2025-08-18 11:51:55 +02:00
Stephan Bergmann fd8b519023 Avoid misaligned-pointer-use
...after d0ee08cfbf "oox: export embedded font
used in a presentation document" caused CppunitTest_vcl_font_ttf_structure_test
to fail with

> vcl/qa/cppunit/font/TTFStructureTest.cxx:47:5: runtime error: member call on misaligned address 0x7de9211e0262 for type 'o3tl::sal_uInt32_BE', which requires 4 byte alignment
> 0x7de9211e0262: note: pointer points here
>  00 00  00 00 80 00 00 af 10 00  20 48 00 00 00 00 00 00  00 00 57 33 43 00 00 40  00 20 f0 02 03 20
>               ^
>  #0 in (anonymous namespace)::testReadTTFStructure::TestBody() at vcl/qa/cppunit/font/TTFStructureTest.cxx:47:5

Change-Id: I4d46decd497fccf7eecdb38764ac82ed2a68b5d6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184829
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2025-04-30 17:00:24 +02:00
Tomaž Vajngerl d0ee08cfbf oox: export embedded font used in a presentation document
This adds support to export the fonts that are used in an
presentation document. The fonts are converted to EOT fonts.

Adds an EOT converter, which converts a TTF font to EOT font by
writing a EOT header and adding the TTF font data.

Adds BigEndianTypes so we can read a structure that is defined in
big endian and the types get converted (if needed) to system
endian when accessed. + test

Adds TTF reader which reads the true type font structure in an
easy way that is used by the EOTConverter. + test

Change-Id: I8b0bcb69e47943c2a8679edf881d7c2bab45c450
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184288
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2025-04-30 08:30:48 +02:00
Tomaž Vajngerl 794e86b99d o3tl: Add concepts for 32/64 bit types, use in hash_combine
This simplifies determining what the byte size of the template type
is, so we can write a specific implementation for 32 and 64 bit
seeds for hash_combine.

Change-Id: Icd68e4618151957ecc00585dd521adf11fe3931a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182266
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2025-03-03 09:43:18 +01:00
Tomaž Vajngerl 2990620e20 remove code duplication - conversion hex char to value
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>
2025-01-20 01:39:16 +01:00
Mike Kaganski a6a6921123 Use good old string literals in assertXPath and friends
These are only sent to an external API expecting char*-like strings,
or for comparison. Having every assertXPath having three of _[ou]str
is too much syntactic noise, making the unit tests almost unreadable.

Change-Id: Ic004a36ea75e7bfe0b96f405c40f926a957b51cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174416
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2024-10-05 10:06:44 +02:00
Noel Grandin c04de7a6f2 tsan: fix data race in o3tl::cow_wrapper
where the use_count() call was happening without any kind of
synchronisation - switch to use std::atomic which does the right thing
for us

Change-Id: I79a6452f42bd425ea494bb0298dc134de5678813
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170217
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2024-07-09 20:12:54 +02:00
Noel Grandin d573e2ae17 loplugin:ostr in various
Change-Id: I9f399b3752da9df930e0647536ffcd4e82beb1ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167856
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-20 22:09:56 +02:00
Gabor Kelemen ab95ed2c4b Use less boost_headers in low level libraries
Most of these don't use boost themselves, nor do they need
it transitively since the use of boost::optional was removed

Change-Id: Ic9dee1c4e160b313ec5b91677b02ffdea6c5779d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164440
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2024-03-06 21:23:17 +01:00
Mike Kaganski 1f5efbf8b9 Generalize search algorithms in sorted_vector
This allows to simplify the code somewhat, and also to relax requirements
to the arguments, e.g. allowing to pass const objects to search in vector
containing non-const objects.

Change-Id: Id34911a8694bbdec275d22b51ca4a0845c9fa4c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163519
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-02-17 10:07:38 +01:00
Stephan Bergmann fa7dd627c9 Extended loplugin:ostr: o3tl
Change-Id: Iac716011fd421c6dd0d40cf81dc6cbebb1ae4e71
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159693
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-20 07:27:41 +01:00
Stephan Bergmann 6d1b241ab7 Drop o3tl::span, can use C++20 std::span directly now
Change-Id: Ic21ff7bf48f07f7277979d52e99d2c5c268de83f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157825
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-11 21:53:13 +02:00
Stephan Bergmann e0c33ec15f loplugin:ostr: automatic rewrite
Change-Id: I2d09b2b83e1b50493ec88d0b2c323a83c0c86395
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157647
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Jenkins
2023-10-07 00:47:20 +02:00
Stephan Bergmann 72da78be20 Drop some newly obsolete __GNUC__ version checks
...after 6ef2d358ac "Adapt Clang and GCC minimum
version checks"

Change-Id: I5f3bcda2ce8e0e093af3bdd9d2cca741a5b95306
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157202
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-09-24 17:31:16 +02:00
Noel Grandin 325c571c22 update loplugin:stringview* for o3tl::iterateCodePoints
And change o3tl::iterateCodePoints to use sal_Int32 for its
second param, to integrate better with places where the parameter
comes from an UNO API, which cannot use std::size_t

Change-Id: I7b9dd2c9bc7f48e6c4a912f039f1b5dae7beae69
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151421
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-05-06 12:09:48 +02:00
Stephan Bergmann 28cc0bff10 Break comphelper::adjustIndexToStartOfSurrogate out of o3tl::iterateCodePoints
...as what they do is orthogonal (and it turned out that the use case that
motivated the addition of o3tl::iterateCodePoints in the first place needs them
independently, anyway)

Change-Id: Id33901a2f7ac627253654ee6d883305dcf5a456f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151415
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-05-05 11:30:12 +02:00
Stephan Bergmann c1bd421eae Add some o3tl::iterateCodePoints tests
Change-Id: I00f7d8bbcf7588bb2d5df1bc6f68e2d5d224bd3f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151414
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-05-05 11:14:48 +02:00
Noel Grandin 5c1561561a loplugin:unnecessarygetstr extend to more std::string checking
suggested by mike kaganski

Change-Id: I5f5f254142767aca45a6101abdd84a0163ca6a34
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150936
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-24 18:04:50 +02:00
Noel Grandin bc2101646b loplugin:stringviewparam improvements
improve the check by checking for methods that exclude
using string_view, rather than checking for methods that
__can__ use string_view, which leads to exposing
some holes in our o3tl/string_view.hxx coverage.

Change-Id: Ic9dd60441c671f502692f9cd2a1bb67301c4b960
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150277
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-14 07:54:28 +02:00
Stephan Bergmann df5995b0bf Only specialize CppUnit::assetion_traits<T>::toString member functions
...not the whole CppUnit::assetion_traits<T> classes (where applicable).  That
avoids spelling out the (identical) equals member functions, and also leaves
around the less and lessEqual member functions, in case they want to be used
after all.

Change-Id: I18f8d6cff0353921ced4952b33a0c85ff8292923
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147165
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-02-16 21:16:12 +00:00
Mike Kaganski 635a0b426e Fix MulDivSaturate to avoid overflow
Thanks to Caolan
https://gerrit.libreoffice.org/c/core/+/110839/comments/5c47cab2_b0523546

> oss-fuzz has come up with a case of n 9223372036854775807 m 72 d 127
>
> include/o3tl/unit_conversion.hxx:105:28: runtime error: signed integer
> overflow: 9223372036854775807 + 63 cannot be represented in type 'long'

Change-Id: I0fe26f6c854a90cf577a60528d15f3da5471b914
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141711
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-10-24 14:07:31 +02:00
Luboš Luňák 0cc8da4c09 remove the o3tl::lru_map "unlimited" hack
It didn't quite make sense before that maxsize == 0 meant no cleanup,
and now with items optionally being count as having size more than 1
it makes even less sense to limit the size to max_size() of the
containers. This comes from 16a338e173,
so instead make that special caller pass a large size, which in
practice is the same.

Change-Id: Id875862126200ba889211f6e4079ae5921f27650
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133690
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-05-03 06:54:54 +02:00
Luboš Luňák 46097559ed support custom item size (cost) for o3tl::lru_map
When used with items that may vary significantly in size (such
as SalLayoutGlyphsCache storing glyphs for texts of different sizes)
limiting lru_map to just the number of items performs poorly,
since it may use only small amount of memory if items are small
or it may spent a huge amount of memory if items are large.

As extra optional template argument to o3tl::lru_map that is a functor
that provides cost of item each, and the total size is based on this
instead of each item having cost 1.

Change-Id: I2b326754fe63eb4bd20010d4cea615187407e26c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133672
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-05-02 09:26:31 +02:00
Stephan Bergmann 956a01947d Avoid unhelpful loplugin:stringviewvar
Regression during `make check` introduced with
ab699bfdb3 "new loplugin:stringviewvar looks for
OUString vars that can be".

Change-Id: Ib6b9aabcfd380b43a77a97cf9d7e15c37aeb852c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133204
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-04-20 13:39:09 +02:00
Noel Grandin 2bf5658247 add a more complete o3tl::getToken
so we avoid OUString copying (mostly when doing stuff like parsing
numbers of out of strings)

Change-Id: I4ef6ac23671c0b40807a22158e655e92dfad4af6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132730
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-09 09:08:56 +02:00
Luboš Luňák b871d057c4 use OUStringBuffer for a string that's modified often (tdf#145862)
SvParser::aToken was OUString despite being a buffer where the parsed
result is collected.

Change-Id: Id24c842738ea0f6f1836f77d855069963ac5ae55
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130763
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-01 21:32:11 +01:00
Luboš Luňák ffe7850a14 fix o3tl::equalsIgnoreAsciiCase()
As the OUString equivalent shows, it needs to check == 0. Commit
33ecd0d5c4 for some reason also
dropped the cheap checks (even from OUString) that OString has,
so add them.

Change-Id: I88e68b5ae10fd76c3c08b9b36d5abed0fad17bbf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130753
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Tested-by: Jenkins
2022-03-01 18:00:17 +01:00
Gabor Kelemen 7b5193e2ae Recheck modules [o-r]* with IWYU
See tdf#42949 for motivation

Change-Id: I6b4b05a5e59b256653c4caf5297fffd601b45083
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128845
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-01-30 16:10:57 +01:00
Stephan Bergmann e88fbc883f -Werror,-Wundef (clang-cl)
Change-Id: Ife97d1645c0ef4684a00f943c649b19623290d7d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127299
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-12-22 13:41:34 +01:00
Noel Grandin e10e5c15cc improve the script for reducing symbol exports
And apply some of the results

Change-Id: If555476fdd951cbc1d01fb3ef3ab1cbca2b64960
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124896
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-01 12:13:59 +01:00
Noel Grandin 5a945e22ee disable test under gcc 11.2.0
Change-Id: Ic0d19cf827bc04026b5adf88bd5eb0a84e9dc270
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126080
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-30 09:33:06 +01:00
Stephan Bergmann b46894e7d0 Some more o3tl::starts/ends_with overloads
...including ones with a rest out parameter, modeled after their O(U)String
counterparts and not present in any C++ standard (so intended to stay in o3tl,
even when the C++20 wrappers are eventually removed again).  Plus test code.

These additional overloads will be used in forthcoming commits changing more
places to use std string_view.

Change-Id: Ifd05e0fdcb93e8751da22b8e4a59796ad00fe581
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122407
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-09-21 23:32:02 +02:00
Tomaž Vajngerl fa339b3adb convert some LogicToLogic calls to use o3tl::convert instead
If a LogicToLogic uses fixed units, we can use o3tl::convert
instead. We can also do the same for all other cases where
LogicToLogic is used, but that needs additional investigation to
determine if it is safe to do so.

Note:
MapUnit::Pixel is converted to o3tl::Length::pt because it assumed
72 PPI for a logical pixel, which corresponds with the conversion
rate of a point (72 PPI).
Today, 96 PPI is standard, which is also used for o3tl::Length:px.

Change-Id: I29126df38bfcfda74b5d83d4cb880a378aecd18b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120230
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-08-11 06:41:17 +02:00
Tomaž Vajngerl 9da7b1592e sw: remove all uses of MM50 with (added) o3tl::toTwip
MM50 constant is the number of twips for 5mm. This is (ab)used as
a "shortcut" to set or compare various variables through the code
and also to set a multiplied value (like 1cm, 2cm, 4cm) or divided
value (2.5mm, 1.25mm). The problem with this is that converting the
5mm to twip doesn't round up exactly and multiplied and divided
values increase the error even more.

Instead of basing it from MM50 constant, it is just better to use
our o3tl::convert (or the added variant o3tl::toTwip), which can
actually calculate the conversion at compile time, so there is no
added complexity at runtime and we get a more readable code with
more exact result.

i.e.
o3tl::toTwip(4, o3tl::Length::cm)
instead of the more cryptic
MM50 * 8

In addition also sanitize and comment the values of the constants
in sw/inc/swtypes.hxx.

Change-Id: I85c306c36207d47ac3dc207094b68d0fb1ca5b70
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119397
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-08-10 03:02:52 +02:00
Luboš Luňák 62b58e88d8 allow altering the max size of o3tl::lru_cache
Change-Id: Id119b70275e1c88a8c57f89d915241427be9dbf5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116927
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-06-09 21:20:09 +02:00
Tomaž Vajngerl e6c0c282be add o3tl version of hash_combine to not depend on boost for this
Change-Id: I081f8d116ef811baa8aa5de35a6cb51fa4de7d56
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114983
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-05-11 12:23:48 +02:00
Hossein 628c1c3b07 Updated README.md files
* Updated README.md contents to fix various issues
* Fixed source links by using [git:], processed by mkdocs scripts
* Added README.md for ios, setup_native, unotest
* Fixed issues with "underline" and "less than" sign

Change-Id: I3e52a1d3372586c390ee6c42a2ef48bbabc81398
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114248
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-04-19 11:13:41 +02:00
Hossein ea5641baee Updated README.md files to represent current code / use Markdown format
Previously, all of the README files have been renamed to README.md
and now, the contents of these files were changed to use Markdown
format. Other than format inconsistency, some README.md files lacked
information about modules, or were out of date. By using LibreOffice
/ OpenOffice wiki and other documentation websites, these files were
updated. Now every README.md file has a title, and some description.
The top-level README.md file is changed to add links to the modules.
The result of processing the Markdown format README.md files can be
seen at: https://docs.libreoffice.org/

Change-Id: Ic3b0c3c064a2498d6a435253b041df010cd7797a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113424
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2021-04-07 17:47:16 +02:00
Hossein c16158772d Using .md extension/Markdown syntax for modules README
Renaming all README files for all top level modules to README.md,
applying no content change at this stage to be able to track history
of the files. These files should be edited to use correct Markdown
syntax later.

Change-Id: I542fa3f3d32072156f16eaad2211a397cc212665
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112977
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2021-03-24 11:46:14 +01:00
Mike Kaganski 984a182750 Fix copy-paste leftover
Change-Id: If00eb6272443e1b97b6990141d091daa1d36dc34
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110881
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-02-14 14:11:58 +01:00
Mike Kaganski cfff893b9c Move unit conversion code to o3tl, and unify on that in more places
This also allows to easily add more units, both of length and for other
unit categories.

The conversion for "Line" unit (312 twip) is questionable. Corresponding
entries in aImplFactor in vcl/source/control/field.cxx were inconsistent
(45/11 in; 10/13 pc; 156/10 pt). They were added without explanation in
commit c85db62602. I haven't found a spec
of the unit (https://en.wikipedia.org/wiki/Line_(unit) is not specific).
I used the definition based on "by pt", "by mm/100", "by char" (they all
were consistent); "by pc" seems inverted; "by twip" was half as much.
This accepted conversion makes unit test for tdf#79236 pass.

Change-Id: Iae5a21d915fa8e934a1f47f8ba9f6df03b79a9fd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110839
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-02-14 12:50:01 +01:00
Stephan Bergmann 6ce3e7b615 Verify o3tl::temporary of a copied lvalue works as expected
Change-Id: I454dd9308e7da4c7be4751eb643395ac483d6c43
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108939
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-01-13 18:10:01 +01:00
Jan-Marek Glogowski 2e0b757e62 Rename sorted_vector::erase(size_t) to erase_at
emscripten clang fails with:

sc/source/core/data/attarray.cxx:378:44: \
    error: call to member function 'erase' is ambiguous
                        aNewCondFormatData.erase(nIndex);
                        ~~~~~~~~~~~~~~~~~~~^~~~~
include/o3tl/sorted_vector.hxx:86:15: note: candidate function
    size_type erase( const Value& x )
              ^
include/o3tl/sorted_vector.hxx:97:10: note: candidate function
    void erase( size_t index )

This looks like a compiler error, but if the vector contained
size_t values, this would also be ambiguous to begin with. So
this just renames erase(size_t) to erase_at.

And instead of a 2nd find in the failing code, after copying
the vector, it mow uses std::distance to remove the item.

Change-Id: I7d03ff32352a1890cc01ca241452c0f00d6a9302
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108212
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2020-12-23 11:44:47 +01:00
Philipp Hofer 6d5ff94b99 tdf#123936 Formatting files in module o3tl with clang-format
Change-Id: Ieb1229869cae8c14480243af98b270b9053fbde1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105691
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2020-11-18 12:55:43 +01:00