Lines 54-59
namespace pdfi
Link Here
|
54 |
m_aFontToId(), |
54 |
m_aFontToId(), |
55 |
m_aGCStack(), |
55 |
m_aGCStack(), |
56 |
m_nNextGCId( 1 ), |
56 |
m_nNextGCId( 1 ), |
|
|
57 |
m_aIdToGC(), |
57 |
m_aGCToId(), |
58 |
m_aGCToId(), |
58 |
m_aImages(), |
59 |
m_aImages(), |
59 |
m_nPages(0), |
60 |
m_nPages(0), |
Lines 65-76
namespace pdfi
Link Here
|
65 |
aDefFont.isBold = false; |
66 |
aDefFont.isBold = false; |
66 |
aDefFont.isItalic = false; |
67 |
aDefFont.isItalic = false; |
67 |
aDefFont.size = 10*PDFI_OUTDEV_RESOLUTION/72; |
68 |
aDefFont.size = 10*PDFI_OUTDEV_RESOLUTION/72; |
68 |
m_aIdToFont[ 0 ] = aDefFont; |
69 |
m_aIdToFont.insert({0, aDefFont}); |
69 |
m_aFontToId[ aDefFont ] = 0; |
70 |
m_aFontToId.insert({aDefFont, 0}); |
70 |
|
71 |
|
71 |
GraphicsContext aDefGC; |
72 |
GraphicsContext aDefGC; |
72 |
m_aGCStack.push_back( aDefGC ); |
73 |
m_aGCStack.push_back( aDefGC ); |
73 |
m_aGCToId.insert(GCToIdBiMap::relation(aDefGC, 0)); |
74 |
m_aGCToId.insert({aDefGC, 0}); |
|
|
75 |
m_aIdToGC.insert({0, aDefGC}); |
74 |
} |
76 |
} |
75 |
|
77 |
|
76 |
void PDFIProcessor::setPageNum( sal_Int32 nPages ) |
78 |
void PDFIProcessor::setPageNum( sal_Int32 nPages ) |
Lines 468-479
const FontAttributes& PDFIProcessor::getFont( sal_Int32 nFontId ) const
Link Here
|
468 |
sal_Int32 PDFIProcessor::getGCId( const GraphicsContext& rGC ) |
470 |
sal_Int32 PDFIProcessor::getGCId( const GraphicsContext& rGC ) |
469 |
{ |
471 |
{ |
470 |
sal_Int32 nGCId = 0; |
472 |
sal_Int32 nGCId = 0; |
471 |
auto it = m_aGCToId.left.find( rGC ); |
473 |
auto it = m_aGCToId.find( rGC ); |
472 |
if( it != m_aGCToId.left.end() ) |
474 |
if( it != m_aGCToId.end() ) |
473 |
nGCId = it->second; |
475 |
nGCId = it->second; |
474 |
else |
476 |
else |
475 |
{ |
477 |
{ |
476 |
m_aGCToId.insert(GCToIdBiMap::relation(rGC, m_nNextGCId)); |
478 |
m_aGCToId.insert({rGC, m_nNextGCId}); |
|
|
479 |
m_aIdToGC.insert({m_nNextGCId, rGC}); |
477 |
nGCId = m_nNextGCId; |
480 |
nGCId = m_nNextGCId; |
478 |
m_nNextGCId++; |
481 |
m_nNextGCId++; |
479 |
} |
482 |
} |
Lines 483-491
sal_Int32 PDFIProcessor::getGCId( const GraphicsContext& rGC )
Link Here
|
483 |
|
486 |
|
484 |
const GraphicsContext& PDFIProcessor::getGraphicsContext( sal_Int32 nGCId ) const |
487 |
const GraphicsContext& PDFIProcessor::getGraphicsContext( sal_Int32 nGCId ) const |
485 |
{ |
488 |
{ |
486 |
auto it = m_aGCToId.right.find( nGCId ); |
489 |
auto it = m_aIdToGC.find( nGCId ); |
487 |
if( it == m_aGCToId.right.end() ) |
490 |
if( it == m_aIdToGC.end() ) |
488 |
it = m_aGCToId.right.find( 0 ); |
491 |
it = m_aIdToGC.find( 0 ); |
489 |
return it->second; |
492 |
return it->second; |
490 |
} |
493 |
} |
491 |
|
494 |
|
492 |
- |
|
|