summaryrefslogtreecommitdiff
path: root/unotools
AgeCommit message (Collapse)AuthorFilesLines
2019-11-06loplugin:indentation find broken if statementsNoel Grandin1-16/+16
so I don't read the "then" block as being a sequential statements Change-Id: Ib2004acd3518bd4ebd2246f02a26c2c0a8bbab4c Reviewed-on: https://gerrit.libreoffice.org/82069 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-03size some stringbuffer to prevent re-allocNoel Grandin2-2/+2
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-10-21size some stringbuffer to prevent re-allocNoel Grandin1-1/+1
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-19Replace some uses of OUStringChar with string literalsStephan Bergmann1-2/+2
Change-Id: I763f9a3f57efcd47643ca4651e2454e95c6921c9 Reviewed-on: https://gerrit.libreoffice.org/81127 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-19loplugin:unusedmethodsNoel Grandin1-6/+0
Change-Id: I95e63105654952d12c1dfd62f51593de114be569 Reviewed-on: https://gerrit.libreoffice.org/81077 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-18make bin/update_pch.s always include code in trivial #if'sLuboš Luňák1-25/+4
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-17Remaining loplugin:bufferaddStephan Bergmann3-18/+3
...that had been missing because the plugin didn't implement postRun, so it didn't report anything when run as part of the shared plugin. (But did report the expected warnings when run as a standalone plugin during CompilerTest_compilerplugins_clang.) Most fixes are straightforward. A noteworthy one is PreparedStatement::setBytes in connectivity/source/drivers/postgresql/pq_preparedstatement.cxx: The old preallocation of a 20 character OStringBuffer might have prevented buf.append( reinterpret_cast<char *>(escapedString), len -1 ); from potentially throwing std::bad_alloc, which would have caused escapedString to be leaked. Even though that 20-character preallocation was likely just random junk and not meant to address the potential leak, lets address it now. Change-Id: Ib506332d061684a22a74e5e39e591539fd2c4900 Reviewed-on: https://gerrit.libreoffice.org/80925 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-17Rename OUStringLiteral1 to OUStringCharStephan Bergmann3-8/+8
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-3/+3
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-1/+1
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-14Add document-level option to lock down content extractionSamuel Mehrbrodt1-0/+6
Setting this option will prevent copying/dragging any content from LO to another program or even another LO window. Change-Id: Ifbc032a4fa69ac1a17d4b500f5a30f5399d84ed7 Reviewed-on: https://gerrit.libreoffice.org/80586 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-10-02loplugin:stringadd in tools..unotoolsNoel Grandin2-9/+3
Change-Id: I441a5ccef6adc8be8029178e304ff3044e812e2a Reviewed-on: https://gerrit.libreoffice.org/79986 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-20Improve exception messageStephan Bergmann1-2/+3
Change-Id: If608a61f75b63327bed67fc3f752769c3a5bde62 Reviewed-on: https://gerrit.libreoffice.org/79307 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-09-06Fixing "...."Andrea Gelmini2-4/+4
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 Gelmini1-2/+2
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-30new loplugin:noexceptmoveNoel Grandin1-1/+1
idea from mike kaganski look for places where we can mark move operators as noexcept, which makes some STL operations more efficient Change-Id: Id732b89d1fcadd5ceb0ea2b9d159fed06136330f Reviewed-on: https://gerrit.libreoffice.org/78251 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-27Use a direct way to get at the temp dirStephan Bergmann1-0/+6
...in code originally added with 2b2f1352c72280dd25ed3bef090a3c708ee4b964 "tdf#86087 Save relative links in DOCX", by introducing utl::TempFile::GetTempNameBaseDirectory Change-Id: Ic0e8b54896a3829c081255404ef92b96f1724a2a Reviewed-on: https://gerrit.libreoffice.org/78174 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-08-24loplugin:returnconstval in unotoolsNoel Grandin4-11/+9
Change-Id: I8bfc0d52c8a68268a12e3dab890402d964d48eba Reviewed-on: https://gerrit.libreoffice.org/78036 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-20loplugin:constvars in test..unotoolsNoel Grandin1-1/+1
Change-Id: I087dc53ca5c18893974bbd9d959de56d5a4cdfa0 Reviewed-on: https://gerrit.libreoffice.org/77827 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-16use more TOOLS_WARN_EXCEPTIONNoel Grandin2-66/+24
Change-Id: Ic21ea11ff106e0732bb8fa600ef39a549d7bda86 Reviewed-on: https://gerrit.libreoffice.org/77569 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-16loplugin:sequenceloop in ucb..unotoolsNoel Grandin14-22/+24
Change-Id: Ie52d993c185ba43386b494baad0a484d5b365499 Reviewed-on: https://gerrit.libreoffice.org/77532 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-15embeddedobj: allow controlling if Visio documents are converted to Draw or notMiklos Vajna1-3/+16
At the moment this affects only Insert -> Object -> OLE Object -> from file. Change-Id: I8d1c6456481610491916e3be3766b0bb04dfa296 Reviewed-on: https://gerrit.libreoffice.org/77489 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2019-08-12Fix typosAndrea Gelmini1-3/+3
"its" Change-Id: I02c660e46964270376a66210fdb5f1b1985ce5b6 Reviewed-on: https://gerrit.libreoffice.org/77255 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-08-10Fix typosAndrea Gelmini1-1/+1
Information is always singular Change-Id: I55275d7c2fd76c3ec0ae4a98aa952777feb90460 Reviewed-on: https://gerrit.libreoffice.org/75645 Tested-by: Jenkins Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2019-08-08Mark some SystemShellExecute::execute calls as URIS_ONLYStephan Bergmann1-3/+10
...as they are obviously meant to display remote HTML content in a browser. Code can be triggered with a Basic snippet like doc = CreateUnoService("com.sun.star.comp.unotools.misc.ServiceDocumenter") doc.showInterfaceDocs(doc) Change-Id: I4c3192bd5f6cf9bf772f57e80d99eaab78e7e9ed Reviewed-on: https://gerrit.libreoffice.org/77114 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-07-31Improved loplugin:stringconstant (now that GCC 7 supports it): unotoolsStephan Bergmann3-18/+18
Change-Id: Idc40b72de04ee17dcc60913cc5f81f5f69dd57e9 Reviewed-on: https://gerrit.libreoffice.org/76631 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-07-29Fix typosAndrea Gelmini5-11/+11
Change-Id: Iec31617554fae0f6c5a3d795a917ce9096d84405 Reviewed-on: https://gerrit.libreoffice.org/76521 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-07-28loplugin:collapseifNoel Grandin1-11/+8
Change-Id: I69bfafa97c66ef944cc6ae35c7e2f66d0430d6a4 Reviewed-on: https://gerrit.libreoffice.org/76496 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-26Fix typosAndrea Gelmini1-1/+1
Change-Id: I60261b937215340d2eb6f439234e99a300b0e189 Reviewed-on: https://gerrit.libreoffice.org/76380 Tested-by: Jenkins Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2019-07-25Fix typosAndrea Gelmini1-2/+2
Change-Id: I59a0fd175fa5185c15d093d2d9bed9f95bb4cfd5 Reviewed-on: https://gerrit.libreoffice.org/76280 Tested-by: Jenkins Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2019-07-21loplugin:referencecasting in unotools..uuiNoel Grandin2-2/+2
Change-Id: Ia2c991591e65deb00710ab7a5b73bc42ae6b1b46 Reviewed-on: https://gerrit.libreoffice.org/76031 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-17loplugin:unusedmethodsNoel Grandin1-7/+0
Change-Id: Ie2285f64919d1c83b0a8df4ceb827f731e5cd609 Reviewed-on: https://gerrit.libreoffice.org/75739 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-11ConfigItem: use getTree also inside the RemoveChangesListener() methodTamás Zolnai1-8/+12
This is the only method which accesses the m_xHierarchyAccess member directly (except getTree() method). All other methods are using getTree() to access it. This direct member usage might be a problem when the code is run in fuzzing mode or the constructor is called with ReleaseTree mode. Change-Id: I7b5b91e63ac81d76028a098296fa306f154de53d Reviewed-on: https://gerrit.libreoffice.org/75042 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2019-06-28Simplify Sequence iterations in unotoolsArkadiy Illarionov18-282/+172
Use range-based loops or replace with STL functions Change-Id: I220c5cd5dcc19fc35e1ad729ae69246f4a79ce2d Reviewed-on: https://gerrit.libreoffice.org/74825 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
2019-06-24Fix AccessibleStateSetHelper::containsAllArkadiy Illarionov1-10/+2
Check if all states of the given state set are members of this object's state set. Previously it checked only last state. Change-Id: I79ffe54a5783aa1c3574bd099d2ea4bdc49a5c2d Reviewed-on: https://gerrit.libreoffice.org/74608 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-20Resolves: tdf#92503 introduce TimeZone to calendar loading and default to UTCEike Rathke1-4/+4
Without that, the system's time zone was used which on DST transition dates leads to non-existent times when switching to/from DST. As the calendar use and number parser/formatter nor conversions or calculations are time zone aware, using not DST afflicted UTC is the better choice. Change-Id: I3303c6620d8c4b9d081555c8293954fb1bd67895 Reviewed-on: https://gerrit.libreoffice.org/74386 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2019-06-18loplugin:logexceptionnicely in toolkit..unoxmlNoel Grandin8-159/+130
Change-Id: I0a3126545f9ef98640f6dd166290e9b9e91b8355 Reviewed-on: https://gerrit.libreoffice.org/74244 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-08tdf#125481 changed font order for Korean localeDaeHyun Sung1-13/+2
- Set Noto Sans CJK KR as the 1st priority. - Set Nanum-series font as the 2nd priority, Such as NanumGothic(나눔고딕),NanumMyeongjo(나눔명조) - Set KoPub-series font that Korea Publisher Society(한국출판인회의) and Ministry of Culture, Sports and Tourism, Republic of Korea(문화체육관광부) are released - for Windows vista and later versions, Add default Korean font, Malgun Gothic(맑은고딕) - for Mac OSX, add default Korean font Apple SD Gothic Neo(Korean: 애플 SD 산돌고딕 Neo) - for Mac OSX, Also add Mac OSX fonts Apple Gothic(애플고딕),AppleMyungjo(애플명조) - remove Sun-style fonts(Maybe Sun StarOffice's legacy) - remove Hy(한양)-series fonts(Hancom HWP package's font, proprietary font-series) Modern Linux distribution's default Korean font-families are Noto Sans&Noto Serif-family Before Noto Sans font released, UnFont-family was Linux distribition default Korean font. Early Linux distribution's default Korean font: Baekmuk-family. Sun-series font rarely use in Korean Linux distribution. ps. Noto Fonts(Modern Korean All OS default fonts) https://www.google.co.kr/get/noto/ Source Han Sans https://fonts.adobe.com/fonts/source-han-sans-korean Source Han Serif https://source.typekit.com/source-han-serif/kr/ Nanum-series font https://hangeul.naver.com/font KoPub-series font http://www.kopus.org/biz/electronic/font.aspx UnFont(Many of Linux distribution's default Korean font) http://kldp.net/unfonts/release/ Baekmuk Font(Early Linux distribution's Korean default font http://kldp.net/baekmuk/ Change-Id: If5bbcf549cbe96240250e44396dce1ff714c88b8 Reviewed-on: https://gerrit.libreoffice.org/73307 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-05-23Make utl::ConfigManager::get* use direct C++ config access internallyStephan Bergmann1-42/+10
But some of those functions' names may be more telling than their configuration property counterparts, so there may be merit in keeping those trivial wrapper functions around. Change-Id: Ibbf4965fcefd58649920fad964b4a8d2108deaca Reviewed-on: https://gerrit.libreoffice.org/72836 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-05-19Fix nillability of ooSetupLastVersionStephan Bergmann1-6/+0
...that had been introduced with 5187d3ae495a07373a12fd5980c9269bc8ce3f8f "Resolves: tdf#69042 - Add a 'What's New' infobar": * Make the default value nil instead of an empty string. * A nilable prop can't reuse the legacy utl::ConfigManager framework to obtain string prop values, so drop it from there and directly use the direct-access functionality in SfxViewFrame::Notify. Change-Id: I5fc67a3d7e0fcb44a218889ecf8c69e81661567e Reviewed-on: https://gerrit.libreoffice.org/72485 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-05-17Resolves: tdf#69042 - Add a "What's New" infobarheiko tietze1-0/+6
Shows an infobar with a link to the respective wiki page Adds a button to the About dialog Replaces If6eb1542d2ad310226f76850f480f2f99070b803 Change-Id: I1eeb504994a6364feb90cfa447029875e0ec1969 Reviewed-on: https://gerrit.libreoffice.org/72218 Tested-by: Jenkins Reviewed-by: Heiko Tietze <tietze.heiko@gmail.com> Tested-by: Heiko Tietze <tietze.heiko@gmail.com>
2019-05-15tdf#42949 Fix IWYU warnings in unotools/*Gabor Kelemen49-160/+64
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Also recheck include/unotools/* Change-Id: I3b8489aca69fbe80fa4a21748ac3c872d0d266c4 Reviewed-on: https://gerrit.libreoffice.org/71883 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-05-12regenerate PCH headersLuboš Luňák1-2/+2
Change-Id: I4894023e42cbfa32916ee3ddfb2cfb5426cfc69f Reviewed-on: https://gerrit.libreoffice.org/72195 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-05-09regenerate PCH headers for the 4 new levelsLuboš Luňák1-14/+19
Plus some build fixes triggered by this. Change-Id: I59b21def706598ceffd45ae5b1f0262ec9c1ad50 Reviewed-on: https://gerrit.libreoffice.org/71581 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-05-02Use hasElements to check Sequence emptiness in [t-u]*Arkadiy Illarionov8-20/+20
Similar to clang-tidy readability-container-size-empty Change-Id: Idefe55e37f5c837c889548ffe7c5711400012a4d Reviewed-on: https://gerrit.libreoffice.org/71667 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-19optimise find/insert patternNoel Grandin1-5/+3
if we're doing a find/insert on a set or a map, it is better to just do a conditional insert/emplace operation than triggering two lookups. Change-Id: I80da5097f5a89fe30fa348ce5b6e747c34287a8d Reviewed-on: https://gerrit.libreoffice.org/70937 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-15loplugin:sequentialassign in ucb..vbahelperNoel Grandin3-6/+3
Change-Id: I0fff9ee06225d4ff2e9c0611b1b11f1d3b896be2 Reviewed-on: https://gerrit.libreoffice.org/70733 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-12Resolves: tdf#124698 bubble down parent for modal dialogCaolán McNamara1-5/+5
Change-Id: If03c6ff8043bb39f2efdf4cde19d8277886bf36f Reviewed-on: https://gerrit.libreoffice.org/70658 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>