diff options
author | Noel Grandin <noel@peralex.com> | 2014-05-08 14:53:29 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-05-08 14:55:12 +0200 |
commit | bf30c8b16d9ac9304a49020ec2d4f744d90abe26 (patch) | |
tree | 0296cec9ca0729874ed1a1963af9f1311366c326 /dbaccess | |
parent | d15540c431587368d749b53074af25cf865e7a5f (diff) |
use new VCL IsValueChangedFromSaved method
follow to commit ff1a7a59434f5f793d4044aad615bcf78148e963
"RFC: add IsValueChangedFromSaved to VCL button and listbox"
Change-Id: If2e6d9e7c18590dc4abbc90362d7897ca2557dd6
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/ui/control/FieldDescControl.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/control/charsetlistbox.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/ConnectionPage.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/TextConnectionHelper.cxx | 10 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/adminpages.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/advancedsettings.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/detailpages.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/generalpage.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/FieldControls.hxx | 8 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/WCPage.cxx | 2 |
11 files changed, 23 insertions, 23 deletions
diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx index 507e18b41b9f..b473fe3bb11a 100644 --- a/dbaccess/source/ui/control/FieldDescControl.cxx +++ b/dbaccess/source/ui/control/FieldDescControl.cxx @@ -655,7 +655,7 @@ IMPL_LINK( OFieldDescControl, ChangeHdl, ListBox *, pListBox ) if ( !pActFieldDescr ) return 0; - if ( pListBox->GetSavedValue() != pListBox->GetSelectEntryPos() ) + if ( pListBox->IsValueChangedFromSaved() ) SetModified(true); // Special treatment for Boold fields diff --git a/dbaccess/source/ui/control/charsetlistbox.cxx b/dbaccess/source/ui/control/charsetlistbox.cxx index a068e7f56219..e1578d00839c 100644 --- a/dbaccess/source/ui/control/charsetlistbox.cxx +++ b/dbaccess/source/ui/control/charsetlistbox.cxx @@ -75,7 +75,7 @@ namespace dbaui bool CharSetListBox::StoreSelectedCharSet( SfxItemSet& _rSet, const sal_uInt16 _nItemId ) { bool bChangedSomething = false; - if ( GetSelectEntryPos() != GetSavedValue() ) + if ( IsValueChangedFromSaved() ) { OCharsetDisplay::const_iterator aFind = m_aCharSets.findDisplayName( GetSelectEntry() ); OSL_ENSURE( aFind != m_aCharSets.end(), "CharSetListBox::StoreSelectedCharSet: could not translate the selected character set!" ); diff --git a/dbaccess/source/ui/dlg/ConnectionPage.cxx b/dbaccess/source/ui/dlg/ConnectionPage.cxx index 9792ce2c8096..573a8feafa65 100644 --- a/dbaccess/source/ui/dlg/ConnectionPage.cxx +++ b/dbaccess/source/ui/dlg/ConnectionPage.cxx @@ -282,7 +282,7 @@ namespace dbaui { bool bChangedSomething = false; - if (m_aUserName.GetText() != m_aUserName.GetSavedValue()) + if (m_aUserName.IsValueChangedFromSaved()) { _rSet.Put(SfxStringItem(DSID_USER, m_aUserName.GetText())); _rSet.Put(SfxStringItem(DSID_PASSWORD, OUString())); diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx index bf842f00ea8d..853e5cbe60c2 100644 --- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx +++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx @@ -162,7 +162,7 @@ using namespace ::com::sun::star; fillString(_rSet,&m_aETBaseDN,DSID_CONN_LDAP_BASEDN, bChangedSomething); fillInt32(_rSet,&m_aNFPortNumber,DSID_CONN_LDAP_PORTNUMBER,bChangedSomething); - if ( m_aETHostServer.GetText() != m_aETHostServer.GetSavedValue() ) + if ( m_aETHostServer.IsValueChangedFromSaved() ) { DbuTypeCollectionItem* pCollectionItem = PTR_CAST(DbuTypeCollectionItem, _rSet.GetItem(DSID_TYPECOLLECTION)); ::dbaccess::ODsnTypeCollection* pCollection = NULL; @@ -738,7 +738,7 @@ using namespace ::com::sun::star; { bool bChangedSomething = false; - if (m_aETUserName.GetText() != m_aETUserName.GetSavedValue()) + if (m_aETUserName.IsValueChangedFromSaved()) { _rSet.Put(SfxStringItem(DSID_USER, m_aETUserName.GetText())); _rSet.Put(SfxStringItem(DSID_PASSWORD, OUString())); diff --git a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx index bc8b7b2c7c68..08bd843652e1 100644 --- a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx @@ -378,7 +378,7 @@ namespace dbaui if ( ( m_nAvailableSections & TC_HEADER ) != 0 ) { - if( (m_aRowHeader.GetState() != m_aRowHeader.GetSavedValue()) ) + if( m_aRowHeader.IsValueChangedFromSaved() ) { rSet.Put(SfxBoolItem(DSID_TEXTFILEHEADER, m_aRowHeader.IsChecked())); bChangedSomething = true; @@ -387,23 +387,23 @@ namespace dbaui if ( ( m_nAvailableSections & TC_SEPARATORS ) != 0 ) { - if( m_aFieldSeparator.GetText() != m_aFieldSeparator.GetSavedValue() ) + if( m_aFieldSeparator.IsValueChangedFromSaved() ) { rSet.Put( SfxStringItem(DSID_FIELDDELIMITER, GetSeparator( m_aFieldSeparator, m_aFieldSeparatorList) ) ); bChangedSomething = true; } - if( m_aTextSeparator.GetText() != m_aTextSeparator.GetSavedValue() ) + if( m_aTextSeparator.IsValueChangedFromSaved() ) { rSet.Put( SfxStringItem(DSID_TEXTDELIMITER, GetSeparator( m_aTextSeparator, m_aTextSeparatorList) ) ); bChangedSomething = true; } - if( m_aDecimalSeparator.GetText() != m_aDecimalSeparator.GetSavedValue() ) + if( m_aDecimalSeparator.IsValueChangedFromSaved() ) { rSet.Put( SfxStringItem(DSID_DECIMALDELIMITER, m_aDecimalSeparator.GetText().copy(0, 1) ) ); bChangedSomething = true; } - if( m_aThousandsSeparator.GetText() != m_aThousandsSeparator.GetSavedValue() ) + if( m_aThousandsSeparator.IsValueChangedFromSaved() ) { rSet.Put( SfxStringItem(DSID_THOUSANDSDELIMITER, m_aThousandsSeparator.GetText().copy(0,1) ) ); bChangedSomething = true; diff --git a/dbaccess/source/ui/dlg/adminpages.cxx b/dbaccess/source/ui/dlg/adminpages.cxx index 9c194c8b7254..24a66a4d1d54 100644 --- a/dbaccess/source/ui/dlg/adminpages.cxx +++ b/dbaccess/source/ui/dlg/adminpages.cxx @@ -193,7 +193,7 @@ namespace dbaui } void OGenericAdministrationPage::fillBool( SfxItemSet& _rSet, CheckBox* _pCheckBox, sal_uInt16 _nID, bool& _bChangedSomething, bool _bRevertValue ) { - if ( (_pCheckBox != NULL ) && ( _pCheckBox->GetState() != _pCheckBox->GetSavedValue() ) ) + if ( _pCheckBox && _pCheckBox->IsValueChangedFromSaved() ) { bool bValue = _pCheckBox->IsChecked(); if ( _bRevertValue ) @@ -214,7 +214,7 @@ namespace dbaui } void OGenericAdministrationPage::fillInt32(SfxItemSet& _rSet, NumericField* _pEdit, sal_uInt16 _nID, bool& _bChangedSomething) { - if( (_pEdit != NULL) && (_pEdit->GetValue() != _pEdit->GetSavedValue().toInt32()) ) + if( _pEdit && _pEdit->IsValueChangedFromSaved() ) { _rSet.Put(SfxInt32Item(_nID, static_cast<sal_Int32>(_pEdit->GetValue()))); _bChangedSomething = true; @@ -222,7 +222,7 @@ namespace dbaui } void OGenericAdministrationPage::fillString(SfxItemSet& _rSet, Edit* _pEdit, sal_uInt16 _nID, bool& _bChangedSomething) { - if( (_pEdit != NULL) && (_pEdit->GetText() != _pEdit->GetSavedValue()) ) + if( _pEdit && _pEdit->IsValueChangedFromSaved() ) { _rSet.Put(SfxStringItem(_nID, _pEdit->GetText())); _bChangedSomething = true; diff --git a/dbaccess/source/ui/dlg/advancedsettings.cxx b/dbaccess/source/ui/dlg/advancedsettings.cxx index 624c95180e59..288f94377d7f 100644 --- a/dbaccess/source/ui/dlg/advancedsettings.cxx +++ b/dbaccess/source/ui/dlg/advancedsettings.cxx @@ -282,7 +282,7 @@ namespace dbaui // the non-boolean items if ( m_bHasBooleanComparisonMode ) { - if ( m_pBooleanComparisonMode->GetSelectEntryPos() != m_pBooleanComparisonMode->GetSavedValue() ) + if ( m_pBooleanComparisonMode->IsValueChangedFromSaved() ) { _rSet.Put( SfxInt32Item( DSID_BOOLEANCOMPARISON, m_pBooleanComparisonMode->GetSelectEntryPos() ) ); bChangedSomething = true; diff --git a/dbaccess/source/ui/dlg/detailpages.cxx b/dbaccess/source/ui/dlg/detailpages.cxx index 2afb25309438..16b192ef171e 100644 --- a/dbaccess/source/ui/dlg/detailpages.cxx +++ b/dbaccess/source/ui/dlg/detailpages.cxx @@ -644,7 +644,7 @@ namespace dbaui bChangedSomething |= m_aMySQLSettings.FillItemSet( _rSet ); - if ( m_aUserName.GetText() != m_aUserName.GetSavedValue() ) + if ( m_aUserName.IsValueChangedFromSaved() ) { _rSet.Put( SfxStringItem( DSID_USER, m_aUserName.GetText() ) ); _rSet.Put( SfxStringItem( DSID_PASSWORD, OUString())); diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx index 83d17bd1e91e..5f5ba276c58f 100644 --- a/dbaccess/source/ui/dlg/generalpage.cxx +++ b/dbaccess/source/ui/dlg/generalpage.cxx @@ -473,7 +473,7 @@ namespace dbaui sal_uInt16 nEntry = m_pDatasourceType->GetSelectEntryPos(); OUString sURLPrefix = m_aURLPrefixes[ nEntry ]; - if ( m_pDatasourceType->GetSavedValue() != nEntry ) + if ( m_pDatasourceType->IsValueChangedFromSaved() ) { _rCoreAttrs.Put( SfxStringItem( DSID_CONNECTURL, sURLPrefix ) ); bChangedSomething = true; @@ -640,7 +640,7 @@ namespace dbaui } else if ( m_pRB_OpenExistingDatabase->IsChecked() ) { - if ( m_pRB_OpenExistingDatabase->GetSavedValue() != m_pRB_OpenExistingDatabase->IsChecked() ) + if ( m_pRB_OpenExistingDatabase->IsValueChangedFromSaved() ) bChangedSomething = true; // TODO @@ -652,7 +652,7 @@ namespace dbaui sal_uInt16 nEntry = m_pDatasourceType->GetSelectEntryPos(); OUString sURLPrefix = m_aURLPrefixes[nEntry]; - if ( ( m_pDatasourceType->GetSavedValue() != nEntry ) + if ( m_pDatasourceType->IsValueChangedFromSaved() || ( GetDatabaseCreationMode() != m_eOriginalCreationMode ) ) { diff --git a/dbaccess/source/ui/inc/FieldControls.hxx b/dbaccess/source/ui/inc/FieldControls.hxx index 7f2e68a7d938..5584549871f6 100644 --- a/dbaccess/source/ui/inc/FieldControls.hxx +++ b/dbaccess/source/ui/inc/FieldControls.hxx @@ -36,7 +36,7 @@ namespace dbaui public: OPropColumnEditCtrl(Window* pParent, OUString& _rAllowedChars, sal_uInt16 nHelpId, short nPosition = -1, WinBits nWinStyle = 0); - virtual bool IsModified() const SAL_OVERRIDE { return GetText() != GetSavedValue(); } + virtual bool IsModified() const SAL_OVERRIDE { return IsValueChangedFromSaved(); } short GetPos() const { return m_nPos; } OUString GetHelp() const { return m_strHelpText; } @@ -54,7 +54,7 @@ namespace dbaui public: OPropEditCtrl(Window* pParent, sal_uInt16 nHelpId, short nPosition = -1, WinBits nWinStyle = 0); - virtual bool IsModified() const SAL_OVERRIDE { return GetText() != GetSavedValue(); } + virtual bool IsModified() const SAL_OVERRIDE { return IsValueChangedFromSaved(); } short GetPos() const { return m_nPos; } OUString GetHelp() const { return m_strHelpText; } @@ -70,7 +70,7 @@ namespace dbaui public: OPropNumericEditCtrl(Window* pParent, sal_uInt16 nHelpId, short nPosition = -1, WinBits nWinStyle = 0); - virtual bool IsModified() const SAL_OVERRIDE { return GetText() != GetSavedValue(); } + virtual bool IsModified() const SAL_OVERRIDE { return IsValueChangedFromSaved(); } short GetPos() const { return m_nPos; } OUString GetHelp() const { return m_strHelpText; } @@ -87,7 +87,7 @@ namespace dbaui public: OPropListBoxCtrl(Window* pParent, sal_uInt16 nHelpId, short nPosition = -1, WinBits nWinStyle = 0); - bool IsModified() const { return GetSelectEntryPos() != GetSavedValue(); } + bool IsModified() const { return IsValueChangedFromSaved(); } short GetPos() const { return m_nPos; } OUString GetHelp() const { return m_strHelpText; } diff --git a/dbaccess/source/ui/misc/WCPage.cxx b/dbaccess/source/ui/misc/WCPage.cxx index 8a7412786ff4..7107d165ac90 100644 --- a/dbaccess/source/ui/misc/WCPage.cxx +++ b/dbaccess/source/ui/misc/WCPage.cxx @@ -204,7 +204,7 @@ bool OCopyTable::LeavePage() } } - if ( m_edTableName.GetSavedValue() != m_edTableName.GetText() ) + if ( m_edTableName.IsValueChangedFromSaved() ) { // table exists and name has changed if ( m_pParent->getOperation() == CopyTableOperation::AppendData ) { |