Apache OpenOffice (AOO) Bugzilla – Issue 123068
remove implicit rtl::O*String conversions to char/utf-16 pointers
Last modified: 2014-04-01 12:26:28 UTC
The implicit conversions from string to pointers are dangerous. Checking the AOO codebase for problems caused by it finds several problems: - string concatenations that assume the Java-behavior that adding a value to a string results in a string and the string-value to be concatenated. Instead the the value does some pointer arithmetic with the string buffer address - tests that assume that there is an OUString to bool operator that checks for the emptiness of the string. This assumption is not only wrong but the implicit OUString->pointer conversion and the fact that an empty rtl-string's buffer doesn't point to NULL result in a wrong answer. - unexpected template specializations being created
"hdu" committed SVN revision 1515767 into branches/rejuvenate01: #i123068# remove implicit conversions from rtl strings to their elements
Fixed with the commit above. It shows that additionally to the three problem categories outlined above an implicit conversion from the reference counted rtl strings to unmanaged plain pointers introduces the risk that lifetime issues for the character buffer are introduced. An example for that risk is the assignment to SfxSlot's pName member in SfxShell::setVerbs(). It was converted 1:1 for now but the lifetime of the buffer is so suspicious that it needs to be analyzed
"hdu" committed SVN revision 1516138 into branches/rejuvenate01: #i123068# remove more implicit conversions from rtl strings to their elements
"hdu" committed SVN revision 1516387 into branches/rejuvenate01: #i123068# replace implicit conversion in migration/wizard
"hdu" committed SVN revision 1546390 into trunk: #i123068# remove implicit conversions from rtl strings to their elements
"hdu" committed SVN revision 1546578 into trunk: #i123068# allow OString argument for tools' DbgOut() function
"hdu" committed SVN revision 1564650 into trunk: #i123068# remove implicit conversion from aUTF8String to its char pointer
Closing the resolved issue.