summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoros <os@openoffice.org>2011-03-15 14:20:47 +0100
committeros <os@openoffice.org>2011-03-15 14:20:47 +0100
commit2c284c0d082c4dff8545e51b8b2c58324d59f9b0 (patch)
tree1a960fdb3ae9895762977b544054ee0756d01223
parente742f019f2004bac83e43291d299567bb34299d0 (diff)
#i116336# mail merge to single documents fixed
-rw-r--r--sw/inc/swabstdlg.hxx5
-rw-r--r--sw/source/ui/dbui/dbmgr.cxx8
-rw-r--r--sw/source/ui/dialog/swdlgfact.cxx17
-rw-r--r--sw/source/ui/dialog/swdlgfact.hxx4
-rw-r--r--sw/source/ui/inc/mailmrge.hxx6
5 files changed, 39 insertions, 1 deletions
diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx
index a045d0a3bf..7d0f85bcfa 100644
--- a/sw/inc/swabstdlg.hxx
+++ b/sw/inc/swabstdlg.hxx
@@ -164,6 +164,11 @@ public:
virtual const ::rtl::OUString& GetSaveFilter() const = 0;
virtual const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > GetSelection() const = 0;
virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet> GetResultSet() const = 0;
+ virtual bool IsSaveIndividualDocs() const = 0;
+ virtual bool IsGenerateFromDataBase() const = 0;
+ virtual String GetColumnName() const = 0;
+ virtual String GetPath() const = 0;
+
};
class AbstractMailMergeCreateFromDlg : public VclAbstractDialog //add for SwMailMergeCreateFromDlg
{
diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx
index 7b303d4850..96f1562bc3 100644
--- a/sw/source/ui/dbui/dbmgr.cxx
+++ b/sw/source/ui/dbui/dbmgr.cxx
@@ -2598,7 +2598,13 @@ void SwNewDBMgr::ExecuteFormLetter( SwWrtShell& rSh,
SwMergeDescriptor aMergeDesc( pImpl->pMergeDialog->GetMergeType(), pView->GetWrtShell(), aDescriptor );
aMergeDesc.sSaveToFilter = pImpl->pMergeDialog->GetSaveFilter();
- aMergeDesc.bCreateSingleFile= true;
+ aMergeDesc.bCreateSingleFile = !pImpl->pMergeDialog->IsSaveIndividualDocs();
+ if( !aMergeDesc.bCreateSingleFile && pImpl->pMergeDialog->IsGenerateFromDataBase() )
+ {
+ aMergeDesc.sAddressFromColumn = pImpl->pMergeDialog->GetColumnName();
+ aMergeDesc.sSubject = pImpl->pMergeDialog->GetPath();
+ }
+
MergeNew(aMergeDesc);
pWorkDoc->SetNewDBMgr( pWorkDBMgr );
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index fa885838d2..da40e4a6eb 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -526,6 +526,23 @@ uno::Reference< sdbc::XResultSet> AbstractMailMergeDlg_Impl::GetResultSet() cons
{
return pDlg->GetResultSet();
}
+bool AbstractMailMergeDlg_Impl::IsSaveIndividualDocs() const
+{
+ return pDlg->IsSaveIndividualDocs();
+}
+bool AbstractMailMergeDlg_Impl::IsGenerateFromDataBase() const
+{
+ return pDlg->IsGenerateFromDataBase();
+}
+String AbstractMailMergeDlg_Impl::GetColumnName() const
+{
+ return pDlg->GetColumnName();
+}
+String AbstractMailMergeDlg_Impl::GetPath() const
+{
+ return pDlg->GetPath();
+}
+
// AbstractMailMergeDlg_Impl end
// AbstractMailMergeCreateFromDlg_Impl begin
sal_Bool AbstractMailMergeCreateFromDlg_Impl::IsThisDocument() const
diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx
index e2fe53ae36..db12ae9eca 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -332,6 +332,10 @@ class AbstractMailMergeDlg_Impl : public AbstractMailMergeDlg
virtual const ::rtl::OUString& GetSaveFilter() const;
virtual const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > GetSelection() const ;
virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet> GetResultSet() const;
+ virtual bool IsSaveIndividualDocs() const;
+ virtual bool IsGenerateFromDataBase() const;
+ virtual String GetColumnName() const;
+ virtual String GetPath() const;
};
//for SwMailMergeDlg end
//for SwMailMergeCreateFromDlg begin
diff --git a/sw/source/ui/inc/mailmrge.hxx b/sw/source/ui/inc/mailmrge.hxx
index cb5f51d788..d762660e46 100644
--- a/sw/source/ui/inc/mailmrge.hxx
+++ b/sw/source/ui/inc/mailmrge.hxx
@@ -156,6 +156,12 @@ public:
~SwMailMergeDlg();
inline sal_uInt16 GetMergeType() { return nMergeType; }
+
+ bool IsSaveIndividualDocs() const { return aSaveIndividualRB.IsChecked(); }
+ bool IsGenerateFromDataBase() const { return aGenerateFromDataBaseCB.IsChecked(); }
+ String GetColumnName() const { return aColumnLB.GetSelectEntry();}
+ String GetPath() const { return aPathED.GetText();}
+
const ::rtl::OUString& GetSaveFilter() const {return m_sSaveFilter;}
inline const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > GetSelection() const { return m_aSelection; }
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet> GetResultSet() const;