Bug 124553

Summary: Add adjustX method to B2DPoint
Product: LibreOffice Reporter: Alexander Farrow <alexanderfarrow>
Component: LibreOfficeAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED NOTABUG    
Severity: enhancement CC: rb.henschel, telesto
Priority: medium    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:

Description Alexander Farrow 2019-04-04 17:28:20 UTC
Description:
Recently I have been looking into resolving https://bugs.documentfoundation.org/show_bug.cgi?id=103322

This involves changing the types of variables from tools::Point to basegfx::B2DPoint.

tools::Point has a method called AdjustX(long nHorzMove), which adds nHorzMove to x.

basegfx::B2DPoint does not have such a method. So calls to AdjustX(nHorzMove) are being replaced by something like setX(getX() + nHorzMove).

It works fine of course but I think adjustX looks cleaner and it feels like a step backwards when moving from tools::Point to basegfx::B2DPoint. 

A quick OpenGrok search for AdjustX reveals it is used frequently in the codebase, so it makes sense to add it to B2DPoint.

If it is agreed that we should add such a method I would like to try to implement it.


Actual Results:
basegfx::B2DPoint does not have a method similar to tools::Point AdjustX method. 

Expected Results:
basegfx::B2DPoint has a method like tools::Point AdjustX.


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 Regina Henschel 2019-04-05 17:34:36 UTC
Perhaps the dev mailing list is more suitable than the bug tracker for such a problem?
Comment 2 Alexander Farrow 2019-04-05 17:46:18 UTC
(In reply to Regina Henschel from comment #1)
> Perhaps the dev mailing list is more suitable than the bug tracker for such
> a problem?

Sorry, I'm new to LibreOffice. I wasn't sure where the best place was for a developer question. I'll send an email to the mailing list now.

Thanks for your help