From 0de1753c64307b8d0d99b51eaf823941d82a659b Mon Sep 17 00:00:00 2001 From: "cmanske%netscape.com" Date: Mon, 27 Jul 1998 02:01:51 +0000 Subject: [PATCH] Added detection of element clicked on to determine text format to use git-svn-id: svn://10.0.0.236/trunk@6506 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/lib/layout/edtbuf.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mozilla/lib/layout/edtbuf.cpp b/mozilla/lib/layout/edtbuf.cpp index 209ab92c313..31244f7297d 100644 --- a/mozilla/lib/layout/edtbuf.cpp +++ b/mozilla/lib/layout/edtbuf.cpp @@ -11044,7 +11044,6 @@ void CEditBuffer::DeleteSelectionAndPositionCaret( int32 x, int32 y ) // this routine is called when the mouse goes down. void CEditBuffer::StartSelection( int32 x, int32 y, XP_Bool doubleClick ){ VALIDATE_TREE(this); - m_bUseCurrentTextFormat = FALSE; ClearPhantomInsertPoint(); { // This is a hack to avoid auto-scrolling to the old selection. @@ -11076,6 +11075,10 @@ void CEditBuffer::StartSelection( int32 x, int32 y, XP_Bool doubleClick ){ LO_Click( m_pContext, x, y, FALSE ); #endif /* LAYERS */ } + CEditElement *pPrev; + // If we set caret at beginning of a text element, + // use its formating with next text typed + m_bUseCurrentTextFormat = (m_pCurrent && m_pCurrent->IsText() && m_iCurrentOffset == 0 ) ? TRUE : FALSE; } // Note: By using MoveAndHideCaretInTable, @@ -11221,7 +11224,9 @@ void CEditBuffer::SelectObject( int32 x, int32 y ){ #else LO_SelectObject(m_pContext, x, y); #endif - m_bUseCurrentTextFormat = FALSE; + // If we set caret at beginning of a text element, + // use its formating with next text typed + m_bUseCurrentTextFormat = (m_pCurrent && m_pCurrent->IsText() && m_iCurrentOffset == 0 ) ? TRUE : FALSE; } //