porting extensions to boost containers
This commit is contained in:
parent
6bf614b7ee
commit
a91b24db4a
17 changed files with 50 additions and 50 deletions
|
@ -32,7 +32,7 @@
|
|||
#include "pppoptimizertoken.hxx"
|
||||
#include <osl/mutex.hxx>
|
||||
#include <sal/macros.h>
|
||||
#include <hash_map>
|
||||
#include <boost/unordered_map.hpp>
|
||||
#include <string.h>
|
||||
|
||||
struct TCheck
|
||||
|
@ -42,7 +42,7 @@ struct TCheck
|
|||
return strcmp( s1, s2 ) == 0;
|
||||
}
|
||||
};
|
||||
typedef std::hash_map< const char*, PPPOptimizerTokenEnum, std::hash<const char*>, TCheck> TypeNameHashMap;
|
||||
typedef boost::unordered_map< const char*, PPPOptimizerTokenEnum, std::hash<const char*>, TCheck> TypeNameHashMap;
|
||||
static TypeNameHashMap* pHashMap = NULL;
|
||||
static ::osl::Mutex& getHashMapMutex()
|
||||
{
|
||||
|
|
|
@ -634,7 +634,7 @@ uno::Reference< io::XStream > getAdditionalStream( const rtl::OUString&
|
|||
if( pTrailer && pTrailer->m_pDict )
|
||||
{
|
||||
// search document checksum entry
|
||||
std::hash_map< rtl::OString,
|
||||
boost::unordered_map< rtl::OString,
|
||||
pdfparse::PDFEntry*,
|
||||
rtl::OStringHash >::iterator chk;
|
||||
chk = pTrailer->m_pDict->m_aMap.find( "DocChecksum" );
|
||||
|
@ -651,7 +651,7 @@ uno::Reference< io::XStream > getAdditionalStream( const rtl::OUString&
|
|||
}
|
||||
|
||||
// search for AdditionalStreams entry
|
||||
std::hash_map< rtl::OString,
|
||||
boost::unordered_map< rtl::OString,
|
||||
pdfparse::PDFEntry*,
|
||||
rtl::OStringHash >::iterator add_stream;
|
||||
add_stream = pTrailer->m_pDict->m_aMap.find( "AdditionalStreams" );
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
#include <com/sun/star/rendering/XColorSpace.hpp>
|
||||
|
||||
#include <vector>
|
||||
#include <hash_map>
|
||||
#include <boost/unordered_map.hpp>
|
||||
|
||||
// virtual resolution of the PDF OutputDev in dpi
|
||||
#define PDFI_OUTDEV_RESOLUTION 7200
|
||||
|
@ -49,7 +49,7 @@ namespace com { namespace sun { namespace star { namespace task
|
|||
|
||||
namespace pdfi
|
||||
{
|
||||
typedef std::hash_map< rtl::OUString, rtl::OUString, rtl::OUStringHash > PropertyMap;
|
||||
typedef boost::unordered_map< rtl::OUString, rtl::OUString, rtl::OUStringHash > PropertyMap;
|
||||
typedef sal_Int32 ImageId;
|
||||
|
||||
/// What to do with a polygon. values can be ORed together
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#include <rtl/string.hxx>
|
||||
|
||||
#include <vector>
|
||||
#include <hash_map>
|
||||
#include <boost/unordered_map.hpp>
|
||||
|
||||
namespace pdfparse
|
||||
{
|
||||
|
@ -189,7 +189,7 @@ struct PDFArray : public PDFContainer
|
|||
|
||||
struct PDFDict : public PDFContainer
|
||||
{
|
||||
typedef std::hash_map<rtl::OString,PDFEntry*,rtl::OStringHash> Map;
|
||||
typedef boost::unordered_map<rtl::OString,PDFEntry*,rtl::OStringHash> Map;
|
||||
Map m_aMap;
|
||||
|
||||
PDFDict() {}
|
||||
|
|
|
@ -486,7 +486,7 @@ void PDFDict::insertValue( const OString& rName, PDFEntry* pValue )
|
|||
if( ! pValue )
|
||||
eraseValue( rName );
|
||||
|
||||
std::hash_map<OString,PDFEntry*,OStringHash>::iterator it = m_aMap.find( rName );
|
||||
boost::unordered_map<OString,PDFEntry*,OStringHash>::iterator it = m_aMap.find( rName );
|
||||
if( it == m_aMap.end() )
|
||||
{
|
||||
// new name/value, pair, append it
|
||||
|
@ -580,7 +580,7 @@ unsigned int PDFStream::getDictLength( const PDFContainer* pContainer ) const
|
|||
if( ! m_pDict )
|
||||
return 0;
|
||||
// find /Length entry, can either be a direct or indirect number object
|
||||
std::hash_map<OString,PDFEntry*,OStringHash>::const_iterator it =
|
||||
boost::unordered_map<OString,PDFEntry*,OStringHash>::const_iterator it =
|
||||
m_pDict->m_aMap.find( "Length" );
|
||||
if( it == m_pDict->m_aMap.end() )
|
||||
return 0;
|
||||
|
@ -635,7 +635,7 @@ bool PDFObject::getDeflatedStream( char** ppStream, unsigned int* pBytes, const
|
|||
return false;
|
||||
}
|
||||
// is there a filter entry ?
|
||||
std::hash_map<OString,PDFEntry*,OStringHash>::const_iterator it =
|
||||
boost::unordered_map<OString,PDFEntry*,OStringHash>::const_iterator it =
|
||||
m_pStream->m_pDict->m_aMap.find( "Filter" );
|
||||
if( it != m_pStream->m_pDict->m_aMap.end() )
|
||||
{
|
||||
|
|
|
@ -34,10 +34,10 @@
|
|||
namespace pdfi
|
||||
{
|
||||
|
||||
SaxAttrList::SaxAttrList( const std::hash_map< rtl::OUString, rtl::OUString, rtl::OUStringHash >& rMap )
|
||||
SaxAttrList::SaxAttrList( const boost::unordered_map< rtl::OUString, rtl::OUString, rtl::OUStringHash >& rMap )
|
||||
{
|
||||
m_aAttributes.reserve(rMap.size());
|
||||
for( std::hash_map< rtl::OUString,
|
||||
for( boost::unordered_map< rtl::OUString,
|
||||
rtl::OUString,
|
||||
rtl::OUStringHash >::const_iterator it = rMap.begin();
|
||||
it != rMap.end(); ++it )
|
||||
|
@ -92,7 +92,7 @@ rtl::OUString SAL_CALL SaxAttrList::getValueByIndex( sal_Int16 i_nIndex ) throw(
|
|||
|
||||
rtl::OUString SAL_CALL SaxAttrList::getValueByName(const ::rtl::OUString& i_rName) throw()
|
||||
{
|
||||
std::hash_map< rtl::OUString, size_t, rtl::OUStringHash >::const_iterator it = m_aIndexMap.find( i_rName );
|
||||
boost::unordered_map< rtl::OUString, size_t, rtl::OUStringHash >::const_iterator it = m_aIndexMap.find( i_rName );
|
||||
return (it != m_aIndexMap.end()) ? m_aAttributes[it->second].m_aValue : rtl::OUString();
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
#include <rtl/ustring.hxx>
|
||||
#include <vector>
|
||||
#include <hash_map>
|
||||
#include <boost/unordered_map.hpp>
|
||||
#include <cppuhelper/implbase2.hxx>
|
||||
|
||||
#include <com/sun/star/util/XCloneable.hpp>
|
||||
|
@ -53,11 +53,11 @@ namespace pdfi
|
|||
: m_aName( i_rName ), m_aValue( i_rValue ) {}
|
||||
};
|
||||
std::vector< AttrEntry > m_aAttributes;
|
||||
std::hash_map< rtl::OUString, size_t, rtl::OUStringHash > m_aIndexMap;
|
||||
boost::unordered_map< rtl::OUString, size_t, rtl::OUStringHash > m_aIndexMap;
|
||||
|
||||
public:
|
||||
SaxAttrList() {}
|
||||
SaxAttrList( const std::hash_map< rtl::OUString, rtl::OUString, rtl::OUStringHash >& );
|
||||
SaxAttrList( const boost::unordered_map< rtl::OUString, rtl::OUString, rtl::OUStringHash >& );
|
||||
SaxAttrList( const SaxAttrList& );
|
||||
virtual ~SaxAttrList();
|
||||
|
||||
|
|
|
@ -307,7 +307,7 @@ int write_addStreams( const char* pInFile, const char* pOutFile, PDFFile* pPDFFi
|
|||
if( pTrailer && pTrailer->m_pDict )
|
||||
{
|
||||
// search for AdditionalStreams entry
|
||||
std::hash_map<rtl::OString,PDFEntry*,rtl::OStringHash>::iterator add_stream;
|
||||
boost::unordered_map<rtl::OString,PDFEntry*,rtl::OStringHash>::iterator add_stream;
|
||||
add_stream = pTrailer->m_pDict->m_aMap.find( "AdditionalStreams" );
|
||||
if( add_stream != pTrailer->m_pDict->m_aMap.end() )
|
||||
{
|
||||
|
@ -334,7 +334,7 @@ int write_fonts( const char* i_pInFile, const char* i_pOutFile, PDFFile* i_pPDFF
|
|||
if( ! pDict )
|
||||
continue;
|
||||
|
||||
std::hash_map<rtl::OString,PDFEntry*,rtl::OStringHash>::iterator map_it =
|
||||
boost::unordered_map<rtl::OString,PDFEntry*,rtl::OStringHash>::iterator map_it =
|
||||
pDict->m_aMap.find( "Type" );
|
||||
if( map_it == pDict->m_aMap.end() )
|
||||
continue;
|
||||
|
|
|
@ -69,7 +69,7 @@
|
|||
#include <basegfx/polygon/b2dpolygonclipper.hxx>
|
||||
|
||||
#include <vector>
|
||||
#include <hash_map>
|
||||
#include <boost/unordered_map.hpp>
|
||||
|
||||
|
||||
using namespace ::pdfparse;
|
||||
|
@ -445,11 +445,11 @@ namespace
|
|||
{
|
||||
}
|
||||
|
||||
typedef std::hash_map<sal_Int32,FontAttributes> IdToFontMap;
|
||||
typedef std::hash_map<FontAttributes,sal_Int32,FontAttrHash> FontToIdMap;
|
||||
typedef boost::unordered_map<sal_Int32,FontAttributes> IdToFontMap;
|
||||
typedef boost::unordered_map<FontAttributes,sal_Int32,FontAttrHash> FontToIdMap;
|
||||
|
||||
typedef std::hash_map<sal_Int32,GraphicsContext> IdToGCMap;
|
||||
typedef std::hash_map<GraphicsContext,sal_Int32,GraphicsContextHash> GCToIdMap;
|
||||
typedef boost::unordered_map<sal_Int32,GraphicsContext> IdToGCMap;
|
||||
typedef boost::unordered_map<GraphicsContext,sal_Int32,GraphicsContextHash> GCToIdMap;
|
||||
|
||||
typedef std::vector<GraphicsContext> GraphicsContextStack;
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
#include <com/sun/star/awt/XBitmap.hpp>
|
||||
|
||||
#include <vector>
|
||||
#include <hash_map>
|
||||
#include <boost/unordered_map.hpp>
|
||||
|
||||
namespace pdfi
|
||||
{
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <list>
|
||||
#include <hash_map>
|
||||
#include <boost/unordered_map.hpp>
|
||||
|
||||
#include "imagecontainer.hxx"
|
||||
#include "pdfihelper.hxx"
|
||||
|
@ -203,11 +203,11 @@ namespace pdfi
|
|||
|
||||
void setupImage(ImageId nImage);
|
||||
|
||||
typedef std::hash_map<sal_Int32,FontAttributes> IdToFontMap;
|
||||
typedef std::hash_map<FontAttributes,sal_Int32,FontAttrHash> FontToIdMap;
|
||||
typedef boost::unordered_map<sal_Int32,FontAttributes> IdToFontMap;
|
||||
typedef boost::unordered_map<FontAttributes,sal_Int32,FontAttrHash> FontToIdMap;
|
||||
|
||||
typedef std::hash_map<sal_Int32,GraphicsContext> IdToGCMap;
|
||||
typedef std::hash_map<GraphicsContext,sal_Int32,GraphicsContextHash> GCToIdMap;
|
||||
typedef boost::unordered_map<sal_Int32,GraphicsContext> IdToGCMap;
|
||||
typedef boost::unordered_map<GraphicsContext,sal_Int32,GraphicsContextHash> GCToIdMap;
|
||||
|
||||
typedef std::vector<GraphicsContext> GraphicsContextStack;
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ sal_Int32 StyleContainer::impl_getStyleId( const Style& rStyle, bool bSubStyle )
|
|||
for( unsigned int n = 0; n < rStyle.SubStyles.size(); ++n )
|
||||
aSearchStyle.SubStyles.push_back( impl_getStyleId( *rStyle.SubStyles[n], true ) );
|
||||
|
||||
std::hash_map< HashedStyle, sal_Int32, StyleHash >::iterator it =
|
||||
boost::unordered_map< HashedStyle, sal_Int32, StyleHash >::iterator it =
|
||||
m_aStyleToId.find( aSearchStyle );
|
||||
|
||||
if( it != m_aStyleToId.end() )
|
||||
|
@ -98,7 +98,7 @@ sal_Int32 StyleContainer::getStandardStyleId( const rtl::OString& rName )
|
|||
|
||||
const PropertyMap* StyleContainer::getProperties( sal_Int32 nStyleId ) const
|
||||
{
|
||||
std::hash_map< sal_Int32, HashedStyle >::const_iterator it =
|
||||
boost::unordered_map< sal_Int32, HashedStyle >::const_iterator it =
|
||||
m_aIdToStyle.find( nStyleId );
|
||||
return it != m_aIdToStyle.end() ? &(it->second.Properties) : NULL;
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ const PropertyMap* StyleContainer::getProperties( sal_Int32 nStyleId ) const
|
|||
sal_Int32 StyleContainer::setProperties( sal_Int32 nStyleId, const PropertyMap& rNewProps )
|
||||
{
|
||||
sal_Int32 nRet = -1;
|
||||
std::hash_map< sal_Int32, HashedStyle >::iterator it =
|
||||
boost::unordered_map< sal_Int32, HashedStyle >::iterator it =
|
||||
m_aIdToStyle.find( nStyleId );
|
||||
if( it != m_aIdToStyle.end() )
|
||||
{
|
||||
|
@ -134,7 +134,7 @@ sal_Int32 StyleContainer::setProperties( sal_Int32 nStyleId, const PropertyMap&
|
|||
aSearchStyle.IsSubStyle = it->second.IsSubStyle;
|
||||
|
||||
// find out whether this new style already exists
|
||||
std::hash_map< HashedStyle, sal_Int32, StyleHash >::iterator new_it =
|
||||
boost::unordered_map< HashedStyle, sal_Int32, StyleHash >::iterator new_it =
|
||||
m_aStyleToId.find( aSearchStyle );
|
||||
if( new_it != m_aStyleToId.end() )
|
||||
{
|
||||
|
@ -160,7 +160,7 @@ OUString StyleContainer::getStyleName( sal_Int32 nStyle ) const
|
|||
{
|
||||
OUStringBuffer aRet( 64 );
|
||||
|
||||
std::hash_map< sal_Int32, HashedStyle >::const_iterator style_it =
|
||||
boost::unordered_map< sal_Int32, HashedStyle >::const_iterator style_it =
|
||||
m_aIdToStyle.find( nStyle );
|
||||
if( style_it != m_aIdToStyle.end() )
|
||||
{
|
||||
|
@ -197,7 +197,7 @@ void StyleContainer::impl_emitStyle( sal_Int32 nStyleId,
|
|||
EmitContext& rContext,
|
||||
ElementTreeVisitor& rContainedElemVisitor )
|
||||
{
|
||||
std::hash_map< sal_Int32, HashedStyle >::const_iterator it = m_aIdToStyle.find( nStyleId );
|
||||
boost::unordered_map< sal_Int32, HashedStyle >::const_iterator it = m_aIdToStyle.find( nStyleId );
|
||||
if( it != m_aIdToStyle.end() )
|
||||
{
|
||||
const HashedStyle& rStyle = it->second;
|
||||
|
@ -221,7 +221,7 @@ void StyleContainer::emit( EmitContext& rContext,
|
|||
ElementTreeVisitor& rContainedElemVisitor )
|
||||
{
|
||||
std::vector< sal_Int32 > aMasterPageSection, aAutomaticStyleSection, aOfficeStyleSection;
|
||||
for( std::hash_map< sal_Int32, HashedStyle >::iterator it = m_aIdToStyle.begin();
|
||||
for( boost::unordered_map< sal_Int32, HashedStyle >::iterator it = m_aIdToStyle.begin();
|
||||
it != m_aIdToStyle.end(); ++it )
|
||||
{
|
||||
if( ! it->second.IsSubStyle )
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#define INCLUDED_PDFI_STYLE_HXX
|
||||
|
||||
#include "pdfihelper.hxx"
|
||||
#include <hash_map>
|
||||
#include <boost/unordered_map.hpp>
|
||||
#include <vector>
|
||||
#include <rtl/ustring.hxx>
|
||||
#include <rtl/string.hxx>
|
||||
|
@ -133,16 +133,16 @@ namespace pdfi
|
|||
friend struct StyleIdNameSort;
|
||||
struct StyleIdNameSort
|
||||
{
|
||||
const std::hash_map< sal_Int32, HashedStyle >* m_pMap;
|
||||
const boost::unordered_map< sal_Int32, HashedStyle >* m_pMap;
|
||||
|
||||
StyleIdNameSort( const std::hash_map< sal_Int32, HashedStyle >* pMap ) :
|
||||
StyleIdNameSort( const boost::unordered_map< sal_Int32, HashedStyle >* pMap ) :
|
||||
m_pMap(pMap)
|
||||
{}
|
||||
bool operator()( sal_Int32 nLeft, sal_Int32 nRight )
|
||||
{
|
||||
const std::hash_map< sal_Int32, HashedStyle >::const_iterator left_it =
|
||||
const boost::unordered_map< sal_Int32, HashedStyle >::const_iterator left_it =
|
||||
m_pMap->find( nLeft );
|
||||
const std::hash_map< sal_Int32, HashedStyle >::const_iterator right_it =
|
||||
const boost::unordered_map< sal_Int32, HashedStyle >::const_iterator right_it =
|
||||
m_pMap->find( nRight );
|
||||
if( left_it == m_pMap->end() )
|
||||
return false;
|
||||
|
@ -154,8 +154,8 @@ namespace pdfi
|
|||
};
|
||||
|
||||
sal_Int32 m_nNextId;
|
||||
std::hash_map< sal_Int32, HashedStyle > m_aIdToStyle;
|
||||
std::hash_map< HashedStyle, sal_Int32, StyleHash > m_aStyleToId;
|
||||
boost::unordered_map< sal_Int32, HashedStyle > m_aIdToStyle;
|
||||
boost::unordered_map< HashedStyle, sal_Int32, StyleHash > m_aStyleToId;
|
||||
|
||||
void impl_emitStyle( sal_Int32 nStyleId,
|
||||
EmitContext& rContext,
|
||||
|
|
|
@ -69,7 +69,7 @@
|
|||
#include <boost/scoped_ptr.hpp>
|
||||
#include <boost/scoped_array.hpp>
|
||||
|
||||
#include <hash_map>
|
||||
#include <boost/unordered_map.hpp>
|
||||
#include <string.h>
|
||||
#ifdef WNT
|
||||
#include <stdlib.h>
|
||||
|
@ -148,7 +148,7 @@ enum parseKey {
|
|||
|
||||
class Parser
|
||||
{
|
||||
typedef std::hash_map< sal_Int64,
|
||||
typedef boost::unordered_map< sal_Int64,
|
||||
FontAttributes > FontMapType;
|
||||
|
||||
const uno::Reference<uno::XComponentContext> m_xContext;
|
||||
|
|
|
@ -658,7 +658,7 @@ void PDFOutDev::updateFont(GfxState *state)
|
|||
Ref* pID = gfxFont->getID();
|
||||
// TODO(Q3): Portability problem
|
||||
long long fontID = (long long)pID->gen << 32 | (long long)pID->num;
|
||||
std::hash_map< long long, FontAttributes >::const_iterator it =
|
||||
boost::unordered_map< long long, FontAttributes >::const_iterator it =
|
||||
m_aFontMap.find( fontID );
|
||||
if( it == m_aFontMap.end() )
|
||||
{
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#include <hash_map>
|
||||
#include <boost/unordered_map.hpp>
|
||||
#include <vector>
|
||||
|
||||
class GfxPath;
|
||||
|
@ -147,7 +147,7 @@ namespace pdfi
|
|||
{
|
||||
// not owned by this class
|
||||
PDFDoc* m_pDoc;
|
||||
mutable std::hash_map< long long,
|
||||
mutable boost::unordered_map< long long,
|
||||
FontAttributes > m_aFontMap;
|
||||
UnicodeMap* m_pUtf8Map;
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#include <com/sun/star/frame/XDispatch.hpp>
|
||||
#include <com/sun/star/lang/XInitialization.hpp>
|
||||
#include <com/sun/star/uno/XComponentContext.hpp>
|
||||
#include <hash_map>
|
||||
#include <boost/unordered_map.hpp>
|
||||
#include <rtl/ref.hxx>
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
|
|
Loading…
Reference in a new issue