mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
Fix indentation
This commit is contained in:
parent
92b7ee46ed
commit
84cca2dd94
@ -1407,12 +1407,12 @@ bool Buffer::save() const
|
|||||||
// to restore it, but that would basically mean trying to do again
|
// to restore it, but that would basically mean trying to do again
|
||||||
// what we just failed to do. better to leave things as they are.
|
// what we just failed to do. better to leave things as they are.
|
||||||
Alert::error(_("Write failure"),
|
Alert::error(_("Write failure"),
|
||||||
bformat(_("The file has successfully been saved as:\n %1$s.\n"
|
bformat(_("The file has successfully been saved as:\n %1$s.\n"
|
||||||
"But LyX could not move it to:\n %2$s.\n"
|
"But LyX could not move it to:\n %2$s.\n"
|
||||||
"Your original file has been backed up to:\n %3$s"),
|
"Your original file has been backed up to:\n %3$s"),
|
||||||
from_utf8(savefile.absFileName()),
|
from_utf8(savefile.absFileName()),
|
||||||
from_utf8(fileName().absFileName()),
|
from_utf8(fileName().absFileName()),
|
||||||
from_utf8(backupName.absFileName())));
|
from_utf8(backupName.absFileName())));
|
||||||
} else {
|
} else {
|
||||||
// either we did not try to make a backup, or else we tried and failed,
|
// either we did not try to make a backup, or else we tried and failed,
|
||||||
// or else the original file was a symlink, in which case it was copied,
|
// or else the original file was a symlink, in which case it was copied,
|
||||||
|
@ -2345,7 +2345,7 @@ OutputParams::FLAVOR BufferParams::getOutputFlavor(string const & format) const
|
|||||||
else if (dformat == "lyx")
|
else if (dformat == "lyx")
|
||||||
result = OutputParams::LYX;
|
result = OutputParams::LYX;
|
||||||
else if (dformat == "pdflatex")
|
else if (dformat == "pdflatex")
|
||||||
result = OutputParams::PDFLATEX;
|
result = OutputParams::PDFLATEX;
|
||||||
else if (dformat == "xetex")
|
else if (dformat == "xetex")
|
||||||
result = OutputParams::XETEX;
|
result = OutputParams::XETEX;
|
||||||
else if (dformat == "luatex")
|
else if (dformat == "luatex")
|
||||||
|
@ -2497,7 +2497,7 @@ bool BufferView::checkDepm(Cursor & cur, Cursor & old)
|
|||||||
d->cursor_ = cur;
|
d->cursor_ = cur;
|
||||||
|
|
||||||
// we would rather not do this here, but it needs to be done before
|
// we would rather not do this here, but it needs to be done before
|
||||||
// the changed() signal is sent.
|
// the changed() signal is sent.
|
||||||
buffer_.updateBuffer();
|
buffer_.updateBuffer();
|
||||||
|
|
||||||
buffer_.changed(true);
|
buffer_.changed(true);
|
||||||
@ -2786,7 +2786,7 @@ Point BufferView::coordOffset(DocIterator const & dit) const
|
|||||||
int lastw = 0;
|
int lastw = 0;
|
||||||
|
|
||||||
// Addup contribution of nested insets, from inside to outside,
|
// Addup contribution of nested insets, from inside to outside,
|
||||||
// keeping the outer paragraph for a special handling below
|
// keeping the outer paragraph for a special handling below
|
||||||
for (size_t i = dit.depth() - 1; i >= 1; --i) {
|
for (size_t i = dit.depth() - 1; i >= 1; --i) {
|
||||||
CursorSlice const & sl = dit[i];
|
CursorSlice const & sl = dit[i];
|
||||||
int xx = 0;
|
int xx = 0;
|
||||||
@ -3053,7 +3053,7 @@ void BufferView::draw(frontend::Painter & pain)
|
|||||||
LYXERR(Debug::PAINTING, "Strategy: NoScreenUpdate");
|
LYXERR(Debug::PAINTING, "Strategy: NoScreenUpdate");
|
||||||
pi.full_repaint = true;
|
pi.full_repaint = true;
|
||||||
pi.pain.setDrawingEnabled(false);
|
pi.pain.setDrawingEnabled(false);
|
||||||
tm.draw(pi, 0, y);
|
tm.draw(pi, 0, y);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SingleParUpdate:
|
case SingleParUpdate:
|
||||||
@ -3062,7 +3062,7 @@ void BufferView::draw(frontend::Painter & pain)
|
|||||||
// In general, only the current row of the outermost paragraph
|
// In general, only the current row of the outermost paragraph
|
||||||
// will be redrawn. Particular cases where selection spans
|
// will be redrawn. Particular cases where selection spans
|
||||||
// multiple paragraph are correctly detected in TextMetrics.
|
// multiple paragraph are correctly detected in TextMetrics.
|
||||||
tm.draw(pi, 0, y);
|
tm.draw(pi, 0, y);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DecorationUpdate:
|
case DecorationUpdate:
|
||||||
|
@ -66,7 +66,7 @@ static docstring const lyx_def = from_ascii(
|
|||||||
static docstring const lyx_hyperref_def = from_ascii(
|
static docstring const lyx_hyperref_def = from_ascii(
|
||||||
"\\providecommand{\\LyX}{\\texorpdfstring%\n"
|
"\\providecommand{\\LyX}{\\texorpdfstring%\n"
|
||||||
" {L\\kern-.1667em\\lower.25em\\hbox{Y}\\kern-.125emX\\@}\n"
|
" {L\\kern-.1667em\\lower.25em\\hbox{Y}\\kern-.125emX\\@}\n"
|
||||||
" {LyX}}");
|
" {LyX}}");
|
||||||
|
|
||||||
static docstring const noun_def = from_ascii(
|
static docstring const noun_def = from_ascii(
|
||||||
"\\newcommand{\\noun}[1]{\\textsc{#1}}");
|
"\\newcommand{\\noun}[1]{\\textsc{#1}}");
|
||||||
@ -256,7 +256,7 @@ static docstring const lyxref_def = from_ascii(
|
|||||||
" {\\def\\RSthmtxt{theorem~}\\newref{thm}{name = \\RSthmtxt}}\n"
|
" {\\def\\RSthmtxt{theorem~}\\newref{thm}{name = \\RSthmtxt}}\n"
|
||||||
" {}\n"
|
" {}\n"
|
||||||
"\\RS@ifundefined{lemref}\n"
|
"\\RS@ifundefined{lemref}\n"
|
||||||
" {\\def\\RSlemtxt{lemma~}\\newref{lem}{name = \\RSlemtxt}}\n"
|
" {\\def\\RSlemtxt{lemma~}\\newref{lem}{name = \\RSlemtxt}}\n"
|
||||||
" {}\n");
|
" {}\n");
|
||||||
|
|
||||||
// Make sure the columns are also outputed as rtl
|
// Make sure the columns are also outputed as rtl
|
||||||
@ -304,15 +304,15 @@ static docstring const rtloutputdblcol_def = from_ascii(
|
|||||||
|
|
||||||
static docstring const lyxnoun_style = from_ascii(
|
static docstring const lyxnoun_style = from_ascii(
|
||||||
"dfn.lyxnoun {\n"
|
"dfn.lyxnoun {\n"
|
||||||
" font-variant: small-caps;\n"
|
" font-variant: small-caps;\n"
|
||||||
"}\n");
|
"}\n");
|
||||||
|
|
||||||
|
|
||||||
// this is how it normally renders, but it might not always do so.
|
// this is how it normally renders, but it might not always do so.
|
||||||
static docstring const lyxstrikeout_style = from_ascii(
|
static docstring const lyxstrikeout_style = from_ascii(
|
||||||
"del.strikeout {\n"
|
"del.strikeout {\n"
|
||||||
" text-decoration: line-through;\n"
|
" text-decoration: line-through;\n"
|
||||||
"}\n");
|
"}\n");
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////
|
||||||
@ -354,7 +354,7 @@ LaTeXFeatures::LangPackage LaTeXFeatures::langPackage() const
|
|||||||
&& isAvailable("polyglossia")
|
&& isAvailable("polyglossia")
|
||||||
&& !isProvided("babel")
|
&& !isProvided("babel")
|
||||||
&& this->hasOnlyPolyglossiaLanguages();
|
&& this->hasOnlyPolyglossiaLanguages();
|
||||||
bool const babel_required =
|
bool const babel_required =
|
||||||
!bufferParams().language->babel().empty()
|
!bufferParams().language->babel().empty()
|
||||||
|| !this->getBabelLanguages().empty();
|
|| !this->getBabelLanguages().empty();
|
||||||
|
|
||||||
@ -893,14 +893,14 @@ string const LaTeXFeatures::getPackages() const
|
|||||||
bool const use_newtxmath =
|
bool const use_newtxmath =
|
||||||
theLaTeXFonts().getLaTeXFont(from_ascii(params_.fonts_math)).getUsedPackage(
|
theLaTeXFonts().getLaTeXFont(from_ascii(params_.fonts_math)).getUsedPackage(
|
||||||
ot1, false, false) == "newtxmath";
|
ot1, false, false) == "newtxmath";
|
||||||
|
|
||||||
if (!params_.useNonTeXFonts && !use_newtxmath && !amsPackages.empty())
|
if (!params_.useNonTeXFonts && !use_newtxmath && !amsPackages.empty())
|
||||||
packages << amsPackages;
|
packages << amsPackages;
|
||||||
|
|
||||||
if (mustProvide("cancel") &&
|
if (mustProvide("cancel") &&
|
||||||
params_.use_package("cancel") != BufferParams::package_off)
|
params_.use_package("cancel") != BufferParams::package_off)
|
||||||
packages << "\\usepackage{cancel}\n";
|
packages << "\\usepackage{cancel}\n";
|
||||||
|
|
||||||
// accents must be loaded after amsmath
|
// accents must be loaded after amsmath
|
||||||
if (mustProvide("accents") &&
|
if (mustProvide("accents") &&
|
||||||
params_.use_package("accents") != BufferParams::package_off)
|
params_.use_package("accents") != BufferParams::package_off)
|
||||||
|
10
src/LyX.cpp
10
src/LyX.cpp
@ -470,9 +470,9 @@ int LyX::execWithoutGui(int & argc, char * argv[])
|
|||||||
{
|
{
|
||||||
int exit_status = init(argc, argv);
|
int exit_status = init(argc, argv);
|
||||||
if (exit_status) {
|
if (exit_status) {
|
||||||
prepareExit();
|
prepareExit();
|
||||||
return exit_status;
|
return exit_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
// this is correct, since return values are inverted.
|
// this is correct, since return values are inverted.
|
||||||
exit_status = !loadFiles();
|
exit_status = !loadFiles();
|
||||||
@ -762,7 +762,7 @@ void cleanDuplicateEnvVars()
|
|||||||
|
|
||||||
// Loop over the list of duplicated variables
|
// Loop over the list of duplicated variables
|
||||||
std::set<std::string>::iterator dupe = dupes.begin();
|
std::set<std::string>::iterator dupe = dupes.begin();
|
||||||
std::set<std::string>::iterator const dend = dupes.end();
|
std::set<std::string>::iterator const dend = dupes.end();
|
||||||
for (; dupe != dend; ++dupe) {
|
for (; dupe != dend; ++dupe) {
|
||||||
const char *name = (*dupe).c_str();
|
const char *name = (*dupe).c_str();
|
||||||
char *val = getenv(name);
|
char *val = getenv(name);
|
||||||
@ -1299,7 +1299,7 @@ void LyX::easyParse(int & argc, char * argv[])
|
|||||||
cmdmap["-userdir"] = parse_userdir;
|
cmdmap["-userdir"] = parse_userdir;
|
||||||
cmdmap["-x"] = parse_execute;
|
cmdmap["-x"] = parse_execute;
|
||||||
cmdmap["--execute"] = parse_execute;
|
cmdmap["--execute"] = parse_execute;
|
||||||
cmdmap["-e"] = parse_export;
|
cmdmap["-e"] = parse_export;
|
||||||
cmdmap["--export"] = parse_export;
|
cmdmap["--export"] = parse_export;
|
||||||
cmdmap["-E"] = parse_export_to;
|
cmdmap["-E"] = parse_export_to;
|
||||||
cmdmap["--export-to"] = parse_export_to;
|
cmdmap["--export-to"] = parse_export_to;
|
||||||
|
@ -2773,7 +2773,7 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
|
|||||||
Alternatives::const_iterator const en = viewer_alternatives.end();
|
Alternatives::const_iterator const en = viewer_alternatives.end();
|
||||||
Alternatives::const_iterator const sysend =
|
Alternatives::const_iterator const sysend =
|
||||||
system_lyxrc.viewer_alternatives.end();
|
system_lyxrc.viewer_alternatives.end();
|
||||||
for (; it != en; ++it) {
|
for (; it != en; ++it) {
|
||||||
string const & fmt = it->first;
|
string const & fmt = it->first;
|
||||||
CommandSet const & cmd = it->second;
|
CommandSet const & cmd = it->second;
|
||||||
CommandSet::const_iterator sit = cmd.begin();
|
CommandSet::const_iterator sit = cmd.begin();
|
||||||
@ -2819,9 +2819,9 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case RC_DEFAULT_OTF_VIEW_FORMAT:
|
case RC_DEFAULT_OTF_VIEW_FORMAT:
|
||||||
if ((ignore_system_lyxrc ||
|
if ((ignore_system_lyxrc ||
|
||||||
default_otf_view_format != system_lyxrc.default_otf_view_format)
|
default_otf_view_format != system_lyxrc.default_otf_view_format)
|
||||||
&& !default_otf_view_format.empty()) {
|
&& !default_otf_view_format.empty()) {
|
||||||
os << "\\default_otf_view_format " << default_otf_view_format << '\n';
|
os << "\\default_otf_view_format " << default_otf_view_format << '\n';
|
||||||
}
|
}
|
||||||
if (tag != RC_LAST)
|
if (tag != RC_LAST)
|
||||||
|
@ -1114,7 +1114,7 @@ bool Text::cursorForwardOneWord(Cursor & cur)
|
|||||||
if (lyxrc.mac_like_cursor_movement) {
|
if (lyxrc.mac_like_cursor_movement) {
|
||||||
// Skip through trailing punctuation and spaces.
|
// Skip through trailing punctuation and spaces.
|
||||||
while (pos != lastpos && (par.isChar(pos) || par.isSpace(pos)))
|
while (pos != lastpos && (par.isChar(pos) || par.isSpace(pos)))
|
||||||
++pos;
|
++pos;
|
||||||
|
|
||||||
// Skip over either a non-char inset or a full word
|
// Skip over either a non-char inset or a full word
|
||||||
if (pos != lastpos && par.isWordSeparator(pos))
|
if (pos != lastpos && par.isWordSeparator(pos))
|
||||||
|
@ -426,7 +426,7 @@ bool CmdLineParser::parse(int argc, char * argv[])
|
|||||||
|
|
||||||
namespace cmdline {
|
namespace cmdline {
|
||||||
|
|
||||||
docstring mainTmp(from_ascii("/tmp"));
|
docstring mainTmp(from_ascii("/tmp"));
|
||||||
|
|
||||||
|
|
||||||
class StopException : public exception
|
class StopException : public exception
|
||||||
@ -456,8 +456,8 @@ void usage()
|
|||||||
"lyxclient will connect only to a lyx with the specified pid. Options -c and -g\n"
|
"lyxclient will connect only to a lyx with the specified pid. Options -c and -g\n"
|
||||||
"cannot be set simultaneoulsly. If no -c or -g options are given, lyxclient\n"
|
"cannot be set simultaneoulsly. If no -c or -g options are given, lyxclient\n"
|
||||||
"will read commands from standard input and disconnect when command read is BYE:\n"
|
"will read commands from standard input and disconnect when command read is BYE:\n"
|
||||||
"\n"
|
"\n"
|
||||||
"System directory is: " << to_utf8(cmdline::mainTmp)
|
"System directory is: " << to_utf8(cmdline::mainTmp)
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,13 +71,13 @@ FindAndReplaceWidget::FindAndReplaceWidget(GuiView & view)
|
|||||||
|
|
||||||
void FindAndReplaceWidget::dockLocationChanged(Qt::DockWidgetArea area)
|
void FindAndReplaceWidget::dockLocationChanged(Qt::DockWidgetArea area)
|
||||||
{
|
{
|
||||||
if (area == Qt::RightDockWidgetArea || area == Qt::LeftDockWidgetArea) {
|
if (area == Qt::RightDockWidgetArea || area == Qt::LeftDockWidgetArea) {
|
||||||
dynamicLayoutBasic_->setDirection(QBoxLayout::TopToBottom);
|
dynamicLayoutBasic_->setDirection(QBoxLayout::TopToBottom);
|
||||||
dynamicLayoutAdvanced_->setDirection(QBoxLayout::TopToBottom);
|
dynamicLayoutAdvanced_->setDirection(QBoxLayout::TopToBottom);
|
||||||
} else {
|
} else {
|
||||||
dynamicLayoutBasic_->setDirection(QBoxLayout::LeftToRight);
|
dynamicLayoutBasic_->setDirection(QBoxLayout::LeftToRight);
|
||||||
dynamicLayoutAdvanced_->setDirection(QBoxLayout::LeftToRight);
|
dynamicLayoutAdvanced_->setDirection(QBoxLayout::LeftToRight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -144,7 +144,7 @@ bool FindAndReplaceWidget::eventFilter(QObject * obj, QEvent * event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static vector<string> const & allManualsFiles()
|
static vector<string> const & allManualsFiles()
|
||||||
{
|
{
|
||||||
static const char * files[] = {
|
static const char * files[] = {
|
||||||
"Intro", "UserGuide", "Tutorial", "Additional",
|
"Intro", "UserGuide", "Tutorial", "Additional",
|
||||||
@ -169,7 +169,7 @@ static vector<string> const & allManualsFiles()
|
|||||||
**
|
**
|
||||||
** Return true if restarted from master-document buffer.
|
** Return true if restarted from master-document buffer.
|
||||||
**/
|
**/
|
||||||
static bool nextDocumentBuffer(Buffer * & buf)
|
static bool nextDocumentBuffer(Buffer * & buf)
|
||||||
{
|
{
|
||||||
ListOfBuffers const children = buf->allRelatives();
|
ListOfBuffers const children = buf->allRelatives();
|
||||||
LYXERR(Debug::FIND, "children.size()=" << children.size());
|
LYXERR(Debug::FIND, "children.size()=" << children.size());
|
||||||
@ -190,7 +190,7 @@ static bool nextDocumentBuffer(Buffer * & buf)
|
|||||||
**
|
**
|
||||||
** Return true if restarted from last child buffer.
|
** Return true if restarted from last child buffer.
|
||||||
**/
|
**/
|
||||||
static bool prevDocumentBuffer(Buffer * & buf)
|
static bool prevDocumentBuffer(Buffer * & buf)
|
||||||
{
|
{
|
||||||
ListOfBuffers const children = buf->allRelatives();
|
ListOfBuffers const children = buf->allRelatives();
|
||||||
LYXERR(Debug::FIND, "children.size()=" << children.size());
|
LYXERR(Debug::FIND, "children.size()=" << children.size());
|
||||||
@ -289,7 +289,7 @@ docstring getQuestionString(FindAndReplaceOptions const & opt)
|
|||||||
docstring message = opt.forward ?
|
docstring message = opt.forward ?
|
||||||
bformat(_("%1$s: the end was reached while searching forward.\n"
|
bformat(_("%1$s: the end was reached while searching forward.\n"
|
||||||
"Continue searching from the beginning?"),
|
"Continue searching from the beginning?"),
|
||||||
scope) :
|
scope) :
|
||||||
bformat(_("%1$s: the beginning was reached while searching backward.\n"
|
bformat(_("%1$s: the beginning was reached while searching backward.\n"
|
||||||
"Continue searching from the end?"),
|
"Continue searching from the end?"),
|
||||||
scope);
|
scope);
|
||||||
@ -498,7 +498,7 @@ void FindAndReplaceWidget::hideDialog()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void FindAndReplaceWidget::on_findNextPB_clicked()
|
void FindAndReplaceWidget::on_findNextPB_clicked()
|
||||||
{
|
{
|
||||||
findAndReplace(searchbackCB->isChecked(), false);
|
findAndReplace(searchbackCB->isChecked(), false);
|
||||||
find_work_area_->setFocus();
|
find_work_area_->setFocus();
|
||||||
@ -583,7 +583,7 @@ FindAndReplace::FindAndReplace(GuiView & parent,
|
|||||||
setFocusProxy(widget_);
|
setFocusProxy(widget_);
|
||||||
|
|
||||||
connect(this, SIGNAL(dockLocationChanged(Qt::DockWidgetArea)),
|
connect(this, SIGNAL(dockLocationChanged(Qt::DockWidgetArea)),
|
||||||
widget_, SLOT(dockLocationChanged(Qt::DockWidgetArea)));
|
widget_, SLOT(dockLocationChanged(Qt::DockWidgetArea)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1022,7 +1022,7 @@ GuiApplication::GuiApplication(int & argc, char ** argv)
|
|||||||
/// Only needed with Qt/Mac.
|
/// Only needed with Qt/Mac.
|
||||||
installTranslator(new MenuTranslator(this));
|
installTranslator(new MenuTranslator(this));
|
||||||
///
|
///
|
||||||
setupApplescript();
|
setupApplescript();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(Q_WS_X11) || defined(QPA_XCB)
|
#if defined(Q_WS_X11) || defined(QPA_XCB)
|
||||||
|
@ -1157,7 +1157,7 @@ GuiDocument::GuiDocument(GuiView & lv)
|
|||||||
headers << qt_("Package") << qt_("Load automatically")
|
headers << qt_("Package") << qt_("Load automatically")
|
||||||
<< qt_("Load always") << qt_("Do not load");
|
<< qt_("Load always") << qt_("Do not load");
|
||||||
mathsModule->packagesTW->setHorizontalHeaderLabels(headers);
|
mathsModule->packagesTW->setHorizontalHeaderLabels(headers);
|
||||||
setSectionResizeMode(mathsModule->packagesTW->horizontalHeader(), QHeaderView::Stretch);
|
setSectionResizeMode(mathsModule->packagesTW->horizontalHeader(), QHeaderView::Stretch);
|
||||||
map<string, string> const & packages = BufferParams::auto_packages();
|
map<string, string> const & packages = BufferParams::auto_packages();
|
||||||
mathsModule->packagesTW->setRowCount(packages.size());
|
mathsModule->packagesTW->setRowCount(packages.size());
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@ -1499,7 +1499,7 @@ void GuiDocument::setListingsMessage()
|
|||||||
// listingsTB->setTextColor("black");
|
// listingsTB->setTextColor("black");
|
||||||
listingsModule->listingsTB->setPlainText(
|
listingsModule->listingsTB->setPlainText(
|
||||||
qt_("Input listings parameters below. "
|
qt_("Input listings parameters below. "
|
||||||
"Enter ? for a list of parameters."));
|
"Enter ? for a list of parameters."));
|
||||||
} else {
|
} else {
|
||||||
isOK = false;
|
isOK = false;
|
||||||
// listingsTB->setTextColor("red");
|
// listingsTB->setTextColor("red");
|
||||||
@ -1801,7 +1801,7 @@ void GuiDocument::osFontsChanged(bool nontexfonts)
|
|||||||
if (!tex_fonts)
|
if (!tex_fonts)
|
||||||
fontModule->fontencLE->setEnabled(false);
|
fontModule->fontencLE->setEnabled(false);
|
||||||
else
|
else
|
||||||
fontencChanged(fontModule->fontencCO->currentIndex());
|
fontencChanged(fontModule->fontencCO->currentIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1967,14 +1967,14 @@ void GuiDocument::updateFontlist()
|
|||||||
fontModule->fontsRomanCO->addItem(rmi.key(), rmi.value());
|
fontModule->fontsRomanCO->addItem(rmi.key(), rmi.value());
|
||||||
++rmi;
|
++rmi;
|
||||||
}
|
}
|
||||||
|
|
||||||
fontModule->fontsSansCO->addItem(qt_("Default"), QString("default"));
|
fontModule->fontsSansCO->addItem(qt_("Default"), QString("default"));
|
||||||
QMap<QString, QString>::const_iterator sfi = sffonts_.constBegin();
|
QMap<QString, QString>::const_iterator sfi = sffonts_.constBegin();
|
||||||
while (sfi != sffonts_.constEnd()) {
|
while (sfi != sffonts_.constEnd()) {
|
||||||
fontModule->fontsSansCO->addItem(sfi.key(), sfi.value());
|
fontModule->fontsSansCO->addItem(sfi.key(), sfi.value());
|
||||||
++sfi;
|
++sfi;
|
||||||
}
|
}
|
||||||
|
|
||||||
fontModule->fontsTypewriterCO->addItem(qt_("Default"), QString("default"));
|
fontModule->fontsTypewriterCO->addItem(qt_("Default"), QString("default"));
|
||||||
QMap<QString, QString>::const_iterator tti = ttfonts_.constBegin();
|
QMap<QString, QString>::const_iterator tti = ttfonts_.constBegin();
|
||||||
while (tti != ttfonts_.constEnd()) {
|
while (tti != ttfonts_.constEnd()) {
|
||||||
@ -2799,7 +2799,7 @@ void GuiDocument::applyView()
|
|||||||
bp_.useNonTeXFonts = nontexfonts;
|
bp_.useNonTeXFonts = nontexfonts;
|
||||||
|
|
||||||
bp_.output_sync = outputModule->outputsyncCB->isChecked();
|
bp_.output_sync = outputModule->outputsyncCB->isChecked();
|
||||||
|
|
||||||
bp_.output_sync_macro = fromqstr(outputModule->synccustomCB->currentText());
|
bp_.output_sync_macro = fromqstr(outputModule->synccustomCB->currentText());
|
||||||
|
|
||||||
int mathfmt = outputModule->mathoutCB->currentIndex();
|
int mathfmt = outputModule->mathoutCB->currentIndex();
|
||||||
|
@ -689,7 +689,7 @@ void PrefCompletion::updateRC(LyXRC const & rc)
|
|||||||
popupTextCB->setChecked(rc.completion_popup_text);
|
popupTextCB->setChecked(rc.completion_popup_text);
|
||||||
cursorTextCB->setChecked(rc.completion_cursor_text);
|
cursorTextCB->setChecked(rc.completion_cursor_text);
|
||||||
popupAfterCompleteCB->setChecked(rc.completion_popup_after_complete);
|
popupAfterCompleteCB->setChecked(rc.completion_popup_after_complete);
|
||||||
enableCB();
|
enableCB();
|
||||||
minlengthSB->setValue(rc.completion_minlength);
|
minlengthSB->setValue(rc.completion_minlength);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3147,7 +3147,7 @@ void PrefShortcuts::on_searchLE_textEdited()
|
|||||||
// show matched items
|
// show matched items
|
||||||
for (int i = 0; i < matched.size(); ++i) {
|
for (int i = 0; i < matched.size(); ++i) {
|
||||||
shortcutsTW->setItemHidden(matched[i], false);
|
shortcutsTW->setItemHidden(matched[i], false);
|
||||||
shortcutsTW->setItemExpanded(matched[i]->parent(), true);
|
shortcutsTW->setItemExpanded(matched[i]->parent(), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,9 +61,9 @@ GuiRef::GuiRef(GuiView & lv)
|
|||||||
this, SLOT(changed_adaptor()));
|
this, SLOT(changed_adaptor()));
|
||||||
connect(referenceED, SIGNAL(textChanged(QString)),
|
connect(referenceED, SIGNAL(textChanged(QString)),
|
||||||
this, SLOT(changed_adaptor()));
|
this, SLOT(changed_adaptor()));
|
||||||
connect(findLE, SIGNAL(textEdited(QString)),
|
connect(findLE, SIGNAL(textEdited(QString)),
|
||||||
this, SLOT(filterLabels()));
|
this, SLOT(filterLabels()));
|
||||||
connect(csFindCB, SIGNAL(clicked()),
|
connect(csFindCB, SIGNAL(clicked()),
|
||||||
this, SLOT(filterLabels()));
|
this, SLOT(filterLabels()));
|
||||||
connect(nameED, SIGNAL(textChanged(QString)),
|
connect(nameED, SIGNAL(textChanged(QString)),
|
||||||
this, SLOT(changed_adaptor()));
|
this, SLOT(changed_adaptor()));
|
||||||
@ -386,7 +386,7 @@ void GuiRef::redoRefs()
|
|||||||
qSort(refsStrings.begin(), refsStrings.end(),
|
qSort(refsStrings.begin(), refsStrings.end(),
|
||||||
caseInsensitiveLessThan /*defined above*/);
|
caseInsensitiveLessThan /*defined above*/);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (groupCB->isChecked()) {
|
if (groupCB->isChecked()) {
|
||||||
QList<QTreeWidgetItem *> refsCats;
|
QList<QTreeWidgetItem *> refsCats;
|
||||||
for (int i = 0; i < refsCategories.size(); ++i) {
|
for (int i = 0; i < refsCategories.size(); ++i) {
|
||||||
@ -428,7 +428,7 @@ void GuiRef::redoRefs()
|
|||||||
QTreeWidgetItemIterator it(refsTW);
|
QTreeWidgetItemIterator it(refsTW);
|
||||||
while (*it) {
|
while (*it) {
|
||||||
if ((*it)->text(0) == textToFind) {
|
if ((*it)->text(0) == textToFind) {
|
||||||
refsTW->setCurrentItem(*it);
|
refsTW->setCurrentItem(*it);
|
||||||
refsTW->setItemSelected(*it, !newInset);
|
refsTW->setItemSelected(*it, !newInset);
|
||||||
//Make sure selected item is visible
|
//Make sure selected item is visible
|
||||||
refsTW->scrollToItem(*it);
|
refsTW->scrollToItem(*it);
|
||||||
|
@ -2159,7 +2159,7 @@ Menus::Menus() : d(new Impl) {}
|
|||||||
|
|
||||||
Menus::~Menus()
|
Menus::~Menus()
|
||||||
{
|
{
|
||||||
delete d;
|
delete d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ using namespace std;
|
|||||||
|
|
||||||
namespace lyx {
|
namespace lyx {
|
||||||
|
|
||||||
// FIXME Would it now be possible to use the InsetCode in
|
// FIXME Would it now be possible to use the InsetCode in
|
||||||
// place of the mailer name and recover that information?
|
// place of the mailer name and recover that information?
|
||||||
InsetCommand::InsetCommand(Buffer * buf, InsetCommandParams const & p)
|
InsetCommand::InsetCommand(Buffer * buf, InsetCommandParams const & p)
|
||||||
: Inset(buf), p_(p)
|
: Inset(buf), p_(p)
|
||||||
@ -190,7 +190,7 @@ bool InsetCommand::getStatus(Cursor & cur, FuncRequest const & cmd,
|
|||||||
case LFUN_ERT_INSERT:
|
case LFUN_ERT_INSERT:
|
||||||
status.setEnabled(false);
|
status.setEnabled(false);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// we handle these
|
// we handle these
|
||||||
case LFUN_INSET_MODIFY:
|
case LFUN_INSET_MODIFY:
|
||||||
if (cmd.getArg(0) == "changetype") {
|
if (cmd.getArg(0) == "changetype") {
|
||||||
@ -200,11 +200,11 @@ bool InsetCommand::getStatus(Cursor & cur, FuncRequest const & cmd,
|
|||||||
}
|
}
|
||||||
status.setEnabled(true);
|
status.setEnabled(true);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case LFUN_INSET_DIALOG_UPDATE:
|
case LFUN_INSET_DIALOG_UPDATE:
|
||||||
status.setEnabled(true);
|
status.setEnabled(true);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return Inset::getStatus(cur, cmd, status);
|
return Inset::getStatus(cur, cmd, status);
|
||||||
}
|
}
|
||||||
@ -334,7 +334,7 @@ bool decodeInsetParam(string const & name, string & data,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case MATH_SPACE_CODE: {
|
case MATH_SPACE_CODE: {
|
||||||
InsetSpaceParams p(true);
|
InsetSpaceParams p(true);
|
||||||
data = InsetSpace::params2string(p);
|
data = InsetSpace::params2string(p);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -127,7 +127,7 @@ bool isVerbatim(InsetCommandParams const & params)
|
|||||||
bool isInputOrInclude(InsetCommandParams const & params)
|
bool isInputOrInclude(InsetCommandParams const & params)
|
||||||
{
|
{
|
||||||
Types const t = type(params);
|
Types const t = type(params);
|
||||||
return t == INPUT || t == INCLUDE;
|
return t == INPUT || t == INCLUDE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -430,7 +430,7 @@ ParamInfo const & InsetPrintIndex::findInfo(string const & /* cmdName */)
|
|||||||
static ParamInfo param_info_;
|
static ParamInfo param_info_;
|
||||||
if (param_info_.empty()) {
|
if (param_info_.empty()) {
|
||||||
param_info_.add("type", ParamInfo::LATEX_OPTIONAL,
|
param_info_.add("type", ParamInfo::LATEX_OPTIONAL,
|
||||||
ParamInfo::HANDLING_ESCAPE);
|
ParamInfo::HANDLING_ESCAPE);
|
||||||
param_info_.add("name", ParamInfo::LATEX_REQUIRED);
|
param_info_.add("name", ParamInfo::LATEX_REQUIRED);
|
||||||
}
|
}
|
||||||
return param_info_;
|
return param_info_;
|
||||||
|
@ -155,7 +155,7 @@ void InsetListings::latex(otexstream & os, OutputParams const & runparams) const
|
|||||||
// language; if not, fall back to latin1.
|
// language; if not, fall back to latin1.
|
||||||
Encoding const * const lstenc =
|
Encoding const * const lstenc =
|
||||||
(outer_language->encoding()->hasFixedWidth()) ?
|
(outer_language->encoding()->hasFixedWidth()) ?
|
||||||
outer_language->encoding()
|
outer_language->encoding()
|
||||||
: encodings.fromLyXName("iso8859-1");
|
: encodings.fromLyXName("iso8859-1");
|
||||||
switchEncoding(os.os(), buffer().params(), runparams, *lstenc, true);
|
switchEncoding(os.os(), buffer().params(), runparams, *lstenc, true);
|
||||||
runparams.encoding = lstenc;
|
runparams.encoding = lstenc;
|
||||||
@ -182,15 +182,15 @@ void InsetListings::latex(otexstream & os, OutputParams const & runparams) const
|
|||||||
+ _("uncodable character") + " '";
|
+ _("uncodable character") + " '";
|
||||||
code += docstring(1, c);
|
code += docstring(1, c);
|
||||||
code += "'>";
|
code += "'>";
|
||||||
} else
|
} else
|
||||||
uncodable += c;
|
uncodable += c;
|
||||||
} catch (EncodingException & /* e */) {
|
} catch (EncodingException & /* e */) {
|
||||||
if (runparams.dryrun) {
|
if (runparams.dryrun) {
|
||||||
code += "<" + _("LyX Warning: ")
|
code += "<" + _("LyX Warning: ")
|
||||||
+ _("uncodable character") + " '";
|
+ _("uncodable character") + " '";
|
||||||
code += docstring(1, c);
|
code += docstring(1, c);
|
||||||
code += "'>";
|
code += "'>";
|
||||||
} else
|
} else
|
||||||
uncodable += c;
|
uncodable += c;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -230,7 +230,7 @@ void InsetListings::latex(otexstream & os, OutputParams const & runparams) const
|
|||||||
else if (pos >= delimiters.find('Q'))
|
else if (pos >= delimiters.find('Q'))
|
||||||
// We need to terminate the command before the delimiter
|
// We need to terminate the command before the delimiter
|
||||||
os << " ";
|
os << " ";
|
||||||
os << delim << code << delim;
|
os << delim << code << delim;
|
||||||
} else {
|
} else {
|
||||||
OutputParams rp = runparams;
|
OutputParams rp = runparams;
|
||||||
rp.moving_arg = true;
|
rp.moving_arg = true;
|
||||||
@ -272,13 +272,13 @@ docstring InsetListings::xhtml(XHTMLStream & os, OutputParams const & rp) const
|
|||||||
XHTMLStream out(ods);
|
XHTMLStream out(ods);
|
||||||
|
|
||||||
bool const isInline = params().isInline();
|
bool const isInline = params().isInline();
|
||||||
if (isInline)
|
if (isInline)
|
||||||
out << html::CompTag("br");
|
out << html::CompTag("br");
|
||||||
else {
|
else {
|
||||||
out << html::StartTag("div", "class='float float-listings'");
|
out << html::StartTag("div", "class='float float-listings'");
|
||||||
docstring caption = getCaptionHTML(rp);
|
docstring caption = getCaptionHTML(rp);
|
||||||
if (!caption.empty())
|
if (!caption.empty())
|
||||||
out << html::StartTag("div", "class='float-caption'")
|
out << html::StartTag("div", "class='float-caption'")
|
||||||
<< XHTMLStream::ESCAPE_NONE
|
<< XHTMLStream::ESCAPE_NONE
|
||||||
<< caption << html::EndTag("div");
|
<< caption << html::EndTag("div");
|
||||||
}
|
}
|
||||||
|
@ -150,7 +150,7 @@ void InsetPhantom::draw(PainterInfo & pi, int x, int y) const
|
|||||||
|
|
||||||
// draw the inset marker
|
// draw the inset marker
|
||||||
drawMarkers(pi, x, y);
|
drawMarkers(pi, x, y);
|
||||||
|
|
||||||
// draw the arrow(s)
|
// draw the arrow(s)
|
||||||
static int const arrow_size = 4;
|
static int const arrow_size = 4;
|
||||||
ColorCode const origcol = pi.base.font.color();
|
ColorCode const origcol = pi.base.font.color();
|
||||||
@ -312,7 +312,7 @@ docstring InsetPhantom::toolTip(BufferView const &, int, int) const
|
|||||||
void InsetPhantom::latex(otexstream & os, OutputParams const & runparams) const
|
void InsetPhantom::latex(otexstream & os, OutputParams const & runparams) const
|
||||||
{
|
{
|
||||||
if (runparams.moving_arg)
|
if (runparams.moving_arg)
|
||||||
os << "\\protect";
|
os << "\\protect";
|
||||||
|
|
||||||
switch (params_.type) {
|
switch (params_.type) {
|
||||||
case InsetPhantomParams::Phantom:
|
case InsetPhantomParams::Phantom:
|
||||||
|
@ -137,8 +137,8 @@ bool findOne(BufferView * bv, docstring const & searchstr,
|
|||||||
if (!searchAllowed(searchstr))
|
if (!searchAllowed(searchstr))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
DocIterator cur = forward
|
DocIterator cur = forward
|
||||||
? bv->cursor().selectionEnd()
|
? bv->cursor().selectionEnd()
|
||||||
: bv->cursor().selectionBegin();
|
: bv->cursor().selectionBegin();
|
||||||
|
|
||||||
MatchString const match(searchstr, case_sens, whole);
|
MatchString const match(searchstr, case_sens, whole);
|
||||||
@ -202,19 +202,19 @@ int replaceAll(BufferView * bv,
|
|||||||
|
|
||||||
|
|
||||||
// the idea here is that we are going to replace the string that
|
// the idea here is that we are going to replace the string that
|
||||||
// is selected IF it is the search string.
|
// is selected IF it is the search string.
|
||||||
// if there is a selection, but it is not the search string, then
|
// if there is a selection, but it is not the search string, then
|
||||||
// we basically ignore it. (FIXME We ought to replace only within
|
// we basically ignore it. (FIXME We ought to replace only within
|
||||||
// the selection.)
|
// the selection.)
|
||||||
// if there is no selection, then:
|
// if there is no selection, then:
|
||||||
// (i) if some search string has been provided, then we find it.
|
// (i) if some search string has been provided, then we find it.
|
||||||
// (think of how the dialog works when you hit "replace" the
|
// (think of how the dialog works when you hit "replace" the
|
||||||
// first time.)
|
// first time.)
|
||||||
// (ii) if no search string has been provided, then we treat the
|
// (ii) if no search string has been provided, then we treat the
|
||||||
// word the cursor is in as the search string. (why? i have no
|
// word the cursor is in as the search string. (why? i have no
|
||||||
// idea.) but this only works in text?
|
// idea.) but this only works in text?
|
||||||
//
|
//
|
||||||
// returns the number of replacements made (one, if any) and
|
// returns the number of replacements made (one, if any) and
|
||||||
// whether anything at all was done.
|
// whether anything at all was done.
|
||||||
pair<bool, int> replaceOne(BufferView * bv, docstring searchstr,
|
pair<bool, int> replaceOne(BufferView * bv, docstring searchstr,
|
||||||
docstring const & replacestr, bool case_sens,
|
docstring const & replacestr, bool case_sens,
|
||||||
@ -237,15 +237,15 @@ pair<bool, int> replaceOne(BufferView * bv, docstring searchstr,
|
|||||||
cur.innerText()->selectWord(cur, WHOLE_WORD);
|
cur.innerText()->selectWord(cur, WHOLE_WORD);
|
||||||
searchstr = cur.selectionAsString(false);
|
searchstr = cur.selectionAsString(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if we still don't have a search string, report the error
|
// if we still don't have a search string, report the error
|
||||||
// and abort.
|
// and abort.
|
||||||
if (!searchAllowed(searchstr))
|
if (!searchAllowed(searchstr))
|
||||||
return make_pair(false, 0);
|
return make_pair(false, 0);
|
||||||
|
|
||||||
bool have_selection = cur.selection();
|
bool have_selection = cur.selection();
|
||||||
docstring const selected = cur.selectionAsString(false);
|
docstring const selected = cur.selectionAsString(false);
|
||||||
bool match =
|
bool match =
|
||||||
case_sens
|
case_sens
|
||||||
? searchstr == selected
|
? searchstr == selected
|
||||||
: compare_no_case(searchstr, selected) == 0;
|
: compare_no_case(searchstr, selected) == 0;
|
||||||
@ -327,7 +327,7 @@ bool lyxfind(BufferView * bv, FuncRequest const & ev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool lyxreplace(BufferView * bv,
|
bool lyxreplace(BufferView * bv,
|
||||||
FuncRequest const & ev, bool has_deleted)
|
FuncRequest const & ev, bool has_deleted)
|
||||||
{
|
{
|
||||||
if (!bv || ev.action() != LFUN_WORD_REPLACE)
|
if (!bv || ev.action() != LFUN_WORD_REPLACE)
|
||||||
@ -372,7 +372,7 @@ bool lyxreplace(BufferView * bv,
|
|||||||
} else if (replace_count == 1) {
|
} else if (replace_count == 1) {
|
||||||
buf.message(_("String has been replaced."));
|
buf.message(_("String has been replaced."));
|
||||||
} else {
|
} else {
|
||||||
docstring const str =
|
docstring const str =
|
||||||
bformat(_("%1$d strings have been replaced."), replace_count);
|
bformat(_("%1$d strings have been replaced."), replace_count);
|
||||||
buf.message(str);
|
buf.message(str);
|
||||||
}
|
}
|
||||||
@ -652,8 +652,8 @@ bool braces_match(string::const_iterator const & beg,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (open_pars != unmatched) {
|
if (open_pars != unmatched) {
|
||||||
LYXERR(Debug::FIND, "Found " << open_pars
|
LYXERR(Debug::FIND, "Found " << open_pars
|
||||||
<< " instead of " << unmatched
|
<< " instead of " << unmatched
|
||||||
<< " unmatched open braces at the end of count");
|
<< " unmatched open braces at the end of count");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -726,7 +726,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static docstring buffer_to_latex(Buffer & buffer)
|
static docstring buffer_to_latex(Buffer & buffer)
|
||||||
{
|
{
|
||||||
OutputParams runparams(&buffer.params().encoding());
|
OutputParams runparams(&buffer.params().encoding());
|
||||||
TexRow texrow;
|
TexRow texrow;
|
||||||
@ -824,15 +824,14 @@ MatchStringAdv::MatchStringAdv(lyx::Buffer & buf, FindAndReplaceOptions const &
|
|||||||
|
|
||||||
size_t lead_size = 0;
|
size_t lead_size = 0;
|
||||||
if (opt.ignoreformat) {
|
if (opt.ignoreformat) {
|
||||||
if (!use_regexp) {
|
if (!use_regexp) {
|
||||||
// if par_as_string_nolead were emty,
|
// if par_as_string_nolead were emty,
|
||||||
// the following call to findAux will always *find* the string
|
// the following call to findAux will always *find* the string
|
||||||
// in the checked data, and thus always using the slow
|
// in the checked data, and thus always using the slow
|
||||||
// examining of the current text part.
|
// examining of the current text part.
|
||||||
par_as_string_nolead = par_as_string;
|
par_as_string_nolead = par_as_string;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
lead_size = identifyLeading(par_as_string);
|
lead_size = identifyLeading(par_as_string);
|
||||||
lead_as_string = par_as_string.substr(0, lead_size);
|
lead_as_string = par_as_string.substr(0, lead_size);
|
||||||
par_as_string_nolead = par_as_string.substr(lead_size, par_as_string.size() - lead_size);
|
par_as_string_nolead = par_as_string.substr(lead_size, par_as_string.size() - lead_size);
|
||||||
@ -908,7 +907,7 @@ int MatchStringAdv::findAux(DocIterator const & cur, int len, bool at_begin) con
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LYXERR(Debug::FIND, "Searching in regexp mode: at_begin=" << at_begin);
|
LYXERR(Debug::FIND, "Searching in regexp mode: at_begin=" << at_begin);
|
||||||
// Try all possible regexp matches,
|
// Try all possible regexp matches,
|
||||||
//until one that verifies the braces match test is found
|
//until one that verifies the braces match test is found
|
||||||
regex const *p_regexp = at_begin ? ®exp : ®exp2;
|
regex const *p_regexp = at_begin ? ®exp : ®exp2;
|
||||||
sregex_iterator re_it(str.begin(), str.end(), *p_regexp);
|
sregex_iterator re_it(str.begin(), str.end(), *p_regexp);
|
||||||
@ -924,7 +923,7 @@ int MatchStringAdv::findAux(DocIterator const & cur, int len, bool at_begin) con
|
|||||||
for (size_t i = 1; i < m.size() - 1; ++i)
|
for (size_t i = 1; i < m.size() - 1; ++i)
|
||||||
if (!braces_match(m[i].first, m[i].second))
|
if (!braces_match(m[i].first, m[i].second))
|
||||||
return false;
|
return false;
|
||||||
// Exclude from the returned match length any length
|
// Exclude from the returned match length any length
|
||||||
// due to close wildcards added at end of regexp
|
// due to close wildcards added at end of regexp
|
||||||
if (close_wildcards == 0)
|
if (close_wildcards == 0)
|
||||||
return m[0].second - m[0].first;
|
return m[0].second - m[0].first;
|
||||||
@ -1241,7 +1240,7 @@ int findBackwardsAdv(DocIterator & cur, MatchStringAdv & match)
|
|||||||
DocIterator cur_prev_iter;
|
DocIterator cur_prev_iter;
|
||||||
do {
|
do {
|
||||||
found_match = match(cur);
|
found_match = match(cur);
|
||||||
LYXERR(Debug::FIND, "findBackAdv3: found_match="
|
LYXERR(Debug::FIND, "findBackAdv3: found_match="
|
||||||
<< found_match << ", cur: " << cur);
|
<< found_match << ", cur: " << cur);
|
||||||
if (found_match)
|
if (found_match)
|
||||||
return findMostBackwards(cur, match);
|
return findMostBackwards(cur, match);
|
||||||
@ -1324,7 +1323,7 @@ static bool firstUppercase(Cursor const & cur)
|
|||||||
ch2 = cur.paragraph().getChar(pos + 1);
|
ch2 = cur.paragraph().getChar(pos + 1);
|
||||||
bool result = isUpperCase(ch1) && isLowerCase(ch2);
|
bool result = isUpperCase(ch1) && isLowerCase(ch2);
|
||||||
LYXERR(Debug::FIND, "firstUppercase(): "
|
LYXERR(Debug::FIND, "firstUppercase(): "
|
||||||
<< "ch1=" << ch1 << "(" << char(ch1) << "), ch2="
|
<< "ch1=" << ch1 << "(" << char(ch1) << "), ch2="
|
||||||
<< ch2 << "(" << char(ch2) << ")"
|
<< ch2 << "(" << char(ch2) << ")"
|
||||||
<< ", result=" << result << ", cur=" << cur);
|
<< ", result=" << result << ", cur=" << cur);
|
||||||
return result;
|
return result;
|
||||||
|
@ -121,7 +121,7 @@ HullType hullType(docstring const & s)
|
|||||||
if (s == "gather") return hullGather;
|
if (s == "gather") return hullGather;
|
||||||
if (s == "flalign") return hullFlAlign;
|
if (s == "flalign") return hullFlAlign;
|
||||||
if (s == "regexp") return hullRegexp;
|
if (s == "regexp") return hullRegexp;
|
||||||
lyxerr << "unknown hull type '" << to_utf8(s) << "'" << endl;
|
lyxerr << "unknown hull type '" << to_utf8(s) << "'" << endl;
|
||||||
return HullType(-1);
|
return HullType(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,7 +141,7 @@ docstring hullName(HullType type)
|
|||||||
case hullGather: return from_ascii("gather");
|
case hullGather: return from_ascii("gather");
|
||||||
case hullFlAlign: return from_ascii("flalign");
|
case hullFlAlign: return from_ascii("flalign");
|
||||||
case hullRegexp: return from_ascii("regexp");
|
case hullRegexp: return from_ascii("regexp");
|
||||||
default:
|
default:
|
||||||
lyxerr << "unknown hull type '" << type << "'" << endl;
|
lyxerr << "unknown hull type '" << type << "'" << endl;
|
||||||
return from_ascii("none");
|
return from_ascii("none");
|
||||||
}
|
}
|
||||||
@ -151,8 +151,8 @@ static InsetLabel * dummy_pointer = 0;
|
|||||||
|
|
||||||
InsetMathHull::InsetMathHull(Buffer * buf)
|
InsetMathHull::InsetMathHull(Buffer * buf)
|
||||||
: InsetMathGrid(buf, 1, 1), type_(hullNone), numbered_(1, NUMBER),
|
: InsetMathGrid(buf, 1, 1), type_(hullNone), numbered_(1, NUMBER),
|
||||||
numbers_(1, empty_docstring()), label_(1, dummy_pointer),
|
numbers_(1, empty_docstring()), label_(1, dummy_pointer),
|
||||||
preview_(new RenderPreview(this)), use_preview_(false)
|
preview_(new RenderPreview(this)), use_preview_(false)
|
||||||
{
|
{
|
||||||
//lyxerr << "sizeof InsetMath: " << sizeof(InsetMath) << endl;
|
//lyxerr << "sizeof InsetMath: " << sizeof(InsetMath) << endl;
|
||||||
//lyxerr << "sizeof MetricsInfo: " << sizeof(MetricsInfo) << endl;
|
//lyxerr << "sizeof MetricsInfo: " << sizeof(MetricsInfo) << endl;
|
||||||
@ -166,8 +166,8 @@ InsetMathHull::InsetMathHull(Buffer * buf)
|
|||||||
|
|
||||||
InsetMathHull::InsetMathHull(Buffer * buf, HullType type)
|
InsetMathHull::InsetMathHull(Buffer * buf, HullType type)
|
||||||
: InsetMathGrid(buf, getCols(type), 1), type_(type), numbered_(1, NUMBER),
|
: InsetMathGrid(buf, getCols(type), 1), type_(type), numbered_(1, NUMBER),
|
||||||
numbers_(1, empty_docstring()), label_(1, dummy_pointer),
|
numbers_(1, empty_docstring()), label_(1, dummy_pointer),
|
||||||
preview_(new RenderPreview(this)), use_preview_(false)
|
preview_(new RenderPreview(this)), use_preview_(false)
|
||||||
{
|
{
|
||||||
buffer_ = buf;
|
buffer_ = buf;
|
||||||
initMath();
|
initMath();
|
||||||
@ -507,10 +507,10 @@ void InsetMathHull::drawBackground(PainterInfo & pi, int x, int y) const
|
|||||||
{
|
{
|
||||||
Dimension const dim = dimension(*pi.base.bv);
|
Dimension const dim = dimension(*pi.base.bv);
|
||||||
if (previewTooSmall(dim)) {
|
if (previewTooSmall(dim)) {
|
||||||
pi.pain.fillRectangle(x, y - 2 * ERROR_FRAME_WIDTH,
|
pi.pain.fillRectangle(x, y - 2 * ERROR_FRAME_WIDTH,
|
||||||
dim.wid, dim.asc + dim.des, backgroundColor(pi));
|
dim.wid, dim.asc + dim.des, backgroundColor(pi));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pi.pain.fillRectangle(x + 1, y - dim.asc + 1, dim.wid - 2,
|
pi.pain.fillRectangle(x + 1, y - dim.asc + 1, dim.wid - 2,
|
||||||
dim.asc + dim.des - 1, pi.backgroundColor(this));
|
dim.asc + dim.des - 1, pi.backgroundColor(this));
|
||||||
}
|
}
|
||||||
@ -1980,7 +1980,7 @@ int InsetMathHull::plaintext(odocstringstream & os,
|
|||||||
// and do not include the newline.
|
// and do not include the newline.
|
||||||
if (op.for_toc || op.for_tooltip || oss.str().size() >= max_length)
|
if (op.for_toc || op.for_tooltip || oss.str().size() >= max_length)
|
||||||
break;
|
break;
|
||||||
if (r < nrows() - 1)
|
if (r < nrows() - 1)
|
||||||
wi << "\n";
|
wi << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -678,7 +678,7 @@ bool MathMacro::validName() const
|
|||||||
|
|
||||||
|
|
||||||
size_t MathMacro::arity() const
|
size_t MathMacro::arity() const
|
||||||
{
|
{
|
||||||
if (d->displayMode_ == DISPLAY_NORMAL )
|
if (d->displayMode_ == DISPLAY_NORMAL )
|
||||||
return cells_.size();
|
return cells_.size();
|
||||||
else
|
else
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* Licence details can be found in the file COPYING.
|
* Licence details can be found in the file COPYING.
|
||||||
*
|
*
|
||||||
* \author Richard Heck
|
* \author Richard Heck
|
||||||
*
|
*
|
||||||
* This code is based upon output_docbook.cpp
|
* This code is based upon output_docbook.cpp
|
||||||
*
|
*
|
||||||
* Full author contact details are available in file CREDITS.
|
* Full author contact details are available in file CREDITS.
|
||||||
@ -131,7 +131,7 @@ string cleanAttr(string const & str)
|
|||||||
string::const_iterator en = str.end();
|
string::const_iterator en = str.end();
|
||||||
for (; it != en; ++it)
|
for (; it != en; ++it)
|
||||||
newname += isAlnumASCII(*it) ? *it : '_';
|
newname += isAlnumASCII(*it) ? *it : '_';
|
||||||
return newname;
|
return newname;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -144,7 +144,7 @@ docstring cleanAttr(docstring const & str)
|
|||||||
char_type const c = *it;
|
char_type const c = *it;
|
||||||
newname += isAlnumASCII(c) ? c : char_type('_');
|
newname += isAlnumASCII(c) ? c : char_type('_');
|
||||||
}
|
}
|
||||||
return newname;
|
return newname;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -392,7 +392,7 @@ bool XHTMLStream::closeFontTags()
|
|||||||
LBUFERR(!tag_stack_.empty());
|
LBUFERR(!tag_stack_.empty());
|
||||||
curtag = tag_stack_.back();
|
curtag = tag_stack_.back();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*curtag == parsep_tag)
|
if (*curtag == parsep_tag)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
@ -440,7 +440,7 @@ void XHTMLStream::endParagraph()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// this case is also normal, if the parsep tag is the last one
|
// this case is also normal, if the parsep tag is the last one
|
||||||
// on the stack. otherwise, it's an error.
|
// on the stack. otherwise, it's an error.
|
||||||
while (!tag_stack_.empty()) {
|
while (!tag_stack_.empty()) {
|
||||||
TagPtr const cur_tag = tag_stack_.back();
|
TagPtr const cur_tag = tag_stack_.back();
|
||||||
@ -513,13 +513,13 @@ XHTMLStream & XHTMLStream::operator<<(int i)
|
|||||||
|
|
||||||
|
|
||||||
XHTMLStream & XHTMLStream::operator<<(EscapeSettings e)
|
XHTMLStream & XHTMLStream::operator<<(EscapeSettings e)
|
||||||
{
|
{
|
||||||
escape_ = e;
|
escape_ = e;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
XHTMLStream & XHTMLStream::operator<<(html::StartTag const & tag)
|
XHTMLStream & XHTMLStream::operator<<(html::StartTag const & tag)
|
||||||
{
|
{
|
||||||
if (tag.tag_.empty())
|
if (tag.tag_.empty())
|
||||||
return *this;
|
return *this;
|
||||||
@ -539,7 +539,7 @@ XHTMLStream & XHTMLStream::operator<<(html::ParTag const & tag)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
XHTMLStream & XHTMLStream::operator<<(html::CompTag const & tag)
|
XHTMLStream & XHTMLStream::operator<<(html::CompTag const & tag)
|
||||||
{
|
{
|
||||||
if (tag.tag_.empty())
|
if (tag.tag_.empty())
|
||||||
return *this;
|
return *this;
|
||||||
@ -601,7 +601,7 @@ bool XHTMLStream::isTagPending(html::StartTag const & stag) const
|
|||||||
|
|
||||||
|
|
||||||
// this is complicated, because we want to make sure that
|
// this is complicated, because we want to make sure that
|
||||||
// everything is properly nested. the code ought to make
|
// everything is properly nested. the code ought to make
|
||||||
// sure of that, but we won't assert (yet) if we run into
|
// sure of that, but we won't assert (yet) if we run into
|
||||||
// a problem. we'll just output error messages and try our
|
// a problem. we'll just output error messages and try our
|
||||||
// best to make things work.
|
// best to make things work.
|
||||||
@ -614,14 +614,14 @@ XHTMLStream & XHTMLStream::operator<<(html::EndTag const & etag)
|
|||||||
if (!pending_tags_.empty()) {
|
if (!pending_tags_.empty()) {
|
||||||
|
|
||||||
if (etag == *pending_tags_.back()) {
|
if (etag == *pending_tags_.back()) {
|
||||||
// we have <tag></tag>, so we discard it and remove it
|
// we have <tag></tag>, so we discard it and remove it
|
||||||
// from the pending_tags_.
|
// from the pending_tags_.
|
||||||
pending_tags_.pop_back();
|
pending_tags_.pop_back();
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// there is a pending tag that isn't the one we are trying
|
// there is a pending tag that isn't the one we are trying
|
||||||
// to close.
|
// to close.
|
||||||
|
|
||||||
// is this tag itself pending?
|
// is this tag itself pending?
|
||||||
// non-const iterators because we may call erase().
|
// non-const iterators because we may call erase().
|
||||||
@ -630,9 +630,9 @@ XHTMLStream & XHTMLStream::operator<<(html::EndTag const & etag)
|
|||||||
for (; dit != den; ++dit) {
|
for (; dit != den; ++dit) {
|
||||||
if (etag == **dit) {
|
if (etag == **dit) {
|
||||||
// it was pending, so we just erase it
|
// it was pending, so we just erase it
|
||||||
writeError("Tried to close pending tag `" + etag.tag_
|
writeError("Tried to close pending tag `" + etag.tag_
|
||||||
+ "' when other tags were pending. Last pending tag is `"
|
+ "' when other tags were pending. Last pending tag is `"
|
||||||
+ to_utf8(pending_tags_.back()->writeTag())
|
+ to_utf8(pending_tags_.back()->writeTag())
|
||||||
+ "'. Tag discarded.");
|
+ "'. Tag discarded.");
|
||||||
pending_tags_.erase(dit);
|
pending_tags_.erase(dit);
|
||||||
return *this;
|
return *this;
|
||||||
@ -640,14 +640,14 @@ XHTMLStream & XHTMLStream::operator<<(html::EndTag const & etag)
|
|||||||
}
|
}
|
||||||
// so etag isn't itself pending. is it even open?
|
// so etag isn't itself pending. is it even open?
|
||||||
if (!isTagOpen(etag)) {
|
if (!isTagOpen(etag)) {
|
||||||
writeError("Tried to close `" + etag.tag_
|
writeError("Tried to close `" + etag.tag_
|
||||||
+ "' when tag was not open. Tag discarded.");
|
+ "' when tag was not open. Tag discarded.");
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
// ok, so etag is open.
|
// ok, so etag is open.
|
||||||
// our strategy will be as below: we will do what we need to
|
// our strategy will be as below: we will do what we need to
|
||||||
// do to close this tag.
|
// do to close this tag.
|
||||||
string estr = "Closing tag `" + etag.tag_
|
string estr = "Closing tag `" + etag.tag_
|
||||||
+ "' when other tags are pending. Discarded pending tags:\n";
|
+ "' when other tags are pending. Discarded pending tags:\n";
|
||||||
for (dit = pending_tags_.begin(); dit != den; ++dit)
|
for (dit = pending_tags_.begin(); dit != den; ++dit)
|
||||||
estr += to_utf8(html::htmlize((*dit)->writeTag(), XHTMLStream::ESCAPE_ALL)) + "\n";
|
estr += to_utf8(html::htmlize((*dit)->writeTag(), XHTMLStream::ESCAPE_ALL)) + "\n";
|
||||||
@ -661,7 +661,7 @@ XHTMLStream & XHTMLStream::operator<<(html::EndTag const & etag)
|
|||||||
if (tag_stack_.empty()) {
|
if (tag_stack_.empty()) {
|
||||||
writeError("Tried to close `" + etag.tag_
|
writeError("Tried to close `" + etag.tag_
|
||||||
+ "' when no tags were open!");
|
+ "' when no tags were open!");
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// is the tag we are closing the last one we opened?
|
// is the tag we are closing the last one we opened?
|
||||||
@ -671,16 +671,16 @@ XHTMLStream & XHTMLStream::operator<<(html::EndTag const & etag)
|
|||||||
// ...and forget about it
|
// ...and forget about it
|
||||||
tag_stack_.pop_back();
|
tag_stack_.pop_back();
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// we are trying to close a tag other than the one last opened.
|
// we are trying to close a tag other than the one last opened.
|
||||||
// let's first see if this particular tag is still open somehow.
|
// let's first see if this particular tag is still open somehow.
|
||||||
if (!isTagOpen(etag)) {
|
if (!isTagOpen(etag)) {
|
||||||
writeError("Tried to close `" + etag.tag_
|
writeError("Tried to close `" + etag.tag_
|
||||||
+ "' when tag was not open. Tag discarded.");
|
+ "' when tag was not open. Tag discarded.");
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// so the tag was opened, but other tags have been opened since
|
// so the tag was opened, but other tags have been opened since
|
||||||
// and not yet closed.
|
// and not yet closed.
|
||||||
// if it's a font tag, though...
|
// if it's a font tag, though...
|
||||||
@ -694,12 +694,12 @@ XHTMLStream & XHTMLStream::operator<<(html::EndTag const & etag)
|
|||||||
break;
|
break;
|
||||||
if (!(*rit)->asFontTag()) {
|
if (!(*rit)->asFontTag()) {
|
||||||
// we'll just leave it and, presumably, have to close it later.
|
// we'll just leave it and, presumably, have to close it later.
|
||||||
writeError("Unable to close font tag `" + etag.tag_
|
writeError("Unable to close font tag `" + etag.tag_
|
||||||
+ "' due to open non-font tag `" + (*rit)->tag_ + "'.");
|
+ "' due to open non-font tag `" + (*rit)->tag_ + "'.");
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// so we have e.g.:
|
// so we have e.g.:
|
||||||
// <em>this is <strong>bold
|
// <em>this is <strong>bold
|
||||||
// and are being asked to closed em. we want:
|
// and are being asked to closed em. we want:
|
||||||
@ -714,7 +714,7 @@ XHTMLStream & XHTMLStream::operator<<(html::EndTag const & etag)
|
|||||||
tag_stack_.pop_back();
|
tag_stack_.pop_back();
|
||||||
curtag = tag_stack_.back();
|
curtag = tag_stack_.back();
|
||||||
}
|
}
|
||||||
os_ << etag.writeEndTag();
|
os_ << etag.writeEndTag();
|
||||||
tag_stack_.pop_back();
|
tag_stack_.pop_back();
|
||||||
|
|
||||||
// ...and restore the other tags.
|
// ...and restore the other tags.
|
||||||
@ -724,12 +724,12 @@ XHTMLStream & XHTMLStream::operator<<(html::EndTag const & etag)
|
|||||||
pending_tags_.push_back(*rit);
|
pending_tags_.push_back(*rit);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// it wasn't a font tag.
|
// it wasn't a font tag.
|
||||||
// so other tags were opened before this one and not properly closed.
|
// so other tags were opened before this one and not properly closed.
|
||||||
// so we'll close them, too. that may cause other issues later, but it
|
// so we'll close them, too. that may cause other issues later, but it
|
||||||
// at least guarantees proper nesting.
|
// at least guarantees proper nesting.
|
||||||
writeError("Closing tag `" + etag.tag_
|
writeError("Closing tag `" + etag.tag_
|
||||||
+ "' when other tags are open, namely:");
|
+ "' when other tags are open, namely:");
|
||||||
TagPtr curtag = tag_stack_.back();
|
TagPtr curtag = tag_stack_.back();
|
||||||
while (etag != *curtag) {
|
while (etag != *curtag) {
|
||||||
@ -798,7 +798,7 @@ inline void openItemTag(XHTMLStream & xs, Layout const & lay)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void openItemTag(XHTMLStream & xs, Layout const & lay,
|
void openItemTag(XHTMLStream & xs, Layout const & lay,
|
||||||
ParagraphParameters const & params)
|
ParagraphParameters const & params)
|
||||||
{
|
{
|
||||||
// FIXME Are there other things we should handle here?
|
// FIXME Are there other things we should handle here?
|
||||||
@ -855,7 +855,7 @@ ParagraphList::const_iterator findEndOfEnvironment(
|
|||||||
|
|
||||||
// FIXME I am not sure about the first check.
|
// FIXME I am not sure about the first check.
|
||||||
// Surely we *could* have different layouts that count as
|
// Surely we *could* have different layouts that count as
|
||||||
// LATEX_PARAGRAPH, right?
|
// LATEX_PARAGRAPH, right?
|
||||||
if (style.latextype == LATEX_PARAGRAPH || style != bstyle)
|
if (style.latextype == LATEX_PARAGRAPH || style != bstyle)
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
@ -894,17 +894,17 @@ ParagraphList::const_iterator makeParagraphs(Buffer const & buf,
|
|||||||
openParTag(xs, lay, par->params(),
|
openParTag(xs, lay, par->params(),
|
||||||
make_parid ? par->magicLabel() : "");
|
make_parid ? par->magicLabel() : "");
|
||||||
|
|
||||||
docstring const deferred =
|
docstring const deferred =
|
||||||
par->simpleLyXHTMLOnePar(buf, xs, runparams, text.outerFont(distance(begin, par)));
|
par->simpleLyXHTMLOnePar(buf, xs, runparams, text.outerFont(distance(begin, par)));
|
||||||
|
|
||||||
// We want to issue the closing tag if either:
|
// We want to issue the closing tag if either:
|
||||||
// (i) We opened it, and either html_in_par is false,
|
// (i) We opened it, and either html_in_par is false,
|
||||||
// or we're not in the last paragraph, anyway.
|
// or we're not in the last paragraph, anyway.
|
||||||
// (ii) We didn't open it and html_in_par is true,
|
// (ii) We didn't open it and html_in_par is true,
|
||||||
// but we are in the first par, and there is a next par.
|
// but we are in the first par, and there is a next par.
|
||||||
ParagraphList::const_iterator nextpar = par;
|
ParagraphList::const_iterator nextpar = par;
|
||||||
++nextpar;
|
++nextpar;
|
||||||
bool const needclose =
|
bool const needclose =
|
||||||
(opened && (!runparams.html_in_par || nextpar != pend))
|
(opened && (!runparams.html_in_par || nextpar != pend))
|
||||||
|| (!opened && runparams.html_in_par && par == pbegin && nextpar != pend);
|
|| (!opened && runparams.html_in_par && par == pbegin && nextpar != pend);
|
||||||
if (needclose) {
|
if (needclose) {
|
||||||
@ -924,7 +924,7 @@ ParagraphList::const_iterator makeBibliography(Buffer const & buf,
|
|||||||
OutputParams const & runparams,
|
OutputParams const & runparams,
|
||||||
Text const & text,
|
Text const & text,
|
||||||
ParagraphList::const_iterator const & pbegin,
|
ParagraphList::const_iterator const & pbegin,
|
||||||
ParagraphList::const_iterator const & pend)
|
ParagraphList::const_iterator const & pend)
|
||||||
{
|
{
|
||||||
// FIXME XHTML
|
// FIXME XHTML
|
||||||
// Use TextClass::htmlTOCLayout() to figure out how we should look.
|
// Use TextClass::htmlTOCLayout() to figure out how we should look.
|
||||||
@ -946,13 +946,13 @@ bool isNormalEnv(Layout const & lay)
|
|||||||
|| lay.latextype == LATEX_BIB_ENVIRONMENT;
|
|| lay.latextype == LATEX_BIB_ENVIRONMENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ParagraphList::const_iterator makeEnvironment(Buffer const & buf,
|
ParagraphList::const_iterator makeEnvironment(Buffer const & buf,
|
||||||
XHTMLStream & xs,
|
XHTMLStream & xs,
|
||||||
OutputParams const & runparams,
|
OutputParams const & runparams,
|
||||||
Text const & text,
|
Text const & text,
|
||||||
ParagraphList::const_iterator const & pbegin,
|
ParagraphList::const_iterator const & pbegin,
|
||||||
ParagraphList::const_iterator const & pend)
|
ParagraphList::const_iterator const & pend)
|
||||||
{
|
{
|
||||||
ParagraphList::const_iterator const begin = text.paragraphs().begin();
|
ParagraphList::const_iterator const begin = text.paragraphs().begin();
|
||||||
ParagraphList::const_iterator par = pbegin;
|
ParagraphList::const_iterator par = pbegin;
|
||||||
@ -976,8 +976,8 @@ ParagraphList::const_iterator makeEnvironment(Buffer const & buf,
|
|||||||
// "ii", etc, as with enum.
|
// "ii", etc, as with enum.
|
||||||
Counters & cnts = buf.masterBuffer()->params().documentClass().counters();
|
Counters & cnts = buf.masterBuffer()->params().documentClass().counters();
|
||||||
docstring const & cntr = style.counter;
|
docstring const & cntr = style.counter;
|
||||||
if (!style.counter.empty()
|
if (!style.counter.empty()
|
||||||
&& (par == pbegin || !isNormalEnv(style))
|
&& (par == pbegin || !isNormalEnv(style))
|
||||||
&& cnts.hasCounter(cntr)
|
&& cnts.hasCounter(cntr)
|
||||||
)
|
)
|
||||||
cnts.step(cntr, OutputUpdate);
|
cnts.step(cntr, OutputUpdate);
|
||||||
@ -990,8 +990,8 @@ ParagraphList::const_iterator makeEnvironment(Buffer const & buf,
|
|||||||
case LATEX_ENVIRONMENT:
|
case LATEX_ENVIRONMENT:
|
||||||
case LATEX_LIST_ENVIRONMENT:
|
case LATEX_LIST_ENVIRONMENT:
|
||||||
case LATEX_ITEM_ENVIRONMENT: {
|
case LATEX_ITEM_ENVIRONMENT: {
|
||||||
// There are two possiblities in this case.
|
// There are two possiblities in this case.
|
||||||
// One is that we are still in the environment in which we
|
// One is that we are still in the environment in which we
|
||||||
// started---which we will be if the depth is the same.
|
// started---which we will be if the depth is the same.
|
||||||
if (par->params().depth() == origdepth) {
|
if (par->params().depth() == origdepth) {
|
||||||
LATTEST(bstyle == style);
|
LATTEST(bstyle == style);
|
||||||
@ -999,19 +999,19 @@ ParagraphList::const_iterator makeEnvironment(Buffer const & buf,
|
|||||||
closeItemTag(xs, *lastlay);
|
closeItemTag(xs, *lastlay);
|
||||||
lastlay = 0;
|
lastlay = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool const labelfirst = style.htmllabelfirst();
|
bool const labelfirst = style.htmllabelfirst();
|
||||||
if (!labelfirst)
|
if (!labelfirst)
|
||||||
openItemTag(xs, style, par->params());
|
openItemTag(xs, style, par->params());
|
||||||
|
|
||||||
// label output
|
// label output
|
||||||
if (style.labeltype != LABEL_NO_LABEL &&
|
if (style.labeltype != LABEL_NO_LABEL &&
|
||||||
style.htmllabeltag() != "NONE") {
|
style.htmllabeltag() != "NONE") {
|
||||||
if (isNormalEnv(style)) {
|
if (isNormalEnv(style)) {
|
||||||
// in this case, we print the label only for the first
|
// in this case, we print the label only for the first
|
||||||
// paragraph (as in a theorem).
|
// paragraph (as in a theorem).
|
||||||
if (par == pbegin) {
|
if (par == pbegin) {
|
||||||
docstring const lbl =
|
docstring const lbl =
|
||||||
pbegin->params().labelString();
|
pbegin->params().labelString();
|
||||||
if (!lbl.empty()) {
|
if (!lbl.empty()) {
|
||||||
openLabelTag(xs, style);
|
openLabelTag(xs, style);
|
||||||
@ -1039,13 +1039,13 @@ ParagraphList::const_iterator makeEnvironment(Buffer const & buf,
|
|||||||
if (labelfirst)
|
if (labelfirst)
|
||||||
openItemTag(xs, style, par->params());
|
openItemTag(xs, style, par->params());
|
||||||
|
|
||||||
par->simpleLyXHTMLOnePar(buf, xs, runparams,
|
par->simpleLyXHTMLOnePar(buf, xs, runparams,
|
||||||
text.outerFont(distance(begin, par)), sep);
|
text.outerFont(distance(begin, par)), sep);
|
||||||
++par;
|
++par;
|
||||||
|
|
||||||
// We may not want to close the tag yet, in particular:
|
// We may not want to close the tag yet, in particular:
|
||||||
// If we're not at the end...
|
// If we're not at the end...
|
||||||
if (par != pend
|
if (par != pend
|
||||||
// and are doing items...
|
// and are doing items...
|
||||||
&& !isNormalEnv(style)
|
&& !isNormalEnv(style)
|
||||||
// and if the depth has changed...
|
// and if the depth has changed...
|
||||||
@ -1167,7 +1167,7 @@ void xhtmlParagraphs(Text const & text,
|
|||||||
case LATEX_COMMAND: {
|
case LATEX_COMMAND: {
|
||||||
// The files with which we are working never have more than
|
// The files with which we are working never have more than
|
||||||
// one paragraph in a command structure.
|
// one paragraph in a command structure.
|
||||||
// FIXME
|
// FIXME
|
||||||
// if (ourparams.html_in_par)
|
// if (ourparams.html_in_par)
|
||||||
// fix it so we don't get sections inside standard, e.g.
|
// fix it so we don't get sections inside standard, e.g.
|
||||||
// note that we may then need to make runparams not const, so we
|
// note that we may then need to make runparams not const, so we
|
||||||
|
@ -366,9 +366,9 @@ docstring const Messages::get(string const & m) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string Messages::language() const
|
std::string Messages::language() const
|
||||||
{
|
{
|
||||||
return string();
|
return string();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Messages::available(string const & /* c */)
|
bool Messages::available(string const & /* c */)
|
||||||
{
|
{
|
||||||
|
@ -47,7 +47,7 @@ using namespace std;
|
|||||||
bool test_Layout(string const & input, string const & output)
|
bool test_Layout(string const & input, string const & output)
|
||||||
{
|
{
|
||||||
FileName const ifn(makeAbsPath(input));
|
FileName const ifn(makeAbsPath(input));
|
||||||
LayoutFileList & l = LayoutFileList::get();
|
LayoutFileList & l = LayoutFileList::get();
|
||||||
LayoutFileIndex i = onlyFileName(l.addLocalLayout(ifn.onlyFileName(), ifn.onlyPath().absFileName()));
|
LayoutFileIndex i = onlyFileName(l.addLocalLayout(ifn.onlyFileName(), ifn.onlyPath().absFileName()));
|
||||||
if (i.empty()) {
|
if (i.empty()) {
|
||||||
cerr << "Could not read layout file " << input << ".layout.\n";
|
cerr << "Could not read layout file " << input << ".layout.\n";
|
||||||
|
@ -1391,12 +1391,12 @@ void parse_environment(Parser & p, ostream & os, bool outer,
|
|||||||
if (!opt.empty())
|
if (!opt.empty())
|
||||||
os << "placement " << opt << '\n';
|
os << "placement " << opt << '\n';
|
||||||
if (contains(opt, "H"))
|
if (contains(opt, "H"))
|
||||||
preamble.registerAutomaticallyLoadedPackage("float");
|
preamble.registerAutomaticallyLoadedPackage("float");
|
||||||
else {
|
else {
|
||||||
Floating const & fl = parent_context.textclass.floats()
|
Floating const & fl = parent_context.textclass.floats()
|
||||||
.getType(unstarred_name);
|
.getType(unstarred_name);
|
||||||
if (!fl.floattype().empty() && fl.usesFloatPkg())
|
if (!fl.floattype().empty() && fl.usesFloatPkg())
|
||||||
preamble.registerAutomaticallyLoadedPackage("float");
|
preamble.registerAutomaticallyLoadedPackage("float");
|
||||||
}
|
}
|
||||||
|
|
||||||
os << "wide " << convert<string>(is_starred)
|
os << "wide " << convert<string>(is_starred)
|
||||||
|
Loading…
Reference in New Issue
Block a user