[Libreoffice-commits] core.git: dbaccess/source

Lionel Elie Mamane lionel at mamane.lu
Wed Apr 18 19:15:34 UTC 2018


 dbaccess/source/ui/dlg/DbAdminImpl.cxx |   13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

New commits:
commit d6fce54c82868b82bd6fa190db6047d69bbb3ecf
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Wed Apr 18 18:54:05 2018 +0200

    tdf#117053 create database wizard: set a property when it is supported
    
    not only when we let the *user* set it in the "Advanced Settings" dialog.
    
    There are two notions:
    1) Does the driver/datasource support a property
    2) Do we show the user any UI in "Advanced Settings" to change that
       property.
    
    Notion 2 is called a _Feature_, notion 1 a _property_.
    
    Database creation was saving properties only in case 2; the right
    test is obviously case 1.
    
    Change-Id: Ie740c9eb6768ae5f412a49119201e9211a9cd07d
    Reviewed-on: https://gerrit.libreoffice.org/53121
    Reviewed-by: Lionel Elie Mamane <lionel at mamane.lu>
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
index 3f89b70a3845..49cdf5756619 100644
--- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx
+++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
@@ -690,18 +690,19 @@ void ODbDataSourceAdministrationHelper::fillDatasourceInfo(const SfxItemSet& _rS
     // us)
 
     // first determine which of all the items are relevant for the data source (depends on the connection url)
-    OUString eType = getDatasourceType(_rSource);
-    std::vector< sal_Int32> aDetailIds;
-    ODriversSettings::getSupportedIndirectSettings(eType, getORB(), aDetailIds);
+    const OUString eType = getDatasourceType(_rSource);
+    const ::connectivity::DriversConfig aDriverConfig(getORB());
+    const ::comphelper::NamedValueCollection& aProperties = aDriverConfig.getProperties(eType);
 
     // collect the translated property values for the relevant items
     PropertyValueSet aRelevantSettings;
     MapInt2String::const_iterator aTranslation;
-    for (auto const& detailId : aDetailIds)
+    for (ItemID detailId = DSID_FIRST_ITEM_ID ; detailId <= DSID_LAST_ITEM_ID; ++detailId)
     {
         const SfxPoolItem* pCurrent = _rSource.GetItem(static_cast<sal_uInt16>(detailId));
         aTranslation = m_aIndirectPropTranslator.find(detailId);
-        if ( pCurrent && (m_aIndirectPropTranslator.end() != aTranslation) )
+        if ( pCurrent && (m_aIndirectPropTranslator.end() != aTranslation) &&
+             aProperties.has(aTranslation->second) )
         {
             if ( aTranslation->second == INFO_CHARSET )
             {
@@ -773,8 +774,6 @@ void ODbDataSourceAdministrationHelper::fillDatasourceInfo(const SfxItemSet& _rS
             ::comphelper::removeElementAt(_rInfo, removeIndex);
     }
 
-    ::connectivity::DriversConfig aDriverConfig(getORB());
-    const ::comphelper::NamedValueCollection& aProperties = aDriverConfig.getProperties(eType);
     Sequence< Any> aTypeSettings;
     aTypeSettings = aProperties.getOrDefault("TypeInfoSettings",aTypeSettings);
     // here we have a special entry for types from oracle


More information about the Libreoffice-commits mailing list