diff options
Diffstat (limited to 'sw/source/core/doc')
-rw-r--r-- | sw/source/core/doc/DocumentContentOperationsManager.cxx | 13 | ||||
-rw-r--r-- | sw/source/core/doc/docbm.cxx | 20 |
2 files changed, 23 insertions, 10 deletions
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index 4150718228fb..cd8258db8b00 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -269,7 +269,8 @@ namespace ::sw::mark::IMark* const pNewMark = pDestDoc->getIDocumentMarkAccess()->makeMark( aTmpPam, pMark->GetName(), - IDocumentMarkAccess::GetType(*pMark)); + IDocumentMarkAccess::GetType(*pMark), + ::sw::mark::InsertMode::CopyText); // Explicitly try to get exactly the same name as in the source // because NavigatorReminders, DdeBookmarks etc. ignore the proposed name pDestDoc->getIDocumentMarkAccess()->renameMark(pNewMark, pMark->GetName()); @@ -3861,7 +3862,10 @@ bool DocumentContentOperationsManager::ReplaceRangeImpl( SwPaM& rPam, const OUSt m_rDoc.GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, nullptr); // If any Redline will change (split!) the node - const ::sw::mark::IMark* pBkmk = m_rDoc.getIDocumentMarkAccess()->makeMark( aDelPam, OUString(), IDocumentMarkAccess::MarkType::UNO_BOOKMARK ); + const ::sw::mark::IMark* pBkmk = + m_rDoc.getIDocumentMarkAccess()->makeMark( aDelPam, + OUString(), IDocumentMarkAccess::MarkType::UNO_BOOKMARK, + ::sw::mark::InsertMode::New); //JP 06.01.98: MUSS noch optimiert werden!!! m_rDoc.getIDocumentRedlineAccess().SetRedlineFlags( @@ -3953,7 +3957,10 @@ bool DocumentContentOperationsManager::ReplaceRangeImpl( SwPaM& rPam, const OUSt m_rDoc.GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, nullptr); // If any Redline will change (split!) the node - const ::sw::mark::IMark* pBkmk = m_rDoc.getIDocumentMarkAccess()->makeMark( aDelPam, OUString(), IDocumentMarkAccess::MarkType::UNO_BOOKMARK ); + const ::sw::mark::IMark* pBkmk = + m_rDoc.getIDocumentMarkAccess()->makeMark( aDelPam, + OUString(), IDocumentMarkAccess::MarkType::UNO_BOOKMARK, + ::sw::mark::InsertMode::New); SwIndex& rIdx = aDelPam.GetPoint()->nContent; rIdx.Assign( nullptr, 0 ); diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index 1604d7ccf35c..99eec9fe1e37 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -369,7 +369,8 @@ namespace sw { namespace mark ::sw::mark::IMark* MarkManager::makeMark(const SwPaM& rPaM, const OUString& rName, - const IDocumentMarkAccess::MarkType eType) + const IDocumentMarkAccess::MarkType eType, + sw::mark::InsertMode const eMode) { #if OSL_DEBUG_LEVEL > 0 { @@ -468,7 +469,7 @@ namespace sw { namespace mark // no special array for these break; } - pMarkBase->InitDoc(m_pDoc); + pMarkBase->InitDoc(m_pDoc, eMode); SAL_INFO("sw.core", "--- makeType ---"); SAL_INFO("sw.core", "Marks"); lcl_DebugMarks(m_vAllMarks); @@ -486,7 +487,8 @@ namespace sw { namespace mark const OUString& rType ) { sw::mark::IMark* pMark = makeMark( rPaM, rName, - IDocumentMarkAccess::MarkType::TEXT_FIELDMARK ); + IDocumentMarkAccess::MarkType::TEXT_FIELDMARK, + sw::mark::InsertMode::New); sw::mark::IFieldmark* pFieldMark = dynamic_cast<sw::mark::IFieldmark*>( pMark ); if (pFieldMark) pFieldMark->SetFieldname( rType ); @@ -500,7 +502,8 @@ namespace sw { namespace mark const OUString& rType) { sw::mark::IMark* pMark = makeMark( rPaM, rName, - IDocumentMarkAccess::MarkType::CHECKBOX_FIELDMARK ); + IDocumentMarkAccess::MarkType::CHECKBOX_FIELDMARK, + sw::mark::InsertMode::New); sw::mark::IFieldmark* pFieldMark = dynamic_cast<sw::mark::IFieldmark*>( pMark ); if (pFieldMark) pFieldMark->SetFieldname( rType ); @@ -518,14 +521,15 @@ namespace sw { namespace mark if(ppExistingMark != m_vBookmarks.end()) return ppExistingMark->get(); const SwPaM aPaM(aPos); - return makeMark(aPaM, OUString(), eType); + return makeMark(aPaM, OUString(), eType, sw::mark::InsertMode::New); } sw::mark::IMark* MarkManager::makeAnnotationMark( const SwPaM& rPaM, const OUString& rName ) { - return makeMark( rPaM, rName, IDocumentMarkAccess::MarkType::ANNOTATIONMARK ); + return makeMark(rPaM, rName, IDocumentMarkAccess::MarkType::ANNOTATIONMARK, + sw::mark::InsertMode::New); } void MarkManager::repositionMark( @@ -1289,7 +1293,9 @@ void SaveBookmark::SetInDoc( if(!aPam.HasMark() || CheckNodesRange(aPam.GetPoint()->nNode, aPam.GetMark()->nNode, true)) { - ::sw::mark::IBookmark* const pBookmark = dynamic_cast< ::sw::mark::IBookmark* >(pDoc->getIDocumentMarkAccess()->makeMark(aPam, m_aName, m_eOrigBkmType)); + ::sw::mark::IBookmark* const pBookmark = dynamic_cast<::sw::mark::IBookmark*>( + pDoc->getIDocumentMarkAccess()->makeMark(aPam, m_aName, + m_eOrigBkmType, sw::mark::InsertMode::New)); if(pBookmark) { pBookmark->SetKeyCode(m_aCode); |