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

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Fri Apr 17 13:14:38 UTC 2020


 sc/source/ui/Accessibility/AccessibleCell.cxx |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 9088a1bac800d1fec7eb0a4102a47c17235b429e
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Thu Apr 16 17:35:57 2020 +0300
Commit:     Eike Rathke <erack at redhat.com>
CommitDate: Fri Apr 17 15:14:06 2020 +0200

    tdf#132147: formula may be empty
    
    "Regression" after commit ab285c743afa1c8769581871d7b56374fd8c49f1
    
      author        Noel Grandin <noel.grandin at collabora.co.uk>     Sat Nov 02 18:59:49 2019 +0200
      committer     Noel Grandin <noel.grandin at collabora.co.uk>     Sun Nov 03 17:11:14 2019 +0100
    
      loplugin:stringadd
    
      tweak the plugin to be more permissive, then validate by hand
      afterwards
    
    which replaced strFor.replaceAt(0,1,"") with strFor.copy(1). Both methods
    are illegal on empty string, but the former asserted, then silently corrected
    wrong count; while the latter returns "br0ken". So the change actually
    revealed a pre-existing bug.
    
    Change-Id: Ic32b69d46e852f26e6c6ba819eed08bb79dce7a9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92301
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
    (cherry picked from commit de1dadd591862e38242cc2de7a4a658a9a8b67ac)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92303
    Reviewed-by: Eike Rathke <erack at redhat.com>

diff --git a/sc/source/ui/Accessibility/AccessibleCell.cxx b/sc/source/ui/Accessibility/AccessibleCell.cxx
index 5e1d077a4de3..b673aee7b884 100644
--- a/sc/source/ui/Accessibility/AccessibleCell.cxx
+++ b/sc/source/ui/Accessibility/AccessibleCell.cxx
@@ -491,8 +491,11 @@ uno::Any SAL_CALL ScAccessibleCell::getExtendedAttributes()
     if (mpViewShell)
     {
         OUString strFor = mpViewShell->GetFormula(maCellAddress) ;
-        strFor = strFor.copy(1);
-        strFor = ReplaceFourChar(strFor);
+        if (!strFor.isEmpty())
+        {
+            strFor = strFor.copy(1);
+            strFor = ReplaceFourChar(strFor);
+        }
         strFor = "Formula:" + strFor +
             ";Note:" +
             ReplaceFourChar(GetAllDisplayNote()) + ";" +


More information about the Libreoffice-commits mailing list