Commit Graph

169 Commits

Author SHA1 Message Date
Eike Rathke
40b1e8266e eliminate false failure warning
Change-Id: I86a1110c50ace958a68a6971aec34ec632b91c93
2015-02-11 00:05:00 +01:00
Julien Nabet
6cafd3e80c std::remove_if not used
Change-Id: I363ac477d364a1b428ebe5181973ff28dc3f4a77
2014-12-28 20:40:42 +01:00
Brij Mohan Lal Srivastava
d32be3ace8 fdo#86023 - O[U]String needs a 'clear' method
Added clear() method to OString and OUString class, Updated appropriate call-sites.

Change-Id: I0ba97fa6dc7af3e31b605953089a4e8e9c3e61ac
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
2014-11-14 09:20:38 +01:00
Stephan Bergmann
2e363d1135 Remove ScToken from the formula::FormulaToken hierarchy
...to keep UBSan from complaining about illegal downcasts from FormulaToken to
ScToken (which were practically harmless, given that ScToken did not add any
data members).

Change-Id: I8fdc026eec363442cc4b720b71d65c972b4a4446
2014-10-23 09:30:10 +02:00
Stephan Bergmann
19d2f42119 Make ScToken::GetSingleRef etc. return * instead of &
...so that default implementations can return nullptr without further ado

Change-Id: Idc8778fe868efa00b1de597a54aa07a2e6fa3bc0
2014-10-23 09:30:09 +02:00
Noel Grandin
fc04f76336 fdo#82577: Handle Time
Put the TOOLS Time class in the tools namespace. Avoids clash with the X11
Time typedef.

Change-Id: Iac57d5aef35e81ace1ee0d5e6d76cb278f8ad866
Reviewed-on: https://gerrit.libreoffice.org/11684
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-10-01 07:34:23 +00:00
Stephan Bergmann
89c72084b2 sc: std::auto_ptr -> std::unique_ptr
Change-Id: I25468d578de597ff9aeba3ffc850c630fa532767
2014-09-30 17:51:30 +02:00
Noel Grandin
827c46e7d7 fdo#82577: Handle Window
Put the VCL Window class in the vcl namespace. Avoids clash with the X11
Window typedef.

Change-Id: Ib1beb7ab4ad75562a42aeb252732a073d25eff1a
2014-09-23 14:11:39 +03:00
Noel Grandin
5bce329040 SfxHint: convert home-grown RTTI to normal C++ RTTI
Also note that I fixed a bug in SvxFontMenuControl::Notify
where the if statement had the check the wrong way around.

Change-Id: I611e8929c65818191e36bd80f2b985820ada4411
Reviewed-on: https://gerrit.libreoffice.org/11147
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
2014-09-06 15:47:44 -05:00
Norbert Thiebaud
d92aa2f445 remove SFX_APP() macro that was a mer wrapper for SfxGetApp()
Change-Id: I480a789c767dd671775c9d70d96bf71908f21f5b
2014-06-27 17:08:04 +02:00
Markus Mohrhard
37e6631cc5 remove whitespace
Change-Id: Ib15413e73409cc33de01fa92a47b9d1237cfc4b2
2014-06-25 05:41:10 +02:00
Noel Grandin
e2080e70fe new compilerplugin returnbyref
Find places where we are returning a pointer to something, where we can
be returning a reference.
e.g.
   class A {
     struct X x;
     public X* getX() { return &x; }
   }
which can be:
     public X& getX() { return x; }

Change-Id: I796fd23fd36a18aedf6e36bc28f8fab4f518c6c7
2014-06-24 11:34:21 +02:00
Noel Grandin
3e82897353 improve the inlinesimplememberfunctions clang plugin
Change-Id: I6d5a952901648e01904ef5c37f953c517304d31e
2014-06-17 10:55:17 +02:00
Kohei Yoshida
3dcfb9a892 Cache table entry may be null. Let's not assume it's always non-null.
This is done intentionally because we do need correct table index when
resolving external reference. This requires we do need to allocate array
with the same sheet size as the remote document.  But we don't allocate
Table instances for remote sheets that we don't reference, to save
memory.

Change-Id: I27fb6228f0e4558327aa4a04a6bccce8d2f1085f
2014-06-16 10:49:01 -04:00
Noel Grandin
184a00b962 loplugin: inlinesimplememberfunctions
Change-Id: I42119f656ca528286fb25d2d36c0af54b7d04a6b
2014-06-09 10:10:13 +02:00
Peter Senna Tschudin
3b24dcc8a8 Remove unnecessary semicolons
A simplified version of the semantic match that finds this problem is
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r1@
statement S;
position p,p1;
@@
S@p1;@p

@script:python r2@
p << r1.p;
p1 << r1.p1;
@@
if p[0].line != p1[0].line_end:
    cocci.include_match(False)
@@
position r1.p;
@@
-;@p
// </smpl>

Change-Id: Ib9708d37fbb4c6060f88d5dae3814a2d37b2091e
Reviewed-on: https://gerrit.libreoffice.org/9493
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-05-27 01:19:00 -05:00
Tor Lillqvist
51a211ca19 WaE: overriding virtual function declaration not marked 'SAL_OVERRIDE'
Change-Id: I9251488743ec3801367600455ef9a22ad876d2d3
2014-05-21 22:12:02 +03:00
Kohei Yoshida
50454f3822 cp#1000072: Skip styles import for external link cache documents.
This reduces external link update time by 10%.

Change-Id: Ic14d9ea7530818f839330a2004f6aa67ef1e831e
2014-05-21 13:25:37 -04:00
Kohei Yoshida
84db495da0 Let's not use ScDocument as a convenient "anything goes" storage place.
Change-Id: I0ae2f44b89b0db915e78a9b07835000e843d016f
2014-05-21 13:25:29 -04:00
Kohei Yoshida
8d5d877dc9 cp#1000072: Populate cache tables when updating all external links.
This way, even after the loaded doc shells get purged due to timeout,
we won't reload those external documents from disk again.  One caveat
is that we currently don't pre-populate empty cells even if they are
referenced by the host document.

Change-Id: I1de2987836bf2fc5d9d7044b406fb99faa534164
2014-05-21 13:25:24 -04:00
Kohei Yoshida
65d026f39c cp#1000072: Purge one document shell at a time, to avoid freeze.
Import especially when we have a whole bunch of large-ish documents open
in the background.

Change-Id: I614e6daab3481c09dae47c8407497d77aec40480
2014-05-21 13:25:22 -04:00
Kohei Yoshida
c28aadc7fc cp#1000072: Stop the external doc shell timer while mass-updating.
To prevent collision with the timer wanting to purge the doc cache
while updating external links.

Also, show progress bar, and make the timer interval and the document
cache life span longer.

Change-Id: I325984c8fa68425a2621cf8f9c016463291afc89
2014-05-21 13:25:20 -04:00
Kohei Yoshida
1b243b14e9 cp#1000072: Load external documents when refreshing caches.
Rather than just clearing the existing caches and loading the external
documents on demand as the formula cells gets re-calculated.  This has two
advantages: 1) when the loading itself fails, we can keep the existing cache
rather than turning all affected cells to error cells, and 2) this prevents
on-demand loading after the external linkes get refreshed, which can make
scrolling very slow & painful.

Change-Id: Ie8243f6f94c5e477964413ab83f6b4b746fe3220
2014-05-21 13:25:19 -04:00
Thomas Arnhold
2bac61013e fix-includes.pl: sc
Change-Id: Iade3fedac5d2f8e978b7dd9c30f001d7d1564946
2014-05-11 01:55:39 +02:00
Markus Mohrhard
c4c51709ea whitespace cleanup in sc
Change-Id: Id1dcadcac179c52977e48a6912ce4d5fd542f60c
2014-04-06 17:19:54 +02:00
Eike Rathke
a45fde7235 justify range to prevent negative tab span and memory alloc, rhbz#1057741
I could not reproduce the crash of that bug (probably having more memory
available), but the backtrace had nTabSpan = -2 implicitly casted to
size_t leading to allocation of a huge amount of memory with
vector::reserve(), which ScRange::Justify() exactly prevents.

Change-Id: Idb79e1be62649922ba793cab01e00011479fade9
2014-03-17 13:57:53 +01:00
Alexander Wilms
84862db95a Remove visual noise from sc
Conflicts:
	sc/source/ui/inc/docfunc.hxx

Change-Id: I9314437ed3dd60e84d28c08ac0a2d1ed7bd1daf8
Reviewed-on: https://gerrit.libreoffice.org/8301
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-03-03 11:04:44 -06:00
Caolán McNamara
477a294e1d coverity#1187830 Uncaught exception
Change-Id: I137af778b9b494c764071e3ae0b8010f080ef936
2014-03-02 20:08:25 +00:00
Alexander Wilms
0ce0c369aa Remove unneccessary comments
Change-Id: I939160ae72fecbe3d4a60ce755730bd4c38497fb
Reviewed-on: https://gerrit.libreoffice.org/8182
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-23 03:38:49 +00:00
Kohei Yoshida
2bcd18892f fdo#72041: Intern strings in the external ref cache with the host document.
To ensure that string comparison with those from the external ref cache
works correctly in functions such as VLOOKUP.

Change-Id: Ib5a466cb6c4b26439abe61b0c17406fc8139f6c0
2014-02-20 16:09:01 -05:00
Andras Timar
ac6e8ac7e4 typo fixes in comments
Change-Id: Idd49478d59cd062118fbf8e99d1c8bc5250013fc
2014-02-06 23:22:30 +01:00
Eike Rathke
3b614521b6 resolved fdo#73522 always create LinkManager if it doesn't exist yet
Regression introduced with 8fde288523
Crash happened under ScExternalRefManager::maybeLinkExternalFile()
pLinkMgr->InsertFileLink(). ScDocument::GetLinkManager() introduced
GetDocLinkManager().getLinkManager(bAutoCalc) leading to the LinkManager
being created only if bAutoCalc is set, which may not be the case during
file import. Changed to unconditionally create the LinkManager again so
the link can actually be inserted. Whatever the intention was, that
needs rework.

Change-Id: I2ae66ac7f62c3cfd92c5bf1a147feb06b0155275
2014-01-14 12:52:27 +01:00
Douglas Mencken
bc8f614ad8 Do not use C++11 std::vector.data(), use an alternative instead
Note that there is no need to check for empty(), because
matrix is always initialized with all empty elements in this code.

Change-Id: If05b3b12d7209b99fcbb09f7c97e74476fb9ce06
Reviewed-on: https://gerrit.libreoffice.org/7098
Reviewed-by: Kohei Yoshida <libreoffice@kohei.us>
Tested-by: Kohei Yoshida <libreoffice@kohei.us>
2013-12-16 19:10:57 +00:00
Kohei Yoshida
eeb91d8f57 Handle external reference bits too. This is the last missing piece.
Change-Id: Ib1dd18bb5a8d70c53722ac91e2340d05bbc7798a
2013-11-18 17:25:41 -05:00
Kohei Yoshida
d8fe172ea0 Remove mutexes from external ref manager.
Change-Id: I4857bb3a1804d4cd53c3e25a7586bd68ab95a202
2013-11-11 16:17:29 -05:00
Kohei Yoshida
35a5999247 Guard cache access with mutex & a new method just to check for range name.
Change-Id: Id24b5ba72362f9d878b4878c1e807bed3e596b20
2013-11-06 20:40:25 -05:00
Kohei Yoshida
719c3fb46b Add mutex for external source document meta-data container.
These get updated from reference parser code (ScAddress, ScRange etc)
which may be run from multiple threads.

Change-Id: I5a1aaa4b51d9b9fb032458eb5e89f0652887184e
2013-11-06 20:40:25 -05:00
Kohei Yoshida
7d2619c9ad Set mutex for external ref cache content.
Change-Id: Id00c0e553e08740df8d9b7eef19407e1b0d3f022
2013-11-06 20:40:24 -05:00
Noel Grandin
5285beeaa4 remove redundant calls to OUString constructor in if expression
Convert code like:
  if( aStr == OUString("xxxx") )
to this:
  if( aStr == "xxxx" )

Change-Id: I8d201f048477731eff590fb988259ef0935c080c
2013-11-04 10:11:08 +02:00
Noel Grandin
bc3b7ca3c7 convert remaining String in SC to OUString
Change-Id: I3ee8c3b59bf9d6ef6516f1da64cbe5f0b35af2d0
2013-10-18 09:59:26 +02:00
Stephan Bergmann
d58d1719a4 Unused ScExternalRefCache::mrStrPool
Change-Id: Idc9d05cae6ebee4c5f88dbe53ab182da66781582
2013-10-11 18:40:10 +02:00
Kohei Yoshida
7333881bb7 Formula tokens, formula cells and formula interpreters to use shared strings.
Change-Id: I5da99869fc7f61ce698180fa5daa9be9db9ac132
2013-10-11 12:14:27 -04:00
Kohei Yoshida
7c6848845f Properly intern strings going into matrix objects.
Change-Id: Ieb8befa4f19ebc31f4afa1370c924b469aa77382
2013-10-11 12:14:26 -04:00
Kohei Yoshida
658fc68d57 Store svl::SharedString in document cell storage instead of OUString.
With this, both ScColumn and ScMatrix store svl::SharedString as their
string values, instead of OUString.

Change-Id: I3faece94d98f774881fd72b3ed5f6143504cd350
2013-10-08 15:48:10 -04:00
Noel Grandin
d872c9e8a2 convert sc/source/ui/docshell/*.cxx from String to OUString
Change-Id: I0f2cada87bfa7b59cfcfdd8cf9bc876dd1395654
2013-10-08 10:03:12 +02:00
Noel Grandin
72b9dd277b convert sc/inc/r*.hxx from String to OUString
Change-Id: Iaae69c0914917d9d5851f227be28ff5cd098da8b
2013-10-04 09:09:56 +02:00
Noel Grandin
3c38dd9bfe convert sc/inc/externalrefmgr.hxx from String to OUString
Change-Id: I71c755f05eb47e26193ae87cb2f9cd618cfaf13d
2013-09-19 10:14:14 +02:00
Noel Grandin
bf1db6daca convert include/sfx2/linkmgr.hxx from String to OUString
along the way, de-virtual ScDocFunc::InsertAreaLink, since
it only has one implementation.

Change-Id: I3fc836f9954628f154e01b1c7ae8f90eb7600a76
2013-08-29 09:30:06 +02:00
Noel Grandin
4779373d47 convert includes/sfx2/lnkbase.hxx from String to OUString
Change-Id: I3816ec77dd334823100421dab90d4bc8b67542e3
2013-08-29 09:30:05 +02:00
Pierre-Eric Pelloux-Prayer
f243d07019 sc/externalrefmgr: reduce individual cell queries
Change-Id: Ic0dda47f02cd392234876a8945e240bbc915fa6a
Reviewed-on: https://gerrit.libreoffice.org/5453
Reviewed-by: Petr Mladek <pmladek@suse.cz>
Tested-by: Petr Mladek <pmladek@suse.cz>
2013-08-19 16:08:34 +00:00