summaryrefslogtreecommitdiff
path: root/extensions
AgeCommit message (Collapse)AuthorFilesLines
2022-01-12gbuild: build static LO / link static executablesJan-Marek Glogowski1-1/+1
This allows to build a complete static LibreOffice on Linux, except for linked externals. Since LO's static build implies disabled dynamic loading, one must select one VCL backend to be compiled in. See the (large) comment in solenv/gbuild/static.mk trying to explain, why this implementation was chosen (spoiler: seems there is no other way) and what is actually implemented. This will collect all libraries, statics and externals of executables. If the executable uses components, it will get linked to all static components. While it works with any Executable, it just makes sense for soffice.bin, because the static component map sucks every dependency in, bloating most other binaries. In theory on could generate the dependencies based on the list of used components (see gb_CppunitTest_use_components), then generate a specific static constructor map, directly include it in the exe's cxx code and then link the minimal dependencies. The static LO should build on Linux with: --enable-customtarget-components --disable-dynamic-loading Tested VCL plugin config is: --disable-gtk3 --disable-gen --enable-qt5 The partial build support is split into a 2nd patch. Change-Id: Iafc95752fae9e88095f54a21f1e30a4f080815e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126790 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-01-05Use GetModuleHandleExW instead of GetModuleHandleWMike Kaganski1-18/+10
... and find directory cearching for path separator. Also drop obsolete code related to Windows XP and mingw. Change-Id: Ib48cfeea8a2ae01d3f8b37728ce1e8ca4aa73b14 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128017 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-01-04Drop also commented-out obfuscated SAL_DEBUG callsTor Lillqvist1-3/+0
Change-Id: I7bc8ee2e5e989e41fcc0b6f96c5b2b8f151cdd3d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127937 Tested-by: Tor Lillqvist <tml@collabora.com> Reviewed-by: Tor Lillqvist <tml@collabora.com>
2022-01-02Introduce OUString::unacquired(const OUStringBuffer&)Mike Kaganski1-1/+1
... and avoid OUStringBuffer::toString when the temporary is used for checking current buffer content Change-Id: I114178f3e74ca3e4a3e517763f9eaab4797b7deb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127478 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-12-24new comphelper::WeakImplComponentHelperNoel Grandin1-0/+1
to replace the cppu:: equivalent with a lightweight version that uses std::mutex instead of osl::Mutex Change-Id: I1b7873a0c2d9cda21f529e43a4ac2fa7574c91a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127335 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-21loplugin:flatten in editeng..extensionsNoel Grandin3-78/+76
Change-Id: Ica8f0a6e3d30dba3b5a083e3c04522073de8303f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127233 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-21Use sal::systools::CoInitializeGuard and sal::systools::ThrowIfFailedMike Kaganski1-16/+5
Change-Id: Ifb40e7672671df03b5ffc89905ad1e7b68451b68 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127232 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-12-19use more cppu::BaseMutexNoel Grandin2-4/+3
Change-Id: Iddd7438161ead93b27cf8e8058ca5b1eae3d8001 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127075 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-18Simplify BSTR RAIIMike Kaganski1-11/+13
Change-Id: I0eaff245a4f5dec9c86ab2c04a329e0d2a7edca5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126984 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-12-18Drop CoIfPtr and use sal::systools::COMReferenceMike Kaganski1-27/+11
Change-Id: Ie6433bb65b4c0a799c98a44c67a708356a5eedef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126983 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-12-10more ofz#42182 oss-build failureCaolán McNamara1-1/+3
Change-Id: I8960db6c013911df26b35623814c5586ce8c3d00 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126642 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-12-10ofz#42182 oss-build failureCaolán McNamara1-1/+2
possibly since: commit db3a61cd958f4a70417929cf8e1fa9bfd0bfe5a3 Author: Stephan Bergmann <sbergman@redhat.com> Date: Thu Dec 9 10:15:05 2021 +0100 Generally determine Rdb content from gb_*_set_componentfile calls (?) Change-Id: I947b0dff174ef437750889fb6cc84c8dfa54e7f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126638 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-12-10remove use of non-existing slot:6661Caolán McNamara1-7/+0
seeing as this call does nothing since ~2006 see: commit 01552f1e77c67f70ffd879294288612f9ab64e3b Author: Stephan Bergmann <sbergman@redhat.com> Date: Fri Oct 17 16:58:26 2014 +0200 SID_TOGGLE_MENUBAR (aka slot:6661, .uno:MenuBarVisible) is dead ...since introduction of XLayoutManager's private:resource/menubar/menubar in 3fb2acf5b77bff59909f616c44c7de17048b64d7 "INTEGRATION: CWS layoutmanager (1.52.10); FILE MERGED" etc. and final removal of SID_TOGGLE_MENUBAR bits in f605b16e395e8ccc3d1aba7907b0792039016f69 "INTEGRATION: CWS sfxcleanup (1.119.8); FILE MERGED" etc. What still needs fixing are extensions/source/activex/SOActiveX.cxx odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/CustomizeView.java odk/examples/OLE/activex/SOActiveX.cpp in a similar way as e.g. 0273d3d81d29d5c1f6c387cca633cd99722c100e "INTEGRATION: CWS jl18 (1.6.8); FILE MERGED." these uses remain outstanding: odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/CustomizeView.java odk/examples/OLE/activex/SOActiveX.cpp Change-Id: Iad43b5adc6ae24e6d794ebef10ed7df476b4e5dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126622 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-12-10Generally determine Rdb content from gb_*_set_componentfile callsStephan Bergmann12-12/+12
...instead of by listing the content somewhat redundantly in the Rdb_*.mk files, to avoid duplication of logic for components that are only built conditionally (and thus should only be included conditionally in the corresponding Rdb). To achieve that, add an "rdb" parameter to gb_ComponentTarget_ComponentTarget (and to the gb_*_set_componentfile macros that internally call gb_ComponentTarget_ComponentTarget), which is used to make the appropriate gb_Rdb_add_component call internally from within gb_ComponentTarget_ComponentTarget. (As a special case, gb_CppunitTest_set_componentfile shall not call gb_Rdb_add_component, as that has already been done by the corresponding gb_Library_set_componentfile call, so allow the gb_ComponentTarget_ComponentTarget "rdb" parameter to be empty to support that special case.) Most Rdb_*.mk files are thus mostly empty now. One exception is i18npool/Rdb_saxparser.mk, which duplicates some of the Rdb_services content as needed during the build in CustomTarget_i18npool/localedata. 1c9a40299d328c78c035ca63ccdf22c5c669a03b "gbuild: create services.rdb from built components" had already tried to do something similar (in addition to other things) under a new --enable-services-rdb-from-build option. However, that approach had four drawbacks that this approach here addresses (and which thus partly reverts 1c9a40299d328c78c035ca63ccdf22c5c669a03b): 1 Rdb_services shall not contain the component files of all libraries that are built. While that commit filtered out the component files that go into Rdb_ure/services (ure/Rdb_ure.mk), it failed to filter out the component files that go into others like Rdb_postgresql-sdbc (connectivity/Rdb_postgresql-sdbc.mk). 2 The code added by that commit to Makefile.gbuild codified the knowledge that there is an Rdb_services, which is brittle. 3 The code added by that commit to solenv/gbuild/Rdb.mk codified the knowledge (for gb_Rdb__URECOMPONENTS) that there is an Rdb_ure/services, which is brittle. 4 Introducing an --enable-services-rdb-from-build option needlessly provided two different ways how the content of Rdb_services is assembled. The changes done here would leave --enable-services-rdb-from-build as a misnomer, as it no longer controls how Rdb_services is assembled. I thus renamed it to --enable-customtarget-components, as that is apparently what it still does now. Change-Id: Ia5e8df4b640146c77421fcec6daa11a9cd260265 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126577 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-12-06cid#1494595,1494597: Silence UNCAUGHT_EXCEPTStephan Bergmann1-0/+1
...after aa5ee0085c7d8b8713f4dbed0009b38b9fabb281 "Stop swallowing exceptions in ~ScopeGuard" had dropped the catch blocks from ~ScopeGuard to make it usable in Library_salhelper in 0c1c300ed7ce168755ae945822eb7a1c610cfa25 "Rather use ScopeGuard to prevent catch and rethrow". But using the original suppress_fun_call_w_exception, which used css::uno::Exception, would have caused the same circular-dependency issue again that aa5ee0085c7d8b8713f4dbed0009b38b9fabb281 had solved, so drop the use of css::uno::Exception (and SAL_WARN, which triggered a number of missing #include <sal/log.hxx>) also from suppress_fun_call_w_exception. After all, that was __COVERITY__-only code that wasn't meant to be actually run, so it shouldn't matter if we just catch everything and silently terminate. Change-Id: If28a214709e4636e1c23a49f2d95d87c91492f14 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126404 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-12-03replace comphelper::OListenerContainer with OInterfaceContainerHelper3Noel Grandin7-32/+28
OInterfaceContainerHelper3 is in wide use and can do the same thing with less ceremony Change-Id: I5252738d6b7bda6245c66da46352944ead79bd52 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126271 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-30Improve an snprintf printing css::util::DateTime membersStephan Bergmann1-8/+10
...to avoid GCC 12 trunk > extensions/source/logging/csvformatter.cxx: In member function ‘virtual rtl::OUString logging::{anonymous}::CsvFormatter::format(const com::sun::star::logging::LogRecord&)’: > extensions/source/logging/csvformatter.cxx:241:70: error: ‘%02i’ directive output may be truncated writing between 2 and 5 bytes into a region of size between 0 and 14 [-Werror=format-truncation=] > 241 | snprintf( buffer, buffer_size, "%04i-%02i-%02iT%02i:%02i:%02i.%09i", > | ^~~~ > extensions/source/logging/csvformatter.cxx:241:44: note: directive argument in the range [0, 65535] > 241 | snprintf( buffer, buffer_size, "%04i-%02i-%02iT%02i:%02i:%02i.%09i", > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > extensions/source/logging/csvformatter.cxx:241:44: note: using the range [-2147483648, 2147483647] for directive argument > extensions/source/logging/csvformatter.cxx:241:21: note: ‘snprintf’ output between 30 and 49 bytes into a destination of size 31 > 241 | snprintf( buffer, buffer_size, "%04i-%02i-%02iT%02i:%02i:%02i.%09i", > | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > 242 | static_cast<int>(record.LogTime.Year), > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > 243 | static_cast<int>(record.LogTime.Month), > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > 244 | static_cast<int>(record.LogTime.Day), > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > 245 | static_cast<int>(record.LogTime.Hours), > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > 246 | static_cast<int>(record.LogTime.Minutes), > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > 247 | static_cast<int>(record.LogTime.Seconds), > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > 248 | static_cast<int>(record.LogTime.NanoSeconds) ); > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Change-Id: I426fd6c54b69c7dcc2153167961295c3bc5cf91f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126116 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-11-25remove unused defines and convert some to OUStringLiteralNoel Grandin6-27/+5
Also remove the associated links.txt entries Change-Id: I5028fab2feb828875a0b772418fc29cbdfe4ce72 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125773 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-25loplugin:stringliteraldefine in extensionsNoel Grandin15-683/+677
Change-Id: I9599fb3ca2fdcb30d8e1a52ecbfd954329762eae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125762 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-24loplugin:stringliteraldefine in comphelperNoel Grandin1-39/+39
Change-Id: I60ccd6049db65fef2397798ab916b0d1e24c0fdc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125531 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-23O[U]String::replaceAt overloads that take string_viewNoel Grandin1-1/+1
which results in lots of nice string_view improvements picked up by the plugins Change-Id: Ib0ec3887816b3d4436d003b739d9814f83e244b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125657 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-20Don't loose scanned image's resolution precisionMike Kaganski1-11/+8
Change-Id: I526dcf8db880615308cfb228eaa06d1a5a0e5cac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125584 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-20Drop unused variables - againMike Kaganski1-5/+3
This re-instates commit a339ebca55f53db5f0b72b26fcfbb3aaa2b2a825 "Drop unused variables", that was accidentally reverted in commit 1b6e3efe964eec9110e656a8242f6f4d8b5e7f7e "Simplify m_aAppId initialization". Change-Id: Ib65500cc0b0b5c27425f76e358f2d786a7faac09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125583 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-20Use o3tl::convertHossein1-3/+5
Used o3tl::convert on nXRes and nYRes to calculate biXPelsPerMeter and biYPelsPerMeter for the bitmap information header structure pBIH: https://docs.microsoft.com/en-us/windows/win32/api/wingdi/ns-wingdi-bitmapinfoheader The values of biXPelsPerMeter and biYPelsPerMeter are always ignored by the GDI when loading the bitmaps, but in theory they can be recommendations for the pysical size of a bitmap in some applications. https://devblogs.microsoft.com/oldnewthing/20130515-00/?p=4363 Change-Id: Ia40f17b7d1c27c094158af89bf15ed2f11bdfc05 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125109 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-19Fix --enable-online-updateStephan Bergmann1-10/+10
...after 4bc44490f51f7cc4a36cc7131137018da986c293 "loplugin:stringliteraldefine in tools" Change-Id: I0ec1e07b151e853be8a795c7135aecf5c6957eac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125556 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-11-19gtk3: default to an explicit constrain-to for PopoversCaolán McNamara1-0/+1
with the intent to do the same replacement with GtkWindow under X11 for gtk3 that we do in MenuButtons for the popover with direct popovers when the constraint is GTK_POPOVER_CONSTRAINT_NONE Change-Id: I629c30b44a9e362ba0d924bb229930b5f0dc7ed3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125540 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-19loplugin:stringliteraldefine in toolsNoel Grandin1-1/+1
Change-Id: I348b9a844c009f9c19301baa76d31b12f67c6130 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125535 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-13Simplify m_aAppId initializationMike Kaganski1-21/+18
Change-Id: Ib760edab95e988b78505de256aba1b09213600fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125127 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-13Drop unused variablesMike Kaganski1-5/+3
nWidth/nHeight (1) are irrelevant here (we get the correct pixel size right in the hDIB), and (2) should not be -1, because we don't use ICAP_UNDEFINEDIMAGESIZE capability [1]. [1] https://twain.org/wp-content/uploads/2017/03/TWAIN-2.4-Specification.pdf#page=268 Change-Id: I8cb20087944536552326b3e1582e8ef12dcc0d32 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124986 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-03Add back `== 2`Stephan Bergmann1-1/+1
...that got lost in 23c8da878529f85ba5045db6f7ea7956a64dfc72 "put the message into static_assert" (causing a loplugin:consttobool warning) Change-Id: I8f2a97bd61edbfad0c871c0d2d0e25f1ce9f9f98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124658 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-11-03put the message into static_assertCaolán McNamara1-2/+2
and use more static_assert where its obviously possible Change-Id: I9466130809acab12505f0760f970793991564165 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124633 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-10-31uniformly allow focus into GtkToolbarCaolán McNamara1-1/+1
Change-Id: I110daf882d9196cf7552e43a157ba4ae73fd670b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124458 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-10-31gtk[3 vs 4]: remove can-focus from GtkToolButtonCaolán McNamara1-7/+0
so tab-cycling inside sidebar panel toolbars works as wanted It needs to be false for gtk3 and true for gtk4, leaving it unspecified gets a desired working default. Change-Id: I34869d5dcffc814f62ec2b717108f90c395a067b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124446 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-10-30Prepare for removal of non-const operator[] from Sequence in extensionsMike Kaganski29-136/+111
Change-Id: Id57b187aaa669d4b9a35ab726a6df1a9b4823f1d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124364 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-22return weld::Builder by unique_ptrNoel Grandin2-3/+3
Change-Id: Ifa4f5951d200eaad6c8aebd3f29eed053c927ff0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124051 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-22Optimize assignment from OUStringLiteral to OUStringStephan Bergmann1-1/+1
...by making the OUString's pData point to the OUStringLiteral, instead of copying the contained characters. This is one of the improvements that had not been done as part of e6dfaf9f44f9939abc338c83b3024108431d0f69 "Turn OUStringLiteral into a consteval'ed, static-refcound rtl_uString": "To keep individual commits reasonably manageable, some consumers of OUStringLiteral in rtl/ustrbuf.hxx and rtl/ustring.hxx are left in a somewhat odd state for now, where they don't take advantage of OUStringLiteral's equivalence to rtl_uString, but just keep extracting its contents and copy it elsewhere. In follow-up commits, those consumers should be changed appropriately, making them treat OUStringLiteral like an rtl_uString or dropping the OUStringLiteral overload in favor of an existing (and cheap to use now) OUString overload, etc." (Simply dropping the OUStringLiteral overload was not possible in this case, though, as that would have lead to ambiguities among the various OUString and std::u16string_view overloads.) The now-deleted OUStringLiteral rvalue reference overload means that some existing assignments from ternary-operator OUStringLiteral<N> to OUString no longer compile and had to be replaced with uses of std::u16string_view. Those had not already been replaced in e6dfaf9f44f9939abc338c83b3024108431d0f69 because they happened to use OUStringLiteral instances of identical length N in both arms of the ternary operator, so did not already start to fail to compile back then. Change-Id: I328e25b8324d045774e811d20a639f40d6a9a960 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124040 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-10-21loplugin:flattenNoel Grandin1-12/+11
Change-Id: I3b4226a9d089ec9aedab95d96e50a068f57a76c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123991 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-16Simplify vector initialization in extensionsJulien Nabet1-24/+25
Change-Id: Ia83209304a7ed889cdd643c8034420c032ccad6e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123685 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-10-15Remove non-const Sequence::begin()/end() in internal codeMike Kaganski2-2/+2
... to avoid hidden cost of multiple COW checks, because they call getArray() internally. This obsoletes [loplugin:sequenceloop]. Also rename toNonConstRange to asNonConstRange, to reflect that the result is a view of the sequence, not an independent object. TODO: also drop non-const operator[], but introduce operator[] in SequenceRange. Change-Id: Idd5fd7a3400fe65274d2a6343025e2ef8911635d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123518 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-14use std::vector::insert instead of push_backNoel Grandin1-4/+2
because it will pre-allocate space and often is optimised to memcpy Change-Id: I03ed7915f2762d3d27e378638052a47a28bbf096 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123588 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-14Avoid COW overhead using css::uno::SequenceMike Kaganski8-28/+32
The scenarios are: 1. Calling sequence's begin() and end() in pairs to pass to algorithms (both calls use getArray(), which does the COW checks) 2. In addition to #1, calling end() again when checking result of find algorithms, and/or begin() to calculate result's distance 3. Using non-const sequences in range-based for loops, which internally do #1 4. Assigning sequence to another sequence variable, and then modifying one of them In many cases, the sequences could be made const, or treated as const for the purposes of the algorithms (using std::as_const, std::cbegin, and std::cend). Where algorithm modifies the sequence, it was changed to only call getArray() once. For that, css::uno::toNonConstRange was introduced, which returns a struct (sublclass of std::pair) with two iterators [begin, end], that are calculated using one call to begin() and one call to getLength(). To handle #4, css::uno::Sequence::swap was introduced, that swaps the internal pointer to uno_Sequence. So when a local Sequence variable should be assigned to another variable, and the latter will be modified further, it's now possible to use swap instead, so the two sequences are kept independent. The modified places were found by temporarily removing non-const end(). Change-Id: I8fe2787f200eecb70744e8b77fbdf7a49653f628 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123542 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-11tdf#145033 remove old focus handler so no double-connect attempt is madeCaolán McNamara1-0/+2
doesn't hurt in this case, but we assert because it has been a fairly common problem in the past Change-Id: Id312c8d2693df803962c265a9a49926d8df04cc0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123413 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-10-11loplugin:moveparam in extensionsNoel Grandin13-36/+32
Change-Id: Ibbf0fff9a3540d4f723b91e2979e4465648ff203 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123385 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-09Typo *ropertie -> *ropertyJulien Nabet2-8/+8
Change-Id: Id5ae03140ac4fd67bf4940569ac5cd2f15716749 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123306 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-10-07drop 'using namespace std' in extensions(ole)Julien Nabet3-9/+5
Change-Id: Id2bb87f792d389dd9e6eeddd17046a46cddfdb6f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123192 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-10-05tdf#119891 Scanner dialog has no Help buttonOlivier Hallot1-4/+80
Added extended tips for the SANE dialog Help page will follow Change-Id: Ibf60eacb561fd65caa682bfa710e52b93b6148d4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123080 Tested-by: Jenkins Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
2021-10-04Bump Glade version for sanedialog.uiOlivier Hallot1-188/+184
Change-Id: I9d787d392d5582fdfbe1928c5e3918863f178260 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123058 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-30Extended loplugin:referencecasting/redundantcast (clang-cl): extensionsStephan Bergmann2-3/+3
Change-Id: Ifd431845dc9bb53b87be400a3f5635c8fdc4b2fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122885 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-09-30loplugin:constparams improve handling of pointer paramsNoel Grandin2-2/+2
Change-Id: I4c0002e72703eded435bfe4985f5b0121bf8524b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122843 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-28gives names to all the Idles and TasksNoel Grandin1-0/+1
enforce it by making the constructor parameter non-default. Change-Id: I321543e4dcf15ea0a43ad8cce91d2f8dc22df6ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122766 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>