summaryrefslogtreecommitdiff
path: root/editeng/source/rtf
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-07-20 12:54:57 +0200
committerMichael Stahl <mstahl@redhat.com>2015-07-20 13:47:40 +0200
commit144d82434ddbb77bb3cd722bc7b636a612bb9db7 (patch)
tree3e2600bcecc729ad16ec6285fd2b5c26ff258a3a /editeng/source/rtf
parent97a0e7558b24792827d77217fb2d8b1106056963 (diff)
editeng: replace boost::ptr_map with std::map<std::unique_ptr>>
Change-Id: Id59fb4ee59872e60094bde85746416c83f058b00
Diffstat (limited to 'editeng/source/rtf')
-rw-r--r--editeng/source/rtf/svxrtf.cxx21
1 files changed, 11 insertions, 10 deletions
diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx
index c4a82217735f..c0f8bedce89f 100644
--- a/editeng/source/rtf/svxrtf.cxx
+++ b/editeng/source/rtf/svxrtf.cxx
@@ -116,7 +116,7 @@ SvParserState SvxRTFParser::CallParser()
ClearColorTbl();
if( !aFontTbl.empty() )
ClearFontTbl();
- if( !aStyleTbl.empty() )
+ if (!m_StyleTable.empty())
ClearStyleTbl();
if( !aAttrStack.empty() )
ClearAttrStack();
@@ -300,7 +300,8 @@ void SvxRTFParser::ReadStyleTable()
int nToken, bSaveChkStyleAttr = bChkStyleAttr ? 1 : 0;
sal_uInt16 nStyleNo = 0;
int _nOpenBrakets = 1; // the first was already detected earlier!!
- SvxRTFStyleType* pStyle = new SvxRTFStyleType( *pAttrPool, &aWhichMap[0] );
+ ::std::unique_ptr<SvxRTFStyleType> pStyle(
+ new SvxRTFStyleType( *pAttrPool, &aWhichMap[0] ));
pStyle->aAttrSet.Put( GetRTFDefaults() );
bIsInReadStyleTab = true;
@@ -348,13 +349,13 @@ void SvxRTFParser::ReadStyleTable()
{
pStyle->sName = DelCharAtEnd( aToken, ';' );
- if( !aStyleTbl.empty() )
+ if (!m_StyleTable.empty())
{
- aStyleTbl.erase(nStyleNo);
+ m_StyleTable.erase(nStyleNo);
}
// All data from the font is available, so off to the table
- aStyleTbl.insert( nStyleNo , pStyle);
- pStyle = new SvxRTFStyleType( *pAttrPool, &aWhichMap[0] );
+ m_StyleTable.insert(std::make_pair(nStyleNo, std::move(pStyle)));
+ pStyle.reset(new SvxRTFStyleType( *pAttrPool, &aWhichMap[0] ));
pStyle->aAttrSet.Put( GetRTFDefaults() );
nStyleNo = 0;
}
@@ -386,7 +387,7 @@ void SvxRTFParser::ReadStyleTable()
break;
}
}
- delete pStyle; // Delete the Last Style
+ pStyle.reset(); // Delete the Last Style
SkipToken( -1 ); // the closing brace is evaluated "above"
// Flag back to old state
@@ -764,7 +765,7 @@ void SvxRTFParser::ClearFontTbl()
void SvxRTFParser::ClearStyleTbl()
{
- aStyleTbl.clear();
+ m_StyleTable.clear();
}
void SvxRTFParser::ClearAttrStack()
@@ -835,7 +836,7 @@ void SvxRTFParser::_ClearStyleAttr( SvxRTFItemStackType& rStkType )
if( !IsChkStyleAttr() ||
!rStkType.GetAttrSet().Count() ||
- aStyleTbl.count( rStkType.nStyleNo ) == 0 )
+ m_StyleTable.count( rStkType.nStyleNo ) == 0 )
{
for( sal_uInt16 nWhich = aIter.GetCurWhich(); nWhich; nWhich = aIter.NextWhich() )
{
@@ -849,7 +850,7 @@ void SvxRTFParser::_ClearStyleAttr( SvxRTFItemStackType& rStkType )
{
// Delete all Attributes, which are already defined in the Style,
// from the current AttrSet.
- SvxRTFStyleType* pStyle = aStyleTbl.find( rStkType.nStyleNo )->second;
+ auto const& pStyle = m_StyleTable.find(rStkType.nStyleNo)->second;
SfxItemSet &rStyleSet = pStyle->aAttrSet;
const SfxPoolItem* pSItem;
for( sal_uInt16 nWhich = aIter.GetCurWhich(); nWhich; nWhich = aIter.NextWhich() )