summaryrefslogtreecommitdiff
path: root/svl
AgeCommit message (Collapse)AuthorFilesLines
2018-10-18clang-tidy readability-simplify-boolean-exprNoel Grandin2-18/+3
Change-Id: I78fa01a6c803dec782488490b730af3a11814d64 Reviewed-on: https://gerrit.libreoffice.org/61902 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-17clang-tidy readability-redundant-smartptr-getNoel Grandin2-6/+5
redundant get() call on smart pointer Change-Id: Icb5a03bbc15e79a30d3d135a507d22914d15c2bd Reviewed-on: https://gerrit.libreoffice.org/61837 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-12SvNumberFormatsSupplierServiceObject: default to LANGUAGE_SYSTEMEike Rathke1-1/+1
... instead of LANGUAGE_ENGLISH_US that will be ultimate fall-back anyway if no match is found. Change-Id: Ice6495e54fa0a1e275769fcfdf1e0e932e22944e Reviewed-on: https://gerrit.libreoffice.org/61729 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2018-10-10ofz#10879 stay inside sSecStr boundsCaolán McNamara1-2/+2
Change-Id: I0ca70cdb9b80305c5339668d65d2c4c9977e7160 Reviewed-on: https://gerrit.libreoffice.org/61604 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-10-09Extend loplugin:redundantinline to catch inline functions w/o external linkageStephan Bergmann4-9/+9
...where "inline" (in its meaning of "this function can be defined in multiple translation units") thus doesn't make much sense. (As discussed in compilerplugins/clang/redundantinline.cxx, exempt such "static inline" functions in include files for now.) All the rewriting has been done automatically by the plugin, except for one instance in sw/source/ui/frmdlg/column.cxx that used to involve an #if), plus some subsequent solenv/clang-format/reformat-formatted-files. Change-Id: Ib8b996b651aeafc03bbdc8890faa05ed50517224 Reviewed-on: https://gerrit.libreoffice.org/61573 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-10-09use unique_ptr in SfxUndoManager::AddUndoActionNoel Grandin1-3/+4
Change-Id: I11483e3cece12a7373f4276972b4c899edf1ce15 Reviewed-on: https://gerrit.libreoffice.org/61566 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-08loplugin:constfields in svlNoel Grandin7-15/+15
Change-Id: I18183c5c257cbe69bd067d4e74c50483ae683cf3 Reviewed-on: https://gerrit.libreoffice.org/61509 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-06try to fix SvtBroadcaster on macOSNoel Grandin1-42/+32
this reverts commit a20ec3b5cd691ae18f0d87d045673ce3a06579c6 fix iterator invalidation assert and commit 4a290888580474f9542f185091bb2a6fcf4e9a53 SvtBroadcaster unify the normal and PrepareForDestruction paths no idea what is going on, I suspect that std::vector is re-allocating its data buffer despite having called reserve() Change-Id: I681ae5fca4578240a2a0dc0af51ff06d919f9099 Reviewed-on: https://gerrit.libreoffice.org/61464 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-06Unit test for de-* Januar/Jänner, tdf#114927Eike Rathke1-0/+30
Change-Id: I8f0f3b88e172e93caca4de6d8000cb20c5af8333 Reviewed-on: https://gerrit.libreoffice.org/61428 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2018-10-05OUString::fromUtf8() instead of createFromAscii()Eike Rathke1-2/+2
So we can use UTF-8 input to test. Change-Id: Ie56d43226c8cc8a5bf10317961fa0a91d8acfcf0
2018-10-05Resolves: tdf#114927 recognize both Januar and Jänner in de-* German localesEike Rathke1-0/+40
Change-Id: Ifcf087a8a20a1cdc460bd2caf6d1ceb528792e0d Reviewed-on: https://gerrit.libreoffice.org/61415 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2018-10-05fix iterator invalidation assertNoel Grandin1-6/+8
which only recent versions of MSVC (from 15.8.6) seem to spot. It resulted in PythonTest_sw_python failures with "vector iterators incompatible" assertion on the dest != maDestructedListeners.end() check ever since commit 4a290888580474f9542f185091bb2a6fcf4e9a53 Date: Mon Oct 1 14:31:00 2018 +0200 SvtBroadcaster unify the normal and PrepareForDestruction paths Although this code appears to always have been wrong, it is just that it is being hit much more often now. Change-Id: I45d4f2ceef4ddf19c205702645a41363eea93f21 Reviewed-on: https://gerrit.libreoffice.org/61397 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-02fix bug in SvtListener copy constructorNoel Grandin1-2/+1
it was copying maBroadcasters, without actually starting to listen to those broadcasters, which means if we __did__ call StartListening, that method would have just returned early. Since nothing seems to need this functionality, and it's not obvious what the correct behaviour would be, just don't do the copy. Change-Id: If5865fa3449839758a43ac537475e0a474f39078 Reviewed-on: https://gerrit.libreoffice.org/61239 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-02SvtBroadcaster unify the normal and PrepareForDestruction pathsNoel Grandin1-32/+40
since this approach is better in that it avoids O(n^2) behaviour of lots of listeners deleting from a std::vector, lets just always use this approach. Change-Id: I9204996ee8c9379ac71dfc168a6c1fc653e63a8e Reviewed-on: https://gerrit.libreoffice.org/61204 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-02minor optimisation to SvtBroadcaster::AddNoel Grandin1-6/+8
Change-Id: I5ab173cb2517602abc42e715375157fd05fdd55f Reviewed-on: https://gerrit.libreoffice.org/61203 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-02fix bug in SvtBroadcaster copy constructorNoel Grandin1-22/+10
otherwise we end up with duplicated listeners on our list, because we add them twice Change-Id: Ia5cdd3584d49ef11b89cf12fc9ebf07441a47724 Reviewed-on: https://gerrit.libreoffice.org/61202 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-01Resolves: tdf#119613 [*-ZA] default to ISO 8601 date formatEike Rathke1-4/+4
This also made it necessary to adapt the unit tests that checked for the old default format in output. Change-Id: Ie7bc78d1e5a17e5cb6f52d5ed1ab42db80f07d2e Reviewed-on: https://gerrit.libreoffice.org/61200 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2018-10-01fix bug in SvtListener::CopyAllBroadcastersNoel Grandin1-0/+1
need to flush existing broadcasters before overwriting Change-Id: If570b838d0313ab7598b36ff8a32fc6d31dea92c Reviewed-on: https://gerrit.libreoffice.org/61151 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-01SvtBroadcaster no need to uniqueNoel Grandin1-4/+0
SvtListener already enforces this Change-Id: I0389668af12013addfdbeec7a5e92a9d374193dc Reviewed-on: https://gerrit.libreoffice.org/61150 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-01scatter some asserts in SvtBroadcasterNoel Grandin1-0/+7
copying a broadcaster that has been marked for destruction is very suspicious. so is adding a listener to such a broadcaster Change-Id: Ic1cae111a600477f16a346004b8017a9a8d242e9 Reviewed-on: https://gerrit.libreoffice.org/61136 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-01don't call back into the SvtBroadcaster when dyingNoel Grandin2-5/+15
and we don't need to use equal_range on a sorted and uniqued vector, lower_bound will do Change-Id: I3f967c04b43432875e3d4de75e6e87bfdef40dc8 Reviewed-on: https://gerrit.libreoffice.org/61135 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-27loplugin:methodcycles more graph theory for the winNoel Grandin1-4/+0
implemeent a reduction approach, which is good at finding virtual methods that only themselves or their virtual partners. The accessibility GetVisArea stuff is dead since commit 891e41fac81fbd8d5cdb277b26639abfd25a7143 Date: Wed Apr 4 11:23:22 2018 +0200 dead code in AccessibleTextHelper_Impl::UpdateVisibleChildren Change-Id: I78d9d8bca585ecec8394f2c3fe2baa93db0e58f5 Reviewed-on: https://gerrit.libreoffice.org/60912 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-19svl: fix SfxItemIter on empty item setMichael Stahl1-1/+1
The problem is that IsAtEnd { return m_nCurrent == m_nEnd; } is never true because of the odd initialisation with m_nEnd > m_nStart. Change-Id: I477b0f111e2c2f47fe093800710a9b28ca8a5925
2018-09-19flatten SfxUndoArrayNoel Grandin1-151/+90
there is really no need to point to an impl which points to a std::vector Change-Id: I73c47cf3056a24d909e77b9b4cf9d9ae57c19c04 Reviewed-on: https://gerrit.libreoffice.org/60588 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-19Bin more binfilter cruftEike Rathke1-69/+31
As the requirement for persistent keyword index values is gone, let's rearrange the keywords to a more logical and also gapless order, which allows to get rid of the cumbersome multiple loops in ImpSvNumberformatScan::GetKeyWord(). Change-Id: Ic1a034acc5f42f593b147a1baf377f1600fac118 Reviewed-on: https://gerrit.libreoffice.org/60692 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2018-09-18Bin binfilter cruftEike Rathke1-2/+0
The requirement for persistent keyword index values is gone since long. Remove the NF_KEY_UNUSEDn place holders. Change-Id: Idcc1b621d88884ebcefb3ba4e7865d4f2db4ce51 Reviewed-on: https://gerrit.libreoffice.org/60643 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2018-09-18Use !startsWith() instead of indexOf()!=0Eike Rathke1-4/+4
Faster and even easier to read. Change-Id: I0146f70ea250e68887ac5d8dd5a10fe7e6a90eeb Reviewed-on: https://gerrit.libreoffice.org/60648 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2018-09-17adapt to commit 1476d95b6ed3afa35ccchimajin1000001-2/+1
Change-Id: Ie6582b324d4c7feb8dbc7cac852b2c52358a052a Reviewed-on: https://gerrit.libreoffice.org/60547 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-17New loplugin:externalStephan Bergmann4-5/+5
...warning about (for now only) functions and variables with external linkage that likely don't need it. The problems with moving entities into unnamed namespacs and breaking ADL (as alluded to in comments in compilerplugins/clang/external.cxx) are illustrated by the fact that while struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } returns 1, both moving just the struct S2 into an nunnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { namespace { struct S2: S1 { int f() { return 1; } }; } int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } as well as moving just the function f overload into an unnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; namespace { int f(S2 s) { return s.f(); } } } int main() { return f(N::S2()); } would each change the program to return 0 instead. Change-Id: I4d09f7ac5e8f9bcd6e6bde4712608444b642265c Reviewed-on: https://gerrit.libreoffice.org/60539 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-12loplugin:simplifyconstruct in stoc..svlNoel Grandin12-23/+3
Change-Id: I81d465d66a979e9a1e092e5d23ed339840d1fb2d Reviewed-on: https://gerrit.libreoffice.org/60315 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-11clang-tidy bugprone-copy-constructor-initNoel Grandin1-2/+2
Change-Id: Idd435b3a4d081f6d3af26ff8add69ad4af50db57 warning: calling a base constructor other than the copy constructor Reviewed-on: https://gerrit.libreoffice.org/60239 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-11loplugin:useuniqueptr in StylePool::createIteratorNoel Grandin1-4/+5
Change-Id: I1a7bdfc00352c25f5d2db9ef195000d16f909537 Reviewed-on: https://gerrit.libreoffice.org/60263 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-10tdf#42949 Fix IWYU warnings in include/cppuhelper/*Gabor Kelemen1-0/+1
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ib420e9216b8313f5ed7634ec375e39ceb741fd45 Reviewed-on: https://gerrit.libreoffice.org/59297 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-08-31Use tools::Time::GetClock() in number formatter for wall clock timeEike Rathke2-112/+137
Also handle rounding/scaling better in ImpGetTimeOutput() for the [] duration formats, of which [HH]:MM:SS(.0000000) is used to edit time values. The wall clock change made it necessary to adapt some test cases in Test::testUserDefinedNumberFormats() where M_PI formatted to date+time actually is 1900-01-02 03:23:53.60527 with second 53 instead of the previously rounded 54. Change-Id: I242a6c753a24281e041d3f73af019bdd77c65b37 Reviewed-on: https://gerrit.libreoffice.org/59857 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2018-08-30Use INPUTSTRING_PRECISION to enable input of fraction of secondEike Rathke1-2/+2
This got lost when SvNumberFormatter::INPUTSTRING_PRECISION was introduced but not all places changed using the previous hard coded number 300, so input of fraction of second in time clock and duration was either truncated or not available at all, already since commit 0ce0dd5863208500d8d4658f1f68f34e254ab015 CommitDate: Tue Dec 1 16:58:07 2009 -0500 #i46511# Fixed one bug where the standard percent format incorrectly got unlimited precision. Change-Id: I9e4dd867b07090db16b23639fd01fb2cebb3f5d0 Reviewed-on: https://gerrit.libreoffice.org/59815 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2018-08-29replace rtl_allocateMemory with std::mallocNoel Grandin1-6/+6
where used directly, since rtl_allocateMemory now just calls into std::malloc Change-Id: I59f85bdb7efdf6baa30e8fcd2370c0f8e9c999ad Reviewed-on: https://gerrit.libreoffice.org/59685 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-27svl: Avoid unnecessary indirection in SfxItemPropertySetInfoTakeshi Abe1-13/+5
Change-Id: I56db3db23361590b5d2c09bc8f6f23a02ccd7f60 Reviewed-on: https://gerrit.libreoffice.org/59570 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-23Related rhbz#1618703: Properly handle failure decoding master passwordStephan Bergmann2-6/+7
...when e.g. FIPS mode makes PasswordContainer::DecodePasswords fail by throwing an exception which needs to be caught in PasswordContainerHelper::addRecord (in uui/source/passwordcontainer.cxx, but which only catches NoMasterException, not generic RuntimeException) Change-Id: I877bb5126e79ac2c90b11ef6d31bf81a2927f409 Reviewed-on: https://gerrit.libreoffice.org/59511 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-08-22Resolves: tdf#73063 preserve and roundtrip LCID from/to Excel number formatsEike Rathke2-3/+31
Change-Id: I8e3e5ef5873af108596b387e8900d038e3942981 Reviewed-on: https://gerrit.libreoffice.org/59441 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2018-08-22Related: tdf#73063 strip a plain locale identifier if locale data is availableEike Rathke1-1/+20
Change-Id: Ie34f6c34fe4415489026203fe7d7b1f32a2bb5dc Reviewed-on: https://gerrit.libreoffice.org/59398 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2018-08-21No LCID if no format code, tdf#73063 prepEike Rathke1-0/+4
Current code inserts LCID only if there is a calendar or locale specific numerals given, prepare for more general handling. Change-Id: I61f89263c47b7aeed58803656f58543def5f4f2f Reviewed-on: https://gerrit.libreoffice.org/59345 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2018-08-20Avoid searching "[DBNum" if not inserted, tdf#73063 prepEike Rathke1-3/+6
Change-Id: I731f2813a2b29d3d7013d559c481f9b59fe7fa43 Reviewed-on: https://gerrit.libreoffice.org/59343 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2018-08-20One more "do not reorder date particles", tdf#113889 tdf#119013 follow-upEike Rathke1-1/+1
commit 5b8007afdb97d416ee7c22bf9226e927d61e9bd3 CommitDate: Thu Aug 16 18:54:31 2018 +0200 Resolves: tdf#119013 do not over-aggressively reorder date particles negated logic from bForExcelExport to bConvertDateOrder. This somehow slipped through in that commit. Change-Id: Ibe7e7f7dc669292f38136ceeced1ead120641a20 Reviewed-on: https://gerrit.libreoffice.org/59330 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2018-08-17Do not convert YMD date order to YDM and vice versa, tdf#107012 follow-upEike Rathke1-2/+9
Change-Id: I6362caae4dd0764a5f99f1b0453c17ecde4b53f1 Reviewed-on: https://gerrit.libreoffice.org/59213 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2018-08-16Resolves: tdf#119013 do not over-aggressively reorder date particlesEike Rathke6-14/+16
In particular not when reading documents as we don't know what the original (default/system) locale was when the date format was created and stored and whether the format's date order actually matched the locale's ordering. Regression from commit 51478cefaa4e265b42e3f67eda0a64767ff3efba CommitDate: Tue Apr 18 17:01:27 2017 +0200 Resolves: tdf#107012 follow date order of the target locale Change-Id: I9d3bdbd512d95ed81ff6459e368a2d7497ec8a2d Reviewed-on: https://gerrit.libreoffice.org/59182 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2018-08-14create appendCopy method in OUStringBufferNoel Grandin2-8/+7
so we can avoid temporary copies when appending a substring of an OUString to the buffer. I would have preferred to call the method just "append" but that results in ambiguous method errors when the callsite is something like sal_Int32 n; OUStringBuffer s; s.append(n, 10); I'm not sure why Change-Id: I6b5b6641fcb5b26ce2269f89ef06e03c0b6aa76f Reviewed-on: https://gerrit.libreoffice.org/58666 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-10unnecessary null check before dynamic_cast, in variousNoel Grandin1-1/+1
Change-Id: I76ad0b3152030c29ee28f6a6cc80d0832188d02b Reviewed-on: https://gerrit.libreoffice.org/58774 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-09svl windows: remove last traces of pre-CNG signingMiklos Vajna1-18/+3
Mostly only the certificate selector was left + the global runtime switch. Change-Id: I11e8e0920806eb61848512df6dea48c594febfe4 Reviewed-on: https://gerrit.libreoffice.org/58751 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-08-08improve SharedStringPoolNoel Grandin1-72/+25
we don't need two sets, we can simplify the logic and let the key in the map perform the same function that one of the sets was performing. Change-Id: If042fd0d1483fb603967164c429a085a4f0b31eb Reviewed-on: https://gerrit.libreoffice.org/58692 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-07SharedStringPool is always called with a CharClassNoel Grandin2-11/+7
Change-Id: Ib2b9963a90a135998b6189fba521bd85f5579cf5 Reviewed-on: https://gerrit.libreoffice.org/58645 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>