From 1f1cff03c4f15ee9fe7786a98ba8259a64823e0a Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Mon, 28 Dec 2015 12:22:52 +0100 Subject: 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 --- sw/Library_swui.mk | 1 - sw/UIConfig_swriter.mk | 1 - sw/source/ui/dbui/mailmergewizard.cxx | 22 +-- sw/source/ui/dbui/mmmergepage.cxx | 103 ------------ sw/source/ui/dbui/mmmergepage.hxx | 57 ------- sw/source/ui/dbui/mmpreparemergepage.cxx | 1 - sw/source/uibase/inc/mailmergewizard.hxx | 1 - sw/uiconfig/swriter/ui/mmmergepage.ui | 263 ------------------------------- 8 files changed, 4 insertions(+), 445 deletions(-) delete mode 100644 sw/source/ui/dbui/mmmergepage.cxx delete mode 100644 sw/source/ui/dbui/mmmergepage.hxx delete mode 100644 sw/uiconfig/swriter/ui/mmmergepage.ui diff --git a/sw/Library_swui.mk b/sw/Library_swui.mk index 0d20c61d758a..2d49d3c357d1 100644 --- a/sw/Library_swui.mk +++ b/sw/Library_swui.mk @@ -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 \ diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk index af1f09f4e36a..216ffb12e4d5 100644 --- a/sw/UIConfig_swriter.mk +++ b/sw/UIConfig_swriter.mk @@ -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 \ diff --git a/sw/source/ui/dbui/mailmergewizard.cxx b/sw/source/ui/dbui/mailmergewizard.cxx index 2ab51277da26..9b853e8f6b0d 100644 --- a/sw/source/ui/dbui/mailmergewizard.cxx +++ b/sw/source/ui/dbui/mailmergewizard.cxx @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include @@ -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 SwMailMergeWizard::createPage(WizardState _nState) case MM_GREETINGSPAGE : pRet = VclPtr::Create(this); break; case MM_LAYOUTPAGE : pRet = VclPtr::Create(this); break; case MM_PREPAREMERGEPAGE : pRet = VclPtr::Create(this); break; - case MM_MERGEPAGE : pRet = VclPtr::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( , false ); @@ -221,7 +208,7 @@ void SwMailMergeWizard::UpdateRoadmap() bool bEnableOutputTypePage = (nCurPage != MM_DOCUMENTSELECTPAGE) || static_cast(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 && diff --git a/sw/source/ui/dbui/mmmergepage.cxx b/sw/source/ui/dbui/mmmergepage.cxx deleted file mode 100644 index 17cdfc792eb9..000000000000 --- a/sw/source/ui/dbui/mmmergepage.cxx +++ /dev/null @@ -1,103 +0,0 @@ -/* -*- 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include - -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: */ diff --git a/sw/source/ui/dbui/mmmergepage.hxx b/sw/source/ui/dbui/mmmergepage.hxx deleted file mode 100644 index 510f33ded7c1..000000000000 --- a/sw/source/ui/dbui/mmmergepage.hxx +++ /dev/null @@ -1,57 +0,0 @@ -/* -*- 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 -#include -#include -#include -#include -#include -class SwMailMergeWizard; - -class SwMailMergeMergePage : public svt::OWizardPage -{ - VclPtr m_pEditFI; - VclPtr m_pEditPB; - - VclPtr m_pFindED; - VclPtr m_pFindPB; - - VclPtr m_pWholeWordsCB; - VclPtr m_pBackwardsCB; - VclPtr m_pMatchCaseCB; - - VclPtr 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: */ diff --git a/sw/source/ui/dbui/mmpreparemergepage.cxx b/sw/source/ui/dbui/mmpreparemergepage.cxx index 662f94f885a6..0b241230aa42 100644 --- a/sw/source/ui/dbui/mmpreparemergepage.cxx +++ b/sw/source/ui/dbui/mmpreparemergepage.cxx @@ -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; diff --git a/sw/source/uibase/inc/mailmergewizard.hxx b/sw/source/uibase/inc/mailmergewizard.hxx index a8d6e5499dff..dba59f493119 100644 --- a/sw/source/uibase/inc/mailmergewizard.hxx +++ b/sw/source/uibase/inc/mailmergewizard.hxx @@ -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 { diff --git a/sw/uiconfig/swriter/ui/mmmergepage.ui b/sw/uiconfig/swriter/ui/mmmergepage.ui deleted file mode 100644 index 79ca07173e61..000000000000 --- a/sw/uiconfig/swriter/ui/mmmergepage.ui +++ /dev/null @@ -1,263 +0,0 @@ - - - - - - - True - False - True - True - 6 - vertical - 12 - - - True - False - True - 0 - none - - - True - False - True - True - 6 - 12 - - - True - False - True - True - 12 - - - True - False - True - 6 - - - True - False - True - 0 - 0 - You can personalize particular documents. Clicking '%1' will temporarily reduce the wizard to a small window so you can edit your document. After editing the document, return to the wizard by clicking 'Return to Mail Merge Wizard' in the small window. - True - 56 - - - 0 - 0 - 1 - 1 - - - - - _Edit individual documents... - True - True - True - center - True - - - 0 - 1 - 1 - 1 - - - - - 0 - 0 - 1 - 1 - - - - - - - - - True - False - Personalize the Mail Merge Documents - - - - - - - - False - True - 0 - - - - - True - False - True - 0 - none - - - True - False - True - True - 6 - 12 - - - True - False - True - True - 6 - 12 - - - _Find... - True - True - True - True - - - 2 - 0 - 1 - 1 - - - - - True - False - 0 - _Search for: - True - entry - - - 0 - 0 - 1 - 1 - - - - - True - True - True - - - 1 - 0 - 1 - 1 - - - - - Whole wor_ds only - True - True - False - True - 0 - True - - - 1 - 1 - 1 - 1 - - - - - Back_wards - True - True - False - True - 0 - True - - - 1 - 2 - 1 - 1 - - - - - Ma_tch case - True - True - False - True - 0 - True - - - 1 - 3 - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - True - False - Find - - - - - - - - False - True - 1 - - - - -- cgit