masterPerspectiveCB->isChecked());
QString old = document_->toPlainText();
QString qcontent = toqstr(content);
-#ifdef DEVEL_VERSION
- // output tex<->row correspondences in the source panel if the "-dbg latex"
- // option is given.
- if (texrow_ && lyx::lyxerr.debugging(Debug::LATEX)) {
- QStringList list = qcontent.split(QChar('\n'));
- docstring_list dlist;
- for (QStringList::const_iterator it = list.begin(); it != list.end(); ++it)
- dlist.push_back(from_utf8(fromqstr(*it)));
- texrow_->prepend(dlist);
- qcontent.clear();
- for (docstring_list::iterator it = dlist.begin(); it != dlist.end(); ++it)
- qcontent += toqstr(*it) + '\n';
+ if (guiApp->currentView()->develMode()) {
+ // output tex<->row correspondences in the source panel if the "-dbg latex"
+ // option is given.
+ if (texrow_ && lyx::lyxerr.debugging(Debug::LATEX)) {
+ QStringList list = qcontent.split(QChar('\n'));
+ docstring_list dlist;
+ for (QStringList::const_iterator it = list.begin(); it != list.end(); ++it)
+ dlist.push_back(from_utf8(fromqstr(*it)));
+ texrow_->prepend(dlist);
+ qcontent.clear();
+ for (docstring_list::iterator it = dlist.begin(); it != dlist.end(); ++it)
+ qcontent += toqstr(*it) + '\n';
+ }
}
-#endif
+
// prevent gotoCursor()
QSignalBlocker blocker(viewSourceTV);
bool const changed = setText(qcontent);
QSignalBlocker blocker(outputFormatCO);
outputFormatCO->clear();
outputFormatCO->addItem(qt_("Default"),
- QVariant(QString("default")));
+ QVariant(QString("default")));
int index = 0;
- vector<string> tmp = bv.buffer().params().backends();
- vector<string>::const_iterator it = tmp.begin();
- vector<string>::const_iterator en = tmp.end();
- for (; it != en; ++it) {
- string const format = *it;
- Format const * fmt = theFormats().getFormat(format);
+ for (string const & fmt_name : bv.buffer().params().backends()) {
+ Format const * fmt = theFormats().getFormat(fmt_name);
if (!fmt) {
- LYXERR0("Can't find format for backend " << format << "!");
+ LYXERR0("Can't find format for backend " << fmt_name << "!");
continue;
- }
-
+ }
QString const pretty = toqstr(translateIfPossible(fmt->prettyname()));
- outputFormatCO->addItem(pretty, QVariant(toqstr(format)));
- if (format == view_format_)
- index = outputFormatCO->count() -1;
+ outputFormatCO->addItem(pretty, QVariant(toqstr(fmt_name)));
+ if (fmt_name == view_format_)
+ index = outputFormatCO->count() - 1;
}
setViewFormat(index);
}
QWidget::resizeEvent(event);
}
-void ViewSourceWidget::saveSession(QString const & session_key) const
+
+void ViewSourceWidget::saveSession(QSettings & settings, QString const & session_key) const
{
- QSettings settings;
settings.setValue(session_key + "/output", toqstr(view_format_));
settings.setValue(session_key + "/contents", contentsCO->currentIndex());
settings.setValue(session_key + "/autoupdate", autoUpdateCB->isChecked());
}
-void GuiViewSource::saveSession() const
+void GuiViewSource::saveSession(QSettings & settings) const
{
- Dialog::saveSession();
- widget_->saveSession(sessionKey());
+ Dialog::saveSession(settings);
+ widget_->saveSession(settings, sessionKey());
}