<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">I think a unit test might be helpful. They are actually quite easy to write - in fact, I wrote a very simple one the other day. </div><div class=""><br class=""></div><div class="">Have a look on master at vcl/qa/cppunit/font.cxx</div><div class=""><br class=""></div><div class="">I’m trying to write a unit test for every low level component I change or refactor, I’ve found that it doesn’t take much time to do and I’m trying to do it if only to ensure that any code I modify doesn’t break unexpectedly when I make changes further down the line. </div><div class=""><br class=""></div><div class="">Let me know if you get stuck :-)</div><div class=""><br class=""></div><div class="">Chris</div><br class=""><div><blockquote type="cite" class=""><div class="">On 17 Jan 2016, at 12:36 AM, Mark Hung <<a href="mailto:marklh9@gmail.com" class="">marklh9@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Hi Michael,<div class=""><br class=""></div><div class="">I'd look into performance issue. </div><div class="">Is there any benchmark or unit test that I can use to check performance enhancement? </div><div class="">And what do you mean by regression test for the characters?</div><div class=""><br class=""></div></div><div class="gmail_extra" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class=""><div class="gmail_quote">2016-01-16 19:33 GMT+08:00 Michael Meeks<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:michael.meeks@collabora.com" target="_blank" class="">michael.meeks@collabora.com</a>></span>:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">Hi Mark,<br class=""><br class="">       <span class="Apple-converted-space"> </span>Great to see:<br class=""><br class="">commit e99f22bbc499ab0566621ee0bb01e4a7747efe76<br class="">Author: Mark Hung <<a href="mailto:marklh9@gmail.com" class="">marklh9@gmail.com</a>><br class="">Date:   Sun Jan 10 00:28:14 2016 +0800<br class=""><br class="">   <span class="Apple-converted-space"> </span>Fix FastSaxSerializer::write() for non-BMP unicode characters.<br class=""><br class="">       <span class="Apple-converted-space"> </span>Clearly we don't want to mangle UTF-16 etc. characters - and the code<br class="">looks dodgy indeed for that =)<br class=""><br class="">       <span class="Apple-converted-space"> </span>I'm somewhat suspicious though that this will cause some unhelpful<br class="">performance regression; and I was wondering if you could look into<br class="">fixing that ? and (ideally) helping out with a regression test for these<br class="">characters ? =)<br class=""><br class="">       <span class="Apple-converted-space"> </span>Memory allocation of OStrings etc. via rtl/sal is rather expensive in<br class="">most of the profiles I've seen; and particularly doing it for every<br class="">attribute ;-)<br class=""><br class="">       <span class="Apple-converted-space"> </span>Would it be possible to replace the original code - but - as soon as we<br class="">hit a non-ASCII character to convert the rest of the string, and write<br class="">that - so something like:<br class=""><br class="">       <span class="Apple-converted-space"> </span>write (OString(sOutput[i], nLength-i, RTL_TEXTENCODING_UTF8), bEscape);<br class="">       <span class="Apple-converted-space"> </span>return;<br class=""><br class="">       <span class="Apple-converted-space"> </span>So we can get the character conversion and pairing correct - while<br class="">keeping the lack of allocation there ? =)<br class=""><br class="">       <span class="Apple-converted-space"> </span>Anyhow - thanks muchly for the fix ! great to see complex text support<br class="">improve.<br class=""><br class="">       <span class="Apple-converted-space"> </span>All the best,<br class=""><br class="">               <span class="Apple-converted-space"> </span>Michael.<br class=""><span class="HOEnZb"><font color="#888888" class=""><br class="">--<br class=""> <a href="mailto:michael.meeks@collabora.com" class="">michael.meeks@collabora.com</a> <span class="Apple-converted-space"> </span><><, Pseudo Engineer, itinerant idiot<br class=""><br class=""></font></span></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>--<span class="Apple-converted-space"> </span><br class=""><div class="gmail_signature"><div dir="ltr" class=""><div class="">Mark Hung<br class=""></div></div></div></div><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">LibreOffice mailing list</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:LibreOffice@lists.freedesktop.org" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">LibreOffice@lists.freedesktop.org</a><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="http://lists.freedesktop.org/mailman/listinfo/libreoffice" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">http://lists.freedesktop.org/mailman/listinfo/libreoffice</a></div></blockquote></div><br class=""></body></html>