diff options
author | Rafael Dominguez <venccsralph@gmail.com> | 2011-04-26 10:17:07 -0430 |
---|---|---|
committer | Katarina Machalkova <kmachalkova@suse.cz> | 2011-04-28 12:27:37 +0200 |
commit | 2c05c11b6483e101da75fa85a34a14821d1f7f18 (patch) | |
tree | 4bb8040c9633636cf6442d8258f204e8c6072d3c /sw | |
parent | 99eebb848aa3066143d3238407870f874db9d4e0 (diff) |
Remove DECLARE_TABLE( SwRTFCharStyleTbl, SwCharFmt* )
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/rtf/rtffld.cxx | 12 | ||||
-rw-r--r-- | sw/source/filter/rtf/swparrtf.cxx | 19 | ||||
-rw-r--r-- | sw/source/filter/rtf/swparrtf.hxx | 3 |
3 files changed, 22 insertions, 12 deletions
diff --git a/sw/source/filter/rtf/rtffld.cxx b/sw/source/filter/rtf/rtffld.cxx index e0e32329b1af..0300efc5277c 100644 --- a/sw/source/filter/rtf/rtffld.cxx +++ b/sw/source/filter/rtf/rtffld.cxx @@ -687,9 +687,15 @@ int SwRTFParser::MakeFieldInst( String& rFieldStr ) } SwFmtRuby aRuby( aData.sUp ); - SwCharFmt * pCharFmt = -1 != aData.nStyleNo - ? aCharFmtTbl.Get( aData.nStyleNo ) - : 0; + SwCharFmt * pCharFmt = NULL; + + if ( aData.nStyleNo != -1) + { + std::map<sal_Int32,SwCharFmt*>::iterator iter = aCharFmtTbl.find(aData.nStyleNo); + + if (iter != aCharFmtTbl.end()) + pCharFmt = iter->second; + } if( !pCharFmt ) { diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx index c9fb0df44230..babdb658755e 100644 --- a/sw/source/filter/rtf/swparrtf.cxx +++ b/sw/source/filter/rtf/swparrtf.cxx @@ -2702,7 +2702,7 @@ void SwRTFParser::MakeStyleTab() sal_uInt16 nNo = sal_uInt16( GetStyleTbl().GetCurKey() ); if( pStyle->bIsCharFmt ) { - if( !aCharFmtTbl.Get( nNo ) ) + if(aCharFmtTbl.find( nNo ) == aCharFmtTbl.end()) // existiert noch nicht, also anlegen MakeCharStyle( nNo, *pStyle ); } @@ -4009,7 +4009,7 @@ SwCharFmt* SwRTFParser::MakeCharStyle( sal_uInt16 nNo, const SvxRTFStyleType& rS { int bCollExist; SwCharFmt* pFmt = MakeCharFmt( rStyle.sName, sal_uInt16(nNo), bCollExist ); - aCharFmtTbl.Insert( nNo, pFmt ); + aCharFmtTbl.insert(std::make_pair(nNo,pFmt)); // in bestehendes Dok einfuegen, dann keine Ableitung usw. setzen if( bCollExist ) @@ -4019,14 +4019,18 @@ SwCharFmt* SwRTFParser::MakeCharStyle( sal_uInt16 nNo, const SvxRTFStyleType& rS if( rStyle.bBasedOnIsSet && nStyleNo != nNo ) { SvxRTFStyleType* pDerivedStyle = GetStyleTbl().Get( nStyleNo ); - SwCharFmt* pDerivedFmt = aCharFmtTbl.Get( nStyleNo ); - if( !pDerivedFmt ) // noch nicht vorhanden, also anlegen + SwCharFmt* pDerivedFmt = NULL; + std::map<sal_Int32,SwCharFmt*>::iterator iter = aCharFmtTbl.find( nStyleNo ); + + if(iter == aCharFmtTbl.end()) // noch nicht vorhanden, also anlegen { // ist die ueberhaupt als Style vorhanden ? pDerivedFmt = pDerivedStyle ? MakeCharStyle( nStyleNo, *pDerivedStyle ) : pDoc->GetDfltCharFmt(); } + else + pDerivedFmt = iter->second; if( pFmt == pDerivedFmt ) ((SfxItemSet&)pFmt->GetAttrSet()).Put( rStyle.aAttrSet ); @@ -4162,9 +4166,10 @@ void SwRTFParser::UnknownAttrToken( int nToken, SfxItemSet* pSet ) break; case RTF_CS: { - SwCharFmt* pFmt = aCharFmtTbl.Get( nTokenValue ); - if( pFmt ) - pSet->Put( SwFmtCharFmt( pFmt )); + std::map<sal_Int32,SwCharFmt*>::iterator iter = aCharFmtTbl.find( nTokenValue ); + + if(iter != aCharFmtTbl.end()) + pSet->Put( SwFmtCharFmt(iter->second)); } break; diff --git a/sw/source/filter/rtf/swparrtf.hxx b/sw/source/filter/rtf/swparrtf.hxx index 5d8ac6469f7d..b908bf6c46a8 100644 --- a/sw/source/filter/rtf/swparrtf.hxx +++ b/sw/source/filter/rtf/swparrtf.hxx @@ -146,7 +146,6 @@ struct SwListEntry bRuleUsed = sal_False; } }; -DECLARE_TABLE( SwRTFCharStyleTbl, SwCharFmt* ) typedef SwFlySave* SwFlySavePtr; SV_DECL_PTRARR_DEL( SwFlySaveArr, SwFlySavePtr, 0, 20 ) typedef std::deque< SwListEntry > SwListArr; @@ -287,7 +286,7 @@ class SwRTFParser : public SvxRTFParser sw::util::InsertedTablesManager maInsertedTables; std::map<sal_Int32,SwTxtFmtColl*> aTxtCollTbl; - SwRTFCharStyleTbl aCharFmtTbl; + std::map<sal_Int32,SwCharFmt*> aCharFmtTbl; SwFlySaveArr aFlyArr; // Flys als Letzes im Doc setzen std::vector<bool> aMergeBoxes; // Flags fuer gemergte Zellen SwListArr aListArr; |