longparas: drop xub_StrLen from fields
Change-Id: Icd6dbc9b374df3e528dc22afa07be72d7fc89ca7
This commit is contained in:
@@ -321,7 +321,7 @@ static OUString ImplPatternReformat( const OUString& rStr,
|
|||||||
|
|
||||||
static void ImplPatternMaxPos( const OUString& rStr, const OString& rEditMask,
|
static void ImplPatternMaxPos( const OUString& rStr, const OString& rEditMask,
|
||||||
sal_uInt16 nFormatFlags, bool bSameMask,
|
sal_uInt16 nFormatFlags, bool bSameMask,
|
||||||
sal_uInt16 nCursorPos, sal_Int32& rPos )
|
sal_Int32 nCursorPos, sal_Int32& rPos )
|
||||||
{
|
{
|
||||||
|
|
||||||
// last position must not be longer than the contained string
|
// last position must not be longer than the contained string
|
||||||
@@ -394,7 +394,7 @@ static void ImplPatternProcessStrictModify( Edit* pEdit,
|
|||||||
if ( nMaxSel >= aText.getLength() )
|
if ( nMaxSel >= aText.getLength() )
|
||||||
{
|
{
|
||||||
sal_Int32 nMaxPos = aNewText.getLength();
|
sal_Int32 nMaxPos = aNewText.getLength();
|
||||||
ImplPatternMaxPos( aNewText, rEditMask, nFormatFlags, bSameMask, (xub_StrLen)nMaxSel, nMaxPos );
|
ImplPatternMaxPos( aNewText, rEditMask, nFormatFlags, bSameMask, nMaxSel, nMaxPos );
|
||||||
if ( aSel.Min() == aSel.Max() )
|
if ( aSel.Min() == aSel.Max() )
|
||||||
{
|
{
|
||||||
aSel.Min() = nMaxPos;
|
aSel.Min() = nMaxPos;
|
||||||
@@ -409,11 +409,11 @@ static void ImplPatternProcessStrictModify( Edit* pEdit,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static xub_StrLen ImplPatternLeftPos(const OString& rEditMask, sal_Int32 nCursorPos)
|
static sal_Int32 ImplPatternLeftPos(const OString& rEditMask, sal_Int32 nCursorPos)
|
||||||
{
|
{
|
||||||
// search non-literal predecessor
|
// search non-literal predecessor
|
||||||
xub_StrLen nNewPos = nCursorPos;
|
sal_Int32 nNewPos = nCursorPos;
|
||||||
xub_StrLen nTempPos = nNewPos;
|
sal_Int32 nTempPos = nNewPos;
|
||||||
while ( nTempPos )
|
while ( nTempPos )
|
||||||
{
|
{
|
||||||
if ( rEditMask[nTempPos-1] != EDITMASK_LITERAL )
|
if ( rEditMask[nTempPos-1] != EDITMASK_LITERAL )
|
||||||
@@ -426,7 +426,7 @@ static xub_StrLen ImplPatternLeftPos(const OString& rEditMask, sal_Int32 nCursor
|
|||||||
return nNewPos;
|
return nNewPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
static xub_StrLen ImplPatternRightPos( const OUString& rStr, const OString& rEditMask,
|
static sal_Int32 ImplPatternRightPos( const OUString& rStr, const OString& rEditMask,
|
||||||
sal_uInt16 nFormatFlags, bool bSameMask,
|
sal_uInt16 nFormatFlags, bool bSameMask,
|
||||||
sal_Int32 nCursorPos )
|
sal_Int32 nCursorPos )
|
||||||
{
|
{
|
||||||
@@ -482,7 +482,7 @@ static bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
|
|||||||
// all was selected by the focus
|
// all was selected by the focus
|
||||||
Selection aSel( aOldSel );
|
Selection aSel( aOldSel );
|
||||||
aSel.Justify();
|
aSel.Justify();
|
||||||
nCursorPos = (xub_StrLen)aSel.Min();
|
nCursorPos = aSel.Min();
|
||||||
aSel.Max() = ImplPatternRightPos( pEdit->GetText(), rEditMask, nFormatFlags, bSameMask, nCursorPos );
|
aSel.Max() = ImplPatternRightPos( pEdit->GetText(), rEditMask, nFormatFlags, bSameMask, nCursorPos );
|
||||||
if ( bShift )
|
if ( bShift )
|
||||||
aSel.Min() = aOldSel.Min();
|
aSel.Min() = aOldSel.Min();
|
||||||
@@ -605,7 +605,7 @@ static bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
|
|||||||
|
|
||||||
Selection aSel = aOldSel;
|
Selection aSel = aOldSel;
|
||||||
aSel.Justify();
|
aSel.Justify();
|
||||||
nNewPos = (xub_StrLen)aSel.Min();
|
nNewPos = aSel.Min();
|
||||||
|
|
||||||
if ( nNewPos < rEditMask.getLength() )
|
if ( nNewPos < rEditMask.getLength() )
|
||||||
{
|
{
|
||||||
@@ -669,7 +669,7 @@ static bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
|
|||||||
aStr.truncate( n );
|
aStr.truncate( n );
|
||||||
|
|
||||||
if ( aSel.Len() )
|
if ( aSel.Len() )
|
||||||
aStr.remove( (xub_StrLen)aSel.Min(), (xub_StrLen)aSel.Len() );
|
aStr.remove( aSel.Min(), aSel.Len() );
|
||||||
|
|
||||||
if ( aStr.getLength() < rEditMask.getLength() )
|
if ( aStr.getLength() < rEditMask.getLength() )
|
||||||
{
|
{
|
||||||
@@ -690,7 +690,7 @@ static bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
|
|||||||
if ( aSel.Len() )
|
if ( aSel.Len() )
|
||||||
{
|
{
|
||||||
// delete selection
|
// delete selection
|
||||||
OUString aRep = rLiteralMask.copy( (xub_StrLen)aSel.Min(), (xub_StrLen)aSel.Len() );
|
OUString aRep = rLiteralMask.copy( aSel.Min(), aSel.Len() );
|
||||||
aStr.remove( aSel.Min(), aRep.getLength() );
|
aStr.remove( aSel.Min(), aRep.getLength() );
|
||||||
aStr.insert( aSel.Min(), aRep );
|
aStr.insert( aSel.Min(), aRep );
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user