diff --git a/src/document.cpp b/src/document.cpp index 7e99635277e66a91e4e5c6711c93d307be483a17..7a6a7d26cee5ff0579d9c4ee77d7fb4b054071b5 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -851,16 +851,14 @@ void SPDocument::fitToRect(Geom::Rect const &rect, bool with_margins) double margin_bottom = 0.0; if (with_margins && nv) { - if (nv != nullptr) { - margin_top = nv->getMarginLength("fit-margin-top", nv_units, unit_table.getUnit("px"), w, h, false); - margin_left = nv->getMarginLength("fit-margin-left", nv_units, unit_table.getUnit("px"), w, h, true); - margin_right = nv->getMarginLength("fit-margin-right", nv_units, unit_table.getUnit("px"), w, h, true); - margin_bottom = nv->getMarginLength("fit-margin-bottom", nv_units, unit_table.getUnit("px"), w, h, false); - margin_top = Inkscape::Util::Quantity::convert(margin_top, nv_units, "px"); - margin_left = Inkscape::Util::Quantity::convert(margin_left, nv_units, "px"); - margin_right = Inkscape::Util::Quantity::convert(margin_right, nv_units, "px"); - margin_bottom = Inkscape::Util::Quantity::convert(margin_bottom, nv_units, "px"); - } + margin_top = nv->getMarginLength("fit-margin-top", nv_units, unit_table.getUnit("px"), w, h, false); + margin_left = nv->getMarginLength("fit-margin-left", nv_units, unit_table.getUnit("px"), w, h, true); + margin_right = nv->getMarginLength("fit-margin-right", nv_units, unit_table.getUnit("px"), w, h, true); + margin_bottom = nv->getMarginLength("fit-margin-bottom", nv_units, unit_table.getUnit("px"), w, h, false); + margin_top = Inkscape::Util::Quantity::convert(margin_top, nv_units, "px"); + margin_left = Inkscape::Util::Quantity::convert(margin_left, nv_units, "px"); + margin_right = Inkscape::Util::Quantity::convert(margin_right, nv_units, "px"); + margin_bottom = Inkscape::Util::Quantity::convert(margin_bottom, nv_units, "px"); } double y_dir = yaxisdir();