[Libreoffice] Script to find undocumented classes

Thorsten Behrens thb at documentfoundation.org
Wed Dec 1 01:02:56 PST 2010


Sebastian Spaeth wrote:
> What does bFull mean? Not so quick? What portions will be formatted if
> this is FALSE? Looking at the function it either calls
>  pImpEditEngine->FormatFullDoc(); 
>  or 
>  pImpEditEngine->FormatDoc();
> 
> What the heck is the difference between those functions? Now I have to
> go another layer deeper to those 2 (both undocumented!) functions.
> 
> All that FormatFullDoc does:
> 
>   for ( sal_uInt16 nPortion = 0; nPortion < GetParaPortions().Count(); nPortion++ )
>     GetParaPortions()[nPortion]->MarkSelectionInvalid( 0, GetParaPortions()[nPortion]->GetNode()->Len() );
>   FormatDoc()
> 
> Excuse me, what does the stuff before we end up in FormatDoc() actually
> do? It must modify the document somehow as a sideeffect,because we call
> FormatDoc without any parameter. And it seems to mark some selections as
> invalid. So perhaps bFull=FALSE only works on selected text?
> 
> For that I need to dig into what GetParaPortions and ParaPortions
> actually are and do, which is an *undocumented class* implemented here: libs-core/editeng/source/editeng/editdoc2.cxx.
> 
> I'd give up at this point, because after reading that much code, I had
> forgotten what I wanted to do in the first place :). A simple docstring
> in QuickFormatDoc, such as
> /**
>  * param bFull determines whether we need to reflow the whole document
>  or only the pieces that are visible on the screen.
>  */
>
Hi spaetz,

see? That's what I meant, documentation for most of the higher-level
methods is either

a) superficial
b) so much prose that you're better off debugging the code in the
   first place

(bFull has *a lot* of side effects, and no, I did not bother to
research all of them for the while)

> would have saved me much time, and I could actually have improved some
> code rather becoming a frustrated opengrok hunter..
> (note this is a bullshit comment, as I *still* don't know what bFull
> really does :)).
>
Having a ctags and/or idutils index setup & integrated into your
editor greatly speeds up jumping around in the codebase. I'd consider
it essential for any productive work with LibO.

Cheers,

-- Thorsten
-------------- 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/20101201/ef09fbe5/attachment-0001.pgp>


More information about the LibreOffice mailing list