Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / external / poppler / gcc7-GfxFont.patch.1
bloba240b1b8bad21a8468beb4245d497a725899f715
1 Revert of upstream: https://gitlab.freedesktop.org/poppler/poppler/-/commit/d5ea5a24124badf2b32a7d08dd2c06a4a40f93fb
3 gcc 7.5.0 says:
5 workdir/UnpackedTarball/poppler/poppler/GfxFont.cc: In member function ‘std::optional<GfxFontLoc> GfxFont::locateFont(XRef*, PSOutputDev*)’:
6 /home/taichi/libo-core/workdir/UnpackedTarball/poppler/poppler/GfxFont.cc:660:24: error: could not convert ‘fontLoc’ from ‘GfxFontLoc’ to ‘std::optional<GfxFontLoc>’
7                  return fontLoc;
8                         ^~~~~~~
9 workdir/UnpackedTarball/poppler/poppler/GfxFont.cc:671:16: error: could not convert ‘fontLoc’ from ‘GfxFontLoc’ to ‘std::optional<GfxFontLoc>’
10          return fontLoc;
11                 ^~~~~~~
12 workdir/UnpackedTarball/poppler/poppler/GfxFont.cc:680:16: error: could not convert ‘fontLoc’ from ‘GfxFontLoc’ to ‘std::optional<GfxFontLoc>’
13          return fontLoc;
14                 ^~~~~~~
15 libo-core/workdir/UnpackedTarball/poppler/poppler/GfxFont.cc:711:24: error: could not convert ‘fontLoc’ from ‘GfxFontLoc’ to ‘std::optional<GfxFontLoc>’
16                  return fontLoc;
17                         ^~~~~~~
18 workdir/UnpackedTarball/poppler/poppler/GfxFont.cc:723:20: error: could not convert ‘fontLoc’ from ‘GfxFontLoc’ to ‘std::optional<GfxFontLoc>’
19              return fontLoc;
20                     ^~~~~~~
21 workdir/UnpackedTarball/poppler/poppler/GfxFont.cc:752:20: error: could not convert ‘fontLoc’ from ‘GfxFontLoc’ to ‘std::optional<GfxFontLoc>’
22              return fontLoc;
23                     ^~~~~~~
24 workdir/UnpackedTarball/poppler/poppler/GfxFont.cc: In static member function ‘static std::optional<GfxFontLoc> GfxFont::getExternalFont(GooString*, bool)’:
25 workdir/UnpackedTarball/poppler/poppler/GfxFont.cc:814:12: error: could not convert ‘fontLoc’ from ‘GfxFontLoc’ to ‘std::optional<GfxFontLoc>’
26      return fontLoc;
28 diff --git a/poppler/GfxFont.cc b/poppler/GfxFont.cc
29 index cc2ce038..b0d0d610 100644
30 --- a/poppler/GfxFont.cc
31 +++ b/poppler/GfxFont.cc
32 @@ -657,7 +657,7 @@ std::optional<GfxFontLoc> GfxFont::locateFont(XRef *xref, PSOutputDev *ps)
33                  fontLoc.locType = gfxFontLocEmbedded;
34                  fontLoc.fontType = type;
35                  fontLoc.embFontID = embFontID;
36 -                return fontLoc;
37 +                return std::move(fontLoc); // std::move only required to please g++-7
38              }
39          }
40      }
41 @@ -668,7 +668,7 @@ std::optional<GfxFontLoc> GfxFont::locateFont(XRef *xref, PSOutputDev *ps)
42          fontLoc.locType = gfxFontLocResident;
43          fontLoc.fontType = fontType1;
44          fontLoc.path = *name;
45 -        return fontLoc;
46 +        return std::move(fontLoc); // std::move only required to please g++-7
47      }
49      //----- PS resident Base-14 font
50 @@ -677,7 +677,7 @@ std::optional<GfxFontLoc> GfxFont::locateFont(XRef *xref, PSOutputDev *ps)
51          fontLoc.locType = gfxFontLocResident;
52          fontLoc.fontType = fontType1;
53          fontLoc.path = ((Gfx8BitFont *)this)->base14->base14Name;
54 -        return fontLoc;
55 +        return std::move(fontLoc); // std::move only required to please g++-7
56      }
58      //----- external font file (fontFile, fontDir)
59 @@ -708,7 +708,7 @@ std::optional<GfxFontLoc> GfxFont::locateFont(XRef *xref, PSOutputDev *ps)
60                  fontLoc.fontType = fontCIDType2;
61                  fontLoc.setPath(path);
62                  fontLoc.fontNum = fontNum;
63 -                return fontLoc;
64 +                return std::move(fontLoc); // std::move only required to please g++-7
65              }
66          } else {
67              GfxFontLoc fontLoc;
68 @@ -720,7 +720,7 @@ std::optional<GfxFontLoc> GfxFont::locateFont(XRef *xref, PSOutputDev *ps)
69                  fontLoc.fontType = fontType1;
70                  fontLoc.fontNum = fontNum;
71              }
72 -            return fontLoc;
73 +            return std::move(fontLoc); // std::move only required to please g++-7
74          }
75          delete path;
76      }
77 @@ -749,7 +749,7 @@ std::optional<GfxFontLoc> GfxFont::locateFont(XRef *xref, PSOutputDev *ps)
78              fontLoc.fontType = fontType1;
79              fontLoc.path = substName;
80              fontLoc.substIdx = substIdx;
81 -            return fontLoc;
82 +            return std::move(fontLoc); // std::move only required to please g++-7
83          } else {
84              path = globalParams->findFontFile(substName);
85              if (path) {
86 @@ -811,7 +811,7 @@ std::optional<GfxFontLoc> GfxFont::getExternalFont(GooString *path, bool cid)
87      fontLoc.locType = gfxFontLocExternal;
88      fontLoc.fontType = fontType;
89      fontLoc.setPath(path);
90 -    return fontLoc;
91 +    return std::move(fontLoc); // std::move only required to please g++-7
92  }
94  std::optional<std::vector<unsigned char>> GfxFont::readEmbFontFile(XRef *xref)