summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjp <jp@openoffice.org>2000-11-28 17:49:16 +0000
committerjp <jp@openoffice.org>2000-11-28 17:49:16 +0000
commitca066d9e5b78a448fcd02df30af8e7aea76fe5a6 (patch)
tree8f2846c2378591cf766317377739e6a30739c5d4
parentf94f90425a5d6097e7b1ceb2fe2ca790f821b96f (diff)
Bug #80312#: OverwriteCursor for CJK
-rw-r--r--sw/inc/extinput.hxx9
-rw-r--r--sw/source/core/crsr/crsrsh.cxx5
-rw-r--r--sw/source/core/crsr/viscrs.cxx34
-rw-r--r--sw/source/core/doc/extinput.cxx8
-rw-r--r--sw/source/ui/wrtsh/select.cxx12
5 files changed, 31 insertions, 37 deletions
diff --git a/sw/inc/extinput.hxx b/sw/inc/extinput.hxx
index 483e02aaa81f..58ee2e66cf93 100644
--- a/sw/inc/extinput.hxx
+++ b/sw/inc/extinput.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: extinput.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: jp $ $Date: 2000-11-15 15:23:45 $
+ * last change: $Author: jp $ $Date: 2000-11-28 18:49:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -75,7 +75,8 @@ class Font;
class SwExtTextInput : public SwPaM
{
SvUShorts aAttrs;
- BOOL bInsText;
+ BOOL bInsText : 1;
+ BOOL bIsOverwriteCursor : 1;
public:
SwExtTextInput( const SwPaM& rPam, Ring* pRing = 0 );
virtual ~SwExtTextInput();
@@ -86,6 +87,8 @@ public:
const SvUShorts& GetAttrs() const { return aAttrs; }
BOOL IsInsText() const { return bInsText; }
void SetInsText( BOOL bFlag ) { bInsText = bFlag; }
+ BOOL IsOverwriteCursor() const { return bIsOverwriteCursor; }
+ void SetOverwriteCursor( BOOL bFlag ) { bIsOverwriteCursor = bFlag; }
};
#endif //_EXTINPUT_HXX
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 57834abf6464..b31c0d3db90e 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: crsrsh.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: jp $ $Date: 2000-11-26 17:02:00 $
+ * last change: $Author: jp $ $Date: 2000-11-28 18:47:46 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1391,6 +1391,7 @@ void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd )
SwCrsrMoveState aTmpState( eMvState );
aTmpState.bSetInReadOnly = IsReadOnlyAvailable();
aTmpState.bRealHeight = !pCurCrsr->HasMark();
+ aTmpState.bRealWidth = IsOverwriteCrsr();
if( !pFrm->GetCharRect( aCharRect, *pCurCrsr->GetPoint(), &aTmpState ) )
{
Point& rPt = pCurCrsr->GetPtPos();
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index f8deaf85363e..f1cd8dcae8d9 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: viscrs.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: jp $ $Date: 2000-11-26 17:02:01 $
+ * last change: $Author: jp $ $Date: 2000-11-28 18:47:46 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -510,38 +510,20 @@ FASTBOOL SwVisCrsr::ChgTimerFlag( BOOL bFlag )
void SwVisCrsr::_SetPosAndShow()
{
SwRect aRect( pCrsrShell->aCharRect.Pos(),
- Size( 1, pCrsrShell->aCrsrHeight.Y() ) );
+ Size( pCrsrShell->aCharRect.Width(),
+ pCrsrShell->aCrsrHeight.Y() ) );
aRect.Pos().Y() += pCrsrShell->aCrsrHeight.X();
if( aRect.Height() )
{
::SwCalcPixStatics( pCrsrShell->GetOut() );
::SwAlignRect( aRect, (ViewShell*)pCrsrShell );
}
- long nWidth = 0;
- if( pCrsrShell->IsOverwriteCrsr() )
- {
- // calculate the with of the current character
- const SwPosition& rPos = *pCrsrShell->GetCrsr()->GetPoint();
- const SwTxtNode* pTNd = rPos.nNode.GetNode().GetTxtNode();
- SwCntntFrm *pFrm;
- Point aPt( aRect.Pos() );
- if( pTNd && rPos.nContent.GetIndex() < pTNd->GetTxt().Len() &&
- 0 != ( pFrm = pTNd->GetFrm( &aPt, &rPos )) )
- {
- SwPosition aPos( rPos );
- aPos.nContent++;
- SwRect aTmpRect;
- SwCrsrMoveState aTmpState( MV_SETONLYTEXT/*MV_RIGHTMARGIN*/ );
- pFrm->GetCharRect( aTmpRect, aPos, &aTmpState );
- nWidth = aTmpRect.Pos().X() - aRect.Pos().X();
- if( 0 >= nWidth )
- nWidth = 0;
- }
- }
-
- aRect.Width( nWidth );
+ if( !pCrsrShell->IsOverwriteCrsr() || bIsDragCrsr ||
+ pCrsrShell->IsSelection() )
+ aRect.Width( 0 );
aTxtCrsr.SetSize( aRect.SSize() );
+
aTxtCrsr.SetPos( aRect.Pos() );
if ( !pCrsrShell->IsCrsrReadonly() )
{
diff --git a/sw/source/core/doc/extinput.cxx b/sw/source/core/doc/extinput.cxx
index 6d1fc84276c5..586f6eae516c 100644
--- a/sw/source/core/doc/extinput.cxx
+++ b/sw/source/core/doc/extinput.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: extinput.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: jp $ $Date: 2000-11-15 15:23:11 $
+ * last change: $Author: jp $ $Date: 2000-11-28 18:48:35 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -96,8 +96,10 @@
SwExtTextInput::SwExtTextInput( const SwPaM& rPam, Ring* pRing )
- : SwPaM( *rPam.GetPoint(), (SwPaM*)pRing ), bInsText( TRUE )
+ : SwPaM( *rPam.GetPoint(), (SwPaM*)pRing )
{
+ bIsOverwriteCursor = FALSE;
+ bInsText = TRUE;
}
SwExtTextInput::~SwExtTextInput()
diff --git a/sw/source/ui/wrtsh/select.cxx b/sw/source/ui/wrtsh/select.cxx
index 477bdc8249af..443a8b3f646a 100644
--- a/sw/source/ui/wrtsh/select.cxx
+++ b/sw/source/ui/wrtsh/select.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: select.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: os $ $Date: 2000-11-21 08:49:57 $
+ * last change: $Author: jp $ $Date: 2000-11-28 18:46:55 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -639,8 +639,11 @@ void SwWrtShell::LeaveAddMode()
void SwWrtShell::SetInsMode( BOOL bOn )
{
bIns = bOn;
+ SwCrsrShell::SetOverwriteCrsr( !bIns );
const SfxBoolItem aTmp( SID_ATTR_INSERT, bIns );
GetView().GetViewFrame()->GetBindings().SetState( aTmp );
+ StartAction();
+ EndAction();
}
/*
@@ -963,11 +966,14 @@ long SwWrtShell::MoveText(const Point *pPt,BOOL)
Source Code Control System - Header
- $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/sw/source/ui/wrtsh/select.cxx,v 1.4 2000-11-21 08:49:57 os Exp $
+ $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/sw/source/ui/wrtsh/select.cxx,v 1.5 2000-11-28 18:46:55 jp Exp $
Source Code Control System - Update
$Log: not supported by cvs2svn $
+ Revision 1.4 2000/11/21 08:49:57 os
+ #80521# prevent creation of illegal strings
+
Revision 1.3 2000/11/20 09:25:03 jp
must change: SearchText->TextSearch and use namespace