[poppler] 2 commits - qt5/src
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Sep 18 09:56:32 UTC 2018
qt5/src/ArthurOutputDev.h | 16 ++--------------
1 file changed, 2 insertions(+), 14 deletions(-)
New commits:
commit 7ac84c1d633b49d69b1ec80606fdca8ee14d80e0
Author: Oliver Sander <oliver.sander at tu-dresden.de>
Date: Tue Sep 18 11:18:33 2018 +0200
Document the new 'ArthurFontID' type
diff --git a/qt5/src/ArthurOutputDev.h b/qt5/src/ArthurOutputDev.h
index 67a96e06..b228a886 100644
--- a/qt5/src/ArthurOutputDev.h
+++ b/qt5/src/ArthurOutputDev.h
@@ -220,7 +220,7 @@ private:
ArthurType3Font* m_currentType3Font;
std::stack<ArthurType3Font*> m_type3FontStack;
- // Cache all fonts
+ // Cache all fonts by their Ref and font size
using ArthurFontID = std::pair<Ref,double>;
std::map<ArthurFontID,std::unique_ptr<QRawFont> > m_rawFontCache;
std::map<ArthurFontID,std::unique_ptr<ArthurType3Font> > m_type3FontCache;
commit 5048bec585be382f9d37110c6b2e16d26d29d5b2
Author: Oliver Sander <oliver.sander at tu-dresden.de>
Date: Tue Sep 18 11:02:58 2018 +0200
Bugfix: Do not disregard Ref::gen when using Ref as a cache key
According to Leonard Rosenthol's book, the 'gen' field of a
reference is almost always zero. However, this doesn't mean that
it can be ignored when comparing two Refs.
Incidentally, this patch also makes use of the recently introduced
Ref::operator<, which allows to replace the small custom class
ArthurFontID by a std::pair.
diff --git a/qt5/src/ArthurOutputDev.h b/qt5/src/ArthurOutputDev.h
index 6d20fb7b..67a96e06 100644
--- a/qt5/src/ArthurOutputDev.h
+++ b/qt5/src/ArthurOutputDev.h
@@ -220,20 +220,8 @@ private:
ArthurType3Font* m_currentType3Font;
std::stack<ArthurType3Font*> m_type3FontStack;
- // Identify a font by its 'Ref' and its font size
- struct ArthurFontID
- {
- Ref ref;
- double fontSize;
-
- bool operator<(const ArthurFontID& other) const
- {
- return (ref.num < other.ref.num)
- || ((ref.num == other.ref.num) && (fontSize < other.fontSize));
- }
- };
-
// Cache all fonts
+ using ArthurFontID = std::pair<Ref,double>;
std::map<ArthurFontID,std::unique_ptr<QRawFont> > m_rawFontCache;
std::map<ArthurFontID,std::unique_ptr<ArthurType3Font> > m_type3FontCache;
More information about the poppler
mailing list