summaryrefslogtreecommitdiff
path: root/sdext
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-10-19 17:18:17 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-10-23 08:15:35 +0200
commit87a9979c8938b800aab6e35903d60d24892e7f2e (patch)
tree6beb01f22537e63df24c023ab65d391a7bee0cf6 /sdext
parentd76c4e5c9aaf8bd27ec97679bcaeba5b18aca493 (diff)
overload std::hash for OUString and OString
no need to explicitly specify it anymore Change-Id: I6ad9259cce77201fdd75152533f5151aae83e9ec Reviewed-on: https://gerrit.libreoffice.org/43567 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sdext')
-rw-r--r--sdext/source/pdfimport/filterdet.cxx6
-rw-r--r--sdext/source/pdfimport/inc/pdfihelper.hxx2
-rw-r--r--sdext/source/pdfimport/inc/pdfparse.hxx2
-rw-r--r--sdext/source/pdfimport/pdfparse/pdfentries.cxx8
-rw-r--r--sdext/source/pdfimport/sax/saxattrlist.cxx7
-rw-r--r--sdext/source/pdfimport/sax/saxattrlist.hxx4
-rw-r--r--sdext/source/pdfimport/test/pdfunzip.cxx4
7 files changed, 15 insertions, 18 deletions
diff --git a/sdext/source/pdfimport/filterdet.cxx b/sdext/source/pdfimport/filterdet.cxx
index a1bb1946a939..57e8681544e8 100644
--- a/sdext/source/pdfimport/filterdet.cxx
+++ b/sdext/source/pdfimport/filterdet.cxx
@@ -491,8 +491,7 @@ uno::Reference< io::XStream > getAdditionalStream( const OUString&
{
// search document checksum entry
std::unordered_map< OString,
- pdfparse::PDFEntry*,
- OStringHash >::iterator chk;
+ pdfparse::PDFEntry* >::iterator chk;
chk = pTrailer->m_pDict->m_aMap.find( "DocChecksum" );
if( chk == pTrailer->m_pDict->m_aMap.end() )
{
@@ -508,8 +507,7 @@ uno::Reference< io::XStream > getAdditionalStream( const OUString&
// search for AdditionalStreams entry
std::unordered_map< OString,
- pdfparse::PDFEntry*,
- OStringHash >::iterator add_stream;
+ pdfparse::PDFEntry* >::iterator add_stream;
add_stream = pTrailer->m_pDict->m_aMap.find( "AdditionalStreams" );
if( add_stream == pTrailer->m_pDict->m_aMap.end() )
{
diff --git a/sdext/source/pdfimport/inc/pdfihelper.hxx b/sdext/source/pdfimport/inc/pdfihelper.hxx
index e989279a32b7..e77b0569d1d2 100644
--- a/sdext/source/pdfimport/inc/pdfihelper.hxx
+++ b/sdext/source/pdfimport/inc/pdfihelper.hxx
@@ -43,7 +43,7 @@ namespace com { namespace sun { namespace star { namespace task
namespace pdfi
{
- typedef std::unordered_map< OUString, OUString, OUStringHash > PropertyMap;
+ typedef std::unordered_map< OUString, OUString > PropertyMap;
typedef sal_Int32 ImageId;
/// What to do with a polygon. values can be ORed together
diff --git a/sdext/source/pdfimport/inc/pdfparse.hxx b/sdext/source/pdfimport/inc/pdfparse.hxx
index 5e4bd837eb51..b38c8ca35a9d 100644
--- a/sdext/source/pdfimport/inc/pdfparse.hxx
+++ b/sdext/source/pdfimport/inc/pdfparse.hxx
@@ -181,7 +181,7 @@ struct PDFArray : public PDFContainer
struct PDFDict : public PDFContainer
{
- typedef std::unordered_map<OString,PDFEntry*,OStringHash> Map;
+ typedef std::unordered_map<OString,PDFEntry*> Map;
Map m_aMap;
PDFDict() {}
diff --git a/sdext/source/pdfimport/pdfparse/pdfentries.cxx b/sdext/source/pdfimport/pdfparse/pdfentries.cxx
index 34d23a5a1310..7a4f457fe0a4 100644
--- a/sdext/source/pdfimport/pdfparse/pdfentries.cxx
+++ b/sdext/source/pdfimport/pdfparse/pdfentries.cxx
@@ -528,7 +528,7 @@ void PDFDict::insertValue( const OString& rName, PDFEntry* pValue )
if( ! pValue )
eraseValue( rName );
- std::unordered_map<OString,PDFEntry*,OStringHash>::iterator it = m_aMap.find( rName );
+ std::unordered_map<OString,PDFEntry*>::iterator it = m_aMap.find( rName );
if( it == m_aMap.end() )
{
// new name/value, pair, append it
@@ -622,7 +622,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::unordered_map<OString,PDFEntry*,OStringHash>::const_iterator it =
+ std::unordered_map<OString,PDFEntry*>::const_iterator it =
m_pDict->m_aMap.find( "Length" );
if( it == m_pDict->m_aMap.end() )
return 0;
@@ -672,7 +672,7 @@ bool PDFObject::getDeflatedStream( char** ppStream, unsigned int* pBytes, const
return false;
}
// is there a filter entry ?
- std::unordered_map<OString,PDFEntry*,OStringHash>::const_iterator it =
+ std::unordered_map<OString,PDFEntry*>::const_iterator it =
m_pStream->m_pDict->m_aMap.find( "Filter" );
if( it != m_pStream->m_pDict->m_aMap.end() )
{
@@ -838,7 +838,7 @@ bool PDFObject::emit( EmitContext& rWriteContext ) const
if( bDeflate && rWriteContext.m_bDeflate )
{
// delete flatedecode filter
- std::unordered_map<OString,PDFEntry*,OStringHash>::const_iterator it =
+ std::unordered_map<OString,PDFEntry*>::const_iterator it =
pClone->m_pStream->m_pDict->m_aMap.find( "Filter" );
if( it != pClone->m_pStream->m_pDict->m_aMap.end() )
{
diff --git a/sdext/source/pdfimport/sax/saxattrlist.cxx b/sdext/source/pdfimport/sax/saxattrlist.cxx
index f2cf5fc16de3..9a284df93119 100644
--- a/sdext/source/pdfimport/sax/saxattrlist.cxx
+++ b/sdext/source/pdfimport/sax/saxattrlist.cxx
@@ -23,12 +23,11 @@
namespace pdfi
{
-SaxAttrList::SaxAttrList( const std::unordered_map< OUString, OUString, OUStringHash >& rMap )
+SaxAttrList::SaxAttrList( const std::unordered_map< OUString, OUString >& rMap )
{
m_aAttributes.reserve(rMap.size());
for( std::unordered_map< OUString,
- OUString,
- OUStringHash >::const_iterator it = rMap.begin();
+ OUString >::const_iterator it = rMap.begin();
it != rMap.end(); ++it )
{
m_aIndexMap[ it->first ] = m_aAttributes.size();
@@ -80,7 +79,7 @@ OUString SAL_CALL SaxAttrList::getValueByIndex( sal_Int16 i_nIndex )
OUString SAL_CALL SaxAttrList::getValueByName(const OUString& i_rName)
{
- std::unordered_map< OUString, size_t, OUStringHash >::const_iterator it = m_aIndexMap.find( i_rName );
+ std::unordered_map< OUString, size_t >::const_iterator it = m_aIndexMap.find( i_rName );
return (it != m_aIndexMap.end()) ? m_aAttributes[it->second].m_aValue : OUString();
}
diff --git a/sdext/source/pdfimport/sax/saxattrlist.hxx b/sdext/source/pdfimport/sax/saxattrlist.hxx
index 73c9222a2258..77c4dc4e20f2 100644
--- a/sdext/source/pdfimport/sax/saxattrlist.hxx
+++ b/sdext/source/pdfimport/sax/saxattrlist.hxx
@@ -44,10 +44,10 @@ namespace pdfi
: m_aName( i_rName ), m_aValue( i_rValue ) {}
};
std::vector< AttrEntry > m_aAttributes;
- std::unordered_map< OUString, size_t, OUStringHash > m_aIndexMap;
+ std::unordered_map< OUString, size_t > m_aIndexMap;
public:
- explicit SaxAttrList( const std::unordered_map< OUString, OUString, OUStringHash >& );
+ explicit SaxAttrList( const std::unordered_map< OUString, OUString >& );
SaxAttrList( const SaxAttrList& );
virtual ~SaxAttrList() override;
diff --git a/sdext/source/pdfimport/test/pdfunzip.cxx b/sdext/source/pdfimport/test/pdfunzip.cxx
index bcc81a1b6c65..d33c2070f8f5 100644
--- a/sdext/source/pdfimport/test/pdfunzip.cxx
+++ b/sdext/source/pdfimport/test/pdfunzip.cxx
@@ -296,7 +296,7 @@ int write_addStreams( const char* pInFile, const char* pOutFile, PDFFile* pPDFFi
if( pTrailer && pTrailer->m_pDict )
{
// search for AdditionalStreams entry
- std::unordered_map<OString,PDFEntry*,OStringHash>::iterator add_stream;
+ std::unordered_map<OString,PDFEntry*>::iterator add_stream;
add_stream = pTrailer->m_pDict->m_aMap.find( "AdditionalStreams" );
if( add_stream != pTrailer->m_pDict->m_aMap.end() )
{
@@ -323,7 +323,7 @@ int write_fonts( const char* i_pInFile, const char* i_pOutFile, PDFFile* i_pPDFF
if( ! pDict )
continue;
- std::unordered_map<OString,PDFEntry*,OStringHash>::iterator map_it =
+ std::unordered_map<OString,PDFEntry*>::iterator map_it =
pDict->m_aMap.find( "Type" );
if( map_it == pDict->m_aMap.end() )
continue;