summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2015-10-19 07:18:39 +0200
committerJan Holesovsky <kendy@collabora.com>2015-10-19 07:20:33 +0200
commit2b5a48da5969b1ed37f4480d843714d434feb5d9 (patch)
tree59a449af7f69a133bc8e1e76b8f9deb65425da02 /dbaccess
parent664197d95becd516c3dac25a50439078ba61e051 (diff)
sfx items: Kill the SFX_ITEMSET_GET macro.
Change-Id: I110a4f25646eb3f0fa93673c84dc67cf64a3b7a0
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/ui/dlg/ConnectionHelper.cxx2
-rw-r--r--dbaccess/source/ui/dlg/ConnectionPage.cxx8
-rw-r--r--dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx22
-rw-r--r--dbaccess/source/ui/dlg/DbAdminImpl.cxx38
-rw-r--r--dbaccess/source/ui/dlg/TextConnectionHelper.cxx14
-rw-r--r--dbaccess/source/ui/dlg/admincontrols.cxx12
-rw-r--r--dbaccess/source/ui/dlg/adminpages.cxx4
-rw-r--r--dbaccess/source/ui/dlg/advancedsettings.cxx12
-rw-r--r--dbaccess/source/ui/dlg/detailpages.cxx42
-rw-r--r--dbaccess/source/ui/dlg/generalpage.cxx8
-rw-r--r--dbaccess/source/ui/dlg/tablespage.cxx4
-rw-r--r--dbaccess/source/ui/misc/UITools.cxx4
12 files changed, 85 insertions, 85 deletions
diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx
index 7bfbd70c58a8..ecd2edc7bac8 100644
--- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx
+++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx
@@ -139,7 +139,7 @@ namespace dbaui
bool bEnableCreateButton = m_pCollection->supportsDBCreation( m_eType );
m_pPB_CreateDB->Show( bEnableCreateButton );
- SFX_ITEMSET_GET(_rSet, pUrlItem, SfxStringItem, DSID_CONNECTURL, true);
+ const SfxStringItem* pUrlItem = _rSet.GetItem<SfxStringItem>(DSID_CONNECTURL);
// forward the values to the controls
if ( bValid )
diff --git a/dbaccess/source/ui/dlg/ConnectionPage.cxx b/dbaccess/source/ui/dlg/ConnectionPage.cxx
index d7bf779767a6..ddd01be56f88 100644
--- a/dbaccess/source/ui/dlg/ConnectionPage.cxx
+++ b/dbaccess/source/ui/dlg/ConnectionPage.cxx
@@ -223,11 +223,11 @@ namespace dbaui
m_pPasswordRequired->SetPosPixel(m_pUserNameLabel->GetPosPixel());
// collect the items
- SFX_ITEMSET_GET(_rSet, pUidItem, SfxStringItem, DSID_USER, true);
+ const SfxStringItem* pUidItem = _rSet.GetItem<SfxStringItem>(DSID_USER);
- SFX_ITEMSET_GET(_rSet, pJdbcDrvItem, SfxStringItem, DSID_JDBCDRIVERCLASS, true);
- SFX_ITEMSET_GET(_rSet, pUrlItem, SfxStringItem, DSID_CONNECTURL, true);
- SFX_ITEMSET_GET(_rSet, pAllowEmptyPwd, SfxBoolItem, DSID_PASSWORDREQUIRED, true);
+ const SfxStringItem* pJdbcDrvItem = _rSet.GetItem<SfxStringItem>(DSID_JDBCDRIVERCLASS);
+ const SfxStringItem* pUrlItem = _rSet.GetItem<SfxStringItem>(DSID_CONNECTURL);
+ const SfxBoolItem* pAllowEmptyPwd = _rSet.GetItem<SfxBoolItem>(DSID_PASSWORDREQUIRED);
// forward the values to the controls
if ( bValid )
diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
index 45ddce7b195a..d0b1f69da861 100644
--- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
+++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
@@ -220,8 +220,8 @@ using namespace ::com::sun::star;
bool bValid, bReadonly;
getFlags(_rSet, bValid, bReadonly);
- SFX_ITEMSET_GET(_rSet, pBaseDN, SfxStringItem, DSID_CONN_LDAP_BASEDN, true);
- SFX_ITEMSET_GET(_rSet, pPortNumber, SfxInt32Item, DSID_CONN_LDAP_PORTNUMBER, true);
+ const SfxStringItem* pBaseDN = _rSet.GetItem<SfxStringItem>(DSID_CONN_LDAP_BASEDN);
+ const SfxInt32Item* pPortNumber = _rSet.GetItem<SfxInt32Item>(DSID_CONN_LDAP_PORTNUMBER);
if ( bValid )
{
@@ -412,8 +412,8 @@ using namespace ::com::sun::star;
m_pETDriverClass->SetModifyHdl(LINK(this, OGenericAdministrationPage, OnControlEditModifyHdl));
m_pPBTestJavaDriver->SetClickHdl(LINK(this,OGeneralSpecialJDBCConnectionPageSetup,OnTestJavaClickHdl));
- SFX_ITEMSET_GET(_rCoreAttrs, pUrlItem, SfxStringItem, DSID_CONNECTURL, true);
- SFX_ITEMSET_GET(_rCoreAttrs, pTypesItem, DbuTypeCollectionItem, DSID_TYPECOLLECTION, true);
+ const SfxStringItem* pUrlItem = _rCoreAttrs.GetItem<SfxStringItem>(DSID_CONNECTURL);
+ const DbuTypeCollectionItem* pTypesItem = _rCoreAttrs.GetItem<DbuTypeCollectionItem>(DSID_TYPECOLLECTION);
::dbaccess::ODsnTypeCollection* pTypeCollection = pTypesItem ? pTypesItem->getCollection() : NULL;
if (pTypeCollection && pUrlItem && pUrlItem->GetValue().getLength() )
{
@@ -500,10 +500,10 @@ using namespace ::com::sun::star;
bool bValid, bReadonly;
getFlags(_rSet, bValid, bReadonly);
- SFX_ITEMSET_GET(_rSet, pDatabaseName, SfxStringItem, DSID_DATABASENAME, true);
- SFX_ITEMSET_GET(_rSet, pDrvItem, SfxStringItem, DSID_JDBCDRIVERCLASS, true);
- SFX_ITEMSET_GET(_rSet, pHostName, SfxStringItem, DSID_CONN_HOSTNAME, true);
- SFX_ITEMSET_GET(_rSet, pPortNumber, SfxInt32Item, m_nPortId, true);
+ const SfxStringItem* pDatabaseName = _rSet.GetItem<SfxStringItem>(DSID_DATABASENAME);
+ const SfxStringItem* pDrvItem = _rSet.GetItem<SfxStringItem>(DSID_JDBCDRIVERCLASS);
+ const SfxStringItem* pHostName = _rSet.GetItem<SfxStringItem>(DSID_CONN_HOSTNAME);
+ const SfxInt32Item* pPortNumber = _rSet.GetItem<SfxInt32Item>(m_nPortId);
if ( bValid )
{
@@ -621,7 +621,7 @@ using namespace ::com::sun::star;
bool bValid, bReadonly;
getFlags(_rSet, bValid, bReadonly);
- SFX_ITEMSET_GET(_rSet, pDrvItem, SfxStringItem, DSID_JDBCDRIVERCLASS, true);
+ const SfxStringItem* pDrvItem = _rSet.GetItem<SfxStringItem>(DSID_JDBCDRIVERCLASS);
if ( bValid )
{
@@ -789,8 +789,8 @@ using namespace ::com::sun::star;
// check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa)
bool bValid, bReadonly;
getFlags(_rSet, bValid, bReadonly);
- SFX_ITEMSET_GET(_rSet, pUidItem, SfxStringItem, DSID_USER, true);
- SFX_ITEMSET_GET(_rSet, pAllowEmptyPwd, SfxBoolItem, DSID_PASSWORDREQUIRED, true);
+ const SfxStringItem* pUidItem = _rSet.GetItem<SfxStringItem>(DSID_USER);
+ const SfxBoolItem* pAllowEmptyPwd = _rSet.GetItem<SfxBoolItem>(DSID_PASSWORDREQUIRED);
m_pETUserName->SetText(pUidItem->GetValue());
m_pCBPasswordRequired->Check(pAllowEmptyPwd->GetValue());
diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
index caf452641e66..c1cdc7f14cdd 100644
--- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx
+++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
@@ -220,7 +220,7 @@ bool ODbDataSourceAdministrationHelper::getCurrentSettings(Sequence< PropertyVal
// collecting this in a vector because it has a push_back, in opposite to sequences
// user: DSID_USER -> "user"
- SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pUser, SfxStringItem, DSID_USER, true);
+ const SfxStringItem* pUser = m_pItemSetHelper->getOutputSet()->GetItem<SfxStringItem>(DSID_USER);
if (pUser && pUser->GetValue().getLength())
aReturn.push_back(
PropertyValue( OUString("user"), 0,
@@ -230,13 +230,13 @@ bool ODbDataSourceAdministrationHelper::getCurrentSettings(Sequence< PropertyVal
if (hasAuthentication(*m_pItemSetHelper->getOutputSet()))
{
// password: DSID_PASSWORD -> password
- SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pPassword, SfxStringItem, DSID_PASSWORD, true);
+ const SfxStringItem* pPassword = m_pItemSetHelper->getOutputSet()->GetItem<SfxStringItem>(DSID_PASSWORD);
OUString sPassword = pPassword ? pPassword->GetValue() : OUString();
- SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pPasswordRequired, SfxBoolItem, DSID_PASSWORDREQUIRED, true);
+ const SfxBoolItem* pPasswordRequired = m_pItemSetHelper->getOutputSet()->GetItem<SfxBoolItem>(DSID_PASSWORDREQUIRED);
// if the set does not contain a password, but the item set says it requires one, ask the user
if ((!pPassword || !pPassword->GetValue().getLength()) && (pPasswordRequired && pPasswordRequired->GetValue()))
{
- SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pName, SfxStringItem, DSID_NAME, true);
+ const SfxStringItem* pName = m_pItemSetHelper->getOutputSet()->GetItem<SfxStringItem>(DSID_NAME);
Reference< XModel > xModel( getDataSourceOrModel( m_xDatasource ), UNO_QUERY_THROW );
::comphelper::NamedValueCollection aArgs( xModel->getArgs() );
@@ -330,7 +330,7 @@ void ODbDataSourceAdministrationHelper::successfullyConnected()
if (hasAuthentication(*m_pItemSetHelper->getOutputSet()))
{
- SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pPassword, SfxStringItem, DSID_PASSWORD, true);
+ const SfxStringItem* pPassword = m_pItemSetHelper->getOutputSet()->GetItem<SfxStringItem>(DSID_PASSWORD);
if (pPassword && (0 != pPassword->GetValue().getLength()))
{
OUString sPassword = pPassword->GetValue();
@@ -446,9 +446,9 @@ Reference< XPropertySet > ODbDataSourceAdministrationHelper::getCurrentDataSourc
OUString ODbDataSourceAdministrationHelper::getDatasourceType( const SfxItemSet& _rSet )
{
- SFX_ITEMSET_GET( _rSet, pConnectURL, SfxStringItem, DSID_CONNECTURL, true );
+ const SfxStringItem* pConnectURL = _rSet.GetItem<SfxStringItem>(DSID_CONNECTURL);
OSL_ENSURE( pConnectURL , "ODbDataSourceAdministrationHelper::getDatasourceType: invalid items in the source set!" );
- SFX_ITEMSET_GET(_rSet, pTypeCollection, DbuTypeCollectionItem, DSID_TYPECOLLECTION, true);
+ const DbuTypeCollectionItem* pTypeCollection = _rSet.GetItem<DbuTypeCollectionItem>(DSID_TYPECOLLECTION);
OSL_ENSURE(pTypeCollection, "ODbDataSourceAdministrationHelper::getDatasourceType: invalid items in the source set!");
::dbaccess::ODsnTypeCollection* pCollection = pTypeCollection->getCollection();
return pCollection->getType(pConnectURL->GetValue());
@@ -465,8 +465,8 @@ OUString ODbDataSourceAdministrationHelper::getConnectionURL() const
OUString eType = getDatasourceType(*m_pItemSetHelper->getOutputSet());
- SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pUrlItem, SfxStringItem, DSID_CONNECTURL, true);
- SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pTypeCollection, DbuTypeCollectionItem, DSID_TYPECOLLECTION, true);
+ const SfxStringItem* pUrlItem = m_pItemSetHelper->getOutputSet()->GetItem<SfxStringItem>(DSID_CONNECTURL);
+ const DbuTypeCollectionItem* pTypeCollection = m_pItemSetHelper->getOutputSet()->GetItem<DbuTypeCollectionItem>(DSID_TYPECOLLECTION);
OSL_ENSURE(pUrlItem,"Connection URL is NULL. -> GPF!");
OSL_ENSURE(pTypeCollection, "ODbDataSourceAdministrationHelper::getDatasourceType: invalid items in the source set!");
@@ -493,9 +493,9 @@ OUString ODbDataSourceAdministrationHelper::getConnectionURL() const
case ::dbaccess::DST_MYSQL_NATIVE:
case ::dbaccess::DST_MYSQL_JDBC:
{
- SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pHostName, SfxStringItem, DSID_CONN_HOSTNAME, true);
- SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pPortNumber, SfxInt32Item, DSID_MYSQL_PORTNUMBER, true);
- SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pDatabaseName, SfxStringItem, DSID_DATABASENAME, true);
+ const SfxStringItem* pHostName = m_pItemSetHelper->getOutputSet()->GetItem<SfxStringItem>(DSID_CONN_HOSTNAME);
+ const SfxInt32Item* pPortNumber = m_pItemSetHelper->getOutputSet()->GetItem<SfxInt32Item>(DSID_MYSQL_PORTNUMBER);
+ const SfxStringItem* pDatabaseName = m_pItemSetHelper->getOutputSet()->GetItem<SfxStringItem>(DSID_DATABASENAME);
sNewUrl = lcl_createHostWithPort(pHostName,pPortNumber);
OUString sDatabaseName = pDatabaseName ? pDatabaseName->GetValue() : OUString();
if ( !sDatabaseName.getLength() && pUrlItem )
@@ -512,9 +512,9 @@ OUString ODbDataSourceAdministrationHelper::getConnectionURL() const
break;
case ::dbaccess::DST_ORACLE_JDBC:
{
- SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pHostName, SfxStringItem, DSID_CONN_HOSTNAME, true);
- SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pPortNumber, SfxInt32Item, DSID_ORACLE_PORTNUMBER, true);
- SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pDatabaseName, SfxStringItem, DSID_DATABASENAME, true);
+ const SfxStringItem* pHostName = m_pItemSetHelper->getOutputSet()->GetItem<SfxStringItem>(DSID_CONN_HOSTNAME);
+ const SfxInt32Item* pPortNumber = m_pItemSetHelper->getOutputSet()->GetItem<SfxInt32Item>(DSID_ORACLE_PORTNUMBER);
+ const SfxStringItem* pDatabaseName = m_pItemSetHelper->getOutputSet()->GetItem<SfxStringItem>(DSID_DATABASENAME);
if ( pHostName && pHostName->GetValue().getLength() )
{
sNewUrl = "@" + lcl_createHostWithPort(pHostName,pPortNumber);
@@ -534,7 +534,7 @@ OUString ODbDataSourceAdministrationHelper::getConnectionURL() const
break;
case ::dbaccess::DST_LDAP:
{
- SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pPortNumber, SfxInt32Item, DSID_CONN_LDAP_PORTNUMBER, true);
+ const SfxInt32Item* pPortNumber = m_pItemSetHelper->getOutputSet()->GetItem<SfxInt32Item>(DSID_CONN_LDAP_PORTNUMBER);
sNewUrl = pCollection->cutPrefix(pUrlItem->GetValue()) + lcl_createHostWithPort(NULL,pPortNumber);
}
break;
@@ -1016,7 +1016,7 @@ void ODbDataSourceAdministrationHelper::implTranslateProperty( SfxItemSet& _rSet
OUString ODbDataSourceAdministrationHelper::getDocumentUrl(SfxItemSet& _rDest)
{
- SFX_ITEMSET_GET(_rDest, pUrlItem, SfxStringItem, DSID_DOCUMENT_URL, true);
+ const SfxStringItem* pUrlItem = _rDest.GetItem<SfxStringItem>(DSID_DOCUMENT_URL);
OSL_ENSURE(pUrlItem,"Document URL is NULL. -> GPF!");
return pUrlItem->GetValue();
}
@@ -1025,8 +1025,8 @@ void ODbDataSourceAdministrationHelper::convertUrl(SfxItemSet& _rDest)
{
OUString eType = getDatasourceType(_rDest);
- SFX_ITEMSET_GET(_rDest, pUrlItem, SfxStringItem, DSID_CONNECTURL, true);
- SFX_ITEMSET_GET(_rDest, pTypeCollection, DbuTypeCollectionItem, DSID_TYPECOLLECTION, true);
+ const SfxStringItem* pUrlItem = _rDest.GetItem<SfxStringItem>(DSID_CONNECTURL);
+ const DbuTypeCollectionItem* pTypeCollection = _rDest.GetItem<DbuTypeCollectionItem>(DSID_TYPECOLLECTION);
OSL_ENSURE(pUrlItem,"Connection URL is NULL. -> GPF!");
OSL_ENSURE(pTypeCollection, "ODbAdminDialog::getDatasourceType: invalid items in the source set!");
diff --git a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
index 9e13b93c50a7..eb17f6cc91df 100644
--- a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
+++ b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
@@ -240,12 +240,12 @@ namespace dbaui
if ( !_bValid )
return;
- SFX_ITEMSET_GET( _rSet, pDelItem, SfxStringItem, DSID_FIELDDELIMITER, true );
- SFX_ITEMSET_GET( _rSet, pStrItem, SfxStringItem, DSID_TEXTDELIMITER, true );
- SFX_ITEMSET_GET( _rSet, pDecdelItem, SfxStringItem, DSID_DECIMALDELIMITER, true );
- SFX_ITEMSET_GET( _rSet, pThodelItem, SfxStringItem, DSID_THOUSANDSDELIMITER, true );
- SFX_ITEMSET_GET( _rSet, pExtensionItem, SfxStringItem, DSID_TEXTFILEEXTENSION, true );
- SFX_ITEMSET_GET( _rSet, pCharsetItem, SfxStringItem, DSID_CHARSET, true );
+ const SfxStringItem* pDelItem = _rSet.GetItem<SfxStringItem>(DSID_FIELDDELIMITER);
+ const SfxStringItem* pStrItem = _rSet.GetItem<SfxStringItem>(DSID_TEXTDELIMITER);
+ const SfxStringItem* pDecdelItem = _rSet.GetItem<SfxStringItem>(DSID_DECIMALDELIMITER);
+ const SfxStringItem* pThodelItem = _rSet.GetItem<SfxStringItem>(DSID_THOUSANDSDELIMITER);
+ const SfxStringItem* pExtensionItem = _rSet.GetItem<SfxStringItem>(DSID_TEXTFILEEXTENSION);
+ const SfxStringItem* pCharsetItem = _rSet.GetItem<SfxStringItem>(DSID_CHARSET);
if ( ( m_nAvailableSections & TC_EXTENSION ) != 0 )
{
@@ -255,7 +255,7 @@ namespace dbaui
if ( ( m_nAvailableSections & TC_HEADER ) != 0 )
{
- SFX_ITEMSET_GET( _rSet, pHdrItem, SfxBoolItem, DSID_TEXTFILEHEADER, true );
+ const SfxBoolItem* pHdrItem = _rSet.GetItem<SfxBoolItem>(DSID_TEXTFILEHEADER);
m_pRowHeader->Check( pHdrItem->GetValue() );
}
diff --git a/dbaccess/source/ui/dlg/admincontrols.cxx b/dbaccess/source/ui/dlg/admincontrols.cxx
index 521c5cccec56..0c871d7edd6c 100644
--- a/dbaccess/source/ui/dlg/admincontrols.cxx
+++ b/dbaccess/source/ui/dlg/admincontrols.cxx
@@ -238,16 +238,16 @@ namespace dbaui
void MySQLNativeSettings::implInitControls(const SfxItemSet& _rSet )
{
- SFX_ITEMSET_GET( _rSet, pInvalid, SfxBoolItem, DSID_INVALID_SELECTION, true );
+ const SfxBoolItem* pInvalid = _rSet.GetItem<SfxBoolItem>(DSID_INVALID_SELECTION);
bool bValid = !pInvalid || !pInvalid->GetValue();
if ( !bValid )
return;
- SFX_ITEMSET_GET( _rSet, pDatabaseName, SfxStringItem, DSID_DATABASENAME, true );
- SFX_ITEMSET_GET( _rSet, pHostName, SfxStringItem, DSID_CONN_HOSTNAME, true );
- SFX_ITEMSET_GET( _rSet, pPortNumber, SfxInt32Item, DSID_MYSQL_PORTNUMBER, true );
- SFX_ITEMSET_GET( _rSet, pSocket, SfxStringItem, DSID_CONN_SOCKET, true );
- SFX_ITEMSET_GET( _rSet, pNamedPipe, SfxStringItem, DSID_NAMED_PIPE, true );
+ const SfxStringItem* pDatabaseName = _rSet.GetItem<SfxStringItem>(DSID_DATABASENAME);
+ const SfxStringItem* pHostName = _rSet.GetItem<SfxStringItem>(DSID_CONN_HOSTNAME);
+ const SfxInt32Item* pPortNumber = _rSet.GetItem<SfxInt32Item>(DSID_MYSQL_PORTNUMBER);
+ const SfxStringItem* pSocket = _rSet.GetItem<SfxStringItem>(DSID_CONN_SOCKET);
+ const SfxStringItem* pNamedPipe = _rSet.GetItem<SfxStringItem>(DSID_NAMED_PIPE);
m_pDatabaseName->SetText( pDatabaseName->GetValue() );
m_pDatabaseName->ClearModifyFlag();
diff --git a/dbaccess/source/ui/dlg/adminpages.cxx b/dbaccess/source/ui/dlg/adminpages.cxx
index 126b90dd31db..a9a6949cf021 100644
--- a/dbaccess/source/ui/dlg/adminpages.cxx
+++ b/dbaccess/source/ui/dlg/adminpages.cxx
@@ -96,9 +96,9 @@ namespace dbaui
void OGenericAdministrationPage::getFlags(const SfxItemSet& _rSet, bool& _rValid, bool& _rReadonly)
{
- SFX_ITEMSET_GET(_rSet, pInvalid, SfxBoolItem, DSID_INVALID_SELECTION, true);
+ const SfxBoolItem* pInvalid = _rSet.GetItem<SfxBoolItem>(DSID_INVALID_SELECTION);
_rValid = !pInvalid || !pInvalid->GetValue();
- SFX_ITEMSET_GET(_rSet, pReadonly, SfxBoolItem, DSID_READONLY, true);
+ const SfxBoolItem* pReadonly = _rSet.GetItem<SfxBoolItem>(DSID_READONLY);
_rReadonly = !_rValid || (pReadonly && pReadonly->GetValue());
}
diff --git a/dbaccess/source/ui/dlg/advancedsettings.cxx b/dbaccess/source/ui/dlg/advancedsettings.cxx
index 11caa93aff42..1f1e68595b33 100644
--- a/dbaccess/source/ui/dlg/advancedsettings.cxx
+++ b/dbaccess/source/ui/dlg/advancedsettings.cxx
@@ -257,7 +257,7 @@ namespace dbaui
::boost::optional< bool > aValue(false);
aValue.reset();
- SFX_ITEMSET_GET( _rSet, pItem, SfxPoolItem, setting->nItemId, true );
+ const SfxPoolItem* pItem = _rSet.GetItem<SfxPoolItem>(setting->nItemId);
if (const SfxBoolItem *pBoolItem = dynamic_cast<const SfxBoolItem*>( pItem) )
{
aValue.reset( pBoolItem->GetValue() );
@@ -285,13 +285,13 @@ namespace dbaui
// the non-boolean items
if ( m_bHasBooleanComparisonMode )
{
- SFX_ITEMSET_GET( _rSet, pBooleanComparison, SfxInt32Item, DSID_BOOLEANCOMPARISON, true );
+ const SfxInt32Item* pBooleanComparison = _rSet.GetItem<SfxInt32Item>(DSID_BOOLEANCOMPARISON);
m_pBooleanComparisonMode->SelectEntryPos( static_cast< sal_uInt16 >( pBooleanComparison->GetValue() ) );
}
if ( m_bHasMaxRowScan )
{
- SFX_ITEMSET_GET(_rSet, pMaxRowScan, SfxInt32Item, DSID_MAX_ROW_SCAN, true);
+ const SfxInt32Item* pMaxRowScan = _rSet.GetItem<SfxInt32Item>(DSID_MAX_ROW_SCAN);
m_pMaxRowScan->SetValue(pMaxRowScan->GetValue());
}
@@ -385,9 +385,9 @@ namespace dbaui
getFlags(_rSet, bValid, bReadonly);
// collect the items
- SFX_ITEMSET_GET(_rSet, pAutoIncrementItem, SfxStringItem, DSID_AUTOINCREMENTVALUE, true);
- SFX_ITEMSET_GET(_rSet, pAutoRetrieveValueItem, SfxStringItem, DSID_AUTORETRIEVEVALUE, true);
- SFX_ITEMSET_GET(_rSet, pAutoRetrieveEnabledItem, SfxBoolItem, DSID_AUTORETRIEVEENABLED, true);
+ const SfxStringItem* pAutoIncrementItem = _rSet.GetItem<SfxStringItem>(DSID_AUTOINCREMENTVALUE);
+ const SfxStringItem* pAutoRetrieveValueItem = _rSet.GetItem<SfxStringItem>(DSID_AUTORETRIEVEVALUE);
+ const SfxBoolItem* pAutoRetrieveEnabledItem = _rSet.GetItem<SfxBoolItem>(DSID_AUTORETRIEVEENABLED);
// forward the values to the controls
if (bValid)
diff --git a/dbaccess/source/ui/dlg/detailpages.cxx b/dbaccess/source/ui/dlg/detailpages.cxx
index ffad681b4d6b..00f48c517555 100644
--- a/dbaccess/source/ui/dlg/detailpages.cxx
+++ b/dbaccess/source/ui/dlg/detailpages.cxx
@@ -146,8 +146,8 @@ namespace dbaui
getFlags(_rSet, bValid, bReadonly);
// collect the items
- SFX_ITEMSET_GET(_rSet, pOptionsItem, SfxStringItem, DSID_ADDITIONALOPTIONS, true);
- SFX_ITEMSET_GET(_rSet, pCharsetItem, SfxStringItem, DSID_CHARSET, true);
+ const SfxStringItem* pOptionsItem = _rSet.GetItem<SfxStringItem>(DSID_ADDITIONALOPTIONS);
+ const SfxStringItem* pCharsetItem = _rSet.GetItem<SfxStringItem>(DSID_CHARSET);
// forward the values to the controls
if (bValid)
@@ -222,14 +222,14 @@ namespace dbaui
getFlags(_rSet, bValid, bReadonly);
// get the DSN string (needed for the index dialog)
- SFX_ITEMSET_GET(_rSet, pUrlItem, SfxStringItem, DSID_CONNECTURL, true);
- SFX_ITEMSET_GET(_rSet, pTypesItem, DbuTypeCollectionItem, DSID_TYPECOLLECTION, true);
+ const SfxStringItem* pUrlItem = _rSet.GetItem<SfxStringItem>(DSID_CONNECTURL);
+ const DbuTypeCollectionItem* pTypesItem = _rSet.GetItem<DbuTypeCollectionItem>(DSID_TYPECOLLECTION);
::dbaccess::ODsnTypeCollection* pTypeCollection = pTypesItem ? pTypesItem->getCollection() : NULL;
if (pTypeCollection && pUrlItem && pUrlItem->GetValue().getLength())
m_sDsn = pTypeCollection->cutPrefix(pUrlItem->GetValue());
// get the other relevant items
- SFX_ITEMSET_GET(_rSet, pDeletedItem, SfxBoolItem, DSID_SHOWDELETEDROWS, true);
+ const SfxBoolItem* pDeletedItem = _rSet.GetItem<SfxBoolItem>(DSID_SHOWDELETEDROWS);
if ( bValid )
{
@@ -311,7 +311,7 @@ namespace dbaui
bool bValid, bReadonly;
getFlags(_rSet, bValid, bReadonly);
- SFX_ITEMSET_GET(_rSet, pUseCatalogItem, SfxBoolItem, DSID_USECATALOG, true);
+ const SfxBoolItem* pUseCatalogItem = _rSet.GetItem<SfxBoolItem>(DSID_USECATALOG);
if ( bValid )
m_pUseCatalog->Check(pUseCatalogItem->GetValue());
@@ -381,9 +381,9 @@ namespace dbaui
bool bValid, bReadonly;
getFlags(_rSet, bValid, bReadonly);
- SFX_ITEMSET_GET(_rSet, pUseCatalogItem, SfxBoolItem, DSID_USECATALOG, true);
- SFX_ITEMSET_GET(_rSet, pHostName, SfxStringItem, DSID_CONN_HOSTNAME, true);
- SFX_ITEMSET_GET(_rSet, pPortNumber, SfxInt32Item, DSID_CONN_PORTNUMBER, true);
+ const SfxBoolItem* pUseCatalogItem = _rSet.GetItem<SfxBoolItem>(DSID_USECATALOG);
+ const SfxStringItem* pHostName = _rSet.GetItem<SfxStringItem>(DSID_CONN_HOSTNAME);
+ const SfxInt32Item* pPortNumber = _rSet.GetItem<SfxInt32Item>(DSID_CONN_PORTNUMBER);
if ( bValid )
{
@@ -424,8 +424,8 @@ namespace dbaui
get(m_pEDDriverClass, "jdbcDriverClassEntry");
get(m_pTestJavaDriver, "testDriverClassButton");
- SFX_ITEMSET_GET(_rCoreAttrs, pUrlItem, SfxStringItem, DSID_CONNECTURL, true);
- SFX_ITEMSET_GET(_rCoreAttrs, pTypesItem, DbuTypeCollectionItem, DSID_TYPECOLLECTION, true);
+ const SfxStringItem* pUrlItem = _rCoreAttrs.GetItem<SfxStringItem>(DSID_CONNECTURL);
+ const DbuTypeCollectionItem* pTypesItem = _rCoreAttrs.GetItem<DbuTypeCollectionItem>(DSID_TYPECOLLECTION);
::dbaccess::ODsnTypeCollection* pTypeCollection = pTypesItem ? pTypesItem->getCollection() : NULL;
if (pTypeCollection && pUrlItem && pUrlItem->GetValue().getLength() )
{
@@ -487,10 +487,10 @@ namespace dbaui
bool bValid, bReadonly;
getFlags(_rSet, bValid, bReadonly);
- SFX_ITEMSET_GET(_rSet, pDrvItem, SfxStringItem, DSID_JDBCDRIVERCLASS, true);
- SFX_ITEMSET_GET(_rSet, pHostName, SfxStringItem, DSID_CONN_HOSTNAME, true);
- SFX_ITEMSET_GET(_rSet, pPortNumber, SfxInt32Item, m_nPortId, true);
- SFX_ITEMSET_GET(_rSet, pSocket, SfxStringItem, DSID_CONN_SOCKET, true);
+ const SfxStringItem* pDrvItem = _rSet.GetItem<SfxStringItem>(DSID_JDBCDRIVERCLASS);
+ const SfxStringItem* pHostName = _rSet.GetItem<SfxStringItem>(DSID_CONN_HOSTNAME);
+ const SfxInt32Item* pPortNumber = _rSet.GetItem<SfxInt32Item>(m_nPortId);
+ const SfxStringItem* pSocket = _rSet.GetItem<SfxStringItem>(DSID_CONN_SOCKET);
if ( bValid )
{
@@ -628,8 +628,8 @@ namespace dbaui
m_aMySQLSettings->implInitControls( _rSet );
- SFX_ITEMSET_GET(_rSet, pUidItem, SfxStringItem, DSID_USER, true);
- SFX_ITEMSET_GET(_rSet, pAllowEmptyPwd, SfxBoolItem, DSID_PASSWORDREQUIRED, true);
+ const SfxStringItem* pUidItem = _rSet.GetItem<SfxStringItem>(DSID_USER);
+ const SfxBoolItem* pAllowEmptyPwd = _rSet.GetItem<SfxBoolItem>(DSID_PASSWORDREQUIRED);
if ( bValid )
{
@@ -729,10 +729,10 @@ namespace dbaui
bool bValid, bReadonly;
getFlags(_rSet, bValid, bReadonly);
- SFX_ITEMSET_GET(_rSet, pBaseDN, SfxStringItem, DSID_CONN_LDAP_BASEDN, true);
- SFX_ITEMSET_GET(_rSet, pUseSSL, SfxBoolItem, DSID_CONN_LDAP_USESSL, true);
- SFX_ITEMSET_GET(_rSet, pPortNumber, SfxInt32Item, DSID_CONN_LDAP_PORTNUMBER, true);
- SFX_ITEMSET_GET(_rSet, pRowCount, SfxInt32Item, DSID_CONN_LDAP_ROWCOUNT, true);
+ const SfxStringItem* pBaseDN = _rSet.GetItem<SfxStringItem>(DSID_CONN_LDAP_BASEDN);
+ const SfxBoolItem* pUseSSL = _rSet.GetItem<SfxBoolItem>(DSID_CONN_LDAP_USESSL);
+ const SfxInt32Item* pPortNumber = _rSet.GetItem<SfxInt32Item>(DSID_CONN_LDAP_PORTNUMBER);
+ const SfxInt32Item* pRowCount = _rSet.GetItem<SfxInt32Item>(DSID_CONN_LDAP_ROWCOUNT);
if ( bValid )
{
diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx
index 565e1babb012..1b3f373e3ef2 100644
--- a/dbaccess/source/ui/dlg/generalpage.cxx
+++ b/dbaccess/source/ui/dlg/generalpage.cxx
@@ -248,8 +248,8 @@ namespace dbaui
if ( bValid )
{
// collect some items and some values
- SFX_ITEMSET_GET( _rSet, pNameItem, SfxStringItem, DSID_NAME, true );
- SFX_ITEMSET_GET( _rSet, pUrlItem, SfxStringItem, DSID_CONNECTURL, true );
+ const SfxStringItem* pNameItem = _rSet.GetItem<SfxStringItem>(DSID_NAME);
+ const SfxStringItem* pUrlItem = _rSet.GetItem<SfxStringItem>(DSID_CONNECTURL);
assert( pUrlItem );
assert( pNameItem );
sName = pNameItem->GetValue();
@@ -296,8 +296,8 @@ namespace dbaui
if ( bValid )
{
// collect some items and some values
- SFX_ITEMSET_GET( _rSet, pNameItem, SfxStringItem, DSID_NAME, true );
- SFX_ITEMSET_GET( _rSet, pUrlItem, SfxStringItem, DSID_CONNECTURL, true );
+ const SfxStringItem* pNameItem = _rSet.GetItem<SfxStringItem>(DSID_NAME);
+ const SfxStringItem* pUrlItem = _rSet.GetItem<SfxStringItem>(DSID_CONNECTURL);
assert( pUrlItem );
assert( pNameItem );
sName = pNameItem->GetValue();
diff --git a/dbaccess/source/ui/dlg/tablespage.cxx b/dbaccess/source/ui/dlg/tablespage.cxx
index 75a51bea944f..1c2ab8c04af0 100644
--- a/dbaccess/source/ui/dlg/tablespage.cxx
+++ b/dbaccess/source/ui/dlg/tablespage.cxx
@@ -226,7 +226,7 @@ namespace dbaui
getFlags(_rSet, bValid, bReadonly);
// get the name of the data source we're working for
- SFX_ITEMSET_GET(_rSet, pNameItem, SfxStringItem, DSID_NAME, true);
+ const SfxStringItem* pNameItem = _rSet.GetItem<SfxStringItem>(DSID_NAME);
OSL_ENSURE(pNameItem, "OTableSubscriptionPage::implInitControls: missing the name attribute!");
OUString sDSName = pNameItem->GetValue();
@@ -350,7 +350,7 @@ namespace dbaui
}
// get the current table filter
- SFX_ITEMSET_GET(_rSet, pTableFilter, OStringListItem, DSID_TABLEFILTER, true);
+ const OStringListItem* pTableFilter = _rSet.GetItem<OStringListItem>(DSID_TABLEFILTER);
Sequence< OUString > aTableFilter;
if (pTableFilter)
aTableFilter = pTableFilter->getList();
diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx
index 9a573a1943fa..423fb3bd22b8 100644
--- a/dbaccess/source/ui/misc/UITools.cxx
+++ b/dbaccess/source/ui/misc/UITools.cxx
@@ -862,14 +862,14 @@ bool callColumnFormatDialog(vcl::Window* _pParent,
// won't reflect these changes, and why do we have a model, then ?)
// horizontal justify
- SFX_ITEMSET_GET(*pSet, pHorJustify, SvxHorJustifyItem, SBA_ATTR_ALIGN_HOR_JUSTIFY, true);
+ const SvxHorJustifyItem* pHorJustify = pSet->GetItem<SvxHorJustifyItem>(SBA_ATTR_ALIGN_HOR_JUSTIFY);
_eJustify = (SvxCellHorJustify)pHorJustify->GetValue();
// format key
if (_bHasFormat)
{
- SFX_ITEMSET_GET(*pSet, pFormat, SfxUInt32Item, SBA_DEF_FMTVALUE, true);
+ const SfxUInt32Item* pFormat = pSet->GetItem<SfxUInt32Item>(SBA_DEF_FMTVALUE);
_nFormatKey = (sal_Int32)pFormat->GetValue();
}
bRet = true;