[Libreoffice-commits] core.git: Branch 'libreoffice-5-3-1' - sc/source

Eike Rathke erack at redhat.com
Tue Feb 28 11:55:24 UTC 2017


 sc/source/ui/drawfunc/fuins2.cxx |   17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

New commits:
commit 0c6d6106a9914b9de16634ee4f55f14a44344bbc
Author: Eike Rathke <erack at redhat.com>
Date:   Mon Feb 20 22:26:40 2017 +0100

    Resolves: tdf#106089 generate range string with current address convention
    
     This is a combination of 2 commits.
    
    Resolves: tdf#106089 catch legal IllegalArgumentException on bad range string
    
    ... that for example doesn't match the document's current address convention.
    Further work is need to make that actually fly, but at least don't terminate
    the application but come up with a default Chart instead where the range can be
    edited.
    
    (cherry picked from commit 0200677891c6d592a12343f0d6f82c569cd7a9e0)
    
    Related: tdf#106089 generate range string with current address convention
    
    ... so subsequent parsing actually works.
    
    (cherry picked from commit 3ec3d7ead0f2e47a4e24ba0d6953fea0f49815ed)
    
    47d661d24552104b56827248b4c5e6a6617c5d63
    
    Change-Id: I6cb6400c56c896dac7ab949b8a986c784690dfd3
    Reviewed-on: https://gerrit.libreoffice.org/34516
    Reviewed-by: Kohei Yoshida <libreoffice at kohei.us>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index 41610a0..9a9e132 100644
--- a/sc/source/ui/drawfunc/fuins2.cxx
+++ b/sc/source/ui/drawfunc/fuins2.cxx
@@ -114,7 +114,7 @@ void lcl_ChartInit( const uno::Reference < embed::XEmbeddedObject >& xObj, ScVie
                 pDoc->LimitChartArea( nTab1, nCol1,nRow1, nCol2,nRow2 );
 
                 ScRange aRange( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 );
-                aRangeString = aRange.Format(ScRefFlags::RANGE_ABS_3D, &rScDoc);
+                aRangeString = aRange.Format(ScRefFlags::RANGE_ABS_3D, &rScDoc, rScDoc.GetAddressConvention());
             }
         }
     }
@@ -186,7 +186,20 @@ void lcl_ChartInit( const uno::Reference < embed::XEmbeddedObject >& xObj, ScVie
             aArgs[3] = beans::PropertyValue(
                 OUString("DataRowSource"), -1,
                 uno::makeAny( eDataRowSource ), beans::PropertyState_DIRECT_VALUE );
-            xReceiver->setArguments( aArgs );
+
+            try
+            {
+                xReceiver->setArguments( aArgs );
+            }
+            catch (const lang::IllegalArgumentException& e)
+            {
+                // Can happen for invalid aRangeString, in which case a Chart
+                // will be created nevertheless and the range string can be
+                // edited.
+                SAL_WARN("sc.ui",
+                        "lcl_ChartInit - caught IllegalArgumentException with message \"" << e.Message << "\","
+                        " might be due to aRangeString: " << aRangeString);
+            }
 
             // don't create chart listener here (range may be modified in chart dialog)
         }


More information about the Libreoffice-commits mailing list