diff options
author | Oliver-Rainer Wittmann <orw@apache.org> | 2014-07-08 11:45:46 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-07-09 15:11:02 +0100 |
commit | 9c3dec47a12d37dd9b6fa71dca1f41def975759b (patch) | |
tree | 37c4c5c720ad49b0efc1a24895a03a06bd902df3 | |
parent | 0aa3dee5e88a1494a7a6a8401e084cbdb4324727 (diff) |
Related: #i125215# MarkManager: remove unnecessary mark container
(cherry picked from commit f73412f09ca8a34bb7ec73370dae3e6033c0c581)
Conflicts:
sw/inc/IDocumentMarkAccess.hxx
sw/source/core/doc/docbm.cxx
sw/source/core/doc/docdde.cxx
sw/source/core/inc/MarkManager.hxx
Change-Id: I8aa3a0a3362de63fec9cd640ffde89d5f7f57417
-rw-r--r-- | sw/inc/IDocumentMarkAccess.hxx | 5 | ||||
-rw-r--r-- | sw/source/core/doc/docbm.cxx | 54 | ||||
-rw-r--r-- | sw/source/core/doc/docdde.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/inc/MarkManager.hxx | 5 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8nds.cxx | 9 |
5 files changed, 10 insertions, 67 deletions
diff --git a/sw/inc/IDocumentMarkAccess.hxx b/sw/inc/IDocumentMarkAccess.hxx index fe5b608ff3ad..c565a91c18ba 100644 --- a/sw/inc/IDocumentMarkAccess.hxx +++ b/sw/inc/IDocumentMarkAccess.hxx @@ -252,11 +252,6 @@ class IDocumentMarkAccess virtual ::sw::mark::IFieldmark* getDropDownFor(const SwPosition& pos) const=0; virtual std::vector< ::sw::mark::IFieldmark* > getDropDownsFor(const SwPaM &rPaM) const=0; - // Marks exclusive annotation marks - virtual const_iterator_t getCommonMarksBegin() const = 0; - virtual const_iterator_t getCommonMarksEnd() const = 0; - virtual sal_Int32 getCommonMarksCount() const = 0; - // Annotation Marks virtual const_iterator_t getAnnotationMarksBegin() const = 0; virtual const_iterator_t getAnnotationMarksEnd() const = 0; diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index 39abcd68a995..1f190d79f46e 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -347,7 +347,6 @@ namespace sw { namespace mark , m_vBookmarks() , m_vFieldmarks() , m_vAnnotationMarks() - , m_vCommonMarks() , m_pDoc(&rDoc) { } @@ -436,12 +435,10 @@ namespace sw { namespace mark case IDocumentMarkAccess::BOOKMARK: case IDocumentMarkAccess::CROSSREF_NUMITEM_BOOKMARK: case IDocumentMarkAccess::CROSSREF_HEADING_BOOKMARK: - lcl_InsertMarkSorted(m_vCommonMarks, pMark); lcl_InsertMarkSorted(m_vBookmarks, pMark); break; case IDocumentMarkAccess::TEXT_FIELDMARK: case IDocumentMarkAccess::CHECKBOX_FIELDMARK: - lcl_InsertMarkSorted(m_vCommonMarks, pMark); lcl_InsertMarkSorted(m_vFieldmarks, pMark); break; case IDocumentMarkAccess::ANNOTATIONMARK: @@ -450,7 +447,6 @@ namespace sw { namespace mark case IDocumentMarkAccess::NAVIGATOR_REMINDER: case IDocumentMarkAccess::DDE_BOOKMARK: case IDocumentMarkAccess::UNO_BOOKMARK: - lcl_InsertMarkSorted(m_vCommonMarks, pMark); // no special array for these break; } @@ -858,16 +854,6 @@ namespace sw { namespace mark { OSL_ENSURE( false, "<MarkManager::deleteMark(..)> - Bookmark not found in Bookmark container."); } - - ppBookmark = lcl_FindMark(m_vCommonMarks, *ppMark); - if ( ppBookmark != m_vCommonMarks.end() ) - { - m_vCommonMarks.erase(ppBookmark); - } - else - { - OSL_ENSURE( false, "<MarkManager::deleteMark(..)> - Bookmark not found in common mark container."); - } } break; @@ -884,16 +870,6 @@ namespace sw { namespace mark { OSL_ENSURE( false, "<MarkManager::deleteMark(..)> - Fieldmark not found in Fieldmark container."); } - - ppFieldmark = lcl_FindMark(m_vCommonMarks, *ppMark); - if ( ppFieldmark != m_vCommonMarks.end() ) - { - m_vCommonMarks.erase(ppFieldmark); - } - else - { - OSL_ENSURE( false, "<MarkManager::deleteMark(..)> - Fieldmark not found in common mark container."); - } } break; @@ -914,17 +890,7 @@ namespace sw { namespace mark case IDocumentMarkAccess::NAVIGATOR_REMINDER: case IDocumentMarkAccess::DDE_BOOKMARK: case IDocumentMarkAccess::UNO_BOOKMARK: - { - IDocumentMarkAccess::iterator_t ppOtherMark = lcl_FindMark(m_vCommonMarks, *ppMark); - 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."); - } - } + // no special marks container break; } DdeBookmark* const pDdeBookmark = dynamic_cast<DdeBookmark*>(ppMark->get()); @@ -981,8 +947,6 @@ namespace sw { namespace mark m_vBookmarks.clear(); m_aMarkNamesSet.clear(); - m_vCommonMarks.clear(); - m_vAnnotationMarks.clear(); #if OSL_DEBUG_LEVEL > 0 @@ -1069,21 +1033,6 @@ namespace sw { namespace mark IFieldmark* MarkManager::getFieldmarkBefore(const SwPosition& rPos) const { return dynamic_cast<IFieldmark*>(lcl_getMarkBefore(m_vFieldmarks, rPos)); } - IDocumentMarkAccess::const_iterator_t MarkManager::getCommonMarksBegin() const - { - return m_vCommonMarks.begin(); - } - - IDocumentMarkAccess::const_iterator_t MarkManager::getCommonMarksEnd() const - { - return m_vCommonMarks.end(); - } - - sal_Int32 MarkManager::getCommonMarksCount() const - { - return m_vCommonMarks.size(); - } - IDocumentMarkAccess::const_iterator_t MarkManager::getAnnotationMarksBegin() const { return m_vAnnotationMarks.begin(); @@ -1143,7 +1092,6 @@ namespace sw { namespace mark void MarkManager::sortSubsetMarks() { - sort(m_vCommonMarks.begin(), m_vCommonMarks.end(), &lcl_MarkOrderingByStart); sort(m_vBookmarks.begin(), m_vBookmarks.end(), &lcl_MarkOrderingByStart); sort(m_vFieldmarks.begin(), m_vFieldmarks.end(), &lcl_MarkOrderingByStart); sort(m_vAnnotationMarks.begin(), m_vAnnotationMarks.end(), &lcl_MarkOrderingByStart); diff --git a/sw/source/core/doc/docdde.cxx b/sw/source/core/doc/docdde.cxx index f321b0587fdd..7d884413bb91 100644 --- a/sw/source/core/doc/docdde.cxx +++ b/sw/source/core/doc/docdde.cxx @@ -50,8 +50,8 @@ namespace { //Iterating over all bookmarks, checking DdeBookmarks const OUString sNameLc = bCaseSensitive ? rName : GetAppCharClass().lowercase(rName); - for(IDocumentMarkAccess::const_iterator_t ppMark = rMarkAccess.getCommonMarksBegin(); - ppMark != rMarkAccess.getCommonMarksEnd(); + for(IDocumentMarkAccess::const_iterator_t ppMark = rMarkAccess.getAllMarksBegin(); + ppMark != rMarkAccess.getAllMarksEnd(); ++ppMark) { if ( IDocumentMarkAccess::GetType( *(ppMark->get()) ) == IDocumentMarkAccess::DDE_BOOKMARK) diff --git a/sw/source/core/inc/MarkManager.hxx b/sw/source/core/inc/MarkManager.hxx index 37616ec0a2fc..1414458252f5 100644 --- a/sw/source/core/inc/MarkManager.hxx +++ b/sw/source/core/inc/MarkManager.hxx @@ -87,11 +87,6 @@ namespace sw { void dumpAsXml(xmlTextWriterPtr w); - // Marks exclusive annotation marks - virtual const_iterator_t getCommonMarksBegin() const SAL_OVERRIDE; - virtual const_iterator_t getCommonMarksEnd() const SAL_OVERRIDE; - virtual sal_Int32 getCommonMarksCount() const SAL_OVERRIDE; - // Annotation Marks virtual const_iterator_t getAnnotationMarksBegin() const SAL_OVERRIDE; virtual const_iterator_t getAnnotationMarksEnd() const SAL_OVERRIDE; diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 68e2799dc2a9..384a004a61f3 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -1754,10 +1754,15 @@ bool MSWordExportBase::GetBookmarks( const SwTxtNode& rNd, sal_Int32 nStt, IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess(); sal_uLong nNd = rNd.GetIndex( ); - const sal_Int32 nMarks = pMarkAccess->getCommonMarksCount(); + const sal_Int32 nMarks = pMarkAccess->getAllMarksCount(); for ( sal_Int32 i = 0; i < nMarks; i++ ) { - IMark* pMark = ( pMarkAccess->getCommonMarksBegin() + i )->get(); + IMark* pMark = ( pMarkAccess->getAllMarksBegin() + i )->get(); + + if ( IDocumentMarkAccess::GetType( *(pMark) ) == IDocumentMarkAccess::ANNOTATIONMARK ) + { + continue; + } // Only keep the bookmarks starting or ending in this node if ( pMark->GetMarkStart().nNode == nNd || |