[Libreoffice-commits] core.git: sw/inc sw/qa sw/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Fri May 31 06:22:12 UTC 2019
sw/inc/IDocumentMarkAccess.hxx | 5
sw/qa/core/uwriter.cxx | 18 -
sw/qa/extras/globalfilter/globalfilter.cxx | 6
sw/qa/extras/mailmerge/mailmerge.cxx | 2
sw/qa/extras/uiwriter/uiwriter.cxx | 4
sw/qa/extras/uiwriter/uiwriter2.cxx | 10
sw/source/core/crsr/crbm.cxx | 12
sw/source/core/doc/CntntIdxStore.cxx | 4
sw/source/core/doc/DocumentContentOperationsManager.cxx | 2
sw/source/core/doc/DocumentLinksAdministrationManager.cxx | 2
sw/source/core/doc/docbm.cxx | 193 ++++++--------
sw/source/core/fields/reffld.cxx | 2
sw/source/core/inc/MarkManager.hxx | 4
sw/source/core/text/EnhancedPDFExportHelper.cxx | 2
sw/source/core/txtnode/atrfld.cxx | 2
sw/source/core/undo/rolbck.cxx | 4
sw/source/core/undo/unbkmk.cxx | 2
sw/source/core/undo/undobj.cxx | 2
sw/source/core/unocore/unocoll.cxx | 4
sw/source/core/unocore/unofield.cxx | 4
sw/source/core/unocore/unoportenum.cxx | 4
sw/source/filter/html/htmlgrin.cxx | 6
sw/source/filter/html/swhtml.cxx | 2
sw/source/filter/html/wrthtml.cxx | 4
sw/source/filter/ww8/wrtw8nds.cxx | 4
sw/source/filter/ww8/ww8par.cxx | 8
sw/source/ui/dialog/uiregionsw.cxx | 2
sw/source/ui/fldui/fldref.cxx | 2
sw/source/ui/misc/bookmark.cxx | 8
sw/source/uibase/dochdl/swdtflvr.cxx | 4
sw/source/uibase/docvw/edtwin2.cxx | 4
sw/source/uibase/uiview/view2.cxx | 6
sw/source/uibase/uiview/viewmdi.cxx | 2
sw/source/uibase/utlui/bookctrl.cxx | 2
sw/source/uibase/utlui/content.cxx | 6
sw/source/uibase/utlui/navipi.cxx | 2
sw/source/uibase/wrtsh/wrtsh3.cxx | 6
37 files changed, 172 insertions(+), 184 deletions(-)
New commits:
commit 9ff648c691f003a11eba9a22ac37032d72b4b642
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu May 30 15:01:39 2019 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri May 31 08:21:31 2019 +0200
tdf#125372 writer, file with lots of hints very slow to open, part8
Takes load time from 22s to 15.5s
sw::mark::IMark does not need to be held by shared_ptr - we have one
vector, which holds all marks we created, and when we remove from that
vector, which remove the other references too.
Change-Id: Ie6d287d9d825f7129855b64a34afa81a2ef9c378
Reviewed-on: https://gerrit.libreoffice.org/73206
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/sw/inc/IDocumentMarkAccess.hxx b/sw/inc/IDocumentMarkAccess.hxx
index 19431c67a343..cbdaa7b35233 100644
--- a/sw/inc/IDocumentMarkAccess.hxx
+++ b/sw/inc/IDocumentMarkAccess.hxx
@@ -52,8 +52,7 @@ class IDocumentMarkAccess
NAVIGATOR_REMINDER
};
- typedef std::shared_ptr< ::sw::mark::IMark> pMark_t;
- typedef std::vector< pMark_t > container_t;
+ typedef std::vector< ::sw::mark::IMark* > container_t;
typedef container_t::iterator iterator_t;
typedef container_t::const_iterator const_iterator_t;
typedef container_t::const_reverse_iterator const_reverse_iterator_t;
@@ -184,7 +183,7 @@ class IDocumentMarkAccess
@param ppMark
[in] an iterator pointing to the Mark to be deleted.
*/
- virtual std::shared_ptr<ILazyDeleter>
+ virtual std::unique_ptr<ILazyDeleter>
deleteMark(const IDocumentMarkAccess::const_iterator_t& ppMark) =0;
/** Deletes a mark.
diff --git a/sw/qa/core/uwriter.cxx b/sw/qa/core/uwriter.cxx
index 20ac02c6a3b0..6b18e67e1392 100644
--- a/sw/qa/core/uwriter.cxx
+++ b/sw/qa/core/uwriter.cxx
@@ -1615,9 +1615,9 @@ void SwDocTest::testMarkMove()
SwTextNode& rParaNode2 = dynamic_cast<SwTextNode&>(aIdx.GetNode());
rParaNode2.JoinNext();
}
- ::sw::mark::IMark* pBM1 = pMarksAccess->findMark("Para1")->get();
- ::sw::mark::IMark* pBM2 = pMarksAccess->findMark("Para2")->get();
- ::sw::mark::IMark* pBM3 = pMarksAccess->findMark("Para3")->get();
+ ::sw::mark::IMark* pBM1 = *pMarksAccess->findMark("Para1");
+ ::sw::mark::IMark* pBM2 = *pMarksAccess->findMark("Para2");
+ ::sw::mark::IMark* pBM3 = *pMarksAccess->findMark("Para3");
CPPUNIT_ASSERT_EQUAL(sal_Int32(0) , pBM1->GetMarkStart().nContent.GetIndex());
CPPUNIT_ASSERT_EQUAL(sal_Int32(11), pBM1->GetMarkEnd().nContent.GetIndex());
@@ -1652,9 +1652,9 @@ void SwDocTest::testMarkMove()
aPaM.GetMark()->nContent += 6;
m_pDoc->getIDocumentContentOperations().DeleteAndJoin(aPaM);
}
- pBM1 = pMarksAccess->findMark("Para1")->get();
- pBM2 = pMarksAccess->findMark("Para2")->get();
- pBM3 = pMarksAccess->findMark("Para3")->get();
+ pBM1 = *pMarksAccess->findMark("Para1");
+ pBM2 = *pMarksAccess->findMark("Para2");
+ pBM3 = *pMarksAccess->findMark("Para3");
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pBM1->GetMarkStart().nContent.GetIndex());
CPPUNIT_ASSERT_EQUAL(sal_Int32(6), pBM1->GetMarkEnd().nContent.GetIndex());
@@ -1688,9 +1688,9 @@ void SwDocTest::testMarkMove()
aPos.nContent += 8;
m_pDoc->getIDocumentContentOperations().SplitNode(aPos, false);
}
- pBM1 = pMarksAccess->findMark("Para1")->get();
- pBM2 = pMarksAccess->findMark("Para2")->get();
- pBM3 = pMarksAccess->findMark("Para3")->get();
+ pBM1 = *pMarksAccess->findMark("Para1");
+ pBM2 = *pMarksAccess->findMark("Para2");
+ pBM3 = *pMarksAccess->findMark("Para3");
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pBM1->GetMarkStart().nContent.GetIndex());
CPPUNIT_ASSERT_EQUAL(sal_Int32(6), pBM1->GetMarkEnd().nContent.GetIndex());
diff --git a/sw/qa/extras/globalfilter/globalfilter.cxx b/sw/qa/extras/globalfilter/globalfilter.cxx
index e487a07346c2..012e16eb3de2 100644
--- a/sw/qa/extras/globalfilter/globalfilter.cxx
+++ b/sw/qa/extras/globalfilter/globalfilter.cxx
@@ -1070,7 +1070,7 @@ void Test::testTextFormField()
// Check whether all fieldmarks are text form fields
for(auto aIter = pMarkAccess->getAllMarksBegin(); aIter != pMarkAccess->getAllMarksEnd(); ++aIter)
{
- ::sw::mark::IFieldmark* pFieldmark = dynamic_cast<::sw::mark::IFieldmark*>(aIter->get());
+ ::sw::mark::IFieldmark* pFieldmark = dynamic_cast<::sw::mark::IFieldmark*>(*aIter);
CPPUNIT_ASSERT_MESSAGE(sFailedMessage.getStr(), pFieldmark);
CPPUNIT_ASSERT_EQUAL_MESSAGE(sFailedMessage.getStr(), OUString(ODF_FORMTEXT), pFieldmark->GetFieldname());
}
@@ -1128,7 +1128,7 @@ void Test::testCheckBoxFormField()
int nIndex = 0;
for(auto aIter = pMarkAccess->getAllMarksBegin(); aIter != pMarkAccess->getAllMarksEnd(); ++aIter)
{
- ::sw::mark::IFieldmark* pFieldmark = dynamic_cast<::sw::mark::IFieldmark*>(aIter->get());
+ ::sw::mark::IFieldmark* pFieldmark = dynamic_cast<::sw::mark::IFieldmark*>(*aIter);
if(rFilterName == "Office Open XML Text") // OOXML import also generates bookmarks
{
@@ -1190,7 +1190,7 @@ void Test::testDropDownFormField()
int nIndex = 0;
for(auto aIter = pMarkAccess->getAllMarksBegin(); aIter != pMarkAccess->getAllMarksEnd(); ++aIter)
{
- ::sw::mark::IFieldmark* pFieldmark = dynamic_cast<::sw::mark::IFieldmark*>(aIter->get());
+ ::sw::mark::IFieldmark* pFieldmark = dynamic_cast<::sw::mark::IFieldmark*>(*aIter);
if(!pFieldmark)
continue;
diff --git a/sw/qa/extras/mailmerge/mailmerge.cxx b/sw/qa/extras/mailmerge/mailmerge.cxx
index 7e6e20967e27..5395afa25bce 100644
--- a/sw/qa/extras/mailmerge/mailmerge.cxx
+++ b/sw/qa/extras/mailmerge/mailmerge.cxx
@@ -345,7 +345,7 @@ int MMTest::documentStartPageNumber( int document ) const
CPPUNIT_ASSERT_EQUAL(document, pos);
sal_uInt16 page, dummy;
shell->Push();
- shell->GotoMark( mark->get());
+ shell->GotoMark( *mark );
shell->GetPageNum( page, dummy );
shell->Pop(SwCursorShell::PopMode::DeleteCurrent);
return page;
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 1e117ce3996d..e403adb33e96 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -1666,7 +1666,7 @@ void SwUiWriterTest::testBookmarkUndo()
IDocumentMarkAccess::const_iterator_t ppBkmk = pMarkAccess->findMark("Mark");
CPPUNIT_ASSERT(ppBkmk != pMarkAccess->getAllMarksEnd());
- pMarkAccess->renameMark(ppBkmk->get(), "Mark_");
+ pMarkAccess->renameMark(*ppBkmk, "Mark_");
CPPUNIT_ASSERT(bool(pMarkAccess->findMark("Mark") == pMarkAccess->getAllMarksEnd()));
CPPUNIT_ASSERT(pMarkAccess->findMark("Mark_") != pMarkAccess->getAllMarksEnd());
rUndoManager.Undo();
@@ -1876,7 +1876,7 @@ void SwUiWriterTest::testTdf51741()
IDocumentMarkAccess::const_iterator_t ppBkmk = pMarkAccess->findMark("Mark");
CPPUNIT_ASSERT(ppBkmk != pMarkAccess->getAllMarksEnd());
//Modification 4
- pMarkAccess->renameMark(ppBkmk->get(), "Mark_");
+ pMarkAccess->renameMark(*ppBkmk, "Mark_");
CPPUNIT_ASSERT(pWrtShell->IsModified());
pWrtShell->ResetModified();
CPPUNIT_ASSERT(bool(pMarkAccess->findMark("Mark") == pMarkAccess->getAllMarksEnd()));
diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx
index 7bf5df086ab5..da1838597825 100644
--- a/sw/qa/extras/uiwriter/uiwriter2.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter2.cxx
@@ -1029,7 +1029,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTextFormFieldInsertion)
// Check whether the fieldmark is created
auto aIter = pMarkAccess->getAllMarksBegin();
CPPUNIT_ASSERT(aIter != pMarkAccess->getAllMarksEnd());
- ::sw::mark::IFieldmark* pFieldmark = dynamic_cast<::sw::mark::IFieldmark*>(aIter->get());
+ ::sw::mark::IFieldmark* pFieldmark = dynamic_cast<::sw::mark::IFieldmark*>(*aIter);
CPPUNIT_ASSERT(pFieldmark);
CPPUNIT_ASSERT_EQUAL(OUString(ODF_FORMTEXT), pFieldmark->GetFieldname());
@@ -1067,7 +1067,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testCheckboxFormFieldInsertion)
// Check whether the fieldmark is created
auto aIter = pMarkAccess->getAllMarksBegin();
CPPUNIT_ASSERT(aIter != pMarkAccess->getAllMarksEnd());
- ::sw::mark::IFieldmark* pFieldmark = dynamic_cast<::sw::mark::IFieldmark*>(aIter->get());
+ ::sw::mark::IFieldmark* pFieldmark = dynamic_cast<::sw::mark::IFieldmark*>(*aIter);
CPPUNIT_ASSERT(pFieldmark);
CPPUNIT_ASSERT_EQUAL(OUString(ODF_FORMCHECKBOX), pFieldmark->GetFieldname());
// The checkbox is not checked by default
@@ -1085,7 +1085,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testCheckboxFormFieldInsertion)
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pMarkAccess->getAllMarksCount());
aIter = pMarkAccess->getAllMarksBegin();
CPPUNIT_ASSERT(aIter != pMarkAccess->getAllMarksEnd());
- pFieldmark = dynamic_cast<::sw::mark::IFieldmark*>(aIter->get());
+ pFieldmark = dynamic_cast<::sw::mark::IFieldmark*>(*aIter);
CPPUNIT_ASSERT(pFieldmark);
CPPUNIT_ASSERT_EQUAL(OUString(ODF_FORMCHECKBOX), pFieldmark->GetFieldname());
}
@@ -1106,7 +1106,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testDropDownFormFieldInsertion)
// Check whether the fieldmark is created
auto aIter = pMarkAccess->getAllMarksBegin();
CPPUNIT_ASSERT(aIter != pMarkAccess->getAllMarksEnd());
- ::sw::mark::IFieldmark* pFieldmark = dynamic_cast<::sw::mark::IFieldmark*>(aIter->get());
+ ::sw::mark::IFieldmark* pFieldmark = dynamic_cast<::sw::mark::IFieldmark*>(*aIter);
CPPUNIT_ASSERT(pFieldmark);
CPPUNIT_ASSERT_EQUAL(OUString(ODF_FORMDROPDOWN), pFieldmark->GetFieldname());
// Check drop down field's parameters. By default these params are not set
@@ -1125,7 +1125,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testDropDownFormFieldInsertion)
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pMarkAccess->getAllMarksCount());
aIter = pMarkAccess->getAllMarksBegin();
CPPUNIT_ASSERT(aIter != pMarkAccess->getAllMarksEnd());
- pFieldmark = dynamic_cast<::sw::mark::IFieldmark*>(aIter->get());
+ pFieldmark = dynamic_cast<::sw::mark::IFieldmark*>(*aIter);
CPPUNIT_ASSERT(pFieldmark);
CPPUNIT_ASSERT_EQUAL(OUString(ODF_FORMDROPDOWN), pFieldmark->GetFieldname());
}
diff --git a/sw/source/core/crsr/crbm.cxx b/sw/source/core/crsr/crbm.cxx
index 543ecabb3f3f..2744c1a50775 100644
--- a/sw/source/core/crsr/crbm.cxx
+++ b/sw/source/core/crsr/crbm.cxx
@@ -66,13 +66,13 @@ namespace
SwCursorSaveState const m_aSaveState;
};
- bool lcl_ReverseMarkOrderingByEnd(const IDocumentMarkAccess::pMark_t& rpFirst,
- const IDocumentMarkAccess::pMark_t& rpSecond)
+ bool lcl_ReverseMarkOrderingByEnd(const ::sw::mark::IMark* pFirst,
+ const ::sw::mark::IMark* pSecond)
{
- return rpFirst->GetMarkEnd() > rpSecond->GetMarkEnd();
+ return pFirst->GetMarkEnd() > pSecond->GetMarkEnd();
}
- bool lcl_IsInvisibleBookmark(const IDocumentMarkAccess::pMark_t& pMark)
+ bool lcl_IsInvisibleBookmark(const ::sw::mark::IMark* pMark)
{
return IDocumentMarkAccess::GetType(*pMark) != IDocumentMarkAccess::MarkType::BOOKMARK;
}
@@ -218,7 +218,7 @@ bool SwCursorShell::GoNextBookmark()
{
continue;
}
- aCursorSt.SetCursorToMark(ppMark->get());
+ aCursorSt.SetCursorToMark(*ppMark);
if(!aCursorSt.RollbackIfIllegal())
break; // found legal move
}
@@ -263,7 +263,7 @@ bool SwCursorShell::GoPrevBookmark()
{
continue;
}
- aCursorSt.SetCursorToMark(ppMark->get());
+ aCursorSt.SetCursorToMark(*ppMark);
if(!aCursorSt.RollbackIfIllegal())
break; // found legal move
}
diff --git a/sw/source/core/doc/CntntIdxStore.cxx b/sw/source/core/doc/CntntIdxStore.cxx
index 6d8a8b8bf5dd..277eb4fe2a72 100644
--- a/sw/source/core/doc/CntntIdxStore.cxx
+++ b/sw/source/core/doc/CntntIdxStore.cxx
@@ -240,7 +240,7 @@ void ContentIdxStoreImpl::SaveBkmks(SwDoc* pDoc, sal_uLong nNode, sal_Int32 nCon
ppBkmk != ppBkmkEnd;
++ppBkmk)
{
- const ::sw::mark::IMark* pBkmk = ppBkmk->get();
+ const ::sw::mark::IMark* pBkmk = *ppBkmk;
bool bMarkPosEqual = false;
if(pBkmk->GetMarkPos().nNode.GetIndex() == nNode
&& pBkmk->GetMarkPos().nContent.GetIndex() <= nContent)
@@ -273,7 +273,7 @@ void ContentIdxStoreImpl::RestoreBkmks(SwDoc* pDoc, updater_t const & rUpdater)
IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess();
for (const MarkEntry& aEntry : m_aBkmkEntries)
{
- if (MarkBase* pMark = dynamic_cast<MarkBase*>(pMarkAccess->getAllMarksBegin()[aEntry.m_nIdx].get()))
+ if (MarkBase* pMark = dynamic_cast<MarkBase*>(pMarkAccess->getAllMarksBegin()[aEntry.m_nIdx]))
{
SwPosition aNewPos(GetRightMarkPos(pMark, aEntry.m_bOther));
rUpdater(aNewPos, aEntry.m_nContent);
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index f15bb96ba7ae..a49fcd7f3a63 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -237,7 +237,7 @@ namespace
ppMark != pSrcMarkAccess->getAllMarksEnd();
++ppMark )
{
- const ::sw::mark::IMark* const pMark = ppMark->get();
+ const ::sw::mark::IMark* const pMark = *ppMark;
const SwPosition& rMarkStart = pMark->GetMarkStart();
const SwPosition& rMarkEnd = pMark->GetMarkEnd();
diff --git a/sw/source/core/doc/DocumentLinksAdministrationManager.cxx b/sw/source/core/doc/DocumentLinksAdministrationManager.cxx
index 65f0319936bd..b9e0e70f1647 100644
--- a/sw/source/core/doc/DocumentLinksAdministrationManager.cxx
+++ b/sw/source/core/doc/DocumentLinksAdministrationManager.cxx
@@ -95,7 +95,7 @@ namespace
ppMark != rMarkAccess.getAllMarksEnd();
++ppMark)
{
- if (::sw::mark::DdeBookmark* const pBkmk = dynamic_cast< ::sw::mark::DdeBookmark*>(ppMark->get()))
+ if (::sw::mark::DdeBookmark* const pBkmk = dynamic_cast< ::sw::mark::DdeBookmark*>(*ppMark))
{
if (
(bCaseSensitive && (pBkmk->GetName() == sNameLc)) ||
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 096c6ab29549..828e5bd7cd30 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -77,11 +77,11 @@ namespace
&& rPos.nContent < pIdx->GetIndex() );
}
- bool lcl_MarkOrderingByStart(const IDocumentMarkAccess::pMark_t& rpFirst,
- const IDocumentMarkAccess::pMark_t& rpSecond)
+ bool lcl_MarkOrderingByStart(const ::sw::mark::IMark* pFirst,
+ const ::sw::mark::IMark* pSecond)
{
- auto const& rFirstStart(rpFirst->GetMarkStart());
- auto const& rSecondStart(rpSecond->GetMarkStart());
+ auto const& rFirstStart(pFirst->GetMarkStart());
+ auto const& rSecondStart(pSecond->GetMarkStart());
if (rFirstStart.nNode != rSecondStart.nNode)
{
return rFirstStart.nNode < rSecondStart.nNode;
@@ -92,8 +92,8 @@ namespace
{
return nFirstContent < nSecondContent;
}
- auto *const pCRFirst (dynamic_cast<::sw::mark::CrossRefBookmark const*>(rpFirst.get()));
- auto *const pCRSecond(dynamic_cast<::sw::mark::CrossRefBookmark const*>(rpSecond.get()));
+ auto *const pCRFirst (dynamic_cast<::sw::mark::CrossRefBookmark const*>(pFirst));
+ auto *const pCRSecond(dynamic_cast<::sw::mark::CrossRefBookmark const*>(pSecond));
if ((pCRFirst == nullptr) == (pCRSecond == nullptr))
{
return false; // equal
@@ -101,14 +101,14 @@ namespace
return pCRFirst != nullptr; // cross-ref sorts *before*
}
- bool lcl_MarkOrderingByEnd(const IDocumentMarkAccess::pMark_t& rpFirst,
- const IDocumentMarkAccess::pMark_t& rpSecond)
+ bool lcl_MarkOrderingByEnd(const ::sw::mark::IMark* pFirst,
+ const ::sw::mark::IMark* pSecond)
{
- return rpFirst->GetMarkEnd() < rpSecond->GetMarkEnd();
+ return pFirst->GetMarkEnd() < pSecond->GetMarkEnd();
}
void lcl_InsertMarkSorted(IDocumentMarkAccess::container_t& io_vMarks,
- const IDocumentMarkAccess::pMark_t& pMark)
+ ::sw::mark::IMark* pMark)
{
io_vMarks.insert(
lower_bound(
@@ -162,11 +162,11 @@ namespace
struct CompareIMarkStartsBefore
{
bool operator()(SwPosition const& rPos,
- std::shared_ptr<sw::mark::IMark> const& pMark)
+ const sw::mark::IMark* pMark)
{
return rPos < pMark->GetMarkStart();
}
- bool operator()(std::shared_ptr<sw::mark::IMark> const& pMark,
+ bool operator()(const sw::mark::IMark* pMark,
SwPosition const& rPos)
{
return pMark->GetMarkStart() < rPos;
@@ -178,7 +178,7 @@ namespace
struct CompareIMarkStartsAfter
{
bool operator()(SwPosition const& rPos,
- std::shared_ptr<sw::mark::IMark> const& pMark)
+ const sw::mark::IMark* pMark)
{
return pMark->GetMarkStart() > rPos;
}
@@ -192,8 +192,9 @@ namespace
rMarks.end(),
rPos,
CompareIMarkStartsAfter());
- if(pMarkAfter == rMarks.end()) return nullptr;
- return pMarkAfter->get();
+ if(pMarkAfter == rMarks.end())
+ return nullptr;
+ return *pMarkAfter;
};
IMark* lcl_getMarkBefore(const IDocumentMarkAccess::container_t& rMarks, const SwPosition& rPos)
@@ -212,11 +213,11 @@ namespace
rMarks.begin(),
pCandidatesEnd,
back_inserter(vCandidates),
- [&rPos] (IDocumentMarkAccess::pMark_t const& rpMark) { return !(rpMark->GetMarkEnd() < rPos); } );
+ [&rPos] (const ::sw::mark::IMark* pMark) { return !(pMark->GetMarkEnd() < rPos); } );
// no candidate left => we are in front of the first mark or there are none
if(vCandidates.empty()) return nullptr;
// return the highest (last) candidate using mark end ordering
- return max_element(vCandidates.begin(), vCandidates.end(), &lcl_MarkOrderingByEnd)->get();
+ return *max_element(vCandidates.begin(), vCandidates.end(), &lcl_MarkOrderingByEnd);
}
bool lcl_FixCorrectedMark(
@@ -252,26 +253,26 @@ namespace
return false;
}
- bool lcl_MarkEqualByStart(const IDocumentMarkAccess::pMark_t& rpFirst,
- const IDocumentMarkAccess::pMark_t& rpSecond)
+ bool lcl_MarkEqualByStart( ::sw::mark::IMark* pFirst,
+ const ::sw::mark::IMark* pSecond)
{
- return !lcl_MarkOrderingByStart(rpFirst, rpSecond) &&
- !lcl_MarkOrderingByStart(rpSecond, rpFirst);
+ return !lcl_MarkOrderingByStart(pFirst, pSecond) &&
+ !lcl_MarkOrderingByStart(pSecond, pFirst);
}
IDocumentMarkAccess::iterator_t lcl_FindMark(
IDocumentMarkAccess::container_t& rMarks,
- const IDocumentMarkAccess::pMark_t& rpMarkToFind)
+ const ::sw::mark::IMark* pMarkToFind)
{
IDocumentMarkAccess::iterator_t ppCurrentMark = lower_bound(
rMarks.begin(), rMarks.end(),
- rpMarkToFind, &lcl_MarkOrderingByStart);
+ pMarkToFind, &lcl_MarkOrderingByStart);
// since there are usually not too many marks on the same start
// position, we are not doing a bisect search for the upper bound
// but instead start to iterate from pMarkLow directly
- while (ppCurrentMark != rMarks.end() && lcl_MarkEqualByStart(*ppCurrentMark, rpMarkToFind))
+ while (ppCurrentMark != rMarks.end() && lcl_MarkEqualByStart(*ppCurrentMark, pMarkToFind))
{
- if(ppCurrentMark->get() == rpMarkToFind.get())
+ if(*ppCurrentMark == pMarkToFind)
{
return ppCurrentMark;
}
@@ -296,7 +297,7 @@ namespace
{
// Once we reach a mark starting after the target pos
// we do not need to continue
- if(ppCurrentMark->get()->GetMarkStart() > rPos)
+ if((*ppCurrentMark)->GetMarkStart() > rPos)
break;
if(IDocumentMarkAccess::GetType(**ppCurrentMark) == eType)
{
@@ -316,7 +317,7 @@ namespace
return find_if(
ppMarksBegin,
ppMarksEnd,
- [&rName] (IDocumentMarkAccess::pMark_t const& rpMark) { return rpMark->GetName() == rName; } );
+ [&rName] (::sw::mark::IMark* pMark) { return pMark->GetName() == rName; } );
}
void lcl_DebugMarks(IDocumentMarkAccess::container_t const& rMarks)
@@ -327,7 +328,7 @@ namespace
ppMark != rMarks.end();
++ppMark)
{
- IMark* pMark = ppMark->get();
+ IMark* pMark = *ppMark;
const SwPosition* const pStPos = &pMark->GetMarkStart();
const SwPosition* const pEndPos = &pMark->GetMarkEnd();
SAL_INFO("sw.core",
@@ -431,38 +432,38 @@ namespace sw { namespace mark
}
// create mark
- pMark_t pMark;
+ std::unique_ptr<::sw::mark::IMark> pMark;
switch(eType)
{
case IDocumentMarkAccess::MarkType::TEXT_FIELDMARK:
- pMark = std::shared_ptr<IMark>(new TextFieldmark(rPaM, rName));
+ pMark = std::make_unique<TextFieldmark>(rPaM, rName);
break;
case IDocumentMarkAccess::MarkType::CHECKBOX_FIELDMARK:
- pMark = std::shared_ptr<IMark>(new CheckboxFieldmark(rPaM));
+ pMark = std::make_unique<CheckboxFieldmark>(rPaM);
break;
case IDocumentMarkAccess::MarkType::DROPDOWN_FIELDMARK:
- pMark = std::shared_ptr<IMark>(new DropDownFieldmark(rPaM));
+ pMark = std::make_unique<DropDownFieldmark>(rPaM);
break;
case IDocumentMarkAccess::MarkType::NAVIGATOR_REMINDER:
- pMark = std::shared_ptr<IMark>(new NavigatorReminder(rPaM));
+ pMark = std::make_unique<NavigatorReminder>(rPaM);
break;
case IDocumentMarkAccess::MarkType::BOOKMARK:
- pMark = std::shared_ptr<IMark>(new Bookmark(rPaM, vcl::KeyCode(), rName));
+ pMark = std::make_unique<Bookmark>(rPaM, vcl::KeyCode(), rName);
break;
case IDocumentMarkAccess::MarkType::DDE_BOOKMARK:
- pMark = std::shared_ptr<IMark>(new DdeBookmark(rPaM));
+ pMark = std::make_unique<DdeBookmark>(rPaM);
break;
case IDocumentMarkAccess::MarkType::CROSSREF_HEADING_BOOKMARK:
- pMark = std::shared_ptr<IMark>(new CrossRefHeadingBookmark(rPaM, vcl::KeyCode(), rName));
+ pMark = std::make_unique<CrossRefHeadingBookmark>(rPaM, vcl::KeyCode(), rName);
break;
case IDocumentMarkAccess::MarkType::CROSSREF_NUMITEM_BOOKMARK:
- pMark = std::shared_ptr<IMark>(new CrossRefNumItemBookmark(rPaM, vcl::KeyCode(), rName));
+ pMark = std::make_unique<CrossRefNumItemBookmark>(rPaM, vcl::KeyCode(), rName);
break;
case IDocumentMarkAccess::MarkType::UNO_BOOKMARK:
- pMark = std::shared_ptr<IMark>(new UnoMark(rPaM));
+ pMark = std::make_unique<UnoMark>(rPaM);
break;
case IDocumentMarkAccess::MarkType::ANNOTATIONMARK:
- pMark = std::shared_ptr<IMark>(new AnnotationMark( rPaM, rName ));
+ pMark = std::make_unique<AnnotationMark>( rPaM, rName );
break;
}
assert(pMark.get() &&
@@ -481,21 +482,21 @@ namespace sw { namespace mark
pMarkBase->SetName( getUniqueMarkName( pMarkBase->GetName() ) );
// register mark
- lcl_InsertMarkSorted(m_vAllMarks, pMark);
+ lcl_InsertMarkSorted(m_vAllMarks, pMark.get());
switch(eType)
{
case IDocumentMarkAccess::MarkType::BOOKMARK:
case IDocumentMarkAccess::MarkType::CROSSREF_NUMITEM_BOOKMARK:
case IDocumentMarkAccess::MarkType::CROSSREF_HEADING_BOOKMARK:
- lcl_InsertMarkSorted(m_vBookmarks, pMark);
+ lcl_InsertMarkSorted(m_vBookmarks, pMark.get());
break;
case IDocumentMarkAccess::MarkType::TEXT_FIELDMARK:
case IDocumentMarkAccess::MarkType::CHECKBOX_FIELDMARK:
case IDocumentMarkAccess::MarkType::DROPDOWN_FIELDMARK:
- lcl_InsertMarkSorted(m_vFieldmarks, pMark);
+ lcl_InsertMarkSorted(m_vFieldmarks, pMark.get());
break;
case IDocumentMarkAccess::MarkType::ANNOTATIONMARK:
- lcl_InsertMarkSorted( m_vAnnotationMarks, pMark );
+ lcl_InsertMarkSorted( m_vAnnotationMarks, pMark.get() );
break;
case IDocumentMarkAccess::MarkType::NAVIGATOR_REMINDER:
case IDocumentMarkAccess::MarkType::DDE_BOOKMARK:
@@ -512,7 +513,7 @@ namespace sw { namespace mark
SAL_INFO("sw.core", "Fieldmarks");
lcl_DebugMarks(m_vFieldmarks);
- return pMark.get();
+ return pMark.release();
}
::sw::mark::IFieldmark* MarkManager::makeFieldBookmark(
@@ -590,7 +591,7 @@ namespace sw { namespace mark
aPos.nContent.Assign(&const_cast<SwTextNode&>(rTextNode), 0);
const iterator_t ppExistingMark = lcl_FindMarkAtPos(m_vBookmarks, aPos, eType);
if(ppExistingMark != m_vBookmarks.end())
- return ppExistingMark->get();
+ return *ppExistingMark;
const SwPaM aPaM(aPos);
return makeMark(aPaM, OUString(), eType, sw::mark::InsertMode::New);
}
@@ -669,7 +670,7 @@ namespace sw { namespace mark
ppMark != m_vAllMarks.end();
++ppMark)
{
- ::sw::mark::MarkBase* pMark = dynamic_cast< ::sw::mark::MarkBase* >(ppMark->get());
+ ::sw::mark::MarkBase* pMark = dynamic_cast< ::sw::mark::MarkBase* >(*ppMark);
// correction of non-existent non-MarkBase instances cannot be done
assert(pMark);
// is on position ??
@@ -714,7 +715,7 @@ namespace sw { namespace mark
{
// is on position ??
bool bChangedPos = false, bChangedOPos = false;
- ::sw::mark::MarkBase* const pMark = dynamic_cast< ::sw::mark::MarkBase* >(ppMark->get());
+ ::sw::mark::MarkBase* const pMark = dynamic_cast< ::sw::mark::MarkBase* >(*ppMark);
// correction of non-existent non-MarkBase instances cannot be done
assert(pMark);
if(&pMark->GetMarkPos().nNode.GetNode() == pOldNode)
@@ -776,7 +777,7 @@ namespace sw { namespace mark
if(IDocumentMarkAccess::GetType(**ppMark) == MarkType::NAVIGATOR_REMINDER)
continue;
- ::sw::mark::MarkBase* pMark = dynamic_cast< ::sw::mark::MarkBase* >(ppMark->get());
+ ::sw::mark::MarkBase* pMark = dynamic_cast< ::sw::mark::MarkBase* >(*ppMark);
if (!pMark)
continue;
@@ -897,7 +898,7 @@ namespace sw { namespace mark
// fdo#61016 delay the deletion of the fieldmark characters
// to prevent that from deleting the marks on that position
// which would invalidate the iterators in vMarksToDelete
- std::vector< std::shared_ptr<ILazyDeleter> > vDelay;
+ std::vector< std::unique_ptr<ILazyDeleter> > vDelay;
vDelay.reserve(vMarksToDelete.size());
// If needed, sort mark containers containing subsets of the marks
@@ -933,34 +934,34 @@ namespace sw { namespace mark
struct LazyFieldmarkDeleter : public IDocumentMarkAccess::ILazyDeleter
{
- std::shared_ptr<IMark> const m_pFieldmark;
- SwDoc *const m_pDoc;
- LazyFieldmarkDeleter(
- std::shared_ptr<IMark> const& pMark, SwDoc *const pDoc)
+ std::unique_ptr<Fieldmark> m_pFieldmark;
+ SwDoc * m_pDoc;
+ LazyFieldmarkDeleter(Fieldmark* pMark, SwDoc *const pDoc)
: m_pFieldmark(pMark), m_pDoc(pDoc)
- { }
+ {
+ assert(m_pFieldmark);
+ }
virtual ~LazyFieldmarkDeleter() override
{
- Fieldmark *const pFieldMark(
- dynamic_cast<Fieldmark*>(m_pFieldmark.get()));
- assert(pFieldMark);
- pFieldMark->ReleaseDoc(m_pDoc);
+ m_pFieldmark->ReleaseDoc(m_pDoc);
}
};
- std::shared_ptr<IDocumentMarkAccess::ILazyDeleter>
+ std::unique_ptr<IDocumentMarkAccess::ILazyDeleter>
MarkManager::deleteMark(const const_iterator_t& ppMark)
{
- std::shared_ptr<ILazyDeleter> ret;
- if (ppMark == m_vAllMarks.end()) return ret;
+ std::unique_ptr<ILazyDeleter> ret;
+ if (ppMark == m_vAllMarks.end())
+ return ret;
+ IMark* pMark = *ppMark;
- switch(IDocumentMarkAccess::GetType(**ppMark))
+ switch(IDocumentMarkAccess::GetType(*pMark))
{
case IDocumentMarkAccess::MarkType::BOOKMARK:
case IDocumentMarkAccess::MarkType::CROSSREF_HEADING_BOOKMARK:
case IDocumentMarkAccess::MarkType::CROSSREF_NUMITEM_BOOKMARK:
{
- IDocumentMarkAccess::iterator_t ppBookmark = lcl_FindMark(m_vBookmarks, *ppMark);
+ IDocumentMarkAccess::iterator_t ppBookmark = lcl_FindMark(m_vBookmarks, pMark);
if ( ppBookmark != m_vBookmarks.end() )
{
m_vBookmarks.erase(ppBookmark);
@@ -977,14 +978,14 @@ namespace sw { namespace mark
case IDocumentMarkAccess::MarkType::CHECKBOX_FIELDMARK:
case IDocumentMarkAccess::MarkType::DROPDOWN_FIELDMARK:
{
- IDocumentMarkAccess::iterator_t ppFieldmark = lcl_FindMark(m_vFieldmarks, *ppMark);
+ IDocumentMarkAccess::iterator_t ppFieldmark = lcl_FindMark(m_vFieldmarks, pMark);
if ( ppFieldmark != m_vFieldmarks.end() )
{
- if(m_pLastActiveFieldmark == ppFieldmark->get())
+ if(m_pLastActiveFieldmark == *ppFieldmark)
ClearFieldActivation();
m_vFieldmarks.erase(ppFieldmark);
- ret.reset(new LazyFieldmarkDeleter(*ppMark, m_pDoc));
+ ret.reset(new LazyFieldmarkDeleter(dynamic_cast<Fieldmark*>(pMark), m_pDoc));
}
else
{
@@ -996,40 +997,33 @@ namespace sw { namespace mark
case IDocumentMarkAccess::MarkType::ANNOTATIONMARK:
{
- IDocumentMarkAccess::iterator_t ppAnnotationMark = lcl_FindMark(m_vAnnotationMarks, *ppMark);
+ IDocumentMarkAccess::iterator_t ppAnnotationMark = lcl_FindMark(m_vAnnotationMarks, pMark);
assert(ppAnnotationMark != m_vAnnotationMarks.end() &&
"<MarkManager::deleteMark(..)> - Annotation Mark not found in Annotation Mark container.");
m_vAnnotationMarks.erase(ppAnnotationMark);
}
break;
- case IDocumentMarkAccess::MarkType::NAVIGATOR_REMINDER:
case IDocumentMarkAccess::MarkType::DDE_BOOKMARK:
+ case IDocumentMarkAccess::MarkType::NAVIGATOR_REMINDER:
case IDocumentMarkAccess::MarkType::UNO_BOOKMARK:
// no special marks container
break;
}
- DdeBookmark* const pDdeBookmark = dynamic_cast<DdeBookmark*>(ppMark->get());
- if(pDdeBookmark)
+ DdeBookmark* const pDdeBookmark = dynamic_cast<DdeBookmark*>(pMark);
+ if (pDdeBookmark)
pDdeBookmark->DeregisterFromDoc(m_pDoc);
//Effective STL Item 27, get a non-const iterator aI at the same
//position as const iterator ppMark was
iterator_t aI = m_vAllMarks.begin();
std::advance(aI, std::distance<const_iterator_t>(aI, ppMark));
- //fdo#37974
- //a) a mark destructor may callback into this method.
- //b) vector::erase first calls the destructor of the object, then
- //removes it from the vector.
- //So if the only reference to the object is the one
- //in the vector then we may reenter this method when the mark
- //is destructed but before it is removed, i.e. findMark still
- //finds the object whose destructor is being run. Take a temp
- //extra reference on the shared_ptr, remove the entry from the
- //vector, and on xHoldPastErase release findMark won't find
- //it anymore.
- pMark_t xHoldPastErase = *aI;
m_vAllMarks.erase(aI);
+ // If we don't have a lazy deleter
+ if (!ret)
+ // delete after we remove from the list, because the destructor can
+ // recursively call into this method.
+ delete pMark;
return ret;
}
@@ -1046,7 +1040,7 @@ namespace sw { namespace mark
pMark->GetMarkStart(),
CompareIMarkStartsBefore());
for ( ; it != endIt; ++it)
- if (it->get() == pMark)
+ if (*it == pMark)
{
deleteMark(it);
break;
@@ -1058,16 +1052,9 @@ namespace sw { namespace mark
ClearFieldActivation();
m_vFieldmarks.clear();
m_vBookmarks.clear();
-
m_vAnnotationMarks.clear();
-
-#if OSL_DEBUG_LEVEL > 0
- for(iterator_t pBkmk = m_vAllMarks.begin();
- pBkmk != m_vAllMarks.end();
- ++pBkmk)
- OSL_ENSURE( pBkmk->use_count() == 1,
- "<MarkManager::clearAllMarks(..)> - a Bookmark is still in use.");
-#endif
+ for (auto & p : m_vAllMarks)
+ delete p;
m_vAllMarks.clear();
}
@@ -1124,9 +1111,10 @@ namespace sw { namespace mark
const_iterator_t pFieldmark = find_if(
m_vFieldmarks.begin(),
m_vFieldmarks.end(),
- [&rPos] (pMark_t const& rpMark) { return rpMark->IsCoveringPosition(rPos); } );
- if(pFieldmark == m_vFieldmarks.end()) return nullptr;
- return dynamic_cast<IFieldmark*>(pFieldmark->get());
+ [&rPos] (const ::sw::mark::IMark* pMark) { return pMark->IsCoveringPosition(rPos); } );
+ if(pFieldmark == m_vFieldmarks.end())
+ return nullptr;
+ return dynamic_cast<IFieldmark*>(*pFieldmark);
}
void MarkManager::deleteFieldmarkAt(const SwPosition& rPos)
@@ -1134,8 +1122,9 @@ namespace sw { namespace mark
const_iterator_t pFieldmark = find_if(
m_vFieldmarks.begin(),
m_vFieldmarks.end(),
- [&rPos] (pMark_t const& rpMark) { return rpMark->IsCoveringPosition(rPos); } );
- if(pFieldmark == m_vFieldmarks.end()) return;
+ [&rPos] (const ::sw::mark::IMark* pMark) { return pMark->IsCoveringPosition(rPos); } );
+ if(pFieldmark == m_vFieldmarks.end())
+ return;
deleteMark(lcl_FindMark(m_vAllMarks, *pFieldmark));
}
@@ -1233,12 +1222,12 @@ namespace sw { namespace mark
for (IDocumentMarkAccess::const_iterator_t aI = m_vFieldmarks.begin(),
aEnd = m_vFieldmarks.end(); aI != aEnd; ++aI)
{
- std::shared_ptr<IMark> xI = *aI;
- const SwPosition &rStart = xI->GetMarkPos();
+ ::sw::mark::IMark* pI = *aI;
+ const SwPosition &rStart = pI->GetMarkPos();
if (!rPaM.ContainsPosition(rStart))
continue;
- IFieldmark *pMark = dynamic_cast<IFieldmark*>(xI.get());
+ IFieldmark *pMark = dynamic_cast<IFieldmark*>(pI);
if (!pMark || pMark->GetFieldname() != ODF_FORMDROPDOWN)
continue;
@@ -1279,10 +1268,10 @@ namespace sw { namespace mark
const_iterator_t pAnnotationMark = find_if(
m_vAnnotationMarks.begin(),
m_vAnnotationMarks.end(),
- [&rPos] (pMark_t const& rpMark) { return rpMark->IsCoveringPosition(rPos); } );
+ [&rPos] (const ::sw::mark::IMark* pMark) { return pMark->IsCoveringPosition(rPos); } );
if (pAnnotationMark == m_vAnnotationMarks.end())
return nullptr;
- return pAnnotationMark->get();
+ return *pAnnotationMark;
}
// finds the first that is starting after
diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx
index 8aa35aa6f283..27a20a24bca0 100644
--- a/sw/source/core/fields/reffld.cxx
+++ b/sw/source/core/fields/reffld.cxx
@@ -1191,7 +1191,7 @@ SwTextNode* SwGetRefFieldType::FindAnchor( SwDoc* pDoc, const OUString& rRefMark
&& (!pLayout || !pLayout->IsHideRedlines()
|| !sw::IsMarkHidden(*pLayout, **ppMark)))
{
- const ::sw::mark::IMark* pBkmk = ppMark->get();
+ const ::sw::mark::IMark* pBkmk = *ppMark;
const SwPosition* pPos = &pBkmk->GetMarkStart();
pTextNd = pPos->nNode.GetNode().GetTextNode();
diff --git a/sw/source/core/inc/MarkManager.hxx b/sw/source/core/inc/MarkManager.hxx
index 2e794656cf6f..e901510e08b5 100644
--- a/sw/source/core/inc/MarkManager.hxx
+++ b/sw/source/core/inc/MarkManager.hxx
@@ -64,7 +64,7 @@ namespace sw {
virtual void deleteMarks(const SwNodeIndex& rStt, const SwNodeIndex& rEnd, std::vector< ::sw::mark::SaveBookmark>* pSaveBkmk, const SwIndex* pSttIdx, const SwIndex* pEndIdx) override;
// deleters
- virtual std::shared_ptr<ILazyDeleter>
+ virtual std::unique_ptr<ILazyDeleter>
deleteMark(const const_iterator_t& ppMark) override;
virtual void deleteMark(const ::sw::mark::IMark* const pMark) override;
virtual void clearAllMarks() override;
@@ -121,7 +121,7 @@ namespace sw {
private:
void sortSubsetMarks();
- // container for all marks
+ // container for all marks, this container owns the objects it points to
container_t m_vAllMarks;
// additional container for bookmarks
diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx
index 3db189edcce0..fa673eb0a278 100644
--- a/sw/source/core/text/EnhancedPDFExportHelper.cxx
+++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx
@@ -2089,7 +2089,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
++ppMark)
{
//get the name
- const ::sw::mark::IMark* pBkmk = ppMark->get();
+ const ::sw::mark::IMark* pBkmk = *ppMark;
mrSh.SwCursorShell::ClearMark();
const OUString& sBkName = pBkmk->GetName();
diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx
index 6f433b2056f5..e5a09ddfb47a 100644
--- a/sw/source/core/txtnode/atrfld.cxx
+++ b/sw/source/core/txtnode/atrfld.cxx
@@ -661,7 +661,7 @@ SwTextAnnotationField::~SwTextAnnotationField()
IDocumentMarkAccess* pMarksAccess = pDoc->getIDocumentMarkAccess();
IDocumentMarkAccess::const_iterator_t pMark = pMarksAccess->findAnnotationMark( pPostItField->GetName() );
return pMark != pMarksAccess->getAnnotationMarksEnd()
- ? pMark->get()
+ ? *pMark
: nullptr;
}
diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index 751d88ad4fb7..e20c705a0228 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -611,7 +611,7 @@ void SwHistoryBookmark::SetInDoc( SwDoc* pDoc, bool )
}
else
{
- pMark = pMarkAccess->findMark(m_aName)->get();
+ pMark = *pMarkAccess->findMark(m_aName);
pPam.reset(new SwPaM(pMark->GetMarkPos()));
}
@@ -632,7 +632,7 @@ void SwHistoryBookmark::SetInDoc( SwDoc* pDoc, bool )
else if(m_bHadOtherPos)
{
if(!pMark)
- pMark = pMarkAccess->findMark(m_aName)->get();
+ pMark = *pMarkAccess->findMark(m_aName);
OSL_ENSURE(pMark->IsExpanded(),
"<SwHistoryBookmark::SetInDoc(..)>"
" - missing pos on old mark");
diff --git a/sw/source/core/undo/unbkmk.cxx b/sw/source/core/undo/unbkmk.cxx
index c4d77b6e2f71..310113ff4ed7 100644
--- a/sw/source/core/undo/unbkmk.cxx
+++ b/sw/source/core/undo/unbkmk.cxx
@@ -134,7 +134,7 @@ void SwUndoRenameBookmark::Rename(::sw::UndoRedoContext const & rContext, const
IDocumentMarkAccess::const_iterator_t ppBkmk = pMarkAccess->findMark(sFrom);
if (ppBkmk != pMarkAccess->getAllMarksEnd())
{
- pMarkAccess->renameMark( ppBkmk->get(), sTo );
+ pMarkAccess->renameMark( *ppBkmk, sTo );
}
}
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index 1d9facd95822..ac36268b40d7 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -1070,7 +1070,7 @@ void SwUndoSaveContent::DelContentIndex( const SwPosition& rMark,
// #i81002#
bool bSavePos = false;
bool bSaveOtherPos = false;
- const ::sw::mark::IMark* pBkmk = (pMarkAccess->getAllMarksBegin() + n)->get();
+ const ::sw::mark::IMark* pBkmk = pMarkAccess->getAllMarksBegin()[n];
if( DelContentType::CheckNoCntnt & nDelContentType )
{
diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx
index 9e9db5ec8ebb..dcc16bd7aa30 100644
--- a/sw/source/core/unocore/unocoll.cxx
+++ b/sw/source/core/unocore/unocoll.cxx
@@ -1601,7 +1601,7 @@ uno::Any SwXBookmarks::getByIndex(sal_Int32 nIndex)
{
uno::Any aRet;
const uno::Reference< text::XTextContent > xRef =
- SwXBookmark::CreateXBookmark(*GetDoc(), ppMark->get());
+ SwXBookmark::CreateXBookmark(*GetDoc(), *ppMark);
aRet <<= xRef;
return aRet;
}
@@ -1624,7 +1624,7 @@ uno::Any SwXBookmarks::getByName(const OUString& rName)
uno::Any aRet;
const uno::Reference< text::XTextContent > xRef =
- SwXBookmark::CreateXBookmark(*GetDoc(), ppBkmk->get());
+ SwXBookmark::CreateXBookmark(*GetDoc(), *ppBkmk);
aRet <<= xRef;
return aRet;
}
diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx
index efb4ff9accab..7b6cd62b4801 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -2118,9 +2118,9 @@ SwXTextField::getAnchor()
IDocumentMarkAccess* pMarkAccess = m_pImpl->m_pDoc->getIDocumentMarkAccess();
for (IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getAnnotationMarksBegin(); ppMark != pMarkAccess->getAnnotationMarksEnd(); ++ppMark)
{
- if (ppMark->get()->GetName() == pPostItField->GetName())
+ if ((*ppMark)->GetName() == pPostItField->GetName())
{
- pPamForTextField.reset(new SwPaM(ppMark->get()->GetMarkStart(), ppMark->get()->GetMarkEnd()));
+ pPamForTextField.reset(new SwPaM((*ppMark)->GetMarkStart(), (*ppMark)->GetMarkEnd()));
break;
}
}
diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx
index bba492871701..30cf25ade0bd 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -194,7 +194,7 @@ namespace
ppMark != pCandidatesEnd;
++ppMark)
{
- ::sw::mark::IMark* const pBkmk = ppMark->get();
+ ::sw::mark::IMark* const pBkmk = *ppMark;
lcl_FillBookmark(pBkmk, nOwnNode, rDoc, rBkmArr);
}
}
@@ -277,7 +277,7 @@ namespace
++ppMark )
{
::sw::mark::AnnotationMark* const pAnnotationMark =
- dynamic_cast< ::sw::mark::AnnotationMark* >(ppMark->get());
+ dynamic_cast< ::sw::mark::AnnotationMark* >(*ppMark);
if (!pAnnotationMark)
continue;
diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx
index b0c6fd24e66f..92f0e37c1228 100644
--- a/sw/source/filter/html/htmlgrin.cxx
+++ b/sw/source/filter/html/htmlgrin.cxx
@@ -1380,7 +1380,7 @@ bool SwHTMLParser::HasCurrentParaBookmarks( bool bIgnoreStack ) const
ppMark != pMarkAccess->getAllMarksEnd();
++ppMark)
{
- const ::sw::mark::IMark* pBookmark = ppMark->get();
+ const ::sw::mark::IMark* pBookmark = *ppMark;
const sal_uLong nBookNdIdx = pBookmark->GetMarkPos().nNode.GetIndex();
if( nBookNdIdx==nNodeIdx )
@@ -1445,7 +1445,7 @@ void SwHTMLParser::StripTrailingPara()
ppMark != pMarkAccess->getAllMarksEnd();
++ppMark)
{
- ::sw::mark::IMark* pMark = ppMark->get();
+ ::sw::mark::IMark* pMark = *ppMark;
sal_uLong nBookNdIdx = pMark->GetMarkPos().nNode.GetIndex();
if(nBookNdIdx==nNodeIdx)
@@ -1463,7 +1463,7 @@ void SwHTMLParser::StripTrailingPara()
SwPosition aNewPos(*pNd);
aNewPos.nContent.Assign(pNd, pNd->Len());
const SwPaM aPaM(aNewPos);
- pMarkAccess->repositionMark(ppMark->get(), aPaM);
+ pMarkAccess->repositionMark(*ppMark, aPaM);
}
}
else if( nBookNdIdx > nNodeIdx )
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index b0e9c2ce64a9..a55206287bbb 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -2857,7 +2857,7 @@ void SwHTMLParser::SetAttr_( bool bChkEnd, bool bBeforeTable,
IDocumentMarkAccess* const pMarkAccess = m_xDoc->getIDocumentMarkAccess();
IDocumentMarkAccess::const_iterator_t ppBkmk = pMarkAccess->findMark( sName );
if( ppBkmk != pMarkAccess->getAllMarksEnd() &&
- ppBkmk->get()->GetMarkStart() == *pAttrPam->GetPoint() )
+ (*ppBkmk)->GetMarkStart() == *pAttrPam->GetPoint() )
break; // do not generate duplicates on this position
pAttrPam->DeleteMark();
const ::sw::mark::IMark* const pNewMark = pMarkAccess->makeMark(
diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx
index 21acd5f6a2e4..51b7317f64e3 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -1119,7 +1119,7 @@ void SwHTMLWriter::OutBookmarks()
const ::sw::mark::IMark* pBookmark = nullptr;
IDocumentMarkAccess* const pMarkAccess = m_pDoc->getIDocumentMarkAccess();
if(m_nBkmkTabPos != -1)
- pBookmark = (pMarkAccess->getAllMarksBegin() + m_nBkmkTabPos)->get();
+ pBookmark = pMarkAccess->getAllMarksBegin()[m_nBkmkTabPos];
// Output all bookmarks in this paragraph. The content position
// for the moment isn't considered!
sal_uInt32 nNode = m_pCurrentPam->GetPoint()->nNode.GetIndex();
@@ -1137,7 +1137,7 @@ void SwHTMLWriter::OutBookmarks()
if( ++m_nBkmkTabPos >= pMarkAccess->getAllMarksCount() )
m_nBkmkTabPos = -1;
else
- pBookmark = (pMarkAccess->getAllMarksBegin() + m_nBkmkTabPos)->get();
+ pBookmark = pMarkAccess->getAllMarksBegin()[m_nBkmkTabPos];
}
decltype(m_aOutlineMarkPoss)::size_type nPos;
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index d10e54aa2993..dc7e4e18c6e8 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -1862,7 +1862,7 @@ bool MSWordExportBase::GetBookmarks( const SwTextNode& rNd, sal_Int32 nStt,
const sal_Int32 nMarks = pMarkAccess->getAllMarksCount();
for ( sal_Int32 i = 0; i < nMarks; i++ )
{
- IMark* pMark = ( pMarkAccess->getAllMarksBegin() + i )->get();
+ IMark* pMark = pMarkAccess->getAllMarksBegin()[i];
if ( IDocumentMarkAccess::GetType( *pMark ) == IDocumentMarkAccess::MarkType::ANNOTATIONMARK )
{
@@ -1898,7 +1898,7 @@ bool MSWordExportBase::GetAnnotationMarks( const SwTextNode& rNd, sal_Int32 nStt
const sal_Int32 nMarks = pMarkAccess->getAnnotationMarksCount();
for ( sal_Int32 i = 0; i < nMarks; i++ )
{
- IMark* pMark = ( pMarkAccess->getAnnotationMarksBegin() + i )->get();
+ IMark* pMark = pMarkAccess->getAnnotationMarksBegin()[i];
// Only keep the bookmarks starting or ending in this node
if ( pMark->GetMarkStart().nNode == nNd ||
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 67b25521ff43..aa596ad3ee2d 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1591,7 +1591,7 @@ void SwWW8FltRefStack::SetAttrInDoc(const SwPosition& rTmpPos,
sal_uInt16 nBkmNo;
if( IsFootnoteEdnBkmField(rFormatField, nBkmNo) )
{
- ::sw::mark::IMark const * const pMark = (pDoc->getIDocumentMarkAccess()->getAllMarksBegin() + nBkmNo)->get();
+ ::sw::mark::IMark const * const pMark = pDoc->getIDocumentMarkAccess()->getAllMarksBegin()[nBkmNo];
const SwPosition& rBkMrkPos = pMark->GetMarkPos();
@@ -5348,9 +5348,9 @@ ErrCode SwWW8ImplReader::CoreLoad(WW8Glossary const *pGloss)
{
IDocumentMarkAccess::const_iterator_t ppBkmk = pMarkAccess->findBookmark( "_PictureBullets" );
if ( ppBkmk != pMarkAccess->getBookmarksEnd() &&
- IDocumentMarkAccess::GetType( *(ppBkmk->get()) ) == IDocumentMarkAccess::MarkType::BOOKMARK )
+ IDocumentMarkAccess::GetType(**ppBkmk) == IDocumentMarkAccess::MarkType::BOOKMARK )
{
- SwTextNode* pTextNode = ppBkmk->get()->GetMarkStart().nNode.GetNode().GetTextNode();
+ SwTextNode* pTextNode = (*ppBkmk)->GetMarkStart().nNode.GetNode().GetTextNode();
if ( pTextNode )
{
@@ -5361,7 +5361,7 @@ ErrCode SwWW8ImplReader::CoreLoad(WW8Glossary const *pGloss)
const sal_Int32 st = pHt->GetStart();
if( pHt
&& pHt->Which() == RES_TXTATR_FLYCNT
- && (st >= ppBkmk->get()->GetMarkStart().nContent.GetIndex()) )
+ && (st >= (*ppBkmk)->GetMarkStart().nContent.GetIndex()) )
{
SwFrameFormat* pFrameFormat = pHt->GetFlyCnt().GetFrameFormat();
vecFrameFormat.push_back(pFrameFormat);
diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx
index 6017ee04ee21..b3c9a6ccb837 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -135,7 +135,7 @@ static void lcl_FillSubRegionList( SwWrtShell& rSh, weld::ComboBox& rSubRegions,
ppMark != pMarkAccess->getBookmarksEnd();
++ppMark)
{
- const ::sw::mark::IMark* pBkmk = ppMark->get();
+ const ::sw::mark::IMark* pBkmk = *ppMark;
if( pBkmk->IsExpanded() )
rSubRegions.append_text( pBkmk->GetName() );
}
diff --git a/sw/source/ui/fldui/fldref.cxx b/sw/source/ui/fldui/fldref.cxx
index 78ce06e5c878..d034a61337da 100644
--- a/sw/source/ui/fldui/fldref.cxx
+++ b/sw/source/ui/fldui/fldref.cxx
@@ -502,7 +502,7 @@ void SwFieldRefPage::UpdateSubType(const OUString& filterString)
ppMark != pMarkAccess->getBookmarksEnd();
++ppMark)
{
- const ::sw::mark::IMark* pBkmk = ppMark->get();
+ const ::sw::mark::IMark* pBkmk = *ppMark;
if(IDocumentMarkAccess::MarkType::BOOKMARK == IDocumentMarkAccess::GetType(*pBkmk))
{
bool isSubstring = MatchSubstring(pBkmk->GetName(), filterString);
diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx
index b7de3dc377da..260bb6e6bc49 100644
--- a/sw/source/ui/misc/bookmark.cxx
+++ b/sw/source/ui/misc/bookmark.cxx
@@ -264,8 +264,8 @@ bool SwInsertBookmarkDlg::HaveBookmarksChanged()
// more bookmarks then expected
if (aListIter == aTableBookmarks.end())
return true;
- if (aListIter->first != ppBookmark->get() ||
- aListIter->second != ppBookmark->get()->GetName())
+ if (aListIter->first != *ppBookmark ||
+ aListIter->second != (*ppBookmark)->GetName())
return true;
++aListIter;
}
@@ -285,8 +285,8 @@ void SwInsertBookmarkDlg::PopulateTable()
{
if (IDocumentMarkAccess::MarkType::BOOKMARK == IDocumentMarkAccess::GetType(**ppBookmark))
{
- m_xBookmarksBox->InsertBookmark(ppBookmark->get());
- aTableBookmarks.emplace_back(ppBookmark->get(), ppBookmark->get()->GetName());
+ m_xBookmarksBox->InsertBookmark(*ppBookmark);
+ aTableBookmarks.emplace_back(*ppBookmark, (*ppBookmark)->GetName());
}
}
m_nLastBookmarksCount = pMarkAccess->getBookmarksCount();
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx
index 5641758d1bfb..9e4852af8551 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -915,7 +915,7 @@ int SwTransferable::PrepareForCopy( bool bIsCut )
++ppMark)
{
if(IDocumentMarkAccess::MarkType::DDE_BOOKMARK == IDocumentMarkAccess::GetType(**ppMark))
- vDdeMarks.push_back(ppMark->get());
+ vDdeMarks.push_back(*ppMark);
}
// remove all DDE-Bookmarks, they are invalid inside the clipdoc!
for(const auto& rpMark : vDdeMarks)
@@ -3982,7 +3982,7 @@ bool SwTrnsfrDdeLink::WriteData( SvStream& rStrm )
{
// the mark is still a DdeBookmark
// we replace it with a Bookmark, so it will get saved etc.
- ::sw::mark::IMark* const pMark = ppMark->get();
+ ::sw::mark::IMark* const pMark = *ppMark;
::sfx2::SvLinkSource* p = refObj.get();
SwServerObject& rServerObject = dynamic_cast<SwServerObject&>(*p);
diff --git a/sw/source/uibase/docvw/edtwin2.cxx b/sw/source/uibase/docvw/edtwin2.cxx
index f17b255a4b39..044154da39b2 100644
--- a/sw/source/uibase/docvw/edtwin2.cxx
+++ b/sw/source/uibase/docvw/edtwin2.cxx
@@ -194,10 +194,10 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
IDocumentMarkAccess::const_iterator_t ppBkmk =
pMarkAccess->findBookmark( sTmpSearchStr );
if ( ppBkmk != pMarkAccess->getBookmarksEnd() &&
- IDocumentMarkAccess::GetType( *(ppBkmk->get()) )
+ IDocumentMarkAccess::GetType(**ppBkmk)
== IDocumentMarkAccess::MarkType::CROSSREF_HEADING_BOOKMARK )
{
- SwTextNode* pTextNode = ppBkmk->get()->GetMarkStart().nNode.GetNode().GetTextNode();
+ SwTextNode* pTextNode = (*ppBkmk)->GetMarkStart().nNode.GetNode().GetTextNode();
if ( pTextNode )
{
sText = sw::GetExpandTextMerged(rSh.GetLayout(), *pTextNode, true, false, ExpandMode(0));
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index 7590d5e8b857..1fcb92016045 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -1660,7 +1660,7 @@ void SwView::ExecuteStatusLine(SfxRequest &rReq)
{
const IDocumentMarkAccess::const_iterator_t ppBookmark = rSh.getIDocumentMarkAccess()->getBookmarksBegin() + nIdx;
rSh.EnterStdMode();
- rSh.GotoMark( ppBookmark->get() );
+ rSh.GotoMark( *ppBookmark );
}
else
OSL_FAIL("SwView::ExecuteStatusLine(..)"
@@ -2001,7 +2001,7 @@ bool SwView::JumpToSwMark( const OUString& rMark )
}
else if( pMarkAccess->getAllMarksEnd() != (ppMark = pMarkAccess->findMark(sMark)) )
{
- bRet = m_pWrtShell->GotoMark( ppMark->get(), false );
+ bRet = m_pWrtShell->GotoMark( *ppMark, false );
}
else if( nullptr != ( pINet = m_pWrtShell->FindINetAttr( sMark ) )) {
m_pWrtShell->addCurrentPosition();
@@ -2027,7 +2027,7 @@ bool SwView::JumpToSwMark( const OUString& rMark )
}
else if( pMarkAccess->getAllMarksEnd() != (ppMark = pMarkAccess->findMark(sMark)))
{
- bRet = m_pWrtShell->GotoMark( ppMark->get(), false );
+ bRet = m_pWrtShell->GotoMark( *ppMark, false );
}
else if( nullptr != ( pINet = m_pWrtShell->FindINetAttr( sMark ) ))
bRet = m_pWrtShell->GotoINetAttr( *pINet->GetTextINetFormat() );
diff --git a/sw/source/uibase/uiview/viewmdi.cxx b/sw/source/uibase/uiview/viewmdi.cxx
index be347f901c84..d6178fcad40c 100644
--- a/sw/source/uibase/uiview/viewmdi.cxx
+++ b/sw/source/uibase/uiview/viewmdi.cxx
@@ -477,7 +477,7 @@ IMPL_LINK( SwView, MoveNavigationHdl, void*, p, void )
++ppMark)
{
if( IDocumentMarkAccess::GetType(**ppMark) == IDocumentMarkAccess::MarkType::NAVIGATOR_REMINDER )
- vNavMarks.push_back(ppMark->get());
+ vNavMarks.push_back(*ppMark);
}
// move
diff --git a/sw/source/uibase/utlui/bookctrl.cxx b/sw/source/uibase/utlui/bookctrl.cxx
index 72f7316fd899..c432e3c6b003 100644
--- a/sw/source/uibase/utlui/bookctrl.cxx
+++ b/sw/source/uibase/utlui/bookctrl.cxx
@@ -118,7 +118,7 @@ void SwBookmarkControl::Command( const CommandEvent& rCEvt )
{
if(IDocumentMarkAccess::MarkType::BOOKMARK == IDocumentMarkAccess::GetType(**ppBookmark))
{
- aPop->InsertItem( nPopupId, ppBookmark->get()->GetName() );
+ aPop->InsertItem( nPopupId, (*ppBookmark)->GetName() );
aBookmarkIdx[nPopupId] = static_cast<sal_uInt16>(ppBookmark - ppBookmarkStart);
nPopupId++;
}
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index 810690100c61..1549f6e60ff1 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -141,9 +141,9 @@ namespace
return bFound;
}
- bool lcl_IsUiVisibleBookmark(const IDocumentMarkAccess::pMark_t& rpMark)
+ bool lcl_IsUiVisibleBookmark(const ::sw::mark::IMark* pMark)
{
- return IDocumentMarkAccess::GetType(*rpMark) == IDocumentMarkAccess::MarkType::BOOKMARK;
+ return IDocumentMarkAccess::GetType(*pMark) == IDocumentMarkAccess::MarkType::BOOKMARK;
}
size_t lcl_InsertURLFieldContent(
@@ -649,7 +649,7 @@ void SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged)
{
if(lcl_IsUiVisibleBookmark(*ppBookmark))
{
- const OUString& rBkmName = ppBookmark->get()->GetName();
+ const OUString& rBkmName = (*ppBookmark)->GetName();
//nYPos from 0 -> text::Bookmarks will be sorted alphabetically
std::unique_ptr<SwContent> pCnt(new SwContent(this, rBkmName, 0));
m_pMember->insert(std::move(pCnt));
diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx
index 7aac5d6094c4..e946ab09e5b6 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -507,7 +507,7 @@ void SwNavigationPI::MakeMark()
ppMark != pMarkAccess->getAllMarksEnd();
++ppMark)
if( IDocumentMarkAccess::GetType(**ppMark) == IDocumentMarkAccess::MarkType::NAVIGATOR_REMINDER )
- vNavMarkNames.push_back(ppMark->get()->GetName());
+ vNavMarkNames.push_back((*ppMark)->GetName());
std::sort(vNavMarkNames.begin(), vNavMarkNames.end());
// we are maxed out and delete one
diff --git a/sw/source/uibase/wrtsh/wrtsh3.cxx b/sw/source/uibase/wrtsh/wrtsh3.cxx
index 4f2e8a249413..7d58670cffe1 100644
--- a/sw/source/uibase/wrtsh/wrtsh3.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh3.cxx
@@ -132,7 +132,7 @@ void SwWrtShell::GotoMark( const OUString& rName )
IDocumentMarkAccess::const_iterator_t ppMark = getIDocumentMarkAccess()->findMark( rName );
if (ppMark == getIDocumentMarkAccess()->getAllMarksEnd())
return;
- MoveBookMark( BOOKMARK_INDEX, ppMark->get() );
+ MoveBookMark( BOOKMARK_INDEX, *ppMark );
}
void SwWrtShell::GotoMark( const ::sw::mark::IMark* const pMark )
@@ -151,7 +151,7 @@ bool SwWrtShell::GoNextBookmark()
bool bRet = MoveBookMark( BOOKMARK_NEXT );
if ( !bRet )
{
- MoveBookMark( BOOKMARK_INDEX, getIDocumentMarkAccess()->getBookmarksBegin()->get() );
+ MoveBookMark( BOOKMARK_INDEX, *getIDocumentMarkAccess()->getBookmarksBegin() );
SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::EndWrapped );
}
else
@@ -172,7 +172,7 @@ bool SwWrtShell::GoPrevBookmark()
bool bRet = MoveBookMark( BOOKMARK_PREV );
if ( !bRet )
{
- MoveBookMark( BOOKMARK_INDEX, ( getIDocumentMarkAccess()->getBookmarksEnd() - 1 )->get() );
+ MoveBookMark( BOOKMARK_INDEX, *( getIDocumentMarkAccess()->getBookmarksEnd() - 1 ) );
SvxSearchDialogWrapper::SetSearchLabel( SearchLabel::StartWrapped );
}
else
More information about the Libreoffice-commits
mailing list