+2005-12-12 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
+
+ * lyxrc.C: set default_papersize to PAPER_DEFAULT;
+ handle PAPER_DEFAULT in LyXRC::read and LyXRC::write (bug 2148).
+ * paper.h: dispose dead PAPER_PACKAGES enum.
+
2005-12-07 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* Makefile.am (OTHERLIBS): add SOCKET_LIBS in case we compile
+2005-12-12 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
+
+ * ControlPrefs.[Ch]: new helper functions toPaperSize and
+ fromPaperSize that prevent off-by-x errors in the papersize
+ combos (bug 2148).
+
2005-11-28 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* ControlErrorList.C (goTo): give a better error message when pid
#include "bufferlist.h"
#include "gettext.h"
#include "funcrequest.h"
+#include "paper.h"
#include "LColor.h"
#include "support/filefilterlist.h"
return browseDir(path, title);
}
+
+// We support less paper sizes than the document dialog
+// Therefore this adjustment is needed.
+PAPER_SIZE const ControlPrefs::toPaperSize(int i) const
+{
+ switch (i) {
+ case 0:
+ return PAPER_DEFAULT;
+ case 1:
+ return PAPER_USLETTER;
+ case 2:
+ return PAPER_USLEGAL;
+ case 3:
+ return PAPER_USEXECUTIVE;
+ case 4:
+ return PAPER_A3;
+ case 5:
+ return PAPER_A4;
+ case 6:
+ return PAPER_A5;
+ case 7:
+ return PAPER_B5;
+ default:
+ // should not happen
+ return PAPER_DEFAULT;
+ }
+}
+
+
+int const ControlPrefs::fromPaperSize(PAPER_SIZE papersize) const
+{
+ switch (papersize) {
+ case PAPER_DEFAULT:
+ return 0;
+ case PAPER_USLETTER:
+ return 1;
+ case PAPER_USLEGAL:
+ return 2;
+ case PAPER_USEXECUTIVE:
+ return 3;
+ case PAPER_A3:
+ return 4;
+ case PAPER_A4:
+ return 5;
+ case PAPER_A5:
+ return 6;
+ case PAPER_B5:
+ return 7;
+ default:
+ // should not happen
+ return 0;
+ }
+}
+
} // namespace frontend
} // namespace lyx
/// update the screen fonts after change
void updateScreenFonts();
+ /// adjust the prefs paper sizes
+ PAPER_SIZE const toPaperSize(int i) const;
+ /// adjust the prefs paper sizes
+ int const fromPaperSize(PAPER_SIZE papersize) const;
+
private:
/// temporary lyxrc
LyXRC rc_;
+2005-12-12 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
+
+ * QPrefs.C: fix off-by-x errors in paper size setting
+ by using new helper functions fromPaperSize/toPaperSize (bug 2148).
+
2005-11-17 Michael Gerz <michael.gerz@teststep.org>
* ui/*.ui: remove dummy captions that pollute the po files
rc.auto_reset_options = latexmod->latexAutoresetCB->isChecked();
rc.view_dvi_paper_option = fromqstr(latexmod->latexDviPaperED->text());
rc.default_papersize =
- static_cast<PAPER_SIZE>(latexmod->latexPaperSizeCO->currentItem());
+ controller().toPaperSize(latexmod->latexPaperSizeCO->currentItem());
QPrefDisplayModule * displaymod(dialog_->displayModule);
latexmod->latexIndexED->setText(toqstr(rc.index_command));
latexmod->latexAutoresetCB->setChecked(rc.auto_reset_options);
latexmod->latexDviPaperED->setText(toqstr(rc.view_dvi_paper_option));
- latexmod->latexPaperSizeCO->setCurrentItem(rc.default_papersize);
+ latexmod->latexPaperSizeCO->setCurrentItem(
+ controller().fromPaperSize(rc.default_papersize));
QPrefDisplayModule * displaymod(dialog_->displayModule);
+2005-12-12 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
+
+ * FormPreferences.C: fix off-by-x errors in paper size setting
+ by using new helper functions fromPaperSize/toPaperSize (bug 2148).
+
2005-10-05 Angus Leeming <leeming@lyx.org>
* FormGraphics.C (build):
int const choice =
fl_get_choice(dialog_->choice_default_papersize) - 1;
- rc.default_papersize = static_cast<PAPER_SIZE>(choice);
+ rc.default_papersize = parent_.controller().toPaperSize(choice);
rc.ascii_roff_command = getString(dialog_->input_ascii_roff);
rc.chktex_command = getString(dialog_->input_checktex);
fl_set_input(dialog_->input_tex_encoding,
rc.fontenc.c_str());
fl_set_choice(dialog_->choice_default_papersize,
- rc.default_papersize + 1);
+ parent_.controller().fromPaperSize(rc.default_papersize) + 1);
fl_set_input(dialog_->input_ascii_roff,
rc.ascii_roff_command.c_str());
fl_set_input(dialog_->input_checktex,
document_path.erase();
tempdir_path = "/tmp";
view_dvi_paper_option.erase();
- default_papersize = PAPER_USLETTER;
+ default_papersize = PAPER_DEFAULT;
custom_export_format = "ps";
chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
bibtex_command = "bibtex";
else if (size == "b5")
default_papersize =
PAPER_B5;
+ else if (size == "default")
+ default_papersize =
+ PAPER_DEFAULT;
}
break;
os << "# The default papersize to use.\n"
<< "\\default_papersize \"";
switch (default_papersize) {
+ case PAPER_DEFAULT:
+ os << "default"; break;
case PAPER_USLETTER:
os << "usletter"; break;
case PAPER_USLEGAL:
os << "a5"; break;
case PAPER_B5:
os << "b5"; break;
- case PAPER_DEFAULT:
- case PAPER_CUSTOM:
+ case PAPER_CUSTOM:
case PAPER_B3:
case PAPER_B4: break;
}
#ifndef PAPER_H
#define PAPER_H
-///
-enum PAPER_PACKAGES {
- ///
- PACKAGE_NONE,
- ///
- PACKAGE_A4,
- ///
- PACKAGE_A4WIDE,
- ///
- PACKAGE_WIDEMARGINSA4
-};
-
///
enum PAPER_SIZE {
///