2010-10-14 08:30:41 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
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-09-18 16:15:01 +00:00
|
|
|
|
2006-09-16 22:17:47 +00:00
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
#define _SW_FRMVALID_HXX
|
|
|
|
#include <hintids.hxx>
|
2012-06-11 13:15:18 +01:00
|
|
|
#include <comphelper/string.hxx>
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/globalnameitem.hxx>
|
2012-01-20 00:14:44 +09:00
|
|
|
#include <svl/ownlist.hxx>
|
|
|
|
#include <sfx2/frmdescr.hxx>
|
2004-10-04 18:31:15 +00:00
|
|
|
#include <sfx2/objface.hxx>
|
|
|
|
#include <sfx2/lnkbase.hxx>
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
#include <tools/errinf.hxx>
|
|
|
|
#include <svx/svdview.hxx>
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/ptitem.hxx>
|
|
|
|
#include <svl/stritem.hxx>
|
2009-10-06 07:38:24 +02:00
|
|
|
#include <unotools/moduleoptions.hxx>
|
2000-09-18 16:15:01 +00:00
|
|
|
#include <vcl/msgbox.hxx>
|
|
|
|
#include <sfx2/fcontnr.hxx>
|
|
|
|
#include <svx/hlnkitem.hxx>
|
2009-12-10 23:06:35 +01:00
|
|
|
#include <svl/srchitem.hxx>
|
2000-09-18 16:15:01 +00:00
|
|
|
#include <sfx2/dispatch.hxx>
|
|
|
|
#include <sfx2/docfile.hxx>
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/urihelper.hxx>
|
2005-04-13 08:44:43 +00:00
|
|
|
#include <basic/sbxvar.hxx>
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/whiter.hxx>
|
2000-09-18 16:15:01 +00:00
|
|
|
#include <sfx2/request.hxx>
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/opaqitem.hxx>
|
|
|
|
#include <editeng/fontitem.hxx>
|
2013-02-12 13:41:53 -05:00
|
|
|
#include <editeng/adjustitem.hxx>
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/boxitem.hxx>
|
|
|
|
#include <editeng/sizeitem.hxx>
|
|
|
|
#include <editeng/svxacorr.hxx>
|
|
|
|
#include <editeng/scripttypeitem.hxx>
|
2013-01-02 22:07:41 +01:00
|
|
|
#include <vcl/graphicfilter.hxx>
|
2000-09-18 16:15:01 +00:00
|
|
|
#include <svx/htmlmode.hxx>
|
|
|
|
#include <svx/pfiledlg.hxx>
|
2010-01-13 22:25:07 +01:00
|
|
|
#include <svtools/htmlcfg.hxx>
|
2009-09-17 07:35:16 +00:00
|
|
|
#include <com/sun/star/i18n/TransliterationModules.hpp>
|
|
|
|
#include <com/sun/star/i18n/TransliterationModulesExtra.hpp>
|
2013-01-17 11:36:39 -05:00
|
|
|
#include <com/sun/star/embed/Aspects.hpp>
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2003-09-19 07:47:24 +00:00
|
|
|
#include <sot/clsids.hxx>
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/acorrcfg.hxx>
|
2000-09-18 16:15:01 +00:00
|
|
|
#include <wdocsh.hxx>
|
|
|
|
#include <fmtinfmt.hxx>
|
|
|
|
#include <fmtclds.hxx>
|
|
|
|
#include <fmtsrnd.hxx>
|
|
|
|
#include <fmtfsize.hxx>
|
|
|
|
#include <swmodule.hxx>
|
|
|
|
#include <wrtsh.hxx>
|
|
|
|
#include <view.hxx>
|
|
|
|
#include <docsh.hxx>
|
2007-05-22 15:39:17 +00:00
|
|
|
#include <doc.hxx>
|
2000-09-18 16:15:01 +00:00
|
|
|
#include <uitool.hxx>
|
|
|
|
#include <cmdid.h>
|
|
|
|
#include <globals.hrc>
|
|
|
|
#include <frmmgr.hxx>
|
|
|
|
#include <textsh.hxx>
|
|
|
|
#include <frmfmt.hxx>
|
|
|
|
#include <tablemgr.hxx>
|
|
|
|
#include <swundo.hxx> // fuer Undo-IDs
|
|
|
|
#include <shellio.hxx>
|
|
|
|
#include <frmdlg.hxx>
|
|
|
|
#include <usrpref.hxx>
|
|
|
|
#include <swtable.hxx>
|
|
|
|
#include <tblafmt.hxx>
|
|
|
|
#include <caption.hxx>
|
|
|
|
#include <idxmrk.hxx>
|
|
|
|
#include <poolfmt.hxx>
|
2001-09-28 15:53:33 +00:00
|
|
|
#include <breakit.hxx>
|
2002-02-01 11:51:13 +00:00
|
|
|
#include <crsskip.hxx>
|
|
|
|
#include <modcfg.hxx>
|
|
|
|
#include <column.hxx>
|
2002-08-08 13:20:54 +00:00
|
|
|
#include <edtwin.hxx>
|
2000-09-18 16:15:01 +00:00
|
|
|
#include <shells.hrc>
|
|
|
|
#include <popup.hrc>
|
|
|
|
#include <swerror.h>
|
2007-05-22 15:39:17 +00:00
|
|
|
#include <unochart.hxx>
|
|
|
|
|
|
|
|
#include <chartins.hxx>
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
#define SwTextShell
|
|
|
|
#define Paragraph
|
|
|
|
#define HyphenZone
|
|
|
|
#define TextFont
|
|
|
|
#define DropCap
|
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>
|
2004-09-08 14:04:28 +00:00
|
|
|
#include <SwRewriter.hxx>
|
|
|
|
#include <comcore.hrc>
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2004-10-04 18:31:15 +00:00
|
|
|
using namespace ::com::sun::star;
|
2008-03-12 11:55:08 +00:00
|
|
|
using ::rtl::OUString;
|
2004-10-04 18:31:15 +00:00
|
|
|
|
2007-09-27 11:30:42 +00:00
|
|
|
#include <svx/svxdlg.hxx>
|
|
|
|
#include <svx/dialogs.hrc>
|
|
|
|
#include "swabstdlg.hxx"
|
|
|
|
#include <misc.hrc>
|
|
|
|
#include <table.hrc>
|
|
|
|
#include <frmui.hrc>
|
|
|
|
#include <unomid.h>
|
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
SFX_IMPL_INTERFACE(SwTextShell, SwBaseShell, SW_RES(STR_SHELLNAME_TEXT))
|
|
|
|
{
|
|
|
|
SFX_POPUPMENU_REGISTRATION(SW_RES(MN_TEXT_POPUPMENU));
|
|
|
|
SFX_OBJECTBAR_REGISTRATION(SFX_OBJECTBAR_OBJECT, SW_RES(RID_TEXT_TOOLBOX));
|
|
|
|
SFX_CHILDWINDOW_REGISTRATION(FN_EDIT_FORMULA);
|
|
|
|
SFX_CHILDWINDOW_REGISTRATION(FN_INSERT_FIELD);
|
|
|
|
SFX_CHILDWINDOW_REGISTRATION(FN_INSERT_IDX_ENTRY_DLG);
|
|
|
|
SFX_CHILDWINDOW_REGISTRATION(FN_INSERT_AUTH_ENTRY_DLG);
|
2001-07-24 06:53:46 +00:00
|
|
|
SFX_CHILDWINDOW_REGISTRATION(SID_RUBY_DIALOG);
|
2011-11-01 22:47:33 -06:00
|
|
|
SFX_CHILDWINDOW_REGISTRATION(FN_WORDCOUNT_DIALOG);
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
TYPEINIT1(SwTextShell,SwBaseShell)
|
|
|
|
|
|
|
|
void SwTextShell::ExecInsert(SfxRequest &rReq)
|
|
|
|
{
|
|
|
|
SwWrtShell &rSh = GetShell();
|
|
|
|
|
2010-10-24 23:48:32 +02:00
|
|
|
OSL_ENSURE( !rSh.IsObjSelected() && !rSh.IsFrmSelected(),
|
|
|
|
"wrong shell on dispatcher" );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
const SfxItemSet *pArgs = rReq.GetArgs();
|
|
|
|
const SfxPoolItem* pItem = 0;
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nSlot = rReq.GetSlot();
|
2000-09-18 16:15:01 +00:00
|
|
|
if(pArgs)
|
2011-01-17 15:06:54 +01:00
|
|
|
pArgs->GetItemState(nSlot, sal_False, &pItem );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
switch( nSlot )
|
|
|
|
{
|
2002-05-06 06:15:01 +00:00
|
|
|
case FN_INSERT_STRING:
|
|
|
|
if( pItem )
|
|
|
|
rSh.InsertByWord(((const SfxStringItem *)pItem)->GetValue());
|
|
|
|
break;
|
2000-09-18 16:15:01 +00:00
|
|
|
case FN_INSERT_SOFT_HYPHEN:
|
2011-01-17 15:06:54 +01:00
|
|
|
if( CHAR_SOFTHYPHEN != rSh.SwCrsrShell::GetChar( sal_True, 0 ) &&
|
|
|
|
CHAR_SOFTHYPHEN != rSh.SwCrsrShell::GetChar( sal_True, -1 ))
|
2012-07-04 23:58:05 +01:00
|
|
|
rSh.Insert( rtl::OUString( CHAR_SOFTHYPHEN ) );
|
2000-09-18 16:15:01 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FN_INSERT_HARDHYPHEN:
|
|
|
|
case FN_INSERT_HARD_SPACE:
|
|
|
|
{
|
|
|
|
sal_Unicode cIns = FN_INSERT_HARD_SPACE == nSlot ? CHAR_HARDBLANK
|
|
|
|
: CHAR_HARDHYPHEN;
|
|
|
|
|
2011-05-20 09:06:56 +01:00
|
|
|
SvxAutoCorrCfg& rACfg = SvxAutoCorrCfg::Get();
|
|
|
|
SvxAutoCorrect* pACorr = rACfg.GetAutoCorrect();
|
|
|
|
if( pACorr && rACfg.IsAutoFmtByInput() &&
|
2003-09-04 10:49:45 +00:00
|
|
|
pACorr->IsAutoCorrFlag( CptlSttSntnc | CptlSttWrd |
|
2009-11-25 14:41:44 +01:00
|
|
|
AddNonBrkSpace | ChgOrdinalNumber |
|
2000-09-18 16:15:01 +00:00
|
|
|
ChgToEnEmDash | SetINetAttr | Autocorrect ))
|
|
|
|
rSh.AutoCorrect( *pACorr, cIns );
|
|
|
|
else
|
2012-07-04 23:58:05 +01:00
|
|
|
rSh.Insert( rtl::OUString( cIns ) );
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
break;
|
2005-11-16 08:52:47 +00:00
|
|
|
case SID_INSERT_RLM :
|
|
|
|
case SID_INSERT_LRM :
|
|
|
|
case SID_INSERT_ZWNBSP :
|
|
|
|
case SID_INSERT_ZWSP:
|
|
|
|
{
|
|
|
|
sal_Unicode cIns = 0;
|
|
|
|
switch(nSlot)
|
|
|
|
{
|
|
|
|
case SID_INSERT_RLM : cIns = CHAR_RLM ; break;
|
|
|
|
case SID_INSERT_LRM : cIns = CHAR_LRM ; break;
|
|
|
|
case SID_INSERT_ZWSP : cIns = CHAR_ZWSP ; break;
|
|
|
|
case SID_INSERT_ZWNBSP: cIns = CHAR_ZWNBSP; break;
|
|
|
|
}
|
2012-07-04 23:58:05 +01:00
|
|
|
rSh.Insert( rtl::OUString( cIns ) );
|
2005-11-16 08:52:47 +00:00
|
|
|
}
|
|
|
|
break;
|
2000-09-18 16:15:01 +00:00
|
|
|
case FN_INSERT_BREAK:
|
|
|
|
rSh.SplitNode();
|
2002-07-01 08:09:41 +00:00
|
|
|
rReq.Done();
|
2000-09-18 16:15:01 +00:00
|
|
|
break;
|
|
|
|
case FN_INSERT_PAGEBREAK:
|
|
|
|
rSh.InsertPageBreak();
|
2002-07-01 08:09:41 +00:00
|
|
|
rReq.Done();
|
2000-09-18 16:15:01 +00:00
|
|
|
break;
|
|
|
|
case FN_INSERT_LINEBREAK:
|
|
|
|
rSh.InsertLineBreak();
|
2002-07-01 08:09:41 +00:00
|
|
|
rReq.Done();
|
2000-09-18 16:15:01 +00:00
|
|
|
break;
|
|
|
|
case FN_INSERT_COLUMN_BREAK:
|
|
|
|
rSh.InsertColumnBreak();
|
2002-07-01 08:09:41 +00:00
|
|
|
rReq.Done();
|
2000-09-18 16:15:01 +00:00
|
|
|
break;
|
|
|
|
case SID_HYPERLINK_SETLINK:
|
|
|
|
if (pItem)
|
|
|
|
InsertHyperlink(*((const SvxHyperlinkItem *)pItem));
|
2002-07-01 08:09:41 +00:00
|
|
|
rReq.Done();
|
2000-09-18 16:15:01 +00:00
|
|
|
break;
|
2004-08-12 09:16:06 +00:00
|
|
|
case SID_INSERT_AVMEDIA:
|
|
|
|
rReq.SetReturnValue(SfxBoolItem(nSlot, InsertMediaDlg( rReq )));
|
|
|
|
break;
|
2000-09-18 16:15:01 +00:00
|
|
|
case SID_INSERT_SOUND:
|
|
|
|
case SID_INSERT_VIDEO:
|
|
|
|
{
|
|
|
|
SvxPluginFileDlg aDlg( &GetView().GetViewFrame()->GetWindow(), nSlot );
|
2002-10-18 12:33:36 +00:00
|
|
|
aDlg.SetContext( nSlot == SID_INSERT_SOUND? sfx2::FileDialogHelper::SW_INSERT_SOUND : sfx2::FileDialogHelper::SW_INSERT_VIDEO );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2001-10-25 14:38:22 +00:00
|
|
|
if ( ERRCODE_NONE == aDlg.Execute() )
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
|
|
|
// URL ermitteln
|
|
|
|
String aStrURL( aDlg.GetPath() );
|
2005-01-11 11:44:11 +00:00
|
|
|
aStrURL = URIHelper::SmartRel2Abs(
|
|
|
|
INetURLObject(), aStrURL, URIHelper::GetMaybeFileHdl() );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
INetURLObject* pURL = new INetURLObject();
|
|
|
|
pURL->SetSmartProtocol( INET_PROT_FILE );
|
|
|
|
|
|
|
|
if ( pURL->SetURL( aStrURL, INetURLObject::WAS_ENCODED ) )
|
|
|
|
{
|
2004-10-04 18:31:15 +00:00
|
|
|
::rtl::OUString aName;
|
|
|
|
comphelper::EmbeddedObjectContainer aCnt;
|
2006-10-13 10:12:37 +00:00
|
|
|
svt::EmbeddedObjectRef xObj( aCnt.CreateEmbeddedObject( SvGlobalName( SO3_PLUGIN_CLASSID ).GetByteSequence(), aName ), embed::Aspects::MSOLE_CONTENT );
|
2004-10-04 18:31:15 +00:00
|
|
|
if ( xObj.is() )
|
|
|
|
{
|
2006-02-01 17:52:07 +00:00
|
|
|
svt::EmbeddedObjectRef::TryRunningState( xObj.GetObject() );
|
|
|
|
|
2004-10-04 18:31:15 +00:00
|
|
|
// set properties from dialog
|
|
|
|
uno::Reference < beans::XPropertySet > xSet( xObj->getComponent(), uno::UNO_QUERY );
|
|
|
|
if ( xSet.is() )
|
|
|
|
{
|
2010-10-27 11:38:46 +01:00
|
|
|
xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PluginURL")),
|
2004-10-04 18:31:15 +00:00
|
|
|
uno::makeAny( ::rtl::OUString( pURL->GetMainURL( INetURLObject::NO_DECODE ) ) ) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
rSh.InsertObject( xObj, 0, sal_True, nSlot);
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_INSERT_OBJECT:
|
|
|
|
case SID_INSERT_PLUGIN:
|
2003-03-27 14:45:43 +00:00
|
|
|
{
|
|
|
|
SFX_REQUEST_ARG( rReq, pNameItem, SfxGlobalNameItem, SID_INSERT_OBJECT, sal_False );
|
|
|
|
SvGlobalName *pName = NULL;
|
|
|
|
SvGlobalName aName;
|
|
|
|
if ( pNameItem )
|
|
|
|
{
|
|
|
|
aName = pNameItem->GetValue();
|
|
|
|
pName = &aName;
|
|
|
|
}
|
|
|
|
|
2003-08-19 11:28:55 +00:00
|
|
|
SFX_REQUEST_ARG( rReq, pClassLocationItem, SfxStringItem, FN_PARAM_2, sal_False );
|
|
|
|
SFX_REQUEST_ARG( rReq, pCommandsItem, SfxStringItem, FN_PARAM_3, sal_False );
|
2004-10-04 18:31:15 +00:00
|
|
|
//TODO/LATER: recording currently not working, need code for Commandlist
|
|
|
|
svt::EmbeddedObjectRef xObj;
|
2010-10-22 10:48:39 +02:00
|
|
|
if( nSlot == SID_INSERT_PLUGIN && ( pClassLocationItem || pCommandsItem ) )
|
2003-08-19 11:28:55 +00:00
|
|
|
{
|
|
|
|
String sClassLocation;
|
|
|
|
if(pClassLocationItem)
|
|
|
|
sClassLocation = pClassLocationItem->GetValue();
|
2004-10-04 18:31:15 +00:00
|
|
|
|
2003-08-19 11:28:55 +00:00
|
|
|
SvCommandList aCommandList;
|
|
|
|
if(pCommandsItem)
|
|
|
|
{
|
2012-02-03 02:34:17 +09:00
|
|
|
sal_Int32 nTemp;
|
2003-08-19 11:28:55 +00:00
|
|
|
aCommandList.AppendCommands( pCommandsItem->GetValue(), &nTemp );
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
2004-10-04 18:31:15 +00:00
|
|
|
comphelper::EmbeddedObjectContainer aCnt;
|
2007-09-27 11:30:42 +00:00
|
|
|
::rtl::OUString sName;
|
|
|
|
xObj.Assign( aCnt.CreateEmbeddedObject( SvGlobalName( SO3_PLUGIN_CLASSID ).GetByteSequence(), sName ),
|
2006-10-13 10:12:37 +00:00
|
|
|
embed::Aspects::MSOLE_CONTENT );
|
2006-02-01 17:52:07 +00:00
|
|
|
svt::EmbeddedObjectRef::TryRunningState( xObj.GetObject() );
|
2004-10-04 18:31:15 +00:00
|
|
|
uno::Reference < beans::XPropertySet > xSet( xObj->getComponent(), uno::UNO_QUERY );
|
|
|
|
if ( xSet.is() )
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
if ( sClassLocation.Len() )
|
2010-10-27 11:38:46 +01:00
|
|
|
xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PluginURL")),
|
2005-01-11 11:44:11 +00:00
|
|
|
uno::makeAny(
|
|
|
|
::rtl::OUString(
|
|
|
|
URIHelper::SmartRel2Abs(
|
|
|
|
INetURLObject(), sClassLocation,
|
|
|
|
URIHelper::GetMaybeFileHdl()) ) ) );
|
2004-10-04 18:31:15 +00:00
|
|
|
uno::Sequence< beans::PropertyValue > aSeq;
|
2011-05-18 18:58:39 -07:00
|
|
|
if ( aCommandList.size() )
|
2004-10-04 18:31:15 +00:00
|
|
|
{
|
|
|
|
aCommandList.FillSequence( aSeq );
|
2010-10-27 11:38:46 +01:00
|
|
|
xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PluginCommands")), uno::makeAny( aSeq ) );
|
2004-10-04 18:31:15 +00:00
|
|
|
}
|
|
|
|
}
|
2011-11-22 09:06:06 +00:00
|
|
|
catch (const uno::Exception&)
|
2004-10-04 18:31:15 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
2003-08-19 11:28:55 +00:00
|
|
|
}
|
2004-10-04 18:31:15 +00:00
|
|
|
|
|
|
|
if(xObj.is())
|
|
|
|
rSh.InsertOleObject( xObj );
|
2003-08-19 11:28:55 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-10-24 23:48:32 +02:00
|
|
|
OSL_ENSURE( !pNameItem || nSlot == SID_INSERT_OBJECT, "Superfluous argument!" );
|
2011-01-17 15:06:54 +01:00
|
|
|
rSh.InsertObject( xObj, pName, sal_True, nSlot);
|
2003-08-19 11:28:55 +00:00
|
|
|
rReq.Done();
|
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
break;
|
2003-03-27 14:45:43 +00:00
|
|
|
}
|
2003-08-19 11:28:55 +00:00
|
|
|
case SID_INSERT_FLOATINGFRAME:
|
|
|
|
{
|
2004-10-04 18:31:15 +00:00
|
|
|
svt::EmbeddedObjectRef xObj;
|
2003-08-19 11:28:55 +00:00
|
|
|
SFX_REQUEST_ARG( rReq, pNameItem, SfxStringItem, FN_PARAM_1, sal_False );
|
|
|
|
SFX_REQUEST_ARG( rReq, pURLItem, SfxStringItem, FN_PARAM_2, sal_False );
|
|
|
|
SFX_REQUEST_ARG( rReq, pMarginItem, SvxSizeItem, FN_PARAM_3, sal_False );
|
|
|
|
SFX_REQUEST_ARG( rReq, pScrollingItem, SfxByteItem, FN_PARAM_4, sal_False );
|
|
|
|
SFX_REQUEST_ARG( rReq, pBorderItem, SfxBoolItem, FN_PARAM_5, sal_False );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2003-08-19 11:28:55 +00:00
|
|
|
if(pURLItem) // URL is a _must_
|
|
|
|
{
|
2004-10-04 18:31:15 +00:00
|
|
|
comphelper::EmbeddedObjectContainer aCnt;
|
|
|
|
::rtl::OUString aName;
|
2006-10-13 10:12:37 +00:00
|
|
|
xObj.Assign( aCnt.CreateEmbeddedObject( SvGlobalName( SO3_IFRAME_CLASSID ).GetByteSequence(), aName ),
|
|
|
|
embed::Aspects::MSOLE_CONTENT );
|
2006-02-01 17:52:07 +00:00
|
|
|
svt::EmbeddedObjectRef::TryRunningState( xObj.GetObject() );
|
2004-10-04 18:31:15 +00:00
|
|
|
uno::Reference < beans::XPropertySet > xSet( xObj->getComponent(), uno::UNO_QUERY );
|
|
|
|
if ( xSet.is() )
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
ScrollingMode eScroll = ScrollingAuto;
|
|
|
|
if( pScrollingItem && pScrollingItem->GetValue() <= ScrollingAuto )
|
|
|
|
eScroll = (ScrollingMode) pScrollingItem->GetValue();
|
|
|
|
|
|
|
|
Size aMargin;
|
|
|
|
if ( pMarginItem )
|
|
|
|
aMargin = pMarginItem->GetSize();
|
|
|
|
|
|
|
|
if ( pURLItem )
|
2010-10-27 11:38:46 +01:00
|
|
|
xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameURL")), uno::makeAny( ::rtl::OUString( pURLItem->GetValue() ) ) );
|
2004-10-04 18:31:15 +00:00
|
|
|
if ( pNameItem )
|
2010-10-27 11:38:46 +01:00
|
|
|
xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameName")), uno::makeAny( ::rtl::OUString( pNameItem->GetValue() ) ) );
|
2004-10-04 18:31:15 +00:00
|
|
|
|
|
|
|
if ( eScroll == ScrollingAuto )
|
2010-10-27 11:38:46 +01:00
|
|
|
xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameIsAutoScroll")),
|
2004-10-04 18:31:15 +00:00
|
|
|
uno::makeAny( sal_True ) );
|
|
|
|
else
|
2010-10-27 11:38:46 +01:00
|
|
|
xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameIsScrollingMode")),
|
2004-10-04 18:31:15 +00:00
|
|
|
uno::makeAny( (sal_Bool) ( eScroll == ScrollingYes) ) );
|
|
|
|
|
|
|
|
if ( pBorderItem )
|
2010-10-27 11:38:46 +01:00
|
|
|
xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameIsBorder")),
|
2004-10-04 18:31:15 +00:00
|
|
|
uno::makeAny( (sal_Bool) pBorderItem->GetValue() ) );
|
|
|
|
|
|
|
|
if ( pMarginItem )
|
|
|
|
{
|
2010-10-27 11:38:46 +01:00
|
|
|
xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameMarginWidth")),
|
2004-10-04 18:31:15 +00:00
|
|
|
uno::makeAny( sal_Int32( aMargin.Width() ) ) );
|
|
|
|
|
2010-10-27 11:38:46 +01:00
|
|
|
xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameMarginHeight")),
|
2004-10-04 18:31:15 +00:00
|
|
|
uno::makeAny( sal_Int32( aMargin.Height() ) ) );
|
|
|
|
}
|
|
|
|
}
|
2011-11-22 09:06:06 +00:00
|
|
|
catch (const uno::Exception&)
|
2004-10-04 18:31:15 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
rSh.InsertOleObject( xObj );
|
2003-08-19 11:28:55 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
rSh.InsertObject( xObj, 0, sal_True, nSlot);
|
2003-08-19 11:28:55 +00:00
|
|
|
rReq.Done();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
2000-09-18 16:15:01 +00:00
|
|
|
case SID_INSERT_DIAGRAM:
|
|
|
|
{
|
2000-11-14 17:32:27 +00:00
|
|
|
SvtModuleOptions aMOpt;
|
|
|
|
if ( !aMOpt.IsChart() )
|
2000-09-18 16:15:01 +00:00
|
|
|
break;
|
|
|
|
if(!rReq.IsAPI())
|
|
|
|
{
|
|
|
|
SfxViewFrame* pVFrame = GetView().GetViewFrame();
|
2007-09-27 11:30:42 +00:00
|
|
|
SwInsertChart( &GetView().GetEditWin(), &pVFrame->GetBindings() );
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2007-05-22 15:39:17 +00:00
|
|
|
uno::Reference< chart2::data::XDataProvider > xDataProvider;
|
|
|
|
sal_Bool bFillWithData = sal_True;
|
|
|
|
OUString aRangeString;
|
|
|
|
if (!GetShell().IsTblComplexForChart())
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2007-05-22 15:39:17 +00:00
|
|
|
SwFrmFmt* pTblFmt = GetShell().GetTableFmt();
|
|
|
|
String aCurrentTblName = pTblFmt->GetName();
|
|
|
|
aRangeString = aCurrentTblName;
|
|
|
|
aRangeString += OUString::valueOf( sal_Unicode('.') );
|
|
|
|
aRangeString += GetShell().GetBoxNms();
|
|
|
|
|
|
|
|
// get table data provider
|
|
|
|
xDataProvider.set( GetView().GetDocShell()->getIDocumentChartDataProviderAccess()->GetChartDataProvider() );
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
else
|
2007-05-22 15:39:17 +00:00
|
|
|
bFillWithData = sal_False; // will create chart with only it's default image
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
SwTableFUNC( &rSh, sal_False ).InsertChart( xDataProvider, bFillWithData, aRangeString );
|
2007-05-22 15:39:17 +00:00
|
|
|
rSh.LaunchOLEObj();
|
2004-10-04 18:31:15 +00:00
|
|
|
|
|
|
|
svt::EmbeddedObjectRef& xObj = rSh.GetOLEObject();
|
|
|
|
if(pItem && xObj.is())
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
|
|
|
Size aSize(((SvxSizeItem*)pItem)->GetSize());
|
|
|
|
aSize = OutputDevice::LogicToLogic
|
|
|
|
( aSize, MapMode( MAP_TWIP ), MapMode( MAP_100TH_MM ) );
|
|
|
|
|
|
|
|
if(aSize.Width() > MINLAY&& aSize.Height()> MINLAY)
|
|
|
|
{
|
2004-10-04 18:31:15 +00:00
|
|
|
awt::Size aSz;
|
|
|
|
aSz.Width = aSize.Width();
|
|
|
|
aSz.Height = aSize.Height();
|
|
|
|
xObj->setVisualAreaSize( xObj.GetViewAspect(), aSz );
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FN_INSERT_SMA:
|
|
|
|
{
|
2004-11-09 15:24:18 +00:00
|
|
|
// #i34343# Inserting a math object into an autocompletion crashes
|
|
|
|
// the suggestion has to be removed before
|
|
|
|
GetView().GetEditWin().StopQuickHelp();
|
2003-09-22 08:08:09 +00:00
|
|
|
SvGlobalName aGlobalName( SO3_SM_CLASSID );
|
2011-01-17 15:06:54 +01:00
|
|
|
rSh.InsertObject( svt::EmbeddedObjectRef(), &aGlobalName, sal_True, 0 );
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FN_INSERT_TABLE:
|
2004-06-01 07:06:24 +00:00
|
|
|
InsertTable( rReq );
|
2000-09-18 16:15:01 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FN_INSERT_FRAME_INTERACT_NOCOL:
|
|
|
|
case FN_INSERT_FRAME_INTERACT:
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nCols = 1;
|
|
|
|
sal_Bool bModifier1 = rReq.GetModifier() == KEY_MOD1;
|
2002-10-25 09:49:23 +00:00
|
|
|
if(pArgs)
|
|
|
|
{
|
|
|
|
if(FN_INSERT_FRAME_INTERACT_NOCOL != nSlot &&
|
2011-01-17 15:06:54 +01:00
|
|
|
pArgs->GetItemState(SID_ATTR_COLUMNS, sal_False, &pItem) == SFX_ITEM_SET)
|
2002-10-25 09:49:23 +00:00
|
|
|
nCols = ((SfxUInt16Item *)pItem)->GetValue();
|
2011-01-17 15:06:54 +01:00
|
|
|
if(pArgs->GetItemState(SID_MODIFIER, sal_False, &pItem) == SFX_ITEM_SET)
|
2002-10-25 09:49:23 +00:00
|
|
|
bModifier1 |= KEY_MOD1 == ((SfxUInt16Item *)pItem)->GetValue();
|
|
|
|
}
|
|
|
|
if(bModifier1 )
|
2002-08-08 13:20:54 +00:00
|
|
|
{
|
|
|
|
SwEditWin& rEdtWin = GetView().GetEditWin();
|
|
|
|
Size aWinSize = rEdtWin.GetSizePixel();
|
|
|
|
Point aStartPos(aWinSize.Width()/2, aWinSize.Height() / 2);
|
|
|
|
aStartPos = rEdtWin.PixelToLogic(aStartPos);
|
|
|
|
aStartPos.X() -= 8 * MM50;
|
|
|
|
aStartPos.Y() -= 4 * MM50;
|
|
|
|
Size aSize(16 * MM50, 8 * MM50);
|
2008-08-18 09:50:33 +00:00
|
|
|
GetShell().LockPaint();
|
2002-08-08 13:20:54 +00:00
|
|
|
GetShell().StartAllAction();
|
2011-01-17 15:06:54 +01:00
|
|
|
SwFlyFrmAttrMgr aMgr( sal_True, GetShellPtr(), FRMMGR_TYPE_TEXT );
|
2002-10-25 09:49:23 +00:00
|
|
|
if(nCols > 1)
|
|
|
|
{
|
|
|
|
SwFmtCol aCol;
|
|
|
|
aCol.Init( nCols, aCol.GetGutterWidth(), aCol.GetWishWidth() );
|
|
|
|
aMgr.SetCol( aCol );
|
|
|
|
}
|
2010-01-05 16:37:41 +01:00
|
|
|
aMgr.InsertFlyFrm(FLY_AT_PARA, aStartPos, aSize);
|
2002-08-08 13:20:54 +00:00
|
|
|
GetShell().EndAllAction();
|
2008-08-18 09:50:33 +00:00
|
|
|
GetShell().UnlockPaint();
|
2002-08-08 13:20:54 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
GetView().InsFrmMode(nCols);
|
|
|
|
}
|
2002-08-07 10:39:35 +00:00
|
|
|
rReq.Ignore();
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case FN_INSERT_FRAME:
|
|
|
|
{
|
2013-02-18 22:04:45 +09:00
|
|
|
bool bSingleCol = false;
|
2007-09-27 11:30:42 +00:00
|
|
|
if( 0!= dynamic_cast< SwWebDocShell*>( GetView().GetDocShell()) )
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2011-05-20 09:06:56 +01:00
|
|
|
SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
|
|
|
|
sal_uInt16 nExport = rHtmlOpt.GetExportMode();
|
2011-10-06 20:58:11 +03:00
|
|
|
if( HTML_CFG_MSIE == nExport )
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2013-02-18 22:04:45 +09:00
|
|
|
bSingleCol = true;
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
// Rahmen neu anlegen
|
2011-01-17 15:06:54 +01:00
|
|
|
SwFlyFrmAttrMgr aMgr( sal_True, GetShellPtr(), FRMMGR_TYPE_TEXT );
|
2002-08-07 10:39:35 +00:00
|
|
|
if(pArgs)
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2002-08-07 10:39:35 +00:00
|
|
|
Size aSize(aMgr.GetSize());
|
|
|
|
aSize.Width() = GetShell().GetAnyCurRect(RECT_PAGE_PRT).Width();
|
|
|
|
Point aPos = aMgr.GetPos();
|
2010-01-05 16:37:41 +01:00
|
|
|
RndStdIds eAnchor = FLY_AT_PARA;
|
2011-01-17 15:06:54 +01:00
|
|
|
if(pArgs->GetItemState(nSlot, sal_False, &pItem) == SFX_ITEM_SET)
|
2002-08-07 10:39:35 +00:00
|
|
|
eAnchor = (RndStdIds)((SfxUInt16Item *)pItem)->GetValue();
|
2011-01-17 15:06:54 +01:00
|
|
|
if(pArgs->GetItemState(FN_PARAM_1, sal_False, &pItem) == SFX_ITEM_SET)
|
2002-08-07 10:39:35 +00:00
|
|
|
aPos = ((SfxPointItem *)pItem)->GetValue();
|
2011-01-17 15:06:54 +01:00
|
|
|
if(pArgs->GetItemState(FN_PARAM_2, sal_False, &pItem) == SFX_ITEM_SET)
|
2002-08-07 10:39:35 +00:00
|
|
|
aSize = ((SvxSizeItem *)pItem)->GetSize();
|
2011-01-17 15:06:54 +01:00
|
|
|
if(pArgs->GetItemState(SID_ATTR_COLUMNS, sal_False, &pItem) == SFX_ITEM_SET)
|
2002-08-07 10:39:35 +00:00
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nCols = ((SfxUInt16Item *)pItem)->GetValue();
|
2002-08-07 10:39:35 +00:00
|
|
|
if( !bSingleCol && 1 < nCols )
|
|
|
|
{
|
|
|
|
SwFmtCol aFmtCol;
|
|
|
|
aFmtCol.Init( nCols , (rReq.IsAPI() ? 0
|
|
|
|
: DEF_GUTTER_WIDTH), USHRT_MAX );
|
|
|
|
aMgr.SetCol(aFmtCol);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-08-18 09:50:33 +00:00
|
|
|
GetShell().LockPaint();
|
2000-09-18 16:15:01 +00:00
|
|
|
GetShell().StartAllAction();
|
|
|
|
|
2002-08-07 10:39:35 +00:00
|
|
|
aMgr.InsertFlyFrm(eAnchor, aPos, aSize);
|
|
|
|
|
|
|
|
GetShell().EndAllAction();
|
2008-08-18 09:50:33 +00:00
|
|
|
GetShell().UnlockPaint();
|
2002-08-07 10:39:35 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-03-14 16:51:14 +00:00
|
|
|
static sal_uInt16 aFrmAttrRange[] =
|
2002-08-07 10:39:35 +00:00
|
|
|
{
|
|
|
|
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
|
|
|
|
SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
|
|
|
|
FN_GET_PRINT_AREA, FN_GET_PRINT_AREA,
|
|
|
|
SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE,
|
|
|
|
FN_SET_FRM_NAME, FN_SET_FRM_NAME,
|
|
|
|
SID_HTML_MODE, SID_HTML_MODE,
|
|
|
|
0
|
|
|
|
};
|
|
|
|
|
|
|
|
SfxItemSet aSet(GetPool(), aFrmAttrRange );
|
|
|
|
aSet.Put(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(GetView().GetDocShell())));
|
|
|
|
const SwRect &rPg = GetShell().GetAnyCurRect(RECT_PAGE);
|
|
|
|
SwFmtFrmSize aFrmSize(ATT_VAR_SIZE, rPg.Width(), rPg.Height());
|
|
|
|
aFrmSize.SetWhich(GetPool().GetWhich(SID_ATTR_PAGE_SIZE));
|
|
|
|
aSet.Put(aFrmSize);
|
|
|
|
|
|
|
|
const SwRect &rPr = GetShell().GetAnyCurRect(RECT_PAGE_PRT);
|
|
|
|
SwFmtFrmSize aPrtSize(ATT_VAR_SIZE, rPr.Width(), rPr.Height());
|
|
|
|
aPrtSize.SetWhich(GetPool().GetWhich(FN_GET_PRINT_AREA));
|
|
|
|
aSet.Put(aPrtSize);
|
|
|
|
|
|
|
|
aSet.Put(aMgr.GetAttrSet());
|
|
|
|
aSet.SetParent( aMgr.GetAttrSet().GetParent() );
|
|
|
|
|
2007-09-27 11:30:42 +00:00
|
|
|
// Minimalgroesse in Spalten loeschen
|
2002-08-07 10:39:35 +00:00
|
|
|
SvxBoxInfoItem aBoxInfo((SvxBoxInfoItem &)aSet.Get(SID_ATTR_BORDER_INNER));
|
2002-09-11 11:40:19 +00:00
|
|
|
const SvxBoxItem& rBox = (const SvxBoxItem&)aSet.Get(RES_BOX);
|
2011-01-17 15:06:54 +01:00
|
|
|
aBoxInfo.SetMinDist(sal_False);
|
2002-09-11 11:40:19 +00:00
|
|
|
aBoxInfo.SetDefDist(rBox.GetDistance(BOX_LINE_LEFT));
|
2002-08-07 10:39:35 +00:00
|
|
|
aSet.Put(aBoxInfo);
|
|
|
|
|
2002-09-11 11:40:19 +00:00
|
|
|
FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebDocShell, GetView().GetDocShell()));
|
2011-01-17 15:06:54 +01:00
|
|
|
SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)));
|
2004-05-10 15:36:36 +00:00
|
|
|
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
|
2010-10-24 23:48:32 +02:00
|
|
|
OSL_ENSURE(pFact, "Dialogdiet fail!");
|
2007-04-26 08:17:55 +00:00
|
|
|
SfxAbstractTabDialog* pDlg = pFact->CreateFrmTabDialog( DLG_FRM_STD,
|
2011-01-17 15:06:54 +01:00
|
|
|
GetView().GetViewFrame(), &GetView().GetViewFrame()->GetWindow(), aSet, sal_True);
|
2010-10-24 23:48:32 +02:00
|
|
|
OSL_ENSURE(pDlg, "Dialogdiet fail!");
|
2012-10-30 09:54:32 +00:00
|
|
|
if(pDlg->Execute() == RET_OK && pDlg->GetOutputItemSet())
|
2002-08-07 10:39:35 +00:00
|
|
|
{
|
2010-11-01 12:20:46 +01:00
|
|
|
//local variable necessary at least after call of .AutoCaption() because this could be deleted at this point
|
|
|
|
SwWrtShell& rShell = GetShell();
|
|
|
|
rShell.LockPaint();
|
|
|
|
rShell.StartAllAction();
|
|
|
|
rShell.StartUndo(UNDO_INSERT);
|
2002-08-07 10:39:35 +00:00
|
|
|
|
|
|
|
const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
|
|
|
|
aMgr.SetAttrSet(*pOutSet);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2002-08-07 10:39:35 +00:00
|
|
|
// beim ClickToEditFeld erst die Selektion loeschen
|
2010-11-01 12:20:46 +01:00
|
|
|
if( rShell.IsInClickToEdit() )
|
|
|
|
rShell.DelRight();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2002-08-07 10:39:35 +00:00
|
|
|
aMgr.InsertFlyFrm();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2007-09-27 11:30:42 +00:00
|
|
|
uno::Reference< frame::XDispatchRecorder > xRecorder =
|
2002-08-07 10:39:35 +00:00
|
|
|
GetView().GetViewFrame()->GetBindings().GetRecorder();
|
|
|
|
if ( xRecorder.is() )
|
|
|
|
{
|
|
|
|
//FN_INSERT_FRAME
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nAnchor = (sal_uInt16)aMgr.GetAnchor();
|
2002-08-07 10:39:35 +00:00
|
|
|
rReq.AppendItem(SfxUInt16Item(nSlot, nAnchor));
|
2010-11-01 12:20:46 +01:00
|
|
|
rReq.AppendItem(SfxPointItem(FN_PARAM_1, rShell.GetObjAbsPos()));
|
|
|
|
rReq.AppendItem(SvxSizeItem(FN_PARAM_2, rShell.GetObjSize()));
|
2002-08-07 10:39:35 +00:00
|
|
|
rReq.Done();
|
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2002-08-07 10:39:35 +00:00
|
|
|
GetView().AutoCaption(FRAME_CAP);
|
2004-11-09 12:52:01 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
SwRewriter aRewriter;
|
|
|
|
|
2012-04-02 09:34:41 +01:00
|
|
|
aRewriter.AddRule(UndoArg1, SW_RESSTR(STR_FRAME));
|
2004-11-09 12:52:01 +00:00
|
|
|
|
2010-11-01 12:20:46 +01:00
|
|
|
rShell.EndUndo(UNDO_INSERT, &aRewriter);
|
2004-11-09 12:52:01 +00:00
|
|
|
}
|
2010-11-01 12:20:46 +01:00
|
|
|
rShell.EndAllAction();
|
|
|
|
rShell.UnlockPaint();
|
2002-08-07 10:39:35 +00:00
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2002-08-07 10:39:35 +00:00
|
|
|
DELETEZ(pDlg);
|
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case FN_FORMAT_COLUMN :
|
|
|
|
{
|
2004-05-10 15:36:36 +00:00
|
|
|
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
|
2010-10-24 23:48:32 +02:00
|
|
|
OSL_ENSURE(pFact, "Dialogdiet fail!");
|
2007-04-26 08:17:55 +00:00
|
|
|
VclAbstractDialog* pColDlg = pFact->CreateVclAbstractDialog( GetView().GetWindow(), rSh, DLG_COLUMN);
|
2010-10-24 23:48:32 +02:00
|
|
|
OSL_ENSURE(pColDlg, "Dialogdiet fail!");
|
2000-09-18 16:15:01 +00:00
|
|
|
pColDlg->Execute();
|
|
|
|
delete pColDlg;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2010-10-24 23:48:32 +02:00
|
|
|
OSL_ENSURE(!this, "wrong dispatcher");
|
2000-09-18 16:15:01 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-10-12 16:49:40 +02:00
|
|
|
static bool lcl_IsMarkInSameSection( SwWrtShell& rWrtSh, const SwSection* pSect )
|
2007-11-06 15:26:57 +00:00
|
|
|
{
|
|
|
|
rWrtSh.SwapPam();
|
|
|
|
bool bRet = pSect == rWrtSh.GetCurrSection();
|
|
|
|
rWrtSh.SwapPam();
|
|
|
|
return bRet;
|
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
void SwTextShell::StateInsert( SfxItemSet &rSet )
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nHtmlMode = ::GetHtmlMode(GetView().GetDocShell());
|
2000-09-18 16:15:01 +00:00
|
|
|
SfxWhichIter aIter( rSet );
|
|
|
|
SwWrtShell &rSh = GetShell();
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nWhich = aIter.FirstWhich();
|
2000-11-14 17:32:27 +00:00
|
|
|
SvtModuleOptions aMOpt;
|
2007-11-21 12:55:23 +00:00
|
|
|
SfxObjectCreateMode eCreateMode =
|
|
|
|
GetView().GetDocShell()->GetCreateMode();
|
2009-02-13 11:19:56 +00:00
|
|
|
|
|
|
|
rSh.Push();
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_Bool bCrsrInHidden = rSh.SelectHiddenRange();
|
2011-04-16 16:19:09 -03:00
|
|
|
// #i103839#
|
2011-01-17 15:06:54 +01:00
|
|
|
// Do not call method <SwCrsrShell::Pop(..)> with 1st parameter = <sal_False>
|
2009-09-07 07:48:12 +00:00
|
|
|
// in order to avoid that the view jumps to the visible cursor.
|
|
|
|
rSh.Pop();
|
2009-02-13 11:19:56 +00:00
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
while ( nWhich )
|
|
|
|
{
|
|
|
|
switch ( nWhich )
|
|
|
|
{
|
|
|
|
case SID_INSERT_SOUND:
|
|
|
|
case SID_INSERT_VIDEO:
|
2009-09-08 10:44:42 +00:00
|
|
|
/*!SvxPluginFileDlg::IsAvailable( nWhich ) ||
|
|
|
|
|
|
|
|
discussed with mba: for performance reasons we skip the IsAvailable call here
|
|
|
|
*/
|
2000-09-18 16:15:01 +00:00
|
|
|
if ( GetShell().IsSelFrmMode() ||
|
2009-02-13 11:19:56 +00:00
|
|
|
SFX_CREATE_MODE_EMBEDDED == eCreateMode || bCrsrInHidden )
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
|
|
|
rSet.DisableItem( nWhich );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_INSERT_DIAGRAM:
|
2009-02-13 11:19:56 +00:00
|
|
|
if( !aMOpt.IsChart() || eCreateMode == SFX_CREATE_MODE_EMBEDDED || bCrsrInHidden )
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
|
|
|
rSet.DisableItem( nWhich );
|
|
|
|
}
|
2007-05-22 15:39:17 +00:00
|
|
|
break;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
case FN_INSERT_SMA:
|
2009-02-13 11:19:56 +00:00
|
|
|
if( !aMOpt.IsMath() || eCreateMode == SFX_CREATE_MODE_EMBEDDED || bCrsrInHidden )
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
|
|
|
rSet.DisableItem( nWhich );
|
|
|
|
}
|
2007-05-22 15:39:17 +00:00
|
|
|
break;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
case SID_INSERT_FLOATINGFRAME:
|
|
|
|
case SID_INSERT_OBJECT:
|
|
|
|
case SID_INSERT_PLUGIN:
|
|
|
|
{
|
2010-07-19 22:04:23 +02:00
|
|
|
if( eCreateMode == SFX_CREATE_MODE_EMBEDDED || bCrsrInHidden )
|
2007-05-22 15:39:17 +00:00
|
|
|
{
|
2000-09-18 16:15:01 +00:00
|
|
|
rSet.DisableItem( nWhich );
|
2007-05-22 15:39:17 +00:00
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
else if( GetShell().IsSelFrmMode())
|
|
|
|
rSet.DisableItem( nWhich );
|
|
|
|
else if(SID_INSERT_FLOATINGFRAME == nWhich && nHtmlMode&HTMLMODE_ON)
|
|
|
|
{
|
2011-05-20 09:06:56 +01:00
|
|
|
SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
|
|
|
|
sal_uInt16 nExport = rHtmlOpt.GetExportMode();
|
2011-08-13 13:40:46 +03:00
|
|
|
if(HTML_CFG_MSIE != nExport && HTML_CFG_WRITER != nExport )
|
2000-09-18 16:15:01 +00:00
|
|
|
rSet.DisableItem(nWhich);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case FN_INSERT_FRAME_INTERACT_NOCOL :
|
|
|
|
case FN_INSERT_FRAME_INTERACT:
|
|
|
|
{
|
2012-08-24 18:53:36 +03:00
|
|
|
if ( GetShell().IsSelFrmMode() || bCrsrInHidden )
|
2000-09-18 16:15:01 +00:00
|
|
|
rSet.DisableItem(nWhich);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_HYPERLINK_GETLINK:
|
|
|
|
{
|
|
|
|
SfxItemSet aSet(GetPool(), RES_TXTATR_INETFMT, RES_TXTATR_INETFMT);
|
2008-03-05 16:26:10 +00:00
|
|
|
rSh.GetCurAttr( aSet );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
SvxHyperlinkItem aHLinkItem;
|
|
|
|
const SfxPoolItem* pItem;
|
2011-01-17 15:06:54 +01:00
|
|
|
if(SFX_ITEM_SET == aSet.GetItemState(RES_TXTATR_INETFMT, sal_False, &pItem))
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
|
|
|
const SwFmtINetFmt* pINetFmt = (const SwFmtINetFmt*)pItem;
|
|
|
|
aHLinkItem.SetURL(pINetFmt->GetValue());
|
|
|
|
aHLinkItem.SetTargetFrame(pINetFmt->GetTargetFrame());
|
|
|
|
aHLinkItem.SetIntName(pINetFmt->GetName());
|
|
|
|
const SvxMacro *pMacro = pINetFmt->GetMacro( SFX_EVENT_MOUSEOVER_OBJECT );
|
|
|
|
if( pMacro )
|
|
|
|
aHLinkItem.SetMacro(HYPERDLG_EVENT_MOUSEOVER_OBJECT, *pMacro);
|
|
|
|
|
|
|
|
pMacro = pINetFmt->GetMacro( SFX_EVENT_MOUSECLICK_OBJECT );
|
|
|
|
if( pMacro )
|
|
|
|
aHLinkItem.SetMacro(HYPERDLG_EVENT_MOUSECLICK_OBJECT, *pMacro);
|
|
|
|
|
|
|
|
pMacro = pINetFmt->GetMacro( SFX_EVENT_MOUSEOUT_OBJECT );
|
|
|
|
if( pMacro )
|
|
|
|
aHLinkItem.SetMacro(HYPERDLG_EVENT_MOUSEOUT_OBJECT, *pMacro);
|
|
|
|
|
|
|
|
// Text des Links besorgen
|
|
|
|
rSh.StartAction();
|
|
|
|
rSh.CreateCrsr();
|
2011-01-17 15:06:54 +01:00
|
|
|
rSh.SwCrsrShell::SelectTxtAttr(RES_TXTATR_INETFMT,sal_True);
|
2000-09-18 16:15:01 +00:00
|
|
|
String sLinkName = rSh.GetSelTxt();
|
|
|
|
aHLinkItem.SetName(sLinkName);
|
|
|
|
aHLinkItem.SetInsertMode(HLINK_FIELD);
|
|
|
|
rSh.DestroyCrsr();
|
|
|
|
rSh.EndAction();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
String sReturn = rSh.GetSelTxt();
|
|
|
|
sReturn.Erase(255);
|
2012-06-11 13:15:18 +01:00
|
|
|
aHLinkItem.SetName(comphelper::string::stripEnd(sReturn, ' '));
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
aHLinkItem.SetInsertMode((SvxLinkInsertMode)(aHLinkItem.GetInsertMode() |
|
|
|
|
((nHtmlMode & HTMLMODE_ON) != 0 ? HLINK_HTMLMODE : 0)));
|
|
|
|
aHLinkItem.SetMacroEvents ( HYPERDLG_EVENT_MOUSEOVER_OBJECT|
|
|
|
|
HYPERDLG_EVENT_MOUSECLICK_OBJECT | HYPERDLG_EVENT_MOUSEOUT_OBJECT );
|
|
|
|
|
|
|
|
rSet.Put(aHLinkItem);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FN_INSERT_FRAME:
|
|
|
|
if(rSh.IsSelFrmMode())
|
|
|
|
{
|
|
|
|
const int nSel = rSh.GetSelectionType();
|
2009-02-13 11:19:56 +00:00
|
|
|
if( ((nsSelectionType::SEL_GRF | nsSelectionType::SEL_OLE ) & nSel ) || bCrsrInHidden )
|
2000-09-18 16:15:01 +00:00
|
|
|
rSet.DisableItem(nWhich);
|
|
|
|
}
|
|
|
|
break;
|
2007-11-06 15:26:57 +00:00
|
|
|
case FN_FORMAT_COLUMN :
|
|
|
|
{
|
|
|
|
//#i80458# column dialog cannot work if the selection contains different page styles and different sections
|
|
|
|
bool bDisable = true;
|
|
|
|
if( rSh.GetFlyFrmFmt() || rSh.GetSelectedPageDescs() )
|
|
|
|
bDisable = false;
|
|
|
|
if( bDisable )
|
|
|
|
{
|
|
|
|
const SwSection* pCurrSection = rSh.GetCurrSection();
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nFullSectCnt = rSh.GetFullSelectedSectionCount();
|
2007-11-06 15:26:57 +00:00
|
|
|
if( pCurrSection && ( !rSh.HasSelection() || 0 != nFullSectCnt ))
|
|
|
|
bDisable = false;
|
|
|
|
else if(
|
|
|
|
rSh.HasSelection() && rSh.IsInsRegionAvailable() &&
|
|
|
|
( !pCurrSection || ( 1 != nFullSectCnt &&
|
|
|
|
lcl_IsMarkInSameSection( rSh, pCurrSection ) )))
|
|
|
|
bDisable = false;
|
|
|
|
}
|
|
|
|
if(bDisable)
|
|
|
|
rSet.DisableItem(nWhich);
|
|
|
|
}
|
|
|
|
break;
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
nWhich = aIter.NextWhich();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SwTextShell::ExecDelete(SfxRequest &rReq)
|
|
|
|
{
|
|
|
|
SwWrtShell &rSh = GetShell();
|
|
|
|
switch( rReq.GetSlot() )
|
|
|
|
{
|
|
|
|
case FN_DELETE_SENT:
|
|
|
|
if( rSh.IsTableMode() )
|
|
|
|
{
|
|
|
|
rSh.DeleteRow();
|
|
|
|
rSh.EnterStdMode();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
rSh.DelToEndOfSentence();
|
|
|
|
break;
|
|
|
|
case FN_DELETE_BACK_SENT:
|
|
|
|
rSh.DelToStartOfSentence();
|
|
|
|
break;
|
|
|
|
case FN_DELETE_WORD:
|
|
|
|
rSh.DelNxtWord();
|
|
|
|
break;
|
|
|
|
case FN_DELETE_BACK_WORD:
|
|
|
|
rSh.DelPrvWord();
|
|
|
|
break;
|
|
|
|
case FN_DELETE_LINE:
|
|
|
|
rSh.DelToEndOfLine();
|
|
|
|
break;
|
|
|
|
case FN_DELETE_BACK_LINE:
|
|
|
|
rSh.DelToStartOfLine();
|
|
|
|
break;
|
|
|
|
case FN_DELETE_PARA:
|
|
|
|
rSh.DelToEndOfPara();
|
|
|
|
break;
|
|
|
|
case FN_DELETE_BACK_PARA:
|
|
|
|
rSh.DelToStartOfPara();
|
|
|
|
break;
|
|
|
|
case FN_DELETE_WHOLE_LINE:
|
|
|
|
rSh.DelLine();
|
|
|
|
break;
|
|
|
|
default:
|
2010-10-24 23:48:32 +02:00
|
|
|
OSL_ENSURE(!this, "wrong dispatcher");
|
2000-09-18 16:15:01 +00:00
|
|
|
return;
|
|
|
|
}
|
2005-11-10 14:57:57 +00:00
|
|
|
rReq.Done();
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
|
2000-12-21 12:02:28 +00:00
|
|
|
void SwTextShell::ExecTransliteration( SfxRequest & rReq )
|
|
|
|
{
|
|
|
|
using namespace ::com::sun::star::i18n;
|
2011-03-29 21:07:59 +01:00
|
|
|
sal_uInt32 nMode = 0;
|
2000-12-21 12:02:28 +00:00
|
|
|
|
2011-03-29 21:07:59 +01:00
|
|
|
switch( rReq.GetSlot() )
|
|
|
|
{
|
|
|
|
case SID_TRANSLITERATE_SENTENCE_CASE:
|
|
|
|
nMode = TransliterationModulesExtra::SENTENCE_CASE;
|
|
|
|
break;
|
|
|
|
case SID_TRANSLITERATE_TITLE_CASE:
|
|
|
|
nMode = TransliterationModulesExtra::TITLE_CASE;
|
|
|
|
break;
|
|
|
|
case SID_TRANSLITERATE_TOGGLE_CASE:
|
|
|
|
nMode = TransliterationModulesExtra::TOGGLE_CASE;
|
|
|
|
break;
|
|
|
|
case SID_TRANSLITERATE_UPPER:
|
|
|
|
nMode = TransliterationModules_LOWERCASE_UPPERCASE;
|
|
|
|
break;
|
|
|
|
case SID_TRANSLITERATE_LOWER:
|
|
|
|
nMode = TransliterationModules_UPPERCASE_LOWERCASE;
|
|
|
|
break;
|
2000-12-21 12:02:28 +00:00
|
|
|
|
2011-03-29 21:07:59 +01:00
|
|
|
case SID_TRANSLITERATE_HALFWIDTH:
|
|
|
|
nMode = TransliterationModules_FULLWIDTH_HALFWIDTH;
|
|
|
|
break;
|
|
|
|
case SID_TRANSLITERATE_FULLWIDTH:
|
|
|
|
nMode = TransliterationModules_HALFWIDTH_FULLWIDTH;
|
|
|
|
break;
|
2000-12-21 12:02:28 +00:00
|
|
|
|
2011-03-29 21:07:59 +01:00
|
|
|
case SID_TRANSLITERATE_HIRAGANA:
|
|
|
|
nMode = TransliterationModules_KATAKANA_HIRAGANA;
|
|
|
|
break;
|
|
|
|
case SID_TRANSLITERATE_KATAGANA:
|
|
|
|
nMode = TransliterationModules_HIRAGANA_KATAKANA;
|
|
|
|
break;
|
2000-12-21 12:02:28 +00:00
|
|
|
|
2011-03-29 21:07:59 +01:00
|
|
|
default:
|
|
|
|
OSL_ENSURE(!this, "wrong dispatcher");
|
2000-12-21 12:02:28 +00:00
|
|
|
}
|
2011-03-29 21:07:59 +01:00
|
|
|
|
|
|
|
if( nMode )
|
|
|
|
GetShell().TransliterateText( nMode );
|
2000-12-21 12:02:28 +00:00
|
|
|
}
|
|
|
|
|
2011-03-21 12:07:52 +00:00
|
|
|
void SwTextShell::ExecRotateTransliteration( SfxRequest & rReq )
|
|
|
|
{
|
2011-03-29 21:07:59 +01:00
|
|
|
if( rReq.GetSlot() == SID_TRANSLITERATE_ROTATE_CASE )
|
|
|
|
GetShell().TransliterateText( m_aRotateCase.getNextMode() );
|
2011-03-21 12:07:52 +00:00
|
|
|
}
|
|
|
|
|
2007-09-27 11:30:42 +00:00
|
|
|
SwTextShell::SwTextShell(SwView &_rView) :
|
2011-03-29 21:07:59 +01:00
|
|
|
SwBaseShell(_rView), pPostItFldMgr( 0 )
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2012-07-02 16:02:38 +01:00
|
|
|
SetName(rtl::OUString("Text"));
|
2000-09-18 16:15:01 +00:00
|
|
|
SetHelpId(SW_TEXTSHELL);
|
|
|
|
}
|
|
|
|
|
|
|
|
SwTextShell::~SwTextShell()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2002-07-01 08:09:41 +00:00
|
|
|
void SwTextShell::InsertSymbol( SfxRequest& rReq )
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2002-07-01 08:09:41 +00:00
|
|
|
const SfxItemSet *pArgs = rReq.GetArgs();
|
|
|
|
const SfxPoolItem* pItem = 0;
|
|
|
|
if( pArgs )
|
2011-01-17 15:06:54 +01:00
|
|
|
pArgs->GetItemState(GetPool().GetWhich(SID_CHARMAP), sal_False, &pItem);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2002-07-01 08:09:41 +00:00
|
|
|
String aChars, aFontName;
|
|
|
|
if ( pItem )
|
|
|
|
{
|
|
|
|
aChars = ((const SfxStringItem*)pItem)->GetValue();
|
|
|
|
const SfxPoolItem* pFtItem = NULL;
|
2011-01-17 15:06:54 +01:00
|
|
|
pArgs->GetItemState( GetPool().GetWhich(SID_ATTR_SPECIALCHAR), sal_False, &pFtItem);
|
2002-07-01 08:09:41 +00:00
|
|
|
const SfxStringItem* pFontItem = PTR_CAST( SfxStringItem, pFtItem );
|
|
|
|
if ( pFontItem )
|
|
|
|
aFontName = pFontItem->GetValue();
|
|
|
|
}
|
|
|
|
|
|
|
|
SwWrtShell &rSh = GetShell();
|
2001-09-28 15:53:33 +00:00
|
|
|
SfxItemSet aSet( GetPool(), RES_CHRATR_FONT, RES_CHRATR_FONT,
|
|
|
|
RES_CHRATR_CJK_FONT, RES_CHRATR_CJK_FONT,
|
|
|
|
RES_CHRATR_CTL_FONT, RES_CHRATR_CTL_FONT,
|
|
|
|
0 );
|
2008-03-05 16:26:10 +00:00
|
|
|
rSh.GetCurAttr( aSet );
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nScript = rSh.GetScriptType();
|
2001-09-28 15:53:33 +00:00
|
|
|
|
2007-05-10 15:24:25 +00:00
|
|
|
SvxFontItem aFont( RES_CHRATR_FONT );
|
2001-09-28 15:53:33 +00:00
|
|
|
{
|
|
|
|
SvxScriptSetItem aSetItem( SID_ATTR_CHAR_FONT, *aSet.GetPool() );
|
2011-01-17 15:06:54 +01:00
|
|
|
aSetItem.GetItemSet().Put( aSet, sal_False );
|
2001-09-28 15:53:33 +00:00
|
|
|
const SfxPoolItem* pI = aSetItem.GetItemOfScript( nScript );
|
|
|
|
if( pI )
|
|
|
|
aFont = *(SvxFontItem*)pI;
|
|
|
|
else
|
|
|
|
aFont = (SvxFontItem&)aSet.Get( GetWhichOfScript(
|
|
|
|
RES_CHRATR_FONT,
|
2011-01-17 15:06:54 +01:00
|
|
|
GetI18NScriptTypeOfLanguage( (sal_uInt16)GetAppLanguage() ) ));
|
2009-05-06 10:59:57 +00:00
|
|
|
if (!aFontName.Len())
|
|
|
|
aFontName = aFont.GetFamilyName();
|
2001-09-28 15:53:33 +00:00
|
|
|
}
|
|
|
|
|
2002-07-01 08:09:41 +00:00
|
|
|
Font aNewFont(aFontName, Size(1,1)); // Size nur wg. CTOR
|
|
|
|
if( !aChars.Len() )
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
|
|
|
// Eingestellten Font als Default
|
2009-05-06 10:59:57 +00:00
|
|
|
SfxAllItemSet aAllSet( rSh.GetAttrPool() );
|
2011-01-17 15:06:54 +01:00
|
|
|
aAllSet.Put( SfxBoolItem( FN_PARAM_1, sal_False ) );
|
2004-02-03 15:54:43 +00:00
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
SwViewOption aOpt(*GetShell().GetViewOptions());
|
|
|
|
String sSymbolFont = aOpt.GetSymbolFont();
|
2002-07-01 08:09:41 +00:00
|
|
|
if( !aFontName.Len() && sSymbolFont.Len() )
|
2009-05-06 10:59:57 +00:00
|
|
|
aAllSet.Put( SfxStringItem( SID_FONT_NAME, sSymbolFont ) );
|
2000-09-18 16:15:01 +00:00
|
|
|
else
|
2009-05-06 10:59:57 +00:00
|
|
|
aAllSet.Put( SfxStringItem( SID_FONT_NAME, aFont.GetFamilyName() ) );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2009-05-06 10:59:57 +00:00
|
|
|
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
|
|
|
|
SfxAbstractDialog* pDlg = pFact->CreateSfxDialog( GetView().GetWindow(), aAllSet,
|
2009-12-15 23:07:57 +01:00
|
|
|
GetView().GetViewFrame()->GetFrame().GetFrameInterface(), RID_SVXDLG_CHARMAP );
|
2000-09-18 16:15:01 +00:00
|
|
|
if( RET_OK == pDlg->Execute() )
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pCItem, SfxStringItem, SID_CHARMAP, sal_False );
|
|
|
|
SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pFontItem, SvxFontItem, SID_ATTR_CHAR_FONT, sal_False );
|
2009-05-06 10:59:57 +00:00
|
|
|
if ( pFontItem )
|
|
|
|
{
|
|
|
|
aNewFont.SetName( pFontItem->GetFamilyName() );
|
|
|
|
aNewFont.SetStyleName( pFontItem->GetStyleName() );
|
|
|
|
aNewFont.SetCharSet( pFontItem->GetCharSet() );
|
|
|
|
aNewFont.SetPitch( pFontItem->GetPitch() );
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( pCItem )
|
|
|
|
{
|
|
|
|
aChars = pCItem->GetValue();
|
|
|
|
aOpt.SetSymbolFont(aNewFont.GetName());
|
|
|
|
SW_MOD()->ApplyUsrPref(aOpt, &GetView());
|
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
2002-06-14 06:56:50 +00:00
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
delete pDlg;
|
|
|
|
}
|
|
|
|
|
|
|
|
if( aChars.Len() )
|
|
|
|
{
|
|
|
|
rSh.StartAllAction();
|
|
|
|
|
|
|
|
// Selektierten Inhalt loeschen
|
2004-09-08 14:04:28 +00:00
|
|
|
SwRewriter aRewriter;
|
2012-04-02 09:34:41 +01:00
|
|
|
aRewriter.AddRule(UndoArg1, SW_RESSTR(STR_SPECIALCHAR));
|
2004-09-08 14:04:28 +00:00
|
|
|
|
|
|
|
rSh.StartUndo( UNDO_INSERT, &aRewriter );
|
2000-09-18 16:15:01 +00:00
|
|
|
if ( rSh.HasSelection() )
|
|
|
|
{
|
|
|
|
rSh.DelRight();
|
|
|
|
aSet.ClearItem();
|
2008-03-05 16:26:10 +00:00
|
|
|
rSh.GetCurAttr( aSet );
|
2001-09-28 15:53:33 +00:00
|
|
|
|
|
|
|
SvxScriptSetItem aSetItem( SID_ATTR_CHAR_FONT, *aSet.GetPool() );
|
2011-01-17 15:06:54 +01:00
|
|
|
aSetItem.GetItemSet().Put( aSet, sal_False );
|
2001-09-28 15:53:33 +00:00
|
|
|
const SfxPoolItem* pI = aSetItem.GetItemOfScript( nScript );
|
|
|
|
if( pI )
|
|
|
|
aFont = *(SvxFontItem*)pI;
|
|
|
|
else
|
|
|
|
aFont = (SvxFontItem&)aSet.Get( GetWhichOfScript(
|
|
|
|
RES_CHRATR_FONT,
|
2011-01-17 15:06:54 +01:00
|
|
|
GetI18NScriptTypeOfLanguage( (sal_uInt16)GetAppLanguage() ) ));
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Zeichen einfuegen
|
|
|
|
rSh.Insert( aChars );
|
|
|
|
|
2003-04-24 12:49:13 +00:00
|
|
|
// #108876# a font attribute has to be set always due to a guessed script type
|
|
|
|
if( aNewFont.GetName().Len() )
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
|
|
|
SvxFontItem aNewFontItem( aFont );
|
2011-02-18 10:06:26 +01:00
|
|
|
aNewFontItem.SetFamilyName( aNewFont.GetName());
|
|
|
|
aNewFontItem.SetFamily( aNewFont.GetFamily());
|
|
|
|
aNewFontItem.SetPitch( aNewFont.GetPitch());
|
|
|
|
aNewFontItem.SetCharSet( aNewFont.GetCharSet() );
|
2001-09-28 15:53:33 +00:00
|
|
|
|
2007-07-26 07:22:40 +00:00
|
|
|
SfxItemSet aRestoreSet( GetPool(), RES_CHRATR_FONT, RES_CHRATR_FONT,
|
|
|
|
RES_CHRATR_CJK_FONT, RES_CHRATR_CJK_FONT,
|
|
|
|
RES_CHRATR_CTL_FONT, RES_CHRATR_CTL_FONT, 0 );
|
|
|
|
|
2001-09-28 15:53:33 +00:00
|
|
|
nScript = pBreakIt->GetAllScriptsOfText( aChars );
|
|
|
|
if( SCRIPTTYPE_LATIN & nScript )
|
2007-07-26 07:22:40 +00:00
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
aRestoreSet.Put( aSet.Get( RES_CHRATR_FONT, sal_True ) );
|
2001-09-28 15:53:33 +00:00
|
|
|
aSet.Put( aNewFontItem, RES_CHRATR_FONT);
|
2007-07-26 07:22:40 +00:00
|
|
|
}
|
2001-09-28 15:53:33 +00:00
|
|
|
if( SCRIPTTYPE_ASIAN & nScript )
|
2007-07-26 07:22:40 +00:00
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
aRestoreSet.Put( aSet.Get( RES_CHRATR_CJK_FONT, sal_True ) );
|
2001-09-28 15:53:33 +00:00
|
|
|
aSet.Put( aNewFontItem, RES_CHRATR_CJK_FONT );
|
2007-07-26 07:22:40 +00:00
|
|
|
}
|
2001-09-28 15:53:33 +00:00
|
|
|
if( SCRIPTTYPE_COMPLEX & nScript )
|
2007-07-26 07:22:40 +00:00
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
aRestoreSet.Put( aSet.Get( RES_CHRATR_CTL_FONT, sal_True ) );
|
2001-09-28 15:53:33 +00:00
|
|
|
aSet.Put( aNewFontItem, RES_CHRATR_CTL_FONT );
|
2007-07-26 07:22:40 +00:00
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
rSh.SetMark();
|
2011-01-17 15:06:54 +01:00
|
|
|
rSh.ExtendSelection( sal_False, aChars.Len() );
|
2007-09-27 11:30:42 +00:00
|
|
|
rSh.SetAttr( aSet, nsSetAttrMode::SETATTR_DONTEXPAND | nsSetAttrMode::SETATTR_NOFORMATATTR );
|
2000-09-18 16:15:01 +00:00
|
|
|
if( !rSh.IsCrsrPtAtEnd() )
|
|
|
|
rSh.SwapPam();
|
2007-07-26 07:22:40 +00:00
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
rSh.ClearMark();
|
2007-07-26 07:22:40 +00:00
|
|
|
|
2011-04-16 22:42:13 -03:00
|
|
|
// #i75891#
|
2007-07-26 07:22:40 +00:00
|
|
|
// SETATTR_DONTEXPAND does not work if there are already hard attributes.
|
|
|
|
// Therefore we have to restore the font attributes.
|
2008-01-04 12:24:08 +00:00
|
|
|
rSh.SetMark();
|
2007-07-26 07:22:40 +00:00
|
|
|
rSh.SetAttr( aRestoreSet );
|
2008-01-04 12:24:08 +00:00
|
|
|
rSh.ClearMark();
|
2007-07-26 07:22:40 +00:00
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
rSh.UpdateAttr();
|
2002-07-01 08:09:41 +00:00
|
|
|
aFont = aNewFontItem;
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
rSh.EndAllAction();
|
2011-01-20 19:19:11 +01:00
|
|
|
rSh.EndUndo();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2002-07-01 08:09:41 +00:00
|
|
|
if ( aChars.Len() )
|
|
|
|
{
|
2009-05-06 10:59:57 +00:00
|
|
|
rReq.AppendItem( SfxStringItem( GetPool().GetWhich(SID_CHARMAP), aChars ) );
|
|
|
|
rReq.AppendItem( SfxStringItem( SID_ATTR_SPECIALCHAR, aNewFont.GetName() ) );
|
2002-07-01 08:09:41 +00:00
|
|
|
rReq.Done();
|
|
|
|
}
|
|
|
|
}
|
2002-06-14 06:56:50 +00:00
|
|
|
}
|
2010-10-14 08:30:41 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|