summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2013-10-10 18:02:25 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-10-13 04:21:03 +0000
commit856e8cdf9cb67acfc858c9ca55bda5bd24ee7b57 (patch)
tree01be2d1c962c04ec1996bf7f21bd8b466d12368c /sc
parent9225bf807d40bf85a83536e2df23a28c457f7777 (diff)
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 f81ed484ffd443e2593627f3d8d3133161817af2 in 4-1 we should have this as well. Change-Id: Ia1d558fc106d9a2010ad41c30f7eb2a2a480c59b Reviewed-on: https://gerrit.libreoffice.org/6218 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/docshell/tablink.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx
index 14ab87801c8c..ba1ed7236ec0 100644
--- a/sc/source/ui/docshell/tablink.cxx
+++ b/sc/source/ui/docshell/tablink.cxx
@@ -512,12 +512,11 @@ bool ScDocumentLoader::GetFilterName(
void ScDocumentLoader::RemoveAppPrefix( OUString& rFilterName )
{
- 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);
+ OUStringBuffer aBuf;
+ aBuf.appendAscii( STRING_SCAPP).appendAscii( ": ");
+ OUString aAppPrefix( aBuf.makeStringAndClear());
+ if (rFilterName.startsWith( aAppPrefix))
+ rFilterName = rFilterName.copy( aAppPrefix.getLength());
}
ScDocumentLoader::ScDocumentLoader( const OUString& rFileName,