diff options
author | Maciej Rumianowski <maciej.rumianowski@gmail.com> | 2011-09-27 22:04:20 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2011-09-29 08:09:19 +0200 |
commit | ef01fae2759ac225f281f11a2b24ebaad40be941 (patch) | |
tree | 9ccc0ed54ee2795b719710260bbc4db0e5ea47c3 /sfx2 | |
parent | f446ca6fe8fe9ebdc66c230f4608fd3de74d0ca9 (diff) |
Replace SvULongs with std::vector in sfx2
Bug 38831, replace SvULongs with std::vector in sfx2 and related svtools
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/inc/sfx2/frmhtml.hxx | 1 | ||||
-rw-r--r-- | sfx2/source/bastyp/frmhtml.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/bastyp/sfxhtml.cxx | 18 | ||||
-rw-r--r-- | sfx2/source/control/dispatch.cxx | 12 | ||||
-rw-r--r-- | sfx2/source/doc/docfile.cxx | 13 |
5 files changed, 19 insertions, 29 deletions
diff --git a/sfx2/inc/sfx2/frmhtml.hxx b/sfx2/inc/sfx2/frmhtml.hxx index b365ab9efebd..6f88b43b45ed 100644 --- a/sfx2/inc/sfx2/frmhtml.hxx +++ b/sfx2/inc/sfx2/frmhtml.hxx @@ -38,7 +38,6 @@ class SfxFrameHTMLParser; class _SfxFrameHTMLContexts; class SfxFrameSetObjectShell; -class SvULongs; class SfxMedium; namespace svtools { class AsynchronLink; } diff --git a/sfx2/source/bastyp/frmhtml.cxx b/sfx2/source/bastyp/frmhtml.cxx index 75cd28be416f..12cbe091c054 100644 --- a/sfx2/source/bastyp/frmhtml.cxx +++ b/sfx2/source/bastyp/frmhtml.cxx @@ -33,10 +33,6 @@ #include <svtools/htmltokn.h> #include <svtools/asynclink.hxx> -#define _SVSTDARR_USHORTS -#define _SVSTDARR_ULONGS -#include <svl/svstdarr.hxx> - #include <sfx2/sfx.hrc> #include <sfx2/frmhtml.hxx> diff --git a/sfx2/source/bastyp/sfxhtml.cxx b/sfx2/source/bastyp/sfxhtml.cxx index 002e2cebcb42..a88764096fe3 100644 --- a/sfx2/source/bastyp/sfxhtml.cxx +++ b/sfx2/source/bastyp/sfxhtml.cxx @@ -42,10 +42,6 @@ #include <svtools/imapobj.hxx> #include <svtools/imappoly.hxx> #include <svtools/imaprect.hxx> -#ifndef _SVSTDARR_ULONGS_DECL -#define _SVSTDARR_ULONGS -#include <svl/svstdarr.hxx> -#endif #include <svl/zforlist.hxx> #include <rtl/tencinfo.h> #include <tools/tenccvt.hxx> @@ -54,6 +50,8 @@ #include <com/sun/star/beans/XPropertyContainer.hpp> +#include <vector> + using namespace ::com::sun::star; @@ -128,7 +126,7 @@ bool SfxHTMLParser::ParseAreaOptions(ImageMap * pImageMap, const String& rBaseUR DBG_ASSERT( pImageMap, "ParseAreaOptions: no Image-Map" ); sal_uInt16 nShape = IMAP_OBJ_RECTANGLE; - SvULongs aCoords; + std::vector<sal_uInt32> aCoords; String aName, aHRef, aAlt, aTarget, sEmpty; sal_Bool bNoHRef = sal_False; SvxMacroTableDtor aMacroTbl; @@ -147,7 +145,7 @@ bool SfxHTMLParser::ParseAreaOptions(ImageMap * pImageMap, const String& rBaseUR rOption.GetEnum( nShape, aAreaShapeOptEnums ); break; case HTML_O_COORDS: - rOption.GetNumbers( aCoords, sal_True ); + rOption.GetNumbers( aCoords, true ); break; case HTML_O_HREF: aHRef = INetURLObject::GetAbsURL( rBaseURL, rOption.GetString() ); @@ -195,7 +193,7 @@ IMAPOBJ_SETEVENT: switch( nShape ) { case IMAP_OBJ_RECTANGLE: - if( aCoords.Count() >=4 ) + if( aCoords.size() >=4 ) { Rectangle aRec( aCoords[0], aCoords[1], aCoords[2], aCoords[3] ); @@ -207,7 +205,7 @@ IMAPOBJ_SETEVENT: } break; case IMAP_OBJ_CIRCLE: - if( aCoords.Count() >=3 ) + if( aCoords.size() >=3 ) { Point aPoint( aCoords[0], aCoords[1] ); IMapCircleObject aMapCObj( aPoint, aCoords[2],aHRef, aAlt, String(), @@ -218,9 +216,9 @@ IMAPOBJ_SETEVENT: } break; case IMAP_OBJ_POLYGON: - if( aCoords.Count() >=6 ) + if( aCoords.size() >=6 ) { - sal_uInt16 nCount = aCoords.Count() / 2; + sal_uInt16 nCount = aCoords.size() / 2; Polygon aPoly( nCount ); for( sal_uInt16 i=0; i<nCount; i++ ) aPoly[i] = Point( aCoords[2*i], aCoords[2*i+1] ); diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx index 7072c09c1778..5aa16e163ff7 100644 --- a/sfx2/source/control/dispatch.cxx +++ b/sfx2/source/control/dispatch.cxx @@ -43,8 +43,6 @@ #include <stdarg.h> #include <stdlib.h> // due to bsearch -#define _SVSTDARR_ULONGS -#include <svl/svstdarr.hxx> #include <svtools/helpopt.hxx> #include <com/sun/star/frame/XLayoutManager.hpp> #include <com/sun/star/beans/XPropertySet.hpp> @@ -152,7 +150,7 @@ struct SfxDispatcher_Impl sal_Bool* pInCallAliveFlag; // view the Destructor Stack SfxObjectBars_Impl aObjBars[SFX_OBJECTBAR_MAX]; SfxObjectBars_Impl aFixedObjBars[SFX_OBJECTBAR_MAX]; - SvULongs aChildWins; + std::vector<sal_uInt32> aChildWins; sal_uInt16 nActionLevel; // in EnterAction sal_uInt32 nEventId; // EventId UserEvent sal_Bool bUILocked; // Update disconnected (no flicker) @@ -831,11 +829,11 @@ void SfxDispatcher::DoDeactivate_Impl( sal_Bool bMDI, SfxViewFrame* pNew ) SfxWorkWindow *pWorkWin = pImp->pFrame->GetFrame().GetWorkWindow_Impl(); if ( pWorkWin ) { - for (sal_uInt16 n=0; n<pImp->aChildWins.Count();) + for (size_t n=0; n<pImp->aChildWins.size();) { SfxChildWindow *pWin = pWorkWin->GetChildWindow_Impl( (sal_uInt16) ( pImp->aChildWins[n] & 0xFFFF ) ); if (!pWin || (pWin && pWin->GetAlignment() == SFX_ALIGN_NOALIGNMENT)) - pImp->aChildWins.Remove(n); + pImp->aChildWins.erase(pImp->aChildWins.begin()+n); else n++; } @@ -1544,7 +1542,7 @@ void SfxDispatcher::_Update_Impl( sal_Bool bUIActive, sal_Bool bIsMDIApp, sal_Bo for (sal_uInt16 n=0; n<SFX_OBJECTBAR_MAX; n++) pImp->aObjBars[n].nResId = 0; - pImp->aChildWins.Remove(0, pImp->aChildWins.Count()); + pImp->aChildWins.clear(); // bQuiet : own shells aren't considered for UI and SlotServer // bNoUI: own Shells aren't considered fors UI @@ -1646,7 +1644,7 @@ void SfxDispatcher::_Update_Impl( sal_Bool bUIActive, sal_Bool bIsMDIApp, sal_Bo if ( bUIActive || bIsActive ) pWorkWin->SetChildWindowVisible_Impl( nId, sal_True, nMode ); if ( bUIActive || bIsActive || !pWorkWin->IsFloating( (sal_uInt16) ( nId & 0xFFFF ) ) ) - pImp->aChildWins.Insert( nId, pImp->aChildWins.Count()); + pImp->aChildWins.push_back( nId ); } if ( bIsMDIApp || bIsIPOwner ) diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index ddeadec0f765..8140cc57aaf9 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -95,7 +95,6 @@ #include <cppuhelper/weakref.hxx> #include <cppuhelper/implbase1.hxx> -#define _SVSTDARR_ULONGS #define _SVSTDARR_STRINGSDTOR #include <svl/svstdarr.hxx> @@ -3104,21 +3103,21 @@ sal_uInt16 SfxMedium::AddVersion_Impl( util::RevisionTag& rRevision ) if ( GetStorage().is() ) { // To determine a unique name for the stream - SvULongs aLongs; + std::vector<sal_uInt32> aLongs; sal_Int32 nLength = pImp->aVersions.getLength(); for ( sal_Int32 m=0; m<nLength; m++ ) { - sal_uInt32 nVer = (sal_uInt32) String( pImp->aVersions[m].Identifier ).Copy(7).ToInt32(); - sal_uInt16 n; - for ( n=0; n<aLongs.Count(); n++ ) + sal_uInt32 nVer = static_cast<sal_uInt32>(String( pImp->aVersions[m].Identifier ).Copy(7).ToInt32()); + size_t n; + for ( n=0; n<aLongs.size(); ++n ) if ( nVer<aLongs[n] ) break; - aLongs.Insert( nVer, n ); + aLongs.insert( aLongs.begin()+n, nVer ); } sal_uInt16 nKey; - for ( nKey=0; nKey<aLongs.Count(); nKey++ ) + for ( nKey=0; nKey<aLongs.size(); ++nKey ) if ( aLongs[nKey] > ( sal_uIntPtr ) nKey+1 ) break; |