From 870564775ba8d0cf351dcb0f2f32c144f951e1c6 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Mon, 17 Sep 2001 15:39:58 +0000 Subject: [PATCH] one more helper method in Bufferparams git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2767 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 5 +++++ src/bufferparams.C | 16 +++++++++++++++- src/bufferparams.h | 3 +++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index e564ca476b..e462f44fd4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2001-09-17 Jean-Marc Lasgouttes + + * bufferparams.C (hasClassDefaults): new method. Returns true if + the buffer parameters correspond to known class defaults + 2001-09-17 Angus Leeming * XFormsView.C (show): set minimum size to the main window. diff --git a/src/bufferparams.C b/src/bufferparams.C index 69fc6ca014..958800c69e 100644 --- a/src/bufferparams.C +++ b/src/bufferparams.C @@ -177,7 +177,8 @@ void BufferParams::writeFile(ostream & os) const } -void BufferParams::useClassDefaults() { +void BufferParams::useClassDefaults() +{ LyXTextClass const & tclass = textclasslist.TextClass(textclass); sides = tclass.sides(); @@ -189,6 +190,19 @@ void BufferParams::useClassDefaults() { } +bool BufferParams::hasClassDefaults() const +{ + LyXTextClass const & tclass = textclasslist.TextClass(textclass); + + return (sides == tclass.sides() + && columns == tclass.columns() + && pagestyle == tclass.pagestyle() + && options == tclass.options() + && secnumdepth == tclass.secnumdepth() + && tocdepth == tclass.tocdepth()); +} + + void BufferParams::readPreamble(LyXLex & lex) { if (lex.getString() != "\\begin_preamble") diff --git a/src/bufferparams.h b/src/bufferparams.h index f912ffe1a8..1d0adc1fd6 100644 --- a/src/bufferparams.h +++ b/src/bufferparams.h @@ -113,6 +113,9 @@ public: /// void useClassDefaults(); + /// + bool hasClassDefaults() const; + /// VSpace const & getDefSkip() const { return defskip; }