3053 Commits
Author SHA1 Message Date
Michael Weghorn 9ad7a74a7c configmgr/dconf: Drop cast from gdouble to double
They're equivalent. (gdouble is a typedef for double.)

Fixes this clang plugin error seen on Debian testing:

    .../configmgr/source/dconf.cxx:305:16: error: redundant functional cast from 'gdouble' (aka 'double') to 'double' [loplugin:redundantfcast]
      305 |     *value <<= double(g_variant_get_double(variant.get()));
          |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1 error generated.

Change-Id: I5f64c27288bcf0b1aeb50ffb446ceb3f579f9651
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202415
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-03-23 15:20:45 +01:00
Stephan Bergmann 8854a990f2 configmgr/winreg: Mention the HKEY in SAL_INFOs
Change-Id: Ib284a7124547dc2e13e2fe3d2262ea79bab957b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193966
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-11-13 23:38:52 +01:00
Gabor Kelemen 6ca541eb8f tdf#146619 Run IWYU on configmgr/
Change-Id: I8f8a9ce432e0fdfa3f00bd577adb3c8749bb89c6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189788
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2025-09-12 17:18:40 +02:00
Caolán McNamara 72e538b9bd tainted_data_return is deprecated
in favour of taint_source, lets drop them all first

Change-Id: I9c4e5c143fcbd6de9491360c993a8ea1b89a726e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189820
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-08-17 15:33:16 +02:00
Stephan Bergmann 0b1d3f2858 Log configmgr data read from Windows Registry
Change-Id: I034bf988d1b9a165ace56a6dd94f1a61ff6633c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189184
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-08-08 16:26:51 +02:00
Stephan Bergmann 33bb647987 Silence bogus GCC -Wstringop-overflow
...seen at least with gcc-15.1.1-2.fc42.x86_64, when doing optimizing LO builds,

> In file included from include/rtl/ustring.h:29,
>                  from include/typelib/typedescription.h:29,
>                  from include/com/sun/star/uno/Type.h:26,
>                  from workdir/UnoApiHeadersTarget/udkapi/normal/com/sun/star/beans/Property.hdl:6,
>                  from workdir/UnoApiHeadersTarget/udkapi/normal/com/sun/star/beans/Property.hpp:6,
>                  from configmgr/source/access.cxx:28:
> In member function ‘void configmgr::Access::releaseNondeleting()’,
>     inlined from ‘rtl::Reference<configmgr::ChildAccess> configmgr::Access::getUnmodifiedChild(const rtl::OUString&)’ at configmgr/source/access.cxx:2064:38:
> include/osl/interlck.h:91:57: error: ‘unsigned int __sync_sub_and_fetch_4(volatile void*, unsigned int)’ writing 4 bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
>    91 | #    define osl_atomic_decrement(p) __sync_sub_and_fetch((p), 1)
>       |                                     ~~~~~~~~~~~~~~~~~~~~^~~~~~~~
> configmgr/source/access.cxx:134:5: note: in expansion of macro ‘osl_atomic_decrement’
>   134 |     osl_atomic_decrement(&m_refCount);
>       |     ^~~~~~~~~~~~~~~~~~~~
> In member function ‘rtl::Reference<configmgr::ChildAccess> configmgr::Access::getUnmodifiedChild(const rtl::OUString&)’:
> cc1plus: note: destination object is likely at address zero

Change-Id: I0885af282844fecaf4c117df7d24a943b62aa42c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188259
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
2025-07-24 10:17:04 +02:00
Gabor Kelemen a48bb5c25b Remove obsolete fw declarations from canvas/ codemaker/ configmgr/
found with bin/find-unneeded-includes --fwdecl

Change-Id: Ife87bf89617d97cee9dd1f25d6e912665e4c33a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183879
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2025-04-11 10:53:14 +02:00
Stephan Bergmann 08ef545000 configmgr: Let XRegistryKey::getLongValue return boolean values, too
Ever since 21d42ab495 "#75148# check security and
netaccess are set now", getJavaPropsFromSafetySettings in
stoc/source/javavm/javavm.cxx tries to read a Security property (of type
xs:boolean in officecfg/registry/schema/org/openoffice/Office/Java.xcs) via
XRegistryKey::getLongValue.  While this may have worked with the previous
configmgr implementation, it now just always caused an exception (that would
have been swalled in initVMConfiguration in stoc/source/javavm/javavm.cxx).

Not sure if there are any other places where code expects to read a boolean
property value from the configuration via XRegistryKey::getLongValue, but lets
better add that (back) as a (hopefully) harmless extension.

Change-Id: I33ca60595da8fd79fb9250d74f36be0b328d610f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183269
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2025-03-24 17:02:26 +01:00
Caolán McNamara 1b39c4dd8b lok: encourage even more sharing of config Node pages.
some properties, e.g. the localized user strings for "uno commands"
as used by vcl::CommandInfoProvider::GetCommandProperties are
cloned, so the inserted clones are not staticized.

Profiles persisted in show many probe:do_wp_page events from
salhelper::SimpleReferenceObject::acquire in
configmgr::Access::getUnmodifiedChild

https: //raw.githubusercontent.com/caolanm/profiles/585ce8645ff6ea1e3de1b3cc6f11a16f325fb0d9/do_wp_page/Demo.eu-2025-02-12T04%3A36%3A21.759836.svg
Change-Id: I3eaccbbd7e9af0c312ed1d7da68e64ffb96d3292
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181513
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 9be96cfcaec84b730ad2dae923a91aa39efe2993)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182350
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-02-28 15:43:56 +01:00
Michael Meeks f05302c3df lok: encourage more sharing of config Node pages.
Profiles show lots of probe:do_wp_page events from things like
configmgr::Access::getUnmodifiedChild - as when we read we touch
lots of Node reference counts - un-necessarily.

So - reduce un-necessary reference counting thrash here in the
lok case through the environment variable. Quite possibly this
would also be safe and beneficial for the desktop app - needs
measurement.

measuring with coolmap and an empty hello-world.odt before & after:
before:
	unshared  3634 (14536kB)
	unshared  3631 (14524kB)
	unshared  3605 (14420kB)

after:
	unshared  3578 (14312kB)
	unshared  3613 (14452kB)
	unshared  3599 (14396kB)

Not hugely encouraging, perhaps there is another page touch
underneath we'll find when this is addressed.

Change-Id: I8ac74c5fcd17f8699139e914a7076a7848456e2a
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175197
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182349
Tested-by: Jenkins
2025-02-28 15:43:40 +01:00
Noel Grandin 02971a09db unused "lock_" field in Components::WriteThread
ever since

    commit a0ffaeeff9
    Author: Stephan Bergmann <stephan.bergmann@allotropia.de>
    Date:   Mon Feb 10 14:38:33 2025 +0100
    Shrink critical section into writeModFile

Change-Id: Iaa7e34182dffe485addc5b221953c938675375d1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181469
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Tested-by: Jenkins
2025-02-12 11:04:19 +01:00
Stephan Bergmann a0ffaeeff9 Shrink critical section into writeModFile
...from the calling configmgr::Components::WriteThread::execute.  This is
relevant at least for an upcoming Emscripten Qt6 JSPI/non-PROXY_TO_PTHREAD mode,
where part of the LO event handling (which would normally take place on the main
thread) will be offloaded to an additional thread.  There, opening e.g. a fresh
Writer document shortly after starting LO could have lead to a deadlock:

The configmgrWriter thread had the configmgr::Components mutex locked and tried
to do a mkdir, which it needs to proxy to the main thread on Emscripten,

> $emscripten_futex_wait (soffice.wasm:0x83dbf64)
> $__timedwait_cp (soffice.wasm:0x83e7f34)
> $__pthread_cond_timedwait (soffice.wasm:0x83e8168)
> $pthread_cond_wait (soffice.wasm:0x83e85a2)
> $emscripten_proxy_sync_with_ctx (soffice.wasm:0x83e6709)
> $emscripten_proxy_sync (soffice.wasm:0x83e6a08)
> $_emscripten_run_on_main_thread_js (soffice.wasm:0x83e6d77)
> ret.<computed> (soffice.js:8709)
> (anonymous) (soffice.js:1285)
> proxyToMainThread (soffice.js:1617)
> ___syscall_mkdirat (soffice.js:6613)
> $mkdir (soffice.wasm:0x83e3e0a)
> $osl::mkdir(rtl::OString const&, unsigned int) (soffice.wasm:0xbce7b3)
> $create_dir_with_callback(char*, void (*)(void*, _rtl_uString*), void*) (soffice.wasm:0xbdc4d6)
> $create_dir_recursively_(char*, void (*)(void*, _rtl_uString*), void*) (soffice.wasm:0xbdc422)
> $osl_createDirectoryPath (soffice.wasm:0xbdc35f)
> $configmgr::writeModFile(configmgr::Components&, rtl::OUString const&, configmgr::Data const&) (soffice.wasm:0x4218d80)
> $configmgr::Components::WriteThread::execute() (soffice.wasm:0x41f561d)
> $non-virtual thunk to salhelper::Thread::run() (soffice.wasm:0xd369fd)
> $threadFunc (soffice.wasm:0xd36890)
> $osl_thread_start_Impl(void*) (soffice.wasm:0xbca617)

...while the main thread was serving a proxied call from the additional "event
handling offload" thread, during which it accesses configmgr code and tried to
lock the configmgr::Components mutex,

> $a_cas_p (soffice.wasm:0x83dc0d9)
> $futex_wait_main_browser_thread (soffice.wasm:0x83dbfed)
> $emscripten_futex_wait (soffice.wasm:0x83dbf23)
> $__timedwait_cp (soffice.wasm:0x83e7f34)
> $__timedwait (soffice.wasm:0x83e7fd2)
> $__pthread_mutex_timedlock (soffice.wasm:0x83e9323)
> $__pthread_mutex_lock (soffice.wasm:0x83e9208)
> $osl_acquireMutex (soffice.wasm:0xbbc750)
> $configmgr::Access::thisIs(int) (soffice.wasm:0x41dc351)
> $configmgr::Access::getByName(rtl::OUString const&) (soffice.wasm:0x41e13b3)
> $non-virtual thunk to configmgr::Access::getByName(rtl::OUString const&) (soffice.wasm:0x41e159a)
> $comphelper::detail::ConfigurationWrapper::getPropertyValue(std::__2::basic_string_view<char16_t, std::__2::char_traits<char16_t>>) const (soffice.wasm:0xc2f8fe)
> $comphelper::ConfigurationProperty<officecfg::Office::Common::Misc::ViewerAppMode, bool>::get(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) (soffice.wasm:0xdfbc05)
> $SfxDispatcher::FindServer_(unsigned short, SfxSlotServer&) (soffice.wasm:0xdfb6d4)
> $SfxDispatcher::GetShellAndSlot_Impl(unsigned short, SfxShell**, SfxSlot const**, bool, bool) (soffice.wasm:0xdfb398)
> $SfxDispatcher::QueryState(unsigned short, com::sun::star::uno::Any&) (soffice.wasm:0xe01fe3)
> $SfxDispatchController_Impl::addStatusListener(com::sun::star::uno::Reference<com::sun::star::frame::XStatusListener> const&, com::sun::star::util::URL const&) (soffice.wasm:0xe1d5bd)
> $SfxOfficeDispatch::addStatusListener(com::sun::star::uno::Reference<com::sun::star::frame::XStatusListener> const&, com::sun::star::util::URL const&) (soffice.wasm:0xe1d4ce)
> $non-virtual thunk to SfxOfficeDispatch::addStatusListener(com::sun::star::uno::Reference<com::sun::star::frame::XStatusListener> const&, com::sun::star::util::URL const&) (soffice.wasm:0xe1daa6)
> $svt::PopupMenuControllerBase::updateCommand(rtl::OUString const&) (soffice.wasm:0x20cd630)
> $svt::PopupMenuControllerBase::updatePopupMenu() (soffice.wasm:0x20cd460)
> $framework::HeaderMenuController::updatePopupMenu() (soffice.wasm:0x29a0323)
> $svt::PopupMenuControllerBase::setPopupMenu(com::sun::star::uno::Reference<com::sun::star::awt::XPopupMenu> const&) (soffice.wasm:0x20cf1bb)
> $non-virtual thunk to svt::PopupMenuControllerBase::setPopupMenu(com::sun::star::uno::Reference<com::sun::star::awt::XPopupMenu> const&) (soffice.wasm:0x20cf1e0)
> $framework::MenuBarManager::CreatePopupMenuController(framework::MenuBarManager::MenuItemHandler*, com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider> const&, rtl::OUString const&) (soffice.wasm:0x217c209)
> $framework::MenuBarManager::Activate(Menu*) (soffice.wasm:0x218130b)
> $framework::MenuBarManager::Activate(Menu*) (soffice.wasm:0x2180b17)
> $framework::MenuBarManager::LinkStubActivate(void*, Menu*) (soffice.wasm:0x2180126)
> $Menu::Activate() (soffice.wasm:0x14d68e0)
> $Menu::HandleMenuActivateEvent(Menu*) const (soffice.wasm:0x14df42c)
> $QtMenu::DoFullMenuUpdate(Menu*) (soffice.wasm:0x6617932)
> $QtMenu::SetFrame(SalFrame const*) (soffice.wasm:0x661738a)
> $std::__2::__function::__func<QtMenu::SetFrame(SalFrame const*)::$_0, std::__2::allocator<QtMenu::SetFrame(SalFrame const*)::$_0>, void ()>::operator()() (soffice.wasm:0x661c275)
> $QtInstance::EmscriptenProxyToMainThread(std::__2::function<void ()>)::$_0::__invoke(void*) (soffice.wasm:0x65b24e4)

Change-Id: Iee58b86a96147273b7ae288524513e0d174287a8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181353
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2025-02-10 17:38:57 +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
Caolán McNamara 4a584493db let insertModificationXcuFile accept "/" to indicate all nodes
insertModificationXcuFile takes a set of paths to include and a set of
paths to ignore from a given .xcu files

adapt this to allow an include path of "/" to match all contents of the
xcu.

insertModificationXcuFile is more useful than insertExtensionXcuFile for
the intended use case, because the latter inserts as an extension level
layer, and cannot override higher layers.

Change-Id: I8eabd9fb91184146a75b087cc31cee44f378d96d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178603
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-12-20 20:29:35 +01:00
Stephan Bergmann 7f927322d9 configmgr: Better handling of finalized vs. non-finalized in the same layer
When there are multiple competing configuration settings for the same
configuration layer (e.g., in xcu files of two different extensions from the
same extension layer), then the setting that is read last always won, even if
any of the settings read earlier is marked as finalized.  (The reason for
originally doing it that way was that it kept the code logic somewhat simple.)

However, esp. for a scenario of multiple extensions in one extension layer
(bundled, shared, or user), it can be unexpected by a user that a non-finalized
setting (that comes from the extension that happens to be read last) can win
over a finalized one.

Therefore, change the logic accordingly.  Now, if any of the competing settings
are finalized, the first finalized one that is read wins.

Change-Id: I22aeade543a5b26d95d49cfcb561f974cd7a5081
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177737
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-12-03 16:26:52 +01:00
Caolán McNamara 4f7cdf40de drop a TODO
I don't think anyone is getting around to changing this after 13
years, and an int worth of config layers looks safe enough to me.

Change-Id: Iecf00a4d342e60d8f56a27978c40fa8d861ecd7e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177428
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-11-27 17:16:36 +01:00
Caolán McNamara a025eef003 cid#1606638 silence Overflowed integer argument
and

cid#1608572 Overflowed integer argument
cid#1607772 Overflowed integer argument
cid#1607196 Overflowed integer argument
cid#1606568 Overflowed return value
cid#1607573 Overflowed return value

Change-Id: I9a701b19026572127399712c3b660094f2a0bd40
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176740
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-11-18 22:24:40 +01:00
Mike Kaganski 56f3dbffdf Simplify a bit
Change-Id: I618b0f8bcb2e8032ee12367c73e1136685f66b3e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176183
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-11-08 05:34:20 +01:00
Noel Grandin 5fdfc074c9 loplugin:passstuffbyref make some small improvements
Change-Id: Ib14a2e6b41165887fcf99c3d155850faa8564822
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176218
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-07 17:20:09 +01:00
Caolán McNamara 23d7910c1e cid#1554844 COPY_INSTEAD_OF_MOVE
and

cid#1554878 COPY_INSTEAD_OF_MOVE
cid#1554907 COPY_INSTEAD_OF_MOVE
cid#1555082 COPY_INSTEAD_OF_MOVE
cid#1555224 COPY_INSTEAD_OF_MOVE
cid#1555301 COPY_INSTEAD_OF_MOVE
cid#1555378 COPY_INSTEAD_OF_MOVE
cid#1555395 COPY_INSTEAD_OF_MOVE
cid#1555452 COPY_INSTEAD_OF_MOVE
cid#1555466 COPY_INSTEAD_OF_MOVE
cid#1555514 COPY_INSTEAD_OF_MOVE
cid#1555566 COPY_INSTEAD_OF_MOVE
cid#1555753 COPY_INSTEAD_OF_MOVE
cid#1555782 COPY_INSTEAD_OF_MOVE
cid#1555825 COPY_INSTEAD_OF_MOVE
cid#1555842 COPY_INSTEAD_OF_MOVE
cid#1555891 COPY_INSTEAD_OF_MOVE
cid#1555917 COPY_INSTEAD_OF_MOVE
cid#1555961 COPY_INSTEAD_OF_MOVE
cid#1556021 COPY_INSTEAD_OF_MOVE
cid#1556055 COPY_INSTEAD_OF_MOVE
cid#1556307 COPY_INSTEAD_OF_MOVE
cid#1556349 COPY_INSTEAD_OF_MOVE
cid#1556436 COPY_INSTEAD_OF_MOVE
cid#1556665 COPY_INSTEAD_OF_MOVE
cid#1556696 COPY_INSTEAD_OF_MOVE
cid#1556718 COPY_INSTEAD_OF_MOVE
cid#1556775 COPY_INSTEAD_OF_MOVE
cid#1556835 COPY_INSTEAD_OF_MOVE
cid#1556877 COPY_INSTEAD_OF_MOVE
cid#1556994 COPY_INSTEAD_OF_MOVE
cid#1557010 COPY_INSTEAD_OF_MOVE
cid#1557074 COPY_INSTEAD_OF_MOVE
cid#1557111 COPY_INSTEAD_OF_MOVE
cid#1557142 COPY_INSTEAD_OF_MOVE
cid#1557163 COPY_INSTEAD_OF_MOVE
cid#1557164 COPY_INSTEAD_OF_MOVE
cid#1557214 COPY_INSTEAD_OF_MOVE
cid#1557254 COPY_INSTEAD_OF_MOVE
cid#1557322 COPY_INSTEAD_OF_MOVE
cid#1557327 COPY_INSTEAD_OF_MOVE
cid#1557492 COPY_INSTEAD_OF_MOVE
cid#1557565 COPY_INSTEAD_OF_MOVE
cid#1557663 COPY_INSTEAD_OF_MOVE
cid#1557798 COPY_INSTEAD_OF_MOVE

Change-Id: I2ae9c184dcc18d44a65437e18c49e16b27f4d81d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174893
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-10-14 15:28:24 +02:00
Caolán McNamara 0a5ce68dc3 cid#1632259 COPY_INSTEAD_OF_MOVE
and

cid#1632258 COPY_INSTEAD_OF_MOVE
cid#1632257 COPY_INSTEAD_OF_MOVE
cid#1632256 COPY_INSTEAD_OF_MOVE
cid#1632255 COPY_INSTEAD_OF_MOVE
cid#1632254 COPY_INSTEAD_OF_MOVE
cid#1632253 COPY_INSTEAD_OF_MOVE
cid#1632252 COPY_INSTEAD_OF_MOVE
cid#1632251 COPY_INSTEAD_OF_MOVE
cid#1632250 COPY_INSTEAD_OF_MOVE
cid#1632249 COPY_INSTEAD_OF_MOVE
cid#1632248 COPY_INSTEAD_OF_MOVE
cid#1632247 COPY_INSTEAD_OF_MOVE
cid#1632246 COPY_INSTEAD_OF_MOVE
cid#1632245 COPY_INSTEAD_OF_MOVE
cid#1632244 COPY_INSTEAD_OF_MOVE
cid#1632243 COPY_INSTEAD_OF_MOVE
cid#1632242 COPY_INSTEAD_OF_MOVE
cid#1632241 COPY_INSTEAD_OF_MOVE
cid#1632240 COPY_INSTEAD_OF_MOVE
cid#1632239 COPY_INSTEAD_OF_MOVE
cid#1632238 COPY_INSTEAD_OF_MOVE
cid#1632237 COPY_INSTEAD_OF_MOVE
cid#1632236 COPY_INSTEAD_OF_MOVE
cid#1632235 COPY_INSTEAD_OF_MOVE
cid#1632234 COPY_INSTEAD_OF_MOVE
cid#1632233 COPY_INSTEAD_OF_MOVE
cid#1632232 COPY_INSTEAD_OF_MOVE
cid#1632231 COPY_INSTEAD_OF_MOVE
cid#1558073 COPY_INSTEAD_OF_MOVE
cid#1557945 COPY_INSTEAD_OF_MOVE
cid#1557916 COPY_INSTEAD_OF_MOVE
cid#1557898 COPY_INSTEAD_OF_MOVE
cid#1557808 COPY_INSTEAD_OF_MOVE

Change-Id: Ibf417c154255fe3b0598127df5b5805ed543c8d5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174660
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-10-08 13:16:08 +02:00
Eike Rathke d65ccee291 Related: tdf#161599 ChildAccess::asValue() must return Reference<XInterface>
... otherwise the unotools/source/config/configitem.cxx
ConfigItem::impl_packLocalizedProperties() checking for
(getValueTypeName() == "com.sun.star.uno.XInterface") would not
hit and thus not pack the properties, returning just the useless
XWeak pointer as property.

This in ScUnoAddInCollection::ReadConfiguration() lead to English
names not being extracted from configured Add-Ins' DisplayName or
CompatibilityName, nor any CompatibilityName added to the list.

Fallout from

    commit bc70f674c2
    CommitDate: Sun Jun 18 08:41:27 2023 +0200

        Use getXWeak in configmgr

Change-Id: Ibaab8c08a06113b27ceffe1c45ef548c1d6fa225
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172476
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
2024-08-27 21:09:35 +02:00
Stephan Bergmann e8358d0a0f Keep around a single configmgr::Components::WriteThread instance
...instead of joining and later re-spawning one.  This helps with the current
Emscripten setup (see 5b1df7709d "Document the
Emscripten threads issue"), and probably doesn't matter much either way on other
platforms (so just get it in unconditionally).  (Renaming the delay_ member
variable to delayOrTerminate_, to make its overall role more clear.)

(I ran into this when trying to turn the Emscripten build from starting up with
a Writer document to starting up with the start center, and then manually
opening a new Writer document.  The resulting different usage scheme happened to
exhaust our current -sPTHREAD_POOL_SIZE=4 pool quickly, so this is one of
multiple commits to address that.)

Change-Id: I1bd28604b4640d2afad982bfd82b1acee8200e26
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170993
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Tested-by: Jenkins
2024-07-25 09:51:52 +02:00
Stephan Bergmann 8cdf186fac Remove bExitWasCalled-handling from confgimgr::Components dtor
That code had been added with 9fa4eff9be
"profilesafe: Enhancements to BackupFileHelper", but it looks dubious:

For one, I cannot find proof for the claim that MSVC would run destructors of
static objects upon _exit.  Building a simple C++ test program

> #include <iostream>
> #include <stdlib.h>
> struct S { ~S() { std::cerr << "hello\n"; } };
> S s;
> void f() { _exit(1); }
> int main() { f(); }

with contemporary MSVC 17.10 and executing it shows no "hello" stderr output
(see
<https://gcc.godbolt.org/#g:!((g:!((g:!((h:codeEditor,i:(filename:'1',fontScale:14,fontUsePx:'0',j:1,lang:c%2B%2B,selection:(endColumn:13,endLineNumber:5,positionColumn:13,positionLineNumber:5,selectionStartColumn:13,selectionStartLineNumber:5,startColumn:13,startLineNumber:5),source:'%23include+%3Ciostream%3E%0A%23include+%3Cstdlib.h%3E%0Astruct+S+%7B+~S()+%7B+std::cerr+%3C%3C+%22hello%5Cn%22%3B+%7D+%7D%3B%0AS+s%3B%0Avoid+f()+%7B+_exit(1)%3B+%7D%0Aint+main()+%7B+f()%3B+%7D%0A'),l:'5',n:'1',o:'C%2B%2B+source+%231',t:'0')),k:32.19670284753087,l:'4',m:100,n:'0',o:'',s:0,t:'0'),(g:!((h:compiler,i:(compiler:vcpp_v19_40_VS17_10_x64,filters:(b:'0',binary:'1',binaryObject:'1',commentOnly:'0',debugCalls:'1',demangle:'0',directives:'0',execute:'0',intel:'0',libraryCode:'0',trim:'1',verboseDemangling:'0'),flagsViewOpen:'1',fontScale:14,fontUsePx:'0',j:1,lang:c%2B%2B,libs:!(),options:'',overrides:!(),selection:(endColumn:1,endLineNumber:1,positionColumn:1,positionLineNumber:1,selectionStartColumn:1,selectionStartLineNumber:1,startColumn:1,startLineNumber:1),source:1),l:'5',n:'0',o:'+x64+msvc+v19.40+VS17.10+(Editor+%231)',t:'0'),(h:output,i:(compilerName:'x86-64+clang+18.1.0',editorid:1,fontScale:14,fontUsePx:'0',j:1,wrap:'1'),l:'5',n:'0',o:'Output+of+x64+msvc+v19.40+VS17.10+(Compiler+%231)',t:'0')),k:67.80329715246913,l:'4',m:100.00000000000001,n:'0',o:'',s:1,t:'0')),l:'2',n:'0',o:'',t:'0')),version:4>).

If there indeed were issues with MSVC and non-standard _exit, a solution might
be to use standard _Exit instead (in FatalError in desktop/source/app/app.cxx).

And for another, when bExitWasCalled was true in
configmgr::Components::~Components, it would still have called
writeThread_->join() (i.e., it would potentially still have called
writeModFile from within configmgr::Components::WriteThread::execute()), but (a)
only after waiting out its full

> delay_.wait(std::chrono::seconds(1));

(because it missed to call configmgr::Components::WriteThread::flush, which
calls delay_.set()), and (b) potentially running into a deadlock because it
called writeThread_->join() with *lock_ locked, which
configmgr::Components::WriteThread::execute wants to lock too.

(I came across this because it got into my way when trying to adapt the
lifecycle of configmgr::Components::WriteThread to the needs of the Emscripten
build.)

Change-Id: Icb4ebf00d1d316b80c29f7bd91b86614ef4ac430
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170940
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-07-24 22:15:30 +02:00
Stephan Bergmann c28c61e528 Revert "boost::unordered_map to std::unordered_map in configmgr::Partial"
This reverts commit 154b204010, 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-14 17:32:17 +02:00
Noel Grandin 154b204010 boost::unordered_map to std::unordered_map in configmgr::Partial
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-07-13 18:49:04 +02:00
Noel Grandin 3c5d5d8ae3 no need to convert from Sequence to std::set here
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-10 10:44:13 +02:00
Noel Grandin b667543a2a loplugin:ostr in configmgr
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-07 08:46:04 +02:00
Noel Grandin b7d3e9ce25 speedup configmgr::Access on Windows
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-05-04 12:27:49 +02:00
Michael Stahl 8350404ec1 configmgr: fix parse error if subelements of <info> used
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 db3078bd8c)

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-22 08:46:04 +01:00
Stephan Bergmann 3ba85b7786 Support o3tl::iterateCodePoints with both sal_Int32 and std::size_t
...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-09 19:19:04 +01:00
Noel Grandin 7840effb1d use more string_view
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-03-08 07:06:13 +01:00
Stephan Bergmann 467eeda66e Fix placement of comments
...which each pertain to all the preceding code that extracts numbers from
strings, and where 0a5d4dc25c "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-06 22:43:18 +01:00
Noel Grandin 0a5d4dc25c elide some OString temporaries
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-06 17:07:23 +01:00
Noel Grandin 7ee4ea5c09 reduce unnecessary OString temporaries
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-02-05 15:10:52 +01:00
Mike Kaganski 0fa827dbb2 Drop std::as_const from css::uno::Sequence iterations
Obsoleted by commit 2484de6728 (Remove
non-const Sequence::begin()/end() in internal code, 2021-10-15) and
commit fb3c04bd19 (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>
2024-01-27 12:43:48 +01:00
Stephan Bergmann f8199c4244 tdf#158593 Make configmgr READONLY Property more useful
...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-19 07:57:32 +01:00
Caolán McNamara 9c22c643ff cid#1558833 Uninitialized scalar field
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-09 21:30:41 +01:00
Samuel Mehrbrodt 030b72df0a tdf#157432 Expert config: Allow filtering by changed values
Change-Id: Ib8bbb7fc9e8014a9367278f3fa640f53af46dd2b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159986
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2023-12-07 08:03:36 +01:00
Stephan Bergmann 3ff66d4361 Simplify implementation of getTypeByHierarchicalName
(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-26 13:19:56 +01:00
Stephan Bergmann 8ac9ef88ce Simplify description/type parsing a bit
...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-25 23:10:06 +01:00
Noel Grandin 06654099e9 asan: fix read of uninitialised value
ever since
    commit a91892ec49
    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-21 17:59:51 +01:00
Samuel Mehrbrodt a91892ec49 Use existing types, instead of strings
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-20 11:17:23 +01:00
Stephan Bergmann 8ef2b4b4c6 Extended loplugin:ostr: configmgr
Change-Id: If9cc1f0c18a5fa344a433b338f81d191340e70f7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159722
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-20 08:53:42 +01:00
Samuel Mehrbrodt 700ac29771 Use proper type in expert config dialog
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-09 15:37:16 +01:00
Samuel Mehrbrodt db3078bd8c tdf#157431 Show description for expert config items
Change-Id: I7d0257c2e06ed384f90ca3b51a6d2549044f2cf3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157148
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2023-11-09 08:14:38 +01:00
Noel Grandin 0e08992f99 reduce ref-counting traffic in configmgr
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-31 18:11:02 +01:00
Noel Grandin 300763ddf6 reduce reference counting traffic in configmgr
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-31 18:10:30 +01:00
Stephan Bergmann 826d673ac8 Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: configmgr
Change-Id: Id95245a309b3baa80d7cca63d980aa0657fb9eb2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158148
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-19 13:54:29 +02:00
Noel Grandin af8ee87852 SAL_WARN->SAL_INFO in Access::getChild
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-08-31 21:50:18 +02:00