]> git.lyx.org Git - lyx.git/blobdiff - src/vspace.C
cleanup after svn hang-up, #undef CursorShape. Should be compilable ganin now.
[lyx.git] / src / vspace.C
index 9313ab09a31b606bd5bb0bd280f6f74767b485a0..d97cb8eca35ec7649e517a1476b8a309a4eb5850 100644 (file)
 #include "buffer.h"
 #include "bufferparams.h"
 #include "BufferView.h"
+#include "gettext.h"
 #include "lengthcommon.h"
 #include "lyxtext.h"
 
+#include "support/convert.h"
 #include "support/lstrings.h"
 
 using lyx::support::compare;
@@ -24,7 +26,6 @@ using lyx::support::isStrDbl;
 using lyx::support::ltrim;
 using lyx::support::prefixIs;
 using lyx::support::rtrim;
-using lyx::support::strToDbl;
 
 using std::string;
 
@@ -117,7 +118,7 @@ char nextToken(string & data)
                lyx_advance(data, i);
 
                if (isStrDbl(buffer)) {
-                       number[number_index] = strToDbl(buffer);
+                       number[number_index] = convert<double>(buffer);
                        ++number_index;
                        return 'n';
                }
@@ -388,7 +389,7 @@ VSpace::VSpace(string const & data)
                // without units in added_space_top/bottom.
                // Let unit default to centimeters here.
                kind_ = LENGTH;
-               len_  = LyXGlueLength(LyXLength(strToDbl(input), LyXLength::CM));
+               len_  = LyXGlueLength(LyXLength(convert<double>(input), LyXLength::CM));
        }
 }
 
@@ -478,6 +479,34 @@ string const VSpace::asLatexCommand(BufferParams const & params) const
 }
 
 
+string const VSpace::asGUIName() const
+{
+       string result;
+       switch (kind_) {
+       case DEFSKIP:
+               result = lyx::to_utf8(_("Default skip"));
+               break;
+       case SMALLSKIP:
+               result = lyx::to_utf8(_("Small skip"));
+               break;
+       case MEDSKIP:
+               result = lyx::to_utf8(_("Medium skip"));
+               break;
+       case BIGSKIP:
+               result = lyx::to_utf8(_("Big skip"));
+               break;
+       case VFILL:
+               result = lyx::to_utf8(_("Vertical fill"));
+               break;
+       case LENGTH:
+               result = len_.asString();
+               break;
+       }
+       if (keep_)
+               result += ", " + lyx::to_utf8(_("protected"));
+       return result;
+}
+
 
 int VSpace::inPixels(BufferView const & bv) const
 {