summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)AuthorFilesLines
2017-07-14use more OUString::operator== in test..xmlsecurityNoel Grandin1-1/+1
Change-Id: If5bdd1532be44a47ff7cc3b769be3ea585aea562 Reviewed-on: https://gerrit.libreoffice.org/39685 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-11ofz#2538: avoid oomCaolán McNamara1-0/+6
and merge together checkSeeks Change-Id: I341a09404280fb8d4acfbe2abaed47e2830af55f Reviewed-on: https://gerrit.libreoffice.org/39800 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-07-10simplify some OUString compareTo callsNoel Grandin1-1/+1
to either startsWith or == or != Change-Id: Ie4b4662f5b8e4532cbc1ab36910389e0b3d41ef0 Reviewed-on: https://gerrit.libreoffice.org/39750 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-07C++11 remove std::binary_function bases from functorsJochen Nitschke1-2/+1
std::binary_function is deprecated since C++11 and removed in C++17 90% done with regexp magic. removed obsolete <functional> includes. The std::binary_function base class was used by deprecated std::bind2nd, this was solved in individual commits. The members first_argument_type and second_argument_type were used in chart2/source/controller/dialogs/DataBrowserModel.cxx: DataBrowserModel::implColumnLess and are inlined in this commit. Change-Id: I60ded60a8d4afd59e15ac15a58e18d2498c9be5a Reviewed-on: https://gerrit.libreoffice.org/39659 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-05loplugin:unnecessaryparenStephan Bergmann1-1/+1
Change-Id: I051e25366300d9ca48ba30825198d78ff67a4bc1
2017-07-05new loplugin unnecessaryparenNoel Grandin1-5/+1
Change-Id: Ic883a07b30069ca6342d7521c8ad890f4326f0ec Reviewed-on: https://gerrit.libreoffice.org/39549 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-03loplugin:oncevar (clang-cl): toolsStephan Bergmann1-1/+5
Change-Id: I6670c2fd0c5897939b16874ed2106475fa948d2d
2017-07-03use sal_Int64 in tools::DateTimeNoel Grandin1-12/+12
instead of long which has platform-dependent bitlength Change-Id: I888458d7807027e237772940d4b2cc15c2971243 Reviewed-on: https://gerrit.libreoffice.org/39434 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-03use sal_Int32 in tools::DateNoel Grandin2-25/+25
instead of long, which has platform-dependant length (32bits on windows, 64bit on everything else) Change-Id: I9b5a950f56dad99a016b481c221bfd103ffa3911 Reviewed-on: https://gerrit.libreoffice.org/39433 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-02loplugin:casttovoid: toolsStephan Bergmann2-2/+0
Change-Id: Ifc36465542d5ee25d30b92b8499dac7594c71bc2
2017-06-29loplugin:oncevar variousNoel Grandin1-2/+1
Change-Id: I8b82d46d4688b1a59d6fe1b05da7d5c8dfc13ca6 Reviewed-on: https://gerrit.libreoffice.org/38766 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-28loplugin:oncevar in test..toolsNoel Grandin3-5/+3
Change-Id: I7b3ccc8f227100ff7fedeaca96a12f135da60bab Reviewed-on: https://gerrit.libreoffice.org/39326 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-27loplugin:useuniqueptr in variousNoel Grandin1-6/+5
extending it to find places we can use std::unique_ptr on arrays Change-Id: I9feb1d12d738d6931e752ecb6dd51cbc1540c81b Reviewed-on: https://gerrit.libreoffice.org/39255 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-25make some tools macros into functionsNoel Grandin1-50/+54
in the process, eliminate the need to explicitly specify the source/destination type at the callsites. Change-Id: Ie556645791a479989fb737933f1dd58e8533cb1c Reviewed-on: https://gerrit.libreoffice.org/39171 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-23simplify some string handling in tracing callsNoel Grandin2-19/+4
Change-Id: I0fb76562429e691400a02216019c7f96791cf9b3 Reviewed-on: https://gerrit.libreoffice.org/39159 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-21convert ErrCode to strong typedefNoel Grandin3-12/+12
would have preferred to re-use o3tl::strong_int, of which this is a modified copy, but there are lots of convenience accessors which are nice to define on the class. Change-Id: I301b807aaf02fbced3bf75de1e1692cde6c0340a Reviewed-on: https://gerrit.libreoffice.org/38497 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-16loplugin:unusedfields in tools..vbahelperNoel Grandin2-8/+2
Change-Id: Ief7d4c8e1866604eda6308ea2a5c1ce4b1c093bc Reviewed-on: https://gerrit.libreoffice.org/38836 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-14use ERRCODE_NONE instead of 0Noel Grandin1-1/+1
peeling off a small chunk of my ErrCode strong_int conversion Change-Id: Idc89e8496083beed7608cba705cd981139eb7111 Reviewed-on: https://gerrit.libreoffice.org/38777 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-14use more SAL_N_ELEMENTS part 1Noel Grandin1-1/+1
- teach comphelper::containerToSequence to handle sized arrays - also use range based for-loop where appropriate. Change-Id: I73ba9b6295e7b29c872ee53de7a9340969e07f99 Reviewed-on: https://gerrit.libreoffice.org/38769 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-06add COVERITY_NOEXCEPT_FALSECaolán McNamara1-1/+1
to markup dtors that coverity warns might throw exceptions which won't throw in practice, or where std::terminate is an acceptable response if they do Change-Id: I32b94814e8245372e1d1dc36be0d81e3564042f4 Reviewed-on: https://gerrit.libreoffice.org/38318 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-06-06replace SVSTREAM_OK with ERRCODE_NONENoel Grandin4-10/+10
since the first is #define'd to the second, and offers no extra value Change-Id: I2c67e09ea3aa5361b8e7dfe7a20858c6ae054450 Reviewed-on: https://gerrit.libreoffice.org/38406 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-05Improved loplugin:cstylecast to reference types: toolsStephan Bergmann1-1/+2
Change-Id: I3351bffc0f6a0725be780c7611138d6a4db5888e
2017-05-30teach redundantcast plugin about functional castsNoel Grandin1-1/+1
Change-Id: Iac8ccd17d9e46ebb2cb55db7adb06c469bbd4ea0 Reviewed-on: https://gerrit.libreoffice.org/37910 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-19make string translation loading more uniformCaolán McNamara1-1/+1
change various ResId classes that use conversion operator to OUString to functions that return a OUString drop various defines drop unnecessary toString calls Change-Id: Ibeccdf2b91a46a2ed5b4b74e6024e301a023bc92 Reviewed-on: https://gerrit.libreoffice.org/37817 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-05-18loplugin:unusedmethodsNoel Grandin1-12/+0
Change-Id: I1c50d176e793397a1f9625f797a3750cf191a61c Reviewed-on: https://gerrit.libreoffice.org/37679 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-09cleanup osl/diagnose.h includesJochen Nitschke2-2/+0
with command > git grep -l osl/diagnose.h *.cxx | xargs grep -L -w 'OSL_\w*' | xargs sed -i '/#include *\(<\|\"\)osl\/diagnose.h\(>\|\"\).*/d' headers need more work Change-Id: I906519ebbd47a04703b4fa5943b2f7abea7a97ab Reviewed-on: https://gerrit.libreoffice.org/37350 Tested-by: Jochen Nitschke <j.nitschke+logerrit@ok.de> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-05-08tdf#43157 Cleanup DBG_ASSERT in pstm.cxxFakabbir Amin1-13/+11
Change-Id: Ibc7b7399ccc827168768ee94b6e75e4116fc95c9 Reviewed-on: https://gerrit.libreoffice.org/33882 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-05-08cleanup tools/debug.hxx includesJochen Nitschke2-2/+0
with command > git grep -l tools/debug.hxx | xargs grep -L DBG_ | xargs sed -i '/#include *\(<\|\"\)tools\/debug.hxx.*/d' don't change files in includes/ and */pch Change-Id: Ie429d6a7dca5dfa1073e0f5ba037f7c84bdbec08 Reviewed-on: https://gerrit.libreoffice.org/37349 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-07revert OSL_ASSERT changesChris Sherlock1-3/+3
Change-Id: I365d140446bd2a62cf8256acbfdd53fe72987380
2017-05-07tdf#43157: convert tools from OSL_ASSERT to assertChris Sherlock1-3/+3
Change-Id: If932ad6282bac2ca0caa1a824ce58cad9e61045c
2017-05-06DateTime::GetWin32FileDateTime: FILETIME is uint64Eike Rathke1-8/+15
Truncate to 0 at 1601-01-01 See source code comment for pointers and reasoning. Change-Id: Iea961e0c0302f4f48a0ddbdd23036cbbbf53c00f
2017-05-05Fix typosAndrea Gelmini2-2/+2
To complete commit 0ef94e2b559547bc4e906e7f24e57ff5d642e108 and f12096272e684ddcd8ffa4e34dcb0a680cc594c2 Change-Id: Ie86bbfbd58dd728a013bef221e4d5c8fbcaf8e03 Reviewed-on: https://gerrit.libreoffice.org/37199 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-05-05DateTime::CreateFromWin32FileDateTime: FILETIME is uint64Eike Rathke1-30/+21
Called with a (stray value read from file?) sometimes absurdly high value treated as an int64 negative value which the algorithm couldn't cope with, resulting in weird DateTime ctor arguments that now assert. Changed to uint64 and replaced calculation with Date::operator+=(long) Change-Id: Ia8dbc10c4c633208730fce583e43afd828e7546f
2017-05-05Use gcd from boost::math::gcdDavid Ostrovsky1-2/+3
According to the documentation "Run-time GCD & LCM Determination": [1], gcd should be consumed from boost::math::gcd. [1] <http://www.boost.org/doc/libs/1_64_0/libs/math/doc/html/math_toolkit/run_time.html> Change-Id: I026a4e8ead75399765eb73fa5434a57958676383 Reviewed-on: https://gerrit.libreoffice.org/37260 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-05-04Replace all OUString("") with OUString()Arnaud Versini1-1/+1
Change-Id: Ie14c4d76cb61cfbe0410103adfc1afc8ade0f3e0 Reviewed-on: https://gerrit.libreoffice.org/37146 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-03tools: don't use std::tie when comparing resourcesMichael Stahl1-2/+4
This is unbelievably slow, Impress is basically unusable in a non-optimized build; every time you enter or leave text edit mode, some svx::sidebar::AreaPropertyPanel is created, which loads the color palette standard.soc, and there are lots of resource lookups for the strings in there; the std::tie and std::tuple::operator< make those 10x slower. (regression from d26f7537a57e4fc4c041db852b23c27149bc213d) Change-Id: I073b0187f6c173487e781a42c49631cb9ff2e625
2017-05-03remove excessive forward declarationsJochen Nitschke1-74/+24
and move comments. Change-Id: Ice44cfb4bbfb8973cd67a168727f2273976f8979 Reviewed-on: https://gerrit.libreoffice.org/37158 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-02Assert that nMonth and nDay <100 to be representableEike Rathke1-0/+2
Change-Id: Ie52269478ecac75519d04310a17873904c8167e6
2017-05-02Add more unit tests for Date::Normalize()Eike Rathke1-0/+29
Change-Id: I013317bfa9dad02194177cca0907b0ffbb171ccd
2017-05-02Date::Normalize: handle day 0 and empty dateEike Rathke1-0/+16
* Empty date (initialized with Date::EMPTY == all 0) stays empty. * Day 0 is normalized to the last day of the previous month. * Day 0 AND month 0 is also normalized to the last day of the previous month (and not the last day of the previous-1 month). * Before, * all day 0 cases weren't handled at all and day 0 stayed day 0, which doesn't make sense in a Normalize() context * empty date wasn't detected and resulted in nonsense date -0001-12-00 Change-Id: Ib12ff7694e1adb17724af038a266f6f284285f36
2017-05-02Test that empty date is not a valid dateEike Rathke1-0/+4
Change-Id: If5f2db3d4bae9158b482b01ce7dbb7335b4cb16b
2017-05-02Date::IsValidDate: year 0 is notEike Rathke1-0/+2
Change-Id: I44e476f354d04a1d070a7348e3b00d75497231c2
2017-05-02untranslated strings are just stringsCaolán McNamara1-4/+8
removes starmaths InsertCommand in favour of InsertCommandText Change-Id: I5659adcaa28e5b5861d1a1cc5d2afa84009490f6 Reviewed-on: https://gerrit.libreoffice.org/37113 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-04-29Move getProcessWorkingDir from tools to unotoolsChris Sherlock2-61/+0
Change-Id: Ifd86ab3c89c285ad5329fc86cc57967ebd1af91a Reviewed-on: https://gerrit.libreoffice.org/37100 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-04-28use std container for ParameterListJochen Nitschke2-114/+61
'ParameterList::find' was used to detect duplicate sections and sort the parameters by attribute and section. Checking for duplicates is done by 'std::any_of' and the predicate 'Parameter::IsSameSection' now. The parameters are inserted as they are parsed and sorted later with 'std::sort' algorithm and 'Parameter::operator<' Adapt loops to use iterators. Change a weird 'for' loop in 'parseParameters' to a 'do .. while ..' loop to match style of a preceding loop. Extend unit test with a case of duplicate sections. Change-Id: If2789c0cee8f64deae84bc720807d2d26d81dc9f Reviewed-on: https://gerrit.libreoffice.org/37075 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-28loplugin:salunicodeliteral: toolsStephan Bergmann1-5/+5
Change-Id: I9b428f4c5ff34a574d13a138cda4444502817e5c
2017-04-28Add unit tests for Date::Normalize()Eike Rathke1-0/+17
Change-Id: I4edb04748b1f407eb6ce17cd24ff022cef6e1f67
2017-04-28Month 100 was always wrongEike Rathke1-1/+1
Though only in case localtime() couldn't be obtained, which is about ~never. Fallout from commit a3de32acc06cfcf9bb343a29c4b9854c92645f70 Date: Wed Oct 28 11:23:36 2015 +0100 Rename (private) Date::init and reuse it Change-Id: Idbbac69f3d90e7556cd83bbf442ef8ccaecec86e
2017-04-28loplugin:cppunitassertequals: toolsStephan Bergmann1-18/+18
Change-Id: I8dc45fbbe3ea8c3fb898250e55cee582d1d8199d
2017-04-27split nTypeAndId into two fields in ImpContentNoel Grandin1-27/+41
preparatory to making the id part into strong_int Change-Id: Ied96193a6db9d45b24267b51b3014eb923319598 Reviewed-on: https://gerrit.libreoffice.org/37027 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>