summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorTor Lillqvist <tlillqvist@novell.com>2011-08-22 19:02:47 +0300
committerTor Lillqvist <tlillqvist@novell.com>2011-08-22 19:05:11 +0300
commitf54198869081cda24b3777ce4ac0c6b9458d0ab7 (patch)
tree1ed5adabba92056cce4df99023b18c5589b6486e /tools
parent096d36c9043aba2966657390a758fdbcb4a06eb7 (diff)
Fix dubious std::lower_bound usage that breaks in a _DEBUG MSVC build
Diffstat (limited to 'tools')
-rw-r--r--tools/source/rc/resmgr.cxx30
1 files changed, 10 insertions, 20 deletions
diff --git a/tools/source/rc/resmgr.cxx b/tools/source/rc/resmgr.cxx
index c5ff7445b036..b6532d245b90 100644
--- a/tools/source/rc/resmgr.cxx
+++ b/tools/source/rc/resmgr.cxx
@@ -518,18 +518,6 @@ struct ImpContentLessCompare : public ::std::binary_function< ImpContent, ImpCon
}
};
-struct ImpContentMixLessCompare : public ::std::binary_function< ImpContent, sal_uInt64, bool>
-{
- inline bool operator() (const ImpContent& lhs, const sal_uInt64& rhs) const
- {
- return lhs.nTypeAndId < rhs;
- }
- inline bool operator() (const sal_uInt64& lhs, const ImpContent& rhs) const
- {
- return lhs < rhs.nTypeAndId;
- }
-};
-
static ResHookProc pImplResHookProc = 0;
InternalResMgr::InternalResMgr( const OUString& rFileURL,
@@ -667,12 +655,13 @@ sal_Bool InternalResMgr::Create()
sal_Bool InternalResMgr::IsGlobalAvailable( RESOURCE_TYPE nRT, sal_uInt32 nId ) const
{
// Anfang der Strings suchen
- sal_uInt64 nValue = ((sal_uInt64(nRT) << 32) | nId);
+ ImpContent aValue;
+ aValue.nTypeAndId = ((sal_uInt64(nRT) << 32) | nId);
ImpContent * pFind = ::std::lower_bound(pContent,
pContent + nEntries,
- nValue,
- ImpContentMixLessCompare());
- return (pFind != (pContent + nEntries)) && (pFind->nTypeAndId == nValue);
+ aValue,
+ ImpContentLessCompare());
+ return (pFind != (pContent + nEntries)) && (pFind->nTypeAndId == aValue.nTypeAndId);
}
// -----------------------------------------------------------------------
@@ -685,13 +674,14 @@ void* InternalResMgr::LoadGlobalRes( RESOURCE_TYPE nRT, sal_uInt32 nId,
pResUseDump->erase( (sal_uInt64(nRT) << 32) | nId );
#endif
// Anfang der Strings suchen
- sal_uInt64 nValue = ((sal_uInt64(nRT) << 32) | nId);
+ ImpContent aValue;
+ aValue.nTypeAndId = ((sal_uInt64(nRT) << 32) | nId);
ImpContent* pEnd = (pContent + nEntries);
ImpContent* pFind = ::std::lower_bound( pContent,
pEnd,
- nValue,
- ImpContentMixLessCompare());
- if( pFind && (pFind != pEnd) && (pFind->nTypeAndId == nValue) )
+ aValue,
+ ImpContentLessCompare());
+ if( pFind && (pFind != pEnd) && (pFind->nTypeAndId == aValue.nTypeAndId) )
{
if( nRT == RSC_STRING && bEqual2Content )
{