]> git.lyx.org Git - lyx.git/blobdiff - src/BranchList.cpp
#5502 add binding for full screen toggle on mac
[lyx.git] / src / BranchList.cpp
index 2afc765a3d53aba2b4d04a14f03c57a3d07f0015..4624f19f4da4c2091b0375112bf57d1343d64b77 100644 (file)
@@ -30,7 +30,9 @@ namespace {
 class BranchNamesEqual : public std::unary_function<Branch, bool>
 {
 public:
-       BranchNamesEqual(docstring const & name) : name_(name) {}
+       BranchNamesEqual(docstring const & name)
+               : name_(name)
+       {}
 
        bool operator()(Branch const & branch) const
        {
@@ -39,6 +41,7 @@ public:
 private:
        docstring name_;
 };
+
 }
 
 
@@ -48,6 +51,8 @@ Branch::Branch()
        // no theApp() with command line export
        if (theApp())
                theApp()->getRgbColor(Color_background, color_);
+       else
+               frontend::Application::getRgbColorUncached(Color_background, color_);
 }
 
 
@@ -78,13 +83,13 @@ bool Branch::setSelected(bool b)
 }
 
 
-bool Branch::hasFilenameSuffix() const
+bool Branch::hasFileNameSuffix() const
 {
        return filenameSuffix_;
 }
 
 
-void Branch::setFilenameSuffix(bool b)
+void Branch::setFileNameSuffix(bool b)
 {
        filenameSuffix_ = b;
 }
@@ -106,9 +111,14 @@ void Branch::setColor(string const & str)
 {
        if (str.size() == 7 && str[0] == '#')
                color_ = rgbFromHexName(str);
-       else
+       else {
                // no color set or invalid color - use normal background
-               theApp()->getRgbColor(Color_background, color_);
+               // no theApp() with command line export
+               if (theApp())
+                       theApp()->getRgbColor(Color_background, color_);
+               else
+                       frontend::Application::getRgbColorUncached(Color_background, color_);
+       }
 }
 
 
@@ -148,7 +158,7 @@ bool BranchList::add(docstring const & s)
                        Branch br;
                        br.setBranch(name);
                        br.setSelected(false);
-                       br.setFilenameSuffix(false);
+                       br.setFileNameSuffix(false);
                        list.push_back(br);
                }
                if (j == docstring::npos)
@@ -188,12 +198,12 @@ bool BranchList::rename(docstring const & oldname,
 }
 
 
-docstring BranchList::getFilenameSuffix() const
+docstring BranchList::getFileNameSuffix() const
 {
        docstring result;
        List::const_iterator it = list.begin();
        for (; it != list.end(); ++it) {
-               if (it->isSelected() && it->hasFilenameSuffix())
+               if (it->isSelected() && it->hasFileNameSuffix())
                        result += "-" + it->branch();
        }
        return support::subst(result, from_ascii("/"), from_ascii("_"));