summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editeng/source/rtf/svxrtf.cxx15
-rw-r--r--include/editeng/svxrtf.hxx10
2 files changed, 9 insertions, 16 deletions
diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx
index b9d6dd33a887..297320a5658e 100644
--- a/editeng/source/rtf/svxrtf.cxx
+++ b/editeng/source/rtf/svxrtf.cxx
@@ -73,8 +73,8 @@ SvxRTFParser::SvxRTFParser( SfxItemPool& rPool, SvStream& rIn )
, bIsLeftToRightDef( true)
, bIsInReadStyleTab( false)
{
- pDfltFont = new vcl::Font;
- pDfltColor = new Color;
+ pDfltFont.reset( new vcl::Font );
+ pDfltColor.reset( new Color );
}
SvxRTFParser::~SvxRTFParser()
@@ -83,18 +83,11 @@ SvxRTFParser::~SvxRTFParser()
ClearColorTbl();
if( !aAttrStack.empty() )
ClearAttrStack();
-
- delete pRTFDefaults;
-
- delete pInsPos;
- delete pDfltFont;
- delete pDfltColor;
}
void SvxRTFParser::SetInsPos( const EditPosition& rNew )
{
- delete pInsPos;
- pInsPos = rNew.Clone();
+ pInsPos.reset( rNew.Clone() );
}
SvParserState SvxRTFParser::CallParser()
@@ -914,7 +907,7 @@ const SfxItemSet& SvxRTFParser::GetRTFDefaults()
{
if( !pRTFDefaults )
{
- pRTFDefaults = new SfxItemSet( *pAttrPool, &aWhichMap[0] );
+ pRTFDefaults.reset( new SfxItemSet( *pAttrPool, &aWhichMap[0] ) );
sal_uInt16 nId;
if( 0 != ( nId = aPardMap.nScriptSpace ))
{
diff --git a/include/editeng/svxrtf.hxx b/include/editeng/svxrtf.hxx
index 73e885553a43..8273e64b6f12 100644
--- a/include/editeng/svxrtf.hxx
+++ b/include/editeng/svxrtf.hxx
@@ -187,11 +187,11 @@ class EDITENG_DLLPUBLIC SvxRTFParser : public SvRTFParser
RTFPardAttrMapIds aPardMap;
std::vector<sal_uInt16> aWhichMap;
- EditPosition* pInsPos;
+ std::unique_ptr<EditPosition> pInsPos;
SfxItemPool* pAttrPool;
- Color* pDfltColor;
- vcl::Font* pDfltFont;
- SfxItemSet *pRTFDefaults;
+ std::unique_ptr<Color> pDfltColor;
+ std::unique_ptr<vcl::Font> pDfltFont;
+ std::unique_ptr<SfxItemSet> pRTFDefaults;
int nDfltFont;
@@ -355,7 +355,7 @@ public:
inline const Color& SvxRTFParser::GetColor( size_t nId ) const
{
- Color* pColor = pDfltColor;
+ Color* pColor = pDfltColor.get();
if( nId < aColorTbl.size() )
pColor = aColorTbl[ nId ];
return *pColor;