mailmerge: Remove "Edit document" page, fuctionality available via toolbar.

Change-Id: I0a5d1ed6703871dc5e90acf5e1119e0126755282
diff --git a/sw/Library_swui.mk b/sw/Library_swui.mk
index 2d49d3c..5126598 100644
--- a/sw/Library_swui.mk
+++ b/sw/Library_swui.mk
@@ -169,7 +169,6 @@ $(eval $(call gb_Library_add_exception_objects,swui,\
    sw/source/ui/dbui/mmgreetingspage \
    sw/source/ui/dbui/mmlayoutpage \
    sw/source/ui/dbui/mmoutputtypepage \
    sw/source/ui/dbui/mmpreparemergepage \
    sw/source/ui/dbui/mmresultdialogs \
    sw/source/ui/dbui/selectdbtabledialog \
))
diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk
index 216ffb1..2dfe8b1 100644
--- a/sw/UIConfig_swriter.mk
+++ b/sw/UIConfig_swriter.mk
@@ -196,7 +196,6 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
	sw/uiconfig/swriter/ui/mmlayoutpage \
	sw/uiconfig/swriter/ui/mmmailbody \
	sw/uiconfig/swriter/ui/mmoutputtypepage \
	sw/uiconfig/swriter/ui/mmpreparepage \
	sw/uiconfig/swriter/ui/mmresultemaildialog \
	sw/uiconfig/swriter/ui/mmresultprintdialog \
	sw/uiconfig/swriter/ui/mmresultsavedialog \
diff --git a/sw/inc/dbui.hrc b/sw/inc/dbui.hrc
index 9bb6168..e85523b 100644
--- a/sw/inc/dbui.hrc
+++ b/sw/inc/dbui.hrc
@@ -79,11 +79,9 @@
#define ST_ADDRESSBLOCK         (RC_DBUI_BEGIN + 54)
#define ST_GREETINGSLINE        (RC_DBUI_BEGIN + 55)
#define ST_LAYOUT               (RC_DBUI_BEGIN + 56)
#define ST_PREPAREMERGE         (RC_DBUI_BEGIN + 57)
#define ST_MERGE                (RC_DBUI_BEGIN + 58)
#define ST_FINISH               (RC_DBUI_BEGIN + 57)
#define ST_ADDRESSLIST          (RC_DBUI_BEGIN + 58)
#define ST_EXCLUDE              (RC_DBUI_BEGIN + 59)
#define ST_FINISH               (RC_DBUI_BEGIN + 60)
#define ST_ADDRESSLIST          (RC_DBUI_BEGIN + 61)

// ImageList
#define ILIST                   (RC_DBUI_BEGIN + 62)
diff --git a/sw/source/ui/dbui/mailmergewizard.cxx b/sw/source/ui/dbui/mailmergewizard.cxx
index 9b853e8..d361063 100644
--- a/sw/source/ui/dbui/mailmergewizard.cxx
+++ b/sw/source/ui/dbui/mailmergewizard.cxx
@@ -21,7 +21,6 @@
#include <mmdocselectpage.hxx>
#include <mmoutputtypepage.hxx>
#include <mmaddressblockpage.hxx>
#include <mmpreparemergepage.hxx>
#include <mmgreetingspage.hxx>
#include <mmlayoutpage.hxx>
#include <mmconfigitem.hxx>
@@ -51,8 +50,6 @@ SwMailMergeWizard::SwMailMergeWizard(SwView& rView, SwMailMergeConfigItem& rItem
        m_sAddressList(     SW_RES( ST_ADDRESSLIST )),
        m_sGreetingsLine(   SW_RES( ST_GREETINGSLINE   )),
        m_sLayout(          SW_RES( ST_LAYOUT        )),
        m_sPrepareMerge(    SW_RES( ST_PREPAREMERGE )),
        m_sMerge(           SW_RES( ST_MERGE        )),
        m_sFinish(          SW_RES( ST_FINISH       )),
        m_nRestartPage( MM_DOCUMENTSELECTPAGE )
{
@@ -72,7 +69,6 @@ SwMailMergeWizard::SwMailMergeWizard(SwView& rView, SwMailMergeConfigItem& rItem
            MM_ADDRESSBLOCKPAGE,
            MM_GREETINGSPAGE,
            MM_LAYOUTPAGE,
            MM_PREPAREMERGEPAGE,
            WZS_INVALID_STATE
        );
    else
@@ -82,7 +78,6 @@ SwMailMergeWizard::SwMailMergeWizard(SwView& rView, SwMailMergeConfigItem& rItem
            MM_ADDRESSBLOCKPAGE,
            MM_GREETINGSPAGE,
            MM_LAYOUTPAGE,
            MM_PREPAREMERGEPAGE,
            WZS_INVALID_STATE
        );

@@ -104,7 +99,6 @@ VclPtr<TabPage> SwMailMergeWizard::createPage(WizardState _nState)
        case MM_ADDRESSBLOCKPAGE  : pRet = VclPtr<SwMailMergeAddressBlockPage>::Create(this);     break;
        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;
    }
    OSL_ENSURE(pRet, "no page created in ::createPage");
    return pRet;
@@ -140,14 +134,14 @@ void SwMailMergeWizard::enterState( WizardState _nState )
    bool bEnableNext = true;
    switch(_nState)
    {
        case MM_DOCUMENTSELECTPAGE :
            bEnablePrev = false;
        case MM_DOCUMENTSELECTPAGE:
            bEnablePrev = false; // the first page
        break;
        case MM_ADDRESSBLOCKPAGE  :
            bEnableNext = m_rConfigItem.GetResultSet().is();
        break;
        case MM_PREPAREMERGEPAGE:
            bEnableNext = false;
        case MM_LAYOUTPAGE:
            bEnableNext = false; // the last page
        break;
    }
    enableButtons( WizardButtonFlags::PREVIOUS, bEnablePrev);
@@ -171,8 +165,6 @@ OUString SwMailMergeWizard::getStateDisplayName( WizardState _nState ) const
            return m_sGreetingsLine;
        case MM_LAYOUTPAGE:
            return m_sLayout;
        case MM_PREPAREMERGEPAGE:
            return m_sPrepareMerge;
    }
    return OUString();
}
@@ -188,8 +180,6 @@ void SwMailMergeWizard::UpdateRoadmap()
    MM_LAYOUTPAGE               >   inactive after the layoutpage
                                    inactive if address block and greeting are switched off
                                    or are already inserted into the source document
    MM_PREPAREMERGEPAGE         > only active if address data has been selected
                                    inactive after preparemerge page
*/

    // enableState( <page id>, false );
@@ -203,12 +193,20 @@ void SwMailMergeWizard::UpdateRoadmap()
    bool bGreetingFieldsConfigured = !m_rConfigItem.IsGreetingLine(false) ||
            !m_rConfigItem.IsIndividualGreeting(false)||
                    m_rConfigItem.IsGreetingFieldsAssigned();

    //#i97436# if a document has to be loaded then enable output type page only
    m_bDocumentLoad = false;
    bool bEnableOutputTypePage = (nCurPage != MM_DOCUMENTSELECTPAGE) ||
        static_cast<svt::OWizardPage*>(pCurPage)->commitPage( ::svt::WizardTypes::eValidate );

    for(sal_uInt16 nPage = MM_DOCUMENTSELECTPAGE; nPage <= MM_PREPAREMERGEPAGE; ++nPage)
    // handle the Finish button
    bool bCanFinish = !m_bDocumentLoad && bEnableOutputTypePage &&
        m_rConfigItem.GetResultSet().is() &&
        bAddressFieldsConfigured &&
        bGreetingFieldsConfigured;
    enableButtons(WizardButtonFlags::FINISH, (nCurPage != MM_DOCUMENTSELECTPAGE) && bCanFinish);

    for(sal_uInt16 nPage = MM_DOCUMENTSELECTPAGE; nPage <= MM_LAYOUTPAGE; ++nPage)
    {
        bool bEnable = true;
        switch(nPage)
@@ -228,15 +226,9 @@ void SwMailMergeWizard::UpdateRoadmap()
                            bAddressFieldsConfigured;
            break;
            case MM_LAYOUTPAGE:
                bEnable =
                bEnable = bCanFinish &&
                        ((m_rConfigItem.IsAddressBlock() && !m_rConfigItem.IsAddressInserted()) ||
                            (m_rConfigItem.IsGreetingLine(false) && !m_rConfigItem.IsGreetingInserted() ));
                // fall-through
            case MM_PREPAREMERGEPAGE:
                bEnable = bEnable && !m_bDocumentLoad && bEnableOutputTypePage &&
                            m_rConfigItem.GetResultSet().is() &&
                            bAddressFieldsConfigured &&
                            bGreetingFieldsConfigured;
            break;
        }
        enableState( nPage, bEnable );
diff --git a/sw/source/ui/dbui/mailmergewizard.src b/sw/source/ui/dbui/mailmergewizard.src
index 176af67..43ddf62 100644
--- a/sw/source/ui/dbui/mailmergewizard.src
+++ b/sw/source/ui/dbui/mailmergewizard.src
@@ -49,16 +49,6 @@ String ST_LAYOUT
    Text [ en-US ] = "Adjust layout";
};

String ST_PREPAREMERGE
{
    Text [ en-US ] = "Edit document";
};

String ST_MERGE
{
    Text [ en-US ] = "Personalize document";
};

String ST_EXCLUDE
{
    Text [ en-US ] = "Exclude recipient";
diff --git a/sw/source/ui/dbui/mmgreetingspage.cxx b/sw/source/ui/dbui/mmgreetingspage.cxx
index 105bb6e..6a8a013 100644
--- a/sw/source/ui/dbui/mmgreetingspage.cxx
+++ b/sw/source/ui/dbui/mmgreetingspage.cxx
@@ -96,7 +96,7 @@ IMPL_LINK_NOARG_TYPED(SwGreetingsHandler, IndividualHdl_Impl, Button*, void)
    {
        m_pWizard->GetConfigItem().SetIndividualGreeting(bIndividual, false);
        m_pWizard->UpdateRoadmap();
        m_pWizard->enableButtons(WizardButtonFlags::NEXT, m_pWizard->isStateEnabled(MM_PREPAREMERGEPAGE));
        m_pWizard->enableButtons(WizardButtonFlags::NEXT, true);
    }
    UpdatePreview();
}
@@ -115,7 +115,7 @@ IMPL_LINK_TYPED(SwGreetingsHandler, GreetingHdl_Impl, Button*, pButton, void)
        if(m_bIsTabPage)
        {
            m_pWizard->UpdateRoadmap();
            m_pWizard->enableButtons(WizardButtonFlags::NEXT, m_pWizard->isStateEnabled(MM_PREPAREMERGEPAGE));
            m_pWizard->enableButtons(WizardButtonFlags::NEXT, true);
        }
        UpdatePreview();
    }
@@ -135,7 +135,7 @@ IMPL_LINK_TYPED(SwMailMergeGreetingsPage, AssignHdl_Impl, Button*, pButton, void
    {
        UpdatePreview();
        m_pWizard->UpdateRoadmap();
        m_pWizard->enableButtons(WizardButtonFlags::NEXT, m_pWizard->isStateEnabled(MM_PREPAREMERGEPAGE));
        m_pWizard->enableButtons(WizardButtonFlags::NEXT, true);
    }
}

@@ -331,7 +331,7 @@ void SwMailMergeGreetingsPage::ActivatePage()
    m_pFemaleFieldCB->SaveValue();

    UpdatePreview();
    m_pWizard->enableButtons(WizardButtonFlags::NEXT, m_pWizard->isStateEnabled(MM_PREPAREMERGEPAGE));
    m_pWizard->enableButtons(WizardButtonFlags::NEXT, true);
}

bool SwMailMergeGreetingsPage::commitPage( ::svt::WizardTypes::CommitPageReason )
diff --git a/sw/source/ui/dbui/mmpreparemergepage.cxx b/sw/source/ui/dbui/mmpreparemergepage.cxx
deleted file mode 100644
index 0b24123..0000000
--- a/sw/source/ui/dbui/mmpreparemergepage.cxx
+++ /dev/null
@@ -1,168 +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 <mmpreparemergepage.hxx>

#include <comphelper/propertysequence.hxx>
#include <mailmergewizard.hxx>
#include <mmconfigitem.hxx>
#include <dbui.hrc>
#include <swtypes.hxx>
#include <view.hxx>
#include <dbmgr.hxx>
#include <wrtsh.hxx>
#include <svx/dataaccessdescriptor.hxx>
#include <com/sun/star/sdbc/XConnection.hpp>
#include <swabstdlg.hxx>

#include <unomid.h>

using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::sdbc;

SwMailMergePrepareMergePage::SwMailMergePrepareMergePage( SwMailMergeWizard* _pParent)
    : svt::OWizardPage(_pParent, "MMPreparePage", "modules/swriter/ui/mmpreparepage.ui")
    , m_pWizard(_pParent)
{
    get(m_pFirstPB, "first");
    get(m_pPrevPB, "prev");
    get(m_pRecordED, "record-nospin");
    get(m_pNextPB, "next");
    get(m_pLastPB, "last");
    get(m_pExcludeCB, "exclude");
    get(m_pEditPB, "edit");

    m_pEditPB->SetClickHdl( LINK( this, SwMailMergePrepareMergePage, EditDocumentHdl_Impl));
    Link<Button*,void> aMoveLink(LINK( this, SwMailMergePrepareMergePage, MoveClickHdl_Impl));
    m_pFirstPB->SetClickHdl( aMoveLink );
    m_pPrevPB->SetClickHdl( aMoveLink );
    m_pNextPB->SetClickHdl( aMoveLink );
    m_pLastPB->SetClickHdl( aMoveLink );
    m_pRecordED->SetModifyHdl( LINK( this, SwMailMergePrepareMergePage, MoveEditHdl_Impl) );
    m_pExcludeCB->SetClickHdl(LINK(this, SwMailMergePrepareMergePage, ExcludeHdl_Impl));
    MoveHdl_Impl(m_pRecordED);
}

SwMailMergePrepareMergePage::~SwMailMergePrepareMergePage()
{
    disposeOnce();
}

void SwMailMergePrepareMergePage::dispose()
{
    m_pFirstPB.clear();
    m_pPrevPB.clear();
    m_pRecordED.clear();
    m_pNextPB.clear();
    m_pLastPB.clear();
    m_pExcludeCB.clear();
    m_pEditPB.clear();
    m_pWizard.clear();
    svt::OWizardPage::dispose();
}

IMPL_LINK_NOARG_TYPED(SwMailMergePrepareMergePage, EditDocumentHdl_Impl, Button*, void)
{
    m_pWizard->SetRestartPage(MM_PREPAREMERGEPAGE);
    m_pWizard->EndDialog(RET_EDIT_DOC);
}

IMPL_LINK_TYPED( SwMailMergePrepareMergePage, MoveClickHdl_Impl, Button*, pCtrl, void)
{
    MoveHdl_Impl(pCtrl);
}
IMPL_LINK_TYPED( SwMailMergePrepareMergePage, MoveEditHdl_Impl, Edit&, rEdit, void)
{
    MoveHdl_Impl(&rEdit);
}
void SwMailMergePrepareMergePage:: MoveHdl_Impl(Control* pCtrl)
{
    SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem();
    sal_Int32 nPos = rConfigItem.GetResultSetPosition();
    if (pCtrl == m_pFirstPB)
    {
        rConfigItem.MoveResultSet(1);
    }
    else if (pCtrl == m_pPrevPB)
    {
        rConfigItem.MoveResultSet(nPos - 1);
    }
    else if (pCtrl == m_pRecordED)
    {
        rConfigItem.MoveResultSet( static_cast< sal_Int32 >(m_pRecordED->GetValue()) );
    }
    else if (pCtrl == m_pNextPB)
        rConfigItem.MoveResultSet(nPos + 1);
    else if (pCtrl == m_pLastPB)
        rConfigItem.MoveResultSet(-1);

    nPos = rConfigItem.GetResultSetPosition();
    m_pRecordED->SetValue(nPos);
    bool bIsFirst;
    bool bIsLast;
    bool bValid = rConfigItem.IsResultSetFirstLast(bIsFirst, bIsLast);
    m_pFirstPB->Enable(bValid && !bIsFirst);
    m_pPrevPB->Enable(bValid && !bIsFirst);
    m_pNextPB->Enable(bValid && !bIsLast);
    m_pLastPB->Enable(bValid && !bIsLast);
    m_pExcludeCB->Check(rConfigItem.IsRecordExcluded( rConfigItem.GetResultSetPosition() ));

    //now the record has to be merged into the source document
    const SwDBData& rDBData = rConfigItem.GetCurrentDBData();
    Sequence<Any> vSelection({ makeAny(rConfigItem.GetResultSetPosition()) });
    svx::ODataAccessDescriptor aDescriptor(::comphelper::InitPropertySequence({
        {"Selection",        makeAny(vSelection)},
        {"DataSourceName",   makeAny(rDBData.sDataSource)},
        {"Command",          makeAny(rDBData.sCommand)},
        {"CommandType",      makeAny(rDBData.nCommandType)},
        {"ActiveConnection", makeAny(rConfigItem.GetConnection().getTyped())},
        {"Filter",           makeAny(rConfigItem.GetFilter())},
        {"Cursor",           makeAny(rConfigItem.GetResultSet())}
    }));

    SwWrtShell& rSh = m_pWizard->GetSwView()->GetWrtShell();
    SwMergeDescriptor aMergeDesc( DBMGR_MERGE, rSh, aDescriptor );
    rSh.GetDBManager()->MergeNew(aMergeDesc);
}

IMPL_LINK_TYPED( SwMailMergePrepareMergePage, ExcludeHdl_Impl, Button*, pBox, void)
{
    SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem();
    rConfigItem.ExcludeRecord( rConfigItem.GetResultSetPosition(), static_cast<CheckBox*>(pBox)->IsChecked());
};

void  SwMailMergePrepareMergePage::ActivatePage()
{
    MoveHdl_Impl(m_pRecordED);
}

// merge the data into a new file
bool SwMailMergePrepareMergePage::commitPage( ::svt::WizardTypes::CommitPageReason _eReason )
{
    SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem();
    if(::svt::WizardTypes::eTravelForward == _eReason && !rConfigItem.IsMergeDone())
    {
        m_pWizard->CreateTargetDocument();
        m_pWizard->EndDialog(RET_TARGET_CREATED);
    }
    return true;
}

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dbui/mmpreparemergepage.hxx b/sw/source/ui/dbui/mmpreparemergepage.hxx
deleted file mode 100644
index 89c4475..0000000
--- a/sw/source/ui/dbui/mmpreparemergepage.hxx
+++ /dev/null
@@ -1,60 +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_MMPREPAREMERGEPAGE_HXX
#define INCLUDED_SW_SOURCE_UI_DBUI_MMPREPAREMERGEPAGE_HXX

#include <svtools/wizardmachine.hxx>
#include <vcl/button.hxx>
#include <vcl/field.hxx>
#include <svtools/stdctrl.hxx>
#include <mailmergehelper.hxx>

class SwMailMergeWizard;

class SwMailMergePrepareMergePage : public svt::OWizardPage
{
    VclPtr<PushButton>     m_pFirstPB;
    VclPtr<PushButton>     m_pPrevPB;
    VclPtr<NumericField>   m_pRecordED;
    VclPtr<PushButton>     m_pNextPB;
    VclPtr<PushButton>     m_pLastPB;
    VclPtr<CheckBox>       m_pExcludeCB;

    VclPtr<PushButton>     m_pEditPB;

    VclPtr<SwMailMergeWizard>  m_pWizard;

    DECL_LINK_TYPED(EditDocumentHdl_Impl, Button*, void);
    DECL_LINK_TYPED(ExcludeHdl_Impl, Button*, void);
    DECL_LINK_TYPED(MoveEditHdl_Impl, Edit&, void);
    DECL_LINK_TYPED(MoveClickHdl_Impl, Button*, void);
    void MoveHdl_Impl(Control*);

    virtual void        ActivatePage() override;
    virtual bool        commitPage( ::svt::WizardTypes::CommitPageReason _eReason ) override;

public:
    SwMailMergePrepareMergePage( SwMailMergeWizard* _pParent);
    virtual ~SwMailMergePrepareMergePage();
    virtual void dispose() override;
};

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/inc/mailmergewizard.hxx b/sw/source/uibase/inc/mailmergewizard.hxx
index dba59f4..e2866ae 100644
--- a/sw/source/uibase/inc/mailmergewizard.hxx
+++ b/sw/source/uibase/inc/mailmergewizard.hxx
@@ -30,7 +30,6 @@ class SwMailMergeConfigItem;
#define MM_ADDRESSBLOCKPAGE     2
#define MM_GREETINGSPAGE        3
#define MM_LAYOUTPAGE           4
#define MM_PREPAREMERGEPAGE     5

class SwMailMergeWizard : public ::svt::RoadmapWizard
{
diff --git a/sw/uiconfig/swriter/ui/mmpreparepage.ui b/sw/uiconfig/swriter/ui/mmpreparepage.ui
deleted file mode 100644
index 95bfd32..0000000
--- a/sw/uiconfig/swriter/ui/mmpreparepage.ui
+++ /dev/null
@@ -1,350 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.16.1 -->
<interface>
  <requires lib="gtk+" version="3.0"/>
  <object class="GtkAdjustment" id="adjustment1">
    <property name="lower">1</property>
    <property name="upper">65535</property>
    <property name="step_increment">1</property>
    <property name="page_increment">10</property>
  </object>
  <object class="GtkBox" id="MMPreparePage">
    <property name="visible">True</property>
    <property name="can_focus">False</property>
    <property name="hexpand">True</property>
    <property name="vexpand">True</property>
    <property name="border_width">6</property>
    <property name="orientation">vertical</property>
    <property name="spacing">12</property>
    <child>
      <object class="GtkFrame" id="frame1">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="hexpand">True</property>
        <property name="vexpand">True</property>
        <property name="label_xalign">0</property>
        <property name="shadow_type">none</property>
        <child>
          <object class="GtkAlignment" id="alignment1">
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="hexpand">True</property>
            <property name="vexpand">True</property>
            <property name="top_padding">6</property>
            <property name="left_padding">12</property>
            <child>
              <object class="GtkGrid" id="grid1">
                <property name="visible">True</property>
                <property name="can_focus">False</property>
                <property name="hexpand">True</property>
                <property name="vexpand">True</property>
                <property name="row_spacing">12</property>
                <child>
                  <object class="GtkGrid" id="grid3">
                    <property name="visible">True</property>
                    <property name="can_focus">False</property>
                    <property name="hexpand">True</property>
                    <property name="row_spacing">6</property>
                    <child>
                      <object class="GtkLabel" id="label3">
                        <property name="visible">True</property>
                        <property name="can_focus">False</property>
                        <property name="hexpand">True</property>
                        <property name="xalign">0</property>
                        <property name="yalign">0</property>
                        <property name="label" translatable="yes">The preview of a merged document is visible now. To see the preview of another document click one of the arrows.</property>
                        <property name="wrap">True</property>
                        <property name="max_width_chars">56</property>
                      </object>
                      <packing>
                        <property name="left_attach">0</property>
                        <property name="top_attach">0</property>
                        <property name="width">1</property>
                        <property name="height">1</property>
                      </packing>
                    </child>
                    <child>
                      <object class="GtkGrid" id="grid4">
                        <property name="visible">True</property>
                        <property name="can_focus">False</property>
                        <property name="row_spacing">6</property>
                        <property name="column_spacing">12</property>
                        <child>
                          <object class="GtkLabel" id="label4">
                            <property name="visible">True</property>
                            <property name="can_focus">False</property>
                            <property name="xalign">0</property>
                            <property name="yalign">0</property>
                            <property name="label" translatable="yes">_Recipient</property>
                            <property name="use_underline">True</property>
                          </object>
                          <packing>
                            <property name="left_attach">0</property>
                            <property name="top_attach">0</property>
                            <property name="width">1</property>
                            <property name="height">1</property>
                          </packing>
                        </child>
                        <child>
                          <object class="GtkGrid" id="grid5">
                            <property name="visible">True</property>
                            <property name="can_focus">False</property>
                            <property name="halign">center</property>
                            <property name="hexpand">True</property>
                            <property name="row_spacing">6</property>
                            <property name="column_spacing">12</property>
                            <child>
                              <object class="GtkButton" id="first">
                                <property name="label" translatable="yes">|&lt;</property>
                                <property name="visible">True</property>
                                <property name="can_focus">True</property>
                                <property name="receives_default">True</property>
                                <property name="tooltip_text" translatable="yes">First</property>
                              </object>
                              <packing>
                                <property name="left_attach">0</property>
                                <property name="top_attach">0</property>
                                <property name="width">1</property>
                                <property name="height">1</property>
                              </packing>
                            </child>
                            <child>
                              <object class="GtkButton" id="prev">
                                <property name="label" translatable="yes">&lt;</property>
                                <property name="visible">True</property>
                                <property name="can_focus">True</property>
                                <property name="receives_default">True</property>
                                <property name="tooltip_text" translatable="yes">Previous</property>
                              </object>
                              <packing>
                                <property name="left_attach">1</property>
                                <property name="top_attach">0</property>
                                <property name="width">1</property>
                                <property name="height">1</property>
                              </packing>
                            </child>
                            <child>
                              <object class="GtkButton" id="next">
                                <property name="label" translatable="yes">&gt;</property>
                                <property name="visible">True</property>
                                <property name="can_focus">True</property>
                                <property name="receives_default">True</property>
                                <property name="tooltip_text" translatable="yes">Next</property>
                              </object>
                              <packing>
                                <property name="left_attach">3</property>
                                <property name="top_attach">0</property>
                                <property name="width">1</property>
                                <property name="height">1</property>
                              </packing>
                            </child>
                            <child>
                              <object class="GtkButton" id="last">
                                <property name="label" translatable="yes">&gt;|</property>
                                <property name="visible">True</property>
                                <property name="can_focus">True</property>
                                <property name="receives_default">True</property>
                                <property name="tooltip_text" translatable="yes">Last</property>
                              </object>
                              <packing>
                                <property name="left_attach">4</property>
                                <property name="top_attach">0</property>
                                <property name="width">1</property>
                                <property name="height">1</property>
                              </packing>
                            </child>
                            <child>
                              <object class="GtkSpinButton" id="record-nospin">
                                <property name="visible">True</property>
                                <property name="can_focus">True</property>
                                <property name="adjustment">adjustment1</property>
                                <property name="value">1</property>
                              </object>
                              <packing>
                                <property name="left_attach">2</property>
                                <property name="top_attach">0</property>
                                <property name="width">1</property>
                                <property name="height">1</property>
                              </packing>
                            </child>
                            <child>
                              <object class="GtkCheckButton" id="exclude">
                                <property name="label" translatable="yes">E_xclude this recipient</property>
                                <property name="visible">True</property>
                                <property name="can_focus">True</property>
                                <property name="receives_default">False</property>
                                <property name="halign">center</property>
                                <property name="use_underline">True</property>
                                <property name="xalign">0</property>
                                <property name="draw_indicator">True</property>
                              </object>
                              <packing>
                                <property name="left_attach">0</property>
                                <property name="top_attach">1</property>
                                <property name="width">5</property>
                                <property name="height">1</property>
                              </packing>
                            </child>
                          </object>
                          <packing>
                            <property name="left_attach">1</property>
                            <property name="top_attach">0</property>
                            <property name="width">1</property>
                            <property name="height">1</property>
                          </packing>
                        </child>
                        <child>
                          <object class="GtkBox" id="box1">
                            <property name="visible">True</property>
                            <property name="can_focus">False</property>
                            <property name="orientation">vertical</property>
                            <child>
                              <placeholder/>
                            </child>
                          </object>
                          <packing>
                            <property name="left_attach">2</property>
                            <property name="top_attach">0</property>
                            <property name="width">1</property>
                            <property name="height">1</property>
                          </packing>
                        </child>
                      </object>
                      <packing>
                        <property name="left_attach">0</property>
                        <property name="top_attach">1</property>
                        <property name="width">1</property>
                        <property name="height">1</property>
                      </packing>
                    </child>
                  </object>
                  <packing>
                    <property name="left_attach">0</property>
                    <property name="top_attach">0</property>
                    <property name="width">1</property>
                    <property name="height">1</property>
                  </packing>
                </child>
              </object>
            </child>
          </object>
        </child>
        <child type="label">
          <object class="GtkLabel" id="label1">
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="label" translatable="yes">Preview Document</property>
            <attributes>
              <attribute name="weight" value="bold"/>
            </attributes>
          </object>
        </child>
      </object>
      <packing>
        <property name="expand">False</property>
        <property name="fill">True</property>
        <property name="position">0</property>
      </packing>
    </child>
    <child>
      <object class="GtkFrame" id="frame2">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="hexpand">True</property>
        <property name="vexpand">True</property>
        <property name="label_xalign">0</property>
        <property name="shadow_type">none</property>
        <child>
          <object class="GtkAlignment" id="alignment2">
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="hexpand">True</property>
            <property name="vexpand">True</property>
            <property name="top_padding">6</property>
            <property name="left_padding">12</property>
            <child>
              <object class="GtkGrid" id="grid2">
                <property name="visible">True</property>
                <property name="can_focus">False</property>
                <property name="hexpand">True</property>
                <property name="vexpand">True</property>
                <property name="row_spacing">12</property>
                <child>
                  <object class="GtkGrid" id="grid6">
                    <property name="visible">True</property>
                    <property name="can_focus">False</property>
                    <property name="hexpand">True</property>
                    <property name="row_spacing">6</property>
                    <child>
                      <object class="GtkLabel" id="label5">
                        <property name="visible">True</property>
                        <property name="can_focus">False</property>
                        <property name="hexpand">True</property>
                        <property name="xalign">0</property>
                        <property name="yalign">0</property>
                        <property name="label" translatable="yes">Write or edit your document now if you have not already done so. The changes will affect all merged documents.

Clicking 'Edit Document...' will temporarily reduce the wizard to a small window so you can edit the mail merge document. After editing the document, return to the wizard by clicking 'Return to Mail Merge Wizard' in the small window.</property>
                        <property name="wrap">True</property>
                        <property name="max_width_chars">56</property>
                      </object>
                      <packing>
                        <property name="left_attach">0</property>
                        <property name="top_attach">0</property>
                        <property name="width">1</property>
                        <property name="height">1</property>
                      </packing>
                    </child>
                    <child>
                      <object class="GtkButton" id="edit">
                        <property name="label" translatable="yes">_Edit Document...</property>
                        <property name="visible">True</property>
                        <property name="can_focus">True</property>
                        <property name="receives_default">True</property>
                        <property name="halign">center</property>
                        <property name="use_underline">True</property>
                      </object>
                      <packing>
                        <property name="left_attach">0</property>
                        <property name="top_attach">1</property>
                        <property name="width">1</property>
                        <property name="height">1</property>
                      </packing>
                    </child>
                  </object>
                  <packing>
                    <property name="left_attach">0</property>
                    <property name="top_attach">0</property>
                    <property name="width">1</property>
                    <property name="height">1</property>
                  </packing>
                </child>
              </object>
            </child>
          </object>
        </child>
        <child type="label">
          <object class="GtkLabel" id="label2">
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="label" translatable="yes">Edit Document</property>
            <attributes>
              <attribute name="weight" value="bold"/>
            </attributes>
          </object>
        </child>
      </object>
      <packing>
        <property name="expand">False</property>
        <property name="fill">True</property>
        <property name="position">1</property>
      </packing>
    </child>
  </object>
  <object class="GtkSizeGroup" id="sizegroup1">
    <widgets>
      <widget name="label4"/>
      <widget name="box1"/>
    </widgets>
  </object>
</interface>