This is an automated email from the ASF dual-hosted git repository.
ardovm pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/trunk by this push:
new 430d1577c6 Ignore meaningless attributes
430d1577c6 is described below
commit 430d1577c639ad8ba4ece164a179111734112fd9
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]>
---
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 0d26ccaff0..743db1f830 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 7625997929..bcf2461efe 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 69348d3166..a29fc19aa8 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;
@@ -741,7 +742,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
@@ -954,7 +955,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;