summaryrefslogtreecommitdiff
path: root/svl
AgeCommit message (Collapse)AuthorFilesLines
2019-11-21tdf#128598: Revert "Move dubious file: -> smb: conversion from...Stephan Bergmann1-0/+5
INetURLObject to file UCP" It turns out that there is lots of code in and around e.g. SfxMedium::LockOrigFileOnDemand (sfx2/source/doc/docfile.cxx) that treats document URLs non-generically and treats file URLs specially. That means that it does not work to transparently rewrite a file URL as an smb URL in the underlying UCB layer. So for libreoffice-6-4 revert the change again. (For master towards LO 6.5, I plan to instead completely drop the feature of silently treating certain forms of file URLs on Linux as smb URLs.) This reverts commit 46c645bf4e9909f5296e75028f1f5434e83942d2. Conflicts: tools/qa/cppunit/test_urlobj.cxx ucb/source/ucp/file/prov.cxx Change-Id: I94ac0637115bea36924099951efd8542854a727d Reviewed-on: https://gerrit.libreoffice.org/83396 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-08Unit test for fixed locale Excel export formats, tdf#128649Eike Rathke1-0/+41
Change-Id: I7ec63659c39acb612de4df502e364afdc2cc7189 Reviewed-on: https://gerrit.libreoffice.org/82257 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2019-11-08Resolves: tdf#128649 Do not insert duplicate LCID for currencyEike Rathke1-12/+22
Fallout from commit d0f8daa0980ba8e403b32006831657c5a0a4ea17 CommitDate: Wed Aug 22 19:03:27 2018 +0200 Resolves: tdf#73063 preserve and roundtrip LCID from/to Excel number formats Change-Id: I356f37624786d753370a272b0f1b54b17b5d206c Reviewed-on: https://gerrit.libreoffice.org/82249 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2019-11-03size some stringbuffer to prevent re-allocNoel Grandin1-1/+1
I started with 32 and kept doubling the size until the site did not need re-alloc, but clamped it at 512. Change-Id: I55fe36b31cd3d40f86e5729337a927cf920f2af6 Reviewed-on: https://gerrit.libreoffice.org/81960 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-02New loplugin:conditionalstringStephan Bergmann2-2/+2
Change-Id: I2eab990c15f845b44a3b598571aca361dadf9ff3 Reviewed-on: https://gerrit.libreoffice.org/81946 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-31Fix StringAdd::isCompileTimeConstantStephan Bergmann1-6/+2
...to find StringLiteral on the RHS of +=. Which revealed that the VisitCompoundStmt/checkForCompoundAssign logic needed to be fixed, too, so that s += side_effect(); s += "literal"; s += side_effect(); only gets combined to s += side_effect() + "literal"; s += side_effect(); and not all the way to s += side_effect() + "literal" + side_effect(); Change-Id: I432e3458b933a7d0ad6141c747b675cc8b0f0ba4 Reviewed-on: https://gerrit.libreoffice.org/81804 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-28loplugin:stringadd improve detectionNoel Grandin1-2/+2
if one side of the expression is a compile-time-constant, we don't need to worry about side-effects on the other side Change-Id: Iee71ea51b327ef244bf39f128f921ac325d74e2b Reviewed-on: https://gerrit.libreoffice.org/81589 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-26size some stringbuffer to prevent re-allocNoel Grandin4-8/+8
I started with 32 and kept doubling the size until the site did not need re-alloc, but clamped it at 512 (e.g. in emfio/). Change-Id: Ib7caf35a1b7e42b0e4ed8aa812493449e3eefc8f Reviewed-on: https://gerrit.libreoffice.org/81540 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-21size some stringbuffer to prevent re-allocNoel Grandin2-17/+16
found by the simple expidient of putting asserts in the resize routine. Where an explicit const size is used, I started with 32 and kept doubling until that site did not need resizing anymore. Change-Id: I998787edc940d0a3ba23b5ac37131ab9ecd300f4 Reviewed-on: https://gerrit.libreoffice.org/81138 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-19OUStringChar must either take a sal_Unicode or an ASCII charStephan Bergmann1-1/+1
...so forbid anything else, to avoid issues like the one described in 766cdd869d7d983e9e171a3eae0629cb9a0206ff "This code wants to add the numeric SvxRotateMode value". Some remaining places that apparently do want to convert some numeric value to sal_Unicode have been augmented with an explicit cast. Change-Id: I6200a84e250e697bc88694bd71142ca1d9a13651 Reviewed-on: https://gerrit.libreoffice.org/81132 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-19Directly use OUStringBuffer::append overload taking a single sal_UnicodeStephan Bergmann1-1/+1
Change-Id: Ibccde3ec84b0ea4e4af74122013229a1793f5ca5 Reviewed-on: https://gerrit.libreoffice.org/81128 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-19Replace some uses of OUStringChar with string literalsStephan Bergmann1-5/+1
Change-Id: I763f9a3f57efcd47643ca4651e2454e95c6921c9 Reviewed-on: https://gerrit.libreoffice.org/81127 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-19We don't support leap seconds, but.. accept as input anywayEike Rathke1-14/+16
Change-Id: If83b42066ffd928c9832e60ea05382ffc42fed84 Reviewed-on: https://gerrit.libreoffice.org/81122 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2019-10-19Resolves: tdf#76441 accept two digit groups MM:SS input if formatted as suchEike Rathke2-0/+85
... instead of producing the usual HH:MM:00 Works on the formats MM:SS [MM]:SS MM:SS.00 [MM]:SS.00 and even MM:[SS] MM:[SS].00 although these two don't make much sense except of displaying leading 00:, but were always accepted. Change-Id: I1dbe147cafaa934efa1d86b187eaab61f0981fca Reviewed-on: https://gerrit.libreoffice.org/81117 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2019-10-18Input with subsequent part greater than 59 is not time or durationEike Rathke1-0/+4
Like 1:123 or 1:1:123 is text, but 123:1 or 123:1:1 is a duration. Change-Id: I4a59d9ed74ae3d4e4bee8a9b86ed0697a02c55e0 Reviewed-on: https://gerrit.libreoffice.org/81087 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2019-10-18make bin/update_pch.s always include code in trivial #if'sLuboš Luňák1-5/+7
E.g. #ifdef LIBO_INTERNAL_ONLY is always true for code that builds with our PCHs. Change-Id: I3cf311ea3621b909105754cfea2cb0116b8b67f5 Reviewed-on: https://gerrit.libreoffice.org/80961 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-10-17Fix typoAndrea Gelmini1-1/+1
Change-Id: I179a20caf33e8e083e6e8f172d38f1201a0afd16 Reviewed-on: https://gerrit.libreoffice.org/80987 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-10-17Resolves: tdf#126773 Excel uses lowercase date and time format code keywordsEike Rathke1-4/+42
... so do the same when exporting to prevent surprises with iOS and OSX viewers or maybe other tools. This made it necessary to adapt ScExportTest::testExtendedLCIDXLSX() that checks calendar and date relevant exported format strings. Change-Id: I243d536e2a42562ec46375923facfa222ecbb29b Reviewed-on: https://gerrit.libreoffice.org/80920 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2019-10-17Remove some memset callsMike Kaganski1-8/+3
Replace them with default initialization or calloc Change-Id: I747f53c2ced2d0473fd5a5ede4f8520a0633dcc1 Reviewed-on: https://gerrit.libreoffice.org/80805 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-17Rename OUStringLiteral1 to OUStringCharStephan Bergmann6-29/+29
It started out as a wrapper around character literals, but has by now become a wrapper around arbitrary single characters. Besides updating the documentation, this change is a mechanical for i in $(git grep -Fl OUStringLiteral1); do sed -i -e s/OUStringLiteral1/OUStringChar/g "$i"; done Change-Id: I1b9eaa4b3fbc9025ce4a4bffea3db1c16188b76f Reviewed-on: https://gerrit.libreoffice.org/80892 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-15new loplugin:bufferaddNoel Grandin1-5/+1
look for OUStringBuffer append sequences that can be turned into creating an OUString with + operations Change-Id: Ica840dc096000307b4a105fb4d9ec7588a15ade6 Reviewed-on: https://gerrit.libreoffice.org/80809 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-14loplugin:stringadd look for unnecessary temporariesNoel Grandin1-4/+4
which defeat the *StringConcat optimisation. Also make StringConcat conversions treat a nullptr as an empty string, to match the O*String(char*) constructors. Change-Id: If45f5b4b6a535c97bfeeacd9ec472a7603a52e5b Reviewed-on: https://gerrit.libreoffice.org/80724 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-06improve SfxPoolItem operator== implementationsNoel Grandin8-12/+13
(*) make them all call the superclass operator== (*) make the base class check which and typeid to ensure we are only comparing the safe subclasses together (*) remove a couple of operator== that were not doing anything useful Change-Id: Ia6234aed42df04157a5d6a323dc951916a9cb316 Reviewed-on: https://gerrit.libreoffice.org/80308 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-05simplify SfxAllEnumItemNoel Grandin2-79/+18
It is just a data carrier for an array of values for SID_ATTR_PATHNAME, it does not need associated enum logic. Change-Id: I547cd5580d02eb9c261feeb3545e31910a4ed644 Reviewed-on: https://gerrit.libreoffice.org/80253 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-03Following "Simplify a bit SfxAllEnumItem (svl)"Julien Nabet1-2/+1
As Mike suggested in: https://gerrit.libreoffice.org/#/c/80089/ Change-Id: Ie33cb1464907215ec23bf7be7cf5ce3fafdf6113 Reviewed-on: https://gerrit.libreoffice.org/80161 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-10-03Simplify a bit SfxAllEnumItem (svl)Julien Nabet1-9/+5
Make private GetValueByPos which is only used in svl/source/items/aeitem.cxx Remove "RemoveValue" method which is only used in InsertValue( sal_uInt16 nValue, const OUString &rValue ) It allows to call once "GetPosByValue" and the assert is useless since we're in the case: "else if ( nPos != USHRT_MAX )" I think we can more optimize by replacing vector by another container for pValues (type "SfxAllEnumValueArr"). Indeed, we insert and remove a lot in pValues in a specific position. Vector is not the best container for this There's also still the part "//FIXME: Optimisation: use binary search or SortArray" in GetPosByValue_ method Change-Id: I0cafea70e9d0361ef9a7b345ff770a9b888ef85b Reviewed-on: https://gerrit.libreoffice.org/80089 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-10-02Avoid std::vector inheritance for SfxAllEnumValueArrJulien Nabet1-3/+0
No need to inherit, just create a typedef Change-Id: Ifeabb90e640e10e590f793716c022f91850ae8b9 Reviewed-on: https://gerrit.libreoffice.org/79991 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-01loplugin:returnconstval (clang-cl)Stephan Bergmann2-2/+2
Change-Id: Ib3c3e32bd998ac7e29f45cc4ce511a863096c3b5 Reviewed-on: https://gerrit.libreoffice.org/79958 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-01loplugin:stringconstant (clang-cl)Stephan Bergmann1-1/+1
Change-Id: Id1a82cea4444255fdb693e126b7571a406094624 Reviewed-on: https://gerrit.libreoffice.org/79916 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-01loplugin:stringadd n sfx2..svlNoel Grandin3-10/+7
Change-Id: Iaf1bbe37449d4e0cfa817909d56d4bffe1e5a184 Reviewed-on: https://gerrit.libreoffice.org/79893 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-01Drop SfxItemIter::FirstItemMike Kaganski2-4/+2
It is always used right after the iterator is created, where simple GetCurItem gives the same value without reseting the position. Change-Id: I871dc7989b79e13f06436ef7928692645b5209f6 Reviewed-on: https://gerrit.libreoffice.org/79903 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-10-01Avoid redundant IsAtEnd: NextItem returns nullptr iif iterator is at endMike Kaganski2-18/+11
To keep the check efficient, split NextItem to inline and Impl parts Change-Id: Id5877a3c5bed73aac9c39c655b106a715cf888ea Reviewed-on: https://gerrit.libreoffice.org/79894 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-09-30Simplify iterating in SwRegHistory::MakeSetWhichIds a littleMike Kaganski1-2/+1
The IsAtEnd check is redundant here. Change-Id: Ie576d039ea3db5f98d9c8c3dfd7e77519fcc1e1d Reviewed-on: https://gerrit.libreoffice.org/79836 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-09-27Deduplicate O(U)StringNumber definitions; add toAsciiUpperCaseMike Kaganski2-3/+3
Change-Id: I00e7ce62940907b5f4efc2b7f23f355c3e43ed6b Reviewed-on: https://gerrit.libreoffice.org/79686 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-09-27loplugin:virtualdead in svlNoel Grandin1-8/+0
Change-Id: Idbb5d0a633f12d5813561a2ad8aed46ec6d67c48 Reviewed-on: https://gerrit.libreoffice.org/79639 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-27Resolves: tdf#127363 accept SEPT as SEP for SeptemberEike Rathke1-7/+16
Change-Id: Idc0fb30308ca32428125656dc8b2ce68e35c4770 Reviewed-on: https://gerrit.libreoffice.org/79655 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2019-09-26add property name when throwing css::uno::UnknownPropertyExceptionNoel Grandin3-9/+9
Change-Id: I17f06c9415b9d43b6d8896360e07216c2856367a Reviewed-on: https://gerrit.libreoffice.org/79627 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-24support O(U)String::number() for fast string concatenationLuboš Luňák2-3/+3
When I did the fast string concatenation, I didn't add any support for number(), which simply returned a O(U)String, and so it did the extra allocation/deallocation, although that could be avoided. In order to support this, number() now returns a special temporary return type, similarly to O(U)StringConcat, which allows delaying the concatenation the same way. Also similarly, the change of the return type in some cases requires explicit cast to the actual string type. Usage of OString::getStr() is so extensive in the codebase that I actually added it to the helper class, after that it's only relatively few cases. Change-Id: Iba6e158010e1e458089698c426803052b6f46031 Reviewed-on: https://gerrit.libreoffice.org/78873 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-09-23tdf#39593 use getUnoTunnelImplementationArkadiy Illarionov1-5/+1
Change-Id: I78eb67913a568c610e38e5002f914773c4906dfd Reviewed-on: https://gerrit.libreoffice.org/79350 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
2019-09-23do not require $(SRCDIR) in every gb_Library_set_precompiled_headerLuboš Luňák1-1/+1
Change-Id: I7b3a22584bb2e4d501f509ffcd80929feed23a4c Reviewed-on: https://gerrit.libreoffice.org/79360 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-09-12Add IwyuFilter_svl.yamlGabor Kelemen1-0/+43
Looks like I forgot to add this in 43ddddb703bcdb9430752af63ae46527f737f874 Change-Id: I1aad5add0cbbc9baf72a4548fa33d57bb837707c Reviewed-on: https://gerrit.libreoffice.org/78084 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-09-12Fix typosAndrea Gelmini1-1/+1
Change-Id: I7fdeba2d7407989a00befaad1c186cd6f132cb85 Reviewed-on: https://gerrit.libreoffice.org/78827 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-09-06tdf#39593 use isUnoTunnelIdArkadiy Illarionov1-7/+5
Adapt getUnoTunnelId methods where required: rename or make public. Change-Id: I0fd2120bf9f0ff1aa690329a65ff64a154c89315 Reviewed-on: https://gerrit.libreoffice.org/78680 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-09-06Fixing "...."Andrea Gelmini1-1/+1
Change-Id: I3424e17cfdfb563fdc5882942031deafae8689fe Reviewed-on: https://gerrit.libreoffice.org/78678 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-09-01Fix '..'Andrea Gelmini1-1/+1
To complete this: https://gerrit.libreoffice.org/#/c/78312/ This is a massive replace for ".." instead of "..." between words. It passed "make check" on Linux. Change-Id: I144d8061fca9f545c762941551e59dffdd3650e8 Reviewed-on: https://gerrit.libreoffice.org/78357 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2019-09-01Fix '..'Andrea Gelmini3-3/+3
To complete this: https://gerrit.libreoffice.org/#/c/78312/ This is a massive replace for lines ending with ".." instead of "..." It passed "make check" on Linux. Change-Id: I07fa7b2e30ba9ea17a1f9a5e21c57216ba958efe Reviewed-on: https://gerrit.libreoffice.org/78356 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2019-08-27loplugin:referencecasting find more redundant static_castNoel Grandin1-1/+1
Change-Id: I3a51812bbd3fcdc6b11e47cb12962f0d4fa7a2ae Reviewed-on: https://gerrit.libreoffice.org/78191 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-24loplugin:returnconstval in svlNoel Grandin3-6/+6
Change-Id: I55371fde92204e6405e74fb8deecbaf14707a312 Reviewed-on: https://gerrit.libreoffice.org/78053 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-23[API CHANGE] Adapt css.uri UNOIDL entities to RFC 3986Stephan Bergmann1-1/+1
...which obsoleted RFC 2396. Notable changes are that the distinction between hierarchical and opaque URIs has been dropped, and that the relative URI resolution specification has been made more rigid. As a consequence, various features of css.uri entities have changed: * XUriReference.isHierarchical is obsolete and deprecated. * The behavior of XUriReference.hasAuthority, XUriReference.getAuthority, XUriReference.getPath, XUriReference.hasRelativePath, XUriReference.getPathSegmentCount, XUriReference.getPathSegment, XUriReference.hasQuery, and XUriReference.getQuery has been made consistent for all URIs, no matter whether they were considered hierarchical or opaque in the past. * The behavior of XUriReferenceFactory.makeAbsolute and XUriReferenceFactory.makeRelative has been changed to match the RFC 3986 reference resolution specification. The XUriReferenceFactory.makeAbsolulte parameter processSpecialBaseSegments has been renamed to processAdditionalSpecialSegments, as per the updated specification it now controls treatment of special segments in the given uriReference, in addition to special segments in the given baseUriReference. (Renaming UNOIDL interface method parameters is technically an incompatible change, but the benefits of improved clarity presumably outweigh any potential drawbacks in this case.) The implementation in stoc has been adapted, and various call sites have been adapted to the deprecated XUriReference.isHierarchical semantics. Change-Id: Ic6e00fdbce5abef70d75ec2f753d22fefe361457 Reviewed-on: https://gerrit.libreoffice.org/77861 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-08-23Mark move ctors/assignments noexceptMike Kaganski4-7/+7
This should enable using move semantics where possible e.g. in standard containers. According to https://en.cppreference.com/w/cpp/language/move_constructor: To make strong exception guarantee possible, user-defined move constructors should not throw exceptions. For example, std::vector relies on std::move_if_noexcept to choose between move and copy when the elements need to be relocated. Change-Id: I6e1e1cdd5cd430b139ffa2fa7031fb0bb625decb Reviewed-on: https://gerrit.libreoffice.org/77957 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>