summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjp <jp@openoffice.org>2001-01-15 16:37:37 +0000
committerjp <jp@openoffice.org>2001-01-15 16:37:37 +0000
commitb9264a4ff4b27e39f30574d96f49706e98682733 (patch)
tree572053806e8ab81e058e4762d43f219aae24348b
parente5dfee7337e2cda0ea517a04e6c7ffec1f67cfdc (diff)
IsSelOvr: skip over hidden paragraphs
-rw-r--r--sw/source/core/crsr/swcrsr.cxx43
1 files changed, 36 insertions, 7 deletions
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index c223e4b5feee..2c02cc112cd5 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: swcrsr.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: jp $ $Date: 2000-11-20 16:37:48 $
+ * last change: $Author: jp $ $Date: 2001-01-15 17:37:37 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -400,12 +400,41 @@ FASTBOOL SwCursor::IsSelOvr( int eFlags )
// neu: Bereiche ueberpruefen
const SwNode* pNd = &GetPoint()->nNode.GetNode();
- if( pNd->IsCntntNode() && !((SwCntntNode*)pNd)->GetFrm() &&
- 0 == (SwUnoCrsr*)*this )
+ if( pNd->IsCntntNode() && 0 == (SwUnoCrsr*)*this )
{
- DeleteMark();
- RestoreSavePos();
- return TRUE; // ohne Frames geht gar nichts!
+ const SwCntntFrm* pFrm = ((SwCntntNode*)pNd)->GetFrm();
+ if( pFrm && 0 == pFrm->Frm().Height() &&
+ 0 != ( SELOVER_CHANGEPOS & eFlags ) )
+ {
+ // skip to the next / prev valida paragraph with a layout
+ SwNodeIndex& rPtIdx = GetPoint()->nNode;
+ int bGoNxt = pSavePos->nNode < rPtIdx.GetIndex();
+ while( 0 != ( pFrm = ( bGoNxt ? pFrm->GetNextCntntFrm()
+ : pFrm->GetPrevCntntFrm() )) &&
+ 0 == pFrm->Frm().Height() )
+ ;
+
+ SwCntntNode* pCNd;
+ if( pFrm && 0 != (pCNd = (SwCntntNode*)pFrm->GetNode()) )
+ {
+ // set this cntntNode as new position
+ rPtIdx = *pCNd;
+
+ // ContentIndex noch anmelden:
+ xub_StrLen nTmpPos = bGoNxt ? 0 : pCNd->Len();
+ GetPoint()->nContent.Assign( pCNd, nTmpPos );
+ // sollten wir in einer Tabelle gelandet sein?
+ if( IsInProtectTable( TRUE ) )
+ pFrm = 0;
+ }
+ }
+
+ if( !pFrm )
+ {
+ DeleteMark();
+ RestoreSavePos();
+ return TRUE; // ohne Frames geht gar nichts!
+ }
}
// darf der Cursor in geschuetzen "Nodes" stehen?