diff options
author | Nigel Hawkins <n.hawkins@gmx.com> | 2011-08-08 11:34:59 +0100 |
---|---|---|
committer | Nigel Hawkins <n.hawkins@gmx.com> | 2011-08-08 20:23:05 +0100 |
commit | b090fcf34f105f7937ddd1d5e814fce3970b5894 (patch) | |
tree | 0cc8343db85a7d18b0ff195d0feadb5ff94615f9 /editeng/source | |
parent | 7d2cea2bc9a9463db8e6b6e82cb8aa9504ba9b8e (diff) |
Replace SvUShorts with vector in editeng.hxx and cascade changes.
LGPLv3+/MPL
Diffstat (limited to 'editeng/source')
-rw-r--r-- | editeng/source/editeng/editeng.cxx | 6 | ||||
-rw-r--r-- | editeng/source/editeng/editview.cxx | 15 | ||||
-rw-r--r-- | editeng/source/editeng/impedit4.cxx | 16 | ||||
-rw-r--r-- | editeng/source/uno/unoedprx.cxx | 2 | ||||
-rw-r--r-- | editeng/source/uno/unofored.cxx | 2 | ||||
-rw-r--r-- | editeng/source/uno/unoforou.cxx | 2 | ||||
-rw-r--r-- | editeng/source/uno/unotext.cxx | 2 | ||||
-rw-r--r-- | editeng/source/uno/unotext2.cxx | 17 |
8 files changed, 27 insertions, 35 deletions
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; |