summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2019-03-10 00:48:06 +0100
committerMike Kaganski <mike.kaganski@collabora.com>2019-03-10 05:26:49 +0100
commit25a4ff61d34aa5c5ab94bbc16724121f436c6074 (patch)
treeb72c87bce9046f01e46907c303a0b2809a4ed038 /dbaccess
parent03b6c20c66047af41ed2f78fe5dd229cd06392e8 (diff)
Simplify SpecialSettingsPage's booleans initialization
Change-Id: I2e1e55d4111e3c996afc27e8970af331b5d76613 Reviewed-on: https://gerrit.libreoffice.org/68988 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/ui/dlg/advancedsettings.cxx50
-rw-r--r--dbaccess/source/ui/dlg/advancedsettings.hxx1
2 files changed, 17 insertions, 34 deletions
diff --git a/dbaccess/source/ui/dlg/advancedsettings.cxx b/dbaccess/source/ui/dlg/advancedsettings.cxx
index 4d70f2827a38..0dbf6ab32afe 100644
--- a/dbaccess/source/ui/dlg/advancedsettings.cxx
+++ b/dbaccess/source/ui/dlg/advancedsettings.cxx
@@ -56,12 +56,26 @@ namespace dbaui
// SpecialSettingsPage
SpecialSettingsPage::SpecialSettingsPage(TabPageParent pParent, const SfxItemSet& _rCoreAttrs, const DataSourceMetaData& _rDSMeta)
: OGenericAdministrationPage(pParent, "dbaccess/ui/specialsettingspage.ui", "SpecialSettingsPage", _rCoreAttrs)
- , m_aBooleanSettings()
+ , m_aBooleanSettings {
+ { m_xIsSQL92Check, "usesql92", DSID_SQL92CHECK, false, false },
+ { m_xAppendTableAlias, "append", DSID_APPEND_TABLE_ALIAS, false, false },
+ { m_xAsBeforeCorrelationName, "useas", DSID_AS_BEFORE_CORRNAME, false, false },
+ { m_xEnableOuterJoin, "useoj", DSID_ENABLEOUTERJOIN, false, false },
+ { m_xIgnoreDriverPrivileges, "ignoreprivs", DSID_IGNOREDRIVER_PRIV, false, false },
+ { m_xParameterSubstitution, "replaceparams", DSID_PARAMETERNAMESUBST, false, false },
+ { m_xSuppressVersionColumn, "displayver", DSID_SUPPRESSVERSIONCL, true, false },
+ { m_xCatalog, "usecatalogname", DSID_CATALOG, false, false },
+ { m_xSchema, "useschemaname", DSID_SCHEMA, false, false },
+ { m_xIndexAppendix, "createindex", DSID_INDEXAPPENDIX, false, false },
+ { m_xDosLineEnds, "eol", DSID_DOSLINEENDS, false, false },
+ { m_xCheckRequiredFields, "ignorecurrency", DSID_CHECK_REQUIRED_FIELDS, false, false },
+ { m_xIgnoreCurrency, "inputchecks", DSID_IGNORECURRENCY, false, false },
+ { m_xEscapeDateTime, "useodbcliterals", DSID_ESCAPE_DATETIME, false, false },
+ { m_xPrimaryKeySupport, "primarykeys", DSID_PRIMARY_KEY_SUPPORT, false, false },
+ { m_xRespectDriverResultSetType, "resulttype", DSID_RESPECTRESULTSETTYPE, false, false } }
, m_bHasBooleanComparisonMode( _rDSMeta.getFeatureSet().has( DSID_BOOLEANCOMPARISON ) )
, m_bHasMaxRowScan( _rDSMeta.getFeatureSet().has( DSID_MAX_ROW_SCAN ) )
{
- impl_initBooleanSettings();
-
const FeatureSet& rFeatures( _rDSMeta.getFeatureSet() );
// create all the check boxes for the boolean settings
for (auto & booleanSetting : m_aBooleanSettings)
@@ -118,36 +132,6 @@ namespace dbaui
disposeOnce();
}
- void SpecialSettingsPage::impl_initBooleanSettings()
- {
- OSL_PRECOND( m_aBooleanSettings.empty(), "SpecialSettingsPage::impl_initBooleanSettings: called twice!" );
-
- // for easier maintenance, write the table in this form, then copy it to m_aBooleanSettings
- BooleanSettingDesc aSettings[] = {
- { m_xIsSQL92Check, "usesql92", DSID_SQL92CHECK, false, false },
- { m_xAppendTableAlias, "append", DSID_APPEND_TABLE_ALIAS, false, false },
- { m_xAsBeforeCorrelationName, "useas", DSID_AS_BEFORE_CORRNAME, false, false },
- { m_xEnableOuterJoin, "useoj", DSID_ENABLEOUTERJOIN, false, false },
- { m_xIgnoreDriverPrivileges, "ignoreprivs", DSID_IGNOREDRIVER_PRIV, false, false },
- { m_xParameterSubstitution, "replaceparams", DSID_PARAMETERNAMESUBST, false, false },
- { m_xSuppressVersionColumn, "displayver", DSID_SUPPRESSVERSIONCL, true, false },
- { m_xCatalog, "usecatalogname", DSID_CATALOG, false, false },
- { m_xSchema, "useschemaname", DSID_SCHEMA, false, false },
- { m_xIndexAppendix, "createindex", DSID_INDEXAPPENDIX, false, false },
- { m_xDosLineEnds, "eol", DSID_DOSLINEENDS, false, false },
- { m_xCheckRequiredFields, "ignorecurrency", DSID_CHECK_REQUIRED_FIELDS, false, false },
- { m_xIgnoreCurrency, "inputchecks", DSID_IGNORECURRENCY, false, false },
- { m_xEscapeDateTime, "useodbcliterals", DSID_ESCAPE_DATETIME, false, false },
- { m_xPrimaryKeySupport, "primarykeys", DSID_PRIMARY_KEY_SUPPORT, false, false },
- { m_xRespectDriverResultSetType, "resulttype", DSID_RESPECTRESULTSETTYPE, false, false }
- };
-
- for ( const BooleanSettingDesc& rDesc : aSettings )
- {
- m_aBooleanSettings.push_back( rDesc );
- }
- }
-
void SpecialSettingsPage::fillWindows( std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList )
{
if ( m_bHasBooleanComparisonMode )
diff --git a/dbaccess/source/ui/dlg/advancedsettings.hxx b/dbaccess/source/ui/dlg/advancedsettings.hxx
index a523e8e8d4ee..c4b7d7894c71 100644
--- a/dbaccess/source/ui/dlg/advancedsettings.hxx
+++ b/dbaccess/source/ui/dlg/advancedsettings.hxx
@@ -83,7 +83,6 @@ namespace dbaui
// <method>OGenericAdministrationPage::fillWindows</method>
virtual void fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
- void impl_initBooleanSettings();
DECL_LINK(BooleanComparisonSelectHdl, weld::ComboBox&, void);
};