[ooo-build-commit] Branch 'ooo-build-3-1-1' - patches/dev300

Kohei Yoshida kohei at kemper.freedesktop.org
Thu Sep 3 13:10:33 PDT 2009


 patches/dev300/apply                      |    3 ++
 patches/dev300/calc-chart-wrong-cast.diff |   37 ++++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+)

New commits:
commit 62b71445f871e042403f2959cf339b9f2d12af9d
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Thu Sep 3 16:08:58 2009 -0400

    Fix a crasher when saving a document with chart.
    
    * patches/dev300/apply:
    * patches/dev300/calc-chart-wrong-cast.diff: incorrect casting
      caused Calc to crash on saving.  The patch is from Caolan.
      (i#104484)

diff --git a/patches/dev300/apply b/patches/dev300/apply
index 892afea..0d72137 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -3199,6 +3199,9 @@ calc-xls-import-array-size.diff, kohei
 calc-copy-range-animated-border-sc.diff, kohei
 calc-copy-range-animated-border-svx.diff, kohei
 
+# fix incorrect casting of chart positioning code.
+calc-chart-wrong-cast.diff, i#104484, caolan/kohei
+
 [ CalcRowLimit ]
 # The work to increase Calc's row size limit, and any work associated with it.
 SectionOwner => kohei
diff --git a/patches/dev300/calc-chart-wrong-cast.diff b/patches/dev300/calc-chart-wrong-cast.diff
new file mode 100644
index 0000000..a496139
--- /dev/null
+++ b/patches/dev300/calc-chart-wrong-cast.diff
@@ -0,0 +1,37 @@
+diff --git sc/source/ui/unoobj/chart2uno.cxx sc/source/ui/unoobj/chart2uno.cxx
+index 4246273..cb99932 100644
+--- sc/source/ui/unoobj/chart2uno.cxx
++++ sc/source/ui/unoobj/chart2uno.cxx
+@@ -500,6 +500,10 @@ void Chart2Positioner::glueState()
+         ScRefTokenHelper::getDoubleRefDataFromToken(aData, *itr);
+         SCCOLROW n1 = aData.Ref1.nCol;
+         SCCOLROW n2 = aData.Ref2.nCol;
++        if (n1 > SCCOL_MAX)
++            n1 = SCCOL_MAX;
++        if (n2 > SCCOL_MAX)
++            n2 = SCCOL_MAX;
+         SCCOLROW nTmp = n2 - n1 + 1;
+         if (n1 < mnStartCol)
+             mnStartCol = static_cast<SCCOL>(n1);
+@@ -510,14 +514,18 @@ void Chart2Positioner::glueState()
+ 
+         n1 = aData.Ref1.nRow;
+         n2 = aData.Ref2.nRow;
++        if (n1 > SCROW_MAX)
++            n1 = SCROW_MAX;
++        if (n2 > SCROW_MAX)
++            n2 = SCROW_MAX;
+         nTmp = n2 - n1 + 1;
+ 
+         if (n1 < mnStartRow)
+-            mnStartRow = static_cast<SCCOL>(n1);
++            mnStartRow = static_cast<SCROW>(n1);
+         if (n2 > nEndRow)
+-            nEndRow = static_cast<SCCOL>(n2);
++            nEndRow = static_cast<SCROW>(n2);
+         if (nTmp > nMaxRows)
+-            nMaxRows = static_cast<SCCOL>(nTmp);
++            nMaxRows = static_cast<SCROW>(nTmp);
+     }
+ 
+     // total column size ?


More information about the ooo-build-commit mailing list