Kaydet (Commit) 2c05c11b authored tarafından Rafael Dominguez's avatar Rafael Dominguez Kaydeden (comit) Katarina Machalkova

Remove DECLARE_TABLE( SwRTFCharStyleTbl, SwCharFmt* )

üst 99eebb84
...@@ -687,9 +687,15 @@ int SwRTFParser::MakeFieldInst( String& rFieldStr ) ...@@ -687,9 +687,15 @@ int SwRTFParser::MakeFieldInst( String& rFieldStr )
} }
SwFmtRuby aRuby( aData.sUp ); SwFmtRuby aRuby( aData.sUp );
SwCharFmt * pCharFmt = -1 != aData.nStyleNo SwCharFmt * pCharFmt = NULL;
? aCharFmtTbl.Get( aData.nStyleNo )
: 0; if ( aData.nStyleNo != -1)
{
std::map<sal_Int32,SwCharFmt*>::iterator iter = aCharFmtTbl.find(aData.nStyleNo);
if (iter != aCharFmtTbl.end())
pCharFmt = iter->second;
}
if( !pCharFmt ) if( !pCharFmt )
{ {
......
...@@ -2702,7 +2702,7 @@ void SwRTFParser::MakeStyleTab() ...@@ -2702,7 +2702,7 @@ void SwRTFParser::MakeStyleTab()
sal_uInt16 nNo = sal_uInt16( GetStyleTbl().GetCurKey() ); sal_uInt16 nNo = sal_uInt16( GetStyleTbl().GetCurKey() );
if( pStyle->bIsCharFmt ) if( pStyle->bIsCharFmt )
{ {
if( !aCharFmtTbl.Get( nNo ) ) if(aCharFmtTbl.find( nNo ) == aCharFmtTbl.end())
// existiert noch nicht, also anlegen // existiert noch nicht, also anlegen
MakeCharStyle( nNo, *pStyle ); MakeCharStyle( nNo, *pStyle );
} }
...@@ -4009,7 +4009,7 @@ SwCharFmt* SwRTFParser::MakeCharStyle( sal_uInt16 nNo, const SvxRTFStyleType& rS ...@@ -4009,7 +4009,7 @@ SwCharFmt* SwRTFParser::MakeCharStyle( sal_uInt16 nNo, const SvxRTFStyleType& rS
{ {
int bCollExist; int bCollExist;
SwCharFmt* pFmt = MakeCharFmt( rStyle.sName, sal_uInt16(nNo), 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 // in bestehendes Dok einfuegen, dann keine Ableitung usw. setzen
if( bCollExist ) if( bCollExist )
...@@ -4019,14 +4019,18 @@ SwCharFmt* SwRTFParser::MakeCharStyle( sal_uInt16 nNo, const SvxRTFStyleType& rS ...@@ -4019,14 +4019,18 @@ SwCharFmt* SwRTFParser::MakeCharStyle( sal_uInt16 nNo, const SvxRTFStyleType& rS
if( rStyle.bBasedOnIsSet && nStyleNo != nNo ) if( rStyle.bBasedOnIsSet && nStyleNo != nNo )
{ {
SvxRTFStyleType* pDerivedStyle = GetStyleTbl().Get( nStyleNo ); SvxRTFStyleType* pDerivedStyle = GetStyleTbl().Get( nStyleNo );
SwCharFmt* pDerivedFmt = aCharFmtTbl.Get( nStyleNo ); SwCharFmt* pDerivedFmt = NULL;
if( !pDerivedFmt ) // noch nicht vorhanden, also anlegen 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 ? // ist die ueberhaupt als Style vorhanden ?
pDerivedFmt = pDerivedStyle pDerivedFmt = pDerivedStyle
? MakeCharStyle( nStyleNo, *pDerivedStyle ) ? MakeCharStyle( nStyleNo, *pDerivedStyle )
: pDoc->GetDfltCharFmt(); : pDoc->GetDfltCharFmt();
} }
else
pDerivedFmt = iter->second;
if( pFmt == pDerivedFmt ) if( pFmt == pDerivedFmt )
((SfxItemSet&)pFmt->GetAttrSet()).Put( rStyle.aAttrSet ); ((SfxItemSet&)pFmt->GetAttrSet()).Put( rStyle.aAttrSet );
...@@ -4162,9 +4166,10 @@ void SwRTFParser::UnknownAttrToken( int nToken, SfxItemSet* pSet ) ...@@ -4162,9 +4166,10 @@ void SwRTFParser::UnknownAttrToken( int nToken, SfxItemSet* pSet )
break; break;
case RTF_CS: case RTF_CS:
{ {
SwCharFmt* pFmt = aCharFmtTbl.Get( nTokenValue ); std::map<sal_Int32,SwCharFmt*>::iterator iter = aCharFmtTbl.find( nTokenValue );
if( pFmt )
pSet->Put( SwFmtCharFmt( pFmt )); if(iter != aCharFmtTbl.end())
pSet->Put( SwFmtCharFmt(iter->second));
} }
break; break;
......
...@@ -146,7 +146,6 @@ struct SwListEntry ...@@ -146,7 +146,6 @@ struct SwListEntry
bRuleUsed = sal_False; } bRuleUsed = sal_False; }
}; };
DECLARE_TABLE( SwRTFCharStyleTbl, SwCharFmt* )
typedef SwFlySave* SwFlySavePtr; typedef SwFlySave* SwFlySavePtr;
SV_DECL_PTRARR_DEL( SwFlySaveArr, SwFlySavePtr, 0, 20 ) SV_DECL_PTRARR_DEL( SwFlySaveArr, SwFlySavePtr, 0, 20 )
typedef std::deque< SwListEntry > SwListArr; typedef std::deque< SwListEntry > SwListArr;
...@@ -287,7 +286,7 @@ class SwRTFParser : public SvxRTFParser ...@@ -287,7 +286,7 @@ class SwRTFParser : public SvxRTFParser
sw::util::InsertedTablesManager maInsertedTables; sw::util::InsertedTablesManager maInsertedTables;
std::map<sal_Int32,SwTxtFmtColl*> aTxtCollTbl; std::map<sal_Int32,SwTxtFmtColl*> aTxtCollTbl;
SwRTFCharStyleTbl aCharFmtTbl; std::map<sal_Int32,SwCharFmt*> aCharFmtTbl;
SwFlySaveArr aFlyArr; // Flys als Letzes im Doc setzen SwFlySaveArr aFlyArr; // Flys als Letzes im Doc setzen
std::vector<bool> aMergeBoxes; // Flags fuer gemergte Zellen std::vector<bool> aMergeBoxes; // Flags fuer gemergte Zellen
SwListArr aListArr; SwListArr aListArr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment