Files
libreoffice/sw/source/ui/shells/textsh.cxx
Release Engineers 65f02b557c 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

1263 lines
46 KiB
C++

/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: textsh.cxx,v $
* $Revision: 1.63 $
*
* This file is part of OpenOffice.org.
*
* 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.
*
* 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).
*
* 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.
*
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
#define _SW_FRMVALID_HXX
#include <hintids.hxx>
#include <svtools/globalnameitem.hxx>
#include <sfx2/objface.hxx>
#include <sfx2/lnkbase.hxx>
#ifndef __RSC //autogen
#include <tools/errinf.hxx>
#endif
#include <svx/svdview.hxx>
#include <svtools/ptitem.hxx>
#include <svtools/stritem.hxx>
#include <svtools/moduleoptions.hxx>
#include <vcl/msgbox.hxx>
#include <sfx2/fcontnr.hxx>
#include <svx/hlnkitem.hxx>
#include <svx/srchitem.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/docfile.hxx>
#include <svtools/urihelper.hxx>
#include <basic/sbxvar.hxx>
#include <svtools/whiter.hxx>
#include <sfx2/request.hxx>
#include <svx/opaqitem.hxx>
#include <svx/fontitem.hxx>
#include <svx/adjitem.hxx>
#include <svx/boxitem.hxx>
#include <svx/sizeitem.hxx>
#include <svx/svxacorr.hxx>
#include <svx/scripttypeitem.hxx>
#include <svtools/filter.hxx>
#include <svx/htmlmode.hxx>
#include <svx/pfiledlg.hxx>
#include <svx/htmlcfg.hxx>
#include <com/sun/star/i18n/TransliterationModules.hdl>
#include <sot/clsids.hxx>
#include <svx/acorrcfg.hxx>
#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>
#include <doc.hxx>
#include <uitool.hxx>
#ifndef _CMDID_H
#include <cmdid.h>
#endif
#ifndef _GLOBALS_HRC
#include <globals.hrc>
#endif
#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>
#include <breakit.hxx>
#include <crsskip.hxx>
#include <modcfg.hxx>
#include <column.hxx>
#include <edtwin.hxx>
#ifndef _SHELLS_HRC
#include <shells.hrc>
#endif
#ifndef _POPUP_HRC
#include <popup.hrc>
#endif
#ifndef _SWERROR_H
#include <swerror.h>
#endif
#include <SwAppletImpl.hxx>
#include <unochart.hxx>
#include <chartins.hxx>
#define SwTextShell
#define Paragraph
#define HyphenZone
#define TextFont
#define DropCap
#include <sfx2/msg.hxx>
#include <swslots.hxx>
#include <SwRewriter.hxx>
#include <undobj.hxx>
#ifndef _COMCORE_HRC
#include <comcore.hrc>
#endif
using namespace ::com::sun::star;
using ::rtl::OUString;
#include <svx/svxdlg.hxx>
#include <svx/dialogs.hrc>
#include "swabstdlg.hxx"
#include <misc.hrc>
#include <table.hrc>
#include <frmui.hrc>
#include <unomid.h>
/*--------------------------------------------------------------------
Beschreibung:
--------------------------------------------------------------------*/
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);
SFX_CHILDWINDOW_REGISTRATION(SID_RUBY_DIALOG);
}
TYPEINIT1(SwTextShell,SwBaseShell)
void SwTextShell::ExecInsert(SfxRequest &rReq)
{
SwWrtShell &rSh = GetShell();
ASSERT( !rSh.IsObjSelected() && !rSh.IsFrmSelected(),
"Falsche Shell auf dem Dispatcher" );
const SfxItemSet *pArgs = rReq.GetArgs();
const SfxPoolItem* pItem = 0;
USHORT nSlot = rReq.GetSlot();
if(pArgs)
pArgs->GetItemState(nSlot, FALSE, &pItem );
switch( nSlot )
{
case FN_INSERT_STRING:
if( pItem )
rSh.InsertByWord(((const SfxStringItem *)pItem)->GetValue());
break;
case FN_INSERT_SOFT_HYPHEN:
if( CHAR_SOFTHYPHEN != rSh.SwCrsrShell::GetChar( TRUE, 0 ) &&
CHAR_SOFTHYPHEN != rSh.SwCrsrShell::GetChar( TRUE, -1 ))
rSh.Insert( String( CHAR_SOFTHYPHEN ) );
break;
case FN_INSERT_HARDHYPHEN:
case FN_INSERT_HARD_SPACE:
{
sal_Unicode cIns = FN_INSERT_HARD_SPACE == nSlot ? CHAR_HARDBLANK
: CHAR_HARDHYPHEN;
SvxAutoCorrCfg* pACfg = SvxAutoCorrCfg::Get();
SvxAutoCorrect* pACorr = pACfg->GetAutoCorrect();
if( pACorr && pACfg->IsAutoFmtByInput() &&
pACorr->IsAutoCorrFlag( CptlSttSntnc | CptlSttWrd |
ChgFractionSymbol | ChgOrdinalNumber |
ChgToEnEmDash | SetINetAttr | Autocorrect ))
rSh.AutoCorrect( *pACorr, cIns );
else
rSh.Insert( String( cIns ) );
}
break;
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;
}
rSh.Insert( String( cIns ) );
}
break;
case FN_INSERT_BREAK:
rSh.SplitNode();
rReq.Done();
break;
case FN_INSERT_PAGEBREAK:
rSh.InsertPageBreak();
rReq.Done();
break;
case FN_INSERT_LINEBREAK:
rSh.InsertLineBreak();
rReq.Done();
break;
case FN_INSERT_COLUMN_BREAK:
rSh.InsertColumnBreak();
rReq.Done();
break;
case SID_HYPERLINK_SETLINK:
if (pItem)
InsertHyperlink(*((const SvxHyperlinkItem *)pItem));
rReq.Done();
break;
case SID_INSERT_AVMEDIA:
rReq.SetReturnValue(SfxBoolItem(nSlot, InsertMediaDlg( rReq )));
break;
case SID_INSERT_SOUND:
case SID_INSERT_VIDEO:
{
SvxPluginFileDlg aDlg( &GetView().GetViewFrame()->GetWindow(), nSlot );
aDlg.SetContext( nSlot == SID_INSERT_SOUND? sfx2::FileDialogHelper::SW_INSERT_SOUND : sfx2::FileDialogHelper::SW_INSERT_VIDEO );
if ( ERRCODE_NONE == aDlg.Execute() )
{
// URL ermitteln
String aStrURL( aDlg.GetPath() );
aStrURL = URIHelper::SmartRel2Abs(
INetURLObject(), aStrURL, URIHelper::GetMaybeFileHdl() );
INetURLObject* pURL = new INetURLObject();
pURL->SetSmartProtocol( INET_PROT_FILE );
if ( pURL->SetURL( aStrURL, INetURLObject::WAS_ENCODED ) )
{
::rtl::OUString aName;
comphelper::EmbeddedObjectContainer aCnt;
svt::EmbeddedObjectRef xObj( aCnt.CreateEmbeddedObject( SvGlobalName( SO3_PLUGIN_CLASSID ).GetByteSequence(), aName ), embed::Aspects::MSOLE_CONTENT );
if ( xObj.is() )
{
svt::EmbeddedObjectRef::TryRunningState( xObj.GetObject() );
// set properties from dialog
uno::Reference < beans::XPropertySet > xSet( xObj->getComponent(), uno::UNO_QUERY );
if ( xSet.is() )
{
xSet->setPropertyValue( ::rtl::OUString::createFromAscii("PluginURL"),
uno::makeAny( ::rtl::OUString( pURL->GetMainURL( INetURLObject::NO_DECODE ) ) ) );
}
}
rSh.InsertObject( xObj, 0, TRUE, nSlot);
}
}
}
break;
case SID_INSERT_OBJECT:
case SID_INSERT_PLUGIN:
case SID_INSERT_APPLET:
{
SFX_REQUEST_ARG( rReq, pNameItem, SfxGlobalNameItem, SID_INSERT_OBJECT, sal_False );
SvGlobalName *pName = NULL;
SvGlobalName aName;
if ( pNameItem )
{
aName = pNameItem->GetValue();
pName = &aName;
}
SFX_REQUEST_ARG( rReq, pClassItem, SfxStringItem, FN_PARAM_1, sal_False );
SFX_REQUEST_ARG( rReq, pClassLocationItem, SfxStringItem, FN_PARAM_2, sal_False );
SFX_REQUEST_ARG( rReq, pCommandsItem, SfxStringItem, FN_PARAM_3, sal_False );
//TODO/LATER: recording currently not working, need code for Commandlist
svt::EmbeddedObjectRef xObj;
if((SID_INSERT_APPLET == nSlot || SID_INSERT_PLUGIN)
&& (pClassItem || pClassLocationItem || pCommandsItem))
{
String sClass;
String sClassLocation;
if(pClassItem)
sClass = pClassItem->GetValue();
if(pClassLocationItem)
sClassLocation = pClassLocationItem->GetValue();
SvCommandList aCommandList;
if(pCommandsItem)
{
USHORT nTemp;
aCommandList.AppendCommands( pCommandsItem->GetValue(), &nTemp );
}
if(SID_INSERT_APPLET == nSlot)
{
SwApplet_Impl aApplImpl( rSh.GetAttrPool(),
RES_FRMATR_BEGIN, RES_FRMATR_END-1 );
String sBaseURL;
SfxMedium* pMedium = GetView().GetDocShell()->GetMedium();
if(pMedium)
sBaseURL = pMedium->GetURLObject().GetMainURL(INetURLObject::NO_DECODE);
aApplImpl.CreateApplet(sClass, aEmptyStr, FALSE, sClassLocation, sBaseURL );
aApplImpl.FinishApplet();
xObj.Assign( aApplImpl.GetApplet(), embed::Aspects::MSOLE_CONTENT );
if( aCommandList.Count() )
{
uno::Reference < beans::XPropertySet > xSet( xObj->getComponent(), uno::UNO_QUERY );
if ( xSet.is() )
{
uno::Sequence < beans::PropertyValue > aSeq;
aCommandList.FillSequence( aSeq );
try
{
xSet->setPropertyValue( ::rtl::OUString::createFromAscii("AppletCommands"), uno::makeAny( aSeq ) );
}
catch ( uno::Exception& )
{
}
}
}
}
else
{
comphelper::EmbeddedObjectContainer aCnt;
::rtl::OUString sName;
xObj.Assign( aCnt.CreateEmbeddedObject( SvGlobalName( SO3_PLUGIN_CLASSID ).GetByteSequence(), sName ),
embed::Aspects::MSOLE_CONTENT );
svt::EmbeddedObjectRef::TryRunningState( xObj.GetObject() );
uno::Reference < beans::XPropertySet > xSet( xObj->getComponent(), uno::UNO_QUERY );
if ( xSet.is() )
{
try
{
if ( sClassLocation.Len() )
xSet->setPropertyValue( ::rtl::OUString::createFromAscii("PluginURL"),
uno::makeAny(
::rtl::OUString(
URIHelper::SmartRel2Abs(
INetURLObject(), sClassLocation,
URIHelper::GetMaybeFileHdl()) ) ) );
uno::Sequence< beans::PropertyValue > aSeq;
if ( aCommandList.Count() )
{
aCommandList.FillSequence( aSeq );
xSet->setPropertyValue( ::rtl::OUString::createFromAscii("PluginCommands"), uno::makeAny( aSeq ) );
}
}
catch ( uno::Exception& )
{
}
}
}
if(xObj.is())
rSh.InsertOleObject( xObj );
}
else
{
DBG_ASSERT( !pNameItem || nSlot == SID_INSERT_OBJECT, "Superfluous argument!" );
rSh.InsertObject( xObj, pName, TRUE, nSlot);
rReq.Done();
}
break;
}
case SID_INSERT_FLOATINGFRAME:
{
svt::EmbeddedObjectRef xObj;
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 );
if(pURLItem) // URL is a _must_
{
comphelper::EmbeddedObjectContainer aCnt;
::rtl::OUString aName;
xObj.Assign( aCnt.CreateEmbeddedObject( SvGlobalName( SO3_IFRAME_CLASSID ).GetByteSequence(), aName ),
embed::Aspects::MSOLE_CONTENT );
svt::EmbeddedObjectRef::TryRunningState( xObj.GetObject() );
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 )
xSet->setPropertyValue( ::rtl::OUString::createFromAscii("FrameURL"), uno::makeAny( ::rtl::OUString( pURLItem->GetValue() ) ) );
if ( pNameItem )
xSet->setPropertyValue( ::rtl::OUString::createFromAscii("FrameName"), uno::makeAny( ::rtl::OUString( pNameItem->GetValue() ) ) );
if ( eScroll == ScrollingAuto )
xSet->setPropertyValue( ::rtl::OUString::createFromAscii("FrameIsAutoScroll"),
uno::makeAny( sal_True ) );
else
xSet->setPropertyValue( ::rtl::OUString::createFromAscii("FrameIsScrollingMode"),
uno::makeAny( (sal_Bool) ( eScroll == ScrollingYes) ) );
//if ( aFrmDescr.IsFrameBorderSet() )
if ( pBorderItem )
xSet->setPropertyValue( ::rtl::OUString::createFromAscii("FrameIsBorder"),
uno::makeAny( (sal_Bool) pBorderItem->GetValue() ) );
/*else
xSet->setPropertyValue( ::rtl::OUString::createFromAscii("FrameIsAutoBorder"),
makeAny( sal_True ) );*/
if ( pMarginItem )
{
xSet->setPropertyValue( ::rtl::OUString::createFromAscii("FrameMarginWidth"),
uno::makeAny( sal_Int32( aMargin.Width() ) ) );
xSet->setPropertyValue( ::rtl::OUString::createFromAscii("FrameMarginHeight"),
uno::makeAny( sal_Int32( aMargin.Height() ) ) );
}
}
catch ( uno::Exception& )
{
}
}
rSh.InsertOleObject( xObj );
}
else
{
rSh.InsertObject( xObj, 0, TRUE, nSlot);
rReq.Done();
}
}
break;
case SID_INSERT_DIAGRAM:
{
SvtModuleOptions aMOpt;
if ( !aMOpt.IsChart() )
break;
if(!rReq.IsAPI())
{
SfxViewFrame* pVFrame = GetView().GetViewFrame();
SwInsertChart( &GetView().GetEditWin(), &pVFrame->GetBindings() );
}
else
{
uno::Reference< chart2::data::XDataProvider > xDataProvider;
sal_Bool bFillWithData = sal_True;
OUString aRangeString;
if (!GetShell().IsTblComplexForChart())
{
SwFrmFmt* pTblFmt = GetShell().GetTableFmt();
String aCurrentTblName = pTblFmt->GetName();
// String aText( String::CreateFromAscii("<.>") ); // was used for UI
// aText.Insert( rWrtShell.GetBoxNms(), 2);
// aText.Insert( aCurrentTblName, 1 );
aRangeString = aCurrentTblName;
aRangeString += OUString::valueOf( sal_Unicode('.') );
aRangeString += GetShell().GetBoxNms();
// get table data provider
xDataProvider.set( GetView().GetDocShell()->getIDocumentChartDataProviderAccess()->GetChartDataProvider() );
}
else
bFillWithData = sal_False; // will create chart with only it's default image
SwTableFUNC( &rSh, FALSE ).InsertChart( xDataProvider, bFillWithData, aRangeString );
rSh.LaunchOLEObj();
svt::EmbeddedObjectRef& xObj = rSh.GetOLEObject();
if(pItem && xObj.is())
{
Size aSize(((SvxSizeItem*)pItem)->GetSize());
aSize = OutputDevice::LogicToLogic
( aSize, MapMode( MAP_TWIP ), MapMode( MAP_100TH_MM ) );
if(aSize.Width() > MINLAY&& aSize.Height()> MINLAY)
{
awt::Size aSz;
aSz.Width = aSize.Width();
aSz.Height = aSize.Height();
xObj->setVisualAreaSize( xObj.GetViewAspect(), aSz );
}
}
}
}
break;
case FN_INSERT_SMA:
{
// #i34343# Inserting a math object into an autocompletion crashes
// the suggestion has to be removed before
GetView().GetEditWin().StopQuickHelp();
SvGlobalName aGlobalName( SO3_SM_CLASSID );
rSh.InsertObject( svt::EmbeddedObjectRef(), &aGlobalName, TRUE, 0 );
}
break;
case FN_INSERT_TABLE:
InsertTable( rReq );
break;
case FN_INSERT_FRAME_INTERACT_NOCOL:
case FN_INSERT_FRAME_INTERACT:
{
USHORT nCols = 1;
BOOL bModifier1 = rReq.GetModifier() == KEY_MOD1;
if(pArgs)
{
if(FN_INSERT_FRAME_INTERACT_NOCOL != nSlot &&
pArgs->GetItemState(SID_ATTR_COLUMNS, FALSE, &pItem) == SFX_ITEM_SET)
nCols = ((SfxUInt16Item *)pItem)->GetValue();
if(pArgs->GetItemState(SID_MODIFIER, FALSE, &pItem) == SFX_ITEM_SET)
bModifier1 |= KEY_MOD1 == ((SfxUInt16Item *)pItem)->GetValue();
}
if(bModifier1 )
{
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);
GetShell().LockPaint();
GetShell().StartAllAction();
SwFlyFrmAttrMgr aMgr( TRUE, GetShellPtr(), FRMMGR_TYPE_TEXT );
if(nCols > 1)
{
SwFmtCol aCol;
aCol.Init( nCols, aCol.GetGutterWidth(), aCol.GetWishWidth() );
aMgr.SetCol( aCol );
}
aMgr.InsertFlyFrm(FLY_AT_CNTNT, aStartPos, aSize);
GetShell().EndAllAction();
GetShell().UnlockPaint();
}
else
{
GetView().InsFrmMode(nCols);
}
rReq.Ignore();
}
break;
case FN_INSERT_FRAME:
{
BOOL bSingleCol = FALSE;
if( 0!= dynamic_cast< SwWebDocShell*>( GetView().GetDocShell()) )
{
SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
USHORT nExport = pHtmlOpt->GetExportMode();
if( HTML_CFG_MSIE == nExport ||
HTML_CFG_HTML32 == nExport ||
HTML_CFG_MSIE_40 == nExport ||
HTML_CFG_HTML32 == nExport )
{
bSingleCol = TRUE;
}
}
// Rahmen neu anlegen
SwFlyFrmAttrMgr aMgr( TRUE, GetShellPtr(), FRMMGR_TYPE_TEXT );
if(pArgs)
{
Size aSize(aMgr.GetSize());
aSize.Width() = GetShell().GetAnyCurRect(RECT_PAGE_PRT).Width();
Point aPos = aMgr.GetPos();
RndStdIds eAnchor = FLY_AT_CNTNT;
if(pArgs->GetItemState(nSlot, FALSE, &pItem) == SFX_ITEM_SET)
eAnchor = (RndStdIds)((SfxUInt16Item *)pItem)->GetValue();
if(pArgs->GetItemState(FN_PARAM_1, FALSE, &pItem) == SFX_ITEM_SET)
aPos = ((SfxPointItem *)pItem)->GetValue();
if(pArgs->GetItemState(FN_PARAM_2, FALSE, &pItem) == SFX_ITEM_SET)
aSize = ((SvxSizeItem *)pItem)->GetSize();
if(pArgs->GetItemState(SID_ATTR_COLUMNS, FALSE, &pItem) == SFX_ITEM_SET)
{
USHORT nCols = ((SfxUInt16Item *)pItem)->GetValue();
if( !bSingleCol && 1 < nCols )
{
SwFmtCol aFmtCol;
aFmtCol.Init( nCols , (rReq.IsAPI() ? 0
: DEF_GUTTER_WIDTH), USHRT_MAX );
aMgr.SetCol(aFmtCol);
}
}
GetShell().LockPaint();
GetShell().StartAllAction();
aMgr.InsertFlyFrm(eAnchor, aPos, aSize);
GetShell().EndAllAction();
GetShell().UnlockPaint();
}
else
{
static USHORT __READONLY_DATA aFrmAttrRange[] =
{
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() );
// Minimalgroesse in Spalten loeschen
SvxBoxInfoItem aBoxInfo((SvxBoxInfoItem &)aSet.Get(SID_ATTR_BORDER_INNER));
const SvxBoxItem& rBox = (const SvxBoxItem&)aSet.Get(RES_BOX);
aBoxInfo.SetMinDist(FALSE);
aBoxInfo.SetDefDist(rBox.GetDistance(BOX_LINE_LEFT));
aSet.Put(aBoxInfo);
FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebDocShell, GetView().GetDocShell()));
SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< UINT16 >(eMetric)));
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
DBG_ASSERT(pFact, "Dialogdiet fail!");
SfxAbstractTabDialog* pDlg = pFact->CreateFrmTabDialog( DLG_FRM_STD,
GetView().GetViewFrame(), &GetView().GetViewFrame()->GetWindow(), aSet, TRUE);
DBG_ASSERT(pDlg, "Dialogdiet fail!");
if(pDlg->Execute() && pDlg->GetOutputItemSet())
{
GetShell().LockPaint();
GetShell().StartAllAction();
GetShell().StartUndo(UNDO_INSERT);
const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
aMgr.SetAttrSet(*pOutSet);
// beim ClickToEditFeld erst die Selektion loeschen
if( GetShell().IsInClickToEdit() )
GetShell().DelRight();
aMgr.InsertFlyFrm();
uno::Reference< frame::XDispatchRecorder > xRecorder =
GetView().GetViewFrame()->GetBindings().GetRecorder();
if ( xRecorder.is() )
{
//FN_INSERT_FRAME
USHORT nAnchor = (USHORT)aMgr.GetAnchor();
rReq.AppendItem(SfxUInt16Item(nSlot, nAnchor));
rReq.AppendItem(SfxPointItem(FN_PARAM_1, GetShell().GetObjAbsPos()));
rReq.AppendItem(SvxSizeItem(FN_PARAM_2, GetShell().GetObjSize()));
rReq.Done();
}
GetView().AutoCaption(FRAME_CAP);
{
SwRewriter aRewriter;
aRewriter.AddRule(UNDO_ARG1, SW_RES(STR_FRAME));
GetShell().EndUndo(UNDO_INSERT, &aRewriter);
}
GetShell().EndAllAction();
GetShell().UnlockPaint();
}
DELETEZ(pDlg);
}
break;
}
case FN_INSERT_HRULER:
{
String sPath;
BOOL bSimpleLine = FALSE;
BOOL bRet = FALSE;
Window* pParent = GetView().GetWindow();
if ( pItem )
{
sPath = ((SfxStringItem*)pItem)->GetValue();
SFX_REQUEST_ARG( rReq, pSimple, SfxBoolItem, FN_PARAM_1 , sal_False );
if ( pSimple )
bSimpleLine = pSimple->GetValue();
}
else
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
DBG_ASSERT(pFact, "Dialogdiet fail!");
AbstractInsertGrfRulerDlg* pDlg = pFact->CreateInsertGrfRulerDlg( DLG_INSERT_RULER,
pParent );
DBG_ASSERT(pDlg, "Dialogdiet fail!");
// MessageBox fuer fehlende Grafiken
if(!pDlg->HasImages())
InfoBox( pParent, SW_RES(MSG_NO_RULER)).Execute();
if(RET_OK == pDlg->Execute())
{
sPath = pDlg->GetGraphicName();
bSimpleLine = pDlg->IsSimpleLine();
}
delete pDlg;
rReq.AppendItem( SfxStringItem( FN_INSERT_HRULER, sPath ) );
rReq.AppendItem( SfxBoolItem( FN_PARAM_1, bSimpleLine ) );
}
rSh.StartAllAction();
rSh.StartUndo(UNDO_UI_INSERT_RULER);
if(bSimpleLine)
{
if(!(rSh.IsSttOfPara() && rSh.IsEndOfPara())) // kein leerer Absatz?
rSh.SplitNode( FALSE, FALSE ); // dann Platz schaffen
rSh.SplitNode( FALSE, FALSE );
rSh.Left(CRSR_SKIP_CHARS, FALSE, 1, FALSE );
rSh.SetTxtFmtColl( rSh.GetTxtCollFromPool( RES_POOLCOLL_HTML_HR ));
rSh.Right(CRSR_SKIP_CHARS, FALSE, 1, FALSE );
bRet = TRUE;
}
else if(sPath.Len())
{
SwFlyFrmAttrMgr aFrmMgr( TRUE, &rSh, FRMMGR_TYPE_GRF );
// am FrmMgr muessen die richtigen Parameter eingestellt werden
aFrmMgr.SetAnchor(FLY_IN_CNTNT);
rSh.SplitNode( FALSE, FALSE );
rSh.SplitNode( FALSE, FALSE );
rSh.Left(CRSR_SKIP_CHARS, FALSE, 1, FALSE );
rSh.SetAttr(SvxAdjustItem(SVX_ADJUST_CENTER,RES_PARATR_ADJUST ));
if(GRFILTER_OK == GetView().InsertGraphic(sPath, aEmptyStr, TRUE, 0, 0 ))
bRet = TRUE;
rSh.EnterStdMode();
rSh.Right(CRSR_SKIP_CHARS, FALSE, 1, FALSE );
}
rSh.EndAllAction();
rSh.EndUndo(UNDO_UI_INSERT_RULER);
rReq.SetReturnValue(SfxBoolItem(nSlot, bRet));
rReq.Done();
}
break;
case FN_FORMAT_COLUMN :
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
DBG_ASSERT(pFact, "Dialogdiet fail!");
VclAbstractDialog* pColDlg = pFact->CreateVclAbstractDialog( GetView().GetWindow(), rSh, DLG_COLUMN);
DBG_ASSERT(pColDlg, "Dialogdiet fail!");
pColDlg->Execute();
delete pColDlg;
}
break;
default:
ASSERT( !this, "falscher Dispatcher" );
return;
}
}
bool lcl_IsMarkInSameSection( SwWrtShell& rWrtSh, const SwSection* pSect )
{
rWrtSh.SwapPam();
bool bRet = pSect == rWrtSh.GetCurrSection();
rWrtSh.SwapPam();
return bRet;
}
void SwTextShell::StateInsert( SfxItemSet &rSet )
{
USHORT nHtmlMode = ::GetHtmlMode(GetView().GetDocShell());
SfxWhichIter aIter( rSet );
SwWrtShell &rSh = GetShell();
USHORT nWhich = aIter.FirstWhich();
SvtModuleOptions aMOpt;
SfxObjectCreateMode eCreateMode =
GetView().GetDocShell()->GetCreateMode();
rSh.Push();
const BOOL bCrsrInHidden = rSh.SelectHiddenRange();
rSh.Pop(FALSE);
while ( nWhich )
{
switch ( nWhich )
{
case SID_INSERT_SOUND:
case SID_INSERT_VIDEO:
if ( GetShell().IsSelFrmMode() ||
!SvxPluginFileDlg::IsAvailable( nWhich ) ||
SFX_CREATE_MODE_EMBEDDED == eCreateMode || bCrsrInHidden )
{
rSet.DisableItem( nWhich );
}
break;
case SID_INSERT_DIAGRAM:
if( !aMOpt.IsChart() || eCreateMode == SFX_CREATE_MODE_EMBEDDED || bCrsrInHidden )
{
rSet.DisableItem( nWhich );
}
break;
case FN_INSERT_SMA:
if( !aMOpt.IsMath() || eCreateMode == SFX_CREATE_MODE_EMBEDDED || bCrsrInHidden )
{
rSet.DisableItem( nWhich );
}
break;
case SID_INSERT_FLOATINGFRAME:
case SID_INSERT_OBJECT:
case SID_INSERT_PLUGIN:
case SID_INSERT_APPLET:
{
if(
#ifndef SOLAR_JAVA
nWhich == SID_INSERT_APPLET ||
#endif
eCreateMode == SFX_CREATE_MODE_EMBEDDED || bCrsrInHidden )
{
rSet.DisableItem( nWhich );
}
else if( GetShell().IsSelFrmMode())
rSet.DisableItem( nWhich );
else if(SID_INSERT_FLOATINGFRAME == nWhich && nHtmlMode&HTMLMODE_ON)
{
SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
USHORT nExport = pHtmlOpt->GetExportMode();
if(HTML_CFG_MSIE_40 != nExport && HTML_CFG_WRITER != nExport )
rSet.DisableItem(nWhich);
}
}
break;
case FN_INSERT_FRAME_INTERACT_NOCOL :
case FN_INSERT_FRAME_INTERACT:
{
if ( GetShell().IsSelFrmMode() ||
(0 != (nHtmlMode & HTMLMODE_ON) && 0 == (nHtmlMode & HTMLMODE_SOME_ABS_POS)) || bCrsrInHidden )
rSet.DisableItem(nWhich);
}
break;
case SID_HYPERLINK_GETLINK:
{
SfxItemSet aSet(GetPool(), RES_TXTATR_INETFMT, RES_TXTATR_INETFMT);
rSh.GetCurAttr( aSet );
SvxHyperlinkItem aHLinkItem;
const SfxPoolItem* pItem;
if(SFX_ITEM_SET == aSet.GetItemState(RES_TXTATR_INETFMT, FALSE, &pItem))
{
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();
rSh.SwCrsrShell::SelectTxtAttr(RES_TXTATR_INETFMT,TRUE);
String sLinkName = rSh.GetSelTxt();
aHLinkItem.SetName(sLinkName);
aHLinkItem.SetInsertMode(HLINK_FIELD);
rSh.DestroyCrsr();
rSh.EndAction();
}
else
{
String sReturn = rSh.GetSelTxt();
sReturn.Erase(255);
sReturn.EraseTrailingChars();
aHLinkItem.SetName(sReturn);
}
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();
if( ((nsSelectionType::SEL_GRF | nsSelectionType::SEL_OLE ) & nSel ) || bCrsrInHidden )
rSet.DisableItem(nWhich);
}
break;
case FN_INSERT_HRULER :
if(rSh.IsReadOnlyAvailable() && rSh.HasReadonlySel() || bCrsrInHidden )
rSet.DisableItem(nWhich);
break;
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();
USHORT nFullSectCnt = rSh.GetFullSelectedSectionCount();
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;
}
nWhich = aIter.NextWhich();
}
}
/*--------------------------------------------------------------------
Beschreibung:
--------------------------------------------------------------------*/
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:
ASSERT(!this, "falscher Dispatcher");
return;
}
rReq.Done();
}
void SwTextShell::ExecTransliteration( SfxRequest & rReq )
{
using namespace ::com::sun::star::i18n;
{
sal_uInt32 nMode = 0;
switch( rReq.GetSlot() )
{
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 )
GetShell().TransliterateText( nMode );
}
}
/*--------------------------------------------------------------------
Beschreibung:
--------------------------------------------------------------------*/
SwTextShell::SwTextShell(SwView &_rView) :
SwBaseShell(_rView), pPostItFldMgr( 0 )
{
SetName(String::CreateFromAscii("Text"));
SetHelpId(SW_TEXTSHELL);
}
/*--------------------------------------------------------------------
Beschreibung:
--------------------------------------------------------------------*/
SwTextShell::~SwTextShell()
{
}
/*--------------------------------------------------------------------
Beschreibung:
--------------------------------------------------------------------*/
void SwTextShell::InsertSymbol( SfxRequest& rReq )
{
const SfxItemSet *pArgs = rReq.GetArgs();
const SfxPoolItem* pItem = 0;
if( pArgs )
pArgs->GetItemState(GetPool().GetWhich(SID_CHARMAP), FALSE, &pItem);
String aChars, aFontName;
if ( pItem )
{
aChars = ((const SfxStringItem*)pItem)->GetValue();
const SfxPoolItem* pFtItem = NULL;
pArgs->GetItemState( GetPool().GetWhich(SID_ATTR_SPECIALCHAR), FALSE, &pFtItem);
const SfxStringItem* pFontItem = PTR_CAST( SfxStringItem, pFtItem );
if ( pFontItem )
aFontName = pFontItem->GetValue();
}
SwWrtShell &rSh = GetShell();
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 );
rSh.GetCurAttr( aSet );
USHORT nScript = rSh.GetScriptType();
SvxFontItem aFont( RES_CHRATR_FONT );
{
SvxScriptSetItem aSetItem( SID_ATTR_CHAR_FONT, *aSet.GetPool() );
aSetItem.GetItemSet().Put( aSet, FALSE );
const SfxPoolItem* pI = aSetItem.GetItemOfScript( nScript );
if( pI )
aFont = *(SvxFontItem*)pI;
else
aFont = (SvxFontItem&)aSet.Get( GetWhichOfScript(
RES_CHRATR_FONT,
GetI18NScriptTypeOfLanguage( (USHORT)GetAppLanguage() ) ));
if (!aFontName.Len())
aFontName = aFont.GetFamilyName();
}
Font aNewFont(aFontName, Size(1,1)); // Size nur wg. CTOR
if( !aChars.Len() )
{
// Eingestellten Font als Default
SfxAllItemSet aAllSet( rSh.GetAttrPool() );
aAllSet.Put( SfxBoolItem( FN_PARAM_1, FALSE ) );
SwViewOption aOpt(*GetShell().GetViewOptions());
String sSymbolFont = aOpt.GetSymbolFont();
if( !aFontName.Len() && sSymbolFont.Len() )
aAllSet.Put( SfxStringItem( SID_FONT_NAME, sSymbolFont ) );
else
aAllSet.Put( SfxStringItem( SID_FONT_NAME, aFont.GetFamilyName() ) );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
SfxAbstractDialog* pDlg = pFact->CreateSfxDialog( GetView().GetWindow(), aAllSet,
GetView().GetViewFrame()->GetFrame()->GetFrameInterface(), RID_SVXDLG_CHARMAP );
if( RET_OK == pDlg->Execute() )
{
SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pCItem, SfxStringItem, SID_CHARMAP, FALSE );
SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pFontItem, SvxFontItem, SID_ATTR_CHAR_FONT, FALSE );
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());
}
}
delete pDlg;
}
BOOL bFontChanged = FALSE;
if( aChars.Len() )
{
rSh.StartAllAction();
// Selektierten Inhalt loeschen
SwRewriter aRewriter;
aRewriter.AddRule(UNDO_ARG1, SW_RES(STR_SPECIALCHAR));
rSh.StartUndo( UNDO_INSERT, &aRewriter );
if ( rSh.HasSelection() )
{
rSh.DelRight();
aSet.ClearItem();
rSh.GetCurAttr( aSet );
SvxScriptSetItem aSetItem( SID_ATTR_CHAR_FONT, *aSet.GetPool() );
aSetItem.GetItemSet().Put( aSet, FALSE );
const SfxPoolItem* pI = aSetItem.GetItemOfScript( nScript );
if( pI )
aFont = *(SvxFontItem*)pI;
else
aFont = (SvxFontItem&)aSet.Get( GetWhichOfScript(
RES_CHRATR_FONT,
GetI18NScriptTypeOfLanguage( (USHORT)GetAppLanguage() ) ));
}
// Zeichen einfuegen
rSh.Insert( aChars );
// #108876# a font attribute has to be set always due to a guessed script type
if( aNewFont.GetName().Len() )
{
bFontChanged = TRUE;
SvxFontItem aNewFontItem( aFont );
aNewFontItem.GetFamilyName() = aNewFont.GetName();
aNewFontItem.GetFamily() = aNewFont.GetFamily();
aNewFontItem.GetPitch() = aNewFont.GetPitch();
aNewFontItem.GetCharSet() = aNewFont.GetCharSet();
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 );
nScript = pBreakIt->GetAllScriptsOfText( aChars );
if( SCRIPTTYPE_LATIN & nScript )
{
aRestoreSet.Put( aSet.Get( RES_CHRATR_FONT, TRUE ) );
aSet.Put( aNewFontItem, RES_CHRATR_FONT);
}
if( SCRIPTTYPE_ASIAN & nScript )
{
aRestoreSet.Put( aSet.Get( RES_CHRATR_CJK_FONT, TRUE ) );
aSet.Put( aNewFontItem, RES_CHRATR_CJK_FONT );
}
if( SCRIPTTYPE_COMPLEX & nScript )
{
aRestoreSet.Put( aSet.Get( RES_CHRATR_CTL_FONT, TRUE ) );
aSet.Put( aNewFontItem, RES_CHRATR_CTL_FONT );
}
rSh.SetMark();
rSh.ExtendSelection( FALSE, aChars.Len() );
rSh.SetAttr( aSet, nsSetAttrMode::SETATTR_DONTEXPAND | nsSetAttrMode::SETATTR_NOFORMATATTR );
if( !rSh.IsCrsrPtAtEnd() )
rSh.SwapPam();
rSh.ClearMark();
// --> FME 2007-07-09 #i75891#
// SETATTR_DONTEXPAND does not work if there are already hard attributes.
// Therefore we have to restore the font attributes.
rSh.SetMark();
rSh.SetAttr( aRestoreSet );
rSh.ClearMark();
// <--
rSh.UpdateAttr();
aFont = aNewFontItem;
}
rSh.EndAllAction();
rSh.EndUndo( UNDO_INSERT );
if ( aChars.Len() )
{
rReq.AppendItem( SfxStringItem( GetPool().GetWhich(SID_CHARMAP), aChars ) );
rReq.AppendItem( SfxStringItem( SID_ATTR_SPECIALCHAR, aNewFont.GetName() ) );
rReq.Done();
}
}
}