From 2c284c0d082c4dff8545e51b8b2c58324d59f9b0 Mon Sep 17 00:00:00 2001 From: os Date: Tue, 15 Mar 2011 14:20:47 +0100 Subject: #i116336# mail merge to single documents fixed --- sw/inc/swabstdlg.hxx | 5 +++++ sw/source/ui/dbui/dbmgr.cxx | 8 +++++++- sw/source/ui/dialog/swdlgfact.cxx | 17 +++++++++++++++++ sw/source/ui/dialog/swdlgfact.hxx | 4 ++++ sw/source/ui/inc/mailmrge.hxx | 6 ++++++ 5 files changed, 39 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3