Kaydet (Commit) 4ded8177 authored tarafından Noel Grandin's avatar Noel Grandin

convert Edit::GetCharPos from xub_StrLen to sal_Int32

Change-Id: I8fe982d0c0c0a04e2a10cff0f0ae68d51bed590a
üst 9083e8d1
...@@ -384,7 +384,7 @@ namespace pcr ...@@ -384,7 +384,7 @@ namespace pcr
//-------------------------------------------------------------------- //--------------------------------------------------------------------
bool HyperlinkInput::impl_textHitTest( const ::Point& _rWindowPos ) bool HyperlinkInput::impl_textHitTest( const ::Point& _rWindowPos )
{ {
xub_StrLen nPos = GetCharPos( _rWindowPos ); sal_Int32 nPos = GetCharPos( _rWindowPos );
return ( ( nPos != STRING_LEN ) && ( nPos < GetText().getLength() ) ); return ( ( nPos != STRING_LEN ) && ( nPos < GetText().getLength() ) );
} }
......
...@@ -236,7 +236,7 @@ public: ...@@ -236,7 +236,7 @@ public:
virtual Size CalcSize( sal_uInt16 nChars ) const; virtual Size CalcSize( sal_uInt16 nChars ) const;
virtual xub_StrLen GetMaxVisChars() const; virtual xub_StrLen GetMaxVisChars() const;
xub_StrLen GetCharPos( const Point& rWindowPos ) const; sal_Int32 GetCharPos( const Point& rWindowPos ) const;
// shows a warning box saying "text too long, truncated" // shows a warning box saying "text too long, truncated"
static void ShowTruncationWarning( Window* pParent ); static void ShowTruncationWarning( Window* pParent );
......
...@@ -1430,7 +1430,7 @@ void Edit::MouseButtonDown( const MouseEvent& rMEvt ) ...@@ -1430,7 +1430,7 @@ void Edit::MouseButtonDown( const MouseEvent& rMEvt )
return; return;
} }
xub_StrLen nChar = ImplGetCharPos( rMEvt.GetPosPixel() ); sal_Int32 nCharPos = ImplGetCharPos( rMEvt.GetPosPixel() );
Selection aSelection( maSelection ); Selection aSelection( maSelection );
aSelection.Justify(); aSelection.Justify();
...@@ -1451,10 +1451,10 @@ void Edit::MouseButtonDown( const MouseEvent& rMEvt ) ...@@ -1451,10 +1451,10 @@ void Edit::MouseButtonDown( const MouseEvent& rMEvt )
ImplSetSelection( Selection( aBoundary.startPos, aBoundary.endPos ) ); ImplSetSelection( Selection( aBoundary.startPos, aBoundary.endPos ) );
ImplCopyToSelectionClipboard(); ImplCopyToSelectionClipboard();
} }
else if ( !rMEvt.IsShift() && HasFocus() && aSelection.IsInside( nChar ) ) else if ( !rMEvt.IsShift() && HasFocus() && aSelection.IsInside( nCharPos ) )
mbClickedInSelection = sal_True; mbClickedInSelection = sal_True;
else if ( rMEvt.IsLeft() ) else if ( rMEvt.IsLeft() )
ImplSetCursorPos( nChar, rMEvt.IsShift() ); ImplSetCursorPos( nCharPos, rMEvt.IsShift() );
if ( !mbClickedInSelection && rMEvt.IsLeft() && ( rMEvt.GetClicks() == 1 ) ) if ( !mbClickedInSelection && rMEvt.IsLeft() && ( rMEvt.GetClicks() == 1 ) )
StartTracking( STARTTRACK_SCROLLREPEAT ); StartTracking( STARTTRACK_SCROLLREPEAT );
...@@ -1471,8 +1471,8 @@ void Edit::MouseButtonUp( const MouseEvent& rMEvt ) ...@@ -1471,8 +1471,8 @@ void Edit::MouseButtonUp( const MouseEvent& rMEvt )
{ {
if ( mbClickedInSelection && rMEvt.IsLeft() ) if ( mbClickedInSelection && rMEvt.IsLeft() )
{ {
xub_StrLen nChar = ImplGetCharPos( rMEvt.GetPosPixel() ); sal_Int32 nCharPos = ImplGetCharPos( rMEvt.GetPosPixel() );
ImplSetCursorPos( nChar, sal_False ); ImplSetCursorPos( nCharPos, sal_False );
mbClickedInSelection = sal_False; mbClickedInSelection = sal_False;
} }
else if ( rMEvt.IsMiddle() && !mbReadOnly && else if ( rMEvt.IsMiddle() && !mbReadOnly &&
...@@ -1492,8 +1492,8 @@ void Edit::Tracking( const TrackingEvent& rTEvt ) ...@@ -1492,8 +1492,8 @@ void Edit::Tracking( const TrackingEvent& rTEvt )
{ {
if ( mbClickedInSelection ) if ( mbClickedInSelection )
{ {
xub_StrLen nChar = ImplGetCharPos( rTEvt.GetMouseEvent().GetPosPixel() ); sal_Int32 nCharPos = ImplGetCharPos( rTEvt.GetMouseEvent().GetPosPixel() );
ImplSetCursorPos( nChar, sal_False ); ImplSetCursorPos( nCharPos, sal_False );
mbClickedInSelection = sal_False; mbClickedInSelection = sal_False;
} }
else if ( rTEvt.GetMouseEvent().IsLeft() ) else if ( rTEvt.GetMouseEvent().IsLeft() )
...@@ -1505,8 +1505,8 @@ void Edit::Tracking( const TrackingEvent& rTEvt ) ...@@ -1505,8 +1505,8 @@ void Edit::Tracking( const TrackingEvent& rTEvt )
{ {
if( !mbClickedInSelection ) if( !mbClickedInSelection )
{ {
xub_StrLen nChar = ImplGetCharPos( rTEvt.GetMouseEvent().GetPosPixel() ); sal_Int32 nCharPos = ImplGetCharPos( rTEvt.GetMouseEvent().GetPosPixel() );
ImplSetCursorPos( nChar, sal_True ); ImplSetCursorPos( nCharPos, sal_True );
} }
} }
...@@ -2967,7 +2967,7 @@ xub_StrLen Edit::GetMaxVisChars() const ...@@ -2967,7 +2967,7 @@ xub_StrLen Edit::GetMaxVisChars() const
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
xub_StrLen Edit::GetCharPos( const Point& rWindowPos ) const sal_Int32 Edit::GetCharPos( const Point& rWindowPos ) const
{ {
return ImplGetCharPos( rWindowPos ); return ImplGetCharPos( rWindowPos );
} }
...@@ -3033,8 +3033,8 @@ void Edit::dragGestureRecognized( const ::com::sun::star::datatransfer::dnd::Dra ...@@ -3033,8 +3033,8 @@ void Edit::dragGestureRecognized( const ::com::sun::star::datatransfer::dnd::Dra
// Nur wenn Maus in der Selektion... // Nur wenn Maus in der Selektion...
Point aMousePos( rDGE.DragOriginX, rDGE.DragOriginY ); Point aMousePos( rDGE.DragOriginX, rDGE.DragOriginY );
xub_StrLen nChar = ImplGetCharPos( aMousePos ); sal_Int32 nCharPos = ImplGetCharPos( aMousePos );
if ( (nChar >= aSel.Min()) && (nChar < aSel.Max()) ) if ( (nCharPos >= aSel.Min()) && (nCharPos < aSel.Max()) )
{ {
if ( !mpDDInfo ) if ( !mpDDInfo )
mpDDInfo = new DDInfo; mpDDInfo = new DDInfo;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment