This is an automated email from the ASF dual-hosted git repository. ardovm pushed a commit to branch AOO41X in repository https://gitbox.apache.org/repos/asf/openoffice.git
commit db366f5c060b6b27ed8d340bc22fba30a017dcf2 Author: Piotr P. Karwasz <[email protected]> AuthorDate: Sat Oct 3 20:44:25 2026 +0200 Ignore meaningless attributes Stop recognizing the db:java-classpath attribute, and drop JavaDriverClassPath and SystemProperties when importing data source settings. Assisted-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit 430d1577c639ad8ba4ece164a179111734112fd9) --- main/dbaccess/source/filter/xml/xmlDataSource.cxx | 3 --- main/dbaccess/source/filter/xml/xmlEnums.hxx | 1 - main/dbaccess/source/filter/xml/xmlfilter.cxx | 18 ++++++++++++++++-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/main/dbaccess/source/filter/xml/xmlDataSource.cxx b/main/dbaccess/source/filter/xml/xmlDataSource.cxx index 478f3144fd..7411c4d653 100644 --- a/main/dbaccess/source/filter/xml/xmlDataSource.cxx +++ b/main/dbaccess/source/filter/xml/xmlDataSource.cxx @@ -189,9 +189,6 @@ OXMLDataSource::OXMLDataSource( ODBFilter& rImport, aProperty.Name = INFO_CONN_LDAP_ROWCOUNT; aProperty.Value <<= sValue.toInt32(); break; - case XML_TOK_JAVA_CLASSPATH: - aProperty.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("JavaDriverClassPath")); - break; } if ( aProperty.Name.getLength() ) { diff --git a/main/dbaccess/source/filter/xml/xmlEnums.hxx b/main/dbaccess/source/filter/xml/xmlEnums.hxx index f104b2cf3c..355c66cd79 100644 --- a/main/dbaccess/source/filter/xml/xmlEnums.hxx +++ b/main/dbaccess/source/filter/xml/xmlEnums.hxx @@ -81,7 +81,6 @@ namespace dbaxml XML_TOK_DATABASE_NAME, XML_TOK_CONNECTION_DATA, XML_TOK_DRIVER_SETTINGS, - XML_TOK_JAVA_CLASSPATH, XML_TOK_CHARACTER_SET, XML_TOK_APPLICATION_CONNECTION_SETTINGS }; diff --git a/main/dbaccess/source/filter/xml/xmlfilter.cxx b/main/dbaccess/source/filter/xml/xmlfilter.cxx index c6ae68840e..ca1b94278f 100644 --- a/main/dbaccess/source/filter/xml/xmlfilter.cxx +++ b/main/dbaccess/source/filter/xml/xmlfilter.cxx @@ -132,6 +132,7 @@ #include <connectivity/CommonTools.hxx> #include <connectivity/DriversConfig.hxx> #include "dsntypes.hxx" +#include <set> using namespace ::com::sun::star; @@ -743,7 +744,7 @@ const SvXMLTokenMap& ODBFilter::GetDataSourceElemTokenMap() const { XML_NAMESPACE_DB, XML_LOCAL_SOCKET, XML_TOK_LOCAL_SOCKET}, { XML_NAMESPACE_DB, XML_DATABASE_NAME, XML_TOK_DATABASE_NAME}, { XML_NAMESPACE_DB, XML_DRIVER_SETTINGS, XML_TOK_DRIVER_SETTINGS}, - { XML_NAMESPACE_DB, XML_JAVA_CLASSPATH, XML_TOK_JAVA_CLASSPATH}, + // db:java-classpath is intentionally not mapped { XML_NAMESPACE_DB, XML_CHARACTER_SET, XML_TOK_CHARACTER_SET}, { XML_NAMESPACE_DB, XML_APPLICATION_CONNECTION_SETTINGS,XML_TOK_APPLICATION_CONNECTION_SETTINGS}, XML_TOKEN_MAP_END @@ -956,7 +957,20 @@ void ODBFilter::setPropertyInfo() Sequence<PropertyValue> aInfo; if ( !m_aInfoSequence.empty() ) - aInfo = Sequence<PropertyValue>(&(*m_aInfoSequence.begin()),m_aInfoSequence.size()); + { + // Ignore UNO property names that do not belong to documents. + static const ::std::set< ::rtl::OUString > s_aDeniedSettings = { + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "JavaDriverClassPath" ) ), + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SystemProperties" ) ) + }; + ::std::vector< PropertyValue > aAccepted; + aAccepted.reserve( m_aInfoSequence.size() ); + for ( const auto & i : m_aInfoSequence ) + if ( s_aDeniedSettings.find( i.Name ) == s_aDeniedSettings.end() ) + aAccepted.push_back( i ); + if ( !aAccepted.empty() ) + aInfo = Sequence<PropertyValue>( &(*aAccepted.begin()), aAccepted.size() ); + } aDataSourceSettings.merge( ::comphelper::NamedValueCollection( aInfo ), true ); aDataSourceSettings >>= aInfo;
