Commit Graph

319 Commits

Author SHA1 Message Date
Stephan Bergmann
cc7fd44822 loplugin:casttovoid: sc
Change-Id: I1dddf4431ccbcea8a5d89d2849307efba592cae9
2017-07-02 22:30:54 +02:00
Noel Grandin
ac2d415a52 loplugin:oncevar in sc
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-26 10:57:03 +02:00
Kohei Yoshida
a078328e91 tdf#107945: prepare for future multi-threading of pivot cache...
It's disabled for now. We need to first make the edit engine and
a few other places thread-safe before we can parallelize this code.

Change-Id: Ie09536964ece42d43f505afc5e2611d469cc5c95
Reviewed-on: https://gerrit.libreoffice.org/38424
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Kohei Yoshida <libreoffice@kohei.us>
2017-06-06 05:00:33 +02:00
Kohei Yoshida
5ecb3f4625 tdf#107945: store rtl_uString pointers instead of heap OUString objects.
Change-Id: I61079e041a79195f9e9cb77ce80368ef7e909cef
Reviewed-on: https://gerrit.libreoffice.org/38288
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Kohei Yoshida <libreoffice@kohei.us>
2017-06-01 15:32:00 +02:00
Noel Grandin
ed5abacda9 drop the SCsROW/SCsCOL/SCsTAB typedefs
which are exactly the same as the regular SCROW/etc typedefs, and have
been this way since
    commit 43a21999a9
    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-23 11:20:43 +02:00
Stephan Bergmann
dc4704ce1b loplugin:stringcopy: sc
Change-Id: Ic6cb5406d20e7e07b8e34514df71adf1c3a4e727
2017-05-19 17:17:29 +02:00
Noel Grandin
95ceaa5c55 loplugin:checkunusedparams in sc(part2)
Change-Id: I1d54d16dbe5648a21baa9bf96444e60fcd034c81
Reviewed-on: https://gerrit.libreoffice.org/37457
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-10 12:13:31 +02:00
Stephan Bergmann
93c0b1f5da Improved loplugin:redundantcast, static_cast on arithmetic types: sc
Change-Id: Id56d3e3d7c4485e24dc8fe6349631837101e86fe
2017-04-06 18:31:44 +02:00
Noel Grandin
fcad02149f use actual UNO enums in sc
Change-Id: I51dbe623178e3c463dc4c941f23edac04fbfe349
Reviewed-on: https://gerrit.libreoffice.org/35968
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-03 06:22:40 +00:00
Miklos Vajna
a5a571307f tdf#82580 tools: rename Rectangle to tools::Rectangle
Mostly generated using

make check COMPILER_EXTERNAL_TOOL=1 CCACHE_PREFIX=clang-rename-wrapper RENAME_ARGS="-qualified-name=Rectangle -new-name=tools::Rectangle"

Except some modules have their own foo::tools namespace, so there have
to use ::tools::Rectangle. This commit just moves the class from the
global namespace, it does not update pre/postwin.h yet.

Change-Id: I42b2de3c6f769fcf28cfe086f98eb31e42a305f2
Reviewed-on: https://gerrit.libreoffice.org/35923
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2017-03-31 06:27:11 +00:00
Noel Grandin
c9da7f6bfe introduce ScGeneralFunction scoped enum
to abstract over css::sheet::GeneralFunction and
css::sheet::GeneralFunction2

Change-Id: I4d4df35a249bf66e12240a3b94948918f1f3ef8a
Reviewed-on: https://gerrit.libreoffice.org/35168
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-15 10:29:31 +00:00
Tomaž Vajngerl
d4c09a4e37 sc: simplify GetByName, FreeTable methods of DPCollection + test
Simplify DPCollection GetByName and FreeTable by using c++11
features. Change GetByName to return non-const ScDPObject as this
is more useful (as operator[] does that already anyway).

Change-Id: Ia502c615acc5cb7fdc51acea9b428d04e1c9a40f
Reviewed-on: https://gerrit.libreoffice.org/34002
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2017-02-12 09:13:19 +00:00
Stephan Bergmann
6dce9c6757 Add missing #includes
...and remove some unncessary using directives/declarations, in preparation of
removing now-unnecessary #includes from cppumaker-generated files, post
e57ca02849 "Remove dynamic exception
specifications".

Change-Id: Iaf1f268871e2ee1d1c76cf90f03557527ebc9067
2017-02-06 17:21:16 +01:00
Julien Nabet
1bdef25291 Typo: FindIntersetingTableByColumns->FindIntersectingTableByColumns
Change-Id: I74456399bde6075c9b3813d6c0ffe98fe1afbe3a
Reviewed-on: https://gerrit.libreoffice.org/33905
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-02-04 07:09:51 +00:00
Noel Grandin
998f635fb4 convert subtotalfuncs from manual array to std::vector
Change-Id: I6af7e8c8d001c92edd364aa32224da1e4e1d1d9b
2017-01-17 08:49:36 +02:00
Tamás Zolnai
9dd7999a48 Revert "PivotTable: Avoid adding useless 'Data' column field to table layout"
This reverts commit ad86820a2b.
2017-01-09 13:47:21 +01:00
Tamás Zolnai
ad86820a2b PivotTable: Avoid adding useless 'Data' column field to table layout
Layout dialog adds this column field by default, but it has
no actual meaning or functionality. It must be added because
of this broken logic here (adding a field only when its hidden?).
This 'Data' field must be related to OOXML format see
OOX_PT_DATALAYOUTFIELD, but might be deprecated actually.

Change-Id: I90f00ef6290b343f84e40e5c94fd0e29a328329b
2017-01-08 07:10:48 +01:00
Tamás Zolnai
5b7b2c8649 GeneralFunction is not an enum anymore
Change-Id: Iaf34d31947fc1b85a42c8924561b756d92873be7
Reviewed-on: https://gerrit.libreoffice.org/31103
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2016-11-23 03:47:05 +00:00
Tamás Zolnai
c0d4aadf08 [API Change]: Create new GeneralFunction2 for adding median
New functionality added to pivot table became fully
broken with Eike's revertion:
5024430950
This commit fixes this problem.

Change-Id: I67cfc63305bb9b2edeed2abd26d729fbf650579f
Reviewed-on: https://gerrit.libreoffice.org/31096
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2016-11-23 02:46:17 +00:00
Noel Grandin
bb674aa550 loplugin:unusedfields
Change-Id: Id2dbbf384637223db3d334d95332251832918003
Reviewed-on: https://gerrit.libreoffice.org/30927
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-17 13:10:42 +00:00
Kohei Yoshida
8ce6e2e8bc Dump the state of the "save" data as well.
The "save" data is basically a section of the pivot table data that
needs to be saved to the file.

Change-Id: I2589c0fcd6df2458d35397b358064645fd97687f
2016-11-12 21:36:25 -05:00
Kohei Yoshida
e8ccf9a2e3 Let's hook up the pivot table dumper code to Ctrl-Shift-F8 as well.
It dumps the pivot data if the cursor is over a pivot table output,
else it dumps the column storage info.

Change-Id: I403e381be3f64d139f8bfaca7e477742a65dde9c
2016-11-12 21:36:25 -05:00
Tamás Zolnai
03a1143cc7 tdf#102694, bnc#957991: Improve pivot cache reading performance
When two or more tables have the same source data, then
the grouping of source fields are shared between these
tables, so don't need to import these grouping for each
tables.
The added code checkes whether we already imported the
group fields and don't create them again using API
functions, but apply the exisiting groups of an other table
sharing the source.

Change-Id: Iad6be9a9e30944ab9a241c8498eff95c6c356689
2016-10-09 20:20:59 +02:00
Tamás Zolnai
7e1fd9aa86 Pivot tables: Fix wrong group field number in cache
getCache should not append new group fields to the cache,
but use those which are stored in the dimension data.

Change-Id: I2011b0d3a22644a86c31500d74469b9c4c641649
2016-10-05 06:03:41 +02:00
Tamás Zolnai
b905116dc4 This parameter can be const.
Change-Id: Ia77b9bebb0653ce5d428956b4d2fca39461bb7c2
2016-09-27 06:36:08 +02:00
Tamás Zolnai
3b64a19856 bnc#957991: Improve pivot cache reading performance
Performance problem was caused by grouping. Pivot
tables with the same source are linked to each other
by the pivot cache and so all the pivot tables were
updated when one group was added to one of the tables.

This code change first of all fixes a functional issue:
group name was wrongly imported and so pivot tables using
group fields were broken. This caused by calling
RefreshPivotTableGroups() on a pivot table which is not part
of the cache yet and so update was not called on this table.
Calling ReloadGroupTableData() solve this problem.

Second part of the codechange is about the consistency
of the pivot cache. We have an invariant in this code to
have the same groups for tabels with the same source.
To keep this invariant we update every newly inserted
tables adding the neccessary groups.
The performance improvement here is that until the table
is not part of the cache, it does not updates other tables.
Group syncronization is done when the table is inserted to
the ScDPCollection.

Change-Id: Iaff55ffa3ed9c9b48cb18bd150eb4e1f7b617353
2016-09-27 05:26:02 +02:00
Tamás Zolnai
94782edef3 Fix build with DEBUG_PIVOT_TABLE macro
Change-Id: Ia2e38469ab8df268c6e03d77cae76e16e454ad76
2016-09-17 06:38:58 +02:00
Noel Grandin
508c95f1b6 improve passstuffbyref return analysis
Change-Id: I4258bcc97273d8bb7a8c4879fac02a427f76e18c
Reviewed-on: https://gerrit.libreoffice.org/27317
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-07-27 06:48:25 +00:00
Eike Rathke
194cea2898 coverity#1362685 Uninitialized scalar variable (UNINIT)
Change-Id: I5da1a04d2fce6583fad0934d06dcba452181f256
2016-06-13 10:17:14 +02:00
Eike Rathke
f88f6bcfce Resolves: tdf#35247 introduce a locale independent numeric field filter
... that tries to match a locale independent query string.

Going via string queries is likely only necessary for the ugly
alternative "fieldname[member]" syntax, if it is actually unnecessary
for the field1,item1,... syntax needs to be evaluated and if so a
distinct GetPivotData() function evaluating numeric contraints as well
could be introduced.

Change-Id: I2c1fc81c1022b0bba5eef8d86c0c815bb6e31f2d
Reviewed-on: https://gerrit.libreoffice.org/25975
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
2016-06-06 20:22:12 +00:00
Noel Grandin
233df63c54 Convert SC_MF to scoped enum
Change-Id: I3089006b502e33710bfb2564f051ebf2892ad08a
Reviewed-on: https://gerrit.libreoffice.org/25085
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-25 09:12:04 +00:00
Noel Grandin
2bc173abb6 convert PIVOT_FUNC to scoped enum
Change-Id: I6d50ad6fa0dbe7b21ad73e14dc2df3c854d08153
Reviewed-on: https://gerrit.libreoffice.org/25076
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
2016-05-24 13:14:25 +00:00
Noel Grandin
58a32075ca use Any constructor instead of temporaries
Change-Id: Iffb82a2cee1a28d89eeea2b905aaa14086ee475a
2016-05-04 12:39:40 +02:00
Noel Grandin
d1f6f79d0d loplugin:passstuffbyref in sc
Change-Id: I75c483972db787ea9c941eaac0df023f1929b09c
2016-04-14 09:21:40 +02:00
Noel Grandin
374b69716d sequence->vector in sc
Change-Id: I3edf08fe5db798dbc1190db375cfb82c5b9bc5da
Reviewed-on: https://gerrit.libreoffice.org/23696
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
2016-03-31 15:18:55 +00:00
Noel Grandin
6439005484 use SAL_N_ELEMENTS more widely
found using
   git grep -n 'sizeof.*/.*sizeof.*[0]'

Change-Id: Icd4a6cc1ca8ec8ebd68e1701a02789c74cf0eb2a
2016-03-31 11:30:36 +02:00
Noel Grandin
26012ae8f6 loplugin:constantparam in sc
Change-Id: I437367b8c6960db730a69c020ba82792a9170d01
2016-03-23 09:13:14 +02:00
Noel Grandin
fecfd9c498 loplugin:unuseddefaultparams in sc (part2)
Change-Id: I356a86bfca20cbf2c52185697042dce5237e847d
2016-03-03 08:11:02 +02:00
Noel Grandin
098462c6f6 loplugin:unusedmethods unused return value in sc
Change-Id: I3ccc98d2e042120093e2e8508518681588692393
2016-01-15 09:36:42 +02:00
Stephan Bergmann
00c62e306f loplugin:privatebase: Publicly derive from binary_/unary_function
Somewhat arbitrarily prefer public over private derivation; ultimately,
derivation from those deprecated (C++11)/removed (C++17) classes should be
removed, anyway.

Change-Id: I5ed24427d37586e72f8c16509cf5002a54af73f1
2016-01-11 13:17:08 +01:00
Michael Meeks
c1aca00860 Fix pivot cache debugging.
Change-Id: I79facae1159f878092a47560bb1c4488842fcc0a
Reviewed-on: https://gerrit.libreoffice.org/20811
Reviewed-by: Kohei Yoshida <libreoffice@kohei.us>
Tested-by: Kohei Yoshida <libreoffice@kohei.us>
2015-12-19 00:00:04 +00:00
Michael Stahl
def6b1dd14 sc: replace boost::ptr_map with std::map<std::unique_ptr>
Change-Id: Ia9d061d9f5fb07e07fd6253a6493a4e9b1f9c975
2015-12-18 17:21:29 +01:00
Michael Stahl
91f571a2d6 sc: replace boost::ptr_map with std::map<std::unique_ptr>
Change-Id: I5abc1d6fae7186342e45a83253d56c2311ec5139
2015-12-18 17:21:28 +01:00
Michael Stahl
8795dff919 sc: replace boost::ptr_map with std::map<std::unique_ptr>
Change-Id: Iaaf8e5f14691cde32058a78842b9c411f2b92d93
2015-12-18 17:21:28 +01:00
Noel Grandin
343ec4b723 sc: boost::ptr_vector->std::vector<std::unique_ptr>
Change-Id: I21fdb9f503241c2fa38f3de059a1f674a6631c78
2015-11-13 10:54:20 +02:00
Noel Grandin
601fd58cc3 sc: boost::ptr_vector->std::vector<std::unique_ptr>
Change-Id: Ie152e03e6219495683ebc50d916406fff0e54b6d
2015-11-13 10:54:19 +02:00
Stephan Bergmann
de29ac0953 loplugin:nullptr (automatic rewrite)
Change-Id: I765d2a600f9c57da50c85354688e3ae796750d94
2015-11-10 10:31:36 +01:00
Stephan Bergmann
e53db9461e loplugin:stringconstant: elide explicit ctor usage (automatic rewrite)
Change-Id: Ief66447f04245b8ab0a4acbf097eb7283529d45d
2015-11-06 09:36:49 +01:00
Noel Grandin
0eb9f56db5 use uno::Reference::set method instead of assignment
Change-Id: I2b592fd3327f4bbe4685e84711dc9d6f19222a97
2015-11-05 07:41:29 +02:00
Noel Grandin
be91a4725d loplugin:stringconstant
Change-Id: I9d3b60bb9f0d8c09968e2be1035fb8e654ac9c95
Reviewed-on: https://gerrit.libreoffice.org/19769
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-11-04 08:01:56 +00:00