From 45b959806da456adf3ba3a1e4f08130480ccf89c Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Thu, 17 Apr 2014 02:02:15 +0200 Subject: 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 Tested-by: Andras Timar --- sc/source/ui/unoobj/chart2uno.cxx | 5 +++++ 1 file changed, 5 insertions(+) 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& rRefTokens, return true; } +#define SHRINK_RANGE_THRESHOLD 10000 + class ShrinkRefTokenToDataRange : std::unary_function { 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; -- cgit v1.2.3