Bug 84380 - Cleanup: Reduce copy&paste in fudraw.cxx
Summary: Cleanup: Reduce copy&paste in fudraw.cxx
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
(earliest affected) Master
Hardware: Other All
: medium normal
Assignee: Victor Sanches Portella
Whiteboard: target:4.4.0
Keywords: difficultyBeginner, easyHack, skillCpp
Depends on:
Reported: 2014-09-26 22:57 UTC by Samuel Mehrbrodt (allotropia)
Modified: 2015-12-15 23:36 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:

git diff of the fudraw.cxx file at sd/source/ui/func (7.14 KB, text/plain)
2014-11-03 17:25 UTC, Victor Sanches Portella

Note You need to log in before you can comment on or make changes to this bug.
Description Samuel Mehrbrodt (allotropia) 2014-09-26 22:57:09 UTC
The MouseButtonDown and MouseMove methods in http://opengrok.libreoffice.org/xref/core/sd/source/ui/func/fudraw.cxx share a lot of code.

This needs to be cleaned up and the shared code put in a method which both call (this file has the same methods and can serve as reference: http://opengrok.libreoffice.org/xref/core/sc/source/ui/drawfunc/fudraw.cxx).
Comment 1 Victor Sanches Portella 2014-10-10 21:31:10 UTC
I'll work on this. It'll be my first contribution, but the work to be done here looks pretty simple, so i guess i won't have many problems.
Comment 2 Victor Sanches Portella 2014-11-03 17:25:06 UTC
Created attachment 108854 [details]
git diff of the fudraw.cxx file at sd/source/ui/func
Comment 3 Victor Sanches Portella 2014-11-03 17:32:50 UTC
Sorry for the double comment... forgot to write the message.

So, sorry for taking so long to do something, but here it is.

I'm having problems in setting up gerrit. I hope i get it working by the end of the day, but i uploaded the git diff of the fudraw.cxx file, so you can say if it is possible to move more things do the DoModifiers and things like that.

I thought i would be able to move a lot of things to the new function, like in the fudraw file Samuel passed as a reference, but there were some differences in the code of both functions, although very similar.

About gerrit, i'm following the tutorial to set it up, but when i try ./logerrit test, it says it has a problem, and when i run ssh -vvvv logerrit, i get the message: "Could not resolve hostname logerrit: Name or service not known"

I also tryed to run "ssh -vvvv gerrit.libreoffice.org", but then i get "Permission denied (publickey)." And yes, i created an account at gerrit and put my public key there. It is the same key i use for github...so i'm kinda lost.

Well, i'll keep trying guys. If you could already give me some feedback, it would be great.
Comment 4 Samuel Mehrbrodt (allotropia) 2014-11-04 15:12:50 UTC
Hi Victor,
thanks for the patch!

Can you please make sure to have a license statement listed here: https://wiki.documentfoundation.org/Development/Developers

For help with gerrit, you might ask in IRC.
Comment 5 Victor Sanches Portella 2014-11-05 19:59:22 UTC
Hi! I was able to solve my gerrit problem by my self, and already pushed my commit for review:


I think i didn't commit right. If i understood right, usually there is a automatic comment in the bug's post when a person pushes a commit for a bug. Well, i'll try to get it right next time. Now i'll wait for the review.
Comment 6 Adolfo Jayme Barrientos 2014-11-06 05:10:35 UTC
(In reply to Victor Sanches Portella from comment #5)
> I think i didn't commit right. If i understood right, usually there is a
> automatic comment in the bug's post when a person pushes a commit for a bug.

The commit notification is triggered when the patch passes review.
Comment 7 Commit Notification 2014-11-06 18:21:29 UTC
Victor Portella committed a patch related to this issue.
It has been pushed to "master":


fdo#84380 Remove repeated mouse handling code

It will be available in 4.4.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
Affected users are encouraged to test the fix and report feedback.
Comment 8 Robinson Tryon (qubit) 2015-12-15 23:36:13 UTC
Migrating Whiteboard tags to Keywords: (EasyHack DifficultyBeginner SkillCpp )