diff options
author | jp <jp@openoffice.org> | 2000-11-06 09:50:05 +0000 |
---|---|---|
committer | jp <jp@openoffice.org> | 2000-11-06 09:50:05 +0000 |
commit | e3d7ceaed80bb16b4eb15ad73919978b58300211 (patch) | |
tree | 57bd3515e6649db1f32ccec4fb1d4e1cdcd7df8b /sw/source/core | |
parent | c99cc5ac7d42ba5bb20b4862c7adfaed11a98b60 (diff) |
use new flag from the txtnode for textattribut expansion
Diffstat (limited to 'sw/source/core')
-rw-r--r-- | sw/source/core/doc/docedt.cxx | 12 | ||||
-rw-r--r-- | sw/source/core/undo/unovwr.cxx | 32 |
2 files changed, 38 insertions, 6 deletions
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx index 3cf4ea38dc71..b94b1f33fe7c 100644 --- a/sw/source/core/doc/docedt.cxx +++ b/sw/source/core/doc/docedt.cxx @@ -2,9 +2,9 @@ * * $RCSfile: docedt.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: tl $ $Date: 2000-10-27 11:54:10 $ + * last change: $Author: jp $ $Date: 2000-11-06 10:50:05 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -794,6 +794,9 @@ sal_Bool SwDoc::Overwrite( const SwPaM &rRg, sal_Unicode c ) } else { + BOOL bOldExpFlg = pNode->IsIgnoreDontExpand(); + pNode->SetIgnoreDontExpand( TRUE ); + // hinter das Zeichen (zum aufspannen der Attribute !!) if( nStart < pNode->GetTxt().Len() ) rIdx++; @@ -804,6 +807,7 @@ sal_Bool SwDoc::Overwrite( const SwPaM &rRg, sal_Unicode c ) pNode->Erase( rIdx, 1 ); rIdx++; } + pNode->SetIgnoreDontExpand( bOldExpFlg ); } sal_uInt16 nNewAttrCnt = pNode->GetpSwpHints() @@ -863,6 +867,9 @@ sal_Bool SwDoc::Overwrite( const SwPaM &rRg, const String &rStr ) sal_Unicode c; String aStr; + BOOL bOldExpFlg = pNode->IsIgnoreDontExpand(); + pNode->SetIgnoreDontExpand( TRUE ); + for( xub_StrLen nCnt = 0; nCnt < rStr.Len(); ++nCnt ) { // hinter das Zeichen (zum aufspannen der Attribute !!) @@ -895,6 +902,7 @@ sal_Bool SwDoc::Overwrite( const SwPaM &rRg, const String &rStr ) } } } + pNode->SetIgnoreDontExpand( bOldExpFlg ); sal_uInt16 nNewAttrCnt = pNode->GetpSwpHints() ? pNode->GetpSwpHints()->Count() : 0; diff --git a/sw/source/core/undo/unovwr.cxx b/sw/source/core/undo/unovwr.cxx index 8b469dcfaff6..65699358148f 100644 --- a/sw/source/core/undo/unovwr.cxx +++ b/sw/source/core/undo/unovwr.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unovwr.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: jp $ $Date: 2000-10-26 11:24:24 $ + * last change: $Author: jp $ $Date: 2000-11-06 10:47:36 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -147,6 +147,10 @@ SwUndoOverwrite::SwUndoOverwrite( SwDoc* pDoc, SwPosition& rPos, rPos.nContent++; bInsChar = FALSE; } + + BOOL bOldExpFlg = pTxtNd->IsIgnoreDontExpand(); + pTxtNd->SetIgnoreDontExpand( TRUE ); + pTxtNd->Insert( cIns, rPos.nContent ); aInsStr.Insert( cIns ); @@ -155,7 +159,7 @@ SwUndoOverwrite::SwUndoOverwrite( SwDoc* pDoc, SwPosition& rPos, const SwIndex aTmpIndex( rPos.nContent, -2 ); pTxtNd->Erase( aTmpIndex, 1 ); } - + pTxtNd->SetIgnoreDontExpand( bOldExpFlg ); } SwUndoOverwrite::~SwUndoOverwrite() @@ -219,6 +223,10 @@ BOOL SwUndoOverwrite::CanGrouping( SwDoc* pDoc, SwPosition& rPos, else bInsChar = TRUE; } + + BOOL bOldExpFlg = pDelTxtNd->IsIgnoreDontExpand(); + pDelTxtNd->SetIgnoreDontExpand( TRUE ); + pDelTxtNd->Insert( cIns, rPos.nContent ); aInsStr.Insert( cIns ); @@ -227,6 +235,7 @@ BOOL SwUndoOverwrite::CanGrouping( SwDoc* pDoc, SwPosition& rPos, const SwIndex aTmpIndex( rPos.nContent, -2 ); pDelTxtNd->Erase( aTmpIndex, 1 ); } + pDelTxtNd->SetIgnoreDontExpand( bOldExpFlg ); bGroup = TRUE; return TRUE; @@ -269,6 +278,9 @@ void SwUndoOverwrite::Undo( SwUndoIter& rUndoIter ) String aTmpStr( '1' ); sal_Unicode* pTmpStr = aTmpStr.GetBufferAccess(); + BOOL bOldExpFlg = pTxtNd->IsIgnoreDontExpand(); + pTxtNd->SetIgnoreDontExpand( TRUE ); + rIdx++; for( xub_StrLen n = 0; n < aDelStr.Len(); n++ ) { @@ -279,10 +291,15 @@ void SwUndoOverwrite::Undo( SwUndoIter& rUndoIter ) pTxtNd->Erase( rIdx, 1 ); rIdx += 2; } + pTxtNd->SetIgnoreDontExpand( bOldExpFlg ); rIdx--; } if( pHistory ) + { + if( pTxtNd->GetpSwpHints() ) + pTxtNd->ClearSwpHintsArr( FALSE ); pHistory->TmpRollback( pDoc, 0, FALSE ); + } if( pAktPam->GetMark()->nContent.GetIndex() != nSttCntnt ) { @@ -334,6 +351,9 @@ void SwUndoOverwrite::Redo( SwUndoIter& rUndoIter ) } rIdx.Assign( pTxtNd, aDelStr.Len() ? nSttCntnt+1 : nSttCntnt ); + BOOL bOldExpFlg = pTxtNd->IsIgnoreDontExpand(); + pTxtNd->SetIgnoreDontExpand( TRUE ); + for( xub_StrLen n = 0; n < aInsStr.Len(); n++ ) { // einzeln, damit die Attribute stehen bleiben !!! @@ -345,6 +365,7 @@ void SwUndoOverwrite::Redo( SwUndoIter& rUndoIter ) rIdx += n+1 < aDelStr.Len() ? 2 : 1; } } + pTxtNd->SetIgnoreDontExpand( bOldExpFlg ); // alte Anfangs-Position vom UndoNodes-Array zurueckholen if( pHistory ) @@ -360,11 +381,14 @@ void SwUndoOverwrite::Redo( SwUndoIter& rUndoIter ) Source Code Control System - Header - $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/sw/source/core/undo/unovwr.cxx,v 1.3 2000-10-26 11:24:24 jp Exp $ + $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/sw/source/core/undo/unovwr.cxx,v 1.4 2000-11-06 10:47:36 jp Exp $ Source Code Control System - Update $Log: not supported by cvs2svn $ + Revision 1.3 2000/10/26 11:24:24 jp + for bug #78848#: don't call DeleteRedline + Revision 1.2 2000/10/25 15:13:25 jp use CharClass/BreakIt instead of old WordSelection |