From fb6ee4a8495b064e6a64e1abec212941ce7c96f9 Mon Sep 17 00:00:00 2001 From: rafael-g Date: Sun, 5 Jun 2016 08:32:58 +0200 Subject: [Bug #1550178] Inkscape crashed with segfault in ExpressionEvaluator on OpenBSD. Fixed bugs: - https://launchpad.net/bugs/1550178 (bzr r14951) --- src/util/expression-evaluator.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/util') diff --git a/src/util/expression-evaluator.cpp b/src/util/expression-evaluator.cpp index 48064e647..b0b8e6036 100644 --- a/src/util/expression-evaluator.cpp +++ b/src/util/expression-evaluator.cpp @@ -28,6 +28,8 @@ #include "util/expression-evaluator.h" #include "util/units.h" +#include + #include #include @@ -49,7 +51,7 @@ EvaluatorToken::EvaluatorToken() } ExpressionEvaluator::ExpressionEvaluator(const char *string, Unit const *unit) : - string(string), + string(g_locale_to_utf8(string,-1,0,0,0)), unit(unit) { current_token.type = TOKEN_END; -- cgit v1.2.3 From 8e79c58572bac72489bde00c15d092bce02e850a Mon Sep 17 00:00:00 2001 From: rafael-g Date: Sun, 5 Jun 2016 08:43:06 +0200 Subject: [Bug #1587311] Entering + into stroke width dialog crashes Inkscape. Fixed bugs: - https://launchpad.net/bugs/1587311 (bzr r14952) --- src/util/expression-evaluator.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/util') diff --git a/src/util/expression-evaluator.cpp b/src/util/expression-evaluator.cpp index b0b8e6036..dd7ce97f7 100644 --- a/src/util/expression-evaluator.cpp +++ b/src/util/expression-evaluator.cpp @@ -208,8 +208,11 @@ EvaluatorQuantity ExpressionEvaluator::evaluateFactor() { EvaluatorQuantity evaluated_factor = EvaluatorQuantity(); EvaluatorToken consumed_token = EvaluatorToken(); - - if (acceptToken(TOKEN_NUM, &consumed_token)) { + + if (acceptToken(TOKEN_END, &consumed_token)) { + return evaluated_factor; + } + else if (acceptToken(TOKEN_NUM, &consumed_token)) { evaluated_factor.value = consumed_token.value.fl; } else if (acceptToken('(', NULL)) { evaluated_factor = evaluateExpression(); -- cgit v1.2.3 From fa70c0e286d268ef3e35f2d08a0404dcbf02caa3 Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Thu, 4 Aug 2016 20:01:10 +0100 Subject: Use C++11 unordered containers (bzr r15040) --- src/util/unordered-containers.h | 46 +++++------------------------------------ 1 file changed, 5 insertions(+), 41 deletions(-) (limited to 'src/util') diff --git a/src/util/unordered-containers.h b/src/util/unordered-containers.h index b92f2e7ea..0bda8191f 100644 --- a/src/util/unordered-containers.h +++ b/src/util/unordered-containers.h @@ -20,12 +20,11 @@ #ifndef DOXYGEN_SHOULD_SKIP_THIS -#if defined(HAVE_NATIVE_UNORDERED_SET) -# include -# include -# define INK_UNORDERED_SET std::unordered_set -# define INK_UNORDERED_MAP std::unordered_map -# define INK_HASH std::hash +#include +#include +#define INK_UNORDERED_SET std::unordered_set +#define INK_UNORDERED_MAP std::unordered_map +#define INK_HASH std::hash namespace std { template <> @@ -36,41 +35,6 @@ struct hash : public std::unary_function -# include -# define INK_UNORDERED_SET std::tr1::unordered_set -# define INK_UNORDERED_MAP std::tr1::unordered_map -# define INK_HASH std::tr1::hash - -namespace std { -namespace tr1 { -template <> -struct hash : public std::unary_function { - std::size_t operator()(Glib::ustring const &s) const { - return hash()(s.raw()); - } -}; -} // namespace tr1 -} // namespace std - -#elif defined(HAVE_BOOST_UNORDERED_SET) -# include -# include -# define INK_UNORDERED_SET boost::unordered_set -# define INK_UNORDERED_MAP boost::unordered_map -# define INK_HASH boost::hash - -namespace boost { -template <> -struct hash : public std::unary_function { - std::size_t operator()(Glib::ustring const &s) const { - return hash()(s.raw()); - } -}; -} // namespace boost -#endif - #else /// Name (with namespace) of the unordered set template. #define INK_UNORDERED_SET -- cgit v1.2.3 From e471a664f923f517b68071f2e33fbb6ce070f8b7 Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Mon, 8 Aug 2016 13:56:40 +0100 Subject: Remove deprecated Autotools and btool files. Please use CMake instead (bzr r15046) --- src/util/Makefile_insert | 49 ------------------------------------------------ 1 file changed, 49 deletions(-) delete mode 100644 src/util/Makefile_insert (limited to 'src/util') diff --git a/src/util/Makefile_insert b/src/util/Makefile_insert deleted file mode 100644 index 2a778e660..000000000 --- a/src/util/Makefile_insert +++ /dev/null @@ -1,49 +0,0 @@ -## Makefile.am fragment sourced by src/Makefile.am. - -util/all: util/libutil.a - -util/clean: - rm -f util/libutil.a $(util_libutil_a_OBJECTS) - -util_libutil_a_SOURCES = \ - util/ziptool.h \ - util/ziptool.cpp \ - util/accumulators.h \ - util/compose.hpp \ - util/copy.h \ - util/enums.h \ - util/ege-appear-time-tracker.cpp \ - util/ege-appear-time-tracker.h \ - util/ege-tags.h \ - util/ege-tags.cpp \ - util/expression-evaluator.h \ - util/expression-evaluator.cpp \ - util/filter-list.h \ - util/find-if-before.h \ - util/find-last-if.h \ - util/fixed_point.h \ - util/format.h \ - util/forward-pointer-iterator.h \ - util/function.h \ - util/list.h \ - util/list-container.h \ - util/list-copy.h \ - util/longest-common-suffix.h \ - util/map-list.h \ - util/reference.h \ - util/reverse-list.h \ - util/share.h \ - util/share.cpp \ - util/signal-blocker.h \ - util/tuple.h \ - util/ucompose.hpp \ - util/units.cpp \ - util/units.h \ - util/unordered-containers.h - -# ###################### -# ### CxxTest stuff #### -# ###################### - -CXXTEST_TESTSUITES += \ - $(srcdir)/util/list-container-test.h -- cgit v1.2.3