problem with assert statement in ustring.hxx

Norbert Thiebaud nthiebaud at gmail.com
Wed Feb 20 21:46:58 PST 2013


On Wed, Feb 20, 2013 at 9:48 PM, Markus Mohrhard
<markus.mohrhard at googlemail.com> wrote:
> Hey,
>
> I'm currently running the calc files throough the automatic import
> test and the first XLSX file that crashed was novell#349591.
>
> THe problem there is the assert statement in ustring.hxx:232 together
> with the vmldrawing.cxx:59.
>
> Is it correct that we can't handle \0 in a string literal or is the
> assert statement wrong?
>

maybe
diff --git a/oox/source/vml/vmldrawing.cxx b/oox/source/vml/vmldrawing.cxx
index 5293e1e..371d1320 100644
--- a/oox/source/vml/vmldrawing.cxx
+++ b/oox/source/vml/vmldrawing.cxx
@@ -55,8 +55,9 @@ namespace {
 /** Returns the textual representation of a numeric VML shape identifier. */
 OUString lclGetShapeId( sal_Int32 nShapeId )
 {
+    sal_Unicode prefix[2] = {0,115}; /* "\0s" */
     // identifier consists of a literal NUL character, a lowercase
's', and the id
-    return OUString( "\0s" ) + OUString::valueOf( nShapeId );
+    return OUString( prefix, 2 ) + OUString::valueOf( nShapeId );
 }

 /** Returns the numeric VML shape identifier from its textual
representation. */

Norbert


More information about the LibreOffice mailing list