[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).
Troy Rollo
troy at troy.rollo.name
Sat Apr 16 16:54:41 PDT 2011
On Thursday 14 April 2011, Cedric Bosdonnat wrote:
> 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?
If it were 20 years ago and I was designing on a clear slate, I agree it would
be better to have a more complete rule. The rule I implemented is the rule
used by Microsoft Word (as determined by testing), which I used for the
following reasons:
1. The rule has operated for a long time now without, as far as I can see, any
serious complaints about it.
2. Using the same rule as Microsoft Word will create fewer problems for
document interchange with Microsoft Word.
> Why that test for strings starting with '(' ?
For the same reasons. I agree that, with a clean slate, the rule would be
different.
I guess it depends on how important it is to keep document consistency high in
interchange with Word. If that is not important I can prepare a more complete
set of rules, submit the rules for approval, and then implement a new patch.
My initial thought was that the correct (clean slate) rule would be:
1. Strip any leading white space (but not trailing - although rule 2 might get
that);
2. If there is formatting content after the number, and not before the number,
strip it if either:
(a) This is the last component in the reference; or
(b) The next component has formatting content before the number.
However I would note that one of the default outline numbering formats (the
"1." "(a)" format) in LibreOffice includes white space in front of the number
at the first list level. Thus this rule would strip the white space, where on
my testing MS Word would not. This would create a common inconsistency when
going from LibreOffice to MS word.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110417/5cc250f0/attachment.pgp>
More information about the LibreOffice
mailing list