Kaydet (Commit) fde00c42 authored tarafından Mike Kaganski's avatar Mike Kaganski

tdf#121092: save db:suppress-version-columns to ODB

The setting is only available from ODatabaseSource itself, not from
its Settings property. So treat it separately on export (it is also
treated separately at import: see OXMLDataSource::OXMLDataSource).

Change-Id: I2ecdea8748e95380c123afdb9507dfa5a4abd838
Reviewed-on: https://gerrit.libreoffice.org/69031
Tested-by: Jenkins
Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst 80aec8ef
......@@ -295,6 +295,17 @@ void ODBExport::exportDataSource()
static OUString s_sFalse(::xmloff::token::GetXMLToken( XML_FALSE ));
// loop through the properties, and export only those which are not defaulted
TSettingsMap aSettingsMap;
// Don't try to get XPropertySetInfo from xProp, simply wrap the attempt into try block
try
{
const Any aValue = xProp->getPropertyValue(PROPERTY_SUPPRESSVERSIONCL);
if (!getBOOL(aValue)) // default in the XML schema is true -> only write false
aSettingsMap.emplace(XML_SUPPRESS_VERSION_COLUMNS, s_sFalse);
}
catch (const UnknownPropertyException&)
{
}
Sequence< Property > aProperties = xSettingsInfo->getProperties();
const Property* pProperties = aProperties.getConstArray();
const Property* pPropertiesEnd = pProperties + aProperties.getLength();
......@@ -358,7 +369,6 @@ void ODBExport::exportDataSource()
PropertyMap( INFO_PARAMETERNAMESUBST, XML_PARAMETER_NAME_SUBSTITUTION, s_sTrue ),
PropertyMap( INFO_IGNOREDRIVER_PRIV, XML_IGNORE_DRIVER_PRIVILEGES, s_sTrue ),
PropertyMap( INFO_USECATALOG, XML_USE_CATALOG, s_sFalse ),
PropertyMap( PROPERTY_SUPPRESSVERSIONCL,XML_SUPPRESS_VERSION_COLUMNS, s_sTrue ),
PropertyMap( INFO_CONN_LDAP_BASEDN, XML_BASE_DN ),
PropertyMap( INFO_CONN_LDAP_ROWCOUNT, XML_MAX_ROW_COUNT )
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment