Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ The release run heads these entries with the version and opens a fresh

## Unreleased

- **Breaking**: the inert `HtmlConfig` fields `background_image_format`,
`background_image_dpi`, `no_drm` and `embed_outline` are gone, with their
java, python, objc and wasm mirrors. Drop them; nothing replaces them.

- **Breaking**: `TextFile::charset()` and the `UnknownCharset` exception are
gone. Use `TextFile::encoding()`, which returns `TextEncoding::unknown` where
`charset()` returned `nullopt`. The bindings' own `charset()` is unchanged.

- **Breaking**: `GlobalParams` is gone, with its java, python and objc mirrors,
`OdrAndroid.init`, and the `ODR_WITH_LIBMAGIC` / `ODR_BUNDLE_ASSETS` cmake
options. All of it was inert; delete the calls, nothing replaces them.
Expand Down
10 changes: 0 additions & 10 deletions apple/include/OdrCoreObjC/ODRHtml.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,6 @@ NS_SWIFT_NAME(HtmlConfig)
@property(nonatomic) uint8_t htmlIndent;
@property(nonatomic, copy) NSString *htmlIndentString;

/// @deprecated Inert.
@property(nonatomic, copy) NSString *backgroundImageFormat;
/// @deprecated Inert.
@property(nonatomic) double backgroundImageDpi;

/// Render only pages `[begin, end)`, 0-based. `nil` end means to the last page.
@property(nonatomic) uint32_t pageRangeBegin;
@property(nonatomic, strong, nullable)
Expand All @@ -136,11 +131,6 @@ NS_SWIFT_NAME(HtmlConfig)
@property(nonatomic, copy) NSArray<NSString *> *pdfDualLayerFallbackFonts;
@property(nonatomic) double pdfDualLayerFallbackFontSizeAdjust;

/// @deprecated Inert.
@property(nonatomic) BOOL noDrm;
/// @deprecated Inert.
@property(nonatomic) BOOL embedOutline;

@property(nonatomic, copy, nullable) NSString *outputPath;

@end
Expand Down
8 changes: 0 additions & 8 deletions apple/src/ODRHtml.mm
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@ - (instancetype)initWithNativeConfig:(const odr::HtmlConfig &)config {
_formatHtml = config.format_html ? YES : NO;
_htmlIndent = config.html_indent;
_htmlIndentString = to_nsstring(config.html_indent_string);
_backgroundImageFormat = to_nsstring(config.background_image_format);
_backgroundImageDpi = config.background_image_dpi;
_pageRangeBegin = config.page_range_begin;
_pageRangeEnd = config.page_range_end.has_value()
? @(static_cast<unsigned int>(*config.page_range_end))
Expand All @@ -134,8 +132,6 @@ - (instancetype)initWithNativeConfig:(const odr::HtmlConfig &)config {
_pdfDualLayerFallbackFonts = to_nsarray(config.pdf_dual_layer_fallback_fonts);
_pdfDualLayerFallbackFontSizeAdjust =
config.pdf_dual_layer_fallback_font_size_adjust;
_noDrm = config.no_drm ? YES : NO;
_embedOutline = config.embed_outline ? YES : NO;
_outputPath =
config.output_path.has_value() ? to_nsstring(*config.output_path) : nil;
return self;
Expand Down Expand Up @@ -211,8 +207,6 @@ - (instancetype)initWithNativeConfig:(const odr::HtmlConfig &)config {
config.format_html = _formatHtml == YES;
config.html_indent = _htmlIndent;
config.html_indent_string = to_string(_htmlIndentString);
config.background_image_format = to_string(_backgroundImageFormat);
config.background_image_dpi = _backgroundImageDpi;
config.page_range_begin = _pageRangeBegin;
if (_pageRangeEnd != nil) {
config.page_range_end =
Expand All @@ -224,8 +218,6 @@ - (instancetype)initWithNativeConfig:(const odr::HtmlConfig &)config {
config.pdf_dual_layer_fallback_fonts = to_strings(_pdfDualLayerFallbackFonts);
config.pdf_dual_layer_fallback_font_size_adjust =
_pdfDualLayerFallbackFontSizeAdjust;
config.no_drm = _noDrm == YES;
config.embed_outline = _embedOutline == YES;
if (_outputPath != nil) {
config.output_path = to_string(_outputPath);
} else {
Expand Down
12 changes: 0 additions & 12 deletions jni/java/app/opendocument/core/HtmlConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,6 @@ public final class HtmlConfig {
public int htmlIndent = 1;
public String htmlIndentString = "\t";

/** @deprecated Inert. */
@Deprecated public String backgroundImageFormat = "png";

/** @deprecated Inert. */
@Deprecated public double backgroundImageDpi = 144.0;

public int pageRangeBegin = 0;
/** {@code null} renders to the end of the document. */
public Integer pageRangeEnd;
Expand All @@ -78,12 +72,6 @@ public final class HtmlConfig {
};
public double pdfDualLayerFallbackFontSizeAdjust = 0.5;

/** @deprecated Inert. */
@Deprecated public boolean noDrm = false;

/** @deprecated Inert. */
@Deprecated public boolean embedOutline = false;

/** {@code null} keeps output in the cache directory. */
public String outputPath;
}
8 changes: 0 additions & 8 deletions jni/src/jni_style.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,6 @@ jobject html_config_to_java(JNIEnv *env, const odr::HtmlConfig &config) {
set_boolean("formatHtml", config.format_html);
set_int("htmlIndent", config.html_indent);
set_string("htmlIndentString", config.html_indent_string);
set_string("backgroundImageFormat", config.background_image_format);
set_double("backgroundImageDpi", config.background_image_dpi);
set_int("pageRangeBegin", static_cast<jint>(config.page_range_begin));
set_object("pageRangeEnd", "Ljava/lang/Integer;",
box_integer(env, config.page_range_end));
Expand All @@ -514,8 +512,6 @@ jobject html_config_to_java(JNIEnv *env, const odr::HtmlConfig &config) {
}
set_double("pdfDualLayerFallbackFontSizeAdjust",
config.pdf_dual_layer_fallback_font_size_adjust);
set_boolean("noDrm", config.no_drm);
set_boolean("embedOutline", config.embed_outline);
set_object("outputPath", "Ljava/lang/String;",
make_string_opt(env, config.output_path));

Expand Down Expand Up @@ -678,8 +674,6 @@ odr::HtmlConfig html_config_from_java(JNIEnv *env, jobject config) {
result.format_html = get_boolean("formatHtml");
result.html_indent = static_cast<std::uint8_t>(get_int("htmlIndent"));
result.html_indent_string = get_string("htmlIndentString");
result.background_image_format = get_string("backgroundImageFormat");
result.background_image_dpi = get_double("backgroundImageDpi");
result.page_range_begin =
static_cast<std::uint32_t>(get_int("pageRangeBegin"));
{
Expand Down Expand Up @@ -716,8 +710,6 @@ odr::HtmlConfig html_config_from_java(JNIEnv *env, jobject config) {
}
result.pdf_dual_layer_fallback_font_size_adjust =
get_double("pdfDualLayerFallbackFontSizeAdjust");
result.no_drm = get_boolean("noDrm");
result.embed_outline = get_boolean("embedOutline");
result.output_path = get_string_opt("outputPath");

env->DeleteLocalRef(cls);
Expand Down
10 changes: 0 additions & 10 deletions python/src/bind_html.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,23 +101,13 @@ void odr_python::bind_html(py::module_ &m) {
.def_readwrite("format_html", &odr::HtmlConfig::format_html)
.def_readwrite("html_indent", &odr::HtmlConfig::html_indent)
.def_readwrite("html_indent_string", &odr::HtmlConfig::html_indent_string)
.def_readwrite("background_image_format",
&odr::HtmlConfig::background_image_format,
"Deprecated and inert.")
.def_readwrite("background_image_dpi",
&odr::HtmlConfig::background_image_dpi,
"Deprecated and inert.")
.def_readwrite("page_range_begin", &odr::HtmlConfig::page_range_begin)
.def_readwrite("page_range_end", &odr::HtmlConfig::page_range_end)
.def_readwrite("pdf_text_mode", &odr::HtmlConfig::pdf_text_mode)
.def_readwrite("pdf_dual_layer_fallback_fonts",
&odr::HtmlConfig::pdf_dual_layer_fallback_fonts)
.def_readwrite("pdf_dual_layer_fallback_font_size_adjust",
&odr::HtmlConfig::pdf_dual_layer_fallback_font_size_adjust)
.def_readwrite("no_drm", &odr::HtmlConfig::no_drm,
"Deprecated and inert.")
.def_readwrite("embed_outline", &odr::HtmlConfig::embed_outline,
"Deprecated and inert.")
.def_readwrite("output_path", &odr::HtmlConfig::output_path)
.def_readwrite("resource_locator", &odr::HtmlConfig::resource_locator);

Expand Down
2 changes: 0 additions & 2 deletions src/odr/exceptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ NoMarkdownFile::NoMarkdownFile() : Exception("not a markdown file") {}

NoJsonFile::NoJsonFile() : Exception("not a json file") {}

UnknownCharset::UnknownCharset() : Exception("unknown charset") {}

NoImageFile::NoImageFile() : Exception("not an image file") {}

NoArchiveFile::NoArchiveFile() : Exception("not an archive file") {}
Expand Down
7 changes: 0 additions & 7 deletions src/odr/exceptions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,6 @@ struct NoJsonFile final : Exception {
NoJsonFile();
};

/// @brief Unknown charset exception
/// @deprecated Nothing throws this any more: a file whose encoding cannot be
/// named is still text, and reports @ref TextEncoding::unknown.
struct [[deprecated("nothing throws this")]] UnknownCharset final : Exception {
UnknownCharset();
};

/// @brief No image file exception
struct NoImageFile final : Exception {
NoImageFile();
Expand Down
8 changes: 0 additions & 8 deletions src/odr/file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,14 +301,6 @@ TextFile::TextFile(std::shared_ptr<internal::abstract::TextFile> impl)

TextEncoding TextFile::encoding() const { return m_impl->encoding(); }

std::optional<std::string> TextFile::charset() const {
const TextEncoding encoding = this->encoding();
if (encoding == TextEncoding::unknown) {
return {};
}
return std::string(text_encoding_to_string(encoding));
}

std::unique_ptr<std::istream> TextFile::stream() const {
return m_impl->file()->stream();
}
Expand Down
5 changes: 0 additions & 5 deletions src/odr/file.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,11 +424,6 @@ class TextFile final : public DecodedFile {
/// @brief The encoding the file's bytes were detected as, or decoded with.
[[nodiscard]] TextEncoding encoding() const;

/// @deprecated See @ref encoding. Returns the encoding's canonical name, and
/// `nullopt` for @ref TextEncoding::unknown.
[[deprecated("use encoding()")]] [[nodiscard]] std::optional<std::string>
charset() const;

/// @brief The file's bytes as they are.
[[nodiscard]] std::unique_ptr<std::istream> stream() const;
/// @brief The file's text, decoded to UTF-8 where @ref encoding is
Expand Down
11 changes: 0 additions & 11 deletions src/odr/html.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,6 @@ struct HtmlConfig {
std::uint8_t html_indent{1};
std::string html_indent_string{"\t"};

/// @deprecated Inert: no view renders a background image to a file.
std::string background_image_format{"png"};
/// @deprecated See @ref background_image_format.
double background_image_dpi{144.0};

/// Renders only the pages with 0-based index in `[page_range_begin,
/// page_range_end)`; page views and `#pN` anchors keep their document-global
/// numbers. Honored by the pdf pipeline.
Expand All @@ -196,12 +191,6 @@ struct HtmlConfig {
/// fill the box. Safe to underestimate: the excess is clipped, not shrunk.
double pdf_dual_layer_fallback_font_size_adjust{0.5};

/// @deprecated Inert: no output carries a restriction to lift.
bool no_drm{false};

/// @deprecated Inert: an outline is never written.
bool embed_outline{false};

std::optional<std::string> output_path;
HtmlResourceLocator resource_locator;

Expand Down
8 changes: 0 additions & 8 deletions wasm/js/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,6 @@ export interface HtmlConfig {
editable?: boolean;
textDocumentMargin?: boolean;
formatHtml?: boolean;
/** @deprecated Inert. */
embedOutline?: boolean;
/** @deprecated Inert. */
noDrm?: boolean;
/** @deprecated Inert. */
backgroundImageFormat?: string;
/** @deprecated Inert. */
backgroundImageDpi?: number;
pageRangeBegin?: number;
pageRangeEnd?: number;
colorScheme?: number;
Expand Down
5 changes: 0 additions & 5 deletions wasm/src/wasm_html.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,6 @@ HtmlConfig to_html_config(const emscripten::val &value) {
read(value, "editable", config.editable);
read(value, "textDocumentMargin", config.text_document_margin);
read(value, "formatHtml", config.format_html);
read(value, "embedOutline", config.embed_outline);
read(value, "noDrm", config.no_drm);

read(value, "backgroundImageFormat", config.background_image_format);
read(value, "backgroundImageDpi", config.background_image_dpi);

read(value, "pageRangeBegin", config.page_range_begin);
if (const emscripten::val end = value["pageRangeEnd"];
Expand Down
Loading