On Mon, Mar 18, 2013 at 02:41:12PM -0600, jorge ivan poot diaz wrote: > where's the code that registers the new color? > > The button to add colors, now I want to know where is the code that > > registers the colors.
Once you have found where the source code for that tab page is, build cui (or this file) with debug symbols, set a break point, and start learning by debugging. There is no other way. I already pointed you in another mail where to look. Try to locate in cui/source/tabpages/tpcolor.cxx the button that you press to add a new color. It is named aBtnAdd. When you insert a push button, you may want to get notified when the user pushed it: this is done in the constructor SvxColorTabPage::SvxColorTabPage aBtnAdd.SetClickHdl( LINK( this, SvxColorTabPage, ClickAddHdl_Impl ) ); In IMPL_LINK( SvxColorTabPage, ClickAddHdl_Impl, void *, EMPTYARG ) http://opengrok.adfinis-sygroup.org/source/xref/aoo-trunk/main/cui/source/tabpages/tpcolor.cxx#465 you can see the code that triggered the dialog in http://imagebin.org/250778 In the same place is the code that "adds" the new color: http://opengrok.adfinis-sygroup.org/source/xref/aoo-trunk/main/cui/source/tabpages/tpcolor.cxx#525 525 pEntry = new XColorEntry( aAktuellColor, aName ); 526 527 pColorTab->Insert( pColorTab->Count(), pEntry ); Of course, to understand how this ends up in an XML file named standard.soc in <user directory>/config/standard.soc you will have to study the code. I already told in other mail that you will end up in the class XColorTable, in the svx module. In a project so complex like this, there isn't a single place in a source file where something is done as an atomic, isolated action; so you won't find the "code that registers the colors", there are several classes, in several modules. IMHO the only way to progress diving into this, is building with debug symbols, and start learning by debugging. Regards -- Ariel Constenla-Haile La Plata, Argentina
pgpfWrIQq7lOV.pgp
Description: PGP signature