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

Caolán McNamara caolanm at redhat.com
Tue Dec 17 11:36:02 PST 2013


 svx/source/fmcomp/dbaexchange.cxx |   11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

New commits:
commit 444a8dd8752fe5e2cee58c5e51b7da7a4f5ff9f8
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Dec 16 12:34:56 2013 +0000

    fix out of range access
    
    this is broken since 6e4a21ff22345a24e4d530725814c436a1bdd49a
    the original commit in 2001.
    
    I imagine the idea was to strip a trailing sal_Unicode(11) from the
    end of the string and then recalculate if the string is empty, but
    seeing as it has chugged away for the last 12+ years like this I'm
    relunctant to change it to what it might have originally been
    intended to do and instead just remove the stuff which was never
    executed.
    
    Change-Id: I73d5108ece8e716d78a4898117e0ee2d51822015

diff --git a/svx/source/fmcomp/dbaexchange.cxx b/svx/source/fmcomp/dbaexchange.cxx
index e5a974d..ff0e74f 100644
--- a/svx/source/fmcomp/dbaexchange.cxx
+++ b/svx/source/fmcomp/dbaexchange.cxx
@@ -464,15 +464,8 @@ namespace svx
                 break;
         }
 
-        sal_Int32 nDescriptorLen = m_sCompatibleObjectDescription.getLength();
-        if (nDescriptorLen)
-        {
-            if (m_sCompatibleObjectDescription[nDescriptorLen] == 11)
-                m_sCompatibleObjectDescription = m_sCompatibleObjectDescription.copy(0, nDescriptorLen - 1);
-
-            if (nDescriptorLen)
-                AddFormat(SOT_FORMATSTR_ID_SBA_DATAEXCHANGE);
-        }
+        if (!m_sCompatibleObjectDescription.isEmpty())
+            AddFormat(SOT_FORMATSTR_ID_SBA_DATAEXCHANGE);
     }
 
     // -----------------------------------------------------------------------------


More information about the Libreoffice-commits mailing list