diff options
author | Noel Grandin <noel@peralex.com> | 2015-03-11 12:45:00 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-03-11 13:40:46 +0200 |
commit | 10a1b861853bc7c53d03d372f913134f9a9065ad (patch) | |
tree | 06b64d8ff302995ae2f78247a9ce7499e8aa9ee5 /sw | |
parent | 67ff4ba5294352b7ed948b196551dea331ee0877 (diff) |
convert MarkType to enum class
Change-Id: I73c23d327104b377834013a0a6bd2de18de2900b
Diffstat (limited to 'sw')
26 files changed, 98 insertions, 96 deletions
diff --git a/sw/inc/IDocumentMarkAccess.hxx b/sw/inc/IDocumentMarkAccess.hxx index c699addc8be2..3e73066d7ec5 100644 --- a/sw/inc/IDocumentMarkAccess.hxx +++ b/sw/inc/IDocumentMarkAccess.hxx @@ -37,7 +37,7 @@ namespace sw { namespace mark { class IDocumentMarkAccess { public: - enum MarkType + enum class MarkType { UNO_BOOKMARK, DDE_BOOKMARK, diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx index 01f5a8aa1577..572773475374 100644 --- a/sw/inc/crsrsh.hxx +++ b/sw/inc/crsrsh.hxx @@ -556,7 +556,7 @@ public: const vcl::KeyCode&, const OUString& rName, const OUString& rShortName, - IDocumentMarkAccess::MarkType eMark = IDocumentMarkAccess::BOOKMARK); + IDocumentMarkAccess::MarkType eMark = IDocumentMarkAccess::MarkType::BOOKMARK); bool GotoMark( const ::sw::mark::IMark* const pMark ); // sets CurCrsr.SPoint bool GotoMark( const ::sw::mark::IMark* const pMark, bool bAtStart ); bool GoNextBookmark(); // true, if there was one diff --git a/sw/source/core/crsr/crbm.cxx b/sw/source/core/crsr/crbm.cxx index 30031ae971c6..469732f7cfe0 100644 --- a/sw/source/core/crsr/crbm.cxx +++ b/sw/source/core/crsr/crbm.cxx @@ -74,7 +74,7 @@ namespace static bool lcl_IsInvisibleBookmark(IDocumentMarkAccess::pMark_t pMark) { - return IDocumentMarkAccess::GetType(*pMark) != IDocumentMarkAccess::BOOKMARK; + return IDocumentMarkAccess::GetType(*pMark) != IDocumentMarkAccess::MarkType::BOOKMARK; } } diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index d1920463f198..4b37b043326e 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -216,7 +216,7 @@ namespace : (rMarkStart != rStt && rMarkEnd != rEnd); // rMarkStart == rMarkEnd if ( rMarkStart >= rStt && rMarkEnd <= rEnd && ( bIsNotOnBoundary - || IDocumentMarkAccess::GetType( *pMark ) == IDocumentMarkAccess::ANNOTATIONMARK ) ) + || IDocumentMarkAccess::GetType( *pMark ) == IDocumentMarkAccess::MarkType::ANNOTATIONMARK ) ) { vMarksToCopy.push_back(pMark); } @@ -3794,7 +3794,7 @@ bool DocumentContentOperationsManager::ReplaceRangeImpl( SwPaM& rPam, const OUSt m_rDoc.GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL); // If any Redline will change (split!) the node - const ::sw::mark::IMark* pBkmk = m_rDoc.getIDocumentMarkAccess()->makeMark( aDelPam, OUString(), IDocumentMarkAccess::UNO_BOOKMARK ); + const ::sw::mark::IMark* pBkmk = m_rDoc.getIDocumentMarkAccess()->makeMark( aDelPam, OUString(), IDocumentMarkAccess::MarkType::UNO_BOOKMARK ); //JP 06.01.98: MUSS noch optimiert werden!!! m_rDoc.getIDocumentRedlineAccess().SetRedlineMode( @@ -3886,7 +3886,7 @@ bool DocumentContentOperationsManager::ReplaceRangeImpl( SwPaM& rPam, const OUSt m_rDoc.GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, NULL); // If any Redline will change (split!) the node - const ::sw::mark::IMark* pBkmk = m_rDoc.getIDocumentMarkAccess()->makeMark( aDelPam, OUString(), IDocumentMarkAccess::UNO_BOOKMARK ); + const ::sw::mark::IMark* pBkmk = m_rDoc.getIDocumentMarkAccess()->makeMark( aDelPam, OUString(), IDocumentMarkAccess::MarkType::UNO_BOOKMARK ); SwIndex& rIdx = aDelPam.GetPoint()->nContent; rIdx.Assign( 0, 0 ); diff --git a/sw/source/core/doc/DocumentLinksAdministrationManager.cxx b/sw/source/core/doc/DocumentLinksAdministrationManager.cxx index febda03d8cb2..6c9c64bf2e1d 100644 --- a/sw/source/core/doc/DocumentLinksAdministrationManager.cxx +++ b/sw/source/core/doc/DocumentLinksAdministrationManager.cxx @@ -94,7 +94,7 @@ namespace ppMark != rMarkAccess.getAllMarksEnd(); ++ppMark) { - if ( IDocumentMarkAccess::GetType( *(ppMark->get()) ) == IDocumentMarkAccess::DDE_BOOKMARK) + if ( IDocumentMarkAccess::GetType( *(ppMark->get()) ) == IDocumentMarkAccess::MarkType::DDE_BOOKMARK) { ::sw::mark::DdeBookmark* const pBkmk = dynamic_cast< ::sw::mark::DdeBookmark*>(ppMark->get()); if (!pBkmk) diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index b239e8834136..5d225084ea1c 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -181,7 +181,7 @@ namespace const bool bChangedOPos, MarkBase* io_pMark ) { - if ( IDocumentMarkAccess::GetType(*io_pMark) == IDocumentMarkAccess::ANNOTATIONMARK ) + if ( IDocumentMarkAccess::GetType(*io_pMark) == IDocumentMarkAccess::MarkType::ANNOTATIONMARK ) { // annotation marks are allowed to span a table cell range. // but trigger sorting to be save @@ -302,28 +302,28 @@ IDocumentMarkAccess::MarkType IDocumentMarkAccess::GetType(const IMark& rBkmk) const std::type_info* const pMarkTypeInfo = &typeid(rBkmk); // not using dynamic_cast<> here for performance if(*pMarkTypeInfo == typeid(UnoMark)) - return UNO_BOOKMARK; + return MarkType::UNO_BOOKMARK; else if(*pMarkTypeInfo == typeid(DdeBookmark)) - return DDE_BOOKMARK; + return MarkType::DDE_BOOKMARK; else if(*pMarkTypeInfo == typeid(Bookmark)) - return BOOKMARK; + return MarkType::BOOKMARK; else if(*pMarkTypeInfo == typeid(CrossRefHeadingBookmark)) - return CROSSREF_HEADING_BOOKMARK; + return MarkType::CROSSREF_HEADING_BOOKMARK; else if(*pMarkTypeInfo == typeid(CrossRefNumItemBookmark)) - return CROSSREF_NUMITEM_BOOKMARK; + return MarkType::CROSSREF_NUMITEM_BOOKMARK; else if(*pMarkTypeInfo == typeid(AnnotationMark)) - return ANNOTATIONMARK; + return MarkType::ANNOTATIONMARK; else if(*pMarkTypeInfo == typeid(TextFieldmark)) - return TEXT_FIELDMARK; + return MarkType::TEXT_FIELDMARK; else if(*pMarkTypeInfo == typeid(CheckboxFieldmark)) - return CHECKBOX_FIELDMARK; + return MarkType::CHECKBOX_FIELDMARK; else if(*pMarkTypeInfo == typeid(NavigatorReminder)) - return NAVIGATOR_REMINDER; + return MarkType::NAVIGATOR_REMINDER; else { assert(false && "IDocumentMarkAccess::GetType(..)" " - unknown MarkType. This needs to be fixed!"); - return UNO_BOOKMARK; + return MarkType::UNO_BOOKMARK; } } @@ -375,7 +375,7 @@ namespace sw { namespace mark "MarkManager::makeMark(..)" " - more than USHRT_MAX marks are not supported correctly"); // There should only be one CrossRefBookmark per Textnode per Type - if ((eType == CROSSREF_NUMITEM_BOOKMARK || eType == CROSSREF_HEADING_BOOKMARK) + if ((eType == MarkType::CROSSREF_NUMITEM_BOOKMARK || eType == MarkType::CROSSREF_HEADING_BOOKMARK) && (lcl_FindMarkAtPos(m_vBookmarks, *rPaM.GetPoint(), eType) != m_vBookmarks.end())) { // this can happen via UNO API SAL_WARN("sw.core", "MarkManager::makeMark(..)" @@ -387,31 +387,31 @@ namespace sw { namespace mark pMark_t pMark; switch(eType) { - case IDocumentMarkAccess::TEXT_FIELDMARK: + case IDocumentMarkAccess::MarkType::TEXT_FIELDMARK: pMark = boost::shared_ptr<IMark>(new TextFieldmark(rPaM)); break; - case IDocumentMarkAccess::CHECKBOX_FIELDMARK: + case IDocumentMarkAccess::MarkType::CHECKBOX_FIELDMARK: pMark = boost::shared_ptr<IMark>(new CheckboxFieldmark(rPaM)); break; - case IDocumentMarkAccess::NAVIGATOR_REMINDER: + case IDocumentMarkAccess::MarkType::NAVIGATOR_REMINDER: pMark = boost::shared_ptr<IMark>(new NavigatorReminder(rPaM)); break; - case IDocumentMarkAccess::BOOKMARK: + case IDocumentMarkAccess::MarkType::BOOKMARK: pMark = boost::shared_ptr<IMark>(new Bookmark(rPaM, vcl::KeyCode(), rName, OUString())); break; - case IDocumentMarkAccess::DDE_BOOKMARK: + case IDocumentMarkAccess::MarkType::DDE_BOOKMARK: pMark = boost::shared_ptr<IMark>(new DdeBookmark(rPaM)); break; - case IDocumentMarkAccess::CROSSREF_HEADING_BOOKMARK: + case IDocumentMarkAccess::MarkType::CROSSREF_HEADING_BOOKMARK: pMark = boost::shared_ptr<IMark>(new CrossRefHeadingBookmark(rPaM, vcl::KeyCode(), rName, OUString())); break; - case IDocumentMarkAccess::CROSSREF_NUMITEM_BOOKMARK: + case IDocumentMarkAccess::MarkType::CROSSREF_NUMITEM_BOOKMARK: pMark = boost::shared_ptr<IMark>(new CrossRefNumItemBookmark(rPaM, vcl::KeyCode(), rName, OUString())); break; - case IDocumentMarkAccess::UNO_BOOKMARK: + case IDocumentMarkAccess::MarkType::UNO_BOOKMARK: pMark = boost::shared_ptr<IMark>(new UnoMark(rPaM)); break; - case IDocumentMarkAccess::ANNOTATIONMARK: + case IDocumentMarkAccess::MarkType::ANNOTATIONMARK: pMark = boost::shared_ptr<IMark>(new AnnotationMark( rPaM, rName )); break; } @@ -427,7 +427,7 @@ namespace sw { namespace mark pMarkBase->Swap(); // for performance reasons, we trust UnoMarks to have a (generated) unique name - if ( eType != IDocumentMarkAccess::UNO_BOOKMARK ) + if ( eType != IDocumentMarkAccess::MarkType::UNO_BOOKMARK ) pMarkBase->SetName( getUniqueMarkName( pMarkBase->GetName() ) ); // register mark @@ -435,21 +435,21 @@ namespace sw { namespace mark lcl_InsertMarkSorted(m_vAllMarks, pMark); switch(eType) { - case IDocumentMarkAccess::BOOKMARK: - case IDocumentMarkAccess::CROSSREF_NUMITEM_BOOKMARK: - case IDocumentMarkAccess::CROSSREF_HEADING_BOOKMARK: + case IDocumentMarkAccess::MarkType::BOOKMARK: + case IDocumentMarkAccess::MarkType::CROSSREF_NUMITEM_BOOKMARK: + case IDocumentMarkAccess::MarkType::CROSSREF_HEADING_BOOKMARK: lcl_InsertMarkSorted(m_vBookmarks, pMark); break; - case IDocumentMarkAccess::TEXT_FIELDMARK: - case IDocumentMarkAccess::CHECKBOX_FIELDMARK: + case IDocumentMarkAccess::MarkType::TEXT_FIELDMARK: + case IDocumentMarkAccess::MarkType::CHECKBOX_FIELDMARK: lcl_InsertMarkSorted(m_vFieldmarks, pMark); break; - case IDocumentMarkAccess::ANNOTATIONMARK: + case IDocumentMarkAccess::MarkType::ANNOTATIONMARK: lcl_InsertMarkSorted( m_vAnnotationMarks, pMark ); break; - case IDocumentMarkAccess::NAVIGATOR_REMINDER: - case IDocumentMarkAccess::DDE_BOOKMARK: - case IDocumentMarkAccess::UNO_BOOKMARK: + case IDocumentMarkAccess::MarkType::NAVIGATOR_REMINDER: + case IDocumentMarkAccess::MarkType::DDE_BOOKMARK: + case IDocumentMarkAccess::MarkType::UNO_BOOKMARK: // no special array for these break; } @@ -473,7 +473,7 @@ namespace sw { namespace mark const OUString& rType ) { sw::mark::IMark* pMark = makeMark( rPaM, rName, - IDocumentMarkAccess::TEXT_FIELDMARK ); + IDocumentMarkAccess::MarkType::TEXT_FIELDMARK ); sw::mark::IFieldmark* pFieldMark = dynamic_cast<sw::mark::IFieldmark*>( pMark ); if (pFieldMark) pFieldMark->SetFieldname( rType ); @@ -487,7 +487,7 @@ namespace sw { namespace mark const OUString& rType) { sw::mark::IMark* pMark = makeMark( rPaM, rName, - IDocumentMarkAccess::CHECKBOX_FIELDMARK ); + IDocumentMarkAccess::MarkType::CHECKBOX_FIELDMARK ); sw::mark::IFieldmark* pFieldMark = dynamic_cast<sw::mark::IFieldmark*>( pMark ); if (pFieldMark) pFieldMark->SetFieldname( rType ); @@ -512,7 +512,7 @@ namespace sw { namespace mark const SwPaM& rPaM, const OUString& rName ) { - return makeMark( rPaM, rName, IDocumentMarkAccess::ANNOTATIONMARK ); + return makeMark( rPaM, rName, IDocumentMarkAccess::MarkType::ANNOTATIONMARK ); } void MarkManager::repositionMark( @@ -679,7 +679,7 @@ namespace sw { namespace mark { // navigator marks should not be moved // TODO: Check if this might make them invalid - if(IDocumentMarkAccess::GetType(**ppMark) == NAVIGATOR_REMINDER) + if(IDocumentMarkAccess::GetType(**ppMark) == MarkType::NAVIGATOR_REMINDER) continue; ::sw::mark::MarkBase* pMark = dynamic_cast< ::sw::mark::MarkBase* >(ppMark->get()); @@ -716,12 +716,12 @@ namespace sw { namespace mark { switch ( IDocumentMarkAccess::GetType( *pMark ) ) { - case IDocumentMarkAccess::CROSSREF_HEADING_BOOKMARK: - case IDocumentMarkAccess::CROSSREF_NUMITEM_BOOKMARK: + case IDocumentMarkAccess::MarkType::CROSSREF_HEADING_BOOKMARK: + case IDocumentMarkAccess::MarkType::CROSSREF_NUMITEM_BOOKMARK: // no delete of cross-reference bookmarks, if range is inside one paragraph bDeleteMark = rStt != rEnd; break; - case IDocumentMarkAccess::UNO_BOOKMARK: + case IDocumentMarkAccess::MarkType::UNO_BOOKMARK: // no delete of UNO mark, if it is not expanded and only touches the start of the range bDeleteMark = bIsOtherPosInRange || pMark->IsExpanded() @@ -766,12 +766,12 @@ namespace sw { namespace mark { switch ( IDocumentMarkAccess::GetType( *pMark ) ) { - case IDocumentMarkAccess::CROSSREF_HEADING_BOOKMARK: - case IDocumentMarkAccess::CROSSREF_NUMITEM_BOOKMARK: + case IDocumentMarkAccess::MarkType::CROSSREF_HEADING_BOOKMARK: + case IDocumentMarkAccess::MarkType::CROSSREF_NUMITEM_BOOKMARK: // no move of cross-reference bookmarks, if move occurs inside a certain node bMoveMark = pMark->GetMarkPos().nNode != pNewPos->nNode; break; - case IDocumentMarkAccess::ANNOTATIONMARK: + case IDocumentMarkAccess::MarkType::ANNOTATIONMARK: // no move of annotation marks, if method is called to collect deleted marks bMoveMark = pSaveBkmk == NULL; break; @@ -854,9 +854,9 @@ namespace sw { namespace mark switch(IDocumentMarkAccess::GetType(**ppMark)) { - case IDocumentMarkAccess::BOOKMARK: - case IDocumentMarkAccess::CROSSREF_HEADING_BOOKMARK: - case IDocumentMarkAccess::CROSSREF_NUMITEM_BOOKMARK: + 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); if ( ppBookmark != m_vBookmarks.end() ) @@ -871,8 +871,8 @@ namespace sw { namespace mark } break; - case IDocumentMarkAccess::TEXT_FIELDMARK: - case IDocumentMarkAccess::CHECKBOX_FIELDMARK: + case IDocumentMarkAccess::MarkType::TEXT_FIELDMARK: + case IDocumentMarkAccess::MarkType::CHECKBOX_FIELDMARK: { IDocumentMarkAccess::iterator_t ppFieldmark = lcl_FindMark(m_vFieldmarks, *ppMark); if ( ppFieldmark != m_vFieldmarks.end() ) @@ -888,7 +888,7 @@ namespace sw { namespace mark } break; - case IDocumentMarkAccess::ANNOTATIONMARK: + case IDocumentMarkAccess::MarkType::ANNOTATIONMARK: { IDocumentMarkAccess::iterator_t ppAnnotationMark = lcl_FindMark(m_vAnnotationMarks, *ppMark); if ( ppAnnotationMark != m_vAnnotationMarks.end() ) @@ -903,9 +903,9 @@ namespace sw { namespace mark } break; - case IDocumentMarkAccess::NAVIGATOR_REMINDER: - case IDocumentMarkAccess::DDE_BOOKMARK: - case IDocumentMarkAccess::UNO_BOOKMARK: + case IDocumentMarkAccess::MarkType::NAVIGATOR_REMINDER: + case IDocumentMarkAccess::MarkType::DDE_BOOKMARK: + case IDocumentMarkAccess::MarkType::UNO_BOOKMARK: // no special marks container break; } diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx index ce75ce98950b..c64afc1cd1ea 100644 --- a/sw/source/core/tox/txmsrt.cxx +++ b/sw/source/core/tox/txmsrt.cxx @@ -573,7 +573,7 @@ OUString SwTOXPara::GetURL() const SwDoc* pDoc = const_cast<SwDoc*>( pTxtNd->GetDoc() ); ::sw::mark::IMark const * const pMark = pDoc->getIDocumentMarkAccess()->getMarkForTxtNode( *(pTxtNd), - IDocumentMarkAccess::CROSSREF_HEADING_BOOKMARK); + IDocumentMarkAccess::MarkType::CROSSREF_HEADING_BOOKMARK); aTxt = "#" + pMark->GetName(); } break; diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx index f20980cf5882..1743614960f3 100644 --- a/sw/source/core/undo/undobj.cxx +++ b/sw/source/core/undo/undobj.cxx @@ -694,8 +694,8 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark, // #i92125# // keep cross-reference bookmarks, if content inside one paragraph is deleted. if ( rMark.nNode == rPoint.nNode - && ( IDocumentMarkAccess::GetType(*pBkmk) == IDocumentMarkAccess::CROSSREF_HEADING_BOOKMARK - || IDocumentMarkAccess::GetType(*pBkmk) == IDocumentMarkAccess::CROSSREF_NUMITEM_BOOKMARK ) ) + && ( IDocumentMarkAccess::GetType(*pBkmk) == IDocumentMarkAccess::MarkType::CROSSREF_HEADING_BOOKMARK + || IDocumentMarkAccess::GetType(*pBkmk) == IDocumentMarkAccess::MarkType::CROSSREF_NUMITEM_BOOKMARK ) ) { continue; } @@ -749,7 +749,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark, } } } - else if ( IDocumentMarkAccess::GetType(*pBkmk) == IDocumentMarkAccess::ANNOTATIONMARK ) + else if ( IDocumentMarkAccess::GetType(*pBkmk) == IDocumentMarkAccess::MarkType::ANNOTATIONMARK ) { // delete annotation marks, if its end position is covered by the deletion const SwPosition& rAnnotationEndPos = pBkmk->GetMarkEnd(); @@ -763,7 +763,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark, if ( bSavePos || bSaveOtherPos ) { - if( IDocumentMarkAccess::GetType(*pBkmk) != IDocumentMarkAccess::UNO_BOOKMARK ) + if( IDocumentMarkAccess::GetType(*pBkmk) != IDocumentMarkAccess::MarkType::UNO_BOOKMARK ) { if( !pHistory ) pHistory = new SwHistory; diff --git a/sw/source/core/unocore/unobkm.cxx b/sw/source/core/unocore/unobkm.cxx index 2f252f99d1a3..f3cba345bcd1 100644 --- a/sw/source/core/unocore/unobkm.cxx +++ b/sw/source/core/unocore/unobkm.cxx @@ -154,7 +154,8 @@ uno::Reference<text::XTextContent> SwXBookmark::CreateXBookmark( if (!xBookmark.is()) { OSL_ENSURE(!pBookmark || - dynamic_cast< ::sw::mark::IBookmark* >(pBookmark) || IDocumentMarkAccess::GetType(*pBookmark) == IDocumentMarkAccess::ANNOTATIONMARK, + dynamic_cast< ::sw::mark::IBookmark* >(pBookmark) || + IDocumentMarkAccess::GetType(*pBookmark) == IDocumentMarkAccess::MarkType::ANNOTATIONMARK, "<SwXBookmark::GetObject(..)>" "SwXBookmark requested for non-bookmark mark and non-annotation mark."); SwXBookmark *const pXBookmark = @@ -229,16 +230,16 @@ throw (lang::IllegalArgumentException, uno::RuntimeException) { m_pImpl->m_sMarkName = "Bookmark"; } - if ((eType == IDocumentMarkAccess::BOOKMARK) && + if ((eType == IDocumentMarkAccess::MarkType::BOOKMARK) && ::sw::mark::CrossRefNumItemBookmark::IsLegalName(m_pImpl->m_sMarkName)) { - eType = IDocumentMarkAccess::CROSSREF_NUMITEM_BOOKMARK; + eType = IDocumentMarkAccess::MarkType::CROSSREF_NUMITEM_BOOKMARK; } - else if ((eType == IDocumentMarkAccess::BOOKMARK) && + else if ((eType == IDocumentMarkAccess::MarkType::BOOKMARK) && ::sw::mark::CrossRefHeadingBookmark::IsLegalName(m_pImpl->m_sMarkName) && IDocumentMarkAccess::IsLegalPaMForCrossRefHeadingBookmark( aPam ) ) { - eType = IDocumentMarkAccess::CROSSREF_HEADING_BOOKMARK; + eType = IDocumentMarkAccess::MarkType::CROSSREF_HEADING_BOOKMARK; } m_pImpl->registerInMark(*this, m_pImpl->m_pDoc->getIDocumentMarkAccess()->makeMark( @@ -258,7 +259,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException) void SwXBookmark::attachToRange( const uno::Reference< text::XTextRange > & xTextRange ) throw (lang::IllegalArgumentException, uno::RuntimeException) { - attachToRangeEx(xTextRange, IDocumentMarkAccess::BOOKMARK); + attachToRangeEx(xTextRange, IDocumentMarkAccess::MarkType::BOOKMARK); } void SAL_CALL SwXBookmark::attach( const uno::Reference< text::XTextRange > & xTextRange ) @@ -571,7 +572,7 @@ void SwXFieldmark::attachToRange( const uno::Reference < text::XTextRange >& xTe { attachToRangeEx( xTextRange, - ( isReplacementObject ? IDocumentMarkAccess::CHECKBOX_FIELDMARK : IDocumentMarkAccess::TEXT_FIELDMARK ) ); + ( isReplacementObject ? IDocumentMarkAccess::MarkType::CHECKBOX_FIELDMARK : IDocumentMarkAccess::MarkType::TEXT_FIELDMARK ) ); } OUString SwXFieldmark::getFieldType(void) diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx index b185d9d9e837..4d115097c9b9 100644 --- a/sw/source/core/unocore/unocoll.cxx +++ b/sw/source/core/unocore/unocoll.cxx @@ -1601,7 +1601,7 @@ sal_Int32 SwXBookmarks::getCount(void) pMarkAccess->getBookmarksBegin(); ppMark != pMarkAccess->getBookmarksEnd(); ++ppMark) { - if (IDocumentMarkAccess::BOOKMARK == + if (IDocumentMarkAccess::MarkType::BOOKMARK == IDocumentMarkAccess::GetType(**ppMark)) { ++count; // only count real bookmarks @@ -1625,7 +1625,7 @@ uno::Any SwXBookmarks::getByIndex(sal_Int32 nIndex) pMarkAccess->getBookmarksBegin(); ppMark != pMarkAccess->getBookmarksEnd(); ++ppMark) { - if (IDocumentMarkAccess::BOOKMARK == + if (IDocumentMarkAccess::MarkType::BOOKMARK == IDocumentMarkAccess::GetType(**ppMark)) { if (count == nIndex) @@ -1674,7 +1674,7 @@ uno::Sequence< OUString > SwXBookmarks::getElementNames(void) pMarkAccess->getBookmarksBegin(); ppMark != pMarkAccess->getBookmarksEnd(); ++ppMark) { - if (IDocumentMarkAccess::BOOKMARK == + if (IDocumentMarkAccess::MarkType::BOOKMARK == IDocumentMarkAccess::GetType(**ppMark)) { ret.push_back((*ppMark)->GetName()); // only add real bookmarks @@ -1712,7 +1712,7 @@ sal_Bool SwXBookmarks::hasElements(void) pMarkAccess->getBookmarksBegin(); ppMark != pMarkAccess->getBookmarksEnd(); ++ppMark) { - if (IDocumentMarkAccess::BOOKMARK == + if (IDocumentMarkAccess::MarkType::BOOKMARK == IDocumentMarkAccess::GetType(**ppMark)) { return true; diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index 2756143db2cc..1066edf0c491 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -811,7 +811,7 @@ void SwXTextRange::SetPositions(const SwPaM& rPam) m_pImpl->Invalidate(); IDocumentMarkAccess* const pMA = m_pImpl->m_rDoc.getIDocumentMarkAccess(); m_pImpl->m_pMark = pMA->makeMark(rPam, OUString(), - IDocumentMarkAccess::UNO_BOOKMARK); + IDocumentMarkAccess::MarkType::UNO_BOOKMARK); m_pImpl->m_pMark->Add(m_pImpl.get()); } diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx index 61a64dffe811..964d1f49f374 100644 --- a/sw/source/core/unocore/unoportenum.cxx +++ b/sw/source/core/unocore/unoportenum.cxx @@ -216,7 +216,8 @@ namespace continue; IDocumentMarkAccess::MarkType eType = IDocumentMarkAccess::GetType(*pBkmk); // These are the types stored in the container otherwise accessible via getBookmarks*() - if (eType != IDocumentMarkAccess::BOOKMARK && eType != IDocumentMarkAccess::CROSSREF_NUMITEM_BOOKMARK && eType != IDocumentMarkAccess::CROSSREF_HEADING_BOOKMARK) + if (eType != IDocumentMarkAccess::MarkType::BOOKMARK && eType != IDocumentMarkAccess::MarkType::CROSSREF_NUMITEM_BOOKMARK && + eType != IDocumentMarkAccess::MarkType::CROSSREF_HEADING_BOOKMARK) continue; // Only handle bookmarks once, if they start and end at this node as well. if (aSeenMarks.find(pBkmk) != aSeenMarks.end()) diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx index 8306fe63a386..8a6733495aa6 100644 --- a/sw/source/filter/basflt/fltshell.cxx +++ b/sw/source/filter/basflt/fltshell.cxx @@ -581,8 +581,8 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos, const IDocumentMarkAccess::MarkType eBookmarkType = ( pB->IsTOCBookmark() && IDocumentMarkAccess::IsLegalPaMForCrossRefHeadingBookmark( aRegion ) ) - ? IDocumentMarkAccess::CROSSREF_HEADING_BOOKMARK - : IDocumentMarkAccess::BOOKMARK; + ? IDocumentMarkAccess::MarkType::CROSSREF_HEADING_BOOKMARK + : IDocumentMarkAccess::MarkType::BOOKMARK; pDoc->getIDocumentMarkAccess()->makeMark( aRegion, rName, eBookmarkType ); } } diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index 73f8732dfa8b..039370cc6205 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -2835,7 +2835,7 @@ void SwHTMLParser::_SetAttr( bool bChkEnd, bool bBeforeTable, const ::sw::mark::IMark* const pNewMark = pMarkAccess->makeMark( *pAttrPam, sName, - IDocumentMarkAccess::BOOKMARK ); + IDocumentMarkAccess::MarkType::BOOKMARK ); // jump to bookmark if( JUMPTO_MARK == eJumpTo && pNewMark->GetName() == sJmpMark ) diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 2a9c05db8c72..00361967a1d5 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -1795,7 +1795,7 @@ bool MSWordExportBase::GetBookmarks( const SwTxtNode& rNd, sal_Int32 nStt, { IMark* pMark = ( pMarkAccess->getAllMarksBegin() + i )->get(); - if ( IDocumentMarkAccess::GetType( *(pMark) ) == IDocumentMarkAccess::ANNOTATIONMARK ) + if ( IDocumentMarkAccess::GetType( *(pMark) ) == IDocumentMarkAccess::MarkType::ANNOTATIONMARK ) { continue; } diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index deae95a56771..a166a7c56eef 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -5255,7 +5255,7 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos) { IDocumentMarkAccess::const_iterator_t ppBkmk = pMarkAccess->findBookmark( "_PictureBullets" ); if ( ppBkmk != pMarkAccess->getBookmarksEnd() && - IDocumentMarkAccess::GetType( *(ppBkmk->get()) ) == IDocumentMarkAccess::BOOKMARK ) + IDocumentMarkAccess::GetType( *(ppBkmk->get()) ) == IDocumentMarkAccess::MarkType::BOOKMARK ) { SwTxtNode* pTxtNode = ppBkmk->get()->GetMarkStart().nNode.GetNode().GetTxtNode(); diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx index 4bfa2db530d4..a270d2943d94 100644 --- a/sw/source/ui/dbui/dbinsdlg.cxx +++ b/sw/source/ui/dbui/dbinsdlg.cxx @@ -1352,7 +1352,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection, pMark = rSh.SetBookmark( vcl::KeyCode(), OUString(), - OUString(), IDocumentMarkAccess::UNO_BOOKMARK ); + OUString(), IDocumentMarkAccess::MarkType::UNO_BOOKMARK ); rSh.SwCrsrShell::MovePara( GetfnParaCurr(), GetfnParaEnd() ); bSetCrsr = false; diff --git a/sw/source/ui/fldui/fldref.cxx b/sw/source/ui/fldui/fldref.cxx index 605e2a360dda..09464e69fc99 100644 --- a/sw/source/ui/fldui/fldref.cxx +++ b/sw/source/ui/fldui/fldref.cxx @@ -482,7 +482,7 @@ void SwFldRefPage::UpdateSubType() ++ppMark) { const ::sw::mark::IMark* pBkmk = ppMark->get(); - if(IDocumentMarkAccess::BOOKMARK == IDocumentMarkAccess::GetType(*pBkmk)) + if(IDocumentMarkAccess::MarkType::BOOKMARK == IDocumentMarkAccess::GetType(*pBkmk)) m_pSelectionLB->InsertEntry( pBkmk->GetName() ); } if (IsFldEdit()) @@ -858,7 +858,7 @@ bool SwFldRefPage::FillItemSet(SfxItemSet* ) { ::sw::mark::IMark const * const pMark = pSh->getIDocumentMarkAccess()->getMarkForTxtNode( *(maOutlineNodes[nOutlIdx]), - IDocumentMarkAccess::CROSSREF_HEADING_BOOKMARK); + IDocumentMarkAccess::MarkType::CROSSREF_HEADING_BOOKMARK); aName = pMark->GetName(); nTypeId = TYP_GETREFFLD; nSubType = REF_BOOKMARK; @@ -879,7 +879,7 @@ bool SwFldRefPage::FillItemSet(SfxItemSet* ) { ::sw::mark::IMark const * const pMark = pSh->getIDocumentMarkAccess()->getMarkForTxtNode( *(maNumItems[nNumItemIdx]->GetTxtNode()), - IDocumentMarkAccess::CROSSREF_NUMITEM_BOOKMARK); + IDocumentMarkAccess::MarkType::CROSSREF_NUMITEM_BOOKMARK); aName = pMark->GetName(); nTypeId = TYP_GETREFFLD; nSubType = REF_BOOKMARK; diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx index 24877e0ccaca..59576289d831 100644 --- a/sw/source/ui/misc/bookmark.cxx +++ b/sw/source/ui/misc/bookmark.cxx @@ -135,7 +135,7 @@ SwInsertBookmarkDlg::SwInsertBookmarkDlg( vcl::Window *pParent, SwWrtShell &rS, ppBookmark != pMarkAccess->getBookmarksEnd(); ++ppBookmark) { - if(IDocumentMarkAccess::BOOKMARK == IDocumentMarkAccess::GetType(**ppBookmark)) + if(IDocumentMarkAccess::MarkType::BOOKMARK == IDocumentMarkAccess::GetType(**ppBookmark)) { m_pBookmarkBox->InsertSwEntry( SwBoxEntry(ppBookmark->get()->GetName(), nId++)); diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx index 3b085cce228a..94e5bca22815 100644 --- a/sw/source/uibase/dbui/dbmgr.cxx +++ b/sw/source/uibase/dbui/dbmgr.cxx @@ -1157,7 +1157,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell, SwDocMergeInfo aMergeInfo; // Name of the mark is actually irrelevant, UNO bookmarks have internals names. aMergeInfo.startPageInTarget = pTargetDoc->getIDocumentMarkAccess()->makeMark( appendedDocStart, "", - IDocumentMarkAccess::UNO_BOOKMARK ); + IDocumentMarkAccess::MarkType::UNO_BOOKMARK ); aMergeInfo.nDBRow = nStartRow; rMergeDescriptor.pMailMergeConfigItem->AddMergedDocument( aMergeInfo ); } diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index 68dc9610f29a..316057820df7 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -885,7 +885,7 @@ int SwTransferable::PrepareForCopy( bool bIsCut ) ppMark != pMarkAccess->getAllMarksEnd(); ++ppMark) { - if(IDocumentMarkAccess::DDE_BOOKMARK == IDocumentMarkAccess::GetType(**ppMark)) + if(IDocumentMarkAccess::MarkType::DDE_BOOKMARK == IDocumentMarkAccess::GetType(**ppMark)) vDdeMarks.push_back(ppMark->get()); } // remove all DDE-Bookmarks, they are invalid inside the clipdoc! @@ -3635,7 +3635,7 @@ SwTrnsfrDdeLink::SwTrnsfrDdeLink( SwTransferable& rTrans, SwWrtShell& rSh ) vcl::KeyCode(), OUString(), OUString(), - IDocumentMarkAccess::DDE_BOOKMARK); + IDocumentMarkAccess::MarkType::DDE_BOOKMARK); if(pMark) { sName = pMark->GetName(); @@ -3715,7 +3715,7 @@ bool SwTrnsfrDdeLink::WriteData( SvStream& rStrm ) IDocumentMarkAccess* const pMarkAccess = pDocShell->GetDoc()->getIDocumentMarkAccess(); IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->findMark(sName); if(ppMark != pMarkAccess->getAllMarksEnd() - && IDocumentMarkAccess::GetType(**ppMark) != IDocumentMarkAccess::BOOKMARK) + && IDocumentMarkAccess::GetType(**ppMark) != IDocumentMarkAccess::MarkType::BOOKMARK) { // the mark is still a DdeBookmark // we replace it with a Bookmark, so it will get saved etc. @@ -3742,7 +3742,7 @@ bool SwTrnsfrDdeLink::WriteData( SvStream& rStrm ) ::sw::mark::IMark* const pNewMark = pMarkAccess->makeMark( aPaM, sMarkName, - IDocumentMarkAccess::BOOKMARK); + IDocumentMarkAccess::MarkType::BOOKMARK); rServerObject.SetDdeBookmark(*pNewMark); } diff --git a/sw/source/uibase/docvw/edtwin2.cxx b/sw/source/uibase/docvw/edtwin2.cxx index e00219cce611..7801d589559a 100644 --- a/sw/source/uibase/docvw/edtwin2.cxx +++ b/sw/source/uibase/docvw/edtwin2.cxx @@ -197,7 +197,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) pMarkAccess->findBookmark( sTmpSearchStr ); if ( ppBkmk != pMarkAccess->getBookmarksEnd() && IDocumentMarkAccess::GetType( *(ppBkmk->get()) ) - == IDocumentMarkAccess::CROSSREF_HEADING_BOOKMARK ) + == IDocumentMarkAccess::MarkType::CROSSREF_HEADING_BOOKMARK ) { SwTxtNode* pTxtNode = ppBkmk->get()->GetMarkStart().nNode.GetNode().GetTxtNode(); if ( pTxtNode ) diff --git a/sw/source/uibase/uiview/viewmdi.cxx b/sw/source/uibase/uiview/viewmdi.cxx index 2422e31f4a4f..d2513ec54ad3 100644 --- a/sw/source/uibase/uiview/viewmdi.cxx +++ b/sw/source/uibase/uiview/viewmdi.cxx @@ -397,7 +397,7 @@ IMPL_STATIC_LINK( SwView, MoveNavigationHdl, bool *, pbNext ) ppMark != pMarkAccess->getAllMarksEnd(); ppMark++) { - if( IDocumentMarkAccess::GetType(**ppMark) == IDocumentMarkAccess::NAVIGATOR_REMINDER ) + if( IDocumentMarkAccess::GetType(**ppMark) == IDocumentMarkAccess::MarkType::NAVIGATOR_REMINDER ) vNavMarks.push_back(ppMark->get()); } diff --git a/sw/source/uibase/utlui/bookctrl.cxx b/sw/source/uibase/utlui/bookctrl.cxx index d3ef629cf1d1..6a78ef5a0b45 100644 --- a/sw/source/uibase/utlui/bookctrl.cxx +++ b/sw/source/uibase/utlui/bookctrl.cxx @@ -114,7 +114,7 @@ void SwBookmarkControl::Command( const CommandEvent& rCEvt ) ppBookmark != pMarkAccess->getBookmarksEnd(); ++ppBookmark) { - if(IDocumentMarkAccess::BOOKMARK == IDocumentMarkAccess::GetType(**ppBookmark)) + if(IDocumentMarkAccess::MarkType::BOOKMARK == IDocumentMarkAccess::GetType(**ppBookmark)) { aPop.InsertItem( nPopupId, ppBookmark->get()->GetName() ); aBookmarkIdx[nPopupId] = static_cast<sal_uInt16>(ppBookmark - ppBookmarkStart); diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 17cd635f6497..96f671b2a1db 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -144,7 +144,7 @@ namespace static bool lcl_IsUiVisibleBookmark(const IDocumentMarkAccess::pMark_t& rpMark) { - return IDocumentMarkAccess::GetType(*rpMark) == IDocumentMarkAccess::BOOKMARK; + return IDocumentMarkAccess::GetType(*rpMark) == IDocumentMarkAccess::MarkType::BOOKMARK; } } diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index 470664bffa2f..52ae241f7e9e 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -501,7 +501,7 @@ void SwNavigationPI::MakeMark() for(IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getAllMarksBegin(); ppMark != pMarkAccess->getAllMarksEnd(); ++ppMark) - if( IDocumentMarkAccess::GetType(**ppMark) == IDocumentMarkAccess::NAVIGATOR_REMINDER ) + if( IDocumentMarkAccess::GetType(**ppMark) == IDocumentMarkAccess::MarkType::NAVIGATOR_REMINDER ) vNavMarkNames.push_back(ppMark->get()->GetName()); ::std::sort(vNavMarkNames.begin(), vNavMarkNames.end()); @@ -511,7 +511,7 @@ void SwNavigationPI::MakeMark() if(vNavMarkNames.size() == MAX_MARKS) pMarkAccess->deleteMark(pMarkAccess->findMark(vNavMarkNames[nAutoMarkIdx])); - rSh.SetBookmark(vcl::KeyCode(), OUString(), OUString(), IDocumentMarkAccess::NAVIGATOR_REMINDER); + rSh.SetBookmark(vcl::KeyCode(), OUString(), OUString(), IDocumentMarkAccess::MarkType::NAVIGATOR_REMINDER); SwView::SetActMark( nAutoMarkIdx ); if(++nAutoMarkIdx == MAX_MARKS) |