From d0cd79a7edbf3515f8d239fca1897a17052132de Mon Sep 17 00:00:00 2001 From: =?utf8?q?Uwe=20St=C3=B6hr?= Date: Sun, 23 Sep 2007 19:17:22 +0000 Subject: [PATCH] PDFOptions: patch by Pavel to store the settings when the user switches hyperref temporarily off git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20456 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/PDFOptions.cpp | 23 +++++++++++++++++------ src/PDFOptions.h | 14 +++++++++++++- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/src/PDFOptions.cpp b/src/PDFOptions.cpp index 5c8233f754..e25dd0710e 100644 --- a/src/PDFOptions.cpp +++ b/src/PDFOptions.cpp @@ -31,12 +31,23 @@ const string PDFOptions::pagemode_fullscreen("FullScreen"); bool PDFOptions::empty() const { - return author.empty() - && title.empty() - && subject.empty() - && keywords.empty() - && pagemode.empty() - && quoted_options.empty(); + PDFOptions x; //implicit hyperref settings + + return author == x.author + && title == x.title + && subject == x.subject + && keywords == x.keywords + && pagemode == x.pagemode + && quoted_options == x.quoted_options + && bookmarks == x.bookmarks + && bookmarksnumbered == x.bookmarksnumbered + && bookmarksopen == x.bookmarksopen + && bookmarksopenlevel == x.bookmarksopenlevel + && breaklinks == x.breaklinks + && pdfborder == x.pdfborder + && colorlinks == x.colorlinks + && backref == x.backref + && pagebackref == x.pagebackref ; } void PDFOptions::writeFile(ostream & os) const diff --git a/src/PDFOptions.h b/src/PDFOptions.h index 82d08841cb..84580f23e1 100644 --- a/src/PDFOptions.h +++ b/src/PDFOptions.h @@ -19,11 +19,23 @@ namespace lyx { class Lexer; /// Options for PDF generation + +/* + Possible cleanups, left for next fileformat change: + + - bookmarksopenlevel is stored in .lyx as string; + after change to spinbox it would be appropriate + change to int. + - store_options flag can be completely replaced by + function store_options() doing essentialy the same + as empty() now. +*/ + class PDFOptions { public: /// PDFOptions() { clear(); } - /// check for string settings + /// check whether user added any settings for hyperref bool empty() const; /// output to lyx header void writeFile(std::ostream &) const; -- 2.39.5