diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-05-02 14:58:29 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-05-03 20:28:17 -0400 |
commit | e4e4b3d65788d14d5f10cd6bccc713cfe2411cb1 (patch) | |
tree | 627eb69f8e42c7f06f9049285f38e5dd6bdd2e2b /editeng | |
parent | 1e68b77bb785e5ab9a68e0052436d8e7e8163728 (diff) |
Another SV_DECL_PTRARR now gone.
Change-Id: I0521274a6e19414d2640a1473a249a90ce2224fc
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/editobj.cxx | 21 | ||||
-rw-r--r-- | editeng/source/editeng/editobj2.hxx | 24 | ||||
-rw-r--r-- | editeng/source/editeng/impedit4.cxx | 17 |
3 files changed, 37 insertions, 25 deletions
diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx index 21f0cbfd9a4a..0fd9de60a465 100644 --- a/editeng/source/editeng/editobj.cxx +++ b/editeng/source/editeng/editobj.cxx @@ -86,6 +86,25 @@ bool XEditAttribute::IsFeature() const return ((nWhich >= EE_FEATURE_START) && (nWhich <= EE_FEATURE_END)); } + +XParaPortionList::XParaPortionList( + OutputDevice* pRefDev, sal_uLong nPW, sal_uInt16 _nStretchX, sal_uInt16 _nStretchY) : + aRefMapMode(pRefDev->GetMapMode()), nStretchX(_nStretchX), nStretchY(_nStretchY) +{ + nRefDevPtr = (sal_uIntPtr)pRefDev; nPaperWidth = nPW; + eRefDevType = pRefDev->GetOutDevType(); +} + +void XParaPortionList::push_back(XParaPortion* p) +{ + maList.push_back(p); +} + +const XParaPortion& XParaPortionList::operator [](size_t i) const +{ + return maList[i]; +} + ContentInfo::ContentInfo( SfxItemPool& rPool ) : aParaAttribs( rPool, EE_PARA_START, EE_CHAR_END ) { eFamily = SFX_STYLE_FAMILY_PARA; @@ -740,8 +759,6 @@ void BinTextObject::ClearPortionInfo() { if ( pPortionInfo ) { - for ( sal_uInt16 n = pPortionInfo->Count(); n; ) - delete pPortionInfo->GetObject( --n ); delete pPortionInfo; pPortionInfo = NULL; } diff --git a/editeng/source/editeng/editobj2.hxx b/editeng/source/editeng/editobj2.hxx index ad611e6ecdd5..233865350a51 100644 --- a/editeng/source/editeng/editobj2.hxx +++ b/editeng/source/editeng/editobj2.hxx @@ -90,28 +90,23 @@ struct XParaPortion TextPortionList aTextPortions; }; -typedef XParaPortion* XParaPortionPtr; -SV_DECL_PTRARR( XBaseParaPortionList, XParaPortionPtr, 0 ) - -class XParaPortionList : public XBaseParaPortionList +class XParaPortionList { - sal_uIntPtr nRefDevPtr; + typedef boost::ptr_vector<XParaPortion> ListType; + ListType maList; + + sal_uIntPtr nRefDevPtr; OutDevType eRefDevType; MapMode aRefMapMode; sal_uInt16 nStretchX; sal_uInt16 nStretchY; sal_uLong nPaperWidth; - public: - XParaPortionList( OutputDevice* pRefDev, sal_uLong nPW, sal_uInt16 _nStretchX, sal_uInt16 _nStretchY ) : - aRefMapMode( pRefDev->GetMapMode() ), - nStretchX(_nStretchX), - nStretchY(_nStretchY) - { - nRefDevPtr = (sal_uIntPtr)pRefDev; nPaperWidth = nPW; - eRefDevType = pRefDev->GetOutDevType(); - } + XParaPortionList(OutputDevice* pRefDev, sal_uLong nPW, sal_uInt16 _nStretchX, sal_uInt16 _nStretchY); + + void push_back(XParaPortion* p); + const XParaPortion& operator[](size_t i) const; sal_uIntPtr GetRefDevPtr() const { return nRefDevPtr; } sal_uLong GetPaperWidth() const { return nPaperWidth; } @@ -119,6 +114,7 @@ public: const MapMode& GetRefMapMode() const { return aRefMapMode; } sal_uInt16 GetStretchX() const { return nStretchX; } sal_uInt16 GetStretchY() const { return nStretchY; } + }; class ContentInfo diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index d20958f6f12a..f9b8e86e0968 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -1140,7 +1140,7 @@ EditTextObject* ImpEditEngine::CreateBinTextObject( EditSelection aSel, SfxItemP { const ParaPortion* pParaPortion = GetParaPortions()[nNode]; XParaPortion* pX = new XParaPortion; - pXList->Insert( pX, pXList->Count() ); + pXList->push_back(pX); pX->nHeight = pParaPortion->GetHeight(); pX->nFirstLineOffset = pParaPortion->GetFirstLineOffset(); @@ -1330,31 +1330,30 @@ EditSelection ImpEditEngine::InsertBinTextObject( BinTextObject& rTextObject, Ed } if ( bNewContent && bUsePortionInfo ) { - XParaPortion* pXP = pPortionInfo->GetObject( n ); - DBG_ASSERT( pXP, "InsertBinTextObject: PortionInfo?" ); + const XParaPortion& rXP = (*pPortionInfo)[n]; ParaPortion* pParaPortion = GetParaPortions()[ nPara ]; DBG_ASSERT( pParaPortion, "InsertBinTextObject: ParaPortion?" ); - pParaPortion->nHeight = pXP->nHeight; - pParaPortion->nFirstLineOffset = pXP->nFirstLineOffset; + pParaPortion->nHeight = rXP.nHeight; + pParaPortion->nFirstLineOffset = rXP.nFirstLineOffset; pParaPortion->bForceRepaint = sal_True; pParaPortion->SetValid(); // Do not format // The Text Portions pParaPortion->GetTextPortions().Reset(); - sal_uInt16 nCount = pXP->aTextPortions.Count(); + sal_uInt16 nCount = rXP.aTextPortions.Count(); for ( sal_uInt16 _n = 0; _n < nCount; _n++ ) { - TextPortion* pTextPortion = pXP->aTextPortions[_n]; + const TextPortion* pTextPortion = rXP.aTextPortions[_n]; TextPortion* pNew = new TextPortion( *pTextPortion ); pParaPortion->GetTextPortions().Insert(_n, pNew); } // The lines pParaPortion->GetLines().Reset(); - nCount = pXP->aLines.Count(); + nCount = rXP.aLines.Count(); for ( sal_uInt16 m = 0; m < nCount; m++ ) { - EditLine* pLine = pXP->aLines[m]; + const EditLine* pLine = rXP.aLines[m]; EditLine* pNew = pLine->Clone(); pNew->SetInvalid(); // Paint again! pParaPortion->GetLines().Insert(m, pNew); |