[Libreoffice-commits] core.git: Branch 'aoo/trunk' - 2 commits - sw/inc sw/source writerfilter/source
Oliver-Rainer Wittmann
orw at apache.org
Tue Jul 8 05:08:00 PDT 2014
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 ++-
writerfilter/source/dmapper/DomainMapper.cxx | 5 +-
writerfilter/source/dmapper/DomainMapper_Impl.cxx | 8 ++-
writerfilter/source/dmapper/DomainMapper_Impl.hxx | 6 +-
8 files changed, 23 insertions(+), 73 deletions(-)
New commits:
commit f73412f09ca8a34bb7ec73370dae3e6033c0c581
Author: Oliver-Rainer Wittmann <orw at apache.org>
Date: Tue Jul 8 11:45:46 2014 +0000
125215: MarkManager: remove unnecessary mark container
diff --git a/sw/inc/IDocumentMarkAccess.hxx b/sw/inc/IDocumentMarkAccess.hxx
index 0057999..a16a861 100644
--- a/sw/inc/IDocumentMarkAccess.hxx
+++ b/sw/inc/IDocumentMarkAccess.hxx
@@ -250,11 +250,6 @@ class IDocumentMarkAccess
virtual ::sw::mark::IFieldmark* getFieldmarkBefore(const SwPosition& pos) const =0;
virtual ::sw::mark::IFieldmark* getFieldmarkAfter(const SwPosition& pos) 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 792e2c5..4626111 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -358,7 +358,6 @@ namespace sw { namespace mark
, m_vBookmarks()
, m_vFieldmarks()
, m_vAnnotationMarks()
- , m_vCommonMarks()
, m_pDoc(&rDoc)
{ }
@@ -444,13 +443,11 @@ namespace sw { namespace mark
case IDocumentMarkAccess::BOOKMARK:
case IDocumentMarkAccess::CROSSREF_NUMITEM_BOOKMARK:
case IDocumentMarkAccess::CROSSREF_HEADING_BOOKMARK:
- lcl_InsertMarkSorted(m_vCommonMarks, pMark);
// if(dynamic_cast<IBookmark*>)
lcl_InsertMarkSorted(m_vBookmarks, pMark);
break;
case IDocumentMarkAccess::TEXT_FIELDMARK:
case IDocumentMarkAccess::CHECKBOX_FIELDMARK:
- lcl_InsertMarkSorted(m_vCommonMarks, pMark);
// if(dynamic_cast<IFieldmark*>
lcl_InsertMarkSorted(m_vFieldmarks, pMark);
break;
@@ -460,7 +457,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;
}
@@ -830,16 +826,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;
@@ -862,15 +848,6 @@ namespace sw { namespace mark
pTextFieldmark->ReleaseDoc(m_pDoc);
}
- 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;
@@ -891,17 +868,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());
@@ -947,8 +914,6 @@ namespace sw { namespace mark
m_vFieldmarks.clear();
m_vBookmarks.clear();
- m_vCommonMarks.clear();
-
m_vAnnotationMarks.clear();
#ifdef DEBUG
@@ -1006,22 +971,6 @@ namespace sw { namespace mark
{ 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();
@@ -1072,7 +1021,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 27f4694..85b81cb 100644
--- a/sw/source/core/doc/docdde.cxx
+++ b/sw/source/core/doc/docdde.cxx
@@ -62,8 +62,8 @@ namespace
{
//Iterating over all bookmarks, checking DdeBookmarks
const ::rtl::OUString sNameLc = bCaseSensitive ? rName : GetAppCharClass().lower(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 086ab32..7455b51 100644
--- a/sw/source/core/inc/MarkManager.hxx
+++ b/sw/source/core/inc/MarkManager.hxx
@@ -84,11 +84,6 @@ namespace sw { namespace mark
virtual ::sw::mark::IFieldmark* getFieldmarkBefore(const SwPosition& rPos) const;
virtual ::sw::mark::IFieldmark* getFieldmarkAfter(const SwPosition& rPos) const;
- // Marks exclusive annotation marks
- virtual const_iterator_t getCommonMarksBegin() const;
- virtual const_iterator_t getCommonMarksEnd() const;
- virtual sal_Int32 getCommonMarksCount() const;
-
// Annotation Marks
virtual const_iterator_t getAnnotationMarksBegin() const;
virtual const_iterator_t getAnnotationMarksEnd() const;
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index bb8340c..c417cac 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -1678,10 +1678,15 @@ bool MSWordExportBase::GetBookmarks(
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 ||
commit f27e75828f65ce454a50f92ba64ee6847456f88f
Author: Oliver-Rainer Wittmann <orw at apache.org>
Date: Tue Jul 8 11:36:35 2014 +0000
125215: *.docx import: Bookmark ID has to be treated as an Integer
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 4a06a1e..e8a9dd2 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -1413,18 +1413,21 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
case NS_rtf::LN_endnote:
/* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
break;
+
case NS_rtf::LN_BOOKMARKNAME:
/* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
// sStringValue contains the bookmark name
sLocalBookmarkName = sStringValue;
break;
+
case NS_rtf::LN_IBKL:
/* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0.5 */
//contains the bookmark identifier - has to be added to the bookmark name imported before
//if it is already available then the bookmark should be inserted
- m_pImpl->AddBookmark( sLocalBookmarkName, sStringValue );
+ m_pImpl->AddBookmark( sLocalBookmarkName, nIntValue );
sLocalBookmarkName = ::rtl::OUString();
break;
+
case NS_rtf::LN_LISTLEVEL:
/* WRITERFILTERSTATUS: done: 0, planned: 0.5, spent: 0 */
break;
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 7089bdf..dba364a 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -3541,10 +3541,12 @@ void DomainMapper_Impl::PopFieldContext()
/*-- 11.06.2007 16:19:00---------------------------------------------------
-----------------------------------------------------------------------*/
-void DomainMapper_Impl::AddBookmark( const ::rtl::OUString& rBookmarkName, const ::rtl::OUString& rId )
+void DomainMapper_Impl::AddBookmark(
+ const ::rtl::OUString& rBookmarkName,
+ const sal_Int32 nId )
{
uno::Reference< text::XTextAppend > xTextAppend = m_aTextAppendStack.top().xTextAppend;
- BookmarkMap_t::iterator aBookmarkIter = m_aBookmarkMap.find( rId );
+ BookmarkMap_t::iterator aBookmarkIter = m_aBookmarkMap.find( nId );
//is the bookmark name already registered?
try
{
@@ -3575,7 +3577,7 @@ void DomainMapper_Impl::AddBookmark( const ::rtl::OUString& rBookmarkName, const
uno::Reference< text::XTextCursor > xCursor = xTextAppend->createTextCursorByRange( xTextAppend->getEnd() );
bool bIsStart = !xCursor->goLeft(1, false);
uno::Reference< text::XTextRange > xCurrent = xCursor->getStart();
- m_aBookmarkMap.insert(BookmarkMap_t::value_type( rId, BookmarkInsertPosition( bIsStart, rBookmarkName, xCurrent ) ));
+ m_aBookmarkMap.insert(BookmarkMap_t::value_type( nId, BookmarkInsertPosition( bIsStart, rBookmarkName, xCurrent ) ));
}
}
catch( const uno::Exception& )
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
index 314d772..1ba6883 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -289,7 +289,7 @@ class DomainMapper_Impl
public:
typedef TableManager< ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >, PropertyMapPtr > TableManager_t;
typedef TableDataHandler< ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >, TablePropertyMapPtr > TableDataHandler_t;
- typedef std::map < ::rtl::OUString, BookmarkInsertPosition > BookmarkMap_t;
+ typedef std::map < sal_Int32, BookmarkInsertPosition > BookmarkMap_t;
private:
SourceDocumentType m_eDocumentType;
@@ -554,7 +554,9 @@ public:
//the end of field is reached (0x15 appeared) - the command might still be open
void PopFieldContext();
- void AddBookmark( const ::rtl::OUString& rBookmarkName, const ::rtl::OUString& rId );
+ void AddBookmark(
+ const ::rtl::OUString& rBookmarkName,
+ const sal_Int32 nId );
void AddAnnotationPosition(
const bool bStart,
More information about the Libreoffice-commits
mailing list