Files
libreoffice/sw/source/ui/app/apphdl.cxx

892 lines
29 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
re-base on ALv2 code. Includes: Patches contributed by Oliver-Rainer Wittmann sw34bf06: #i117783# - Writer's implementation of XPagePrintable - apply print settings to new printing routines http://svn.apache.org/viewvc?view=revision&revision=1172115 sw34bf06: #o12311627# use <rtl_random> methods to create unique ids for list styles and list ids http://svn.apache.org/viewvc?view=revision&revision=1172112 sw34bf06 #i114725#,#i115828# - method <SwDoc::ClearDoc()> - clear list structures completely http://svn.apache.org/viewvc?view=revision&revision=1172122 i#118572 - remove ui string and help content regarding usage of Java Mail in Writer's Mail Merge as Java Mail is not used. http://svn.apache.org/viewvc?view=revision&revision=1197035 Patches contributed by Mathias Bauer cws mba34issues01: #i117718#: provide filter name in case storage of medium does not allow to detect one http://svn.apache.org/viewvc?view=revision&revision=1172350 cws mba34issues01: #i117721#: directly provide parameters retrieved from SfxMedium http://svn.apache.org/viewvc?view=revision&revision=1172353 gnumake4 work variously http://svn.apache.org/viewvc?view=revision&revision=1394707 http://svn.apache.org/viewvc?view=revision&revision=1394326 http://svn.apache.org/viewvc?view=revision&revision=1396797 http://svn.apache.org/viewvc?view=revision&revision=1397315 cws mba34issues01: #i117723#: convert assertion into trace http://svn.apache.org/viewvc?view=revision&revision=1172355 cws mba34issues01: #i117699#: keep layout alive until swdoc dies http://svn.apache.org/viewvc?view=revision&revision=1172362 cws mba34issues01: #i117943#: missing color attributes in RTF clipboard http://svn.apache.org/viewvc?view=revision&revision=1172363 Patch contributed by Henning Brinkmann imported patch i#103878 http://svn.apache.org/viewvc?view=revision&revision=1172109 Patches contributed by Michael Stahl sw34bf06: #i117955#: WW8 export: disable storing of section breaks in endnotes http://svn.apache.org/viewvc?view=revision&revision=1172119 Patch contributed by imacat Fixed the Asian language work count. http://svn.apache.org/viewvc?view=revision&revision=1241345 Patch contributed by Pedro Giffuni i#20878 - Add comment with BZ issue for reference. http://svn.apache.org/viewvc?view=revision&revision=1244517 Patch contributed by Andre Fischer Do not add targets for junit tests when junit is disabled. http://svn.apache.org/viewvc?view=revision&revision=1241508 add writerperfect dependency.
2011-03-31 10:05:04 +02:00
/*
* 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 .
*/
2000-10-06 12:41:54 +00:00
#include <hintids.hxx>
2000-09-18 16:15:01 +00:00
#include <osl/diagnose.h>
#include <tools/link.hxx>
#include <svl/urihelper.hxx>
#include <unotools/pathoptions.hxx>
#include <svtools/accessibilityoptions.hxx>
2000-10-06 12:41:54 +00:00
#include <sfx2/dispatch.hxx>
#include <sfx2/event.hxx>
INTEGRATION: CWS swmailmerge (1.37.76); FILE MERGED 2004/09/15 14:29:22 os 1.37.76.21: RESYNC: (1.39-1.40); FILE MERGED 2004/09/10 14:23:32 os 1.37.76.20: #i25107# source document has to be set at the config item when new document has been loaded 2004/09/08 13:57:16 os 1.37.76.19: #i25107# switch off address/greeting also if called from the database beamer 2004/09/08 10:59:56 os 1.37.76.18: #i25107# source view should only be updated after return from editing 2004/09/03 13:10:03 os 1.37.76.17: #i25107# update source view after reload 2004/09/03 08:16:43 os 1.37.76.16: #i25107# last fixes 2004/08/20 14:16:47 os 1.37.76.15: #i25107# close target view on 'step back' and re-show source view 2004/08/13 14:48:49 os 1.37.76.14: RESYNC: (1.38-1.39); FILE MERGED 2004/08/10 08:01:07 os 1.37.76.13: #i25107# go-anywhere allowed in mail merge dialog 2004/07/06 11:25:34 os 1.37.76.12: #i25107# weekly check-in 2004/07/02 09:15:05 os 1.37.76.11: #i25107# weekly check-in 2004/06/25 13:39:08 os 1.37.76.10: #i25107# weekly check-in 2004/06/23 14:06:43 os 1.37.76.9: #i25107# weekly check-in 2004/06/17 07:02:23 os 1.37.76.8: #i25107# weekly check-in 2004/06/08 06:53:18 os 1.37.76.7: #i25107# restart of mail merge wizard corrected 2004/06/04 10:26:35 os 1.37.76.6: #i25107# mail merge dialogs move to swcui library 2004/05/28 21:36:37 os 1.37.76.5: RESYNC: (1.37-1.38); FILE MERGED 2004/05/28 12:22:58 os 1.37.76.4: #i25107# ChildWindow to return to the mail merge wizard 2004/05/07 09:41:20 os 1.37.76.3: #i25107# Mail merge mailer configuration page 2004/04/30 14:32:15 os 1.37.76.2: #i25107# intermediate check-in 2004/04/08 08:37:43 os 1.37.76.1: #i25107# new mail merge wizard
2004-09-20 12:06:54 +00:00
#include <sfx2/objitem.hxx>
#include <svx/dataaccessdescriptor.hxx>
2009-12-10 23:06:35 +01:00
#include <svl/srchitem.hxx>
#include <svtools/colorcfg.hxx>
#include <svl/eitem.hxx>
#include <svl/whiter.hxx>
#include <svl/isethint.hxx>
2000-09-18 16:15:01 +00:00
#include <sfx2/request.hxx>
INTEGRATION: CWS swmailmerge (1.37.76); FILE MERGED 2004/09/15 14:29:22 os 1.37.76.21: RESYNC: (1.39-1.40); FILE MERGED 2004/09/10 14:23:32 os 1.37.76.20: #i25107# source document has to be set at the config item when new document has been loaded 2004/09/08 13:57:16 os 1.37.76.19: #i25107# switch off address/greeting also if called from the database beamer 2004/09/08 10:59:56 os 1.37.76.18: #i25107# source view should only be updated after return from editing 2004/09/03 13:10:03 os 1.37.76.17: #i25107# update source view after reload 2004/09/03 08:16:43 os 1.37.76.16: #i25107# last fixes 2004/08/20 14:16:47 os 1.37.76.15: #i25107# close target view on 'step back' and re-show source view 2004/08/13 14:48:49 os 1.37.76.14: RESYNC: (1.38-1.39); FILE MERGED 2004/08/10 08:01:07 os 1.37.76.13: #i25107# go-anywhere allowed in mail merge dialog 2004/07/06 11:25:34 os 1.37.76.12: #i25107# weekly check-in 2004/07/02 09:15:05 os 1.37.76.11: #i25107# weekly check-in 2004/06/25 13:39:08 os 1.37.76.10: #i25107# weekly check-in 2004/06/23 14:06:43 os 1.37.76.9: #i25107# weekly check-in 2004/06/17 07:02:23 os 1.37.76.8: #i25107# weekly check-in 2004/06/08 06:53:18 os 1.37.76.7: #i25107# restart of mail merge wizard corrected 2004/06/04 10:26:35 os 1.37.76.6: #i25107# mail merge dialogs move to swcui library 2004/05/28 21:36:37 os 1.37.76.5: RESYNC: (1.37-1.38); FILE MERGED 2004/05/28 12:22:58 os 1.37.76.4: #i25107# ChildWindow to return to the mail merge wizard 2004/05/07 09:41:20 os 1.37.76.3: #i25107# Mail merge mailer configuration page 2004/04/30 14:32:15 os 1.37.76.2: #i25107# intermediate check-in 2004/04/08 08:37:43 os 1.37.76.1: #i25107# new mail merge wizard
2004-09-20 12:06:54 +00:00
#include <sfx2/fcontnr.hxx>
#include <svl/stritem.hxx>
#include <svl/ctloptions.hxx>
#include <unotools/useroptions.hxx>
2000-09-18 16:15:01 +00:00
#include <vcl/msgbox.hxx>
#include <vcl/wrkwin.hxx>
#include <svx/insctrl.hxx>
#include <svx/selctrl.hxx>
#include <com/sun/star/document/UpdateDocMode.hpp>
#include <sfx2/docfile.hxx>
#include <svx/xmlsecctrl.hxx>
2000-09-18 16:15:01 +00:00
#include <navicfg.hxx>
#include <sfx2/objface.hxx>
#include <sfx2/app.hxx>
2000-10-06 12:41:54 +00:00
#include <view.hxx>
2002-04-12 09:39:11 +00:00
#include <pview.hxx>
#include <srcview.hxx>
2000-10-06 12:41:54 +00:00
#include <wrtsh.hxx>
#include <docsh.hxx>
#include <cmdid.h>
2000-10-06 12:41:54 +00:00
#include <initui.hxx>
#include <uitool.hxx>
#include <swmodule.hxx>
#include <wdocsh.hxx>
#include <wview.hxx>
#include <usrpref.hxx>
#include <gloslst.hxx>
#include <glosdoc.hxx>
2000-10-06 12:41:54 +00:00
#include <doc.hxx>
#include <IDocumentUndoRedo.hxx>
2000-10-06 12:41:54 +00:00
#include <cfgitems.hxx>
#include <prtopt.hxx>
#include <modcfg.hxx>
#include <globals.h>
2000-10-06 12:41:54 +00:00
#include <app.hrc>
2000-09-18 16:15:01 +00:00
#include <fontcfg.hxx>
2000-10-06 12:41:54 +00:00
#include <barcfg.hxx>
2000-09-18 16:15:01 +00:00
#include <uinums.hxx>
#include <dbconfig.hxx>
INTEGRATION: CWS swmailmerge (1.37.76); FILE MERGED 2004/09/15 14:29:22 os 1.37.76.21: RESYNC: (1.39-1.40); FILE MERGED 2004/09/10 14:23:32 os 1.37.76.20: #i25107# source document has to be set at the config item when new document has been loaded 2004/09/08 13:57:16 os 1.37.76.19: #i25107# switch off address/greeting also if called from the database beamer 2004/09/08 10:59:56 os 1.37.76.18: #i25107# source view should only be updated after return from editing 2004/09/03 13:10:03 os 1.37.76.17: #i25107# update source view after reload 2004/09/03 08:16:43 os 1.37.76.16: #i25107# last fixes 2004/08/20 14:16:47 os 1.37.76.15: #i25107# close target view on 'step back' and re-show source view 2004/08/13 14:48:49 os 1.37.76.14: RESYNC: (1.38-1.39); FILE MERGED 2004/08/10 08:01:07 os 1.37.76.13: #i25107# go-anywhere allowed in mail merge dialog 2004/07/06 11:25:34 os 1.37.76.12: #i25107# weekly check-in 2004/07/02 09:15:05 os 1.37.76.11: #i25107# weekly check-in 2004/06/25 13:39:08 os 1.37.76.10: #i25107# weekly check-in 2004/06/23 14:06:43 os 1.37.76.9: #i25107# weekly check-in 2004/06/17 07:02:23 os 1.37.76.8: #i25107# weekly check-in 2004/06/08 06:53:18 os 1.37.76.7: #i25107# restart of mail merge wizard corrected 2004/06/04 10:26:35 os 1.37.76.6: #i25107# mail merge dialogs move to swcui library 2004/05/28 21:36:37 os 1.37.76.5: RESYNC: (1.37-1.38); FILE MERGED 2004/05/28 12:22:58 os 1.37.76.4: #i25107# ChildWindow to return to the mail merge wizard 2004/05/07 09:41:20 os 1.37.76.3: #i25107# Mail merge mailer configuration page 2004/04/30 14:32:15 os 1.37.76.2: #i25107# intermediate check-in 2004/04/08 08:37:43 os 1.37.76.1: #i25107# new mail merge wizard
2004-09-20 12:06:54 +00:00
#include <mmconfigitem.hxx>
#include <mailmergechildwindow.hxx>
2000-11-19 10:41:10 +00:00
#include <linguistic/lngprops.hxx>
#include <editeng/unolingu.hxx>
2000-09-18 16:15:01 +00:00
#include <com/sun/star/beans/XMultiPropertySet.hpp>
#include <com/sun/star/beans/XFastPropertySet.hpp>
#include <com/sun/star/beans/XPropertyState.hpp>
#include <com/sun/star/beans/XPropertyStateChangeListener.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/beans/XPropertyAccess.hpp>
#include <com/sun/star/beans/XPropertyContainer.hpp>
INTEGRATION: CWS swmailmerge (1.37.76); FILE MERGED 2004/09/15 14:29:22 os 1.37.76.21: RESYNC: (1.39-1.40); FILE MERGED 2004/09/10 14:23:32 os 1.37.76.20: #i25107# source document has to be set at the config item when new document has been loaded 2004/09/08 13:57:16 os 1.37.76.19: #i25107# switch off address/greeting also if called from the database beamer 2004/09/08 10:59:56 os 1.37.76.18: #i25107# source view should only be updated after return from editing 2004/09/03 13:10:03 os 1.37.76.17: #i25107# update source view after reload 2004/09/03 08:16:43 os 1.37.76.16: #i25107# last fixes 2004/08/20 14:16:47 os 1.37.76.15: #i25107# close target view on 'step back' and re-show source view 2004/08/13 14:48:49 os 1.37.76.14: RESYNC: (1.38-1.39); FILE MERGED 2004/08/10 08:01:07 os 1.37.76.13: #i25107# go-anywhere allowed in mail merge dialog 2004/07/06 11:25:34 os 1.37.76.12: #i25107# weekly check-in 2004/07/02 09:15:05 os 1.37.76.11: #i25107# weekly check-in 2004/06/25 13:39:08 os 1.37.76.10: #i25107# weekly check-in 2004/06/23 14:06:43 os 1.37.76.9: #i25107# weekly check-in 2004/06/17 07:02:23 os 1.37.76.8: #i25107# weekly check-in 2004/06/08 06:53:18 os 1.37.76.7: #i25107# restart of mail merge wizard corrected 2004/06/04 10:26:35 os 1.37.76.6: #i25107# mail merge dialogs move to swcui library 2004/05/28 21:36:37 os 1.37.76.5: RESYNC: (1.37-1.38); FILE MERGED 2004/05/28 12:22:58 os 1.37.76.4: #i25107# ChildWindow to return to the mail merge wizard 2004/05/07 09:41:20 os 1.37.76.3: #i25107# Mail merge mailer configuration page 2004/04/30 14:32:15 os 1.37.76.2: #i25107# intermediate check-in 2004/04/08 08:37:43 os 1.37.76.1: #i25107# new mail merge wizard
2004-09-20 12:06:54 +00:00
#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/sdbc/XConnection.hpp>
#include <com/sun/star/sdbc/XDataSource.hpp>
#include <swabstdlg.hxx>
2000-09-18 16:15:01 +00:00
2005-01-20 11:07:36 +00:00
#include <vcl/status.hxx>
#include "salhelper/simplereferenceobject.hxx"
#include "rtl/ref.hxx"
#include <unomid.h>
2000-09-18 16:15:01 +00:00
using namespace ::com::sun::star;
// Slotmaps for the application's methods
2000-09-18 16:15:01 +00:00
// here are the SlotID's being included
// see Idl-file
2000-09-18 16:15:01 +00:00
#define SwModule
CWS-TOOLING: integrate CWS odfmetadata2 2009-06-22 11:48:36 +0200 mst r273206 : - connectivity/source/drivers/mozab/mozillasrc/MNSInclude.hxx: + add "include ustrbuf.hxx" to work around warning caused by solaris <sys/kstat.h> declaring a global "long l ;" 2009-06-19 14:25:25 +0200 mst r273159 : - scp2/source/ooo/file_library_ooo.scp: + fix MinGW build 2009-06-08 12:52:33 +0200 mst r272727 : - redland/raptor-1.4.18.patch.mingw, redland/raptor/makefile.mk: + disable parsers that do not build on MinGW (thanks for patch by tono) 2009-05-15 17:31:07 +0200 mst r271957 : fix typos 2009-05-15 17:28:57 +0200 mst r271956 : #i101965# - offapi/com/sun/star/text/TextPortion: + add missing properties: SoftPageBreak, DocumentIndexMark, ReferenceMark, Footnote, TextField + fix read-only status of properties: Bookmark, IsStart, IsCollapsed - offapi/type_reference/{typelibrary_history.txt,types.rdb}: + update reference types.rdb 2009-05-07 14:41:38 +0200 mst r271669 : - sw/inc/{fmtftn.hxx,unocoll.hxx,doc.hxx,editsh.hxx,ftninfo.hxx}, sw/source/core/layout/{flowfrm.cxx,ftnfrm.cxx}, sw/source/core/doc/docftn.cxx, sw/source/core/edit/edattr.cxx, sw/source/core/txtnode/atrftn.cxx, sw/source/core/unocore/unocoll.cxx, sw/source/ui/fldui/fldref.cxx: + fix warning ... the hard way + also fix signature of SwDoc::SetCurFtn 2009-05-05 19:52:55 +0200 mst r271556 : - sw/inc/undobj.hxx: + make some members const 2009-05-05 19:34:40 +0200 mst r271555 : - sw/inc/rolbck.hxx, sw/source/core/undo/rolbck.cxx: + make some members const 2009-05-05 19:13:14 +0200 mst r271553 : - sw/inc/{undobj.hxx,rolbck.hxx}, sw/source/core/undo/{unbkmk.cxx,rolbck.cxx}: + fix rebase merge error + rename SwHstryBookmark to SwHistoryBookmark + clean up SwUndoBookmark 2009-05-05 19:05:53 +0200 mst r271552 : - sw/source/core/unocore/unoportenum.cxx: + fix annoying assertion 2009-05-05 15:34:48 +0200 mst r271522 : CWS-TOOLING: rebase CWS odfmetadata2 to trunk@271427 (milestone: DEV300:m47) 2009-05-04 12:37:01 +0200 mst r271444 : trivial 2009-04-22 13:30:37 +0200 mst r271102 : - sfx2/inc/sfx2/dinfdlg.hxx: + trivial change 2009-04-21 16:46:58 +0200 mst r271043 : - sw/inc/hintids.hxx: + introduce some predicates for the various hints, and use them 2009-04-21 16:19:03 +0200 mst r271041 : - sw/inc/undobj.hxx, sw/source/core/doc/{docfly.cxx,docfmt.cxx,docftn.cxx,doctxm.cxx}, sw/source/core/undo/{unattr.cxx,unins.cxx}: + clean up unattr.cxx: remove/fix casts, prefix members, use auto_ptr, etc. 2009-04-21 15:34:23 +0200 mst r271039 : - sw/inc/{rolbck.hxx,undobj.hxx}, sw/source/core/doc/docfmt.cxx, sw/source/core/txtnode/{thints.cxx,txtedt.cxx}, sw/source/core/undo/{rolbck.cxx,undel.cxx,undobj.cxx,unins.cxx,unmove.cxx, unovwr.cxx,unsect.cxx,unspnd.cxx,untbl.cxx,untblk.cxx,unattr.cxx}: + clean up SwHistory, SwRegHistory and SwHistoryHint etc.: remove/fix casts, prefix members, remove wrong const annotations, use auto_ptr, remove unused members, etc. 2009-04-20 19:17:36 +0200 mst r271013 : - sw/inc/ndhints.hxx, sw/source/core/text/{itrtxt.cxx,txtftn.cxx,itratr.cxx,porfly.cxx, txtfrm.cxx,txtdrop.cxx,frmform.cxx}, sw/source/core/txtnode/{ndtxt.cxx,ndhints.cxx,thints.cxx,txtedt.cxx}, sw/source/core/edit/acorrect.cxx, sw/source/core/doc/{docedt.cxx,docfmt.cxx}, sw/source/filter/html/swhtml.cxx: + clean up SwHintsArray and its subclasses: remove/fix casts, prefix members 2009-04-20 18:42:07 +0200 mst r271007 : - sw/source/core/text/txtio.cxx, sw/source/core/edit/edattr.cxx, sw/source/core/undo/rolbck.cxx: + remove JP_NEWCORE dead code 2009-04-20 18:38:09 +0200 mst r271006 : - sw/source/core/unocore/unochart.cxx: + silence unxlngi warning (debug=t) 2009-04-20 16:36:13 +0200 mst r270991 : - sfx2/inc/sfx2/dinfdlg.hxx, sfx2/source/dialog/dinfdlg.cxx, sfx2/source/doc/objserv.cxx, sw/source/ui/fldui/flddinf.hxx: + trivial cleanups 2009-04-20 15:28:52 +0200 mst r270990 : - sfx2/inc/sfx2/dinfdlg.hxx, sfx2/source/dialog/dinfdlg.cxx, sfx2/source/doc/objserv.cxx: + fix bug: replaying a macro with a DocumentInfoItem removes all user-defined properties 2009-03-10 15:08:20 +0100 mst r269273 : - sfx2/source/doc/Metadatable.cxx: + add missing SolarMutex guards 2009-03-10 14:46:29 +0100 mst r269272 : - unoxml/source/rdf/librdf_repository.cxx: + never free rdf_world because that would call libxm2 xmlCleanupParser (and, to add insult to injury, other libxml2 functions later...) 2009-03-06 19:02:44 +0100 mst r269041 : argh! undo... 2009-03-06 19:00:58 +0100 mst r269040 : fix #i99931# - sw/source/ui/uno/unomod.cxx: + SwXViewSettings::_getSingleValue returns uninitialized memory for the ZoomType property if the value is PAGE_WIDTH_EXACT 2009-03-06 18:59:28 +0100 mst r269039 : - sw/inc/ndtxt.hxx, sw/source/core/txtnode/ndtxt.cxx, sw/source/core/unocore/unoportenum.cxx: + fix some more wntmsci12 warnings... 2009-03-06 18:56:46 +0100 mst r269038 : - sd/source/ui/slidesorter/model/SlsPageEnumerationProvider.cxx: + work around spurious warning on unxsoli4 debug=t 2009-03-05 14:02:01 +0100 mst r268902 : - sw/inc/txatbase.hxx: + back to c-style casts, they also compile on wntmsci12... 2009-03-05 10:23:25 +0100 mst r268882 : - comphelper/inc/comphelper/processfactory.hxx, comphelper/source/processfactory/processfactory.cxx: + revert change of return type of comphelper_getProcessComponentContext to Reference: does not build on wntmsci12 2009-03-04 19:08:09 +0100 mst r268861 : - sw/source/core/txtnode/{atrtox.cxx,ndtxt.cxx}: + fix initialization 2009-03-04 14:37:30 +0100 mst r268831 : - solenv/inc/target.mk: + fix CLASSPATH so complex tests run (fix by sb) 2009-03-04 14:36:30 +0100 mst r268830 : - sw/inc/unoobj.hxx, sw/source/core/unocore/{unoparagraph.cxx,unoobj.cxx,unoobj2.cxx}: + SwXParaFrameEnumeration constructor now takes SwPaM, not SwUnoCrsr + move SwParaSelection into unoparagraph.cxx, as it is only used there + bugfix: replace SwUnoCrsrs on stack with SwCursors 2009-03-04 14:34:46 +0100 mst r268829 : - sw/inc/pam.hxx, sw/source/core/crsr/pam.cxx, sw/source/core/edit/eddel.cxx, sw/source/core/doc/docredln.cxx, sw/source/core/undo/{untbl.cxx,undel.cxx}, sw/source/filter/rtf/swparrtf.cxx: + clean up SwPaM: prefix members + new constructor SwPosition(SwCntntNode&, xub_StrLen) + fix several broken SwPosition and SwPaM constructors + SwPam::DeleteMark now actually resets the unused position to default 2009-03-02 12:07:09 +0100 mst r268646 : - sw/inc/fmtcol.hxx: + fix annoying warning (gcc 4) 2009-03-02 12:06:27 +0100 mst r268645 : - odk/util/check.pl, odk/examples/DevelopersGuide/Text/TextDocuments.java: + rename module from FieldMaster to fieldmaster 2009-02-27 19:49:56 +0100 mst r268614 : - sfx2/inc/sfx2/Metadatable.hxx, sfx2/prj/d.lst, sfx2/source/doc/{Metadatable.cxx,makefile.mk}, sw/inc/{SwMetadatable.hxx,unoobj.hxx,undobj.hxx,ndtxt.hxx}, sw/source/core/doc/{SwMetadatable.cxx,makefile.mk,docnew.cxx}, sw/source/core/undo/{untbl.cxx,unins.cxx}, sw/source/core/unocore/unoparagraph.cxx, sw/source/ui/app/docsh.cxx: + move Metadatable implementation from sw to sfx2 2009-02-27 17:58:55 +0100 mst r268608 : - sw/inc/{SwMetadatable.hxx,undobj.hxx}, sw/source/core/doc/SwMetadatable.cxx, sw/source/core/undo/{untbl.cxx,unins.cxx,undel.cxx}: + CreateUndo now returns an opaque MetadatableUndo object 2009-02-27 13:15:44 +0100 mst r268587 : - sw/inc/ndtxt.hxx, sw/source/core/doc/docfmt.cxx, sw/source/core/text/{itratr.cxx,porlay.cxx}, sw/source/core/txtnode/{txtedt.cxx,ndtxt.cxx,thints.cxx}: + clean up SwTxtNode: fix casts, prefix members + factor out inline function SwTxtNode::TryDeleteSwpHints() 2009-02-27 13:14:30 +0100 mst r268586 : - svx/inc/svx/emphitem.hxx: + fix borken header guard 2009-02-27 13:13:56 +0100 mst r268585 : - sfx2/source/bastyp/progress.cxx: + fix use of compiler specific macro 2009-02-27 11:00:32 +0100 mst r268564 : - sw/inc/{txatbase.hxx,txtatr.hxx,txtinet.hxx,txtfld.hxx,txtftn.hxx, txtflcnt.hxx,txttxmrk.hxx,txtrfmrk.hxx}, sw/source/core/txtnode/{atrtox.cxx,atrref.cxx,atrflyin.cxx,atrftn.cxx, txtatr2.cxx,txatbase.cxx,atrfld.cxx,txtedt.cxx}, sw/source/core/text/atrstck.cxx, sw/source/core/access/acchyperlink.cxx, sw/source/core/doc/visiturl.cxx, sw/source/ui/wrtsh/wrtsh2.cxx: + clean up SwTxtAttr and its subclasses: remove/fix casts, prefix members + SwTxtINetFmt: remove unused member bColor - sw/source/core/text/txtfld.cxx: + move SwTxtFld methods to atrfld.cxx 2009-02-27 10:58:44 +0100 mst r268563 : - sfx2/inc/sfx2/sfxbasemodel.hxx: + don't privately inherit BaseMutex, ScModelObj wants to access it 2009-02-27 10:58:02 +0100 mst r268562 : - xmloff/source/core/{RDFaExportHelper.cxx,RDFaImportHelper.cxx}: + arrrgh!!! someone thought it would be a good idea to have 2 different versions of boost in external! and they're NOT compatible!!! insert an ugly fragile hack that maybe works with both... 2009-02-26 17:42:26 +0100 mst r268544 : - comphelper/inc/comphelper/storagehelper.hxx. sfx2/source/doc/DocumentMetadataAccess.cxx: + someone made IsValidZipEntryFileName a static method and didn't tell me 2009-02-26 15:52:56 +0100 mst r268529 : redland: split up patches 2009-02-26 13:17:56 +0100 mst r268509 : migration of cws odfmetadata2 from CVS (resync to m42): module sw #i95863# - sw/inc/segdefs{,_}.hxx: + remove obsolete files - sw/source/ui/inc/itemdef.hxx: + remove itemdef.hxx - sw/source/ui/app/[apphdl.cxx,docsh.cxx}, sw/source/ui/misc/glshell.cxx, sw/source/ui/shells/*.cxx, sw/source/ui/uiview/*.cxx, sw/source/ui/web/*.cxx: + use sfx2/msg.hxx instead of itemdef.hxx - sw/source/core/edit/eddel.cxx: + @ JP: SwEditShell::Replace: you're right, deleting the text to be replaced first, and then inserting a space, and then replacing that space is unnecessary. whew, i'm so happy that we finally answered that question after 11 years. - sw/inc/edimp.hxx: + remove FOREACHCURSOR_START, FOREACHCURSOR_END - sw/inc/{swcrsr.hxx,unocrsr.hxx,viscrs.hxx}, sw/source/core/crsr/{crsrsh.cxx,swcrsr.cxx,trvlreg.cxx,trvltbl.cxx, unocrsr.cxx,viscrs.cxx}, sw/source/core/doc/{docbm.cxx,doccorr.cxx}, sw/source/core/docnode/{ndtbl.cxx,ndtbl1.cxx}, sw/source/core/edit/editsh.cxx, sw/source/core/frmedt/{fefly1.cxx,fetab.cxx,tblsel.cxx}, sw/source/core/layout/trvlfrm.cxx, sw/source/core/unocore/{unochart.cxx,unoobj2.cxx,unoparagraph.cxx, unoportenum.cxx,unotbl.cxx}, sw/source/core/view/vprint.cxx: + remove the hideous virtual operator SwFooCursor* + make SwCursor::IsReadOnlyAvailable() virtual + make SwUnoCrsr::Clone() virtual + refactor SwCursor methods IsSelOver(), LeftRight(), UpDown(), GotoTable(): replace dynamic_cast<...>(this) with new virtual methods 2009-02-26 13:14:58 +0100 mst r268508 : migration of cws odfmetadata2 from CVS (resync to m42): module sw - sw/source/filter/xml/swxml.cxx: + XMLReader::Read: load RDF metadata of the ODF document - sw/source/filter/xml/wrtxml.cxx: + SwXMLWriter::_Write: write RDF metadata of the ODF document if ODF >= 1.2 #i90620#: import xml:id in text tables (does not actually work yet) - sw/source/filter/xml/xmltbli{.hxx,.cxx}: + SwXMLTableCellAttrTokens,aTableCellAttrTokenMap: add XML_TOK_TABLE_XMLID + SwXMLTableCellContext_Impl::SwXMLTableCellContext_Impl: attribute xml:id + SwXMLTableCellContext_Impl::CreateChildContext: attribute xml:id + SwXMLTableColContext_Impl::SwXMLTableColContext_Impl: attribute xml:id + SwXMLTableContext::SwXMLTableContext: attribute xml:id fix #i98530# - sw/inc/unoport.hxx, sw/source/core/unocore/unoport.cxx: + SwXTextPortion: make constructor params const& - sw/source/core/unocore/unoportenum.cxx: + refactor to remove some code duplication + fix bug: paragraph w/out hints: bookmark before frame gets lost #i97274# handle invalid tables - sw/source/core/layout/tabfrm.cxx, sw/source/filter/xml/xmltbli.cxx: + SwXMLTableContext::MakeTable(): check that the table actually contains cells, and abort (removing the inserted table nodes) if not 2009-02-26 13:11:48 +0100 mst r268507 : migration of cws odfmetadata2 from CVS (resync to m42): module sw refactor SwXTextRange and SwXParagraph - sw/inc/unoobj.hxx, sw/source/core/unocore/unoobj2.cxx: + remove 3 constructors of SwXTextRange + new method SwXTextRange::CreateParentXText + refactor SwXTextRange::CreateTextRangeFromPosition and SwXTextRange::getText - sw/inc/unoobj.hxx, sw/source/core/unocore/unoparagraph.cxx: + SwXParagraph no longer uses a cursor; it registers directly at SwTxtNode + replace SwXParagraph::GetCrsr with SwXParagraph::GetTxtNode - sw/source/core/unocore/unotext.cxx, sw/source/ui/uno/unotxvw.cxx: + adapt to new SwXParagraph #i90620# - sw/inc/SwMetadatable.hxx, sw/source/core/doc/SwMetadatable.cxx: + new files: base classes sw::Metadatable and sw::MetadatableMixin; also, 2 implementations of IXmlIdRegistry: sw::XmlIdRegistryDocument and sw::XmlIdRegistryClipboard + setMetadataReference: handle empty stream name as auto-detect - sw/source/core/doc/makefile.mk: + add SwMetadatable add a XmlIdRegistry to SwDoc - sw/inc/doc.hxx: + SwDoc: add member m_pXmlIdRegistry, method GetXmlIdRegistry() - sw/source/core/doc/docnew.cxx: + initialize XmlIdRegistry in SwDoc::GetXmlIdRegistry, not in constructor, because the constructor is not told whether the SwDoc is a clipboard - sw/inc/docsh.hxx, sw/source/ui/app/docsh.cxx: + SwDocShell: override GetXmlIdRegistry() #i91563#: make the SwTxtNode metadatable - sw/inc/ndtxt.hxx + SwTxtNode inherits sw::Metadatable - sw/inc/unoobj.hxx, sw/source/core/unocore/unoparagraph.cxx: + SwXParagraph inherits sw::MetadatableMixin #i91563#: handle SwTxtNode's metadata for delete - sw/source/core/txtnode/ndtxt.cxx: + SwTxtNode::SplitCntntNode: handle XmlId + SwTxtNode::JoinNext: merge XmlIds - sw/source/core/doc/docedt.cxx: + lcl_GetJoinFlags: document postcondition + SwDoc::Delete: remove XmlId only if SwTxtNode _becomes_ empty #i91563#: handle SwTxtNode's metadata for delete with undo - sw/inc/undobj.hxx + SwUndoDelete: new members m_pMetadataUndoStart, m_pMetadataUndoEnd - sw/source/core/undo/undel.cxx: + SwUndoDelete::SaveCntnt: save XmlIds for start and end SwTxtNode + SwUndoDelete::SaveCntnt: remove XmlId only if SwTxtNode _becomes_ empty + SwUndoDelete::Undo: restore saved XmlIds for start and end SwTxtNode - sw/source/core/docnode/ndcopy.cxx: + SwTxtNode::MakeCopy: register copy at XmlIdRegistry #i91563#: handle SwTxtNode's metadata for find/replace with undo - sw/source/core/undo/unins.cxx: + _UnReplaceData: rename members: add prefix m_ + _UnReplaceData: new members m_pMetadataUndoStart, m_pMetadataUndoEnd + _UnReplaceData::_UnReplaceData: save XmlIds for start and end SwTxtNode + _UnReplaceData::Undo: restore saved XmlIds for start and end SwTxtNode #i91563#: handle SwTxtNode's metadata for table-to-text with undo - sw/source/core/undo/untbl.cxx: + SwTblToTxtSave: rename members: add prefix m_ + SwTblToTxtSave: new members m_pMetadataUndoStart, m_pMetadataUndoEnd + SwTblToTxtSave::SwTblToTxtSave: save XmlIds for start and end SwTxtNode + SwTblToTxtSave::SwTblToTxtSave, SwNodes::UndoTableToText: always store the index of the first SwTxtNode in the cell, instead of the index of the first SwTxtNode in case of the first cell in a row, and the cell start node in other cases + SwNodes::UndoTableToText: restore saved XmlIds for start and end SwTxtNode - sw/source/core/docnode/ndtbl.cxx: + lcl_DelBox: simplify for refactored start index handling in SwTblToTxtSave 2009-02-26 13:02:28 +0100 mst r268505 : migration of cws odfmetadata2 from CVS (resync to m42): module sd - sd/source/ui/table/tableobjectbar.cxx,sd/source/ui/view/*.cxx: + remove invocations of SFX_DECL_TYPE - sd/source/ui/slideshow/SlideShowRestarter.cxx, sd/source/ui/toolpanel/LayoutMenu.cxx, sd/source/ui/unoidl/DrawController.cxx, sd/source/ui/view/{ViewShellBase.cxx,ViewTabBar.cxx,frmview.cxx}: + fix abuses of comphelper_getProcessComponentContext (missing release) 2009-02-26 13:01:24 +0100 mst r268504 : migration of cws odfmetadata2 from CVS (resync to m42): module starmath - starmath/source/document.cxx: + don't touch SfxObjectShell's privates 2009-02-26 13:00:37 +0100 mst r268503 : migration of cws odfmetadata2 from CVS (resync to m42): module sfx2 #i90620# - sfx2/inc/sfx2/XmlIdRegistry.hxx: + new file: interfaces sfx2::IXmlIdRegistry and sfx2::IXmlIdRegistrySupplier and a couple of utility functions - sfx2/inc/sfx2/DocumentMetadataAccess.hxx, sfx2/source/doc/DocumentMetadataAccess.cxx: + new class sfx2::DocumentMetadataAccess, implements XDocumentMetadataAccess + the URI of the DocumentMetadataAccess is now the URI from which the document was loaded; for a new document, use a vnd.sun.star.tdoc URI + add new function sfx2::createBaseURI() + prevent using reserved file names + try not to recurse into embedded subdocuments - sfx2/source/doc/makefile.mk: + add DocumentMetadataAccess - sfx2/util/makefile.mk: + link libsfx2 against libxml2 (needed for xmlValidateNCName) - sfx2/source/doc/makefile.mk: + add LIBXML_CFLAGS to CFLAGS - sfx2/prj/build.lst: + add dependence on libxml2 - sfx2/prj/d.lst: + add XmlIdRegistry.hxx, DocumentMetadataAccess.hxx - sfx2/inc/sfx2/objsh.hxx, sfx2/source/doc/objxtor.cxx: + make SfxObjectShell's members private + new method SfxObjectShell::GetAutoStyleFilterIndex + SfxObjectShell inherits sfx2::IXmlIdRegistrySupplier - sfx2/source/dialog/templdlg.cxx, sfx2/source/doc/sfxbasemodel.cxx: + don't touch SfxObjectShell's privates - sfx2/inc/sfx2/sfxbasemodel.hxx, sfx2/source/doc/sfxbasemodel.cxx: + SfxBaseModel inherits BaseMutex instead of IMPL_SfxBaseModel_MutexContainer + SfxBaseModel implements additional interface XDocumentMetadataAccess + IMPL_SfxBaseModel_DataContainer has new member: a sfx2::DocumentMetadataAccess + implementation of XDocumentMetadataAccess forwards to the sfx2::DocumentMetadataAccess member - sfx2/qa/complex/DocumentMetadataAccessTest.java, sfx2/qa/complex/{tests.sce,makefile.mk}, sfx2/qa/complex/testdocuments/TESTRDFA.odt: + add complex test: DocumentMetadataAccessTest + add RDFa test document #i95863# - sfx2/inc/sfx2/dinfdlg.hxx, sfx2/source/dialog/dinfdlg.cxx: + refactor SfxDocumentItem so it no longer requires a XDocumentInfo + move struct CustomProperty to implementation file + remove class SfxDocumentUserPage + QueryValue,PutValue: remove MID_DOCINFO_FIELD* - sfx2/source/doc/objserv.cxx: + adapt to SfxDocumentItem change - sfx2/inc/sfx2/sfx.hrc, sfx2/sdi/sfxslots.sdi, sfx2/inc/sfx2/msg.hxx: + remove MID_DOCINFO_FIELD* + put all invocations of SFX_DECL_TYPE in msg.hxx, and undef SFX_DECL_TYPE - sfx2/source/doc/objxtor.cxx: + fix abuses of comphelper_getProcessComponentContext (missing release) - sfx2/source/doc/docfile.cxx: + SfxMedium::SfxMedium: don't dereference NULL, throw exception instead - sfx2/source/doc/objstor.cxx: + SfxObjectShell::DoLoad: fix bug: DocumentBaseURI is not initialized 2009-02-26 12:58:07 +0100 mst r268502 : migration of cws odfmetadata2 from CVS (resync to m42): module xmloff #i90620#: implement RDFa import (interface change) - xmloff/inc/xmloff/xmlimp.hxx. xmloff/source/core/xmlimp.cxx: + make SvXMLImport::GetAbsoluteReference() const + add SvXMLImport::GetComponentContext() + SvXMLImport::_InitCtor(): add RDFa namespace + add SvXMLImport::AddRDFa() + SvXMLImport::endDocument() inserts RDFa into document repository - xmloff/inc/xmloff/xmltoken.hxx, xmloff/source/core/xmltoken.cxx: + new tokens for RDFa: XML_ABOUT, XML_DATATYPE - xmloff/inc/RDFaImportHelper.hxx, xmloff/source/core/RDFaImportHelper.cxx: + new class RDFaImportHelper + adapt the code to the bleak reality of broken C++ implementations + handle empty xhtml:about attributes properly, which are actually valid relative URIs + work around broken SvXMLImport::GetAbsoluteReference - xmloff/source/core/makefile.mk: + add RDFaImportHelper.cxx #i90620#: implement RDFa export - xmloff/inc/xmloff/xmlexp.hxx, xmloff/source/core/xmlexp.cxx: + add SvXMLExport::EnsureNamespace(), and a stack of namespace maps + add SvXMLExport::GetComponentContext() + add SvXMLExport::AddAttributesRDFa() - xmloff/inc/RDFaExportHelper.hxx, xmloff/source/core/RDFaExportHelper.cxx: + new class RDFaExportHelper + don't use std::map::data_type, which is actually called std::map::mapped_type by libstdc++ - xmloff/source/core/makefile.mk: + add RDFaExportHelper.cxx #i91563# - xmloff/inc/xmloff/txtimp.hxx, xmloff/source/text/txtimp.cxx: + XMLTextPAttrTokens: add RDFa tokens - xmloff/source/text/txtparai{.hxx,.cxx}: + import RDFa for text:p - xmloff/source/text/txtparae.cxx: + export RDFa for text:p interface change: use XHTML namespace instead of RDFA - xmloff/inc/xmlnmspe.hxx, xmloff/inc/xmloff/xmltoken.hxx, xmloff/source/core/{xmltoken.cxx,xmlimp.cxx,xmlexp.cxx,RDFaExportHelper.cxx}, xmloff/source/text/txtimp.cxx: + use XHTML namespace instead of RDFA #i91565#, #i91566#: (preliminary) import for text:meta, text:meta-field - xmloff/source/text/txtparai.cxx: + new class XMLMetaImportContextBase with subclasses to import text:meta and text:meta-field - xmloff/source/text/XMLTextMarkImportContext.cxx: + change XMLTextMarkImportContext::CreateAndInsertMark to handle marks with no name (text:meta) #i91565#, #i91566#: (preliminary) export for text:meta, text:meta-field - xmloff/inc/txtflde.hxx, xmloff/source/text/txtflde.cxx: + add FIELD_ID_META to FieldIdEnum + new method XMLTextFieldExport::ExportMetaField() + change XMLTextFieldExport::ExportField{,AutoStyle,Helper} to take additional parameter for progress bar - xmloff/inc/xmloff/txtparae.hxx, xmloff/source/text/txtparae.cxx: + make XMLTextParagraphExport::exportTextRangeEnumeration() public + new method XMLTextParagraphExport::exportMeta() #i90620# - xmloff/inc/xmloff/xmlimp.hxx, xmloff/source/core/xmlimp.cxx, xmloff/inc/xmloff/xmlexp.hxx, xmloff/source/core/xmlexp.cxx: + rename SvXML{Im,Ex}port::GetStreamPath() to GetStreamName() + fix xml:id {im,ex}port for embedded documents and non-packages + adapt to API change: XMetadatable #i90620# GRDDL - xmloff/inc/xmlnmspe.hxx, xmloff/inc/xmloff/xmltoken.hxx, xmloff/source/core/{xmltoken.cxx,xmlexp.cxx}: + add GRDDL namespace + add token XML_TRANSFORMATION + add grddl:transformation attribute to root elements for meta.xml, content.xml and styles.xml 2009-02-26 12:54:40 +0100 mst r268501 : migration of cws odfmetadata2 from CVS (resync to m42): module unoxml #i90620# - unoxml/source/rdf/librdf_repository.cxx: + librdf_Repository::importGraph: allocate buffer sized length of stream + switch from one librdf_world per repository to a single static world because redland has global variables with a brain-damaged life-cycle... + exportGraph: use new raptor 1.4.18 feature to disable writing an xml:base attribute in RDF/XML files - unoxml/source/rdf/librdf_repository.cxx: unoxml/qa/complex/RDFRepositoryTest.java: + adapt to predicate is URI change + adapt to RDFa API change + adapt to API change: RDFa has multiple predicates... + adapt to API change: XMetadatable derives from XURI + allow xhtml:datatype without xhtml:content + adapt to API change: attribute MetadataReference is StringPair - unoxml/source/rdf/CURI.cxx: + add some more URI constants 2009-02-26 12:53:32 +0100 mst r268500 : migration of cws odfmetadata2 from CVS (resync to m42): module package - package/inc/ImplValidCharacters.hxx: + remove (moved to comphelper) 2009-02-26 12:52:49 +0100 mst r268499 : migration of cws odfmetadata2 from CVS (resync to m42): module comphelper - comphelper/inc/comphelper/processfactory.hxx, comphelper/source/processfactory/processfactory.cxx: + add getProcessComponentContext() + change return type of comphelper_getProcessComponentContext to Reference - comphelper/inc/comphelper/stl_types.hxx: + add OUStringBufferAppender + add algorithm intersperse - comphelper/source/misc/string.cxx: + rewrite convertCommaSeparated with intersperse and OUStringBufferAppender - comphelper/inc/comphelper/stlunosequence.hxx: + fix bug: begin() on empty sequence != end() 2009-02-26 12:50:47 +0100 mst r268498 : migration of cws odfmetadata2 from CVS (resync to m42): module offapi #i96209# - offapi/com/sun/star/text/fieldmaster/*.idl: + rename module from FieldMaster to fieldmaster - offapi/type_reference/{typelibrary_history.txt,types.rdb}: + update reference types.rdb #i90620# - offapi/com/sun/star/rdf/{XMetadatable.idl,XDocumentMetadataAccess.idl}: + API change: XMetadatable derives from XURI + API change: replace XmlId (string) with MetadataReference (StringPair) - offapi/com/sun/star/rdf/{Statement.idl,XDocumentRepository.idl, XNamedGraph.idl,XRepository.idl}: + the predicate of a statement is a URI, not a Resource - offapi/com/sun/star/rdf/XDocumentMetadataAccess.idl: + rename: s/Package/Document/ + remove uuid + remove everything related to mapping + graph names are now generated from base URI and file names + load methods: improve error handling with XInteractionHandler - offapi/com/sun/star/rdf/XDocumentRepository.idl: + change: RDFa permits using multiple predicates in one attribute + setStatementRDFa: subject is now XResource, object is now XMetadatable - offapi/com/sun/star/rdf/URIs.idl: + add some more URI constants - offapi/com/sun/star/rdf: + fix @since tags and replace <method> with <member> 2009-02-26 12:47:24 +0100 mst r268497 : migration of cws odfmetadata2 from CVS (resync to m42): module redland fix #i93768# - redland/raptor-1.4.17.patch, redland/raptor/makefile.mk: + disable GRDDL parser to prevent call to libxslt xsltSetDefaultSecurityPrefs, which breaks xmlhelp - redland/raptor/makefile.mk, redland/raptor-1.4.17.patch, redland/raptor-1.4.18.patch: + upgrade raptor to 1.4.18 + deactivate serializer for RSS/Atom (does not build) - redland/rasqal/makefile.mk, redland/rasqal-0.9.15.patch, redland/rasqal-0.9.16.patch, + upgrade rasqal to 0.9.16 - redland/redland/makefile.mk, redland/redland-1.0.7.patch, redland/redland-1.0.8.patch: + upgrade redland to 1.0.8 - redland/redlandversion.mk: + the librasqal SONAME has changed
2009-07-02 09:05:03 +00:00
#include <sfx2/msg.hxx>
2000-09-18 16:15:01 +00:00
#include "swslots.hxx"
2000-10-19 07:29:12 +00:00
#include <cfgid.h>
2000-09-18 16:15:01 +00:00
#include <shells.hrc>
2000-09-18 16:15:01 +00:00
SFX_IMPL_INTERFACE( SwModule, SfxModule, SW_RES(RID_SW_NAME) )
{
2000-10-19 07:29:12 +00:00
SFX_STATUSBAR_REGISTRATION(SW_RES(CFG_STATUSBAR));
SFX_OBJECTBAR_REGISTRATION( SFX_OBJECTBAR_APPLICATION |
SFX_VISIBILITY_DESKTOP | SFX_VISIBILITY_STANDARD | SFX_VISIBILITY_CLIENT | SFX_VISIBILITY_VIEWER,
SW_RES(RID_MODULE_TOOLBOX) );
2000-09-18 16:15:01 +00:00
}
// other states
2000-09-18 16:15:01 +00:00
void SwModule::StateOther(SfxItemSet &rSet)
{
SfxWhichIter aIter(rSet);
sal_uInt16 nWhich = aIter.FirstWhich();
SwView* pActView = ::GetActiveView();
sal_Bool bWebView = 0 != PTR_CAST(SwWebView, pActView);
while(nWhich)
{
switch(nWhich)
{
case FN_BUSINESS_CARD:
case FN_LABEL:
case FN_ENVELOP:
{
bool bDisable = false;
SfxViewShell* pCurrView = SfxViewShell::Current();
if( !pCurrView || (pCurrView && !pCurrView->ISA(SwView)) )
bDisable = true;
2000-09-18 16:15:01 +00:00
SwDocShell *pDocSh = (SwDocShell*) SfxObjectShell::Current();
if ( bDisable ||
(pDocSh && (pDocSh->IsReadOnly() ||
pDocSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED)) )
rSet.DisableItem( nWhich );
}
break;
case FN_XFORMS_INIT:
// slot is always active!
break;
2000-09-18 16:15:01 +00:00
case FN_EDIT_FORMULA:
{
SwWrtShell* pSh = 0;
int nSelection = 0;
if( pActView )
pSh = &pActView->GetWrtShell();
if( pSh )
nSelection = pSh->GetSelectionType();
if( (pSh && pSh->HasSelection()) ||
!(nSelection & (nsSelectionType::SEL_TXT | nsSelectionType::SEL_TBL)))
2000-09-18 16:15:01 +00:00
rSet.DisableItem(nWhich);
}
break;
case SID_ATTR_METRIC:
rSet.Put( SfxUInt16Item( SID_ATTR_METRIC, static_cast< sal_uInt16 >(::GetDfltMetric(bWebView))));
2000-09-18 16:15:01 +00:00
break;
case FN_SET_MODOPT_TBLNUMFMT:
rSet.Put( SfxBoolItem( nWhich, pModuleConfig->
IsInsTblFormatNum( bWebView )));
break;
default:
OSL_FAIL("::StateOther: default");
2000-09-18 16:15:01 +00:00
}
nWhich = aIter.NextWhich();
}
}
static SwView* lcl_LoadDoc(SwView* pView, const OUString& rURL)
INTEGRATION: CWS swmailmerge (1.37.76); FILE MERGED 2004/09/15 14:29:22 os 1.37.76.21: RESYNC: (1.39-1.40); FILE MERGED 2004/09/10 14:23:32 os 1.37.76.20: #i25107# source document has to be set at the config item when new document has been loaded 2004/09/08 13:57:16 os 1.37.76.19: #i25107# switch off address/greeting also if called from the database beamer 2004/09/08 10:59:56 os 1.37.76.18: #i25107# source view should only be updated after return from editing 2004/09/03 13:10:03 os 1.37.76.17: #i25107# update source view after reload 2004/09/03 08:16:43 os 1.37.76.16: #i25107# last fixes 2004/08/20 14:16:47 os 1.37.76.15: #i25107# close target view on 'step back' and re-show source view 2004/08/13 14:48:49 os 1.37.76.14: RESYNC: (1.38-1.39); FILE MERGED 2004/08/10 08:01:07 os 1.37.76.13: #i25107# go-anywhere allowed in mail merge dialog 2004/07/06 11:25:34 os 1.37.76.12: #i25107# weekly check-in 2004/07/02 09:15:05 os 1.37.76.11: #i25107# weekly check-in 2004/06/25 13:39:08 os 1.37.76.10: #i25107# weekly check-in 2004/06/23 14:06:43 os 1.37.76.9: #i25107# weekly check-in 2004/06/17 07:02:23 os 1.37.76.8: #i25107# weekly check-in 2004/06/08 06:53:18 os 1.37.76.7: #i25107# restart of mail merge wizard corrected 2004/06/04 10:26:35 os 1.37.76.6: #i25107# mail merge dialogs move to swcui library 2004/05/28 21:36:37 os 1.37.76.5: RESYNC: (1.37-1.38); FILE MERGED 2004/05/28 12:22:58 os 1.37.76.4: #i25107# ChildWindow to return to the mail merge wizard 2004/05/07 09:41:20 os 1.37.76.3: #i25107# Mail merge mailer configuration page 2004/04/30 14:32:15 os 1.37.76.2: #i25107# intermediate check-in 2004/04/08 08:37:43 os 1.37.76.1: #i25107# new mail merge wizard
2004-09-20 12:06:54 +00:00
{
SwView* pNewView = 0;
if(!rURL.isEmpty())
INTEGRATION: CWS swmailmerge (1.37.76); FILE MERGED 2004/09/15 14:29:22 os 1.37.76.21: RESYNC: (1.39-1.40); FILE MERGED 2004/09/10 14:23:32 os 1.37.76.20: #i25107# source document has to be set at the config item when new document has been loaded 2004/09/08 13:57:16 os 1.37.76.19: #i25107# switch off address/greeting also if called from the database beamer 2004/09/08 10:59:56 os 1.37.76.18: #i25107# source view should only be updated after return from editing 2004/09/03 13:10:03 os 1.37.76.17: #i25107# update source view after reload 2004/09/03 08:16:43 os 1.37.76.16: #i25107# last fixes 2004/08/20 14:16:47 os 1.37.76.15: #i25107# close target view on 'step back' and re-show source view 2004/08/13 14:48:49 os 1.37.76.14: RESYNC: (1.38-1.39); FILE MERGED 2004/08/10 08:01:07 os 1.37.76.13: #i25107# go-anywhere allowed in mail merge dialog 2004/07/06 11:25:34 os 1.37.76.12: #i25107# weekly check-in 2004/07/02 09:15:05 os 1.37.76.11: #i25107# weekly check-in 2004/06/25 13:39:08 os 1.37.76.10: #i25107# weekly check-in 2004/06/23 14:06:43 os 1.37.76.9: #i25107# weekly check-in 2004/06/17 07:02:23 os 1.37.76.8: #i25107# weekly check-in 2004/06/08 06:53:18 os 1.37.76.7: #i25107# restart of mail merge wizard corrected 2004/06/04 10:26:35 os 1.37.76.6: #i25107# mail merge dialogs move to swcui library 2004/05/28 21:36:37 os 1.37.76.5: RESYNC: (1.37-1.38); FILE MERGED 2004/05/28 12:22:58 os 1.37.76.4: #i25107# ChildWindow to return to the mail merge wizard 2004/05/07 09:41:20 os 1.37.76.3: #i25107# Mail merge mailer configuration page 2004/04/30 14:32:15 os 1.37.76.2: #i25107# intermediate check-in 2004/04/08 08:37:43 os 1.37.76.1: #i25107# new mail merge wizard
2004-09-20 12:06:54 +00:00
{
SfxStringItem aURL(SID_FILE_NAME, rURL);
SfxStringItem aTargetFrameName( SID_TARGETNAME, OUString("_blank") );
SfxBoolItem aHidden( SID_HIDDEN, sal_True );
INTEGRATION: CWS swmailmerge (1.37.76); FILE MERGED 2004/09/15 14:29:22 os 1.37.76.21: RESYNC: (1.39-1.40); FILE MERGED 2004/09/10 14:23:32 os 1.37.76.20: #i25107# source document has to be set at the config item when new document has been loaded 2004/09/08 13:57:16 os 1.37.76.19: #i25107# switch off address/greeting also if called from the database beamer 2004/09/08 10:59:56 os 1.37.76.18: #i25107# source view should only be updated after return from editing 2004/09/03 13:10:03 os 1.37.76.17: #i25107# update source view after reload 2004/09/03 08:16:43 os 1.37.76.16: #i25107# last fixes 2004/08/20 14:16:47 os 1.37.76.15: #i25107# close target view on 'step back' and re-show source view 2004/08/13 14:48:49 os 1.37.76.14: RESYNC: (1.38-1.39); FILE MERGED 2004/08/10 08:01:07 os 1.37.76.13: #i25107# go-anywhere allowed in mail merge dialog 2004/07/06 11:25:34 os 1.37.76.12: #i25107# weekly check-in 2004/07/02 09:15:05 os 1.37.76.11: #i25107# weekly check-in 2004/06/25 13:39:08 os 1.37.76.10: #i25107# weekly check-in 2004/06/23 14:06:43 os 1.37.76.9: #i25107# weekly check-in 2004/06/17 07:02:23 os 1.37.76.8: #i25107# weekly check-in 2004/06/08 06:53:18 os 1.37.76.7: #i25107# restart of mail merge wizard corrected 2004/06/04 10:26:35 os 1.37.76.6: #i25107# mail merge dialogs move to swcui library 2004/05/28 21:36:37 os 1.37.76.5: RESYNC: (1.37-1.38); FILE MERGED 2004/05/28 12:22:58 os 1.37.76.4: #i25107# ChildWindow to return to the mail merge wizard 2004/05/07 09:41:20 os 1.37.76.3: #i25107# Mail merge mailer configuration page 2004/04/30 14:32:15 os 1.37.76.2: #i25107# intermediate check-in 2004/04/08 08:37:43 os 1.37.76.1: #i25107# new mail merge wizard
2004-09-20 12:06:54 +00:00
SfxStringItem aReferer(SID_REFERER, pView->GetDocShell()->GetTitle());
SfxObjectItem* pItem = (SfxObjectItem*)pView->GetViewFrame()->GetDispatcher()->
Execute(SID_OPENDOC, SFX_CALLMODE_SYNCHRON,
&aURL, &aHidden, &aReferer, &aTargetFrameName, 0L);
INTEGRATION: CWS swmailmerge (1.37.76); FILE MERGED 2004/09/15 14:29:22 os 1.37.76.21: RESYNC: (1.39-1.40); FILE MERGED 2004/09/10 14:23:32 os 1.37.76.20: #i25107# source document has to be set at the config item when new document has been loaded 2004/09/08 13:57:16 os 1.37.76.19: #i25107# switch off address/greeting also if called from the database beamer 2004/09/08 10:59:56 os 1.37.76.18: #i25107# source view should only be updated after return from editing 2004/09/03 13:10:03 os 1.37.76.17: #i25107# update source view after reload 2004/09/03 08:16:43 os 1.37.76.16: #i25107# last fixes 2004/08/20 14:16:47 os 1.37.76.15: #i25107# close target view on 'step back' and re-show source view 2004/08/13 14:48:49 os 1.37.76.14: RESYNC: (1.38-1.39); FILE MERGED 2004/08/10 08:01:07 os 1.37.76.13: #i25107# go-anywhere allowed in mail merge dialog 2004/07/06 11:25:34 os 1.37.76.12: #i25107# weekly check-in 2004/07/02 09:15:05 os 1.37.76.11: #i25107# weekly check-in 2004/06/25 13:39:08 os 1.37.76.10: #i25107# weekly check-in 2004/06/23 14:06:43 os 1.37.76.9: #i25107# weekly check-in 2004/06/17 07:02:23 os 1.37.76.8: #i25107# weekly check-in 2004/06/08 06:53:18 os 1.37.76.7: #i25107# restart of mail merge wizard corrected 2004/06/04 10:26:35 os 1.37.76.6: #i25107# mail merge dialogs move to swcui library 2004/05/28 21:36:37 os 1.37.76.5: RESYNC: (1.37-1.38); FILE MERGED 2004/05/28 12:22:58 os 1.37.76.4: #i25107# ChildWindow to return to the mail merge wizard 2004/05/07 09:41:20 os 1.37.76.3: #i25107# Mail merge mailer configuration page 2004/04/30 14:32:15 os 1.37.76.2: #i25107# intermediate check-in 2004/04/08 08:37:43 os 1.37.76.1: #i25107# new mail merge wizard
2004-09-20 12:06:54 +00:00
SfxShell* pShell = pItem ? pItem->GetShell() : 0;
if(pShell)
{
SfxViewShell* pViewShell = pShell->GetViewShell();
if(pViewShell)
{
if( pViewShell->ISA(SwView) )
{
pNewView = PTR_CAST(SwView,pViewShell);
pNewView->GetViewFrame()->GetFrame().Appear();
}
else
{
pViewShell->GetViewFrame()->DoClose();
}
}
}
INTEGRATION: CWS swmailmerge (1.37.76); FILE MERGED 2004/09/15 14:29:22 os 1.37.76.21: RESYNC: (1.39-1.40); FILE MERGED 2004/09/10 14:23:32 os 1.37.76.20: #i25107# source document has to be set at the config item when new document has been loaded 2004/09/08 13:57:16 os 1.37.76.19: #i25107# switch off address/greeting also if called from the database beamer 2004/09/08 10:59:56 os 1.37.76.18: #i25107# source view should only be updated after return from editing 2004/09/03 13:10:03 os 1.37.76.17: #i25107# update source view after reload 2004/09/03 08:16:43 os 1.37.76.16: #i25107# last fixes 2004/08/20 14:16:47 os 1.37.76.15: #i25107# close target view on 'step back' and re-show source view 2004/08/13 14:48:49 os 1.37.76.14: RESYNC: (1.38-1.39); FILE MERGED 2004/08/10 08:01:07 os 1.37.76.13: #i25107# go-anywhere allowed in mail merge dialog 2004/07/06 11:25:34 os 1.37.76.12: #i25107# weekly check-in 2004/07/02 09:15:05 os 1.37.76.11: #i25107# weekly check-in 2004/06/25 13:39:08 os 1.37.76.10: #i25107# weekly check-in 2004/06/23 14:06:43 os 1.37.76.9: #i25107# weekly check-in 2004/06/17 07:02:23 os 1.37.76.8: #i25107# weekly check-in 2004/06/08 06:53:18 os 1.37.76.7: #i25107# restart of mail merge wizard corrected 2004/06/04 10:26:35 os 1.37.76.6: #i25107# mail merge dialogs move to swcui library 2004/05/28 21:36:37 os 1.37.76.5: RESYNC: (1.37-1.38); FILE MERGED 2004/05/28 12:22:58 os 1.37.76.4: #i25107# ChildWindow to return to the mail merge wizard 2004/05/07 09:41:20 os 1.37.76.3: #i25107# Mail merge mailer configuration page 2004/04/30 14:32:15 os 1.37.76.2: #i25107# intermediate check-in 2004/04/08 08:37:43 os 1.37.76.1: #i25107# new mail merge wizard
2004-09-20 12:06:54 +00:00
}
else
{
SfxStringItem aFactory(SID_NEWDOCDIRECT, SwDocShell::Factory().GetFilterContainer()->GetName());
const SfxFrameItem* pItem = (SfxFrameItem*)
pView->GetViewFrame()->GetDispatcher()->Execute(SID_NEWDOCDIRECT,
SFX_CALLMODE_SYNCHRON, &aFactory, 0L);
SfxFrame* pFrm = pItem ? pItem->GetFrame() : 0;
SfxViewFrame* pFrame = pFrm ? pFrm->GetCurrentViewFrame() : 0;
pNewView = pFrame ? PTR_CAST(SwView, pFrame->GetViewShell()) : 0;
}
2000-09-18 16:15:01 +00:00
INTEGRATION: CWS swmailmerge (1.37.76); FILE MERGED 2004/09/15 14:29:22 os 1.37.76.21: RESYNC: (1.39-1.40); FILE MERGED 2004/09/10 14:23:32 os 1.37.76.20: #i25107# source document has to be set at the config item when new document has been loaded 2004/09/08 13:57:16 os 1.37.76.19: #i25107# switch off address/greeting also if called from the database beamer 2004/09/08 10:59:56 os 1.37.76.18: #i25107# source view should only be updated after return from editing 2004/09/03 13:10:03 os 1.37.76.17: #i25107# update source view after reload 2004/09/03 08:16:43 os 1.37.76.16: #i25107# last fixes 2004/08/20 14:16:47 os 1.37.76.15: #i25107# close target view on 'step back' and re-show source view 2004/08/13 14:48:49 os 1.37.76.14: RESYNC: (1.38-1.39); FILE MERGED 2004/08/10 08:01:07 os 1.37.76.13: #i25107# go-anywhere allowed in mail merge dialog 2004/07/06 11:25:34 os 1.37.76.12: #i25107# weekly check-in 2004/07/02 09:15:05 os 1.37.76.11: #i25107# weekly check-in 2004/06/25 13:39:08 os 1.37.76.10: #i25107# weekly check-in 2004/06/23 14:06:43 os 1.37.76.9: #i25107# weekly check-in 2004/06/17 07:02:23 os 1.37.76.8: #i25107# weekly check-in 2004/06/08 06:53:18 os 1.37.76.7: #i25107# restart of mail merge wizard corrected 2004/06/04 10:26:35 os 1.37.76.6: #i25107# mail merge dialogs move to swcui library 2004/05/28 21:36:37 os 1.37.76.5: RESYNC: (1.37-1.38); FILE MERGED 2004/05/28 12:22:58 os 1.37.76.4: #i25107# ChildWindow to return to the mail merge wizard 2004/05/07 09:41:20 os 1.37.76.3: #i25107# Mail merge mailer configuration page 2004/04/30 14:32:15 os 1.37.76.2: #i25107# intermediate check-in 2004/04/08 08:37:43 os 1.37.76.1: #i25107# new mail merge wizard
2004-09-20 12:06:54 +00:00
return pNewView;
}
2000-09-18 16:15:01 +00:00
// start field dialog
void NewXForms( SfxRequest& rReq ); // implementation: below
2000-09-18 16:15:01 +00:00
namespace
{
class SwMailMergeWizardExecutor : public salhelper::SimpleReferenceObject
{
SwView* m_pView; // never owner
SwView* m_pView2Close; // never owner
SwMailMergeConfigItem* m_pMMConfig; // sometimes owner
AbstractMailMergeWizard* m_pWizard; // always owner
DECL_LINK( EndDialogHdl, AbstractMailMergeWizard* );
DECL_LINK( DestroyDialogHdl, void* );
DECL_LINK( DestroyWizardHdl, AbstractMailMergeWizard* );
DECL_LINK( CancelHdl, void* );
DECL_LINK( CloseFrameHdl, void* );
void ExecutionFinished( bool bDeleteConfigItem );
void ExecuteWizard();
public:
SwMailMergeWizardExecutor();
~SwMailMergeWizardExecutor();
void ExecuteMailMergeWizard( const SfxItemSet * pArgs );
};
SwMailMergeWizardExecutor::SwMailMergeWizardExecutor()
: m_pView( 0 ),
m_pView2Close( NULL ),
m_pMMConfig( 0 ),
m_pWizard( 0 )
{
}
SwMailMergeWizardExecutor::~SwMailMergeWizardExecutor()
{
OSL_ENSURE( m_pWizard == 0, "SwMailMergeWizardExecutor: m_pWizard must be Null!" );
OSL_ENSURE( m_pMMConfig == 0, "SwMailMergeWizardExecutor: m_pMMConfig must be Null!" );
}
void SwMailMergeWizardExecutor::ExecuteMailMergeWizard( const SfxItemSet * pArgs )
{
if ( m_pView )
{
OSL_FAIL("SwMailMergeWizardExecutor::ExecuteMailMergeWizard: Already executing the wizard!" );
return;
}
m_pView = ::GetActiveView(); // not owner!
OSL_ENSURE(m_pView, "no current view?");
if(m_pView)
{
// keep self alive until done.
acquire();
// if called from the child window - get the config item and close the ChildWindow, then restore
// the wizard
SwMailMergeChildWindow* pChildWin =
static_cast<SwMailMergeChildWindow*>(m_pView->GetViewFrame()->GetChildWindow(FN_MAILMERGE_CHILDWINDOW));
bool bRestoreWizard = false;
sal_uInt16 nRestartPage = 0;
if(pChildWin && pChildWin->IsVisible())
{
m_pMMConfig = m_pView->GetMailMergeConfigItem();
nRestartPage = m_pView->GetMailMergeRestartPage();
if(m_pView->IsMailMergeSourceView())
m_pMMConfig->SetSourceView( m_pView );
m_pView->SetMailMergeConfigItem(0, 0, sal_True);
SfxViewFrame* pViewFrame = m_pView->GetViewFrame();
pViewFrame->ShowChildWindow(FN_MAILMERGE_CHILDWINDOW, sal_False);
OSL_ENSURE(m_pMMConfig, "no MailMergeConfigItem available");
bRestoreWizard = true;
}
// to make it bullet proof ;-)
if(!m_pMMConfig)
{
m_pMMConfig = new SwMailMergeConfigItem;
m_pMMConfig->SetSourceView(m_pView);
//set the first used database as default source on the config item
const SfxPoolItem* pItem = 0;
if(pArgs && SFX_ITEM_SET == pArgs->GetItemState(
FN_PARAM_DATABASE_PROPERTIES, sal_False, &pItem))
{
//mailmerge has been called from the database beamer
uno::Sequence< beans::PropertyValue> aDBValues;
if(static_cast<const SfxUsrAnyItem*>(pItem)->GetValue() >>= aDBValues)
{
SwDBData aDBData;
svx::ODataAccessDescriptor aDescriptor(aDBValues);
aDescriptor[svx::daDataSource] >>= aDBData.sDataSource;
aDescriptor[svx::daCommand] >>= aDBData.sCommand;
aDescriptor[svx::daCommandType] >>= aDBData.nCommandType;
uno::Sequence< uno::Any > aSelection;
uno::Reference< sdbc::XConnection> xConnection;
uno::Reference< sdbc::XDataSource> xSource;
uno::Reference< sdbcx::XColumnsSupplier> xColumnsSupplier;
if ( aDescriptor.has(svx::daSelection) )
aDescriptor[svx::daSelection] >>= aSelection;
if ( aDescriptor.has(svx::daConnection) )
aDescriptor[svx::daConnection] >>= xConnection;
uno::Reference<container::XChild> xChild(xConnection, uno::UNO_QUERY);
if(xChild.is())
xSource = uno::Reference<sdbc::XDataSource>(
xChild->getParent(), uno::UNO_QUERY);
m_pMMConfig->SetCurrentConnection(
xSource, SharedConnection( xConnection, SharedConnection::NoTakeOwnership ),
xColumnsSupplier, aDBData);
}
}
else
{
std::vector<OUString> aDBNameList;
std::vector<OUString> aAllDBNames;
m_pView->GetWrtShell().GetAllUsedDB( aDBNameList, &aAllDBNames );
2012-01-13 00:20:39 -05:00
if(!aDBNameList.empty())
{
OUString sDBName(aDBNameList[0]);
SwDBData aDBData;
aDBData.sDataSource = sDBName.getToken(0, DB_DELIM);
aDBData.sCommand = sDBName.getToken(1, DB_DELIM);
aDBData.nCommandType = sDBName.getToken(2, DB_DELIM ).toInt32();
//set the currently used database for the wizard
m_pMMConfig->SetCurrentDBData( aDBData );
}
}
}
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
m_pWizard = pFact->CreateMailMergeWizard(*m_pView, *m_pMMConfig);
if(bRestoreWizard)
{
m_pWizard->ShowPage( nRestartPage );
}
ExecuteWizard();
}
}
void SwMailMergeWizardExecutor::ExecutionFinished( bool bDeleteConfigItem )
{
m_pMMConfig->Commit();
if ( bDeleteConfigItem ) // owner?
delete m_pMMConfig;
m_pMMConfig = 0;
// release/destroy asynchronously
Application::PostUserEvent( LINK( this, SwMailMergeWizardExecutor, DestroyDialogHdl ) );
}
void SwMailMergeWizardExecutor::ExecuteWizard()
{
m_pWizard->StartExecuteModal(
LINK( this, SwMailMergeWizardExecutor, EndDialogHdl ) );
}
IMPL_LINK( SwMailMergeWizardExecutor, EndDialogHdl, AbstractMailMergeWizard*, pDialog )
{
OSL_ENSURE( pDialog == m_pWizard, "wrong dialog passed to EndDialogHdl!" );
(void) pDialog;
long nRet = m_pWizard->GetResult();
sal_uInt16 nRestartPage = m_pWizard->GetRestartPage();
switch ( nRet )
{
case RET_LOAD_DOC:
{
SwView* pNewView = lcl_LoadDoc(m_pView, m_pWizard->GetReloadDocument());
// destroy wizard asynchronously
Application::PostUserEvent(
LINK( this, SwMailMergeWizardExecutor, DestroyWizardHdl ), m_pWizard );
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
if(pNewView)
{
m_pView = pNewView;
m_pMMConfig->DocumentReloaded();
//new source view!
m_pMMConfig->SetSourceView( m_pView );
m_pWizard = pFact->CreateMailMergeWizard(*m_pView, *m_pMMConfig);
m_pWizard->ShowPage( nRestartPage );
}
else
{
m_pWizard = pFact->CreateMailMergeWizard(*m_pView, *m_pMMConfig);
}
// execute the wizard again
ExecuteWizard();
break;
}
case RET_TARGET_CREATED:
{
SwView* pTargetView = m_pMMConfig->GetTargetView();
uno::Reference< frame::XFrame > xFrame =
m_pView->GetViewFrame()->GetFrame().GetFrameInterface();
xFrame->getContainerWindow()->setVisible(sal_False);
OSL_ENSURE(pTargetView, "No target view has been created");
if(pTargetView)
{
// destroy wizard asynchronously
Application::PostUserEvent(
LINK( this, SwMailMergeWizardExecutor, DestroyWizardHdl ), m_pWizard );
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
m_pWizard = pFact->CreateMailMergeWizard(*pTargetView, *m_pMMConfig);
m_pWizard->ShowPage( nRestartPage );
// execute the wizard again
ExecuteWizard();
}
else
{
// should not happen - just in case no target view has been created
ExecutionFinished( true );
}
break;
}
case RET_EDIT_DOC:
case RET_EDIT_RESULT_DOC:
{
//create a non-modal dialog that allows to return to the wizard
//the ConfigItem ownership moves to this dialog
bool bResult = nRet == RET_EDIT_RESULT_DOC && m_pMMConfig->GetTargetView();
SwView* pTempView = bResult ? m_pMMConfig->GetTargetView() : m_pMMConfig->GetSourceView();
pTempView->SetMailMergeConfigItem(m_pMMConfig, m_pWizard->GetRestartPage(), !bResult);
SfxViewFrame* pViewFrame = pTempView->GetViewFrame();
pViewFrame->GetDispatcher()->Execute(
FN_MAILMERGE_CHILDWINDOW, SFX_CALLMODE_SYNCHRON);
ExecutionFinished( false );
break;
}
case RET_REMOVE_TARGET:
{
SwView* pTargetView = m_pMMConfig->GetTargetView();
SwView* pSourceView = m_pMMConfig->GetSourceView();
OSL_ENSURE(pTargetView && pSourceView, "source or target view not available" );
if(pTargetView && pSourceView)
{
m_pView2Close = pTargetView;
pTargetView->GetViewFrame()->GetTopViewFrame()->GetWindow().Hide();
pSourceView->GetViewFrame()->GetFrame().AppearWithUpdate();
// the current view has be be set when the target is destroyed
m_pView = pSourceView;
m_pMMConfig->SetTargetView(0);
// destroy wizard asynchronously
Application::PostUserEvent(
LINK( this, SwMailMergeWizardExecutor, CloseFrameHdl ), m_pWizard );
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
m_pWizard = pFact->CreateMailMergeWizard(*pSourceView, *m_pMMConfig);
m_pWizard->ShowPage( nRestartPage );
// execute the wizard again
ExecuteWizard();
}
else
{
// should not happen - just in case no target view has been created
ExecutionFinished( true );
}
break;
}
case RET_CANCEL:
{
// close frame and destroy wizard asynchronously
Application::PostUserEvent(
LINK( this, SwMailMergeWizardExecutor, CancelHdl ), m_pWizard );
break;
}
default: // finish
{
SwView* pSourceView = m_pMMConfig->GetSourceView();
if(pSourceView)
{
SwDocShell* pDocShell = pSourceView->GetDocShell();
if(pDocShell->HasName() && !pDocShell->IsModified())
m_pMMConfig->GetSourceView()->GetViewFrame()->DoClose();
else
m_pMMConfig->GetSourceView()->GetViewFrame()->GetFrame().Appear();
}
ExecutionFinished( true );
break;
}
} // switch
return 0L;
}
IMPL_LINK_NOARG(SwMailMergeWizardExecutor, DestroyDialogHdl)
{
delete m_pWizard;
m_pWizard = 0;
release();
return 0L;
}
IMPL_LINK( SwMailMergeWizardExecutor, DestroyWizardHdl, AbstractMailMergeWizard*, pDialog )
{
delete pDialog;
return 0L;
}
IMPL_LINK_NOARG(SwMailMergeWizardExecutor, CancelHdl)
{
if(m_pMMConfig->GetTargetView())
{
m_pMMConfig->GetTargetView()->GetViewFrame()->DoClose();
m_pMMConfig->SetTargetView(0);
}
if(m_pMMConfig->GetSourceView())
m_pMMConfig->GetSourceView()->GetViewFrame()->GetFrame().AppearWithUpdate();
m_pMMConfig->Commit();
delete m_pMMConfig;
m_pMMConfig = 0;
// m_pWizard already deleted by closing the target view
m_pWizard = 0;
release();
return 0L;
}
IMPL_LINK_NOARG(SwMailMergeWizardExecutor, CloseFrameHdl)
{
if ( m_pView2Close )
{
m_pView2Close->GetViewFrame()->DoClose();
m_pView2Close = NULL;
}
return 0L;
}
} // namespace
2000-09-18 16:15:01 +00:00
void SwModule::ExecOther(SfxRequest& rReq)
{
const SfxItemSet *pArgs = rReq.GetArgs();
const SfxPoolItem* pItem = 0;
sal_uInt16 nWhich = rReq.GetSlot();
switch (nWhich)
{
case FN_ENVELOP:
2002-07-03 15:48:10 +00:00
InsertEnv( rReq );
2000-09-18 16:15:01 +00:00
break;
case FN_BUSINESS_CARD:
case FN_LABEL:
InsertLab(rReq, nWhich == FN_LABEL);
2000-09-18 16:15:01 +00:00
break;
case FN_XFORMS_INIT:
NewXForms( rReq );
break;
2000-09-18 16:15:01 +00:00
case SID_ATTR_METRIC:
if(pArgs && SFX_ITEM_SET == pArgs->GetItemState(nWhich, sal_False, &pItem))
{
FieldUnit eUnit = (FieldUnit)((const SfxUInt16Item*)pItem)->GetValue();
switch( eUnit )
{
case FUNIT_MM:
case FUNIT_CM:
case FUNIT_INCH:
case FUNIT_PICA:
case FUNIT_POINT:
{
SwView* pActView = ::GetActiveView();
sal_Bool bWebView = 0 != PTR_CAST(SwWebView, pActView);
::SetDfltMetric(eUnit, bWebView);
}
break;
default:;//prevent warning
2000-09-18 16:15:01 +00:00
}
}
break;
case FN_SET_MODOPT_TBLNUMFMT:
{
sal_Bool bWebView = 0 != PTR_CAST(SwWebView, ::GetActiveView() ),
bSet;
if( pArgs && SFX_ITEM_SET == pArgs->GetItemState(
nWhich, sal_False, &pItem ))
bSet = ((SfxBoolItem*)pItem)->GetValue();
else
bSet = !pModuleConfig->IsInsTblFormatNum( bWebView );
pModuleConfig->SetInsTblFormatNum( bWebView, bSet );
}
break;
INTEGRATION: CWS swmailmerge (1.37.76); FILE MERGED 2004/09/15 14:29:22 os 1.37.76.21: RESYNC: (1.39-1.40); FILE MERGED 2004/09/10 14:23:32 os 1.37.76.20: #i25107# source document has to be set at the config item when new document has been loaded 2004/09/08 13:57:16 os 1.37.76.19: #i25107# switch off address/greeting also if called from the database beamer 2004/09/08 10:59:56 os 1.37.76.18: #i25107# source view should only be updated after return from editing 2004/09/03 13:10:03 os 1.37.76.17: #i25107# update source view after reload 2004/09/03 08:16:43 os 1.37.76.16: #i25107# last fixes 2004/08/20 14:16:47 os 1.37.76.15: #i25107# close target view on 'step back' and re-show source view 2004/08/13 14:48:49 os 1.37.76.14: RESYNC: (1.38-1.39); FILE MERGED 2004/08/10 08:01:07 os 1.37.76.13: #i25107# go-anywhere allowed in mail merge dialog 2004/07/06 11:25:34 os 1.37.76.12: #i25107# weekly check-in 2004/07/02 09:15:05 os 1.37.76.11: #i25107# weekly check-in 2004/06/25 13:39:08 os 1.37.76.10: #i25107# weekly check-in 2004/06/23 14:06:43 os 1.37.76.9: #i25107# weekly check-in 2004/06/17 07:02:23 os 1.37.76.8: #i25107# weekly check-in 2004/06/08 06:53:18 os 1.37.76.7: #i25107# restart of mail merge wizard corrected 2004/06/04 10:26:35 os 1.37.76.6: #i25107# mail merge dialogs move to swcui library 2004/05/28 21:36:37 os 1.37.76.5: RESYNC: (1.37-1.38); FILE MERGED 2004/05/28 12:22:58 os 1.37.76.4: #i25107# ChildWindow to return to the mail merge wizard 2004/05/07 09:41:20 os 1.37.76.3: #i25107# Mail merge mailer configuration page 2004/04/30 14:32:15 os 1.37.76.2: #i25107# intermediate check-in 2004/04/08 08:37:43 os 1.37.76.1: #i25107# new mail merge wizard
2004-09-20 12:06:54 +00:00
case FN_MAILMERGE_WIZARD:
{
rtl::Reference< SwMailMergeWizardExecutor > xEx( new SwMailMergeWizardExecutor );
xEx->ExecuteMailMergeWizard( pArgs );
INTEGRATION: CWS swmailmerge (1.37.76); FILE MERGED 2004/09/15 14:29:22 os 1.37.76.21: RESYNC: (1.39-1.40); FILE MERGED 2004/09/10 14:23:32 os 1.37.76.20: #i25107# source document has to be set at the config item when new document has been loaded 2004/09/08 13:57:16 os 1.37.76.19: #i25107# switch off address/greeting also if called from the database beamer 2004/09/08 10:59:56 os 1.37.76.18: #i25107# source view should only be updated after return from editing 2004/09/03 13:10:03 os 1.37.76.17: #i25107# update source view after reload 2004/09/03 08:16:43 os 1.37.76.16: #i25107# last fixes 2004/08/20 14:16:47 os 1.37.76.15: #i25107# close target view on 'step back' and re-show source view 2004/08/13 14:48:49 os 1.37.76.14: RESYNC: (1.38-1.39); FILE MERGED 2004/08/10 08:01:07 os 1.37.76.13: #i25107# go-anywhere allowed in mail merge dialog 2004/07/06 11:25:34 os 1.37.76.12: #i25107# weekly check-in 2004/07/02 09:15:05 os 1.37.76.11: #i25107# weekly check-in 2004/06/25 13:39:08 os 1.37.76.10: #i25107# weekly check-in 2004/06/23 14:06:43 os 1.37.76.9: #i25107# weekly check-in 2004/06/17 07:02:23 os 1.37.76.8: #i25107# weekly check-in 2004/06/08 06:53:18 os 1.37.76.7: #i25107# restart of mail merge wizard corrected 2004/06/04 10:26:35 os 1.37.76.6: #i25107# mail merge dialogs move to swcui library 2004/05/28 21:36:37 os 1.37.76.5: RESYNC: (1.37-1.38); FILE MERGED 2004/05/28 12:22:58 os 1.37.76.4: #i25107# ChildWindow to return to the mail merge wizard 2004/05/07 09:41:20 os 1.37.76.3: #i25107# Mail merge mailer configuration page 2004/04/30 14:32:15 os 1.37.76.2: #i25107# intermediate check-in 2004/04/08 08:37:43 os 1.37.76.1: #i25107# new mail merge wizard
2004-09-20 12:06:54 +00:00
}
break;
2000-09-18 16:15:01 +00:00
}
}
// Catch notifications
2000-09-18 16:15:01 +00:00
// Catch hint for DocInfo
void SwModule::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
2000-09-18 16:15:01 +00:00
{
if( rHint.ISA( SfxEventHint ) )
{
SfxEventHint& rEvHint = (SfxEventHint&) rHint;
SwDocShell* pDocSh = PTR_CAST( SwDocShell, rEvHint.GetObjShell() );
if( pDocSh )
{
SwWrtShell* pWrtSh = pDocSh->GetWrtShell();
2000-09-18 16:15:01 +00:00
switch( rEvHint.GetEventId() )
{
case SFX_EVENT_LOADFINISHED:
OSL_ASSERT(!pWrtSh);
// if it is a new document created from a template,
// update fixed fields
if (pDocSh->GetMedium())
{
SFX_ITEMSET_ARG( pDocSh->GetMedium()->GetItemSet(),
pTemplateItem, SfxBoolItem,
SID_TEMPLATE, sal_False);
if (pTemplateItem && pTemplateItem->GetValue())
{
pDocSh->GetDoc()->SetFixFields(false, 0);
}
}
2000-09-18 16:15:01 +00:00
case SFX_EVENT_CREATEDOC:
// Update all FIX-Date/Time fields
2000-09-18 16:15:01 +00:00
if( pWrtSh )
{
SFX_ITEMSET_ARG( pDocSh->GetMedium()->GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE, sal_False);
bool bUpdateFields = true;
if( pUpdateDocItem && pUpdateDocItem->GetValue() == document::UpdateDocMode::NO_UPDATE)
bUpdateFields = false;
if(bUpdateFields)
{
pWrtSh->UpdateInputFlds();
// Are database fields contained?
// Get all used databases for the first time
SwDoc *pDoc = pDocSh->GetDoc();
std::vector<OUString> aDBNameList;
pDoc->GetAllUsedDB( aDBNameList );
2012-01-13 00:20:39 -05:00
if(!aDBNameList.empty())
{ // Open database beamer
ShowDBObj(pWrtSh->GetView(), pDoc->GetDBData());
}
2000-09-18 16:15:01 +00:00
}
}
break;
}
}
}
else if(rHint.ISA(SfxItemSetHint))
{
if( SFX_ITEM_SET == ((SfxItemSetHint&)rHint).GetItemSet().GetItemState(SID_ATTR_PATHNAME))
{
::GetGlossaries()->UpdateGlosPath( sal_False );
SwGlossaryList* pList = ::GetGlossaryList();
if(pList->IsActive())
pList->Update();
}
}
2002-04-12 09:39:11 +00:00
else if(rHint.ISA(SfxSimpleHint))
2000-09-18 16:15:01 +00:00
{
sal_uInt16 nHintId = ((SfxSimpleHint&)rHint).GetId();
if(SFX_HINT_DEINITIALIZING == nHintId)
2002-04-12 09:39:11 +00:00
{
DELETEZ(pWebUsrPref);
DELETEZ(pUsrPref) ;
DELETEZ(pModuleConfig);
DELETEZ(pPrtOpt) ;
DELETEZ(pWebPrtOpt) ;
DELETEZ(pChapterNumRules);
DELETEZ(pStdFontConfig) ;
DELETEZ(pNavigationConfig) ;
DELETEZ(pToolbarConfig) ;
DELETEZ(pWebToolbarConfig) ;
DELETEZ(pAuthorNames) ;
DELETEZ(pDBConfig);
2010-05-26 15:54:55 +02:00
if( pColorConfig )
{
pColorConfig->RemoveListener(this);
DELETEZ(pColorConfig);
}
if( pAccessibilityOptions )
{
pAccessibilityOptions->RemoveListener(this);
DELETEZ(pAccessibilityOptions);
}
if( pCTLOptions )
{
pCTLOptions->RemoveListener(this);
DELETEZ(pCTLOptions);
}
if( pUserOptions )
{
pUserOptions->RemoveListener(this);
DELETEZ(pUserOptions);
}
2002-04-12 09:39:11 +00:00
}
2000-09-18 16:15:01 +00:00
}
}
void SwModule::ConfigurationChanged( utl::ConfigurationBroadcaster* pBrdCst, sal_uInt32 )
{
if( pBrdCst == pUserOptions )
{
bAuthorInitialised = sal_False;
}
else if ( pBrdCst == pColorConfig || pBrdCst == pAccessibilityOptions )
{
bool bAccessibility = false;
if( pBrdCst == pColorConfig )
SwViewOption::ApplyColorConfigValues(*pColorConfig);
else
bAccessibility = true;
//invalidate all edit windows
const TypeId aSwViewTypeId = TYPE(SwView);
const TypeId aSwPreviewTypeId = TYPE(SwPagePreview);
const TypeId aSwSrcViewTypeId = TYPE(SwSrcView);
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
while(pViewShell)
{
if(pViewShell->GetWindow())
{
if((pViewShell->IsA(aSwViewTypeId) ||
pViewShell->IsA(aSwPreviewTypeId) ||
pViewShell->IsA(aSwSrcViewTypeId)))
{
if(bAccessibility)
{
if(pViewShell->IsA(aSwViewTypeId))
((SwView*)pViewShell)->ApplyAccessiblityOptions(*pAccessibilityOptions);
else if(pViewShell->IsA(aSwPreviewTypeId))
((SwPagePreview*)pViewShell)->ApplyAccessiblityOptions(*pAccessibilityOptions);
}
pViewShell->GetWindow()->Invalidate();
}
}
pViewShell = SfxViewShell::GetNext( *pViewShell );
}
}
else if( pBrdCst == pCTLOptions )
{
const SfxObjectShell* pObjSh = SfxObjectShell::GetFirst();
while( pObjSh )
{
if( pObjSh->IsA(TYPE(SwDocShell)) )
{
const SwDoc* pDoc = ((SwDocShell*)pObjSh)->GetDoc();
SwViewShell* pVSh = 0;
pDoc->GetEditShell( &pVSh );
if ( pVSh )
pVSh->ChgNumberDigits();
}
pObjSh = SfxObjectShell::GetNext(*pObjSh);
}
}
}
SwDBConfig* SwModule::GetDBConfig()
{
if(!pDBConfig)
pDBConfig = new SwDBConfig;
return pDBConfig;
}
2002-04-12 09:39:11 +00:00
svtools::ColorConfig& SwModule::GetColorConfig()
2002-04-12 09:39:11 +00:00
{
if(!pColorConfig)
{
pColorConfig = new svtools::ColorConfig;
SwViewOption::ApplyColorConfigValues(*pColorConfig);
pColorConfig->AddListener(this);
}
2002-04-12 09:39:11 +00:00
return *pColorConfig;
}
SvtAccessibilityOptions& SwModule::GetAccessibilityOptions()
{
if(!pAccessibilityOptions)
{
pAccessibilityOptions = new SvtAccessibilityOptions;
pAccessibilityOptions->AddListener(this);
}
return *pAccessibilityOptions;
}
SvtCTLOptions& SwModule::GetCTLOptions()
{
if(!pCTLOptions)
{
pCTLOptions = new SvtCTLOptions;
pCTLOptions->AddListener(this);
}
return *pCTLOptions;
}
SvtUserOptions& SwModule::GetUserOptions()
{
if(!pUserOptions)
{
pUserOptions = new SvtUserOptions;
pUserOptions->AddListener(this);
}
return *pUserOptions;
}
const SwMasterUsrPref *SwModule::GetUsrPref(sal_Bool bWeb) const
2000-09-18 16:15:01 +00:00
{
SwModule* pNonConstModule = (SwModule*)this;
2000-09-18 16:15:01 +00:00
if(bWeb && !pWebUsrPref)
{
// The SpellChecker is needed in SwMasterUsrPref's Load, but it must not
// be created there #58256#
pNonConstModule->pWebUsrPref = new SwMasterUsrPref(sal_True);
2000-09-18 16:15:01 +00:00
}
else if(!bWeb && !pUsrPref)
{
pNonConstModule->pUsrPref = new SwMasterUsrPref(sal_False);
2000-09-18 16:15:01 +00:00
}
return bWeb ? pWebUsrPref : pUsrPref;
}
void NewXForms( SfxRequest& rReq )
{
// copied & excerpted from SwModule::InsertLab(..)
// create new document
SfxObjectShellLock xDocSh( new SwDocShell( SFX_CREATE_MODE_STANDARD) );
xDocSh->DoInitNew( 0 );
// initialize XForms
static_cast<SwDocShell*>( &xDocSh )->GetDoc()->initXForms( true );
// load document into frame
SfxViewFrame::DisplayNewDocument( *xDocSh, rReq );
// set return value
rReq.SetReturnValue( SfxVoidItem( rReq.GetSlot() ) );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */