summaryrefslogtreecommitdiff
path: root/sc
AgeCommit message (Collapse)AuthorFilesLines
2018-01-24[Pardus] tdf#108989 Add contextual validity command.Gulsah Kose8-1/+40
When cursor is in a cell has following validity attributes SC_VALID_WHOLE, SC_VALID_DECIMAL, SC_VALID_DATE, SC_VALID_TIME,SC_VALID_TEXTLEN, SC_VALID_LIST, SC_VALID_CUSTOM, Validity command appears on context menu. This patch is sponsored by ULAKBIM/Pardus project. Change-Id: I47c0de7b62befdf02c343c1419cf32441d8f4df2 Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/48067 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Heiko Tietze <tietze.heiko@gmail.com> Tested-by: Heiko Tietze <tietze.heiko@gmail.com>
2018-01-24loplugin:constparamsNoel Grandin8-16/+16
Change-Id: I7c695073d9a9d3b7a641d6eb9fe01a47d8c3a504 Reviewed-on: https://gerrit.libreoffice.org/48392 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-24loplugin:unused-returns in vclNoel Grandin2-10/+8
Change-Id: I507320900a47f604d17ed7d402d531a7cbdf744e Reviewed-on: https://gerrit.libreoffice.org/48331 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-24tdf#115093 : Do not reuse singleref tokens...Dennis Francis2-3/+36
...in formula group computation if the formula contains only a single reference besides any ocOpen/ocClose pairs wrapping it as the sole content. In such a case the "result" formula token returned by ScInterpreter::GetResultToken() is the same as the original singleref token, so for each row of the formulagroup, we need to use a separate singleref token. Also added a unit test in sc/qa/unit/parallelism.cxx Change-Id: I6032efc5be9b51ca1e9daf9bdd19997a949d2f43 Reviewed-on: https://gerrit.libreoffice.org/48449 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Jenkins <ci@libreoffice.org>
2018-01-23Use a more conventional way of clearing ScRange variablesStephan Bergmann1-5/+3
...to avoid upcoming GCC 8 -Werror=class-memaccess ("clearing an object of type ‘class ScRange’ with no trivial copy-assignment") Change-Id: I2178697082b1c284d26cedaa64c73b92d9e6aecb Reviewed-on: https://gerrit.libreoffice.org/48393 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-23offapi: Add properties FormulaResultType2 and CellContentTypeJens Carl4-6/+51
Add two new properties to SheetCell.idl "FormulaResultType2" and "CellContentType", because the "FormulaResultType" is returning the wrong value (com::sun::star::table::CellContentType instead of com::sun::star::sheet::FormulaResult). Also documeted the curiosity. Change-Id: Icc6538e155ba27fb9d097d8790ac9b4b230c1446 Reviewed-on: https://gerrit.libreoffice.org/48367 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jens Carl <j.carl43@gmx.de>
2018-01-23Fix typosAndrea Gelmini1-1/+1
Change-Id: I17e617d89d1b5ad92c5c8218958e86ca722b13e2 Reviewed-on: https://gerrit.libreoffice.org/48435 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2018-01-23Flatten ScRangePairList::Join() recursionEike Rathke1-35/+41
Similar to ScRangeList::Join() done before. Change-Id: Ie513b4c72bc211c196e13761b63446174321a389 Reviewed-on: https://gerrit.libreoffice.org/48361 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2018-01-23Flatten ScRangeList::Join() recursionEike Rathke1-39/+47
Joining an existing list of identical ranges could end up in a very deep (but not infinite) recursion which could lead to stack exhaustion. Recursion is unnecessary if we re-enter the loop with the picked range. Continuing the loop as it was done after recursion isn't necessary either, to the contrary, as long as there is one join try the entire list again. Commit f6eefd96cb16a9b5607fe59bdbf9b1121c9b56e8 pointed this out as the UBSan build runs with ulimit -s 8192 Change-Id: Ibbc542fc8ae6d1509744aa731771eb6e32a38841 Reviewed-on: https://gerrit.libreoffice.org/48360 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2018-01-23new loplugin: pointerboolNoel Grandin5-8/+8
look for possibly bogus implicit conversions to bool when passing (normally pointer) args to bool params. this plugin comes in the wake of a couple of bugs caused by refactoring, where some of the call sites were not currently updated. Of the changes, the following are real bugs: desktop/../dp_persmap.cxx StartInputFieldDlg in sw/../fldmgr.cxx which occurred as a result of commit 39d719a80d8c87856c84e3ecd569d45fa6f8a30e Date: Tue May 3 11:39:37 2016 +0200 tdf#99529 sw: don't pop up input field dialog before inserting field CSerializationURLEncoded::encode_and_append in forms/../serialization_urlencoded.cxx XclExpCFImpl::XclExpCFImpl in sc/../xecontent.cxx I have no idea how to properly fix this, just made a guess. SwDocTest::test64kPageDescs in sw/qa/core/uwriter.cxx which looks like a simple copy/paste error. Change-Id: I795ebd5ef485a1d36863dc27fe13832989f5a441 Reviewed-on: https://gerrit.libreoffice.org/48291 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-23USHRT_MAX -> SAL_MAX_UINT16Stephan Bergmann1-12/+6
...that had presumably been forgotten when the surrounding code had been changed from USHORT to sal_uInt16 in cd42389ad67b403a07a0dda8e2a6e213def49251 "removetooltypes01: #i112600# remove tooltypes from sc". Plus, turning the preprocessor checks into static_asserts. Change-Id: I78271f7027af701699865913813d6dea8b0c570b Reviewed-on: https://gerrit.libreoffice.org/48358 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-23tdf#98931 Consider cell-anchored images when sortingSamuel Mehrbrodt12-19/+180
This makes images/draw objects anchored to cells move as any other content when sorting cells. Works for sorting rows and columns. Also fixes a bug where notes attached to cells were not sorted when sorting columns. Change-Id: Id9a56a15f776d5adbe382a9bca167bff48b69a0c Reviewed-on: https://gerrit.libreoffice.org/46838 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2018-01-22gbuild: always compile as C++17 with MSVC 2017Michael Stahl1-0/+7
The current update MSVC 2017.5 supports fancy new C++ features, but unfortunately in its default C++14 mode it falls over and dies with an internal compiler error as soon as it sees the WeakImplHelper variadic template. In order to work around the ICE, build everything as C++17, which somehow doesn't crash. This causes loads of deprecation warnings about obsolete std::this and badly designed std::that, almost all of them from boost headers, which are well known for following every best practice in the C++ book. Liberally sprinkle macros around to suppress the warnings for now, like we already do with the other million warnings from boost headers. Change-Id: Ia6b6ef5e457b5fe3c8cfe361ba5da39376bb7c4c Reviewed-on: https://gerrit.libreoffice.org/48225 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2018-01-22StartExecuteAsync doesn't need a second paramNoel Grandin1-1/+1
we can just use this to store a keep-alive reference in AsyncContext Change-Id: I0152aef5386aa9753b48afdfc958790f10d13560 Reviewed-on: https://gerrit.libreoffice.org/48294 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jenkins <ci@libreoffice.org>
2018-01-22sc: std::iterator is deprecated in C++17Michael Stahl1-7/+8
Change-Id: I947dcf61e95bdc68d19eab7daca4c31ba8047d5e Reviewed-on: https://gerrit.libreoffice.org/48224 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2018-01-22copy ScAddress before possibly joining itCaolán McNamara2-1/+3
Change-Id: Ib1148584b9771da67d3f4b3141184228e1bbe3a2 Reviewed-on: https://gerrit.libreoffice.org/48271 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-01-21tdf#113572: removed redundant calc serviceVasily Melenchuk1-2/+1
calc service introduced previously in commit 0074951704022d173a5fdb9df933f47be1dcbb91 is not required, interface is enough for feature implementation. Change-Id: I9cf30f2201619465da9061c7ef1e574209062cf9 Reviewed-on: https://gerrit.libreoffice.org/47960 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-01-20Addition of focus_on_click to notebookbar ui filesMaxim Monastirsky4-2/+184
(automatic rewrite) Change-Id: I959b58b3b0b69de9344b0f7188594a19e8b9d4ea Reviewed-on: https://gerrit.libreoffice.org/48176 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
2018-01-20RowInfo copy ctor was presumably killed in errorStephan Bergmann1-0/+1
...by 3c6b7c8b43d23dd7de46c02ee2cfa5bd2a97f168 "loplugin: unnecessary destructor sc" Change-Id: I67868187565cb25b40a6380298deaefca0d76b0b Reviewed-on: https://gerrit.libreoffice.org/48218 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-20tdf#39593 deduplicate code in ScCellShelltagezi1-29/+22
Change-Id: I764edf0c1fb093bf64ea3ea91f98f8586d9549f5 Reviewed-on: https://gerrit.libreoffice.org/47017 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-01-20loplugin:unusedmethodsNoel Grandin2-5/+0
Change-Id: If00b0e659e1818c29ae39b89f8b4f7ea29d14986 Reviewed-on: https://gerrit.libreoffice.org/48185 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-19Don't push error twiceEike Rathke1-3/+4
No harm was done as the stack is cleaned up afterwards, but it's wrong anyway and having to push the result downwards during cleanup is unnecessary. Change-Id: I0b2c153c9791ce5c287d340bac466c19cd6a5703
2018-01-19inline some definesNoel Grandin3-7/+4
which don't add any value anymore Change-Id: I45977d972d4d02926630b749d3ec736416138cf5
2018-01-19new loplugin:emptyifNoel Grandin10-114/+27
Change-Id: I1092115a0ceb3a5e6680a4b724b129f98a892c42 Reviewed-on: https://gerrit.libreoffice.org/48128 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-19Fix typosAndrea Gelmini1-1/+1
Change-Id: Icadf5cb88024b8889d49dc9c5210d0de8deaed3b Reviewed-on: https://gerrit.libreoffice.org/48172 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2018-01-19SfxReqest::Done takes a SfxItemSet& or a boolean, not a SfxItemSet*Caolán McNamara1-3/+1
regression from commit c40dfabd56ade10fe35690dc9810955c2e99e2c0 Date: Fri Jan 12 11:57:22 2018 +0000 Change-Id: Ia97ba286a2da0584a2e806ad7396a3633f9d913e Reviewed-on: https://gerrit.libreoffice.org/48160 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-01-19SAL_W32 is just an alias for _WIN32Stephan Bergmann1-2/+2
...so consistently use the latter instead of the former Change-Id: I144d5e7c472632f93b2258461510346bc85892d9 Reviewed-on: https://gerrit.libreoffice.org/48135 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-18xSheetDoc cannot be null hereStephan Bergmann1-2/+0
...as the UNO_QUERY_THROW above would already have caused an exception Change-Id: Ie0453b67716c64ddaddfa6becd498952a497be63 Reviewed-on: https://gerrit.libreoffice.org/48106 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-18tdf#114720: Fix subtotal crashAhmed GHANMI1-36/+39
A condition was added in order to not make subtotal functions if category was not checked. Change-Id: I56f11330fa16bf0d3199576ce2545cbc8d13e864 Reviewed-on: https://gerrit.libreoffice.org/48099 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2018-01-18Include android/compatibility.hxx from ubiquitous sal/config.hStephan Bergmann3-3/+0
...instead of having to add it to more and more individual .cxx files, as the need arises. Change-Id: If1e893c79abf1c1bb7fb7b89dcb9bd423a7f1b94 Reviewed-on: https://gerrit.libreoffice.org/48108 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-18Don't let testSpreadsheetViewSettingsProperties interfere with existing testsStephan Bergmann1-19/+3
...by giving each test its own mxComponent. At least my Windows builds started to fail CppunitTest_sc_tabviewobj with > C:/lo/core/test/source/sheet/xviewsplitable.cxx:36:sc_apitest::ScTabViewObj::testSplit > equality assertion failed > - Expected: 1 > - Actual : 0 > - Wrong column after 95307f2ca73480176634e5cc46d96a19b735e87b "tdf#45904 Move _SpreadsheetViewSettings Java tests to C++" added the call to testSpreadsheetViewSettingsProperties ahead of the call to testSplit. (And allowing multiple tests to work on shared state and interfere like they apparently do here seems rather brittle in general.) Change-Id: I73a60ae3c703e59852c8e16b09f5897849f5bdf4 Reviewed-on: https://gerrit.libreoffice.org/48070 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-18Fix typosAndrea Gelmini2-2/+2
Change-Id: I633e4921042809c628e55825b70c540767eba1d3 Reviewed-on: https://gerrit.libreoffice.org/48140 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2018-01-18CheckLinkFormulaNeedingCheck() for .xls cell formulasEike Rathke3-0/+3
Change-Id: I2587fbc4fec39b6f2c8e733331815a2953dee308
2018-01-18Fix Android build (missing std::trunc)Stephan Bergmann1-0/+1
...after 110025afab3946586826b18a316416fba41dc1f6 "Odd conversion double -> sal_Int32 -> double" Change-Id: Iaff78e2046261290f8c4ae8bdfcbf1edc5963d87
2018-01-18Odd conversion double -> sal_Int32 -> doubleStephan Bergmann1-1/+3
...which had been introduced into that assignment in ScDataPilotFieldObj::createDateGroup with 7dd50f9ec124f2666dcfd1fd8bb02a1335a360ac "CWS-TOOLING: integrate CWS dr67", but for no documented purpose. So lets assume the truncation is for a reason, and replace it with a call to std::trunc. Change-Id: I2dfd4c0f5966e9ab294ecd5b3424fece2ea70daa Reviewed-on: https://gerrit.libreoffice.org/47995 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Kohei Yoshida <libreoffice@kohei.us>
2018-01-17CheckLinkFormulaNeedingCheck() for .xlsx cell formulasEike Rathke1-0/+4
Change-Id: Ia6dd195f7eb4d43483e87eeca59f651e7bf2dcb8
2018-01-17Move implementation to CheckLinkFormulaNeedingCheck() for further reuseEike Rathke3-2/+13
Change-Id: I541d2b6e12a88371c064b901b00e71206ee0c18e
2018-01-17Fix typosAndrea Gelmini1-1/+1
Change-Id: I6f2822e7068754a1b5e70e401247a36b214147e3 Reviewed-on: https://gerrit.libreoffice.org/48079 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2018-01-17Fix typosAndrea Gelmini5-5/+5
Change-Id: Id1c7ddf6c49ec709e38947a82731fe31a64aad04 Reviewed-on: https://gerrit.libreoffice.org/48076 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2018-01-17coverity#1427628 Dereference before null checkCaolán McNamara1-0/+2
Change-Id: Ic68d765cc21733ba864b78c135eaae4ec673e7c1
2018-01-17Use ROUNDSIG(...,13) to hopefully fix Jenkins lo_callgrind_linux buildsEike Rathke1-285/+134
Since commit b97a0df0f3234b4c1140ba1418d4b96a592afa4a lo_callgrind_linux builds fail (some of) these tests, https://ci.libreoffice.org/job/lo_callgrind_linux/4939/ This is a blind shot in the air, let's see if the bullet lands. Change-Id: I4eb96746b58f24be62a47099887d5785e3bc28d0
2018-01-17loplugin:unnecessaryparen extend to delete statementsNoel Grandin2-3/+3
Change-Id: Ic4383ea948876a26f791f0e5b0110cef978a26e1 Reviewed-on: https://gerrit.libreoffice.org/48027 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-17Misplaced static_castStephan Bergmann1-1/+1
...introduced with 58d863eec084029716eccab7f941727fc650415e "sc: replace local macros" changing from > #define HMM2XL(x) ((x)/26.5)+0.5 [...] > aFrom = Rectangle( nCol-1, static_cast<long>(HMM2XL( nColOff )), [...] to > inline long lcl_hmm2px(long nPixel) > { > return static_cast<long>(nPixel*PIXEL_PER_INCH/1000.0/CM_PER_INCH)+0.5; > } [...] > aFrom = Rectangle( nCol-1, lcl_hmm2px( nColOff ), [...] Change-Id: Ia98d659e494255e5dbb4e9d47d20df121ccdcc44 Reviewed-on: https://gerrit.libreoffice.org/47993 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-16tdf#45904 Move _GlobalSheetSettings Java tests to C++Jens Carl3-0/+200
Change-Id: Icdc30eb65b10a72b66f26c0d55844b8fb433f090 Reviewed-on: https://gerrit.libreoffice.org/47976 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jens Carl <j.carl43@gmx.de>
2018-01-16lokdialog: Don't output anything for the incoming SfxRequest.Jan Holesovsky1-0/+2
Change-Id: I1b216b7348a46835df3c2d307ce17bca64199997 Reviewed-on: https://gerrit.libreoffice.org/47985 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2018-01-16tdf#96821 fix corner cases for Calc function ROUND.Winfried Donkers8-217/+240
For very large integer numbers, e.g. 2^52+1, ROUND produced incorrect results because rtl::math::round uses floor( number + 0.5 + small_correction_value ), which reduces the maximum possible mantissa resolution.a Correction of several unit test documents (Calc functions) with rounding errors that only became apparent with this fix. Change-Id: I1769c9939a3d6118d3bfbfdf8e41dd4619997232 Reviewed-on: https://gerrit.libreoffice.org/47179 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
2018-01-16use more ScopedVclPtr to avoid missing disposeNoel Grandin1-1/+1
follow on to commit 315be3a276b01e88c794da1dbc6252a8b803d269 Author: Caolán McNamara <caolanm@redhat.com> Date: Fri Jan 12 10:48:59 2018 +0000 VclPtr, missing dispose Change-Id: Idfa4709f10928ef6d53ada93db0f5452e5d5c4eb Reviewed-on: https://gerrit.libreoffice.org/47982 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-16Fix typosAndrea Gelmini1-1/+1
Change-Id: Id3d1a07922d4ca05e3bbf61d4b5797a30fc5b23a Reviewed-on: https://gerrit.libreoffice.org/47872 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-01-16Fix typosAndrea Gelmini4-5/+5
Change-Id: I078626eaa3155cc429320cc8c1532003b382b22a Reviewed-on: https://gerrit.libreoffice.org/47855 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-01-16Add ServiceProvider "com.sun.star.sheet.GlobalSheetSettings"Jens Carl2-1/+6
Change-Id: I31a93cd6a7b46f1746aee694668295fabe4fa8fd Reviewed-on: https://gerrit.libreoffice.org/47926 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jens Carl <j.carl43@gmx.de>