convert GETCRSR constants to o3tl::typed_flags
Change-Id: Ia367d9a1b73d6c5b7a7989da45af0f002c43413c
This commit is contained in:
@@ -958,7 +958,7 @@ bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditView, v
|
|||||||
bool bAllowIdle = true;
|
bool bAllowIdle = true;
|
||||||
bool bReadOnly = pEditView->IsReadOnly();
|
bool bReadOnly = pEditView->IsReadOnly();
|
||||||
|
|
||||||
sal_uInt16 nNewCursorFlags = 0;
|
GetCursorFlags nNewCursorFlags = GetCursorFlags::NONE;
|
||||||
bool bSetCursorFlags = true;
|
bool bSetCursorFlags = true;
|
||||||
|
|
||||||
EditSelection aCurSel( pEditView->pImpEditView->GetEditSelection() );
|
EditSelection aCurSel( pEditView->pImpEditView->GetEditSelection() );
|
||||||
@@ -1091,9 +1091,9 @@ bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditView, v
|
|||||||
|
|
||||||
bMoved = true;
|
bMoved = true;
|
||||||
if ( nCode == KEY_HOME )
|
if ( nCode == KEY_HOME )
|
||||||
nNewCursorFlags |= GETCRSR_STARTOFLINE;
|
nNewCursorFlags |= GetCursorFlags::StartOfLine;
|
||||||
else if ( nCode == KEY_END )
|
else if ( nCode == KEY_END )
|
||||||
nNewCursorFlags |= GETCRSR_ENDOFLINE;
|
nNewCursorFlags |= GetCursorFlags::EndOfLine;
|
||||||
|
|
||||||
}
|
}
|
||||||
#if OSL_DEBUG_LEVEL > 1
|
#if OSL_DEBUG_LEVEL > 1
|
||||||
@@ -2367,8 +2367,8 @@ Rectangle EditEngine::GetCharacterBounds( const EPosition& rPos ) const
|
|||||||
// Check against index, not paragraph
|
// Check against index, not paragraph
|
||||||
if ( pNode && ( rPos.nIndex < pNode->Len() ) )
|
if ( pNode && ( rPos.nIndex < pNode->Len() ) )
|
||||||
{
|
{
|
||||||
aBounds = pImpEditEngine->PaMtoEditCursor( EditPaM( pNode, rPos.nIndex ), GETCRSR_TXTONLY );
|
aBounds = pImpEditEngine->PaMtoEditCursor( EditPaM( pNode, rPos.nIndex ), GetCursorFlags::TextOnly );
|
||||||
Rectangle aR2 = pImpEditEngine->PaMtoEditCursor( EditPaM( pNode, rPos.nIndex+1 ), GETCRSR_TXTONLY|GETCRSR_ENDOFLINE );
|
Rectangle aR2 = pImpEditEngine->PaMtoEditCursor( EditPaM( pNode, rPos.nIndex+1 ), GetCursorFlags::TextOnly|GetCursorFlags::EndOfLine );
|
||||||
if ( aR2.Right() > aBounds.Right() )
|
if ( aR2.Right() > aBounds.Right() )
|
||||||
aBounds.Right() = aR2.Right();
|
aBounds.Right() = aR2.Right();
|
||||||
}
|
}
|
||||||
|
@@ -971,7 +971,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link<SpellCallbackInfo
|
|||||||
|
|
||||||
aPopupMenu->RemoveDisabledEntries( true, true );
|
aPopupMenu->RemoveDisabledEntries( true, true );
|
||||||
|
|
||||||
Rectangle aTempRect = pImpEditView->pEditEngine->pImpEditEngine->PaMtoEditCursor( aPaM, GETCRSR_TXTONLY );
|
Rectangle aTempRect = pImpEditView->pEditEngine->pImpEditEngine->PaMtoEditCursor( aPaM, GetCursorFlags::TextOnly );
|
||||||
Point aScreenPos = pImpEditView->GetWindowPos( aTempRect.TopLeft() );
|
Point aScreenPos = pImpEditView->GetWindowPos( aTempRect.TopLeft() );
|
||||||
aScreenPos = pImpEditView->GetWindow()->OutputToScreenPixel( aScreenPos );
|
aScreenPos = pImpEditView->GetWindow()->OutputToScreenPixel( aScreenPos );
|
||||||
aTempRect = pImpEditView->GetWindow()->LogicToPixel( Rectangle(aScreenPos, aTempRect.GetSize() ));
|
aTempRect = pImpEditView->GetWindow()->LogicToPixel( Rectangle(aScreenPos, aTempRect.GetSize() ));
|
||||||
|
@@ -82,7 +82,7 @@ ImpEditView::ImpEditView( EditView* pView, EditEngine* pEng, vcl::Window* pWindo
|
|||||||
mpViewShell = nullptr;
|
mpViewShell = nullptr;
|
||||||
mpOtherShell = nullptr;
|
mpOtherShell = nullptr;
|
||||||
nScrollDiffX = 0;
|
nScrollDiffX = 0;
|
||||||
nExtraCursorFlags = 0;
|
nExtraCursorFlags = GetCursorFlags::NONE;
|
||||||
nCursorBidiLevel = CURSOR_BIDILEVEL_DONTKNOW;
|
nCursorBidiLevel = CURSOR_BIDILEVEL_DONTKNOW;
|
||||||
pCursor = nullptr;
|
pCursor = nullptr;
|
||||||
pDragAndDropInfo = nullptr;
|
pDragAndDropInfo = nullptr;
|
||||||
@@ -816,7 +816,7 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor )
|
|||||||
|
|
||||||
const ParaPortion* pParaPortion = pEditEngine->GetParaPortions()[nPara];
|
const ParaPortion* pParaPortion = pEditEngine->GetParaPortions()[nPara];
|
||||||
|
|
||||||
sal_uInt16 nShowCursorFlags = nExtraCursorFlags | GETCRSR_TXTONLY;
|
GetCursorFlags nShowCursorFlags = nExtraCursorFlags | GetCursorFlags::TextOnly;
|
||||||
|
|
||||||
// Use CursorBidiLevel 0/1 in meaning of
|
// Use CursorBidiLevel 0/1 in meaning of
|
||||||
// 0: prefer portion end, normal mode
|
// 0: prefer portion end, normal mode
|
||||||
@@ -824,7 +824,7 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor )
|
|||||||
|
|
||||||
if ( ( GetCursorBidiLevel() != CURSOR_BIDILEVEL_DONTKNOW ) && GetCursorBidiLevel() )
|
if ( ( GetCursorBidiLevel() != CURSOR_BIDILEVEL_DONTKNOW ) && GetCursorBidiLevel() )
|
||||||
{
|
{
|
||||||
nShowCursorFlags |= GETCRSR_PREFERPORTIONSTART;
|
nShowCursorFlags |= GetCursorFlags::PreferPortionStart;
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle aEditCursor = pEditEngine->pImpEditEngine->PaMtoEditCursor( aPaM, nShowCursorFlags );
|
Rectangle aEditCursor = pEditEngine->pImpEditEngine->PaMtoEditCursor( aPaM, nShowCursorFlags );
|
||||||
@@ -833,7 +833,7 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor )
|
|||||||
if ( aPaM.GetNode()->Len() && ( aPaM.GetIndex() < aPaM.GetNode()->Len() ) )
|
if ( aPaM.GetNode()->Len() && ( aPaM.GetIndex() < aPaM.GetNode()->Len() ) )
|
||||||
{
|
{
|
||||||
// If we are behind a portion, and the next portion has other direction, we must change position...
|
// If we are behind a portion, and the next portion has other direction, we must change position...
|
||||||
aEditCursor.Left() = aEditCursor.Right() = pEditEngine->pImpEditEngine->PaMtoEditCursor( aPaM, GETCRSR_TXTONLY|GETCRSR_PREFERPORTIONSTART ).Left();
|
aEditCursor.Left() = aEditCursor.Right() = pEditEngine->pImpEditEngine->PaMtoEditCursor( aPaM, GetCursorFlags::TextOnly|GetCursorFlags::PreferPortionStart ).Left();
|
||||||
|
|
||||||
sal_Int32 nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nTextPortionStart, true );
|
sal_Int32 nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nTextPortionStart, true );
|
||||||
const TextPortion& rTextPortion = pParaPortion->GetTextPortions()[nTextPortion];
|
const TextPortion& rTextPortion = pParaPortion->GetTextPortions()[nTextPortion];
|
||||||
@@ -844,9 +844,9 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor )
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
EditPaM aNext = pEditEngine->CursorRight( aPaM );
|
EditPaM aNext = pEditEngine->CursorRight( aPaM );
|
||||||
Rectangle aTmpRect = pEditEngine->pImpEditEngine->PaMtoEditCursor( aNext, GETCRSR_TXTONLY );
|
Rectangle aTmpRect = pEditEngine->pImpEditEngine->PaMtoEditCursor( aNext, GetCursorFlags::TextOnly );
|
||||||
if ( aTmpRect.Top() != aEditCursor.Top() )
|
if ( aTmpRect.Top() != aEditCursor.Top() )
|
||||||
aTmpRect = pEditEngine->pImpEditEngine->PaMtoEditCursor( aNext, GETCRSR_TXTONLY|GETCRSR_ENDOFLINE );
|
aTmpRect = pEditEngine->pImpEditEngine->PaMtoEditCursor( aNext, GetCursorFlags::TextOnly|GetCursorFlags::EndOfLine );
|
||||||
aEditCursor.Right() = aTmpRect.Left();
|
aEditCursor.Right() = aTmpRect.Left();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1036,7 +1036,7 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor )
|
|||||||
CursorDirection nCursorDir = CursorDirection::NONE;
|
CursorDirection nCursorDir = CursorDirection::NONE;
|
||||||
if ( IsInsertMode() && !aEditSelection.HasRange() && ( pEditEngine->pImpEditEngine->HasDifferentRTLLevels( aPaM.GetNode() ) ) )
|
if ( IsInsertMode() && !aEditSelection.HasRange() && ( pEditEngine->pImpEditEngine->HasDifferentRTLLevels( aPaM.GetNode() ) ) )
|
||||||
{
|
{
|
||||||
sal_uInt16 nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nTextPortionStart, (nShowCursorFlags & GETCRSR_PREFERPORTIONSTART) != 0 );
|
sal_uInt16 nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nTextPortionStart, bool(nShowCursorFlags & GetCursorFlags::PreferPortionStart) );
|
||||||
const TextPortion& rTextPortion = pParaPortion->GetTextPortions()[nTextPortion];
|
const TextPortion& rTextPortion = pParaPortion->GetTextPortions()[nTextPortion];
|
||||||
if (rTextPortion.IsRightToLeft())
|
if (rTextPortion.IsRightToLeft())
|
||||||
nCursorDir = CursorDirection::RTL;
|
nCursorDir = CursorDirection::RTL;
|
||||||
@@ -1237,7 +1237,7 @@ bool ImpEditView::MouseButtonUp( const MouseEvent& rMouseEvent )
|
|||||||
}
|
}
|
||||||
nTravelXPos = TRAVEL_X_DONTKNOW;
|
nTravelXPos = TRAVEL_X_DONTKNOW;
|
||||||
nCursorBidiLevel = CURSOR_BIDILEVEL_DONTKNOW;
|
nCursorBidiLevel = CURSOR_BIDILEVEL_DONTKNOW;
|
||||||
nExtraCursorFlags = 0;
|
nExtraCursorFlags = GetCursorFlags::NONE;
|
||||||
bClickedInSelection = false;
|
bClickedInSelection = false;
|
||||||
|
|
||||||
if ( rMouseEvent.IsMiddle() && !bReadOnly &&
|
if ( rMouseEvent.IsMiddle() && !bReadOnly &&
|
||||||
@@ -1265,8 +1265,8 @@ bool ImpEditView::MouseButtonDown( const MouseEvent& rMouseEvent )
|
|||||||
pEditEngine->CheckIdleFormatter(); // If fast typing and mouse button downs
|
pEditEngine->CheckIdleFormatter(); // If fast typing and mouse button downs
|
||||||
if ( pEditEngine->GetInternalEditStatus().NotifyCursorMovements() )
|
if ( pEditEngine->GetInternalEditStatus().NotifyCursorMovements() )
|
||||||
pEditEngine->GetInternalEditStatus().GetPrevParagraph() = pEditEngine->GetEditDoc().GetPos( GetEditSelection().Max().GetNode() );
|
pEditEngine->GetInternalEditStatus().GetPrevParagraph() = pEditEngine->GetEditDoc().GetPos( GetEditSelection().Max().GetNode() );
|
||||||
nTravelXPos = TRAVEL_X_DONTKNOW;
|
nTravelXPos = TRAVEL_X_DONTKNOW;
|
||||||
nExtraCursorFlags = 0;
|
nExtraCursorFlags = GetCursorFlags::NONE;
|
||||||
nCursorBidiLevel = CURSOR_BIDILEVEL_DONTKNOW;
|
nCursorBidiLevel = CURSOR_BIDILEVEL_DONTKNOW;
|
||||||
bClickedInSelection = IsSelectionAtPoint( rMouseEvent.GetPosPixel() );
|
bClickedInSelection = IsSelectionAtPoint( rMouseEvent.GetPosPixel() );
|
||||||
return pEditEngine->pImpEditEngine->MouseButtonDown( rMouseEvent, GetEditViewPtr() );
|
return pEditEngine->pImpEditEngine->MouseButtonDown( rMouseEvent, GetEditViewPtr() );
|
||||||
|
@@ -56,23 +56,11 @@
|
|||||||
#include <i18nlangtag/lang.h>
|
#include <i18nlangtag/lang.h>
|
||||||
#include <rtl/ref.hxx>
|
#include <rtl/ref.hxx>
|
||||||
#include <LibreOfficeKit/LibreOfficeKitTypes.h>
|
#include <LibreOfficeKit/LibreOfficeKitTypes.h>
|
||||||
|
#include <o3tl/typed_flags_set.hxx>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#define DEL_LEFT 1
|
|
||||||
#define DEL_RIGHT 2
|
|
||||||
#define TRAVEL_X_DONTKNOW 0xFFFFFFFF
|
|
||||||
#define CURSOR_BIDILEVEL_DONTKNOW 0xFFFF
|
|
||||||
#define MAXCHARSINPARA 0x3FFF-CHARPOSGROW // Max 16K, because WYSIWYG array
|
|
||||||
|
|
||||||
#define GETCRSR_TXTONLY 0x0001
|
|
||||||
#define GETCRSR_STARTOFLINE 0x0002
|
|
||||||
#define GETCRSR_ENDOFLINE 0x0004
|
|
||||||
#define GETCRSR_PREFERPORTIONSTART 0x0008
|
|
||||||
|
|
||||||
#define LINE_SEP '\x0A'
|
|
||||||
|
|
||||||
class EditView;
|
class EditView;
|
||||||
class EditEngine;
|
class EditEngine;
|
||||||
class OutlinerSearchable;
|
class OutlinerSearchable;
|
||||||
@@ -103,6 +91,28 @@ namespace editeng {
|
|||||||
struct MisspellRanges;
|
struct MisspellRanges;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define DEL_LEFT 1
|
||||||
|
#define DEL_RIGHT 2
|
||||||
|
#define TRAVEL_X_DONTKNOW 0xFFFFFFFF
|
||||||
|
#define CURSOR_BIDILEVEL_DONTKNOW 0xFFFF
|
||||||
|
#define MAXCHARSINPARA 0x3FFF-CHARPOSGROW // Max 16K, because WYSIWYG array
|
||||||
|
#define LINE_SEP '\x0A'
|
||||||
|
|
||||||
|
#define ATTRSPECIAL_WHOLEWORD 1
|
||||||
|
#define ATTRSPECIAL_EDGE 2
|
||||||
|
|
||||||
|
enum class GetCursorFlags {
|
||||||
|
NONE = 0x0000,
|
||||||
|
TextOnly = 0x0001,
|
||||||
|
StartOfLine = 0x0002,
|
||||||
|
EndOfLine = 0x0004,
|
||||||
|
PreferPortionStart = 0x0008,
|
||||||
|
};
|
||||||
|
namespace o3tl {
|
||||||
|
template<> struct typed_flags<GetCursorFlags> : is_typed_flags<GetCursorFlags, 0x0f> {};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
struct DragAndDropInfo
|
struct DragAndDropInfo
|
||||||
{
|
{
|
||||||
Rectangle aCurCursor;
|
Rectangle aCurCursor;
|
||||||
@@ -234,7 +244,7 @@ private:
|
|||||||
long nInvMore;
|
long nInvMore;
|
||||||
EVControlBits nControl;
|
EVControlBits nControl;
|
||||||
sal_uInt32 nTravelXPos;
|
sal_uInt32 nTravelXPos;
|
||||||
sal_uInt16 nExtraCursorFlags;
|
GetCursorFlags nExtraCursorFlags;
|
||||||
sal_uInt16 nCursorBidiLevel;
|
sal_uInt16 nCursorBidiLevel;
|
||||||
sal_uInt16 nScrollDiffX;
|
sal_uInt16 nScrollDiffX;
|
||||||
bool bReadOnly;
|
bool bReadOnly;
|
||||||
@@ -829,8 +839,8 @@ public:
|
|||||||
bool HasParaAttrib( sal_Int32 nPara, sal_uInt16 nWhich ) const;
|
bool HasParaAttrib( sal_Int32 nPara, sal_uInt16 nWhich ) const;
|
||||||
const SfxPoolItem& GetParaAttrib( sal_Int32 nPara, sal_uInt16 nWhich ) const;
|
const SfxPoolItem& GetParaAttrib( sal_Int32 nPara, sal_uInt16 nWhich ) const;
|
||||||
|
|
||||||
Rectangle PaMtoEditCursor( EditPaM aPaM, sal_uInt16 nFlags = 0 );
|
Rectangle PaMtoEditCursor( EditPaM aPaM, GetCursorFlags nFlags = GetCursorFlags::NONE );
|
||||||
Rectangle GetEditCursor( ParaPortion* pPortion, sal_Int32 nIndex, sal_uInt16 nFlags = 0 );
|
Rectangle GetEditCursor( ParaPortion* pPortion, sal_Int32 nIndex, GetCursorFlags nFlags = GetCursorFlags::NONE );
|
||||||
|
|
||||||
bool IsModified() const { return aEditDoc.IsModified(); }
|
bool IsModified() const { return aEditDoc.IsModified(); }
|
||||||
void SetModifyFlag( bool b ) { aEditDoc.SetModified( b ); }
|
void SetModifyFlag( bool b ) { aEditDoc.SetModified( b ); }
|
||||||
|
@@ -490,7 +490,7 @@ void ImpEditEngine::Command( const CommandEvent& rCEvt, EditView* pView )
|
|||||||
const EditLine& rLine = pParaPortion->GetLines()[nLine];
|
const EditLine& rLine = pParaPortion->GetLines()[nLine];
|
||||||
if ( nInputEnd > rLine.GetEnd() )
|
if ( nInputEnd > rLine.GetEnd() )
|
||||||
nInputEnd = rLine.GetEnd();
|
nInputEnd = rLine.GetEnd();
|
||||||
Rectangle aR2 = PaMtoEditCursor( EditPaM( aPaM.GetNode(), nInputEnd ), GETCRSR_ENDOFLINE );
|
Rectangle aR2 = PaMtoEditCursor( EditPaM( aPaM.GetNode(), nInputEnd ), GetCursorFlags::EndOfLine );
|
||||||
Rectangle aRect = pView->GetImpEditView()->GetWindowPos( aR1 );
|
Rectangle aRect = pView->GetImpEditView()->GetWindowPos( aR1 );
|
||||||
pView->GetWindow()->SetCursorRect( &aRect, aR2.Left()-aR1.Right() );
|
pView->GetWindow()->SetCursorRect( &aRect, aR2.Left()-aR1.Right() );
|
||||||
}
|
}
|
||||||
@@ -924,7 +924,7 @@ EditPaM ImpEditEngine::CursorVisualStartEnd( EditView* pEditView, const EditPaM&
|
|||||||
const EditLine& rLine = pParaPortion->GetLines()[nLine];
|
const EditLine& rLine = pParaPortion->GetLines()[nLine];
|
||||||
bool bEmptyLine = rLine.GetStart() == rLine.GetEnd();
|
bool bEmptyLine = rLine.GetStart() == rLine.GetEnd();
|
||||||
|
|
||||||
pEditView->pImpEditView->nExtraCursorFlags = 0;
|
pEditView->pImpEditView->nExtraCursorFlags = GetCursorFlags::NONE;
|
||||||
|
|
||||||
if ( !bEmptyLine )
|
if ( !bEmptyLine )
|
||||||
{
|
{
|
||||||
@@ -979,7 +979,7 @@ EditPaM ImpEditEngine::CursorVisualLeftRight( EditView* pEditView, const EditPaM
|
|||||||
const EditLine& rLine = pParaPortion->GetLines()[nLine];
|
const EditLine& rLine = pParaPortion->GetLines()[nLine];
|
||||||
bool bEmptyLine = rLine.GetStart() == rLine.GetEnd();
|
bool bEmptyLine = rLine.GetStart() == rLine.GetEnd();
|
||||||
|
|
||||||
pEditView->pImpEditView->nExtraCursorFlags = 0;
|
pEditView->pImpEditView->nExtraCursorFlags = GetCursorFlags::NONE;
|
||||||
|
|
||||||
bool bParaRTL = IsRightToLeft( nPara );
|
bool bParaRTL = IsRightToLeft( nPara );
|
||||||
|
|
||||||
@@ -2972,7 +2972,7 @@ EditPaM ImpEditEngine::InsertLineBreak(const EditSelection& aCurSel)
|
|||||||
|
|
||||||
// Helper functions
|
// Helper functions
|
||||||
|
|
||||||
Rectangle ImpEditEngine::PaMtoEditCursor( EditPaM aPaM, sal_uInt16 nFlags )
|
Rectangle ImpEditEngine::PaMtoEditCursor( EditPaM aPaM, GetCursorFlags nFlags )
|
||||||
{
|
{
|
||||||
OSL_ENSURE( GetUpdateMode(), "Must not be reached when Update=FALSE: PaMtoEditCursor" );
|
OSL_ENSURE( GetUpdateMode(), "Must not be reached when Update=FALSE: PaMtoEditCursor" );
|
||||||
|
|
||||||
@@ -4113,13 +4113,13 @@ void ImpEditEngine::CalcHeight( ParaPortion* pPortion )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle ImpEditEngine::GetEditCursor( ParaPortion* pPortion, sal_Int32 nIndex, sal_uInt16 nFlags )
|
Rectangle ImpEditEngine::GetEditCursor( ParaPortion* pPortion, sal_Int32 nIndex, GetCursorFlags nFlags )
|
||||||
{
|
{
|
||||||
OSL_ENSURE( pPortion->IsVisible(), "Why GetEditCursor() for an invisible paragraph?" );
|
OSL_ENSURE( pPortion->IsVisible(), "Why GetEditCursor() for an invisible paragraph?" );
|
||||||
OSL_ENSURE( IsFormatted() || GetTextRanger(), "GetEditCursor: Not formatted" );
|
OSL_ENSURE( IsFormatted() || GetTextRanger(), "GetEditCursor: Not formatted" );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
GETCRSR_ENDOFLINE: If after the last character of a wrapped line, remaining
|
GetCursorFlags::EndOfLine: If after the last character of a wrapped line, remaining
|
||||||
at the end of the line, not the beginning of the next one.
|
at the end of the line, not the beginning of the next one.
|
||||||
Purpose: - END => really after the last character
|
Purpose: - END => really after the last character
|
||||||
- Selection....
|
- Selection....
|
||||||
@@ -4137,7 +4137,7 @@ Rectangle ImpEditEngine::GetEditCursor( ParaPortion* pPortion, sal_Int32 nIndex,
|
|||||||
if (nLineCount == 0)
|
if (nLineCount == 0)
|
||||||
return Rectangle();
|
return Rectangle();
|
||||||
const EditLine* pLine = nullptr;
|
const EditLine* pLine = nullptr;
|
||||||
bool bEOL = ( nFlags & GETCRSR_ENDOFLINE ) != 0;
|
bool bEOL( nFlags & GetCursorFlags::EndOfLine );
|
||||||
for (sal_Int32 nLine = 0; nLine < nLineCount; ++nLine)
|
for (sal_Int32 nLine = 0; nLine < nLineCount; ++nLine)
|
||||||
{
|
{
|
||||||
const EditLine& rTmpLine = pPortion->GetLines()[nLine];
|
const EditLine& rTmpLine = pPortion->GetLines()[nLine];
|
||||||
@@ -4172,24 +4172,24 @@ Rectangle ImpEditEngine::GetEditCursor( ParaPortion* pPortion, sal_Int32 nIndex,
|
|||||||
// Search within the line...
|
// Search within the line...
|
||||||
long nX;
|
long nX;
|
||||||
|
|
||||||
if ( ( nIndex == pLine->GetStart() ) && ( nFlags & GETCRSR_STARTOFLINE ) )
|
if ( ( nIndex == pLine->GetStart() ) && ( nFlags & GetCursorFlags::StartOfLine ) )
|
||||||
{
|
{
|
||||||
Range aXRange = GetLineXPosStartEnd( pPortion, pLine );
|
Range aXRange = GetLineXPosStartEnd( pPortion, pLine );
|
||||||
nX = !IsRightToLeft( GetEditDoc().GetPos( pPortion->GetNode() ) ) ? aXRange.Min() : aXRange.Max();
|
nX = !IsRightToLeft( GetEditDoc().GetPos( pPortion->GetNode() ) ) ? aXRange.Min() : aXRange.Max();
|
||||||
}
|
}
|
||||||
else if ( ( nIndex == pLine->GetEnd() ) && ( nFlags & GETCRSR_ENDOFLINE ) )
|
else if ( ( nIndex == pLine->GetEnd() ) && ( nFlags & GetCursorFlags::EndOfLine ) )
|
||||||
{
|
{
|
||||||
Range aXRange = GetLineXPosStartEnd( pPortion, pLine );
|
Range aXRange = GetLineXPosStartEnd( pPortion, pLine );
|
||||||
nX = !IsRightToLeft( GetEditDoc().GetPos( pPortion->GetNode() ) ) ? aXRange.Max() : aXRange.Min();
|
nX = !IsRightToLeft( GetEditDoc().GetPos( pPortion->GetNode() ) ) ? aXRange.Max() : aXRange.Min();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
nX = GetXPos( pPortion, pLine, nIndex, ( nFlags & GETCRSR_PREFERPORTIONSTART ) != 0 );
|
nX = GetXPos( pPortion, pLine, nIndex, bool( nFlags & GetCursorFlags::PreferPortionStart ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
aEditCursor.Left() = aEditCursor.Right() = nX;
|
aEditCursor.Left() = aEditCursor.Right() = nX;
|
||||||
|
|
||||||
if ( nFlags & GETCRSR_TXTONLY )
|
if ( nFlags & GetCursorFlags::TextOnly )
|
||||||
aEditCursor.Top() = aEditCursor.Bottom() - pLine->GetTxtHeight() + 1;
|
aEditCursor.Top() = aEditCursor.Bottom() - pLine->GetTxtHeight() + 1;
|
||||||
else
|
else
|
||||||
aEditCursor.Top() = aEditCursor.Bottom() - std::min( pLine->GetTxtHeight(), pLine->GetHeight() ) + 1;
|
aEditCursor.Top() = aEditCursor.Bottom() - std::min( pLine->GetTxtHeight(), pLine->GetHeight() ) + 1;
|
||||||
|
Reference in New Issue
Block a user