diff options
author | Albert Astals Cid <aacid@kde.org> | 2020-01-05 22:49:15 +0100 |
---|---|---|
committer | Albert Astals Cid <tsdgeos@yahoo.es> | 2020-01-05 22:44:45 +0000 |
commit | 7489b99bc0e8ee22538e5c4697f43181e74044c1 (patch) | |
tree | ed4e9e87914dd6e16e602d70e63cd760f27f731b | |
parent | 6b1ee539705f1ddf8e252f1589866862ad688bc2 (diff) |
Make HtmlFontAccu::Get const
-rw-r--r-- | utils/HtmlFonts.h | 2 | ||||
-rw-r--r-- | utils/HtmlOutputDev.cc | 5 | ||||
-rw-r--r-- | utils/HtmlOutputDev.h | 4 |
3 files changed, 5 insertions, 6 deletions
diff --git a/utils/HtmlFonts.h b/utils/HtmlFonts.h index 195f46fa..c44ce6a1 100644 --- a/utils/HtmlFonts.h +++ b/utils/HtmlFonts.h @@ -104,7 +104,7 @@ public: HtmlFontAccu(const HtmlFontAccu &) = delete; HtmlFontAccu& operator=(const HtmlFontAccu &) = delete; int AddFont(const HtmlFont& font); - HtmlFont *Get(int i){ + const HtmlFont *Get(int i) const { return &accu[i]; } GooString* CSStyle(int i, int j = 0); diff --git a/utils/HtmlOutputDev.cc b/utils/HtmlOutputDev.cc index a8af0ea9..b8a69e34 100644 --- a/utils/HtmlOutputDev.cc +++ b/utils/HtmlOutputDev.cc @@ -489,7 +489,6 @@ static void CloseTags( GooString *htext, bool &finish_a, bool &finish_italic, bo // It may also strip out duplicate strings (if they are on top of each other); sometimes they are to create a font effect void HtmlPage::coalesce() { HtmlString *str1, *str2; - HtmlFont *hfont1, *hfont2; double space, horSpace, vertSpace, vertOverlap; bool addSpace, addLineBreak; int n, i; @@ -551,7 +550,7 @@ void HtmlPage::coalesce() { str1 = yxStrings; - hfont1 = getFont(str1); + const HtmlFont *hfont1 = getFont(str1); if( hfont1->isBold() ) str1->htext->insert(0,"<b>",3); if( hfont1->isItalic() ) @@ -564,7 +563,7 @@ void HtmlPage::coalesce() { curX = str1->xMin; curY = str1->yMin; while (str1 && (str2 = str1->yxNext)) { - hfont2 = getFont(str2); + const HtmlFont *hfont2 = getFont(str2); space = str1->yMax - str1->yMin; // the height of the font's bounding box horSpace = str2->xMin - str1->xMax; // if strings line up on left-hand side AND they are on subsequent lines, we need a line break diff --git a/utils/HtmlOutputDev.h b/utils/HtmlOutputDev.h index e5823d27..b724ec18 100644 --- a/utils/HtmlOutputDev.h +++ b/utils/HtmlOutputDev.h @@ -14,7 +14,7 @@ // All changes made under the Poppler project to this file are licensed // under GPL version 2 or later // -// Copyright (C) 2006, 2007, 2009, 2012, 2018, 2019 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2006, 2007, 2009, 2012, 2018-2020 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2008, 2009 Warren Toomey <wkt@tuhs.org> // Copyright (C) 2009, 2011 Carlos Garcia Campos <carlosgc@gnome.org> // Copyright (C) 2009 Kovid Goyal <kovid@kovidgoyal.net> @@ -167,7 +167,7 @@ public: void conv(); private: - HtmlFont* getFont(HtmlString *hStr) { return fonts->Get(hStr->fontpos); } + const HtmlFont* getFont(HtmlString *hStr) const { return fonts->Get(hStr->fontpos); } double fontSize; // current font size bool rawOrder; // keep strings in content stream order |