mirror of
https://github.com/pdf2htmlEX/pdf2htmlEX.git
synced 2024-12-22 04:50:09 +00:00
Upgrade Poppler to 24.06.1
Poppler-24.02.0 OutlineItem changed Title from Unicode pointer and length counter into Unicode vector. ( fc1c711cb5
)
Poppler-24.03.0 GooString.h exposes std::string::starts_with and ::ends_with which are CXX20.
This commit is contained in:
parent
6f85c88b1d
commit
1462429f31
@ -4,11 +4,12 @@
|
||||
# versions
|
||||
|
||||
# see: https://poppler.freedesktop.org/releases.html
|
||||
# current working: 24.01.0
|
||||
# current working: 24.06.1
|
||||
|
||||
export PDF2HTMLEX_VERSION=0.18.8.rc2
|
||||
|
||||
export POPPLER_VERSION=poppler-24.01.0
|
||||
export POPPLER_VERSION=poppler-24.06.1
|
||||
#export POPPLER_VERSION=poppler-24.01.0
|
||||
#export POPPLER_VERSION=poppler-23.12.0
|
||||
#export POPPLER_VERSION=poppler-21.02.0
|
||||
#export POPPLER_VERSION=poppler-0.89.0
|
||||
|
@ -125,8 +125,8 @@ set(CMAKE_THREAD_PREFER_PTHREAD ON)
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
find_package(Threads REQUIRED)
|
||||
set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} Threads::Threads)
|
||||
# Poppler-23.12.0 requires CXX17
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
# Poppler-24.03.0 requires CXX20
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
if(NOT CYGWIN)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
@ -42,7 +42,7 @@ void HTMLRenderer::process_outline_items(const std::vector<OutlineItem*> * items
|
||||
|
||||
f_outline.fs << ">";
|
||||
|
||||
writeUnicodes(f_outline.fs, item->getTitle(), item->getTitleLength());
|
||||
writeUnicodes(f_outline.fs, item->getTitle());
|
||||
|
||||
f_outline.fs << "</a>";
|
||||
|
||||
|
@ -55,34 +55,46 @@ static int mapUTF8(Unicode u, char *buf, int bufSize)
|
||||
}
|
||||
}
|
||||
|
||||
static void writeUnicode(ostream & out, const Unicode u) {
|
||||
switch(u)
|
||||
{
|
||||
case '&':
|
||||
out << "&";
|
||||
break;
|
||||
case '\"':
|
||||
out << """;
|
||||
break;
|
||||
case '\'':
|
||||
out << "'";
|
||||
break;
|
||||
case '<':
|
||||
out << "<";
|
||||
break;
|
||||
case '>':
|
||||
out << ">";
|
||||
break;
|
||||
default:
|
||||
{
|
||||
char buf[4];
|
||||
auto n = mapUTF8(u, buf, 4);
|
||||
out.write(buf, n);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void writeUnicodes(ostream & out, const Unicode * u, int uLen)
|
||||
{
|
||||
for(int i = 0; i < uLen; ++i)
|
||||
{
|
||||
switch(u[i])
|
||||
{
|
||||
case '&':
|
||||
out << "&";
|
||||
break;
|
||||
case '\"':
|
||||
out << """;
|
||||
break;
|
||||
case '\'':
|
||||
out << "'";
|
||||
break;
|
||||
case '<':
|
||||
out << "<";
|
||||
break;
|
||||
case '>':
|
||||
out << ">";
|
||||
break;
|
||||
default:
|
||||
{
|
||||
char buf[4];
|
||||
auto n = mapUTF8(u[i], buf, 4);
|
||||
out.write(buf, n);
|
||||
}
|
||||
}
|
||||
writeUnicode(out, u[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void writeUnicodes(ostream & out, const std::vector<Unicode> & u)
|
||||
{
|
||||
for(const auto & i: u)
|
||||
{
|
||||
writeUnicode(out, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
#define ENCODING_H__
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
|
||||
#include <CharTypes.h>
|
||||
@ -19,6 +20,7 @@ namespace pdf2htmlEX {
|
||||
* Escape necessary characters, and map Unicode to UTF-8
|
||||
*/
|
||||
void writeUnicodes(std::ostream & out, const Unicode * u, int uLen);
|
||||
void writeUnicodes(std::ostream & out, const std::vector<Unicode> & u);
|
||||
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user