Kaydet (Commit) 84052694 authored tarafından Michael Stahl's avatar Michael Stahl Kaydeden (comit) Miklos Vajna

better page descriptor handling in RTF

Change-Id: I88384cf3a059c9988499b63512aafd411cf0dd9a
üst 3536fcd9
......@@ -3233,6 +3233,7 @@ void SwRTFParser::ReadPageDescTbl()
sal_uInt16 nCols = USHRT_MAX, nColSpace = USHRT_MAX, nAktCol = 0;
std::vector<sal_uInt16> aColumns;
::std::map< const SwPageDesc*, sal_uInt16 > aFollowMap; //store index of following page descriptors
while( nNumOpenBrakets && IsParserWorking() )
{
......@@ -3295,10 +3296,9 @@ void SwRTFParser::ReadPageDescTbl()
break;
case RTF_PGDSCNXT:
// setze erstmal nur die Nummer als Follow. Am Ende der
// Tabelle wird diese entsprechend korrigiert !!
// store index of follow in map; will be fixed up later
if( nTokenValue )
pPg->SetFollow( (const SwPageDesc*)nTokenValue );
aFollowMap.insert( ::std::pair<const SwPageDesc*, sal_uInt16>( pPg, nTokenValue ));
else
pPg->SetFollow( &pDoc->GetPageDesc( 0 ) );
break;
......@@ -3466,9 +3466,13 @@ void SwRTFParser::ReadPageDescTbl()
for( nPos = 0; nPos < pDoc->GetPageDescCnt(); ++nPos )
{
SwPageDesc* pPgDsc = &pDoc->GetPageDesc( nPos );
if( (sal_uInt16)(long)pPgDsc->GetFollow() < pDoc->GetPageDescCnt() )
pPgDsc->SetFollow(& pDoc->GetPageDesc((sal_uInt16)(long)
pPgDsc->GetFollow()));
std::map< const SwPageDesc*, sal_uInt16 >::const_iterator aIter =
aFollowMap.find( pPgDsc );
if (aIter != aFollowMap.end())
{
if ((*aIter).second < pDoc->GetPageDescCnt())
pPgDsc->SetFollow(& pDoc->GetPageDesc((*aIter).second));
}
}
SetChkStyleAttr( bSaveChkStyleAttr );
......
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