Skip to content

Commit 994d66e

Browse files
jimjagpgiffuni
andauthored
Sync with trunk (#519)
* Replace std::hash_map/hash_set with std::unordered_map/unordered_set on trunk (C++11) GCC 15 removed std::hash_map/std::hash_set (GNU extensions) from libstdc++. Replace all 628 occurrences across 477 files with std::unordered_map/ std::unordered_set, updating #include <hash_map>/<hash_set> to Affects: vcl, crashrep, extensions, dbaccess, scripting, sw, io, rdbmaker, codemaker, unodevtools, and many other modules. * Migrate remaining std::hash_map/std::hash_set to std::unordered_map/std::unordered_set Replace TR1/backport hash containers with C++11 standard equivalents in source files not yet covered by trunk's migration. * Replace std::hash_multimap with std::unordered_multimap in propcontroller.hxx std::hash_multimap is a GNU extension removed from GCC 13's libstdc++, causing a build failure in the pcr module (propcontroller.obj). std::unordered_multimap is the C++11 standard equivalent already used elsewhere in this file and supports all operations performed on m_aDependencyHandlers. * Replace std::hash_multimap with std::unordered_multimap in oleobjw.hxx std::hash_multimap is a GNU extension removed from GCC 13's libstdc++. The functors hashOUString_Impl/equalOUString_Impl are already used with std::unordered_map on line 74 of the same file, and all operations on m_mapComFunc (find, end, insert) are supported by std::unordered_multimap. --------- Co-authored-by: Pedro F. Giffuni <pfg@apache.org>
1 parent aac6cdf commit 994d66e

479 files changed

Lines changed: 1342 additions & 1340 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎main/accessibility/inc/accessibility/extended/textwindowaccessibility.hxx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
#endif
7070
#include <memory>
7171
#include <queue>
72-
#include <hash_map>
72+
#include <unordered_map>
7373

7474
class TextEngine;
7575
class TextView;
@@ -343,7 +343,7 @@ private:
343343
};
344344

345345

346-
typedef ::std::hash_map< ::rtl::OUString,
346+
typedef ::std::unordered_map< ::rtl::OUString,
347347
::css::beans::PropertyValue,
348348
::rtl::OUStringHash,
349349
::std::equal_to< ::rtl::OUString > > tPropValMap;

‎main/accessibility/source/extended/textwindowaccessibility.cxx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
#include <algorithm>
3737
#include <vector>
38-
#include <hash_map>
38+
#include <unordered_map>
3939

4040
namespace css = ::com::sun::star;
4141

‎main/animations/source/animcore/targetpropertiescreator.cxx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
#include <animations/animationnodehelper.hxx>
4545

4646
#include <vector>
47-
#include <hash_map>
47+
#include <unordered_map>
4848

4949

5050
using namespace ::com::sun::star;
@@ -136,7 +136,7 @@ namespace animcore
136136
*/
137137
sal_Int16 mnParagraphIndex;
138138

139-
/// Comparison needed for hash_map
139+
/// Comparison needed for unordered_map
140140
bool operator==( const ShapeHashKey& rRHS ) const
141141
{
142142
return mxRef == rRHS.mxRef && mnParagraphIndex == rRHS.mnParagraphIndex;
@@ -165,7 +165,7 @@ namespace animcore
165165
};
166166

167167
// A hash map which maps a XShape to the corresponding vector of initial properties
168-
typedef ::std::hash_map< ShapeHashKey, VectorOfNamedValues, ShapeKeyHasher > XShapeHash;
168+
typedef ::std::unordered_map< ShapeHashKey, VectorOfNamedValues, ShapeKeyHasher > XShapeHash;
169169

170170
class NodeFunctor
171171
{

‎main/avmedia/source/macavf/macavf_player.cxx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828

2929
using namespace ::com::sun::star;
3030

31-
#include <hash_map>
32-
typedef std::hash_map<NSObject*,avmedia::macavf::MacAVObserverHandler*> HandlersForObject;
31+
#include <unordered_map>
32+
typedef std::unordered_map<NSObject*,avmedia::macavf::MacAVObserverHandler*> HandlersForObject;
3333

3434
@implementation MacAVObserverObject
3535
{

‎main/basctl/source/inc/bastypes.hxx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class SfxItemSet;
4848
#include <svtools/tabbar.hxx>
4949
#include <com/sun/star/script/XLibraryContainer.hpp>
5050

51-
#include <hash_map>
51+
#include <unordered_map>
5252

5353
#define LINE_SEP_CR 0x0D
5454
#define LINE_SEP 0x0A
@@ -305,7 +305,7 @@ private:
305305
}
306306
};
307307

308-
typedef ::std::hash_map< LibInfoKey, LibInfoItem*, LibInfoKeyHash, ::std::equal_to< LibInfoKey > > LibInfoMap;
308+
typedef ::std::unordered_map< LibInfoKey, LibInfoItem*, LibInfoKeyHash, ::std::equal_to< LibInfoKey > > LibInfoMap;
309309
LibInfoMap m_aLibInfoMap;
310310

311311
public:

‎main/basic/source/classes/sb.cxx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
#include <com/sun/star/util/XCloseListener.hpp>
5959
#include "errobject.hxx"
6060
#include <map>
61-
#include <hash_map>
61+
#include <unordered_map>
6262
#include <vector>
6363
#include <algorithm>
6464

@@ -1194,7 +1194,7 @@ struct ClassModuleRunInitItem
11941194
// Derive from has_map type instead of typedef
11951195
// to allow forward declaration in sbmod.hxx
11961196
class ModuleInitDependencyMap : public
1197-
std::hash_map< ::rtl::OUString, ClassModuleRunInitItem,
1197+
std::unordered_map< ::rtl::OUString, ClassModuleRunInitItem,
11981198
::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > >
11991199
{};
12001200

@@ -2069,7 +2069,7 @@ SbxInfoRef BasicCollection::xItemInfo = NULL;
20692069
// Items may share a name (an item added without a key keeps the name of the
20702070
// variable it was copied from), so each name maps to all of its holders.
20712071
class CollectionNameMap : public
2072-
std::hash_map< ::rtl::OUString, std::vector< SbxVariable* >,
2072+
std::unordered_map< ::rtl::OUString, std::vector< SbxVariable* >,
20732073
::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > >
20742074
{};
20752075

‎main/basic/source/classes/sbunoobj.cxx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ using namespace cppu;
9595
#include<runtime.hxx>
9696

9797
#include<math.h>
98-
#include <hash_map>
98+
#include <unordered_map>
9999
#include <com/sun/star/reflection/XTypeDescriptionEnumerationAccess.hpp>
100100
#include <com/sun/star/reflection/XConstantsTypeDescription.hpp>
101101

@@ -3389,7 +3389,7 @@ void RTL_Impl_EqualUnoObjects( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrit
33893389
refVar->PutBool( sal_True );
33903390
}
33913391

3392-
typedef std::hash_map< ::rtl::OUString, std::vector< ::rtl::OUString >, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > ModuleHash;
3392+
typedef std::unordered_map< ::rtl::OUString, std::vector< ::rtl::OUString >, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > ModuleHash;
33933393

33943394

33953395
// helper wrapper function to interact with TypeProvider and
@@ -3416,7 +3416,7 @@ getTypeDescriptorEnumeration( const ::rtl::OUString& sSearchRoot,
34163416
return xEnum;
34173417
}
34183418

3419-
typedef std::hash_map< ::rtl::OUString, Any, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > VBAConstantsHash;
3419+
typedef std::unordered_map< ::rtl::OUString, Any, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > VBAConstantsHash;
34203420

34213421
SbxVariable* getVBAConstant( const String& rName )
34223422
{

‎main/basic/source/comp/sbcomp.cxx‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
// To activate tracing enable in sbtrace.hxx
3838
#ifdef DBG_TRACE_BASIC
3939

40-
#include <hash_map>
40+
#include <unordered_map>
4141

4242
// Trace ini file (set NULL to ignore)
4343
// can be overridden with the environment variable OOO_BASICTRACEINI
@@ -239,8 +239,8 @@ struct TraceTextData
239239
rtl::OString m_aTraceStr_STMNT;
240240
rtl::OString m_aTraceStr_PCode;
241241
};
242-
typedef std::hash_map< sal_Int32, TraceTextData > PCToTextDataMap;
243-
typedef std::hash_map< ::rtl::OUString, PCToTextDataMap*, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > ModuleTraceMap;
242+
typedef std::unordered_map< sal_Int32, TraceTextData > PCToTextDataMap;
243+
typedef std::unordered_map< ::rtl::OUString, PCToTextDataMap*, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > ModuleTraceMap;
244244

245245
ModuleTraceMap GaModuleTraceMap;
246246
ModuleTraceMap& rModuleTraceMap = GaModuleTraceMap;
@@ -381,7 +381,7 @@ struct FunctionItem
381381
, m_bBlockSteps( false )
382382
{}
383383
};
384-
typedef std::hash_map< ::rtl::OUString, FunctionItem*, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > FunctionItemMap;
384+
typedef std::unordered_map< ::rtl::OUString, FunctionItem*, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > FunctionItemMap;
385385

386386
static std::stack< double > GaCallEnterTimeStack;
387387
static std::stack< FunctionItem* > GaFunctionItemStack;

‎main/basic/source/inc/namecont.hxx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#ifndef BASIC_NAMECONTAINER_HXX
2525
#define BASIC_NAMECONTAINER_HXX
2626

27-
#include <hash_map>
27+
#include <unordered_map>
2828

2929
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
3030
#include <com/sun/star/uno/XComponentContext.hpp>
@@ -76,7 +76,7 @@ typedef ::cppu::WeakImplHelper3<
7676

7777
class NameContainer : public ::cppu::BaseMutex, public NameContainer_BASE
7878
{
79-
typedef std::hash_map< ::rtl::OUString, sal_Int32, ::rtl::OUStringHash > NameContainerNameMap;
79+
typedef std::unordered_map< ::rtl::OUString, sal_Int32, ::rtl::OUStringHash > NameContainerNameMap;
8080

8181
NameContainerNameMap mHashMap;
8282
::com::sun::star::uno::Sequence< ::rtl::OUString > mNames;

‎main/basic/source/inc/scriptcont.hxx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class SfxScriptLibrary : public SfxLibrary, public SfxScriptLibrary_BASE
126126
{
127127
friend class SfxScriptLibraryContainer;
128128

129-
typedef std::hash_map< ::rtl::OUString, ::com::sun::star::script::ModuleInfo, ::rtl::OUStringHash > ModuleInfoMap;
129+
typedef std::unordered_map< ::rtl::OUString, ::com::sun::star::script::ModuleInfo, ::rtl::OUStringHash > ModuleInfoMap;
130130

131131
sal_Bool mbLoadedSource;
132132
sal_Bool mbLoadedBinary;

0 commit comments

Comments
 (0)