X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLyXRC.cpp;h=6f5a19e6079d85db9f7039c92a370026606ae73e;hb=94f0968e9212f24997cfee0d17c6f060210edbc6;hp=145ac93d246eb66db299c5cfaf92d25cfe243766;hpb=269695aa5f50651cc7e49a480bc426e540b577b6;p=lyx.git diff --git a/src/LyXRC.cpp b/src/LyXRC.cpp index 145ac93d24..6f5a19e607 100644 --- a/src/LyXRC.cpp +++ b/src/LyXRC.cpp @@ -55,7 +55,7 @@ namespace os = support::os; namespace { -static unsigned int const LYXRC_FILEFORMAT = 4; // vfr: remove default paper size +static unsigned int const LYXRC_FILEFORMAT = 5; // vfr: add default length unit // when adding something to this array keep it sorted! LexerKeyword lyxrcTags[] = { @@ -91,6 +91,7 @@ LexerKeyword lyxrcTags[] = { { "\\def_file", LyXRC::RC_DEFFILE }, { "\\default_decimal_point", LyXRC::RC_DEFAULT_DECIMAL_POINT }, { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE }, + { "\\default_length_unit", LyXRC::RC_DEFAULT_LENGTH_UNIT }, { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT }, { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN }, { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS }, @@ -365,6 +366,7 @@ void LyXRC::setDefaults() completion_inline_dots = -1; completion_inline_delay = 0.2; default_decimal_point = "."; + default_length_unit = Length::CM; cursor_width = 1; } @@ -979,6 +981,10 @@ LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format) case RC_DEFAULT_DECIMAL_POINT: lexrc >> default_decimal_point; break; + case RC_DEFAULT_LENGTH_UNIT: + if (lexrc.next()) + default_length_unit = (Length::UNIT) lexrc.getInteger(); + break; case RC_DATE_INSERT_FORMAT: lexrc >> date_insert_format; break; @@ -2448,6 +2454,14 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c if (tag != RC_LAST) break; + case RC_DEFAULT_LENGTH_UNIT: + if (ignore_system_lyxrc || + default_length_unit != system_lyxrc.default_length_unit) { + os << "\\default_length_unit " << int(default_length_unit) << '\n'; + } + if (tag != RC_LAST) + break; + case RC_SPELLCHECKER: if (ignore_system_lyxrc || spellchecker != system_lyxrc.spellchecker) { @@ -2996,6 +3010,7 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new) case LyXRC::RC_FORWARD_SEARCH_PDF: case LyXRC::RC_EXPORT_OVERWRITE: case LyXRC::RC_DEFAULT_DECIMAL_POINT: + case LyXRC::RC_DEFAULT_LENGTH_UNIT: case LyXRC::RC_SCROLL_WHEEL_ZOOM: case LyXRC::RC_CURSOR_WIDTH: break;