[Libreoffice] [PUSHED][PATCH] Remove unnecessary parameter to IDocumentStatistics::UpdateDocStat
Miklos Vajna
vmiklos at frugalware.org
Thu Aug 25 15:26:33 PDT 2011
On Wed, Aug 24, 2011 at 11:50:02AM +0100, Caolán McNamara <caolanm at redhat.com> wrote:
> > You mean something like this? Given that the idl says these properties
> > are readonly (I did not notice that so far), I don't think there is a
> > reason to set them.
>
> I was thinking more of the "old" rtf filter which const casts away
> constness to set these on import. Need better names than old/new.
I used RtfReader/RTFTokenizer, but that's confusing as well.
"writerfilter-based rtf import"?
> re: readonly-ness in the uno api, the AdvancedTextDocument
> CharacterCount etc properties are read-only alright, but no mention is
> made of readonly-ness for DocumentStatistics from XDocumentProperties
Here is my understanding:
- PageCount: readonly in TextDocumentView.idl
- WordCount: readonly in AdvancedTextDocument.idl
- CharacterCount: readonly in AdvancedTextDocument.idl
> I suppose there's a counter-argument that says setting what the
> producing app thinks was the stats allows the expected results from
> fields etc up to as far as the first update when the user edits that
> document.
Hm, what I see here: with a trivial test doc, like:
{\rtf1
{\info
{\nofpages99}
}
{foobar
\par }
}
(which is of course a single page, but it says it's 99 pages)
when (on master) I go to File -> Properties -> Statistics, Number of
Pages is already 1, without pressing Update.
It's possible this is a bug in RTFDocumentImpl (search for RTF_NOFPAGES
in rtfdocumentimpl.cxx), but isn't this just because the attributes are
read-only? (Lack of uno knowledge on my side: not sure if "readonly" in
the IDL is just a suggestion for the implementation or in case it's
enforced.)
Thanks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110826/86d30bb8/attachment.pgp>
More information about the LibreOffice
mailing list