[Libreoffice-commits] core.git: 3 commits - sw/inc sw/source vcl/source

Oliver-Rainer Wittmann orw at apache.org
Tue Mar 4 12:31:28 PST 2014


 sw/inc/IDocumentMarkAccess.hxx          |    2 
 sw/inc/undobj.hxx                       |    2 
 sw/source/core/bastyp/index.cxx         |    7 ++-
 sw/source/core/crsr/bookmrk.cxx         |   69 ++++++++++++++++++++------------
 sw/source/core/doc/docbm.cxx            |   69 +++++++++++++++++++++++++-------
 sw/source/core/inc/MarkManager.hxx      |    2 
 sw/source/core/inc/bookmrk.hxx          |    4 +
 sw/source/core/inc/crossrefbookmark.hxx |    1 
 sw/source/core/txtnode/ndtxt.cxx        |    6 ++
 sw/source/core/undo/undobj.cxx          |   32 +++++++++-----
 sw/source/core/undo/unredln.cxx         |    6 +-
 vcl/source/app/settings.cxx             |    8 +--
 12 files changed, 147 insertions(+), 61 deletions(-)

New commits:
commit b229d16cd94d31eb8cad043b54d2d421cf92ef70
Author: Oliver-Rainer Wittmann <orw at apache.org>
Date:   Tue Mar 4 14:02:37 2014 +0000

    Related: #i123480# correct the previous made refactoring
    
    (cherry picked from commit aa46680dd96539848bf8bef0293e2a614172515d)
    
    Conflicts:
    	sw/source/core/undo/undobj.cxx
    
    Change-Id: I4689d5fe02ab2c814e15a1c11ebd3ad11d6e56c8

diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx
index 1dcd5ca..39e3fe0 100644
--- a/sw/inc/undobj.hxx
+++ b/sw/inc/undobj.hxx
@@ -115,7 +115,7 @@ public:
 
     // Save and set Redline data.
     static bool FillSaveData( const SwPaM& rRange, SwRedlineSaveDatas& rSData,
-                              bool bDelRange = true );
+                              bool bDelRange = true, bool bCopyNext = true );
     static bool FillSaveDataForFmt( const SwPaM& , SwRedlineSaveDatas& );
     static void SetSaveData( SwDoc& rDoc, const SwRedlineSaveDatas& rSData );
     static bool HasHiddenRedlines( const SwRedlineSaveDatas& rSData );
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index 2e75e42..e22fe52 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -46,7 +46,9 @@ public:
         SwComparePosition eCmpPos,
         const SwPosition& rSttPos,
         const SwPosition& rEndPos,
-        SwRangeRedline& rRedl );
+        SwRangeRedline& rRedl,
+        sal_Bool bCopyNext );
+
     ~SwRedlineSaveData();
 
     void RedlineToDoc( SwPaM& rPam );
@@ -847,7 +849,7 @@ void SwUndoSaveSection::SaveSection(
     }
 
     pRedlSaveData = new SwRedlineSaveDatas;
-    if( !SwUndo::FillSaveData( aPam, *pRedlSaveData, true ))
+    if( !SwUndo::FillSaveData( aPam, *pRedlSaveData, true, true ))
         delete pRedlSaveData, pRedlSaveData = 0;
 
     nStartPos = rRange.aStart.GetIndex();
@@ -912,9 +914,10 @@ SwRedlineSaveData::SwRedlineSaveData(
     SwComparePosition eCmpPos,
     const SwPosition& rSttPos,
     const SwPosition& rEndPos,
-    SwRangeRedline& rRedl )
+    SwRangeRedline& rRedl,
+    sal_Bool bCopyNext )
     : SwUndRng( rRedl )
-    , SwRedlineData( rRedl.GetRedlineData(), true )
+    , SwRedlineData( rRedl.GetRedlineData(), bCopyNext )
 {
     assert( POS_OUTSIDE == eCmpPos ||
             !rRedl.GetContentIdx() ); // "Redline with Content"
@@ -925,6 +928,7 @@ SwRedlineSaveData::SwRedlineSaveData(
         nEndNode = rEndPos.nNode.GetIndex();
         nEndCntnt = rEndPos.nContent.GetIndex();
         break;
+
     case POS_OVERLAP_BEHIND:        // Pos1 overlaps Pos2 at the end
         nSttNode = rSttPos.nNode.GetIndex();
         nSttCntnt = rSttPos.nContent.GetIndex();
@@ -996,7 +1000,8 @@ void SwRedlineSaveData::RedlineToDoc( SwPaM& rPam )
 bool SwUndo::FillSaveData(
     const SwPaM& rRange,
     SwRedlineSaveDatas& rSData,
-    bool bDelRange )
+    bool bDelRange,
+    bool bCopyNext )
 {
     rSData.DeleteAndDestroyAll();
 
@@ -1009,6 +1014,7 @@ bool SwUndo::FillSaveData(
     for ( ; n < rTbl.size(); ++n )
     {
         SwRangeRedline* pRedl = rTbl[n];
+
         const SwComparePosition eCmpPos =
             ComparePosition( *pStt, *pEnd, *pRedl->Start(), *pRedl->End() );
         if ( eCmpPos != POS_BEFORE
@@ -1016,12 +1022,14 @@ bool SwUndo::FillSaveData(
              && eCmpPos != POS_COLLIDE_END
              && eCmpPos != POS_COLLIDE_START )
         {
-            pNewData = new SwRedlineSaveData( eCmpPos, *pStt, *pEnd, *pRedl );
+            pNewData = new SwRedlineSaveData( eCmpPos, *pStt, *pEnd, *pRedl, bCopyNext );
             rSData.push_back( pNewData );
         }
     }
     if( !rSData.empty() && bDelRange )
+    {
         rRange.GetDoc()->DeleteRedline( rRange, false, USHRT_MAX );
+    }
     return !rSData.empty();
 }
 
@@ -1041,12 +1049,13 @@ bool SwUndo::FillSaveDataForFmt(
         SwRangeRedline* pRedl = rTbl[n];
         if ( nsRedlineType_t::REDLINE_FORMAT == pRedl->GetType() )
         {
-            const SwPosition *pRStt = pRedl->Start(), *pREnd = pRedl->End();
-
-            SwComparePosition eCmpPos = ComparePosition( *pStt, *pEnd, *pRStt, *pREnd );
-            if ( POS_BEFORE != eCmpPos && POS_BEHIND != eCmpPos && POS_COLLIDE_END != eCmpPos && POS_COLLIDE_START != eCmpPos )
+            const SwComparePosition eCmpPos = ComparePosition( *pStt, *pEnd, *pRedl->Start(), *pRedl->End() );
+            if ( eCmpPos != POS_BEFORE
+                 && eCmpPos != POS_BEHIND
+                 && eCmpPos != POS_COLLIDE_END
+                 && eCmpPos != POS_COLLIDE_START )
             {
-                pNewData = new SwRedlineSaveData( eCmpPos, *pStt, *pEnd, *pRedl );
+                pNewData = new SwRedlineSaveData( eCmpPos, *pStt, *pEnd, *pRedl, true );
                 rSData.push_back( pNewData );
             }
 
@@ -1055,6 +1064,7 @@ bool SwUndo::FillSaveDataForFmt(
     return !rSData.empty();
 }
 
+
 void SwUndo::SetSaveData( SwDoc& rDoc, const SwRedlineSaveDatas& rSData )
 {
     RedlineMode_t eOld = rDoc.GetRedlineMode();
diff --git a/sw/source/core/undo/unredln.cxx b/sw/source/core/undo/unredln.cxx
index 86f0ec8..7fd9b58 100644
--- a/sw/source/core/undo/unredln.cxx
+++ b/sw/source/core/undo/unredln.cxx
@@ -58,7 +58,7 @@ SwUndoRedline::SwUndoRedline( SwUndoId nUsrId, const SwPaM& rRange )
     sal_uLong nEndExtra = rDoc.GetNodes().GetEndOfExtras().GetIndex();
 
     mpRedlSaveData = new SwRedlineSaveDatas;
-    if( !FillSaveData( rRange, *mpRedlSaveData, false ))
+    if( !FillSaveData( rRange, *mpRedlSaveData, false, UNDO_REJECT_REDLINE != mnUserId ))
         delete mpRedlSaveData, mpRedlSaveData = 0;
     else
     {
@@ -116,7 +116,7 @@ void SwUndoRedline::RedoImpl(::sw::UndoRedoContext & rContext)
     if( mpRedlSaveData && mbHiddenRedlines )
     {
         sal_uLong nEndExtra = pDoc->GetNodes().GetEndOfExtras().GetIndex();
-        FillSaveData(rPam, *mpRedlSaveData, false );
+        FillSaveData(rPam, *mpRedlSaveData, false, UNDO_REJECT_REDLINE != mnUserId );
 
         nEndExtra -= pDoc->GetNodes().GetEndOfExtras().GetIndex();
         nSttNode -= nEndExtra;
@@ -379,7 +379,7 @@ SwUndoCompDoc::SwUndoCompDoc( const SwRangeRedline& rRedl )
     }
 
     pRedlSaveData = new SwRedlineSaveDatas;
-    if( !FillSaveData( rRedl, *pRedlSaveData, false ))
+    if( !FillSaveData( rRedl, *pRedlSaveData, false, true ))
         delete pRedlSaveData, pRedlSaveData = 0;
 }
 
commit 14f124a5ef5c32bad765265d5a3f05290ccc6149
Author: Oliver-Rainer Wittmann <orw at apache.org>
Date:   Tue Mar 4 12:35:01 2014 +0000

    Resolves: #i124338# assure sorted mark containers...
    
    when updating <SwIndex> instances due to inserted characters
    
    (cherry picked from commit 770c0e6b910129710b4be5cb9e9bae39bfa6bd5a)
    
    Conflicts:
    	sw/source/core/bastyp/index.cxx
    	sw/source/core/crsr/bookmrk.cxx
    	sw/source/core/doc/docbm.cxx
    	sw/source/core/inc/bookmrk.hxx
    	sw/source/core/inc/crossrefbookmark.hxx
    
    Change-Id: Ie4531c3b33aff0a7f3d139ee81a21c3823474f84

diff --git a/sw/inc/IDocumentMarkAccess.hxx b/sw/inc/IDocumentMarkAccess.hxx
index 784b45f..8d59cbf 100644
--- a/sw/inc/IDocumentMarkAccess.hxx
+++ b/sw/inc/IDocumentMarkAccess.hxx
@@ -194,6 +194,8 @@ class IDocumentMarkAccess
         */
         virtual void clearAllMarks() =0;
 
+        virtual void assureSortedMarkContainers() const = 0;
+
         /** returns a STL-like random access iterator to the begin of the sequence of marks.
         */
         virtual const_iterator_t getAllMarksBegin() const =0;
diff --git a/sw/source/core/bastyp/index.cxx b/sw/source/core/bastyp/index.cxx
index 120d119..4f3f045 100644
--- a/sw/source/core/bastyp/index.cxx
+++ b/sw/source/core/bastyp/index.cxx
@@ -223,8 +223,11 @@ SwIndexReg::~SwIndexReg()
     assert(!m_pFirst && !m_pLast); // There are still indices registered
 }
 
-void SwIndexReg::Update( SwIndex const & rIdx, const sal_Int32 nDiff,
-    const bool bNeg, const bool /* argument is only used in derived class*/ )
+void SwIndexReg::Update(
+    SwIndex const & rIdx,
+    const sal_Int32 nDiff,
+    const bool bNeg,
+    const bool /* argument is only used in derived class*/ )
 {
     SwIndex* pStt = const_cast<SwIndex*>(&rIdx);
     const sal_Int32 nNewVal = rIdx.m_nIndex;
diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx
index f09895a..1fb0b05 100644
--- a/sw/source/core/crsr/bookmrk.cxx
+++ b/sw/source/core/crsr/bookmrk.cxx
@@ -64,31 +64,32 @@ namespace
         const sal_Unicode aStartMark,
         const sal_Unicode aEndMark)
     {
-        SwPosition& rStart = pField->GetMarkStart();
-        SwPosition& rEnd = pField->GetMarkEnd();
+        io_pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_UI_REPLACE, NULL);
 
-        SwTxtNode const*const pStartTxtNode =
-            rStart.nNode.GetNode().GetTxtNode();
-        SwTxtNode const*const pEndTxtNode = rEnd.nNode.GetNode().GetTxtNode();
+        SwPosition rStart = pField->GetMarkStart();
+        SwTxtNode const*const pStartTxtNode = rStart.nNode.GetNode().GetTxtNode();
         const sal_Unicode ch_start = ( rStart.nContent.GetIndex() >= pStartTxtNode->GetTxt().getLength() ) ? 0 :
             pStartTxtNode->GetTxt()[rStart.nContent.GetIndex()];
-        const sal_Int32 nEndPos = ( rEnd == rStart ||  rEnd.nContent.GetIndex() == 0 ) ?
-            rEnd.nContent.GetIndex() : rEnd.nContent.GetIndex() - 1;
-        const sal_Unicode ch_end = nEndPos >= pEndTxtNode->GetTxt().getLength() ? 0 : pEndTxtNode->GetTxt()[nEndPos];
-        SwPaM aStartPaM(rStart);
-        SwPaM aEndPaM(rEnd);
-
-        io_pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_UI_REPLACE, NULL);
         if( ( ch_start != aStartMark ) && ( aEndMark != CH_TXT_ATR_FORMELEMENT ) )
         {
+            SwPaM aStartPaM(rStart);
             io_pDoc->InsertString(aStartPaM, OUString(aStartMark));
             rStart.nContent--;
+            pField->SetMarkStartPos( rStart );
         }
+
+        SwPosition& rEnd = pField->GetMarkEnd();
+        SwTxtNode const*const pEndTxtNode = rEnd.nNode.GetNode().GetTxtNode();
+        const sal_Int32 nEndPos = ( rEnd == rStart ||  rEnd.nContent.GetIndex() == 0 ) ?
+            rEnd.nContent.GetIndex() : rEnd.nContent.GetIndex() - 1;
+        const sal_Unicode ch_end = nEndPos >= pEndTxtNode->GetTxt().getLength() ? 0 : pEndTxtNode->GetTxt()[nEndPos];
         if ( aEndMark && ( ch_end != aEndMark ) )
         {
+            SwPaM aEndPaM(rEnd);
             io_pDoc->InsertString(aEndPaM, OUString(aEndMark));
             rEnd.nContent++;
         }
+
         io_pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_UI_REPLACE, NULL);
     };
 
@@ -97,31 +98,33 @@ namespace
         const sal_Unicode aStartMark,
         const sal_Unicode aEndMark)
     {
-        SwPosition& rStart = pField->GetMarkStart();
-        SwPosition& rEnd = pField->GetMarkEnd();
-        SwTxtNode const*const pStartTxtNode =
-            rStart.nNode.GetNode().GetTxtNode();
-        SwTxtNode const*const pEndTxtNode = rEnd.nNode.GetNode().GetTxtNode();
+        io_pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_UI_REPLACE, NULL);
+
+        const SwPosition& rStart = pField->GetMarkStart();
+        SwTxtNode const*const pStartTxtNode = rStart.nNode.GetNode().GetTxtNode();
         const sal_Unicode ch_start =
             pStartTxtNode->GetTxt()[rStart.nContent.GetIndex()];
-        const sal_Int32 nEndPos = ( rEnd == rStart ||  rEnd.nContent.GetIndex() == 0 ) ?
-            rEnd.nContent.GetIndex() : rEnd.nContent.GetIndex() - 1;
-        const sal_Unicode ch_end = pEndTxtNode->GetTxt()[nEndPos];
-        SwPaM aStartPaM(rStart);
-        SwPaM aEndPaM(rEnd);
-        io_pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_UI_REPLACE, NULL);
+
         if( ch_start == aStartMark )
         {
             SwPaM aStart(rStart, rStart);
             aStart.End()->nContent++;
             io_pDoc->DeleteRange(aStart);
         }
+
+        const SwPosition& rEnd = pField->GetMarkEnd();
+        SwTxtNode const*const pEndTxtNode = rEnd.nNode.GetNode().GetTxtNode();
+        const sal_Int32 nEndPos = ( rEnd == rStart ||  rEnd.nContent.GetIndex() == 0 )
+                                   ? rEnd.nContent.GetIndex()
+                                   : rEnd.nContent.GetIndex() - 1;
+        const sal_Unicode ch_end = pEndTxtNode->GetTxt()[nEndPos];
         if ( ch_end == aEndMark )
         {
             SwPaM aEnd(rEnd, rEnd);
             aEnd.Start()->nContent--;
             io_pDoc->DeleteRange(aEnd);
         }
+
         io_pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_UI_REPLACE, NULL);
     };
 }
@@ -308,6 +311,22 @@ namespace sw { namespace mark
             SetOtherMarkPos(GetMarkPos());
     }
 
+    void Fieldmark::SetMarkStartPos( const SwPosition& rNewStartPos )
+    {
+        if ( GetMarkPos( ) <= GetOtherMarkPos( ) )
+            return SetMarkPos( rNewStartPos );
+        else
+            return SetOtherMarkPos( rNewStartPos );
+    }
+
+    void Fieldmark::SetMarkEndPos( const SwPosition& rNewEndPos )
+    {
+        if ( GetMarkPos( ) <= GetOtherMarkPos( ) )
+            return SetOtherMarkPos( rNewEndPos );
+        else
+            return SetMarkPos( rNewEndPos );
+    }
+
     OUString Fieldmark::ToString( ) const
     {
         return "Fieldmark: ( Name, Type, [ Nd1, Id1 ], [ Nd2, Id2 ] ): ( " + m_aName + ", "
@@ -349,7 +368,9 @@ namespace sw { namespace mark
 
         // For some reason the end mark is moved from 1 by the Insert: we don't
         // want this for checkboxes
-        this->GetMarkEnd( ).nContent--;
+        SwPosition aNewEndPos = this->GetMarkEnd();
+        aNewEndPos.nContent--;
+        SetMarkEndPos( aNewEndPos );
     }
 
     void CheckboxFieldmark::ReleaseDoc(SwDoc* const pDoc)
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 3cb4dff..d972236 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -828,16 +828,26 @@ namespace sw { namespace mark
             case IDocumentMarkAccess::BOOKMARK:
             case IDocumentMarkAccess::CROSSREF_HEADING_BOOKMARK:
             case IDocumentMarkAccess::CROSSREF_NUMITEM_BOOKMARK:
-                // if(dynamic_cast<IBookmark*>)
                 {
                     IDocumentMarkAccess::iterator_t ppBookmark = lcl_FindMark(m_vBookmarks, *ppMark);
-                    OSL_ENSURE(ppBookmark != m_vBookmarks.end(),
-                        "<MarkManager::deleteMark(..)>"
-                        " - Bookmark not found.");
-                    m_vBookmarks.erase(ppBookmark);
+                    if ( ppBookmark != m_vBookmarks.end() )
+                    {
+                        m_vBookmarks.erase(ppBookmark);
+                    }
+                    else
+                    {
+                        OSL_ENSURE( false, "<MarkManager::deleteMark(..)> - Bookmark not found in Bookmark container.");
+                    }
 
                     ppBookmark = lcl_FindMark(m_vCommonMarks, *ppMark);
-                    m_vCommonMarks.erase(ppBookmark);
+                    if ( ppBookmark != m_vCommonMarks.end() )
+                    {
+                        m_vCommonMarks.erase(ppBookmark);
+                    }
+                    else
+                    {
+                        OSL_ENSURE( false, "<MarkManager::deleteMark(..)> - Bookmark not found in common mark container.");
+                    }
                 }
                 break;
 
@@ -845,22 +855,39 @@ namespace sw { namespace mark
             case IDocumentMarkAccess::CHECKBOX_FIELDMARK:
                 {
                     IDocumentMarkAccess::iterator_t ppFieldmark = lcl_FindMark(m_vFieldmarks, *ppMark);
-                    OSL_ENSURE(ppFieldmark != m_vFieldmarks.end(),
-                        "<MarkManager::deleteMark(..)>"
-                        " - Bookmark not found.");
-                    m_vFieldmarks.erase(ppFieldmark);
-                    ret.reset(new LazyFieldmarkDeleter(*ppMark, m_pDoc));
+                    if ( ppFieldmark != m_vFieldmarks.end() )
+                    {
+                        m_vFieldmarks.erase(ppFieldmark);
+                        ret.reset(new LazyFieldmarkDeleter(*ppMark, m_pDoc));
+                    }
+                    else
+                    {
+                        OSL_ENSURE( false, "<MarkManager::deleteMark(..)> - Fieldmark not found in Fieldmark container.");
+                    }
 
                     ppFieldmark = lcl_FindMark(m_vCommonMarks, *ppMark);
-                    m_vCommonMarks.erase(ppFieldmark);
+                    if ( ppFieldmark != m_vCommonMarks.end() )
+                    {
+                        m_vCommonMarks.erase(ppFieldmark);
+                    }
+                    else
+                    {
+                        OSL_ENSURE( false, "<MarkManager::deleteMark(..)> - Fieldmark not found in common mark container.");
+                    }
                 }
                 break;
 
             case IDocumentMarkAccess::ANNOTATIONMARK:
                 {
                     IDocumentMarkAccess::iterator_t ppAnnotationMark = lcl_FindMark(m_vAnnotationMarks, *ppMark);
-                    OSL_ENSURE( ppAnnotationMark != m_vAnnotationMarks.end(), "<MarkManager::deleteMark(..)> - Annotation Mark not found." );
-                    m_vAnnotationMarks.erase(ppAnnotationMark);
+                    if ( ppAnnotationMark != m_vAnnotationMarks.end() )
+                    {
+                        m_vAnnotationMarks.erase(ppAnnotationMark);
+                    }
+                    else
+                    {
+                        OSL_ENSURE( false, "<MarkManager::deleteMark(..)> - Annotation Mark not found in Annotation Mark container.");
+                    }
                 }
                 break;
 
@@ -869,7 +896,14 @@ namespace sw { namespace mark
             case IDocumentMarkAccess::UNO_BOOKMARK:
                 {
                     IDocumentMarkAccess::iterator_t ppOtherMark = lcl_FindMark(m_vCommonMarks, *ppMark);
-                    m_vCommonMarks.erase(ppOtherMark);
+                    if ( ppOtherMark != m_vCommonMarks.end() )
+                    {
+                        m_vCommonMarks.erase(ppOtherMark);
+                    }
+                    else
+                    {
+                        OSL_ENSURE( false, "<MarkManager::deleteMark(..)> - Navigator Reminder, DDE Mark or Uno Makr not found in common mark container.");
+                    }
                 }
                 break;
         }
@@ -1052,6 +1086,11 @@ namespace sw { namespace mark
         return sTmp;
     }
 
+    void MarkManager::assureSortedMarkContainers() const
+    {
+        const_cast< MarkManager* >(this)->sortMarks();
+    }
+
     void MarkManager::sortSubsetMarks()
     {
         sort(m_vCommonMarks.begin(), m_vCommonMarks.end(), &lcl_MarkOrderingByStart);
diff --git a/sw/source/core/inc/MarkManager.hxx b/sw/source/core/inc/MarkManager.hxx
index 549d06b..ed4afd7 100644
--- a/sw/source/core/inc/MarkManager.hxx
+++ b/sw/source/core/inc/MarkManager.hxx
@@ -95,6 +95,8 @@ namespace sw {
             virtual sal_Int32 getAnnotationMarksCount() const;
             virtual const_iterator_t findAnnotationMark( const ::rtl::OUString& rName ) const;
 
+            virtual void assureSortedMarkContainers() const;
+
         private:
             // make names
             OUString getUniqueMarkName(const OUString& rName) const;
diff --git a/sw/source/core/inc/bookmrk.hxx b/sw/source/core/inc/bookmrk.hxx
index 761842f..9df8878 100644
--- a/sw/source/core/inc/bookmrk.hxx
+++ b/sw/source/core/inc/bookmrk.hxx
@@ -47,6 +47,7 @@ namespace sw {
             : virtual public IMark
         {
         public:
+            //getters
             virtual SwPosition& GetMarkPos() const
                 { return *m_pPos1; }
             virtual const OUString& GetName() const
@@ -215,6 +216,9 @@ namespace sw {
 
             virtual void ReleaseDoc(SwDoc* const) = 0;
 
+            void SetMarkStartPos( const SwPosition& rNewStartPos );
+            void SetMarkEndPos( const SwPosition& rNewEndPos );
+
             virtual void Invalidate();
             virtual OUString ToString() const;
 
diff --git a/sw/source/core/inc/crossrefbookmark.hxx b/sw/source/core/inc/crossrefbookmark.hxx
index fa4777b..79212d3 100644
--- a/sw/source/core/inc/crossrefbookmark.hxx
+++ b/sw/source/core/inc/crossrefbookmark.hxx
@@ -36,6 +36,7 @@ namespace sw {
                 const OUString& rShortName,
                 const OUString& rPrefix);
 
+            // getters
             virtual SwPosition& GetOtherMarkPos() const;
             virtual SwPosition& GetMarkStart() const
                 { return *m_pPos1; }
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 92d70da..a82bda2 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -1014,6 +1014,7 @@ void SwTxtNode::Update(
         }
     }
 
+    bool bSortMarks = false;
     SwIndexReg aTmpIdxReg;
     if ( !bNegative && !bDelete )
     {
@@ -1072,6 +1073,7 @@ void SwTxtNode::Update(
                     rPos.GetIndex() == rIdx.GetIndex() )
                 {
                     rIdx.Assign( &aTmpIdxReg, rIdx.GetIndex() );
+                    bSortMarks = true;
                 }
             }
         }
@@ -1090,6 +1092,10 @@ void SwTxtNode::Update(
     }
 
     aTmpIdxReg.MoveTo( *this );
+    if ( bSortMarks )
+    {
+        getIDocumentMarkAccess()->assureSortedMarkContainers();
+    }
 }
 
 void SwTxtNode::_ChgTxtCollUpdateNum( const SwTxtFmtColl *pOldColl,
commit 41bd5a3bc80b670040884b835db4c425ab990a46
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Mar 4 15:04:42 2014 +0000

    valgrind: remove unused mnOptions
    
    Change-Id: I0a86971d1750ea640db64cd3238f3e31b22d1223

diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index 49a0691..a03645f 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -219,10 +219,9 @@ struct ImplMiscData
 
 struct ImplHelpData
 {
-                                    ImplHelpData();
-                                    ImplHelpData( const ImplHelpData& rData );
+    ImplHelpData();
+    ImplHelpData( const ImplHelpData& rData );
 
-    sal_uLong                           mnOptions;
     sal_uLong                           mnTipDelay;
     sal_uLong                           mnTipTimeout;
     sal_uLong                           mnBalloonDelay;
@@ -2578,8 +2577,7 @@ bool HelpSettings::operator ==( const HelpSettings& rSet ) const
     if ( mpData == rSet.mpData )
         return true;
 
-    if ( (mpData->mnOptions         == rSet.mpData->mnOptions ) &&
-         (mpData->mnTipDelay        == rSet.mpData->mnTipDelay ) &&
+    if ( (mpData->mnTipDelay        == rSet.mpData->mnTipDelay ) &&
          (mpData->mnTipTimeout      == rSet.mpData->mnTipTimeout ) &&
          (mpData->mnBalloonDelay    == rSet.mpData->mnBalloonDelay ) )
         return true;


More information about the Libreoffice-commits mailing list