Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 721806
Collapse All | Expand All

(-)a/sdext/source/pdfimport/inc/pdfiprocessor.hxx (-8 / +4 lines)
Lines 37-45 Link Here
37
#include "treevisitorfactory.hxx"
37
#include "treevisitorfactory.hxx"
38
#include "genericelements.hxx"
38
#include "genericelements.hxx"
39
39
40
#include <boost/bimap/bimap.hpp>
41
#include <boost/bimap/unordered_set_of.hpp>
42
43
namespace pdfi
40
namespace pdfi
44
{
41
{
45
42
Lines 160-169 namespace pdfi Link Here
160
        typedef std::unordered_map<sal_Int32,FontAttributes> IdToFontMap;
157
        typedef std::unordered_map<sal_Int32,FontAttributes> IdToFontMap;
161
        typedef std::unordered_map<FontAttributes,sal_Int32,FontAttrHash> FontToIdMap;
158
        typedef std::unordered_map<FontAttributes,sal_Int32,FontAttrHash> FontToIdMap;
162
159
163
        typedef boost::bimaps::bimap<
160
        typedef std::unordered_map<sal_Int32,GraphicsContext> IdToGCMap;
164
                             boost::bimaps::unordered_set_of<GraphicsContext, GraphicsContextHash>,
161
        typedef std::unordered_map<GraphicsContext, sal_Int32, GraphicsContextHash> GCToIdMap;
165
                             boost::bimaps::unordered_set_of<sal_Int32>
166
                            > GCToIdBiMap;
167
162
168
        typedef std::vector<GraphicsContext> GraphicsContextStack;
163
        typedef std::vector<GraphicsContext> GraphicsContextStack;
169
164
Lines 178-184 namespace pdfi Link Here
178
173
179
        GraphicsContextStack               m_aGCStack;
174
        GraphicsContextStack               m_aGCStack;
180
        sal_Int32                          m_nNextGCId;
175
        sal_Int32                          m_nNextGCId;
181
        GCToIdBiMap                        m_aGCToId;
176
        IdToGCMap                          m_aIdToGC;
177
        GCToIdMap                          m_aGCToId;
182
178
183
        ImageContainer                     m_aImages;
179
        ImageContainer                     m_aImages;
184
180
(-)a/sdext/source/pdfimport/tree/pdfiprocessor.cxx (-10 / +12 lines)
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
- 

Return to bug 721806