From 1fda2e457748b96ef8d34eac9e6416b8de925eae Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Thu, 16 Jul 2009 12:35:31 +0000 Subject: [PATCH] branch: Fix the enabling of the custom page size field in GuiDocument. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@30626 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiDocument.cpp | 14 +++++++++----- src/frontends/qt4/GuiDocument.h | 4 +++- status.16x | 3 +++ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/frontends/qt4/GuiDocument.cpp b/src/frontends/qt4/GuiDocument.cpp index b0577dba66..05daa4d628 100644 --- a/src/frontends/qt4/GuiDocument.cpp +++ b/src/frontends/qt4/GuiDocument.cpp @@ -641,9 +641,9 @@ GuiDocument::GuiDocument(GuiView & lv) pageLayoutModule = new UiWidget; // page layout connect(pageLayoutModule->papersizeCO, SIGNAL(activated(int)), - this, SLOT(setCustomPapersize(int))); + this, SLOT(papersizeChanged(int))); connect(pageLayoutModule->papersizeCO, SIGNAL(activated(int)), - this, SLOT(setCustomPapersize(int))); + this, SLOT(papersizeChanged(int))); connect(pageLayoutModule->portraitRB, SIGNAL(clicked()), this, SLOT(portraitChanged())); connect(pageLayoutModule->papersizeCO, SIGNAL(activated(int)), @@ -1108,10 +1108,14 @@ void GuiDocument::setMargins(bool custom) } -void GuiDocument::setCustomPapersize(int papersize) +void GuiDocument::papersizeChanged(int paper_size) { - bool const custom = (papersize == 1); + setCustomPapersize(paper_size == 1); +} + +void GuiDocument::setCustomPapersize(bool custom) +{ pageLayoutModule->paperwidthL->setEnabled(custom); pageLayoutModule->paperwidthLE->setEnabled(custom); pageLayoutModule->paperwidthUnitCO->setEnabled(custom); @@ -2101,7 +2105,7 @@ void GuiDocument::paramsToDialog() documentClass().provides("geometry"); int const psize = bp_.papersize; pageLayoutModule->papersizeCO->setCurrentIndex(psize); - setCustomPapersize(!extern_geometry && psize); + setCustomPapersize(!extern_geometry && psize == 1); pageLayoutModule->papersizeCO->setEnabled(!extern_geometry); bool const landscape = diff --git a/src/frontends/qt4/GuiDocument.h b/src/frontends/qt4/GuiDocument.h index c5c1c55bf1..9dd412b20e 100644 --- a/src/frontends/qt4/GuiDocument.h +++ b/src/frontends/qt4/GuiDocument.h @@ -82,7 +82,7 @@ private Q_SLOTS: void useDefaultsClicked(); void setLSpacing(int); void setMargins(bool); - void setCustomPapersize(int); + void papersizeChanged(int); void setColSep(); void setCustomMargins(bool); void romanChanged(int); @@ -201,6 +201,8 @@ private: bool providesSC(std::string const & font) const; /// does this font provide size adjustment? bool providesScale(std::string const & font) const; + /// + void setCustomPapersize(bool custom); private: /// void loadModuleInfo(); diff --git a/status.16x b/status.16x index 7b6faccf07..5cd351d8fe 100644 --- a/status.16x +++ b/status.16x @@ -228,6 +228,9 @@ What's new - Fix unitialized variable in Dialog code (bug 6081). +- Fix the enabling of the page height and width fields in the Document + Settings dialog. + * DOCUMENTATION AND LOCALIZATION