Libre Office Hack

Libre office is a free and open source office suite developed by The Document Foundation. If you find any bug with libreoffice kindly file it to bugzilla, other links to guide you to report bug is given in the end of this post.

Now being a developer you should also to try to fix the bug. If you dont want to work on any bug then you can just try to look into the code. So to put your hands in hacking libre office, we will follow following steps.. <all related links are provided at the end of the post..>

  1. First of all get libre office soure code, either directly from git, or as bundle(.tar.gz).
  2. Now build the source code using following commands. First of all open the terminal and go to the directory of libreoffice source code ( lets assume your directory is /home/documents/libo/)
  • cd /home/documents/libo/
  • make
  • make dev-install
  • make debugrun
  • cd install/program
  • ./soffice                          #to start libreoffice
  • ./scalc                             #if u want to open calc only

3. This will start your libreoffice.

4. Now if you want to make changes in any features, then you have to find out where is the relevant code. Since you don’t know whole code and its structure, so we will use http://opengrok.libreoffice.org

On this site you search for some key words, you will get many results. To be specific lets pick a task, which is described as follows..

In libre office calc, vertical auto fill is working, but horizontal auto fill is not working. To use auto fill user will select all already filled cells and double click on the last cell, it will auto fill the rest of the relevant cells with appropriate values.

To enable horizontal auto fill we would like to search a function which is responsible to call which is being invoked when we double click. so we will seach for autofill or fillauto. (always remember that we dont know the name of the functions etc, so we have to guess and search for that). After doing some search you will be able to find out few functions which will be useful to us. For current issue we have to reach  /core/sc/source/ui/view/viewfun2.cxx file and relevant function is void ScViewFunc::FillCrossDblClick(). It calls FillAuto( FILL_TO_BOTTOM, nStartX, nStartY, nEndX, nEndY,nMovY – nEndY );

Now you can study this function and find out what changes are required to enable horizontal auto fill also.

5. After making changes again given make command and then execute /install/program/./scalc or ./soffice

6.  If you are still unable to reflect the changes in the program you can use break points etc, you can put printf() statements to check where something is being executed or not. Note, the printf() command will print the output when you will close your program.

7. Now your patch is ready. You can submit it to libreoffice through gerrit. I will put a separate post about gerrit later.

Hope the post was useful. You may find difficulty in hacking for the first time, but remember you have to work hard, and should not give up if things are not going accordingly. You can get help from libreoffice mailing list, if you have any doubt, just drop a mail to the mailing list(after subscribing to the list), experts will help you out. I expect your comment for any suggestions/query/improvement in the post etc. Thanks.

Given below is the list of resources..

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s