summaryrefslogtreecommitdiff
path: root/editeng/inc
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-06-12 14:18:56 +0200
committerMichael Stahl <mstahl@redhat.com>2012-06-12 23:25:16 +0200
commit586df9f1ec5a733082ced2a51f416c8baa2cc914 (patch)
treeb44d7fd03bca760021d11722797593dc66da5f82 /editeng/inc
parentc2fc98fa9e46cd18201d3940beb67d74630c8604 (diff)
Convert SV_DECL_PTRARR_DEL(SvxRTFItemStackList) to boost::ptr_vector
I had to make the destructor of SvxRTFItemStackType public. The combination of friend class, boost, and a private destructor does not make OSX's gcc happy. Change-Id: I2d9a3bff3c5edaf5435fb543389a9a2822c6b2ad
Diffstat (limited to 'editeng/inc')
-rw-r--r--editeng/inc/editeng/svxrtf.hxx18
1 files changed, 8 insertions, 10 deletions
diff --git a/editeng/inc/editeng/svxrtf.hxx b/editeng/inc/editeng/svxrtf.hxx
index 4d255da62bbb..926846fb4d86 100644
--- a/editeng/inc/editeng/svxrtf.hxx
+++ b/editeng/inc/editeng/svxrtf.hxx
@@ -39,6 +39,7 @@
#include <utility>
#include <vector>
#include "boost/ptr_container/ptr_map.hpp"
+#include "boost/ptr_container/ptr_vector.hpp"
class Font;
class Color;
@@ -46,7 +47,7 @@ class Graphic;
class DateTime;
struct SvxRTFStyleType;
class SvxRTFItemStackType;
-class SvxRTFItemStackList;
+class SvxRTFItemStackList : public boost::ptr_vector<SvxRTFItemStackType> {};
namespace com { namespace sun { namespace star {
namespace document {
@@ -88,12 +89,10 @@ typedef Color* ColorPtr;
typedef std::deque< ColorPtr > SvxRTFColorTbl;
typedef boost::ptr_map<short, Font> SvxRTFFontTbl;
typedef boost::ptr_map<sal_uInt16, SvxRTFStyleType> SvxRTFStyleTbl;
-typedef SvxRTFItemStackType* SvxRTFItemStackTypePtr;
-SV_DECL_PTRARR_DEL( SvxRTFItemStackList, SvxRTFItemStackTypePtr, 1 )
-// SvxRTFItemStack can't be "std::stack< SvxRTFItemStackTypePtr >" type, because
+// SvxRTFItemStack can't be "std::stack< SvxRTFItemStackType* >" type, because
// the methods are using operator[] in sw/source/filter/rtf/rtftbl.cxx file
-typedef std::deque< SvxRTFItemStackTypePtr > SvxRTFItemStack;
+typedef std::deque< SvxRTFItemStackType* > SvxRTFItemStack;
// own helper classes for the RTF Parser
struct SvxRTFStyleType
@@ -262,7 +261,7 @@ class EDITENG_DLLPUBLIC SvxRTFParser : public SvRTFParser
void ClearStyleTbl();
void ClearAttrStack();
- SvxRTFItemStackTypePtr _GetAttrSet( int bCopyAttr=sal_False ); // Create new ItemStackType:s
+ SvxRTFItemStackType* _GetAttrSet( int bCopyAttr=sal_False ); // Create new ItemStackType:s
void _ClearStyleAttr( SvxRTFItemStackType& rStkType );
// Sets all the attributes that are different from the current
@@ -413,7 +412,6 @@ public:
class EDITENG_DLLPUBLIC SvxRTFItemStackType
{
friend class SvxRTFParser;
- friend class SvxRTFItemStackList;
SfxItemSet aAttrSet;
SvxNodeIdx *pSttNd, *pEndNd;
@@ -423,14 +421,14 @@ class EDITENG_DLLPUBLIC SvxRTFItemStackType
SvxRTFItemStackType( SfxItemPool&, const sal_uInt16* pWhichRange,
const SvxPosition& );
- ~SvxRTFItemStackType();
- void Add( SvxRTFItemStackTypePtr );
+ void Add( SvxRTFItemStackType* );
void Compress( const SvxRTFParser& );
public:
SvxRTFItemStackType( const SvxRTFItemStackType&, const SvxPosition&,
int bCopyAttr = sal_False );
+ ~SvxRTFItemStackType();
//cmc, I'm very suspicios about SetStartPos, it doesn't change
//its children's starting position, and the implementation looks
//bad, consider this deprecated.
@@ -469,7 +467,7 @@ inline const Color& SvxRTFParser::GetColor( size_t nId ) const
inline SfxItemSet& SvxRTFParser::GetAttrSet()
{
- SvxRTFItemStackTypePtr pTmp;
+ SvxRTFItemStackType* pTmp;
if( bNewGroup || 0 == ( pTmp = aAttrStack.empty() ? 0 : aAttrStack.back()) )
pTmp = _GetAttrSet();
return pTmp->aAttrSet;