diff options
author | Oliver Specht <os@openoffice.org> | 2000-11-13 07:41:36 +0000 |
---|---|---|
committer | Oliver Specht <os@openoffice.org> | 2000-11-13 07:41:36 +0000 |
commit | 387a6c81032207dce64bc448bbfcdad47e27d02b (patch) | |
tree | e8934e5cf33218e6de7e152f59147fba98a75e9a | |
parent | 2426577c118f86343bfef926c607be76717717cf (diff) |
added methods for dispatch interface
-rw-r--r-- | sw/source/ui/envelp/mailmrge.cxx | 45 | ||||
-rw-r--r-- | sw/source/ui/inc/mailmrge.hxx | 23 |
2 files changed, 33 insertions, 35 deletions
diff --git a/sw/source/ui/envelp/mailmrge.cxx b/sw/source/ui/envelp/mailmrge.cxx index 3e9851dbaa25..f260106caff9 100644 --- a/sw/source/ui/envelp/mailmrge.cxx +++ b/sw/source/ui/envelp/mailmrge.cxx @@ -2,9 +2,9 @@ * * $RCSfile: mailmrge.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: hr $ $Date: 2000-10-31 16:01:08 $ + * last change: $Author: os $ $Date: 2000-11-13 08:39:05 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -141,12 +141,11 @@ using namespace com::sun::star::uno; /*------------------------------------------------------------------------ Beschreibung: ------------------------------------------------------------------------*/ - -SwMailMergeDlg::SwMailMergeDlg(Window *pParent, SwWrtShell *pShell, - const String& rName, - const String& rTblName, - const String& rStat, - SbaSelectionListRef& pSelList): +SwMailMergeDlg::SwMailMergeDlg(Window* pParent, SwWrtShell& rShell, + const String& rSourceName, + const String& rTblName, + sal_Int32 nCommandType, + Sequence< sal_Int32 >& rSelection) : SvxStandardDialog(pParent, SW_RES(DLG_MAILMERGE)), @@ -190,18 +189,15 @@ SwMailMergeDlg::SwMailMergeDlg(Window *pParent, SwWrtShell *pShell, aCancelBTN (this, SW_RES(BTN_CANCEL)), aHelpBTN (this, SW_RES(BTN_HELP)), - pSh (pShell), - rDBName (rName), + rSh (rShell), + rDBName (rSourceName), rTableName (rTblName), - rStatement (rStat), - rSelectionList (pSelList), + aSelection (rSelection), nMergeType (DBMGR_MERGE_MAILING) { FreeResource(); - DBG_ASSERT(pSh, "Shell fehlt" ); - pModOpt = SW_MOD()->GetModuleConfig(); aSingleJobsCB.Check(pModOpt->IsSinglePrintJob()); @@ -240,7 +236,7 @@ SwMailMergeDlg::SwMailMergeDlg(Window *pParent, SwWrtShell *pShell, aFromNF.SetModifyHdl(aLk); aToNF.SetModifyHdl(aLk); - pSh->GetNewDBMgr()->GetColumnNames(&aAddressFldLB, rDBName, rTableName); + rSh.GetNewDBMgr()->GetColumnNames(&aAddressFldLB, rDBName, rTableName); for(USHORT nEntry = 0; nEntry < aAddressFldLB.GetEntryCount(); nEntry++) aColumnLB.InsertEntry(aAddressFldLB.GetEntry(nEntry)); aAddressFldLB.SelectEntry(C2S("EMAIL")); @@ -266,9 +262,9 @@ SwMailMergeDlg::SwMailMergeDlg(Window *pParent, SwWrtShell *pShell, if (aColumnLB.GetSelectEntryCount() == 0) aColumnLB.SelectEntryPos(0); - const BOOL bEnable = rSelectionList->Count() != 0; + const BOOL bEnable = aSelection.getLength() != 0; aMarkedRB.Enable(bEnable); - if (bEnable && (long)rSelectionList->GetObject(0) != -1L) + if (bEnable) aMarkedRB.Check(); else { @@ -411,7 +407,7 @@ IMPL_LINK( SwMailMergeDlg, ModifyHdl, NumericField *, pFld ) void SwMailMergeDlg::ExecQryShell(BOOL bVisible) { - SwNewDBMgr* pMgr = pSh->GetNewDBMgr(); + SwNewDBMgr* pMgr = rSh.GetNewDBMgr(); if (aPrinterRB.IsChecked()) nMergeType = DBMGR_MERGE_MAILMERGE; @@ -445,7 +441,7 @@ void SwMailMergeDlg::ExecQryShell(BOOL bVisible) String sName(aFilenameED.GetText()); if (!sName.Len()) { - sName = pSh->GetView().GetDocShell()->GetTitle(); + sName = rSh.GetView().GetDocShell()->GetTitle(); INetURLObject aTemp(sName); sName = aTemp.GetBase(); } @@ -469,14 +465,15 @@ void SwMailMergeDlg::ExecQryShell(BOOL bVisible) nStart = nZw; } - rSelectionList->Clear(); - - for (ULONG i = nStart; i <= nEnd; i++) - rSelectionList->Insert((void*)i , LIST_APPEND); + aSelection.realloc(nStart - nEnd + 1); + sal_Int32* pSelection = aSelection.getArray(); + sal_Int32 nPos = 0; + for (ULONG i = nStart; i <= nEnd; i++, nPos++) + pSelection[nPos] = i; } if (aAllRB.IsChecked() ) - rSelectionList->Clear(); // Leere Selektion = Alles einfuegen + aSelection.realloc(0); // Leere Selektion = Alles einfuegen pModOpt->SetSinglePrintJob(aSingleJobsCB.IsChecked()); diff --git a/sw/source/ui/inc/mailmrge.hxx b/sw/source/ui/inc/mailmrge.hxx index 9c718589fd99..d08030ef5a4b 100644 --- a/sw/source/ui/inc/mailmrge.hxx +++ b/sw/source/ui/inc/mailmrge.hxx @@ -2,9 +2,9 @@ * * $RCSfile: mailmrge.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: os $ $Date: 2000-10-27 11:24:26 $ + * last change: $Author: os $ $Date: 2000-11-13 08:41:36 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -88,10 +88,11 @@ #ifndef _LSTBOX_HXX //autogen #include <vcl/lstbox.hxx> #endif +#ifndef _COM_SUN_STAR_UNO_SEQUENCE_H_ +#include <com/sun/star/uno/Sequence.h> +#endif class SwWrtShell; -class SbaObject; -class SbaSelectionListRef; class SwModuleOptions; class SwMailMergeDlg : public SvxStandardDialog @@ -136,15 +137,13 @@ class SwMailMergeDlg : public SvxStandardDialog CancelButton aCancelBTN; HelpButton aHelpBTN; - SwWrtShell* pSh; - SbaObject* pSbaObject; + SwWrtShell& rSh; SwModuleOptions* pModOpt; const String& rDBName; const String& rTableName; - const String& rStatement; - SbaSelectionListRef& rSelectionList; USHORT nMergeType; + ::com::sun::star::uno::Sequence< sal_Int32 > aSelection; DECL_LINK( ButtonHdl, Button* pBtn ); DECL_LINK( InsertPathHdl, PushButton * ); @@ -158,13 +157,15 @@ class SwMailMergeDlg : public SvxStandardDialog public: - SwMailMergeDlg(Window* pParent, SwWrtShell* pSh, - const String& rName, + SwMailMergeDlg(Window* pParent, SwWrtShell& rSh, + const String& rSourceName, const String& rTblName, - const String& rStat, SbaSelectionListRef& pSelList); + sal_Int32 nCommandType, + ::com::sun::star::uno::Sequence< sal_Int32 >& rSelection); ~SwMailMergeDlg(); inline USHORT GetMergeType() { return nMergeType; } + const ::com::sun::star::uno::Sequence< sal_Int32 > GetSelection() const{return aSelection;} }; #endif |