From bdf23d1d42a1664e5804ab3c29700706d1e29979 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Tue, 31 Oct 2017 01:42:22 +0000 Subject: fix asserts --- src/svg/svg-color.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/svg/svg-color.cpp b/src/svg/svg-color.cpp index 89a5636a8..60cbff3dc 100644 --- a/src/svg/svg-color.cpp +++ b/src/svg/svg-color.cpp @@ -398,7 +398,7 @@ guint32 sp_svg_read_color(gchar const *str, gchar const **end_ptr, guint32 dfl) * this check wrapper. */ gchar const *end = str; guint32 const ret = internal_sp_svg_read_color(str, &end, dfl); - assert(((ret == dfl) && (end == str)) + g_assert(((ret == dfl) && (end == str)) || (((ret & 0xff) == 0) && (str < end))); if (str < end) { @@ -407,7 +407,7 @@ guint32 sp_svg_read_color(gchar const *str, gchar const **end_ptr, guint32 dfl) buf[end - str] = '\0'; gchar const *buf_end = buf; guint32 const check = internal_sp_svg_read_color(buf, &buf_end, 1); - assert(check == ret + g_assert(check == ret && buf_end - buf == end - str); g_free(buf); @@ -425,7 +425,7 @@ guint32 sp_svg_read_color(gchar const *str, gchar const **end_ptr, guint32 dfl) */ static void rgb24_to_css(char *const buf, unsigned const rgb24) { - assert(rgb24 < (1u << 24)); + g_assert(rgb24 < (1u << 24)); /* SVG 1.1 Full allows additional colour names not supported by SVG Tiny, but we don't bother * with them: it's good for these colours to be copyable to non-SVG CSS stylesheets and for -- cgit v1.2.3 From 36216068dee24b54d67a35854d9160a9ec5f76dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A8le=20Duda?= Date: Tue, 31 Oct 2017 10:32:02 +0000 Subject: fix removing class when object to path --- src/path-chemistry.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/path-chemistry.cpp b/src/path-chemistry.cpp index b3b0c8076..b824d15c7 100644 --- a/src/path-chemistry.cpp +++ b/src/path-chemistry.cpp @@ -430,6 +430,8 @@ sp_item_list_to_curves(const std::vector &items, std::vector& Inkscape::XML::Node *parent = item->getRepr()->parent(); // remember id char const *id = item->getRepr()->attribute("id"); + // remember class + char const *class_attr = item->getRepr()->attribute("class"); // remember title gchar *title = item->title(); // remember description @@ -444,6 +446,8 @@ sp_item_list_to_curves(const std::vector &items, std::vector& // restore id repr->setAttribute("id", id); + // restore class + repr->setAttribute("class", class_attr); // add the new repr to the parent parent->appendChild(repr); SPObject* newObj = document->getObjectByRepr(repr); -- cgit v1.2.3 From 8bd2ff33b87bae1db644b473a6e6055118cf7131 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Thu, 2 Nov 2017 18:37:43 +0100 Subject: Make shared library building an option --- CMakeLists.txt | 1 + src/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b01956876..09519c8ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -95,6 +95,7 @@ option(WITH_LPETOOL "Compile with LPE Tool and experimental LPEs enabled" ON) option(WITH_OPENMP "Compile with OpenMP support" ON) option(WITH_PROFILING "Turn on profiling" OFF) # Set to true if compiler/linker should enable profiling +option(BUILD_SHARED_LIBS "Compile libraries as shared and not static" ON) option(ENABLE_POPPLER "Compile with support of libpoppler" ON) option(ENABLE_POPPLER_CAIRO "Compile with support of libpoppler-cairo for rendering PDF preview (depends on ENABLE_POPPLER)" ON) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 72d984845..4c56b211d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -540,7 +540,7 @@ set(INKSCAPE_TARGET_LIBS ) # Build everything except main and inkview.c in a shared library. -add_library(inkscape_base SHARED ${inkscape_SRC} ${sp_SRC}) +add_library(inkscape_base ${inkscape_SRC} ${sp_SRC}) if(WITH_DBUS) add_dependencies(inkscape_base inkscape_dbus) -- cgit v1.2.3 From 4e991ba74afefc4595c748a9435fc5a07f1c67d4 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Thu, 2 Nov 2017 19:20:46 +0100 Subject: do not build grid2 in target all --- CMakeLists.txt | 2 +- src/extension/plugins/grid2/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 09519c8ac..a1a68d4e6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -148,7 +148,7 @@ add_definitions(-DORBIT2=1) add_definitions(-DHAVE_CONFIG_H) add_definitions(-DHAVE_CAIRO_PDF=1) # needed for src/libnrtype/Layout-TNG.h add_definitions(-DHAVE_TR1_UNORDERED_SET) # XXX make an option! -if(NOT WIN32) +if(BUILD_SHARED_LIBS AND NOT WIN32) add_definitions(-fPIC) endif() # diff --git a/src/extension/plugins/grid2/CMakeLists.txt b/src/extension/plugins/grid2/CMakeLists.txt index f39e259de..eb200e96e 100644 --- a/src/extension/plugins/grid2/CMakeLists.txt +++ b/src/extension/plugins/grid2/CMakeLists.txt @@ -2,7 +2,7 @@ set(grid_PART_SRCS grid.cpp) include_directories( ${CMAKE_BINARY_DIR}/src ) -add_library(grid2 SHARED ${grid_PART_SRCS}) +add_library(grid2 SHARED EXCLUDE_FROM_ALL ${grid_PART_SRCS}) target_link_libraries(grid2 inkscape_base) -- cgit v1.2.3 From 2479a36d9f59544f8b0978f1577ec8a7613c74be Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Thu, 2 Nov 2017 22:23:24 +0100 Subject: fix build --- CMakeScripts/HelperMacros.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeScripts/HelperMacros.cmake b/CMakeScripts/HelperMacros.cmake index a0bdd9866..54bbf9d09 100644 --- a/CMakeScripts/HelperMacros.cmake +++ b/CMakeScripts/HelperMacros.cmake @@ -29,7 +29,7 @@ macro(add_inkscape_lib name sources) - add_library(${name} ${sources}) + add_library(${name} STATIC ${sources}) # works fine without having the includes # listed is helpful for IDE's (QtCreator/MSVC) -- cgit v1.2.3 From 073da60232635543fe12186d4fcb81a3da15f0f2 Mon Sep 17 00:00:00 2001 From: Simon Wells Date: Fri, 3 Nov 2017 12:25:58 +1300 Subject: change assignment to equality --- src/libnrtype/FontFactory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libnrtype/FontFactory.cpp b/src/libnrtype/FontFactory.cpp index 9c62e5483..90df81261 100644 --- a/src/libnrtype/FontFactory.cpp +++ b/src/libnrtype/FontFactory.cpp @@ -939,7 +939,7 @@ void font_factory::AddFontsDir(char const *utf8dir) conf = pango_fc_font_map_get_config(PANGO_FC_FONT_MAP(fontServer)); # endif FcBool res = FcConfigAppFontAddDir(conf, (FcChar8 const *)dir); - if (res = FcTrue) { + if (res == FcTrue) { g_info("Fonts dir '%s' added successfully.", utf8dir); } else { g_warning("Could not add fonts dir '%s'.", utf8dir); @@ -971,7 +971,7 @@ void font_factory::AddFontFile(char const *utf8file) conf = pango_fc_font_map_get_config(PANGO_FC_FONT_MAP(fontServer)); # endif FcBool res = FcConfigAppFontAddFile(conf, (FcChar8 const *)file); - if (res = FcTrue) { + if (res == FcTrue) { g_info("Font file '%s' added successfully.", utf8file); } else { g_warning("Could not add font file '%s'.", utf8file); -- cgit v1.2.3