diff options
25 files changed, 70 insertions, 102 deletions
diff --git a/editeng/inc/editeng/editeng.hxx b/editeng/inc/editeng/editeng.hxx index eccc1c4f0b6f..babe1644f52c 100644 --- a/editeng/inc/editeng/editeng.hxx +++ b/editeng/inc/editeng/editeng.hxx @@ -54,7 +54,6 @@ class SvStream; class Link; class OutputDevice; class Window; -class SvUShorts; class SfxPoolItem; class SvxNumBulletItem; class SvxBulletItem; @@ -293,7 +292,7 @@ public: void StopSelectionMode(); void StripPortions(); - void GetPortions( sal_uInt16 nPara, SvUShorts& rList ); + void GetPortions( sal_uInt16 nPara, std::vector<sal_uInt16>& rList ); long GetFirstLineStartX( sal_uInt16 nParagraph ); Point GetDocPosTopLeft( sal_uInt16 nParagraph ); diff --git a/editeng/inc/editeng/unoedprx.hxx b/editeng/inc/editeng/unoedprx.hxx index 4dde5a9688b5..573b23c35035 100644 --- a/editeng/inc/editeng/unoedprx.hxx +++ b/editeng/inc/editeng/unoedprx.hxx @@ -49,7 +49,7 @@ public: virtual SfxItemSet GetParaAttribs( sal_uInt16 nPara ) const; virtual void SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet ); virtual void RemoveAttribs( const ESelection& rSelection, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich ); - virtual void GetPortions( sal_uInt16 nPara, SvUShorts& rList ) const; + virtual void GetPortions( sal_uInt16 nPara, std::vector<sal_uInt16>& rList ) const; virtual sal_Int32 CalcLogicalIndex( sal_uInt16 nPara, sal_uInt16 nEEIndex ); virtual sal_uInt16 CalcEditEngineIndex( sal_uInt16 nPara, sal_Int32 nLogicalIndex ); diff --git a/editeng/inc/editeng/unoedsrc.hxx b/editeng/inc/editeng/unoedsrc.hxx index b522155264cc..3f45bae909c6 100644 --- a/editeng/inc/editeng/unoedsrc.hxx +++ b/editeng/inc/editeng/unoedsrc.hxx @@ -50,7 +50,6 @@ struct EBulletInfo; class OutputDevice; class String; class SfxItemSet; -class SvUShorts; class SvxTextForwarder; class SvxViewForwarder; class SvxEditViewForwarder; @@ -159,7 +158,7 @@ public: virtual SfxItemSet GetParaAttribs( sal_uInt16 nPara ) const = 0; virtual void SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet ) = 0; virtual void RemoveAttribs( const ESelection& rSelection, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich ) = 0; - virtual void GetPortions( sal_uInt16 nPara, SvUShorts& rList ) const = 0; + virtual void GetPortions( sal_uInt16 nPara, std::vector<sal_uInt16>& rList ) const = 0; virtual sal_uInt16 GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const = 0; virtual sal_uInt16 GetItemState( sal_uInt16 nPara, sal_uInt16 nWhich ) const = 0; diff --git a/editeng/inc/editeng/unofored.hxx b/editeng/inc/editeng/unofored.hxx index 2daa4d8a2bd8..964fe6557090 100644 --- a/editeng/inc/editeng/unofored.hxx +++ b/editeng/inc/editeng/unofored.hxx @@ -51,7 +51,7 @@ public: virtual SfxItemSet GetParaAttribs( sal_uInt16 nPara ) const; virtual void SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet ); virtual void RemoveAttribs( const ESelection& rSelection, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich ); - virtual void GetPortions( sal_uInt16 nPara, SvUShorts& rList ) const; + virtual void GetPortions( sal_uInt16 nPara, std::vector<sal_uInt16>& rList ) const; virtual sal_uInt16 GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const; virtual sal_uInt16 GetItemState( sal_uInt16 nPara, sal_uInt16 nWhich ) const; diff --git a/editeng/inc/editeng/unoforou.hxx b/editeng/inc/editeng/unoforou.hxx index f5987d23edbc..d1c5325c92a3 100644 --- a/editeng/inc/editeng/unoforou.hxx +++ b/editeng/inc/editeng/unoforou.hxx @@ -69,7 +69,7 @@ public: virtual SfxItemSet GetParaAttribs( sal_uInt16 nPara ) const; virtual void SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet ); virtual void RemoveAttribs( const ESelection& rSelection, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich ); - virtual void GetPortions( sal_uInt16 nPara, SvUShorts& rList ) const; + virtual void GetPortions( sal_uInt16 nPara, std::vector<sal_uInt16>& rList ) const; virtual sal_uInt16 GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const; virtual sal_uInt16 GetItemState( sal_uInt16 nPara, sal_uInt16 nWhich ) const; diff --git a/editeng/inc/editeng/unotext.hxx b/editeng/inc/editeng/unotext.hxx index 4fd80927518d..0395e4d9afda 100644 --- a/editeng/inc/editeng/unotext.hxx +++ b/editeng/inc/editeng/unotext.hxx @@ -196,7 +196,7 @@ public: virtual SfxItemSet GetParaAttribs( sal_uInt16 nPara ) const; virtual void SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet ); virtual void RemoveAttribs( const ESelection& rSelection, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich ); - virtual void GetPortions( sal_uInt16 nPara, SvUShorts& rList ) const; + virtual void GetPortions( sal_uInt16 nPara, std::vector<sal_uInt16>& rList ) const; sal_uInt16 GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const; sal_uInt16 GetItemState( sal_uInt16 nPara, sal_uInt16 nWhich ) const; @@ -600,10 +600,10 @@ class SvxUnoTextRangeEnumeration : public ::cppu::WeakAggImplHelper1< ::com::sun private: SvxEditSource* mpEditSource; ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > mxParentText; - const SvxUnoTextBase& mrParentText; - sal_uInt16 mnParagraph; - SvUShorts* mpPortions; - sal_uInt16 mnNextPortion; + const SvxUnoTextBase& mrParentText; + sal_uInt16 mnParagraph; + std::vector<sal_uInt16>* mpPortions; + sal_uInt16 mnNextPortion; public: SvxUnoTextRangeEnumeration( const SvxUnoTextBase& rText, sal_uInt16 nPara ) throw(); diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index 64591310d7dd..800a60dd6178 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -36,8 +36,6 @@ #define USE_SVXFONT -#define _SVSTDARR_sal_uInt16S -#include <svl/svstdarr.hxx> #include <svl/ctloptions.hxx> #include <svtools/ctrltool.hxx> @@ -1694,7 +1692,7 @@ void EditEngine::StripPortions() pImpEditEngine->Paint( &aTmpDev, aBigRec, Point(), sal_True ); } -void EditEngine::GetPortions( sal_uInt16 nPara, SvUShorts& rList ) +void EditEngine::GetPortions( sal_uInt16 nPara, std::vector<sal_uInt16>& rList ) { if ( !pImpEditEngine->IsFormatted() ) pImpEditEngine->FormatFullDoc(); @@ -1707,7 +1705,7 @@ void EditEngine::GetPortions( sal_uInt16 nPara, SvUShorts& rList ) for ( sal_uInt16 n = 0; n < nTextPortions; n++ ) { nEnd = nEnd + pParaPortion->GetTextPortions()[n]->GetLen(); - rList.Insert( nEnd, rList.Count() ); + rList.push_back( nEnd ); } } } diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index e324b7beca1d..9f7b2c494d7d 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -46,9 +46,6 @@ #include <svl/srchitem.hxx> -#define _SVSTDARR_sal_uIt16S -#include <svl/svstdarr.hxx> - #include <impedit.hxx> #include <editeng/editeng.hxx> #include <editeng/editview.hxx> @@ -1455,19 +1452,19 @@ void EditView::ChangeFontSize( bool bGrow, const FontList* pFontList ) { for( sal_uInt16 nPara = aSel.nStartPara; nPara <= aSel.nEndPara; nPara++ ) { - SvUShorts aPortions; + std::vector<sal_uInt16> aPortions; rEditEngine.GetPortions( nPara, aPortions ); - if( aPortions.Count() == 0 ) - aPortions.Insert( rEditEngine.GetTextLen(nPara), 0 ); + if( aPortions.empty() ) + aPortions.push_back( rEditEngine.GetTextLen(nPara) ); const sal_uInt16 nBeginPos = (nPara == aSel.nStartPara) ? aSel.nStartPos : 0; const sal_uInt16 nEndPos = (nPara == aSel.nEndPara) ? aSel.nEndPos : 0xffff; - for ( sal_uInt16 nPos = 0; nPos < aPortions.Count(); ++nPos ) + for ( size_t nPos = 0; nPos < aPortions.size(); ++nPos ) { - sal_uInt16 nPortionEnd = aPortions.GetObject( nPos ); - sal_uInt16 nPortionStart = nPos > 0 ? aPortions.GetObject( nPos - 1 ) : 0; + sal_uInt16 nPortionEnd = aPortions[ nPos ]; + sal_uInt16 nPortionStart = nPos > 0 ? aPortions[ nPos - 1 ] : 0; if( (nPortionEnd < nBeginPos) || (nPortionStart > nEndPos) ) continue; diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index 9b86411d8cf1..d3f78ef0c3fb 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -1484,12 +1484,12 @@ sal_Bool ImpEditEngine::HasConvertibleTextPortion( LanguageType nSrcLang ) sal_uInt16 nParas = pEditEngine->GetParagraphCount(); for (sal_uInt16 k = 0; k < nParas; ++k) { - SvUShorts aPortions; + std::vector<sal_uInt16> aPortions; pEditEngine->GetPortions( k, aPortions ); - for ( sal_uInt16 nPos = 0; nPos < aPortions.Count(); ++nPos ) + for ( size_t nPos = 0; nPos < aPortions.size(); ++nPos ) { - sal_uInt16 nEnd = aPortions.GetObject( nPos ); - sal_uInt16 nStart = nPos > 0 ? aPortions.GetObject( nPos - 1 ) : 0; + sal_uInt16 nEnd = aPortions[ nPos ]; + sal_uInt16 nStart = nPos > 0 ? aPortions[ nPos - 1 ] : 0; // if the paragraph is not empty we need to increase the index // by one since the attribute of the character left to the @@ -1675,12 +1675,12 @@ void ImpEditEngine::ImpConvert( rtl::OUString &rConvTxt, LanguageType &rConvTxtL sal_uInt16 nAttribEnd = USHRT_MAX; sal_uInt16 nCurPos = USHRT_MAX; EPaM aCurStart = CreateEPaM( aCurSel.Min() ); - SvUShorts aPortions; + std::vector<sal_uInt16> aPortions; pEditEngine->GetPortions( (sal_uInt16)aCurStart.nPara, aPortions ); - for ( sal_uInt16 nPos = 0; nPos < aPortions.Count(); ++nPos ) + for ( size_t nPos = 0; nPos < aPortions.size(); ++nPos ) { - sal_uInt16 nEnd = aPortions.GetObject( nPos ); - sal_uInt16 nStart = nPos > 0 ? aPortions.GetObject( nPos - 1 ) : 0; + sal_uInt16 nEnd = aPortions[ nPos ]; + sal_uInt16 nStart = nPos > 0 ? aPortions[ nPos - 1 ] : 0; // the language attribute is obtained from the left character // (like usually all other attributes) diff --git a/editeng/source/uno/unoedprx.cxx b/editeng/source/uno/unoedprx.cxx index 45abc3f4a459..245241595af1 100644 --- a/editeng/source/uno/unoedprx.cxx +++ b/editeng/source/uno/unoedprx.cxx @@ -591,7 +591,7 @@ void SvxAccessibleTextAdapter::RemoveAttribs( const ESelection& , sal_Bool , sal DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); } -void SvxAccessibleTextAdapter::GetPortions( sal_uInt16 nPara, SvUShorts& rList ) const +void SvxAccessibleTextAdapter::GetPortions( sal_uInt16 nPara, std::vector<sal_uInt16>& rList ) const { DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); diff --git a/editeng/source/uno/unofored.cxx b/editeng/source/uno/unofored.cxx index b994e46c404d..b91227545da7 100644 --- a/editeng/source/uno/unofored.cxx +++ b/editeng/source/uno/unofored.cxx @@ -135,7 +135,7 @@ SfxItemPool* SvxEditEngineForwarder::GetPool() const return rEditEngine.GetEmptyItemSet().GetPool(); } -void SvxEditEngineForwarder::GetPortions( sal_uInt16 nPara, SvUShorts& rList ) const +void SvxEditEngineForwarder::GetPortions( sal_uInt16 nPara, std::vector<sal_uInt16>& rList ) const { rEditEngine.GetPortions( nPara, rList ); } diff --git a/editeng/source/uno/unoforou.cxx b/editeng/source/uno/unoforou.cxx index 8f3d7593efca..5561d740dee2 100644 --- a/editeng/source/uno/unoforou.cxx +++ b/editeng/source/uno/unoforou.cxx @@ -201,7 +201,7 @@ SfxItemPool* SvxOutlinerForwarder::GetPool() const return rOutliner.GetEmptyItemSet().GetPool(); } -void SvxOutlinerForwarder::GetPortions( sal_uInt16 nPara, SvUShorts& rList ) const +void SvxOutlinerForwarder::GetPortions( sal_uInt16 nPara, std::vector<sal_uInt16>& rList ) const { ((EditEngine&)rOutliner.GetEditEngine()).GetPortions( nPara, rList ); } diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx index 0d097884b588..680b0f9f27fe 100644 --- a/editeng/source/uno/unotext.cxx +++ b/editeng/source/uno/unotext.cxx @@ -2486,7 +2486,7 @@ void SvxDummyTextSource::RemoveAttribs( const ESelection& , sal_Bool , sal_uInt1 { } -void SvxDummyTextSource::GetPortions( sal_uInt16, SvUShorts& ) const +void SvxDummyTextSource::GetPortions( sal_uInt16, std::vector<sal_uInt16>& ) const { } diff --git a/editeng/source/uno/unotext2.cxx b/editeng/source/uno/unotext2.cxx index af227be6b673..33fcf225eb2d 100644 --- a/editeng/source/uno/unotext2.cxx +++ b/editeng/source/uno/unotext2.cxx @@ -32,9 +32,6 @@ #include <osl/mutex.hxx> #include <rtl/instance.hxx> -#define _SVSTDARR_sal_uIt16S -#include <svl/svstdarr.hxx> - #include <editeng/eeitem.hxx> #include <editeng/flditem.hxx> #include <editeng/unofield.hxx> @@ -321,9 +318,9 @@ sal_Bool SAL_CALL SvxUnoTextContent::hasElements() SvxTextForwarder* pForwarder = GetEditSource() ? GetEditSource()->GetTextForwarder() : NULL; if( pForwarder ) { - SvUShorts aPortions; + std::vector<sal_uInt16> aPortions; pForwarder->GetPortions( mnParagraph, aPortions ); - return aPortions.Count() > 0; + return !aPortions.empty(); } else { @@ -426,7 +423,7 @@ SvxUnoTextRangeEnumeration::SvxUnoTextRangeEnumeration( const SvxUnoTextBase& rT if( mpEditSource && mpEditSource->GetTextForwarder() ) { - mpPortions = new SvUShorts; + mpPortions = new std::vector<sal_uInt16>; mpEditSource->GetTextForwarder()->GetPortions( nPara, *mpPortions ); } else @@ -448,7 +445,7 @@ sal_Bool SAL_CALL SvxUnoTextRangeEnumeration::hasMoreElements() { SolarMutexGuard aGuard; - return mpPortions && mnNextPortion < mpPortions->Count(); + return mpPortions && mnNextPortion < mpPortions->size(); } uno::Any SAL_CALL SvxUnoTextRangeEnumeration::nextElement() @@ -456,13 +453,13 @@ uno::Any SAL_CALL SvxUnoTextRangeEnumeration::nextElement() { SolarMutexGuard aGuard; - if( mpPortions == NULL || mnNextPortion >= mpPortions->Count() ) + if( mpPortions == NULL || mnNextPortion >= mpPortions->size() ) throw container::NoSuchElementException(); sal_uInt16 nStartPos = 0; if (mnNextPortion > 0) - nStartPos = mpPortions->GetObject(mnNextPortion-1); - sal_uInt16 nEndPos = mpPortions->GetObject(mnNextPortion); + nStartPos = mpPortions->at(mnNextPortion-1); + sal_uInt16 nEndPos = mpPortions->at(mnNextPortion); ESelection aSel( mnParagraph, nStartPos, mnParagraph, nEndPos ); uno::Reference< text::XTextRange > xRange; diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx index 0d0a55885ef0..fd517a37310d 100644 --- a/sc/source/core/tool/editutil.cxx +++ b/sc/source/core/tool/editutil.cxx @@ -50,10 +50,6 @@ #include <vcl/outdev.hxx> #include <svl/inethist.hxx> #include <unotools/syslocale.hxx> -#ifndef _SVSTDARR_USHORTS -#define _SVSTDARR_USHORTS -#include <svl/svstdarr.hxx> -#endif #include "editutil.hxx" #include "global.hxx" @@ -495,17 +491,16 @@ void ScEditEngineDefaulter::RemoveParaAttribs() if ( pCharItems ) { - SvUShorts aPortions; + std::vector<sal_uInt16> aPortions; GetPortions( nPar, aPortions ); // loop through the portions of the paragraph, and set only those items // that are not overridden by existing character attributes - sal_uInt16 nPCount = aPortions.Count(); sal_uInt16 nStart = 0; - for ( sal_uInt16 nPos=0; nPos<nPCount; nPos++ ) + for ( std::vector<sal_uInt16>::const_iterator it(aPortions.begin()); it != aPortions.end(); ++it ) { - sal_uInt16 nEnd = aPortions.GetObject( nPos ); + sal_uInt16 nEnd = *it; ESelection aSel( nPar, nStart, nPar, nEnd ); SfxItemSet aOldCharAttrs = GetAttribs( aSel ); SfxItemSet aNewCharAttrs = *pCharItems; diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx index baf07094e429..df2c4bc0992d 100644 --- a/sc/source/filter/excel/xehelper.cxx +++ b/sc/source/filter/excel/xehelper.cxx @@ -46,8 +46,6 @@ #include <editeng/escpitem.hxx> #include <editeng/svxfont.hxx> -#define _SVSTDARR_USHORTS -#include <svl/svstdarr.hxx> #include "document.hxx" #include "docpool.hxx" #include "cell.hxx" @@ -456,14 +454,13 @@ XclExpStringRef lclCreateFormattedString( ESelection aSel( nPara, 0 ); String aParaText( rEE.GetText( nPara ) ); - SvUShorts aPosList; + std::vector<sal_uInt16> aPosList; rEE.GetPortions( nPara, aPosList ); // process all portions in the paragraph - sal_uInt16 nPosCount = aPosList.Count(); - for( sal_uInt16 nPos = 0; nPos < nPosCount; ++nPos ) + for( std::vector<sal_uInt16>::const_iterator it(aPosList.begin()); it != aPosList.end(); ++it ) { - aSel.nEndPos = static_cast< xub_StrLen >( aPosList.GetObject( nPos ) ); + aSel.nEndPos = static_cast< xub_StrLen >( *it ); String aXclPortionText( aParaText, aSel.nStartPos, aSel.nEndPos - aSel.nStartPos ); aItemSet.ClearItem(); @@ -738,13 +735,12 @@ void XclExpHFConverter::AppendPortion( const EditTextObject* pTextObj, sal_Unico ESelection aSel( nPara, 0 ); String aParaText; sal_Int32 nParaHeight = 0; - SvUShorts aPosList; + std::vector<sal_uInt16> aPosList; mrEE.GetPortions( nPara, aPosList ); - sal_uInt16 nPosCount = aPosList.Count(); - for( sal_uInt16 nPos = 0; nPos < nPosCount; ++nPos ) + for( std::vector<sal_uInt16>::const_iterator it( aPosList.begin() ); it != aPosList.end(); ++it ) { - aSel.nEndPos = static_cast< xub_StrLen >( aPosList.GetObject( nPos ) ); + aSel.nEndPos = static_cast< xub_StrLen >( *it ); if( aSel.nStartPos < aSel.nEndPos ) { diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx index e90fb7665c27..70d8ac866ad6 100644 --- a/sc/source/filter/html/htmlexp.cxx +++ b/sc/source/filter/html/htmlexp.cxx @@ -36,7 +36,6 @@ #include "scitems.hxx" #include <editeng/eeitem.hxx> -#define _SVSTDARR_STRINGSSORTDTOR #include <rtl/tencinfo.h> #include <vcl/svapp.hxx> @@ -58,8 +57,8 @@ #include <sfx2/objsh.hxx> #include <svl/stritem.hxx> #include <svl/urihelper.hxx> -#ifndef _SVSTDARR_USHORTS -#define _SVSTDARR_USHORTS +#ifndef _SVSTDARR_STRINGSSORTDTOR +#define _SVSTDARR_STRINGSSORTDTOR #endif #include <svl/svstdarr.hxx> #include <svl/zforlist.hxx> @@ -1262,13 +1261,12 @@ sal_Bool ScHTMLExport::WriteFieldText( const ScEditCell* pCell ) { if ( nPar > 0 ) TAG_ON( OOO_STRING_SVTOOLS_HTML_linebreak ); - SvUShorts aPortions; + std::vector<sal_uInt16> aPortions; rEngine.GetPortions( nPar, aPortions ); - sal_uInt16 nCnt = aPortions.Count(); sal_uInt16 nStart = 0; - for ( sal_uInt16 nPos = 0; nPos < nCnt; nPos++ ) + for ( std::vector<sal_uInt16>::const_iterator it(aPortions.begin()); it != aPortions.end(); ++it ) { - sal_uInt16 nEnd = aPortions.GetObject( nPos ); + sal_uInt16 nEnd = *it; ESelection aSel( nPar, nStart, nPar, nEnd ); sal_Bool bUrl = false; // fields are single characters diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx index 9237d0e1f66a..588e53d5a2d5 100644 --- a/sc/source/ui/drawfunc/drtxtob.cxx +++ b/sc/source/ui/drawfunc/drtxtob.cxx @@ -625,15 +625,15 @@ void lcl_RemoveFields( OutlinerView& rOutView ) for (sal_uLong nPar=0; nPar<nParCount; nPar++) if ( nPar >= aSel.nStartPara && nPar <= aSel.nEndPara ) { - SvUShorts aPortions; + std::vector<sal_uInt16> aPortions; rEditEng.GetPortions( (sal_uInt16)nPar, aPortions ); //! GetPortions should use xub_StrLen instead of USHORT - for ( sal_uInt16 nPos = aPortions.Count(); nPos; ) + for ( size_t nPos = aPortions.size(); nPos; ) { --nPos; - sal_uInt16 nEnd = aPortions.GetObject( nPos ); - sal_uInt16 nStart = nPos ? aPortions.GetObject( nPos - 1 ) : 0; + sal_uInt16 nEnd = aPortions[ nPos ]; + sal_uInt16 nStart = nPos ? aPortions[ nPos - 1 ] : 0; // fields are single characters if ( nEnd == nStart+1 && ( nPar > aSel.nStartPara || nStart >= aSel.nStartPos ) && diff --git a/sc/source/ui/pagedlg/scuitphfedit.cxx b/sc/source/ui/pagedlg/scuitphfedit.cxx index dd47ce988480..a86e1bb1e1ee 100644 --- a/sc/source/ui/pagedlg/scuitphfedit.cxx +++ b/sc/source/ui/pagedlg/scuitphfedit.cxx @@ -48,8 +48,6 @@ #include <vcl/msgbox.hxx> #include <vcl/svapp.hxx> #include <unotools/useroptions.hxx> -#define _SVSTDARR_USHORTS -#include <svl/svstdarr.hxx> #include "editutil.hxx" #include "global.hxx" @@ -554,9 +552,9 @@ bool ScHFEditPage::IsPageEntry(EditEngine*pEngine, EditTextObject* pTextObj) if(!pTextObj->IsFieldObject()) { - SvUShorts aPosList; + std::vector<sal_uInt16> aPosList; pEngine->GetPortions(0,aPosList); - if(aPosList.Count() == 2) + if(aPosList.size() == 2) { String aPageEntry(ScGlobal::GetRscString( STR_PAGE ) ); aPageEntry += ' '; diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index e6796d99b742..8a24b72833ad 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -61,11 +61,6 @@ #include <vcl/outdev.hxx> #include <vcl/pdfextoutdevdata.hxx> -#ifndef _SVSTDARR_USHORTS -#define _SVSTDARR_USHORTS -#include <svl/svstdarr.hxx> -#endif - #include "output.hxx" #include "document.hxx" #include "cell.hxx" @@ -1975,14 +1970,13 @@ void lcl_ScaleFonts( EditEngine& rEngine, long nPercent ) sal_uInt16 nParCount = rEngine.GetParagraphCount(); for (sal_uInt16 nPar=0; nPar<nParCount; nPar++) { - SvUShorts aPortions; + std::vector<sal_uInt16> aPortions; rEngine.GetPortions( nPar, aPortions ); - sal_uInt16 nPCount = aPortions.Count(); sal_uInt16 nStart = 0; - for ( sal_uInt16 nPos=0; nPos<nPCount; nPos++ ) + for ( std::vector<sal_uInt16>::const_iterator it(aPortions.begin()); it != aPortions.end(); ++it ) { - sal_uInt16 nEnd = aPortions.GetObject( nPos ); + sal_uInt16 nEnd = *it; ESelection aSel( nPar, nStart, nPar, nEnd ); SfxItemSet aAttribs = rEngine.GetAttribs( aSel ); diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx index 41a14f3e4801..8054c1af637f 100644 --- a/sd/source/filter/html/htmlex.cxx +++ b/sd/source/filter/html/htmlex.cxx @@ -72,8 +72,6 @@ #include <sfx2/dispatch.hxx> #include <sfx2/fcontnr.hxx> #include <svl/style.hxx> -#define _SVSTDARR_USHORTS -#include <svl/svstdarr.hxx> #include <editeng/frmdiritem.hxx> #include <svx/svdoutl.hxx> #include <tools/urlobj.hxx> // INetURLObject @@ -1365,14 +1363,13 @@ String HtmlExport::ParagraphToHTMLString( SdrOutliner* pOutliner, sal_uLong nPar return aStr; HtmlState aState( (mbUserAttr || mbDocColors) ? maTextColor : Color(COL_BLACK) ); - SvUShorts aPortionList; + std::vector<sal_uInt16> aPortionList; rEditEngine.GetPortions( (sal_uInt16) nPara, aPortionList ); - sal_uInt16 nPortionCount = aPortionList.Count(); sal_uInt16 nPos1 = 0; - for( sal_uInt16 nPortion = 0; nPortion < nPortionCount; nPortion++ ) + for( std::vector<sal_uInt16>::const_iterator it( aPortionList.begin() ); it != aPortionList.end(); ++it ) { - sal_uInt16 nPos2 = aPortionList.GetObject(nPortion); + sal_uInt16 nPos2 = *it; ESelection aSelection( (sal_uInt16) nPara, nPos1, (sal_uInt16) nPara, nPos2); diff --git a/starmath/source/accessibility.cxx b/starmath/source/accessibility.cxx index 426d0a61c294..96f40993c3ce 100644 --- a/starmath/source/accessibility.cxx +++ b/starmath/source/accessibility.cxx @@ -1086,7 +1086,7 @@ void SmTextForwarder::RemoveAttribs( const ESelection& rSelection, sal_Bool bRem pEditEngine->RemoveAttribs( rSelection, bRemoveParaAttribs, nWhich ); } -void SmTextForwarder::GetPortions( sal_uInt16 nPara, SvUShorts& rList ) const +void SmTextForwarder::GetPortions( sal_uInt16 nPara, std::vector<sal_uInt16>& rList ) const { EditEngine *pEditEngine = rEditAcc.GetEditEngine(); if (pEditEngine) diff --git a/starmath/source/accessibility.hxx b/starmath/source/accessibility.hxx index a6b682b706fb..8ed6c48465f9 100644 --- a/starmath/source/accessibility.hxx +++ b/starmath/source/accessibility.hxx @@ -218,7 +218,7 @@ public: virtual SfxItemSet GetParaAttribs( sal_uInt16 nPara ) const; virtual void SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet ); virtual void RemoveAttribs( const ESelection& rSelection, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich ); - virtual void GetPortions( sal_uInt16 nPara, SvUShorts& rList ) const; + virtual void GetPortions( sal_uInt16 nPara, std::vector<sal_uInt16>& rList ) const; virtual sal_uInt16 GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const; virtual sal_uInt16 GetItemState( sal_uInt16 nPara, sal_uInt16 nWhich ) const; diff --git a/svx/source/accessibility/AccessibleEmptyEditSource.cxx b/svx/source/accessibility/AccessibleEmptyEditSource.cxx index 3dd0d11b3ff2..2cb6e87e1ec9 100644 --- a/svx/source/accessibility/AccessibleEmptyEditSource.cxx +++ b/svx/source/accessibility/AccessibleEmptyEditSource.cxx @@ -119,7 +119,7 @@ namespace accessibility SfxItemSet GetParaAttribs( sal_uInt16 /*nPara*/ ) const { return GetAttribs(ESelection()); } void SetParaAttribs( sal_uInt16 /*nPara*/, const SfxItemSet& /*rSet*/ ) {} void RemoveAttribs( const ESelection& /*rSelection*/, sal_Bool /*bRemoveParaAttribs*/, sal_uInt16 /*nWhich*/ ){} - void GetPortions( sal_uInt16 /*nPara*/, SvUShorts& /*rList*/ ) const {} + void GetPortions( sal_uInt16 /*nPara*/, std::vector<sal_uInt16>& /*rList*/ ) const {} sal_uInt16 GetItemState( const ESelection& /*rSel*/, sal_uInt16 /*nWhich*/ ) const { return 0; } sal_uInt16 GetItemState( sal_uInt16 /*nPara*/, sal_uInt16 /*nWhich*/ ) const { return 0; } diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index d7f67faac29f..603773b0c6ea 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -3177,15 +3177,15 @@ uno::Sequence< lang::Locale > SAL_CALL SwXTextDocument::getDocumentLanguages( for (sal_uLong nPar=0; nPar<nParCount; nPar++) { //every paragraph - SvUShorts aPortions; + std::vector<sal_uInt16> aPortions; rEditEng.GetPortions( (sal_uInt16)nPar, aPortions ); - for ( sal_uInt16 nPos = aPortions.Count(); nPos; ) + for ( size_t nPos = aPortions.size(); nPos; ) { //every position --nPos; - sal_uInt16 nEnd = aPortions.GetObject( nPos ); - sal_uInt16 nStart = nPos ? aPortions.GetObject( nPos - 1 ) : 0; + sal_uInt16 nEnd = aPortions[ nPos ]; + sal_uInt16 nStart = nPos ? aPortions[ nPos - 1 ] : 0; ESelection aSelection( (sal_uInt16)nPar, nStart, (sal_uInt16)nPar, nEnd ); SfxItemSet aAttr = rEditEng.GetAttribs( aSelection ); |