summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedricbosdo@openoffice.org>2010-12-02 13:54:13 +0100
committerCédric Bosdonnat <cedricbosdo@openoffice.org>2010-12-03 11:12:16 +0100
commit781eee6c381590f007c13963b1e5bc1c8844d771 (patch)
tree2c2181983fad1e33da58687e3304426c6a4c8d82
parent6f900529468c2ca340ba8ffa2dbb74a4b8d673bb (diff)
fdo#31190: Use the same method to getthe DBData than the mail merge
-rw-r--r--sw/source/ui/uiview/view2.cxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx
index 7936bccfb3..938d3e037f 100644
--- a/sw/source/ui/uiview/view2.cxx
+++ b/sw/source/ui/uiview/view2.cxx
@@ -2272,7 +2272,17 @@ void SwView::GenerateFormLetter(BOOL bUseCurrentDocument)
SwDBData aData;
SwWrtShell &rSh = GetWrtShell();
- aData = rSh.GetDBData();
+
+ SvStringsDtor aDBNameList(5, 1);
+ SvStringsDtor aAllDBNames(5, 5);
+ rSh.GetAllUsedDB( aDBNameList, &aAllDBNames );
+ if ( aDBNameList.Count( ) )
+ {
+ String sDBName = *aDBNameList[0];
+ aData.sDataSource = sDBName.GetToken(0, DB_DELIM);
+ aData.sCommand = sDBName.GetToken(1, DB_DELIM);
+ aData.nCommandType = sDBName.GetToken(2, DB_DELIM ).ToInt32();
+ }
rSh.EnterStdMode(); // Wechsel in Textshell erzwingen; ist fuer
// das Mischen von DB-Feldern notwendig.
AttrChangedNotify( &rSh );