Kaydet (Commit) eb4cd7e7 authored tarafından Caolán McNamara's avatar Caolán McNamara

some remaining sal_uInt16 to sal_Int32 editeng ESelection bounds

Change-Id: Ib47dea5c2d965cf613c465e624a1bdd81becb1c2
üst f1f7f3f1
...@@ -92,8 +92,7 @@ namespace accessibility ...@@ -92,8 +92,7 @@ namespace accessibility
nEndIndex >= 0 && nEndIndex <= USHRT_MAX , nEndIndex >= 0 && nEndIndex <= USHRT_MAX ,
"AccessibleStaticTextBase_Impl::MakeSelection: index value overflow"); "AccessibleStaticTextBase_Impl::MakeSelection: index value overflow");
return ESelection( nStartPara, static_cast< sal_uInt16 >(nStartIndex), return ESelection(nStartPara, nStartIndex, nEndPara, nEndIndex);
nEndPara, static_cast< sal_uInt16 >(nEndIndex) );
} }
...@@ -360,7 +359,7 @@ namespace accessibility ...@@ -360,7 +359,7 @@ namespace accessibility
nFlatIndex - nCurrIndex + nCurrCount >= 0 && nFlatIndex - nCurrIndex + nCurrCount <= USHRT_MAX , nFlatIndex - nCurrIndex + nCurrCount >= 0 && nFlatIndex - nCurrIndex + nCurrCount <= USHRT_MAX ,
"AccessibleStaticTextBase_Impl::Index2Internal: index value overflow"); "AccessibleStaticTextBase_Impl::Index2Internal: index value overflow");
return EPosition( nCurrPara, static_cast< sal_uInt16 >(nFlatIndex - nCurrIndex + nCurrCount) ); return EPosition(nCurrPara, nFlatIndex - nCurrIndex + nCurrCount);
} }
} }
...@@ -372,7 +371,7 @@ namespace accessibility ...@@ -372,7 +371,7 @@ namespace accessibility
nFlatIndex - nCurrIndex + nCurrCount >= 0 && nFlatIndex - nCurrIndex + nCurrCount <= USHRT_MAX , nFlatIndex - nCurrIndex + nCurrCount >= 0 && nFlatIndex - nCurrIndex + nCurrCount <= USHRT_MAX ,
"AccessibleStaticTextBase_Impl::Index2Internal: index value overflow"); "AccessibleStaticTextBase_Impl::Index2Internal: index value overflow");
return EPosition( nCurrPara-1, static_cast< sal_uInt16 >(nFlatIndex - nCurrIndex + nCurrCount) ); return EPosition(nCurrPara-1, nFlatIndex - nCurrIndex + nCurrCount);
} }
// not found? Out of bounds // not found? Out of bounds
...@@ -744,8 +743,7 @@ namespace accessibility ...@@ -744,8 +743,7 @@ namespace accessibility
// #112814# Use correct index offset // #112814# Use correct index offset
if ( ( nIndex = rPara.getIndexAtPoint( aPoint ) ) != -1 ) if ( ( nIndex = rPara.getIndexAtPoint( aPoint ) ) != -1 )
return mpImpl->Internal2Index( EPosition(sal::static_int_cast<sal_uInt16>(i), return mpImpl->Internal2Index(EPosition(i, nIndex));
sal::static_int_cast<sal_uInt16>(nIndex)) );
} }
return -1; return -1;
......
...@@ -319,13 +319,13 @@ namespace accessibility ...@@ -319,13 +319,13 @@ namespace accessibility
// Get text from forwarder // Get text from forwarder
OUString GetTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ); OUString GetTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex );
sal_uInt16 GetTextLen() const; sal_Int32 GetTextLen() const;
/** Get the current selection of this paragraph /** Get the current selection of this paragraph
@return sal_False, if nothing in this paragraph is selected @return sal_False, if nothing in this paragraph is selected
*/ */
bool GetSelection( sal_uInt16& nStartPos, sal_uInt16& nEndPos ); bool GetSelection(sal_Int32& nStartPos, sal_Int32& nEndPos );
/** create selection from Accessible selection. /** create selection from Accessible selection.
......
...@@ -492,8 +492,8 @@ void FuInsertFile::InsTextOrRTFinDrMode(SfxMedium* pMedium) ...@@ -492,8 +492,8 @@ void FuInsertFile::InsTextOrRTFinDrMode(SfxMedium* pMedium)
{ {
Paragraph* pPara = pOutliner->GetParagraph( 0 ); Paragraph* pPara = pOutliner->GetParagraph( 0 );
sal_uLong nLen = pOutliner->GetText( pPara, 1 ).getLength(); sal_uLong nLen = pOutliner->GetText( pPara, 1 ).getLength();
pOutliner->QuickDelete( ESelection( 0, (sal_uInt16) nLen, 1, 0 ) ); pOutliner->QuickDelete( ESelection( 0, nLen, 1, 0 ) );
pOutliner->QuickInsertLineBreak( ESelection( 0, (sal_uInt16) nLen, 0, (sal_uInt16) nLen ) ); pOutliner->QuickInsertLineBreak( ESelection( 0, nLen, 0, nLen ) );
} }
} }
} }
......
...@@ -601,8 +601,8 @@ uno::Reference< text::XTextRange > SdUnoSearchReplaceShape::Search( uno::Refere ...@@ -601,8 +601,8 @@ uno::Reference< text::XTextRange > SdUnoSearchReplaceShape::Search( uno::Refere
{ {
if( nStartPos <= nTextLen && nEndPos <= nTextLen ) if( nStartPos <= nTextLen && nEndPos <= nTextLen )
{ {
ESelection aSelection( pConvertPara[nStartPos], (sal_uInt16)pConvertPos[nStartPos], ESelection aSelection( pConvertPara[nStartPos], pConvertPos[nStartPos],
pConvertPara[nEndPos], (sal_uInt16)pConvertPos[nEndPos] ); pConvertPara[nEndPos], pConvertPos[nEndPos] );
SvxUnoTextRange *pRange; SvxUnoTextRange *pRange;
SvxUnoTextBase* pParent = SvxUnoTextBase::getImplementation( xParent ); SvxUnoTextBase* pParent = SvxUnoTextBase::getImplementation( xParent );
......
...@@ -323,7 +323,7 @@ void View::DoPaste (::Window* pWindow) ...@@ -323,7 +323,7 @@ void View::DoPaste (::Window* pWindow)
for( sal_Int32 nPara = nParaCount - 2; nPara >= 0; nPara-- ) for( sal_Int32 nPara = nParaCount - 2; nPara >= 0; nPara-- )
{ {
const sal_uInt16 nParaLen = (sal_uInt16)rEdit.GetTextLen( nPara ); const sal_Int32 nParaLen = rEdit.GetTextLen( nPara );
pOutliner->QuickDelete( ESelection( nPara, nParaLen, nPara+1, 0 ) ); pOutliner->QuickDelete( ESelection( nPara, nParaLen, nPara+1, 0 ) );
pOutliner->QuickInsertLineBreak( ESelection( nPara, nParaLen, nPara, nParaLen ) ); pOutliner->QuickInsertLineBreak( ESelection( nPara, nParaLen, nPara, nParaLen ) );
} }
......
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