2008-02-19 12:57:51 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 20:22:19 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2008-02-19 12:57:51 +00:00
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2008-02-19 12:57:51 +00:00
|
|
|
*
|
2008-04-10 20:22:19 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2008-02-19 12:57:51 +00:00
|
|
|
*
|
2008-04-10 20:22:19 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2008-02-19 12:57:51 +00:00
|
|
|
*
|
2008-04-10 20:22:19 +00:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2008-02-19 12:57:51 +00:00
|
|
|
*
|
2008-04-10 20:22:19 +00:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2008-02-19 12:57:51 +00:00
|
|
|
*
|
2008-04-10 20:22:19 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2008-02-19 12:57:51 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_sw.hxx"
|
2009-11-25 16:52:25 +00:00
|
|
|
|
2008-02-19 12:57:51 +00:00
|
|
|
#include <hintids.hxx>
|
|
|
|
|
|
|
|
#include <com/sun/star/i18n/TransliterationModules.hpp>
|
2009-09-17 07:35:16 +00:00
|
|
|
#include <com/sun/star/i18n/TransliterationModulesExtra.hpp>
|
2008-05-30 08:30:05 +00:00
|
|
|
#include <com/sun/star/i18n/TextConversionOption.hpp>
|
|
|
|
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
|
|
|
|
#include <com/sun/star/lang/XInitialization.hpp>
|
2009-11-25 16:52:25 +00:00
|
|
|
|
|
|
|
#include <tools/shl.hxx>
|
|
|
|
#include <i18npool/mslangid.hxx>
|
2008-02-19 12:57:51 +00:00
|
|
|
#include <sfx2/objface.hxx>
|
|
|
|
#include <sfx2/viewfrm.hxx>
|
|
|
|
#include <sfx2/bindings.hxx>
|
|
|
|
#include <sfx2/dispatch.hxx>
|
|
|
|
#include <sfx2/request.hxx>
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/spltitem.hxx>
|
|
|
|
#include <editeng/orphitem.hxx>
|
|
|
|
#include <editeng/brkitem.hxx>
|
|
|
|
#include <editeng/widwitem.hxx>
|
|
|
|
#include <editeng/kernitem.hxx>
|
|
|
|
#include <editeng/escpitem.hxx>
|
|
|
|
#include <editeng/lspcitem.hxx>
|
|
|
|
#include <editeng/adjitem.hxx>
|
|
|
|
#include <editeng/crsditem.hxx>
|
|
|
|
#include <editeng/shdditem.hxx>
|
|
|
|
#include <editeng/hyznitem.hxx>
|
|
|
|
#include <editeng/udlnitem.hxx>
|
|
|
|
#include <editeng/fontitem.hxx>
|
|
|
|
#include <editeng/fhgtitem.hxx>
|
2008-05-30 08:30:05 +00:00
|
|
|
#include <svx/clipfmtitem.hxx>
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/stritem.hxx>
|
|
|
|
#include <svl/slstitm.hxx>
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/colritem.hxx>
|
|
|
|
#include <editeng/wghtitem.hxx>
|
|
|
|
#include <editeng/cntritem.hxx>
|
|
|
|
#include <editeng/postitem.hxx>
|
|
|
|
#include <editeng/frmdiritem.hxx>
|
2008-02-19 12:57:51 +00:00
|
|
|
#include <svx/svdoutl.hxx>
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/whiter.hxx>
|
|
|
|
#include <svl/cjkoptions.hxx>
|
|
|
|
#include <svl/ctloptions.hxx>
|
2009-10-06 07:38:24 +02:00
|
|
|
#include <unotools/useroptions.hxx>
|
2008-02-19 12:57:51 +00:00
|
|
|
#include <vcl/msgbox.hxx>
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/flditem.hxx>
|
|
|
|
#include <editeng/editstat.hxx>
|
2008-02-19 12:57:51 +00:00
|
|
|
#include <svx/hlnkitem.hxx>
|
|
|
|
#include <svx/htmlmode.hxx>
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/langitem.hxx>
|
|
|
|
#include <editeng/unolingu.hxx>
|
|
|
|
#include <editeng/scripttypeitem.hxx>
|
|
|
|
#include <editeng/writingmodeitem.hxx>
|
2008-02-19 12:57:51 +00:00
|
|
|
#include <swundo.hxx>
|
|
|
|
#include <doc.hxx>
|
|
|
|
#include <viewopt.hxx>
|
|
|
|
#include <wrtsh.hxx>
|
|
|
|
#include <uitool.hxx>
|
|
|
|
#include <popup.hrc>
|
|
|
|
#include <pardlg.hxx>
|
|
|
|
#include <swdtflvr.hxx>
|
|
|
|
#include <drwtxtsh.hxx>
|
|
|
|
#include <swmodule.hxx>
|
|
|
|
#include <initui.hxx>
|
|
|
|
#include <edtwin.hxx>
|
2009-01-02 15:51:45 +00:00
|
|
|
#include <swwait.hxx>
|
|
|
|
#include <docstat.hxx>
|
2008-02-19 12:57:51 +00:00
|
|
|
|
|
|
|
#include <cmdid.h>
|
|
|
|
#include <globals.hrc>
|
|
|
|
#include <shells.hrc>
|
|
|
|
#include <breakit.hxx>
|
|
|
|
#include "annotsh.hxx"
|
|
|
|
#include "view.hxx"
|
2010-01-12 10:43:45 +01:00
|
|
|
#include <PostItMgr.hxx>
|
|
|
|
#include <SidebarWin.hxx>
|
2008-02-19 12:57:51 +00:00
|
|
|
|
|
|
|
#include "swtypes.hxx"
|
|
|
|
|
|
|
|
#include <svx/svxdlg.hxx>
|
|
|
|
#include <svx/dialogs.hrc>
|
|
|
|
|
|
|
|
#include <svx/svxids.hrc>
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/itempool.hxx>
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/outliner.hxx>
|
|
|
|
#include <editeng/editeng.hxx>
|
|
|
|
#include <editeng/editview.hxx>
|
2008-06-16 07:22:38 +00:00
|
|
|
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/languageoptions.hxx>
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/langitem.hxx>
|
2008-06-16 07:22:38 +00:00
|
|
|
#include <svtools/langtab.hxx>
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/slstitm.hxx>
|
2008-02-19 12:57:51 +00:00
|
|
|
|
|
|
|
#include <docsh.hxx>
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/undo.hxx>
|
2009-11-25 16:52:25 +00:00
|
|
|
#include "swabstdlg.hxx"
|
|
|
|
#include "chrdlg.hrc"
|
2009-01-02 15:51:45 +00:00
|
|
|
#include "misc.hrc"
|
|
|
|
#include <app.hrc>
|
|
|
|
|
|
|
|
#include <comphelper/processfactory.hxx>
|
2008-05-30 08:30:05 +00:00
|
|
|
|
|
|
|
#include <cppuhelper/bootstrap.hxx>
|
|
|
|
|
2008-06-16 07:22:38 +00:00
|
|
|
#include <langhelper.hxx>
|
|
|
|
|
2008-02-19 12:57:51 +00:00
|
|
|
using namespace ::com::sun::star;
|
2008-05-30 08:30:05 +00:00
|
|
|
using namespace ::com::sun::star::uno;
|
|
|
|
using namespace ::com::sun::star::beans;
|
|
|
|
using namespace ::com::sun::star::i18n;
|
2008-02-19 12:57:51 +00:00
|
|
|
|
|
|
|
#define SwAnnotationShell
|
2008-06-16 07:22:38 +00:00
|
|
|
|
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>
|
2008-02-19 12:57:51 +00:00
|
|
|
#include <swslots.hxx>
|
|
|
|
|
|
|
|
SFX_IMPL_INTERFACE(SwAnnotationShell, SfxShell, SW_RES(STR_SHELLNAME_DRAW_TEXT))
|
|
|
|
{
|
|
|
|
SFX_OBJECTBAR_REGISTRATION(SFX_OBJECTBAR_OBJECT, SW_RES(RID_TEXT_TOOLBOX));
|
|
|
|
SFX_POPUPMENU_REGISTRATION(SW_RES(MN_ANNOTATION_POPUPMENU));
|
|
|
|
}
|
|
|
|
|
|
|
|
TYPEINIT1(SwAnnotationShell,SfxShell)
|
|
|
|
|
|
|
|
SwAnnotationShell::SwAnnotationShell( SwView& r )
|
|
|
|
: rView(r)
|
|
|
|
{
|
|
|
|
SwWrtShell &rSh = rView.GetWrtShell();
|
|
|
|
SetPool(rSh.GetAttrPool().GetSecondaryPool());
|
|
|
|
}
|
|
|
|
|
|
|
|
SwAnnotationShell::~SwAnnotationShell()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
SfxUndoManager* SwAnnotationShell::GetUndoManager()
|
|
|
|
{
|
|
|
|
SwPostItMgr* pPostItMgr = rView.GetPostItMgr();
|
2010-01-12 10:43:45 +01:00
|
|
|
if ( !pPostItMgr ||
|
|
|
|
!pPostItMgr->HasActiveSidebarWin() )
|
2008-02-19 12:57:51 +00:00
|
|
|
{
|
2008-11-10 15:06:12 +00:00
|
|
|
DBG_ASSERT(pPostItMgr,"PostItMgr::Layout(): We are looping forever");
|
2008-02-19 12:57:51 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2010-01-12 10:43:45 +01:00
|
|
|
return &pPostItMgr->GetActiveSidebarWin()->GetOutlinerView()->GetOutliner()->GetUndoManager();
|
2008-02-19 12:57:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SwAnnotationShell::Exec( SfxRequest &rReq )
|
|
|
|
{
|
2008-05-30 08:30:05 +00:00
|
|
|
//TODO: clean this up!!!!
|
2008-02-19 12:57:51 +00:00
|
|
|
SwPostItMgr* pPostItMgr = rView.GetPostItMgr();
|
2010-01-12 10:43:45 +01:00
|
|
|
if ( !pPostItMgr || !pPostItMgr->HasActiveSidebarWin() )
|
2008-02-19 12:57:51 +00:00
|
|
|
return;
|
|
|
|
|
2010-01-12 10:43:45 +01:00
|
|
|
OutlinerView* pOLV = pPostItMgr->GetActiveSidebarWin()->GetOutlinerView();
|
2008-02-19 12:57:51 +00:00
|
|
|
SfxItemSet aEditAttr(pOLV->GetAttribs());
|
|
|
|
SfxItemSet aNewAttr(*aEditAttr.GetPool(), aEditAttr.GetRanges());
|
|
|
|
|
|
|
|
sal_uInt16 nSlot = rReq.GetSlot();
|
|
|
|
sal_uInt16 nWhich = GetPool().GetWhich(nSlot);
|
|
|
|
const SfxItemSet *pNewAttrs = rReq.GetArgs();
|
|
|
|
sal_uInt16 nEEWhich = 0;
|
|
|
|
switch (nSlot)
|
|
|
|
{
|
|
|
|
case SID_ATTR_CHAR_FONT:
|
|
|
|
case SID_ATTR_CHAR_FONTHEIGHT:
|
|
|
|
case SID_ATTR_CHAR_WEIGHT:
|
|
|
|
case SID_ATTR_CHAR_POSTURE:
|
|
|
|
{
|
|
|
|
SfxItemPool* pSecondPool = aEditAttr.GetPool()->GetSecondaryPool();
|
|
|
|
if( !pSecondPool )
|
|
|
|
pSecondPool = aEditAttr.GetPool();
|
|
|
|
SvxScriptSetItem aSetItem( nSlot, *pSecondPool );
|
|
|
|
aSetItem.PutItemForScriptType( pOLV->GetSelectedScriptType(), pNewAttrs->Get( nWhich ));
|
|
|
|
aNewAttr.Put( aSetItem.GetItemSet() );
|
|
|
|
rReq.Done();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case SID_ATTR_CHAR_COLOR: nEEWhich = EE_CHAR_COLOR; break;
|
|
|
|
case SID_ATTR_CHAR_UNDERLINE:
|
|
|
|
{
|
2009-01-05 17:49:45 +00:00
|
|
|
FontUnderline eFU = ((const SvxUnderlineItem&)aEditAttr.Get(EE_CHAR_UNDERLINE)).GetLineStyle();
|
2008-02-19 12:57:51 +00:00
|
|
|
aNewAttr.Put(SvxUnderlineItem(eFU == UNDERLINE_SINGLE ? UNDERLINE_NONE : UNDERLINE_SINGLE, EE_CHAR_UNDERLINE));
|
|
|
|
break;
|
|
|
|
}
|
2009-01-05 17:49:45 +00:00
|
|
|
case SID_ATTR_CHAR_OVERLINE:
|
|
|
|
{
|
|
|
|
FontUnderline eFO = ((const SvxOverlineItem&)aEditAttr.Get(EE_CHAR_OVERLINE)).GetLineStyle();
|
|
|
|
aNewAttr.Put(SvxOverlineItem(eFO == UNDERLINE_SINGLE ? UNDERLINE_NONE : UNDERLINE_SINGLE, EE_CHAR_OVERLINE));
|
|
|
|
break;
|
|
|
|
}
|
2008-02-19 12:57:51 +00:00
|
|
|
case SID_ATTR_CHAR_CONTOUR: nEEWhich = EE_CHAR_OUTLINE; break;
|
|
|
|
case SID_ATTR_CHAR_SHADOWED: nEEWhich = EE_CHAR_SHADOW; break;
|
|
|
|
case SID_ATTR_CHAR_STRIKEOUT: nEEWhich = EE_CHAR_STRIKEOUT; break;
|
|
|
|
case SID_ATTR_CHAR_WORDLINEMODE: nEEWhich = EE_CHAR_WLM; break;
|
|
|
|
case SID_ATTR_CHAR_RELIEF : nEEWhich = EE_CHAR_RELIEF; break;
|
|
|
|
case SID_ATTR_CHAR_LANGUAGE : nEEWhich = EE_CHAR_LANGUAGE;break;
|
|
|
|
case SID_ATTR_CHAR_KERNING : nEEWhich = EE_CHAR_KERNING; break;
|
|
|
|
case SID_ATTR_CHAR_SCALEWIDTH: nEEWhich = EE_CHAR_FONTWIDTH; break;
|
|
|
|
case SID_ATTR_CHAR_AUTOKERN : nEEWhich = EE_CHAR_PAIRKERNING; break;
|
|
|
|
case SID_ATTR_CHAR_ESCAPEMENT: nEEWhich = EE_CHAR_ESCAPEMENT; break;
|
|
|
|
case SID_ATTR_PARA_ADJUST_LEFT:
|
|
|
|
aNewAttr.Put(SvxAdjustItem(SVX_ADJUST_LEFT, EE_PARA_JUST));
|
|
|
|
break;
|
|
|
|
case SID_ATTR_PARA_ADJUST_CENTER:
|
|
|
|
aNewAttr.Put(SvxAdjustItem(SVX_ADJUST_CENTER, EE_PARA_JUST));
|
|
|
|
break;
|
|
|
|
case SID_ATTR_PARA_ADJUST_RIGHT:
|
|
|
|
aNewAttr.Put(SvxAdjustItem(SVX_ADJUST_RIGHT, EE_PARA_JUST));
|
|
|
|
break;
|
|
|
|
case SID_ATTR_PARA_ADJUST_BLOCK:
|
|
|
|
aNewAttr.Put(SvxAdjustItem(SVX_ADJUST_BLOCK, EE_PARA_JUST));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_ATTR_PARA_LINESPACE_10:
|
|
|
|
{
|
|
|
|
SvxLineSpacingItem aItem(SVX_LINESPACE_ONE_LINE, EE_PARA_SBL);
|
|
|
|
aItem.SetPropLineSpace(100);
|
|
|
|
aNewAttr.Put(aItem);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_ATTR_PARA_LINESPACE_15:
|
|
|
|
{
|
|
|
|
SvxLineSpacingItem aItem(SVX_LINESPACE_ONE_POINT_FIVE_LINES, EE_PARA_SBL);
|
|
|
|
aItem.SetPropLineSpace(150);
|
|
|
|
aNewAttr.Put(aItem);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_ATTR_PARA_LINESPACE_20:
|
|
|
|
{
|
|
|
|
SvxLineSpacingItem aItem(SVX_LINESPACE_TWO_LINES, EE_PARA_SBL);
|
|
|
|
aItem.SetPropLineSpace(200);
|
|
|
|
aNewAttr.Put(aItem);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_SELECTALL:
|
|
|
|
{
|
|
|
|
Outliner * pOutliner = pOLV->GetOutliner();
|
|
|
|
if(pOutliner)
|
|
|
|
{
|
|
|
|
ULONG nParaCount = pOutliner->GetParagraphCount();
|
|
|
|
if (nParaCount > 0)
|
|
|
|
pOLV->SelectRange(0L, USHORT(nParaCount) );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case FN_FORMAT_RESET:
|
|
|
|
{
|
2010-01-12 10:43:45 +01:00
|
|
|
pPostItMgr->GetActiveSidebarWin()->ResetAttributes();
|
2008-02-19 12:57:51 +00:00
|
|
|
rReq.Done();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case FN_SET_SUPER_SCRIPT:
|
|
|
|
{
|
|
|
|
SvxEscapementItem aItem(EE_CHAR_ESCAPEMENT);
|
|
|
|
SvxEscapement eEsc = (SvxEscapement ) ( (const SvxEscapementItem&)
|
|
|
|
aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
|
|
|
|
|
|
|
|
if( eEsc == SVX_ESCAPEMENT_SUPERSCRIPT )
|
|
|
|
aItem.SetEscapement( SVX_ESCAPEMENT_OFF );
|
|
|
|
else
|
|
|
|
aItem.SetEscapement( SVX_ESCAPEMENT_SUPERSCRIPT );
|
|
|
|
aNewAttr.Put( aItem, EE_CHAR_ESCAPEMENT );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case FN_SET_SUB_SCRIPT:
|
|
|
|
{
|
|
|
|
SvxEscapementItem aItem(EE_CHAR_ESCAPEMENT);
|
|
|
|
SvxEscapement eEsc = (SvxEscapement ) ( (const SvxEscapementItem&)
|
|
|
|
aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
|
|
|
|
|
|
|
|
if( eEsc == SVX_ESCAPEMENT_SUBSCRIPT )
|
|
|
|
aItem.SetEscapement( SVX_ESCAPEMENT_OFF );
|
|
|
|
else
|
|
|
|
aItem.SetEscapement( SVX_ESCAPEMENT_SUBSCRIPT );
|
|
|
|
aNewAttr.Put( aItem, EE_CHAR_ESCAPEMENT );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_HYPERLINK_SETLINK:
|
|
|
|
{
|
|
|
|
const SfxPoolItem* pItem = 0;
|
|
|
|
if(pNewAttrs)
|
|
|
|
pNewAttrs->GetItemState(nSlot, sal_False, &pItem);
|
|
|
|
|
|
|
|
if(pItem)
|
|
|
|
{
|
|
|
|
const SvxHyperlinkItem& rHLinkItem = *(const SvxHyperlinkItem *)pItem;
|
|
|
|
SvxURLField aFld(rHLinkItem.GetURL(), rHLinkItem.GetName(), SVXURLFORMAT_APPDEFAULT);
|
|
|
|
aFld.SetTargetFrame(rHLinkItem.GetTargetFrame());
|
|
|
|
|
|
|
|
const SvxFieldItem* pFieldItem = pOLV->GetFieldAtSelection();
|
|
|
|
|
|
|
|
if (pFieldItem && pFieldItem->GetField()->ISA(SvxURLField))
|
|
|
|
{
|
|
|
|
// Feld selektieren, so dass es beim Insert geloescht wird
|
|
|
|
ESelection aSel = pOLV->GetSelection();
|
|
|
|
aSel.nEndPos++;
|
|
|
|
pOLV->SetSelection(aSel);
|
|
|
|
}
|
2010-01-12 10:43:45 +01:00
|
|
|
if (pPostItMgr->GetActiveSidebarWin()->GetLayoutStatus()!=SwPostItHelper::DELETED)
|
2008-06-16 07:22:38 +00:00
|
|
|
pOLV->InsertField(SvxFieldItem(aFld, EE_FEATURE_FIELD));
|
2008-02-19 12:57:51 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2009-01-02 15:51:45 +00:00
|
|
|
case FN_INSERT_SOFT_HYPHEN:
|
|
|
|
case FN_INSERT_HARDHYPHEN:
|
|
|
|
case FN_INSERT_HARD_SPACE:
|
|
|
|
case SID_INSERT_RLM :
|
|
|
|
case SID_INSERT_LRM :
|
|
|
|
case SID_INSERT_ZWNBSP :
|
|
|
|
case SID_INSERT_ZWSP:
|
|
|
|
{
|
|
|
|
sal_Unicode cIns = 0;
|
|
|
|
switch(rReq.GetSlot())
|
|
|
|
{
|
|
|
|
case FN_INSERT_SOFT_HYPHEN: cIns = CHAR_SOFTHYPHEN; break;
|
|
|
|
case FN_INSERT_HARDHYPHEN: cIns = CHAR_HARDHYPHEN; break;
|
|
|
|
case FN_INSERT_HARD_SPACE: cIns = CHAR_HARDBLANK; break;
|
|
|
|
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;
|
|
|
|
}
|
2009-09-11 10:21:51 +00:00
|
|
|
pOLV->InsertText( String(cIns));
|
2009-01-02 15:51:45 +00:00
|
|
|
rReq.Done();
|
|
|
|
break;
|
|
|
|
}
|
2009-05-06 10:59:57 +00:00
|
|
|
case SID_CHARMAP:
|
2008-06-16 07:22:38 +00:00
|
|
|
{
|
2010-01-12 10:43:45 +01:00
|
|
|
if (pPostItMgr->GetActiveSidebarWin()->GetLayoutStatus()!=SwPostItHelper::DELETED)
|
2008-06-16 07:22:38 +00:00
|
|
|
InsertSymbol(rReq);
|
2008-02-19 12:57:51 +00:00
|
|
|
break;
|
2008-06-16 07:22:38 +00:00
|
|
|
}
|
2009-01-02 15:51:45 +00:00
|
|
|
case FN_INSERT_STRING:
|
|
|
|
{
|
|
|
|
const SfxPoolItem* pItem = 0;
|
|
|
|
if(pNewAttrs)
|
|
|
|
pNewAttrs->GetItemState(nSlot, FALSE, &pItem );
|
2010-01-12 10:43:45 +01:00
|
|
|
if (pPostItMgr->GetActiveSidebarWin()->GetLayoutStatus()!=SwPostItHelper::DELETED)
|
2009-01-02 15:51:45 +00:00
|
|
|
pOLV->InsertText(((const SfxStringItem *)pItem)->GetValue());
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case FN_FORMAT_FOOTNOTE_DLG:
|
|
|
|
{
|
|
|
|
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
|
|
|
|
DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
|
|
|
|
|
|
|
|
VclAbstractDialog* pDlg = pFact->CreateSwFootNoteOptionDlg( rView.GetWindow(), rView.GetWrtShell(), DLG_DOC_FOOTNOTE );
|
|
|
|
DBG_ASSERT(pDlg, "Dialogdiet fail!");
|
|
|
|
pDlg->Execute();
|
|
|
|
delete pDlg;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case FN_NUMBERING_OUTLINE_DLG:
|
|
|
|
{
|
|
|
|
SfxItemSet aTmp(GetPool(), FN_PARAM_1, FN_PARAM_1);
|
|
|
|
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
|
|
|
|
DBG_ASSERT(pFact, "Dialogdiet fail!");
|
|
|
|
SfxAbstractTabDialog* pDlg = pFact->CreateSwTabDialog( DLG_TAB_OUTLINE,
|
|
|
|
rView.GetWindow(), &aTmp, rView.GetWrtShell());
|
|
|
|
DBG_ASSERT(pDlg, "Dialogdiet fail!");
|
|
|
|
pDlg->Execute();
|
|
|
|
delete pDlg;
|
|
|
|
rReq.Done();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_OPEN_XML_FILTERSETTINGS:
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
uno::Reference < ui::dialogs::XExecutableDialog > xDialog(::comphelper::getProcessServiceFactory()->createInstance(rtl::OUString::createFromAscii("com.sun.star.comp.ui.XSLTFilterDialog")), uno::UNO_QUERY);
|
|
|
|
if( xDialog.is() )
|
|
|
|
{
|
|
|
|
xDialog->execute();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch( uno::Exception& )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
rReq.Ignore ();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case FN_WORDCOUNT_DIALOG:
|
|
|
|
{
|
|
|
|
SwWrtShell &rSh = rView.GetWrtShell();
|
|
|
|
SwDocStat aCurr;
|
|
|
|
SwDocStat aDocStat( rSh.getIDocumentStatistics()->GetDocStat() );
|
|
|
|
{
|
|
|
|
SwWait aWait( *rView.GetDocShell(), TRUE );
|
|
|
|
rSh.StartAction();
|
|
|
|
rSh.CountWords( aCurr );
|
|
|
|
rSh.UpdateDocStat( aDocStat );
|
|
|
|
rSh.EndAction();
|
|
|
|
}
|
|
|
|
|
|
|
|
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
|
|
|
|
DBG_ASSERT(pFact, "Dialogdiet fail!");
|
|
|
|
AbstractSwWordCountDialog* pDialog = pFact->CreateSwWordCountDialog( rView.GetWindow() );
|
|
|
|
pDialog->SetValues(aCurr, aDocStat );
|
|
|
|
pDialog->Execute();
|
|
|
|
delete pDialog;
|
|
|
|
}
|
|
|
|
break;
|
2008-02-19 12:57:51 +00:00
|
|
|
case SID_CHAR_DLG:
|
|
|
|
{
|
|
|
|
const SfxItemSet* pArgs = rReq.GetArgs();
|
|
|
|
|
|
|
|
if( !pArgs )
|
|
|
|
{
|
|
|
|
/* mod
|
|
|
|
SwView* pView = &GetView();
|
|
|
|
FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, pView));
|
|
|
|
SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, eMetric));
|
|
|
|
*/
|
|
|
|
SfxItemSet aDlgAttr(GetPool(), EE_ITEMS_START, EE_ITEMS_END);
|
|
|
|
|
|
|
|
// util::Language gibts an der EditEngine nicht! Daher nicht im Set.
|
|
|
|
|
|
|
|
aDlgAttr.Put( aEditAttr );
|
|
|
|
aDlgAttr.Put( SvxKerningItem(0, RES_CHRATR_KERNING) );
|
|
|
|
|
|
|
|
//CHINA001 SwCharDlg* pDlg = new SwCharDlg(pView->GetWindow(), *pView, aDlgAttr, 0, sal_True);
|
|
|
|
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();//CHINA001
|
|
|
|
DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");//CHINA001
|
|
|
|
|
|
|
|
SfxAbstractTabDialog* pDlg = pFact->CreateSwCharDlg( rView.GetWindow(), rView, aDlgAttr, DLG_CHAR,0, sal_True );
|
|
|
|
DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001
|
|
|
|
USHORT nRet = pDlg->Execute();
|
|
|
|
if(RET_OK == nRet )
|
|
|
|
{
|
|
|
|
rReq.Done( *( pDlg->GetOutputItemSet() ) );
|
|
|
|
aNewAttr.Put(*pDlg->GetOutputItemSet());
|
|
|
|
}
|
|
|
|
delete( pDlg );
|
|
|
|
if(RET_OK != nRet)
|
|
|
|
return ;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
aNewAttr.Put(*pArgs);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case SID_PARA_DLG:
|
|
|
|
{
|
|
|
|
const SfxItemSet* pArgs = rReq.GetArgs();
|
|
|
|
|
|
|
|
if (!pArgs)
|
|
|
|
{
|
|
|
|
/* mod todo ???
|
|
|
|
SwView* pView = &GetView();
|
|
|
|
FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, pView));
|
|
|
|
SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, eMetric));
|
|
|
|
*/
|
|
|
|
SfxItemSet aDlgAttr(GetPool(),
|
|
|
|
EE_ITEMS_START, EE_ITEMS_END,
|
|
|
|
SID_ATTR_PARA_HYPHENZONE, SID_ATTR_PARA_HYPHENZONE,
|
|
|
|
SID_ATTR_PARA_SPLIT, SID_ATTR_PARA_SPLIT,
|
|
|
|
SID_ATTR_PARA_WIDOWS, SID_ATTR_PARA_WIDOWS,
|
|
|
|
SID_ATTR_PARA_ORPHANS, SID_ATTR_PARA_ORPHANS,
|
|
|
|
0);
|
|
|
|
|
|
|
|
aDlgAttr.Put(aEditAttr);
|
|
|
|
|
|
|
|
|
|
|
|
aDlgAttr.Put( SvxHyphenZoneItem( sal_False, RES_PARATR_HYPHENZONE) );
|
|
|
|
aDlgAttr.Put( SvxFmtBreakItem( SVX_BREAK_NONE, RES_BREAK ) );
|
|
|
|
aDlgAttr.Put( SvxFmtSplitItem( sal_True, RES_PARATR_SPLIT ) );
|
|
|
|
aDlgAttr.Put( SvxWidowsItem( 0, RES_PARATR_WIDOWS ) );
|
|
|
|
aDlgAttr.Put( SvxOrphansItem( 0, RES_PARATR_ORPHANS ) );
|
|
|
|
|
|
|
|
//CHINA001 SwParaDlg* pDlg = new SwParaDlg(GetView().GetWindow(), GetView(), aDlgAttr, DLG_STD, 0, sal_True);
|
|
|
|
|
|
|
|
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();//CHINA001
|
|
|
|
DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");//CHINA001
|
|
|
|
|
|
|
|
SfxAbstractTabDialog* pDlg = pFact->CreateSwParaDlg( rView.GetWindow(), rView, aDlgAttr,DLG_STD, DLG_PARA, 0, sal_True );
|
|
|
|
DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001
|
|
|
|
USHORT nRet = pDlg->Execute();
|
|
|
|
if(RET_OK == nRet)
|
|
|
|
{
|
|
|
|
rReq.Done( *( pDlg->GetOutputItemSet() ) );
|
|
|
|
aNewAttr.Put(*pDlg->GetOutputItemSet());
|
|
|
|
}
|
|
|
|
delete( pDlg );
|
|
|
|
if(RET_OK != nRet)
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
aNewAttr.Put(*pArgs);
|
|
|
|
break;
|
|
|
|
}
|
2008-04-11 13:03:42 +00:00
|
|
|
|
|
|
|
case SID_AUTOSPELL_CHECK:
|
|
|
|
{
|
|
|
|
rView.ExecuteSlot(rReq);
|
|
|
|
break;
|
|
|
|
}
|
2008-06-16 07:22:38 +00:00
|
|
|
case SID_ATTR_PARA_LEFT_TO_RIGHT:
|
|
|
|
case SID_ATTR_PARA_RIGHT_TO_LEFT:
|
|
|
|
{
|
|
|
|
sal_Bool bLeftToRight = nSlot == SID_ATTR_PARA_LEFT_TO_RIGHT;
|
|
|
|
|
|
|
|
const SfxPoolItem* pPoolItem;
|
|
|
|
if( pNewAttrs && SFX_ITEM_SET == pNewAttrs->GetItemState( nSlot, TRUE, &pPoolItem ) )
|
|
|
|
{
|
|
|
|
if( !( (SfxBoolItem*)pPoolItem)->GetValue() )
|
|
|
|
bLeftToRight = !bLeftToRight;
|
|
|
|
}
|
|
|
|
SfxItemSet aAttr( *aNewAttr.GetPool(),
|
|
|
|
EE_PARA_JUST, EE_PARA_JUST,
|
|
|
|
EE_PARA_WRITINGDIR, EE_PARA_WRITINGDIR,
|
|
|
|
0 );
|
|
|
|
|
|
|
|
USHORT nAdjust = SVX_ADJUST_LEFT;
|
|
|
|
if( SFX_ITEM_ON == aEditAttr.GetItemState(EE_PARA_JUST, TRUE, &pPoolItem ) )
|
|
|
|
nAdjust = ( (SvxAdjustItem*)pPoolItem)->GetEnumValue();
|
|
|
|
|
|
|
|
if( bLeftToRight )
|
|
|
|
{
|
|
|
|
aAttr.Put( SvxFrameDirectionItem( FRMDIR_HORI_LEFT_TOP, EE_PARA_WRITINGDIR ) );
|
|
|
|
if( nAdjust == SVX_ADJUST_RIGHT )
|
|
|
|
aAttr.Put( SvxAdjustItem( SVX_ADJUST_LEFT, EE_PARA_JUST ) );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
aAttr.Put( SvxFrameDirectionItem( FRMDIR_HORI_RIGHT_TOP, EE_PARA_WRITINGDIR ) );
|
|
|
|
if( nAdjust == SVX_ADJUST_LEFT )
|
|
|
|
aAttr.Put( SvxAdjustItem( SVX_ADJUST_RIGHT, EE_PARA_JUST ) );
|
|
|
|
}
|
|
|
|
pOLV->SetAttribs(aAttr);
|
|
|
|
break;
|
|
|
|
}
|
2008-02-19 12:57:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if(nEEWhich && pNewAttrs)
|
|
|
|
aNewAttr.Put(pNewAttrs->Get(nWhich), nEEWhich);
|
|
|
|
|
|
|
|
Rectangle aNullRect;
|
|
|
|
Rectangle aOutRect = pOLV->GetOutputArea();
|
|
|
|
if (aNullRect != aOutRect)
|
|
|
|
pOLV->SetAttribs(aNewAttr);
|
|
|
|
|
|
|
|
rView.GetViewFrame()->GetBindings().InvalidateAll(sal_False);
|
|
|
|
if ( pOLV->GetOutliner()->IsModified() )
|
|
|
|
rView.GetWrtShell().SetModified();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void SwAnnotationShell::GetState(SfxItemSet& rSet)
|
|
|
|
{
|
|
|
|
//TODO: clean this up!!!
|
|
|
|
// FN_SET_SUPER_SCRIPT
|
|
|
|
//SID_ATTR_PARA_ADJUST
|
|
|
|
//SID_ATTR_PARA_ADJUST_BLOCK
|
|
|
|
|
|
|
|
SwPostItMgr* pPostItMgr = rView.GetPostItMgr();
|
2010-01-12 10:43:45 +01:00
|
|
|
if ( !pPostItMgr || !pPostItMgr->HasActiveSidebarWin() )
|
2008-02-19 12:57:51 +00:00
|
|
|
return;
|
|
|
|
|
2010-01-12 10:43:45 +01:00
|
|
|
OutlinerView* pOLV = pPostItMgr->GetActiveSidebarWin()->GetOutlinerView();
|
2008-02-19 12:57:51 +00:00
|
|
|
SfxItemSet aEditAttr(pOLV->GetAttribs());
|
|
|
|
|
|
|
|
SfxWhichIter aIter(rSet);
|
|
|
|
sal_uInt16 nWhich = aIter.FirstWhich();
|
|
|
|
while(nWhich)
|
|
|
|
{
|
|
|
|
sal_uInt16 nEEWhich = 0;
|
|
|
|
USHORT nSlotId = GetPool().GetSlotId( nWhich );
|
|
|
|
switch( nSlotId )
|
|
|
|
{
|
|
|
|
case SID_ATTR_CHAR_FONT:
|
|
|
|
case SID_ATTR_CHAR_FONTHEIGHT:
|
|
|
|
case SID_ATTR_CHAR_WEIGHT:
|
|
|
|
case SID_ATTR_CHAR_POSTURE:
|
|
|
|
{
|
|
|
|
if ( pOLV )
|
|
|
|
{
|
|
|
|
USHORT nScriptType = pOLV->GetSelectedScriptType();
|
|
|
|
SfxItemPool* pSecondPool = aEditAttr.GetPool()->GetSecondaryPool();
|
|
|
|
if( !pSecondPool )
|
|
|
|
pSecondPool = aEditAttr.GetPool();
|
|
|
|
SvxScriptSetItem aSetItem( nSlotId, *pSecondPool );
|
|
|
|
aSetItem.GetItemSet().Put( aEditAttr, FALSE );
|
|
|
|
const SfxPoolItem* pI = aSetItem.GetItemOfScript( nScriptType );
|
|
|
|
if( pI )
|
|
|
|
rSet.Put( *pI, nWhich );
|
|
|
|
else
|
|
|
|
rSet.InvalidateItem( nWhich );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
rSet.InvalidateItem( nWhich );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_ATTR_CHAR_COLOR: nEEWhich = EE_CHAR_COLOR; break;
|
|
|
|
case SID_ATTR_CHAR_UNDERLINE: nEEWhich = EE_CHAR_UNDERLINE;break;
|
2009-01-05 17:49:45 +00:00
|
|
|
case SID_ATTR_CHAR_OVERLINE: nEEWhich = EE_CHAR_OVERLINE;break;
|
2008-02-19 12:57:51 +00:00
|
|
|
case SID_ATTR_CHAR_CONTOUR: nEEWhich = EE_CHAR_OUTLINE; break;
|
|
|
|
case SID_ATTR_CHAR_SHADOWED: nEEWhich = EE_CHAR_SHADOW;break;
|
|
|
|
case SID_ATTR_CHAR_STRIKEOUT: nEEWhich = EE_CHAR_STRIKEOUT;break;
|
2008-05-30 08:30:05 +00:00
|
|
|
case SID_ATTR_CHAR_LANGUAGE : nEEWhich = EE_CHAR_LANGUAGE;break;
|
2008-02-19 12:57:51 +00:00
|
|
|
case FN_SET_SUPER_SCRIPT:
|
|
|
|
case FN_SET_SUB_SCRIPT:
|
|
|
|
{
|
|
|
|
USHORT nEsc = 0;
|
|
|
|
const SfxPoolItem *pEscItem = 0;
|
|
|
|
if (nWhich==FN_SET_SUPER_SCRIPT)
|
|
|
|
nEsc = SVX_ESCAPEMENT_SUPERSCRIPT;
|
|
|
|
else
|
|
|
|
nEsc = SVX_ESCAPEMENT_SUBSCRIPT;
|
|
|
|
|
|
|
|
if( !pEscItem )
|
|
|
|
pEscItem = &aEditAttr.Get( EE_CHAR_ESCAPEMENT );
|
|
|
|
|
|
|
|
if( nEsc == ((const SvxEscapementItem*)pEscItem)->GetEnumValue() )
|
|
|
|
rSet.Put( SfxBoolItem( nWhich, sal_True ));
|
|
|
|
else
|
|
|
|
rSet.InvalidateItem( nWhich );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case SID_ATTR_PARA_ADJUST_LEFT:
|
|
|
|
case SID_ATTR_PARA_ADJUST_RIGHT:
|
|
|
|
case SID_ATTR_PARA_ADJUST_CENTER:
|
|
|
|
case SID_ATTR_PARA_ADJUST_BLOCK:
|
|
|
|
{
|
|
|
|
const SfxPoolItem *pAdjust = 0;
|
|
|
|
int eAdjust = 0;
|
|
|
|
|
|
|
|
if (nWhich==SID_ATTR_PARA_ADJUST_LEFT)
|
|
|
|
eAdjust = SVX_ADJUST_LEFT;
|
|
|
|
else
|
|
|
|
if (nWhich==SID_ATTR_PARA_ADJUST_RIGHT)
|
|
|
|
eAdjust = SVX_ADJUST_RIGHT;
|
|
|
|
else
|
|
|
|
if (nWhich==SID_ATTR_PARA_ADJUST_CENTER)
|
|
|
|
eAdjust = SVX_ADJUST_CENTER;
|
|
|
|
else
|
|
|
|
if (nWhich==SID_ATTR_PARA_ADJUST_BLOCK)
|
|
|
|
eAdjust = SVX_ADJUST_BLOCK;
|
|
|
|
|
|
|
|
if( !pAdjust )
|
|
|
|
aEditAttr.GetItemState( EE_PARA_JUST, sal_False, &pAdjust);
|
|
|
|
|
|
|
|
if( !pAdjust || IsInvalidItem( pAdjust ))
|
|
|
|
rSet.InvalidateItem( nSlotId ), nSlotId = 0;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ( eAdjust == ((const SvxAdjustItem*)pAdjust)->GetAdjust())
|
|
|
|
rSet.Put( SfxBoolItem( nWhich, sal_True ));
|
|
|
|
else
|
|
|
|
rSet.InvalidateItem( nWhich );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case SID_ATTR_PARA_LINESPACE_10:
|
|
|
|
case SID_ATTR_PARA_LINESPACE_15:
|
|
|
|
case SID_ATTR_PARA_LINESPACE_20:
|
|
|
|
{
|
|
|
|
const SfxPoolItem *pLSpace = 0;
|
|
|
|
int nLSpace = 0;
|
|
|
|
|
|
|
|
if (nWhich==SID_ATTR_PARA_LINESPACE_10)
|
|
|
|
nLSpace = 100;
|
|
|
|
else
|
|
|
|
if (nWhich==SID_ATTR_PARA_LINESPACE_15)
|
|
|
|
nLSpace = 150;
|
|
|
|
else
|
|
|
|
if (nWhich==SID_ATTR_PARA_LINESPACE_20)
|
|
|
|
nLSpace = 200;
|
|
|
|
|
|
|
|
if( !pLSpace )
|
|
|
|
aEditAttr.GetItemState( EE_PARA_SBL, sal_False, &pLSpace );
|
|
|
|
|
|
|
|
if( !pLSpace || IsInvalidItem( pLSpace ))
|
|
|
|
rSet.InvalidateItem( nSlotId ), nSlotId = 0;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if( nLSpace == ((const SvxLineSpacingItem*)pLSpace)->GetPropLineSpace() )
|
|
|
|
rSet.Put( SfxBoolItem( nWhich, sal_True ));
|
|
|
|
else
|
|
|
|
rSet.InvalidateItem( nWhich );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2008-04-11 13:03:42 +00:00
|
|
|
case SID_AUTOSPELL_CHECK:
|
|
|
|
{
|
|
|
|
const SfxPoolItem* pState = rView.GetSlotState(nWhich);
|
|
|
|
if (pState)
|
|
|
|
rSet.Put(SfxBoolItem(nWhich, ((const SfxBoolItem*)pState)->GetValue()));
|
|
|
|
else
|
|
|
|
rSet.DisableItem( nWhich );
|
|
|
|
break;
|
|
|
|
}
|
2008-06-16 07:22:38 +00:00
|
|
|
case SID_ATTR_PARA_LEFT_TO_RIGHT:
|
|
|
|
case SID_ATTR_PARA_RIGHT_TO_LEFT:
|
|
|
|
{
|
|
|
|
if ( !SvtLanguageOptions().IsCTLFontEnabled() )
|
|
|
|
rSet.DisableItem( nWhich );
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if(pOLV->GetOutliner() && pOLV->GetOutliner()->IsVertical())
|
|
|
|
rSet.DisableItem( nWhich );
|
|
|
|
else
|
|
|
|
{
|
|
|
|
BOOL bFlag = FALSE;
|
|
|
|
switch( ( ( (SvxFrameDirectionItem&) aEditAttr.Get( EE_PARA_WRITINGDIR ) ) ).GetValue() )
|
|
|
|
{
|
|
|
|
case FRMDIR_HORI_LEFT_TOP:
|
|
|
|
{
|
|
|
|
bFlag = nWhich == SID_ATTR_PARA_LEFT_TO_RIGHT;
|
|
|
|
rSet.Put( SfxBoolItem( nWhich, bFlag ));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case FRMDIR_HORI_RIGHT_TOP:
|
|
|
|
{
|
|
|
|
bFlag = nWhich != SID_ATTR_PARA_LEFT_TO_RIGHT;
|
|
|
|
rSet.Put( SfxBoolItem( nWhich, bFlag ));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
2009-01-02 15:51:45 +00:00
|
|
|
case SID_INSERT_RLM :
|
|
|
|
case SID_INSERT_LRM :
|
|
|
|
case SID_INSERT_ZWNBSP :
|
|
|
|
case SID_INSERT_ZWSP:
|
|
|
|
{
|
|
|
|
SvtCTLOptions aCTLOptions;
|
|
|
|
sal_Bool bEnabled = aCTLOptions.IsCTLFontEnabled();
|
|
|
|
rView.GetViewFrame()->GetBindings().SetVisibleState( nWhich, bEnabled );
|
|
|
|
if(!bEnabled)
|
|
|
|
rSet.DisableItem(nWhich);
|
|
|
|
}
|
|
|
|
break;
|
2008-02-19 12:57:51 +00:00
|
|
|
default:
|
|
|
|
rSet.InvalidateItem( nWhich );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(nEEWhich)
|
|
|
|
rSet.Put(aEditAttr.Get(nEEWhich, sal_True), nWhich);
|
|
|
|
|
2010-01-12 10:43:45 +01:00
|
|
|
if (pPostItMgr->GetActiveSidebarWin()->GetLayoutStatus()==SwPostItHelper::DELETED)
|
2008-06-16 07:22:38 +00:00
|
|
|
rSet.DisableItem( nWhich );
|
|
|
|
|
2008-02-19 12:57:51 +00:00
|
|
|
nWhich = aIter.NextWhich();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-01-02 15:51:45 +00:00
|
|
|
void SwAnnotationShell::ExecSearch(SfxRequest& rReq, BOOL bNoMessage)
|
|
|
|
{
|
|
|
|
rView.ExecSearch(rReq,bNoMessage);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SwAnnotationShell::StateSearch(SfxItemSet &rSet)
|
|
|
|
{
|
|
|
|
rView.StateSearch(rSet);
|
|
|
|
}
|
|
|
|
|
2008-02-19 12:57:51 +00:00
|
|
|
void SwAnnotationShell::ExecClpbrd(SfxRequest &rReq)
|
|
|
|
{
|
|
|
|
SwPostItMgr* pPostItMgr = rView.GetPostItMgr();
|
2010-01-12 10:43:45 +01:00
|
|
|
if ( !pPostItMgr || !pPostItMgr->HasActiveSidebarWin() )
|
2008-02-19 12:57:51 +00:00
|
|
|
return;
|
|
|
|
|
2010-01-12 10:43:45 +01:00
|
|
|
OutlinerView* pOLV = pPostItMgr->GetActiveSidebarWin()->GetOutlinerView();
|
2008-02-19 12:57:51 +00:00
|
|
|
SfxItemSet aEditAttr(pOLV->GetAttribs());
|
|
|
|
SfxItemSet aNewAttr(*aEditAttr.GetPool(), aEditAttr.GetRanges());
|
|
|
|
|
2010-01-12 10:43:45 +01:00
|
|
|
long aOldHeight = pPostItMgr->GetActiveSidebarWin()->GetPostItTextHeight();
|
2008-02-19 12:57:51 +00:00
|
|
|
sal_uInt16 nSlot = rReq.GetSlot();
|
|
|
|
switch (nSlot)
|
|
|
|
{
|
|
|
|
case SID_CUT:
|
2010-01-12 10:43:45 +01:00
|
|
|
if ( (pPostItMgr->GetActiveSidebarWin()->GetLayoutStatus()!=SwPostItHelper::DELETED) && pOLV->HasSelection() )
|
2009-09-18 10:15:03 +00:00
|
|
|
pOLV->Cut();
|
2008-02-19 12:57:51 +00:00
|
|
|
break;
|
|
|
|
case SID_COPY:
|
2009-09-18 10:15:03 +00:00
|
|
|
if( pOLV->HasSelection() )
|
|
|
|
pOLV->Copy();
|
2008-02-19 12:57:51 +00:00
|
|
|
break;
|
|
|
|
case SID_PASTE:
|
2010-01-12 10:43:45 +01:00
|
|
|
if (pPostItMgr->GetActiveSidebarWin()->GetLayoutStatus()!=SwPostItHelper::DELETED)
|
2008-06-16 07:22:38 +00:00
|
|
|
pOLV->Paste();
|
2008-02-19 12:57:51 +00:00
|
|
|
break;
|
2009-09-18 10:15:03 +00:00
|
|
|
case SID_PASTE_SPECIAL:
|
2008-06-16 07:22:38 +00:00
|
|
|
{
|
2010-01-12 10:43:45 +01:00
|
|
|
if (pPostItMgr->GetActiveSidebarWin()->GetLayoutStatus()!=SwPostItHelper::DELETED)
|
2008-07-01 13:37:27 +00:00
|
|
|
{
|
|
|
|
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
|
|
|
|
SfxAbstractPasteDialog* pDlg = pFact->CreatePasteDialog( &rView.GetEditWin() );
|
2008-06-16 07:22:38 +00:00
|
|
|
|
2008-07-01 13:37:27 +00:00
|
|
|
pDlg->Insert( SOT_FORMAT_STRING, aEmptyStr );
|
|
|
|
pDlg->Insert( SOT_FORMAT_RTF, aEmptyStr );
|
2008-06-16 07:22:38 +00:00
|
|
|
|
2008-07-01 13:37:27 +00:00
|
|
|
TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( &rView.GetEditWin() ) );
|
2008-06-16 07:22:38 +00:00
|
|
|
|
2008-07-01 13:37:27 +00:00
|
|
|
ULONG nFormat = pDlg->GetFormat( aDataHelper.GetTransferable() );
|
2008-06-16 07:22:38 +00:00
|
|
|
|
2008-07-01 13:37:27 +00:00
|
|
|
if (nFormat > 0)
|
|
|
|
{
|
|
|
|
if (nFormat == SOT_FORMAT_STRING)
|
|
|
|
pOLV->Paste();
|
|
|
|
else
|
|
|
|
pOLV->PasteSpecial();
|
|
|
|
}
|
|
|
|
delete pDlg;
|
2008-06-16 07:22:38 +00:00
|
|
|
}
|
2008-05-30 08:30:05 +00:00
|
|
|
break;
|
2008-06-16 07:22:38 +00:00
|
|
|
}
|
2008-05-30 08:30:05 +00:00
|
|
|
case SID_CLIPBOARD_FORMAT_ITEMS:
|
|
|
|
{
|
|
|
|
ULONG nFormat = 0;
|
|
|
|
const SfxPoolItem* pItem;
|
|
|
|
if ( rReq.GetArgs() && rReq.GetArgs()->GetItemState(nSlot, TRUE, &pItem) == SFX_ITEM_SET &&
|
|
|
|
pItem->ISA(SfxUInt32Item) )
|
|
|
|
{
|
|
|
|
nFormat = ((const SfxUInt32Item*)pItem)->GetValue();
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( nFormat )
|
|
|
|
{
|
|
|
|
if (SOT_FORMAT_STRING == nFormat)
|
|
|
|
pOLV->Paste();
|
|
|
|
else
|
|
|
|
pOLV->PasteSpecial();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2008-02-19 12:57:51 +00:00
|
|
|
}
|
2010-01-12 10:43:45 +01:00
|
|
|
pPostItMgr->GetActiveSidebarWin()->ResizeIfNeccessary(aOldHeight,pPostItMgr->GetActiveSidebarWin()->GetPostItTextHeight());
|
2008-02-19 12:57:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SwAnnotationShell::StateClpbrd(SfxItemSet &rSet)
|
|
|
|
{
|
|
|
|
SwPostItMgr* pPostItMgr = rView.GetPostItMgr();
|
2010-01-12 10:43:45 +01:00
|
|
|
if ( !pPostItMgr || !pPostItMgr->HasActiveSidebarWin() )
|
2008-02-19 12:57:51 +00:00
|
|
|
return;
|
2010-01-12 10:43:45 +01:00
|
|
|
OutlinerView* pOLV = pPostItMgr->GetActiveSidebarWin()->GetOutlinerView();
|
2008-02-19 12:57:51 +00:00
|
|
|
|
2008-05-30 08:30:05 +00:00
|
|
|
TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( &rView.GetEditWin() ) );
|
|
|
|
bool bPastePossible = ( aDataHelper.HasFormat( SOT_FORMAT_STRING ) || aDataHelper.HasFormat( SOT_FORMAT_RTF ) );
|
2010-01-12 10:43:45 +01:00
|
|
|
bPastePossible = bPastePossible && (pPostItMgr->GetActiveSidebarWin()->GetLayoutStatus()!=SwPostItHelper::DELETED);
|
2008-02-19 12:57:51 +00:00
|
|
|
|
|
|
|
SfxWhichIter aIter(rSet);
|
|
|
|
sal_uInt16 nWhich = aIter.FirstWhich();
|
|
|
|
|
|
|
|
while(nWhich)
|
|
|
|
{
|
|
|
|
switch(nWhich)
|
|
|
|
{
|
|
|
|
case SID_CUT:
|
2008-06-16 07:22:38 +00:00
|
|
|
{
|
2010-01-12 10:43:45 +01:00
|
|
|
if ( (pPostItMgr->GetActiveSidebarWin()->GetLayoutStatus()==SwPostItHelper::DELETED) || !pOLV->HasSelection() )
|
2008-06-16 07:22:38 +00:00
|
|
|
rSet.DisableItem( nWhich );
|
|
|
|
}
|
2008-02-19 12:57:51 +00:00
|
|
|
case SID_COPY:
|
2008-05-30 08:30:05 +00:00
|
|
|
{
|
|
|
|
if( !pOLV->HasSelection() )
|
2008-02-19 12:57:51 +00:00
|
|
|
rSet.DisableItem( nWhich );
|
|
|
|
break;
|
2008-05-30 08:30:05 +00:00
|
|
|
}
|
2008-02-19 12:57:51 +00:00
|
|
|
case SID_PASTE:
|
2009-09-18 10:15:03 +00:00
|
|
|
case SID_PASTE_SPECIAL:
|
2008-02-19 12:57:51 +00:00
|
|
|
{
|
2008-05-30 08:30:05 +00:00
|
|
|
if( !bPastePossible )
|
|
|
|
rSet.DisableItem( nWhich );
|
|
|
|
break;
|
2008-02-19 12:57:51 +00:00
|
|
|
}
|
2008-05-30 08:30:05 +00:00
|
|
|
case SID_CLIPBOARD_FORMAT_ITEMS:
|
2008-02-19 12:57:51 +00:00
|
|
|
{
|
2008-05-30 08:30:05 +00:00
|
|
|
if ( bPastePossible )
|
|
|
|
{
|
|
|
|
SvxClipboardFmtItem aFormats( SID_CLIPBOARD_FORMAT_ITEMS );
|
|
|
|
if ( aDataHelper.HasFormat( SOT_FORMAT_RTF ) )
|
|
|
|
aFormats.AddClipbrdFormat( SOT_FORMAT_RTF );
|
2008-06-16 07:22:38 +00:00
|
|
|
//if ( aDataHelper.HasFormat( SOT_FORMAT_STRING ) )
|
2008-05-30 08:30:05 +00:00
|
|
|
aFormats.AddClipbrdFormat( SOT_FORMAT_STRING );
|
|
|
|
rSet.Put( aFormats );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
rSet.DisableItem( nWhich );
|
|
|
|
break;
|
2008-02-19 12:57:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
nWhich = aIter.NextWhich();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-06-16 07:22:38 +00:00
|
|
|
void SwAnnotationShell::StateStatusLine(SfxItemSet &rSet)
|
|
|
|
{
|
|
|
|
SfxWhichIter aIter( rSet );
|
|
|
|
USHORT nWhich = aIter.FirstWhich();
|
|
|
|
|
|
|
|
while( nWhich )
|
|
|
|
{
|
|
|
|
switch( nWhich )
|
|
|
|
{
|
|
|
|
case FN_STAT_SELMODE:
|
|
|
|
{
|
|
|
|
rSet.Put(SfxUInt16Item(FN_STAT_SELMODE, 0));
|
|
|
|
rSet.DisableItem( nWhich );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case FN_STAT_TEMPLATE:
|
|
|
|
{
|
|
|
|
rSet.DisableItem( nWhich );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
nWhich = aIter.NextWhich();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-02-19 12:57:51 +00:00
|
|
|
void SwAnnotationShell::StateInsert(SfxItemSet &rSet)
|
|
|
|
{
|
|
|
|
SwPostItMgr* pPostItMgr = rView.GetPostItMgr();
|
2010-01-12 10:43:45 +01:00
|
|
|
if ( !pPostItMgr || !pPostItMgr->HasActiveSidebarWin() )
|
2008-02-19 12:57:51 +00:00
|
|
|
return;
|
|
|
|
|
2010-01-12 10:43:45 +01:00
|
|
|
OutlinerView* pOLV = pPostItMgr->GetActiveSidebarWin()->GetOutlinerView();
|
2008-02-19 12:57:51 +00:00
|
|
|
SfxWhichIter aIter(rSet);
|
|
|
|
sal_uInt16 nWhich = aIter.FirstWhich();
|
|
|
|
|
|
|
|
while(nWhich)
|
|
|
|
{
|
|
|
|
switch(nWhich)
|
|
|
|
{
|
|
|
|
case SID_HYPERLINK_GETLINK:
|
|
|
|
{
|
|
|
|
SvxHyperlinkItem aHLinkItem;
|
|
|
|
aHLinkItem.SetInsertMode(HLINK_FIELD);
|
|
|
|
|
|
|
|
const SvxFieldItem* pFieldItem = pOLV->GetFieldAtSelection();
|
|
|
|
|
|
|
|
if (pFieldItem)
|
|
|
|
{
|
|
|
|
const SvxFieldData* pField = pFieldItem->GetField();
|
|
|
|
|
|
|
|
if (pField->ISA(SvxURLField))
|
|
|
|
{
|
|
|
|
aHLinkItem.SetName(((const SvxURLField*) pField)->GetRepresentation());
|
|
|
|
aHLinkItem.SetURL(((const SvxURLField*) pField)->GetURL());
|
|
|
|
aHLinkItem.SetTargetFrame(((const SvxURLField*) pField)->GetTargetFrame());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
String sSel(pOLV->GetSelected());
|
|
|
|
sSel.Erase(255);
|
|
|
|
sSel.EraseTrailingChars();
|
|
|
|
aHLinkItem.SetName(sSel);
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_uInt16 nHtmlMode = ::GetHtmlMode(rView.GetDocShell());
|
|
|
|
aHLinkItem.SetInsertMode((SvxLinkInsertMode)(aHLinkItem.GetInsertMode() |
|
|
|
|
((nHtmlMode & HTMLMODE_ON) != 0 ? HLINK_HTMLMODE : 0)));
|
|
|
|
|
|
|
|
rSet.Put(aHLinkItem);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2008-06-16 07:22:38 +00:00
|
|
|
|
2010-01-12 10:43:45 +01:00
|
|
|
if (pPostItMgr->GetActiveSidebarWin()->GetLayoutStatus()==SwPostItHelper::DELETED)
|
2008-06-16 07:22:38 +00:00
|
|
|
rSet.DisableItem( nWhich );
|
|
|
|
|
2008-02-19 12:57:51 +00:00
|
|
|
nWhich = aIter.NextWhich();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void SwAnnotationShell::NoteExec(SfxRequest &rReq)
|
|
|
|
{
|
|
|
|
SwPostItMgr* pPostItMgr = rView.GetPostItMgr();
|
2008-04-11 13:03:42 +00:00
|
|
|
if ( !pPostItMgr )
|
2008-02-19 12:57:51 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
sal_uInt16 nSlot = rReq.GetSlot();
|
|
|
|
switch (nSlot)
|
|
|
|
{
|
2009-01-02 15:51:45 +00:00
|
|
|
case FN_REPLY:
|
|
|
|
case FN_POSTIT:
|
|
|
|
case FN_DELETE_COMMENT:
|
2008-02-19 12:57:51 +00:00
|
|
|
case FN_DELETE_NOTE:
|
2010-01-12 10:43:45 +01:00
|
|
|
if ( pPostItMgr->HasActiveSidebarWin() )
|
|
|
|
pPostItMgr->GetActiveSidebarWin()->ExecuteCommand(nSlot);
|
2008-04-11 13:03:42 +00:00
|
|
|
break;
|
2008-02-19 12:57:51 +00:00
|
|
|
case FN_DELETE_ALL_NOTES:
|
2008-04-11 13:03:42 +00:00
|
|
|
pPostItMgr->Delete();
|
|
|
|
break;
|
|
|
|
case FN_DELETE_NOTE_AUTHOR:
|
|
|
|
{
|
|
|
|
SFX_REQUEST_ARG( rReq, pItem, SfxStringItem, nSlot, FALSE);
|
|
|
|
if ( pItem )
|
|
|
|
pPostItMgr->Delete( pItem->GetValue() );
|
|
|
|
break;
|
|
|
|
}
|
2008-02-19 12:57:51 +00:00
|
|
|
case FN_HIDE_NOTE:
|
2009-01-02 15:51:45 +00:00
|
|
|
/*
|
2010-01-12 10:43:45 +01:00
|
|
|
if ( Mgr()->GetActiveSidebarWin() == this )
|
2009-01-02 15:51:45 +00:00
|
|
|
{
|
|
|
|
Mgr()->SetActivePostIt(0);
|
|
|
|
// put the cursor back into the document
|
|
|
|
SwitchToFieldPos();
|
|
|
|
}
|
|
|
|
Mgr()->Hide(mpFld);
|
|
|
|
*/
|
2008-04-11 13:03:42 +00:00
|
|
|
break;
|
2008-02-19 12:57:51 +00:00
|
|
|
case FN_HIDE_ALL_NOTES:
|
2008-04-11 13:03:42 +00:00
|
|
|
pPostItMgr->Hide();
|
|
|
|
break;
|
|
|
|
case FN_HIDE_NOTE_AUTHOR:
|
|
|
|
{
|
|
|
|
SFX_REQUEST_ARG( rReq, pItem, SfxStringItem, nSlot, FALSE);
|
|
|
|
if ( pItem )
|
|
|
|
pPostItMgr->Hide( pItem->GetValue() );
|
|
|
|
}
|
2008-02-19 12:57:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SwAnnotationShell::GetNoteState(SfxItemSet &rSet)
|
|
|
|
{
|
|
|
|
SwPostItMgr* pPostItMgr = rView.GetPostItMgr();
|
|
|
|
SfxWhichIter aIter(rSet);
|
|
|
|
sal_uInt16 nWhich = aIter.FirstWhich();
|
|
|
|
while(nWhich)
|
|
|
|
{
|
|
|
|
USHORT nSlotId = GetPool().GetSlotId( nWhich );
|
|
|
|
switch( nSlotId )
|
|
|
|
{
|
2009-01-02 15:51:45 +00:00
|
|
|
case FN_POSTIT:
|
2008-02-19 12:57:51 +00:00
|
|
|
case FN_DELETE_NOTE:
|
|
|
|
case FN_DELETE_NOTE_AUTHOR:
|
|
|
|
case FN_DELETE_ALL_NOTES:
|
|
|
|
case FN_HIDE_NOTE:
|
|
|
|
case FN_HIDE_NOTE_AUTHOR:
|
|
|
|
case FN_HIDE_ALL_NOTES:
|
2009-01-02 15:51:45 +00:00
|
|
|
{
|
2010-01-12 10:43:45 +01:00
|
|
|
if ( !pPostItMgr ||
|
|
|
|
!pPostItMgr->HasActiveAnnotationWin() )
|
|
|
|
{
|
2009-01-02 15:51:45 +00:00
|
|
|
rSet.DisableItem(nWhich);
|
2010-01-12 10:43:45 +01:00
|
|
|
}
|
2009-01-02 15:51:45 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case FN_DELETE_COMMENT:
|
|
|
|
{
|
2010-01-12 10:43:45 +01:00
|
|
|
if ( !pPostItMgr ||
|
|
|
|
!pPostItMgr->HasActiveSidebarWin() /*HasActiveRedCommentWin()*/ )
|
|
|
|
{
|
2009-01-02 15:51:45 +00:00
|
|
|
rSet.DisableItem(nWhich);
|
2010-01-12 10:43:45 +01:00
|
|
|
}
|
2009-01-02 15:51:45 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case FN_REPLY:
|
|
|
|
{
|
2010-01-12 10:43:45 +01:00
|
|
|
if ( !pPostItMgr ||
|
|
|
|
!pPostItMgr->HasActiveAnnotationWin() )
|
|
|
|
{
|
2009-01-02 15:51:45 +00:00
|
|
|
rSet.DisableItem(nWhich);
|
2010-01-12 10:43:45 +01:00
|
|
|
}
|
2009-01-02 15:51:45 +00:00
|
|
|
else
|
2008-02-19 12:57:51 +00:00
|
|
|
{
|
2009-01-02 15:51:45 +00:00
|
|
|
SvtUserOptions aUserOpt;
|
|
|
|
String sAuthor;
|
|
|
|
if( !(sAuthor = aUserOpt.GetFullName()).Len())
|
|
|
|
if( !(sAuthor = aUserOpt.GetID()).Len() )
|
|
|
|
sAuthor = String( SW_RES( STR_REDLINE_UNKNOWN_AUTHOR ));
|
2010-01-12 10:43:45 +01:00
|
|
|
if (sAuthor == pPostItMgr->GetActiveSidebarWin()->GetAuthor())
|
2009-01-02 15:51:45 +00:00
|
|
|
rSet.DisableItem(nWhich);
|
2008-02-19 12:57:51 +00:00
|
|
|
}
|
|
|
|
break;
|
2009-01-02 15:51:45 +00:00
|
|
|
}
|
2008-02-19 12:57:51 +00:00
|
|
|
default:
|
|
|
|
rSet.InvalidateItem( nWhich );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2010-01-12 10:43:45 +01:00
|
|
|
if (pPostItMgr->HasActiveSidebarWin())
|
2009-02-13 14:09:50 +00:00
|
|
|
{
|
2010-01-12 10:43:45 +01:00
|
|
|
if ( (pPostItMgr->GetActiveSidebarWin()->IsProtected()) &&
|
2009-02-13 14:09:50 +00:00
|
|
|
( (nSlotId==FN_DELETE_NOTE) || (nSlotId==FN_REPLY) ) )
|
2009-01-02 15:51:45 +00:00
|
|
|
rSet.DisableItem( nWhich );
|
2009-02-13 14:09:50 +00:00
|
|
|
}
|
2008-02-19 12:57:51 +00:00
|
|
|
nWhich = aIter.NextWhich();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SwAnnotationShell::ExecLingu(SfxRequest &rReq)
|
|
|
|
{
|
|
|
|
SwPostItMgr* pPostItMgr = rView.GetPostItMgr();
|
2010-01-12 10:43:45 +01:00
|
|
|
if ( !pPostItMgr || !pPostItMgr->HasActiveSidebarWin() )
|
2008-02-19 12:57:51 +00:00
|
|
|
return;
|
|
|
|
|
2010-01-12 10:43:45 +01:00
|
|
|
OutlinerView* pOLV = pPostItMgr->GetActiveSidebarWin()->GetOutlinerView();
|
2008-06-16 07:22:38 +00:00
|
|
|
SfxItemSet aEditAttr(pOLV->GetAttribs());
|
2008-02-19 12:57:51 +00:00
|
|
|
sal_uInt16 nSlot = rReq.GetSlot();
|
2008-06-16 07:22:38 +00:00
|
|
|
SwWrtShell &rSh = rView.GetWrtShell();
|
|
|
|
bool bRestoreSelection = false;
|
|
|
|
ESelection aOldSelection;
|
|
|
|
|
2008-02-19 12:57:51 +00:00
|
|
|
switch (nSlot)
|
|
|
|
{
|
2008-06-16 07:22:38 +00:00
|
|
|
case SID_LANGUAGE_STATUS:
|
|
|
|
{
|
|
|
|
aOldSelection = pOLV->GetSelection();
|
|
|
|
if (!pOLV->GetEditView().HasSelection())
|
|
|
|
{
|
|
|
|
bRestoreSelection = true;
|
|
|
|
pOLV->GetEditView().SelectCurrentWord();
|
|
|
|
}
|
|
|
|
|
2008-07-01 13:37:27 +00:00
|
|
|
bRestoreSelection = SwLangHelper::SetLanguageStatus(pOLV,rReq,rView,rSh);
|
2008-06-16 07:22:38 +00:00
|
|
|
break;
|
|
|
|
}
|
2009-11-25 16:52:25 +00:00
|
|
|
case SID_THES:
|
|
|
|
{
|
|
|
|
String aReplaceText;
|
|
|
|
SFX_REQUEST_ARG( rReq, pItem2, SfxStringItem, SID_THES, sal_False );
|
|
|
|
if (pItem2)
|
|
|
|
aReplaceText = pItem2->GetValue();
|
|
|
|
if (aReplaceText.Len() > 0)
|
|
|
|
ReplaceTextWithSynonym( pOLV->GetEditView(), aReplaceText );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case SID_THESAURUS:
|
2008-02-19 12:57:51 +00:00
|
|
|
{
|
|
|
|
pOLV->StartThesaurus();
|
|
|
|
break;
|
|
|
|
}
|
2008-05-30 08:30:05 +00:00
|
|
|
case SID_HANGUL_HANJA_CONVERSION:
|
|
|
|
pOLV->StartTextConversion( LANGUAGE_KOREAN, LANGUAGE_KOREAN, NULL,
|
|
|
|
i18n::TextConversionOption::CHARACTER_BY_CHARACTER, sal_True, sal_False );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_CHINESE_CONVERSION:
|
2008-06-16 07:22:38 +00:00
|
|
|
{
|
2008-05-30 08:30:05 +00:00
|
|
|
//open ChineseTranslationDialog
|
|
|
|
Reference< XComponentContext > xContext(
|
|
|
|
::cppu::defaultBootstrap_InitialComponentContext() ); //@todo get context from calc if that has one
|
|
|
|
if(xContext.is())
|
|
|
|
{
|
|
|
|
Reference< lang::XMultiComponentFactory > xMCF( xContext->getServiceManager() );
|
|
|
|
if(xMCF.is())
|
|
|
|
{
|
|
|
|
Reference< ui::dialogs::XExecutableDialog > xDialog(
|
|
|
|
xMCF->createInstanceWithContext(
|
|
|
|
rtl::OUString::createFromAscii("com.sun.star.linguistic2.ChineseTranslationDialog")
|
|
|
|
, xContext), UNO_QUERY);
|
|
|
|
Reference< lang::XInitialization > xInit( xDialog, UNO_QUERY );
|
|
|
|
if( xInit.is() )
|
|
|
|
{
|
|
|
|
// initialize dialog
|
|
|
|
Reference< awt::XWindow > xDialogParentWindow(0);
|
|
|
|
Sequence<Any> aSeq(1);
|
|
|
|
Any* pArray = aSeq.getArray();
|
|
|
|
PropertyValue aParam;
|
|
|
|
aParam.Name = rtl::OUString::createFromAscii("ParentWindow");
|
|
|
|
aParam.Value <<= makeAny(xDialogParentWindow);
|
|
|
|
pArray[0] <<= makeAny(aParam);
|
|
|
|
xInit->initialize( aSeq );
|
|
|
|
|
|
|
|
//execute dialog
|
|
|
|
sal_Int16 nDialogRet = xDialog->execute();
|
|
|
|
if( RET_OK == nDialogRet )
|
|
|
|
{
|
|
|
|
//get some parameters from the dialog
|
|
|
|
sal_Bool bToSimplified = sal_True;
|
|
|
|
sal_Bool bUseVariants = sal_True;
|
|
|
|
sal_Bool bCommonTerms = sal_True;
|
|
|
|
Reference< beans::XPropertySet > xProp( xDialog, UNO_QUERY );
|
|
|
|
if( xProp.is() )
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
xProp->getPropertyValue( C2U("IsDirectionToSimplified") ) >>= bToSimplified;
|
|
|
|
xProp->getPropertyValue( C2U("IsUseCharacterVariants") ) >>= bUseVariants;
|
|
|
|
xProp->getPropertyValue( C2U("IsTranslateCommonTerms") ) >>= bCommonTerms;
|
|
|
|
}
|
|
|
|
catch( Exception& )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//execute translation
|
|
|
|
sal_Int16 nSourceLang = bToSimplified ? LANGUAGE_CHINESE_TRADITIONAL : LANGUAGE_CHINESE_SIMPLIFIED;
|
|
|
|
sal_Int16 nTargetLang = bToSimplified ? LANGUAGE_CHINESE_SIMPLIFIED : LANGUAGE_CHINESE_TRADITIONAL;
|
|
|
|
sal_Int32 nOptions = bUseVariants ? i18n::TextConversionOption::USE_CHARACTER_VARIANTS : 0;
|
|
|
|
if( !bCommonTerms )
|
|
|
|
nOptions = nOptions | i18n::TextConversionOption::CHARACTER_BY_CHARACTER;
|
|
|
|
|
|
|
|
Font aTargetFont = pOLV->GetWindow()->GetDefaultFont( DEFAULTFONT_CJK_TEXT,
|
|
|
|
nTargetLang, DEFAULTFONT_FLAGS_ONLYONE );
|
|
|
|
|
|
|
|
pOLV->StartTextConversion( nSourceLang, nTargetLang, &aTargetFont, nOptions, sal_False, sal_False );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Reference< lang::XComponent > xComponent( xDialog, UNO_QUERY );
|
|
|
|
if( xComponent.is() )
|
|
|
|
xComponent->dispose();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
2008-02-19 12:57:51 +00:00
|
|
|
}
|
2008-06-16 07:22:38 +00:00
|
|
|
|
|
|
|
if (bRestoreSelection)
|
|
|
|
{
|
|
|
|
// restore selection
|
|
|
|
pOLV->GetEditView().SetSelection( aOldSelection );
|
|
|
|
}
|
2008-02-19 12:57:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SwAnnotationShell::GetLinguState(SfxItemSet &rSet)
|
|
|
|
{
|
|
|
|
SwPostItMgr* pPostItMgr = rView.GetPostItMgr();
|
2010-01-12 10:43:45 +01:00
|
|
|
if ( !pPostItMgr || !pPostItMgr->HasActiveSidebarWin() )
|
2008-02-19 12:57:51 +00:00
|
|
|
return;
|
|
|
|
|
2010-01-12 10:43:45 +01:00
|
|
|
OutlinerView* pOLV = pPostItMgr->GetActiveSidebarWin()->GetOutlinerView();
|
2008-02-19 12:57:51 +00:00
|
|
|
SfxItemSet aEditAttr(pOLV->GetAttribs());
|
|
|
|
|
|
|
|
SfxWhichIter aIter(rSet);
|
|
|
|
sal_uInt16 nWhich = aIter.FirstWhich();
|
|
|
|
while(nWhich)
|
|
|
|
{
|
|
|
|
switch (nWhich)
|
|
|
|
{
|
2008-06-16 07:22:38 +00:00
|
|
|
case SID_LANGUAGE_STATUS:
|
|
|
|
{
|
2008-07-01 13:37:27 +00:00
|
|
|
SwLangHelper::GetLanguageStatus(pOLV,rSet);
|
|
|
|
break;
|
2008-06-16 07:22:38 +00:00
|
|
|
}
|
2009-11-25 16:52:25 +00:00
|
|
|
|
|
|
|
case SID_THES:
|
|
|
|
{
|
|
|
|
String aStatusVal;
|
|
|
|
LanguageType nLang = LANGUAGE_NONE;
|
|
|
|
bool bIsLookUpWord = GetStatusValueForThesaurusFromContext( aStatusVal, nLang, pOLV->GetEditView() );
|
|
|
|
rSet.Put( SfxStringItem( SID_THES, aStatusVal ) );
|
|
|
|
|
|
|
|
// disable "Thesaurus" context menu entry if there is nothing to look up
|
|
|
|
uno::Reference< linguistic2::XThesaurus > xThes( ::GetThesaurus() );
|
|
|
|
lang::Locale aLocale( SvxCreateLocale( nLang ) );
|
|
|
|
if (!bIsLookUpWord ||
|
|
|
|
!xThes.is() || nLang == LANGUAGE_NONE || !xThes->hasLocale( aLocale ))
|
|
|
|
rSet.DisableItem( SID_THES );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2008-02-19 12:57:51 +00:00
|
|
|
// disable "Thesaurus" if the language is not supported
|
2009-11-25 16:52:25 +00:00
|
|
|
case SID_THESAURUS:
|
2008-02-19 12:57:51 +00:00
|
|
|
{
|
|
|
|
const SfxPoolItem &rItem = rView.GetWrtShell().GetDoc()->GetDefault(
|
|
|
|
GetWhichOfScript( RES_CHRATR_LANGUAGE,
|
|
|
|
GetI18NScriptTypeOfLanguage( (USHORT)GetAppLanguage())) );
|
2008-05-30 08:30:05 +00:00
|
|
|
LanguageType nLang = ((const SvxLanguageItem &)
|
|
|
|
rItem).GetLanguage();
|
|
|
|
uno::Reference< linguistic2::XThesaurus > xThes( ::GetThesaurus() );
|
|
|
|
if (!xThes.is() || nLang == LANGUAGE_NONE ||
|
|
|
|
!xThes->hasLocale( SvxCreateLocale( nLang ) ))
|
2009-11-25 16:52:25 +00:00
|
|
|
rSet.DisableItem( SID_THESAURUS );
|
2008-05-30 08:30:05 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SID_HANGUL_HANJA_CONVERSION:
|
|
|
|
case SID_CHINESE_CONVERSION:
|
|
|
|
{
|
|
|
|
if (!SvtCJKOptions().IsAnyEnabled())
|
|
|
|
{
|
|
|
|
rView.GetViewFrame()->GetBindings().SetVisibleState( nWhich, sal_False );
|
|
|
|
rSet.DisableItem(nWhich);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
rView.GetViewFrame()->GetBindings().SetVisibleState( nWhich, sal_True );
|
2008-02-19 12:57:51 +00:00
|
|
|
}
|
2008-05-30 08:30:05 +00:00
|
|
|
break;
|
2008-02-19 12:57:51 +00:00
|
|
|
}
|
2008-06-16 07:22:38 +00:00
|
|
|
|
2010-01-12 10:43:45 +01:00
|
|
|
if (pPostItMgr->GetActiveSidebarWin()->GetLayoutStatus()==SwPostItHelper::DELETED)
|
2008-06-16 07:22:38 +00:00
|
|
|
rSet.DisableItem( nWhich );
|
|
|
|
|
2008-02-19 12:57:51 +00:00
|
|
|
nWhich = aIter.NextWhich();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SwAnnotationShell::ExecTransliteration(SfxRequest &rReq)
|
|
|
|
{
|
|
|
|
SwPostItMgr* pPostItMgr = rView.GetPostItMgr();
|
2010-01-12 10:43:45 +01:00
|
|
|
if ( !pPostItMgr || !pPostItMgr->HasActiveSidebarWin() )
|
2008-02-19 12:57:51 +00:00
|
|
|
return;
|
|
|
|
|
2010-01-12 10:43:45 +01:00
|
|
|
OutlinerView* pOLV = pPostItMgr->GetActiveSidebarWin()->GetOutlinerView();
|
2008-02-19 12:57:51 +00:00
|
|
|
|
|
|
|
using namespace ::com::sun::star::i18n;
|
|
|
|
{
|
|
|
|
sal_uInt32 nMode = 0;
|
|
|
|
|
|
|
|
switch( rReq.GetSlot() )
|
|
|
|
{
|
2009-09-17 07:35:16 +00:00
|
|
|
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;
|
2008-02-19 12:57:51 +00:00
|
|
|
case SID_TRANSLITERATE_UPPER:
|
|
|
|
nMode = TransliterationModules_LOWERCASE_UPPERCASE;
|
|
|
|
break;
|
|
|
|
case SID_TRANSLITERATE_LOWER:
|
|
|
|
nMode = TransliterationModules_UPPERCASE_LOWERCASE;
|
|
|
|
break;
|
|
|
|
case SID_TRANSLITERATE_HALFWIDTH:
|
|
|
|
nMode = TransliterationModules_FULLWIDTH_HALFWIDTH;
|
|
|
|
break;
|
|
|
|
case SID_TRANSLITERATE_FULLWIDTH:
|
|
|
|
nMode = TransliterationModules_HALFWIDTH_FULLWIDTH;
|
|
|
|
break;
|
|
|
|
case SID_TRANSLITERATE_HIRAGANA:
|
|
|
|
nMode = TransliterationModules_KATAKANA_HIRAGANA;
|
|
|
|
break;
|
|
|
|
case SID_TRANSLITERATE_KATAGANA:
|
|
|
|
nMode = TransliterationModules_HIRAGANA_KATAKANA;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
ASSERT(!this, "falscher Dispatcher");
|
|
|
|
}
|
|
|
|
|
|
|
|
if( nMode )
|
|
|
|
{
|
|
|
|
pOLV->TransliterateText( nMode );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SwAnnotationShell::ExecUndo(SfxRequest &rReq)
|
|
|
|
{
|
|
|
|
const SfxItemSet* pArgs = rReq.GetArgs();
|
|
|
|
SfxUndoManager* pUndoManager = GetUndoManager();
|
|
|
|
SwWrtShell &rSh = rView.GetWrtShell();
|
|
|
|
|
2010-01-12 10:43:45 +01:00
|
|
|
long aOldHeight = rView.GetPostItMgr()->HasActiveSidebarWin()
|
|
|
|
? rView.GetPostItMgr()->GetActiveSidebarWin()->GetPostItTextHeight()
|
|
|
|
: 0;
|
2008-04-11 13:03:42 +00:00
|
|
|
|
2008-02-19 12:57:51 +00:00
|
|
|
USHORT nId = rReq.GetSlot();
|
|
|
|
sal_uInt16 nCnt = 1;
|
|
|
|
const SfxPoolItem* pItem=0;
|
|
|
|
if( pArgs && SFX_ITEM_SET == pArgs->GetItemState( nId, FALSE, &pItem ) )
|
|
|
|
nCnt = ((SfxUInt16Item*)pItem)->GetValue();
|
|
|
|
switch( nId )
|
|
|
|
{
|
|
|
|
case SID_UNDO:
|
|
|
|
{
|
|
|
|
if ( pUndoManager )
|
|
|
|
{
|
|
|
|
sal_uInt16 nCount = pUndoManager->GetUndoActionCount();
|
|
|
|
sal_uInt16 nSteps = nCnt;
|
|
|
|
if ( nCount < nCnt )
|
|
|
|
{
|
|
|
|
nCnt = nCnt - nCount;
|
|
|
|
nSteps = nCount;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
nCnt = 0;
|
|
|
|
|
|
|
|
while( nSteps-- )
|
|
|
|
pUndoManager->Undo(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( nCnt )
|
|
|
|
rSh.Do( SwWrtShell::UNDO, nCnt );
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case SID_REDO:
|
|
|
|
{
|
|
|
|
if ( pUndoManager )
|
|
|
|
{
|
|
|
|
sal_uInt16 nCount = pUndoManager->GetRedoActionCount();
|
|
|
|
sal_uInt16 nSteps = nCnt;
|
|
|
|
if ( nCount < nCnt )
|
|
|
|
{
|
|
|
|
nCnt = nCnt - nCount;
|
|
|
|
nSteps = nCount;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
nCnt = 0;
|
|
|
|
|
|
|
|
while( nSteps-- )
|
|
|
|
pUndoManager->Redo(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( nCnt )
|
|
|
|
rSh.Do( SwWrtShell::REDO, nCnt );
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2008-04-11 13:03:42 +00:00
|
|
|
|
2009-09-18 10:15:03 +00:00
|
|
|
rView.GetViewFrame()->GetBindings().InvalidateAll(sal_False);
|
|
|
|
|
2010-01-12 10:43:45 +01:00
|
|
|
if (rView.GetPostItMgr()->HasActiveSidebarWin())
|
|
|
|
rView.GetPostItMgr()->GetActiveSidebarWin()->ResizeIfNeccessary(aOldHeight,rView.GetPostItMgr()->GetActiveSidebarWin()->GetPostItTextHeight());
|
2008-02-19 12:57:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SwAnnotationShell::StateUndo(SfxItemSet &rSet)
|
|
|
|
{
|
2008-06-16 07:22:38 +00:00
|
|
|
SwPostItMgr* pPostItMgr = rView.GetPostItMgr();
|
2010-01-12 10:43:45 +01:00
|
|
|
if ( !pPostItMgr || !pPostItMgr->HasActiveSidebarWin() )
|
2008-06-16 07:22:38 +00:00
|
|
|
return;
|
|
|
|
|
2008-02-19 12:57:51 +00:00
|
|
|
SfxWhichIter aIter(rSet);
|
|
|
|
USHORT nWhich = aIter.FirstWhich();
|
|
|
|
SfxUndoManager* pUndoManager = GetUndoManager();
|
|
|
|
SfxViewFrame *pSfxViewFrame = rView.GetViewFrame();
|
|
|
|
SwWrtShell &rSh = rView.GetWrtShell();
|
|
|
|
|
|
|
|
while( nWhich )
|
|
|
|
{
|
|
|
|
switch ( nWhich )
|
|
|
|
{
|
|
|
|
case SID_UNDO:
|
|
|
|
{
|
|
|
|
sal_uInt16 nCount = pUndoManager->GetUndoActionCount();
|
|
|
|
if ( nCount )
|
|
|
|
pSfxViewFrame->GetSlotState( nWhich, pSfxViewFrame->GetInterface(), &rSet );
|
|
|
|
else if( rSh.GetUndoIds() )
|
|
|
|
rSet.Put( SfxStringItem( nWhich, rSh.GetDoString(SwWrtShell::UNDO)) );
|
|
|
|
else
|
|
|
|
rSet.DisableItem(nWhich);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case SID_REDO:
|
|
|
|
{
|
|
|
|
sal_uInt16 nCount = pUndoManager->GetRedoActionCount();
|
|
|
|
if ( nCount )
|
|
|
|
pSfxViewFrame->GetSlotState( nWhich, pSfxViewFrame->GetInterface(), &rSet );
|
|
|
|
else if(rSh.GetRedoIds())
|
|
|
|
rSet.Put(SfxStringItem( nWhich, rSh.GetDoString(SwWrtShell::REDO)) );
|
|
|
|
else
|
|
|
|
rSet.DisableItem(nWhich);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case SID_GETUNDOSTRINGS:
|
|
|
|
case SID_GETREDOSTRINGS:
|
|
|
|
{
|
|
|
|
if( pUndoManager )
|
|
|
|
{
|
|
|
|
UniString (SfxUndoManager:: *fnGetComment)( USHORT ) const;
|
|
|
|
|
|
|
|
sal_uInt16 nCount;
|
|
|
|
if( SID_GETUNDOSTRINGS == nWhich )
|
|
|
|
{
|
|
|
|
nCount = pUndoManager->GetUndoActionCount();
|
|
|
|
fnGetComment = &SfxUndoManager::GetUndoActionComment;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
nCount = pUndoManager->GetRedoActionCount();
|
|
|
|
fnGetComment = &SfxUndoManager::GetRedoActionComment;
|
|
|
|
}
|
|
|
|
|
|
|
|
String sList;
|
|
|
|
if( nCount )
|
|
|
|
{
|
|
|
|
for( sal_uInt16 n = 0; n < nCount; ++n )
|
|
|
|
( sList += (pUndoManager->*fnGetComment)( n ) )
|
|
|
|
+= '\n';
|
|
|
|
}
|
|
|
|
|
|
|
|
SfxStringListItem aItem( nWhich );
|
|
|
|
if( nWhich == SID_GETUNDOSTRINGS && rSh.GetUndoIds() )
|
|
|
|
{
|
|
|
|
rSh.GetDoStrings( SwWrtShell::UNDO, aItem );
|
|
|
|
}
|
|
|
|
else if( nWhich == SID_GETREDOSTRINGS && rSh.GetRedoIds() )
|
|
|
|
{
|
|
|
|
rSh.GetDoStrings( SwWrtShell::UNDO, aItem );
|
|
|
|
}
|
|
|
|
|
|
|
|
sList += aItem.GetString();
|
|
|
|
aItem.SetString( sList );
|
|
|
|
rSet.Put( aItem );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
rSet.DisableItem( nWhich );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
{
|
|
|
|
pSfxViewFrame->GetSlotState( nWhich, pSfxViewFrame->GetInterface(), &rSet );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2008-06-16 07:22:38 +00:00
|
|
|
|
2010-01-12 10:43:45 +01:00
|
|
|
if (pPostItMgr->GetActiveSidebarWin()->GetLayoutStatus()==SwPostItHelper::DELETED)
|
2008-06-16 07:22:38 +00:00
|
|
|
rSet.DisableItem( nWhich );
|
|
|
|
|
2008-02-19 12:57:51 +00:00
|
|
|
nWhich = aIter.NextWhich();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SwAnnotationShell::StateDisableItems( SfxItemSet &rSet )
|
|
|
|
{
|
|
|
|
SfxWhichIter aIter(rSet);
|
|
|
|
USHORT nWhich = aIter.FirstWhich();
|
|
|
|
while (nWhich)
|
|
|
|
{
|
|
|
|
rSet.DisableItem( nWhich );
|
|
|
|
nWhich = aIter.NextWhich();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SwAnnotationShell::InsertSymbol(SfxRequest& rReq)
|
|
|
|
{
|
|
|
|
SwPostItMgr* pPostItMgr = rView.GetPostItMgr();
|
2010-01-12 10:43:45 +01:00
|
|
|
if ( !pPostItMgr || !pPostItMgr->HasActiveSidebarWin() )
|
2008-02-19 12:57:51 +00:00
|
|
|
return;
|
|
|
|
|
2010-01-12 10:43:45 +01:00
|
|
|
OutlinerView* pOLV = pPostItMgr->GetActiveSidebarWin()->GetOutlinerView();
|
2008-02-19 12:57:51 +00:00
|
|
|
|
|
|
|
const SfxItemSet *pArgs = rReq.GetArgs();
|
|
|
|
const SfxPoolItem* pItem = 0;
|
|
|
|
if( pArgs )
|
2009-05-06 10:59:57 +00:00
|
|
|
pArgs->GetItemState(GetPool().GetWhich(SID_CHARMAP), FALSE, &pItem);
|
2008-02-19 12:57:51 +00:00
|
|
|
|
|
|
|
String sSym;
|
|
|
|
String sFontName;
|
|
|
|
if ( pItem )
|
|
|
|
{
|
|
|
|
sSym = ((const SfxStringItem*)pItem)->GetValue();
|
|
|
|
const SfxPoolItem* pFtItem = NULL;
|
2009-05-06 10:59:57 +00:00
|
|
|
pArgs->GetItemState( GetPool().GetWhich(SID_ATTR_SPECIALCHAR), FALSE, &pFtItem);
|
2008-02-19 12:57:51 +00:00
|
|
|
const SfxStringItem* pFontItem = PTR_CAST( SfxStringItem, pFtItem );
|
|
|
|
if ( pFontItem )
|
|
|
|
sFontName = pFontItem->GetValue();
|
|
|
|
}
|
|
|
|
|
|
|
|
SfxItemSet aSet(pOLV->GetAttribs());
|
|
|
|
USHORT nScript = pOLV->GetSelectedScriptType();
|
|
|
|
SvxFontItem aSetDlgFont( RES_CHRATR_FONT );
|
|
|
|
{
|
|
|
|
SvxScriptSetItem aSetItem( SID_ATTR_CHAR_FONT, *aSet.GetPool() );
|
|
|
|
aSetItem.GetItemSet().Put( aSet, FALSE );
|
|
|
|
const SfxPoolItem* pI = aSetItem.GetItemOfScript( nScript );
|
|
|
|
if( pI )
|
|
|
|
aSetDlgFont = *(SvxFontItem*)pI;
|
|
|
|
else
|
|
|
|
aSetDlgFont = (SvxFontItem&)aSet.Get( GetWhichOfScript(
|
|
|
|
SID_ATTR_CHAR_FONT,
|
|
|
|
GetI18NScriptTypeOfLanguage( (USHORT)GetAppLanguage() ) ));
|
2009-05-06 10:59:57 +00:00
|
|
|
if (!sFontName.Len())
|
|
|
|
sFontName = aSetDlgFont.GetFamilyName();
|
2008-02-19 12:57:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Font aFont(sFontName, Size(1,1));
|
2009-05-06 10:59:57 +00:00
|
|
|
if( !sSym.Len() )
|
2008-02-19 12:57:51 +00:00
|
|
|
{
|
|
|
|
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
|
|
|
|
|
2009-05-06 10:59:57 +00:00
|
|
|
SfxAllItemSet aAllSet( GetPool() );
|
|
|
|
aAllSet.Put( SfxBoolItem( FN_PARAM_1, FALSE ) );
|
|
|
|
|
2008-02-19 12:57:51 +00:00
|
|
|
SwViewOption aOpt(*rView.GetWrtShell().GetViewOptions());
|
|
|
|
String sSymbolFont = aOpt.GetSymbolFont();
|
2009-05-06 10:59:57 +00:00
|
|
|
if( sSymbolFont.Len() )
|
|
|
|
aAllSet.Put( SfxStringItem( SID_FONT_NAME, sSymbolFont ) );
|
2008-02-19 12:57:51 +00:00
|
|
|
else
|
2009-05-06 10:59:57 +00:00
|
|
|
aAllSet.Put( SfxStringItem( SID_FONT_NAME, aSetDlgFont.GetFamilyName() ) );
|
2008-02-19 12:57:51 +00:00
|
|
|
|
|
|
|
// Wenn Zeichen selektiert ist kann es angezeigt werden
|
2009-05-06 10:59:57 +00:00
|
|
|
SfxAbstractDialog* pDlg = pFact->CreateSfxDialog( rView.GetWindow(), aAllSet,
|
2009-12-15 23:07:57 +01:00
|
|
|
rView.GetViewFrame()->GetFrame().GetFrameInterface(), RID_SVXDLG_CHARMAP );
|
2009-05-06 10:59:57 +00:00
|
|
|
|
2008-02-19 12:57:51 +00:00
|
|
|
USHORT nResult = pDlg->Execute();
|
|
|
|
if( nResult == RET_OK )
|
|
|
|
{
|
2009-05-06 10:59:57 +00:00
|
|
|
SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pCItem, SfxStringItem, SID_CHARMAP, FALSE );
|
|
|
|
SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pFontItem, SvxFontItem, SID_ATTR_CHAR_FONT, FALSE );
|
|
|
|
if ( pFontItem )
|
|
|
|
{
|
|
|
|
aFont.SetName( pFontItem->GetFamilyName() );
|
|
|
|
aFont.SetStyleName( pFontItem->GetStyleName() );
|
|
|
|
aFont.SetCharSet( pFontItem->GetCharSet() );
|
|
|
|
aFont.SetPitch( pFontItem->GetPitch() );
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( pCItem )
|
|
|
|
{
|
|
|
|
sSym = pCItem->GetValue();
|
|
|
|
aOpt.SetSymbolFont(aFont.GetName());
|
|
|
|
SW_MOD()->ApplyUsrPref(aOpt, &rView);
|
|
|
|
}
|
2008-02-19 12:57:51 +00:00
|
|
|
}
|
2009-05-06 10:59:57 +00:00
|
|
|
|
2008-02-19 12:57:51 +00:00
|
|
|
delete( pDlg );
|
|
|
|
}
|
|
|
|
|
|
|
|
if( sSym.Len() )
|
|
|
|
{
|
|
|
|
// nicht flackern
|
|
|
|
pOLV->HideCursor();
|
|
|
|
Outliner * pOutliner = pOLV->GetOutliner();
|
|
|
|
pOutliner->SetUpdateMode(FALSE);
|
|
|
|
|
|
|
|
SfxItemSet aOldSet( pOLV->GetAttribs() );
|
|
|
|
SfxItemSet aFontSet( *aOldSet.GetPool(),
|
|
|
|
EE_CHAR_FONTINFO, EE_CHAR_FONTINFO,
|
|
|
|
EE_CHAR_FONTINFO_CJK, EE_CHAR_FONTINFO_CJK,
|
|
|
|
EE_CHAR_FONTINFO_CTL, EE_CHAR_FONTINFO_CTL,
|
|
|
|
0 );
|
|
|
|
aFontSet.Set( aOldSet );
|
|
|
|
|
|
|
|
// String einfuegen
|
2009-09-11 10:21:51 +00:00
|
|
|
pOLV->InsertText( sSym);
|
2008-02-19 12:57:51 +00:00
|
|
|
|
|
|
|
// attributieren (Font setzen)
|
|
|
|
SfxItemSet aSetFont( *aFontSet.GetPool(), aFontSet.GetRanges() );
|
|
|
|
SvxFontItem aFontItem (aFont.GetFamily(), aFont.GetName(),
|
|
|
|
aFont.GetStyleName(), aFont.GetPitch(),
|
|
|
|
aFont.GetCharSet(),
|
|
|
|
EE_CHAR_FONTINFO );
|
|
|
|
USHORT nScriptBreak = pBreakIt->GetAllScriptsOfText( sSym );
|
|
|
|
if( SCRIPTTYPE_LATIN & nScriptBreak )
|
|
|
|
aSetFont.Put( aFontItem, EE_CHAR_FONTINFO );
|
|
|
|
if( SCRIPTTYPE_ASIAN & nScriptBreak )
|
|
|
|
aSetFont.Put( aFontItem, EE_CHAR_FONTINFO_CJK );
|
|
|
|
if( SCRIPTTYPE_COMPLEX & nScriptBreak )
|
|
|
|
aSetFont.Put( aFontItem, EE_CHAR_FONTINFO_CTL );
|
|
|
|
pOLV->SetAttribs(aSetFont);
|
|
|
|
|
|
|
|
// Selektion loeschen
|
|
|
|
ESelection aSel(pOLV->GetSelection());
|
|
|
|
aSel.nStartPara = aSel.nEndPara;
|
|
|
|
aSel.nStartPos = aSel.nEndPos;
|
|
|
|
pOLV->SetSelection(aSel);
|
|
|
|
|
|
|
|
// Alten Font restaurieren
|
|
|
|
pOLV->SetAttribs( aFontSet );
|
|
|
|
|
|
|
|
// ab jetzt wieder anzeigen
|
|
|
|
pOutliner->SetUpdateMode(TRUE);
|
|
|
|
pOLV->ShowCursor();
|
|
|
|
|
2009-05-06 10:59:57 +00:00
|
|
|
rReq.AppendItem( SfxStringItem( GetPool().GetWhich(SID_CHARMAP), sSym ) );
|
2008-02-19 12:57:51 +00:00
|
|
|
if(aFont.GetName().Len())
|
2009-05-06 10:59:57 +00:00
|
|
|
rReq.AppendItem( SfxStringItem( SID_ATTR_SPECIALCHAR, aFont.GetName() ) );
|
2008-02-19 12:57:51 +00:00
|
|
|
rReq.Done();
|
|
|
|
}
|
|
|
|
}
|