Hi Jorge,

On Wed, Feb 13, 2013 at 07:27:05PM -0600, jorge ivan poot diaz wrote:
> Hello Ariel,
> 
> I did the steps you said, the compilation was successful, I made two copies
> too. Now when I click the button about not the message.
> 
> And another point the basis that I have is the basis3.4.

Are you building with sources checked out using subversion/git-svn? If
so, you need to update your working copy, revision 1442743 updated the
version number from 3.5 to 4.0 (quite strange you have 3.4).

Configure with --with-package-format="installed"
It will generate an installation in
main/instsetoo_native/<unxlngx6>/Apache_OpenOffice/installed/install/en-US/
Copy the two directories there to your $HOME

This in-build installation uses its own user profile, you can play with
it without overwriting any existing configuration. You can also
customize the user directory by modifying
$HOME/apache_openoffice4/program/bootstraprc, the line

UserInstallation=$ORIGIN/../.apacheopenoffice/4

> Instead unxlngx6 I have a unxlngi6.pro

.pro means a product build. You can build a non-product build, see
http://wiki.openoffice.org/wiki/Non_Product_Build

Configure with --enable-dbgutil

> How I can do a debug mode?

Usually you build the modules you are interested in with debug switch.

If the module is ported to gbuild (you know this because in the module
folder there is a Module_<module>.mk, like framework/Module_framework.mk):


touch the files you want tor recompile with debugging symbols, or simply
clean the whole module:

cd main/framework
touch <some_file>
or
make -sr DEBUG=yes clean

then build with debug:

make -sr DEBUG=yes

You'll find the framework libraries in
main/solver/<400>/<unxlngx6>/workdir/LinkTarget/Library/lifw*.so

Copy the library to $HOME/apacheopenoffice/basis4.0/program/


If the module is not ported to gbuild the output is in the same folder,
and then copied to the solver:

cd cui
rm -rf <unxlngx6>/
build debug=true dbglevel=3 -- -P2 && deliver

The libraries are in main/<module>/<unxlngx6>/lib/.



Note that you need to configure with --disable-strip-solver because, if
not, the libraries are stripped before delivering them to the solver.


Once you have compiled with debug, launch OpenOffice and attach the
debugger, a way of doing this:

in on terminal

$HOME/apache_openoffice/program/soffice


in another terminal

gdb attach `pgrep soffice.bin`


Set a break point, and continue, for example:

break AboutDialog::AboutDialog
c


> Where I can find more information about the debug mode?

I'm not sure if there is something in the wiki.

> Where there is more current tutorials that this tutorial about?

AFAIK there are no up-to-date development tutorials. I guess developers
don't like writing documentation, it would imply maintaining the source
code and the tutorial as the source code gets modified...

> Where I can find more tutorials updated to make them?

May be it's better to pick up an easy bug, and try to fix it. Now that
you've been in the cui module, take for example

https://issues.apache.org/ooo/show_bug.cgi?id=121706


This is my tutorial to get started with this bug (you may find the tips
useful for other cases):



- Open a new Writer document

- select the menu Format - AutoCorrect - AutoCorrect Options...

- select the tab "Word Completion"

The bug is about the number of max. entries, the last metric field in
that tab page. We are going to find where that metric field is defined.
For this, let's search for the whole tab page definition, using one of
the strings.

To start investigating, search in opengrok for a string (you must have
the user interface in English, so that you see English strings in order
to find them in .src files). For example, "Enable word ~completion" (the
string "~Max. entries" might be not quite unique).

http://opengrok.adfinis-sygroup.org/source/search?q=%22Enable+word+~completion%22&defs=&refs=&path=&hist=&project=aoo-trunk

With the AboutDialog example, you have learnt that the dialog structure
is defined in a *.src file, so dismiss all the results, looking only for
a file with extension src

http://opengrok.adfinis-sygroup.org/source/search?q=%22Enable+word+~completion%22&defs=&refs=&path=src&hist=&project=aoo-trunk

/aoo-trunk/main/cui/source/tabpages/
H A D   autocdlg.src    709 Text [ en-US ] = "Enable word ~completion";


Now you know that trunk/main/cui/source/tabpages/autocdlg.src is your
starting point.

TabDialog RID_OFA_AUTOCORR_DLG defines the structure of the whole tab
dialog.

PageItem RID_OFAPAGE_AUTOCOMPLETE_OPTIONS is the AutoCorrect tab page.

Dialogs and controls are identified by its IDs, so look for
RID_OFAPAGE_AUTOCOMPLETE_OPTIONS in
trunk/main/cui/source/tabpages/autocdlg.src and you'll find the tab page
definition:


TabPage RID_OFAPAGE_AUTOCOMPLETE_OPTIONS


In the tab page definition, look for the metric field control:

NumericField NF_MAX_ENTRIES

The name of the ID suggests this is the control to investigate. In fact,
it has the values:

795     Value = 500 ;
796     Maximum = 10000;
797     Last = 10000 ;
798     First = 50 ;
799     Minimum = 50;
800     SpinSize = 25 ;


Could the Maximum be changes to 50000, as asked in the issue?
You need to investigate if the code, both in the dialog and the
application, can cope with this number.

The dialog code is in the same folder as the autocdlg.src:

autocdlg.cxx    19-Apr-2012 92.7 KiB
autocdlg.hrc    19-Apr-2012 5.6 KiB
autocdlg.src    19-Apr-2012 22.9 KiB

the header is in trunk/main/cui/source/inc/autocdlg.hxx


Now that you know the ID, search the ID in aboutcdlg.cxx, you'll find
that the control is constructed with this ID:

aNFMaxEntries   (this, CUI_RES(NF_MAX_ENTRIES)),


so, we've found that aNFMaxEntries is the control, defined in
trunk/main/cui/source/inc/autocdlg.hxx

NumericField    aNFMaxEntries;


Investigate if a NumericField can handle a value like 50,000
http://opengrok.adfinis-sygroup.org/source/xref/aoo-trunk/main/vcl/inc/vcl/field.hxx#519
http://opengrok.adfinis-sygroup.org/source/xref/aoo-trunk/main/vcl/source/control/field.cxx#813

look for the GetValue method, it seems it returns sal_Int64, a signed
64 bit integer...


Investigate if the code in the tab page is handling 64 bit integers,
search for aNFMaxEntries in trunk/main/cui/source/tabpages/autocdlg.cxx

2463    sal_uInt16 nVal;
2485    nVal = (sal_uInt16)aNFMaxEntries.GetValue();


The value is stored in an unsigned 16 bit integer.

The line where the value is assigned will give also some clues:

pOpt->nAutoCmpltListLen = nVal;


Investigate what pOpt is, how it stored this value, can it hold a number
like 50,000?

Then, you have to find the application code, in the module sw (Writer
core code).

I'd suggest you search for nAutoCmpltListLen:

- first, the definition:

http://opengrok.adfinis-sygroup.org/source/search?q=&defs=nAutoCmpltListLen&refs=&path=&hist=&project=aoo-trunk
(discard binfilter results)

- second, search the symbol in sw.

http://opengrok.adfinis-sygroup.org/source/search?q=&defs=&refs=nAutoCmpltListLen&path=sw&hist=&project=aoo-trunk

the results will lead you to SwAutoCompleteWord.

In short, it seems that internally an unsigned 16 bits integer is used.


With all the above you have some insight how to investigate this bug,
and even fix it ;) (more fun that a dummy tutorial)

The bug is easy to fix, the other respective bug is more complex:
https://issues.apache.org/ooo/show_bug.cgi?id=121705
And the other related bug about the size of the AutoCorrect entries
https://issues.apache.org/ooo/show_bug.cgi?id=87672 is even more
complex, it implies changing the underlying data structures. But nothing
is impossible, once you get started, and get the gratifying feeling of
fixing something that will be useful for more than 35,000 users.



Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina

Attachment: pgpdGog7IlWZx.pgp
Description: PGP signature

Reply via email to