Skip to content

Instantly share code, notes, and snippets.

@jessoclarence
jessoclarence / onmacros.cpp
Created July 29, 2012 10:14
Life before templates
#include<iostream>
/** Example is very simple, see LibreOffice code for
real world/complicated examples.
Code is unnecessarily bloated to be clear.
*/
//Macro to create template like functions
#define ADD_FUNC(ret,typedesc) \
typedesc add##ret(typedesc a, typedesc b){\
typedesc c; \
@jessoclarence
jessoclarence / Menu Dropdown
Created July 11, 2012 08:24
Understanding LibreOffice Source Code
Menu Dropdown
I put a breakpoint at libo/vcl/source/window/winproc.cxx:2405, at the case SAL_EVENTMOUSEDOWN, to see
what happens when I click a mouse.
I clicked on File Menu, it hit the breakpoint. Then off it goes to calls ImplHandleSalMouseButtonDown ()
with the following details stored in pEvent and pWindow.
pEvent
mnTime = 78764380 //Time
@jessoclarence
jessoclarence / Debugging LibreOffice - Create Table
Created July 3, 2012 06:43
Understanding LibreOffice Source Code
Aim
To make sense of LibreOffice source code. I plan to put a breakpoint in the constructors of
SwTableBox, and then get the back trace to see the flow and gain a little understanding of what's
going on. This is post is aimed at beginners, so a little knowledge of C++/Java should be able to
get one through this.
[A Little Background Info (Skip this)
I'm a programmer from the Center for Development of Advanced Computing (CDAC), India, currently