diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-04-17 02:02:15 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2014-04-17 09:27:33 +0000 |
commit | 45b959806da456adf3ba3a1e4f08130480ccf89c (patch) | |
tree | f70a46383a0752a9aebd6b1bdd3486baf9a2befb | |
parent | 3adb6f809f19d3132062bed405de5ef4444128a8 (diff) |
limit the range shrinking in charts to really large ranges, fdo#70609,
Also improves the situation for fdo#55697.
It is just the fist step to a better algorithm.
Change-Id: I15de1ca6604e585fcf5690f0d903c757d641e765
Reviewed-on: https://gerrit.libreoffice.org/9078
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r-- | sc/source/ui/unoobj/chart2uno.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index 8754057dc893..093dbbe36d53 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -1372,6 +1372,8 @@ bool lcl_addUpperLeftCornerIfMissing(vector<ScTokenRef>& rRefTokens, return true; } +#define SHRINK_RANGE_THRESHOLD 10000 + class ShrinkRefTokenToDataRange : std::unary_function<ScTokenRef, void> { ScDocument* mpDoc; @@ -1391,6 +1393,9 @@ public: ScSingleRefData& s = rData.Ref1; ScSingleRefData& e = rData.Ref2; + if(abs((e.Col()-s.Col())*(e.Row()-s.Row())) < SHRINK_RANGE_THRESHOLD) + return; + SCCOL nMinCol = MAXCOL, nMaxCol = 0; SCROW nMinRow = MAXROW, nMaxRow = 0; |