diff --git a/src/document.cpp b/src/document.cpp index 24d5ace477c36ba656277b6032912b6315f98ece..c7f1a734c9d723dcfd9faf4bb69025ca97738117 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -460,32 +460,32 @@ std::unique_ptr SPDocument::createDoc( Inkscape::Version const lowest_version{0, 1}; Inkscape::Version &docver = document->root->inkscape_version; if (!sp_no_convert_text_baseline_spacing && - docver.isInsideRangeInclusive(lowest_version, {0, 92})) { + docver.isInsideRangeExclusive(lowest_version, {0, 92})) { sp_file_convert_text_baseline_spacing(document.get()); } /** Fix font names in legacy documents (pre-92 files) **/ - if (docver.isInsideRangeInclusive(lowest_version, {0, 92})) { + if (docver.isInsideRangeExclusive(lowest_version, {0, 92})) { sp_file_convert_font_name(document.get()); } /** Fix first line spacing in legacy documents (pre-1.0 files) **/ - if (docver.isInsideRangeInclusive(lowest_version, {1, 0})) { + if (docver.isInsideRangeExclusive(lowest_version, {1, 0})) { sp_file_fix_empty_lines(document.get()); } /** Fix OSB (pre-1.1 files) **/ - if (docver.isInsideRangeInclusive(lowest_version, {1, 1})) { + if (docver.isInsideRangeExclusive(lowest_version, {1, 1})) { sp_file_fix_osb(document->getRoot()); } /** Fix feComposite (pre-1.2 files) **/ - if (docver.isInsideRangeInclusive(lowest_version, {1, 2})) { + if (docver.isInsideRangeExclusive(lowest_version, {1, 2})) { sp_file_fix_feComposite(document->getRoot()); } /** Fix hotspot (pre-1.5 files) **/ - if (docver.isInsideRangeInclusive(lowest_version, {1, 4})) { + if (docver.isInsideRangeExclusive(lowest_version, {1, 5})) { sp_file_fix_hotspot(document->getRoot()); } @@ -498,7 +498,7 @@ std::unique_ptr SPDocument::createDoc( } } /** Fix dpi (pre-92 files). With GUI fixed in Inkscape::Application::fix_document. **/ - if (!(INKSCAPE.use_gui()) && docver.isInsideRangeInclusive(lowest_version, {0, 92})) { + if (!(INKSCAPE.use_gui()) && docver.isInsideRangeExclusive(lowest_version, {0, 92})) { sp_file_convert_dpi(document.get()); } diff --git a/src/inkscape-application.cpp b/src/inkscape-application.cpp index 490fe477d09086201679dd51c912c82a4cce12e3..7e719a25eed7d39497ed0b86d4fc987a40684805 100644 --- a/src/inkscape-application.cpp +++ b/src/inkscape-application.cpp @@ -360,7 +360,7 @@ void InkscapeApplication::document_fix(SPDesktop *desktop) } // Fix dpi (pre-92 files). - if (document->getRoot()->inkscape_version.isInsideRangeInclusive({0, 1}, {0, 92})) { + if (document->getRoot()->inkscape_version.isInsideRangeExclusive({0, 1}, {0, 92})) { sp_file_convert_dpi(document); } diff --git a/src/live_effects/lpe-fill-between-many.cpp b/src/live_effects/lpe-fill-between-many.cpp index c0871f2fad926a652a2e85d454140e4c5363d177..bd09f69f9edb14ad7980da854ba613fb47925a37 100644 --- a/src/live_effects/lpe-fill-between-many.cpp +++ b/src/live_effects/lpe-fill-between-many.cpp @@ -253,7 +253,7 @@ void LPEFillBetweenMany::doEffect(Geom::PathVector &curve) linked_path *= itemnear->getRelativeTransform(sp_lpe_item); } if (!res_pathv.empty() && join) { - if (!getSPDoc()->getRoot()->inkscape_version.isInsideRangeInclusive({0, 1}, {1, 1}) && + if (!getSPDoc()->getRoot()->inkscape_version.isInsideRangeExclusive({0, 1}, {1, 1}) && Geom::distance(res_pathv.front().finalPoint(), linked_path.initialPoint()) > Geom::distance(res_pathv.front().finalPoint(), linked_path.finalPoint())) { linked_path = linked_path.reversed(); diff --git a/src/object/sp-item-group.cpp b/src/object/sp-item-group.cpp index 12c8e2c3848363ba649fb6d795c75a394276aac1..390d6b0f442ce7a413affea897a4d88916a9d003 100644 --- a/src/object/sp-item-group.cpp +++ b/src/object/sp-item-group.cpp @@ -1022,7 +1022,7 @@ void SPGroup::update_patheffect(bool write) { // must be set also to non effect items (satellites or parents) lpe_initialized = true; if (hasPathEffect() && pathEffectsEnabled()) { - if (!document->getRoot()->inkscape_version.isInsideRangeInclusive({0, 1}, {0, 92})) { + if (!document->getRoot()->inkscape_version.isInsideRangeExclusive({0, 1}, {0, 92})) { resetClipPathAndMaskLPE(); } PathEffectList path_effect_list(*this->path_effect_list); diff --git a/src/object/sp-lpe-item.cpp b/src/object/sp-lpe-item.cpp index 5e7987e2609e42f4740a57006a2720e63ed03d60..a02a1ed9a6529d74974cc0771815a65241b6633f 100755 --- a/src/object/sp-lpe-item.cpp +++ b/src/object/sp-lpe-item.cpp @@ -1236,7 +1236,7 @@ SPLPEItem::applyToClipPathOrMask(SPItem *clip_mask, SPItem* to, Inkscape::LivePa applyToClipPathOrMask(subitem, to, lpe); } } else if (shape) { - if (root->inkscape_version.isInsideRangeInclusive({0, 1}, {0, 92})) { + if (root->inkscape_version.isInsideRangeExclusive({0, 1}, {0, 92})) { shape->removeAttribute("inkscape:original-d"); } else { if (shape->curve()) { diff --git a/src/object/sp-shape.cpp b/src/object/sp-shape.cpp index 6f831a45c850b8d26fc4590d884736df0a945420..446337d1b94f06ec507d3c99642369fbdebf06b7 100644 --- a/src/object/sp-shape.cpp +++ b/src/object/sp-shape.cpp @@ -663,7 +663,7 @@ void SPShape::update_patheffect(bool write) if (hasPathEffect() && pathEffectsEnabled()) { success = this->performPathEffect(c_lpe, this); if (success) { - if (!document->getRoot()->inkscape_version.isInsideRangeInclusive({0, 1}, {0, 92})) { + if (!document->getRoot()->inkscape_version.isInsideRangeExclusive({0, 1}, {0, 92})) { resetClipPathAndMaskLPE(); } setCurveInsync(c_lpe); diff --git a/src/version.h b/src/version.h index 8532c52fd6af41b77313aeb98ec4f9028688fdb0..76e19ea64d3db77ea987a36c8690766ed94f8907 100644 --- a/src/version.h +++ b/src/version.h @@ -39,10 +39,17 @@ public: } bool operator==(Version const &other) const { return _major == other._major && _minor == other._minor; } + // Run Inclusive check on version [min_version, max_version] bool isInsideRangeInclusive(Version const &min_version, Version const &max_version) const { return min_version <= *this && *this <= max_version; } + + // Run Exclusive check on version (min_version, max_version) + bool isInsideRangeExclusive(Version const &min_version, Version const &max_version) const + { + return min_version < *this && *this < max_version; + } std::string const &str() const; private: