summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Specht <os@openoffice.org>2001-06-29 12:30:27 +0000
committerOliver Specht <os@openoffice.org>2001-06-29 12:30:27 +0000
commit56f7f73c6bfa974ec33795b2da6dfc6a7e8e52c0 (patch)
tree36fcd66d96d204b1d626ab3ab6ab0b886c882257
parent3a6b51cd6381ceea19788a46a4570d451ab84195 (diff)
#88849# insert DB Field: use OColumnTransferable
-rw-r--r--sw/inc/cmdid.h8
-rw-r--r--sw/source/ui/dochdl/swdtflvr.cxx17
-rw-r--r--sw/source/ui/shells/textsh2.cxx27
3 files changed, 39 insertions, 13 deletions
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index 052c911ab12b..b313041aef48 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -2,9 +2,9 @@
*
* $RCSfile: cmdid.h,v $
*
- * $Revision: 1.16 $
+ * $Revision: 1.17 $
*
- * last change: $Author: os $ $Date: 2001-06-25 13:42:09 $
+ * last change: $Author: os $ $Date: 2001-06-29 13:30:07 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1033,7 +1033,9 @@ Achtung: Ab sofort sind in diesem File keine C++-Kommentare (//) mehr
#define FN_DB_INSERT_COLUMNS (FN_QUERY2 + 2) /* insert data into text/table/as fields*/
#define FN_DB_CONNECTION_ANY (FN_QUERY2 + 3)
#define FN_DB_COLUMN_ANY (FN_QUERY2 + 4)
-
+#define FN_DB_DATA_SOURCE_ANY (FN_QUERY2 + 5)
+#define FN_DB_DATA_COMMAND_ANY (FN_QUERY2 + 6)
+#define FN_DB_DATA_COMMAND_TYPE_ANY (FN_QUERY2 + 7)
/*--------------------------------------------------------------------
Bereich: Envelope
diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx
index 3e2885f56127..a1cc1c5f57e2 100644
--- a/sw/source/ui/dochdl/swdtflvr.cxx
+++ b/sw/source/ui/dochdl/swdtflvr.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: swdtflvr.cxx,v $
*
- * $Revision: 1.19 $
+ * $Revision: 1.20 $
*
- * last change: $Author: os $ $Date: 2001-06-08 13:47:30 $
+ * last change: $Author: os $ $Date: 2001-06-29 13:30:25 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -2411,6 +2411,9 @@ int SwTransferable::_PasteDBData( TransferableDataHelper& rData,
SfxUsrAnyItem* pConnectionItem = 0;
SfxUsrAnyItem* pColumnItem = 0;
SfxUsrAnyItem* pSourceItem = 0;
+ SfxUsrAnyItem* pCommandItem = 0;
+ SfxUsrAnyItem* pCommandTypeItem = 0;
+
DataFlavorExVector& rVector = rData.GetDataFlavorExVector();
if(OColumnTransferable::canExtractColumnDescriptor(rVector, CTF_COLUMN_DESCRIPTOR))
{
@@ -2418,6 +2421,9 @@ int SwTransferable::_PasteDBData( TransferableDataHelper& rData,
rData);
pConnectionItem = new SfxUsrAnyItem(FN_DB_CONNECTION_ANY, aColDesc[daConnection]);
pColumnItem = new SfxUsrAnyItem(FN_DB_COLUMN_ANY, aColDesc[daColumnObject]);
+ pSourceItem = new SfxUsrAnyItem(FN_DB_DATA_SOURCE_ANY, aColDesc[daDataSource]);
+ pCommandItem = new SfxUsrAnyItem(FN_DB_DATA_COMMAND_ANY, aColDesc[daCommand]);
+ pCommandTypeItem = new SfxUsrAnyItem(FN_DB_DATA_COMMAND_TYPE_ANY, aColDesc[daCommandType]);
}
SwView& rView = rSh.GetView();
@@ -2427,9 +2433,14 @@ int SwTransferable::_PasteDBData( TransferableDataHelper& rData,
SfxStringItem aDataDesc( nWh, sTxt );
rView.GetViewFrame()->GetDispatcher()->Execute(
nWh, SFX_CALLMODE_ASYNCHRON, &aDataDesc,
- pConnectionItem, pColumnItem, 0L);
+ pConnectionItem, pColumnItem,
+ pSourceItem, pCommandItem, pCommandTypeItem,
+ 0L);
delete pConnectionItem;
delete pColumnItem;
+ delete pSourceItem;
+ delete pCommandItem;
+ delete pCommandTypeItem;
}
else
{
diff --git a/sw/source/ui/shells/textsh2.cxx b/sw/source/ui/shells/textsh2.cxx
index 8f7bb0a96790..c9f9f54dc4df 100644
--- a/sw/source/ui/shells/textsh2.cxx
+++ b/sw/source/ui/shells/textsh2.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: textsh2.cxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: os $ $Date: 2001-06-20 14:40:59 $
+ * last change: $Author: os $ $Date: 2001-06-29 13:30:27 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -247,18 +247,31 @@ void SwTextShell::ExecDB(SfxRequest &rReq)
case FN_QRY_INSERT_FIELD:
{
- String sSbaData = ((const SfxStringItem&)pArgs->Get(FN_QRY_INSERT_FIELD)).GetValue();
const SfxPoolItem* pConnectionItem = 0;
const SfxPoolItem* pColumnItem = 0;
+ const SfxPoolItem* pSourceItem = 0;
+ const SfxPoolItem* pCommandItem = 0;
+ const SfxPoolItem* pCommandTypeItem = 0;
+
pArgs->GetItemState(FN_DB_CONNECTION_ANY, FALSE, &pConnectionItem);
pArgs->GetItemState(FN_DB_COLUMN_ANY, FALSE, &pColumnItem);
+ pArgs->GetItemState(FN_DB_DATA_SOURCE_ANY, FALSE, &pSourceItem);
+ pArgs->GetItemState(FN_DB_DATA_COMMAND_ANY, FALSE, &pCommandItem);
+ pArgs->GetItemState(FN_DB_DATA_COMMAND_TYPE_ANY, FALSE, &pCommandTypeItem);
- String sDBName = sSbaData.GetToken(0, DB_DD_DELIM);
+ OUString sSource, sCommand;
+ sal_Int32 nCommandType = 0;
+ if(pSourceItem)
+ ((SfxUsrAnyItem*)pSourceItem)->GetValue() >>= sSource;
+ if(pCommandItem)
+ ((SfxUsrAnyItem*)pCommandItem)->GetValue() >>= sCommand;
+ if(pCommandTypeItem)
+ ((SfxUsrAnyItem*)pCommandTypeItem)->GetValue() >>= nCommandType;
+ String sDBName = sSource;
sDBName += DB_DELIM;
- sDBName += sSbaData.GetToken(1, DB_DD_DELIM);
+ sDBName += (String)sCommand;
sDBName += DB_DELIM;
- BOOL bTable = sSbaData.GetToken(2, DB_DD_DELIM) == C2S("1");
- sDBName += sSbaData.GetToken(3, DB_DD_DELIM); // Column name
+ sDBName += String::CreateFromInt32(nCommandType);
SwFldMgr aFldMgr(GetShellPtr());
SwInsertFld_Data aData(TYP_DBFLD, 0, sDBName, aEmptyStr, 0, FALSE, TRUE);