diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2014-02-02 22:16:48 -0600 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2014-02-03 07:44:28 +0000 |
commit | 3cbfcee36dd16e451d76c561eaaaee0ff29b01a5 (patch) | |
tree | 7377a9e1d8cd56279104429abce73aec334569d5 /starmath | |
parent | 5c39b6b997ddc85e6848efc230a427a124b97264 (diff) |
xub_StrLen and tools/string.hxx final straw
Thre is still some 0xffff limit left and possibly some
less than gracefully handled overflow/error cases
Change-Id: I00957ee3a30b02f73918ea49d7353056263dc638
Reviewed-on: https://gerrit.libreoffice.org/7787
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/source/accessibility.cxx | 36 | ||||
-rw-r--r-- | starmath/source/accessibility.hxx | 30 |
2 files changed, 33 insertions, 33 deletions
diff --git a/starmath/source/accessibility.cxx b/starmath/source/accessibility.cxx index 7b6a2c492d37..43dc44de3ebe 100644 --- a/starmath/source/accessibility.cxx +++ b/starmath/source/accessibility.cxx @@ -979,7 +979,7 @@ sal_Int32 SmTextForwarder::GetParagraphCount() const return pEditEngine ? pEditEngine->GetParagraphCount() : 0; } -sal_uInt16 SmTextForwarder::GetTextLen( sal_Int32 nParagraph ) const +sal_Int32 SmTextForwarder::GetTextLen( sal_Int32 nParagraph ) const { EditEngine *pEditEngine = rEditAcc.GetEditEngine(); return pEditEngine ? pEditEngine->GetTextLen( nParagraph ) : 0; @@ -1065,7 +1065,7 @@ void SmTextForwarder::RemoveAttribs( const ESelection& rSelection, sal_Bool bRem pEditEngine->RemoveAttribs( rSelection, bRemoveParaAttribs, nWhich ); } -void SmTextForwarder::GetPortions( sal_Int32 nPara, std::vector<sal_uInt16>& rList ) const +void SmTextForwarder::GetPortions( sal_Int32 nPara, std::vector<sal_Int32>& rList ) const { EditEngine *pEditEngine = rEditAcc.GetEditEngine(); if (pEditEngine) @@ -1108,13 +1108,13 @@ sal_Bool SmTextForwarder::IsValid() const return pEditEngine ? pEditEngine->GetUpdateMode() : sal_False; } -OUString SmTextForwarder::CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor ) +OUString SmTextForwarder::CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos, Color*& rpTxtColor, Color*& rpFldColor ) { EditEngine *pEditEngine = rEditAcc.GetEditEngine(); return pEditEngine ? pEditEngine->CalcFieldValue(rField, nPara, nPos, rpTxtColor, rpFldColor) : OUString(); } -void SmTextForwarder::FieldClicked(const SvxFieldItem&, sal_Int32, sal_uInt16) +void SmTextForwarder::FieldClicked(const SvxFieldItem&, sal_Int32, sal_Int32) { } @@ -1132,11 +1132,11 @@ static sal_uInt16 GetSvxEditEngineItemState( EditEngine& rEditEngine, const ESel SfxItemState eParaState = SFX_ITEM_DEFAULT; // calculate start and endpos for this paragraph - sal_uInt16 nPos = 0; + sal_Int32 nPos = 0; if( rSel.nStartPara == nPara ) nPos = rSel.nStartPos; - sal_uInt16 nEndPos = rSel.nEndPos; + sal_Int32 nEndPos = rSel.nEndPos; if( rSel.nEndPara != nPara ) nEndPos = rEditEngine.GetTextLen( nPara ); @@ -1146,7 +1146,7 @@ static sal_uInt16 GetSvxEditEngineItemState( EditEngine& rEditEngine, const ESel bool bEmpty = true; // we found no item inside the selektion of this paragraph bool bGaps = false; // we found items but theire gaps between them - sal_uInt16 nLastEnd = nPos; + sal_Int32 nLastEnd = nPos; const SfxPoolItem* pParaItem = NULL; @@ -1231,13 +1231,13 @@ sal_uInt16 SmTextForwarder::GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) c return nState; } -LanguageType SmTextForwarder::GetLanguage( sal_Int32 nPara, sal_uInt16 nIndex ) const +LanguageType SmTextForwarder::GetLanguage( sal_Int32 nPara, sal_Int32 nIndex ) const { EditEngine *pEditEngine = rEditAcc.GetEditEngine(); return pEditEngine ? pEditEngine->GetLanguage(nPara, nIndex) : LANGUAGE_NONE; } -sal_uInt16 SmTextForwarder::GetFieldCount( sal_Int32 nPara ) const +sal_Int32 SmTextForwarder::GetFieldCount( sal_Int32 nPara ) const { EditEngine *pEditEngine = rEditAcc.GetEditEngine(); return pEditEngine ? pEditEngine->GetFieldCount(nPara) : 0; @@ -1254,7 +1254,7 @@ EBulletInfo SmTextForwarder::GetBulletInfo( sal_Int32 /*nPara*/ ) const return EBulletInfo(); } -Rectangle SmTextForwarder::GetCharBounds( sal_Int32 nPara, sal_uInt16 nIndex ) const +Rectangle SmTextForwarder::GetCharBounds( sal_Int32 nPara, sal_Int32 nIndex ) const { Rectangle aRect(0,0,0,0); EditEngine *pEditEngine = rEditAcc.GetEditEngine(); @@ -1306,7 +1306,7 @@ OutputDevice* SmTextForwarder::GetRefDevice() const return pEditEngine ? pEditEngine->GetRefDevice() : 0; } -sal_Bool SmTextForwarder::GetIndexAtPoint( const Point& rPos, sal_Int32& nPara, sal_uInt16& nIndex ) const +sal_Bool SmTextForwarder::GetIndexAtPoint( const Point& rPos, sal_Int32& nPara, sal_Int32& nIndex ) const { sal_Bool bRes = sal_False; EditEngine *pEditEngine = rEditAcc.GetEditEngine(); @@ -1320,7 +1320,7 @@ sal_Bool SmTextForwarder::GetIndexAtPoint( const Point& rPos, sal_Int32& nPara, return bRes; } -sal_Bool SmTextForwarder::GetWordIndices( sal_Int32 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const +sal_Bool SmTextForwarder::GetWordIndices( sal_Int32 nPara, sal_Int32 nIndex, sal_Int32& nStart, sal_Int32& nEnd ) const { sal_Bool bRes = sal_False; EditEngine *pEditEngine = rEditAcc.GetEditEngine(); @@ -1341,7 +1341,7 @@ sal_Bool SmTextForwarder::GetWordIndices( sal_Int32 nPara, sal_uInt16 nIndex, sa return bRes; } -sal_Bool SmTextForwarder::GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_Int32 nPara, sal_uInt16 nIndex, sal_Bool bInCell ) const +sal_Bool SmTextForwarder::GetAttributeRun( sal_Int32& nStartIndex, sal_Int32& nEndIndex, sal_Int32 nPara, sal_Int32 nIndex, sal_Bool bInCell ) const { EditEngine *pEditEngine = rEditAcc.GetEditEngine(); return pEditEngine ? @@ -1349,25 +1349,25 @@ sal_Bool SmTextForwarder::GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& : sal_False; } -sal_uInt16 SmTextForwarder::GetLineCount( sal_Int32 nPara ) const +sal_Int32 SmTextForwarder::GetLineCount( sal_Int32 nPara ) const { EditEngine *pEditEngine = rEditAcc.GetEditEngine(); return pEditEngine ? pEditEngine->GetLineCount(nPara) : 0; } -sal_uInt16 SmTextForwarder::GetLineLen( sal_Int32 nPara, sal_uInt16 nLine ) const +sal_Int32 SmTextForwarder::GetLineLen( sal_Int32 nPara, sal_Int32 nLine ) const { EditEngine *pEditEngine = rEditAcc.GetEditEngine(); return pEditEngine ? pEditEngine->GetLineLen(nPara, nLine) : 0; } -void SmTextForwarder::GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_Int32 nPara, sal_uInt16 nLine ) const +void SmTextForwarder::GetLineBoundaries( /*out*/sal_Int32 &rStart, /*out*/sal_Int32 &rEnd, sal_Int32 nPara, sal_Int32 nLine ) const { EditEngine *pEditEngine = rEditAcc.GetEditEngine(); pEditEngine->GetLineBoundaries(rStart, rEnd, nPara, nLine); } -sal_uInt16 SmTextForwarder::GetLineNumberAtIndex( sal_Int32 nPara, sal_uInt16 nIndex ) const +sal_Int32 SmTextForwarder::GetLineNumberAtIndex( sal_Int32 nPara, sal_Int32 nIndex ) const { EditEngine *pEditEngine = rEditAcc.GetEditEngine(); return pEditEngine ? pEditEngine->GetLineNumberAtIndex(nPara, nIndex) : 0; @@ -1445,7 +1445,7 @@ void SmTextForwarder::AppendParagraph() } } -sal_uInt16 SmTextForwarder::AppendTextPortion( sal_Int32 nPara, const OUString &rText, const SfxItemSet &rSet ) +sal_Int32 SmTextForwarder::AppendTextPortion( sal_Int32 nPara, const OUString &rText, const SfxItemSet &rSet ) { sal_uInt16 nRes = 0; EditEngine *pEditEngine = rEditAcc.GetEditEngine(); diff --git a/starmath/source/accessibility.hxx b/starmath/source/accessibility.hxx index d0e5ebbd759f..d9d30ae62fec 100644 --- a/starmath/source/accessibility.hxx +++ b/starmath/source/accessibility.hxx @@ -202,13 +202,13 @@ public: virtual ~SmTextForwarder(); virtual sal_Int32 GetParagraphCount() const; - virtual sal_uInt16 GetTextLen( sal_Int32 nParagraph ) const; + virtual sal_Int32 GetTextLen( sal_Int32 nParagraph ) const; virtual OUString GetText( const ESelection& rSel ) const; virtual SfxItemSet GetAttribs( const ESelection& rSel, sal_Bool bOnlyHardAttrib = EditEngineAttribs_All ) const; virtual SfxItemSet GetParaAttribs( sal_Int32 nPara ) const; virtual void SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet ); virtual void RemoveAttribs( const ESelection& rSelection, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich ); - virtual void GetPortions( sal_Int32 nPara, std::vector<sal_uInt16>& rList ) const; + virtual void GetPortions( sal_Int32 nPara, std::vector<sal_Int32>& rList ) const; virtual sal_uInt16 GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const; virtual sal_uInt16 GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const; @@ -220,25 +220,25 @@ public: virtual SfxItemPool* GetPool() const; - virtual OUString CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor ); - virtual void FieldClicked(const SvxFieldItem&, sal_Int32, sal_uInt16); + virtual OUString CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos, Color*& rpTxtColor, Color*& rpFldColor ); + virtual void FieldClicked(const SvxFieldItem&, sal_Int32, sal_Int32); virtual sal_Bool IsValid() const; - virtual LanguageType GetLanguage( sal_Int32, sal_uInt16 ) const; - virtual sal_uInt16 GetFieldCount( sal_Int32 nPara ) const; + virtual LanguageType GetLanguage( sal_Int32, sal_Int32 ) const; + virtual sal_Int32 GetFieldCount( sal_Int32 nPara ) const; virtual EFieldInfo GetFieldInfo( sal_Int32 nPara, sal_uInt16 nField ) const; virtual EBulletInfo GetBulletInfo( sal_Int32 nPara ) const; - virtual Rectangle GetCharBounds( sal_Int32 nPara, sal_uInt16 nIndex ) const; + virtual Rectangle GetCharBounds( sal_Int32 nPara, sal_Int32 nIndex ) const; virtual Rectangle GetParaBounds( sal_Int32 nPara ) const; virtual MapMode GetMapMode() const; virtual OutputDevice* GetRefDevice() const; - virtual sal_Bool GetIndexAtPoint( const Point&, sal_Int32& nPara, sal_uInt16& nIndex ) const; - virtual sal_Bool GetWordIndices( sal_Int32 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const; - virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_Int32 nPara, sal_uInt16 nIndex, sal_Bool bInCell = sal_False ) const; - virtual sal_uInt16 GetLineCount( sal_Int32 nPara ) const; - virtual sal_uInt16 GetLineLen( sal_Int32 nPara, sal_uInt16 nLine ) const; - virtual void GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_Int32 nParagraph, sal_uInt16 nLine ) const; - virtual sal_uInt16 GetLineNumberAtIndex( sal_Int32 nPara, sal_uInt16 nLine ) const; + virtual sal_Bool GetIndexAtPoint( const Point&, sal_Int32& nPara, sal_Int32& nIndex ) const; + virtual sal_Bool GetWordIndices( sal_Int32 nPara, sal_Int32 nIndex, sal_Int32& nStart, sal_Int32& nEnd ) const; + virtual sal_Bool GetAttributeRun( sal_Int32& nStartIndex, sal_Int32& nEndIndex, sal_Int32 nPara, sal_Int32 nIndex, sal_Bool bInCell = sal_False ) const; + virtual sal_Int32 GetLineCount( sal_Int32 nPara ) const; + virtual sal_Int32 GetLineLen( sal_Int32 nPara, sal_Int32 nLine ) const; + virtual void GetLineBoundaries( /*out*/sal_Int32 &rStart, /*out*/sal_Int32 &rEnd, sal_Int32 nParagraph, sal_Int32 nLine ) const; + virtual sal_Int32 GetLineNumberAtIndex( sal_Int32 nPara, sal_Int32 nLine ) const; virtual sal_Bool Delete( const ESelection& ); virtual sal_Bool InsertText( const OUString&, const ESelection& ); virtual sal_Bool QuickFormatDoc( sal_Bool bFull=sal_False ); @@ -249,7 +249,7 @@ public: virtual const SfxItemSet* GetEmptyItemSetPtr(); // implementation functions for XParagraphAppend and XTextPortionAppend virtual void AppendParagraph(); - virtual sal_uInt16 AppendTextPortion( sal_Int32 nPara, const OUString &rText, const SfxItemSet &rSet ); + virtual sal_Int32 AppendTextPortion( sal_Int32 nPara, const OUString &rText, const SfxItemSet &rSet ); virtual void CopyText(const SvxTextForwarder& rSource); }; |