]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/xforms_helpers.C
Change glob() API to accept a dir parameter.
[lyx.git] / src / frontends / xforms / xforms_helpers.C
index d8e49c4cea35d438a7e082a6d26b645b79c16355..50fb6409d4fb85485fd65cbb49a8008bd56552fa 100644 (file)
@@ -14,6 +14,7 @@
 
 #include "debug.h"
 #include "gettext.h"
+#include "lengthcommon.h"
 #include "lyxgluelength.h"
 #include "lyxlex.h"
 
 
 #include <fstream>
 
-using lyx::support::AbsolutePath;
-using lyx::support::FileInfo;
-using lyx::support::isStrDbl;
-using lyx::support::OnlyPath;
-using lyx::support::subst;
-using lyx::support::trim;
-
 using std::make_pair;
 
 using std::ofstream;
 using std::vector;
 using std::string;
 
+namespace lyx {
+
+using support::AbsolutePath;
+using support::FileInfo;
+using support::isStrDbl;
+using support::OnlyPath;
+using support::subst;
+using support::trim;
+
+namespace frontend {
+
+std::string const buildChoiceLengthString()
+{
+       string data;
+       for (int i = 0; i != num_units; ++i) {
+               if (i != 0)
+                       data += "|";
+               data += subst(unit_name_gui[i], "%", "%%");
+       }
+       return data;
+}
+
 
 bool isActive(FL_OBJECT * ob)
 {
@@ -325,7 +341,7 @@ bool XformsColor::read(string const & filename)
        if (f.readable() && !lexrc.setFile(filename)) {
                lyxerr << "XformsColor::read(" << filename << ")\n"
                       << _("Failed to open file.") << std::endl;
-               return false;
+               return false;
        }
 
        while (lexrc.isOK()) {
@@ -370,7 +386,7 @@ bool XformsColor::write(string const & filename)
        if (!os) {
                lyxerr << "XformsColor::write(" << filename << ")\n"
                       << _("Failed to open file.") << std::endl;
-               return false;
+               return false;
        }
 
        os << "###"
@@ -544,3 +560,6 @@ bool RWInfo::ReadableFile(string const & name)
 
        return true;
 }
+
+} // namespace frontend
+} // namespace lyx