]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetquotes.C
updates to minipage inset
[lyx.git] / src / insets / insetquotes.C
index 8444ee0aa9819e67dd4a2e56c209fb3bee75ff89..378649e3f884b28922f868d15953e87ef64c072d 100644 (file)
@@ -31,8 +31,6 @@ using std::endl;
 // Quotes. Used for the various quotes. German, English, French,
 // Danish, Polish, all either double or single.
 
-extern BufferView * current_view;
-
 // codes used to read/write quotes to LyX files
 static char const * const language_char = "esgpfa";
 static char const * const side_char = "lr" ;
@@ -80,7 +78,7 @@ InsetQuotes::InsetQuotes(char c, BufferParams const & params)
        : language(params.quotes_language), times(params.quotes_times)
 {
        // Decide whether left or right 
-       switch(c) {
+       switch (c) {
        case ' ': case '(': case '{': case '[': case '-': case ':':
        case LyXParagraph::META_HFILL:
        case LyXParagraph::META_NEWLINE: 
@@ -148,7 +146,7 @@ string const InsetQuotes::DispString() const
        if (times == InsetQuotes::DoubleQ)
                disp += disp;
 
-       if (lyxrc.font_norm == "iso8859-1") 
+       if (lyxrc.font_norm_type == LyXRC::ISO_8859_1)
                if (disp == "<<")
                        disp = '«';
                else if (disp == ">>")
@@ -229,17 +227,22 @@ void InsetQuotes::Read(Buffer const *, LyXLex & lex)
 }
 
 
-int InsetQuotes::Latex(Buffer const *, ostream & os,
+extern bool use_babel;
+
+int InsetQuotes::Latex(Buffer const * buf, ostream & os,
                       bool /*fragile*/, bool) const
 {
-       string doclang = 
-               current_view->buffer()->GetLanguage();
+       string const doclang = buf->GetLanguage()->lang();
        int quoteind = quote_index[side][language];
        string qstr;
        
        if (lyxrc.fontenc == "T1") {
                qstr = latex_quote_t1[times][quoteind];
+#ifdef DO_USE_DEFAULT_LANGUAGE
        } else if (doclang == "default") {
+#else
+       } else if (!use_babel) {
+#endif
                qstr = latex_quote_ot1[times][quoteind];
        } else if (language == InsetQuotes::FrenchQ 
                 && times == InsetQuotes::DoubleQ
@@ -275,7 +278,7 @@ int InsetQuotes::Linuxdoc(Buffer const *, ostream & os) const
 
 int InsetQuotes::DocBook(Buffer const *, ostream & os) const
 {
-       if(times == InsetQuotes::DoubleQ) {
+       if (times == InsetQuotes::DoubleQ) {
                if (side == InsetQuotes::LeftQ)
                        os << "&ldquo;";
                else
@@ -294,7 +297,7 @@ void InsetQuotes::Validate(LaTeXFeatures & features) const
 {
        char type = quote_char[quote_index[side][language]];
 
-       if (current_view->buffer()->GetLanguage() == "default" 
+       if (features.bufferParams().language->lang() == "default" 
            && lyxrc.fontenc != "T1") {
                if (times == InsetQuotes::SingleQ) 
                        switch (type) {
@@ -314,7 +317,7 @@ void InsetQuotes::Validate(LaTeXFeatures & features) const
 }
 
 
-Inset * InsetQuotes::Clone() const
+Inset * InsetQuotes::Clone(Buffer const &) const
 {
   return new InsetQuotes(language, side, times);
 }