[Libreoffice-commits] core.git: 3 commits - idl/inc idl/source mergeclasses.results sw/inc sw/source

Noel Grandin noel at peralex.com
Tue Sep 8 02:36:31 PDT 2015


 idl/inc/basobj.hxx                                      |   78 +++-----
 idl/inc/bastype.hxx                                     |   37 +---
 idl/inc/database.hxx                                    |    6 
 idl/inc/types.hxx                                       |    8 
 idl/source/objects/basobj.cxx                           |   30 +--
 idl/source/objects/bastype.cxx                          |    4 
 idl/source/objects/module.cxx                           |    2 
 idl/source/objects/object.cxx                           |    4 
 idl/source/objects/slot.cxx                             |    4 
 idl/source/objects/types.cxx                            |    8 
 idl/source/prj/database.cxx                             |    2 
 mergeclasses.results                                    |    2 
 sw/inc/ndhints.hxx                                      |  142 +++++-----------
 sw/source/core/access/acchyperlink.cxx                  |    2 
 sw/source/core/access/accpara.cxx                       |    4 
 sw/source/core/crsr/callnk.cxx                          |    2 
 sw/source/core/crsr/crstrvl.cxx                         |    2 
 sw/source/core/crsr/findattr.cxx                        |   16 -
 sw/source/core/crsr/findtxt.cxx                         |   22 +-
 sw/source/core/doc/DocumentContentOperationsManager.cxx |    4 
 sw/source/core/doc/DocumentFieldsManager.cxx            |    2 
 sw/source/core/doc/dbgoutsw.cxx                         |    2 
 sw/source/core/doc/docruby.cxx                          |    2 
 sw/source/core/doc/doctxm.cxx                           |    6 
 sw/source/core/docnode/nodes.cxx                        |    4 
 sw/source/core/edit/acorrect.cxx                        |    2 
 sw/source/core/edit/edattr.cxx                          |    2 
 sw/source/core/frmedt/fefly1.cxx                        |    2 
 sw/source/core/table/swtable.cxx                        |    2 
 sw/source/core/text/frmform.cxx                         |    4 
 sw/source/core/text/itratr.cxx                          |   24 +-
 sw/source/core/text/itrpaint.cxx                        |    4 
 sw/source/core/text/itrtxt.cxx                          |    2 
 sw/source/core/text/porfly.cxx                          |    2 
 sw/source/core/text/porlay.cxx                          |    4 
 sw/source/core/text/pormulti.cxx                        |   12 -
 sw/source/core/text/txtfld.cxx                          |    6 
 sw/source/core/text/txtfrm.cxx                          |    4 
 sw/source/core/text/txtftn.cxx                          |    4 
 sw/source/core/tox/ToxTextGenerator.cxx                 |    2 
 sw/source/core/txtnode/modeltoviewhelper.cxx            |    2 
 sw/source/core/txtnode/ndhints.cxx                      |   67 +++----
 sw/source/core/txtnode/ndtxt.cxx                        |   44 ++--
 sw/source/core/txtnode/thints.cxx                       |   69 ++++---
 sw/source/core/txtnode/txatritr.cxx                     |    2 
 sw/source/core/txtnode/txtedt.cxx                       |    6 
 sw/source/core/undo/rolbck.cxx                          |    2 
 sw/source/core/unocore/unocrsrhelper.cxx                |    4 
 sw/source/core/unocore/unoportenum.cxx                  |   26 +-
 sw/source/filter/ascii/ascatr.cxx                       |    4 
 sw/source/filter/html/htmlatr.cxx                       |    6 
 sw/source/filter/html/swhtml.cxx                        |    4 
 sw/source/filter/html/wrthtml.cxx                       |    2 
 sw/source/filter/ww8/wrtw8nds.cxx                       |   16 -
 sw/source/filter/ww8/ww8par.cxx                         |    2 
 55 files changed, 321 insertions(+), 406 deletions(-)

New commits:
commit d4c6a3883a38187effdd7414a0a07a9a2d3d026d
Author: Noel Grandin <noel at peralex.com>
Date:   Fri Aug 28 11:53:11 2015 +0200

    loplugin:mergeclasses merge SvMetaObject with SvMetaName
    
    Change-Id: I8c65ad9a5e2141b6fdf578e1361f8685d2f8517e

diff --git a/idl/inc/basobj.hxx b/idl/inc/basobj.hxx
index 89ca0a6..71dc136 100644
--- a/idl/inc/basobj.hxx
+++ b/idl/inc/basobj.hxx
@@ -32,8 +32,23 @@ typedef SvMetaObject * (*CreateMetaObjectType)();
 
 #define C_PREF  "C_"
 
+class SvMetaObjectMemberList : public SvRefMemberList<SvMetaObject *> {};
+
 class SvMetaObject : public SvRttiBase
 {
+protected:
+    SvString      aName;
+    SvHelpContext aHelpContext;
+    SvHelpText    aHelpText;
+    SvString      aConfigName;
+    SvString      aDescription;
+
+    bool ReadNameSvIdl( SvIdlDataBase &, SvTokenStream & rInStm );
+            void DoReadContextSvIdl( SvIdlDataBase &, SvTokenStream & rInStm,
+                                     char c = '\0' );
+    virtual void ReadContextSvIdl( SvIdlDataBase &, SvTokenStream & rInStm );
+    virtual void ReadAttributesSvIdl( SvIdlDataBase & rBase,
+                                      SvTokenStream & rInStm );
 public:
             TYPEINFO_OVERRIDE();
             SvMetaObject();
@@ -42,14 +57,17 @@ public:
     static void         Back2Delemitter( SvStream & );
     static void         WriteStars( SvStream & );
 
-    virtual bool        ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm );
+    virtual bool                SetName( const OString& rName, SvIdlDataBase * = NULL  );
+    const SvHelpContext&        GetHelpContext() const { return aHelpContext; }
+    virtual const SvString &    GetName() const { return aName; }
+    virtual const SvString &    GetHelpText() const { return aHelpText; }
+    virtual const SvString &    GetConfigName() const{ return aConfigName; }
+    virtual const SvString&     GetDescription() const{ return aDescription; }
 
-protected:
-    virtual ~SvMetaObject() {}
+    virtual bool        Test( SvIdlDataBase &, SvTokenStream & rInStm );
+    virtual bool        ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm );
 };
 
-class SvMetaObjectMemberList : public SvRefMemberList<SvMetaObject *> {};
-
 class SvMetaObjectMemberStack
 {
     SvMetaObjectMemberList aList;
@@ -68,39 +86,9 @@ public:
                     }
 };
 
-class SvMetaName : public SvMetaObject
-{
-    SvString      aName;
-    SvHelpContext aHelpContext;
-    SvHelpText    aHelpText;
-    SvString      aConfigName;
-    SvString      aDescription;
-
-protected:
-    bool ReadNameSvIdl( SvIdlDataBase &, SvTokenStream & rInStm );
-            void DoReadContextSvIdl( SvIdlDataBase &, SvTokenStream & rInStm,
-                                     char c = '\0' );
-    virtual void ReadContextSvIdl( SvIdlDataBase &, SvTokenStream & rInStm );
-    virtual void ReadAttributesSvIdl( SvIdlDataBase & rBase,
-                                      SvTokenStream & rInStm );
-public:
-            TYPEINFO_OVERRIDE();
-            SvMetaName();
-
-    virtual bool                SetName( const OString& rName, SvIdlDataBase * = NULL  );
-    const SvHelpContext&        GetHelpContext() const { return aHelpContext; }
-    virtual const SvString &    GetName() const { return aName; }
-    virtual const SvString &    GetHelpText() const { return aHelpText; }
-    virtual const SvString &    GetConfigName() const{ return aConfigName; }
-    virtual const SvString&     GetDescription() const{ return aDescription; }
-
-    virtual bool        Test( SvIdlDataBase &, SvTokenStream & rInStm );
-    virtual bool        ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ) SAL_OVERRIDE;
-};
-
-class SvMetaNameMemberList : public SvRefMemberList<SvMetaName *> {};
+class SvMetaNameMemberList : public SvRefMemberList<SvMetaObject *> {};
 
-class SvMetaReference : public SvMetaName
+class SvMetaReference : public SvMetaObject
 {
 protected:
     tools::SvRef<SvMetaReference>  aRef;
@@ -111,32 +99,32 @@ public:
     const SvString &    GetName() const SAL_OVERRIDE
                         {
                             return ( !aRef.Is()
-                                    || !SvMetaName::GetName().getString().isEmpty() )
-                                ? SvMetaName::GetName()
+                                    || !SvMetaObject::GetName().getString().isEmpty() )
+                                ? SvMetaObject::GetName()
                                 : aRef->GetName();
                         }
 
     const SvString &    GetHelpText() const SAL_OVERRIDE
                         {
                             return ( !aRef.Is()
-                                    || !SvMetaName::GetHelpText().getString().isEmpty() )
-                                ? SvMetaName::GetHelpText()
+                                    || !SvMetaObject::GetHelpText().getString().isEmpty() )
+                                ? SvMetaObject::GetHelpText()
                                 : aRef->GetHelpText();
                         }
 
     const SvString &    GetConfigName() const SAL_OVERRIDE
                         {
                             return ( !aRef.Is()
-                                    || !SvMetaName::GetConfigName().getString().isEmpty() )
-                                ? SvMetaName::GetConfigName()
+                                    || !SvMetaObject::GetConfigName().getString().isEmpty() )
+                                ? SvMetaObject::GetConfigName()
                                 : aRef->GetConfigName();
                         }
 
     const SvString &    GetDescription() const SAL_OVERRIDE
                         {
                             return ( !aRef.Is()
-                                    || !SvMetaName::GetDescription().getString().isEmpty() )
-                                ? SvMetaName::GetDescription()
+                                    || !SvMetaObject::GetDescription().getString().isEmpty() )
+                                ? SvMetaObject::GetDescription()
                                 : aRef->GetDescription();
                         }
     SvMetaReference *   GetRef() const { return aRef; }
diff --git a/idl/inc/types.hxx b/idl/inc/types.hxx
index 90f358c9..f1cbcde 100644
--- a/idl/inc/types.hxx
+++ b/idl/inc/types.hxx
@@ -182,7 +182,7 @@ public:
 
 class SvMetaTypeStringMemberList : public SvRefMemberList<SvMetaTypeString *> {};
 
-class SvMetaEnumValue : public SvMetaName
+class SvMetaEnumValue : public SvMetaObject
 {
 public:
     TYPEINFO_OVERRIDE();
diff --git a/idl/source/objects/basobj.cxx b/idl/source/objects/basobj.cxx
index bde7d8a..59a832e 100644
--- a/idl/source/objects/basobj.cxx
+++ b/idl/source/objects/basobj.cxx
@@ -28,11 +28,6 @@
 #include <globals.hxx>
 #include <database.hxx>
 
-TYPEINIT1( SvMetaObject, SvRttiBase )
-SvMetaObject::SvMetaObject()
-{
-}
-
 void SvMetaObject::WriteTab( SvStream & rOutStm, sal_uInt16 nTab )
 {
     while( nTab-- )
@@ -67,23 +62,18 @@ void SvMetaObject::Back2Delemitter( SvStream & rOutStm )
         rOutStm.Seek( nPos );
 }
 
-bool SvMetaObject::ReadSvIdl( SvIdlDataBase &, SvTokenStream & )
-{
-    return false;
-}
-
-TYPEINIT1( SvMetaName, SvMetaObject );
-SvMetaName::SvMetaName()
+TYPEINIT1( SvMetaObject, SvRttiBase );
+SvMetaObject::SvMetaObject()
 {
 }
 
-bool SvMetaName::SetName( const OString& rName, SvIdlDataBase * )
+bool SvMetaObject::SetName( const OString& rName, SvIdlDataBase * )
 {
     aName.setString(rName);
     return true;
 }
 
-bool SvMetaName::ReadNameSvIdl( SvIdlDataBase & rBase,
+bool SvMetaObject::ReadNameSvIdl( SvIdlDataBase & rBase,
                                 SvTokenStream & rInStm )
 {
     sal_uInt32 nTokPos = rInStm.Tell();
@@ -98,7 +88,7 @@ bool SvMetaName::ReadNameSvIdl( SvIdlDataBase & rBase,
     return false;
 }
 
-void SvMetaName::ReadAttributesSvIdl( SvIdlDataBase & rBase,
+void SvMetaObject::ReadAttributesSvIdl( SvIdlDataBase & rBase,
                                       SvTokenStream & rInStm )
 {
     sal_uInt32 nTokPos = rInStm.Tell();
@@ -114,7 +104,7 @@ void SvMetaName::ReadAttributesSvIdl( SvIdlDataBase & rBase,
     aDescription.ReadSvIdl( SvHash_Description(), rInStm );
 }
 
-void SvMetaName::DoReadContextSvIdl( SvIdlDataBase & rBase,
+void SvMetaObject::DoReadContextSvIdl( SvIdlDataBase & rBase,
                                    SvTokenStream & rInStm, char cDel )
 {
     sal_uInt32 nBeginPos = 0; // can not happen with Tell
@@ -129,16 +119,16 @@ void SvMetaName::DoReadContextSvIdl( SvIdlDataBase & rBase,
     }
 }
 
-void SvMetaName::ReadContextSvIdl( SvIdlDataBase &, SvTokenStream & )
+void SvMetaObject::ReadContextSvIdl( SvIdlDataBase &, SvTokenStream & )
 {
 }
 
-bool SvMetaName::Test( SvIdlDataBase &, SvTokenStream & )
+bool SvMetaObject::Test( SvIdlDataBase &, SvTokenStream & )
 {
     return true;
 }
 
-bool SvMetaName::ReadSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm )
+bool SvMetaObject::ReadSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm )
 {
     sal_uInt32 nTokPos = rInStm.Tell();
     bool bOk = true;
@@ -168,7 +158,7 @@ bool SvMetaName::ReadSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm )
     return bOk;
 }
 
-TYPEINIT1( SvMetaReference, SvMetaName );
+TYPEINIT1( SvMetaReference, SvMetaObject );
 
 SvMetaReference::SvMetaReference()
 {
diff --git a/idl/source/objects/module.cxx b/idl/source/objects/module.cxx
index c6e2944..f78390e 100644
--- a/idl/source/objects/module.cxx
+++ b/idl/source/objects/module.cxx
@@ -225,7 +225,7 @@ bool SvMetaModule::ReadSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm )
         {
             // set pointer to itself
             SetModule( rBase );
-            bOk = SvMetaName::ReadSvIdl( rBase, rInStm );
+            bOk = SvMetaObject::ReadSvIdl( rBase, rInStm );
         }
         rBase.GetStack().Pop(); // remove from stack
     }
diff --git a/idl/source/objects/object.cxx b/idl/source/objects/object.cxx
index 3898504..3310770 100644
--- a/idl/source/objects/object.cxx
+++ b/idl/source/objects/object.cxx
@@ -164,7 +164,7 @@ bool SvMetaClass::ReadSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm )
         if( bOk )
         {
             rBase.Write(OString('.'));
-            bOk = SvMetaName::ReadSvIdl( rBase, rInStm );
+            bOk = SvMetaObject::ReadSvIdl( rBase, rInStm );
         }
         if( bOk )
             return bOk;
diff --git a/idl/source/objects/slot.cxx b/idl/source/objects/slot.cxx
index 00054c2..2b1c172 100644
--- a/idl/source/objects/slot.cxx
+++ b/idl/source/objects/slot.cxx
@@ -433,7 +433,7 @@ bool SvMetaSlot::ReadSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm )
         {
             SetRef( pKnownSlot );
             SetName( pKnownSlot->GetName().getString(), &rBase );
-            bOk = SvMetaName::ReadSvIdl( rBase, rInStm );
+            bOk = SvMetaObject::ReadSvIdl( rBase, rInStm );
         }
         else
         {
diff --git a/idl/source/objects/types.cxx b/idl/source/objects/types.cxx
index 49549c1..cd4c262 100644
--- a/idl/source/objects/types.cxx
+++ b/idl/source/objects/types.cxx
@@ -160,7 +160,7 @@ bool SvMetaAttribute::ReadSvIdl( SvIdlDataBase & rBase,
             bOk = aType->ReadMethodArgs( rBase, rInStm );
         }
         if( bOk )
-            bOk = SvMetaName::ReadSvIdl( rBase, rInStm );
+            bOk = SvMetaObject::ReadSvIdl( rBase, rInStm );
     }
     else
     {
@@ -664,7 +664,7 @@ SvMetaTypeString::SvMetaTypeString()
 {
 }
 
-TYPEINIT1( SvMetaEnumValue, SvMetaName );
+TYPEINIT1( SvMetaEnumValue, SvMetaObject );
 SvMetaEnumValue::SvMetaEnumValue()
 {
 }
@@ -730,7 +730,7 @@ bool SvMetaTypeEnum::ReadSvIdl( SvIdlDataBase & rBase,
     if( SvMetaType::ReadHeaderSvIdl( rBase, rInStm )
       && GetType() == TYPE_ENUM )
     {
-        if( SvMetaName::ReadSvIdl( rBase, rInStm ) )
+        if( SvMetaObject::ReadSvIdl( rBase, rInStm ) )
              return true;
     }
     rInStm.Seek( nTokPos );
diff --git a/mergeclasses.results b/mergeclasses.results
index e3d7c67..40dfe8f 100644
--- a/mergeclasses.results
+++ b/mergeclasses.results
@@ -80,7 +80,6 @@ merge SfxUndoListener with framework::UndoManagerHelper_Impl
 merge StarSymbolToMSMultiFont with StarSymbolToMSMultiFontImpl
 merge StgReader with WW8Reader
 merge SvListView with SvTreeListBox
-merge SvMetaObject with SvMetaName
 merge SvxNodeIdx with EditNodeIdx
 merge SvxPosition with EditPosition
 merge SvxShapeMaster with SdXShape
commit 42b0440d55a522806cbb36ea448b61749188ae6b
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Aug 27 16:38:21 2015 +0200

    loplugin:mergeclasses merge SwpHintsArray with SwpHints
    
    and clean up the API a little, there were multiple versions
    of the same accessor with different names.
    
    Change-Id: I01e44a7a81c0d67cbb6135a6d196ee106cbf994a

diff --git a/mergeclasses.results b/mergeclasses.results
index 572d9a4..e3d7c67 100644
--- a/mergeclasses.results
+++ b/mergeclasses.results
@@ -88,7 +88,6 @@ merge SvxUnoDrawMSFactory with SvxFmMSFactory
 merge SwXParaFrameEnumeration with SwXParaFrameEnumerationImpl
 merge SwXParagraphEnumeration with SwXParagraphEnumerationImpl
 merge SwXTextRanges with SwXTextRangesImpl
-merge SwpHintsArray with SwpHints
 merge UniqueIndexImpl with UniqueIndex
 merge UpdateCheckConfigListener with UpdateCheck
 merge ValueGetter with CellValueGetter
diff --git a/sw/inc/ndhints.hxx b/sw/inc/ndhints.hxx
index 44c853b..2d15a12 100644
--- a/sw/inc/ndhints.hxx
+++ b/sw/inc/ndhints.hxx
@@ -58,15 +58,8 @@ SwTextAttr* MakeRedlineTextAttr(
     SwDoc & rDoc,
     SfxPoolItem& rAttr );
 
-/** Class SwpHints is derived indirectly via SwpHts, because only the
-   class SwTextNode should be allowed to insert and remove attributes.
-   Other classes like the Frames are given only reading access via
-   the index-operator.
-   Size when created is 1 because an array is created only if
-   also a hint is inserted. */
-
- /// Class SwpHtStart/End
 
+/// SwTextAttr's, sorted by start
 struct CompareSwpHtStart
 {
     bool operator()(SwTextAttr* const lhs, SwTextAttr* const rhs) const;
@@ -74,6 +67,7 @@ struct CompareSwpHtStart
 class SwpHtStart : public o3tl::sorted_vector<SwTextAttr*, CompareSwpHtStart,
     o3tl::find_partialorder_ptrequals> {};
 
+/// SwTextAttr's, sorted by end
 struct CompareSwpHtEnd
 {
     bool operator()(SwTextAttr* const lhs, SwTextAttr* const rhs) const;
@@ -81,97 +75,28 @@ struct CompareSwpHtEnd
 class SwpHtEnd : public o3tl::sorted_vector<SwTextAttr*, CompareSwpHtEnd,
     o3tl::find_partialorder_ptrequals> {};
 
-/// Class SwpHintsArr
-
-/// the Hints array
-class SwpHintsArray
-{
 
-protected:
-    SwpHtStart m_HintStarts;
-    SwpHtEnd   m_HintEnds;
 
+class SwpHints
+{
+private:
     // SAL_MAX_SIZE is used by GetStartOf to return
     // failure, so just allow SAL_MAX_SIZE-1 hints
     static const size_t MAX_HINTS = SAL_MAX_SIZE-1;
 
-    //FIXME: why are the non-const methods public?
-public:
-    void Insert( const SwTextAttr *pHt );
-    void DeleteAtPos( const size_t nPosInStart );
-    void Resort();
-    SwTextAttr * Cut( const size_t nPosInStart )
-    {
-        SwTextAttr *pHt = GetTextHint(nPosInStart);
-        DeleteAtPos( nPosInStart );
-        return pHt;
-    }
-    const SwTextAttr * GetStart( const size_t nPos ) const
-    {
-        assert(nPos < m_HintStarts.size());
-        return m_HintStarts[nPos];
-    }
-    const SwTextAttr * GetEnd( const size_t nPos ) const
-    {
-        assert(nPos < m_HintEnds.size());
-        return m_HintEnds[nPos];
-    }
-    SwTextAttr * GetStart( const size_t nPos )
-    {
-        assert(nPos < m_HintStarts.size());
-        return m_HintStarts[nPos];
-    }
-    SwTextAttr * GetEnd( const size_t nPos )
-    {
-        assert(nPos < m_HintEnds.size());
-        return m_HintEnds[nPos];
-    }
-
-    size_t GetEndCount()   const { return m_HintEnds.size(); }
-    size_t GetStartCount() const { return m_HintStarts.size(); }
-
-    size_t GetStartOf( const SwTextAttr *pHt ) const
-    {
-        SwpHtStart::const_iterator const it =
-            m_HintStarts.find(const_cast<SwTextAttr*>(pHt));
-        if ( it == m_HintStarts.end() )
-        {
-            return SAL_MAX_SIZE;
-        }
-        return it - m_HintStarts.begin();
-    }
+    SwpHtStart    m_HintsByStart;
+    SwpHtEnd      m_HintsByEnd;
 
-    bool Contains( const SwTextAttr *pHt ) const;
-
-    const SwTextAttr * GetTextHint( const size_t nIdx ) const
-        { return GetStart(nIdx); }
-    SwTextAttr * GetTextHint( const size_t nIdx )
-        { return GetStart(nIdx); }
-    const SwTextAttr * operator[]( const size_t nIdx ) const
-        { return GetStart(nIdx); }
-    size_t Count() const { return GetStartCount(); }
+    SwRegHistory* m_pHistory;                   ///< for Undo
 
-#ifdef DBG_UTIL
-    bool Check(bool) const;
-#endif
-};
-
-// Class SwpHints
-
-/// public interface
-class SwpHints : public SwpHintsArray
-{
-private:
-    SwRegHistory* m_pHistory;          ///< for Undo
-
-    bool m_bFontChange          : 1;   ///< font change
+    bool          m_bFontChange          : 1;   ///< font change
     /// true: the Node is in Split and Frames are moved
-    bool m_bInSplitNode         : 1;
+    bool          m_bInSplitNode         : 1;
     /// m_bHasHiddenParaField is invalid, call CalcHiddenParaField()
-    bool m_bCalcHiddenParaField : 1;
-    bool m_bHasHiddenParaField  : 1;   ///< HiddenParaField
-    bool m_bFootnote            : 1;   ///< footnotes
-    bool m_bDDEFields           : 1;   ///< the TextNode has DDE fields
+    bool          m_bCalcHiddenParaField : 1;
+    bool          m_bHasHiddenParaField  : 1;   ///< HiddenParaField
+    bool          m_bFootnote            : 1;   ///< footnotes
+    bool          m_bDDEFields           : 1;   ///< the TextNode has DDE fields
 
     /// records a new attibute in m_pHistory.
     void NoteInHistory( SwTextAttr *pAttr, const bool bNew = false );
@@ -182,7 +107,7 @@ private:
        Because the TextNode also guarantees removal of the Character for
        attributes without an end. */
     friend class SwTextNode;
-    void DeleteAtPos( const size_t nPos );
+    void DeleteAtPos( size_t nPos );
     /// Delete the given Hint. The Hint must actually be in the array!
     void Delete( SwTextAttr* pTextHt );
 
@@ -204,10 +129,45 @@ private:
             const SetAttrMode nMode );
     bool MergePortions( SwTextNode& rNode );
 
+    void Insert( const SwTextAttr *pHt );
+    void Resort();
+
+    size_t GetIndexOf( const SwTextAttr *pHt ) const
+    {
+        SwpHtStart::const_iterator const it =
+            m_HintsByStart.find(const_cast<SwTextAttr*>(pHt));
+        if ( it == m_HintsByStart.end() )
+        {
+            return SAL_MAX_SIZE;
+        }
+        return it - m_HintsByStart.begin();
+    }
+
+#ifdef DBG_UTIL
+    bool Check(bool) const;
+#endif
+
 public:
     SwpHints();
 
-    bool CanBeDeleted() const    { return !Count(); }
+    size_t Count() const { return m_HintsByStart.size(); }
+    bool Contains( const SwTextAttr *pHt ) const;
+    SwTextAttr * Get( size_t nPos ) const
+    {
+        return m_HintsByStart[nPos];
+    }
+    SwTextAttr * GetSortedByEnd( size_t nPos ) const
+    {
+        return m_HintsByEnd[nPos];
+    }
+    SwTextAttr * Cut( const size_t nPosInStart )
+    {
+        SwTextAttr *pHt = m_HintsByStart[nPosInStart];
+        DeleteAtPos( nPosInStart );
+        return pHt;
+    }
+
+    bool CanBeDeleted() const    { return m_HintsByStart.empty(); }
 
     /// register a History, which receives all attribute changes (for Undo)
     void Register( SwRegHistory* pHist ) { m_pHistory = pHist; }
diff --git a/sw/source/core/access/acchyperlink.cxx b/sw/source/core/access/acchyperlink.cxx
index 7b9e25b..cd14308 100644
--- a/sw/source/core/access/acchyperlink.cxx
+++ b/sw/source/core/access/acchyperlink.cxx
@@ -53,7 +53,7 @@ const SwTextAttr *SwAccessibleHyperlink::GetTextAttr() const
         const SwpHints *pHints = pTextNd->GetpSwpHints();
         if( pHints && nHintPos < pHints->Count() )
         {
-            const SwTextAttr *pHt = (*pHints)[nHintPos];
+            const SwTextAttr *pHt = pHints->Get(nHintPos);
             if( RES_TXTATR_INETFMT == pHt->Which() )
                 pTextAttr = pHt;
         }
diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx
index 950611ce..b96dcdf 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -1445,7 +1445,7 @@ OUString SwAccessibleParagraph::GetFieldTypeNameAtIndex(sal_Int32 nIndex)
             const size_t nSize = pSwpHints->Count();
             for( size_t i = 0; i < nSize; ++i )
             {
-                const SwTextAttr* pHt = (*pSwpHints)[i];
+                const SwTextAttr* pHt = pSwpHints->Get(i);
                 if ( ( pHt->Which() == RES_TXTATR_FIELD
                        || pHt->Which() == RES_TXTATR_ANNOTATION
                        || pHt->Which() == RES_TXTATR_INPUTFIELD )
@@ -3113,7 +3113,7 @@ const SwTextAttr *SwHyperlinkIter_Impl::next()
     {
         while( !pAttr && nPos < pHints->Count() )
         {
-            const SwTextAttr *pHt = (*pHints)[nPos];
+            const SwTextAttr *pHt = pHints->Get(nPos);
             if( RES_TXTATR_INETFMT == pHt->Which() )
             {
                 const sal_Int32 nHtStt = pHt->GetStart();
diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx
index 1db2c60..9daa0fe 100644
--- a/sw/source/core/crsr/callnk.cxx
+++ b/sw/source/core/crsr/callnk.cxx
@@ -165,7 +165,7 @@ SwCallLink::~SwCallLink()
 
                 for( size_t n = 0; n < rHts.Count(); ++n )
                 {
-                    const SwTextAttr* pHt = rHts[ n ];
+                    const SwTextAttr* pHt = rHts.Get( n );
                     const sal_Int32 *pEnd = pHt->End();
                     const sal_Int32 nStart = pHt->GetStart();
 
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 6e2db3f..675b35e 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -1548,7 +1548,7 @@ bool SwCrsrShell::GetContentAtPos( const Point& rPt,
                 {
                     for( size_t i = 0; i < pTextNd->GetSwpHints().Count(); ++i )
                     {
-                        const SwTextAttr* pHt = pTextNd->GetSwpHints()[i];
+                        const SwTextAttr* pHt = pTextNd->GetSwpHints().Get(i);
                         const sal_Int32 nAttrStart = pHt->GetStart();
                         if( nAttrStart > n ) // over the section
                             break;
diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx
index c8bb015..a357a61 100644
--- a/sw/source/core/crsr/findattr.cxx
+++ b/sw/source/core/crsr/findattr.cxx
@@ -95,7 +95,7 @@ const SwTextAttr* GetFrwrdTextHint( const SwpHints& rHtsArr, sal_uInt16& rPos,
 {
     while( rPos < rHtsArr.Count() )
     {
-        const SwTextAttr *pTextHt = rHtsArr.GetStart( rPos++ );
+        const SwTextAttr *pTextHt = rHtsArr.Get( rPos++ );
         // the start of an attribute has to be in the section
         if( pTextHt->GetStart() >= nContentPos )
             return pTextHt; // valid text attribute
@@ -108,7 +108,7 @@ const SwTextAttr* GetBkwrdTextHint( const SwpHints& rHtsArr, sal_uInt16& rPos,
 {
     while( rPos > 0 )
     {
-        const SwTextAttr *pTextHt = rHtsArr.GetStart( --rPos );
+        const SwTextAttr *pTextHt = rHtsArr.Get( --rPos );
         // the start of an attribute has to be in the section
         if( pTextHt->GetStart() < nContentPos )
             return pTextHt; // valid text attribute
@@ -715,7 +715,7 @@ static bool lcl_SearchForward( const SwTextNode& rTextNd, SwAttrCheckArr& rCmpAr
     if( rCmpArr.Found() )
     {
         for( ; nPos < rHtArr.Count(); ++nPos )
-            if( !rCmpArr.SetAttrFwd( *( pAttr = rHtArr.GetStart( nPos )) ) )
+            if( !rCmpArr.SetAttrFwd( *( pAttr = rHtArr.Get( nPos )) ) )
             {
                 if( rCmpArr.GetNdStt() < pAttr->GetStart() )
                 {
@@ -739,12 +739,12 @@ static bool lcl_SearchForward( const SwTextNode& rTextNd, SwAttrCheckArr& rCmpAr
 
     sal_Int32 nSttPos;
     for( ; nPos < rHtArr.Count(); ++nPos )
-        if( rCmpArr.SetAttrFwd( *( pAttr = rHtArr.GetStart( nPos )) ) )
+        if( rCmpArr.SetAttrFwd( *( pAttr = rHtArr.Get( nPos )) ) )
         {
             // Do multiple start at that position? Do also check those:
             nSttPos = pAttr->GetStart();
             while( ++nPos < rHtArr.Count() && nSttPos ==
-                    ( pAttr = rHtArr.GetStart( nPos ))->GetStart() &&
+                    ( pAttr = rHtArr.Get( nPos ))->GetStart() &&
                     rCmpArr.SetAttrFwd( *pAttr ) )
                 ;
 
@@ -790,7 +790,7 @@ static bool lcl_SearchBackward( const SwTextNode& rTextNd, SwAttrCheckArr& rCmpA
     if( rCmpArr.Found() )
     {
         while( nPos )
-            if( !rCmpArr.SetAttrBwd( *( pAttr = rHtArr.GetEnd( --nPos )) ) )
+            if( !rCmpArr.SetAttrBwd( *( pAttr = rHtArr.GetSortedByEnd( --nPos )) ) )
             {
                 nSttPos = *pAttr->GetAnyEnd();
                 if( nSttPos < rCmpArr.GetNdEnd() )
@@ -815,14 +815,14 @@ static bool lcl_SearchBackward( const SwTextNode& rTextNd, SwAttrCheckArr& rCmpA
     }
 
     while( nPos )
-        if( rCmpArr.SetAttrBwd( *( pAttr = rHtArr.GetEnd( --nPos )) ) )
+        if( rCmpArr.SetAttrBwd( *( pAttr = rHtArr.GetSortedByEnd( --nPos )) ) )
         {
             // Do multiple start at that position? Do also check those:
             if( nPos )
             {
                 nEndPos = *pAttr->GetAnyEnd();
                 while( --nPos && nEndPos ==
-                        *( pAttr = rHtArr.GetEnd( nPos ))->GetAnyEnd() &&
+                        *( pAttr = rHtArr.GetSortedByEnd( nPos ))->GetAnyEnd() &&
                         rCmpArr.SetAttrBwd( *pAttr ) )
                     ;
             }
diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx
index 33a4c86..e859a99 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -74,7 +74,7 @@ lcl_CleanStr(const SwTextNode& rNd, sal_Int32 const nStart, sal_Int32& rEnd,
     {
         if ( bNewHint )
             nHintStart = pHts && n < pHts->Count() ?
-                         (*pHts)[n]->GetStart() :
+                         pHts->Get(n)->GetStart() :
                          -1;
 
         if ( bNewSoftHyphen )
@@ -118,7 +118,7 @@ lcl_CleanStr(const SwTextNode& rNd, sal_Int32 const nStart, sal_Int32& rEnd,
 
         if ( bNewHint )
         {
-            const SwTextAttr* pHt = (*pHts)[n];
+            const SwTextAttr* pHt = pHts->Get(n);
             if ( pHt->HasDummyChar() && (nStt >= nStart) )
             {
                 switch( pHt->Which() )
@@ -198,7 +198,7 @@ size_t GetPostIt(sal_Int32 aCount,const SwpHints *pHts)
         for (size_t i = 0; i < pHts->Count(); ++i )
         {
             aIndex++;
-            const SwTextAttr* pTextAttr = (*pHts)[i];
+            const SwTextAttr* pTextAttr = pHts->Get(i);
             if ( pTextAttr->Which() == RES_TXTATR_ANNOTATION )
             {
                 aCount--;
@@ -210,7 +210,7 @@ size_t GetPostIt(sal_Int32 aCount,const SwpHints *pHts)
     // throw away all following non postits
     for( size_t i = aIndex; i < pHts->Count(); ++i )
     {
-        const SwTextAttr* pTextAttr = (*pHts)[i];
+        const SwTextAttr* pTextAttr = pHts->Get(i);
         if ( pTextAttr->Which() == RES_TXTATR_ANNOTATION )
             break;
         else
@@ -275,7 +275,7 @@ bool SwPaM::Find( const SearchOptions& rSearchOpt, bool bSearchInNotes , utl::Te
 
                 for( size_t i = 0; i < pHts->Count(); ++i )
                 {
-                    const SwTextAttr* pTextAttr = (*pHts)[i];
+                    const SwTextAttr* pTextAttr = pHts->Get(i);
                     if ( pTextAttr->Which()==RES_TXTATR_ANNOTATION )
                     {
                         const sal_Int32 aPos = pTextAttr->GetStart();
@@ -410,14 +410,14 @@ bool SwPaM::Find( const SearchOptions& rSearchOpt, bool bSearchInNotes , utl::Te
                 {
                     if (bSrchForward)
                     {
-                        nStartInside = aLoop==0 ? nStart : (*pHts)[GetPostIt(aLoop+aIgnore-1,pHts)]->GetStart()+1;
-                        nEndInside = aLoop==aNumberPostits ? nEnd : (*pHts)[GetPostIt(aLoop+aIgnore,pHts)]->GetStart();
+                        nStartInside = aLoop==0 ? nStart : pHts->Get(GetPostIt(aLoop+aIgnore-1,pHts))->GetStart()+1;
+                        nEndInside = aLoop==aNumberPostits ? nEnd : pHts->Get(GetPostIt(aLoop+aIgnore,pHts))->GetStart();
                         nTextLen = nEndInside - nStartInside;
                     }
                     else
                     {
-                        nStartInside =  aLoop==aNumberPostits ? nStart : (*pHts)[GetPostIt(aLoop+aIgnore,pHts)]->GetStart();
-                        nEndInside = aLoop==0 ? nEnd : (*pHts)[GetPostIt(aLoop+aIgnore-1,pHts)]->GetStart()+1;
+                        nStartInside =  aLoop==aNumberPostits ? nStart : pHts->Get(GetPostIt(aLoop+aIgnore,pHts))->GetStart();
+                        nEndInside = aLoop==0 ? nEnd : pHts->Get(GetPostIt(aLoop+aIgnore-1,pHts))->GetStart()+1;
                         nTextLen = nStartInside - nEndInside;
                     }
                     // search inside the text between a note
@@ -432,7 +432,9 @@ bool SwPaM::Find( const SearchOptions& rSearchOpt, bool bSearchInNotes , utl::Te
                         // we should now be right in front of a note, search inside
                         if ( (bSrchForward && (GetPostIt(aLoop + aIgnore,pHts) < pHts->Count()) ) || ( !bSrchForward && (aLoop!=0) ))
                         {
-                            const SwTextAttr* pTextAttr = bSrchForward ?  (*pHts)[GetPostIt(aLoop+aIgnore,pHts)] : (*pHts)[GetPostIt(aLoop+aIgnore-1,pHts)];
+                            const SwTextAttr* pTextAttr = bSrchForward
+                                    ? pHts->Get(GetPostIt(aLoop+aIgnore,pHts))
+                                    : pHts->Get(GetPostIt(aLoop+aIgnore-1,pHts));
                             if (pPostItMgr && pPostItMgr->SearchReplace(
                                     static_txtattr_cast<SwTextField const*>(pTextAttr)->GetFormatField(),rSearchOpt,bSrchForward))
                             {
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 32ece3e..cfb2976 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -901,7 +901,7 @@ namespace
                         const size_t nCount = pHints->Count();
                         for( size_t i = 0; i < nCount; ++i )
                         {
-                            SwTextAttr *pAttr = pHints->GetTextHint( i );
+                            SwTextAttr *pAttr = pHints->Get( i );
                             if ( pAttr->Which() == RES_TXTATR_FTN )
                             {
                                 rSaveArr.insert( static_cast<SwTextFootnote*>(pAttr) );
@@ -3620,7 +3620,7 @@ bool DocumentContentOperationsManager::DeleteRangeImplImpl(SwPaM & rPam)
             const sal_Int32 nMkCntPos = rPam.GetMark()->nContent.GetIndex();
             for( size_t n = pHts->Count(); n; )
             {
-                const SwTextAttr* pAttr = (*pHts)[ --n ];
+                const SwTextAttr* pAttr = pHts->Get( --n );
                 if( nMkCntPos > pAttr->GetStart() )
                     break;
 
diff --git a/sw/source/core/doc/DocumentFieldsManager.cxx b/sw/source/core/doc/DocumentFieldsManager.cxx
index 0672cd0..44b16d3 100644
--- a/sw/source/core/doc/DocumentFieldsManager.cxx
+++ b/sw/source/core/doc/DocumentFieldsManager.cxx
@@ -1257,7 +1257,7 @@ bool DocumentFieldsManager::SetFieldsDirty( bool b, const SwNode* pChk, sal_uLon
                     const size_t nEnd = pTNd->GetSwpHints().Count();
                     for( size_t n = 0 ; n < nEnd; ++n )
                     {
-                        const SwTextAttr* pAttr = pTNd->GetSwpHints()[ n ];
+                        const SwTextAttr* pAttr = pTNd->GetSwpHints().Get(n);
                         if ( pAttr->Which() == RES_TXTATR_FIELD )
                         {
                             b = true;
diff --git a/sw/source/core/doc/dbgoutsw.cxx b/sw/source/core/doc/dbgoutsw.cxx
index d88be7b..0f18087 100644
--- a/sw/source/core/doc/dbgoutsw.cxx
+++ b/sw/source/core/doc/dbgoutsw.cxx
@@ -324,7 +324,7 @@ static const OUString lcl_dbg_out(const SwpHints & rHints)
     for (size_t i = 0; i < rHints.Count(); ++i)
     {
         aStr += "  ";
-        aStr += lcl_dbg_out(*rHints[i]);
+        aStr += lcl_dbg_out(*rHints.Get(i));
         aStr += "\n";
     }
 
diff --git a/sw/source/core/doc/docruby.cxx b/sw/source/core/doc/docruby.cxx
index b3372f0..10d87d7 100644
--- a/sw/source/core/doc/docruby.cxx
+++ b/sw/source/core/doc/docruby.cxx
@@ -210,7 +210,7 @@ bool SwDoc::_SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rEntry, sal_uInt
     {
         for( size_t nHtIdx = 0; nHtIdx < pHts->Count(); ++nHtIdx )
         {
-            const SwTextAttr* pHt = (*pHts)[ nHtIdx ];
+            const SwTextAttr* pHt = pHts->Get(nHtIdx);
             if( RES_TXTATR_CJK_RUBY == pHt->Which() &&
                 *pHt->GetAnyEnd() > nStart )
             {
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index 0f53a03..3effff7 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -126,7 +126,7 @@ sal_uInt16 SwDoc::GetCurTOXMark( const SwPosition& rPos,
 
     for( size_t n = 0; n < rHts.Count(); ++n )
     {
-        const SwTextAttr* pHt = rHts[n];
+        const SwTextAttr* pHt = rHts.Get(n);
         if( RES_TXTATR_TOXMARK != pHt->Which() )
             continue;
         if( ( nSttIdx = pHt->GetStart() ) < nAktPos )
@@ -1700,9 +1700,9 @@ void SwTOXBaseSection::_UpdatePageNum( SwTextNode* pNd,
     SwCharFormat* pPageNoCharFormat = 0;
     SwpHints* pHints = pNd->GetpSwpHints();
     if(pHints)
-        for(size_t nHintIdx = 0; nHintIdx < pHints->GetStartCount(); ++nHintIdx)
+        for(size_t nHintIdx = 0; nHintIdx < pHints->Count(); ++nHintIdx)
         {
-            SwTextAttr* pAttr = pHints->GetStart(nHintIdx);
+            const SwTextAttr* pAttr = pHints->Get(nHintIdx);
             const sal_Int32 nTmpEnd = pAttr->End() ? *pAttr->End() : 0;
             if( nStartPos >= pAttr->GetStart() &&
                 (nStartPos + 2) <= nTmpEnd &&
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index 7cf97fc..6c7620e 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -264,7 +264,7 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz,
                             GetDoc()->GetIDocumentUndoRedo().IsUndoNodes(rNds);
                         for( size_t i = pHts->Count(); i; )
                         {
-                            SwTextAttr * const pAttr = pHts->GetTextHint( --i );
+                            SwTextAttr * const pAttr = pHts->Get( --i );
                             switch ( pAttr->Which() )
                             {
                             case RES_TXTATR_FIELD:
@@ -2232,7 +2232,7 @@ void SwNodes::RemoveNode( sal_uLong nDelPos, sal_uLong nSz, bool bDel )
                     std::vector<SwTextAttr*> flys;
                     for (size_t i = 0; i < pHints->Count(); ++i)
                     {
-                        SwTextAttr *const pHint(pHints->GetTextHint(i));
+                        SwTextAttr *const pHint(pHints->Get(i));
                         if (RES_TXTATR_FLYCNT == pHint->Which())
                         {
                             flys.push_back(pHint);
diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx
index be1167e..18c1d19 100644
--- a/sw/source/core/edit/acorrect.cxx
+++ b/sw/source/core/edit/acorrect.cxx
@@ -491,7 +491,7 @@ void SwDontExpandItem::RestoreDontExpandItems( const SwPosition& rPos )
 
             for( size_t n = 0; n < nSize; ++n )
             {
-                SwTextAttr* pHt = pTextNd->GetpSwpHints()->GetTextHint( n );
+                SwTextAttr* pHt = pTextNd->GetpSwpHints()->Get( n );
                 nAttrStart = pHt->GetStart();
                 if( nAttrStart > nStart )       // beyond the area
                     break;
diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx
index 759cfc8..c9be0fb 100644
--- a/sw/source/core/edit/edattr.cxx
+++ b/sw/source/core/edit/edattr.cxx
@@ -325,7 +325,7 @@ std::vector<std::pair< const SfxPoolItem*, std::unique_ptr<SwPaM> >> SwEditShell
                 const size_t nSize = pTextNd->GetpSwpHints()->Count();
                 for( size_t m = 0; m < nSize; m++ )
                 {
-                    const SwTextAttr* pHt = (*pTextNd->GetpSwpHints())[m];
+                    const SwTextAttr* pHt = pTextNd->GetpSwpHints()->Get(m);
                     if( pHt->Which() == RES_TXTATR_AUTOFMT ||
                         pHt->Which() == RES_TXTATR_CHARFMT ||
                         pHt->Which() == RES_TXTATR_INETFMT )
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index e31a3f0..1738def 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -1303,7 +1303,7 @@ Size SwFEShell::RequestObjectResize( const SwRect &rRect, const uno::Reference <
             const size_t nEnd = pHts->Count();
             for( size_t n = 0; n < nEnd; ++n )
             {
-                const SfxPoolItem* pItem = &(*pHts)[ n ]->GetAttr();
+                const SfxPoolItem* pItem = &pHts->Get(n)->GetAttr();
                 if( RES_TXTATR_FIELD == pItem->Which()
                     && TYP_SEQFLD == static_cast<const SwFormatField*>(pItem)->GetField()->GetTypeId() )
                 {
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index 9422b1c..93abe09 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -2509,7 +2509,7 @@ sal_uLong SwTableBox::IsValidNumTextNd( bool bCheckAttr ) const
                     sal_Int32 nNextSetField = 0;
                     for( size_t n = 0; n < pHts->Count(); ++n )
                     {
-                        const SwTextAttr* pAttr = (*pHts)[ n ];
+                        const SwTextAttr* pAttr = pHts->Get(n);
                         if( RES_TXTATR_NOEND_BEGIN <= pAttr->Which() )
                         {
                             if ( (pAttr->GetStart() == nNextSetField)
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index 43a9589..2a17ffa 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -610,7 +610,7 @@ SwContentFrm *SwTextFrm::JoinFrm()
             SwFootnoteBossFrm *pEndBoss = 0;
             for ( size_t i = 0; i < pHints->Count(); ++i )
             {
-                const SwTextAttr *pHt = (*pHints)[i];
+                const SwTextAttr *pHt = pHints->Get(i);
                 if( RES_TXTATR_FTN==pHt->Which() && pHt->GetStart()>=nStart )
                 {
                     if( pHt->GetFootnote().IsEndNote() )
@@ -703,7 +703,7 @@ SwContentFrm *SwTextFrm::SplitFrm( const sal_Int32 nTextPos )
             SwFootnoteBossFrm *pEndBoss = 0;
             for ( size_t i = 0; i < pHints->Count(); ++i )
             {
-                const SwTextAttr *pHt = (*pHints)[i];
+                const SwTextAttr *pHt = pHints->Get(i);
                 if( RES_TXTATR_FTN==pHt->Which() && pHt->GetStart()>=nTextPos )
                 {
                     if( pHt->GetFootnote().IsEndNote() )
diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx
index d4347bd..71425ae 100644
--- a/sw/source/core/text/itratr.cxx
+++ b/sw/source/core/text/itratr.cxx
@@ -164,8 +164,8 @@ bool SwAttrIter::SeekStartAndChgAttrIter( OutputDevice* pOut, const bool bParaFo
     {
         SwTextAttr *pTextAttr;
         // While we've not reached the end of the StartArray && the TextAttribute starts at position 0...
-        while ( ( nStartIndex < pHints->GetStartCount() ) &&
-                !((pTextAttr=pHints->GetStart(nStartIndex))->GetStart()) )
+        while ( ( nStartIndex < pHints->Count() ) &&
+                !((pTextAttr = pHints->Get(nStartIndex))->GetStart()) )
         {
             // open the TextAttributes
             Chg( pTextAttr );
@@ -202,8 +202,8 @@ void SwAttrIter::SeekFwd( const sal_Int32 nNewPos )
 
         // As long as we've not yet reached the end of EndArray and the
         // TextAttribute ends before or at the new position ...
-        while ( ( nEndIndex < pHints->GetEndCount() ) &&
-                (*(pTextAttr=pHints->GetEnd(nEndIndex))->GetAnyEnd()<=nNewPos))
+        while ( ( nEndIndex < pHints->Count() ) &&
+                (*(pTextAttr=pHints->GetSortedByEnd(nEndIndex))->GetAnyEnd()<=nNewPos))
         {
             // Close the TextAttributes, whose StartPos were before or at
             // the old nPos and are currently open
@@ -213,8 +213,8 @@ void SwAttrIter::SeekFwd( const sal_Int32 nNewPos )
     }
     else // skip the not opended ends
     {
-        while ( (nEndIndex < pHints->GetEndCount()) &&
-                (*pHints->GetEnd(nEndIndex)->GetAnyEnd() <= nNewPos) )
+        while ( (nEndIndex < pHints->Count()) &&
+                (*pHints->GetSortedByEnd(nEndIndex)->GetAnyEnd() <= nNewPos) )
         {
             nEndIndex++;
         }
@@ -222,8 +222,8 @@ void SwAttrIter::SeekFwd( const sal_Int32 nNewPos )
 
     // As long as we've not yet reached the end of EndArray and the
     // TextAttribute ends before or at the new position ...
-    while ( ( nStartIndex < pHints->GetStartCount() ) &&
-            ((pTextAttr=pHints->GetStart(nStartIndex))->GetStart()<=nNewPos) )
+    while ( ( nStartIndex < pHints->Count() ) &&
+            ((pTextAttr=pHints->Get(nStartIndex))->GetStart()<=nNewPos) )
     {
 
         // open the TextAttributes, whose ends lie behind the new position
@@ -286,9 +286,9 @@ sal_Int32 SwAttrIter::GetNextAttr( ) const
     if( pHints )
     {
         // are there attribute starts left?
-        for (size_t i = nStartIndex; i < pHints->GetStartCount(); ++i)
+        for (size_t i = nStartIndex; i < pHints->Count(); ++i)
         {
-            SwTextAttr *const pAttr(pHints->GetStart(i));
+            SwTextAttr *const pAttr(pHints->Get(i));
             if (!pAttr->IsFormatIgnoreStart())
             {
                 nNext = pAttr->GetStart();
@@ -296,9 +296,9 @@ sal_Int32 SwAttrIter::GetNextAttr( ) const
             }
         }
         // are there attribute ends left?
-        for (size_t i = nEndIndex; i < pHints->GetEndCount(); ++i)
+        for (size_t i = nEndIndex; i < pHints->Count(); ++i)
         {
-            SwTextAttr *const pAttr(pHints->GetEnd(i));
+            SwTextAttr *const pAttr(pHints->GetSortedByEnd(i));
             if (!pAttr->IsFormatIgnoreEnd())
             {
                 sal_Int32 const nNextEnd = *pAttr->GetAnyEnd();
diff --git a/sw/source/core/text/itrpaint.cxx b/sw/source/core/text/itrpaint.cxx
index 56d155b..2b46d0c 100644
--- a/sw/source/core/text/itrpaint.cxx
+++ b/sw/source/core/text/itrpaint.cxx
@@ -494,9 +494,9 @@ void SwTextPainter::CheckSpecialUnderline( const SwLinePortion* pPor,
 
     if( HasHints() )
     {
-        for ( size_t nTmp = 0; nTmp < pHints->GetStartCount(); ++nTmp )
+        for ( size_t nTmp = 0; nTmp < pHints->Count(); ++nTmp )
         {
-            SwTextAttr* const pTextAttr = pHints->GetStart( nTmp );
+            SwTextAttr* const pTextAttr = pHints->Get( nTmp );
 
             const SvxUnderlineItem* pItem =
                     static_cast<const SvxUnderlineItem*>(CharFormat::GetItem( *pTextAttr, RES_CHRATR_UNDERLINE ));
diff --git a/sw/source/core/text/itrtxt.cxx b/sw/source/core/text/itrtxt.cxx
index 8f4f709..149a506 100644
--- a/sw/source/core/text/itrtxt.cxx
+++ b/sw/source/core/text/itrtxt.cxx
@@ -347,7 +347,7 @@ void SwTextIter::TruncLines( bool bNoteFollow )
                 // examine hints in range nEnd - (nEnd + nRangeChar)
                 for( size_t i = 0; i < pTmpHints->Count(); ++i )
                 {
-                    const SwTextAttr* pHt = pTmpHints->GetTextHint( i );
+                    const SwTextAttr* pHt = pTmpHints->Get( i );
                     if( RES_TXTATR_FLYCNT == pHt->Which() )
                     {
                         // check, if hint is in our range
diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx
index bd62642..065777d 100644
--- a/sw/source/core/text/porfly.cxx
+++ b/sw/source/core/text/porfly.cxx
@@ -189,7 +189,7 @@ sal_Int32 SwTextFrm::CalcFlyPos( SwFrameFormat* pSearch )
     SwTextAttr* pFound = NULL;
     for ( size_t i = 0; i < pHints->Count(); ++i )
     {
-        SwTextAttr *pHt = pHints->GetTextHint( i );
+        SwTextAttr *pHt = pHints->Get( i );
         if( RES_TXTATR_FLYCNT == pHt->Which() )
         {
             SwFrameFormat* pFrameFormat = pHt->GetFlyCnt().GetFrameFormat();
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 93d4162..d7c217d 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -2067,9 +2067,9 @@ void SwScriptInfo::selectHiddenTextProperty(const SwTextNode& rNode, MultiSelect
 
     if( pHints )
     {
-        for( size_t nTmp = 0; nTmp < pHints->GetStartCount(); ++nTmp )
+        for( size_t nTmp = 0; nTmp < pHints->Count(); ++nTmp )
         {
-            const SwTextAttr* pTextAttr = pHints->GetStart( nTmp );
+            const SwTextAttr* pTextAttr = pHints->Get( nTmp );
             const SvxCharHiddenItem* pHiddenItem =
                 static_cast<const SvxCharHiddenItem*>( CharFormat::GetItem( *pTextAttr, RES_CHRATR_HIDDEN ) );
             if( pHiddenItem )
diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx
index d66702e..800f097 100644
--- a/sw/source/core/text/pormulti.cxx
+++ b/sw/source/core/text/pormulti.cxx
@@ -865,7 +865,7 @@ SwMultiCreator* SwTextSizeInfo::GetMultiCreator( sal_Int32 &rPos,
     const size_t nCount = pHints ? pHints->Count() : 0;
     for( size_t i = 0; i < nCount; ++i )
     {
-        const SwTextAttr *pTmp = (*pHints)[i];
+        const SwTextAttr *pTmp = pHints->Get(i);
         sal_Int32 nStart = pTmp->GetStart();
         if( rPos < nStart )
             break;
@@ -918,7 +918,7 @@ SwMultiCreator* SwTextSizeInfo::GetMultiCreator( sal_Int32 &rPos,
         if( n2Lines < nCount )
         {
             pRet->pItem = NULL;
-            pRet->pAttr = (*pHints)[n2Lines];
+            pRet->pAttr = pHints->Get(n2Lines);
             aEnd.push_front( *pRet->pAttr->End() );
             if( pItem )
             {
@@ -957,7 +957,7 @@ SwMultiCreator* SwTextSizeInfo::GetMultiCreator( sal_Int32 &rPos,
         // continuity attribute.
         for( size_t i = 0; i < nCount; ++i )
         {
-            const SwTextAttr *pTmp = (*pHints)[i];
+            const SwTextAttr *pTmp = pHints->Get(i);
             if( *pTmp->GetAnyEnd() <= rPos )
                 continue;
             if( rPos < pTmp->GetStart() )
@@ -1035,7 +1035,7 @@ SwMultiCreator* SwTextSizeInfo::GetMultiCreator( sal_Int32 &rPos,
         sal_Int32 n2Start = rPos;
         for( size_t i = 0; i < nCount; ++i )
         {
-            const SwTextAttr *pTmp = (*pHints)[i];
+            const SwTextAttr *pTmp = pHints->Get(i);
             if( *pTmp->GetAnyEnd() <= n2Start )
                 continue;
             if( n2Start < pTmp->GetStart() )
@@ -1090,7 +1090,7 @@ SwMultiCreator* SwTextSizeInfo::GetMultiCreator( sal_Int32 &rPos,
         if( nRotate < nCount )
         {
             pRet->pItem = NULL;
-            pRet->pAttr = (*pHints)[nRotate];
+            pRet->pAttr = pHints->Get(nRotate);
             aEnd.push_front( *pRet->pAttr->End() );
             if( pRotItem )
             {
@@ -1107,7 +1107,7 @@ SwMultiCreator* SwTextSizeInfo::GetMultiCreator( sal_Int32 &rPos,
         }
         for( size_t i = 0; i < nCount; ++i )
         {
-            const SwTextAttr *pTmp = (*pHints)[i];
+            const SwTextAttr *pTmp = pHints->Get(i);
             if( *pTmp->GetAnyEnd() <= rPos )
                 continue;
             if( rPos < pTmp->GetStart() )
diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx
index 98fc3c9..b09fad2 100644
--- a/sw/source/core/text/txtfld.cxx
+++ b/sw/source/core/text/txtfld.cxx
@@ -319,9 +319,9 @@ SwExpandPortion * SwTextFormatter::TryNewNoLengthPortion(SwTextFormatInfo & rInf
     if (pHints)
     {
         const sal_Int32 nIdx(rInfo.GetIdx());
-        while (m_nHintEndIndex < pHints->GetEndCount())
+        while (m_nHintEndIndex < pHints->Count())
         {
-            SwTextAttr & rHint( *pHints->GetEnd(m_nHintEndIndex) );
+            SwTextAttr & rHint( *pHints->GetSortedByEnd(m_nHintEndIndex) );
             sal_Int32 const nEnd( *rHint.GetAnyEnd() );
             if (nEnd > nIdx)
             {
@@ -413,7 +413,7 @@ static void checkApplyParagraphMarkFormatToNumbering( SwFont* pNumFnt, SwTextFor
     {
         for( size_t i = 0; i < hints->Count(); ++i )
         {
-            SwTextAttr* hint = hints->GetTextHint( i );
+            SwTextAttr* hint = hints->Get( i );
             // Formatting for the paragraph mark is set to apply only to the (non-existent) extra character
             // the at end of the txt node.
             if( hint->Which() == RES_TXTATR_AUTOFMT && hint->GetEnd() != NULL
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index e931f5a..b240c63 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -483,7 +483,7 @@ void SwTextFrm::HideFootnotes( sal_Int32 nStart, sal_Int32 nEnd )
         SwPageFrm *pPage = 0;
         for ( size_t i = 0; i < nSize; ++i )
         {
-            const SwTextAttr *pHt = (*pHints)[i];
+            const SwTextAttr *pHt = pHints->Get(i);
             if ( pHt->Which() == RES_TXTATR_FTN )
             {
                 const sal_Int32 nIdx = pHt->GetStart();
@@ -1616,7 +1616,7 @@ bool SwTextFrm::Prepare( const PrepareHint ePrep, const void* pVoid,
                                     GetFollow()->GetOfst() : COMPLETE_STRING;
                 for ( size_t i = 0; i < nSize; ++i )
                 {
-                    const SwTextAttr *pHt = (*pHints)[i];
+                    const SwTextAttr *pHt = pHints->Get(i);
                     const sal_Int32 nStart = pHt->GetStart();
                     if( nStart >= GetOfst() )
                     {
diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx
index 0b96586..4a85368 100644
--- a/sw/source/core/text/txtftn.cxx
+++ b/sw/source/core/text/txtftn.cxx
@@ -103,7 +103,7 @@ void SwTextFrm::CalcFootnoteFlag()
 
     for ( size_t i = 0; i < nSize; ++i )
     {
-        const SwTextAttr *pHt = (*pHints)[i];
+        const SwTextAttr *pHt = pHints->Get(i);
         if ( pHt->Which() == RES_TXTATR_FTN )
         {
             const sal_Int32 nIdx = pHt->GetStart();
@@ -422,7 +422,7 @@ void SwTextFrm::RemoveFootnote( const sal_Int32 nStart, const sal_Int32 nLen )
             = FTNPOS_CHAPTER == GetNode()->GetDoc()->GetFootnoteInfo().ePos;
         for ( size_t i = nSize; i; )
         {
-            SwTextAttr *pHt = pHints->GetTextHint(--i);
+            SwTextAttr *pHt = pHints->Get(--i);
             if ( RES_TXTATR_FTN != pHt->Which() )
                 continue;
 
diff --git a/sw/source/core/tox/ToxTextGenerator.cxx b/sw/source/core/tox/ToxTextGenerator.cxx
index 11eab33..3fc431d 100644
--- a/sw/source/core/tox/ToxTextGenerator.cxx
+++ b/sw/source/core/tox/ToxTextGenerator.cxx
@@ -303,7 +303,7 @@ ToxTextGenerator::HandleTextToken(const SwTOXSortTabBase& source, SwAttrPool& po
     }
     const SwpHints& hints = pSrc->GetSwpHints();
     for (size_t i = 0; i < hints.Count(); ++i) {
-        const SwTextAttr* hint = hints[i];
+        const SwTextAttr* hint = hints.Get(i);
         std::shared_ptr<SfxItemSet> attributesToClone = CollectAttributesForTox(*hint, pool);
         if (attributesToClone->Count() <= 0) {
             continue;
diff --git a/sw/source/core/txtnode/modeltoviewhelper.cxx b/sw/source/core/txtnode/modeltoviewhelper.cxx
index 7a8e4fe..5d5cd6d 100644
--- a/sw/source/core/txtnode/modeltoviewhelper.cxx
+++ b/sw/source/core/txtnode/modeltoviewhelper.cxx
@@ -130,7 +130,7 @@ ModelToViewHelper::ModelToViewHelper(const SwTextNode &rNode, ExpandMode eMode)
         const SwpHints* pSwpHints2 = rNode.GetpSwpHints();
         for ( size_t i = 0; pSwpHints2 && i < pSwpHints2->Count(); ++i )
         {
-            const SwTextAttr* pAttr = (*pSwpHints2)[i];
+            const SwTextAttr* pAttr = pSwpHints2->Get(i);
             if (pAttr->HasDummyChar())
             {
                 const sal_Int32 nDummyCharPos = pAttr->GetStart();
diff --git a/sw/source/core/txtnode/ndhints.cxx b/sw/source/core/txtnode/ndhints.cxx
index 24f52d8..72c5946 100644
--- a/sw/source/core/txtnode/ndhints.cxx
+++ b/sw/source/core/txtnode/ndhints.cxx
@@ -106,38 +106,25 @@ bool CompareSwpHtEnd::operator()(SwTextAttr* const lhs, SwTextAttr* const rhs) c
   return lcl_IsLessEnd( *lhs, *rhs );
 }
 
-void SwpHintsArray::Insert( const SwTextAttr *pHt )
+void SwpHints::Insert( const SwTextAttr *pHt )
 {
     Resort();
-    assert(m_HintStarts.find(const_cast<SwTextAttr*>(pHt))
-            == m_HintStarts.end()); // "Insert: hint already in HtStart"
-    assert(m_HintEnds.find(const_cast<SwTextAttr*>(pHt))
-            == m_HintEnds.end());   // "Insert: hint already in HtEnd"
-    m_HintStarts.insert( const_cast<SwTextAttr*>(pHt) );
-    m_HintEnds  .insert( const_cast<SwTextAttr*>(pHt) );
+    assert(m_HintsByStart.find(const_cast<SwTextAttr*>(pHt))
+            == m_HintsByStart.end()); // "Insert: hint already in HtStart"
+    assert(m_HintsByEnd.find(const_cast<SwTextAttr*>(pHt))
+            == m_HintsByEnd.end());   // "Insert: hint already in HtEnd"
+    m_HintsByStart.insert( const_cast<SwTextAttr*>(pHt) );
+    m_HintsByEnd  .insert( const_cast<SwTextAttr*>(pHt) );
 }
 
-void SwpHintsArray::DeleteAtPos( const size_t nPos )
-{
-    // optimization: nPos is the position in the Starts array
-    SwTextAttr *pHt = m_HintStarts[ nPos ];
-    m_HintStarts.erase( m_HintStarts.begin() + nPos );
-
-    Resort();
-
-    bool const done = m_HintEnds.erase(pHt);
-    assert(done);
-    (void) done; // unused in NDEBUG
-}
-
-bool SwpHintsArray::Contains( const SwTextAttr *pHt ) const
+bool SwpHints::Contains( const SwTextAttr *pHt ) const
 {
     // DO NOT use find() or CHECK here!
     // if called from SwTextNode::InsertItem, pHt has already been deleted,
     // so it cannot be dereferenced
-    for (size_t i = 0; i < m_HintStarts.size(); ++i)
+    for (size_t i = 0; i < m_HintsByStart.size(); ++i)
     {
-        if (m_HintStarts[i] == pHt)
+        if (m_HintsByStart[i] == pHt)
         {
             return true;
         }
@@ -151,14 +138,14 @@ bool SwpHintsArray::Contains( const SwTextAttr *pHt ) const
         if(!(cond)) \
         { \
             SAL_WARN("sw.core", text); \
-            (const_cast<SwpHintsArray*>(this))->Resort(); \
+            (const_cast<SwpHints*>(this))->Resort(); \
             return false; \
         }
 
-bool SwpHintsArray::Check(bool bPortionsMerged) const
+bool SwpHints::Check(bool bPortionsMerged) const
 {
     // 1) gleiche Anzahl in beiden Arrays
-    CHECK_ERR( m_HintStarts.size() == m_HintEnds.size(),
+    CHECK_ERR( m_HintsByStart.size() == m_HintsByEnd.size(),
         "HintsCheck: wrong sizes" );
     sal_Int32 nLastStart = 0;
     sal_Int32 nLastEnd   = 0;
@@ -170,7 +157,7 @@ bool SwpHintsArray::Check(bool bPortionsMerged) const
     {
         for (size_t i = 0; i < Count(); ++i)
         {
-            SwTextAttr const*const pHint(m_HintStarts[i]);
+            SwTextAttr const*const pHint(m_HintsByStart[i]);
             if (RES_TXTATR_AUTOFMT == pHint->Which())
             {
                 std::shared_ptr<SfxItemSet> const pSet(
@@ -188,7 +175,7 @@ bool SwpHintsArray::Check(bool bPortionsMerged) const
         // --- Start-Kontrolle ---
 
         // 2a) gueltiger Pointer? vgl. DELETEFF
-        const SwTextAttr *pHt = m_HintStarts[i];
+        const SwTextAttr *pHt = m_HintsByStart[i];
         CHECK_ERR( 0xFF != *reinterpret_cast<unsigned char const *>(pHt), "HintsCheck: start ptr was deleted" );
 
         // 3a) Stimmt die Start-Sortierung?
@@ -205,7 +192,7 @@ bool SwpHintsArray::Check(bool bPortionsMerged) const
         // --- End-Kontrolle ---
 
         // 2b) gueltiger Pointer? vgl. DELETEFF
-        const SwTextAttr *pHtEnd = m_HintEnds[i];
+        const SwTextAttr *pHtEnd = m_HintsByEnd[i];
         CHECK_ERR( 0xFF != *reinterpret_cast<unsigned char const *>(pHtEnd), "HintsCheck: end ptr was deleted" );
 
         // 3b) Stimmt die End-Sortierung?
@@ -223,13 +210,13 @@ bool SwpHintsArray::Check(bool bPortionsMerged) const
         // --- Ueberkreuzungen ---
 
         // 5) gleiche Pointer in beiden Arrays
-        if (m_HintStarts.find(const_cast<SwTextAttr*>(pHt)) == m_HintStarts.end())
+        if (m_HintsByStart.find(const_cast<SwTextAttr*>(pHt)) == m_HintsByStart.end())
             nIdx = COMPLETE_STRING;
 
         CHECK_ERR( COMPLETE_STRING != nIdx, "HintsCheck: no GetStartOf" );
 
         // 6) gleiche Pointer in beiden Arrays
-        if (m_HintEnds.find(const_cast<SwTextAttr*>(pHt)) == m_HintEnds.end())
+        if (m_HintsByEnd.find(const_cast<SwTextAttr*>(pHt)) == m_HintsByEnd.end())
             nIdx = COMPLETE_STRING;
 
         CHECK_ERR( COMPLETE_STRING != nIdx, "HintsCheck: no GetEndOf" );
@@ -245,8 +232,8 @@ bool SwpHintsArray::Check(bool bPortionsMerged) const
                    "HintsCheck: Character attribute in end array" );
 
         // 8) style portion check
-        const SwTextAttr* pHtThis = m_HintStarts[i];
-        const SwTextAttr* pHtLast = i > 0 ? m_HintStarts[i-1] : 0;
+        const SwTextAttr* pHtThis = m_HintsByStart[i];
+        const SwTextAttr* pHtLast = i > 0 ? m_HintsByStart[i-1] : 0;
         CHECK_ERR( (0 == i)
             ||  (   (RES_TXTATR_CHARFMT != pHtLast->Which())
                 &&  (RES_TXTATR_AUTOFMT != pHtLast->Which()))
@@ -297,7 +284,7 @@ bool SwpHintsArray::Check(bool bPortionsMerged) const
                     bool bFound(false);
                     for (size_t j = i + 1; j < Count(); ++j)
                     {
-                        SwTextAttr *const pOther(m_HintStarts[j]);
+                        SwTextAttr *const pOther(m_HintsByStart[j]);
                         if (pOther->GetStart() > *pHt->End())
                         {
                             break; // done
@@ -343,7 +330,7 @@ bool SwpHintsArray::Check(bool bPortionsMerged) const
         {
             for ( size_t j = 0; j < Count(); ++j )
             {
-                SwTextAttr const * const pOther( m_HintStarts[j] );
+                SwTextAttr const * const pOther( m_HintsByStart[j] );
                 if ( pOther->IsNesting() &&  (i != j) )
                 {
                     SwComparePosition cmp = ComparePosition(
@@ -361,7 +348,7 @@ bool SwpHintsArray::Check(bool bPortionsMerged) const
         {
             for ( size_t j = 0; j < i; ++j )
             {
-                SwTextAttr const * const pOther( m_HintStarts[j] );
+                SwTextAttr const * const pOther( m_HintsByStart[j] );
                 if (pOther->HasDummyChar())
                 {
                     CHECK_ERR( (pOther->GetStart() != pHtThis->GetStart()),
@@ -377,13 +364,13 @@ bool SwpHintsArray::Check(bool bPortionsMerged) const
 
 // Resort() is called before every Insert and Delete.
 // Various SwTextNode methods modify hints in a way that violates the
-// sort order of the m_HintStarts, m_HintEnds arrays, so this method is needed
+// sort order of the m_HintsByStart, m_HintsByEnd arrays, so this method is needed
 // to restore the order.
 
-void SwpHintsArray::Resort()
+void SwpHints::Resort()
 {
-    m_HintStarts.Resort();
-    m_HintEnds.Resort();
+    m_HintsByStart.Resort();
+    m_HintsByEnd.Resort();
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 3317369..aa37458 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -254,7 +254,7 @@ SwTextNode::~SwTextNode()
         {
             // first remove the attribute from the array otherwise
             // if would delete itself
-            DestroyAttr( pTmpHints->GetTextHint( --j ) );
+            DestroyAttr( pTmpHints->Get( --j ) );
         }
 
         delete pTmpHints;
@@ -311,7 +311,7 @@ static void lcl_ChangeFootnoteRef( SwTextNode &rNode )
         SwFootnoteFrm* pFirstFootnoteOfNode = 0;
         for( size_t j = pSwpHints->Count(); j; )
         {
-            SwTextAttr* pHt = pSwpHints->GetTextHint(--j);
+            SwTextAttr* pHt = pSwpHints->Get(--j);
             if (RES_TXTATR_FTN == pHt->Which())
             {
                 if( !pFrm )
@@ -464,7 +464,7 @@ SwContentNode *SwTextNode::SplitContentNode( const SwPosition &rPos )
             {
                 for ( size_t j = m_pSwpHints->Count(); j; )
                 {
-                    SwTextAttr* const pHt = m_pSwpHints->GetTextHint( --j );
+                    SwTextAttr* const pHt = m_pSwpHints->Get( --j );
                     if ( RES_TXTATR_FLYCNT == pHt ->Which() )
                     {
                         pHt->GetFlyCnt().GetFrameFormat()->DelFrms();
@@ -552,7 +552,7 @@ SwContentNode *SwTextNode::SplitContentNode( const SwPosition &rPos )
         {
             for ( size_t j = m_pSwpHints->Count(); j; )
             {
-                SwTextAttr* const pHt = m_pSwpHints->GetTextHint( --j );
+                SwTextAttr* const pHt = m_pSwpHints->Get( --j );
                 const sal_Int32* const pEnd = pHt->GetEnd();
                 if ( pHt->DontExpand() && pEnd && (pHt->GetStart() == *pEnd) )
                 {
@@ -609,7 +609,7 @@ void SwTextNode::MoveTextAttr_To_AttrSet()
     OSL_ENSURE( m_pSwpHints, "MoveTextAttr_To_AttrSet without SwpHints?" );
     for ( size_t i = 0; m_pSwpHints && i < m_pSwpHints->Count(); ++i )
     {
-        SwTextAttr *pHt = m_pSwpHints->GetTextHint(i);
+        SwTextAttr *pHt = m_pSwpHints->Get(i);
 
         if( pHt->GetStart() )
             break;
@@ -866,7 +866,7 @@ void SwTextNode::Update(
             {
                 bool bTextAttrChanged = false;
                 bool bStartOfTextAttrChanged = false;
-                SwTextAttr * const pHint = m_pSwpHints->GetTextHint(n);
+                SwTextAttr * const pHint = m_pSwpHints->Get(n);
                 sal_Int32 &       rStart = pHint->GetStart();
                 if ( rStart > nChangePos )
                 {
@@ -930,7 +930,7 @@ void SwTextNode::Update(
             for ( size_t n = 0; n < m_pSwpHints->Count(); ++n )
             {
                 bool bTextAttrChanged = false;
-                SwTextAttr * const pHint = m_pSwpHints->GetTextHint(n);
+                SwTextAttr * const pHint = m_pSwpHints->Get(n);
                 sal_Int32 &       rStart = pHint->GetStart();
                 sal_Int32 * const pEnd = pHint->GetEnd();
                 if ( rStart >= nChangePos )
@@ -1244,11 +1244,11 @@ bool SwTextNode::DontExpandFormat( const SwIndex& rIdx, bool bFlag,
     bool bRet = false;
     if ( HasHints() )
     {
-        const size_t nEndCnt = m_pSwpHints->GetEndCount();
+        const size_t nEndCnt = m_pSwpHints->Count();
         size_t nPos = nEndCnt;
         while( nPos )
         {
-            SwTextAttr *pTmp = m_pSwpHints->GetEnd( --nPos );
+            SwTextAttr *pTmp = m_pSwpHints->GetSortedByEnd( --nPos );
             sal_Int32 *pEnd = pTmp->GetEnd();
             if( !pEnd || *pEnd > nIdx )
                 continue;
@@ -1300,7 +1300,7 @@ lcl_GetTextAttrs(
 
     for( size_t i = 0; i < nSize; ++i )
     {
-        SwTextAttr *const pHint = pSwpHints->GetTextHint(i);
+        SwTextAttr *const pHint = pSwpHints->Get(i);
         sal_Int32 const nHintStart = pHint->GetStart();
         if (nIndex < nHintStart)
         {
@@ -1580,7 +1580,7 @@ void SwTextNode::CopyAttr( SwTextNode *pDest, const sal_Int32 nTextStartIdx,
 
         for ( size_t i = 0; i < m_pSwpHints->Count(); ++i )
         {
-            SwTextAttr *const pHt = m_pSwpHints->GetTextHint(i);
+            SwTextAttr *const pHt = m_pSwpHints->Get(i);
             sal_Int32 const nAttrStartIdx = pHt->GetStart();
             if ( nTextStartIdx < nAttrStartIdx )
                 break; // ueber das Textende, da nLen == 0
@@ -1764,11 +1764,11 @@ void SwTextNode::CopyText( SwTextNode *const pDest,
     //Achtung: kann ungueltig sein!!
     for (size_t n = 0; n < nSize; ++n)
     {
-        const sal_Int32 nAttrStartIdx = (*m_pSwpHints)[n]->GetStart();
+        const sal_Int32 nAttrStartIdx = m_pSwpHints->Get(n)->GetStart();
         if (!( nAttrStartIdx < nEnd))
             break;
 
-        SwTextAttr * const pHt = m_pSwpHints->GetTextHint(n);
+        SwTextAttr * const pHt = m_pSwpHints->Get(n);
         const sal_Int32 * const pEndIdx = pHt->GetEnd();
         const sal_uInt16 nWhich = pHt->Which();
 
@@ -1948,9 +1948,9 @@ OUString SwTextNode::InsertText( const OUString & rStr, const SwIndex & rIdx,
     {
         bool bMergePortionsNeeded(false);
         for ( size_t i = 0; i < m_pSwpHints->Count() &&
-                rIdx >= (*m_pSwpHints)[i]->GetStart(); ++i )
+                rIdx >= m_pSwpHints->Get(i)->GetStart(); ++i )
         {
-            SwTextAttr * const pHt = m_pSwpHints->GetTextHint( i );
+            SwTextAttr * const pHt = m_pSwpHints->Get( i );
             sal_Int32 * const pEndIdx = pHt->GetEnd();
             if( !pEndIdx )
                 continue;
@@ -2110,7 +2110,7 @@ void SwTextNode::CutImpl( SwTextNode * const pDest, const SwIndex & rDestStart,
     size_t nAttrCnt = 0;
     while (m_pSwpHints && (nAttrCnt < m_pSwpHints->Count()))
     {
-        SwTextAttr * const pHt = m_pSwpHints->GetTextHint(nAttrCnt);
+        SwTextAttr * const pHt = m_pSwpHints->Get(nAttrCnt);
         const sal_Int32 nAttrStartIdx = pHt->GetStart();
         if (!( nAttrStartIdx < nEnd ))
             break;
@@ -2204,7 +2204,7 @@ void SwTextNode::CutImpl( SwTextNode * const pDest, const SwIndex & rDestStart,
         SwpHts aArr;
         while (nAttrCnt < m_pSwpHints->Count())
         {
-            SwTextAttr * const pHt = m_pSwpHints->GetTextHint(nAttrCnt);
+            SwTextAttr * const pHt = m_pSwpHints->Get(nAttrCnt);
             if (nEnd != pHt->GetStart())
                 break;
             const sal_Int32 * const pEndIdx = pHt->GetEnd();
@@ -2266,7 +2266,7 @@ void SwTextNode::EraseText(const SwIndex &rIdx, const sal_Int32 nCount,
 
     for ( size_t i = 0; m_pSwpHints && i < m_pSwpHints->Count(); ++i )
     {
-        SwTextAttr *pHt = m_pSwpHints->GetTextHint(i);
+        SwTextAttr *pHt = m_pSwpHints->Get(i);
 
         const sal_Int32 nHintStart = pHt->GetStart();
 
@@ -2362,7 +2362,7 @@ void SwTextNode::GCAttr()
 
     for ( size_t i = 0; m_pSwpHints && i < m_pSwpHints->Count(); ++i )
     {
-        SwTextAttr * const pHt = m_pSwpHints->GetTextHint(i);
+        SwTextAttr * const pHt = m_pSwpHints->Get(i);
 
         // wenn Ende und Start gleich sind --> loeschen
         const sal_Int32 * const pEndIdx = pHt->GetEnd();
@@ -2653,7 +2653,7 @@ SwTextAttr * SwTextNode::GetTextAttrForCharAt(
     {
         for ( size_t i = 0; i < m_pSwpHints->Count(); ++i )
         {
-            SwTextAttr * const pHint = m_pSwpHints->GetTextHint(i);
+            SwTextAttr * const pHint = m_pSwpHints->Get(i);
             const sal_Int32 nStartPos = pHint->GetStart();
             if ( nIndex < nStartPos )
             {
@@ -3080,7 +3080,7 @@ bool SwTextNode::GetExpandText( SwTextNode& rDestNd, const SwIndex* pDestIdx,
         sal_Int32 nInsPos = nDestStt - nIdx;
         for ( size_t i = 0; i < m_pSwpHints->Count(); ++i )
         {
-            const SwTextAttr* pHt = (*m_pSwpHints)[i];
+            const SwTextAttr* pHt = m_pSwpHints->Get(i);
             const sal_Int32 nAttrStartIdx = pHt->GetStart();
             const sal_uInt16 nWhich = pHt->Which();
             if (nIdx + nLen <= nAttrStartIdx)
@@ -4862,7 +4862,7 @@ void SwTextNode::dumpAsXml(xmlTextWriterPtr pWriter) const
         xmlTextWriterStartElement(pWriter, BAD_CAST("swpHints"));
         const SwpHints& rHints = GetSwpHints();
         for (size_t i = 0; i < rHints.Count(); ++i)
-            rHints.GetTextHint(i)->dumpAsXml(pWriter);
+            rHints.Get(i)->dumpAsXml(pWriter);
         xmlTextWriterEndElement(pWriter);
     }
 
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index 3da268e..f13c1d4 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -282,7 +282,7 @@ lcl_DoSplitNew(NestList_t & rSplits, SwTextNode & rNode,
  */
 void SwpHints::InsertNesting(SwTextAttrNesting & rNewHint)
 {
-    SwpHintsArray::Insert(& rNewHint);
+    Insert(& rNewHint);
     NoteInHistory( & rNewHint, true );
 }
 
@@ -375,9 +375,9 @@ SwpHints::TryInsertNesting( SwTextNode & rNode, SwTextAttrNesting & rNewHint )
     SplitNew.push_back(& rNewHint);
 
     // pass 1: split the inserted hint into fragments if necessary
-    for ( size_t i = 0; i < GetEndCount(); ++i )
+    for ( size_t i = 0; i < Count(); ++i )
     {
-        SwTextAttr * const pOther = GetEnd(i);
+        SwTextAttr * const pOther = GetSortedByEnd(i);
 
         if (pOther->IsNesting())
         {
@@ -610,7 +610,7 @@ void SwpHints::BuildPortions( SwTextNode& rNode, SwTextAttr& rNewHint,
     {
         for ( size_t i = 0; i < Count(); ++i )
         {
-            SwTextAttr* pOther = GetTextHint(i);
+            SwTextAttr* pOther = Get(i);
 
             if ( RES_TXTATR_CHARFMT != pOther->Which() &&
                  RES_TXTATR_AUTOFMT != pOther->Which() )
@@ -661,7 +661,7 @@ void SwpHints::BuildPortions( SwTextNode& rNode, SwTextAttr& rNewHint,
         // Insert the newly created attributes:
         for ( aIter = aInsDelHints.begin(); aIter != aInsDelHints.end(); ++aIter )
         {
-            SwpHintsArray::Insert( *aIter );
+            Insert( *aIter );
             NoteInHistory( *aIter, true );
         }
     }
@@ -681,7 +681,7 @@ void SwpHints::BuildPortions( SwTextNode& rNode, SwTextAttr& rNewHint,
     {
         for ( size_t i = 0; i < Count(); ++i )
         {
-            const SwTextAttr* pOther = GetTextHint(i);
+            const SwTextAttr* pOther = Get(i);
 
             if ( RES_TXTATR_CHARFMT != pOther->Which() &&
                  RES_TXTATR_AUTOFMT != pOther->Which() )
@@ -713,7 +713,7 @@ void SwpHints::BuildPortions( SwTextNode& rNode, SwTextAttr& rNewHint,
         // Get all hints that are in [nPorStart, nPorEnd[:
         for ( size_t i = 0; i < Count(); ++i )
         {
-            SwTextAttr *pOther = GetTextHint(i);
+            SwTextAttr *pOther = Get(i);
 
             if ( RES_TXTATR_CHARFMT != pOther->Which() &&
                  RES_TXTATR_AUTOFMT != pOther->Which() )
@@ -798,7 +798,7 @@ void SwpHints::BuildPortions( SwTextNode& rNode, SwTextAttr& rNewHint,
                     {
                         pNewAttr = MakeTextAttr( *rNode.GetDoc(),
                                 aNewSet, nPorStart, nPorEnd );
-                        SwpHintsArray::Insert( pNewAttr );
+                        Insert( pNewAttr );
                         NoteInHistory( pNewAttr, true );
                     }
                 }
@@ -940,7 +940,7 @@ void SwpHints::BuildPortions( SwTextNode& rNode, SwTextAttr& rNewHint,
 
         if ( pNewAttr )
         {
-            SwpHintsArray::Insert( pNewAttr );
+            Insert( pNewAttr );
 //            if ( bDestroyHint )
                 NoteInHistory( pNewAttr, true );
         }
@@ -1694,7 +1694,7 @@ void SwTextNode::DeleteAttributes(
 
     for ( size_t nPos = 0; m_pSwpHints && nPos < m_pSwpHints->Count(); ++nPos )
     {
-        SwTextAttr * const pTextHt = m_pSwpHints->GetTextHint( nPos );
+        SwTextAttr * const pTextHt = m_pSwpHints->Get( nPos );
         const sal_Int32 nHintStart = pTextHt->GetStart();
         if (nStart < nHintStart)
         {
@@ -1874,7 +1874,7 @@ bool SwTextNode::SetAttr(
         {
             for ( size_t n = 0; n < m_pSwpHints->Count(); ++n )
             {
-                if ( (*m_pSwpHints)[ n ]->IsCharFormatAttr() )
+                if ( m_pSwpHints->Get( n )->IsCharFormatAttr() )
                 {
                     bHasCharFormats = true;
                     break;
@@ -2109,7 +2109,7 @@ bool SwTextNode::GetAttr( SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd,
         {
             for (size_t n = 0; n < nSize; ++n)
             {
-                const SwTextAttr* pHt = (*m_pSwpHints)[n];
+                const SwTextAttr* pHt = m_pSwpHints->Get(n);
                 const sal_Int32 nAttrStart = pHt->GetStart();
                 if( nAttrStart > nEnd )         // ueber den Bereich hinaus
                     break;
@@ -2135,7 +2135,7 @@ bool SwTextNode::GetAttr( SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd,
 
             for (size_t n = 0; n < nSize; ++n)
             {
-                const SwTextAttr* pHt = (*m_pSwpHints)[n];
+                const SwTextAttr* pHt = m_pSwpHints->Get(n);
                 const sal_Int32 nAttrStart = pHt->GetStart();
                 if( nAttrStart > nEnd )         // ueber den Bereich hinaus
                     break;
@@ -2359,7 +2359,7 @@ lcl_CollectHintSpans(const SwpHints& i_rHints, const sal_Int32 nLength,
 
     for (size_t i = 0; i < i_rHints.Count(); ++i)
     {
-        const SwTextAttr* const pHint(i_rHints[i]);
+        const SwTextAttr* pHint = i_rHints.Get(i);
         const sal_uInt16 nWhich(pHint->Which());
         if (nWhich == RES_TXTATR_CHARFMT || nWhich == RES_TXTATR_AUTOFMT)
         {
@@ -2580,7 +2580,7 @@ void SwpHints::CalcFlags()
     const size_t nSize = Count();
     for( size_t nPos = 0; nPos < nSize; ++nPos )
     {
-        const SwTextAttr* pAttr = (*this)[ nPos ];
+        const SwTextAttr* pAttr = Get( nPos );
         switch( pAttr->Which() )
         {
         case RES_TXTATR_FTN:
@@ -2613,7 +2613,7 @@ bool SwpHints::CalcHiddenParaField()
 
     for( size_t nPos = 0; nPos < nSize; ++nPos )
     {
-        pTextHt = (*this)[ nPos ];
+        pTextHt = Get(nPos);
         const sal_uInt16 nWhich = pTextHt->Which();
 
         if( RES_TXTATR_FIELD == nWhich )
@@ -2648,7 +2648,7 @@ bool SwpHints::MergePortions( SwTextNode& rNode )
         return false;
 
     // sort before merging
-    SwpHintsArray::Resort();
+    Resort();
 
     bool bRet = false;
     typedef std::multimap< int, std::pair<SwTextAttr*, bool> > PortionMap;
@@ -2660,7 +2660,7 @@ bool SwpHints::MergePortions( SwTextNode& rNode )
     // get portions by start position:
     for ( size_t i = 0; i < Count(); ++i )
     {
-        SwTextAttr *pHt = GetTextHint( i );
+        SwTextAttr *pHt = Get( i );
         if ( RES_TXTATR_CHARFMT != pHt->Which() &&
              RES_TXTATR_AUTOFMT != pHt->Which() )
              //&&
@@ -2679,7 +2679,7 @@ bool SwpHints::MergePortions( SwTextNode& rNode )
                 // could be produced by ReplaceText or (maybe?) RstAttr
                 if (pHt->GetStart() == *pHt->GetEnd())
                 {
-                    SwpHintsArray::DeleteAtPos(i); // kill it without History!
+                    DeleteAtPos(i); // kill it without History!
                     SwTextAttr::Destroy(pHt, rNode.GetDoc()->GetAttrPool());
                     --i;
                     continue;
@@ -2871,7 +2871,7 @@ bool SwpHints::MergePortions( SwTextNode& rNode )
 
             if (bRet)
             {
-                SwpHintsArray::Resort();
+                Resort();
             }
         }
         else
@@ -2922,7 +2922,7 @@ static void lcl_CheckSortNumber( const SwpHints& rHints, SwTextCharFormat& rNewC
 
     for ( size_t i = 0; i < rHints.Count(); ++i )
     {
-        const SwTextAttr* pOtherHt = rHints[i];
+        const SwTextAttr* pOtherHt = rHints.Get(i);
 
         const sal_Int32 nOtherStart = pOtherHt->GetStart();
 
@@ -3115,7 +3115,7 @@ bool SwpHints::TryInsertHint(
             sal_Int32 *pTmpHintEnd;
             for( size_t n = 0, nEnd = Count(); n < nEnd; ++n )
             {
-                if (RES_TXTATR_REFMARK == (pTmpHt = GetTextHint(n))->Which() &&
+                if (RES_TXTATR_REFMARK == (pTmpHt = Get(n))->Which() &&
                     pHint->GetAttr() == pTmpHt->GetAttr() &&
                     0 != ( pTmpHtEnd = pTmpHt->GetEnd() ) &&
                     0 != ( pTmpHintEnd = pHint->GetEnd() ) )
@@ -3181,7 +3181,7 @@ bool SwpHints::TryInsertHint(
     sal_Int32 nHtStart = pHint->GetStart();
     if( !pHtEnd )
     {
-        SwpHintsArray::Insert( pHint );
+        Insert( pHint );
         CalcFlags();
 #ifdef DBG_UTIL
         if( !rNode.GetDoc()->IsInReading() )
@@ -3266,7 +3266,7 @@ bool SwpHints::TryInsertHint(
             if ( RES_TXTATR_CHARFMT == nWhich )
                 lcl_CheckSortNumber(*this, *static_txtattr_cast<SwTextCharFormat*>(pHint));
 
-            SwpHintsArray::Insert( pHint );
+            Insert( pHint );
             NoteInHistory( pHint, true );
         }
     }
@@ -3292,10 +3292,19 @@ bool SwpHints::TryInsertHint(
 
 void SwpHints::DeleteAtPos( const size_t nPos )
 {
-    SwTextAttr *pHint = GetTextHint(nPos);
+    SwTextAttr *pHint = Get(nPos);
     // ChainDelete( pHint );
     NoteInHistory( pHint );
-    SwpHintsArray::DeleteAtPos( nPos );
+
+    // optimization: nPos is the position in the Starts array
+    SwTextAttr *pHt = m_HintsByStart[ nPos ];
+    m_HintsByStart.erase( m_HintsByStart.begin() + nPos );
+
+    Resort();
+
+    bool const done = m_HintsByEnd.erase(pHt);
+    assert(done);
+    (void) done; // unused in NDEBUG
 
     if( pHint->Which() == RES_TXTATR_FIELD )
     {
@@ -3331,7 +3340,7 @@ void SwpHints::DeleteAtPos( const size_t nPos )
 void SwpHints::Delete( SwTextAttr* pTextHt )
 {
     // Attr 2.0: SwpHintsArr::Delete( pTextHt );
-    const size_t nPos = GetStartOf( pTextHt );
+    const size_t nPos = GetIndexOf( pTextHt );
     OSL_ENSURE( SAL_MAX_SIZE != nPos, "Attribut nicht im Attribut-Array!" );
     if( SAL_MAX_SIZE != nPos )
         DeleteAtPos( nPos );
@@ -3344,7 +3353,7 @@ void SwTextNode::ClearSwpHintsArr( bool bDelFields )
         size_t nPos = 0;
         while ( nPos < m_pSwpHints->Count() )
         {
-            SwTextAttr* pDel = m_pSwpHints->GetTextHint( nPos );
+            SwTextAttr* pDel = m_pSwpHints->Get( nPos );
             bool bDel = false;
 
             switch( pDel->Which() )
@@ -3365,7 +3374,7 @@ void SwTextNode::ClearSwpHintsArr( bool bDelFields )
 
             if( bDel )
             {
-                m_pSwpHints->SwpHintsArray::DeleteAtPos( nPos );
+                m_pSwpHints->DeleteAtPos( nPos );
                 DestroyAttr( pDel );
             }
             else
@@ -3394,7 +3403,7 @@ sal_uInt16 SwTextNode::GetLang( const sal_Int32 nBegin, const sal_Int32 nLen,
         for ( size_t i = 0; i < nSize; ++i )
         {
             // ist der Attribut-Anfang schon groesser als der Idx ?
-            const SwTextAttr *pHt = m_pSwpHints->operator[](i);
+            const SwTextAttr *pHt = m_pSwpHints->Get(i);
             const sal_Int32 nAttrStart = pHt->GetStart();
             if( nEnd < nAttrStart )
                 break;
diff --git a/sw/source/core/txtnode/txatritr.cxx b/sw/source/core/txtnode/txatritr.cxx
index c9f7158..37d4133 100644
--- a/sw/source/core/txtnode/txatritr.cxx
+++ b/sw/source/core/txtnode/txatritr.cxx
@@ -202,7 +202,7 @@ void SwTextAttrIterator::SearchNextChg()
         const SfxPoolItem* pItem = 0;
         for( ; nAttrPos < pHts->Count(); ++nAttrPos )
         {
-            const SwTextAttr* pHt = (*pHts)[ nAttrPos ];
+            const SwTextAttr* pHt = pHts->Get( nAttrPos );
             const sal_Int32* pEnd = pHt->End();
             const sal_Int32 nHtStt = pHt->GetStart();
             if( nHtStt < nStt && ( !pEnd || *pEnd <= nStt ))
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index ac22a84..582c60f 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -421,10 +421,10 @@ void SwTextNode::RstTextAttr(
     sal_Int32 nAttrStart;
     SwTextAttr *pHt = NULL;
     while ( (i < m_pSwpHints->Count())
-            && ( ( ( nAttrStart = (*m_pSwpHints)[i]->GetStart()) < nEnd )
+            && ( ( ( nAttrStart = m_pSwpHints->Get(i)->GetStart()) < nEnd )
                  || nLen==0 ) && !bExactRange)
     {
-        pHt = m_pSwpHints->GetTextHint(i);
+        pHt = m_pSwpHints->Get(i);
 
         // attributes without end stay in!
         // but consider <bInclRefToxMark> used by Undo
@@ -605,7 +605,7 @@ void SwTextNode::RstTextAttr(
         // Only delete the hints which start at nStt and end at nEnd.
         for (i = 0; i < m_pSwpHints->Count(); ++i)
         {
-            SwTextAttr* pHint = m_pSwpHints->GetTextHint(i);
+            SwTextAttr* pHint = m_pSwpHints->Get(i);
             if (pHint->GetStart() != nStt)
                 continue;
 
diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index fc6b51e..294ab3e 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -1244,7 +1244,7 @@ void SwHistory::CopyAttr(
     for( size_t n = 0; n < pHts->Count(); ++n )
     {
         // nAttrStt must even be set when !pEndIdx
-        pHt = pHts->GetTextHint(n);
+        pHt = pHts->Get(n);
         const sal_Int32 nAttrStt = pHt->GetStart();
         const sal_Int32 * pEndIdx = pHt->GetEnd();
         if( 0 !=  pEndIdx && nAttrStt > nEnd )
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx
index c6dcb50..e43aeb6 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -675,9 +675,9 @@ bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
                 }
                 Sequence< OUString> aCharStyles;
                 SwpHints* pHints = pTextNode->GetpSwpHints();
-                for( size_t nAttr = 0; nAttr < pHints->GetStartCount(); ++nAttr )
+                for( size_t nAttr = 0; nAttr < pHints->Count(); ++nAttr )
                 {
-                    SwTextAttr* pAttr = pHints->GetStart( nAttr );
+                    SwTextAttr* pAttr = pHints->Get( nAttr );
                     if(pAttr->Which() != RES_TXTATR_CHARFMT)
                         continue;
                     const sal_Int32 nAttrStart = pAttr->GetStart();
diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx
index 713a531..b90039b 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -728,13 +728,13 @@ lcl_ExportHints(
     //search for special text attributes - first some ends
     size_t nEndIndex = 0;
     sal_Int32 nNextEnd = 0;
-    while(nEndIndex < pHints->GetEndCount() &&
-        (!pHints->GetEnd(nEndIndex)->GetEnd() ||
-        nCurrentIndex >= (nNextEnd = (*pHints->GetEnd(nEndIndex)->GetEnd()))))
+    while(nEndIndex < pHints->Count() &&
+        (!pHints->GetSortedByEnd(nEndIndex)->GetEnd() ||
+        nCurrentIndex >= (nNextEnd = (*pHints->GetSortedByEnd(nEndIndex)->GetEnd()))))
     {
-        if(pHints->GetEnd(nEndIndex)->GetEnd())
+        if(pHints->GetSortedByEnd(nEndIndex)->GetEnd())
         {
-            SwTextAttr * const pAttr = pHints->GetEnd(nEndIndex);
+            SwTextAttr * const pAttr = pHints->GetSortedByEnd(nEndIndex);
             if (nNextEnd == nCurrentIndex)
             {
                 const sal_uInt16 nWhich( pAttr->Which() );
@@ -779,7 +779,7 @@ lcl_ExportHints(
                             // (necessary for SwXMeta::createEnumeration)
                             if (pAttr->GetStart() + 1 == i_nStartPos)
                             {
-                                nEndIndex = pHints->GetEndCount() - 1;
+                                nEndIndex = pHints->Count() - 1;
                             }
                             break;
                         }
@@ -809,10 +809,10 @@ lcl_ExportHints(
     // then some starts
     size_t nStartIndex = 0;
     sal_Int32 nNextStart = 0;
-    while(nStartIndex < pHints->GetStartCount() &&
-        nCurrentIndex >= (nNextStart = pHints->GetStart(nStartIndex)->GetStart()))
+    while(nStartIndex < pHints->Count() &&
+        nCurrentIndex >= (nNextStart = pHints->Get(nStartIndex)->GetStart()))
     {
-        SwTextAttr * const pAttr = pHints->GetStart(nStartIndex);
+        SwTextAttr * const pAttr = pHints->Get(nStartIndex);
         sal_uInt16 nAttrWhich = pAttr->Which();
         if (nNextStart == nCurrentIndex)
         {
@@ -995,14 +995,14 @@ lcl_ExportHints(
 
         nStartIndex = 0;
         nNextStart = 0;
-        while(nStartIndex < pHints->GetStartCount() &&
-            nCurrentIndex >= (nNextStart = pHints->GetStart(nStartIndex)->GetStart()))
+        while(nStartIndex < pHints->Count() &&
+            nCurrentIndex >= (nNextStart = pHints->Get(nStartIndex)->GetStart()))
             nStartIndex++;
 
         nEndIndex = 0;
         nNextEnd = 0;
-        while(nEndIndex < pHints->GetEndCount() &&
-            nCurrentIndex >= (nNextEnd = (*pHints->GetEnd(nEndIndex)->GetAnyEnd())))
+        while(nEndIndex < pHints->Count() &&
+            nCurrentIndex >= (nNextEnd = (*pHints->GetSortedByEnd(nEndIndex)->GetAnyEnd())))
             nEndIndex++;
 
         sal_Int32 nNextPos =
diff --git a/sw/source/filter/ascii/ascatr.cxx b/sw/source/filter/ascii/ascatr.cxx
index a4f32b8..5ed77ce 100644
--- a/sw/source/filter/ascii/ascatr.cxx
+++ b/sw/source/filter/ascii/ascatr.cxx
@@ -87,7 +87,7 @@ sal_Int32 SwASC_AttrIter::SearchNext( sal_Int32 nStartPos )
         // are sorted by starting position. We would need to remember two indices, however.
         for ( size_t i = 0; i < pTextAttrs->Count(); ++i )
         {
-            const SwTextAttr* pHt = (*pTextAttrs)[i];
+            const SwTextAttr* pHt = pTextAttrs->Get(i);
             if ( pHt->HasDummyChar() )
             {
                 sal_Int32 nPos = pHt->GetStart();
@@ -125,7 +125,7 @@ bool SwASC_AttrIter::OutAttr( sal_Int32 nSwPos )
     {
         for( size_t i = 0; i < pTextAttrs->Count(); ++i )
         {
-            const SwTextAttr* pHt = (*pTextAttrs)[i];
+            const SwTextAttr* pHt = pTextAttrs->Get(i);
             if ( ( pHt->HasDummyChar()
                    || pHt->HasContent() )
                  && nSwPos == pHt->GetStart() )
diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx
index f8f6d4d7..375e914 100644
--- a/sw/source/filter/html/htmlatr.cxx
+++ b/sw/source/filter/html/htmlatr.cxx
@@ -2342,7 +2342,7 @@ Writer& OutHTML_SwTextNode( Writer& rWrt, const SwContentNode& rNode )
     sal_Int32 nStrPos = rHTMLWrt.pCurPam->GetPoint()->nContent.GetIndex();
     const SwTextAttr * pHt = 0;
     const size_t nCntAttr = pNd->HasHints() ? pNd->GetSwpHints().Count() : 0;
-    if( nCntAttr && nStrPos > ( pHt = pNd->GetSwpHints()[ 0 ] )->GetStart() )
+    if( nCntAttr && nStrPos > ( pHt = pNd->GetSwpHints().Get(0) )->GetStart() )
     {
         // Ok, es gibt vorher Attribute, die ausgegeben werden muessen
         do {
@@ -2382,7 +2382,7 @@ Writer& OutHTML_SwTextNode( Writer& rWrt, const SwContentNode& rNode )
             }
 
         } while( nAttrPos < nCntAttr && nStrPos >
-            ( pHt = pNd->GetSwpHints()[ nAttrPos ] )->GetStart() );
+            ( pHt = pNd->GetSwpHints().Get( nAttrPos ) )->GetStart() );
 
         // dann gebe mal alle gesammelten Attribute von der String-Pos aus
         aEndPosLst.OutEndAttrs( rHTMLWrt, nStrPos + nOffset );
@@ -2448,7 +2448,7 @@ Writer& OutHTML_SwTextNode( Writer& rWrt, const SwContentNode& rNode )
                         bOutChar = false;       // keine 255 ausgeben
                     }
                 } while( ++nAttrPos < nCntAttr && nStrPos ==
-                    ( pHt = pNd->GetSwpHints()[ nAttrPos ] )->GetStart() );
+                    ( pHt = pNd->GetSwpHints().Get( nAttrPos ) )->GetStart() );
             }
 
             // Manche Draw-Formate koennen auch noch Attribute mitbringen
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index 7ad8b7b..22ede3a 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -2289,7 +2289,7 @@ bool SwHTMLParser::AppendTextNode( SwHTMLAppendMode eMode, bool bUpdateNum )
         SwpHints& rHints = pTextNd->GetSwpHints();
         for( size_t i=0; i < nCntAttr; i++ )
         {
-            SwTextAttr *pHt = rHints.GetTextHint( i );
+            SwTextAttr *pHt = rHints.Get( i );
             sal_uInt16 nWhich = pHt->Which();
             sal_Int16 nIdx = 0;
             bool bFont = false;
@@ -2429,7 +2429,7 @@ void SwHTMLParser::AddParSpace()
 
             for(size_t i = 0; i < nCntAttr; ++i)
             {
-                SwTextAttr *const pHt = pTextNode->GetSwpHints().GetTextHint(i);
+                SwTextAttr *const pHt = pTextNode->GetSwpHints().Get(i);
                 sal_uInt16 const nWhich = pHt->Which();
                 if (RES_CHRATR_CJK_FONT == nWhich ||
                     RES_CHRATR_CJK_FONTSIZE == nWhich ||
diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx
index ea5e12b..6a6782c 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -915,7 +915,7 @@ sal_uInt16 SwHTMLWriter::OutHeaderAttrs()
     sal_Int32 nOldPos = 0;
     for( size_t i=0; i<nCntAttr; ++i )
     {
-        const SwTextAttr *pHt = pTextNd->GetSwpHints()[i];
+        const SwTextAttr *pHt = pTextNd->GetSwpHints().Get(i);
         if( !pHt->End() )
         {
             sal_Int32 nPos = pHt->GetStart();
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 14ac38b..cb2da65 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -312,7 +312,7 @@ sal_Int32 SwWW8AttrIter::SearchNext( sal_Int32 nStartPos )
 // but then we'd have to save 2 indices
         for( size_t i = 0; i < pTextAttrs->Count(); ++i )
         {
-            const SwTextAttr* pHt = (*pTextAttrs)[i];
+            const SwTextAttr* pHt = pTextAttrs->Get(i);
             sal_Int32 nPos = pHt->GetStart();    // first Attr characters
             if( nPos >= nStartPos && nPos <= nMinPos )
                 nMinPos = nPos;
@@ -419,7 +419,7 @@ void SwWW8AttrIter::OutAttr( sal_Int32 nSwPos, bool bRuby )
     {
         for( size_t i = 0; i < pTextAttrs->Count(); ++i )
         {
-            const SwTextAttr* pHt = (*pTextAttrs)[i];
+            const SwTextAttr* pHt = pTextAttrs->Get(i);
             const sal_Int32* pEnd = pHt->End();
 
             if (pEnd ? ( nSwPos >= pHt->GetStart() && nSwPos < *pEnd)
@@ -665,7 +665,7 @@ bool SwWW8AttrIter::IsTextAttr( sal_Int32 nSwPos )
     {
         for (size_t i = 0; i < pTextAttrs->Count(); ++i)
         {
-            const SwTextAttr* pHt = (*pTextAttrs)[i];
+            const SwTextAttr* pHt = pTextAttrs->Get(i);
             if ( ( pHt->HasDummyChar() || pHt->HasContent() )
                  && (pHt->GetStart() == nSwPos) )
             {
@@ -722,7 +722,7 @@ const SfxPoolItem* SwWW8AttrIter::HasTextItem( sal_uInt16 nWhich ) const
         const sal_Int32 nTmpSwPos = m_rExport.m_aCurrentCharPropStarts.top();
         for (size_t i = 0; i < pTextAttrs->Count(); ++i)
         {
-            const SwTextAttr* pHt = (*pTextAttrs)[i];
+            const SwTextAttr* pHt = pTextAttrs->Get(i);
             const SfxPoolItem* pItem = &pHt->GetAttr();
             const sal_Int32 * pAtrEnd = 0;
             if( 0 != ( pAtrEnd = pHt->End() ) &&        // only Attr with an end
@@ -1234,9 +1234,9 @@ int SwWW8AttrIter::OutAttrWithRange(sal_Int32 nPos)
         m_rExport.m_aCurrentCharPropStarts.push( nPos );
         const sal_Int32* pEnd;
         // first process ends of attributes with extent
-        for (size_t i = 0; i < pTextAttrs->GetEndCount(); ++i)
+        for (size_t i = 0; i < pTextAttrs->Count(); ++i)
         {
-            const SwTextAttr* pHt = pTextAttrs->GetEnd(i);
+            const SwTextAttr* pHt = pTextAttrs->GetSortedByEnd(i);
             const SfxPoolItem* pItem = &pHt->GetAttr();
             switch ( pItem->Which() )
             {
@@ -1270,7 +1270,7 @@ int SwWW8AttrIter::OutAttrWithRange(sal_Int32 nPos)
         }
         for ( size_t i = 0; i < pTextAttrs->Count(); ++i )
         {
-            const SwTextAttr* pHt = (*pTextAttrs)[i];
+            const SwTextAttr* pHt = pTextAttrs->Get(i);
             const SfxPoolItem* pItem = &pHt->GetAttr();
             switch ( pItem->Which() )
             {
@@ -2763,7 +2763,7 @@ void MSWordExportBase::OutputTextNode( const SwTextNode& rNode )
     {
         for( size_t i = 0; i < pTextAttrs->Count(); ++i )
         {
-            const SwTextAttr* pHt = (*pTextAttrs)[i];
+            const SwTextAttr* pHt = pTextAttrs->Get(i);
             const sal_Int32 startPos = pHt->GetStart();    // first Attr characters
             const sal_Int32* endPos = pHt->End();    // end Attr characters
             // Check if these attributes are for the last character in the paragraph
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 1142325..0742005 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -5293,7 +5293,7 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss)
                     const SwpHints* pHints = pTextNode->GetpSwpHints();
                     for( size_t nHintPos = 0; pHints && nHintPos < pHints->Count(); ++nHintPos)
                     {
-                        const SwTextAttr *pHt = (*pHints)[nHintPos];
+                        const SwTextAttr *pHt = pHints->Get(nHintPos);
                         const sal_Int32 st = pHt->GetStart();
                         if( pHt
                             && pHt->Which() == RES_TXTATR_FLYCNT
commit b359064463fffab69425ad960bbf9f9984b32aaa
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Aug 27 14:42:39 2015 +0200

    loplugin:mergeclasses SvIdentifier
    
    Change-Id: If3b6ce64c7ad2cda1f992cfb10618fa7d7946fba

diff --git a/idl/inc/bastype.hxx b/idl/inc/bastype.hxx
index 1b87c11..6c552e8 100644
--- a/idl/inc/bastype.hxx
+++ b/idl/inc/bastype.hxx
@@ -66,39 +66,20 @@ public:
 
 class SvIdentifier
 {
-private:
-    OString m_aStr;
+    OString     m_aStr;
+    sal_uInt32  nValue;
 public:
-    SvIdentifier()
-    {
-    }
-    void setString(const OString& rStr)
-    {
-        m_aStr = rStr;
-    }
-    const OString& getString() const
-    {
-        return m_aStr;
-    }
-
-    bool IsSet() const
-    {
-        return !m_aStr.isEmpty();
-    }
-    bool        ReadSvIdl( SvStringHashEntry * pName, SvTokenStream & rInStm );
-};
+                SvIdentifier() : nValue( 0 ) {};
 
+    void        setString(const OString& rStr) { m_aStr = rStr; }
+    const OString& getString() const { return m_aStr; }
 
-class SvNumberIdentifier : public SvIdentifier
-{
-    sal_uInt32  nValue;
-public:
-                SvNumberIdentifier() : nValue( 0 ) {};
+    bool        ReadSvIdl( SvStringHashEntry * pName, SvTokenStream & rInStm );
     bool        IsSet() const
                 {
-                    return SvIdentifier::IsSet() || nValue != 0;
+                    return !m_aStr.isEmpty() || nValue != 0;
                 }
-    sal_uInt32      GetValue() const { return nValue; }
+    sal_uInt32  GetValue() const { return nValue; }
     void        SetValue( sal_uInt32 nVal ) { nValue = nVal; }
 
     bool        ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm );
@@ -140,7 +121,7 @@ public:
 };
 
 
-class SvHelpContext : public SvNumberIdentifier
+class SvHelpContext : public SvIdentifier
 {
 };
 
diff --git a/idl/inc/database.hxx b/idl/inc/database.hxx
index 8871c39..4031dde 100644
--- a/idl/inc/database.hxx
+++ b/idl/inc/database.hxx
@@ -91,8 +91,8 @@ public:
 
     // list of used types while writing
     SvMetaTypeMemberList    aUsedTypes;
-    OString            aIFaceName;
-    SvNumberIdentifier      aStructSlotId;
+    OString                 aIFaceName;
+    SvIdentifier            aStructSlotId;
 
     void                    StartNewFile( const OUString& rName );
     void                    SetExportFile( const OUString& rName )
@@ -124,7 +124,7 @@ public:
     SvMetaType *            ReadKnownType( SvTokenStream & rInStm );
     SvMetaAttribute *       ReadKnownAttr( SvTokenStream & rInStm,
                                             SvMetaType * pType = NULL );
-    SvMetaAttribute *       SearchKnownAttr( const SvNumberIdentifier& );
+    SvMetaAttribute *       SearchKnownAttr( const SvIdentifier& );
     SvMetaClass *           ReadKnownClass( SvTokenStream & rInStm );
     void AddDepFile(OUString const& rFileName);
     bool WriteDepFile(SvFileStream & rStream, OUString const& rTarget);
diff --git a/idl/inc/types.hxx b/idl/inc/types.hxx
index a9d5c75..90f358c9 100644
--- a/idl/inc/types.hxx
+++ b/idl/inc/types.hxx
@@ -35,7 +35,7 @@ typedef tools::SvRef<SvMetaType> SvMetaTypeRef;
 class SvMetaAttribute : public SvMetaReference
 {
     SvMetaTypeRef       aType;
-    SvNumberIdentifier  aSlotId;
+    SvIdentifier        aSlotId;
     SvBOOL              aAutomation;
     SvBOOL              aExport;
     SvBOOL              aReadonly;
@@ -55,9 +55,9 @@ public:
     void                SetNewAttribute( bool bNew )
                         { bNewAttr = bNew; }
     bool                GetReadonly() const;
-    void                SetSlotId( const SvNumberIdentifier & rId )
+    void                SetSlotId( const SvIdentifier & rId )
                         { aSlotId = rId; }
-    const SvNumberIdentifier & GetSlotId() const;
+    const SvIdentifier & GetSlotId() const;
     bool                GetExport() const;
     bool                GetHidden() const;
     bool                GetAutomation() const;
diff --git a/idl/source/objects/bastype.cxx b/idl/source/objects/bastype.cxx
index ca84295..c2cc6c5 100644
--- a/idl/source/objects/bastype.cxx
+++ b/idl/source/objects/bastype.cxx
@@ -175,7 +175,7 @@ bool SvIdentifier::ReadSvIdl( SvStringHashEntry * pName, SvTokenStream & rInStm
     return false;
 }
 
-bool SvNumberIdentifier::ReadSvIdl( SvIdlDataBase & rBase,
+bool SvIdentifier::ReadSvIdl( SvIdlDataBase & rBase,
                                     SvStringHashEntry * pName,
                                     SvTokenStream & rInStm )
 {
@@ -198,7 +198,7 @@ bool SvNumberIdentifier::ReadSvIdl( SvIdlDataBase & rBase,
     return false;
 }
 
-bool SvNumberIdentifier::ReadSvIdl( SvIdlDataBase & rBase,
+bool SvIdentifier::ReadSvIdl( SvIdlDataBase & rBase,
                                     SvTokenStream & rInStm )
 {
     sal_uInt32 nTokPos = rInStm.Tell();
diff --git a/idl/source/objects/object.cxx b/idl/source/objects/object.cxx
index 1ce4378..3898504 100644
--- a/idl/source/objects/object.cxx
+++ b/idl/source/objects/object.cxx
@@ -133,7 +133,7 @@ void SvMetaClass::ReadContextSvIdl( SvIdlDataBase & rBase,
         {
             if( !xAttr->GetSlotId().IsSet() )
             {

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list