diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-10-28 23:20:20 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-10-30 16:30:33 +0100 |
commit | 4954e2a2f6d99e9c1cfb15435c66bdbbf62f1cd3 (patch) | |
tree | b324a50bf8d4f8febe2beea25300e57e05002da0 /test | |
parent | 34012133266714259e5b009851924d176199a60d (diff) |
simplify code and fix out of bounds read
Change-Id: I5be3a28d3d1ae43974f844d143a30bfd989cbe5b
Diffstat (limited to 'test')
-rw-r--r-- | test/source/sheet/xspreadsheets2.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/source/sheet/xspreadsheets2.cxx b/test/source/sheet/xspreadsheets2.cxx index d9d78b600060..aa010d375f59 100644 --- a/test/source/sheet/xspreadsheets2.cxx +++ b/test/source/sheet/xspreadsheets2.cxx @@ -326,10 +326,10 @@ void XSpreadsheets2::importSheetToCopy() bool XSpreadsheets2::isExternalReference(const OUString& aDestContent, const OUString& aSrcContent ) { OUString aStart("'file://"); - const sal_Char* sSrcContent = OUStringToOString( aSrcContent, RTL_TEXTENCODING_UTF8 ).getStr(); - return (aDestContent.endsWithIgnoreAsciiCaseAsciiL(sSrcContent, aSrcContent.getLength()) // same cell address - && aDestContent.indexOf(aStart)==0 // starts with 'file:// + CPPUNIT_ASSERT(aDestContent.startsWith(aStart)); + + return (aDestContent.endsWithIgnoreAsciiCase(aSrcContent, NULL) // same cell address && aDestContent.indexOf(aSrcFileName)>0); // contains source file name } |