summaryrefslogtreecommitdiff
path: root/unotools
AgeCommit message (Collapse)Author
2022-06-03tdf#146988 Opening at cursor position doesn't work in large documentsNoel Grandin
regression from commit 07021596acb3d104ba129d371b1ae0b79f67a6a4 (HEAD) Date: Sat Jun 12 18:57:51 2021 +0200 tdf#142242 Forename imported with trailing space Change-Id: I792fbe5955de464f41ac61c85f1ca651121b4a99 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135372 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-03Fix type of impl_getISO8601TimeToken etc. string index parametersStephan Bergmann
...after 6fc3dfd3f1b5cb13101299df42444f2ff0493846 "use more string_view" Change-Id: I0f4fb75e90d18ed3331f0c857dce1cfcb7482d65 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135335 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-30no need to allocate LocaleDataWrapper separatelyNoel Grandin
Change-Id: Icceaf255a3a71d612b17dad41d04b1906550a7a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135133 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-30clang-tidy modernize-pass-by-value in unotoolsNoel Grandin
Change-Id: Ifa67ab7198f5d3b06171869f57703acdaa959f7d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135128 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-23cache ref to GlobalEventConfigNoel Grandin
so we avoid repeated allocation Change-Id: I9541c52e73878cf515c9159477bd3d2fda9e0078 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134803 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-19add ByteWriter to reduce memory copying when writing dataNoel Grandin
similarly to ByteReader move both of them down to comphelper, since we want to use it from comphelper, and comphelper is "below" unotools in the module dependency graph Change-Id: Ic98fa2268e125fd8e4378fb899ad5f97de721713 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134645 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-19add utl::ByteReader pure classNoel Grandin
which lets us skip the inefficiency of needing an extra buffer when reading via XInputStream Change-Id: Ic5334b7d11ea6a57bc1800f508fc69611a053af1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134348 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-18only need to create the folder for temp files onceNoel Grandin
Change-Id: I805203dc51ca85515150fe0f28fc6464c45453c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134523 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-17elide some OUString allocationNoel Grandin
Change-Id: Iadd73477bf3b0edaa0fb7db10f9ffca88fe737e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134476 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-15cache string in DocInfoHelper::GetGeneratorStringNoel Grandin
since it doesn't change Change-Id: I8a9eee18b6de5f375ee2d4d67cdf48700590d007 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134347 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-15osl::Mutex->std::mutex in SvtLinguOptionsNoel Grandin
and fix SvtLinguConfigItem::GetOptions so that it only accesses state while holding the lock. Change-Id: Ie092bf427e130348131412a038bce7de8ebcde83 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134327 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-14bypass some unnecessary wrapping in Any in SfxEvents_ImplNoel Grandin
Change-Id: I96d1194253207642e7abe83b0b18c82eb3782824 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134316 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-14cache some OUString in GetEnglishSearchFontNameNoel Grandin
rather than allocating them repeatedly Change-Id: Ie0f751f589b512a97534d193e1401312ae2f2afe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134310 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-13std::mutex->std::recursive_mutex in SvtUserOptionsMike Kaganski
Since commit ac511d90cdf9d28eb8809c30be9fa08b42ea0bd3 Author Noel Grandin <noelgrandin@gmail.com> Date Thu Dec 23 19:42:19 2021 +0200 osl::Mutex->std::mutex in SvtUserOptions non-recursive std::mutex is used. However, it looks like recursive locking is possible here, as shows the debugging that I made during the work on https://gerrit.libreoffice.org/c/core/+/134251. The call stack looks like this: utllo.dll!SvtUserOptions::GetToken(UserOptToken nToken) Line 318 utllo.dll!SvtUserOptions::GetLastName() Line 294 sclo.dll!ScChangeTrack::ConfigurationChanged(utl::ConfigurationBroadcaster * __formal, ConfigurationHints __formal) Line 2166 utllo.dll!utl::ConfigurationBroadcaster::NotifyListeners(ConfigurationHints nHint) Line 85 utllo.dll!utl::detail::Options::ConfigurationChanged(utl::ConfigurationBroadcaster * __formal, ConfigurationHints nHint) Line 112 utllo.dll!utl::ConfigurationBroadcaster::NotifyListeners(ConfigurationHints nHint) Line 85 utllo.dll!SvtUserOptions::Impl::Notify() Line 251 utllo.dll!SvtUserOptions::ChangeListener::changesOccurred(const com::sun::star::util::ChangesEvent & rEvent) Line 116 configmgrlo.dll!configmgr::Broadcaster::send() Line 168 configmgrlo.dll!configmgr::Access::setPropertyValue(const rtl::OUString & aPropertyName, const com::sun::star::uno::Any & aValue) Line 714 utllo.dll!SvtUserOptions::Impl::SetValue_Impl<rtl::OUString>(UserOptToken nToken, const rtl::OUString & sToken) Line 183 utllo.dll!SvtUserOptions::Impl::SetToken(UserOptToken nToken, const rtl::OUString & sToken) Line 200 utllo.dll!SvtUserOptions::SetToken(UserOptToken nToken, const rtl::OUString & rNewToken) Line 325 test_sc_subsequent_export_test.dll!ScExportTest::testTrackChangesSimpleXLSX() Line 3072 ... So getting the token may happen during notification of the listeners after setting the token, in the same thread. So let's use recursive mutex. Change-Id: I9be82f307a9948bcbc76d7d90632a0307c5dc4f6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134190 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-05-11osl::Mutex->std::mutex in SvtSysLocaleNoel Grandin
Change-Id: I722c4ca5d1bb6c0de6b1eff7478de03a23e9d89b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134199 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-10osl::Mutex->std::mutex in GlobalEventConfigNoel Grandin
Change-Id: Id54f9f15547010c9df640e406d36fb09febac4cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134089 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-05use more o3tl::getTokenNoel Grandin
found by inspecting call sites of OUString::getToken Change-Id: I4269c7476c7aa46fac39528227e350568f0eb34a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132644 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-04Fix typo in cbc34f69ec6363cd234ad2b1dfe09bfb531238dbAurimas Fišeras
Signed-off-by: Aurimas Fišeras <aurimas@members.fsf.org> Change-Id: Iee5c7aec7817bc7af5f45d192165fe30301788d0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133823 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Tested-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2022-05-04use more string_view in unotoolsNoel Grandin
Change-Id: Id10d68f2eb016671be6842dfaa82909207b0708d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133754 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-03Just use Any ctor instead of makeAny in unotoolsStephan Bergmann
Change-Id: I58d2020035396da0b3580b058d87c8e2d3f2df40 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133750 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-03Rename #define HAVE_LIBCXX -> HAVE_LIBCPPStephan Bergmann
...to harmonize it with the HAVE_LIBCPP configuration variable recently introduced in 6014f363a08f2edd6086cf30b3bbb913f1c621c6 "improve support for using libc++ on Linux and for libc++ debug mode" Change-Id: I6b3fee2e4e564d75caf1e60095d0b554153bce9e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133745 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-03add o3tl::equalsAsciiNoel Grandin
Change-Id: I042b8dcadbf7581de325c161763fe35aecde5ca2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133694 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-29use more string_view in INetURLObjectNoel Grandin
Change-Id: I4462f7cf4740fa4d1b129d76a0775f4250f41bbd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133555 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-27add string_view wrappers for rtl::math::stringToDoubleNoel Grandin
Change-Id: I114bec72cb933238675e539a8388a607226827cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133455 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-26Use o3tl::make_unsigned in some placesStephan Bergmann
...where a signed and an unsigned value are compared, and the signed value has just been proven to be non-negative here Change-Id: I9665e6c2c4c5557f2d4cf1bb646f9fffc7bd7d30 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133442 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-04-26Pick better variable typesStephan Bergmann
Change-Id: I134a8cddba169fe9bcc04687ad15c2cfeaccfb0f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133440 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-04-26officecfg,unotools,framework,sfx2: store ReadOnly for recent docsMichael Stahl
Add Office::Histories::HistoryItem::ReadOnly flag to configuration so that a document that was opened read-only isn't opened as editable from recent documents. Change-Id: I6985da287d3337a53a7e41e8e500421038eedb91 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133385 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-04-22use more string_view in unotoolsNoel Grandin
Change-Id: If32767647d3fba22a8e4a2b10fc57f47efca01d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133270 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-14use more string_view in unotoolsNoel Grandin
Change-Id: I5fc3753475c3c6a45f86910eeb49055f96a2e925 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133013 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-13loplugin:stringviewparam whitelist some more functionsNoel Grandin
for which we have o3tl:: equivalents Change-Id: I4670fd8b703ac47214be213f41e88d1c6ede7032 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132913 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-12Recheck modules [uU]* with IWYUGabor Kelemen
See tdf#42949 for motivation Change-Id: If710445176681de8e0a0b6c65f58ecaca19dbccf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132768 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-04-11use more string_viewNoel Grandin
found by tweaking the loplugin:stringview and making it whitelist getLength Change-Id: Ic41cd4e3026d93b70a76fe1279c6de3abbe6b4a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132820 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-10loplugin:stringview check for getToken and trimNoel Grandin
since we now have o3tl versions of those that work on string_view. Also improve those o3tl functions to support both string_view and u16string_view Change-Id: Iacab2996becec62aa78a5597c52d983bb784749a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132755 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-08move comphelper::string::toInt32 to o3tlNoel Grandin
so we can use it in places where we cannot include comphelper Change-Id: Iba0ba3e4c0dcf0f9d1f09092a77c3b2010ec4f6d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132732 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-08allow to override the generator/producer string in output documentsLuboš Luňák
Add a (non-gui) setting GeneratorOverride that, if set, is used for odt/docx/pdf generator string identifying the application that has written it instead of the normal productname etc. string. Change-Id: Ibe12a063e7e6b5a09c69cdf66cba073793650d62 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132495 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-04-08use more subView when converting to Int32Noel Grandin
Change-Id: I54e3ddf79ba793fd4328bf8bda7f949b65349651 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132693 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-02loplugin:stringviewparam convert methods using indexOfNoel Grandin
.. and lastIndexOf, which convert to find and rfind Change-Id: I6c4156cf904774c0d867f85a4c2785dba7593f62 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132445 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-24loplugin:constantparamNoel Grandin
Change-Id: I86592be0717c062a918108bf4437074b0f70b372 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132029 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-18tdf#133603 cache languagetag in FontSubstConfigurationNoel Grandin
speeds up saving XLSX by 10% Change-Id: I5f48fcd3de44675d27e275c6ff2f4e51a067c750 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131727 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-02-25renames in template manager creates xml file in wrong locationNoel Grandin
revert part of commit dd42f133f604ee2f7e0ffbca6a8d94fb8f95dfe5 Author: Noel Grandin <noelgrandin@gmail.com> Date: Mon Jan 10 19:37:05 2022 +0200 tdf#146375 Cannot rename user-defined categories in template manager specifically, revert the > Simplify the UCB usage to just write the contents of the tempfile and also call SvStream::Flush() in utl::TempFile::GetURL(), so that the data actually hits the disk, so that when UCB attempts to read the data using a separate file handle, it sees the data. (Otherwise the temporary file data only exists in the operating system buffers, and can only be read by the same file handle that created it) Change-Id: I17798c53e49d65484605f2dcd96b45babd70054d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130499 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-02-06Avoid signed-integer-overflowStephan Bergmann
...as seen during e.g. UITest_calc_tests9 now, > unotools/source/i18n/localedatawrapper.cxx:1017:17: runtime error: signed integer overflow: -9223372036854775808 * -1 cannot be represented in type 'long' > #0 in LocaleDataWrapper::ImplAddFormatNum(rtl::OUStringBuffer&, long, unsigned short, bool, bool) const at unotools/source/i18n/localedatawrapper.cxx:1017:17 > #1 in LocaleDataWrapper::getNum(long, unsigned short, bool, bool) const at unotools/source/i18n/localedatawrapper.cxx:1217:5 > #2 in weld::MetricSpinButton::format_number(long) const at vcl/source/window/builder.cxx:306:32 > #3 in weld::MetricSpinButton::update_width_chars() at vcl/source/window/builder.cxx:259:61 > #4 in weld::MetricSpinButton::set_range(long, long, FieldUnit) at include/vcl/weld.hxx:1991:9 > #5 in weld::MetricSpinButton::set_min(long, FieldUnit) at include/vcl/weld.hxx:2005:9 Change-Id: I940e2f1e2e4d42db84d4bb0e7b68086204dc77ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129570 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-01-20WASM --enable-wasm-strip now skips lots of LO codeArmin Le Grand (Allotropia)
... resulting in a stripped-down, Writer-only build to decrease the resulting WASM bytecode size. It removes the following code from the build: * All other major modules: Base, Calc, Chart, Draw, Impress and Math and related writerperfect filters * The premultiply tables * The (auto-)recovery functionality * All accessibility (but not the accessibility document checker) * The LanguageGuess component * EPUB support * The start center / BackingWindow * The TipOfTheDay functionality * The splash screen communication Currently crashs with anything different then soffice --writer. Closing the document also still crashes. FYI: many of these features are now behind ENABLE_WASM_STRIP_* defines, but they normally don't work on their own, globally! That's because we started with stripping the main components. Change-Id: Ib9c0f9452815910c0a2aceaf142ba1ad4a9cb0d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126182 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2022-01-11tdf#146375 Cannot rename user-defined categories in template managerNoel Grandin
Regression from commit 3624a703361b108d22448bd60a97733f05e37820 tdf#135316 remove OTempFileService pessimisation So fix two things here (1) make it so the tempfile service flushes the SvStream buffer and resets the file position, so we can read the data after writing it. (2) Simplify the UCB usage to just write the contents of the tempfile via the tempfile InputStream, which is simpler and safer Change-Id: I15ed3b02c2d6415d10a9579f66374e6268188d5c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128195 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-01-10use less SvStream::Flush()Noel Grandin
Flush() turns into a sync() on the device, which is pretty slow. Most of the time all we actually want to do is to flush the internal buffers from the SvStream. So expose the FlushBuffer method and use that where possible. And also means we don't need the mbDontFlushOnClose flag on SvStream any more. Change-Id: Ibe089b88b325f0fdc565200a97ce72cd26b7fcfb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128214 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-25osl::Mutex->std::mutex in SvtPathOptionsNoel Grandin
Change-Id: Ibf0aef2116e6ee7ab1cdc0de2b2bb502a8ce05e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127417 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-25osl::Mutex->std::mutex in OTempFileServiceNoel Grandin
Change-Id: If841031faf5b214a1978422b93b59cfa32fcd299 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127400 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-24osl::Mutex->std::mutex in SvtModuleOptionsNoel Grandin
Change-Id: I6882b30c823d06aa04c04c8a17bfe33cc45d7307 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127415 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-24osl::Mutex->std::mutex in SvtCommandOptionsNoel Grandin
Change-Id: I80eaba645351e2f3a3c67586fdced3325608633e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127413 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-24osl::Mutex->std::mutex in SvtPathOptions_ImplNoel Grandin
Change-Id: I04d0bf2a6b00ab0da24735158ad267632356128f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127416 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-24osl::Mutex->std::mutex in SvtUserOptionsNoel Grandin
Change-Id: Ib16cc05a8d9c3e7ef828223e8b1067eeb7faf809 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127399 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>