summaryrefslogtreecommitdiff
path: root/sc/qa/unit
AgeCommit message (Collapse)Author
2017-07-14use more OUString::operator== in scNoel Grandin
Change-Id: I1a7691fe59e5e93c15bd812f03366da814f9f3db Reviewed-on: https://gerrit.libreoffice.org/39900 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-13tdf#108758 : do not write to undo document when...Dennis Francis
...updating references during a block move, for formula cells that are in the target range of the move operation. The fix is for formula cells that are not grouped. For the grouped case, it was already doing correctly. Added two unit tests in ucalc_formula.cxx for grouped formula and non-grouped formula cases. Change-Id: I9f4d988f5e154f56670bd1c0cc366ee6704fb858 Reviewed-on: https://gerrit.libreoffice.org/39883 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
2017-07-13Move scheduler task into its own headerJan-Marek Glogowski
Change-Id: I54534787b8cfa4c47dc09dde9c38a7893df9d367
2017-07-12loplugin:unreffunJan-Marek Glogowski
Fix some HAVE_MORE_FONTS dependent tests. Change-Id: I79fec705d02b38222d66368759a95b667604335c
2017-07-10tdf#107135, add missing ODFF function REPLACEB.Winfried Donkers
Change-Id: I8d782b109eb390838b6c4f3a85e9b344ecef87ec Reviewed-on: https://gerrit.libreoffice.org/39606 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2017-07-09add test for non-ascii gnumeric file names, tdf#107827Markus Mohrhard
Change-Id: Ib530567df9cb487951d8dbf1b7824f78a7d150d9 Reviewed-on: https://gerrit.libreoffice.org/37581 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2017-07-08Add a way to resize ScDBDataJaskaran Singh
Change-Id: I6e0e1a7f58873c012e0e8015ed69da38a32a44f4 Reviewed-on: https://gerrit.libreoffice.org/39323 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2017-07-07C++11 remove std::binary_function bases from functorsJochen Nitschke
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-06loplugin:unusedfields in scNoel Grandin
found a couple more by running make build-nocheck to exclude testing code Also, teach unusedfields loplugin about operator<<, since referring to a field in an ostream operator<< does not indicate a real use, it's normally for debugging Change-Id: I3dce22bf5afda2fd09e01de9bf1d0ef85e535aa8 Reviewed-on: https://gerrit.libreoffice.org/39625 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-05coverity#1414486 Unchecked dynamic_castCaolán McNamara
and coverity#1414482 Unchecked dynamic_cast coverity#1414480 Unchecked dynamic_cast coverity#1414479 Unchecked dynamic_cast Change-Id: Ia33e4cfa5c13beeae5dfa46411f526433d87ea99 Reviewed-on: https://gerrit.libreoffice.org/39568 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-07-03C++11 remove std::unary_function bases from functorsJochen Nitschke
std::unary_function is deprecated since C++11 and removed in C++17 90% done with regexp magic. removed obsolete <functional> includes. The std::unary_function base class was used in 3 places: * chart2/source/tools/DataSeriesHelper.cxx: lcl_MatchesRole is used in a std::not1 function helper who uses the members return_type and argument_type. - replace deprecated std::not1 with a lambda * chart2/source/tools/ModifyListenerHelper.cxx: lcl_weakReferenceToSame used the argument_type member in the operator() parameter. - inline the parameter type. * xmloff/source/chart/SchXMLExport.cxx: lcl_SequenceToMapElement used result_type and argument_type in operator(). - inline the types Also fix compile error with gcc about finding std::for_each. Change-Id: I073673beb01410c3108e7d0346d9e7d6b9ad2e2f Reviewed-on: https://gerrit.libreoffice.org/39358 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2017-07-03Translate German comments and debug strings (leftovers in dirs sal to sc)Johnny_M
Translates leftovers found using a custom regex and manually checking the rest of the affected file. Additionally: - A few spelling fixes Change-Id: I2b83bd11adf520b90bb29c8ea624990759dad3c6 Reviewed-on: https://gerrit.libreoffice.org/39427 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2017-07-02loplugin:casttovoid: scStephan Bergmann
Change-Id: I1dddf4431ccbcea8a5d89d2849307efba592cae9
2017-06-29loplugin:oncevarStephan Bergmann
Change-Id: Ib8027a45f98b623e04b14d55a7b75a0f4c317b42
2017-06-28sc lok: disable Undo/Redo state if conflict with other viewsHenry Castro
Change-Id: I5bc5be2b17925ec3a203f9704f62a8c80ac5fc9d Reviewed-on: https://gerrit.libreoffice.org/39363 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Henry Castro <hcastro@collabora.com>
2017-06-28add test for tdf#65848Markus Mohrhard
Change-Id: I6a75fdf0eb615a80d76f9298d3dad8ecbec7c66e Reviewed-on: https://gerrit.libreoffice.org/39335 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2017-06-27add test for formula listener during delete sheetMarkus Mohrhard
Change-Id: I49c53048db575e60f5110b2161658c190ba2e7f8 Reviewed-on: https://gerrit.libreoffice.org/39318 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2017-06-27add a test for listener update during insert tabMarkus Mohrhard
Change-Id: Ia726c76a448aaef97228a5c04d5fd876d5d4c67f Reviewed-on: https://gerrit.libreoffice.org/39313 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2017-06-27Unit test for update reference in deletion of last col/row, tdf#108788Eike Rathke
Change-Id: Ibb7a30144a1eebac3b233320c3d56c7be41cc7e3
2017-06-26loplugin:oncevar in scNoel Grandin
Change-Id: Ice59e286debb6bd0eb692f2b2b0c2c5087c069c0 Reviewed-on: https://gerrit.libreoffice.org/39239 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-22Unit test for named single reference pointing to deleted row, tdf#108671Eike Rathke
Change-Id: Idb22bd00572d362eb2cc0137fe01835d6c28fcf8
2017-06-21loplugin:unusedfields in sfx2 part1Noel Grandin
and fix a memory leak in NotebookbarTabControl where it was not freeing it's m_pListener field Change-Id: Ib9970c9084982d532fa38d1bc3c44180ab2c3c39 Reviewed-on: https://gerrit.libreoffice.org/39036 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-16Make SfxItemSet ranges correct by constructionStephan Bergmann
This is a follow-up to 45a7f5b62d0b1b21763c1c94255ef2309ea4280b "Keep WID ranges sorted, and join adjacent ones". While SfxItemSet::MergeRange relies on the m_pWhichRanges being sorted (and, under DBG_UTIL, asserts if they are not), the various SfxItemSet constructors curiously only check (via assert or DBG_ASSERT) that each individual range has an upper bound not smaller than its lower bound. Arguably, all SfxItemSet instances should fulfill the stronger guarantees required and checked by MergeRange. And in many cases the ranges are statically known, so that the checking can happen at compile time. Therefore, replace the two SfxItemSet ctors taking explicit ranges with two other ctors that actually do proper checking. The (templated) overload taking an svl::Items struct should be used in all cases where the range values are statically known at compile time, while the overload taking a std::initializer_list<Pair> is for the remaining cases (that can only do runtime checking via assert). Most of those latter cases are simple cases with a single range covering a single item, but a few are more complex. (At least some of the uses of the existing SfxItemSet overload taking a const sal_uInt16* pWhichPairTable can probably also be strengthened, but that is left for another day.) This commit is the first in a series of two. Apart from the manual changes to compilerplugins/clang/store/sfxitemsetrewrite.cxx, include/svl/itemset.hxx, and svl/source/items/itemset.cxx, it only consists of automatic rewriting of the relevant SfxItemSet ctor calls (plus a few required manual fixes, see next). But it does not yet check that the individual ranges are properly sorted (see the TODO in svl::detail::validGap). That check will be enabled, and the ensuing manual fixes will be made in a follow-up commit, to reduce the likelyhood of accidents. There were three cases of necessary manual intervention: * sw/source/core/unocore/unostyle.cxx uses eAtr of enum type RES_FRMATR in braced-init-list syntax now, so needs explicit narrowing conversion to sal_uInt16. * In sw/source/uibase/uiview/formatclipboard.cxx, the trailiing comma in the definition of macro FORMAT_PAINTBRUSH_FRAME_IDS needed to be removed manually. * In svx/source/svdraw/svdoashp.cxx, svx/source/svdraw/svdotext.cxx, sw/source/uibase/app/docstyle.cxx, sw/source/uibase/shells/frmsh.cxx, sw/source/uibase/shells/grfsh.cxx, and sw/source/uibase/shells/textsh1.cxx, some comments had to be put back (see "TODO: the replaced range can contain relevant comments" in compilerplugins/clang/store/sfxitemsetrewrite.cxx). A few uses of the variadic form erroneously used nullptr instead of 0 for termination. But this should have been harmless even if promoted std::nullptr_t is larger than promoted sal_uInt16, assuming that the part of the nullptr value that was interpreted as sal_uInt16/promoted int was all-zero bits. Similarly, some uses made the harmless error of using 0L instead of 0. Change-Id: I2afea97282803cb311b9321a99bb627520ef5e35 Reviewed-on: https://gerrit.libreoffice.org/38861 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2017-06-13Use FormulaTokenArray::FirstToken() in one place where we canTor Lillqvist
Change-Id: I84a108d9c0f1a0982fb7144b32be007498e5f0ea
2017-06-13Let SfxSetItem ctor take SfxItemSet by unique_ptrStephan Bergmann
Change-Id: I219dd03477862169cd50eecc14822f6a023f879a
2017-06-12cleanup unused css/frame/* includesJochen Nitschke
Change-Id: I173a29fd1ee889127369d2bc2fce8e010b89ca65 Reviewed-on: https://gerrit.libreoffice.org/38633 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-10Unit test for COUNTIFS, SUMIFS, AVERAGEIFS with array of references, tdf#58874Eike Rathke
Change-Id: Ie833716fcde0b82dcaa2e5b66deb2952ee912b7f
2017-06-09Some compilers can't init vector from empty {}Eike Rathke
Change-Id: I82767a92d1f816cb7fa8ef4f96d694ca5658dfc0
2017-06-09Add unit test for COUNTIFS and AVERAGEIFS in array contextEike Rathke
To cover different code paths and use of sc::ParamIfsResult::mfCount Change-Id: I7d0cfa9de3ac5460822c4d5075de54791f7abff8
2017-06-09use comphelper::InitPropertySequence in more placesNoel Grandin
Change-Id: I72d7b13a23ce306b752b39187a0e9fbb7028643a Reviewed-on: https://gerrit.libreoffice.org/38606 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-09Add unit test for SUMIFS in array contextEike Rathke
Change-Id: I5318ab8bb4d896f3c936ec8d04eba3908b59861a
2017-06-07Add Test for dataprovider and modify the way we fetch and apply streamJaskaran Singh
Make FetchStreamFromURL::aBuffer a pointer to prevent the crash that happens because of it. Add ExternalDataMapper::StopImport() method. Add a few member functions in CSVFetchThread that help in sync the line fetch and writing. Introduce a WriteToDoc() method that iterates over the the range to apply whatever value or string needs to be applied. Change-Id: I9baa053fa6d91bdf758a9b035888af50a40674eb Reviewed-on: https://gerrit.libreoffice.org/32964 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2017-06-06add COVERITY_NOEXCEPT_FALSECaolán McNamara
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-05clang-tidy performance-unnecessary-value-paramNoel Grandin
Change-Id: I6ed8c54c7c45931d91709cc818f2483c70197192 Reviewed-on: https://gerrit.libreoffice.org/38400 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-02Improved loplugin:redundantcast static_cast handling: scStephan Bergmann
Change-Id: I11f0deb6913a7a3adc6bc31890451e05bfa00802
2017-06-01Improve suppression of loplugin:redundantcast in CPPUNIT_ASSERTStephan Bergmann
Change-Id: I65f95e7245f08592ea11cc75e1cf34dcbdf16b40
2017-05-31tdf#104219 Don't export color information when color is automaticBartosz Kosiorek
In LibreOffice and MS Office, there are two types of colors: - Automatic (which is taken from settings) and Fixed (which is set by RGB value). OOXML is setting automatic color by default, by not providing any RGB color. To preserve automatic color we need to not export RGB color during OOXML export. Change-Id: I8895230c4fffc9d8741f3eff37e64c4823d71da8 Reviewed-on: https://gerrit.libreoffice.org/37970 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2017-05-31clang-tidy readability-redundant-string-cstrNoel Grandin
and readability-redundant-string-init Change-Id: I7b25659ace9e1d5be042ec5e179f01191693334e Reviewed-on: https://gerrit.libreoffice.org/38225 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-28remove unnecessary use of OString::getStrNoel Grandin
Change-Id: I0490efedf459190521f4339854b3394d57765fdb Reviewed-on: https://gerrit.libreoffice.org/38058 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-26xlsx export: limit dataValidation list to 255 chars, not 254Justin Luth
related to tdf#99856 commit b139bf96574010f317c543bc45d23dd6a5810621 which had a logic failure, caused by investigating too many alternative ways of fixing. Change-Id: I6ffce8c0bc10c992804cb5d8c75441da1a4c3d37 Reviewed-on: https://gerrit.libreoffice.org/38051 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org>
2017-05-25tdf#99856 xlsx export: limit dataValidation list to 255 charsJustin Luth
Excel consider the file corrupt if it has an overly long validation list. Change-Id: I4145859d4f76e0a70521c7bee33c96927b437ace Reviewed-on: https://gerrit.libreoffice.org/38038 Reviewed-by: Justin Luth <justin_luth@sil.org> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
2017-05-25tdf#108017 xlsb import: protection settings were reversedJustin Luth
Back in LO4.3, commit 5728a56b20e01d6c9e86a23f20af64a1b68ad604 fdo#70499 selectn of lock/unlocked cells with worksheet protection reversed ...reversed finalizeImport's understanding of maSheetProt.* to match xml import, but then it no longer matched the binary stream import. So, .xlsb imported the opposite of what .xlsx/.xlsm imported. Change-Id: I2da3967ef52187e4ef36ce7d01b17a4672f61e1c Reviewed-on: https://gerrit.libreoffice.org/37952 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2017-05-23Unit test for COUNTBLANK with array of references, tdf#58874Eike Rathke
Change-Id: I44c4db675b822c0456197bf019783076cb7a4b78
2017-05-23drop the SCsROW/SCsCOL/SCsTAB typedefsNoel Grandin
which are exactly the same as the regular SCROW/etc typedefs, and have been this way since commit 43a21999a92c99867bc3417291719996776b0647 Author: Oliver Bolte <obo@openoffice.org> Date: Fri Jun 4 09:00:39 2004 +0000 INTEGRATION: CWS rowlimit (1.1.2); FILE ADDED Change-Id: Ia7f75d71227ca3167b5fd56019bb9bdf0697d1b0 Reviewed-on: https://gerrit.libreoffice.org/37911 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
2017-05-22Unit tests for ...,ref1,arrayofrefs,ref2) to result array, tdf#58874Eike Rathke
Change-Id: I21e98ccd6c13c7e4aa98d5bbdd0dab6d9917a3dc
2017-05-22Unit test for SUBTOTAL STDEV with array of references, tdf#58874Eike Rathke
Change-Id: I27d8a0a3c03012a4575785feb32df11a76d6fcdb
2017-05-22Unit test for SUBTOTAL AVERAGE with array of references, tdf#58874Eike Rathke
To test the count vector as well. Change-Id: Idc6bcdc779ea0e6e8a6118934fd8e7856eba1518
2017-05-22Unit test for SUBTOTAL MIN,MAX with array of references, tdf#58874Eike Rathke
Change-Id: I116b236066f28e3442f644544e789e1dbc2ff88a
2017-05-22Add unit test for SUBTOTAL over reference list in array context, tdf#58874Eike Rathke
Change-Id: I82752c035f6551d3136dc06331ff8745ba959463
2017-05-22Use SetValue() instead of SetString()Eike Rathke
Change-Id: I9d1f9be14d69006126a2c72b7c4cfbfb24b3cfe8