Kaydet (Commit) 1f1cff03 authored tarafından Jan Holesovsky's avatar Jan Holesovsky Kaydeden (comit) Miklos Vajna

mailmerge: Kill the "Personalize document" mail merge wizard page.

The new workflow expects the user to use the "Edit individual documents"
toolbar button instead, and then edit the newly created document as necessary.

Change-Id: I3bda01a06f2e317a41ce0c766e35dfa361b45f91
üst 2881c93e
......@@ -168,7 +168,6 @@ $(eval $(call gb_Library_add_exception_objects,swui,\
sw/source/ui/dbui/mmdocselectpage \
sw/source/ui/dbui/mmgreetingspage \
sw/source/ui/dbui/mmlayoutpage \
sw/source/ui/dbui/mmmergepage \
sw/source/ui/dbui/mmoutputtypepage \
sw/source/ui/dbui/mmpreparemergepage \
sw/source/ui/dbui/mmresultdialogs \
......
......@@ -195,7 +195,6 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/mmcreatingdialog \
sw/uiconfig/swriter/ui/mmlayoutpage \
sw/uiconfig/swriter/ui/mmmailbody \
sw/uiconfig/swriter/ui/mmmergepage \
sw/uiconfig/swriter/ui/mmoutputtypepage \
sw/uiconfig/swriter/ui/mmpreparepage \
sw/uiconfig/swriter/ui/mmresultemaildialog \
......
......@@ -22,7 +22,6 @@
#include <mmoutputtypepage.hxx>
#include <mmaddressblockpage.hxx>
#include <mmpreparemergepage.hxx>
#include <mmmergepage.hxx>
#include <mmgreetingspage.hxx>
#include <mmlayoutpage.hxx>
#include <mmconfigitem.hxx>
......@@ -74,7 +73,6 @@ SwMailMergeWizard::SwMailMergeWizard(SwView& rView, SwMailMergeConfigItem& rItem
MM_GREETINGSPAGE,
MM_LAYOUTPAGE,
MM_PREPAREMERGEPAGE,
MM_MERGEPAGE,
WZS_INVALID_STATE
);
else
......@@ -85,7 +83,6 @@ SwMailMergeWizard::SwMailMergeWizard(SwView& rView, SwMailMergeConfigItem& rItem
MM_GREETINGSPAGE,
MM_LAYOUTPAGE,
MM_PREPAREMERGEPAGE,
MM_MERGEPAGE,
WZS_INVALID_STATE
);
......@@ -108,7 +105,6 @@ VclPtr<TabPage> SwMailMergeWizard::createPage(WizardState _nState)
case MM_GREETINGSPAGE : pRet = VclPtr<SwMailMergeGreetingsPage>::Create(this); break;
case MM_LAYOUTPAGE : pRet = VclPtr<SwMailMergeLayoutPage>::Create(this); break;
case MM_PREPAREMERGEPAGE : pRet = VclPtr<SwMailMergePrepareMergePage>::Create(this); break;
case MM_MERGEPAGE : pRet = VclPtr<SwMailMergeMergePage>::Create(this); break;
}
OSL_ENSURE(pRet, "no page created in ::createPage");
return pRet;
......@@ -130,14 +126,8 @@ void SwMailMergeWizard::enterState( WizardState _nState )
SwMailMergeLayoutPage::InsertAddressAndGreeting(m_rConfigItem.GetSourceView(),
m_rConfigItem, Point(-1, -1), true);
}
if(_nState >= MM_MERGEPAGE && !m_rConfigItem.GetTargetView())
{
CreateTargetDocument();
m_nRestartPage = _nState;
EndDialog(RET_TARGET_CREATED);
return;
}
else if(_nState < MM_MERGEPAGE && m_rConfigItem.GetTargetView())
if(m_rConfigItem.GetTargetView())
{
//close the dialog, remove the target view, show the source view
m_nRestartPage = _nState;
......@@ -156,7 +146,7 @@ void SwMailMergeWizard::enterState( WizardState _nState )
case MM_ADDRESSBLOCKPAGE :
bEnableNext = m_rConfigItem.GetResultSet().is();
break;
case MM_MERGEPAGE:
case MM_PREPAREMERGEPAGE:
bEnableNext = false;
break;
}
......@@ -183,8 +173,6 @@ OUString SwMailMergeWizard::getStateDisplayName( WizardState _nState ) const
return m_sLayout;
case MM_PREPAREMERGEPAGE:
return m_sPrepareMerge;
case MM_MERGEPAGE:
return m_sMerge;
}
return OUString();
}
......@@ -202,7 +190,6 @@ void SwMailMergeWizard::UpdateRoadmap()
or are already inserted into the source document
MM_PREPAREMERGEPAGE > only active if address data has been selected
inactive after preparemerge page
MM_MERGEPAGE > only active if address data has been selected
*/
// enableState( <page id>, false );
......@@ -221,7 +208,7 @@ void SwMailMergeWizard::UpdateRoadmap()
bool bEnableOutputTypePage = (nCurPage != MM_DOCUMENTSELECTPAGE) ||
static_cast<svt::OWizardPage*>(pCurPage)->commitPage( ::svt::WizardTypes::eValidate );
for(sal_uInt16 nPage = MM_DOCUMENTSELECTPAGE; nPage <= MM_MERGEPAGE; ++nPage)
for(sal_uInt16 nPage = MM_DOCUMENTSELECTPAGE; nPage <= MM_PREPAREMERGEPAGE; ++nPage)
{
bool bEnable = true;
switch(nPage)
......@@ -246,7 +233,6 @@ void SwMailMergeWizard::UpdateRoadmap()
(m_rConfigItem.IsGreetingLine(false) && !m_rConfigItem.IsGreetingInserted() ));
// fall-through
case MM_PREPAREMERGEPAGE:
case MM_MERGEPAGE:
bEnable = bEnable && !m_bDocumentLoad && bEnableOutputTypePage &&
m_rConfigItem.GetResultSet().is() &&
bAddressFieldsConfigured &&
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <mmmergepage.hxx>
#include <mailmergewizard.hxx>
#include <mmconfigitem.hxx>
#include <swtypes.hxx>
#include <view.hxx>
#include <dbui.hrc>
#include <svl/srchitem.hxx>
#include <sfx2/dispatch.hxx>
#include <svl/eitem.hxx>
#include <swabstdlg.hxx>
SwMailMergeMergePage::SwMailMergeMergePage(SwMailMergeWizard* _pParent)
: svt::OWizardPage(_pParent, "MMMergePage",
"modules/swriter/ui/mmmergepage.ui")
, m_pWizard(_pParent)
{
get(m_pEditFI, "helplabel");
get(m_pEditPB, "edit");
get(m_pFindPB, "find");
get(m_pWholeWordsCB, "wholewords");
get(m_pBackwardsCB, "backwards");
get(m_pMatchCaseCB, "matchcase");
get(m_pFindED, "entry");
OUString sTemp(m_pEditFI->GetText());
sTemp = sTemp.replaceFirst("%1", m_pEditPB->GetText());
m_pEditFI->SetText(sTemp);
m_pEditPB->SetClickHdl( LINK( this, SwMailMergeMergePage, EditDocumentHdl_Impl));
m_pFindPB->SetClickHdl( LINK( this, SwMailMergeMergePage, FindHdl_Impl ));
m_pFindED->SetReturnActionLink( LINK(this, SwMailMergeMergePage, EnteredFindStringHdl_Impl ));
}
SwMailMergeMergePage::~SwMailMergeMergePage()
{
disposeOnce();
}
void SwMailMergeMergePage::dispose()
{
m_pEditFI.clear();
m_pEditPB.clear();
m_pFindED.clear();
m_pFindPB.clear();
m_pWholeWordsCB.clear();
m_pBackwardsCB.clear();
m_pMatchCaseCB.clear();
m_pWizard.clear();
svt::OWizardPage::dispose();
}
IMPL_LINK_NOARG_TYPED(SwMailMergeMergePage, EditDocumentHdl_Impl, Button*, void)
{
m_pWizard->SetRestartPage(MM_MERGEPAGE);
m_pWizard->EndDialog(RET_EDIT_RESULT_DOC);
}
IMPL_LINK_NOARG_TYPED(SwMailMergeMergePage, FindHdl_Impl, Button*, void)
{
SvxSearchItem aSearchItem( SID_SEARCH_ITEM );
SfxBoolItem aQuiet( SID_SEARCH_QUIET, false );
aSearchItem.SetSearchString(m_pFindED->GetText());
aSearchItem.SetWordOnly(m_pWholeWordsCB->IsChecked());
aSearchItem.SetExact(m_pMatchCaseCB->IsChecked());
aSearchItem.SetBackward(m_pBackwardsCB->IsChecked());
SwView* pTargetView = m_pWizard->GetConfigItem().GetTargetView();
OSL_ENSURE(pTargetView, "no target view exists");
if(pTargetView)
{
pTargetView->GetViewFrame()->GetDispatcher()->Execute(
FID_SEARCH_NOW, SfxCallMode::SYNCHRON, &aSearchItem, &aQuiet, 0L );
}
}
IMPL_LINK_NOARG_TYPED(SwMailMergeMergePage, EnteredFindStringHdl_Impl, ReturnActionEdit&, void)
{
m_pFindPB->GetClickHdl().Call(m_pFindPB);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_SW_SOURCE_UI_DBUI_MMMERGEPAGE_HXX
#define INCLUDED_SW_SOURCE_UI_DBUI_MMMERGEPAGE_HXX
#include <svtools/wizardmachine.hxx>
#include <vcl/button.hxx>
#include <vcl/edit.hxx>
#include <svtools/stdctrl.hxx>
#include <mailmergehelper.hxx>
#include <actctrl.hxx>
class SwMailMergeWizard;
class SwMailMergeMergePage : public svt::OWizardPage
{
VclPtr<FixedText> m_pEditFI;
VclPtr<PushButton> m_pEditPB;
VclPtr<ReturnActionEdit> m_pFindED;
VclPtr<PushButton> m_pFindPB;
VclPtr<CheckBox> m_pWholeWordsCB;
VclPtr<CheckBox> m_pBackwardsCB;
VclPtr<CheckBox> m_pMatchCaseCB;
VclPtr<SwMailMergeWizard> m_pWizard;
DECL_LINK_TYPED(EditDocumentHdl_Impl, Button*, void);
DECL_LINK_TYPED(FindHdl_Impl, Button*, void);
DECL_LINK_TYPED(EnteredFindStringHdl_Impl, ReturnActionEdit&, void);
public:
SwMailMergeMergePage( SwMailMergeWizard* _pParent);
virtual ~SwMailMergeMergePage();
virtual void dispose() override;
};
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -160,7 +160,6 @@ bool SwMailMergePrepareMergePage::commitPage( ::svt::WizardTypes::CommitPageReas
if(::svt::WizardTypes::eTravelForward == _eReason && !rConfigItem.IsMergeDone())
{
m_pWizard->CreateTargetDocument();
m_pWizard->SetRestartPage(MM_MERGEPAGE);
m_pWizard->EndDialog(RET_TARGET_CREATED);
}
return true;
......
......@@ -31,7 +31,6 @@ class SwMailMergeConfigItem;
#define MM_GREETINGSPAGE 3
#define MM_LAYOUTPAGE 4
#define MM_PREPAREMERGEPAGE 5
#define MM_MERGEPAGE 6
class SwMailMergeWizard : public ::svt::RoadmapWizard
{
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment