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 /sc/source | |
parent | 7d2cea2bc9a9463db8e6b6e82cb8aa9504ba9b8e (diff) |
Replace SvUShorts with vector in editeng.hxx and cascade changes.
LGPLv3+/MPL
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/core/tool/editutil.cxx | 11 | ||||
-rw-r--r-- | sc/source/filter/excel/xehelper.cxx | 16 | ||||
-rw-r--r-- | sc/source/filter/html/htmlexp.cxx | 12 | ||||
-rw-r--r-- | sc/source/ui/drawfunc/drtxtob.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/pagedlg/scuitphfedit.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/view/output2.cxx | 12 |
6 files changed, 23 insertions, 42 deletions
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 ); |