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

Eike Rathke erack at redhat.com
Sat Oct 12 21:21:02 PDT 2013


 sc/source/ui/docshell/tablink.cxx |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

New commits:
commit 8b12ee3ae1f22ada7d8ffb3d86fb7c5b94ef1971
Author: Eike Rathke <erack at redhat.com>
Date:   Thu Oct 10 18:02:25 2013 +0200

    fixed another "Out of bounds substring access"
    
    Introduced with 3c2a26c84e70fd996855181d319970e2230b2459
    Didn't have consequences here because the result was used to check for a
    "startsWith" condition which it wouldn't had matched anyway. However,
    use the real startsWith() now.
    
    (cherry picked from commit b1caf176a44b6979d2e0ea47f495a3dacf86e197)
    
    With 5688ab5ba457ea9a50152570d161a11a1d093994 in 4-0 we should have this
    as well.
    
    Conflicts:
    	sc/source/ui/docshell/tablink.cxx
    
    Change-Id: Ia1d558fc106d9a2010ad41c30f7eb2a2a480c59b
    Reviewed-on: https://gerrit.libreoffice.org/6223
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx
index b7d3a54..7a28d22 100644
--- a/sc/source/ui/docshell/tablink.cxx
+++ b/sc/source/ui/docshell/tablink.cxx
@@ -522,12 +522,11 @@ bool ScDocumentLoader::GetFilterName(
 
 void ScDocumentLoader::RemoveAppPrefix( rtl::OUString& rFilterName )
 {
-    rtl::OUStringBuffer aAppPrefix;
-    aAppPrefix.appendAscii(STRING_SCAPP);
-    aAppPrefix.appendAscii(": ");
-    sal_Int32 nPreLen = aAppPrefix.getLength();
-    if (rFilterName.copy(0, nPreLen).equals(aAppPrefix.makeStringAndClear()))
-        rFilterName = rFilterName.copy(nPreLen);
+    rtl::OUStringBuffer aBuf;
+    aBuf.appendAscii( STRING_SCAPP).appendAscii( ": ");
+    OUString aAppPrefix( aBuf.makeStringAndClear());
+    if (rFilterName.startsWith( aAppPrefix))
+        rFilterName = rFilterName.copy( aAppPrefix.getLength());
 }
 
 ScDocumentLoader::ScDocumentLoader( const rtl::OUString& rFileName,


More information about the Libreoffice-commits mailing list