Files
libreoffice/sw/source/ui/shells/textfld.cxx

893 lines
33 KiB
C++
Raw Normal View History

2008-02-19 12:58:22 +00:00
/************ *************************************************************
2000-09-18 16:15:01 +00:00
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2000-09-18 16:15:01 +00:00
*
* Copyright 2008 by Sun Microsystems, Inc.
2000-09-18 16:15:01 +00:00
*
* OpenOffice.org - a multi-platform office productivity suite
2000-09-18 16:15:01 +00:00
*
* $RCSfile: textfld.cxx,v $
CWS-TOOLING: integrate CWS notes7 2008-12-29 19:45:08 +0100 mod r265824 : CWS-TOOLING: rebase CWS notes7 to trunk@265758 (milestone: DEV300:m38) 2008-12-16 14:54:42 +0100 mod r265544 : #i97239# 2008-12-16 14:53:18 +0100 mod r265543 : #i97239# 2008-12-16 13:36:43 +0100 mod r265537 : 96602 2008-12-13 13:02:54 +0100 mba r265452 : warning fixed 2008-12-13 08:20:21 +0100 mod r265448 : search inside notes 2008-12-13 00:11:47 +0100 mod r265447 : search inside notes 2008-12-13 00:11:09 +0100 mod r265446 : search inside notes 2008-12-13 00:10:52 +0100 mod r265445 : search inside notes 2008-12-12 19:39:14 +0100 mod r265439 : search inside notes 2008-12-12 19:02:44 +0100 mod r265438 : search inside notes 2008-12-12 16:42:07 +0100 mba r265431 : #i80135#: search in notes 2008-12-12 16:11:54 +0100 mba r265429 : #i80135#: search in notes 2008-12-12 16:11:02 +0100 mba r265428 : #i80135#: search in notes 2008-12-11 20:24:20 +0100 pb r265358 : fix: #i80135# fixes for aNotesBtn 2008-12-11 20:23:19 +0100 pb r265357 : fix: #i80135# fixes for aNotesBtn 2008-12-11 07:42:17 +0100 pb r265241 : fix: #i80135# CB_NOTES added 2008-12-11 07:40:36 +0100 pb r265240 : fix: #i80135# CB_NOTES added 2008-12-11 07:32:03 +0100 pb r265239 : fix: #i80135# CheckBox aNotesBtn added 2008-12-11 07:24:45 +0100 pb r265238 : fix: #i80135# CheckBox aNotesBtn added 2008-12-10 15:41:31 +0100 mod r265198 : crash using replies 2008-12-10 15:21:23 +0100 mod r265195 : crash using replies 2008-12-10 13:45:14 +0100 mba r265181 : warning fixed 2008-12-10 13:26:45 +0100 mba r265178 : warning fixed 2008-12-10 11:48:23 +0100 mba r265162 : fixed compilation error on Linux 2008-12-03 18:39:07 +0100 mod r264806 : we don't get the Ctrl-Alt-N on mac inside a note, let's do the whole reply thing using the shell, cleaner anyway 2008-12-03 17:13:59 +0100 mod r264802 : search dialog can be started and closed when focus is inside a note 2008-12-03 00:07:08 +0100 mod r264733 : search inside notes 2008-12-02 18:06:08 +0100 mod r264729 : WaE 2008-12-02 15:01:26 +0100 mod r264703 : WaE 2008-12-02 00:20:14 +0100 mod r264644 : WaE 2008-12-01 10:06:14 +0100 mod r264587 : WaE 2008-12-01 01:28:34 +0100 mod r264585 : WaE 2008-11-30 22:51:19 +0100 mod r264584 : search inside notes 2008-11-30 17:03:04 +0100 mod r264583 : search inside notes 2008-11-28 16:30:05 +0100 mod r264560 : #i96602# 2008-11-28 16:14:50 +0100 mod r264559 : test 2008-11-28 16:11:37 +0100 mod r264558 : test 2008-11-17 17:46:10 +0100 mod r263735 : WaE 2008-11-17 17:45:56 +0100 mod r263734 : WaE 2008-11-17 17:37:35 +0100 mod r263733 : revert manual fix for icu 2008-11-17 15:03:55 +0100 mod r263726 : manual fix for icu 2008-11-17 11:17:49 +0100 mod r263707 : manual fix for icu 2008-11-14 15:51:19 +0100 mod r263679 : fix 2008-11-14 14:48:02 +0100 mod r263676 : some more cleanup, redline comments not in the margin for 3.1 2008-11-14 08:37:07 +0100 mod r263664 : end of line missing 2008-11-13 18:36:53 +0100 mod r263660 : WaE 2008-11-13 18:20:04 +0100 mod r263659 : #i94374# 2008-11-13 15:51:28 +0100 mod r263648 : CWS-TOOLING: rebase CWS notes7 to trunk@263288 (milestone: DEV300:m35) 2008-11-13 08:33:19 +0100 mod r263622 : typos 2008-11-02 23:18:19 +0100 mod r263278 : changes notes, replies 2008-11-01 11:48:35 +0100 mod r262873 : replies, comments 2008-11-01 11:44:57 +0100 mod r262872 : notes search button 2008-10-10 14:34:34 +0200 mod r262150 : migration from cvs to svn 2008-10-10 14:33:39 +0200 mod r262149 : migration from cvs to svn
2009-01-02 15:51:45 +00:00
* $Revision: 1.38.190.2 $
2000-09-18 16:15:01 +00:00
*
* This file is part of OpenOffice.org.
2000-09-18 16:15:01 +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.
2000-09-18 16:15:01 +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).
2000-09-18 16:15:01 +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.
2000-09-18 16:15:01 +00:00
*
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
2008-02-19 12:58:22 +00:00
#include <crsskip.hxx>
2000-10-06 12:41:54 +00:00
#include <hintids.hxx> //_immer_ vor den solar-Items
#include <sfx2/lnkbase.hxx>
2008-02-19 12:58:22 +00:00
#include <fmtfld.hxx>
2000-10-06 12:41:54 +00:00
#include <tools/urlobj.hxx>
#include <vcl/msgbox.hxx>
2000-09-18 16:15:01 +00:00
#include <svtools/itempool.hxx>
#include <unotools/useroptions.hxx>
2000-09-18 16:15:01 +00:00
#include <svtools/whiter.hxx>
#include <svtools/eitem.hxx>
#include <svtools/macitem.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/request.hxx>
2000-10-06 12:41:54 +00:00
#include <svx/postattr.hxx>
#include <svx/hlnkitem.hxx>
#include <svx/svxdlg.hxx>
2000-10-06 12:41:54 +00:00
#include <svx/linkmgr.hxx>
#include <unotools/localedatawrapper.hxx>
2008-02-19 12:58:22 +00:00
#include <sfx2/dispatch.hxx>
2000-09-18 16:15:01 +00:00
#include <fmtinfmt.hxx>
#include <fldwrap.hxx>
2000-10-06 12:41:54 +00:00
#include <redline.hxx>
#include <view.hxx>
#include <wrtsh.hxx>
#include <basesh.hxx>
#include <wrtsh.hxx>
#include <flddat.hxx>
#include <numrule.hxx>
#include <textsh.hxx>
CWS-TOOLING: integrate CWS notes7 2008-12-29 19:45:08 +0100 mod r265824 : CWS-TOOLING: rebase CWS notes7 to trunk@265758 (milestone: DEV300:m38) 2008-12-16 14:54:42 +0100 mod r265544 : #i97239# 2008-12-16 14:53:18 +0100 mod r265543 : #i97239# 2008-12-16 13:36:43 +0100 mod r265537 : 96602 2008-12-13 13:02:54 +0100 mba r265452 : warning fixed 2008-12-13 08:20:21 +0100 mod r265448 : search inside notes 2008-12-13 00:11:47 +0100 mod r265447 : search inside notes 2008-12-13 00:11:09 +0100 mod r265446 : search inside notes 2008-12-13 00:10:52 +0100 mod r265445 : search inside notes 2008-12-12 19:39:14 +0100 mod r265439 : search inside notes 2008-12-12 19:02:44 +0100 mod r265438 : search inside notes 2008-12-12 16:42:07 +0100 mba r265431 : #i80135#: search in notes 2008-12-12 16:11:54 +0100 mba r265429 : #i80135#: search in notes 2008-12-12 16:11:02 +0100 mba r265428 : #i80135#: search in notes 2008-12-11 20:24:20 +0100 pb r265358 : fix: #i80135# fixes for aNotesBtn 2008-12-11 20:23:19 +0100 pb r265357 : fix: #i80135# fixes for aNotesBtn 2008-12-11 07:42:17 +0100 pb r265241 : fix: #i80135# CB_NOTES added 2008-12-11 07:40:36 +0100 pb r265240 : fix: #i80135# CB_NOTES added 2008-12-11 07:32:03 +0100 pb r265239 : fix: #i80135# CheckBox aNotesBtn added 2008-12-11 07:24:45 +0100 pb r265238 : fix: #i80135# CheckBox aNotesBtn added 2008-12-10 15:41:31 +0100 mod r265198 : crash using replies 2008-12-10 15:21:23 +0100 mod r265195 : crash using replies 2008-12-10 13:45:14 +0100 mba r265181 : warning fixed 2008-12-10 13:26:45 +0100 mba r265178 : warning fixed 2008-12-10 11:48:23 +0100 mba r265162 : fixed compilation error on Linux 2008-12-03 18:39:07 +0100 mod r264806 : we don't get the Ctrl-Alt-N on mac inside a note, let's do the whole reply thing using the shell, cleaner anyway 2008-12-03 17:13:59 +0100 mod r264802 : search dialog can be started and closed when focus is inside a note 2008-12-03 00:07:08 +0100 mod r264733 : search inside notes 2008-12-02 18:06:08 +0100 mod r264729 : WaE 2008-12-02 15:01:26 +0100 mod r264703 : WaE 2008-12-02 00:20:14 +0100 mod r264644 : WaE 2008-12-01 10:06:14 +0100 mod r264587 : WaE 2008-12-01 01:28:34 +0100 mod r264585 : WaE 2008-11-30 22:51:19 +0100 mod r264584 : search inside notes 2008-11-30 17:03:04 +0100 mod r264583 : search inside notes 2008-11-28 16:30:05 +0100 mod r264560 : #i96602# 2008-11-28 16:14:50 +0100 mod r264559 : test 2008-11-28 16:11:37 +0100 mod r264558 : test 2008-11-17 17:46:10 +0100 mod r263735 : WaE 2008-11-17 17:45:56 +0100 mod r263734 : WaE 2008-11-17 17:37:35 +0100 mod r263733 : revert manual fix for icu 2008-11-17 15:03:55 +0100 mod r263726 : manual fix for icu 2008-11-17 11:17:49 +0100 mod r263707 : manual fix for icu 2008-11-14 15:51:19 +0100 mod r263679 : fix 2008-11-14 14:48:02 +0100 mod r263676 : some more cleanup, redline comments not in the margin for 3.1 2008-11-14 08:37:07 +0100 mod r263664 : end of line missing 2008-11-13 18:36:53 +0100 mod r263660 : WaE 2008-11-13 18:20:04 +0100 mod r263659 : #i94374# 2008-11-13 15:51:28 +0100 mod r263648 : CWS-TOOLING: rebase CWS notes7 to trunk@263288 (milestone: DEV300:m35) 2008-11-13 08:33:19 +0100 mod r263622 : typos 2008-11-02 23:18:19 +0100 mod r263278 : changes notes, replies 2008-11-01 11:48:35 +0100 mod r262873 : replies, comments 2008-11-01 11:44:57 +0100 mod r262872 : notes search button 2008-10-10 14:34:34 +0200 mod r262150 : migration from cvs to svn 2008-10-10 14:33:39 +0200 mod r262149 : migration from cvs to svn
2009-01-02 15:51:45 +00:00
#include <docsh.hxx>
2000-10-06 12:41:54 +00:00
#include <docufld.hxx>
#include <usrfld.hxx>
#include <ddefld.hxx>
#include <expfld.hxx>
#include <fldmgr.hxx>
#include <uitool.hxx>
2000-10-06 12:41:54 +00:00
#include <cmdid.h>
#include <shells.hrc>
2000-09-18 16:15:01 +00:00
#include <sfx2/app.hxx>
#include <svx/svxdlg.hxx>
#include <svx/dialogs.hrc>
#include "swabstdlg.hxx"
#include "dialog.hrc"
#include <fldui.hrc>
2008-02-19 12:58:22 +00:00
#include <doc.hxx>
#include <app.hrc>
#include "PostItMgr.hxx"
#include "postit.hxx"
using namespace nsSwDocInfoSubType;
2000-09-18 16:15:01 +00:00
extern BOOL bNoInterrupt; // in mainwn.cxx
String& lcl_AppendRedlineStr( String& rStr, USHORT nRedlId )
{
USHORT nResId = 0;
switch( nRedlId )
{
case nsRedlineType_t::REDLINE_INSERT: nResId = STR_REDLINE_INSERTED; break;
case nsRedlineType_t::REDLINE_DELETE: nResId = STR_REDLINE_DELETED; break;
case nsRedlineType_t::REDLINE_FORMAT: nResId = STR_REDLINE_FORMATED; break;
case nsRedlineType_t::REDLINE_TABLE: nResId = STR_REDLINE_TABLECHG; break;
case nsRedlineType_t::REDLINE_FMTCOLL: nResId = STR_REDLINE_FMTCOLLSET; break;
2000-09-18 16:15:01 +00:00
}
if( nResId )
rStr += SW_RESSTR( nResId );
return rStr;
}
// STATIC DATA -----------------------------------------------------------
void SwTextShell::ExecField(SfxRequest &rReq)
{
SwWrtShell& rSh = GetShell();
const SfxPoolItem* pItem = 0;
USHORT nSlot = rReq.GetSlot();
const SfxItemSet* pArgs = rReq.GetArgs();
if(pArgs)
pArgs->GetItemState(GetPool().GetWhich(nSlot), FALSE, &pItem);
Window *pMDI = &GetView().GetViewFrame()->GetWindow();
BOOL bMore = FALSE;
BOOL bIsText = TRUE;
2000-09-18 16:15:01 +00:00
USHORT nInsertType = 0;
USHORT nInsertSubType = 0;
ULONG nInsertFormat = 0;
2000-09-18 16:15:01 +00:00
switch(nSlot)
{
case FN_EDIT_FIELD:
{
SwField* pFld = rSh.GetCurFld();
if( pFld )
{
switch ( pFld->GetTypeId() )
{
case TYP_DDEFLD:
{
::sfx2::SvBaseLink& rLink = ((SwDDEFieldType*)pFld->GetTyp())->
GetBaseLink();
if(rLink.IsVisible())
{
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
SfxAbstractLinksDialog* pDlg = pFact->CreateLinksDialog( pMDI, &rSh.GetLinkManager(), FALSE, &rLink );
if ( pDlg )
{
pDlg->Execute();
delete pDlg;
}
}
2000-09-18 16:15:01 +00:00
break;
}
default:
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
CWS-TOOLING: integrate CWS mba32issues01 2009-05-05 18:23:27 +0200 mba r271547 : apply diffs from m45->m47 for all files moved from dialog to cui 2009-05-05 18:22:02 +0200 mba r271545 : apply diffs from m45->m47 for all files moved from dialog to cui 2009-05-05 18:16:42 +0200 mba r271544 : apply diffs from m45->m47 for all files moved from dialog to cui 2009-04-29 19:35:58 +0200 mba r271392 : #i73672#: unify commands for inserting special characters 2009-04-29 18:01:27 +0200 mba r271391 : #i101337#: missing string resources 2009-04-29 18:01:10 +0200 mba r271390 : #i101337#: missing string resources 2009-04-29 15:42:47 +0200 mba r271380 : concurrency problem in multithreaded dmake due to missing dependency 2009-04-28 17:36:03 +0200 tbo r271336 : #i99432# 2009-04-28 13:57:52 +0200 mba r271322 : #i101302#: ctor might be called with pSet=0 2009-04-22 19:32:39 +0200 tbo r271138 : #i99432# 2009-04-09 14:46:03 +0200 mba r270709 : make sendreportw32.cxx compile with pch 2009-04-06 16:05:07 +0200 mba r270568 : #i99432#: some tweaks for build order 2009-04-06 15:38:52 +0200 mba r270558 : typo 2009-04-06 13:36:19 +0200 mba r270542 : #i99432#: split of localization also 2009-04-06 13:19:06 +0200 mba r270539 : #i99432#: split up srs files also 2009-04-03 17:57:59 +0200 mba r270513 : #i99432#: split dialog folder into two 2009-04-03 17:56:46 +0200 mba r270512 : #i99432#: split dialog folder into two 2009-04-01 22:15:00 +0200 mba r270364 : warnings on Linux 2009-04-01 22:10:44 +0200 mba r270363 : warnings on Linux 2009-04-01 21:43:54 +0200 mba r270362 : warning fixed 2009-04-01 21:41:27 +0200 mba r270361 : warning on Linux fixed 2009-04-01 21:35:44 +0200 mba r270360 : warning fixed 2009-04-01 20:19:59 +0200 mba r270358 : warning found on Linux fixed 2009-04-01 19:23:38 +0200 mba r270354 : warning due to missing eof 2009-04-01 18:56:25 +0200 mba r270352 : linking problem fixed that appeared only on mac 2009-04-01 18:41:30 +0200 mba r270350 : warnings discovered on Linux fixed 2009-04-01 18:34:28 +0200 mba r270349 : some fixes for warnings and include problems discoverd after resync and build on mac 2009-04-01 14:08:22 +0200 mba r270328 : CWS-TOOLING: rebase CWS mba32issues01 to trunk@270033 (milestone: DEV300:m45) 2009-03-04 18:13:35 +0100 mba r268858 : #i99432#: more dialogs moved to cui 2009-03-04 17:47:41 +0100 mba r268854 : #i99432#: more dialogs moved to cui 2009-03-04 17:32:39 +0100 mba r268851 : warning fixed 2009-03-04 12:59:26 +0100 mba r268814 : #i99432#: more dialogs moved to cui 2009-03-04 11:49:03 +0100 mba r268802 : #i99432#: CharmapDialog moved to cui 2009-03-04 10:46:00 +0100 mba r268795 : #i99432#: CharmapDialog moved to cui 2009-03-04 10:43:50 +0100 mba r268794 : #i99432#: CharmapDialog moved to cui 2009-03-04 10:00:29 +0100 mba r268792 : #i99432#: CharmapDialog moved to cui 2009-03-04 10:00:03 +0100 mba r268791 : #i99432#: CharmapDialog moved to cui 2009-03-04 09:59:43 +0100 mba r268790 : #i99432#: CharmapDialog moved to cui 2009-03-04 09:58:51 +0100 mba r268789 : #i99432#: CharmapDialog moved to cui 2009-03-04 09:58:16 +0100 mba r268788 : #i99432#: CharmapDialog moved to cui 2009-03-03 16:33:14 +0100 mba r268763 : #i99465#: new SfxAbstractDialog interface and creation methods 2009-03-03 16:32:28 +0100 mba r268762 : #i99432#: some tabpages moved to cui 2009-03-03 16:32:09 +0100 mba r268761 : #i99432#: some tabpages moved to cui 2009-03-03 16:29:40 +0100 mba r268760 : #i99465#: new SfxAbstractDialog interface and creation methods 2009-03-03 16:29:08 +0100 mba r268759 : #i99432#: MacroAssignment page moved to cui 2009-03-03 16:28:41 +0100 mba r268758 : #i99432#: MacroAssignment page moved to cui 2009-03-03 16:28:18 +0100 mba r268757 : #i99465#: new SfxAbstractDialog interface and creation methods 2009-03-03 16:27:36 +0100 mba r268756 : #i99465#: replace FN_SYMBOL by SID_CHARMAP 2009-03-03 16:27:02 +0100 mba r268755 : #i99465#: new SfxAbstractDialog interface and creation methods 2009-03-03 16:26:23 +0100 mba r268754 : #i99465#: new SfxAbstractDialog interface and creation methods 2009-03-03 16:25:30 +0100 mba r268753 : #i99465#: new SfxAbstractDialog interface and creation methods 2009-03-03 16:24:49 +0100 mba r268752 : #i99465#: new SfxAbstractDialog interface and creation methods 2009-03-03 16:24:35 +0100 mba r268751 : #i99432#: MacroAssignment page moved to cui 2009-03-03 16:23:20 +0100 mba r268750 : #i99465#: new SfxAbstractDialog interface and creation methods 2009-03-03 16:23:04 +0100 mba r268749 : #i99432#: MacroAssignment page moved to cui 2009-03-03 16:21:56 +0100 mba r268748 : #i99465#: new SfxAbstractDialog interface and creation methods 2009-03-03 16:18:39 +0100 mba r268747 : #i99432#: MacroAssignment page moved to cui 2009-03-03 16:13:14 +0100 mba r268745 : #i99465#: replace FN_SYMBOL by SID_CHARMAP 2009-03-03 16:02:54 +0100 mba r268738 : #i99432#: moved MacroAssignment TabPage from sfx2 2009-03-03 14:57:58 +0100 mba r268729 : #i99465#: transport return value via ItemSet 2009-03-03 00:08:10 +0100 mba r268701 : #i99432#: move acccfg to cuilib 2009-03-03 00:07:32 +0100 mba r268700 : #i99432#: move acccfg to cuilib 2009-03-03 00:02:01 +0100 mba r268699 : #i99432#: move acccfg to cuilib 2009-03-03 00:01:38 +0100 mba r268698 : #i99432#: move acccfg to cuilib 2009-03-03 00:01:11 +0100 mba r268697 : #i99432#: move acccfg to cuilib 2009-03-03 00:00:40 +0100 mba r268696 : #i99432#: move acccfg to cuilib 2009-03-03 00:00:06 +0100 mba r268695 : #i99432#: replace SfxAbstractSingleTabDialog by SfxAbstractDialog 2009-03-02 23:59:22 +0100 mba r268694 : #i99432#: move acccfg to cuilib 2009-03-02 23:57:19 +0100 mba r268693 : #i99432#: move acccfg to svx 2009-03-02 23:56:14 +0100 mba r268692 : #i99432#: replace SfxAbstractSingleTabDialog by SfxAbstractDialog 2009-03-02 23:49:37 +0100 mba r268691 : #i99785#: consolidate dialogs library 2009-03-02 17:26:40 +0100 mba r268683 : #i99785#: consolidate dialogs library 2009-03-02 17:24:28 +0100 mba r268682 : i99465#: consolidate slot for InsertSymbol command 2009-03-02 17:22:29 +0100 mba r268681 : #i99785#: consolidate dialogs library 2009-03-02 17:18:11 +0100 mba r268680 : i99432#: move accelconfig and macroassignment to cui 2009-03-02 17:08:30 +0100 mba r268679 : #i99785#: consolidate dialogs library 2009-03-02 17:06:57 +0100 mba r268678 : #i99785#: consolidate dialogs library 2009-03-02 17:06:30 +0100 mba r268677 : #i99785#: consolidate dialogs library 2009-03-02 17:05:02 +0100 mba r268676 : #i99785#: consolidate dialogs library 2009-03-02 17:04:35 +0100 mba r268675 : #i99785#: consolidate dialogs library 2009-03-02 16:47:53 +0100 mba r268673 : i99432#: move accelconfig and macroassignment to cui 2009-03-02 16:45:17 +0100 mba r268671 : i99432#: move accelconfig and macroassignment to cui 2009-03-02 16:39:59 +0100 mba r268670 : i99432#: move accelconfig and macroassignment to cui 2009-03-02 16:38:59 +0100 mba r268668 : i99432#: move accelconfig and macroassignment to cui 2009-03-02 16:38:28 +0100 mba r268667 : i99432#: move accelconfig and macroassignment to cui 2009-03-02 16:36:06 +0100 mba r268666 : i99432#: move accelconfig and macroassignment to cui 2009-03-02 16:29:50 +0100 mba r268663 : i99432#: move accelconfig and macroassignment to cui 2009-03-02 16:24:00 +0100 mba r268659 : i99432#: move accelconfig and macroassignment to cui 2009-03-02 16:23:31 +0100 mba r268658 : i99432#: move accelconfig and macroassignment to cui 2009-03-02 16:22:41 +0100 mba r268657 : i99432#: move accelconfig and macroassignment to cui 2009-02-25 16:57:26 +0100 mba r268453 : obsolete 2009-02-17 10:50:51 +0100 mba r267846 : obsolete 2009-02-12 16:33:54 +0100 mba r267676 : #i96834#: warning fixed 2009-02-11 19:28:47 +0100 mba r267626 : #i91978#: unused code 2009-02-11 18:37:47 +0100 mba r267625 : metafile output, fixes for 3 layer office 2009-02-11 12:56:28 +0100 mba r267593 : selective trees; incomplete build lists; metafile output
2009-05-06 10:59:57 +00:00
SfxAbstractDialog* pDlg = pFact->CreateSwFldEditDlg( GetView(),RC_DLG_SWFLDEDITDLG );
DBG_ASSERT(pDlg, "Dialogdiet fail!");
2000-09-18 16:15:01 +00:00
pDlg->Execute();
delete pDlg;
}
}
}
break;
}
case FN_EXECUTE_MACROFIELD:
{
SwField* pFld = rSh.GetCurFld();
if(pFld && pFld->GetTyp()->Which() == RES_MACROFLD)
{
const String& rMacro = ((SwMacroField*)pFld)->GetMacro();
USHORT nPos = rMacro.Search('.', 0);
if(nPos != STRING_NOTFOUND)
{
SvxMacro aMacro( rMacro.Copy(nPos + 1), rMacro.Copy(0,nPos), STARBASIC );
rSh.ExecMacro(aMacro);
}
}
}
break;
case FN_GOTO_NEXT_INPUTFLD:
case FN_GOTO_PREV_INPUTFLD:
{
BOOL bRet = FALSE;
SwFieldType* pFld = rSh.GetFldType( 0, RES_INPUTFLD );
if( pFld && rSh.MoveFldType( pFld,
FN_GOTO_NEXT_INPUTFLD == nSlot ))
{
rSh.ClearMark();
rSh.StartInputFldDlg( rSh.GetCurFld(), FALSE );
bRet = TRUE;
}
rReq.SetReturnValue( SfxBoolItem( nSlot, bRet ));
}
break;
default:
bMore = TRUE;
}
if(bMore)
{
// hier kommen die Slots mit FldMgr
SwFldMgr aFldMgr(GetShellPtr());
switch(nSlot)
{
case FN_INSERT_DBFIELD:
{
BOOL bRes = FALSE;
if( pItem )
{
ULONG nFormat = 0;
USHORT nType = 0;
String aPar1 = ((SfxStringItem *)pItem)->GetValue();
String aPar2;
sal_Int32 nCommand = 0;
if( SFX_ITEM_SET == pArgs->GetItemState( FN_PARAM_FIELD_TYPE,
FALSE, &pItem ))
nType = ((SfxUInt16Item *)pItem)->GetValue();
aPar1 += DB_DELIM;
if( SFX_ITEM_SET == pArgs->GetItemState(
FN_PARAM_1, FALSE, &pItem ))
{
aPar1 += ((SfxStringItem *)pItem)->GetValue();
}
if( SFX_ITEM_SET == pArgs->GetItemState(
FN_PARAM_3, FALSE, &pItem ))
nCommand = ((SfxInt32Item*)pItem)->GetValue();
aPar1 += DB_DELIM;
aPar1 += String::CreateFromInt32(nCommand);
aPar1 += DB_DELIM;
if( SFX_ITEM_SET == pArgs->GetItemState(
FN_PARAM_2, FALSE, &pItem ))
{
aPar1 += ((SfxStringItem *)pItem)->GetValue();
}
if( SFX_ITEM_SET == pArgs->GetItemState(
FN_PARAM_FIELD_CONTENT, FALSE, &pItem ))
aPar2 = ((SfxStringItem *)pItem)->GetValue();
if( SFX_ITEM_SET == pArgs->GetItemState(
FN_PARAM_FIELD_FORMAT, FALSE, &pItem ))
nFormat = ((SfxUInt32Item *)pItem)->GetValue();
DBG_WARNING("Command is not yet used");
sal_Unicode cSeparator = ' ';
SwInsertFld_Data aData(nType, 0, aPar1, aPar2, nFormat, GetShellPtr(), cSeparator );
bRes = aFldMgr.InsertFld(aData);
}
rReq.SetReturnValue(SfxBoolItem( nSlot, bRes ));
}
break;
2000-09-18 16:15:01 +00:00
case FN_INSERT_FIELD_CTRL:
case FN_INSERT_FIELD:
{
BOOL bRes = FALSE;
if( pItem && nSlot != FN_INSERT_FIELD_CTRL)
{
ULONG nFormat = 0;
USHORT nType = 0;
USHORT nSubType = 0;
String aPar1 = ((SfxStringItem *)pItem)->GetValue();
String aPar2;
sal_Unicode cSeparator = ' ';
if( SFX_ITEM_SET == pArgs->GetItemState( FN_PARAM_FIELD_TYPE,
FALSE, &pItem ))
nType = ((SfxUInt16Item *)pItem)->GetValue();
if( SFX_ITEM_SET == pArgs->GetItemState( FN_PARAM_FIELD_SUBTYPE,
FALSE, &pItem ))
nSubType = ((SfxUInt16Item *)pItem)->GetValue();
if( SFX_ITEM_SET == pArgs->GetItemState(
FN_PARAM_FIELD_CONTENT, FALSE, &pItem ))
aPar2 = ((SfxStringItem *)pItem)->GetValue();
if( SFX_ITEM_SET == pArgs->GetItemState(
FN_PARAM_FIELD_FORMAT, FALSE, &pItem ))
nFormat = ((SfxUInt32Item *)pItem)->GetValue();
if( SFX_ITEM_SET == pArgs->GetItemState(
FN_PARAM_3, FALSE, &pItem ))
{
String sTmp = ((SfxStringItem *)pItem)->GetValue();
if(sTmp.Len())
cSeparator = sTmp.GetChar(0);
}
SwInsertFld_Data aData(nType, nSubType, aPar1, aPar2, nFormat, GetShellPtr(), cSeparator );
bRes = aFldMgr.InsertFld( aData );
}
else
//#i5788# prevent closing of the field dialog while a modal dialog ( Input field dialog ) is active
if(!GetView().GetViewFrame()->IsInModalMode())
{
SfxViewFrame* pVFrame = GetView().GetViewFrame();
pVFrame->ToggleChildWindow(FN_INSERT_FIELD);
bRes = pVFrame->GetChildWindow( nSlot ) != 0;
Invalidate(rReq.GetSlot());
Invalidate(FN_INSERT_FIELD_CTRL);
rReq.Ignore();
}
2000-09-18 16:15:01 +00:00
rReq.SetReturnValue(SfxBoolItem( nSlot, bRes ));
}
break;
case FN_INSERT_REF_FIELD:
{
SfxViewFrame* pVFrame = GetView().GetViewFrame();
if (!pVFrame->HasChildWindow(FN_INSERT_FIELD))
pVFrame->ToggleChildWindow(FN_INSERT_FIELD); // Dialog anzeigen
// Flddlg auf neue TabPage umschalten
USHORT nId = SwFldDlgWrapper::GetChildWindowId();
SwFldDlgWrapper *pWrp = (SwFldDlgWrapper*)pVFrame->GetChildWindow(nId);
if (pWrp)
pWrp->ShowPage();
rReq.Ignore();
2000-09-18 16:15:01 +00:00
}
break;
case FN_DELETE_NOTE:
if ( GetView().GetPostItMgr() && GetView().GetPostItMgr()->GetActivePostIt() )
GetView().GetPostItMgr()->GetActivePostIt()->Delete();
break;
case FN_DELETE_ALL_NOTES:
if ( GetView().GetPostItMgr() )
GetView().GetPostItMgr()->Delete();
break;
case FN_DELETE_NOTE_AUTHOR:
{
SFX_REQUEST_ARG( rReq, pNoteItem, SfxStringItem, nSlot, FALSE);
if ( pNoteItem && GetView().GetPostItMgr() )
GetView().GetPostItMgr()->Delete( pNoteItem->GetValue() );
}
break;
case FN_HIDE_NOTE:
if ( GetView().GetPostItMgr() && GetView().GetPostItMgr()->GetActivePostIt() )
GetView().GetPostItMgr()->GetActivePostIt()->Hide();
break;
case FN_HIDE_ALL_NOTES:
if ( GetView().GetPostItMgr() )
GetView().GetPostItMgr()->Hide();
break;
case FN_HIDE_NOTE_AUTHOR:
{
SFX_REQUEST_ARG( rReq, pNoteItem, SfxStringItem, nSlot, FALSE);
if ( pNoteItem && GetView().GetPostItMgr() )
GetView().GetPostItMgr()->Hide( pNoteItem->GetValue() );
}
break;
2000-09-18 16:15:01 +00:00
case FN_POSTIT:
{
2008-02-19 12:58:22 +00:00
SwPostItField* pPostIt = (SwPostItField*)aFldMgr.GetCurFld();
BOOL bNew = !(pPostIt && pPostIt->GetTyp()->Which() == RES_POSTITFLD);
CWS-TOOLING: integrate CWS notes7 2008-12-29 19:45:08 +0100 mod r265824 : CWS-TOOLING: rebase CWS notes7 to trunk@265758 (milestone: DEV300:m38) 2008-12-16 14:54:42 +0100 mod r265544 : #i97239# 2008-12-16 14:53:18 +0100 mod r265543 : #i97239# 2008-12-16 13:36:43 +0100 mod r265537 : 96602 2008-12-13 13:02:54 +0100 mba r265452 : warning fixed 2008-12-13 08:20:21 +0100 mod r265448 : search inside notes 2008-12-13 00:11:47 +0100 mod r265447 : search inside notes 2008-12-13 00:11:09 +0100 mod r265446 : search inside notes 2008-12-13 00:10:52 +0100 mod r265445 : search inside notes 2008-12-12 19:39:14 +0100 mod r265439 : search inside notes 2008-12-12 19:02:44 +0100 mod r265438 : search inside notes 2008-12-12 16:42:07 +0100 mba r265431 : #i80135#: search in notes 2008-12-12 16:11:54 +0100 mba r265429 : #i80135#: search in notes 2008-12-12 16:11:02 +0100 mba r265428 : #i80135#: search in notes 2008-12-11 20:24:20 +0100 pb r265358 : fix: #i80135# fixes for aNotesBtn 2008-12-11 20:23:19 +0100 pb r265357 : fix: #i80135# fixes for aNotesBtn 2008-12-11 07:42:17 +0100 pb r265241 : fix: #i80135# CB_NOTES added 2008-12-11 07:40:36 +0100 pb r265240 : fix: #i80135# CB_NOTES added 2008-12-11 07:32:03 +0100 pb r265239 : fix: #i80135# CheckBox aNotesBtn added 2008-12-11 07:24:45 +0100 pb r265238 : fix: #i80135# CheckBox aNotesBtn added 2008-12-10 15:41:31 +0100 mod r265198 : crash using replies 2008-12-10 15:21:23 +0100 mod r265195 : crash using replies 2008-12-10 13:45:14 +0100 mba r265181 : warning fixed 2008-12-10 13:26:45 +0100 mba r265178 : warning fixed 2008-12-10 11:48:23 +0100 mba r265162 : fixed compilation error on Linux 2008-12-03 18:39:07 +0100 mod r264806 : we don't get the Ctrl-Alt-N on mac inside a note, let's do the whole reply thing using the shell, cleaner anyway 2008-12-03 17:13:59 +0100 mod r264802 : search dialog can be started and closed when focus is inside a note 2008-12-03 00:07:08 +0100 mod r264733 : search inside notes 2008-12-02 18:06:08 +0100 mod r264729 : WaE 2008-12-02 15:01:26 +0100 mod r264703 : WaE 2008-12-02 00:20:14 +0100 mod r264644 : WaE 2008-12-01 10:06:14 +0100 mod r264587 : WaE 2008-12-01 01:28:34 +0100 mod r264585 : WaE 2008-11-30 22:51:19 +0100 mod r264584 : search inside notes 2008-11-30 17:03:04 +0100 mod r264583 : search inside notes 2008-11-28 16:30:05 +0100 mod r264560 : #i96602# 2008-11-28 16:14:50 +0100 mod r264559 : test 2008-11-28 16:11:37 +0100 mod r264558 : test 2008-11-17 17:46:10 +0100 mod r263735 : WaE 2008-11-17 17:45:56 +0100 mod r263734 : WaE 2008-11-17 17:37:35 +0100 mod r263733 : revert manual fix for icu 2008-11-17 15:03:55 +0100 mod r263726 : manual fix for icu 2008-11-17 11:17:49 +0100 mod r263707 : manual fix for icu 2008-11-14 15:51:19 +0100 mod r263679 : fix 2008-11-14 14:48:02 +0100 mod r263676 : some more cleanup, redline comments not in the margin for 3.1 2008-11-14 08:37:07 +0100 mod r263664 : end of line missing 2008-11-13 18:36:53 +0100 mod r263660 : WaE 2008-11-13 18:20:04 +0100 mod r263659 : #i94374# 2008-11-13 15:51:28 +0100 mod r263648 : CWS-TOOLING: rebase CWS notes7 to trunk@263288 (milestone: DEV300:m35) 2008-11-13 08:33:19 +0100 mod r263622 : typos 2008-11-02 23:18:19 +0100 mod r263278 : changes notes, replies 2008-11-01 11:48:35 +0100 mod r262873 : replies, comments 2008-11-01 11:44:57 +0100 mod r262872 : notes search button 2008-10-10 14:34:34 +0200 mod r262150 : migration from cvs to svn 2008-10-10 14:33:39 +0200 mod r262149 : migration from cvs to svn
2009-01-02 15:51:45 +00:00
if (bNew || GetView().GetPostItMgr()->IsAnswer())
2000-09-18 16:15:01 +00:00
{
2000-10-06 12:41:54 +00:00
SvtUserOptions aUserOpt;
2008-02-19 12:58:22 +00:00
String sAuthor;
if( !(sAuthor = aUserOpt.GetFullName()).Len())
if( !(sAuthor = aUserOpt.GetID()).Len() )
sAuthor = String( SW_RES( STR_REDLINE_UNKNOWN_AUTHOR ));
if( rSh.HasSelection() )
{
rSh.NormalizePam(true);
rSh.KillPams();
rSh.ClearMark();
}
2008-02-19 12:58:22 +00:00
SwInsertFld_Data aData(TYP_POSTITFLD, 0, sAuthor, aEmptyStr, 0);
aFldMgr.InsertFld(aData);
rSh.Push();
rSh.SwCrsrShell::Left(1, CRSR_SKIP_CHARS, FALSE);
pPostIt = (SwPostItField*)aFldMgr.GetCurFld();
rSh.Pop(FALSE); // Cursorpos restaurieren
CWS-TOOLING: integrate CWS notes7 2008-12-29 19:45:08 +0100 mod r265824 : CWS-TOOLING: rebase CWS notes7 to trunk@265758 (milestone: DEV300:m38) 2008-12-16 14:54:42 +0100 mod r265544 : #i97239# 2008-12-16 14:53:18 +0100 mod r265543 : #i97239# 2008-12-16 13:36:43 +0100 mod r265537 : 96602 2008-12-13 13:02:54 +0100 mba r265452 : warning fixed 2008-12-13 08:20:21 +0100 mod r265448 : search inside notes 2008-12-13 00:11:47 +0100 mod r265447 : search inside notes 2008-12-13 00:11:09 +0100 mod r265446 : search inside notes 2008-12-13 00:10:52 +0100 mod r265445 : search inside notes 2008-12-12 19:39:14 +0100 mod r265439 : search inside notes 2008-12-12 19:02:44 +0100 mod r265438 : search inside notes 2008-12-12 16:42:07 +0100 mba r265431 : #i80135#: search in notes 2008-12-12 16:11:54 +0100 mba r265429 : #i80135#: search in notes 2008-12-12 16:11:02 +0100 mba r265428 : #i80135#: search in notes 2008-12-11 20:24:20 +0100 pb r265358 : fix: #i80135# fixes for aNotesBtn 2008-12-11 20:23:19 +0100 pb r265357 : fix: #i80135# fixes for aNotesBtn 2008-12-11 07:42:17 +0100 pb r265241 : fix: #i80135# CB_NOTES added 2008-12-11 07:40:36 +0100 pb r265240 : fix: #i80135# CB_NOTES added 2008-12-11 07:32:03 +0100 pb r265239 : fix: #i80135# CheckBox aNotesBtn added 2008-12-11 07:24:45 +0100 pb r265238 : fix: #i80135# CheckBox aNotesBtn added 2008-12-10 15:41:31 +0100 mod r265198 : crash using replies 2008-12-10 15:21:23 +0100 mod r265195 : crash using replies 2008-12-10 13:45:14 +0100 mba r265181 : warning fixed 2008-12-10 13:26:45 +0100 mba r265178 : warning fixed 2008-12-10 11:48:23 +0100 mba r265162 : fixed compilation error on Linux 2008-12-03 18:39:07 +0100 mod r264806 : we don't get the Ctrl-Alt-N on mac inside a note, let's do the whole reply thing using the shell, cleaner anyway 2008-12-03 17:13:59 +0100 mod r264802 : search dialog can be started and closed when focus is inside a note 2008-12-03 00:07:08 +0100 mod r264733 : search inside notes 2008-12-02 18:06:08 +0100 mod r264729 : WaE 2008-12-02 15:01:26 +0100 mod r264703 : WaE 2008-12-02 00:20:14 +0100 mod r264644 : WaE 2008-12-01 10:06:14 +0100 mod r264587 : WaE 2008-12-01 01:28:34 +0100 mod r264585 : WaE 2008-11-30 22:51:19 +0100 mod r264584 : search inside notes 2008-11-30 17:03:04 +0100 mod r264583 : search inside notes 2008-11-28 16:30:05 +0100 mod r264560 : #i96602# 2008-11-28 16:14:50 +0100 mod r264559 : test 2008-11-28 16:11:37 +0100 mod r264558 : test 2008-11-17 17:46:10 +0100 mod r263735 : WaE 2008-11-17 17:45:56 +0100 mod r263734 : WaE 2008-11-17 17:37:35 +0100 mod r263733 : revert manual fix for icu 2008-11-17 15:03:55 +0100 mod r263726 : manual fix for icu 2008-11-17 11:17:49 +0100 mod r263707 : manual fix for icu 2008-11-14 15:51:19 +0100 mod r263679 : fix 2008-11-14 14:48:02 +0100 mod r263676 : some more cleanup, redline comments not in the margin for 3.1 2008-11-14 08:37:07 +0100 mod r263664 : end of line missing 2008-11-13 18:36:53 +0100 mod r263660 : WaE 2008-11-13 18:20:04 +0100 mod r263659 : #i94374# 2008-11-13 15:51:28 +0100 mod r263648 : CWS-TOOLING: rebase CWS notes7 to trunk@263288 (milestone: DEV300:m35) 2008-11-13 08:33:19 +0100 mod r263622 : typos 2008-11-02 23:18:19 +0100 mod r263278 : changes notes, replies 2008-11-01 11:48:35 +0100 mod r262873 : replies, comments 2008-11-01 11:44:57 +0100 mod r262872 : notes search button 2008-10-10 14:34:34 +0200 mod r262150 : migration from cvs to svn 2008-10-10 14:33:39 +0200 mod r262149 : migration from cvs to svn
2009-01-02 15:51:45 +00:00
}
2002-07-01 08:05:46 +00:00
2008-02-19 12:58:22 +00:00
if (pPostIt)
2000-09-18 16:15:01 +00:00
{
2008-02-19 12:58:22 +00:00
SwFieldType* pType = rSh.GetDoc()->GetFldType(RES_POSTITFLD, aEmptyStr,false);
SwClientIter aIter( *pType );
SwClient* pFirst = aIter.GoStart();
while( pFirst )
{
2008-02-19 12:58:22 +00:00
SwFmtFld* pSwFmtFld = static_cast<SwFmtFld*>(pFirst);
if ( pSwFmtFld->GetFld() == pPostIt )
{
pSwFmtFld->Broadcast( SwFmtFldHint( 0, SWFMTFLD_FOCUS, &GetView() ) );
2008-02-19 12:58:22 +00:00
break;
}
pFirst = aIter++;
}
2000-09-18 16:15:01 +00:00
}
}
break;
case FN_REDLINE_COMMENT:
{
CWS-TOOLING: integrate CWS notes7 2008-12-29 19:45:08 +0100 mod r265824 : CWS-TOOLING: rebase CWS notes7 to trunk@265758 (milestone: DEV300:m38) 2008-12-16 14:54:42 +0100 mod r265544 : #i97239# 2008-12-16 14:53:18 +0100 mod r265543 : #i97239# 2008-12-16 13:36:43 +0100 mod r265537 : 96602 2008-12-13 13:02:54 +0100 mba r265452 : warning fixed 2008-12-13 08:20:21 +0100 mod r265448 : search inside notes 2008-12-13 00:11:47 +0100 mod r265447 : search inside notes 2008-12-13 00:11:09 +0100 mod r265446 : search inside notes 2008-12-13 00:10:52 +0100 mod r265445 : search inside notes 2008-12-12 19:39:14 +0100 mod r265439 : search inside notes 2008-12-12 19:02:44 +0100 mod r265438 : search inside notes 2008-12-12 16:42:07 +0100 mba r265431 : #i80135#: search in notes 2008-12-12 16:11:54 +0100 mba r265429 : #i80135#: search in notes 2008-12-12 16:11:02 +0100 mba r265428 : #i80135#: search in notes 2008-12-11 20:24:20 +0100 pb r265358 : fix: #i80135# fixes for aNotesBtn 2008-12-11 20:23:19 +0100 pb r265357 : fix: #i80135# fixes for aNotesBtn 2008-12-11 07:42:17 +0100 pb r265241 : fix: #i80135# CB_NOTES added 2008-12-11 07:40:36 +0100 pb r265240 : fix: #i80135# CB_NOTES added 2008-12-11 07:32:03 +0100 pb r265239 : fix: #i80135# CheckBox aNotesBtn added 2008-12-11 07:24:45 +0100 pb r265238 : fix: #i80135# CheckBox aNotesBtn added 2008-12-10 15:41:31 +0100 mod r265198 : crash using replies 2008-12-10 15:21:23 +0100 mod r265195 : crash using replies 2008-12-10 13:45:14 +0100 mba r265181 : warning fixed 2008-12-10 13:26:45 +0100 mba r265178 : warning fixed 2008-12-10 11:48:23 +0100 mba r265162 : fixed compilation error on Linux 2008-12-03 18:39:07 +0100 mod r264806 : we don't get the Ctrl-Alt-N on mac inside a note, let's do the whole reply thing using the shell, cleaner anyway 2008-12-03 17:13:59 +0100 mod r264802 : search dialog can be started and closed when focus is inside a note 2008-12-03 00:07:08 +0100 mod r264733 : search inside notes 2008-12-02 18:06:08 +0100 mod r264729 : WaE 2008-12-02 15:01:26 +0100 mod r264703 : WaE 2008-12-02 00:20:14 +0100 mod r264644 : WaE 2008-12-01 10:06:14 +0100 mod r264587 : WaE 2008-12-01 01:28:34 +0100 mod r264585 : WaE 2008-11-30 22:51:19 +0100 mod r264584 : search inside notes 2008-11-30 17:03:04 +0100 mod r264583 : search inside notes 2008-11-28 16:30:05 +0100 mod r264560 : #i96602# 2008-11-28 16:14:50 +0100 mod r264559 : test 2008-11-28 16:11:37 +0100 mod r264558 : test 2008-11-17 17:46:10 +0100 mod r263735 : WaE 2008-11-17 17:45:56 +0100 mod r263734 : WaE 2008-11-17 17:37:35 +0100 mod r263733 : revert manual fix for icu 2008-11-17 15:03:55 +0100 mod r263726 : manual fix for icu 2008-11-17 11:17:49 +0100 mod r263707 : manual fix for icu 2008-11-14 15:51:19 +0100 mod r263679 : fix 2008-11-14 14:48:02 +0100 mod r263676 : some more cleanup, redline comments not in the margin for 3.1 2008-11-14 08:37:07 +0100 mod r263664 : end of line missing 2008-11-13 18:36:53 +0100 mod r263660 : WaE 2008-11-13 18:20:04 +0100 mod r263659 : #i94374# 2008-11-13 15:51:28 +0100 mod r263648 : CWS-TOOLING: rebase CWS notes7 to trunk@263288 (milestone: DEV300:m35) 2008-11-13 08:33:19 +0100 mod r263622 : typos 2008-11-02 23:18:19 +0100 mod r263278 : changes notes, replies 2008-11-01 11:48:35 +0100 mod r262873 : replies, comments 2008-11-01 11:44:57 +0100 mod r262872 : notes search button 2008-10-10 14:34:34 +0200 mod r262150 : migration from cvs to svn 2008-10-10 14:33:39 +0200 mod r262149 : migration from cvs to svn
2009-01-02 15:51:45 +00:00
/* this code can be used once we want redline comments in the margin, all other stuff can
then be deleted
String sComment;
const SwRedline *pRedline = rSh.GetCurrRedline();
if (pRedline)
{
sComment = pRedline->GetComment();
if ( sComment == String(rtl::OUString::createFromAscii("")) )
GetView().GetDocShell()->Broadcast(SwRedlineHint(pRedline,SWREDLINE_INSERTED));
const_cast<SwRedline*>(pRedline)->Broadcast(SwRedlineHint(pRedline,SWREDLINE_FOCUS,&GetView()));
CWS-TOOLING: integrate CWS notes7 2008-12-29 19:45:08 +0100 mod r265824 : CWS-TOOLING: rebase CWS notes7 to trunk@265758 (milestone: DEV300:m38) 2008-12-16 14:54:42 +0100 mod r265544 : #i97239# 2008-12-16 14:53:18 +0100 mod r265543 : #i97239# 2008-12-16 13:36:43 +0100 mod r265537 : 96602 2008-12-13 13:02:54 +0100 mba r265452 : warning fixed 2008-12-13 08:20:21 +0100 mod r265448 : search inside notes 2008-12-13 00:11:47 +0100 mod r265447 : search inside notes 2008-12-13 00:11:09 +0100 mod r265446 : search inside notes 2008-12-13 00:10:52 +0100 mod r265445 : search inside notes 2008-12-12 19:39:14 +0100 mod r265439 : search inside notes 2008-12-12 19:02:44 +0100 mod r265438 : search inside notes 2008-12-12 16:42:07 +0100 mba r265431 : #i80135#: search in notes 2008-12-12 16:11:54 +0100 mba r265429 : #i80135#: search in notes 2008-12-12 16:11:02 +0100 mba r265428 : #i80135#: search in notes 2008-12-11 20:24:20 +0100 pb r265358 : fix: #i80135# fixes for aNotesBtn 2008-12-11 20:23:19 +0100 pb r265357 : fix: #i80135# fixes for aNotesBtn 2008-12-11 07:42:17 +0100 pb r265241 : fix: #i80135# CB_NOTES added 2008-12-11 07:40:36 +0100 pb r265240 : fix: #i80135# CB_NOTES added 2008-12-11 07:32:03 +0100 pb r265239 : fix: #i80135# CheckBox aNotesBtn added 2008-12-11 07:24:45 +0100 pb r265238 : fix: #i80135# CheckBox aNotesBtn added 2008-12-10 15:41:31 +0100 mod r265198 : crash using replies 2008-12-10 15:21:23 +0100 mod r265195 : crash using replies 2008-12-10 13:45:14 +0100 mba r265181 : warning fixed 2008-12-10 13:26:45 +0100 mba r265178 : warning fixed 2008-12-10 11:48:23 +0100 mba r265162 : fixed compilation error on Linux 2008-12-03 18:39:07 +0100 mod r264806 : we don't get the Ctrl-Alt-N on mac inside a note, let's do the whole reply thing using the shell, cleaner anyway 2008-12-03 17:13:59 +0100 mod r264802 : search dialog can be started and closed when focus is inside a note 2008-12-03 00:07:08 +0100 mod r264733 : search inside notes 2008-12-02 18:06:08 +0100 mod r264729 : WaE 2008-12-02 15:01:26 +0100 mod r264703 : WaE 2008-12-02 00:20:14 +0100 mod r264644 : WaE 2008-12-01 10:06:14 +0100 mod r264587 : WaE 2008-12-01 01:28:34 +0100 mod r264585 : WaE 2008-11-30 22:51:19 +0100 mod r264584 : search inside notes 2008-11-30 17:03:04 +0100 mod r264583 : search inside notes 2008-11-28 16:30:05 +0100 mod r264560 : #i96602# 2008-11-28 16:14:50 +0100 mod r264559 : test 2008-11-28 16:11:37 +0100 mod r264558 : test 2008-11-17 17:46:10 +0100 mod r263735 : WaE 2008-11-17 17:45:56 +0100 mod r263734 : WaE 2008-11-17 17:37:35 +0100 mod r263733 : revert manual fix for icu 2008-11-17 15:03:55 +0100 mod r263726 : manual fix for icu 2008-11-17 11:17:49 +0100 mod r263707 : manual fix for icu 2008-11-14 15:51:19 +0100 mod r263679 : fix 2008-11-14 14:48:02 +0100 mod r263676 : some more cleanup, redline comments not in the margin for 3.1 2008-11-14 08:37:07 +0100 mod r263664 : end of line missing 2008-11-13 18:36:53 +0100 mod r263660 : WaE 2008-11-13 18:20:04 +0100 mod r263659 : #i94374# 2008-11-13 15:51:28 +0100 mod r263648 : CWS-TOOLING: rebase CWS notes7 to trunk@263288 (milestone: DEV300:m35) 2008-11-13 08:33:19 +0100 mod r263622 : typos 2008-11-02 23:18:19 +0100 mod r263278 : changes notes, replies 2008-11-01 11:48:35 +0100 mod r262873 : replies, comments 2008-11-01 11:44:57 +0100 mod r262872 : notes search button 2008-10-10 14:34:34 +0200 mod r262150 : migration from cvs to svn 2008-10-10 14:33:39 +0200 mod r262149 : migration from cvs to svn
2009-01-02 15:51:45 +00:00
}
*/
2000-09-18 16:15:01 +00:00
String sComment;
const SwRedline *pRedline = rSh.GetCurrRedline();
if (pRedline)
{
sComment = pRedline->GetComment();
BOOL bTravel = FALSE;
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
DBG_ASSERT(pFact, "Dialogdiet fail!");
::DialogGetRanges fnGetRange = pFact->GetDialogGetRangesFunc( RID_SVXDLG_POSTIT );
DBG_ASSERT(fnGetRange, "Dialogdiet fail! GetRanges()");
SfxItemSet aSet(GetPool(), fnGetRange());
2000-09-18 16:15:01 +00:00
aSet.Put(SvxPostItTextItem(sComment.ConvertLineEnd(), SID_ATTR_POSTIT_TEXT));
aSet.Put(SvxPostItAuthorItem(pRedline->GetAuthorString(), SID_ATTR_POSTIT_AUTHOR));
aSet.Put( SvxPostItDateItem( GetAppLangDateTimeString(
pRedline->GetRedlineData().GetTimeStamp() ),
SID_ATTR_POSTIT_DATE ));
2000-09-18 16:15:01 +00:00
// Traveling nur bei mehr als einem Feld
rSh.StartAction();
rSh.Push();
const SwRedline *pActRed = rSh.SelPrevRedline();
if (pActRed == pRedline)
{ // Neuer Cursor steht am Anfang des Current Redlines
rSh.Pop(); // Alten Cursor wegwerfen
rSh.Push();
pActRed = rSh.SelPrevRedline();
}
BOOL bPrev = pActRed != 0;
rSh.Pop(FALSE);
rSh.EndAction();
rSh.ClearMark();
rSh.SelNextRedline(); // Aktueller Redline wird selektiert
rSh.StartAction();
rSh.Push();
pActRed = rSh.SelNextRedline();
BOOL bNext = pActRed != 0;
rSh.Pop(FALSE); // Cursorpos restaurieren
if( rSh.IsCrsrPtAtEnd() )
rSh.SwapPam();
rSh.EndAction();
bTravel |= bNext|bPrev;
SvxAbstractDialogFactory* pFact2 = SvxAbstractDialogFactory::Create();
DBG_ASSERT(pFact2, "Dialogdiet fail!");
AbstractSvxPostItDialog* pDlg = pFact2->CreateSvxPostItDialog( pMDI, aSet, RID_SVXDLG_POSTIT, bTravel, TRUE );
DBG_ASSERT(pDlg, "Dialogdiet fail!");
2000-09-18 16:15:01 +00:00
pDlg->HideAuthor();
String sTitle(SW_RES(STR_REDLINE_COMMENT));
::lcl_AppendRedlineStr( sTitle, pRedline->GetType() );
pDlg->SetText(sTitle);
if (bTravel)
{
pDlg->EnableTravel(bNext, bPrev);
pDlg->SetPrevHdl(LINK(this, SwTextShell, RedlinePrevHdl));
pDlg->SetNextHdl(LINK(this, SwTextShell, RedlineNextHdl));
}
rSh.SetCareWin(pDlg->GetWindow());
2000-09-18 16:15:01 +00:00
bNoInterrupt = TRUE;
if ( pDlg->Execute() == RET_OK )
{
const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
String sMsg(((const SvxPostItTextItem&)pOutSet->Get(SID_ATTR_POSTIT_TEXT)).GetValue());
// Kommentar einfuegen bzw aendern
rSh.SetRedlineComment(sMsg);
}
delete pDlg;
rSh.SetCareWin(NULL);
bNoInterrupt = FALSE;
rSh.ClearMark();
GetView().AttrChangedNotify(GetShellPtr());
}
}
break;
case FN_JAVAEDIT:
{
2002-07-01 08:05:46 +00:00
String aType, aText;
BOOL bIsUrl=FALSE;
BOOL bNew=FALSE, bUpdate=FALSE;
SwFldMgr* pMgr = new SwFldMgr;
if ( pItem )
{
aText = ((SfxStringItem*)pItem)->GetValue();
SFX_REQUEST_ARG( rReq, pType, SfxStringItem, FN_PARAM_2 , sal_False );
SFX_REQUEST_ARG( rReq, pIsUrl, SfxBoolItem, FN_PARAM_1 , sal_False );
if ( pType )
aType = pType->GetValue();
if ( pIsUrl )
bIsUrl = pIsUrl->GetValue();
SwScriptField* pFld = (SwScriptField*)pMgr->GetCurFld();
2002-07-08 15:14:50 +00:00
bNew = !pFld || !(pFld->GetTyp()->Which() == RES_SCRIPTFLD);
bUpdate = pFld && ( bIsUrl != pFld->GetFormat() || pFld->GetPar2() != aType || pFld->GetPar1() != aText );
2002-07-01 08:05:46 +00:00
}
else
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
DBG_ASSERT(pFact, "Dialogdiet fail!");
AbstractJavaEditDialog* pDlg = pFact->CreateJavaEditDialog( DLG_JAVAEDIT,
pMDI, &rSh);
DBG_ASSERT(pDlg, "Dialogdiet fail!");
2002-07-01 08:05:46 +00:00
if ( pDlg->Execute() )
{
aType = pDlg->GetType();
aText = pDlg->GetText();
bIsUrl = pDlg->IsUrl();
bNew = pDlg->IsNew();
bUpdate = pDlg->IsUpdate();
rReq.AppendItem( SfxStringItem( FN_JAVAEDIT, aText ) );
rReq.AppendItem( SfxStringItem( FN_PARAM_2, aType ) );
rReq.AppendItem( SfxBoolItem( FN_PARAM_1, bIsUrl ) );
}
delete pDlg;
}
if( bNew )
{
SwInsertFld_Data aData(TYP_SCRIPTFLD, 0, aType, aText, bIsUrl);
pMgr->InsertFld(aData);
rReq.Done();
}
else if( bUpdate )
{
pMgr->UpdateCurFld( bIsUrl, aType, aText );
rSh.SetUndoNoResetModified();
rReq.Done();
}
else
rReq.Ignore();
2000-09-18 16:15:01 +00:00
}
break;
case FN_INSERT_FLD_DATE :
nInsertType = TYP_DATEFLD;
bIsText = FALSE;
2000-09-18 16:15:01 +00:00
goto FIELD_INSERT;
case FN_INSERT_FLD_TIME :
nInsertType = TYP_TIMEFLD;
bIsText = FALSE;
2000-09-18 16:15:01 +00:00
goto FIELD_INSERT;
case FN_INSERT_FLD_PGNUMBER:
nInsertType = TYP_PAGENUMBERFLD;
nInsertFormat = SVX_NUM_PAGEDESC; // wie Seitenvorlage
bIsText = FALSE;
2000-09-18 16:15:01 +00:00
goto FIELD_INSERT;
case FN_INSERT_FLD_PGCOUNT :
nInsertType = TYP_DOCSTATFLD;
nInsertSubType = 0;
bIsText = FALSE;
2000-09-18 16:15:01 +00:00
nInsertFormat = SVX_NUM_PAGEDESC;
goto FIELD_INSERT;
case FN_INSERT_FLD_TOPIC :
nInsertType = TYP_DOCINFOFLD;
nInsertSubType = DI_THEMA;
goto FIELD_INSERT;
case FN_INSERT_FLD_TITLE :
nInsertType = TYP_DOCINFOFLD;
nInsertSubType = DI_TITEL;
goto FIELD_INSERT;
case FN_INSERT_FLD_AUTHOR :
nInsertType = TYP_DOCINFOFLD;
nInsertSubType = DI_CREATE|DI_SUB_AUTHOR;
2000-09-18 16:15:01 +00:00
FIELD_INSERT:
{
//format conversion should only be done for number formatter formats
if(!nInsertFormat)
nInsertFormat = aFldMgr.GetDefaultFormat(nInsertType, bIsText, rSh.GetNumberFormatter());
SwInsertFld_Data aData(nInsertType, nInsertSubType,
2000-09-18 16:15:01 +00:00
aEmptyStr, aEmptyStr, nInsertFormat);
aFldMgr.InsertFld(aData);
rReq.Done();
}
2000-09-18 16:15:01 +00:00
break;
default:
ASSERT(FALSE, falscher Dispatcher);
return;
}
}
}
void SwTextShell::StateField( SfxItemSet &rSet )
{
SwWrtShell& rSh = GetShell();
SfxWhichIter aIter( rSet );
const SwField* pField = 0;
int bGetField = FALSE;
USHORT nWhich = aIter.FirstWhich();
while (nWhich)
{
switch (nWhich)
{
case FN_DELETE_NOTE:
case FN_DELETE_NOTE_AUTHOR:
case FN_DELETE_ALL_NOTES:
case FN_HIDE_NOTE:
case FN_HIDE_NOTE_AUTHOR:
case FN_HIDE_ALL_NOTES:
{
SwPostItMgr* pPostItMgr = GetView().GetPostItMgr();
if ( !pPostItMgr )
rSet.InvalidateItem( nWhich );
else if ( !pPostItMgr->GetActivePostIt() )
{
rSet.InvalidateItem( FN_DELETE_NOTE );
rSet.InvalidateItem( FN_HIDE_NOTE );
}
}
break;
2000-09-18 16:15:01 +00:00
case FN_EDIT_FIELD:
{
/* #108536# Fields can be selected, too now. Removed
2000-09-18 16:15:01 +00:00
if( rSh.HasSelection() )
rSet.DisableItem(nWhich);
else ...
*/
2000-09-18 16:15:01 +00:00
if( !bGetField )
{
pField = rSh.GetCurFld();
bGetField = TRUE;
2000-09-18 16:15:01 +00:00
}
USHORT nTempWhich = pField ? pField->GetTyp()->Which() : USHRT_MAX;
if( USHRT_MAX == nTempWhich ||
RES_POSTITFLD == nTempWhich ||
RES_SCRIPTFLD == nTempWhich ||
RES_AUTHORITY == nTempWhich )
rSet.DisableItem( nWhich );
else if( RES_DDEFLD == nTempWhich &&
!((SwDDEFieldType*)pField->GetTyp())->GetBaseLink().IsVisible())
{
// nested links cannot be edited
rSet.DisableItem( nWhich );
}
2000-09-18 16:15:01 +00:00
}
break;
case FN_EXECUTE_MACROFIELD:
{
if(!bGetField)
{
pField = rSh.GetCurFld();
bGetField = TRUE;
}
if(!pField || pField->GetTyp()->Which() != RES_MACROFLD)
rSet.DisableItem(nWhich);
}
break;
case FN_INSERT_FIELD:
{
SfxViewFrame* pVFrame = GetView().GetViewFrame();
//#i5788# prevent closing of the field dialog while a modal dialog ( Input field dialog ) is active
if(!pVFrame->IsInModalMode() &&
pVFrame->KnowsChildWindow(FN_INSERT_FIELD) && !pVFrame->HasChildWindow(FN_INSERT_FIELD_DATA_ONLY) )
2000-09-18 16:15:01 +00:00
rSet.Put(SfxBoolItem( FN_INSERT_FIELD, pVFrame->HasChildWindow(nWhich)));
else
rSet.DisableItem(FN_INSERT_FIELD);
}
break;
case FN_INSERT_REF_FIELD:
{
SfxViewFrame* pVFrame = GetView().GetViewFrame();
if (!pVFrame->KnowsChildWindow(FN_INSERT_FIELD))
rSet.DisableItem(FN_INSERT_REF_FIELD);
}
break;
case FN_INSERT_FIELD_CTRL:
rSet.Put(SfxBoolItem( nWhich, GetView().GetViewFrame()->HasChildWindow(FN_INSERT_FIELD)));
break;
case FN_REDLINE_COMMENT:
if (!rSh.GetCurrRedline())
rSet.DisableItem(nWhich);
break;
case FN_POSTIT :
case FN_JAVAEDIT :
BOOL bCurField = FALSE;
pField = rSh.GetCurFld();
2000-09-18 16:15:01 +00:00
if(nWhich == FN_POSTIT)
bCurField = pField && pField->GetTyp()->Which() == RES_POSTITFLD;
else
bCurField = pField && pField->GetTyp()->Which() == RES_SCRIPTFLD;
if(!bCurField && rSh.IsReadOnlyAvailable() && rSh.HasReadonlySel() )
rSet.DisableItem(nWhich);
break;
}
nWhich = aIter.NextWhich();
}
}
/*---------------------------------------------------------------------------
Beschreibung:
----------------------------------------------------------------------------*/
void SwTextShell::InsertHyperlink(const SvxHyperlinkItem& rHlnkItem)
{
const String& rName = rHlnkItem.GetName();
const String& rURL = rHlnkItem.GetURL();
const String& rTarget = rHlnkItem.GetTargetFrame();
USHORT nType = (USHORT)rHlnkItem.GetInsertMode();
2000-11-14 10:38:29 +00:00
nType &= ~HLINK_HTMLMODE;
2000-09-18 16:15:01 +00:00
const SvxMacroTableDtor* pMacroTbl = rHlnkItem.GetMacroTbl();
SwWrtShell& rSh = GetShell();
if( rSh.GetSelectionType() & nsSelectionType::SEL_TXT )
2000-09-18 16:15:01 +00:00
{
rSh.StartAction();
SfxItemSet aSet(GetPool(), RES_TXTATR_INETFMT, RES_TXTATR_INETFMT);
rSh.GetCurAttr( aSet );
const SfxPoolItem* pItem;
if(SFX_ITEM_SET == aSet.GetItemState(RES_TXTATR_INETFMT, FALSE, &pItem))
{
// Links selektieren
rSh.SwCrsrShell::SelectTxtAttr(RES_TXTATR_INETFMT, FALSE);
}
2000-09-18 16:15:01 +00:00
switch (nType)
{
case HLINK_DEFAULT:
case HLINK_FIELD:
{
SwFmtINetFmt aINetFmt( rURL, rTarget );
aINetFmt.SetName(rHlnkItem.GetIntName());
if(pMacroTbl)
{
SvxMacro *pMacro = pMacroTbl->Get( SFX_EVENT_MOUSEOVER_OBJECT );
if( pMacro )
aINetFmt.SetMacro(SFX_EVENT_MOUSEOVER_OBJECT, *pMacro);
pMacro = pMacroTbl->Get( SFX_EVENT_MOUSECLICK_OBJECT );
if( pMacro )
aINetFmt.SetMacro(SFX_EVENT_MOUSECLICK_OBJECT, *pMacro);
pMacro = pMacroTbl->Get( SFX_EVENT_MOUSEOUT_OBJECT );
if( pMacro )
aINetFmt.SetMacro(SFX_EVENT_MOUSEOUT_OBJECT, *pMacro);
}
rSh.SttSelect();
2000-09-18 16:15:01 +00:00
rSh.InsertURL( aINetFmt, rName, TRUE );
rSh.EndSelect();
2000-09-18 16:15:01 +00:00
}
break;
case HLINK_BUTTON:
BOOL bSel = rSh.HasSelection();
if(bSel)
rSh.DelRight();
2000-09-18 16:15:01 +00:00
InsertURLButton( rURL, rTarget, rName );
rSh.EnterStdMode();
break;
}
rSh.EndAction();
2000-09-18 16:15:01 +00:00
}
}
IMPL_LINK( SwTextShell, RedlineNextHdl, AbstractSvxPostItDialog *, pBtn )
2000-09-18 16:15:01 +00:00
{
SwWrtShell* pSh = GetShellPtr();
AbstractSvxPostItDialog *pDlg = (AbstractSvxPostItDialog*)pBtn;
2000-09-18 16:15:01 +00:00
// Kommentar einfuegen bzw aendern
pSh->SetRedlineComment(pDlg->GetNote());
const SwRedline *pRedline = pSh->GetCurrRedline();
String sComment;
if (pRedline)
{
// Traveling nur bei mehr als einem Feld
if( !pSh->IsCrsrPtAtEnd() )
pSh->SwapPam(); // Cursor hinter den Redline stellen
pSh->Push();
const SwRedline *pActRed = pSh->SelNextRedline();
pSh->Pop(pActRed != 0);
BOOL bEnable = FALSE;
if (pActRed)
{
pSh->StartAction();
pSh->Push();
bEnable = pSh->SelNextRedline() != 0;
pSh->Pop(FALSE);
pSh->EndAction();
}
pDlg->EnableTravel(bEnable, TRUE);
if( pSh->IsCrsrPtAtEnd() )
pSh->SwapPam();
pRedline = pSh->GetCurrRedline();
sComment = pRedline->GetComment();
pDlg->SetNote( sComment.ConvertLineEnd() );
pDlg->ShowLastAuthor( pRedline->GetAuthorString(),
GetAppLangDateTimeString(
pRedline->GetRedlineData().GetTimeStamp() ));
2000-09-18 16:15:01 +00:00
String sTitle(SW_RES(STR_REDLINE_COMMENT));
::lcl_AppendRedlineStr( sTitle, pRedline->GetType() );
pDlg->SetText(sTitle);
}
return 0;
}
IMPL_LINK( SwTextShell, RedlinePrevHdl, AbstractSvxPostItDialog *, pBtn )
2000-09-18 16:15:01 +00:00
{
SwWrtShell* pSh = GetShellPtr();
AbstractSvxPostItDialog *pDlg = (AbstractSvxPostItDialog*)pBtn;
2000-09-18 16:15:01 +00:00
// Kommentar einfuegen bzw aendern
pSh->SetRedlineComment(pDlg->GetNote());
const SwRedline *pRedline = pSh->GetCurrRedline();
String sComment;
if (pRedline)
{
// Traveling nur bei mehr als einem Feld
pSh->Push();
const SwRedline *pActRed = pSh->SelPrevRedline();
pSh->Pop(pActRed != 0);
BOOL bEnable = FALSE;
if (pActRed)
{
pSh->StartAction();
pSh->Push();
bEnable = pSh->SelPrevRedline() != 0;
pSh->Pop(FALSE);
pSh->EndAction();
}
pDlg->EnableTravel(TRUE, bEnable);
pRedline = pSh->GetCurrRedline();
sComment = pRedline->GetComment();
pDlg->SetNote(sComment.ConvertLineEnd());
pDlg->ShowLastAuthor(pRedline->GetAuthorString(),
GetAppLangDateTimeString(
pRedline->GetRedlineData().GetTimeStamp() ));
2000-09-18 16:15:01 +00:00
String sTitle(SW_RES(STR_REDLINE_COMMENT));
::lcl_AppendRedlineStr( sTitle, pRedline->GetType() );
pDlg->SetText(sTitle);
}
return 0;
}