control: tags -1 patch Hello, upstream released a one line fix for this issue:
https://gitlab.com/inkscape/inkscape/-/commit/694d8ae43d06efff21adebf377ce614d660b24cd but other commits will need cherry-picking, e.g. f7e944575ea5247952d23f85dfa905cfa13f7b28 1798e9c13b786f3d077ba0132592c4d5c1d1fb9b 694d8ae43d06efff21adebf377ce614d660b24cd 877fc26483f74f951eab516f1b57b136780a8c78 I'm attaching them, so you don't have to rebase. G.
From f7e944575ea5247952d23f85dfa905cfa13f7b28 Mon Sep 17 00:00:00 2001 From: Andreas Sturmlechner <ast...@gentoo.org> Date: Mon, 4 Mar 2024 22:59:40 +0100 Subject: [PATCH] Fix build with >=poppler-24.03.0 Fixes build errors caused by: "Use an enum for Function getType" Upstream commit 6e3824d45d42cb806a28a2df84e4ab6bb3587083 Signed-off-by: Andreas Sturmlechner <ast...@gentoo.org> Fixes https://gitlab.com/inkscape/inkscape/-/issues/4787 --- .../internal/pdfinput/poppler-transition-api.h | 10 ++++++++++ src/extension/internal/pdfinput/svg-builder.cpp | 8 ++++---- 2 files changed, 14 insertions(+), 4 deletions(-) Index: inkscape-1.2.2/src/extension/internal/pdfinput/poppler-transition-api.h =================================================================== --- inkscape-1.2.2.orig/src/extension/internal/pdfinput/poppler-transition-api.h +++ inkscape-1.2.2/src/extension/internal/pdfinput/poppler-transition-api.h @@ -14,6 +14,16 @@ #include <glib/poppler-features.h> +#if POPPLER_CHECK_VERSION(24, 3, 0) +#define _POPPLER_FUNCTION_TYPE_SAMPLED Function::Type::Sampled +#define _POPPLER_FUNCTION_TYPE_EXPONENTIAL Function::Type::Exponential +#define _POPPLER_FUNCTION_TYPE_STITCHING Function::Type::Stitching +#else +#define _POPPLER_FUNCTION_TYPE_SAMPLED 0 +#define _POPPLER_FUNCTION_TYPE_EXPONENTIAL 2 +#define _POPPLER_FUNCTION_TYPE_STITCHING 3 +#endif + #if POPPLER_CHECK_VERSION(22, 4, 0) #define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr.get()) #else Index: inkscape-1.2.2/src/extension/internal/pdfinput/svg-builder.cpp =================================================================== --- inkscape-1.2.2.orig/src/extension/internal/pdfinput/svg-builder.cpp +++ inkscape-1.2.2/src/extension/internal/pdfinput/svg-builder.cpp @@ -923,8 +923,8 @@ #define INT_EPSILON 8 bool SvgBuilder::_addGradientStops(Inkscape::XML::Node *gradient, GfxShading *shading, _POPPLER_CONST Function *func) { - int type = func->getType(); - if ( type == 0 || type == 2 ) { // Sampled or exponential function + auto type = func->getType(); + if (type == _POPPLER_FUNCTION_TYPE_SAMPLED || type == _POPPLER_FUNCTION_TYPE_EXPONENTIAL) { GfxRGB stop1, stop2; if ( !svgGetShadingColorRGB(shading, 0.0, &stop1) || !svgGetShadingColorRGB(shading, 1.0, &stop2) ) { @@ -933,7 +933,7 @@ _addStopToGradient(gradient, 0.0, &stop1, 1.0); _addStopToGradient(gradient, 1.0, &stop2, 1.0); } - } else if ( type == 3 ) { // Stitching + } else if (type == _POPPLER_FUNCTION_TYPE_STITCHING) { auto stitchingFunc = static_cast<_POPPLER_CONST StitchingFunction*>(func); const double *bounds = stitchingFunc->getBounds(); const double *encode = stitchingFunc->getEncode(); @@ -946,7 +946,7 @@ for ( int i = 0 ; i < num_funcs ; i++ ) { svgGetShadingColorRGB(shading, bounds[i + 1], &color); // Add stops - if (stitchingFunc->getFunc(i)->getType() == 2) { // process exponential fxn + if (stitchingFunc->getFunc(i)->getType() == _POPPLER_FUNCTION_TYPE_EXPONENTIAL) { double expE = (static_cast<_POPPLER_CONST ExponentialFunction*>(stitchingFunc->getFunc(i)))->getE(); if (expE > 1.0) { expE = (bounds[i + 1] - bounds[i])/expE; // approximate exponential as a single straight line at x=1
From 1798e9c13b786f3d077ba0132592c4d5c1d1fb9b Mon Sep 17 00:00:00 2001 From: Tavmjong Bah <tavmj...@free.fr> Date: Tue, 26 Sep 2023 19:23:27 +0000 Subject: [PATCH] Up C++ version to C++20. --- CMakeLists.txt | 4 ++-- _clang-format | 2 +- src/ui/knot/knot-holder-entity.cpp | 2 +- src/ui/tools/pencil-tool.cpp | 9 ++++++--- 4 files changed, 10 insertions(+), 7 deletions(-) Index: inkscape-1.2.2/CMakeLists.txt =================================================================== --- inkscape-1.2.2.orig/CMakeLists.txt +++ inkscape-1.2.2/CMakeLists.txt @@ -18,9 +18,9 @@ # ----------------------------------------------------------------------------- # CMake Configuration # ----------------------------------------------------------------------------- -set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) -# set(CMAKE_CXX_EXTENSIONS OFF) # enforces -std=c++17 instead of -std=gnu++17 +# set(CMAKE_CXX_EXTENSIONS OFF) # enforces -std=c++20 instead of -std=gnu++20 # TODO: build currently fails with it as we actually depend on GNU compiler extensions... list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeScripts/Modules") Index: inkscape-1.2.2/_clang-format =================================================================== --- inkscape-1.2.2.orig/_clang-format +++ inkscape-1.2.2/_clang-format @@ -103,7 +103,7 @@ SpacesInCStyleCastParentheses: false SpacesInParentheses: false SpacesInSquareBrackets: false -Standard: c++17 +Standard: c++20 StatementMacros: [] TypenameMacros: [] TabWidth: 4 Index: inkscape-1.2.2/src/ui/tools/pencil-tool.cpp =================================================================== --- inkscape-1.2.2.orig/src/ui/tools/pencil-tool.cpp +++ inkscape-1.2.2/src/ui/tools/pencil-tool.cpp @@ -17,7 +17,11 @@ * Released under GNU GPL v2+, read the file 'COPYING' for more information. */ -#include <numeric> // For std::accumulate +#include "pencil-tool.h" + +#include <cmath> // std::lerp +#include <numeric> // std::accumulate + #include <gdk/gdkkeysyms.h> #include <glibmm/i18n.h> @@ -26,7 +30,6 @@ #include <2geom/sbasis-to-bezier.h> #include <2geom/svg-path-parser.h> -#include "pencil-tool.h" #include "context-fns.h" #include "desktop.h" @@ -821,7 +824,7 @@ min = max; } double dezoomify_factor = 0.05 * 1000 / _desktop->current_zoom(); - double const pressure_shrunk = pressure * (max - min) + min; // C++20 -> use std::lerp() + double const pressure_shrunk = std::lerp(min, max, pressure); double pressure_computed = std::abs(pressure_shrunk * dezoomify_factor); double pressure_computed_scaled = std::abs(pressure_computed * _desktop->getDocument()->getDocumentScale().inverse()[Geom::X]); if (p != this->p[this->_npoints - 1]) {
From 694d8ae43d06efff21adebf377ce614d660b24cd Mon Sep 17 00:00:00 2001 From: Christian Hesse <m...@eworm.de> Date: Fri, 17 Nov 2023 22:30:42 +0100 Subject: [PATCH] include missing header file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes build error: ``` /build/inkscape/src/inkscape/src/object/uri.cpp: In constructor ‘Inkscape::URI::URI(const gchar*, const char*)’: /build/inkscape/src/inkscape/src/object/uri.cpp:86:9: error: ‘xmlFree’ was not declared in this scope; did you mean ‘xmlFreeURI’? 86 | xmlFree(full); ``` --- src/object/uri.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/object/uri.h b/src/object/uri.h index 381adec58cf..d5b211fe2b2 100644 --- a/src/object/uri.h +++ b/src/object/uri.h @@ -13,6 +13,7 @@ #define INKSCAPE_URI_H #include <libxml/uri.h> +#include <libxml/xmlmemory.h> #include <memory> #include <string> -- GitLab
From 877fc26483f74f951eab516f1b57b136780a8c78 Mon Sep 17 00:00:00 2001 From: Daniel Boles <dboles.src+inksc...@gmail.com> Date: Mon, 4 Sep 2023 10:02:09 +0100 Subject: [PATCH] FilterEffectsDial: rm <T> on own ctor breaks C++20 The `<T>` on our constructor here is redundant anyway, but _somehow_ in C++20 it confuses the compiler and makes the file not build. Remove it! --- src/ui/dialog/filter-effects-dialog.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp index 2c1b69dbcb6..f1be9c682f5 100644 --- a/src/ui/dialog/filter-effects-dialog.cpp +++ b/src/ui/dialog/filter-effects-dialog.cpp @@ -174,7 +174,9 @@ public: template< typename T> class ComboWithTooltip : public Gtk::EventBox { public: - ComboWithTooltip<T>(T default_value, const Util::EnumDataConverter<T>& c, const SPAttr a = SPAttr::INVALID, char* tip_text = nullptr) + ComboWithTooltip(T const default_value, Util::EnumDataConverter<T> const &c, + SPAttr const a = SPAttr::INVALID, + char* const tip_text = nullptr) { if (tip_text) { set_tooltip_text(tip_text); -- GitLab
OpenPGP_signature.asc
Description: OpenPGP digital signature