texrow.newline();
}
if (!tclass.provides("geometry")
- && (use_geometry || nonstandard_papersize)) {
+ && (use_geometry || nonstandard_papersize)) {
odocstringstream ods;
if (!getGraphicsDriver("geometry").empty())
ods << getGraphicsDriver("geometry");
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");
}
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 &)),
}
-void GuiDocument::portraitChanged()
-{
- setMargins(pageLayoutModule->papersizeCO->currentIndex());
-}
-
-
-void GuiDocument::setMargins(bool custom)
+void GuiDocument::setMargins()
{
bool const extern_geometry =
documentClass().provides("geometry");
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);
}
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);
bp_.orientation = ORIENTATION_PORTRAIT;
// margins
- bp_.use_geometry = !marginsModule->marginCB->isChecked()
- || geom_papersize;
+ bp_.use_geometry = !marginsModule->marginCB->isChecked();
Ui::MarginsUi const * m = marginsModule;
// margins
Ui::MarginsUi * m = marginsModule;
- setMargins(!bp_.use_geometry);
+ setMargins();
lengthToWidgets(m->topLE, m->topUnit,
bp_.topmargin, defaultUnit);