]> git.lyx.org Git - lyx.git/blobdiff - src/BufferParams.cpp
cleanup and reorder initialisation code of GuiView and GuiToolbars. Move some things...
[lyx.git] / src / BufferParams.cpp
index 80724d6cbcaeb1171168323302d506600528b621..a713f84c52a74bfec1853b65c883c76c8500f224 100644 (file)
@@ -21,6 +21,7 @@
 #include "BranchList.h"
 #include "buffer_funcs.h"
 #include "Bullet.h"
+#include "Color.h"
 #include "debug.h"
 #include "Encoding.h"
 #include "gettext.h"
 #include "insets/InsetListingsParams.h"
 
 #include "support/convert.h"
+#include "support/docstream.h"
 #include "support/filetools.h"
 #include "support/Translator.h"
 #include "support/lstrings.h"
 
-#include <boost/array.hpp>
-
 #include <algorithm>
 #include <sstream>
 
@@ -195,13 +195,13 @@ PaperOrientationTranslator const & paperorientationtranslator()
 
 
 // Page sides
-typedef Translator<int, TextClass::PageSides> SidesTranslator;
+typedef Translator<int, PageSides> SidesTranslator;
 
 
 SidesTranslator const init_sidestranslator()
 {
-       SidesTranslator translator(1, TextClass::OneSide);
-       translator.addPair(2, TextClass::TwoSides);
+       SidesTranslator translator(1, OneSide);
+       translator.addPair(2, TwoSides);
        return translator;
 }
 
@@ -286,8 +286,8 @@ public:
 
        AuthorList authorlist;
        BranchList branchlist;
-       boost::array<Bullet, 4> temp_bullets;
-       boost::array<Bullet, 4> user_defined_bullets;
+       Bullet temp_bullets[4];
+       Bullet user_defined_bullets[4];
        Spacing spacing;
        /** This is the amount of space used for paragraph_separation "skip",
         * and for detached paragraphs in "indented" documents.
@@ -352,7 +352,7 @@ BufferParams::BufferParams()
        fontsTypewriterScale = 100;
        inputenc = "auto";
        graphicsDriver = "default";
-       sides = TextClass::OneSide;
+       sides = OneSide;
        columns = 1;
        listings_params = string();
        pagestyle = "default";
@@ -863,10 +863,10 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features,
        // if needed
        if (sides != tclass.sides()) {
                switch (sides) {
-               case TextClass::OneSide:
+               case OneSide:
                        clsoptions << "oneside,";
                        break;
-               case TextClass::TwoSides:
+               case TwoSides:
                        clsoptions << "twoside,";
                        break;
                }
@@ -1392,15 +1392,14 @@ void BufferParams::clearLayoutModules() {
 
 Font const BufferParams::getFont() const
 {
-       Font f = getTextClass().defaultfont();
-       f.setLanguage(language);
+       FontInfo f = getTextClass().defaultfont();
        if (fontsDefaultFamily == "rmdefault")
-               f.setFamily(Font::ROMAN_FAMILY);
+               f.setFamily(ROMAN_FAMILY);
        else if (fontsDefaultFamily == "sfdefault")
-               f.setFamily(Font::SANS_FAMILY);
+               f.setFamily(SANS_FAMILY);
        else if (fontsDefaultFamily == "ttdefault")
-               f.setFamily(Font::TYPEWRITER_FAMILY);
-       return f;
+               f.setFamily(TYPEWRITER_FAMILY);
+       return Font(f, language);
 }
 
 
@@ -1621,7 +1620,7 @@ void BufferParams::writeEncodingPreamble(odocstream & os,
                        os << "]{inputenc}\n";
                        texrow.newline();
                }
-               if (package == Encoding::CJK) {
+               if (package == Encoding::CJK || features.mustProvide("CJK")) {
                        os << "\\usepackage{CJK}\n";
                        texrow.newline();
                }