summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjp <jp@openoffice.org>2000-10-25 15:02:15 +0000
committerjp <jp@openoffice.org>2000-10-25 15:02:15 +0000
commit66a95767329a43030899a1d12240852c460841b2 (patch)
tree25062cc7cf480d507159f591e872c2f3ecb50412
parentc09fc2c1db5c94c3ef69986549f970e1c03e8067 (diff)
UnoCrsr are allowed to skip into protected/hidden sections
-rw-r--r--sw/inc/unocrsr.hxx27
-rw-r--r--sw/source/core/crsr/swcrsr.cxx36
-rw-r--r--sw/source/core/crsr/unocrsr.cxx13
3 files changed, 57 insertions, 19 deletions
diff --git a/sw/inc/unocrsr.hxx b/sw/inc/unocrsr.hxx
index 558d6644e98e..8e2f621cb744 100644
--- a/sw/inc/unocrsr.hxx
+++ b/sw/inc/unocrsr.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unocrsr.hxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 17:14:29 $
+ * last change: $Author: jp $ $Date: 2000-10-25 16:02:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -61,13 +61,20 @@
#ifndef _UNOCRSR_HXX
#define _UNOCRSR_HXX
-#include "swcrsr.hxx"
-#include "calbck.hxx"
+#ifndef _SWCRSR_HXX
+#include <swcrsr.hxx>
+#endif
+#ifndef _CALBCK_HXX
+#include <calbck.hxx>
+#endif
class SwUnoCrsr : public virtual SwCursor, public SwModify
{
- BOOL bRemainInSection;
+ BOOL bRemainInSection : 1;
+ BOOL bSkipOverHiddenSections : 1;
+ BOOL bSkipOverProtectSections : 1;
+
public:
SwUnoCrsr( const SwPosition &rPos, SwPaM* pRing = 0 );
SwUnoCrsr( SwUnoCrsr& );
@@ -86,6 +93,16 @@ public:
BOOL IsRemainInSection() const { return bRemainInSection; }
void SetRemainInSection( BOOL bFlag ) { bRemainInSection = bFlag; }
+ BOOL IsSkipOverProtectSections() const
+ { return bSkipOverProtectSections; }
+ void SetSkipOverProtectSections( BOOL bFlag )
+ { bSkipOverProtectSections = bFlag; }
+
+ BOOL IskipOverHiddenSections() const
+ { return bSkipOverHiddenSections; }
+ void SetkipOverHiddenSections( BOOL bFlag )
+ { bSkipOverHiddenSections = bFlag; }
+
DECL_FIXEDMEMPOOL_NEWDEL( SwUnoCrsr )
};
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index 8eeaa09fc1b1..2877746a9408 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.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: jp $ $Date: 2000-10-09 11:42:03 $
+ * last change: $Author: jp $ $Date: 2000-10-25 16:01:32 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -90,6 +90,9 @@
#ifndef _SWCRSR_HXX
#include <swcrsr.hxx>
#endif
+#ifndef _UNOCRSR_HXX
+#include <unocrsr.hxx>
+#endif
#ifndef _DOC_HXX
#include <doc.hxx>
#endif
@@ -267,6 +270,19 @@ FASTBOOL SwCursor::IsSelOvr( int eFlags )
SwDoc* pDoc = GetDoc();
SwNodes& rNds = pDoc->GetNodes();
+ BOOL bSkipOverHiddenSections, bSkipOverProtectSections;
+ SwUnoCrsr* pUnoCrsr = *this;
+ if( pUnoCrsr )
+ {
+ bSkipOverHiddenSections = pUnoCrsr->IskipOverHiddenSections();
+ bSkipOverProtectSections = pUnoCrsr->IsSkipOverProtectSections();
+ }
+ else
+ {
+ bSkipOverHiddenSections = TRUE;
+ bSkipOverProtectSections = !IsReadOnlyAvailable();
+ }
+
// Bereiche vom Nodes-Array ueberpruefen
if( (SELOVER_CHECKNODESSECTION & eFlags) && pTblCrsr && HasMark() )
{
@@ -288,9 +304,9 @@ FASTBOOL SwCursor::IsSelOvr( int eFlags )
// teste doch mal die neuen Sections:
SwNodeIndex& rPtIdx = GetPoint()->nNode;
const SwSectionNode* pSectNd = rPtIdx.GetNode().FindSectionNode();
- BOOL bCrsrInReadOnly = IsReadOnlyAvailable();
- if( pSectNd && (pSectNd->GetSection().IsHiddenFlag() ||
- (!bCrsrInReadOnly && pSectNd->GetSection().IsProtectFlag() )))
+ if( pSectNd &&
+ ((bSkipOverHiddenSections && pSectNd->GetSection().IsHiddenFlag() ) ||
+ (bSkipOverProtectSections && pSectNd->GetSection().IsProtectFlag() )))
{
if( 0 == ( SELOVER_CHANGEPOS & eFlags ) )
{
@@ -304,13 +320,13 @@ FASTBOOL SwCursor::IsSelOvr( int eFlags )
xub_StrLen nCntntPos = pSavePos->nCntnt;
int bGoNxt = pSavePos->nNode < rPtIdx.GetIndex();
SwCntntNode* pCNd = bGoNxt
- ? rNds.GoNextSection( &rPtIdx, TRUE, !bCrsrInReadOnly )
- : rNds.GoPrevSection( &rPtIdx, TRUE, !bCrsrInReadOnly );
+ ? rNds.GoNextSection( &rPtIdx, bSkipOverHiddenSections, bSkipOverProtectSections)
+ : rNds.GoPrevSection( &rPtIdx, bSkipOverHiddenSections, bSkipOverProtectSections);
if( !pCNd && ( SELOVER_ENABLEREVDIREKTION & eFlags ))
{
bGoNxt = !bGoNxt;
- pCNd = bGoNxt ? rNds.GoNextSection( &rPtIdx, TRUE, !bCrsrInReadOnly )
- : rNds.GoPrevSection( &rPtIdx, TRUE, !bCrsrInReadOnly );
+ pCNd = bGoNxt ? rNds.GoNextSection( &rPtIdx, bSkipOverHiddenSections, bSkipOverProtectSections)
+ : rNds.GoPrevSection( &rPtIdx, bSkipOverHiddenSections, bSkipOverProtectSections);
}
int bIsValidPos = 0 != pCNd;
@@ -343,7 +359,7 @@ FASTBOOL SwCursor::IsSelOvr( int eFlags )
}
// oder sollte eine geschuetzte Section innerhalb der Selektion liegen?
- if( HasMark() && !bCrsrInReadOnly )
+ if( HasMark() && bSkipOverProtectSections)
{
ULONG nSttIdx = GetMark()->nNode.GetIndex(),
nEndIdx = GetPoint()->nNode.GetIndex();
diff --git a/sw/source/core/crsr/unocrsr.cxx b/sw/source/core/crsr/unocrsr.cxx
index 6b859e4c48f5..e6f3f997698b 100644
--- a/sw/source/core/crsr/unocrsr.cxx
+++ b/sw/source/core/crsr/unocrsr.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unocrsr.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: jp $ $Date: 2000-10-24 17:21:47 $
+ * last change: $Author: jp $ $Date: 2000-10-25 16:01:33 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -90,12 +90,17 @@ IMPL_FIXEDMEMPOOL_NEWDEL( SwUnoCrsr, 10, 10 )
SwUnoCrsr::SwUnoCrsr( const SwPosition &rPos, SwPaM* pRing )
: SwCursor( rPos, pRing ), SwModify( 0 ),
- bRemainInSection( TRUE )
+ bRemainInSection( TRUE ),
+ bSkipOverHiddenSections( TRUE ),
+ bSkipOverProtectSections( FALSE )
+
{}
SwUnoCrsr::SwUnoCrsr( SwUnoCrsr& rICrsr )
: SwCursor( rICrsr ), SwModify( 0 ),
- bRemainInSection( rICrsr.bRemainInSection )
+ bRemainInSection( rICrsr.bRemainInSection ),
+ bSkipOverHiddenSections( rICrsr.bSkipOverHiddenSections ),
+ bSkipOverProtectSections( rICrsr.bSkipOverProtectSections )
{}
SwUnoCrsr::~SwUnoCrsr()