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

--- Comment #20 from Ariel Constenla-Haile <[email protected]> ---
(In reply to Oliver-Rainer Wittmann from comment #19)
> The strange thing is, why the AOO 4.0.0 created document works in AOO 4.0.0.
> I save and deleted the user profile of this installation. Afterwards, the
> AOO 4.0.0 created document no longer works in this instance. Is the defect
> depending on a certain configuration??

Yes, because the code in const SwDBData& SwDoc::GetDBDesc() calls const
SwDBData& SwNewDBMgr::GetAddressDBName() when
(!aDBData.sDataSource.getLength())

This is sw/source/ui/dbui/dbmgr.cxx
const SwDBData&    SwNewDBMgr::GetAddressDBName()
{
    return SW_MOD()->GetDBConfig()->GetAddressSource();
}

SwDBConfig
sw/source/ui/inc/dbconfig.hxx
sw/source/ui/config/dbconfig.cxx

reads the configuration under

"org.openoffice.Office.DataAccess/AddressBook/DataSourceName"
"org.openoffice.Office.DataAccess/AddressBook/Command"
"org.openoffice.Office.DataAccess/AddressBook/CommandType"

(officecfg/registry/schema/org/openoffice/Office/DataAccess.xcs)

Following comment 15:

If the document settings are set in the following order:

1. CurrentDatabaseCommand = biblio
2. CurrentDatabaseDataSource = Bibliography
3. CurrentDatabaseCommandType = 0

A) Supposing that there is no address book set

- step 1 sets aDBData with ( sDataSource = ""; sCommand = "biblio";
nCommandType = 0)
Here, because aDBData.sDataSource is empty, (!aDBData.sDataSource.getLength())
evaluates to true, and aDBData is reset with the empty address-book, so the
value in sCommand is lost in step 2.
- step 2 with ( sDataSource = "Bibliography"; sCommand = ""; nCommandType = 0)
- step 3 with ( sDataSource = "Bibliography"; sCommand = ""; nCommandType = 0)


B) Supposing that there *is* an address book:
DataSourceName = MyAddressBook
Command = MyTable
CommandType = 0

- step 1 sets aDBData with ( sDataSource = "MyAddressBook"; sCommand =
"biblio"; nCommandType = 0)
at this point, because aDBData was filled with an addressbook from the
configuration, (!aDBData.sDataSource.getLength()) will evaluate to false in the
next call, and aDBData will not be reset in step 2, as it was in the case when
there is no address source.
- step 2 with ( sDataSource = "Bibliography"; sCommand = "biblio"; nCommandType
= 0)
- step 3 with ( sDataSource = "Bibliography"; sCommand = "biblio"; nCommandType
= 0)


Without a valid address-book datasource name, it all depends on the order in
which the DB document settings are set, and CurrentDatabaseDataSource must be
the first.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are watching all bug changes.

Reply via email to