sw/inc/IDocumentMarkAccess.hxx | 5 --- sw/source/core/doc/docbm.cxx | 54 ------------------------------------- sw/source/core/doc/docdde.cxx | 4 +- sw/source/core/inc/MarkManager.hxx | 5 --- sw/source/filter/ww8/wrtw8nds.cxx | 9 ++++-- 5 files changed, 10 insertions(+), 67 deletions(-)
New commits: commit 9c3dec47a12d37dd9b6fa71dca1f41def975759b Author: Oliver-Rainer Wittmann <o...@apache.org> Date: Tue Jul 8 11:45:46 2014 +0000 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 diff --git a/sw/inc/IDocumentMarkAccess.hxx b/sw/inc/IDocumentMarkAccess.hxx index fe5b608..c565a91 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 39abcd6..1f190d7 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 f321b05..7d88441 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 37616ec..1414458 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 68e2799..384a004 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 || _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits