diff options
-rw-r--r-- | sw/source/core/doc/docfmt.cxx | 16 | ||||
-rw-r--r-- | sw/source/core/docnode/nodes.cxx | 5 | ||||
-rw-r--r-- | sw/source/core/edit/edundo.cxx | 159 | ||||
-rw-r--r-- | sw/source/core/frmedt/feshview.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/txtnode/atrflyin.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/txtnode/txtedt.cxx | 40 | ||||
-rw-r--r-- | sw/source/core/undo/untbl.cxx | 2 | ||||
-rwxr-xr-x | sw/source/ui/ribbar/inputwin.cxx | 6 |
8 files changed, 8 insertions, 226 deletions
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index ce470b37084c..1154fbf61d88 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -1499,13 +1499,8 @@ sal_uInt16 SwDoc::GetTblFrmFmtCount(sal_Bool bUsed) const sal_uInt16 nCount = pTblFrmFmtTbl->Count(); if(bUsed) { -<<<<<<< local - SwAutoFmtGetDocNode aGetHt( &aNodes ); - for ( sal_uInt16 i = nCount; i; ) -======= SwAutoFmtGetDocNode aGetHt( &GetNodes() ); for ( sal_uInt16 i = nCount; i; ) ->>>>>>> other { if((*pTblFrmFmtTbl)[--i]->GetInfo( aGetHt )) @@ -1522,14 +1517,8 @@ SwFrmFmt& SwDoc::GetTblFrmFmt(sal_uInt16 nFmt, sal_Bool bUsed ) const sal_uInt16 nRemoved = 0; if(bUsed) { -<<<<<<< local - SwAutoFmtGetDocNode aGetHt( &aNodes ); - - for ( sal_uInt16 i = 0; i <= nFmt; i++ ) -======= SwAutoFmtGetDocNode aGetHt( &GetNodes() ); for ( sal_uInt16 i = 0; i <= nFmt; i++ ) ->>>>>>> other { while ( (*pTblFrmFmtTbl)[ i + nRemoved]->GetInfo( aGetHt )) { @@ -2278,12 +2267,7 @@ void SwDoc::CopyPageDesc( const SwPageDesc& rSrcDesc, SwPageDesc& rDstDesc, void SwDoc::ReplaceStyles( SwDoc& rSource ) { -<<<<<<< local - sal_Bool bIsUndo = DoesUndo(); - DoUndo( sal_False ); -======= ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo()); ->>>>>>> other CopyFmtArr( *rSource.pCharFmtTbl, *pCharFmtTbl, &SwDoc::_MakeCharFmt, *pDfltCharFmt ); diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx index 32fd36e19802..5ef2df851e17 100644 --- a/sw/source/core/docnode/nodes.cxx +++ b/sw/source/core/docnode/nodes.cxx @@ -1879,12 +1879,7 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes ) SwDoc* const pInsDoc = pDestNd->GetDoc(); ::sw::UndoGuard const undoGuard(pInsDoc->GetIDocumentUndoRedo()); pSrcNd->CopyCollFmt( *pDestNd ); -<<<<<<< local - pInsDoc->DoUndo( bIsUndo ); bCopyCollFmt = sal_False; -======= - bCopyCollFmt = sal_False; ->>>>>>> other } if( bOneNd ) // das wars schon diff --git a/sw/source/core/edit/edundo.cxx b/sw/source/core/edit/edundo.cxx index 9ca8bb1a7e3c..466db86bd93a 100644 --- a/sw/source/core/edit/edundo.cxx +++ b/sw/source/core/edit/edundo.cxx @@ -52,9 +52,6 @@ void lcl_SelectSdrMarkList( SwEditShell* pShell, bool SwEditShell::CursorsLocked() const { -<<<<<<< local -sal_Bool SwEditShell::Undo( SwUndoId nUndoId, sal_uInt16 nCnt ) -======= return GetDoc()->GetDocShell()->GetModel()->hasControllersLocked(); } @@ -103,23 +100,13 @@ SwEditShell::HandleUndoRedoContext(::sw::UndoRedoContext & rContext) } bool SwEditShell::Undo(sal_uInt16 const nCount) ->>>>>>> other { SET_CURR_SHELL( this ); // #105332# current undo state was not saved -<<<<<<< local - sal_Bool bRet = sal_False; - sal_Bool bSaveDoesUndo = GetDoc()->DoesUndo(); -======= ::sw::UndoGuard const undoGuard(GetDoc()->GetIDocumentUndoRedo()); sal_Bool bRet = sal_False; ->>>>>>> other -<<<<<<< local - GetDoc()->DoUndo( sal_False ); -======= ->>>>>>> other StartAllAction(); { // eigentlich muesste ja nur der aktuelle Cursor berarbeitet @@ -132,14 +119,9 @@ bool SwEditShell::Undo(sal_uInt16 const nCount) // JP 02.04.98: Cursor merken - beim Auto-Format/-Korrektur // soll dieser wieder an die Position -<<<<<<< local - SwUndoId nLastUndoId = GetDoc()->GetUndoIds(NULL, NULL); - sal_Bool bRestoreCrsr = 1 == nCnt && ( UNDO_AUTOFORMAT == nLastUndoId || -======= SwUndoId nLastUndoId(UNDO_EMPTY); GetDoc()->GetIDocumentUndoRedo().GetLastUndoInfo(0, & nLastUndoId); bool bRestoreCrsr = 1 == nCount && (UNDO_AUTOFORMAT == nLastUndoId || ->>>>>>> other UNDO_AUTOCORRECT == nLastUndoId ); Push(); @@ -149,28 +131,6 @@ bool SwEditShell::Undo(sal_uInt16 const nCount) RedlineMode_t eOld = GetDoc()->GetRedlineMode(); -<<<<<<< local - SwUndoIter aUndoIter( GetCrsr(), nUndoId ); - while( nCnt-- ) - { - do { - - bRet = GetDoc()->Undo( aUndoIter ) || bRet; - - if( !aUndoIter.IsNextUndo() ) - break; - - // es geht weiter, also erzeuge einen neuen Cursor wenn - // der alte schon eine Selection hat - // JP 02.04.98: aber nicht wenns ein Autoformat ist - if( !bRestoreCrsr && HasSelection() ) - { - CreateCrsr(); - aUndoIter.pAktPam = GetCrsr(); - } - } while( sal_True ); - } -======= try { for (sal_uInt16 i = 0; i < nCount; ++i) { @@ -182,36 +142,9 @@ bool SwEditShell::Undo(sal_uInt16 const nCount) ::rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8) .getStr()); } ->>>>>>> other Pop( !bRestoreCrsr ); -<<<<<<< local - if( aUndoIter.pSelFmt ) // dann erzeuge eine Rahmen-Selection - { - if( RES_DRAWFRMFMT == aUndoIter.pSelFmt->Which() ) - { - SdrObject* pSObj = aUndoIter.pSelFmt->FindSdrObject(); - ((SwFEShell*)this)->SelectObj( pSObj->GetCurrentBoundRect().Center() ); - } - else - { - Point aPt; - SwFlyFrm* pFly = ((SwFlyFrmFmt*)aUndoIter.pSelFmt)->GetFrm( - &aPt, sal_False ); - if( pFly ) - ((SwFEShell*)this)->SelectFlyFrm( *pFly, sal_True ); - } - } - else if( aUndoIter.pMarkList ) - { - lcl_SelectSdrMarkList( this, aUndoIter.pMarkList ); - } - else if( GetCrsr()->GetNext() != GetCrsr() ) // gehe nach einem - GoNextCrsr(); // Undo zur alten Undo-Position !! - -======= ->>>>>>> other GetDoc()->SetRedlineMode( eOld ); GetDoc()->CompressRedlines(); @@ -220,35 +153,18 @@ bool SwEditShell::Undo(sal_uInt16 const nCount) } EndAllAction(); -<<<<<<< local - // #105332# undo state was not restored but set to sal_False everytime - GetDoc()->DoUndo( bSaveDoesUndo ); -======= ->>>>>>> other return bRet; } -<<<<<<< local -sal_uInt16 SwEditShell::Redo( sal_uInt16 nCnt ) -======= bool SwEditShell::Redo(sal_uInt16 const nCount) ->>>>>>> other { SET_CURR_SHELL( this ); sal_Bool bRet = sal_False; // #105332# undo state was not saved -<<<<<<< local - sal_Bool bSaveDoesUndo = GetDoc()->DoesUndo(); -======= ::sw::UndoGuard const undoGuard(GetDoc()->GetIDocumentUndoRedo()); ->>>>>>> other -<<<<<<< local - GetDoc()->DoUndo( sal_False ); -======= ->>>>>>> other StartAllAction(); { @@ -266,53 +182,6 @@ bool SwEditShell::Redo(sal_uInt16 const nCount) RedlineMode_t eOld = GetDoc()->GetRedlineMode(); -<<<<<<< local - SwUndoIter aUndoIter( GetCrsr(), UNDO_EMPTY ); - while( nCnt-- ) - { - do { - - bRet = GetDoc()->Redo( aUndoIter ) || bRet; - - if( !aUndoIter.IsNextUndo() ) - break; - - // es geht weiter, also erzeugen einen neuen Cursor wenn - // der alte schon eine SSelection hat - if( HasSelection() ) - { - CreateCrsr(); - aUndoIter.pAktPam = GetCrsr(); - } - } while( sal_True ); - } - - if( aUndoIter.IsUpdateAttr() ) - UpdateAttr(); - - if( aUndoIter.pSelFmt ) // dann erzeuge eine Rahmen-Selection - { - if( RES_DRAWFRMFMT == aUndoIter.pSelFmt->Which() ) - { - SdrObject* pSObj = aUndoIter.pSelFmt->FindSdrObject(); - ((SwFEShell*)this)->SelectObj( pSObj->GetCurrentBoundRect().Center() ); - } - else - { - Point aPt; - SwFlyFrm* pFly = ((SwFlyFrmFmt*)aUndoIter.pSelFmt)->GetFrm( - &aPt, sal_False ); - if( pFly ) - ((SwFEShell*)this)->SelectFlyFrm( *pFly, sal_True ); - } - } - else if( aUndoIter.pMarkList ) - { - lcl_SelectSdrMarkList( this, aUndoIter.pMarkList ); - } - else if( GetCrsr()->GetNext() != GetCrsr() ) // gehe nach einem - GoNextCrsr(); // Redo zur alten Undo-Position !! -======= try { for (sal_uInt16 i = 0; i < nCount; ++i) { @@ -324,7 +193,6 @@ bool SwEditShell::Redo(sal_uInt16 const nCount) ::rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8) .getStr()); } ->>>>>>> other GetDoc()->SetRedlineMode( eOld ); GetDoc()->CompressRedlines(); @@ -335,20 +203,11 @@ bool SwEditShell::Redo(sal_uInt16 const nCount) EndAllAction(); -<<<<<<< local - // #105332# undo state was not restored but set sal_False everytime - GetDoc()->DoUndo( bSaveDoesUndo ); -======= ->>>>>>> other return bRet; } -<<<<<<< local -sal_uInt16 SwEditShell::Repeat( sal_uInt16 nCount ) -======= bool SwEditShell::Repeat(sal_uInt16 const nCount) ->>>>>>> other { SET_CURR_SHELL( this ); @@ -369,24 +228,6 @@ bool SwEditShell::Repeat(sal_uInt16 const nCount) return bRet; } -<<<<<<< local - // abfragen/setzen der Anzahl von wiederherstellbaren Undo-Actions - -sal_uInt16 SwEditShell::GetUndoActionCount() -{ - return SwDoc::GetUndoActionCount(); -} - - -void SwEditShell::SetUndoActionCount( sal_uInt16 nNew ) -{ - SwDoc::SetUndoActionCount( nNew ); -} - - - -======= ->>>>>>> other void lcl_SelectSdrMarkList( SwEditShell* pShell, const SdrMarkList* pSdrMarkList ) diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index a25a9442a629..d32db01ee73e 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -1629,7 +1629,7 @@ sal_Bool SwFEShell::EndCreate( sal_uInt16 eSdrCreateCmd ) } sal_Bool bCreate = Imp()->GetDrawView()->EndCreateObj( SdrCreateCmd( eSdrCreateCmd ) ); - GetDoc()->SetNoDrawUndoObj( sal_False ); + GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(true); if ( !bCreate ) { diff --git a/sw/source/core/txtnode/atrflyin.cxx b/sw/source/core/txtnode/atrflyin.cxx index 5f5ac5daeb13..d3076e642ef5 100644 --- a/sw/source/core/txtnode/atrflyin.cxx +++ b/sw/source/core/txtnode/atrflyin.cxx @@ -194,8 +194,8 @@ void SwTxtFlyCnt::SetAnchor( const SwTxtNode *pNode ) ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo()); SwFrmFmt* pNew = pDoc->CopyLayoutFmt( *pFmt, aAnchor, false, false ); - bUndo = pFmt->GetDoc()->DoesUndo(); - pFmt->GetDoc()->DoUndo( sal_False ); + ::sw::UndoGuard const undoGuardFmt( + pFmt->GetDoc()->GetIDocumentUndoRedo()); pFmt->GetDoc()->DelLayoutFmt( pFmt ); ((SwFmtFlyCnt&)GetFlyCnt()).SetFlyFmt( pNew ); } diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index a310460a0739..4b99670b865c 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -754,52 +754,13 @@ sal_Bool SwScanner::NextWord() // #i89042, as discussed with HDU: don't evaluate script changes for word count. Use whole word. if ( nWordType == i18n::WordType::WORD_COUNT ) { -<<<<<<< local - ASSERT( aBound.endPos >= nBegin, "Unexpected aBound result" ) - - // restrict boundaries to script boundaries and nEndPos - const sal_uInt16 nCurrScript = - pBreakIt->GetBreakIter()->getScriptType( rText, nBegin ); - - XubString aTmpWord = rText.Copy( nBegin, static_cast<xub_StrLen>(aBound.endPos - nBegin) ); - const sal_Int32 nScriptEnd = nBegin + - pBreakIt->GetBreakIter()->endOfScript( aTmpWord, 0, nCurrScript ); - const sal_Int32 nEnd = Min( aBound.endPos, nScriptEnd ); - - // restrict word start to last script change position - sal_Int32 nScriptBegin = 0; - if ( aBound.startPos < nBegin ) - { - // search from nBegin backwards until the next script change - aTmpWord = rText.Copy( static_cast<xub_StrLen>(aBound.startPos), - static_cast<xub_StrLen>(nBegin - aBound.startPos + 1) ); - nScriptBegin = aBound.startPos + - pBreakIt->GetBreakIter()->beginOfScript( aTmpWord, nBegin - aBound.startPos, - nCurrScript ); - } - - nBegin = (xub_StrLen)Max( aBound.startPos, nScriptBegin ); - nLen = (xub_StrLen)(nEnd - nBegin); -======= nBegin = Max( static_cast< xub_StrLen >(aBound.startPos), nBegin ); nLen = 0; if (static_cast< xub_StrLen >(aBound.endPos) > nBegin) nLen = static_cast< xub_StrLen >(aBound.endPos) - nBegin; ->>>>>>> other } else { -<<<<<<< local - const sal_uInt16 nCurrScript = - pBreakIt->GetBreakIter()->getScriptType( rText, aBound.startPos ); - XubString aTmpWord = rText.Copy( static_cast<xub_StrLen>(aBound.startPos), - static_cast<xub_StrLen>(aBound.endPos - aBound.startPos) ); - const sal_Int32 nScriptEnd = aBound.startPos + - pBreakIt->GetBreakIter()->endOfScript( aTmpWord, 0, nCurrScript ); - const sal_Int32 nEnd = Min( aBound.endPos, nScriptEnd ); - nBegin = (xub_StrLen)aBound.startPos; - nLen = (xub_StrLen)(nEnd - nBegin); -======= // we have to differenciate between these cases: if ( aBound.startPos <= nBegin ) { @@ -838,7 +799,6 @@ sal_Bool SwScanner::NextWord() nBegin = (xub_StrLen)aBound.startPos; nLen = (xub_StrLen)(nEnd - nBegin); } ->>>>>>> other } // optionally clip the result of getWordBoundaries: diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx index 1398e957cd7f..c395e44dabd2 100644 --- a/sw/source/core/undo/untbl.cxx +++ b/sw/source/core/undo/untbl.cxx @@ -1537,7 +1537,7 @@ void SwUndoTblAutoFmt::UndoImpl(::sw::UndoRedoContext & rContext) void SwUndoTblAutoFmt::RedoImpl(::sw::UndoRedoContext & rContext) { - UndoRedo( sal_False, rUndoIter ); + UndoRedo(false, rContext); } diff --git a/sw/source/ui/ribbar/inputwin.cxx b/sw/source/ui/ribbar/inputwin.cxx index d205e8650f43..fe148ff04841 100755 --- a/sw/source/ui/ribbar/inputwin.cxx +++ b/sw/source/ui/ribbar/inputwin.cxx @@ -255,9 +255,11 @@ void SwInputWindow::ShowWin() SW_MOD()->GetUndoOptions().SetUndoCount(1); } - bDoesUndo = pWrtShell->DoesUndo(); - if( !bDoesUndo ) + m_bDoesUndo = pWrtShell->DoesUndo(); + if( !m_bDoesUndo ) + { pWrtShell->DoUndo( sal_True ); + } if( !pWrtShell->SwCrsrShell::HasSelection() ) { |