[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source

Markus Mohrhard markus.mohrhard at collabora.co.uk
Thu Apr 17 02:28:04 PDT 2014


 sc/source/ui/unoobj/chart2uno.cxx |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit 45b959806da456adf3ba3a1e4f08130480ccf89c
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Thu Apr 17 02:02:15 2014 +0200

    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 at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index 8754057..093dbbe 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;
 


More information about the Libreoffice-commits mailing list