You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openoffice.apache.org by eric b <er...@free.fr> on 2012/01/24 11:55:36 UTC

bIsInside (a Rectangle)

Hi,

Hacking the Presenter Screen (trying to implement the Presentation  
timer reset because I need it), I found yet another definition of  
bIsInside [an area, a rectangle]. I know there is a similar  
definition in tools (gen.hxx) and using Opengrok, I found  other  
places where IsInside a given [rR]ectangle is defined. e.g. : sw/ 
source/core/bastyp/swrect.cxx, reportdesign/source/core/sdr/ 
RptObject.cxx ... and so on.

Reading the gen.cxx implementation, I have some doubts (strange  
rectangle with inverted axes), but is there a good reason to repeat  
the same definition several times in the code ? What about factorize  
and simplify that ? e.g. we could propose a list of tasks for  
newcomers, reserved to people who want to discover Apache OpenOffice  
source code ?

Thanks in advance,
Eric Bachard

-- 
qɔᴉɹə
Projet OOo4Kids : http://wiki.ooo4kids.org/index.php/Main_Page
L'association EducOOo : http://www.educoo.org
Blog : http://eric.bachard.org/news






Re: bIsInside (a Rectangle)

Posted by Andre Fischer <af...@a-w-f.de>.
Hi Eric,

I assume that you mean PresenterGeometryHelper::IsInside().  It is 
defined for ::com::sun::star::geometry::RealRectangle2D and 
::com::sun::star::awt::Rectangle, and the respective point types.  These 
UNO structures are just that, data structures, not classes with their 
own methods.

So in order to do something with them, you can
a) convert the rectangles into a class, eg from basegfx, or
b) just write the operation down.

I chose the later because a) may have lead to even more code.


But in general you are right.  We have to many versions of certain 
classes/structs.  At least two types of rectangles alone in the UNO API. 
  More string classes than I care to remember.

Cleaning this up would be a good thing.

Regards,
Andre


On 24.01.2012 11:55, eric b wrote:
> Hi,
>
> Hacking the Presenter Screen (trying to implement the Presentation timer
> reset because I need it), I found yet another definition of bIsInside
> [an area, a rectangle]. I know there is a similar definition in tools
> (gen.hxx) and using Opengrok, I found other places where IsInside a
> given [rR]ectangle is defined. e.g. : sw/source/core/bastyp/swrect.cxx,
> reportdesign/source/core/sdr/RptObject.cxx ... and so on.
>
> Reading the gen.cxx implementation, I have some doubts (strange
> rectangle with inverted axes), but is there a good reason to repeat the
> same definition several times in the code ? What about factorize and
> simplify that ? e.g. we could propose a list of tasks for newcomers,
> reserved to people who want to discover Apache OpenOffice source code ?
>
> Thanks in advance,
> Eric Bachard
>