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

Michael Stahl mstahl at redhat.com
Wed Jun 11 07:13:02 PDT 2014


 sw/inc/IMark.hxx                         |    2 -
 sw/source/core/crsr/bookmrk.cxx          |   14 ++++++------
 sw/source/core/crsr/crossrefbookmark.cxx |    4 +--
 sw/source/core/doc/docbm.cxx             |   34 +++++++++++++++----------------
 sw/source/core/doc/docdde.cxx            |    2 -
 sw/source/core/doc/docedt.cxx            |    4 +--
 sw/source/core/doc/swserv.cxx            |    2 -
 sw/source/core/docnode/ndcopy.cxx        |    4 +--
 sw/source/core/fields/reffld.cxx         |    2 -
 sw/source/core/inc/bookmrk.hxx           |   12 +++++-----
 sw/source/core/inc/crossrefbookmark.hxx  |    2 -
 sw/source/core/undo/rolbck.cxx           |    6 ++---
 sw/source/core/undo/undobj.cxx           |    8 +++----
 sw/source/core/unocore/unobkm.cxx        |    4 +--
 sw/source/core/unocore/unoobj2.cxx       |    2 -
 sw/source/filter/writer/writer.cxx       |    8 +++----
 sw/source/filter/ww8/wrtww8.cxx          |    2 -
 17 files changed, 56 insertions(+), 56 deletions(-)

New commits:
commit 3070914cf4942ac42604fe72937bbd9efa00642f
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Jun 11 16:06:01 2014 +0200

    avoid undefined null-reference in CrossRefBookmark::GetOtherMarkPos()
    
    CrossRefBookmark::GetOtherMarkPos() is apparently not supposed to be
    called, so just replace the undefined null-reference with a call to
    abort().
    
    Change-Id: Ie8e141d661b870573092d20bd85fa1ae04506421

diff --git a/sw/source/core/crsr/crossrefbookmark.cxx b/sw/source/core/crsr/crossrefbookmark.cxx
index 22438a8..6154e1c 100644
--- a/sw/source/core/crsr/crossrefbookmark.cxx
+++ b/sw/source/core/crsr/crossrefbookmark.cxx
@@ -59,7 +59,7 @@ namespace sw { namespace mark
         OSL_PRECOND(false,
             "<sw::mark::CrossRefBookmark::GetOtherMarkPos(..)>"
             " - this should never be called!");
-        return *static_cast<SwPosition*>(NULL);
+        abort();
     }
 
     CrossRefHeadingBookmark::CrossRefHeadingBookmark(const SwPaM& rPaM,
commit 2da8a60702c0f9fac6752573dce95a5596c5688e
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Jun 11 15:33:59 2014 +0200

    Revert "Change sw::mark::IMark::GetOtherMarkPos return type from ref
    
    ... to pointer"
    
    CrossRefBookmark::GetOtherMarkPos() is apparently not supposed to be
    called, so just replace the undefined null-reference with a call to
    abort().
    
    This reverts commit dcf0ac048ce745774f401ada72b051757298c559.
    
    Change-Id: I55b4accb4f42031df5671e8a30897e3aff9b56f9

diff --git a/sw/inc/IMark.hxx b/sw/inc/IMark.hxx
index 72cdad1..13c1e00 100644
--- a/sw/inc/IMark.hxx
+++ b/sw/inc/IMark.hxx
@@ -41,7 +41,7 @@ namespace sw { namespace mark
             virtual const SwPosition& GetMarkPos() const =0;
             // GetOtherMarkPos() is only guaranteed to return a valid
             // reference if IsExpanded() returned true
-            virtual const SwPosition* GetOtherMarkPos() const =0;
+            virtual const SwPosition& GetOtherMarkPos() const =0;
             virtual const SwPosition& GetMarkStart() const =0;
             virtual const SwPosition& GetMarkEnd() const =0;
             virtual const OUString& GetName() const =0;
diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx
index 124aaec..5bd6dc9 100644
--- a/sw/source/core/crsr/bookmrk.cxx
+++ b/sw/source/core/crsr/bookmrk.cxx
@@ -311,7 +311,7 @@ namespace sw { namespace mark
 
     void Fieldmark::SetMarkStartPos( const SwPosition& rNewStartPos )
     {
-        if ( GetMarkPos( ) <= *GetOtherMarkPos( ) )
+        if ( GetMarkPos( ) <= GetOtherMarkPos( ) )
             return SetMarkPos( rNewStartPos );
         else
             return SetOtherMarkPos( rNewStartPos );
@@ -319,7 +319,7 @@ namespace sw { namespace mark
 
     void Fieldmark::SetMarkEndPos( const SwPosition& rNewEndPos )
     {
-        if ( GetMarkPos( ) <= *GetOtherMarkPos( ) )
+        if ( GetMarkPos( ) <= GetOtherMarkPos( ) )
             return SetOtherMarkPos( rNewEndPos );
         else
             return SetMarkPos( rNewEndPos );
@@ -330,15 +330,15 @@ namespace sw { namespace mark
         return "Fieldmark: ( Name, Type, [ Nd1, Id1 ], [ Nd2, Id2 ] ): ( " + m_aName + ", "
             + m_aFieldname + ", [ " + OUString::number( GetMarkPos().nNode.GetIndex( ) )
             + ", " + OUString::number( GetMarkPos( ).nContent.GetIndex( ) ) + " ], ["
-            + OUString::number( GetOtherMarkPos()->nNode.GetIndex( ) ) + ", "
-            + OUString::number( GetOtherMarkPos( )->nContent.GetIndex( ) ) + " ] ) ";
+            + OUString::number( GetOtherMarkPos().nNode.GetIndex( ) ) + ", "
+            + OUString::number( GetOtherMarkPos( ).nContent.GetIndex( ) ) + " ] ) ";
     }
 
     void Fieldmark::Invalidate( )
     {
         // TODO: Does exist a better solution to trigger a format of the
         //       fieldmark portion? If yes, please use it.
-        SwPaM aPaM( this->GetMarkPos(), *this->GetOtherMarkPos() );
+        SwPaM aPaM( this->GetMarkPos(), this->GetOtherMarkPos() );
         aPaM.InvalidatePaM();
     }
 
@@ -405,8 +405,8 @@ namespace sw { namespace mark
             + m_aName + ", " + GetFieldname() + ", [ "
             + OUString::number(GetMarkPos().nNode.GetIndex( ) ) + ", "
             + OUString::number( GetMarkPos( ).nContent.GetIndex( ) ) + " ], ["
-            + OUString::number( GetOtherMarkPos()->nNode.GetIndex( ) ) + ", "
-            + OUString::number( GetOtherMarkPos( )->nContent.GetIndex( ) ) + " ] ) ";
+            + OUString::number( GetOtherMarkPos().nNode.GetIndex( ) ) + ", "
+            + OUString::number( GetOtherMarkPos( ).nContent.GetIndex( ) ) + " ] ) ";
     }
 }}
 
diff --git a/sw/source/core/crsr/crossrefbookmark.cxx b/sw/source/core/crsr/crossrefbookmark.cxx
index 49a4886..22438a8 100644
--- a/sw/source/core/crsr/crossrefbookmark.cxx
+++ b/sw/source/core/crsr/crossrefbookmark.cxx
@@ -54,12 +54,12 @@ namespace sw { namespace mark
         MarkBase::SetMarkPos(rNewPos);
     }
 
-    SwPosition* CrossRefBookmark::GetOtherMarkPos() const
+    SwPosition& CrossRefBookmark::GetOtherMarkPos() const
     {
         OSL_PRECOND(false,
             "<sw::mark::CrossRefBookmark::GetOtherMarkPos(..)>"
             " - this should never be called!");
-        return NULL;
+        return *static_cast<SwPosition*>(NULL);
     }
 
     CrossRefHeadingBookmark::CrossRefHeadingBookmark(const SwPaM& rPaM,
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 62a8002..676b669 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -188,12 +188,12 @@ namespace
 
         if ( ( bChangedPos || bChangedOPos )
              && io_pMark->IsExpanded()
-             && io_pMark->GetOtherMarkPos()->nNode.GetNode().FindTableBoxStartNode() !=
+             && io_pMark->GetOtherMarkPos().nNode.GetNode().FindTableBoxStartNode() !=
                     io_pMark->GetMarkPos().nNode.GetNode().FindTableBoxStartNode() )
         {
             if ( !bChangedOPos )
             {
-                io_pMark->SetMarkPos( *io_pMark->GetOtherMarkPos() );
+                io_pMark->SetMarkPos( io_pMark->GetOtherMarkPos() );
             }
             io_pMark->ClearOtherMarkPos();
             DdeBookmark * const pDdeBkmk = dynamic_cast< DdeBookmark*>(io_pMark);
@@ -584,7 +584,7 @@ namespace sw { namespace mark
             }
             bool bChangedOPos = false;
             if (pMark->IsExpanded() &&
-                &pMark->GetOtherMarkPos()->nNode.GetNode() == pOldNode)
+                &pMark->GetOtherMarkPos().nNode.GetNode() == pOldNode)
             {
                 pMark->SetMarkPos(aNewPos);
                 bChangedOPos= true;
@@ -626,10 +626,10 @@ namespace sw { namespace mark
                 bChangedPos = true;
             }
             if(pMark->IsExpanded() &&
-                &pMark->GetOtherMarkPos()->nNode.GetNode() == pOldNode)
+                &pMark->GetOtherMarkPos().nNode.GetNode() == pOldNode)
             {
                 SwPosition aNewPosRel(aNewPos);
-                aNewPosRel.nContent += pMark->GetOtherMarkPos()->nContent.GetIndex();
+                aNewPosRel.nContent += pMark->GetOtherMarkPos().nContent.GetIndex();
                 pMark->SetOtherMarkPos(aNewPosRel);
                 bChangedOPos = true;
             }
@@ -679,8 +679,8 @@ namespace sw { namespace mark
             bool bIsPosInRange = lcl_GreaterThan(pMark->GetMarkPos(), rStt, pSttIdx)
                                  && lcl_Lower(pMark->GetMarkPos(), rEnd, pEndIdx);
             bool bIsOtherPosInRange = pMark->IsExpanded()
-                                      && lcl_GreaterThan(*pMark->GetOtherMarkPos(), rStt, pSttIdx)
-                                      && lcl_Lower(*pMark->GetOtherMarkPos(), rEnd, pEndIdx);
+                                      && lcl_GreaterThan(pMark->GetOtherMarkPos(), rStt, pSttIdx)
+                                      && lcl_Lower(pMark->GetOtherMarkPos(), rEnd, pEndIdx);
             // special case: completely in range, touching the end?
             if ( pEndIdx != NULL
                  && ( ( bIsOtherPosInRange
@@ -688,8 +688,8 @@ namespace sw { namespace mark
                         && pMark->GetMarkPos().nContent == *pEndIdx )
                       || ( bIsPosInRange
                            && pMark->IsExpanded()
-                           && pMark->GetOtherMarkPos()->nNode == rEnd
-                           && pMark->GetOtherMarkPos()->nContent == *pEndIdx ) ) )
+                           && pMark->GetOtherMarkPos().nNode == rEnd
+                           && pMark->GetOtherMarkPos().nContent == *pEndIdx ) ) )
             {
                 bIsPosInRange = true, bIsOtherPosInRange = true;
             }
@@ -747,7 +747,7 @@ namespace sw { namespace mark
                     else
                     {
                         pNewPos =
-                            lcl_FindExpelPosition( rStt, rEnd, bIsPosInRange ? *pMark->GetOtherMarkPos() : pMark->GetMarkPos() );
+                            lcl_FindExpelPosition( rStt, rEnd, bIsPosInRange ? pMark->GetOtherMarkPos() : pMark->GetMarkPos() );
                     }
                 }
 
@@ -1341,8 +1341,8 @@ SaveBookmark::SaveBookmark(
 
     if(rBkmk.IsExpanded())
     {
-        m_nNode2 = rBkmk.GetOtherMarkPos()->nNode.GetIndex();
-        m_nCntnt2 = rBkmk.GetOtherMarkPos()->nContent.GetIndex();
+        m_nNode2 = rBkmk.GetOtherMarkPos().nNode.GetIndex();
+        m_nCntnt2 = rBkmk.GetOtherMarkPos().nContent.GetIndex();
 
         if(m_bSaveOtherPos)
         {
@@ -1533,15 +1533,15 @@ void _SaveCntntIdx(SwDoc* pDoc,
         }
 
         if(pBkmk->IsExpanded()
-            && pBkmk->GetOtherMarkPos()->nNode.GetIndex() == nNode
-            && pBkmk->GetOtherMarkPos()->nContent.GetIndex() <= nCntnt)
+            && pBkmk->GetOtherMarkPos().nNode.GetIndex() == nNode
+            && pBkmk->GetOtherMarkPos().nContent.GetIndex() <= nCntnt)
         {
             if(bMarkPosEqual)
             { // the other position is before, the (main) position is equal
                 aSave.SetContent(pBkmk->GetMarkPos().nContent.GetIndex());
                 aSave.Add(rSaveArr);
             }
-            aSave.SetContent(pBkmk->GetOtherMarkPos()->nContent.GetIndex());
+            aSave.SetContent(pBkmk->GetOtherMarkPos().nContent.GetIndex());
             aSave.IncType();
             aSave.Add(rSaveArr);
             aSave.DecType();
@@ -1746,7 +1746,7 @@ void _RestoreCntntIdx(SwDoc* pDoc,
             case 0x8001:
             if (MarkBase* pMark = dynamic_cast<MarkBase*>(pMarkAccess->getAllMarksBegin()[aSave.GetCount()].get()))
             {
-                SwPosition aNewPos(*pMark->GetOtherMarkPos());
+                SwPosition aNewPos(pMark->GetOtherMarkPos());
                 aNewPos.nNode = *pCNd;
                 aNewPos.nContent.Assign(pCNd, aSave.GetContent() + nOffset);
                 pMark->SetOtherMarkPos(aNewPos);
@@ -1919,7 +1919,7 @@ void _RestoreCntntIdx(std::vector<sal_uLong> &rSaveArr,
                 MarkBase* pMark = dynamic_cast<MarkBase*>(pMarkAccess->getAllMarksBegin()[aSave.GetCount()].get());
                 if (pMark)
                 {
-                    SwPosition aNewPos(*pMark->GetOtherMarkPos());
+                    SwPosition aNewPos(pMark->GetOtherMarkPos());
                     aNewPos.nNode = rNd;
                     aNewPos.nContent.Assign(pCNd, std::min(aSave.GetContent(), nLen));
                     pMark->SetOtherMarkPos(aNewPos);
diff --git a/sw/source/core/doc/docdde.cxx b/sw/source/core/doc/docdde.cxx
index 1ac67e6..f321b05 100644
--- a/sw/source/core/doc/docdde.cxx
+++ b/sw/source/core/doc/docdde.cxx
@@ -386,7 +386,7 @@ bool SwDoc::SelectServerObj( const OUString& rStr, SwPaM*& rpPam,
             if(pBkmk->IsExpanded())
                 rpPam = new SwPaM(
                     pBkmk->GetMarkPos(),
-                    *pBkmk->GetOtherMarkPos());
+                    pBkmk->GetOtherMarkPos());
             return static_cast<bool>(rpPam);
         }
 
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index a363cc3..2ce11ac 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -2263,7 +2263,7 @@ bool SwDoc::ReplaceRangeImpl( SwPaM& rPam, const OUString& rStr,
 
                 *aDelPam.GetPoint() = pBkmk->GetMarkPos();
                 if(pBkmk->IsExpanded())
-                    *aDelPam.GetMark() = *pBkmk->GetOtherMarkPos();
+                    *aDelPam.GetMark() = pBkmk->GetOtherMarkPos();
                 getIDocumentMarkAccess()->deleteMark(pBkmk);
                 pStt = aDelPam.Start();
                 pTxtNd = pStt->nNode.GetNode().GetTxtNode();
@@ -2360,7 +2360,7 @@ SetRedlineMode( eOld );
 
                 *rPam.GetPoint() = pBkmk->GetMarkPos();
                 if(pBkmk->IsExpanded())
-                    *rPam.GetMark() = *pBkmk->GetOtherMarkPos();
+                    *rPam.GetMark() = pBkmk->GetOtherMarkPos();
                 getIDocumentMarkAccess()->deleteMark(pBkmk);
             }
             bJoinTxt = false;
diff --git a/sw/source/core/doc/swserv.cxx b/sw/source/core/doc/swserv.cxx
index a7d6d90..d5e9924 100644
--- a/sw/source/core/doc/swserv.cxx
+++ b/sw/source/core/doc/swserv.cxx
@@ -64,7 +64,7 @@ bool SwServerObject::GetData( uno::Any & rData,
             {
                 // Span area
                 pPam = new SwPaM( CNTNT_TYPE.pBkmk->GetMarkPos(),
-                                *CNTNT_TYPE.pBkmk->GetOtherMarkPos() );
+                                CNTNT_TYPE.pBkmk->GetOtherMarkPos() );
             }
             break;
 
diff --git a/sw/source/core/docnode/ndcopy.cxx b/sw/source/core/docnode/ndcopy.cxx
index 3c9aa78..270e2c9 100644
--- a/sw/source/core/docnode/ndcopy.cxx
+++ b/sw/source/core/docnode/ndcopy.cxx
@@ -173,8 +173,8 @@ namespace
             if(pMark->IsExpanded())
             {
                 aTmpPam.SetMark();
-                lcl_NonCopyCount(rPam, aCorrIdx, pMark->GetOtherMarkPos()->nNode.GetIndex(), nDelCount);
-                lcl_SetCpyPos(*pMark->GetOtherMarkPos(), rStt, *pCpyStt, *aTmpPam.GetMark(), nDelCount);
+                lcl_NonCopyCount(rPam, aCorrIdx, pMark->GetOtherMarkPos().nNode.GetIndex(), nDelCount);
+                lcl_SetCpyPos(pMark->GetOtherMarkPos(), rStt, *pCpyStt, *aTmpPam.GetMark(), nDelCount);
             }
 
             ::sw::mark::IMark* const pNewMark = pDestDoc->getIDocumentMarkAccess()->makeMark(
diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx
index efdecbd..f3205df 100644
--- a/sw/source/core/fields/reffld.cxx
+++ b/sw/source/core/fields/reffld.cxx
@@ -880,7 +880,7 @@ SwTxtNode* SwGetRefFieldType::FindAnchor( SwDoc* pDoc, const OUString& rRefMark,
                             *pEnd = pTxtNd->Len();
                         }
                     }
-                    else if(pBkmk->GetOtherMarkPos()->nNode == pBkmk->GetMarkPos().nNode)
+                    else if(pBkmk->GetOtherMarkPos().nNode == pBkmk->GetMarkPos().nNode)
                         *pEnd = pBkmk->GetMarkEnd().nContent.GetIndex();
                     else
                         *pEnd = -1;
diff --git a/sw/source/core/inc/bookmrk.hxx b/sw/source/core/inc/bookmrk.hxx
index 95ae338..dc5cb5d 100644
--- a/sw/source/core/inc/bookmrk.hxx
+++ b/sw/source/core/inc/bookmrk.hxx
@@ -53,26 +53,26 @@ namespace sw {
                 { return *m_pPos1; }
             virtual const OUString& GetName() const SAL_OVERRIDE
                 { return m_aName; }
-            virtual SwPosition* GetOtherMarkPos() const SAL_OVERRIDE
+            virtual SwPosition& GetOtherMarkPos() const SAL_OVERRIDE
             {
                 OSL_PRECOND(IsExpanded(), "<SwPosition::GetOtherMarkPos(..)> - I have no other Pos set." );
-                return m_pPos2.get();
+                return *m_pPos2;
             }
             virtual SwPosition& GetMarkStart() const SAL_OVERRIDE
             {
                 if( !IsExpanded() ) return GetMarkPos( );
-                if ( GetMarkPos( ) < *GetOtherMarkPos( ) )
+                if ( GetMarkPos( ) < GetOtherMarkPos( ) )
                     return GetMarkPos();
                 else
-                    return *GetOtherMarkPos( );
+                    return GetOtherMarkPos( );
             }
             virtual SwPosition& GetMarkEnd() const SAL_OVERRIDE
             {
                 if( !IsExpanded() ) return GetMarkPos();
-                if ( GetMarkPos( ) >= *GetOtherMarkPos( ) )
+                if ( GetMarkPos( ) >= GetOtherMarkPos( ) )
                     return GetMarkPos( );
                 else
-                    return *GetOtherMarkPos( );
+                    return GetOtherMarkPos( );
             }
 
             virtual bool IsCoveringPosition(const SwPosition& rPos) const SAL_OVERRIDE;
diff --git a/sw/source/core/inc/crossrefbookmark.hxx b/sw/source/core/inc/crossrefbookmark.hxx
index 22c4835..b43775d 100644
--- a/sw/source/core/inc/crossrefbookmark.hxx
+++ b/sw/source/core/inc/crossrefbookmark.hxx
@@ -37,7 +37,7 @@ namespace sw {
                 const OUString& rPrefix);
 
             // getters
-            virtual SwPosition* GetOtherMarkPos() const SAL_OVERRIDE;
+            virtual SwPosition& GetOtherMarkPos() const SAL_OVERRIDE;
             virtual SwPosition& GetMarkStart() const SAL_OVERRIDE
                 { return *m_pPos1; }
             virtual SwPosition& GetMarkEnd() const SAL_OVERRIDE
diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index fbaf20a..20fa77b 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -569,11 +569,11 @@ SwHistoryBookmark::SwHistoryBookmark(
     , m_nNode(bSavePos ?
         rBkmk.GetMarkPos().nNode.GetIndex() : 0)
     , m_nOtherNode(bSaveOtherPos ?
-        rBkmk.GetOtherMarkPos()->nNode.GetIndex() : 0)
+        rBkmk.GetOtherMarkPos().nNode.GetIndex() : 0)
     , m_nCntnt(bSavePos ?
         rBkmk.GetMarkPos().nContent.GetIndex() : 0)
     , m_nOtherCntnt(bSaveOtherPos ?
-        rBkmk.GetOtherMarkPos()->nContent.GetIndex() :0)
+        rBkmk.GetOtherMarkPos().nContent.GetIndex() :0)
     , m_bSavePos(bSavePos)
     , m_bSaveOtherPos(bSaveOtherPos)
     , m_bHadOtherPos(rBkmk.IsExpanded())
@@ -642,7 +642,7 @@ void SwHistoryBookmark::SetInDoc( SwDoc* pDoc, bool )
             "<SwHistoryBookmark::SetInDoc(..)>"
             " - missing pos on old mark");
         pPam->SetMark();
-        *pPam->GetMark() = *pMark->GetOtherMarkPos();
+        *pPam->GetMark() = pMark->GetOtherMarkPos();
     }
 
     if(pPam.get())
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index becb4e3..78697dc 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -710,8 +710,8 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
                         bSavePos = true;
                     }
                     if ( pBkmk->IsExpanded()
-                         && pStt->nNode <= pBkmk->GetOtherMarkPos()->nNode
-                         && pBkmk->GetOtherMarkPos()->nNode < pEnd->nNode )
+                         && pStt->nNode <= pBkmk->GetOtherMarkPos().nNode
+                         && pBkmk->GetOtherMarkPos().nNode < pEnd->nNode )
                     {
                         bSaveOtherPos = true;
                     }
@@ -737,10 +737,10 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
                             bSavePos = true;
                     }
                     if( pBkmk->IsExpanded() &&
-                        *pStt <= *pBkmk->GetOtherMarkPos() && *pBkmk->GetOtherMarkPos() <= *pEnd )
+                        *pStt <= pBkmk->GetOtherMarkPos() && pBkmk->GetOtherMarkPos() <= *pEnd )
                     {
                         if ( bSavePos || bSaveOtherPos
-                             || ( *pBkmk->GetOtherMarkPos() < *pEnd && *pBkmk->GetOtherMarkPos() > *pStt ) )
+                             || ( pBkmk->GetOtherMarkPos() < *pEnd && pBkmk->GetOtherMarkPos() > *pStt ) )
                         {
                             if( bMaybe )
                                 bSavePos = true;
diff --git a/sw/source/core/unocore/unobkm.cxx b/sw/source/core/unocore/unobkm.cxx
index 8af253e..9b08e0e 100644
--- a/sw/source/core/unocore/unobkm.cxx
+++ b/sw/source/core/unocore/unobkm.cxx
@@ -288,7 +288,7 @@ throw (uno::RuntimeException, std::exception)
             *m_pImpl->m_pDoc,
             m_pImpl->m_pRegisteredBookmark->GetMarkPos(),
             (m_pImpl->m_pRegisteredBookmark->IsExpanded())
-                ? m_pImpl->m_pRegisteredBookmark->GetOtherMarkPos() : NULL);
+                ? &m_pImpl->m_pRegisteredBookmark->GetOtherMarkPos() : NULL);
 }
 
 void SAL_CALL SwXBookmark::dispose()
@@ -351,7 +351,7 @@ throw (uno::RuntimeException, std::exception)
     if (m_pImpl->m_pRegisteredBookmark->IsExpanded())
     {
         aPam.SetMark();
-        *aPam.GetMark() = *m_pImpl->m_pRegisteredBookmark->GetOtherMarkPos();
+        *aPam.GetMark() = m_pImpl->m_pRegisteredBookmark->GetOtherMarkPos();
     }
 
     SwRewriter aRewriter;
diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx
index 59c71d9..1328b22 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -1021,7 +1021,7 @@ bool SwXTextRange::GetPositions(SwPaM& rToFill) const
         if(pBkmk->IsExpanded())
         {
             rToFill.SetMark();
-            *rToFill.GetMark() = *pBkmk->GetOtherMarkPos();
+            *rToFill.GetMark() = pBkmk->GetOtherMarkPos();
         }
         else
         {
diff --git a/sw/source/filter/writer/writer.cxx b/sw/source/filter/writer/writer.cxx
index 5b3df67..be1cfe6 100644
--- a/sw/source/filter/writer/writer.cxx
+++ b/sw/source/filter/writer/writer.cxx
@@ -96,9 +96,9 @@ void Writer_Impl::InsertBkmk(const ::sw::mark::IMark& rBkmk)
 
     aBkmkNodePos.insert( SwBookmarkNodeTable::value_type( nNd, &rBkmk ) );
 
-    if(rBkmk.IsExpanded() && rBkmk.GetOtherMarkPos()->nNode != nNd)
+    if(rBkmk.IsExpanded() && rBkmk.GetOtherMarkPos().nNode != nNd)
     {
-        nNd = rBkmk.GetOtherMarkPos()->nNode.GetIndex();
+        nNd = rBkmk.GetOtherMarkPos().nNode.GetIndex();
         aBkmkNodePos.insert( SwBookmarkNodeTable::value_type( nNd, &rBkmk ));
     }
 }
@@ -417,8 +417,8 @@ sal_uInt16 Writer::GetBookmarks(const SwCntntNode& rNd, sal_Int32 nStt,
                     rArr.push_back( &rBkmk );
                 }
                 else if( rBkmk.IsExpanded() && nNd ==
-                        rBkmk.GetOtherMarkPos()->nNode.GetIndex() && (nCntnt =
-                        rBkmk.GetOtherMarkPos()->nContent.GetIndex() ) >= nStt &&
+                        rBkmk.GetOtherMarkPos().nNode.GetIndex() && (nCntnt =
+                        rBkmk.GetOtherMarkPos().nContent.GetIndex() ) >= nStt &&
                         nCntnt < nEnd )
                 {
                     rArr.push_back( &rBkmk );
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 27b40fe..d110c90 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -1341,7 +1341,7 @@ void WW8Export::AppendBookmarks( const SwTxtNode& rNd, sal_Int32 nAktPos, sal_In
             const SwPosition* pPos = &rBkmk.GetMarkPos();
             const SwPosition* pOPos = 0;
             if(rBkmk.IsExpanded())
-                pOPos = rBkmk.GetOtherMarkPos();
+                pOPos = &rBkmk.GetOtherMarkPos();
             if( pOPos && pOPos->nNode == pPos->nNode &&
                 pOPos->nContent < pPos->nContent )
             {


More information about the Libreoffice-commits mailing list