2004-09-20 12:17:26 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 17:39:56 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2004-09-20 12:17:26 +00:00
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2004-09-20 12:17:26 +00:00
|
|
|
*
|
2008-04-10 17:39:56 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2004-09-20 12:17:26 +00:00
|
|
|
*
|
2008-04-10 17:39:56 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2004-09-20 12:17:26 +00:00
|
|
|
*
|
2008-04-10 17:39:56 +00:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2004-09-20 12:17:26 +00:00
|
|
|
*
|
2008-04-10 17:39:56 +00:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2004-09-20 12:17:26 +00:00
|
|
|
*
|
2008-04-10 17:39:56 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2004-09-20 12:17:26 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
2006-09-16 21:46:39 +00:00
|
|
|
|
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_sw.hxx"
|
2004-09-29 08:33:13 +00:00
|
|
|
#ifdef SW_DLLIMPLEMENTATION
|
|
|
|
#undef SW_DLLIMPLEMENTATION
|
|
|
|
#endif
|
2004-09-20 12:17:26 +00:00
|
|
|
#include <mmmergepage.hxx>
|
|
|
|
#include <mailmergewizard.hxx>
|
|
|
|
#include <mmconfigitem.hxx>
|
|
|
|
#include <swtypes.hxx>
|
|
|
|
#include <view.hxx>
|
|
|
|
#include <dbui.hrc>
|
|
|
|
#include <mmmergepage.hrc>
|
2009-12-10 23:06:35 +01:00
|
|
|
#include <svl/srchitem.hxx>
|
2004-09-20 12:17:26 +00:00
|
|
|
#include <sfx2/dispatch.hxx>
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/eitem.hxx>
|
2004-09-20 12:17:26 +00:00
|
|
|
#include <swabstdlg.hxx>
|
|
|
|
|
|
|
|
/*-- 02.04.2004 16:38:45---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
SwMailMergeMergePage::SwMailMergeMergePage( SwMailMergeWizard* _pParent) :
|
|
|
|
svt::OWizardPage(_pParent, SW_RES(DLG_MM_MERGE_PAGE)),
|
2007-09-27 10:34:27 +00:00
|
|
|
#ifdef MSC
|
2004-09-20 12:17:26 +00:00
|
|
|
#pragma warning (disable : 4355)
|
2007-09-06 13:06:20 +00:00
|
|
|
#endif
|
2007-04-26 08:04:08 +00:00
|
|
|
m_aHeaderFI(this, SW_RES( FI_HEADER ) ),
|
|
|
|
m_aEditFI(this, SW_RES( FI_EDIT )),
|
|
|
|
m_aEditPB(this, SW_RES( PB_EDIT )),
|
|
|
|
m_aFindFL(this, SW_RES( FL_FIND )),
|
|
|
|
m_aFineFT(this, SW_RES( FT_FIND )),
|
|
|
|
m_aFindED(this, SW_RES( ED_FIND )),
|
|
|
|
m_aFindPB(this, SW_RES( PB_FIND )),
|
|
|
|
m_aWholeWordsCB(this, SW_RES( CB_WHOLEWORDS)),
|
|
|
|
m_aBackwardsCB(this, SW_RES( CB_BACKWARDS )),
|
|
|
|
m_aMatchCaseCB(this, SW_RES( CB_MATCHCASE )),
|
2007-09-27 10:34:27 +00:00
|
|
|
#ifdef MSC
|
2004-09-20 12:17:26 +00:00
|
|
|
#pragma warning (default : 4355)
|
2007-09-06 13:06:20 +00:00
|
|
|
#endif
|
2004-09-20 12:17:26 +00:00
|
|
|
m_pWizard(_pParent)
|
|
|
|
{
|
|
|
|
FreeResource();
|
|
|
|
String sTemp(m_aEditFI.GetText());
|
|
|
|
sTemp.SearchAndReplace(String::CreateFromAscii("%1"), m_aEditPB.GetText());
|
|
|
|
m_aEditFI.SetText(sTemp);
|
|
|
|
m_aEditPB.SetClickHdl( LINK( this, SwMailMergeMergePage, EditDocumentHdl_Impl));
|
|
|
|
m_aFindPB.SetClickHdl( LINK( this, SwMailMergeMergePage, FindHdl_Impl ));
|
|
|
|
|
2004-11-16 15:59:13 +00:00
|
|
|
m_aFindED.SetReturnActionLink( LINK(this, SwMailMergeMergePage, EnteredFindStringHdl_Impl ));
|
|
|
|
|
2004-09-20 12:17:26 +00:00
|
|
|
}
|
|
|
|
/*-- 02.04.2004 16:38:45---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
SwMailMergeMergePage::~SwMailMergeMergePage()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
/*-- 25.05.2004 16:14:49---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
2007-09-27 10:34:27 +00:00
|
|
|
IMPL_LINK( SwMailMergeMergePage, EditDocumentHdl_Impl, PushButton*, EMPTYARG)
|
2004-09-20 12:17:26 +00:00
|
|
|
{
|
|
|
|
m_pWizard->SetRestartPage(MM_MERGEPAGE);
|
|
|
|
m_pWizard->EndDialog(RET_EDIT_RESULT_DOC);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
/*-- 25.05.2004 16:14:49---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
2007-09-27 10:34:27 +00:00
|
|
|
IMPL_LINK( SwMailMergeMergePage, FindHdl_Impl, PushButton*, EMPTYARG)
|
2004-09-20 12:17:26 +00:00
|
|
|
{
|
|
|
|
SvxSearchItem aSearchItem( SID_SEARCH_ITEM );
|
|
|
|
|
2004-11-16 15:59:13 +00:00
|
|
|
SfxBoolItem aQuiet( SID_SEARCH_QUIET, sal_False );
|
2004-09-20 12:17:26 +00:00
|
|
|
aSearchItem.SetSearchString(m_aFindED.GetText());
|
|
|
|
|
|
|
|
aSearchItem.SetWordOnly(m_aWholeWordsCB.IsChecked());
|
|
|
|
aSearchItem.SetExact(m_aMatchCaseCB.IsChecked());
|
|
|
|
aSearchItem.SetBackward(m_aBackwardsCB.IsChecked());
|
|
|
|
|
|
|
|
SwView* pTargetView = m_pWizard->GetConfigItem().GetTargetView();
|
2008-11-10 15:06:12 +00:00
|
|
|
DBG_ASSERT(pTargetView, "no target view exists");
|
2004-09-20 12:17:26 +00:00
|
|
|
if(pTargetView)
|
|
|
|
{
|
|
|
|
pTargetView->GetViewFrame()->GetDispatcher()->Execute(
|
|
|
|
FID_SEARCH_NOW, SFX_CALLMODE_SYNCHRON, &aSearchItem, &aQuiet, 0L );
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2004-11-16 15:59:13 +00:00
|
|
|
IMPL_LINK( SwMailMergeMergePage, EnteredFindStringHdl_Impl, void*, EMPTYARG )
|
|
|
|
{
|
|
|
|
m_aFindPB.GetClickHdl().Call( &m_aFindPB );
|
|
|
|
return 0;
|
|
|
|
}
|