diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2019-03-11 09:57:38 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2019-03-12 10:21:52 +0100 |
commit | fde00c42b169d80c9fe850d4876a0d0e5d6744a6 (patch) | |
tree | d83280152cf7a4beca171069d083866d57f4975e /dbaccess | |
parent | 80aec8ef2a333890d46c4258f84af6b8f81832a8 (diff) |
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: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/filter/xml/xmlExport.cxx | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/dbaccess/source/filter/xml/xmlExport.cxx b/dbaccess/source/filter/xml/xmlExport.cxx index e0cd1a11f5e7..f31f500d252e 100644 --- a/dbaccess/source/filter/xml/xmlExport.cxx +++ b/dbaccess/source/filter/xml/xmlExport.cxx @@ -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 ) }; |