Please be careful with (OU)String changes - endless loop with report designer

David Ostrovsky d.ostrovsky at gmx.de
Sun Jun 23 06:15:18 PDT 2013


just pushed a partially revert [1] for your commit
b7df3446c373a93dc5b77b495a54d873d83a91a7
that introduced the endless loop:

[...]

-            String aText = m_aFtTitle.GetText();
+            OUStringBuffer aText( m_aFtTitle.GetText() );
 
- while( m_pTheParent->GetTextWidth( aText ) < m_nNameWidth )
-        aText.AppendAscii("...........");
+           
while( m_pTheParent->GetTextWidth( aText.makeStringAndClear() ) <
m_nNameWidth )
+         aText.append("...........");

[...]

The problem here is, that the method aText.makeStringAndClear() destroys
the content of the OUStringBuffer and aText.append("...........") start
from the beginning and thus never ends.

Note: i didn't check the rest of that commit.

[1]
http://cgit.freedesktop.org/libreoffice/core/commit/?id=865b5caf6e2256e06f46a39a86d67f03408718a9




More information about the LibreOffice mailing list