From 6fa95cecc4b8c2cea3ac5b427835dc2f66438376 Mon Sep 17 00:00:00 2001 From: xy Date: Fri, 3 Aug 2012 21:14:18 +0800 Subject: [PATCH] Fix PathDataCacheKey hash. --- src/subtitles/cache_manager.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/subtitles/cache_manager.cpp b/src/subtitles/cache_manager.cpp index 4e8e96a..661e602 100644 --- a/src/subtitles/cache_manager.cpp +++ b/src/subtitles/cache_manager.cpp @@ -102,7 +102,24 @@ bool PathDataCacheKey::CompareSTSStyle( const STSStyle& lhs, const STSStyle& rhs ULONG PathDataCacheKey::UpdateHashValue() { + const STSStyle& style = m_style.get(); m_hash_value = CStringElementTraits::Hash(m_str); + m_hash_value += (m_hash_value<<5); + m_hash_value += style.charSet; + m_hash_value += (m_hash_value<<5); + m_hash_value += CStringElementTraits::Hash(style.fontName); + m_hash_value += (m_hash_value<<5); + m_hash_value += style.fontSize; + m_hash_value += (m_hash_value<<5); + m_hash_value += style.fontSpacing; + m_hash_value += (m_hash_value<<5); + m_hash_value += style.fontWeight; + m_hash_value += (m_hash_value<<5); + m_hash_value += style.fItalic; + m_hash_value += (m_hash_value<<5); + m_hash_value += style.fUnderline; + m_hash_value += (m_hash_value<<5); + m_hash_value += style.fStrikeOut; return m_hash_value; } @@ -134,7 +151,7 @@ ULONG ScanLineData2CacheKey::UpdateHashValue() m_hash_value += (m_hash_value<<5); m_hash_value += m_org.x; m_hash_value += (m_hash_value<<5); - m_hash_value += m_org.y; + m_hash_value += m_org.y;//fix me: fontScale and fontAngle are not take into account return m_hash_value; } -- 2.11.4.GIT