]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetSpace.cpp
Properly communicate forced encodings
[lyx.git] / src / insets / InsetSpace.cpp
index 3a5161a9ed9fd1469d96fa9eb11d420f5c6420bb..2a709c4b0edf28c15fb3d070c02fe5b49a16a2b7 100644 (file)
@@ -27,6 +27,7 @@
 #include "MetricsInfo.h"
 #include "OutputParams.h"
 #include "output_xhtml.h"
+#include "texstream.h"
 
 #include "support/debug.h"
 #include "support/docstream.h"
@@ -200,9 +201,10 @@ int const arrow_size = 8;
 void InsetSpace::metrics(MetricsInfo & mi, Dimension & dim) const
 {
        if (isHfill()) {
-               // The metrics for this kinds are calculated externally in
-               // \c TextMetrics::computeRowMetrics. Those are dummy value:
-               dim = Dimension(10, 10, 10);
+               // The width for hfills is calculated externally in
+               // TextMetrics::computeRowMetrics. The value of 5 is the
+               // minimal value when the hfill is not active.
+               dim = Dimension(5, 10, 10);
                return;
        }
 
@@ -258,8 +260,6 @@ void InsetSpace::metrics(MetricsInfo & mi, Dimension & dim) const
                        // shut up compiler
                        break;
        }
-       // Cache the inset dimension.
-       setDimCache(mi, dim);
 }
 
 
@@ -387,7 +387,6 @@ void InsetSpace::draw(PainterInfo & pi, int x, int y) const
 
 void InsetSpaceParams::write(ostream & os) const
 {
-       string command;
        switch (kind) {
        case InsetSpaceParams::NORMAL:
                os << "\\space{}";
@@ -832,7 +831,7 @@ docstring InsetSpace::xhtml(XHTMLStream & xs, OutputParams const &) const
 void InsetSpace::validate(LaTeXFeatures & features) const
 {
        if (params_.kind == InsetSpaceParams::NEGMEDIUM ||
-           params_.kind == InsetSpaceParams::NEGTHICK) 
+           params_.kind == InsetSpaceParams::NEGTHICK)
                features.require("amsmath");
 }