[Libreoffice] [PATCH] Cross-references to numbered paragraphs: remove trailing dots at the end of a cross-reference, or where they precede an open parenthesis that starts the next paragraph level in the cross-reference (bugzilla 33960).

Cedric Bosdonnat cedric.bosdonnat.ooo at free.fr
Thu Apr 14 05:25:41 PDT 2011


Hi Troy,

Many thanks for your nice patch: you found out the right place to hack!
However I have some concerns here...

On Thu, 2011-04-14 at 18:04 +1000, Troy Rollo wrote:
> +                if ( nLen > 0 && aPrevStr.GetChar(nLen - 1) == '.' &&

This is quite restrictive as it only clears the ending '.' I think that
the same should apply whatever the suffix is.. Would one want to have
[1-] as the reference?

You could either hack the MakeNumString itself or get inspired of it to
get the suffix to remove.

> +                     ( aRefNumStr.Len() == 0 ||
> +                      aRefNumStr.GetChar(0) == '(' )

Why that test for strings starting with '(' ?

Don't hesitate to ask for help if you need some to improve the patch and
keep doing nice work like this one.

Regards,

-- 
Cédric Bosdonnat
LibreOffice hacker
http://documentfoundation.org
OOo Eclipse Integration developer
http://cedric.bosdonnat.free.fr



More information about the LibreOffice mailing list