summaryrefslogtreecommitdiff
path: root/configmgr/source
AgeCommit message (Collapse)Author
2024-07-14Revert "boost::unordered_map to std::unordered_map in configmgr::Partial"Stephan Bergmann
This reverts commit 154b2040102d74aeb4c5d0cf07f1bdc90d265d52, which is known broken, as (unlike for boost::unordered_map) there is no guarantee that std::unordered_map works for incomplete value types, and indeed there is build environments that started to fail now with > In file included from /home/libo/src/core/configmgr/source/partial.cxx:23: > In file included from /usr/lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/set:60: > In file included from /usr/lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/stl_tree.h:63: > In file included from /usr/lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/stl_algobase.h:64: > /usr/lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/stl_pair.h:218:11: error: field has incomplete type 'configmgr::Partial::Node' > _T2 second; ///< The second member > ^ [...] Change-Id: Ie8d041bcf3d3b1b6aeede73adbaf14676250c4bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170467 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-07-13boost::unordered_map to std::unordered_map in configmgr::PartialNoel Grandin
Change-Id: I030a175af694d1e0025ac2c047141913b08c3be4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170395 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-05-10no need to convert from Sequence to std::set hereNoel Grandin
we are never actually going to need a set, so just iterate over the Sequence Change-Id: I0de6ff9e0661227a69b7fbe6cccc5268f9eba58f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167430 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-07loplugin:ostr in configmgrNoel Grandin
Change-Id: If1caaee8e54b5861e1435e900b3ae7bd90ecae5f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167237 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-05-04speedup configmgr::Access on WindowsNoel Grandin
std::multiset seems to be pretty slow to construct and destruct, even if we ~never put anything into these listener lists, so rather use o3tl::sorted_vector, which has more predictable performance. Shaves 10% off startup time for me. Change-Id: I13afcbe3cb63522e4efe61c64f773e1ffbec9683 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167101 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-22configmgr: fix parse error if subelements of <info> usedMichael Stahl
The unused but valid child elements of <info> such as <author> may be used by exentions. This fails with: warn:configmgr:15104:10916:configmgr/source/components.cxx:660: error reading "file:///instdir/program/../share/uno_packages/cache/uno_packages/....xcs" com.sun.star.uno.RuntimeException message: "bad member <component> in ....xcs at configmgr/source/xcsparser.cxx:289" Because ending the first such element sets bIsParsingInfo_ to false. This fix just concatenates all the characters in all the children, should work well enough for extensions. (regression from commit db3078bd8c8e3ce3a99fc3987bb6e93b609990c1) Change-Id: I17a3fb7014cd34c1d546701036550085365432a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165143 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2024-03-09Support o3tl::iterateCodePoints with both sal_Int32 and std::size_tStephan Bergmann
...and clean up the most gross casting offenses Change-Id: If0d646fb3e73e71a9a2735569395034973563a1f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164602 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-03-08use more string_viewNoel Grandin
found by tweaking the stringview loplugin Change-Id: I92203ba99642bef7951ffa146184c5562cb31d09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163744 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-06Fix placement of commentsStephan Bergmann
...which each pertain to all the preceding code that extracts numbers from strings, and where 0a5d4dc25c5521de221f63dbc47c6ba79a51f8fb "elide some OString temporaries" had changed that preceding code from stretching over a single to stretching over multiple statements each Change-Id: I315187465d64f620b1ddea8a0cc74ed5f8dc113b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163063 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-02-06elide some OString temporariesNoel Grandin
Change-Id: I2ecb6af11c95605c84e935b850fe94a1831a1497 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163043 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-05reduce unnecessary OString temporariesNoel Grandin
spotted while profiling tdf#108037 Change-Id: I66afa79d7da94c1d3c7d1695ce9c5cf902e1429e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163002 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-01-27Drop std::as_const from css::uno::Sequence iterationsMike Kaganski
Obsoleted by commit 2484de6728bd11bb7949003d112f1ece2223c7a1 (Remove non-const Sequence::begin()/end() in internal code, 2021-10-15) and commit fb3c04bd1930eedacd406874e1a285d62bbf27d9 (Drop non-const Sequence::operator[] in internal code, 2021-11-05). Change-Id: Idbafef5d34c0d4771cbbf75b9db9712e504164cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162640 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-12-19tdf#158593 Make configmgr READONLY Property more usefulStephan Bergmann
...to reflect whether or not the corresponding item can be modified. Which matches what the READONLY flag is actually used for today. (And the original, somewhat arbitrary semantics had been assigned without much thought, IIRC, and it should be OK to change them.) Change-Id: I8185e47519a5cb4aff6e8f260326845276b0c092 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160957 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2023-12-09cid#1558833 Uninitialized scalar fieldCaolán McNamara
Change-Id: I8c617c20f725f4277a0c4d637be336c6624c3238 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160513 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-07tdf#157432 Expert config: Allow filtering by changed valuesSamuel Mehrbrodt
Change-Id: Ib8bbb7fc9e8014a9367278f3fa640f53af46dd2b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159986 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2023-11-26Simplify implementation of getTypeByHierarchicalNameStephan Bergmann
(Localized)PropertyType::getStaticType already provides the relevant information Change-Id: I5aceb596ac4a2d111ebcb5ddef7ef74c80762047 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159969 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2023-11-25Simplify description/type parsing a bitStephan Bergmann
...it only pertains to property nodes Change-Id: I706e14118e3f8c33190821f9bcce81bd60d665e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159953 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2023-11-21asan: fix read of uninitialised valueNoel Grandin
ever since commit a91892ec4942fc875820ea02dfbe74e986548142 Author: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> Date: Thu Nov 16 13:56:06 2023 +0100 Use existing types, instead of strings Change-Id: Ifb7af17d21a32fdf411854b6820b32d1767660e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159779 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-20Use existing types, instead of stringsSamuel Mehrbrodt
as suggested in https://gerrit.libreoffice.org/c/core/+/158028/comments/b7a803f4_7e5899ca Change-Id: I7d4c46b24307922b51e463bacdfacfca85956b80 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159524 Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de> Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2023-11-20Extended loplugin:ostr: configmgrStephan Bergmann
Change-Id: If9cc1f0c18a5fa344a433b338f81d191340e70f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159722 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-09Use proper type in expert config dialogSamuel Mehrbrodt
In preparation for proper editing support for the different types. Change-Id: I7044ff100c9bfcca5fa8894ff4525a1aac692796 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158028 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2023-11-09tdf#157431 Show description for expert config itemsSamuel Mehrbrodt
Change-Id: I7d0257c2e06ed384f90ca3b51a6d2549044f2cf3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157148 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2023-10-31reduce ref-counting traffic in configmgrNoel Grandin
we can return by const& from getNode Change-Id: If93c43fd2e910e2fb69d9bd0a9e3dc587133dfa8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158729 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-10-31reduce reference counting traffic in configmgrNoel Grandin
no need to construct a vector when iterating over children Change-Id: I717e92be3c576a6e5d877f4333264a5bed9daadf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158728 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-10-19Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: configmgrStephan Bergmann
Change-Id: Id95245a309b3baa80d7cca63d980aa0657fb9eb2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158148 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-08-31SAL_WARN->SAL_INFO in Access::getChildNoel Grandin
reduce log noise Change-Id: I95393f18fe8cc019c89ad4779d5b10f64993bd51 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156340 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-07-18Make sure that root listeners are notified firstMike Kaganski
The problem appeared when in a configuration listener's changesOccurred, a configuration value was read using officecfg machinery, which could return the old value of the configuration, or an updated one, at random. This was caused by use of a cached value in comphelper::detail::ConfigurationWrapper::getPropertyValue, which is cleaned in ConfigurationChangesListener::changesOccurred; but the order in which the listeners' changesOccurred methods were called depended on the implementation detail of configmgr::Components::roots_, which was previously a std::set of pointers, and now is a sorted vector. This made the pointers sorted in order of the pointers' addresses (basically random), and when a broadcaster's common list of change listeners was prepared in Components::initGlobalBroadcaster, ConfigurationWrapper's listener could arrive last. This meant, that the cache could be cleaned too late, after its obsolete content was already used in a previous listener. The problem could be partially mitigated by clearing the cache in the comphelper::detail::ConfigurationWrapper::setPropertyValue, but that would only handle cases of config modifications using comphelper. Instead, take into account that ConfigurationWrapper listens on the root of configuration tree; and introduce a separate container in configmgr::Broadcaster for root listeners. They would be triggered first, before all other listeners. Still, this would not guarantee the proper order, if another listener is registered on root. To handle all cases, a special listener category could be used, which could be filled using a dedicated internal API, so comphelper could use it to register its privileged listener close to the heart of the broadcaster :) This might be implemented later. Change-Id: I956b7989b3927dca2683f63cf92b0dda04db9bdf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154561 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-06-18Use getXWeak in configmgrMike Kaganski
Change-Id: Ia7d9475cecd2208ccf672f2b35c0c841fed7f4dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150840 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-05-25merge some stringaddsNoel Grandin
found with a lightly tweaked version of the loplugin:stringadd and some hand-holding. Change-Id: I146aadcaf665e98fea89a9cad2df4dc3935622f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152275 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-05-11Allow all hierarchical path segments to be ['...'] quotedStephan Bergmann
...and not just set elements. <https://gerrit.libreoffice.org/c/core/+/151660> "tdf#104005 Don't allow changing finalized properties" found that some existing property names include "/", which makes them unusable with e.g. getPropertyByHierarchicalName. The most obvious solution is to allow ['...'] quoting (without a leading template name, though) for all kinds of hierarchical path segments. (In theory, that would cause backwards incompatibility, as e.g. a property named ['foo'] could no longer be referenced by a ['foo'] path segment (it would need to be referenced by a ['[&apos;foo&apos;]'] path segment instead). But in practice, that path segment ['foo'] would have been rejected in the past anyway, as it did not reference a set element.) To make this work, the meaning of the setElement out-parameter of configmgr::Data::parseSegment is changed to only be true if the segment uses ['...'] notation including a leading (non-empty) template name. What this change does not (yet) address is writing out such quoted (group or set) names in the hierarchical paths written out in configmgr::writeModFile, where necessary. (It never writes out names of properties as parts of hierarchical names, so this wouldn't be an issue for the existing problematic properties containing "/" in their names, anyway.) Change-Id: I635d823c7bbb6b8ac5869c7e0130ba8cfd329599 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151673 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-04-28optimise find/insert calls to mapsNoel Grandin
Instead of doing two lookups, we can just call insert and then update the mapped-to value if the insert actually succeeded. Change-Id: I3df3b98f0debe6bf74c739dd5850e7714d9c2789 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151030 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-18Some missing XServiceInfo implementationsStephan Bergmann
Change-Id: I1cf871b40f9f4020147dac0456ebeed3de0438e6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150533 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-03-24loplugin:stringadd in c*Noel Grandin
after my patch to merge the bufferadd loplugin into stringadd Change-Id: I66f4ce2fd87c1e12eefb14406e0e17212f68ceff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149497 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-03-16tdf#143148: Use pragma once instead of include guardsUday Sharma
Change-Id: I6898acbf7c6c9de45bbfa6a32202acf302f92caa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146822 Tested-by: Jenkins Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2023-03-15Bump dconf minimum version requirementStephan Bergmann
At least building on Fedora 37 with dconf-devel-0.40.0-7.fc37.x86_64 against recent LLVM 17 trunk libc++ started to fail now with > In file included from configmgr/source/dconf.cxx:25: > In file included from /usr/include/dconf/dconf.h:23: > In file included from /usr/include/dconf/common/dconf-enums.h:23: > In file included from /usr/include/glib-2.0/glib.h:34: > In file included from /usr/include/glib-2.0/glib/gasyncqueue.h:34: > In file included from /usr/include/glib-2.0/glib/gthread.h:34: > In file included from /usr/include/glib-2.0/glib/gatomic.h:30: > In file included from /usr/include/glib-2.0/glib/glib-typeof.h:44: > In file included from ~/llvm/inst/bin/../include/c++/v1/type_traits:430: > ~/llvm/inst/bin/../include/c++/v1/__type_traits/aligned_union.h:23:1: error: templates must have C++ linkage > template <size_t _I0, size_t ..._In> > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > configmgr/source/dconf.cxx:19:1: note: extern "C" language linkage specification begins here > extern "C" { > ^ because the missing extern "C" has meanwhile been added to upstream dconf with <https://gitlab.gnome.org/GNOME/dconf/-/commit/f860ddcc6a501b982d82c5630c73936bd611ad8a> "common: Add missing G_BEGIN/END_DECLS" towards tag 0.40.0. So the easiest fix here appears to be to bump our requirements to that dconf version 0.40.0: The one case I'm aware of that explicitly wants dconf support is downstream Fedora and RHEL builds, which already have dconf 0.40.0 (cf. most recent <https://src.fedoraproject.org/rpms/dconf/blob/a9987b0abe15133d091bcd390fd33077881567ae/f/dconf.spec#_4> for f37 and most recent <https://gitlab.com/redhat/centos-stream/rpms/dconf/-/blob/1bb6b46da242b75e5e1864f5c97ab6e592ca60ba/dconf.spec#L4> for e9s). On the other hand, the TDF Linux release builds are done with an explicit --disable-dconf in distro-configs/LibreOfficeLinux.conf (since ecc617e797aa5ed329668114e54ec7ffa5c0e87b "configmgr: support reading from a dconf layer (WIP)") and the Flatpak builds on Flathub are done against an org.freedesktop.Sdk//22.08 where no dconf support is detected at all (for the most recent LO 7.5.1 build on Flathub see > checking for DCONF... no > checking whether to enable dconf... no at <https://buildbot.flathub.org/#/builders/5/builds/3184/steps/8/logs/stdio> for aarch64 and at <https://buildbot.flathub.org/#/builders/5/builds/3184/steps/8/logs/stdio> for x86_64). Change-Id: I559d2ac8712dbe2b40c9b881314b88d1cc8eaf43 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148887 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-02-23unlock during dispose in configmgr::configuration_provider::ServiceNoel Grandin
Since the code that can run during flushModifications might manage to call back into Service.. regression from commit a61951a3a21c6457334f78f657806c1167dbf339 Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Mon Feb 20 20:08:30 2023 +0200 BaseMutex->std::mutex in configmgr::configuration_provider::Service Change-Id: I0070e7589cdea38905de6c68adefd8081b122152 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147500 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-21fix locking in configmgr::configuration_provider::ServiceNoel Grandin
a mistake from commit a61951a3a21c6457334f78f657806c1167dbf339 Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Mon Feb 20 20:08:30 2023 +0200 BaseMutex->std::mutex in configmgr::configuration_provider::Service Change-Id: I59c670ea7bffacb9dcd1f073b5da2439c2102a45 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147392 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-21BaseMutex->std::mutex in configmgr::configuration_provider::ServiceNoel Grandin
Change-Id: Ie8f7cb4cd91ac0089365a691f07962a26d51a72a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147377 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-17Try an override locale as first fallbackEike Rathke
Change-Id: I4ca6db43fef2706c4c1bab020e2170f6cf45a441 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147184 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2023-02-15Use the (first segment of the) original locale value for the workaround againStephan Bergmann
cf7c9599e776eba8e14614cecb528d3da5778190 "Make comphelper/configuration.hxx work for localized properties", which had originally introduced this code, had been careful to ensure that the > assert( > !locale.isEmpty() && locale.indexOf('-') == -1 && > locale.indexOf('_') == -1); would always hold here (it had already removed all trailing "-..." and "_..." segments, but had made sure to stop before `locale`, which is known to initially be no non-empty, would have become empty, by treating a leading "-" or "_" not as a segment delimiter, but rather as a first segment). dfc28be2487c13be36a90efd778b8d8f179c589d "configmgr: Use a proper LanguageTag-based locale fallback mechanism" had changed that, instead setting `locale` to some value obtained from `LanguageTag::getFallbackStrings`, which might or might not satisfy the assert. But there was no good reason for that part of dfc28be2487c13be36a90efd778b8d8f179c589d in the first place: The workaround (as explained in the leading code comment) was meant to be carried out with the first segment of the original `locale` value, not with some fallback value. So put back here the computation of that first segment of the original `locale` value. (And drop the misleading empty line that dfc28be2487c13be36a90efd778b8d8f179c589d had, for no good reason, introduced between the workaround's leading code comment and its actual code.) However, it turns out that there was one flaw in cf7c9599e776eba8e14614cecb528d3da5778190: When the original `locale` starts with "-" or "_", the resulting `locale` representing the first segment will be "-" or "_", so the `locale.indexOf('-') == -1 && locale.indexOf('_') == -1` part of the assert would be false. But that wouldn't be an issue for the following code (the only issue would be if `locale` had become empty, in which case the `name2.startsWiht(locale)` check would trivially become true, and that for loop would erroneously pick the child with the empty `name2`), and that part of the assert had merely been there to reinforce that `locale` had indeed been stripped down to the first segment. A correct version of the assert would have used `locale.indexOf('-', 1) == -1 && locale.indexOf('_', 1) == -1` instead, but as the code now makes it obvious anyway that `locale` has been cut down here to the first segment, we can just as well simplify the assert to just the `!locale.isEmpty()` part. (The added test code unfortunately doesn't actually test this piece of code, and somewhat unexpectedly receives the "default" value from the empty string locale default, rather than the "en-US" value from the higher precedence "en-US" locale default, because `aFallbacks` happens to contain an empty string, so we already leave Access::getChild early in the "Find the best match using the LanguageTag fallback mechanism, excluding the original tag" block.) Change-Id: Ib92e714c9db4879be058529ec905e631df975424 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147113 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-02-02osl::Mutex->std::mutex in configmgr::read_write_access::ServiceNoel Grandin
Change-Id: Ic8f688d3ad66c1be33a147e05b0e9145593214f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146471 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-02-02osl::Mutex->std::mutex in configmgr::read_only_access::ServiceNoel Grandin
Change-Id: Ia92bb76cedb45d2c28482d34869e239cfdd32ebf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146470 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-23XUnoTunnel->dynamic_cast in configmgr::ChildAccessNoel Grandin
Change-Id: Iadfdbb68ad7876801bf79352bdec26da7da63325 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145993 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-10-11Deduplicate O(U)StringConcatenationMike Kaganski
And use an overloaded helper function with a better (?) unified name to show that the result is not an O(U)String. Change-Id: I8956338b05d02bf46a6185828130ea8ef145d46b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141203 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-09-27Revert some string_view pessimizationStephan Bergmann
This reverts the configmgr part of 0a7eac8576f313dcaf27ee45326d71fd6b5aea1e "use more string_view in accessibility..configmgr": All calls to Data::parseSegment (either directly, or indirectly either via Access::getSubChild or via parseSegment in partial.cxx) pass in an OUString path, and in some cases (see below) > *name = path.substr(index, i - index); in Data::parseSegment reconstructs an OUString from the full path (i.e., index == 0 and i == path.size()). And I see no code that actually benefited from the switch to string_view. One example call stack for such an expensive reconstruction of an OUString from full path is > #0 in configmgr::Data::parseSegment(path=u"ooSetupSystemLocale", index=0, name=0x7ffff5299280, setElement=0x7ffff52992a0, templateName=0x7ffff52992b0) in core/configmgr/source/data.cxx > #1 in configmgr::Access::getSubChild(this=0x619000028f80, path=u"ooSetupSystemLocale") in core/configmgr/source/access.cxx > #2 in configmgr::Access::getByHierarchicalName(this=0x619000028f80, aName="ooSetupSystemLocale") in core/configmgr/source/access.cxx > #3 in utl::ConfigItem::GetProperties(xHierarchyAccess=uno::Reference to (configmgr::RootAccess *) 0x619000028fb8, rNames=uno::Sequence of length 6 = {...}, bAllLocales=false) in core/unotools/source/config/configitem.cxx > #4 in utl::ConfigItem::GetProperties(this=0x61100000cad0, rNames=uno::Sequence of length 6 = {...}) in core/unotools/source/config/configitem.cxx > #5 in SvtSysLocaleOptions_Impl::SvtSysLocaleOptions_Impl(this=0x61100000cad0) in core/unotools/source/config/syslocaleoptions.cxx [...] Change-Id: I51127d82aea927dd9aaf374880c406dbafaddcde Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140658 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-09-27use more string_view in accessibility..configmgrNoel Grandin
Change-Id: Ie16d36faac7d06e275348ed68e6c6b2518534fd6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140636 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-09-15Clean up color scheme migrationStephan Bergmann
...avoiding to have code in configmgr that knows about the details of the data stored in the configuration. (See the comments starting at <https://gerrit.libreoffice.org/c/core/+/139690/9#message-44703a2529c07bf1b0202ed3a232aa661784b159> "Migrating product name related color schemes between different versions" for details.) This reverts the dubious changes of 583ea856f2aa227bb04581c5bcdc3a402f5a184f "Migrating product name related color schemes between different versions" in configmgr and offapi. (Also, this moves the computation of sMigratedProductName in MigrationImpl::copyConfig, desktop/source/migration/migration.cxx, to a saner location than in the middle of the "check if the shared registrymodifications.xcu file exists" block where that 583ea856f2aa227bb04581c5bcdc3a402f5a184f had placed it.) Change-Id: I7ab3d57db19065c7c818e697300a2abd9e7f72bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139963 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-09-13Migrating product name related color schemes between different versionsBalazs Varga
Making work to migrate product name related color schemes with different kind of product names. For example from a product named by LibreOffice to a product named by LibreOfficeDev. Change-Id: Iabef982216f126b781df122ed258816af2ae337c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139690 Tested-by: Jenkins Tested-by: Gabor Kelemen <kelemeng@ubuntu.com> Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
2022-08-18Move tools/diagnose_ex.h to comphelper/diagnose_ex.hxxStephan Bergmann
...so that its TOOLS_WARN_EXCEPTION can be used in comphelper/source/misc/logging.cxx in a follow-up commit. (And while at it, rename from diangose_ex.h to the more appropriate diagnose_ex.hxx. The comphelper module is sufficiently low-level for this immediate use case, so use that at least for now; o3tl might be even more suitable but doesn't have a Library until now. Also, for the immediate use case it would have sufficed to only break DbgGetCaughtException, exceptionToString, TOOLS_WARN_EXCEPTION, TOOLS_WARN_EXCEPTION_IF, and TOOLS_INFO_EXCEPTION out of include/tools/diagnose_ex.h into an additional new include/comphelper/diagnose_ex.hxx, but its probably easier overall to just move the complete include file as is.) Change-Id: I9f3222d4ccf1a9ac29d7eb9ba1530d53e2affaee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138451 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-07-21elide some makeStringAndClear() callsNoel Grandin
Change-Id: Id81a0c0046d0d84e6c327eef4447b21fecae6ddc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137283 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>