summaryrefslogtreecommitdiff
path: root/sw/source/ui/envelp/mailmrge.cxx
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2016-03-24 13:43:46 +0100
committerJan-Marek Glogowski <glogow@fbihome.de>2016-03-24 22:40:41 +0100
commite637b6743a506ef74c93ccbe15ab6642f3baa34f (patch)
tree8318b820a833163d64f6b55e5c08b23978999bbd /sw/source/ui/envelp/mailmrge.cxx
parent3e33c891ab9c49e6fb4b3767c5e6daae651ebc82 (diff)
MM: move email subject and address into descriptor
Both are not related to the DBManager, but the mail merge job. While at it, also drop the insane bSubjectIsFilename handling, add an independent sPath, rename sAddressFromColumn to a more general sDBcolumn, as it's also used for file name lookup in FILE mode, and unify the DB column data handling. Change-Id: I1b583f4a67279a229329ba7cd15fb8d2c215737c
Diffstat (limited to 'sw/source/ui/envelp/mailmrge.cxx')
-rw-r--r--sw/source/ui/envelp/mailmrge.cxx38
1 files changed, 25 insertions, 13 deletions
diff --git a/sw/source/ui/envelp/mailmrge.cxx b/sw/source/ui/envelp/mailmrge.cxx
index 5f55838598bf..184053aac2d7 100644
--- a/sw/source/ui/envelp/mailmrge.cxx
+++ b/sw/source/ui/envelp/mailmrge.cxx
@@ -486,12 +486,16 @@ IMPL_LINK_NOARG_TYPED(SwMailMergeDlg, ModifyHdl, Edit&, void)
m_pFromRB->Check();
}
+bool SwMailMergeDlg::AskUserFilename() const
+{
+ return (m_pSaveSingleDocRB->IsChecked() || !m_pGenerateFromDataBaseCB->IsChecked());
+}
+
bool SwMailMergeDlg::ExecQryShell()
{
if(pImpl->xSelSupp.is()) {
pImpl->xSelSupp->removeSelectionChangeListener( pImpl->xChgLstnr );
}
- SwDBManager* pMgr = rSh.GetDBManager();
if (m_pPrinterRB->IsChecked())
nMergeType = DBMGR_MERGE_PRINTER;
@@ -501,33 +505,27 @@ bool SwMailMergeDlg::ExecQryShell()
INetURLObject aAbs;
if( pMedium )
aAbs = pMedium->GetURLObject();
- OUString sPath(
+ pModOpt->SetMailingPath(
URIHelper::SmartRel2Abs(
aAbs, m_pPathED->GetText(), URIHelper::GetMaybeFileHdl()));
- pModOpt->SetMailingPath(sPath);
-
- if (!sPath.endsWith("/"))
- sPath += "/";
pModOpt->SetIsNameFromColumn(m_pGenerateFromDataBaseCB->IsChecked());
- if (m_pGenerateFromDataBaseCB->IsEnabled() && m_pGenerateFromDataBaseCB->IsChecked()) {
- pMgr->SetEMailColumn(m_pColumnLB->GetSelectEntry());
+ if (!AskUserFilename()) {
pModOpt->SetNameFromColumn(m_pColumnLB->GetSelectEntry());
if( m_pFilterLB->GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND)
m_sSaveFilter = *static_cast<const OUString*>(m_pFilterLB->GetSelectEntryData());
+ m_sFilename = OUString();
} else {
//#i97667# reset column name - otherwise it's remembered from the last run
- pMgr->SetEMailColumn(OUString());
+ pModOpt->SetNameFromColumn(OUString());
//start save as dialog
OUString sFilter;
- sPath = SwMailMergeHelper::CallSaveAsDialog(sFilter);
- if (sPath.isEmpty())
+ m_sFilename = SwMailMergeHelper::CallSaveAsDialog(sFilter);
+ if (m_sFilename.isEmpty())
return false;
m_sSaveFilter = sFilter;
}
-
- pMgr->SetSubject(sPath);
}
if (m_pFromRB->IsChecked()) { // Insert list
@@ -579,6 +577,20 @@ bool SwMailMergeDlg::ExecQryShell()
return true;
}
+OUString SwMailMergeDlg::GetTargetURL() const
+{
+ if( AskUserFilename() )
+ return m_sFilename;
+ OUString sPath( pModOpt->GetMailingPath() );
+ if( sPath.isEmpty() ) {
+ SvtPathOptions aPathOpt;
+ sPath = aPathOpt.GetWorkPath();
+ }
+ if( !sPath.endsWith("/") )
+ sPath += "/";
+ return sPath;
+}
+
IMPL_LINK_NOARG_TYPED(SwMailMergeDlg, InsertPathHdl, Button*, void)
{
OUString sPath( m_pPathED->GetText() );