Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


Hi August,

On 2011-10-02 at 20:00 -0400, August Sodora wrote:

Apparently the issue was that I actually wasn't using the parameter :)
I've attached a preliminary patch (my first!) for review.

Great stuff, thank you for that! :-)  Unfortunately the original code is
a kind of horror, and there is one tricky thing in there:

@@ -266,10 +266,8 @@ sal_Bool SbiScanner::NextSym()
         // replace closing '_' by space when end of line is following
         // (wrong line continuation otherwise)
         if( !bUsedForHilite && !*pLine && *(pLine-1) == '_' )
-        {
-            aSym.GetBufferAccess();     // #109693 force copy if necessary
             *((sal_Unicode*)(pLine-1)) = ' ';       // cast because of const
-        }
+
         // type recognition?
         // don't test the exclamation mark 
         // if there's a symbol behind it

The (C-style) cast touches the [potentially shared!] pLine (ie. aLine);
in which case, when it is shared with aSym, it can break badly when you
remove the GetBufferAccess.  If we want to get rid of that, I am afraid
more refactoring is needed :-(

BTW, another horror in the original code is:

ch1 = aSym.ToUpperAscii().GetBuffer()[0];

ie. we convert the entire string to upper case, and then throw all that
away but the first char.

Can you have a look at these, and maybe first address the ToUpperAscii
part, and then have one more look at how to get rid of the
GetBufferAccess?

Either way - thank you a lot for looking into this!

All the best,
Kendy


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.