mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 18:08:10 +00:00
* GuiDocument:
- fix #6699; use_geometry now only means that the user don't want to have custom margins; that geometry also needs to be loaded for some paper formats is already done in BufferParams.cpp - remove portraitChanged() because this was useless - A4 landscape is still A4 and still uses the default margins * BufferParams.cpp: only output the margins if the option "Default margins" is not checked - this was a bug in the margins UI git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34429 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
10dc64bd18
commit
0600e656f8
@ -1397,7 +1397,7 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features,
|
||||
texrow.newline();
|
||||
}
|
||||
if (!tclass.provides("geometry")
|
||||
&& (use_geometry || nonstandard_papersize)) {
|
||||
&& (use_geometry || nonstandard_papersize)) {
|
||||
odocstringstream ods;
|
||||
if (!getGraphicsDriver("geometry").empty())
|
||||
ods << getGraphicsDriver("geometry");
|
||||
@ -1536,25 +1536,28 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features,
|
||||
os << '[' << g_options << ']';
|
||||
os << "{geometry}\n";
|
||||
texrow.newline();
|
||||
os << "\\geometry{verbose";
|
||||
if (!topmargin.empty())
|
||||
os << ",tmargin=" << from_ascii(Length(topmargin).asLatexString());
|
||||
if (!bottommargin.empty())
|
||||
os << ",bmargin=" << from_ascii(Length(bottommargin).asLatexString());
|
||||
if (!leftmargin.empty())
|
||||
os << ",lmargin=" << from_ascii(Length(leftmargin).asLatexString());
|
||||
if (!rightmargin.empty())
|
||||
os << ",rmargin=" << from_ascii(Length(rightmargin).asLatexString());
|
||||
if (!headheight.empty())
|
||||
os << ",headheight=" << from_ascii(Length(headheight).asLatexString());
|
||||
if (!headsep.empty())
|
||||
os << ",headsep=" << from_ascii(Length(headsep).asLatexString());
|
||||
if (!footskip.empty())
|
||||
os << ",footskip=" << from_ascii(Length(footskip).asLatexString());
|
||||
if (!columnsep.empty())
|
||||
os << ",columnsep=" << from_ascii(Length(columnsep).asLatexString());
|
||||
os << "}\n";
|
||||
texrow.newline();
|
||||
// output this if only use_geometry is true
|
||||
if (use_geometry) {
|
||||
os << "\\geometry{verbose";
|
||||
if (!topmargin.empty())
|
||||
os << ",tmargin=" << from_ascii(Length(topmargin).asLatexString());
|
||||
if (!bottommargin.empty())
|
||||
os << ",bmargin=" << from_ascii(Length(bottommargin).asLatexString());
|
||||
if (!leftmargin.empty())
|
||||
os << ",lmargin=" << from_ascii(Length(leftmargin).asLatexString());
|
||||
if (!rightmargin.empty())
|
||||
os << ",rmargin=" << from_ascii(Length(rightmargin).asLatexString());
|
||||
if (!headheight.empty())
|
||||
os << ",headheight=" << from_ascii(Length(headheight).asLatexString());
|
||||
if (!headsep.empty())
|
||||
os << ",headsep=" << from_ascii(Length(headsep).asLatexString());
|
||||
if (!footskip.empty())
|
||||
os << ",footskip=" << from_ascii(Length(footskip).asLatexString());
|
||||
if (!columnsep.empty())
|
||||
os << ",columnsep=" << from_ascii(Length(columnsep).asLatexString());
|
||||
os << "}\n";
|
||||
texrow.newline();
|
||||
}
|
||||
} else if (orientation == ORIENTATION_LANDSCAPE) {
|
||||
features.require("papersize");
|
||||
}
|
||||
|
@ -721,7 +721,7 @@ GuiDocument::GuiDocument(GuiView & lv)
|
||||
connect(pageLayoutModule->papersizeCO, SIGNAL(activated(int)),
|
||||
this, SLOT(papersizeChanged(int)));
|
||||
connect(pageLayoutModule->portraitRB, SIGNAL(clicked()),
|
||||
this, SLOT(portraitChanged()));
|
||||
this, SLOT(change_adaptor()));
|
||||
connect(pageLayoutModule->papersizeCO, SIGNAL(activated(int)),
|
||||
this, SLOT(change_adaptor()));
|
||||
connect(pageLayoutModule->paperheightLE, SIGNAL(textChanged(const QString &)),
|
||||
@ -1297,13 +1297,7 @@ void GuiDocument::enableSkip(bool skip)
|
||||
}
|
||||
|
||||
|
||||
void GuiDocument::portraitChanged()
|
||||
{
|
||||
setMargins(pageLayoutModule->papersizeCO->currentIndex());
|
||||
}
|
||||
|
||||
|
||||
void GuiDocument::setMargins(bool custom)
|
||||
void GuiDocument::setMargins()
|
||||
{
|
||||
bool const extern_geometry =
|
||||
documentClass().provides("geometry");
|
||||
@ -1313,8 +1307,12 @@ void GuiDocument::setMargins(bool custom)
|
||||
setCustomMargins(true);
|
||||
return;
|
||||
}
|
||||
marginsModule->marginCB->setChecked(custom);
|
||||
setCustomMargins(custom);
|
||||
bool custom = false;
|
||||
// only check marginCB when there are no custom margins set
|
||||
if (bp_.use_geometry)
|
||||
custom = true;
|
||||
marginsModule->marginCB->setChecked(!custom);
|
||||
setCustomMargins(!custom);
|
||||
}
|
||||
|
||||
|
||||
@ -2353,12 +2351,6 @@ void GuiDocument::applyView()
|
||||
bp_.papersize = PAPER_SIZE(
|
||||
pageLayoutModule->papersizeCO->currentIndex());
|
||||
|
||||
// only custom, A4, B4, B5 and the US sizes don't need the LaTeX-
|
||||
// package gegeometry
|
||||
int psize = pageLayoutModule->papersizeCO->currentIndex();
|
||||
bool geom_papersize = (psize != 1 && psize != 2 && psize != 3
|
||||
&& psize != 4 && psize != 9 && psize != 10 && psize != 17);
|
||||
|
||||
bp_.paperwidth = widgetsToLength(pageLayoutModule->paperwidthLE,
|
||||
pageLayoutModule->paperwidthUnitCO);
|
||||
|
||||
@ -2376,8 +2368,7 @@ void GuiDocument::applyView()
|
||||
bp_.orientation = ORIENTATION_PORTRAIT;
|
||||
|
||||
// margins
|
||||
bp_.use_geometry = !marginsModule->marginCB->isChecked()
|
||||
|| geom_papersize;
|
||||
bp_.use_geometry = !marginsModule->marginCB->isChecked();
|
||||
|
||||
Ui::MarginsUi const * m = marginsModule;
|
||||
|
||||
@ -2822,7 +2813,7 @@ void GuiDocument::paramsToDialog()
|
||||
// margins
|
||||
Ui::MarginsUi * m = marginsModule;
|
||||
|
||||
setMargins(!bp_.use_geometry);
|
||||
setMargins();
|
||||
|
||||
lengthToWidgets(m->topLE, m->topUnit,
|
||||
bp_.topmargin, defaultUnit);
|
||||
|
@ -88,7 +88,7 @@ private Q_SLOTS:
|
||||
void saveDefaultClicked();
|
||||
void useDefaultsClicked();
|
||||
void setLSpacing(int);
|
||||
void setMargins(bool);
|
||||
void setMargins();
|
||||
void papersizeChanged(int);
|
||||
void setColSep();
|
||||
void setCustomMargins(bool);
|
||||
@ -100,7 +100,6 @@ private Q_SLOTS:
|
||||
void enableIndent(bool);
|
||||
void setSkip(int);
|
||||
void enableSkip(bool);
|
||||
void portraitChanged();
|
||||
void browseLayout();
|
||||
void browseMaster();
|
||||
void classChanged();
|
||||
|
Loading…
Reference in New Issue
Block a user