[Libreoffice-commits] core.git: dbaccess/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Mar 12 09:22:14 UTC 2019
dbaccess/source/filter/xml/xmlExport.cxx | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
New commits:
commit fde00c42b169d80c9fe850d4876a0d0e5d6744a6
Author: Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Mon Mar 11 09:57:38 2019 +0300
Commit: Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Tue Mar 12 10:21:52 2019 +0100
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 at collabora.com>
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 )
};
More information about the Libreoffice-commits
mailing list