| View previous topic :: View next topic |
| Author |
Message |
Omar Power User

Joined: 24 Aug 2004 Posts: 85
|
Posted: Tue Jan 11, 2005 12:36 pm Post subject: registry database filename truncated in C++ |
|
|
I've run across an odd error involving the OpenOffice.org registry database and was hoping that someone else may have had a similar experience and knows of a solution. The registry database file is created at /office/DocumentConversion.rdb using the regmerge and regcomp programs in the <OOo_HOME>/linux/bin directory of the SDK. When my main program tries to access the registry database in order to convert some documents, the program crashes. I put in some debugging info and found that it crashes when trying to open the registry with the following command where REGISTRY_DATABASE is a string set to "/office/DocumentConversion.rdb":
| Code: |
xSimpleRegistry->open( OUString( RTL_CONSTASCII_USTRINGPARAM(string(REGISTRY_DATABASE).c_str()) ), sal_True, sal_False);
|
Doing an strace on the execution showed me that the program first opens and closes '/office/DocumentConversion.rdb" then attempts to open the file "/of" and crashes. I tried changing the REGISTRY_DATABASE variable to "/root/registry.rdb" and the system then opened/closed "/root/registry.rdb" then tried to open "/ro" and crashes.
The only work-around I've found so far is to either copy the registry to both "/office/DocumentConversion.rdb" and "/of" or create a symbolic link that points "/of" to "/office/DocumentConversion.rdb". With the work-around in place the program works fine and the database is loaded correctly. The other option I've found that works is to set the REGISTRY_DATABASE variable to a 3 character file name. Thus the file location isn't affected when the file name is truncated down to three characters.
I've run the code on two development machines, one with OpenOffice.org 1.1.3 and the other with OpenOffice.org 1.1.4 and the error crops up on both. I haven't tried regressing as far back as OpenOffice.org 1.1.2.
Both systems are Linux boxes running Fedora Core 3 with gcc 3.3 compatability since gcc 3.4 isn't supported by the OOo SDK.
-Omar |
|
| Back to top |
|
 |
SergeM Super User

Joined: 09 Sep 2003 Posts: 3211 Location: Troyes France
|
|
| Back to top |
|
 |
|