longparas: nStart and nEnd are always overwritten

so simplify to the reality, which conveniently removes some
hard-coded 0xFFFF and STRING_LEN uses

Change-Id: I4fc014a972f6a157c18f8194c410b7cbff03de4a
This commit is contained in:
Caolán McNamara
2014-01-12 11:20:39 +00:00
parent ad4f00a992
commit f042e84e63
2 changed files with 11 additions and 11 deletions

View File

@@ -93,8 +93,8 @@ private:
SAL_DLLPRIVATE void ImplInitEditData(); SAL_DLLPRIVATE void ImplInitEditData();
SAL_DLLPRIVATE void ImplModified(); SAL_DLLPRIVATE void ImplModified();
SAL_DLLPRIVATE OUString ImplGetText() const; SAL_DLLPRIVATE OUString ImplGetText() const;
SAL_DLLPRIVATE void ImplRepaint( sal_Int32 nStart = 0, sal_Int32 nEnd = STRING_LEN, bool bLayout = false ); SAL_DLLPRIVATE void ImplRepaint(bool bLayout = false);
SAL_DLLPRIVATE void ImplInvalidateOrRepaint( sal_Int32 nStart = 0, sal_Int32 nEnd = STRING_LEN ); SAL_DLLPRIVATE void ImplInvalidateOrRepaint();
SAL_DLLPRIVATE void ImplDelete( const Selection& rSelection, sal_uInt8 nDirection, sal_uInt8 nMode ); SAL_DLLPRIVATE void ImplDelete( const Selection& rSelection, sal_uInt8 nDirection, sal_uInt8 nMode );
SAL_DLLPRIVATE void ImplSetText( const OUString& rStr, const Selection* pNewSelection = 0 ); SAL_DLLPRIVATE void ImplSetText( const OUString& rStr, const Selection* pNewSelection = 0 );
SAL_DLLPRIVATE void ImplInsertText( const OUString& rStr, const Selection* pNewSelection = 0, sal_Bool bIsUserInput = sal_False ); SAL_DLLPRIVATE void ImplInsertText( const OUString& rStr, const Selection* pNewSelection = 0, sal_Bool bIsUserInput = sal_False );

View File

@@ -496,7 +496,7 @@ OUString Edit::ImplGetText() const
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
void Edit::ImplInvalidateOrRepaint( sal_Int32 nStart, sal_Int32 nEnd ) void Edit::ImplInvalidateOrRepaint()
{ {
if( IsPaintTransparent() ) if( IsPaintTransparent() )
{ {
@@ -506,7 +506,7 @@ void Edit::ImplInvalidateOrRepaint( sal_Int32 nStart, sal_Int32 nEnd )
Update(); Update();
} }
else else
ImplRepaint( nStart, nEnd ); ImplRepaint();
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
@@ -522,14 +522,14 @@ long Edit::ImplGetTextYPosition() const
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
void Edit::ImplRepaint( sal_Int32 nStart, sal_Int32 nEnd, bool bLayout ) void Edit::ImplRepaint(bool bLayout)
{ {
if ( !IsReallyVisible() ) if ( !IsReallyVisible() )
return; return;
OUString aText = ImplGetText(); OUString aText = ImplGetText();
nStart = 0; sal_Int32 nStart = 0;
nEnd = aText.getLength(); sal_Int32 nEnd = aText.getLength();
sal_Int32 nDXBuffer[256]; sal_Int32 nDXBuffer[256];
sal_Int32* pDXBuffer = NULL; sal_Int32* pDXBuffer = NULL;
@@ -1275,7 +1275,7 @@ void Edit::ImplAlign()
void Edit::ImplAlignAndPaint() void Edit::ImplAlignAndPaint()
{ {
ImplAlign(); ImplAlign();
ImplInvalidateOrRepaint( 0, STRING_LEN ); ImplInvalidateOrRepaint();
ImplShowCursor(); ImplShowCursor();
} }
@@ -1861,7 +1861,7 @@ void Edit::KeyInput( const KeyEvent& rKEvt )
void Edit::FillLayoutData() const void Edit::FillLayoutData() const
{ {
mpControlData->mpLayoutData = new vcl::ControlLayoutData(); mpControlData->mpLayoutData = new vcl::ControlLayoutData();
const_cast<Edit*>(this)->ImplRepaint( 0, STRING_LEN, true ); const_cast<Edit*>(this)->ImplRepaint(true);
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
@@ -2343,7 +2343,7 @@ void Edit::StateChanged( StateChangedType nType )
if ( !mpSubEdit ) if ( !mpSubEdit )
{ {
// change text color only // change text color only
ImplInvalidateOrRepaint( 0, 0xFFFF ); ImplInvalidateOrRepaint();
} }
} }
else if ( nType == STATE_CHANGE_STYLE || nType == STATE_CHANGE_MIRRORING ) else if ( nType == STATE_CHANGE_STYLE || nType == STATE_CHANGE_MIRRORING )
@@ -2648,7 +2648,7 @@ void Edit::ImplSetSelection( const Selection& rSelection, sal_Bool bPaint )
maSelection = aNew; maSelection = aNew;
if ( bPaint && ( aOld.Len() || aNew.Len() || IsPaintTransparent() ) ) if ( bPaint && ( aOld.Len() || aNew.Len() || IsPaintTransparent() ) )
ImplInvalidateOrRepaint( 0, maText.getLength() ); ImplInvalidateOrRepaint();
ImplShowCursor(); ImplShowCursor();
sal_Bool bCaret = sal_False, bSelection = sal_False; sal_Bool bCaret = sal_False, bSelection = sal_False;