summaryrefslogtreecommitdiff
path: root/sw
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 /sw
parent6cb3884898a39f57bcb30b2663a258e3971083fe (diff)
convert DataAccessDescriptorProperty to scoped enum
Change-Id: Ifb8fb1d28464f0638ec1485d77ad333b1acc667c
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/unocore/unofield.cxx4
-rw-r--r--sw/source/uibase/app/apphdl.cxx14
-rw-r--r--sw/source/uibase/app/swmodul1.cxx4
-rw-r--r--sw/source/uibase/dbui/dbmgr.cxx44
-rw-r--r--sw/source/uibase/dochdl/swdtflvr.cxx14
-rw-r--r--sw/source/uibase/shells/textsh2.cxx8
-rw-r--r--sw/source/uibase/uno/unodispatch.cxx8
-rw-r--r--sw/source/uibase/uno/unomailmerge.cxx16
-rw-r--r--sw/source/uibase/utlui/condedit.cxx4
9 files changed, 58 insertions, 58 deletions
diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx
index 36bf54b9d291..71e33bb79a29 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -795,9 +795,9 @@ SwFieldType* SwXFieldMaster::GetFieldType(bool const bDontCreate) const
// set DataSource
svx::ODataAccessDescriptor aAcc;
if (!m_pImpl->m_sParam1.isEmpty())
- aAcc[svx::daDataSource] <<= m_pImpl->m_sParam1; // DataBaseName
+ aAcc[svx::DataAccessDescriptorProperty::DataSource] <<= m_pImpl->m_sParam1; // DataBaseName
else if (!m_pImpl->m_sParam5.isEmpty())
- aAcc[svx::daDatabaseLocation] <<= m_pImpl->m_sParam5; // DataBaseURL
+ aAcc[svx::DataAccessDescriptorProperty::DatabaseLocation] <<= m_pImpl->m_sParam5; // DataBaseURL
aData.sDataSource = aAcc.getDataSource();
aData.sCommand = m_pImpl->m_sParam2;
diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx
index fc088df0496b..0610f8cc587d 100644
--- a/sw/source/uibase/app/apphdl.cxx
+++ b/sw/source/uibase/app/apphdl.cxx
@@ -287,18 +287,18 @@ std::shared_ptr<SwMailMergeConfigItem> SwView::EnsureMailMergeConfigItem(const S
{
SwDBData aDBData;
svx::ODataAccessDescriptor aDescriptor(aDBValues);
- aDescriptor[svx::daDataSource] >>= aDBData.sDataSource;
- aDescriptor[svx::daCommand] >>= aDBData.sCommand;
- aDescriptor[svx::daCommandType] >>= aDBData.nCommandType;
+ aDescriptor[svx::DataAccessDescriptorProperty::DataSource] >>= aDBData.sDataSource;
+ aDescriptor[svx::DataAccessDescriptorProperty::Command] >>= aDBData.sCommand;
+ aDescriptor[svx::DataAccessDescriptorProperty::CommandType] >>= aDBData.nCommandType;
uno::Sequence< uno::Any > aSelection;
uno::Reference< sdbc::XConnection> xConnection;
uno::Reference< sdbc::XDataSource> xSource;
uno::Reference< sdbcx::XColumnsSupplier> xColumnsSupplier;
- if (aDescriptor.has(svx::daSelection))
- aDescriptor[svx::daSelection] >>= aSelection;
- if (aDescriptor.has(svx::daConnection))
- aDescriptor[svx::daConnection] >>= xConnection;
+ if (aDescriptor.has(svx::DataAccessDescriptorProperty::Selection))
+ aDescriptor[svx::DataAccessDescriptorProperty::Selection] >>= aSelection;
+ if (aDescriptor.has(svx::DataAccessDescriptorProperty::Connection))
+ aDescriptor[svx::DataAccessDescriptorProperty::Connection] >>= xConnection;
uno::Reference<container::XChild> xChild(xConnection, uno::UNO_QUERY);
if (xChild.is())
xSource.set(xChild->getParent(), uno::UNO_QUERY);
diff --git a/sw/source/uibase/app/swmodul1.cxx b/sw/source/uibase/app/swmodul1.cxx
index e3c080a91837..2e72374bdb66 100644
--- a/sw/source/uibase/app/swmodul1.cxx
+++ b/sw/source/uibase/app/swmodul1.cxx
@@ -379,8 +379,8 @@ void SwModule::ShowDBObj(SwView& rView, const SwDBData& rData)
ODataAccessDescriptor aSelection;
aSelection.setDataSource(rData.sDataSource);
- aSelection[daCommand] <<= rData.sCommand;
- aSelection[daCommandType] <<= rData.nCommandType;
+ aSelection[DataAccessDescriptorProperty::Command] <<= rData.sCommand;
+ aSelection[DataAccessDescriptorProperty::CommandType] <<= rData.nCommandType;
xControllerSelection->select(makeAny(aSelection.createPropertyValueSequence()));
}
else {
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 7d585512f82b..6ac018bf7933 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -464,15 +464,15 @@ bool SwDBManager::Merge( const SwMergeDescriptor& rMergeDesc )
uno::Reference< sdbc::XConnection> xConnection;
aData.sDataSource = rMergeDesc.rDescriptor.getDataSource();
- rMergeDesc.rDescriptor[svx::daCommand] >>= aData.sCommand;
- rMergeDesc.rDescriptor[svx::daCommandType] >>= aData.nCommandType;
+ rMergeDesc.rDescriptor[svx::DataAccessDescriptorProperty::Command] >>= aData.sCommand;
+ rMergeDesc.rDescriptor[svx::DataAccessDescriptorProperty::CommandType] >>= aData.nCommandType;
- if ( rMergeDesc.rDescriptor.has(svx::daCursor) )
- rMergeDesc.rDescriptor[svx::daCursor] >>= xResSet;
- if ( rMergeDesc.rDescriptor.has(svx::daSelection) )
- rMergeDesc.rDescriptor[svx::daSelection] >>= aSelection;
- if ( rMergeDesc.rDescriptor.has(svx::daConnection) )
- rMergeDesc.rDescriptor[svx::daConnection] >>= xConnection;
+ if ( rMergeDesc.rDescriptor.has(svx::DataAccessDescriptorProperty::Cursor) )
+ rMergeDesc.rDescriptor[svx::DataAccessDescriptorProperty::Cursor] >>= xResSet;
+ if ( rMergeDesc.rDescriptor.has(svx::DataAccessDescriptorProperty::Selection) )
+ rMergeDesc.rDescriptor[svx::DataAccessDescriptorProperty::Selection] >>= aSelection;
+ if ( rMergeDesc.rDescriptor.has(svx::DataAccessDescriptorProperty::Connection) )
+ rMergeDesc.rDescriptor[svx::DataAccessDescriptorProperty::Connection] >>= xConnection;
if(aData.sDataSource.isEmpty() || aData.sCommand.isEmpty() || !xResSet.is())
{
@@ -2796,13 +2796,13 @@ void SwDBManager::ExecuteFormLetter( SwWrtShell& rSh,
svx::ODataAccessDescriptor aDescriptor(rProperties);
sDataSource = aDescriptor.getDataSource();
- OSL_VERIFY(aDescriptor[svx::daCommand] >>= sDataTableOrQuery);
- OSL_VERIFY(aDescriptor[svx::daCommandType] >>= nCmdType);
+ OSL_VERIFY(aDescriptor[svx::DataAccessDescriptorProperty::Command] >>= sDataTableOrQuery);
+ OSL_VERIFY(aDescriptor[svx::DataAccessDescriptorProperty::CommandType] >>= nCmdType);
- if ( aDescriptor.has(svx::daSelection) )
- aDescriptor[svx::daSelection] >>= aSelection;
- if ( aDescriptor.has(svx::daConnection) )
- aDescriptor[svx::daConnection] >>= xConnection;
+ if ( aDescriptor.has(svx::DataAccessDescriptorProperty::Selection) )
+ aDescriptor[svx::DataAccessDescriptorProperty::Selection] >>= aSelection;
+ if ( aDescriptor.has(svx::DataAccessDescriptorProperty::Connection) )
+ aDescriptor[svx::DataAccessDescriptorProperty::Connection] >>= xConnection;
if(sDataSource.isEmpty() || sDataTableOrQuery.isEmpty())
{
@@ -2828,11 +2828,11 @@ void SwDBManager::ExecuteFormLetter( SwWrtShell& rSh,
assert( pImpl->pMergeDialog && "Dialog creation failed!" );
if(pImpl->pMergeDialog->Execute() == RET_OK)
{
- aDescriptor[svx::daSelection] <<= pImpl->pMergeDialog->GetSelection();
+ aDescriptor[svx::DataAccessDescriptorProperty::Selection] <<= pImpl->pMergeDialog->GetSelection();
uno::Reference<sdbc::XResultSet> xResSet = pImpl->pMergeDialog->GetResultSet();
if(xResSet.is())
- aDescriptor[svx::daCursor] <<= xResSet;
+ aDescriptor[svx::DataAccessDescriptorProperty::Cursor] <<= xResSet;
// SfxObjectShellRef is ok, since there should be no control over the document lifetime here
SfxObjectShellRef xDocShell = rSh.GetView().GetViewFrame()->GetObjectShell();
@@ -2855,7 +2855,7 @@ void SwDBManager::ExecuteFormLetter( SwWrtShell& rSh,
// reset the cursor inside
xResSet = nullptr;
- aDescriptor[svx::daCursor] <<= xResSet;
+ aDescriptor[svx::DataAccessDescriptorProperty::Cursor] <<= xResSet;
}
if(pFound)
{
@@ -3078,11 +3078,11 @@ std::shared_ptr<SwMailMergeConfigItem> SwDBManager::PerformMailMerge(SwView* pVi
svx::ODataAccessDescriptor aDescriptor;
aDescriptor.setDataSource(xConfigItem->GetCurrentDBData().sDataSource);
- aDescriptor[ svx::daConnection ] <<= xConfigItem->GetConnection().getTyped();
- aDescriptor[ svx::daCursor ] <<= xConfigItem->GetResultSet();
- aDescriptor[ svx::daCommand ] <<= xConfigItem->GetCurrentDBData().sCommand;
- aDescriptor[ svx::daCommandType ] <<= xConfigItem->GetCurrentDBData().nCommandType;
- aDescriptor[ svx::daSelection ] <<= xConfigItem->GetSelection();
+ aDescriptor[ svx::DataAccessDescriptorProperty::Connection ] <<= xConfigItem->GetConnection().getTyped();
+ aDescriptor[ svx::DataAccessDescriptorProperty::Cursor ] <<= xConfigItem->GetResultSet();
+ aDescriptor[ svx::DataAccessDescriptorProperty::Command ] <<= xConfigItem->GetCurrentDBData().sCommand;
+ aDescriptor[ svx::DataAccessDescriptorProperty::CommandType ] <<= xConfigItem->GetCurrentDBData().nCommandType;
+ aDescriptor[ svx::DataAccessDescriptorProperty::Selection ] <<= xConfigItem->GetSelection();
SwWrtShell& rSh = pView->GetWrtShell();
xConfigItem->SetTargetView(nullptr);
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx
index 288144bc90fb..dc75047a9158 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -2671,14 +2671,14 @@ bool SwTransferable::PasteDBData( TransferableDataHelper& rData,
if ( bDataAvailable )
{
- pConnectionItem.reset(new SfxUsrAnyItem(FN_DB_CONNECTION_ANY, aDesc[daConnection]));
- pColumnItem.reset(new SfxUsrAnyItem(FN_DB_COLUMN_ANY, aDesc[daColumnObject]));
+ pConnectionItem.reset(new SfxUsrAnyItem(FN_DB_CONNECTION_ANY, aDesc[DataAccessDescriptorProperty::Connection]));
+ pColumnItem.reset(new SfxUsrAnyItem(FN_DB_COLUMN_ANY, aDesc[DataAccessDescriptorProperty::ColumnObject]));
pSourceItem.reset(new SfxUsrAnyItem(FN_DB_DATA_SOURCE_ANY, makeAny(aDesc.getDataSource())));
- pCommandItem.reset(new SfxUsrAnyItem(FN_DB_DATA_COMMAND_ANY, aDesc[daCommand]));
- pCommandTypeItem.reset(new SfxUsrAnyItem(FN_DB_DATA_COMMAND_TYPE_ANY, aDesc[daCommandType]));
- pColumnNameItem.reset(new SfxUsrAnyItem(FN_DB_DATA_COLUMN_NAME_ANY, aDesc[daColumnName]));
- pSelectionItem.reset(new SfxUsrAnyItem(FN_DB_DATA_SELECTION_ANY, aDesc[daSelection]));
- pCursorItem.reset(new SfxUsrAnyItem(FN_DB_DATA_CURSOR_ANY, aDesc[daCursor]));
+ pCommandItem.reset(new SfxUsrAnyItem(FN_DB_DATA_COMMAND_ANY, aDesc[DataAccessDescriptorProperty::Command]));
+ pCommandTypeItem.reset(new SfxUsrAnyItem(FN_DB_DATA_COMMAND_TYPE_ANY, aDesc[DataAccessDescriptorProperty::CommandType]));
+ pColumnNameItem.reset(new SfxUsrAnyItem(FN_DB_DATA_COLUMN_NAME_ANY, aDesc[DataAccessDescriptorProperty::ColumnName]));
+ pSelectionItem.reset(new SfxUsrAnyItem(FN_DB_DATA_SELECTION_ANY, aDesc[DataAccessDescriptorProperty::Selection]));
+ pCursorItem.reset(new SfxUsrAnyItem(FN_DB_DATA_CURSOR_ANY, aDesc[DataAccessDescriptorProperty::Cursor]));
}
SwView& rView = rSh.GetView();
diff --git a/sw/source/uibase/shells/textsh2.cxx b/sw/source/uibase/shells/textsh2.cxx
index 33f2b87d32dd..47969fa7b26f 100644
--- a/sw/source/uibase/shells/textsh2.cxx
+++ b/sw/source/uibase/shells/textsh2.cxx
@@ -172,10 +172,10 @@ void SwTextShell::ExecDB(SfxRequest &rReq)
ODataAccessDescriptor aDescriptor;
aDescriptor.setDataSource(sSourceArg);
- aDescriptor[daCommand] <<= sCommandArg;
- aDescriptor[daCursor] <<= xCursor;
- aDescriptor[daSelection] <<= aSelection;
- aDescriptor[daCommandType] <<= nCommandTypeArg;
+ aDescriptor[DataAccessDescriptorProperty::Command] <<= sCommandArg;
+ aDescriptor[DataAccessDescriptorProperty::Cursor] <<= xCursor;
+ aDescriptor[DataAccessDescriptorProperty::Selection] <<= aSelection;
+ aDescriptor[DataAccessDescriptorProperty::CommandType] <<= nCommandTypeArg;
SwMergeDescriptor aMergeDesc( DBMGR_MERGE, *GetShellPtr(), aDescriptor );
pDBManager->Merge(aMergeDesc);
diff --git a/sw/source/uibase/uno/unodispatch.cxx b/sw/source/uibase/uno/unodispatch.cxx
index 3335eebc4dfd..b64983cc8e25 100644
--- a/sw/source/uibase/uno/unodispatch.cxx
+++ b/sw/source/uibase/uno/unodispatch.cxx
@@ -257,8 +257,8 @@ void SwXDispatch::dispatch(const util::URL& aURL,
const SwDBData& rData = m_pView->GetWrtShell().GetDBDesc();
svx::ODataAccessDescriptor aDescriptor;
aDescriptor.setDataSource(rData.sDataSource);
- aDescriptor[svx::daCommand] <<= rData.sCommand;
- aDescriptor[svx::daCommandType] <<= rData.nCommandType;
+ aDescriptor[svx::DataAccessDescriptorProperty::Command] <<= rData.sCommand;
+ aDescriptor[svx::DataAccessDescriptorProperty::CommandType] <<= rData.nCommandType;
aEvent.State <<= aDescriptor.createPropertyValueSequence();
aEvent.IsEnabled = !rData.sDataSource.isEmpty();
@@ -303,8 +303,8 @@ void SwXDispatch::addStatusListener(
svx::ODataAccessDescriptor aDescriptor;
aDescriptor.setDataSource(rData.sDataSource);
- aDescriptor[svx::daCommand] <<= rData.sCommand;
- aDescriptor[svx::daCommandType] <<= rData.nCommandType;
+ aDescriptor[svx::DataAccessDescriptorProperty::Command] <<= rData.sCommand;
+ aDescriptor[svx::DataAccessDescriptorProperty::CommandType] <<= rData.nCommandType;
aEvent.State <<= aDescriptor.createPropertyValueSequence();
aEvent.IsEnabled = !rData.sDataSource.isEmpty();
diff --git a/sw/source/uibase/uno/unomailmerge.cxx b/sw/source/uibase/uno/unomailmerge.cxx
index 938a907d6a25..cacd76429d08 100644
--- a/sw/source/uibase/uno/unomailmerge.cxx
+++ b/sw/source/uibase/uno/unomailmerge.cxx
@@ -654,14 +654,14 @@ uno::Any SAL_CALL SwXMailMerge::execute(
svx::ODataAccessDescriptor aDescriptor;
aDescriptor.setDataSource(aCurDataSourceName);
- aDescriptor[ svx::daConnection ] <<= xCurConnection;
- aDescriptor[ svx::daCommand ] <<= aCurDataCommand;
- aDescriptor[ svx::daCommandType ] <<= nCurDataCommandType;
- aDescriptor[ svx::daEscapeProcessing ] <<= bCurEscapeProcessing;
- aDescriptor[ svx::daCursor ] <<= xCurResultSet;
- // aDescriptor[ svx::daColumnName ] not used
- // aDescriptor[ svx::daColumnObject ] not used
- aDescriptor[ svx::daSelection ] <<= aCurSelection;
+ aDescriptor[ svx::DataAccessDescriptorProperty::Connection ] <<= xCurConnection;
+ aDescriptor[ svx::DataAccessDescriptorProperty::Command ] <<= aCurDataCommand;
+ aDescriptor[ svx::DataAccessDescriptorProperty::CommandType ] <<= nCurDataCommandType;
+ aDescriptor[ svx::DataAccessDescriptorProperty::EscapeProcessing ] <<= bCurEscapeProcessing;
+ aDescriptor[ svx::DataAccessDescriptorProperty::Cursor ] <<= xCurResultSet;
+ // aDescriptor[ svx::DataAccessDescriptorProperty::ColumnName ] not used
+ // aDescriptor[ svx::DataAccessDescriptorProperty::ColumnObject ] not used
+ aDescriptor[ svx::DataAccessDescriptorProperty::Selection ] <<= aCurSelection;
DBManagerOptions nMergeType;
switch (nCurOutputType)
diff --git a/sw/source/uibase/utlui/condedit.cxx b/sw/source/uibase/utlui/condedit.cxx
index fd11e8a5b8a0..4dffb1b01c02 100644
--- a/sw/source/uibase/utlui/condedit.cxx
+++ b/sw/source/uibase/utlui/condedit.cxx
@@ -71,11 +71,11 @@ sal_Int8 ConditionEdit::ExecuteDrop( const ExecuteDropEvent& rEvt )
sDBName += sTmp;
sDBName += ".";
- aColDesc[daCommand] >>= sTmp;
+ aColDesc[DataAccessDescriptorProperty::Command] >>= sTmp;
sDBName += sTmp;
sDBName += ".";
- aColDesc[daColumnName] >>= sTmp;
+ aColDesc[DataAccessDescriptorProperty::ColumnName] >>= sTmp;
sDBName += sTmp;
if (bBrackets)
sDBName += "]";