mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
Fixes to ParIndent support
- remove quotes around length - use "default" for default parindent, instead of an empty string - Fix the constructor Length(string const &) so that an empty string corresponds to an empty length (coherent with Length::asString()).
This commit is contained in:
parent
b250eb5a46
commit
e7c3354a87
@ -822,7 +822,12 @@ string BufferParams::readToken(Lexer & lex, string const & token,
|
||||
lex >> parsep;
|
||||
paragraph_separation = parseptranslator().find(parsep);
|
||||
} else if (token == "\\paragraph_indentation") {
|
||||
lex >> pimpl_->parindent;
|
||||
lex.next();
|
||||
string parindent = lex.getString();
|
||||
if (parindent == "default")
|
||||
pimpl_->parindent = Length();
|
||||
else
|
||||
pimpl_->parindent = Length(parindent);
|
||||
} else if (token == "\\defskip") {
|
||||
lex.next();
|
||||
string const defskip = lex.getString();
|
||||
@ -1327,7 +1332,8 @@ void BufferParams::writeFile(ostream & os, Buffer const * buf) const
|
||||
<< "\n\\paragraph_separation "
|
||||
<< string_paragraph_separation[paragraph_separation];
|
||||
if (!paragraph_separation)
|
||||
os << "\n\\paragraph_indentation " << Lexer::quoteString(pimpl_->parindent.asString());
|
||||
os << "\n\\paragraph_indentation "
|
||||
<< (pimpl_->parindent.empty() ? "default" : pimpl_->parindent.asString());
|
||||
else
|
||||
os << "\n\\defskip " << getDefSkip().asLyXCommand();
|
||||
os << "\n\\is_math_indent " << is_math_indent;
|
||||
|
@ -52,7 +52,7 @@ Length::Length(double v, Length::UNIT u)
|
||||
|
||||
|
||||
Length::Length(string const & data)
|
||||
: val_(0), unit_(Length::PT)
|
||||
: val_(0), unit_(Length::UNIT_NONE)
|
||||
{
|
||||
Length tmp;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user