X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FVSpace.cpp;h=f377edebaed284f1f69f99c1a7f92ca088a7ccde;hb=09df753df4c24470617c64d25eae6df2db85dfed;hp=bae4c799e540e772dfc6563644236b4f32a6c667;hpb=e0d54dd3b497b78094ea16ab0f38ccdc8c1642e2;p=lyx.git diff --git a/src/VSpace.cpp b/src/VSpace.cpp index bae4c799e5..f377edebae 100644 --- a/src/VSpace.cpp +++ b/src/VSpace.cpp @@ -11,12 +11,14 @@ #include #include "VSpace.h" + #include "Buffer.h" #include "BufferParams.h" #include "BufferView.h" #include "gettext.h" -#include "lengthcommon.h" +#include "Length.h" #include "Text.h" +#include "TextMetrics.h" // for defaultRowHeight() #include "support/convert.h" #include "support/lstrings.h" @@ -249,10 +251,12 @@ bool isValidGlueLength(string const & data, GlueLength * result) unit_index = 1; // entries at index 0 are sentinels // construct "pattern" from "data" - while (!isEndOfData (buffer)) { - if (pattern_index > 20) return false; - pattern[pattern_index] = nextToken (buffer); - if (pattern[pattern_index] == 'E') return false; + while (!isEndOfData(buffer)) { + if (pattern_index > 20) + return false; + pattern[pattern_index] = nextToken(buffer); + if (pattern[pattern_index] == 'E') + return false; ++pattern_index; } pattern[pattern_index] = '\0'; @@ -324,7 +328,8 @@ bool isValidLength(string const & data, Length * result) pattern[pattern_index] = '\0'; // only the most basic pattern is accepted here - if (compare(pattern, "nu") != 0) return false; + if (compare(pattern, "nu") != 0) + return false; // It _was_ a correct length string. // Store away the values we found. @@ -345,7 +350,7 @@ VSpace::VSpace() {} -VSpace::VSpace(vspace_kind k) +VSpace::VSpace(VSpaceKind k) : kind_(k), len_(), keep_(false) {} @@ -397,30 +402,6 @@ VSpace::VSpace(string const & data) } -VSpace::vspace_kind VSpace::kind() const -{ - return kind_; -} - - -GlueLength const & VSpace::length() const -{ - return len_; -} - - -bool VSpace::keep() const -{ - return keep_; -} - - -void VSpace::setKeep(bool val) -{ - keep_ = val; -} - - bool VSpace::operator==(VSpace const & other) const { if (kind_ != other.kind_) @@ -519,7 +500,7 @@ int VSpace::inPixels(BufferView const & bv) const switch (kind_) { case DEFSKIP: - return bv.buffer()->params().getDefSkip().inPixels(bv); + return bv.buffer().params().getDefSkip().inPixels(bv); // This is how the skips are normally defined by LateX. // But there should be some way to change this per document.