diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2015-08-01 19:31:34 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2015-08-01 19:33:22 +0200 |
commit | 44cd9ef88bfc14b4520de8a73a692f0d59c40946 (patch) | |
tree | f7a358c1a6dc342519b45b9e248ee40eab5edc4f /accessibility | |
parent | 9b49846fad132f121b2848c69477e42a0051884e (diff) |
sal_uInt16 to sal_Int32, constify, minor optimizations
Change-Id: Icc41bbe09e495454ca27e9281eca6f4731a135c8
Diffstat (limited to 'accessibility')
-rw-r--r-- | accessibility/source/extended/textwindowaccessibility.cxx | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/accessibility/source/extended/textwindowaccessibility.cxx b/accessibility/source/extended/textwindowaccessibility.cxx index be6a97629eca..2224fecb99bd 100644 --- a/accessibility/source/extended/textwindowaccessibility.cxx +++ b/accessibility/source/extended/textwindowaccessibility.cxx @@ -882,13 +882,11 @@ void Document::retrieveParagraphSelection(Paragraph const * pParagraph, if ( nNumber >= aMinPaM.GetPara() && nNumber <= aMaxPaM.GetPara() ) { - *pBegin = nNumber > aMinPaM.GetPara() - ? 0 - : static_cast< ::sal_Int32 >( aMinPaM.GetIndex() ); + *pBegin = nNumber > aMinPaM.GetPara() ? 0 : aMinPaM.GetIndex(); // XXX numeric overflow *pEnd = nNumber < aMaxPaM.GetPara() - ? static_cast< ::sal_Int32 >( m_rEngine.GetText(static_cast< ::sal_uLong >(nNumber)).getLength() ) - : static_cast< ::sal_Int32 >( aMaxPaM.GetIndex() ); + ? m_rEngine.GetText(static_cast< ::sal_uLong >(nNumber)).getLength() + : aMaxPaM.GetIndex(); // XXX numeric overflow (3x) if ( aStartPaM > aEndPaM ) @@ -909,8 +907,7 @@ void Document::retrieveParagraphSelection(Paragraph const * pParagraph, Paragraphs::size_type nNumber = pParagraph->getNumber(); TextPaM aEndPaM( rSelection.GetEnd() ); - return aEndPaM.GetPara() == nNumber - ? static_cast< ::sal_Int32 >(aEndPaM.GetIndex()) : -1; + return aEndPaM.GetPara() == nNumber ? aEndPaM.GetIndex() : -1; } css::awt::Rectangle @@ -974,8 +971,7 @@ Document::retrieveCharacterBounds(Paragraph const * pParagraph, ::TextPaM aPaM(m_rEngine.GetPaM(::Point(static_cast< long >(rPoint.X), static_cast< long >(rPoint.Y)))); // XXX numeric overflow (2x) - return aPaM.GetPara() == nNumber - ? static_cast< ::sal_Int32 >(aPaM.GetIndex()) : -1; + return aPaM.GetPara() == nNumber ? aPaM.GetIndex() : -1; // XXX numeric overflow } @@ -2248,13 +2244,11 @@ void Document::handleSelectionChangeNotification() "bad TEXT_HINT_VIEWSELECTIONCHANGED event"); ::sal_Int32 nNewFirstPara = static_cast< ::sal_Int32 >(rSelection.GetStart().GetPara()); - ::sal_Int32 nNewFirstPos - = static_cast< ::sal_Int32 >(rSelection.GetStart().GetIndex()); + ::sal_Int32 nNewFirstPos = rSelection.GetStart().GetIndex(); // XXX numeric overflow ::sal_Int32 nNewLastPara = static_cast< ::sal_Int32 >(rSelection.GetEnd().GetPara()); - ::sal_Int32 nNewLastPos - = static_cast< ::sal_Int32 >(rSelection.GetEnd().GetIndex()); + ::sal_Int32 nNewLastPos = rSelection.GetEnd().GetIndex(); // XXX numeric overflow // Lose focus: |