[Libreoffice-commits] core.git: sc/source

Eike Rathke erack at redhat.com
Fri Sep 5 05:57:21 PDT 2014


 sc/source/core/tool/reffind.cxx |   21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

New commits:
commit 02969a1446fa107813cd138ef4053bed1bedb16b
Author: Eike Rathke <erack at redhat.com>
Date:   Fri Sep 5 14:52:13 2014 +0200

    don't use OSL_FAIL in new code; in this case use assert instead
    
    Change-Id: I67e96a4a394429045655d33825ce77664ff6dc9b

diff --git a/sc/source/core/tool/reffind.cxx b/sc/source/core/tool/reffind.cxx
index d109d68..94db172 100644
--- a/sc/source/core/tool/reffind.cxx
+++ b/sc/source/core/tool/reffind.cxx
@@ -284,14 +284,19 @@ void ScRefFinder::ToggleRel( sal_Int32 nStartPos, sal_Int32 nEndPos )
                          nSep = aExpr.lastIndexOf('.');
                          break;
                 }
-                if( nSep < 0 )
-                  OSL_FAIL( "Invalid syntax according to address convention." );
-                OUString aRef = aExpr.copy(nSep+1);
-                OUString aExtDocNameTabName = aExpr.copy(0, nSep+1);
-                nResult = aAddr.Parse(aRef, mpDoc, aDetails);
-                aAddr.SetTab(0); // force to first tab to avoid error on checking
-                nFlags = lcl_NextFlags( nResult );
-                aExpr = aExtDocNameTabName + aAddr.Format(nFlags, mpDoc, aDetails);
+                if (nSep < 0)
+                {
+                    assert(!"Invalid syntax according to address convention.");
+                }
+                else
+                {
+                    OUString aRef = aExpr.copy(nSep+1);
+                    OUString aExtDocNameTabName = aExpr.copy(0, nSep+1);
+                    nResult = aAddr.Parse(aRef, mpDoc, aDetails);
+                    aAddr.SetTab(0); // force to first tab to avoid error on checking
+                    nFlags = lcl_NextFlags( nResult );
+                    aExpr = aExtDocNameTabName + aAddr.Format(nFlags, mpDoc, aDetails);
+                }
             }
             else
             {


More information about the Libreoffice-commits mailing list