[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: [PATCH] two kotext fixes for 1.6
From:       Benjamin.Stuhl () colorado ! edu
Date:       2006-07-26 17:27:42
Message-ID: 1153934862.44c7a60ece02f () webmail ! colorado ! edu
[Download RAW message or body]

Forgot to CC koffice-devel with my reply to Thomas...

On Wed, July 26, 2006 10:41, Thomas Zander wrote:
> I altered it to:
>
>     /**
>      * Load a section of text from a oasis based xml tree.
>      * @param parent the xml element that has content as children. *
@param context the context
>      * @param stripLeadingSpace Set to true to remove a leading space from
> the content even if
>      *        the xml contains one.
>      */
>     void loadOasisSpan( const QDomElement& parent, KoOasisContext&
> context, uint& pos, bool stripLeadingSpace = false);
>
>
> Let me know if I understood the value of the bool properly, and thus choose
> the default correctly.

Not quite: the fact that it was bool& mattered, since the ODF spec requires that
whitespace be compressed around tags. IOW,

blah blah blah <text:span> Blah Blah </text:span> Foo

should only have one space each between "blah" and "Blah" and between "Blah" and
"Foo". So we have to propogate knowledge of whitespace back up the
loadOasisSpan() call chain, so that we don't end up with two spaces between
"Blah" and "Foo". (The obvious alternative to the in/out reference was to
change the return value to bool, but that seemed too confusing, since it would
_not_ be a success/failure indication. Perhaps a fourth bool* parameter?) The
comment for @param stripLeadingSpace might be better as something like

@param stripLeadingSpace In: whether to remove leading literal whitespace from
the first text node of the span; out: whether there was trailing literal
whitespace in the last text node

If you'd like, I can prepare a patch along those lines this evening.

Thanks,
-- BKS



_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic