summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-08-24 12:37:28 +0200
committerNoel Grandin <noel@peralex.com>2016-08-25 08:40:00 +0200
commit271bd3522e1148c0260688a42fd78959225db8cb (patch)
tree4bed1e26667e9609a0973205420e1e26c666da8b /dbaccess
parent6cb3884898a39f57bcb30b2663a258e3971083fe (diff)
convert DataAccessDescriptorProperty to scoped enum
Change-Id: Ifb8fb1d28464f0638ec1485d77ad333b1acc667c
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/ui/app/AppController.cxx2
-rw-r--r--dbaccess/source/ui/app/AppControllerDnD.cxx16
-rw-r--r--dbaccess/source/ui/browser/dbexchange.cxx36
-rw-r--r--dbaccess/source/ui/browser/unodatbr.cxx48
-rw-r--r--dbaccess/source/ui/misc/TableCopyHelper.cxx24
-rw-r--r--dbaccess/source/ui/misc/TokenWriter.cxx20
6 files changed, 73 insertions, 73 deletions
diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx
index d1206dcbc959..18c2fe562bcd 100644
--- a/dbaccess/source/ui/app/AppController.cxx
+++ b/dbaccess/source/ui/app/AppController.cxx
@@ -2447,7 +2447,7 @@ sal_Int8 OApplicationController::executeDrop( const ExecuteDropEvent& _rEvt )
sal_Int8 nAction = _rEvt.mnAction;
Reference<XContent> xContent;
- m_aAsyncDrop.aDroppedData[daComponent] >>= xContent;
+ m_aAsyncDrop.aDroppedData[DataAccessDescriptorProperty::Component] >>= xContent;
if ( xContent.is() )
{
OUString sName = xContent->getIdentifier()->getContentIdentifier();
diff --git a/dbaccess/source/ui/app/AppControllerDnD.cxx b/dbaccess/source/ui/app/AppControllerDnD.cxx
index 3e2141f6962b..692d9868a024 100644
--- a/dbaccess/source/ui/app/AppControllerDnD.cxx
+++ b/dbaccess/source/ui/app/AppControllerDnD.cxx
@@ -586,8 +586,8 @@ bool OApplicationController::paste( ElementType _eType, const svx::ODataAccessDe
if ( _eType == E_QUERY )
{
sal_Int32 nCommandType = CommandType::TABLE;
- if ( _rPasteData.has(daCommandType) )
- _rPasteData[daCommandType] >>= nCommandType;
+ if ( _rPasteData.has(DataAccessDescriptorProperty::CommandType) )
+ _rPasteData[DataAccessDescriptorProperty::CommandType] >>= nCommandType;
if ( CommandType::QUERY == nCommandType || CommandType::COMMAND == nCommandType )
{
@@ -596,9 +596,9 @@ bool OApplicationController::paste( ElementType _eType, const svx::ODataAccessDe
OUString sCommand;
bool bEscapeProcessing = true;
- _rPasteData[daCommand] >>= sCommand;
- if ( _rPasteData.has(daEscapeProcessing) )
- _rPasteData[daEscapeProcessing] >>= bEscapeProcessing;
+ _rPasteData[DataAccessDescriptorProperty::Command] >>= sCommand;
+ if ( _rPasteData.has(DataAccessDescriptorProperty::EscapeProcessing) )
+ _rPasteData[DataAccessDescriptorProperty::EscapeProcessing] >>= bEscapeProcessing;
// plausibility check
bool bValidDescriptor = false;
@@ -749,10 +749,10 @@ bool OApplicationController::paste( ElementType _eType, const svx::ODataAccessDe
OSL_TRACE("There should be a sequence in it!");
return true;
}
- else if ( _rPasteData.has(daComponent) ) // forms or reports
+ else if ( _rPasteData.has(DataAccessDescriptorProperty::Component) ) // forms or reports
{
Reference<XContent> xContent;
- _rPasteData[daComponent] >>= xContent;
+ _rPasteData[DataAccessDescriptorProperty::Component] >>= xContent;
return insertHierachyElement(_eType,_sParentFolder,Reference<XNameAccess>(xContent,UNO_QUERY).is(),xContent,_bMove);
}
}
@@ -815,7 +815,7 @@ IMPL_LINK_NOARG_TYPED( OApplicationController, OnAsyncDrop, void*, void )
&& m_aAsyncDrop.nAction == DND_ACTION_MOVE )
{
Reference<XContent> xContent;
- m_aAsyncDrop.aDroppedData[daComponent] >>= xContent;
+ m_aAsyncDrop.aDroppedData[DataAccessDescriptorProperty::Component] >>= xContent;
::std::vector< OUString> aList;
sal_Int32 nIndex = 0;
OUString sName = xContent->getIdentifier()->getContentIdentifier();
diff --git a/dbaccess/source/ui/browser/dbexchange.cxx b/dbaccess/source/ui/browser/dbexchange.cxx
index 9cf3126d0306..00e9ab6c95e6 100644
--- a/dbaccess/source/ui/browser/dbexchange.cxx
+++ b/dbaccess/source/ui/browser/dbexchange.cxx
@@ -104,7 +104,7 @@ namespace dbaui
osl_atomic_increment( &m_refCount );
Reference<XConnection> xConnection;
- getDescriptor()[ daConnection ] >>= xConnection;
+ getDescriptor()[ DataAccessDescriptorProperty::Connection ] >>= xConnection;
lcl_setListener( xConnection, this, true );
// do not pass the form itself as source result set, since the client might operate on the form, which
@@ -116,9 +116,9 @@ namespace dbaui
OSL_ENSURE( xResultSetClone.is(), "ODataClipboard::ODataClipboard: could not clone the form's result set" );
lcl_setListener( xResultSetClone, this, true );
- getDescriptor()[daCursor] <<= xResultSetClone;
- getDescriptor()[daSelection] <<= i_rSelectedRows;
- getDescriptor()[daBookmarkSelection]<<= i_bBookmarkSelection;
+ getDescriptor()[DataAccessDescriptorProperty::Cursor] <<= xResultSetClone;
+ getDescriptor()[DataAccessDescriptorProperty::Selection] <<= i_rSelectedRows;
+ getDescriptor()[DataAccessDescriptorProperty::BookmarkSelection]<<= i_bBookmarkSelection;
addCompatibleSelectionDescription( i_rSelectedRows );
if ( xConnection.is() && i_rORB.is() )
@@ -194,15 +194,15 @@ namespace dbaui
m_pRtf.clear();
}
- if ( getDescriptor().has( daConnection ) )
+ if ( getDescriptor().has( DataAccessDescriptorProperty::Connection ) )
{
- Reference<XConnection> xConnection( getDescriptor()[daConnection], UNO_QUERY );
+ Reference<XConnection> xConnection( getDescriptor()[DataAccessDescriptorProperty::Connection], UNO_QUERY );
lcl_setListener( xConnection, this, false );
}
- if ( getDescriptor().has( daCursor ) )
+ if ( getDescriptor().has( DataAccessDescriptorProperty::Cursor ) )
{
- Reference< XResultSet > xResultSet( getDescriptor()[ daCursor ], UNO_QUERY );
+ Reference< XResultSet > xResultSet( getDescriptor()[ DataAccessDescriptorProperty::Cursor ], UNO_QUERY );
lcl_setListener( xResultSet, this, false );
}
@@ -213,26 +213,26 @@ namespace dbaui
{
ODataAccessDescriptor& rDescriptor( getDescriptor() );
- if ( rDescriptor.has( daConnection ) )
+ if ( rDescriptor.has( DataAccessDescriptorProperty::Connection ) )
{
- Reference< XConnection > xConnection( rDescriptor[daConnection], UNO_QUERY );
+ Reference< XConnection > xConnection( rDescriptor[DataAccessDescriptorProperty::Connection], UNO_QUERY );
if ( xConnection == i_rSource.Source )
{
- rDescriptor.erase( daConnection );
+ rDescriptor.erase( DataAccessDescriptorProperty::Connection );
}
}
- if ( rDescriptor.has( daCursor ) )
+ if ( rDescriptor.has( DataAccessDescriptorProperty::Cursor ) )
{
- Reference< XResultSet > xResultSet( rDescriptor[ daCursor ], UNO_QUERY );
+ Reference< XResultSet > xResultSet( rDescriptor[ DataAccessDescriptorProperty::Cursor ], UNO_QUERY );
if ( xResultSet == i_rSource.Source )
{
- rDescriptor.erase( daCursor );
+ rDescriptor.erase( DataAccessDescriptorProperty::Cursor );
// Selection and BookmarkSelection are meaningless without a result set
- if ( rDescriptor.has( daSelection ) )
- rDescriptor.erase( daSelection );
- if ( rDescriptor.has( daBookmarkSelection ) )
- rDescriptor.erase( daBookmarkSelection );
+ if ( rDescriptor.has( DataAccessDescriptorProperty::Selection ) )
+ rDescriptor.erase( DataAccessDescriptorProperty::Selection );
+ if ( rDescriptor.has( DataAccessDescriptorProperty::BookmarkSelection ) )
+ rDescriptor.erase( DataAccessDescriptorProperty::BookmarkSelection );
}
}
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx
index c38e5b4b93ca..a0d9ac0f12bc 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -1002,11 +1002,11 @@ void SAL_CALL SbaTableQueryBrowser::statusChanged( const FeatureStateEvent& _rEv
OSL_ENSURE(bProperFormat, "SbaTableQueryBrowser::statusChanged: need a data access descriptor here!");
m_aDocumentDataSource.initializeFrom(aDescriptor);
- OSL_ENSURE( ( m_aDocumentDataSource.has(daDataSource)
- || m_aDocumentDataSource.has(daDatabaseLocation)
+ OSL_ENSURE( ( m_aDocumentDataSource.has(DataAccessDescriptorProperty::DataSource)
+ || m_aDocumentDataSource.has(DataAccessDescriptorProperty::DatabaseLocation)
)
- && m_aDocumentDataSource.has(daCommand)
- && m_aDocumentDataSource.has(daCommandType),
+ && m_aDocumentDataSource.has(DataAccessDescriptorProperty::Command)
+ && m_aDocumentDataSource.has(DataAccessDescriptorProperty::CommandType),
"SbaTableQueryBrowser::statusChanged: incomplete descriptor!");
// check if we know the object which is set as document data source
@@ -1041,13 +1041,13 @@ void SbaTableQueryBrowser::checkDocumentDataSource()
// TODO: should we expand the object container? This may be too expensive just for checking ....
else
{
- if ((nullptr == pObjectEntry) && m_aDocumentDataSource.has(daCommandType) && m_aDocumentDataSource.has(daCommand))
+ if ((nullptr == pObjectEntry) && m_aDocumentDataSource.has(DataAccessDescriptorProperty::CommandType) && m_aDocumentDataSource.has(DataAccessDescriptorProperty::Command))
{ // maybe we have a command to be displayed ?
sal_Int32 nCommandType = CommandType::TABLE;
- m_aDocumentDataSource[daCommandType] >>= nCommandType;
+ m_aDocumentDataSource[DataAccessDescriptorProperty::CommandType] >>= nCommandType;
OUString sCommand;
- m_aDocumentDataSource[daCommand] >>= sCommand;
+ m_aDocumentDataSource[DataAccessDescriptorProperty::Command] >>= sCommand;
bKnownDocDataSource = (CommandType::COMMAND == nCommandType) && (!sCommand.isEmpty());
}
@@ -1065,15 +1065,15 @@ void SbaTableQueryBrowser::checkDocumentDataSource()
void SbaTableQueryBrowser::extractDescriptorProps(const svx::ODataAccessDescriptor& _rDescriptor, OUString& _rDataSource, OUString& _rCommand, sal_Int32& _rCommandType, bool& _rEscapeProcessing)
{
_rDataSource = _rDescriptor.getDataSource();
- if ( _rDescriptor.has(daCommand) )
- _rDescriptor[daCommand] >>= _rCommand;
- if ( _rDescriptor.has(daCommandType) )
- _rDescriptor[daCommandType] >>= _rCommandType;
+ if ( _rDescriptor.has(DataAccessDescriptorProperty::Command) )
+ _rDescriptor[DataAccessDescriptorProperty::Command] >>= _rCommand;
+ if ( _rDescriptor.has(DataAccessDescriptorProperty::CommandType) )
+ _rDescriptor[DataAccessDescriptorProperty::CommandType] >>= _rCommandType;
// escape processing is the only one allowed not to be present
_rEscapeProcessing = true;
- if (_rDescriptor.has(daEscapeProcessing))
- _rEscapeProcessing = ::cppu::any2bool(_rDescriptor[daEscapeProcessing]);
+ if (_rDescriptor.has(DataAccessDescriptorProperty::EscapeProcessing))
+ _rEscapeProcessing = ::cppu::any2bool(_rDescriptor[DataAccessDescriptorProperty::EscapeProcessing]);
}
namespace
@@ -1446,7 +1446,7 @@ sal_Bool SAL_CALL SbaTableQueryBrowser::select( const Any& _rSelection ) throw (
}
// check the presence of the props we need
- if ( !(aDescriptor.has(daDataSource) || aDescriptor.has(daDatabaseLocation)) || !aDescriptor.has(daCommand) || !aDescriptor.has(daCommandType))
+ if ( !(aDescriptor.has(DataAccessDescriptorProperty::DataSource) || aDescriptor.has(DataAccessDescriptorProperty::DatabaseLocation)) || !aDescriptor.has(DataAccessDescriptorProperty::Command) || !aDescriptor.has(DataAccessDescriptorProperty::CommandType))
throw IllegalArgumentException(OUString(), *this, 1);
// TODO: error message
@@ -1465,8 +1465,8 @@ Any SAL_CALL SbaTableQueryBrowser::getSelection( ) throw (RuntimeException, std
Reference< XPropertySet > aFormProps(getRowSet(), UNO_QUERY);
ODataAccessDescriptor aDescriptor(aFormProps);
// remove properties which are not part of our "selection"
- aDescriptor.erase(daConnection);
- aDescriptor.erase(daCursor);
+ aDescriptor.erase(DataAccessDescriptorProperty::Connection);
+ aDescriptor.erase(DataAccessDescriptorProperty::Cursor);
aReturn <<= aDescriptor.createPropertyValueSequence();
}
@@ -1974,14 +1974,14 @@ void SbaTableQueryBrowser::Execute(sal_uInt16 nId, const Sequence< PropertyValue
xProp->getPropertyValue(PROPERTY_DATASOURCENAME) >>= sDataSourceName;
aDescriptor.setDataSource(sDataSourceName);
- aDescriptor[daCommand] = xProp->getPropertyValue(PROPERTY_COMMAND);
- aDescriptor[daCommandType] = xProp->getPropertyValue(PROPERTY_COMMAND_TYPE);
- aDescriptor[daConnection] = xProp->getPropertyValue(PROPERTY_ACTIVE_CONNECTION);
- aDescriptor[daCursor] <<= xCursorClone;
+ aDescriptor[DataAccessDescriptorProperty::Command] = xProp->getPropertyValue(PROPERTY_COMMAND);
+ aDescriptor[DataAccessDescriptorProperty::CommandType] = xProp->getPropertyValue(PROPERTY_COMMAND_TYPE);
+ aDescriptor[DataAccessDescriptorProperty::Connection] = xProp->getPropertyValue(PROPERTY_ACTIVE_CONNECTION);
+ aDescriptor[DataAccessDescriptorProperty::Cursor] <<= xCursorClone;
if ( aSelection.getLength() )
{
- aDescriptor[daSelection] <<= aSelection;
- aDescriptor[daBookmarkSelection] <<= false;
+ aDescriptor[DataAccessDescriptorProperty::Selection] <<= aSelection;
+ aDescriptor[DataAccessDescriptorProperty::BookmarkSelection] <<= false;
// these are selection indices
// before we change this, all clients have to be adjusted
// so that they recognize the new BookmarkSelection property!
@@ -3543,8 +3543,8 @@ bool SbaTableQueryBrowser::implGetQuerySignature( OUString& _rCommand, bool& _bE
Reference< XPropertySet > xRowsetProps( getRowSet(), UNO_QUERY );
ODataAccessDescriptor aDesc( xRowsetProps );
sDataSourceName = aDesc.getDataSource();
- aDesc[ daCommand ] >>= sCommand;
- aDesc[ daCommandType ] >>= nCommandType;
+ aDesc[ DataAccessDescriptorProperty::Command ] >>= sCommand;
+ aDesc[ DataAccessDescriptorProperty::CommandType ] >>= nCommandType;
// do we need to do anything?
if ( CommandType::QUERY != nCommandType )
diff --git a/dbaccess/source/ui/misc/TableCopyHelper.cxx b/dbaccess/source/ui/misc/TableCopyHelper.cxx
index 1b14e462b7c9..527072d59c04 100644
--- a/dbaccess/source/ui/misc/TableCopyHelper.cxx
+++ b/dbaccess/source/ui/misc/TableCopyHelper.cxx
@@ -140,37 +140,37 @@ void OTableCopyHelper::pasteTable( const svx::ODataAccessDescriptor& _rPasteData
OUString sSrcDataSourceName = _rPasteData.getDataSource();
OUString sCommand;
- _rPasteData[ daCommand ] >>= sCommand;
+ _rPasteData[ DataAccessDescriptorProperty::Command ] >>= sCommand;
Reference<XConnection> xSrcConnection;
- if ( _rPasteData.has(daConnection) )
+ if ( _rPasteData.has(DataAccessDescriptorProperty::Connection) )
{
- OSL_VERIFY( _rPasteData[daConnection] >>= xSrcConnection );
+ OSL_VERIFY( _rPasteData[DataAccessDescriptorProperty::Connection] >>= xSrcConnection );
}
Reference< XResultSet > xResultSet;
- if ( _rPasteData.has(daCursor) )
+ if ( _rPasteData.has(DataAccessDescriptorProperty::Cursor) )
{
- OSL_VERIFY( _rPasteData[ daCursor ] >>= xResultSet );
+ OSL_VERIFY( _rPasteData[ DataAccessDescriptorProperty::Cursor ] >>= xResultSet );
}
Sequence< Any > aSelection;
- if ( _rPasteData.has( daSelection ) )
+ if ( _rPasteData.has( DataAccessDescriptorProperty::Selection ) )
{
- OSL_VERIFY( _rPasteData[ daSelection ] >>= aSelection );
- OSL_ENSURE( _rPasteData.has( daBookmarkSelection ), "OTableCopyHelper::pasteTable: you should specify BookmarkSelection, too, to be on the safe side!" );
+ OSL_VERIFY( _rPasteData[ DataAccessDescriptorProperty::Selection ] >>= aSelection );
+ OSL_ENSURE( _rPasteData.has( DataAccessDescriptorProperty::BookmarkSelection ), "OTableCopyHelper::pasteTable: you should specify BookmarkSelection, too, to be on the safe side!" );
}
bool bBookmarkSelection( true );
- if ( _rPasteData.has( daBookmarkSelection ) )
+ if ( _rPasteData.has( DataAccessDescriptorProperty::BookmarkSelection ) )
{
- OSL_VERIFY( _rPasteData[ daBookmarkSelection ] >>= bBookmarkSelection );
+ OSL_VERIFY( _rPasteData[ DataAccessDescriptorProperty::BookmarkSelection ] >>= bBookmarkSelection );
}
OSL_ENSURE( bBookmarkSelection, "OTableCopyHelper::pasteTable: working with selection-indicies (instead of bookmarks) is error-prone, and thus deprecated!" );
sal_Int32 nCommandType = CommandType::COMMAND;
- if ( _rPasteData.has(daCommandType) )
- _rPasteData[daCommandType] >>= nCommandType;
+ if ( _rPasteData.has(DataAccessDescriptorProperty::CommandType) )
+ _rPasteData[DataAccessDescriptorProperty::CommandType] >>= nCommandType;
insertTable( sSrcDataSourceName, xSrcConnection, sCommand, nCommandType,
xResultSet, aSelection, bBookmarkSelection,
diff --git a/dbaccess/source/ui/misc/TokenWriter.cxx b/dbaccess/source/ui/misc/TokenWriter.cxx
index 98a3312919be..cb7d8873356c 100644
--- a/dbaccess/source/ui/misc/TokenWriter.cxx
+++ b/dbaccess/source/ui/misc/TokenWriter.cxx
@@ -190,12 +190,12 @@ void ODatabaseImportExport::impl_initFromDescriptor( const ODataAccessDescriptor
if ( !_bPlusDefaultInit )
{
m_sDataSourceName = _aDataDescriptor.getDataSource();
- _aDataDescriptor[daCommandType] >>= m_nCommandType;
- _aDataDescriptor[daCommand] >>= m_sName;
+ _aDataDescriptor[DataAccessDescriptorProperty::CommandType] >>= m_nCommandType;
+ _aDataDescriptor[DataAccessDescriptorProperty::Command] >>= m_sName;
// some additional information
- if(_aDataDescriptor.has(daConnection))
+ if(_aDataDescriptor.has(DataAccessDescriptorProperty::Connection))
{
- Reference< XConnection > xPureConn( _aDataDescriptor[daConnection], UNO_QUERY );
+ Reference< XConnection > xPureConn( _aDataDescriptor[DataAccessDescriptorProperty::Connection], UNO_QUERY );
m_xConnection.reset( xPureConn, SharedConnection::NoTakeOwnership );
Reference< XEventListener> xEvt(static_cast<cppu::OWeakObject*>(this),UNO_QUERY);
Reference< XComponent > xComponent(m_xConnection, UNO_QUERY);
@@ -203,15 +203,15 @@ void ODatabaseImportExport::impl_initFromDescriptor( const ODataAccessDescriptor
xComponent->addEventListener(xEvt);
}
- if ( _aDataDescriptor.has( daSelection ) )
- _aDataDescriptor[ daSelection ] >>= m_aSelection;
+ if ( _aDataDescriptor.has( DataAccessDescriptorProperty::Selection ) )
+ _aDataDescriptor[ DataAccessDescriptorProperty::Selection ] >>= m_aSelection;
- if ( _aDataDescriptor.has( daBookmarkSelection ) )
- _aDataDescriptor[ daBookmarkSelection ] >>= m_bBookmarkSelection;
+ if ( _aDataDescriptor.has( DataAccessDescriptorProperty::BookmarkSelection ) )
+ _aDataDescriptor[ DataAccessDescriptorProperty::BookmarkSelection ] >>= m_bBookmarkSelection;
- if ( _aDataDescriptor.has( daCursor ) )
+ if ( _aDataDescriptor.has( DataAccessDescriptorProperty::Cursor ) )
{
- _aDataDescriptor[ daCursor ] >>= m_xResultSet;
+ _aDataDescriptor[ DataAccessDescriptorProperty::Cursor ] >>= m_xResultSet;
m_xRowLocate.set( m_xResultSet, UNO_QUERY );
}