simplify code and fix out of bounds read
Change-Id: I5be3a28d3d1ae43974f844d143a30bfd989cbe5b
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user