Commits

Anonymous committed d2f7b2f

CWS-TOOLING: integrate CWS odfmetadata3
2009-09-11 Michael Stahl merge DEV300_m58
2009-09-07 Michael Stahl SwFmtFld::Modify(): do nothing on RES_OBJECTDYING
2009-08-27 Michael Stahl #i91565#, #i91566#: TextPortionEnumerationTest.java: add test document
2009-08-27 Michael Stahl #i91565#, #i91566#: add complex test: TextPortionEnumerationTest.java
2009-08-27 Michael Stahl CLiteral::initialize(): zero-length literals probably not an error
2009-08-27 Michael Stahl #i91565#, #i91566#: offapi: new InContentMetadata and MetadataField services
adapt TextPortion for InContentMetadata
2009-08-27 Michael Stahl #i91564#: xmloff: load/store xml:id and RDFa for text:bookmark(-start).
2009-08-27 Michael Stahl #i91564#: sw core: add support for xml:id at bookmarks:
sw::mark::Bookmark: derive from Metadatable.
SwHistoryBookmark, SaveBookmark: store a MetadatableUndo.
ndcopy.cxx: lcl_CopyBookmarks(): copy the xml:id.
SwXBookmark: derive from MetadatableMixin.
2009-08-27 Michael Stahl #i91565#, #i91566#: xmloff: refactor ruby import so nested meta(-field) works:
remove XMLRubyHint_Impl.
XMLImpRubyContext_Impl::~XMLImpRubyContext_Impl(): insert ruby directly.
2009-08-27 Michael Stahl #i91565#, #i91566#: xmloff: fix text:meta(-field) import/export:
new XMLTextParagraphExport::exportTextField() overload for XTextField.
CreateAndInsertMark(): set xml:id after insertion.
fix meta(-field) service names, bugs etc.
2009-08-27 Michael Stahl #i91565#, #i91566#: sw text formatting: paint background of meta(-field) body:
SwFont: add member m_nMetaCount.
txttypes.hxx: add POR_META.
atrstck.cxx: handle RES_TXTATR_META(FIELD).
itrform2.cxx: SwTxtFormatter::WhichTxtPor(): create new class SwMetaPortion.
2009-08-27 Michael Stahl #i91566#: sw text formatting: display meta-field prefix and suffix:
SwAttrIter::GetAttr(): replace with call to GetTxtAttrForCharAt().
SwTxtFormatter::NewExtraPortion(): handle meta-field prefix.
SwTxtFormatter: new member m_nHintEndIndex.
SwTxtFormatter::WhichFirstPortion(): call TryNewNoLengthPortion().
SwTxtFormatter::TryNewNoLengthPortion(): new; handle suffix of meta-field.
SwTxtFormatter::UnderFlow(): UGLY HACK: decrement m_nHintEndIndex.
SwFldPortion: add flag m_bNoLength: portion has zero length (for suffix).
2009-08-27 Michael Stahl #i91565#, #i91566#: extend text:meta(-field) uno wrapper with XText interface:
unoobj.hxx: new CursorType CURSOR_META.
unoobj2.cxx: refactor SwXText implementation to ensure that when the SwXText
belongs to a SwXMeta, content is always inserted inside the meta(-field).
unoobj.cxx: new SwXTextCursor::ForceIntoMeta(): cursor stays in meta(-field).
unometa.hxx: SwXMeta implements XText, forwarding to a member SwXMetaText.
DocInsertStringSplitCR(), SwX*::attachToRange(), SwX*::DeleteAndInsert():
use FORCEHINTEXPAND hack to ensure insert into the meta(-field) at the end.
2009-08-27 Michael Stahl #i91565#, #i91566#: add text:meta(-field) uno wrapper to sw:
fmtmeta.hxx, fmtatr2.cxx: new class sw::MetaField, new sw::MetaFieldManager.
doc.hxx, docnew.cxx: new SwDoc::GetMetaFieldManager().
unocoll.hxx,.cxx: new SW_SERVICE_FIELDTYPE_METAFIELD, SW_SERVICE_TYPE_META.
unomap.hxx,.cxx: new PROPERTY_MAP_METAFIELD.
unoprnms.hxx: new UNO_NAME_META.
unoport.hxx: new PORTION_META; add "InContentMetadata" prop to SwXTextPortion.
new unometa.hxx: new class SwXMeta and SwXMetaField.
unofield.cxx: SwXFieldEnumeration: include meta-fields.
unoportenum.cxx: handle RES_TXTATR_META(FIELD) by using a portion list stack.
unotext.cxx: SwXText::insertTextContent(): handle meta(-field) as attribute.
2009-08-27 Michael Stahl #i91565#, #i91566#: ndhints.cxx: remove sort number from SwTxtAttrNesting
2009-08-27 Michael Stahl #i91565#, #i91566#: add support for hints with end and CH_TXTATR to sw core:
doc.hxx, docedt.cxx: replace SwDoc::Delete(), DeleteAndJoin(), ReplaceRange()
with wrappers that split at left-overlapped end+CH_TXTATR hints.
txatbase.hxx: new member SwTxtAttr::m_bHasDummyChar.
ndtxt.hxx: rename SwTxtNode::GetTxtAttr() to GetTxtAttrForCharAt().
ndtxt.cxx: SwTxtNode::CopyText(): copy end+CH_TXTATR hints iff copy CH_TXTATR.
txtatr2.cxx, thints.cxx: SwTxtMeta gets a CH_TXTATR.
2009-08-27 Michael Stahl #i91565#, #i91566#: add text:meta(-field) to sw core:
txatbase.hxx: new member SwTxtAttr::m_bNesting.
hintids.hxx: new ids RES_TXTATR_META, RES_TXTATR_METAFIELD.
txtatr.hxx: new base class SwTxtAttrNesting.
new hint SwTxtMeta.
SwTxtRuby derives from SwTxtAttrNesting.
txtinet.hxx: SwTxtINetFmt derives from SwTxtAttrNesting.
new header fmtmeta.hxx: new pool item SwFmtMeta. new class sw::Meta.
ndhints.hxx, thints.cxx: new method SwpHints::TryInsertNesting().
thints.cxx: refactoring: BuildPortions() no longer handles Ruby/Hyperlink,
but TryInsertNesting(), which also handles meta(-field).
SwTxtNode::InsertItem(): check if the hint is actually inserted.
ndhints.cxx: sort nesting hints based on sort number.
ndtxt.cxx: lcl_CopyHint(): handle copy of meta/meta-field.
2009-08-27 Michael Stahl enable expanding hints with m_bLockExpandFlag set:
add new InsertFlag: INS_FORCEHINTEXPAND.
add new SetAttrMode: SETATTR_FORCEHINTEXPAND.
rename SwEditShell::Insert() to Insert2() because changed signature fails
to compile when SwWrtShell tries to overwrite these non-virtual members...
SwWrtShell::Insert() sets FOCEHINTEXPAND if range was selected/deleted.
adapt SwUndoInsert to store flags.
2009-08-27 Michael Stahl change formal parameters of item insertion methods to type SetAttrMode
2009-08-27 Michael Stahl fix incorrect resetting of text attributes in SwUndoInsSection, SwUndoInserts
2009-08-27 Michael Stahl clean up SwTxtNode::CutImpl() and lcl_CopyHint()
2009-08-27 Michael Stahl rename SwDoc::Copy() to CopyRange(), and _Copy() to CopyImpl()
2009-08-27 Michael Stahl rename SwNodes::Move() to MoveRange(), and remove unused parameter
2009-08-27 Michael Stahl rename SwDoc::Move() to MoveRange()/MoveNodeRange()
2009-08-27 Michael Stahl rename SwDoc::Insert() to InsertString(), and remove sal_Unicode variant
2009-08-27 Michael Stahl rename SwDoc::Insert() to InsertPoolItem()/InsertItemSet()/InsertSwSection()
2009-08-27 Michael Stahl rename SwDoc::Replace() to ReplaceRange()
2009-08-27 Michael Stahl remove SwDoc::Overwrite() sal_Unicode variant
2009-08-27 Michael Stahl split up SwDoc::DeleteAndJoin(): factor out DeleteAndJoinWithRedline()
2009-08-27 Michael Stahl rename overloaded SwDoc::Delete() to DeleteRange()/DeleteTOXMark()
2009-08-27 Michael Stahl rename SwTxtNode::Copy() to CopyText()
2009-08-27 Michael Stahl rename SwTxtNode::Cut() to CutText(), and _Cut() to CutImpl()
2009-08-27 Michael Stahl rename SwTxtNode::Delete() to DeleteAttribute()/DeleteAttributes()
2009-08-27 Michael Stahl rename SwTxtNode::Replace() to ReplaceText(), and remove the xub_Unicode variant
2009-08-27 Michael Stahl rename SwTxtNode::Erase() to EraseText()
2009-08-27 Michael Stahl rename SwTxtNode::Insert() to InsertText(), and remove the xub_Unicode variant
2009-08-27 Michael Stahl clean up SwTxtNode::Update()
2009-08-27 Michael Stahl remove SwTxtAttr::RemoveFromPool() and make destructor non-public,
to be invoked by new method SwTxtAttr::Destroy()
2009-08-27 Michael Stahl ensure that SwDoc::Insert() for item (set) returns success indicator:
replace SwRegHistory constructor with method InsertItems(), returning bool.
refactor InsAttr() so that it checks if InsertItems() succeeds.
2009-08-27 Michael Stahl move SwXTextPortionEnumeration from unoobj.hxx to unoport.hxx
2009-08-27 Michael Stahl add missing SolarMutex in SwXTextPortion methods
2009-08-27 Michael Stahl SwXTextPortion: new member m_xTextField (so the TextField property need not
be returned indirectly via SwUnoCursorHelper).
factor out function CreateSwXTextField().
2009-08-27 Michael Stahl SwXTextPortion: remove PORTION_CONTROL_CHAR and implementation of XTextField
2009-08-27 Michael Stahl remove obsolete hint SwTxtHardBlank and formats SwFmtHardBlank/SwFmtSoftHyph
2009-08-27 Michael Stahl clean up SwTxtAttr and friends:
remove many accessor methods for obsolete (due to autofmt) char format items.
remove unused flag SwTxtAttr::m_bDontMergeAttr.
MakeRedlineTxtAttr() now dedicated function, no longer calls MakeTxtAttr().
2009-08-27 Michael Stahl remove obsolete attribute SwTxt2Lines
2009-08-27 Michael Stahl SwXTextPortionEnumeration: finish refactoring CreatePortions
change ExportHints so it always returns a text portion for hint w/ CH_TXTATR.
remove special case for handling end of paragraph.
unfortunately had to refactor the fieldmarks export as well (got in the way).
2009-08-27 Michael Stahl SwXTextPortionEnumeration: refactor CreatePortions: frames export
extract function ExportFrames() from CreatePortions().
remove (un)dead code that calls evil MovePara(fnParaCurr, fnParaEnd)
2009-08-27 Michael Stahl clean up SwXParaFrameEnumeration
2009-08-27 Michael Stahl CollectFrameAtNode: replace SwDependArr with STL based FrameDependList_t
2009-08-27 Michael Stahl SwXTextPortionEnumeration: tweak refmark/toxmark export
so ExportHints returns the portion for point marks
2009-08-27 Michael Stahl clean up SwXTextPortionEnumeration:
prefix members, remove casts, replace SvWeirdArray with STL, etc.
make CreatePortions() method a function, and remove lots of members.
extract fieldmarks function from CreatePortions.
2009-08-27 Michael Stahl remove FOREACHUNOPAM_START/END macros
2009-08-27 Michael Stahl clean up SwXTextPortion:
prefix members, remove casts, etc.
remove SwXRubyPortion: replace it with another SwXTextPortion constructor
2009-08-27 Michael Stahl #i102541# SwXReferenceMark::InsertRefMark(): use flag SETATTR_DONTEXPAND
2009-08-27 Michael Stahl rename SwTxtNode::Insert to SwTxtNode::InsertHint, and
fix constness in SwTxtNode::InsertItem
2009-08-27 Michael Stahl turn SwTxtNode::MakeTxtAttr() methods into global functions in ndhints.hxx
2009-08-27 Michael Stahl remove obsolete sw/inc/bookmrk.hxx
2009-08-27 Michael Stahl pam.cxx: fix ComparePosition functions (returned wrong result in one case)
2009-08-27 Michael Stahl #i103613# only import RDF metadata on normal open of a document
2009-09-11 kz CWS-TOOLING: integrate CWS impress176
2009-09-08 20:18:24 +0200 sj r275957 : fixed warning (shadowed variable)
2009-09-08 18:02:05 +0200 cl r275948 : #i104315# added missing tab pages
2009-09-08 17:35:18 +0200 cl r275947 : #i104866# fixed angle import
2009-09-08 17:32:53 +0200 cl r275946 : #i104841# fixed angle import
2009-09-08 17:01:25 +0200 cl r275943 : #i103935# fixed the SID_EVENTCONFIG mess
2009-09-08 14:32:57 +0200 sj r275928 : #i104685# only comments
2009-09-07 12:37:36 +0200 sj r275886 : #i104683# fixed import of bold/italic attributes for normal text shapes
2009-09-04 15:07:46 +0200 sj r275808 : #104689# fixed bullet color problem
2009-09-03 15:25:07 +0200 sj r275753 : #160200# added vertical alignment of table cells
2009-09-11 kz CWS-TOOLING: integrate CWS dv14
2009-09-10 15:16:32 +0200 sg r276035 : #160513# updated wfs scheme to accept ports
2009-09-10 07:41:47 +0200 dv r276019 : #i104942# Better renaming algorithmen
2009-08-31 13:41:11 +0200 dv r275604 : #160505# Setting APP1PRODUCTNAME must not overwrite APP1PRODUCTDEF
2009-09-11 kz CWS-TOOLING: integrate CWS jl131
2009-09-02 16:42:40 +0200 jl r275720 : #i97896#
2009-08-31 13:01:53 +0200 jl r275599 : CWS-TOOLING: rebase CWS jl131 to trunk@275331 (milestone: DEV300:m56)
2009-07-31 14:35:30 +0200 jl r274531 : CWS-TOOLING: rebase CWS jl131 to trunk@274203 (milestone: DEV300:m53)
2009-07-23 14:20:32 +0200 jl r274272 : #i79839# better error text when trying to modify shared layer without having write permission, eg. unopkg add --shared, unopkg remove --shared, unopkg reinstall --shared
2009-07-22 16:38:02 +0200 jl r274252 : #i97896# localize error message for lock file
2009-07-22 16:37:22 +0200 jl r274251 : #i80462# unprecise wording in updatedialog
2009-07-22 16:36:06 +0200 jl r274250 : #i97896# localize error message for lock file
2009-07-22 16:35:20 +0200 jl r274249 : #i97896# localize error message for lock file
2009-07-22 15:07:30 +0200 jl r274242 : #i98873# minimum java version is 1.5 since OOo 3.0
2009-09-11 kz CWS-TOOLING: integrate CWS changehc
2009-08-31 19:38:50 +0200 pl r275633 : remove dbug printf
2009-08-31 17:41:50 +0200 pl r275623 : CWS-TOOLING: rebase CWS changehc to trunk@275331 (milestone: DEV300:m56)
2009-07-15 19:45:46 +0200 pl r274028 : #i35482# use HC flag to decide high contrast mode
2009-07-15 17:40:52 +0200 pl r274020 : #i35482# use HC flag to decide high contrast mode
2009-07-15 17:39:50 +0200 pl r274019 : #i35482# update autohc correctly in MergeSystemSettings
2009-07-15 17:38:57 +0200 pl r274018 : #i35482# update autohc correctly in MergeSystemSettings
2009-09-11 kz CWS-TOOLING: integrate CWS notes10
2009-08-24 07:25:57 +0200 mod r275287 : 2009-07-26 02:38:32 +0200 mod r274343 : #i#i103645#
2009-07-26 02:01:53 +0200 mod r274342 : #i103645#
2009-07-26 01:52:42 +0200 mod r274341 : #i103490#
2009-07-22 08:31:48 +0200 mod r274215 : #i103373#
2009-07-15 00:55:11 +0200 mod r273987 : #i101419#
2009-07-14 07:07:55 +0200 mod r273956 : #i101419#
2009-07-14 07:07:43 +0200 mod r273955 : #i101419#
2009-07-14 07:02:10 +0200 mod r273954 : changes from notes9
2009-07-14 06:14:25 +0200 mod r273953 : #i103476#
2009-09-11 kz CWS-TOOLING: integrate CWS ab70
2009-09-10 15:12:54 +0200 jsk r276034 : #i85434# - mandatory automatic update test
2009-09-10 15:11:06 +0200 jsk r276033 : #i85434# - mandatory automatic update test
2009-09-02 09:49:24 +0200 ab r275698 : #i85434# Dialog Import
2009-09-11 kz CWS-TOOLING: integrate CWS hb32bugs02
2009-09-02 Henning Brinkmann #i102420# revert changes
2009-08-26 Henning Brinkmann merged DEV300_m56
2009-08-19 Henning Brinkmann merged DEV300_m55
2009-08-14 Henning Brinkmann merged changes from wntmsci12
2009-08-12 Henning Brinkmann Implemented NoSpaceEdit constructor and destructor in .cxx to allow compile with debug on wntmsci12.
2009-08-12 Henning Brinkmann Added some SW_DLLPUBLIC to make compilable on wntmsci12.
2009-08-11 Henning Brinkmann #i102420# dbg_out: surround output for SwNodes with <nodes-array>.
2009-08-10 Henning Brinkmann #i102420# rewritten debug output for SwNodes.
2009-08-07 Henning Brinkmann #i102420# debug _MoveNodes: output the destination, too. Break after two iterations.
2009-08-07 Henning Brinkmann #i102420# _MoveNodes: Additionally check if destination index is inside source => false
Check if current range was already handled => loop
Debug output current range
2009-08-06 Henning Brinkmann merged DEV300_m54
2009-08-06 Henning Brinkmann added master fix
2009-08-06 Henning Brinkmann debug output for SwNodeRange
2009-08-04 Henning Brinkmann #i102844# robustness: check for NULL pointer to prevent crash
2009-08-03 Henning Brinkmann #i103475# applied patch and verified
2009-08-03 Henning Brinkmann Removed code preventing build of sw with DEBUG.
2009-09-11 convert-repo update tags
2009-09-10 kz CWS-TOOLING: integrate CWS os2port06dev300
2009-09-05 22:49:00 +0200 ydario r275858 : #i99588# applied os2port06 diff to DEV300 tree.
2009-09-10 kz CWS-TOOLING: integrate CWS mingwport23
2009-08-29 07:07:53 +0200 tono r275555 : i#104522: mingw port graphite
2009-08-29 07:07:26 +0200 tono r275554 : i#104522: mingw port printf format fix
2009-09-10 kz CWS-TOOLING: integrate CWS mh232
2009-08-26 03:52:57 +0200 mh r275385 : #i102182# FreeBSD patch
2009-08-26 03:43:20 +0200 mh r275384 : #i101333# patch for FreeBSD
2009-08-26 03:11:20 +0200 mh r275383 : #i39230
2009-08-26 03:07:51 +0200 mh r275382 : #i39230# more space for initials field
2009-08-26 02:41:19 +0200 mh r275380 : #i39230# use vos::osecurity for reading the user name
2009-08-18 22:06:00 +0200 mh r275130 : #i104243#, line ending problem with newer perl
2009-08-18 21:53:21 +0200 mh r275129 : #i39230# read initials via getpwnam
2009-08-18 21:34:05 +0200 mh r275128 : enable CAIROCANVAS for Linux and Mac, #i88613#
2009-08-17 18:02:59 +0200 mh r275067 : #i95498# make compile with gcc3
2009-09-10 kz CWS-TOOLING: integrate CWS tkr24
2009-09-07 14:31:06 +0200 is r275898 : #160081# adding NO_LICENSE_INTO_COPYRIGHT
2009-09-10 releng #i10000# change KeyMapping to SingletonRef<framework::KeyMapping>
2009-09-11 convert-repo update tags
2009-09-10 kz CWS-TOOLING: integrate CWS os2port06dev300
2009-09-05 22:49:00 +0200 ydario r275858 : #i99588# applied os2port06 diff to DEV300 tree.
2009-09-10 kz CWS-TOOLING: integrate CWS mingwport23
2009-08-29 07:07:53 +0200 tono r275555 : i#104522: mingw port graphite
2009-08-29 07:07:26 +0200 tono r275554 : i#104522: mingw port printf format fix
2009-09-10 kz CWS-TOOLING: integrate CWS mh232
2009-08-26 03:52:57 +0200 mh r275385 : #i102182# FreeBSD patch
2009-08-26 03:43:20 +0200 mh r275384 : #i101333# patch for FreeBSD
2009-08-26 03:11:20 +0200 mh r275383 : #i39230
2009-08-26 03:07:51 +0200 mh r275382 : #i39230# more space for initials field
2009-08-26 02:41:19 +0200 mh r275380 : #i39230# use vos::osecurity for reading the user name
2009-08-18 22:06:00 +0200 mh r275130 : #i104243#, line ending problem with newer perl
2009-08-18 21:53:21 +0200 mh r275129 : #i39230# read initials via getpwnam
2009-08-18 21:34:05 +0200 mh r275128 : enable CAIROCANVAS for Linux and Mac, #i88613#
2009-08-17 18:02:59 +0200 mh r275067 : #i95498# make compile with gcc3
2009-09-10 kz CWS-TOOLING: integrate CWS tkr24
2009-09-07 14:31:06 +0200 is r275898 : #160081# adding NO_LICENSE_INTO_COPYRIGHT
2009-09-10 releng #i10000# change KeyMapping to SingletonRef<framework::KeyMapping>

Comments (0)

Files changed (198)

offapi/com/sun/star/text/TextPortion.idl

 /*************************************************************************
  *
  * 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
         <dt>Ruby</dt><dd>a ruby attribute which is used in Asian text</dd>
         <dt>Frame</dt><dd>a frame</dd>
         <dt>SoftPageBreak</dt><dd>a soft page break</dd>
+        <dt>InContentMetadata</dt><dd>a text range with attached metadata</dd>
     </dl>
     <p>For Reference marks, document index marks, etc., 2 text portions
        will be generated, one for the start position and one for the
     //-------------------------------------------------------------------------
     /** contains the control character of a text portion of type
         ControlCharacter.
+        @deprecated type ControlCharacter no longer implemented
      */
     [readonly, property] short ControlCharacter;
-    
+
     //-------------------------------------------------------------------------
     /** contains the bookmark of a text portion of type Bookmark. */
     [optional, readonly, property]
     ::com::sun::star::text::XTextContent Bookmark;
-    
+
     //-------------------------------------------------------------------------
     /** contains the document index mark of a text portion of type
         DocumentIndexMark. */
     [optional, readonly, property]
     ::com::sun::star::text::XTextContent DocumentIndexMark;
-    
+
     //-------------------------------------------------------------------------
     /** contains the bookmark of a text portion of type ReferenceMark. */
     [optional, readonly, property]
     ::com::sun::star::text::XTextContent ReferenceMark;
-    
+
     //-------------------------------------------------------------------------
     /** contains the footnote of a text portion of type Footnote. */
     [optional, readonly, property]
     ::com::sun::star::text::XFootnote Footnote;
-    
+
     //-------------------------------------------------------------------------
     /** contains the text field of a text portion of type TextField. */
     [optional, readonly, property]
     ::com::sun::star::text::XTextField TextField;
-    
+
+    //-------------------------------------------------------------------------
+    /** contains the text range of a text portion of type InContentMetadata.
+        @since OOo 3.2
+     */
+    [optional, readonly, property]
+    ::com::sun::star::text::XTextContent InContentMetadata;
+
     //-------------------------------------------------------------------------
     /** contains whether the portion is a point only. */
     [optional, readonly, property] boolean IsCollapsed;
-    
+
     //-------------------------------------------------------------------------
     /** contains whether the portion is the start of the portion.
-    
+
         <p>This is used for portions which are represented by
         2 TextPortion objects (e.g., DocmentIndexMark).</p>
      */

offapi/com/sun/star/text/makefile.mk

  	HorizontalAdjust.idl\
  	HypertextDocument.idl\
     IllustrationsIndex.idl\
+    InContentMetadata.idl\
  	InvalidTextContentException.idl\
         LabelFollow.idl\
  	LineNumberingProperties.idl\

offapi/com/sun/star/text/textfield/makefile.mk

 	InputUser.idl\
     JumpEdit.idl\
     Macro.idl\
+    MetadataField.idl\
     PageCount.idl\
     PageNumber.idl\
     ParagraphCount.idl\

sw/inc/IDocumentContentOperations.hxx

         DOC_NO_DELFRMS = 0x08
     };
 
+    // constants for inserting text
+    enum InsertFlags
+    {   INS_DEFAULT         = 0x00 // no extras
+    ,   INS_EMPTYEXPAND     = 0x01 // expand empty hints at insert position
+    ,   INS_NOHINTEXPAND    = 0x02 // do not expand any hints at insert pos
+    ,   INS_FORCEHINTEXPAND = 0x04 // expand all hints at insert position
+    };
+
  public:
     /** Kopieren eines Bereiches im oder in ein anderes Dokument !
 	    Die Position kann auch im Bereich liegen !!
     */
-    virtual bool Copy(SwPaM&, SwPosition&, bool bCopyAll ) const = 0;
+    virtual bool CopyRange(SwPaM&, SwPosition&, const bool bCopyAll ) const = 0;
 
 	/** Loesche die Section, in der der Node steht.
     */
 
     /** loeschen eines BereichesSwFlyFrmFmt
     */
-	virtual bool Delete(SwPaM&) = 0;
+    virtual bool DeleteRange(SwPaM&) = 0;
 
     /** loeschen gesamter Absaetze
     */
 
     /** verschieben eines Bereiches
     */
-	virtual bool Move(SwPaM&, SwPosition&, SwMoveFlags) = 0;
+    virtual bool MoveRange(SwPaM&, SwPosition&, SwMoveFlags) = 0;
 
     /** verschieben ganzer Nodes
     */
-	virtual bool Move(SwNodeRange&, SwNodeIndex&, SwMoveFlags) = 0;
+    virtual bool MoveNodeRange(SwNodeRange&, SwNodeIndex&, SwMoveFlags) = 0;
 
     /** verschieben eines Bereiches
     */
 	virtual bool MoveAndJoin(SwPaM&, SwPosition&, SwMoveFlags) = 0;
 
-	/** Ueberschreiben eines einzelnen Zeichens. rRg.Start() bezeichnet
-	    den Node und die Position in dem Node, an der eingefuegt wird,
-    */
-	virtual bool Overwrite(const SwPaM &rRg, sal_Unicode c) = 0;
-
 	/** Ueberschreiben eines Strings in einem bestehenden Textnode.
     */
 	virtual bool Overwrite(const SwPaM &rRg, const String& rStr) = 0;
 
-	/** Einfuegen eines einzelnen Zeichens. rRg.Start() bezeichnet
-	    den Node und die Position in dem Node, an der eingefuegt wird.
+    /** Insert string into existing text node at position rRg.Point().
     */
-	virtual bool Insert(const SwPaM &rRg, sal_Unicode c) = 0;
-
-	/** Einfuegen eines Strings in einen bestehenden
-	    Textnode. Der Text wird kopiert.
-    */
-	virtual bool Insert(const SwPaM &rRg, const String&, bool bHintExpand) = 0;
+    virtual bool InsertString(const SwPaM &rRg, const String&,
+              const enum InsertFlags nInsertMode = INS_EMPTYEXPAND ) = 0;
 
 	/** change text to Upper/Lower/Hiragana/Katagana/...
     */
 	    			z.B.: Fnd: "zzz", Repl: "xx\t\\t..&..\&"
 						--> "xx\t<Tab>..zzz..&"
     */
-	virtual bool Replace(SwPaM& rPam, const String& rNewStr, bool bRegExpRplc) = 0;
+    virtual bool ReplaceRange(SwPaM& rPam, const String& rNewStr,
+                              const bool bRegExReplace) = 0;
 
     /** Einfuegen eines Attributs. Erstreckt sich rRg ueber
 	    mehrere Nodes, wird das Attribut aufgespaltet, sofern
         hinzugefuegt.  Wenn das Attribut nicht eingefuegt werden
         konnte, liefert die Methode sal_False.
 	*/
-	virtual bool Insert(const SwPaM &rRg, const SfxPoolItem&, sal_uInt16 nFlags) = 0;
+    virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem&,
+                                const sal_uInt16 nFlags) = 0;
 
     /**
     */
-	virtual bool Insert(const SwPaM &rRg, const SfxItemSet&, sal_uInt16 nFlags) = 0;
+    virtual bool InsertItemSet (const SwPaM &rRg, const SfxItemSet&,
+                                const sal_uInt16 nFlags) = 0;
 
     /** Removes any leading white space from the paragraph
     */
 #define FN_UNO_PARA_CONT_PREV_SUBTREE       (FN_EXTRA2 + 109)
 #define FN_UNO_PARA_NUM_STRING              (FN_EXTRA2 + 110)
 #define FN_UNO_TABLE_NAME                   (FN_EXTRA2 + 111)
+#define FN_UNO_META                         (FN_EXTRA2 + 112)
 
 /*--------------------------------------------------------------------
 	Bereich: Hilfe
 namespace sw { namespace mark {
     class MarkManager;
 }}
+namespace sw {
+    class MetaFieldManager;
+}
 
 namespace com { namespace sun { namespace star {
 namespace i18n {
     mutable com::sun::star::uno::Reference< com::sun::star::linguistic2::XProofreadingIterator > m_xGCIterator;
 
     const ::boost::scoped_ptr< ::sw::mark::MarkManager> pMarkManager;
+    const ::boost::scoped_ptr< ::sw::MetaFieldManager > m_pMetaFieldManager;
 
 	// -------------------------------------------------------------------
 	// die Pointer
 		// nur fuer den internen Gebrauch deshalb privat.
 		// Kopieren eines Bereiches im oder in ein anderes Dokument !
 		// Die Position darf nicht im Bereich liegen !!
-	sal_Bool _Copy( SwPaM&, SwPosition&,
-				sal_Bool MakeNewFrms /*= sal_True*/, bool bCopyAll, SwPaM* pCpyRng /*= 0*/ ) const;	// in ndcopy.cxx
+    bool CopyImpl( SwPaM&, SwPosition&, const bool MakeNewFrms /*= true */,
+            const bool bCopyAll, SwPaM *const pCpyRng /*= 0*/ ) const;
 
 	SwFlyFrmFmt* _MakeFlySection( const SwPosition& rAnchPos,
 								const SwCntntNode& rNode, RndStdIds eRequestId,
 								const SfxItemSet* pGrfAttrSet,
 								SwFrmFmt* = 0 );
 
-    void _CopyFlyInFly( const SwNodeRange& rRg, const xub_StrLen nEndContentIndex,
-                        const SwNodeIndex& rSttIdx,
-						sal_Bool bCopyFlyAtFly = sal_False ) const;	// steht im ndcopy.cxx
+    void CopyFlyInFlyImpl(  const SwNodeRange& rRg,
+                            const xub_StrLen nEndContentIndex,
+                            const SwNodeIndex& rStartIdx,
+                            const bool bCopyFlyAtFly = false ) const;
     sal_Int8 SetFlyFrmAnchor( SwFrmFmt& rFlyFmt, SfxItemSet& rSet, sal_Bool bNewFrms );
 
     // --> OD 2005-01-13 #i40550#
 						FNCopyFmt fnCopyFmt, const SwFmt& rDfltFmt );
 	void CopyFmtArr( const SvPtrarr& rSourceArr, SvPtrarr& rDestArr,
 						FNCopyFmt fnCopyFmt, SwFmt& rDfltFmt );
-	void _CopyPageDescHeaderFooter( sal_Bool bCpyHeader,
+    void CopyPageDescHeaderFooterImpl( bool bCpyHeader,
 								const SwFrmFmt& rSrcFmt, SwFrmFmt& rDestFmt );
 	SwFmt* FindFmtByName( const SvPtrarr& rFmtArr,
 									const String& rName ) const;
 
      void InitTOXTypes();
      void   Paste( const SwDoc& );
+     bool DeleteAndJoinImpl(SwPaM&, const bool);
+     bool DeleteAndJoinWithRedlineImpl(SwPaM&, const bool unused = false);
+     bool DeleteRangeImpl(SwPaM&, const bool unused = false);
+     bool ReplaceRangeImpl(SwPaM&, String const&, const bool);
+
 public:
 
     /** Life cycle
 
     /** IDocumentContentOperations
     */
-    virtual bool Copy(SwPaM&, SwPosition&, bool bCopyAll) const;
+    virtual bool CopyRange(SwPaM&, SwPosition&, const bool bCopyAll) const;
 	virtual void DeleteSection(SwNode* pNode);
-	virtual bool Delete(SwPaM&);
+    virtual bool DeleteRange(SwPaM&);
 	virtual bool DelFullPara(SwPaM&);
     // --> OD 2009-08-20 #i100466#
     // Add optional parameter <bForceJoinNext>, default value <false>
     virtual bool DeleteAndJoin( SwPaM&,
                                 const bool bForceJoinNext = false );
     // <--
-	virtual bool Move(SwPaM&, SwPosition&, SwMoveFlags);
-	virtual bool Move(SwNodeRange&, SwNodeIndex&, SwMoveFlags);
+    virtual bool MoveRange(SwPaM&, SwPosition&, SwMoveFlags);
+    virtual bool MoveNodeRange(SwNodeRange&, SwNodeIndex&, SwMoveFlags);
 	virtual bool MoveAndJoin(SwPaM&, SwPosition&, SwMoveFlags);
-	virtual bool Overwrite(const SwPaM &rRg, sal_Unicode c);
 	virtual bool Overwrite(const SwPaM &rRg, const String& rStr);
-	virtual bool Insert(const SwPaM &rRg, sal_Unicode c);
-	virtual bool Insert(const SwPaM &rRg, const String&, bool bHintExpand);
+    virtual bool InsertString(const SwPaM &rRg, const String&,
+              const enum InsertFlags nInsertMode = INS_EMPTYEXPAND );
 	virtual SwFlyFrmFmt* Insert(const SwPaM &rRg, const String& rGrfName, const String& rFltName, const Graphic* pGraphic,
 						const SfxItemSet* pFlyAttrSet, const SfxItemSet* pGrfAttrSet, SwFrmFmt*);
 	virtual SwFlyFrmFmt* Insert(const SwPaM& rRg, const GraphicObject& rGrfObj,	const SfxItemSet* pFlyAttrSet,
     virtual SwDrawFrmFmt* Insert(const SwPaM &rRg, SdrObject& rDrawObj, const SfxItemSet* pFlyAttrSet, SwFrmFmt*);
     virtual SwFlyFrmFmt* Insert(const SwPaM &rRg, const svt::EmbeddedObjectRef& xObj, const SfxItemSet* pFlyAttrSet,
 						const SfxItemSet* pGrfAttrSet, SwFrmFmt*);
-    virtual bool Insert(const SwPaM &rRg, const SfxPoolItem&, sal_uInt16 nFlags);
-	virtual bool Insert(const SwPaM &rRg, const SfxItemSet&, sal_uInt16 nFlags);
+    virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem&,
+                                const SetAttrMode nFlags);
+    virtual bool InsertItemSet (const SwPaM &rRg, const SfxItemSet&,
+                                const SetAttrMode nFlags);
 	virtual void ReRead(SwPaM&, const String& rGrfName, const String& rFltName, const Graphic* pGraphic, const GraphicObject* pGrfObj);
     virtual void TransliterateText(const SwPaM& rPaM, utl::TransliterationWrapper&);
 	virtual SwFlyFrmFmt* InsertOLE(const SwPaM &rRg, const String& rObjName, sal_Int64 nAspect, const SfxItemSet* pFlyAttrSet,
 	virtual bool SplitNode(const SwPosition &rPos, bool bChkTableStart);
 	virtual bool AppendTxtNode(SwPosition& rPos);
         virtual void SetModified(SwPaM &rPaM);
-    virtual bool Replace(SwPaM& rPam, const String& rNewStr, bool bRegExpRplc);
+    virtual bool ReplaceRange(SwPaM& rPam, const String& rNewStr,
+                              const bool bRegExReplace);
     virtual void RemoveLeadingWhiteSpace(const SwPosition & rPos );
 
     /** IDocumentStylePoolAccess
 		// kopiere die Kopzeile (mit dem Inhalt!) aus dem SrcFmt
 		// ins DestFmt ( auch ueber Doc grenzen hinaus!)
 	void CopyHeader( const SwFrmFmt& rSrcFmt, SwFrmFmt& rDestFmt )
-		{ _CopyPageDescHeaderFooter( sal_True, rSrcFmt, rDestFmt ); }
+        { CopyPageDescHeaderFooterImpl( true, rSrcFmt, rDestFmt ); }
 		// kopiere die Fusszeile (mit dem Inhalt!) aus dem SrcFmt
 		// ins DestFmt ( auch ueber Doc grenzen hinaus!)
 	void CopyFooter( const SwFrmFmt& rSrcFmt, SwFrmFmt& rDestFmt )
-		{ _CopyPageDescHeaderFooter( sal_False, rSrcFmt, rDestFmt ); }
+        { CopyPageDescHeaderFooterImpl( false, rSrcFmt, rDestFmt ); }
 
 		//fuer Reader
 
 		// Methoden fuer die Verzeichnisse:
 		// - Verzeichnismarke einfuegen loeschen travel
 	sal_uInt16 GetCurTOXMark( const SwPosition& rPos, SwTOXMarks& ) const;
-    void Delete( const SwTOXMark* pTOXMark );
+    void DeleteTOXMark( const SwTOXMark* pTOXMark );
 	const SwTOXMark& GotoTOXMark( const SwTOXMark& rCurTOXMark,
 								SwTOXSearch eDir, sal_Bool bInReadOnly );
 
 	inline		 void  SetOle2Link(const Link& rLink) {aOle2Link = rLink;}
 	inline const Link& GetOle2Link() const {return aOle2Link;}
 
-	// SS fuer Bereiche
-	SwSection* Insert( const SwPaM& rRange, const SwSection& rNew,
-						const SfxItemSet* pAttr = 0, sal_Bool bUpdate = sal_True );
+    // insert section (the ODF kind of section, not the nodesarray kind)
+    SwSection* InsertSwSection( const SwPaM& rRange, const SwSection& rNew,
+                    const SfxItemSet* pAttr = 0, bool bUpdate = true);
 	sal_uInt16 IsInsRegionAvailable( const SwPaM& rRange,
 								const SwNode** ppSttNd = 0 ) const;
 	SwSection* GetCurrSection( const SwPosition& rPos ) const;
 	}
 
     ::sfx2::IXmlIdRegistry& GetXmlIdRegistry();
+    ::sw::MetaFieldManager & GetMetaFieldManager();
     SwDoc* CreateCopy() const;
 };
 

sw/inc/editsh.hxx

 public:
 	// Editieren (immer auf allen selektierten Bereichen)
 	void Insert( sal_Unicode, BOOL bOnlyCurrCrsr = FALSE );
-	void Insert( const String &);
+    void Insert2( const String &, const bool bForceExpandHints = false );
 	void Overwrite( const String & );
 
 	// Ersetz einen selektierten Bereich in einem TextNode mit dem
 		{ return (SwCharFmt*)SwEditShell::GetFmtFromPool( nId ); }
 
 	// Felder
-	void Insert(SwField&);
+    void Insert2(SwField&, const bool bForceExpandHints = false);
 	SwField* GetCurFld() const;
 
 	void UpdateFlds( SwField & );		// ein einzelnes Feld

sw/inc/hintids.hxx

     RES_TXTATR_DUMMY5,                              // 46
 	RES_TXTATR_CJK_RUBY, 							// 47
 	RES_TXTATR_UNKNOWN_CONTAINER,					// 48
-	RES_TXTATR_DUMMY6,								// 49
-	RES_TXTATR_DUMMY7,								// 50
+    RES_TXTATR_META,                                // 49
+    RES_TXTATR_METAFIELD,                           // 50
 RES_TXTATR_WITHEND_END,
 
 // alle TextAttribute ohne ein Ende
 	RES_TXTATR_FIELD = RES_TXTATR_NOEND_BEGIN,		// 51
 	RES_TXTATR_FLYCNT,								// 52
 	RES_TXTATR_FTN, 								// 53
-	RES_TXTATR_SOFTHYPH,							// 54
-	RES_TXTATR_HARDBLANK,							// 55
+    RES_TXTATR_DUMMY4,                              // 54
+    RES_TXTATR_DUMMY3,                              // 55
 	RES_TXTATR_DUMMY1,								// 56
 	RES_TXTATR_DUMMY2,								// 57
 RES_TXTATR_NOEND_END,
 	static SwIndexReg* pEmptyIndexArray;
 
 protected:
-	virtual void Update( const SwIndex & aPos, xub_StrLen nLen,
-                         BOOL bNegativ = FALSE, BOOL bDelete = FALSE );
+    virtual void Update( SwIndex const & rPos, const xub_StrLen nChangeLen,
+                 const bool bNegative = false, const bool bDelete = false );
 
 	void ChkArr();
 
 
 	BOOL _MoveNodes( const SwNodeRange&, SwNodes& rNodes, const SwNodeIndex&,
 				BOOL bNewFrms = TRUE );
-	void Move( SwPaM&, SwPosition&, SwNodes& rNodes, BOOL bSplitNd=TRUE );
+    void MoveRange( SwPaM&, SwPosition&, SwNodes& rNodes );
 
 	void _Copy( const SwNodeRange& rRg, const SwNodeIndex& rInsPos,
 				BOOL bNewFrms = TRUE ) const

sw/inc/ndhints.hxx

 #include <svtools/svarray.hxx>
 #include <tools/mempool.hxx>
 
+#include "swtypes.hxx"
+
 //#include "numrule.hxx"
 
 class SwTxtNode;
 class SwRegHistory;                 // steht im RolBck.hxx
 class SwTxtAttr;
+class SwTxtAttrNesting;
+
+class SfxPoolItem;
+class SfxItemSet;
+class SwDoc;
+
+SW_DLLPRIVATE SwTxtAttr *
+MakeTxtAttr( SwDoc & rDoc, SfxPoolItem & rNew,
+        xub_StrLen nStt, xub_StrLen nEnd );
+SW_DLLPRIVATE SwTxtAttr *
+MakeTxtAttr( SwDoc & rDoc, const SfxItemSet & rSet,
+        xub_StrLen nStt, xub_StrLen nEnd );
+
+// create redline dummy text hint that must not be inserted into hints array
+SW_DLLPRIVATE SwTxtAttr*
+MakeRedlineTxtAttr( SwDoc & rDoc, SfxPoolItem& rAttr );
+
 
 /*
  * Ableitung der Klasse SwpHints ueber den Umweg ueber SwpHts, da
         return m_bHasHiddenParaField;
     }
 
-    void BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint, USHORT nMode );
+    void InsertNesting(SwTxtAttrNesting & rNewHint);
+    bool TryInsertNesting(SwTxtNode & rNode, SwTxtAttrNesting & rNewHint);
+    void BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint,
+            const SetAttrMode nMode );
     bool MergePortions( SwTxtNode& rNode );
 
 public:
     void DeRegister() { Register(0); }
     SwRegHistory* GetHistory() const    { return m_pHistory; }
 
-    void Insert( SwTxtAttr*  pHt, SwTxtNode &rNode, USHORT nMode = 0 );
+    /// try to insert the hint
+    /// @return true iff hint successfully inserted
+    bool TryInsertHint( SwTxtAttr * const pHint, SwTxtNode & rNode,
+            const SetAttrMode nMode = nsSetAttrMode::SETATTR_DEFAULT );
 
     inline bool HasFtn() const          { return m_bFootnote; }
     inline bool IsInSplitNode() const   { return m_bInSplitNode; }
 #include <errhdl.hxx>
 #include <modeltoviewhelper.hxx>
 #include <SwNumberTreeTypes.hxx>
+#include <IDocumentContentOperations.hxx>
 
 #include <sfx2/Metadatable.hxx>
 
 struct SwDocStat;
 struct SwParaIdleData_Impl;
 
-// Konstanten fuer das Text-Insert:
-#define INS_DEFAULT         0x0000 // keine Extras
-#define INS_EMPTYEXPAND     0x0001 // leere Hints beim Einfuegen aufspannen
-#define INS_NOHINTEXPAND    0x0002 // Hints an der InsPos nicht aufspannen
-
 namespace com { namespace sun { namespace star { namespace uno {
     template < class > class Sequence;
 }}}}
 	friend class SwNodes;
 	friend class SwTxtFrm;
     friend class SwScriptInfo;
-	friend void SwpHints::Insert( SwTxtAttr*, SwTxtNode&, USHORT );
-    friend void SwpHints::BuildPortions( SwTxtNode&, SwTxtAttr&, USHORT );
 
 	//Kann 0 sein, nur dann nicht 0 wenn harte Attribute drin stehen.
 	//Also niemals direkt zugreifen!
 	SW_DLLPRIVATE SwTxtNode* _MakeNewTxtNode( const SwNodeIndex&, BOOL bNext = TRUE,
 								BOOL bChgFollow = TRUE );
 
-	SW_DLLPRIVATE void	_Cut( SwTxtNode *pDest, const SwIndex &rDestStart,
-				  const SwIndex &rStart, xub_StrLen nLen, BOOL bUpdate = TRUE );
-
-    SW_DLLPRIVATE SwTxtAttr* MakeTxtAttr( const SfxPoolItem& rNew, xub_StrLen nStt, xub_StrLen nEnd, bool bRedlineAttr = false );
-    SW_DLLPRIVATE SwTxtAttr* MakeTxtAttr( const SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd );
+    SW_DLLPRIVATE void CutImpl(
+          SwTxtNode * const pDest, const SwIndex & rDestStart,
+          const SwIndex & rStart, /*const*/ xub_StrLen nLen,
+          const bool bUpdate = true );
 
     // Verlagere alles umfassende harte Attribute in den AttrSet des Absatzes
 	SW_DLLPRIVATE void MoveTxtAttr_To_AttrSet();  // wird von SplitNode gerufen.
     virtual USHORT ResetAllAttr();
     // <--
 
-    /*
-	 * Einfuegen anderer Datentypen durch Erzeugen eines
-	 * temporaeren Strings.
-	 */
-	SwTxtNode&	Insert( xub_Unicode c, const SwIndex &rIdx );
-	SwTxtNode&	Insert( const XubString &rStr, const SwIndex &rIdx,
-						const USHORT nMode = INS_DEFAULT );
+    /// insert text content
+    void InsertText( const XubString & rStr, const SwIndex & rIdx,
+                     const enum IDocumentContentOperations::InsertFlags nMode
+                         = IDocumentContentOperations::INS_DEFAULT );
 
-	SwTxtNode&	Erase( const SwIndex &rIdx, xub_StrLen nCount = STRING_LEN,
-					   const USHORT nMode = INS_DEFAULT );
+    /** delete text content
+        ATTENTION: must not be called with a range that overlaps the start of
+                   an attribute with both extent and dummy char
+     */
+    void EraseText ( const SwIndex &rIdx, const xub_StrLen nCount = STRING_LEN,
+                     const enum IDocumentContentOperations::InsertFlags nMode
+                         = IDocumentContentOperations::INS_DEFAULT );
 
-	// Aktionen auf Attributen
-	// loesche alle TextAttribute die als Attribut im Set vorhanden sind
-	// (Set-Pointer != 0 ) oder alle deren Which-Wert mit nWhich mappen
-	// oder wenn Which = 0, alle.
+    /** delete all attributes.
+        If neither pSet nor nWhich is given, delete all attributes (except
+        refmarks, toxmarks, meta) in range.
+        @param rIdx     start position
+        @param nLen     range in which attributes will be deleted
+        @param pSet     if not 0, delete only attributes contained in pSet
+        @param nWhich   if not 0, delete only attributes with matching which
+        @param bInclRefToxMark
+            refmarks, toxmarks, and metas will be ignored unless this is true
+        ATTENTION: setting bInclRefToxMark is only allowed from UNDO!
+     */
 	void	RstAttr( const SwIndex &rIdx, xub_StrLen nLen, USHORT nWhich = 0,
 					const SfxItemSet* pSet = 0, BOOL bInclRefToxMark = FALSE );
 	void	GCAttr();
 	// loesche alle Attribute aus dem SwpHintsArray.
     void    ClearSwpHintsArr( bool bDelFields );
 
-    // Insert pAttr into hints array.
-    BOOL    Insert( SwTxtAttr *pAttr, USHORT nMode = 0 );
-    // lege ein neues TextAttribut an und fuege es ins SwpHints-Array ein
-	// returne den neuen Pointer (oder 0 bei Fehlern)!
-    SwTxtAttr* InsertItem( const SfxPoolItem& rAttr,
-                           xub_StrLen nStt, xub_StrLen nEnd, USHORT nMode = 0 );
+    /// Insert pAttr into hints array. @return true iff inserted successfully
+    bool    InsertHint( SwTxtAttr * const pAttr,
+                  const SetAttrMode nMode = nsSetAttrMode::SETATTR_DEFAULT );
+    /// create new text attribute from rAttr and insert it
+    /// @return     inserted hint; 0 if not sure the hint is inserted
+    SwTxtAttr* InsertItem( SfxPoolItem& rAttr,
+                  const xub_StrLen nStart, const xub_StrLen nEnd,
+                  const SetAttrMode nMode = nsSetAttrMode::SETATTR_DEFAULT );
 
 	// setze diese Attribute am TextNode. Wird der gesamte Bereich umspannt,
 	// dann setze sie nur im AutoAttrSet (SwCntntNode:: SetAttr)
     BOOL SetAttr( const SfxItemSet& rSet,
-                  xub_StrLen nStt, xub_StrLen nEnd, USHORT nMode = 0 );
+                  xub_StrLen nStt, xub_StrLen nEnd,
+                  const SetAttrMode nMode = nsSetAttrMode::SETATTR_DEFAULT );
 	// erfrage die Attribute vom TextNode ueber den Bereich
     // --> OD 2008-01-16 #newlistlevelattrs#
     // Introduce 4th optional parameter <bMergeIndentValuesOfNumRule>.
 	// uebertrage Attribute eines AttrSets ( AutoFmt ) in das SwpHintsArray
 	void FmtToTxtAttr( SwTxtNode* pNd );
 
-	// loeschen eines einzelnen Attributes (fuer SwUndoAttr)
-	// ( nur das Attribut loeschen, dass mit Which,Start und End oder
-	//   mit pTxtHint identisch ist (es gibt nur ein gueltiges))
-	// 	AUSNAHME: ToxMarks !!!
-	void 	Delete( USHORT nTxtWhich, xub_StrLen nStart, xub_StrLen nEnd = 0 );
-	void 	Delete( SwTxtAttr * pTxtAttr, BOOL bThisOnly = FALSE );
+    /// delete all attributes of type nWhich at nStart (opt. end nEnd)
+    void DeleteAttributes( const USHORT nWhich,
+                  const xub_StrLen nStart, const xub_StrLen nEnd = 0 );
+    /// delete the attribute pTxtAttr
+    void DeleteAttribute ( SwTxtAttr * const pTxtAttr );
 
 	// Aktionen auf Text und Attributen
     // --> OD 2008-11-18 #i96213#
     // introduce optional parameter to control, if all attributes have to be copied.
-    void Copy( SwTxtNode *pDest,
+    void CopyText( SwTxtNode * const pDest,
                const SwIndex &rStart,
-               USHORT nLen,
+               const xub_StrLen nLen,
                const bool bForceCopyOfAllAttrs = false );
-    void Copy( SwTxtNode *pDest,
+    void CopyText( SwTxtNode * const pDest,
                const SwIndex &rDestStart,
                const SwIndex &rStart,
                xub_StrLen nLen,
                const bool bForceCopyOfAllAttrs = false );
     // <--
-	void	Cut(SwTxtNode *pDest, const SwIndex &rStart, xub_StrLen nLen);
-	inline void	Cut(SwTxtNode *pDest, const SwIndex &rDestStart,
-					const SwIndex &rStart, xub_StrLen nLen);
-	// ersetze im String an Position nIdx das Zeichen
-	void Replace( const SwIndex& rStart, xub_Unicode cCh );
-	void Replace( const SwIndex& rStart, xub_StrLen nLen, const XubString& rText );
+
+    void        CutText(SwTxtNode * const pDest,
+                    const SwIndex & rStart, const xub_StrLen nLen);
+    inline void CutText(SwTxtNode * const pDest, const SwIndex &rDestStart,
+                    const SwIndex & rStart, const xub_StrLen nLen);
+
+    /// replace nDelLen characters at rStart with rText
+    void ReplaceText( const SwIndex& rStart, const xub_StrLen nDelLen,
+            const XubString& rText );
 	void ReplaceTextOnly( xub_StrLen nPos, xub_StrLen nLen, const XubString& rText,
 					const ::com::sun::star::uno::Sequence<sal_Int32>& rOffsets );
 
 	// gebe das vorgegebene Attribut, welches an der TextPosition (rIdx)
 	// gesetzt ist zurueck. Gibt es keines, returne 0-Pointer
 	// gesetzt heisst: Start <= rIdx < End
+    // FIXME: this function does not seem to be well-defined for those
+    // hints of which several may cover a single position, like TOXMark,
+    // or CharFmt
 	SwTxtAttr *GetTxtAttr( const SwIndex& rIdx, USHORT nWhichHt,
 						   BOOL bExpand = FALSE ) const;
 
-	// Diese Methode liefert nur Textattribute auf der Position nIdx
-	// zurueck, die kein EndIdx besitzen und denselben Which besitzen.
-	// Ueblicherweise steht an dieser Position ein CH_TXTATR.
-	// Bei RES_TXTATR_END entfaellt die Pruefung auf den Which-Wert.
-	SwTxtAttr *GetTxtAttr( const xub_StrLen nIdx,
-						   const USHORT nWhichHt = RES_TXTATR_END ) const;
-
-	SwTxtFld  *GetTxtFld( const SwIndex& rIdx )
-		{ return (SwTxtFld *)GetTxtAttr( rIdx, RES_TXTATR_FIELD ); }
+    /** get the text attribute at position nIndex which owns
+        the dummy character CH_TXTATR_* at that position, if one exists.
+        @param nIndex   the position in the text
+        @param nWhich   if different from RES_TXTATR_END, return only
+                        attribute with given which id
+        @return the text attribute at nIndex of type nWhich, if it exists
+    */
+    SwTxtAttr *GetTxtAttrForCharAt( const xub_StrLen nIndex,
+                       const RES_TXTATR nWhich = RES_TXTATR_END ) const;
 
 	// Aktuelles Wort zurueckliefern
     XubString GetCurWord(xub_StrLen) const;
     bool IsHidden() const;
 // <--
 
-    inline SwTxtAttr* MakeRedlineTxtAttr( const SfxPoolItem& rNew )
-        { return MakeTxtAttr( rNew, 0, 0, true ); }
-
 	TYPEINFO();	// fuer rtti
 
 	// fuers Umhaengen der TxtFmtCollections (Outline-Nummerierung!!)
 	virtual void Modify( SfxPoolItem*, SfxPoolItem* );
 
-	// aus SwIndexReg
-	virtual void Update( const SwIndex & aPos, USHORT xub_StrLen,
-                         BOOL bNegativ = FALSE, BOOL bDelete = FALSE );
+    // override SwIndexReg
+    virtual void Update( SwIndex const & rPos, const xub_StrLen nChangeLen,
+                 const bool bNegative = false, const bool bDelete = false );
 
 	// change text to Upper/Lower/Hiragana/Katagana/...
 	void TransliterateText( utl::TransliterationWrapper& rTrans,
 }
 #endif
 
-inline void	SwTxtNode::Cut(SwTxtNode *pDest, const SwIndex &rDestStart,
-							const SwIndex &rStart, xub_StrLen nLen)
+inline void
+SwTxtNode::CutText(SwTxtNode * const pDest, const SwIndex & rDestStart,
+                    const SwIndex & rStart, const xub_StrLen nLen)
 {
-	_Cut( pDest, rDestStart, rStart, nLen, TRUE );
+    CutImpl( pDest, rDestStart, rStart, nLen, true );
 }
 
-
 #endif

sw/inc/rolbck.hxx

 
 //Nur die History anziehen, um das docnew.cxx gegen die CLOOK's zu behaupten.
 
+namespace sfx2 {
+    class MetadatableUndo;
+}
+
 class SwDoc;
 class SwFmt;
 class SwFmtColl;
         const bool m_bSaveOtherPos;
         const bool m_bHadOtherPos;
         const IDocumentMarkAccess::MarkType m_eBkmkType;
+        ::boost::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndo;
 };
 
 class SwHistorySetAttrSet : public SwHistoryHint
     // --> OD 2008-02-27 #refactorlists# - removed <rDoc>
     SwRegHistory( SwHistory* pHst );
     // <--
-    SwRegHistory( SwTxtNode* pTxtNode, const SfxItemSet& rSet,
-                xub_StrLen nStart, xub_StrLen nEnd, USHORT nFlags,
-                SwHistory* pHst );
     SwRegHistory( const SwNode& rNd, SwHistory* pHst );
     SwRegHistory( SwModify* pRegIn, const SwNode& rNd, SwHistory* pHst );
 
     virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew );
+
+    /// @return true iff at least 1 item was inserted
+    bool InsertItems( const SfxItemSet& rSet,
+        xub_StrLen const nStart, xub_StrLen const nEnd,
+        SetAttrMode const nFlags );
+
     void AddHint( SwTxtAttr* pHt, const bool bNew = false );
 
     void RegisterInModify( SwModify* pRegIn, const SwNode& rNd );

sw/inc/swtypes.hxx

 	const SetAttrMode SETATTR_DONTCHGNUMRULE = 0x0020; 	// nicht die NumRule veraendern
 	const SetAttrMode SETATTR_APICALL		 = 0x0040;	// called from API (all UI related
 										                // functionality will be disabled)
+    /// force hint expand (only matters for hints with CH_TXTATR)
+    const SetAttrMode SETATTR_FORCEHINTEXPAND= 0x0080;
 }
 
 //Umrechnung Twip<-> 1/100 mm fuer UNO

sw/inc/txatbase.hxx

 
 
 class SfxItemPool;
-class SvxBrushItem;
-class SvxFontItem;
-class SvxPostureItem;
-class SvxWeightItem;
-class SvxUnderlineItem;
-class SvxOverlineItem;
-class SvxFontHeightItem;
-class SvxPropSizeItem;
-class SvxShadowedItem;
-class SvxAutoKernItem;
-class SvxWordLineModeItem;
-class SvxContourItem;
-class SvxCrossedOutItem;
-class SvxColorItem;
-class SvxCharSetColorItem;
 class SvXMLAttrContainerItem;
 class SwFmtRuby;
-class SvxTwoLinesItem;
-class SvxEmphasisMarkItem;
-class SvxCharScaleWidthItem;
-class SvxCharRotateItem;
-class SvxCharReliefItem;
-class SvxCharHiddenItem;
-
 class SwFmtCharFmt;
 class SwFmtAutoFmt;
 class SwFmtINetFmt;
-class SvxKerningItem;
-class SvxCaseMapItem;
-class SvxLanguageItem;
-class SvxEscapementItem;
-class SvxBlinkItem;
-class SvxNoHyphenItem;
-class SwFmtSoftHyph;
-class SwFmtHardBlank;
 class SwFmtFld;
 class SwFmtFtn;
 class SwFmtFlyCnt;
 class SwTOXMark;
 class SwFmtRefMark;
+class SwFmtMeta;
+
 
 class SwTxtAttr : private boost::noncopyable
 {
-    const SfxPoolItem* m_pAttr;
+private:
+    SfxPoolItem * const m_pAttr;
     xub_StrLen m_nStart;
     bool m_bDontExpand          : 1;
     bool m_bLockExpandFlag      : 1;
 
-    bool m_bDontMergeAttr       : 1;    // refmarks, toxmarks, ruby
     bool m_bDontMoveAttr        : 1;    // refmarks, toxmarks
     bool m_bCharFmtAttr         : 1;    // charfmt, inet
     bool m_bOverlapAllowedAttr  : 1;    // refmarks, toxmarks
     bool m_bPriorityAttr        : 1;    // attribute has priority (redlining)
     bool m_bDontExpandStart     : 1;    // don't expand start at paragraph start (ruby)
+    bool m_bNesting             : 1;    // SwTxtAttrNesting
+    bool m_bHasDummyChar        : 1;    // without end + meta
 
 protected:
-	SwTxtAttr( const SfxPoolItem& rAttr, xub_StrLen nStart );
+    SwTxtAttr( SfxPoolItem& rAttr, xub_StrLen nStart );
+    virtual ~SwTxtAttr();
 
     void SetLockExpandFlag( bool bFlag )    { m_bLockExpandFlag = bFlag; }
-    void SetDontMergeAttr( bool bFlag )     { m_bDontMergeAttr = bFlag; }
     void SetDontMoveAttr( bool bFlag )      { m_bDontMoveAttr = bFlag; }
     void SetCharFmtAttr( bool bFlag )       { m_bCharFmtAttr = bFlag; }
     void SetOverlapAllowedAttr( bool bFlag ){ m_bOverlapAllowedAttr = bFlag; }
     void SetDontExpandStartAttr(bool bFlag) { m_bDontExpandStart = bFlag; }
+    void SetNesting(const bool bFlag)       { m_bNesting = bFlag; }
+    void SetHasDummyChar(const bool bFlag)  { m_bHasDummyChar = bFlag; }
 
 public:
-	virtual ~SwTxtAttr();
 
-	// RemoveFromPool muss immer vorm DTOR Aufruf erfolgen!!
-	void RemoveFromPool( SfxItemPool& rPool );
+    /// destroy instance
+    static void Destroy( SwTxtAttr * pToDestroy, SfxItemPool& rPool );
 
     /// start position
                   xub_StrLen* GetStart()        { return & m_nStart; }
     inline void SetDontExpand( bool bDontExpand );
     bool DontExpand() const                 { return m_bDontExpand; }
     bool IsLockExpandFlag() const           { return m_bLockExpandFlag; }
-    bool IsDontMergeAttr() const            { return m_bDontMergeAttr; }
     bool IsDontMoveAttr() const             { return m_bDontMoveAttr; }
     bool IsCharFmtAttr() const              { return m_bCharFmtAttr; }
     bool IsOverlapAllowedAttr() const       { return m_bOverlapAllowedAttr; }
     bool IsPriorityAttr() const             { return m_bPriorityAttr; }
     void SetPriorityAttr( bool bFlag )      { m_bPriorityAttr = bFlag; }
     bool IsDontExpandStartAttr() const      { return m_bDontExpandStart; }
+    bool IsNesting() const                  { return m_bNesting; }
+    bool HasDummyChar() const               { return m_bHasDummyChar; }
 
 	inline const SfxPoolItem& GetAttr() const;
+    inline       SfxPoolItem& GetAttr();
 	inline USHORT Which() const { return GetAttr().Which(); }
 
 	virtual	int         operator==( const SwTxtAttr& ) const;
 
-	inline const SvxFontItem		 	&GetFont() const;
-    inline const SvxPostureItem         &GetPosture() const;
-    inline const SvxWeightItem          &GetWeight() const;
-	inline const SvxUnderlineItem 		&GetUnderline() const;
-	inline const SvxOverlineItem 		&GetOverline() const;
-    inline const SvxFontHeightItem      &GetFontSize() const;
-    inline const SvxPropSizeItem        &GetPropSize() const;
-    inline const SvxShadowedItem        &GetShadowed() const;
-    inline const SvxAutoKernItem        &GetAutoKern() const;
-    inline const SvxWordLineModeItem    &GetWordLineMode() const;
-    inline const SvxContourItem         &GetContour() const;
-    inline const SvxCrossedOutItem      &GetCrossedOut() const;
-    inline const SvxColorItem           &GetColor() const;
-	inline const SvxCharSetColorItem	&GetCharSetColor() const;
 	inline const SwFmtCharFmt			&GetCharFmt() const;
     inline const SwFmtAutoFmt           &GetAutoFmt() const;
-	inline const SvxKerningItem			&GetKerning() const;
-	inline const SvxCaseMapItem			&GetCaseMap() const;
-	inline const SvxLanguageItem		&GetLanguage() const;
-	inline const SvxEscapementItem		&GetEscapement() const;
-	inline const SvxBlinkItem			&GetBlink() const;
-	inline const SvxBrushItem			&GetChrBackground() const;
-	inline const SvxNoHyphenItem		&GetNoHyphenHere() const;
-	inline const SwFmtSoftHyph			&GetSoftHyph() const;
-    inline const SwFmtHardBlank         &GetHardBlank() const;
 	inline const SwFmtFld				&GetFld() const;
 	inline const SwFmtFtn				&GetFtn() const;
 	inline const SwFmtFlyCnt			&GetFlyCnt() const;
 	inline const SwFmtINetFmt			&GetINetFmt() const;
     inline const SvXMLAttrContainerItem &GetXMLAttrContainer() const;
 	inline const SwFmtRuby				&GetRuby() const;
-	inline const SvxTwoLinesItem		&Get2Lines() const;
-    inline const SvxEmphasisMarkItem    &GetEmphasisMark() const;
-    inline const SvxCharScaleWidthItem &GetCharScaleW() const;
-	inline const SvxCharRotateItem		&GetCharRotate() const;
-    inline const SvxCharReliefItem      &GetCharRelief() const;
-    inline const SvxCharHiddenItem      &GetCharHidden() const;
+    inline const SwFmtMeta              &GetMeta() const;
 
 };
 
 class SwTxtAttrEnd : public SwTxtAttr
 {
-    using SwTxtAttr::GetEnd;
-
 protected:
     xub_StrLen m_nEnd;
 
 public:
-	SwTxtAttrEnd( const SfxPoolItem& rAttr, USHORT nStart, USHORT nEnd );
+    SwTxtAttrEnd( SfxPoolItem& rAttr, USHORT nStart, USHORT nEnd );
 
-	virtual xub_StrLen* GetEnd();
+    using SwTxtAttr::GetEnd;
+    virtual xub_StrLen* GetEnd();
 };
 
 
     return *m_pAttr;
 }
 
+inline SfxPoolItem& SwTxtAttr::GetAttr()
+{
+    return const_cast<SfxPoolItem&>(
+            const_cast<const SwTxtAttr*>(this)->GetAttr());
+}
+
 inline void SwTxtAttr::SetDontExpand( bool bDontExpand )
 {
     if ( !m_bLockExpandFlag )
     }
 }
 
-inline const SvxFontItem& SwTxtAttr::GetFont() const
-{
-    ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_FONT, "Wrong attribute" );
-    return (const SvxFontItem&)(*m_pAttr);
-}
-
-inline const SvxPostureItem& SwTxtAttr::GetPosture() const
-{
-    ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_POSTURE,
-        "Wrong attribute" );
-    return (const SvxPostureItem&)(*m_pAttr);
-}
-
-inline const SvxWeightItem& SwTxtAttr::GetWeight() const
-{
-    ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_WEIGHT,
-        "Wrong attribute" );
-    return (const SvxWeightItem&)(*m_pAttr);
-}
-
-inline const SvxUnderlineItem& SwTxtAttr::GetUnderline() const
-{
-    ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_UNDERLINE,
-        "Wrong attribute" );
-    return (const SvxUnderlineItem&)(*m_pAttr);
-}
-
-inline const SvxOverlineItem& SwTxtAttr::GetOverline() const
-{
-    ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_OVERLINE,
-        "Wrong attribute" );
-    return (const SvxOverlineItem&)(*m_pAttr);
-}
-
-inline const SvxFontHeightItem& SwTxtAttr::GetFontSize() const
-{
-    ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_FONTSIZE,
-        "Wrong attribute" );
-    return (const SvxFontHeightItem&)(*m_pAttr);
-}
-
-inline const SvxPropSizeItem& SwTxtAttr::GetPropSize() const
-{
-    ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_PROPORTIONALFONTSIZE,
-        "Wrong attribute" );
-    return (const SvxPropSizeItem&)(*m_pAttr);
-}
-
-inline const SvxShadowedItem& SwTxtAttr::GetShadowed() const
-{
-    ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_SHADOWED,
-        "Wrong attribute" );
-    return (const SvxShadowedItem&)(*m_pAttr);
-}
-
-inline const SvxAutoKernItem& SwTxtAttr::GetAutoKern() const
-{
-    ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_AUTOKERN,
-        "Wrong attribute" );
-    return (const SvxAutoKernItem&)(*m_pAttr);
-}
-
-inline const SvxWordLineModeItem& SwTxtAttr::GetWordLineMode() const
-{
-    ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_WORDLINEMODE,
-        "Wrong attribute" );
-    return (const SvxWordLineModeItem&)(*m_pAttr);
-}
-
-inline const SvxContourItem& SwTxtAttr::GetContour() const
-{
-    ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_CONTOUR,
-        "Wrong attribute" );
-    return (const SvxContourItem&)(*m_pAttr);
-}
-
-inline const SvxCrossedOutItem& SwTxtAttr::GetCrossedOut() const
-{
-    ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_CROSSEDOUT,
-        "Wrong attribute" );
-    return (const SvxCrossedOutItem&)(*m_pAttr);
-}
-
-inline const SvxColorItem& SwTxtAttr::GetColor() const
-{
-    ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_COLOR,
-        "Wrong attribute" );
-    return (const SvxColorItem&)(*m_pAttr);
-}
-
-inline const SvxCharSetColorItem& SwTxtAttr::GetCharSetColor() const
-{
-    ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_CHARSETCOLOR,
-        "Wrong attribute" );
-    return (const SvxCharSetColorItem&)(*m_pAttr);
-}
+//------------------------------------------------------------------------
 
 inline const SwFmtCharFmt& SwTxtAttr::GetCharFmt() const
 {
     return (const SwFmtAutoFmt&)(*m_pAttr);
 }
 
-inline const SvxKerningItem& SwTxtAttr::GetKerning() const
-{
-    ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_KERNING,
-        "Wrong attribute" );
-    return (const SvxKerningItem&)(*m_pAttr);
-}
-
-inline const SvxCaseMapItem& SwTxtAttr::GetCaseMap() const
-{
-    ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_CASEMAP,
-        "Wrong attribute" );
-    return (const SvxCaseMapItem&)(*m_pAttr);
-}
-
-inline const SvxLanguageItem& SwTxtAttr::GetLanguage() const
-{
-    ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_LANGUAGE,
-        "Wrong attribute" );
-    return (const SvxLanguageItem&)(*m_pAttr);
-}
-
-inline const SvxEscapementItem& SwTxtAttr::GetEscapement() const
-{
-    ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_ESCAPEMENT,
-        "Wrong attribute" );
-    return (const SvxEscapementItem&)(*m_pAttr);
-}
-
-inline const SvxBlinkItem& SwTxtAttr::GetBlink() const
-{
-    ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_BLINK,
-        "Wrong attribute" );
-    return (const SvxBlinkItem&)(*m_pAttr);
-}
-
-inline const SvxBrushItem& SwTxtAttr::GetChrBackground() const
-{
-    ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_BACKGROUND,
-        "Wrong attribute" );
-    return (const SvxBrushItem&)(*m_pAttr);
-}
-
-inline const SvxNoHyphenItem& SwTxtAttr::GetNoHyphenHere() const
-{
-    ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_NOHYPHEN,
-        "Wrong attribute" );
-    return (const SvxNoHyphenItem&)(*m_pAttr);
-}
-
-inline const SwFmtSoftHyph& SwTxtAttr::GetSoftHyph() const
-{
-    ASSERT( m_pAttr && m_pAttr->Which() == RES_TXTATR_SOFTHYPH,
-        "Wrong attribute" );
-    return (const SwFmtSoftHyph&)(*m_pAttr);
-}
-
-inline const SwFmtHardBlank& SwTxtAttr::GetHardBlank() const
-{
-    ASSERT( m_pAttr && m_pAttr->Which() == RES_TXTATR_HARDBLANK,
-        "Wrong attribute" );
-    return (const SwFmtHardBlank&)(*m_pAttr);
-}
-
 inline const SwFmtFld& SwTxtAttr::GetFld() const
 {
     ASSERT( m_pAttr && m_pAttr->Which() == RES_TXTATR_FIELD,
         "Wrong attribute" );
     return (const SwFmtRuby&)(*m_pAttr);
 }
-inline const SvxTwoLinesItem& SwTxtAttr::Get2Lines() const
+
+inline const SwFmtMeta& SwTxtAttr::GetMeta() const
 {
-    ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_TWO_LINES,
+    ASSERT( m_pAttr && (m_pAttr->Which() == RES_TXTATR_META ||
+                        m_pAttr->Which() == RES_TXTATR_METAFIELD),
         "Wrong attribute" );
-    return (const SvxTwoLinesItem&)(*m_pAttr);
-}
-
-inline const SvxEmphasisMarkItem& SwTxtAttr::GetEmphasisMark() const
-{
-    ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_EMPHASIS_MARK,
-        "Wrong attribute" );
-    return (const SvxEmphasisMarkItem&)(*m_pAttr);
-}
-
-inline const SvxCharScaleWidthItem&    SwTxtAttr::GetCharScaleW() const
-{
-    ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_SCALEW,
-        "Wrong attribute" );
-    return (const SvxCharScaleWidthItem&)(*m_pAttr);
-}
-
-inline const SvxCharRotateItem&    SwTxtAttr::GetCharRotate() const
-{
-    ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_ROTATE,
-        "Wrong attribute" );
-    return (const SvxCharRotateItem&)(*m_pAttr);
-}
-
-inline const SvxCharReliefItem&    SwTxtAttr::GetCharRelief() const
-{
-    ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_RELIEF,
-        "Wrong attribute" );
-    return (const SvxCharReliefItem&)(*m_pAttr);
-}
-
-inline const SvxCharHiddenItem& SwTxtAttr::GetCharHidden() const
-{
-    ASSERT( m_pAttr && m_pAttr->Which() == RES_CHRATR_HIDDEN,
-        "Wrong attribute" );
-    return (const SvxCharHiddenItem&)(*m_pAttr);
+    return (const SwFmtMeta&)(*m_pAttr);
 }
 
 #endif

sw/inc/txtatr.hxx

 /*************************************************************************
  *
  * 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
  ************************************************************************/
 #ifndef _TXTATR_HXX
 #define _TXTATR_HXX
-#include <tools/gen.hxx>
-#include <tools/color.hxx>
+
 #include <txatbase.hxx>     // SwTxtAttr/SwTxtAttrEnd
 #include <calbck.hxx>
 
+
 class SwTxtNode;	// fuer SwTxtFld
 class SwCharFmt;
-class SvxTwoLinesItem;
 
 // ATT_CHARFMT *********************************************
 
     USHORT GetSortNumber() const { return m_nSortNumber; }
 };
 
-// ATT_HARDBLANK ******************************
 
-class SwTxtHardBlank : public SwTxtAttr
-{
-    sal_Unicode m_Char;
-
-public:
-    SwTxtHardBlank( const SwFmtHardBlank& rAttr, xub_StrLen nStart );
-    inline sal_Unicode GetChar() const  { return m_Char; }
-};
-
-// ATT_XNLCONTAINERITEM ******************************
+// ATT_XMLCONTAINERITEM ******************************
 
 class SwTxtXMLAttrContainer : public SwTxtAttrEnd
 {
 public:
-	SwTxtXMLAttrContainer( const SvXMLAttrContainerItem& rAttr,
-						xub_StrLen nStart, xub_StrLen nEnd );
+    SwTxtXMLAttrContainer( SvXMLAttrContainerItem& rAttr,
+                        xub_StrLen nStart, xub_StrLen nEnd );
 };
 
 // ******************************
 
-class SW_DLLPUBLIC SwTxtRuby : public SwTxtAttrEnd, public SwClient
+class SwTxtAttrNesting : public SwTxtAttrEnd
+{
+public:
+    SwTxtAttrNesting( SfxPoolItem & i_rAttr,
+        const xub_StrLen i_nStart, const xub_StrLen i_nEnd );
+    virtual ~SwTxtAttrNesting();
+};
+
+class SwTxtMeta : public SwTxtAttrNesting
+{
+private:
+    SwTxtNode * m_pTxtNode;
+
+public:
+    SwTxtMeta( SwFmtMeta & i_rAttr,
+        const xub_StrLen i_nStart, const xub_StrLen i_nEnd );
+    virtual ~SwTxtMeta();
+
+    void ChgTxtNode( SwTxtNode * const pNode ) { m_pTxtNode = pNode; }
+    SwTxtNode * GetTxtNode() const { return m_pTxtNode; }
+
+};
+
+
+// ******************************
+
+class SW_DLLPUBLIC SwTxtRuby : public SwTxtAttrNesting, public SwClient
 {
     SwTxtNode* m_pTxtNode;
 
 
 		  SwCharFmt* GetCharFmt();
 	const SwCharFmt* GetCharFmt() const
-			{ return ((SwTxtRuby*)this)->GetCharFmt(); }
-};
-
-// ******************************
-
-class SwTxt2Lines : public SwTxtAttrEnd
-{
-public:
-	SwTxt2Lines( const SvxTwoLinesItem& rAttr,
-					xub_StrLen nStart, xub_StrLen nEnd );
+            { return (const_cast<SwTxtRuby*>(this))->GetCharFmt(); }
 };
 
 // --------------- Inline Implementierungen ------------------------

sw/inc/txtftn.hxx

     inline SwNodeIndex *GetStartNode() const { return m_pStartNode; }
 	void SetStartNode( const SwNodeIndex *pNode, BOOL bDelNodes = TRUE );
 	void SetNumber( const USHORT nNumber, const String* = 0 );
-	void CopyFtn( SwTxtFtn *pDest );
+    void CopyFtn( SwTxtFtn *pDest ) const;
 
     // get and set TxtNode pointer
     inline const SwTxtNode& GetTxtNode() const;

sw/inc/txtinet.hxx

 #define _TXTINET_HXX
 
 #include <txatbase.hxx>
+#include <txtatr.hxx>
 #include <calbck.hxx>
 
 class SwTxtNode;
 
 // ATT_INETFMT *********************************************
 
-class SW_DLLPUBLIC SwTxtINetFmt : public SwTxtAttrEnd, public SwClient
+class SW_DLLPUBLIC SwTxtINetFmt : public SwTxtAttrNesting, public SwClient
 {
     SwTxtNode * m_pTxtNode;
     bool m_bVisited         : 1; // visited link?

sw/inc/undobj.hxx

 #include <swundo.hxx>
 
 #include <IMark.hxx>
+#include <IDocumentContentOperations.hxx>
 // --> OD 2006-11-01 #130889#
 #include <vector>
 // <--
 	BOOL bIsWordDelim : 1;
 	BOOL bIsAppend : 1;
 
+    const IDocumentContentOperations::InsertFlags m_nInsertFlags;
+
 	friend class SwDoc;		// eigentlich nur SwDoc::Insert( String )
 	BOOL CanGrouping( sal_Unicode cIns );
 	BOOL CanGrouping( const SwPosition& rPos );
 
 public:
 	SwUndoInsert( const SwNodeIndex& rNode, xub_StrLen nCntnt, xub_StrLen nLen,
+                  const IDocumentContentOperations::InsertFlags nInsertFlags,
 				  BOOL bWDelim = TRUE );
 	SwUndoInsert( const SwNodeIndex& rNode );
 	virtual ~SwUndoInsert();
     ::std::auto_ptr<SwRedlineData> m_pRedlineData;  // Redlining
     ::std::auto_ptr<SwRedlineSaveDatas> m_pRedlineSaveData;
     ULONG m_nNodeIndex;                             // Offset: for Redlining
-    const USHORT m_nInsertFlags;                    // insert flags
+    const SetAttrMode m_nInsertFlags;               // insert flags
 
 	void RemoveIdx( SwDoc& rDoc );
 
 public:
-	SwUndoAttr( const SwPaM&, const SfxItemSet&, USHORT nFlags = 0  );
-	SwUndoAttr( const SwPaM&, const SfxPoolItem&, USHORT nFlags = 0 );
+    SwUndoAttr( const SwPaM&, const SfxItemSet &, const SetAttrMode nFlags );
+    SwUndoAttr( const SwPaM&, const SfxPoolItem&, const SetAttrMode nFlags );
 	virtual ~SwUndoAttr();
 	virtual void Undo( SwUndoIter& );
 	virtual void Redo( SwUndoIter& );

sw/inc/unocoll.hxx

 #define SW_SERVICE_FIELDTYPE_BIBLIOGRAPHY               73
 #define SW_SERVICE_FIELDTYPE_COMBINED_CHARACTERS        74
 #define SW_SERVICE_FIELDTYPE_DROPDOWN                   75
-#define SW_SERVICE_FIELDTYPE_DUMMY_4                    76
-#define SW_SERVICE_FIELDTYPE_DUMMY_5                    77
-#define SW_SERVICE_FIELDTYPE_DUMMY_6                    78
-#define SW_SERVICE_FIELDTYPE_DUMMY_7                    79
-#define SW_SERVICE_FIELDTYPE_DUMMY_8                    80
+#define SW_SERVICE_FIELDTYPE_METAFIELD                  76
+#define SW_SERVICE_FIELDTYPE_DUMMY_4                    77
+#define SW_SERVICE_FIELDTYPE_DUMMY_5                    78
+#define SW_SERVICE_FIELDTYPE_DUMMY_6                    79
+#define SW_SERVICE_FIELDTYPE_DUMMY_7                    80
 #define SW_SERVICE_FIELDMASTER_USER						81
 #define SW_SERVICE_FIELDMASTER_DDE                      82
 #define SW_SERVICE_FIELDMASTER_SET_EXP                  83
 #define SW_SERVICE_CHART2_DATA_PROVIDER                 106
 #define SW_SERVICE_TYPE_FIELDMARK                       107
 #define SW_SERVICE_TYPE_FORMFIELDMARK                   108
+#define SW_SERVICE_TYPE_META                            109
 
-#define SW_SERVICE_LAST                 SW_SERVICE_TYPE_FORMFIELDMARK
+#define SW_SERVICE_LAST                 SW_SERVICE_TYPE_META
 
 #define SW_SERVICE_INVALID			USHRT_MAX
 

sw/inc/unocrsrhelper.hxx

 									com::sun::star::beans::PropertyState& eState);
 
     sal_Bool    DocInsertStringSplitCR(  SwDoc &rDoc,
-                                    const SwPaM &rNewCursor, const String &rText );
+                    const SwPaM &rNewCursor, const String &rText,
+                    const bool bForceExpandHints );
     void    makeRedline( SwPaM& rPaM, const ::rtl::OUString& RedlineType, 
             const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& RedlineProperties ) 
                 throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);

sw/inc/unofield.hxx

 class SwFmtFld;
 class SwField;
 class SwSetExpField;
-class String;
 class SwTextAPIObject;
 
 /* -----------------04.12.98 12:49-------------------
 
 	void Invalidate();
 };
+
+/// @return a SwXTextField, either an already existing one or a new one
+SwXTextField * CreateSwXTextField(SwDoc & rDoc, SwFmtFld const& rFmt);
+
+
 /* -----------------21.12.98 10:26-------------------
  *
  * --------------------------------------------------*/

sw/inc/unomap.hxx

 #define PROPERTY_MAP_RUBY_AUTO_STYLE                    95
 #define PROPERTY_MAP_PARA_AUTO_STYLE                    96
 #define PROPERTY_MAP_FLDTYP_DOCINFO_CUSTOM				97
+#define PROPERTY_MAP_METAFIELD                          98
 
-#define PROPERTY_MAP_END                                98
+#define PROPERTY_MAP_END                                99
 
 //S&E
 #define WID_WORDS				 0

sw/inc/unoobj.hxx

  ************************************************************************/
 #ifndef _UNOOBJ_HXX
 #define _UNOOBJ_HXX
+
 #include <unoevtlstnr.hxx>
 #include <unobaseclass.hxx>
+#include <unocrsr.hxx>
 #include <svtools/itemprop.hxx>
 #include <svtools/svarray.hxx>
 #include <frmfmt.hxx>
 #include <IDocumentMarkAccess.hxx>
 #include <sfx2/Metadatable.hxx>
 
+#include <deque>
+#include <boost/shared_ptr.hpp>
 
-class SwUnoCrsr;
-class SwCursor;
+
 class SwFmtFtn;
 class SwFmtRefMark;
 class GetCurTxtFmtColl;
 
+
+struct FrameDependSortListEntry {
+    xub_StrLen nIndex;
+    sal_uInt32 nOrder;
+    ::boost::shared_ptr<SwDepend> pFrameDepend;
+    FrameDependSortListEntry (xub_StrLen const i_nIndex,
+                sal_uInt32 const i_nOrder, SwDepend * const i_pDepend)
+        : nIndex(i_nIndex), nOrder(i_nOrder), pFrameDepend(i_pDepend) { }
+};
+typedef ::std::deque< FrameDependSortListEntry >
+    FrameDependSortList_t;
+
+typedef ::std::deque< ::boost::shared_ptr<SwDepend> >
+    FrameDependList_t;
+
 /* -----------------29.04.98 07:35-------------------
  *
  * --------------------------------------------------*/
 	CURSOR_REDLINE,
     CURSOR_ALL,          // fuer Search&Replace
     CURSOR_SELECTION,    // create a paragraph enumeration from a text range or cursor
-    CURSOR_SELECTION_IN_TABLE
+    CURSOR_SELECTION_IN_TABLE,
+    CURSOR_META,         // meta/meta-field
 };
 
-/* -----------------29.04.98 07:35-------------------
- *
- * --------------------------------------------------*/
-#define PUNOPAM (_pStartCrsr)
-
-#define FOREACHUNOPAM_START(pCrsr) \
-	{\
-		SwPaM *_pStartCrsr = pCrsr, *__pStartCrsr = _pStartCrsr; \
-		do {
-
-#define FOREACHUNOPAM_END() \
-		} while( (_pStartCrsr=(SwPaM *)_pStartCrsr->GetNext()) != __pStartCrsr ); \
-	}
-
 
 /* -----------------26.06.98 16:18-------------------
  *
  * --------------------------------------------------*/
 
-SV_DECL_PTRARR(SwDependArr, SwDepend*, 2, 2)
-
 SwPageDesc*	GetPageDescByName_Impl(SwDoc& rDoc, const String& rName);
 ::com::sun::star::uno::Sequence< sal_Int8 > CreateUnoTunnelId();
 
 // OD 2004-05-07 #i28701# - adjust 4th parameter
 void CollectFrameAtNode( SwClient& rClnt, const SwNodeIndex& rIdx,
-                         SwDependArr& rFrameArr,
+                         FrameDependSortList_t & rFrames,
                          const bool _bAtCharAnchoredObjs );
 
 /* -----------------29.04.98 07:35-------------------
                 const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > & CharacterAndParagraphProperties ) 
                 throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
 
-protected:
-	virtual const SwStartNode *GetStartNode() const;
+    virtual void PrepareForAttach( ::com::sun::star::uno::Reference<
+                ::com::sun::star::text::XTextRange > & xRange,
+            const SwXTextRange* const pRange, const SwPaM * const pPam);
+
+public: /*not protected because C++ is retarded*/
+    virtual const SwStartNode *GetStartNode() const;
+
 public:
                 SwXText(SwDoc* pDc, CursorType eType);
 	virtual 	~SwXText();
     virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor >         createCursor()throw(::com::sun::star::uno::RuntimeException);
     INT16   ComparePositions(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange>& xPos1, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange>& xPos2) throw (com::sun::star::lang::IllegalArgumentException, com::sun::star::uno::RuntimeException);
 	BOOL	CheckForOwnMember(const SwXTextRange* pRange1, const OTextCursorHelper* pCursor1)throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+    virtual bool CheckForOwnMemberMeta(const SwXTextRange* const pRange,
+            const SwPaM* const pPam, bool bAbsorb)
+        throw (::com::sun::star::lang::IllegalArgumentException,
+               ::com::sun::star::uno::RuntimeException);
 	//
 	void			Invalidate() {bObjectValid = sal_False;}
 	BOOL 			IsValid()const {return bObjectValid;}
     bool mbRemoveUserEvent;
     // <--
 
-	void 	DeleteAndInsert(const String& rText);
-
     DECL_STATIC_LINK( SwXTextCursor, RemoveCursor_Impl,
                       ::com::sun::star::uno::Reference<
                       ::com::sun::star::uno::XInterface>* );
 protected:
 	virtual ~SwXTextCursor();
 public:
+    void    DeleteAndInsert(const String& rText, const bool bForceExpandHints);
 	SwXTextCursor(::com::sun::star::uno::Reference< ::com::sun::star::text::XText >  xParent, const SwPosition& rPos,
 					CursorType eSet, SwDoc* pDoc, const SwPosition* pMark = 0);
 	SwXTextCursor(::com::sun::star::uno::Reference< ::com::sun::star::text::XText >  xParent, SwUnoCrsr* pSourceCrsr, CursorType eSet = CURSOR_ALL);
     // --> FME 2006-03-07 #126177#
     void DoNotRemoveUserEvent() { mbRemoveUserEvent = false; }
     // <--
+
+    bool IsAtEndOfMeta() const;
 };
 /*-----------------20.03.98 07:47-------------------
 
 };
 */
 
-typedef cppu::WeakImplHelper5
+typedef ::cppu::ImplInheritanceHelper5
 <
+    ::sfx2::MetadatableMixin,
 	::com::sun::star::text::XTextContent,
 	::com::sun::star::beans::XPropertySet,
 	::com::sun::star::lang::XServiceInfo,
 	::com::sun::star::container::XNamed,
 	::com::sun::star::lang::XUnoTunnel
 >
-SwRefMarkBaseClass;
+SwBookmarkBaseClass;
 
 class SwXBookmark
-    : public SwRefMarkBaseClass
+    : public SwBookmarkBaseClass
     , private SwClient
 {
     private:
         //SwClient
         virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew );
 
+        // MetadatableMixin
+        virtual ::sfx2::Metadatable* GetCoreObject();
+        virtual ::com::sun::star::uno::Reference<
+            ::com::sun::star::frame::XModel > GetModel();
+
         const ::sw::mark::IMark* GetBookmark() const
             { return m_pRegisteredBookmark; }
+              ::sw::mark::IMark* GetBookmark()
+            { return m_pRegisteredBookmark; }
         SwDoc* GetDoc()
             { return m_pDoc; }
 };
 
     void    _CreateNewBookmark(SwPaM& rPam);
     //TODO: new exception type for protected content
-    void    DeleteAndInsert(const String& rText) throw( ::com::sun::star::uno::RuntimeException );
+    void    DeleteAndInsert(const String& rText, const bool bForceExpandHints)
+        throw( ::com::sun::star::uno::RuntimeException );
 protected:
     virtual ~SwXTextRange();
 
 >,
 	public SwClient
 {
-	::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent >  xNextObject;	//hasMoreElements legt das Objekt schon an
-	SwDependArr		aFrameArr;		//wird im Ctor gefuellt
+    ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent >
+        m_xNextObject;    // created by hasMoreElements
+    FrameDependList_t m_Frames;
 
-	SwUnoCrsr*		GetCrsr(){return (SwUnoCrsr*)GetRegisteredIn();}
-	BOOL			CreateNextObject();
-	void 			FillFrame(SwUnoCrsr& rUnoCrsr);
+    SwUnoCrsr*          GetCursor() const
+    {return static_cast<SwUnoCrsr*>(const_cast<SwModify*>(GetRegisteredIn()));}
 
 public:
     SwXParaFrameEnumeration(const SwPaM& rPaM,
         sal_uInt8 nParaFrameMode, SwFrmFmt* pFmt = 0);
     ~SwXParaFrameEnumeration();
 
-	//XEnumeration
-	virtual BOOL SAL_CALL hasMoreElements(void) throw( ::com::sun::star::uno::RuntimeException );
-	virtual ::com::sun::star::uno::Any SAL_CALL nextElement(void) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException );
+    // XEnumeration
+    virtual sal_Bool SAL_CALL hasMoreElements()
+        throw( ::com::sun::star::uno::RuntimeException );
+    virtual ::com::sun::star::uno::Any SAL_CALL nextElement()
+        throw( ::com::sun::star::container::NoSuchElementException,
+               ::com::sun::star::lang::WrappedTargetException,
+               ::com::sun::star::uno::RuntimeException );
 
-	//XServiceInfo
-	virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
-	virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
-	virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
+    // XServiceInfo
+    virtual rtl::OUString SAL_CALL getImplementationName()
+        throw( ::com::sun::star::uno::RuntimeException );
+    virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName)
+        throw( ::com::sun::star::uno::RuntimeException );
+    virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL
+        getSupportedServiceNames()
+        throw( ::com::sun::star::uno::RuntimeException );
 
 	//SwClient
 	virtual void 	Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
 };
-/* -----------------29.05.98 14:42-------------------
- *
- * --------------------------------------------------*/
 
-class SwXTextPortionEnumeration : public cppu::WeakImplHelper3
-<
-	::com::sun::star::container::XEnumeration,
-	::com::sun::star::lang::XServiceInfo,
-	::com::sun::star::lang::XUnoTunnel
->,
-	public SwClient
-{
-	XTextRangeArr		aPortionArr;	//all portions are created in the ctor
-	SwDependArr			aFrameArr;		//wird im Ctor gefuellt - mit am Zeichen gebundenen Rahmen
-	::com::sun::star::uno::Reference< ::com::sun::star::text::XText >  			xParent;
-	BOOL 				bAtEnd;
-	BOOL				bFirstPortion;
-
-    const sal_Int32     nStartPos;
-    const sal_Int32     nEndPos;
-
-    SwUnoCrsr*          GetCrsr() const { return (SwUnoCrsr*)GetRegisteredIn(); }
-	SwXTextPortionEnumeration();
-	void				CreatePortions();
-protected:
-	virtual ~SwXTextPortionEnumeration();
-public:
-	SwXTextPortionEnumeration(SwPaM& rParaCrsr,
-            ::com::sun::star::uno::Reference< ::com::sun::star::text::XText >  xParent,
-            sal_Int32 nStart, sal_Int32 nEnd );
-
-
-	static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId();
-
-	//XUnoTunnel
-	virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
-
-	//XEnumeration
-	virtual BOOL SAL_CALL hasMoreElements(void) throw( ::com::sun::star::uno::RuntimeException );
-	virtual ::com::sun::star::uno::Any SAL_CALL nextElement(void) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException );
-
-	//XServiceInfo
-	virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
-	virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
-	virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
-
-	//SwClient
-	virtual void 		Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
-};
 
 /* -----------------29.09.98 09:01-------------------
  *
 /* -----------------27.08.98 15:11-------------------
  *
  * --------------------------------------------------*/
+typedef ::cppu::WeakImplHelper5
+<
+	::com::sun::star::text::XTextContent,
+	::com::sun::star::beans::XPropertySet,
+	::com::sun::star::lang::XServiceInfo,
+	::com::sun::star::container::XNamed,
+	::com::sun::star::lang::XUnoTunnel
+>
+SwRefMarkBaseClass;
+
 class SwXReferenceMark : public SwRefMarkBaseClass,
 	public SwClient
 {
 	BOOL				   		m_bIsDescriptor;
 
 	BOOL	IsValid() const {return 0 != GetRegisteredIn();}
-	void 	InsertRefMark( SwPaM& rPam );
+    void    InsertRefMark( SwPaM& rPam, SwXTextCursor * pCursor );
 public:
 	SwXReferenceMark(SwDoc* pDoc, const SwFmtRefMark* pMark);
 	~SwXReferenceMark();

sw/inc/unoport.hxx

  ************************************************************************/
 #ifndef _UNOPORT_HXX
 #define _UNOPORT_HXX
+
+#include <unocrsr.hxx>
 #include <unoevtlstnr.hxx>
 #include <calbck.hxx>
-#include <cppuhelper/implbase6.hxx>
+
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/text/XTextRange.hpp>
+#include <com/sun/star/container/XEnumeration.hpp>
 #include <com/sun/star/container/XContentEnumerationAccess.hpp>
 #include <com/sun/star/container/XEnumerationAccess.hpp>
 #include <com/sun/star/beans/XPropertyState.hpp>