mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 21:21:32 +00:00
Whitespace cleanup
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18550 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
0e64103f92
commit
897436efbb
@ -145,7 +145,7 @@ docstring const ASpell::nextMiss()
|
||||
docstring const ASpell::error()
|
||||
{
|
||||
char const * err = 0;
|
||||
|
||||
|
||||
if (spell_error_object && aspell_error_number(spell_error_object) != 0) {
|
||||
err = aspell_error_message(spell_error_object);
|
||||
}
|
||||
|
@ -210,7 +210,7 @@ bool Bidi::isBoundary(Buffer const & buf, Paragraph const & par,
|
||||
}
|
||||
|
||||
|
||||
bool reverseDirectionNeeded(Cursor const & cur)
|
||||
bool reverseDirectionNeeded(Cursor const & cur)
|
||||
{
|
||||
/*
|
||||
* We determine the directions based on the direction of the
|
||||
|
@ -510,20 +510,20 @@ bool Buffer::readDocument(Lexer & lex)
|
||||
if (params().outputChanges) {
|
||||
bool dvipost = LaTeXFeatures::isAvailable("dvipost");
|
||||
bool xcolorsoul = LaTeXFeatures::isAvailable("soul") &&
|
||||
LaTeXFeatures::isAvailable("xcolor");
|
||||
|
||||
LaTeXFeatures::isAvailable("xcolor");
|
||||
|
||||
if (!dvipost && !xcolorsoul) {
|
||||
Alert::warning(_("Changes not shown in LaTeX output"),
|
||||
_("Changes will not be highlighted in LaTeX output, "
|
||||
"because neither dvipost nor xcolor/soul are installed.\n"
|
||||
"Please install these packages or redefine "
|
||||
"\\lyxadded and \\lyxdeleted in the LaTeX preamble."));
|
||||
_("Changes will not be highlighted in LaTeX output, "
|
||||
"because neither dvipost nor xcolor/soul are installed.\n"
|
||||
"Please install these packages or redefine "
|
||||
"\\lyxadded and \\lyxdeleted in the LaTeX preamble."));
|
||||
} else if (!xcolorsoul) {
|
||||
Alert::warning(_("Changes not shown in LaTeX output"),
|
||||
_("Changes will not be highlighted in LaTeX output "
|
||||
"when using pdflatex, because xcolor and soul are not installed.\n"
|
||||
"Please install both packages or redefine "
|
||||
"\\lyxadded and \\lyxdeleted in the LaTeX preamble."));
|
||||
_("Changes will not be highlighted in LaTeX output "
|
||||
"when using pdflatex, because xcolor and soul are not installed.\n"
|
||||
"Please install both packages or redefine "
|
||||
"\\lyxadded and \\lyxdeleted in the LaTeX preamble."));
|
||||
}
|
||||
}
|
||||
|
||||
@ -718,10 +718,10 @@ Buffer::ReadStatus Buffer::readFile(Lexer & lex, FileName const & filename,
|
||||
}
|
||||
ostringstream command;
|
||||
command << os::python()
|
||||
<< ' ' << quoteName(lyx2lyx.toFilesystemEncoding())
|
||||
<< " -t " << convert<string>(LYX_FORMAT)
|
||||
<< " -o " << quoteName(tmpfile.toFilesystemEncoding())
|
||||
<< ' ' << quoteName(filename.toFilesystemEncoding());
|
||||
<< ' ' << quoteName(lyx2lyx.toFilesystemEncoding())
|
||||
<< " -t " << convert<string>(LYX_FORMAT)
|
||||
<< " -o " << quoteName(tmpfile.toFilesystemEncoding())
|
||||
<< ' ' << quoteName(filename.toFilesystemEncoding());
|
||||
string const command_str = command.str();
|
||||
|
||||
LYXERR(Debug::INFO) << "Running '"
|
||||
@ -776,16 +776,16 @@ bool Buffer::save() const
|
||||
backupName = FileName(fileName() + '~');
|
||||
if (!lyxrc.backupdir_path.empty())
|
||||
backupName = FileName(addName(lyxrc.backupdir_path,
|
||||
subst(os::internal_path(backupName.absFilename()), '/', '!')));
|
||||
subst(os::internal_path(backupName.absFilename()), '/', '!')));
|
||||
|
||||
try {
|
||||
fs::copy_file(encodedFilename, backupName.toFilesystemEncoding(), false);
|
||||
madeBackup = true;
|
||||
} catch (fs::filesystem_error const & fe) {
|
||||
Alert::error(_("Backup failure"),
|
||||
bformat(_("Cannot create backup file %1$s.\n"
|
||||
"Please check whether the directory exists and is writeable."),
|
||||
from_utf8(backupName.absFilename())));
|
||||
bformat(_("Cannot create backup file %1$s.\n"
|
||||
"Please check whether the directory exists and is writeable."),
|
||||
from_utf8(backupName.absFilename())));
|
||||
LYXERR(Debug::DEBUG) << "Fs error: " << fe.what() << endl;
|
||||
}
|
||||
}
|
||||
@ -1000,8 +1000,8 @@ void Buffer::writeLaTeXSource(odocstream & os,
|
||||
!params().language->babel().empty()) {
|
||||
// FIXME UNICODE
|
||||
os << from_utf8(subst(lyxrc.language_command_begin,
|
||||
"$$lang",
|
||||
params().language->babel()))
|
||||
"$$lang",
|
||||
params().language->babel()))
|
||||
<< '\n';
|
||||
texrow().newline();
|
||||
}
|
||||
@ -1047,8 +1047,8 @@ void Buffer::writeLaTeXSource(odocstream & os,
|
||||
if (!lyxrc.language_auto_end &&
|
||||
!params().language->babel().empty()) {
|
||||
os << from_utf8(subst(lyxrc.language_command_end,
|
||||
"$$lang",
|
||||
params().language->babel()))
|
||||
"$$lang",
|
||||
params().language->babel()))
|
||||
<< '\n';
|
||||
texrow().newline();
|
||||
}
|
||||
@ -1098,7 +1098,7 @@ void Buffer::makeDocBookFile(FileName const & fname,
|
||||
LYXERR(Debug::LATEX) << "makeDocBookFile..." << endl;
|
||||
|
||||
//ofstream ofs;
|
||||
odocfstream ofs;
|
||||
odocfstream ofs;
|
||||
if (!openFileWrite(ofs, fname))
|
||||
return;
|
||||
|
||||
@ -1126,12 +1126,12 @@ void Buffer::writeDocBookSource(odocstream & os, string const & fname,
|
||||
if (runparams.flavor == OutputParams::XML)
|
||||
os << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
|
||||
|
||||
// FIXME UNICODE
|
||||
// FIXME UNICODE
|
||||
os << "<!DOCTYPE " << from_ascii(top_element) << ' ';
|
||||
|
||||
// FIXME UNICODE
|
||||
// FIXME UNICODE
|
||||
if (! tclass.class_header().empty())
|
||||
os << from_ascii(tclass.class_header());
|
||||
os << from_ascii(tclass.class_header());
|
||||
else if (runparams.flavor == OutputParams::XML)
|
||||
os << "PUBLIC \"-//OASIS//DTD DocBook XML//EN\" "
|
||||
<< "\"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd\"";
|
||||
@ -1152,7 +1152,7 @@ void Buffer::writeDocBookSource(odocstream & os, string const & fname,
|
||||
preamble += features.getLyXSGMLEntities();
|
||||
|
||||
if (!preamble.empty()) {
|
||||
os << "\n [ " << preamble << " ]";
|
||||
os << "\n [ " << preamble << " ]";
|
||||
}
|
||||
os << ">\n\n";
|
||||
}
|
||||
@ -1233,9 +1233,9 @@ void Buffer::validate(LaTeXFeatures & features) const
|
||||
if (params().outputChanges) {
|
||||
bool dvipost = LaTeXFeatures::isAvailable("dvipost");
|
||||
bool xcolorsoul = LaTeXFeatures::isAvailable("soul") &&
|
||||
LaTeXFeatures::isAvailable("xcolor");
|
||||
|
||||
if (features.runparams().flavor == OutputParams::LATEX) {
|
||||
LaTeXFeatures::isAvailable("xcolor");
|
||||
|
||||
if (features.runparams().flavor == OutputParams::LATEX) {
|
||||
if (dvipost) {
|
||||
features.require("ct-dvipost");
|
||||
features.require("dvipost");
|
||||
@ -1243,7 +1243,7 @@ void Buffer::validate(LaTeXFeatures & features) const
|
||||
features.require("ct-xcolor-soul");
|
||||
features.require("soul");
|
||||
features.require("xcolor");
|
||||
} else {
|
||||
} else {
|
||||
features.require("ct-none");
|
||||
}
|
||||
} else if (features.runparams().flavor == OutputParams::PDFLATEX ) {
|
||||
@ -1255,7 +1255,7 @@ void Buffer::validate(LaTeXFeatures & features) const
|
||||
} else {
|
||||
features.require("ct-none");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// AMS Style is at document level
|
||||
|
@ -395,7 +395,7 @@ private:
|
||||
\return \c false if method fails.
|
||||
*/
|
||||
ReadStatus readFile(Lexer &, support::FileName const & filename,
|
||||
bool fromString = false);
|
||||
bool fromString = false);
|
||||
|
||||
/// Use the Pimpl idiom to hide the internals.
|
||||
class Impl;
|
||||
|
@ -474,11 +474,11 @@ string const BufferParams::readToken(Lexer & lex, string const & token)
|
||||
if (!getTextClass().isTeXClassAvailable()) {
|
||||
docstring const msg =
|
||||
bformat(_("The layout file requested by this document,\n"
|
||||
"%1$s.layout,\n"
|
||||
"is not usable. This is probably because a LaTeX\n"
|
||||
"class or style file required by it is not\n"
|
||||
"available. See the Customization documentation\n"
|
||||
"for more information.\n"), from_utf8(classname));
|
||||
"%1$s.layout,\n"
|
||||
"is not usable. This is probably because a LaTeX\n"
|
||||
"class or style file required by it is not\n"
|
||||
"available. See the Customization documentation\n"
|
||||
"for more information.\n"), from_utf8(classname));
|
||||
frontend::Alert::warning(_("Document class not available"),
|
||||
msg + _("LyX will not be able to produce output."));
|
||||
}
|
||||
@ -748,7 +748,7 @@ void BufferParams::writeFile(ostream & os) const
|
||||
<< "\n\\papersides " << sides
|
||||
<< "\n\\paperpagestyle " << pagestyle << '\n';
|
||||
if (!listings_params.empty())
|
||||
os << "\\listings_params \"" <<
|
||||
os << "\\listings_params \"" <<
|
||||
InsetListingsParams(listings_params).encodedString() << "\"\n";
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
if (user_defined_bullet(i) != ITEMIZE_DEFAULTS[i]) {
|
||||
@ -794,7 +794,7 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features,
|
||||
}
|
||||
|
||||
// custom, A3, B3 and B4 paper sizes need geometry
|
||||
bool nonstandard_papersize = papersize == PAPER_B3
|
||||
bool nonstandard_papersize = papersize == PAPER_B3
|
||||
|| papersize == PAPER_B4
|
||||
|| papersize == PAPER_A3
|
||||
|| papersize == PAPER_CUSTOM;
|
||||
|
@ -208,9 +208,9 @@ void BufferView::setBuffer(Buffer * b)
|
||||
|
||||
if (!buffer_)
|
||||
return;
|
||||
|
||||
|
||||
LYXERR(Debug::INFO) << BOOST_CURRENT_FUNCTION
|
||||
<< "Buffer addr: " << buffer_ << endl;
|
||||
<< "Buffer addr: " << buffer_ << endl;
|
||||
cursor_.push(buffer_->inset());
|
||||
cursor_.resetAnchor();
|
||||
buffer_->text().setCurrentFont(cursor_);
|
||||
@ -228,7 +228,7 @@ void BufferView::setBuffer(Buffer * b)
|
||||
// example if this Buffer has been modified by another view.
|
||||
cursor_.fixIfBroken();
|
||||
}
|
||||
updateMetrics(false);
|
||||
updateMetrics(false);
|
||||
if (graphics::Previews::status() != LyXRC::PREVIEW_OFF)
|
||||
graphics::Previews::get().generateBufferPreviews(*buffer_);
|
||||
}
|
||||
@ -384,7 +384,7 @@ bool BufferView::update(Update::flags flags)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (flags == Update::FitCursor
|
||||
if (flags == Update::FitCursor
|
||||
|| flags == (Update::Decoration | Update::FitCursor)) {
|
||||
bool const fit_cursor = fitCursor();
|
||||
// tell the frontend to update the screen if needed.
|
||||
@ -563,7 +563,7 @@ void BufferView::saveBookmark(unsigned int idx)
|
||||
{
|
||||
// tenatively save bookmark, id and pos will be used to
|
||||
// acturately locate a bookmark in a 'live' lyx session.
|
||||
// pit and pos will be updated with bottom level pit/pos
|
||||
// pit and pos will be updated with bottom level pit/pos
|
||||
// when lyx exits.
|
||||
LyX::ref().session().bookmarks().save(
|
||||
FileName(buffer_->fileName()),
|
||||
@ -609,7 +609,7 @@ boost::tuple<pit_type, pos_type, int> BufferView::moveToPosition(pit_type bottom
|
||||
}
|
||||
}
|
||||
// if top_id == 0, or searching through top_id failed
|
||||
// This is the case for a 'restored' bookmark when only bottom
|
||||
// This is the case for a 'restored' bookmark when only bottom
|
||||
// (document level) pit was saved. Because of this, bookmark
|
||||
// restoration is inaccurate. If a bookmark was within an inset,
|
||||
// it will be restored to the left of the outmost inset that contains
|
||||
@ -619,7 +619,7 @@ boost::tuple<pit_type, pos_type, int> BufferView::moveToPosition(pit_type bottom
|
||||
it.pit() = bottom_pit;
|
||||
it.pos() = min(bottom_pos, it.paragraph().size());
|
||||
setCursor(it);
|
||||
return boost::make_tuple(it.pit(), it.pos(),
|
||||
return boost::make_tuple(it.pit(), it.pos(),
|
||||
it.paragraph().id());
|
||||
}
|
||||
// both methods fail
|
||||
@ -901,20 +901,20 @@ Update::flags BufferView::dispatch(FuncRequest const & cmd)
|
||||
if (buffer_->params().outputChanges) {
|
||||
bool dvipost = LaTeXFeatures::isAvailable("dvipost");
|
||||
bool xcolorsoul = LaTeXFeatures::isAvailable("soul") &&
|
||||
LaTeXFeatures::isAvailable("xcolor");
|
||||
|
||||
LaTeXFeatures::isAvailable("xcolor");
|
||||
|
||||
if (!dvipost && !xcolorsoul) {
|
||||
Alert::warning(_("Changes not shown in LaTeX output"),
|
||||
_("Changes will not be highlighted in LaTeX output, "
|
||||
"because neither dvipost nor xcolor/soul are installed.\n"
|
||||
"Please install these packages or redefine "
|
||||
"\\lyxadded and \\lyxdeleted in the LaTeX preamble."));
|
||||
_("Changes will not be highlighted in LaTeX output, "
|
||||
"because neither dvipost nor xcolor/soul are installed.\n"
|
||||
"Please install these packages or redefine "
|
||||
"\\lyxadded and \\lyxdeleted in the LaTeX preamble."));
|
||||
} else if (!xcolorsoul) {
|
||||
Alert::warning(_("Changes not shown in LaTeX output"),
|
||||
_("Changes will not be highlighted in LaTeX output "
|
||||
"when using pdflatex, because xcolor and soul are not installed.\n"
|
||||
"Please install both packages or redefine "
|
||||
"\\lyxadded and \\lyxdeleted in the LaTeX preamble."));
|
||||
_("Changes will not be highlighted in LaTeX output "
|
||||
"when using pdflatex, because xcolor and soul are not installed.\n"
|
||||
"Please install both packages or redefine "
|
||||
"\\lyxadded and \\lyxdeleted in the LaTeX preamble."));
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -1148,7 +1148,7 @@ Inset const * BufferView::getCoveringInset(Text const & text, int x, int y)
|
||||
Inset * const inset = iit->inset;
|
||||
if (inset->covers(*this, x, y)) {
|
||||
if (!inset->descendable())
|
||||
// No need to go further down if the inset is not
|
||||
// No need to go further down if the inset is not
|
||||
// descendable.
|
||||
return inset;
|
||||
|
||||
@ -1158,7 +1158,7 @@ Inset const * BufferView::getCoveringInset(Text const & text, int x, int y)
|
||||
Text const * inner_text = inset->getText(i);
|
||||
if (inner_text) {
|
||||
// Try deeper.
|
||||
Inset const * inset_deeper =
|
||||
Inset const * inset_deeper =
|
||||
getCoveringInset(*inner_text, x, y);
|
||||
if (inset_deeper)
|
||||
return inset_deeper;
|
||||
@ -1199,11 +1199,11 @@ bool BufferView::workAreaDispatch(FuncRequest const & cmd0)
|
||||
|
||||
// make sure we stay within the screen...
|
||||
cmd.y = min(max(cmd.y, -1), height_);
|
||||
|
||||
|
||||
if (cmd.action == LFUN_MOUSE_MOTION && cmd.button() == mouse_button::none) {
|
||||
|
||||
|
||||
// Get inset under mouse, if there is one.
|
||||
Inset const * covering_inset =
|
||||
Inset const * covering_inset =
|
||||
getCoveringInset(buffer_->text(), cmd.x, cmd.y);
|
||||
if (covering_inset == last_inset_)
|
||||
// Same inset, no need to do anything...
|
||||
@ -1224,9 +1224,9 @@ bool BufferView::workAreaDispatch(FuncRequest const & cmd0)
|
||||
// not expose the button for redraw. We adjust here the metrics dimension
|
||||
// to enable a full redraw.
|
||||
// FIXME: It is possible to redraw only the area around the button!
|
||||
if (need_redraw
|
||||
if (need_redraw
|
||||
&& metrics_info_.update_strategy == SingleParUpdate) {
|
||||
// FIXME: It should be possible to redraw only the area around
|
||||
// FIXME: It should be possible to redraw only the area around
|
||||
// the button by doing this:
|
||||
//
|
||||
//metrics_info_.singlepar = false;
|
||||
@ -1252,7 +1252,7 @@ bool BufferView::workAreaDispatch(FuncRequest const & cmd0)
|
||||
// This should be changed if it is further utilized.
|
||||
return need_redraw;
|
||||
}
|
||||
|
||||
|
||||
// Build temporary cursor.
|
||||
Inset * inset = buffer_->text().editXY(cur, cmd.x, cmd.y);
|
||||
|
||||
@ -1340,7 +1340,7 @@ TextMetrics & BufferView::textMetrics(Text const * t)
|
||||
if (tmc_it == text_metrics_.end()) {
|
||||
tmc_it = text_metrics_.insert(
|
||||
make_pair(t, TextMetrics(this, const_cast<Text *>(t)))).first;
|
||||
}
|
||||
}
|
||||
return tmc_it->second;
|
||||
}
|
||||
|
||||
@ -1381,7 +1381,7 @@ bool BufferView::checkDepm(Cursor & cur, Cursor & old)
|
||||
|
||||
if (need_anchor_change)
|
||||
cur.resetAnchor();
|
||||
|
||||
|
||||
if (!changed)
|
||||
return false;
|
||||
|
||||
@ -1415,8 +1415,8 @@ bool BufferView::mouseSetCursor(Cursor & cur)
|
||||
// position is in the nucleus of the inset, notifyCursorLeaves
|
||||
// will kill the script inset itself. So we check all the
|
||||
// elements of the cursor to make sure that they are correct.
|
||||
// For an example, see bug 2933:
|
||||
// http://bugzilla.lyx.org/show_bug.cgi?id=2933
|
||||
// For an example, see bug 2933:
|
||||
// http://bugzilla.lyx.org/show_bug.cgi?id=2933
|
||||
// The code below could maybe be moved to a DocIterator method.
|
||||
//lyxerr << "cur before " << cur <<std::endl;
|
||||
DocIterator dit(cur.inset());
|
||||
@ -1489,7 +1489,7 @@ void BufferView::updateMetrics(bool singlepar)
|
||||
anchor_ref_ = int(buftext.paragraphs().size() - 1);
|
||||
offset_ref_ = 0;
|
||||
}
|
||||
|
||||
|
||||
// If the paragraph metrics has changed, we can not
|
||||
// use the singlepar optimisation.
|
||||
if (singlepar
|
||||
@ -1508,7 +1508,7 @@ void BufferView::updateMetrics(bool singlepar)
|
||||
// Rebreak anchor paragraph.
|
||||
if (!singlepar)
|
||||
tm.redoParagraph(pit);
|
||||
|
||||
|
||||
// Clear out the position cache in case of full screen redraw.
|
||||
if (!singlepar)
|
||||
coord_cache_.clear();
|
||||
@ -1586,7 +1586,7 @@ void BufferView::updateMetrics(bool singlepar)
|
||||
<< "size: " << size
|
||||
<< endl;
|
||||
|
||||
metrics_info_ = ViewMetricsInfo(pit1, pit2, y1, y2,
|
||||
metrics_info_ = ViewMetricsInfo(pit1, pit2, y1, y2,
|
||||
singlepar? SingleParUpdate: FullScreenUpdate, size);
|
||||
|
||||
if (lyxerr.debugging(Debug::WORKAREA)) {
|
||||
|
@ -72,7 +72,7 @@ struct ScrollbarParameters
|
||||
* is a sliding window of the entire document rendering.
|
||||
* It is the official interface between the LyX core and
|
||||
* the frontend WorkArea.
|
||||
*
|
||||
*
|
||||
* \sa WorkArea
|
||||
* \sa Buffer
|
||||
* \sa CoordCache
|
||||
|
@ -37,7 +37,7 @@ using std::max;
|
||||
* When merging two adjacent changes, the changetime is not considered,
|
||||
* only the equality of the change type and author is checked (in method
|
||||
* isSimilarTo(...)). If two changes are in fact merged (in method merge()),
|
||||
* the later change time is preserved.
|
||||
* the later change time is preserved.
|
||||
*/
|
||||
|
||||
bool Change::isSimilarTo(Change const & change)
|
||||
@ -64,7 +64,7 @@ bool operator==(Change const & l, Change const & r)
|
||||
if (l.type == Change::UNCHANGED) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return l.author == r.author &&
|
||||
l.changetime == r.changetime;
|
||||
}
|
||||
@ -222,7 +222,7 @@ void Changes::insert(Change const & change, lyx::pos_type pos)
|
||||
Change const & Changes::lookup(pos_type const pos) const
|
||||
{
|
||||
static Change const noChange = Change(Change::UNCHANGED);
|
||||
|
||||
|
||||
ChangeTable::const_iterator it = table_.begin();
|
||||
ChangeTable::const_iterator const end = table_.end();
|
||||
|
||||
@ -282,7 +282,7 @@ void Changes::merge()
|
||||
|
||||
(it + 1)->range.start = it->range.start;
|
||||
(it + 1)->change.changetime = max(it->change.changetime,
|
||||
(it + 1)->change.changetime);
|
||||
(it + 1)->change.changetime);
|
||||
table_.erase(it);
|
||||
// start again
|
||||
it = table_.begin();
|
||||
@ -314,7 +314,7 @@ int Changes::latexMarkChange(odocstream & os, BufferParams const & bparams,
|
||||
if (change.type == Change::DELETED) {
|
||||
docstring str = "\\lyxdeleted{" +
|
||||
bparams.authors().get(change.author).name() + "}{" +
|
||||
chgTime + "}{";
|
||||
chgTime + "}{";
|
||||
os << str;
|
||||
column += str.size();
|
||||
} else if (change.type == Change::INSERTED) {
|
||||
|
@ -79,7 +79,7 @@ public:
|
||||
/// output latex to mark a transition between two change types
|
||||
/// returns length of text outputted
|
||||
static int latexMarkChange(odocstream & os, BufferParams const & bparams,
|
||||
Change const & oldChange, Change const & change);
|
||||
Change const & oldChange, Change const & change);
|
||||
|
||||
/// output .lyx file format for transitions between changes
|
||||
static void lyxMarkChange(std::ostream & os, int & column,
|
||||
|
@ -288,10 +288,10 @@ OutputParams::FLAVOR Converters::getFlavor(Graph::EdgePath const & path)
|
||||
|
||||
|
||||
bool Converters::convert(Buffer const * buffer,
|
||||
FileName const & from_file, FileName const & to_file,
|
||||
FileName const & orig_from,
|
||||
string const & from_format, string const & to_format,
|
||||
ErrorList & errorList, int conversionflags)
|
||||
FileName const & from_file, FileName const & to_file,
|
||||
FileName const & orig_from,
|
||||
string const & from_format, string const & to_format,
|
||||
ErrorList & errorList, int conversionflags)
|
||||
{
|
||||
if (from_format == to_format)
|
||||
return move(from_format, from_file, to_file, false);
|
||||
@ -401,10 +401,10 @@ bool Converters::convert(Buffer const * buffer,
|
||||
// FIXME UNICODE
|
||||
string const infile2 = (conv.original_dir)
|
||||
? infile.absFilename() : to_utf8(makeRelPath(from_utf8(infile.absFilename()),
|
||||
from_utf8(path)));
|
||||
from_utf8(path)));
|
||||
string const outfile2 = (conv.original_dir)
|
||||
? outfile.absFilename() : to_utf8(makeRelPath(from_utf8(outfile.absFilename()),
|
||||
from_utf8(path)));
|
||||
from_utf8(path)));
|
||||
|
||||
string command = conv.command;
|
||||
command = subst(command, token_from, quoteName(infile2));
|
||||
|
@ -119,10 +119,10 @@ public:
|
||||
};
|
||||
///
|
||||
bool convert(Buffer const * buffer,
|
||||
support::FileName const & from_file, support::FileName const & to_file,
|
||||
support::FileName const & orig_from,
|
||||
std::string const & from_format, std::string const & to_format,
|
||||
ErrorList & errorList, int conversionflags = none);
|
||||
support::FileName const & from_file, support::FileName const & to_file,
|
||||
support::FileName const & orig_from,
|
||||
std::string const & from_format, std::string const & to_format,
|
||||
ErrorList & errorList, int conversionflags = none);
|
||||
///
|
||||
void update(Formats const & formats);
|
||||
///
|
||||
|
@ -62,7 +62,7 @@ class CacheItem {
|
||||
public:
|
||||
CacheItem() {}
|
||||
CacheItem(FileName const & orig_from, string const & to_format,
|
||||
time_t t, unsigned long c)
|
||||
time_t t, unsigned long c)
|
||||
: timestamp(t), checksum(c)
|
||||
{
|
||||
std::ostringstream os;
|
||||
@ -70,9 +70,9 @@ public:
|
||||
<< '-' << to_format;
|
||||
cache_name = FileName(addName(cache_dir.absFilename(), os.str()));
|
||||
LYXERR(Debug::FILES) << "Add file cache item " << orig_from
|
||||
<< ' ' << to_format << ' ' << cache_name
|
||||
<< ' ' << timestamp << ' ' << checksum
|
||||
<< '.' << std::endl;
|
||||
<< ' ' << to_format << ' ' << cache_name
|
||||
<< ' ' << timestamp << ' ' << checksum
|
||||
<< '.' << std::endl;
|
||||
}
|
||||
~CacheItem() {}
|
||||
FileName cache_name;
|
||||
@ -258,8 +258,8 @@ void ConverterCache::add(FileName const & orig_from, string const & to_format,
|
||||
converted_file.empty())
|
||||
return;
|
||||
LYXERR(Debug::FILES) << BOOST_CURRENT_FUNCTION << ' ' << orig_from
|
||||
<< ' ' << to_format << ' ' << converted_file
|
||||
<< std::endl;
|
||||
<< ' ' << to_format << ' ' << converted_file
|
||||
<< std::endl;
|
||||
|
||||
// Is the file in the cache already?
|
||||
CacheItem * item = pimpl_->find(orig_from, to_format);
|
||||
@ -268,12 +268,12 @@ void ConverterCache::add(FileName const & orig_from, string const & to_format,
|
||||
Mover const & mover = getMover(to_format);
|
||||
if (item) {
|
||||
LYXERR(Debug::FILES) << "ConverterCache::add(" << orig_from << "):\n"
|
||||
"The file is already in the cache."
|
||||
<< std::endl;
|
||||
"The file is already in the cache."
|
||||
<< std::endl;
|
||||
// First test for timestamp
|
||||
if (timestamp == item->timestamp) {
|
||||
LYXERR(Debug::FILES) << "Same timestamp."
|
||||
<< std::endl;
|
||||
<< std::endl;
|
||||
return;
|
||||
} else {
|
||||
// Maybe the contents is still the same?
|
||||
@ -281,16 +281,16 @@ void ConverterCache::add(FileName const & orig_from, string const & to_format,
|
||||
unsigned long const checksum = support::sum(orig_from);
|
||||
if (checksum == item->checksum) {
|
||||
LYXERR(Debug::FILES) << "Same checksum."
|
||||
<< std::endl;
|
||||
<< std::endl;
|
||||
return;
|
||||
}
|
||||
item->checksum = checksum;
|
||||
}
|
||||
if (!mover.copy(converted_file, item->cache_name, 0600))
|
||||
LYXERR(Debug::FILES) << "ConverterCache::add("
|
||||
<< orig_from << "):\n"
|
||||
"Could not copy file."
|
||||
<< std::endl;
|
||||
<< orig_from << "):\n"
|
||||
"Could not copy file."
|
||||
<< std::endl;
|
||||
} else {
|
||||
CacheItem new_item(orig_from, to_format, timestamp,
|
||||
support::sum(orig_from));
|
||||
@ -302,9 +302,9 @@ void ConverterCache::add(FileName const & orig_from, string const & to_format,
|
||||
format_cache.cache[to_format] = new_item;
|
||||
} else
|
||||
LYXERR(Debug::FILES) << "ConverterCache::add("
|
||||
<< orig_from << "):\n"
|
||||
"Could not copy file."
|
||||
<< std::endl;
|
||||
<< orig_from << "):\n"
|
||||
"Could not copy file."
|
||||
<< std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -315,7 +315,7 @@ void ConverterCache::remove(FileName const & orig_from,
|
||||
if (!lyxrc.use_converter_cache || orig_from.empty())
|
||||
return;
|
||||
LYXERR(Debug::FILES) << BOOST_CURRENT_FUNCTION << ' ' << orig_from
|
||||
<< ' ' << to_format << std::endl;
|
||||
<< ' ' << to_format << std::endl;
|
||||
|
||||
CacheType::iterator const it1 = pimpl_->cache.find(orig_from);
|
||||
if (it1 == pimpl_->cache.end())
|
||||
@ -376,7 +376,7 @@ bool ConverterCache::inCache(FileName const & orig_from,
|
||||
if (!lyxrc.use_converter_cache || orig_from.empty())
|
||||
return false;
|
||||
LYXERR(Debug::FILES) << BOOST_CURRENT_FUNCTION << ' ' << orig_from
|
||||
<< ' ' << to_format << std::endl;
|
||||
<< ' ' << to_format << std::endl;
|
||||
|
||||
CacheItem * const item = pimpl_->find(orig_from, to_format);
|
||||
if (!item) {
|
||||
@ -402,7 +402,7 @@ FileName const & ConverterCache::cacheName(FileName const & orig_from,
|
||||
string const & to_format) const
|
||||
{
|
||||
LYXERR(Debug::FILES) << BOOST_CURRENT_FUNCTION << ' ' << orig_from
|
||||
<< ' ' << to_format << std::endl;
|
||||
<< ' ' << to_format << std::endl;
|
||||
|
||||
CacheItem * const item = pimpl_->find(orig_from, to_format);
|
||||
BOOST_ASSERT(item);
|
||||
@ -416,7 +416,7 @@ bool ConverterCache::copy(FileName const & orig_from, string const & to_format,
|
||||
if (!lyxrc.use_converter_cache || orig_from.empty() || dest.empty())
|
||||
return false;
|
||||
LYXERR(Debug::FILES) << BOOST_CURRENT_FUNCTION << ' ' << orig_from
|
||||
<< ' ' << to_format << ' ' << dest << std::endl;
|
||||
<< ' ' << to_format << ' ' << dest << std::endl;
|
||||
|
||||
CacheItem * const item = pimpl_->find(orig_from, to_format);
|
||||
BOOST_ASSERT(item);
|
||||
|
@ -63,30 +63,30 @@ public:
|
||||
* the cache if it is not already in or not up to date.
|
||||
*/
|
||||
void add(support::FileName const & orig_from, std::string const & to_format,
|
||||
support::FileName const & converted_file) const;
|
||||
support::FileName const & converted_file) const;
|
||||
|
||||
/// Remove a file from the cache.
|
||||
void remove(support::FileName const & orig_from,
|
||||
std::string const & to_format) const;
|
||||
std::string const & to_format) const;
|
||||
|
||||
/// Remove all cached \p from_format -> \p to_format conversions
|
||||
void remove_all(std::string const & from_format,
|
||||
std::string const & to_format) const;
|
||||
std::string const & to_format) const;
|
||||
|
||||
/**
|
||||
* Returns \c true if \c orig_from converted to \c to_format is in
|
||||
* the cache and up to date.
|
||||
*/
|
||||
bool inCache(support::FileName const & orig_from,
|
||||
std::string const & to_format) const;
|
||||
std::string const & to_format) const;
|
||||
|
||||
/// Get the name of the cached file
|
||||
support::FileName const & cacheName(support::FileName const & orig_from,
|
||||
std::string const & to_format) const;
|
||||
std::string const & to_format) const;
|
||||
|
||||
/// Copy the file from the cache to \p dest
|
||||
bool copy(support::FileName const & orig_from, std::string const & to_format,
|
||||
support::FileName const & dest) const;
|
||||
support::FileName const & dest) const;
|
||||
|
||||
private:
|
||||
/** Make the c-tor, d-tor private so we can control how many objects
|
||||
|
@ -326,7 +326,7 @@ docstring Counters::counterLabel(docstring const & format)
|
||||
docstring const numbertype(label, i + 1, j - i - 1);
|
||||
docstring const counter(label, j + 1, k - j - 1);
|
||||
docstring const rep = labelItem(counter, numbertype);
|
||||
label = docstring(label, 0, i) + rep
|
||||
label = docstring(label, 0, i) + rep
|
||||
+ docstring(label, k + 1, docstring::npos);
|
||||
//lyxerr << " : " << " (" << counter << ","
|
||||
// << numbertype << ") -> " << label << endl;
|
||||
|
@ -250,7 +250,7 @@ namespace {
|
||||
odocstringstream ods;
|
||||
ods << '\n';
|
||||
// only add blank line if we're not in an ERT or Listings inset
|
||||
if (par.ownerCode() != Inset::ERT_CODE
|
||||
if (par.ownerCode() != Inset::ERT_CODE
|
||||
&& par.ownerCode() != Inset::LISTINGS_CODE)
|
||||
ods << '\n';
|
||||
return ods.str();
|
||||
@ -785,7 +785,7 @@ bool Cursor::backspace()
|
||||
// If empty cell, and not part of a big cell
|
||||
if (lastpos() == 0 && inset().nargs() == 1) {
|
||||
popLeft();
|
||||
// Directly delete empty cell: [|[]] => [|]
|
||||
// Directly delete empty cell: [|[]] => [|]
|
||||
if (inMathed()) {
|
||||
plainErase();
|
||||
resetAnchor();
|
||||
@ -844,7 +844,7 @@ bool Cursor::erase()
|
||||
bool one_cell = inset().nargs() == 1;
|
||||
if (one_cell && lastpos() == 0) {
|
||||
popLeft();
|
||||
// Directly delete empty cell: [|[]] => [|]
|
||||
// Directly delete empty cell: [|[]] => [|]
|
||||
if (inMathed()) {
|
||||
plainErase();
|
||||
resetAnchor();
|
||||
|
@ -146,10 +146,10 @@ pasteSelectionHelper(Cursor & cur, ParagraphList const & parlist,
|
||||
// If we are in an inset which returns forceDefaultParagraphs,
|
||||
// set the paragraphs to default
|
||||
if (cur.inset().forceDefaultParagraphs(cur.idx())) {
|
||||
Layout_ptr const layout =
|
||||
Layout_ptr const layout =
|
||||
buffer.params().getTextClass().defaultLayout();
|
||||
ParagraphList::iterator const end = insertion.end();
|
||||
for (ParagraphList::iterator par = insertion.begin();
|
||||
for (ParagraphList::iterator par = insertion.begin();
|
||||
par != end; ++par)
|
||||
par->layout(layout);
|
||||
}
|
||||
@ -198,7 +198,7 @@ pasteSelectionHelper(Cursor & cur, ParagraphList const & parlist,
|
||||
}
|
||||
|
||||
tmpbuf->setChange(Change(buffer.params().trackChanges ?
|
||||
Change::INSERTED : Change::UNCHANGED));
|
||||
Change::INSERTED : Change::UNCHANGED));
|
||||
}
|
||||
|
||||
bool const empty = pars[pit].empty();
|
||||
@ -335,7 +335,7 @@ PitPosPair eraseSelectionHelper(BufferParams const & params,
|
||||
|
||||
|
||||
void putClipboard(ParagraphList const & paragraphs, textclass_type textclass,
|
||||
docstring const & plaintext)
|
||||
docstring const & plaintext)
|
||||
{
|
||||
// For some strange reason gcc 3.2 and 3.3 do not accept
|
||||
// Buffer buffer(string(), false);
|
||||
@ -382,7 +382,7 @@ void copySelectionHelper(Buffer const & buf, ParagraphList & pars,
|
||||
// to the buffer language.
|
||||
if (it->ownerCode() == Inset::ERT_CODE || it->ownerCode() == Inset::LISTINGS_CODE) {
|
||||
it->changeLanguage(buf.params(), latex_language,
|
||||
buf.getLanguage());
|
||||
buf.getLanguage());
|
||||
}
|
||||
it->setInsetOwner(0);
|
||||
}
|
||||
@ -498,7 +498,7 @@ std::vector<docstring> const availableSelections(Buffer const & buffer)
|
||||
asciiSel += pit->asString(buffer, false);
|
||||
if (asciiSel.size() > 25) {
|
||||
asciiSel.replace(22, docstring::npos,
|
||||
from_ascii("..."));
|
||||
from_ascii("..."));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -563,7 +563,7 @@ void cutSelection(Cursor & cur, bool doclear, bool realcut)
|
||||
cur.pit() = endpit;
|
||||
|
||||
// sometimes necessary
|
||||
if (doclear
|
||||
if (doclear
|
||||
&& text->paragraphs()[begpit].stripLeadingSpaces(bp.trackChanges))
|
||||
cur.fixIfBroken();
|
||||
|
||||
@ -651,7 +651,7 @@ void copySelectionToStack()
|
||||
void copySelection(Cursor & cur, docstring const & plaintext)
|
||||
{
|
||||
// In tablemode, because copy and paste actually use special table stack
|
||||
// we do not attemp to get selected paragraphs under cursor. Instead, a
|
||||
// we do not attemp to get selected paragraphs under cursor. Instead, a
|
||||
// paragraph with the plain text version is generated so that table cells
|
||||
// can be pasted as pure text somewhere else.
|
||||
if (cur.selBegin().idx() != cur.selEnd().idx()) {
|
||||
@ -675,7 +675,7 @@ void saveSelection(Cursor & cur)
|
||||
LYXERR(Debug::ACTION) << BOOST_CURRENT_FUNCTION << ": `"
|
||||
<< to_utf8(cur.selectionAsString(true)) << "'."
|
||||
<< endl;
|
||||
|
||||
|
||||
if (cur.selection())
|
||||
copySelectionToStack(cur, selectionBuffer);
|
||||
// tell X whether we now have a valid selection
|
||||
@ -784,7 +784,7 @@ void pasteSelection(Cursor & cur, ErrorList & errorList)
|
||||
return;
|
||||
recordUndo(cur);
|
||||
pasteParagraphList(cur, selectionBuffer[0].first,
|
||||
selectionBuffer[0].second, errorList);
|
||||
selectionBuffer[0].second, errorList);
|
||||
cur.setSelection();
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,7 @@ void replaceSelection(Cursor & cur);
|
||||
* they get merged.
|
||||
* \param realcut If this is true: Push the selection to the cut buffer and
|
||||
* system clipboard. Set this to false to only delete the
|
||||
* selection.
|
||||
* selection.
|
||||
*/
|
||||
void cutSelection(Cursor & cur, bool doclear = true, bool realcut = true);
|
||||
/// Push the current selection to the cut buffer and the system clipboard.
|
||||
@ -97,7 +97,7 @@ void pasteParagraphList(Cursor & cur, ParagraphList const & parlist,
|
||||
* It changes layouts and character styles.
|
||||
*/
|
||||
void switchBetweenClasses(textclass_type c1, textclass_type c2,
|
||||
InsetText & in, ErrorList &);
|
||||
InsetText & in, ErrorList &);
|
||||
|
||||
/// Get the current selection as a string. Does not change the selection.
|
||||
/// Does only work if the whole selection is in mathed.
|
||||
|
@ -561,14 +561,14 @@ void DocIterator::updateInsets(Inset * inset)
|
||||
bool DocIterator::fixIfBroken()
|
||||
{
|
||||
bool fixed = false;
|
||||
|
||||
|
||||
for (size_t i = slices_.size() - 1; i != 0; --i)
|
||||
if (!slices_[i].isValid()) {
|
||||
pop_back();
|
||||
fixed = true;
|
||||
}
|
||||
|
||||
// The top level CursorSlice should always be valid.
|
||||
// The top level CursorSlice should always be valid.
|
||||
BOOST_ASSERT(slices_[0].isValid());
|
||||
|
||||
if (idx() > lastidx()) {
|
||||
|
@ -131,7 +131,7 @@ char_type const max_ucs4 = 0x110000;
|
||||
|
||||
|
||||
Encoding::Encoding(string const & n, string const & l, string const & i,
|
||||
bool f, Encoding::Package p)
|
||||
bool f, Encoding::Package p)
|
||||
: Name_(n), LatexName_(l), iconvName_(i), fixedwidth_(f), package_(p)
|
||||
{
|
||||
if (n == "ascii") {
|
||||
@ -241,10 +241,10 @@ bool Encodings::isComposeChar_hebrew(char_type c)
|
||||
bool Encodings::is_arabic_special(char_type c)
|
||||
{
|
||||
return (c >= 0x0621 && c <= 0x0625) ||
|
||||
c == 0x0627 || c == 0x0629 ||
|
||||
c == 0x062f || c == 0x0648 ||
|
||||
c == 0x0627 || c == 0x0629 ||
|
||||
c == 0x062f || c == 0x0648 ||
|
||||
(c >= 0x0630 && c <= 0x0632) ||
|
||||
c == 0x0649;
|
||||
c == 0x0649;
|
||||
}
|
||||
|
||||
|
||||
@ -356,8 +356,8 @@ void Encodings::read(FileName const & encfile, FileName const & symbolsfile)
|
||||
info.force = true;
|
||||
else
|
||||
lyxerr << "Ignoring unknown flag `" << flag
|
||||
<< "' for symbol `0x"
|
||||
<< std::hex << symbol << std::dec
|
||||
<< "' for symbol `0x"
|
||||
<< std::hex << symbol << std::dec
|
||||
<< "'." << endl;
|
||||
}
|
||||
|
||||
@ -405,7 +405,7 @@ void Encodings::read(FileName const & encfile, FileName const & symbolsfile)
|
||||
fixedwidth = false;
|
||||
else
|
||||
lex.printError("Encodings::read: "
|
||||
"Unknown width: `$$Token'");
|
||||
"Unknown width: `$$Token'");
|
||||
lex.next();
|
||||
string const p = lex.getString();
|
||||
Encoding::Package package;
|
||||
@ -417,11 +417,11 @@ void Encodings::read(FileName const & encfile, FileName const & symbolsfile)
|
||||
package = Encoding::CJK;
|
||||
else
|
||||
lex.printError("Encodings::read: "
|
||||
"Unknown package: `$$Token'");
|
||||
"Unknown package: `$$Token'");
|
||||
LYXERR(Debug::INFO) << "Reading encoding " << name << endl;
|
||||
encodinglist[name] = Encoding(name, latexname,
|
||||
iconvname, fixedwidth,
|
||||
package);
|
||||
iconvname, fixedwidth,
|
||||
package);
|
||||
if (lex.lex() != et_end)
|
||||
lex.printError("Encodings::read: "
|
||||
"missing end");
|
||||
|
@ -38,7 +38,7 @@ public:
|
||||
Encoding() {}
|
||||
///
|
||||
Encoding(std::string const & n, std::string const & l,
|
||||
std::string const & i, bool f, Package p);
|
||||
std::string const & i, bool f, Package p);
|
||||
///
|
||||
void init() const;
|
||||
///
|
||||
@ -108,7 +108,7 @@ public:
|
||||
/// \param encfile encodings definition file
|
||||
/// \param symbolsfile unicode->LaTeX mapping file
|
||||
void read(support::FileName const & encfile,
|
||||
support::FileName const & symbolsfile);
|
||||
support::FileName const & symbolsfile);
|
||||
/// Get encoding from LyX name \p name
|
||||
Encoding const * getFromLyXName(std::string const & name) const;
|
||||
/// Get encoding from LaTeX name \p name
|
||||
|
36
src/Font.cpp
36
src/Font.cpp
@ -510,21 +510,21 @@ docstring const Font::stateText(BufferParams * params) const
|
||||
os << lcolor.getGUIName(color()) << ", ";
|
||||
if (emph() != INHERIT)
|
||||
os << bformat(_("Emphasis %1$s, "),
|
||||
_(GUIMiscNames[emph()]));
|
||||
_(GUIMiscNames[emph()]));
|
||||
if (underbar() != INHERIT)
|
||||
os << bformat(_("Underline %1$s, "),
|
||||
_(GUIMiscNames[underbar()]));
|
||||
_(GUIMiscNames[underbar()]));
|
||||
if (noun() != INHERIT)
|
||||
os << bformat(_("Noun %1$s, "),
|
||||
_(GUIMiscNames[noun()]));
|
||||
_(GUIMiscNames[noun()]));
|
||||
if (bits == inherit)
|
||||
os << _("Default") << ", ";
|
||||
if (!params || (language() != params->language))
|
||||
os << bformat(_("Language: %1$s, "),
|
||||
_(language()->display()));
|
||||
_(language()->display()));
|
||||
if (number() != OFF)
|
||||
os << bformat(_(" Number %1$s"),
|
||||
_(GUIMiscNames[number()]));
|
||||
_(GUIMiscNames[number()]));
|
||||
return rtrim(os.str(), ", ");
|
||||
}
|
||||
|
||||
@ -740,9 +740,9 @@ void Font::lyxWriteChanges(Font const & orgfont,
|
||||
/// Writes the head of the LaTeX needed to impose this font
|
||||
// Returns number of chars written.
|
||||
int Font::latexWriteStartChanges(odocstream & os, BufferParams const & bparams,
|
||||
OutputParams const & runparams,
|
||||
Font const & base,
|
||||
Font const & prev) const
|
||||
OutputParams const & runparams,
|
||||
Font const & base,
|
||||
Font const & prev) const
|
||||
{
|
||||
bool env = false;
|
||||
|
||||
@ -752,7 +752,7 @@ int Font::latexWriteStartChanges(odocstream & os, BufferParams const & bparams,
|
||||
if (language()->lang() == "farsi") {
|
||||
os << "\\textFR{";
|
||||
count += 8;
|
||||
} else if (!isRightToLeft() &&
|
||||
} else if (!isRightToLeft() &&
|
||||
base.language()->lang() == "farsi") {
|
||||
os << "\\textLR{";
|
||||
count += 8;
|
||||
@ -788,11 +788,11 @@ int Font::latexWriteStartChanges(odocstream & os, BufferParams const & bparams,
|
||||
}
|
||||
|
||||
// When the current language is Hebrew, Arabic, or Farsi
|
||||
// the numbers are written Left-to-Right. ArabTeX package
|
||||
// the numbers are written Left-to-Right. ArabTeX package
|
||||
// reorders the number automatically but the packages used
|
||||
// for Hebrew and Farsi (Arabi) do not.
|
||||
if (number() == ON && prev.number() != ON
|
||||
&& (language()->lang() == "hebrew"
|
||||
if (number() == ON && prev.number() != ON
|
||||
&& (language()->lang() == "hebrew"
|
||||
|| language()->lang() == "farsi")) {
|
||||
os << "{\\beginL ";
|
||||
count += 9;
|
||||
@ -864,9 +864,9 @@ int Font::latexWriteStartChanges(odocstream & os, BufferParams const & bparams,
|
||||
// Returns number of chars written
|
||||
// This one corresponds to latexWriteStartChanges(). (Asger)
|
||||
int Font::latexWriteEndChanges(odocstream & os, BufferParams const & bparams,
|
||||
OutputParams const & runparams,
|
||||
Font const & base,
|
||||
Font const & next) const
|
||||
OutputParams const & runparams,
|
||||
Font const & base,
|
||||
Font const & next) const
|
||||
{
|
||||
int count = 0;
|
||||
bool env = false;
|
||||
@ -921,11 +921,11 @@ int Font::latexWriteEndChanges(odocstream & os, BufferParams const & bparams,
|
||||
}
|
||||
|
||||
// When the current language is Hebrew, Arabic, or Farsi
|
||||
// the numbers are written Left-to-Right. ArabTeX package
|
||||
// the numbers are written Left-to-Right. ArabTeX package
|
||||
// reorders the number automatically but the packages used
|
||||
// for Hebrew and Farsi (Arabi) do not.
|
||||
if (number() == ON && next.number() != ON
|
||||
&& (language()->lang() == "hebrew"
|
||||
if (number() == ON && next.number() != ON
|
||||
&& (language()->lang() == "hebrew"
|
||||
|| language()->lang() == "farsi")) {
|
||||
os << "\\endL}";
|
||||
count += 6;
|
||||
|
12
src/Font.h
12
src/Font.h
@ -298,18 +298,18 @@ public:
|
||||
font state active now.
|
||||
*/
|
||||
int latexWriteStartChanges(odocstream &, BufferParams const & bparams,
|
||||
OutputParams const & runparams,
|
||||
Font const & base,
|
||||
Font const & prev) const;
|
||||
OutputParams const & runparams,
|
||||
Font const & base,
|
||||
Font const & prev) const;
|
||||
|
||||
/** Writes the tail of the LaTeX needed to change to this font.
|
||||
Returns number of chars written. Base is the font state we want
|
||||
to achieve.
|
||||
*/
|
||||
int latexWriteEndChanges(odocstream &, BufferParams const & bparams,
|
||||
OutputParams const & runparams,
|
||||
Font const & base,
|
||||
Font const & next) const;
|
||||
OutputParams const & runparams,
|
||||
Font const & base,
|
||||
Font const & next) const;
|
||||
|
||||
|
||||
/// Build GUI description of font state
|
||||
|
@ -97,7 +97,7 @@ bool operator<(Format const & a, Format const & b)
|
||||
|
||||
Format::Format(string const & n, string const & e, string const & p,
|
||||
string const & s, string const & v, string const & ed,
|
||||
int flags)
|
||||
int flags)
|
||||
: name_(n), extension_(e), prettyname_(p), shortcut_(s), viewer_(v),
|
||||
editor_(ed), flags_(flags)
|
||||
{}
|
||||
@ -220,15 +220,15 @@ void Formats::add(string const & name)
|
||||
|
||||
void Formats::add(string const & name, string const & extension,
|
||||
string const & prettyname, string const & shortcut,
|
||||
string const & viewer, string const & editor,
|
||||
int flags)
|
||||
string const & viewer, string const & editor,
|
||||
int flags)
|
||||
{
|
||||
FormatList::iterator it =
|
||||
find_if(formatlist.begin(), formatlist.end(),
|
||||
FormatNamesEqual(name));
|
||||
if (it == formatlist.end())
|
||||
formatlist.push_back(Format(name, extension, prettyname,
|
||||
shortcut, viewer, editor, flags));
|
||||
shortcut, viewer, editor, flags));
|
||||
else
|
||||
*it = Format(name, extension, prettyname, shortcut, viewer,
|
||||
editor, flags);
|
||||
|
@ -142,9 +142,9 @@ public:
|
||||
void add(std::string const & name);
|
||||
///
|
||||
void add(std::string const & name, std::string const & extension,
|
||||
std::string const & prettyname, std::string const & shortcut,
|
||||
std::string const & viewer, std::string const & editor,
|
||||
int flags);
|
||||
std::string const & prettyname, std::string const & shortcut,
|
||||
std::string const & viewer, std::string const & editor,
|
||||
int flags);
|
||||
///
|
||||
void erase(std::string const & name);
|
||||
///
|
||||
|
@ -253,7 +253,7 @@ void KeyMap::defkey(KeySequence * seq, FuncRequest const & func, unsigned int r)
|
||||
it->func.origin = FuncRequest::KEYBOARD;
|
||||
return;
|
||||
} else if (!it->table.get()) {
|
||||
lyxerr << "Error: New binding for '"
|
||||
lyxerr << "Error: New binding for '"
|
||||
<< to_utf8(seq->print(false))
|
||||
<< "' is overriding old binding..."
|
||||
<< endl;
|
||||
|
@ -47,8 +47,8 @@ public:
|
||||
|
||||
/**
|
||||
* print all available keysyms
|
||||
* @param forgui true if the string should use translations and
|
||||
* special characters.
|
||||
* @param forgui true if the string should use translations and
|
||||
* special characters.
|
||||
*/
|
||||
docstring const print(bool forgui) const;
|
||||
|
||||
|
@ -63,8 +63,8 @@ public:
|
||||
|
||||
/**
|
||||
* Return the current sequence as a string.
|
||||
* @param forgui true if the string should use translations and
|
||||
* special characters.
|
||||
* @param forgui true if the string should use translations and
|
||||
* special characters.
|
||||
* @see parse()
|
||||
*/
|
||||
docstring const print(bool forgui) const;
|
||||
@ -72,8 +72,8 @@ public:
|
||||
/**
|
||||
* Return the current sequence and available options as
|
||||
* a string. No options are added if no curmap kb map exists.
|
||||
* @param forgui true if the string should use translations and
|
||||
* special characters.
|
||||
* @param forgui true if the string should use translations and
|
||||
* special characters.
|
||||
*/
|
||||
docstring const printOptions(bool forgui) const;
|
||||
|
||||
|
@ -229,7 +229,7 @@ int LaTeX::run(TeXErrors & terr)
|
||||
head.update();
|
||||
// Can't just check if anything has changed because it might
|
||||
// have aborted on error last time... in which cas we need
|
||||
// to re-run latex and collect the error messages
|
||||
// to re-run latex and collect the error messages
|
||||
// (even if they are the same).
|
||||
if (!fs::exists(output_file.toFilesystemEncoding())) {
|
||||
LYXERR(Debug::DEPEND)
|
||||
@ -293,7 +293,7 @@ int LaTeX::run(TeXErrors & terr)
|
||||
// A second latex run is needed.
|
||||
FileName const idxfile(changeExtension(file.absFilename(), ".idx"));
|
||||
rerun = fs::exists(idxfile.toFilesystemEncoding()) &&
|
||||
fs::is_empty(idxfile.toFilesystemEncoding());
|
||||
fs::is_empty(idxfile.toFilesystemEncoding());
|
||||
|
||||
// run makeindex
|
||||
if (head.haschanged(idxfile)) {
|
||||
@ -438,13 +438,13 @@ int LaTeX::startscript()
|
||||
|
||||
|
||||
bool LaTeX::runMakeIndex(string const & f, OutputParams const & runparams,
|
||||
string const & params)
|
||||
string const & params)
|
||||
{
|
||||
LYXERR(Debug::LATEX)
|
||||
<< "idx file has been made, running makeindex on file "
|
||||
<< f << endl;
|
||||
string tmp = lyxrc.index_command + ' ';
|
||||
|
||||
|
||||
tmp = subst(tmp, "$$lang", runparams.document_language);
|
||||
tmp += quoteName(f);
|
||||
tmp += params;
|
||||
@ -965,7 +965,7 @@ void LaTeX::deplog(DepTable & head)
|
||||
|
||||
// Sometimes, filenames are broken across lines.
|
||||
// We care for that and save suspicious lines.
|
||||
// Here we exclude some cases where we are sure
|
||||
// Here we exclude some cases where we are sure
|
||||
// that there is no continued filename
|
||||
if (!lastline.empty()) {
|
||||
static regex package_info("Package \\w+ Info: .*");
|
||||
@ -1035,7 +1035,7 @@ void LaTeX::deplog(DepTable & head)
|
||||
found_file = false;
|
||||
// (6) "Writing nomenclature file file.ext"
|
||||
} else if (regex_match(token, sub, regnomencl) ||
|
||||
regex_match(token, sub, regoldnomencl))
|
||||
regex_match(token, sub, regoldnomencl))
|
||||
// check for dot
|
||||
found_file = checkLineBreak(sub.str(1), head);
|
||||
// (7) "\tf@toc=\write<nr>" (for MikTeX)
|
||||
|
@ -169,11 +169,11 @@ private:
|
||||
|
||||
///
|
||||
bool runMakeIndex(std::string const &, OutputParams const &,
|
||||
std::string const & = std::string());
|
||||
std::string const & = std::string());
|
||||
|
||||
///
|
||||
bool runMakeIndexNomencl(support::FileName const &, OutputParams const &,
|
||||
std::string const &, std::string const &);
|
||||
std::string const &, std::string const &);
|
||||
|
||||
///
|
||||
std::vector<Aux_Info> const scanAuxFiles(support::FileName const &);
|
||||
|
@ -489,7 +489,7 @@ string const LaTeXFeatures::getPackages() const
|
||||
// shadecolor for shaded
|
||||
if (mustProvide("framed") && mustProvide("color")) {
|
||||
RGBColor c = RGBColor(lcolor.getX11Name(Color::shadedbg));
|
||||
packages << "\\definecolor{shadecolor}{rgb}{"
|
||||
packages << "\\definecolor{shadecolor}{rgb}{"
|
||||
<< c.r/255 << ',' << c.g/255 << ',' << c.b/255 << "}\n";
|
||||
}
|
||||
|
||||
@ -523,13 +523,13 @@ string const LaTeXFeatures::getPackages() const
|
||||
}
|
||||
|
||||
// amssymb.sty
|
||||
if (mustProvide("amssymb")
|
||||
if (mustProvide("amssymb")
|
||||
|| params_.use_amsmath == BufferParams::package_on)
|
||||
packages << "\\usepackage{amssymb}\n";
|
||||
|
||||
// esint must be after amsmath and wasysym, since it will redeclare
|
||||
// inconsistent integral symbols
|
||||
if (mustProvide("esint")
|
||||
if (mustProvide("esint")
|
||||
&& params_.use_esint != BufferParams::package_off)
|
||||
packages << "\\usepackage{esint}\n";
|
||||
|
||||
@ -568,15 +568,15 @@ string const LaTeXFeatures::getPackages() const
|
||||
// but don't use the compatibility option since it is
|
||||
// incompatible to other packages.
|
||||
packages << "\\usepackage{nomencl}\n"
|
||||
"% the following is useful when we have the old nomencl.sty package\n"
|
||||
"\\providecommand{\\printnomenclature}{\\printglossary}\n"
|
||||
"\\providecommand{\\makenomenclature}{\\makeglossary}\n"
|
||||
"\\makenomenclature\n";
|
||||
"% the following is useful when we have the old nomencl.sty package\n"
|
||||
"\\providecommand{\\printnomenclature}{\\printglossary}\n"
|
||||
"\\providecommand{\\makenomenclature}{\\makeglossary}\n"
|
||||
"\\makenomenclature\n";
|
||||
}
|
||||
|
||||
if (mustProvide("listings"))
|
||||
packages << "\\usepackage{listings}\n";
|
||||
|
||||
|
||||
return packages.str();
|
||||
}
|
||||
|
||||
@ -653,11 +653,11 @@ string const LaTeXFeatures::getMacros() const
|
||||
}
|
||||
if (mustProvide("ct-xcolor-soul")) {
|
||||
RGBColor cadd = RGBColor(lcolor.getX11Name(Color::addedtext));
|
||||
macros << "\\providecolor{lyxadded}{rgb}{"
|
||||
macros << "\\providecolor{lyxadded}{rgb}{"
|
||||
<< cadd.r/255 << ',' << cadd.g/255 << ',' << cadd.b/255 << "}\n";
|
||||
|
||||
RGBColor cdel = RGBColor(lcolor.getX11Name(Color::deletedtext));
|
||||
macros << "\\providecolor{lyxdeleted}{rgb}{"
|
||||
macros << "\\providecolor{lyxdeleted}{rgb}{"
|
||||
<< cdel.r/255 << ',' << cdel.g/255 << ',' << cdel.b/255 << "}\n";
|
||||
|
||||
macros << "\\newcommand{\\lyxadded}[3]{\\color{lyxadded}{#3}}\n"
|
||||
|
@ -110,7 +110,7 @@ bool operator==(Length const & l1, Length const & l2);
|
||||
///
|
||||
bool operator!=(Length const & l1, Length const & l2);
|
||||
/** Test whether \p data represents a valid length.
|
||||
*
|
||||
*
|
||||
* \returns whether \p data is a valid length
|
||||
* \param data Length in LyX format. Since the only difference between LyX
|
||||
* and LaTeX format is the representation of length variables as units (e.g.
|
||||
|
@ -417,7 +417,7 @@ bool Lexer::Pimpl::next(bool esc /* = false */)
|
||||
c = cc;
|
||||
|
||||
// skip ','s
|
||||
if (c == ',')
|
||||
if (c == ',')
|
||||
continue;
|
||||
|
||||
if (c == commentChar) {
|
||||
@ -525,7 +525,7 @@ int Lexer::Pimpl::search_kw(char const * const tag) const
|
||||
int Lexer::Pimpl::lex()
|
||||
{
|
||||
//NOTE: possible bug.
|
||||
if (next() && status == LEX_TOKEN)
|
||||
if (next() && status == LEX_TOKEN)
|
||||
return search_kw(getString().c_str());
|
||||
return status;
|
||||
}
|
||||
@ -619,7 +619,7 @@ bool Lexer::Pimpl::nextToken()
|
||||
|
||||
bool Lexer::Pimpl::inputAvailable()
|
||||
{
|
||||
return is.good();
|
||||
return is.good();
|
||||
}
|
||||
|
||||
|
||||
@ -771,7 +771,7 @@ string const Lexer::getString() const
|
||||
docstring const Lexer::getDocString() const
|
||||
{
|
||||
lastReadOk_ = pimpl_->status == LEX_DATA || pimpl_->status == LEX_TOKEN;
|
||||
|
||||
|
||||
if (lastReadOk_)
|
||||
return pimpl_->getDocString();
|
||||
|
||||
|
10
src/Lexer.h
10
src/Lexer.h
@ -37,10 +37,10 @@ struct keyword_item {
|
||||
};
|
||||
|
||||
/** Generalized simple lexical analizer.
|
||||
Use the method isOK() to check if there is still data available
|
||||
Use the method isOK() to check if there is still data available
|
||||
for lexing. Use one of the the operators void* or ! to test if
|
||||
the last reading operation was successful.
|
||||
|
||||
|
||||
Example:
|
||||
|
||||
int readParam(LyxLex &lex) {
|
||||
@ -51,7 +51,7 @@ struct keyword_item {
|
||||
if (lex) param = p; // only use the input if reading was successful
|
||||
}
|
||||
return param;
|
||||
}
|
||||
}
|
||||
|
||||
@see LyXRC.cpp for an example of usage.
|
||||
*/
|
||||
@ -76,11 +76,11 @@ public:
|
||||
|
||||
/// stream is open and end of stream is not reached
|
||||
/// FIXME: test also if pushTok is not empty
|
||||
/// FIXME: the method should be renamed to something like
|
||||
/// FIXME: the method should be renamed to something like
|
||||
/// dataAvailable(), in order to reflect the real behavior
|
||||
bool isOK() const;
|
||||
/// FIXME: The next two operators should be replaced by one method
|
||||
/// called e.g. lastReadOk(), in order to reflect the real
|
||||
/// called e.g. lastReadOk(), in order to reflect the real
|
||||
/// behavior
|
||||
/// last read operation was successful.
|
||||
operator void const *() const;
|
||||
|
42
src/LyX.cpp
42
src/LyX.cpp
@ -108,7 +108,7 @@ using std::system;
|
||||
|
||||
|
||||
/// are we using the GUI at all?
|
||||
/**
|
||||
/**
|
||||
* We default to true and this is changed to false when the export feature is used.
|
||||
*/
|
||||
bool use_gui = true;
|
||||
@ -148,7 +148,7 @@ void reconfigureUserLyXDir()
|
||||
|
||||
|
||||
/// The main application class private implementation.
|
||||
struct LyX::Singletons
|
||||
struct LyX::Singletons
|
||||
{
|
||||
Singletons()
|
||||
{
|
||||
@ -183,10 +183,10 @@ struct LyX::Singletons
|
||||
|
||||
// The system converters copy after reading lyxrc.defaults.
|
||||
Converters system_converters_;
|
||||
|
||||
|
||||
///
|
||||
Movers movers_;
|
||||
|
||||
|
||||
///
|
||||
Movers system_movers_;
|
||||
};
|
||||
@ -269,14 +269,14 @@ LyXFunc const & LyX::lyxFunc() const
|
||||
Server & LyX::server()
|
||||
{
|
||||
BOOST_ASSERT(pimpl_->lyx_server_.get());
|
||||
return *pimpl_->lyx_server_.get();
|
||||
return *pimpl_->lyx_server_.get();
|
||||
}
|
||||
|
||||
|
||||
Server const & LyX::server() const
|
||||
Server const & LyX::server() const
|
||||
{
|
||||
BOOST_ASSERT(pimpl_->lyx_server_.get());
|
||||
return *pimpl_->lyx_server_.get();
|
||||
return *pimpl_->lyx_server_.get();
|
||||
}
|
||||
|
||||
|
||||
@ -341,7 +341,7 @@ Messages & LyX::getMessages(std::string const & language)
|
||||
if (it != pimpl_->messages_.end())
|
||||
return it->second;
|
||||
|
||||
std::pair<map<string, Messages>::iterator, bool> result =
|
||||
std::pair<map<string, Messages>::iterator, bool> result =
|
||||
pimpl_->messages_.insert(std::make_pair(language, Messages(language)));
|
||||
|
||||
BOOST_ASSERT(result.second);
|
||||
@ -387,8 +387,8 @@ int LyX::exec(int & argc, char * argv[])
|
||||
easyParse(argc, argv);
|
||||
|
||||
try { support::init_package(to_utf8(from_local8bit(argv[0])),
|
||||
cl_system_support, cl_user_support,
|
||||
support::top_build_dir_is_one_level_up);
|
||||
cl_system_support, cl_user_support,
|
||||
support::top_build_dir_is_one_level_up);
|
||||
} catch (support::ExceptionMessage const & message) {
|
||||
if (message.type_ == support::ErrorException) {
|
||||
Alert::error(message.title_, message.details_);
|
||||
@ -421,7 +421,7 @@ int LyX::exec(int & argc, char * argv[])
|
||||
Buffer * buf = *I;
|
||||
bool success = false;
|
||||
buf->dispatch(batch_command, &success);
|
||||
final_success |= success;
|
||||
final_success |= success;
|
||||
}
|
||||
prepareExit();
|
||||
return !final_success;
|
||||
@ -456,12 +456,12 @@ int LyX::exec(int & argc, char * argv[])
|
||||
// Note: socket callback must be registered after init(argc, argv)
|
||||
// such that package().temp_dir() is properly initialized.
|
||||
pimpl_->lyx_server_.reset(new Server(&pimpl_->lyxfunc_, lyxrc.lyxpipes));
|
||||
pimpl_->lyx_socket_.reset(new ServerSocket(&pimpl_->lyxfunc_,
|
||||
pimpl_->lyx_socket_.reset(new ServerSocket(&pimpl_->lyxfunc_,
|
||||
FileName(package().temp_dir().absFilename() + "/lyxsocket")));
|
||||
|
||||
// Start the real execution loop.
|
||||
exit_status = pimpl_->application_->exec();
|
||||
|
||||
|
||||
prepareExit();
|
||||
|
||||
// Restore original font resources after Application is destroyed.
|
||||
@ -680,7 +680,7 @@ LyXView * LyX::newLyXView()
|
||||
posy = convert<int>(val);
|
||||
}
|
||||
|
||||
if (!geometryArg.empty())
|
||||
if (!geometryArg.empty())
|
||||
{
|
||||
width = 0;
|
||||
height = 0;
|
||||
@ -808,7 +808,7 @@ void LyX::initGuiFont()
|
||||
lyxrc.sans_font_name = pimpl_->application_->sansFontName();
|
||||
|
||||
if (lyxrc.typewriter_font_name.empty())
|
||||
lyxrc.typewriter_font_name
|
||||
lyxrc.typewriter_font_name
|
||||
= pimpl_->application_->typewriterFontName();
|
||||
}
|
||||
|
||||
@ -936,8 +936,8 @@ bool LyX::init()
|
||||
}
|
||||
|
||||
LYXERR(Debug::INIT) << "LyX tmp dir: `"
|
||||
<< package().temp_dir().absFilename()
|
||||
<< '\'' << endl;
|
||||
<< package().temp_dir().absFilename()
|
||||
<< '\'' << endl;
|
||||
|
||||
LYXERR(Debug::INIT) << "Reading session information '.lyx/session'..." << endl;
|
||||
pimpl_->session_.reset(new Session(lyxrc.num_lastfiles));
|
||||
@ -1170,7 +1170,7 @@ bool LyX::readUIFile(string const & name, bool include)
|
||||
|
||||
LYXERR(Debug::INIT) << "About to read " << name << "..." << endl;
|
||||
|
||||
|
||||
|
||||
FileName ui_path;
|
||||
if (include) {
|
||||
ui_path = libFileSearch("ui", name, "inc");
|
||||
@ -1180,7 +1180,7 @@ bool LyX::readUIFile(string const & name, bool include)
|
||||
}
|
||||
else
|
||||
ui_path = libFileSearch("ui", name, "ui");
|
||||
|
||||
|
||||
if (ui_path.empty()) {
|
||||
LYXERR(Debug::INIT) << "Could not find " << name << endl;
|
||||
showFileError(name);
|
||||
@ -1250,10 +1250,10 @@ bool LyX::readLanguagesFile(string const & name)
|
||||
|
||||
// Read the encodings file `name'
|
||||
bool LyX::readEncodingsFile(string const & enc_name,
|
||||
string const & symbols_name)
|
||||
string const & symbols_name)
|
||||
{
|
||||
LYXERR(Debug::INIT) << "About to read " << enc_name << " and "
|
||||
<< symbols_name << "..." << endl;
|
||||
<< symbols_name << "..." << endl;
|
||||
|
||||
FileName const symbols_path = libFileSearch(string(), symbols_name);
|
||||
if (symbols_path.empty()) {
|
||||
|
@ -83,7 +83,7 @@ public:
|
||||
///
|
||||
KeyMap & topLevelKeymap();
|
||||
KeyMap const & topLevelKeymap() const;
|
||||
|
||||
|
||||
///
|
||||
Converters & converters();
|
||||
Converters & systemConverters();
|
||||
@ -157,7 +157,7 @@ private:
|
||||
/// \param enc_name encodings definition file
|
||||
/// \param symbols_name unicode->LaTeX mapping file
|
||||
bool readEncodingsFile(std::string const & enc_name,
|
||||
std::string const & symbols_name);
|
||||
std::string const & symbols_name);
|
||||
/// parsing of non-gui LyX options.
|
||||
void easyParse(int & argc, char * argv[]);
|
||||
/// shows up a parsing error on screen
|
||||
|
@ -272,7 +272,7 @@ void LyXFunc::gotoBookmark(unsigned int idx, bool openFile, bool switchToBuffer)
|
||||
// see http://bugzilla.lyx.org/show_bug.cgi?id=3092
|
||||
if (bm.bottom_pit != new_pit || bm.bottom_pos != new_pos || bm.top_id != new_id )
|
||||
const_cast<BookmarksSection::Bookmark &>(bm).updatePos(new_pit, new_pos, new_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -893,7 +893,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
|
||||
menuWrite(lyx_view_->buffer());
|
||||
lyx_view_->message(str + _(" done."));
|
||||
} else {
|
||||
writeAs(lyx_view_->buffer());
|
||||
writeAs(lyx_view_->buffer());
|
||||
}
|
||||
updateFlags = Update::None;
|
||||
break;
|
||||
@ -1424,7 +1424,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
|
||||
// when the target is in the parent or another child document.
|
||||
lyx_view_->buffer()->setParentName(parentfilename);
|
||||
setMessage(bformat(_("Opening child document %1$s..."),
|
||||
makeDisplayPath(filename.absFilename())));
|
||||
makeDisplayPath(filename.absFilename())));
|
||||
} else
|
||||
setMessage(_("Document not loaded."));
|
||||
break;
|
||||
@ -1483,8 +1483,8 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
|
||||
|
||||
case LFUN_PREFERENCES_SAVE: {
|
||||
lyxrc.write(makeAbsPath("preferences",
|
||||
package().user_support().absFilename()),
|
||||
false);
|
||||
package().user_support().absFilename()),
|
||||
false);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1628,7 +1628,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
|
||||
|
||||
if (defaults.writeFile(FileName(defaults.fileName())))
|
||||
setMessage(bformat(_("Document defaults saved in %1$s"),
|
||||
makeDisplayPath(fname)));
|
||||
makeDisplayPath(fname)));
|
||||
else
|
||||
setErrorMessage(from_ascii(N_("Unable to save document defaults")));
|
||||
break;
|
||||
|
@ -77,7 +77,7 @@ public:
|
||||
void handleKeyFunc(kb_action action);
|
||||
/// goto a bookmark
|
||||
/// openFile: whether or not open a file if the file is not opened
|
||||
/// switchToBuffer: whether or not switch to buffer if the buffer is
|
||||
/// switchToBuffer: whether or not switch to buffer if the buffer is
|
||||
/// not the current buffer
|
||||
void gotoBookmark(unsigned int idx, bool openFile, bool switchToBuffer);
|
||||
|
||||
|
@ -1086,7 +1086,7 @@ int LyXRC::read(Lexer & lexrc)
|
||||
}
|
||||
} else {
|
||||
formats.add(format, extension, prettyname,
|
||||
shortcut, viewer, editor, flgs);
|
||||
shortcut, viewer, editor, flgs);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ namespace support { class FileName; }
|
||||
class Lexer;
|
||||
|
||||
/// This contains the runtime configuration of LyX
|
||||
class LyXRC //: public noncopyable
|
||||
class LyXRC //: public noncopyable
|
||||
// after 1.1.6 I will use a LyXRCStruct here and then this can be made
|
||||
// noncopyable again. For now I want to minimise changes. ARRae 20001010
|
||||
{
|
||||
|
@ -486,7 +486,7 @@ void expandBookmarks(Menu & tomenu)
|
||||
docstring const label = convert<docstring>(i) + ". "
|
||||
+ makeDisplayPath(bm.bookmark(i).filename.absFilename(), 20)
|
||||
+ char_type('|') + convert<docstring>(i);
|
||||
tomenu.add(MenuItem(MenuItem::Command, label, FuncRequest(LFUN_BOOKMARK_GOTO,
|
||||
tomenu.add(MenuItem(MenuItem::Command, label, FuncRequest(LFUN_BOOKMARK_GOTO,
|
||||
convert<docstring>(i))));
|
||||
}
|
||||
}
|
||||
@ -792,10 +792,10 @@ void expandToolbars(Menu & tomenu)
|
||||
// frontends are not supposed to turn on/off toolbars, if they cannot
|
||||
// update ToolbarBackend::flags. That is to say, ToolbarsBackend::flags
|
||||
// should reflect the true state of toolbars.
|
||||
//
|
||||
// menu is displayed as
|
||||
//
|
||||
// menu is displayed as
|
||||
// on/off review
|
||||
// and
|
||||
// and
|
||||
// review (auto)
|
||||
// in the case of auto.
|
||||
if (cit->flags & ToolbarInfo::AUTO)
|
||||
|
@ -111,7 +111,7 @@ public:
|
||||
/// returns the status of the lfun associated with this entry
|
||||
void status(FuncStatus const & status) { status_ = status; }
|
||||
/**
|
||||
* returns the binding associated to this action.
|
||||
* returns the binding associated to this action.
|
||||
* Use the native UI format when \c forgui is true.
|
||||
*/
|
||||
docstring const binding(bool forgui) const;
|
||||
|
@ -166,7 +166,7 @@ docstring const Messages::get(string const & m) const
|
||||
#endif
|
||||
setlocale(LC_CTYPE, oldCTYPE.c_str());
|
||||
|
||||
std::pair<TranslationCache::iterator, bool> result =
|
||||
std::pair<TranslationCache::iterator, bool> result =
|
||||
cache_.insert(std::make_pair(m, translated));
|
||||
|
||||
BOOST_ASSERT(result.second);
|
||||
|
@ -29,7 +29,7 @@ public:
|
||||
private:
|
||||
///
|
||||
std::string lang_;
|
||||
/// Did we warn about unavailable locale already?
|
||||
/// Did we warn about unavailable locale already?
|
||||
mutable bool warned_;
|
||||
///
|
||||
typedef std::map<std::string, docstring> TranslationCache;
|
||||
|
@ -28,7 +28,7 @@ namespace lyx {
|
||||
using support::quoteName;
|
||||
|
||||
bool Mover::copy(support::FileName const & from, support::FileName const & to,
|
||||
unsigned long int mode) const
|
||||
unsigned long int mode) const
|
||||
{
|
||||
return do_copy(from, to, to.absFilename(), mode);
|
||||
}
|
||||
@ -42,7 +42,7 @@ bool Mover::do_copy(support::FileName const & from, support::FileName const & to
|
||||
|
||||
|
||||
bool Mover::rename(support::FileName const & from,
|
||||
support::FileName const & to) const
|
||||
support::FileName const & to) const
|
||||
{
|
||||
return do_rename(from, to, to.absFilename());
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ public:
|
||||
protected:
|
||||
virtual bool
|
||||
do_copy(support::FileName const & from, support::FileName const & to,
|
||||
std::string const &, unsigned long int mode) const;
|
||||
std::string const &, unsigned long int mode) const;
|
||||
|
||||
virtual bool
|
||||
do_rename(support::FileName const & from, support::FileName const & to,
|
||||
@ -131,7 +131,7 @@ public:
|
||||
private:
|
||||
virtual bool
|
||||
do_copy(support::FileName const & from, support::FileName const & to,
|
||||
std::string const & latex, unsigned long int mode) const;
|
||||
std::string const & latex, unsigned long int mode) const;
|
||||
|
||||
virtual bool
|
||||
do_rename(support::FileName const & from, support::FileName const & to,
|
||||
|
@ -77,7 +77,7 @@ public:
|
||||
copy (e.g. in insets): \code
|
||||
int InsetFoo::latex(..., OutputParams const & runparams_in) const
|
||||
{
|
||||
OutputParams runparams(runparams_in);
|
||||
OutputParams runparams(runparams_in);
|
||||
runparams.inComment = true;
|
||||
...
|
||||
InsetBla::latex(..., runparams);
|
||||
@ -120,18 +120,18 @@ public:
|
||||
*/
|
||||
bool inComment;
|
||||
|
||||
/** allow output of only part of the top-level paragraphs
|
||||
/** allow output of only part of the top-level paragraphs
|
||||
* par_begin: beginning paragraph
|
||||
*/
|
||||
pit_type par_begin;
|
||||
|
||||
/** allow output of only part of the top-level paragraphs
|
||||
/** allow output of only part of the top-level paragraphs
|
||||
* par_end: par_end-1 is the ending paragraph
|
||||
* if par_begin=par_end, output all paragraphs
|
||||
*/
|
||||
pit_type par_end;
|
||||
|
||||
/** whether or not do actual file copying and image conversion
|
||||
/** whether or not do actual file copying and image conversion
|
||||
* This mode will be used to preview the source code
|
||||
*/
|
||||
bool dryrun;
|
||||
|
@ -176,21 +176,21 @@ public:
|
||||
/// Output the surrogate pair formed by \p c and \p next to \p os.
|
||||
/// \return the number of characters written.
|
||||
int latexSurrogatePair(odocstream & os, value_type c, value_type next,
|
||||
Encoding const &);
|
||||
Encoding const &);
|
||||
/// Output a space in appropriate formatting (or a surrogate pair
|
||||
/// if the next character is a combining character).
|
||||
/// \return whether a surrogate pair was output.
|
||||
bool simpleTeXBlanks(Encoding const &,
|
||||
odocstream &, TexRow & texrow,
|
||||
odocstream &, TexRow & texrow,
|
||||
pos_type & i,
|
||||
unsigned int & column,
|
||||
Font const & font,
|
||||
Layout const & style);
|
||||
///
|
||||
void simpleTeXSpecialChars(Buffer const &, BufferParams const &,
|
||||
odocstream &,
|
||||
TexRow & texrow, OutputParams const &,
|
||||
Font & running_font,
|
||||
odocstream &,
|
||||
TexRow & texrow, OutputParams const &,
|
||||
Font & running_font,
|
||||
Font & basefont,
|
||||
Font const & outerfont,
|
||||
bool & open_font,
|
||||
@ -445,7 +445,7 @@ void Paragraph::Pimpl::insertChar(pos_type pos, value_type c, Change const & cha
|
||||
|
||||
// Update the font table.
|
||||
FontTable search_font(pos, Font());
|
||||
for (FontList::iterator it
|
||||
for (FontList::iterator it
|
||||
= lower_bound(fontlist.begin(), fontlist.end(), search_font, matchFT());
|
||||
it != fontlist.end(); ++it)
|
||||
{
|
||||
@ -458,7 +458,7 @@ void Paragraph::Pimpl::insertChar(pos_type pos, value_type c, Change const & cha
|
||||
|
||||
|
||||
void Paragraph::Pimpl::insertInset(pos_type pos, Inset * inset,
|
||||
Change const & change)
|
||||
Change const & change)
|
||||
{
|
||||
BOOST_ASSERT(inset);
|
||||
BOOST_ASSERT(pos >= 0 && pos <= size());
|
||||
@ -480,7 +480,7 @@ bool Paragraph::Pimpl::eraseChar(pos_type pos, bool trackChanges)
|
||||
if (trackChanges) {
|
||||
Change change = changes_.lookup(pos);
|
||||
|
||||
// set the character to DELETED if
|
||||
// set the character to DELETED if
|
||||
// a) it was previously unchanged or
|
||||
// b) it was inserted by a co-author
|
||||
|
||||
@ -580,8 +580,8 @@ int Paragraph::Pimpl::latexSurrogatePair(odocstream & os, value_type c,
|
||||
|
||||
|
||||
bool Paragraph::Pimpl::simpleTeXBlanks(Encoding const & encoding,
|
||||
odocstream & os, TexRow & texrow,
|
||||
pos_type & i,
|
||||
odocstream & os, TexRow & texrow,
|
||||
pos_type & i,
|
||||
unsigned int & column,
|
||||
Font const & font,
|
||||
Layout const & style)
|
||||
@ -1204,7 +1204,7 @@ int Paragraph::eraseChars(pos_type start, pos_type end, bool trackChanges)
|
||||
|
||||
|
||||
void Paragraph::insert(pos_type start, docstring const & str,
|
||||
Font const & font, Change const & change)
|
||||
Font const & font, Change const & change)
|
||||
{
|
||||
for (size_t i = 0, n = str.size(); i != n ; ++i)
|
||||
insertChar(start + i, str[i], font, change);
|
||||
@ -1212,24 +1212,24 @@ void Paragraph::insert(pos_type start, docstring const & str,
|
||||
|
||||
|
||||
void Paragraph::insertChar(pos_type pos, Paragraph::value_type c,
|
||||
bool trackChanges)
|
||||
bool trackChanges)
|
||||
{
|
||||
pimpl_->insertChar(pos, c, Change(trackChanges ?
|
||||
Change::INSERTED : Change::UNCHANGED));
|
||||
Change::INSERTED : Change::UNCHANGED));
|
||||
}
|
||||
|
||||
|
||||
void Paragraph::insertChar(pos_type pos, Paragraph::value_type c,
|
||||
Font const & font, bool trackChanges)
|
||||
Font const & font, bool trackChanges)
|
||||
{
|
||||
pimpl_->insertChar(pos, c, Change(trackChanges ?
|
||||
Change::INSERTED : Change::UNCHANGED));
|
||||
Change::INSERTED : Change::UNCHANGED));
|
||||
setFont(pos, font);
|
||||
}
|
||||
|
||||
|
||||
void Paragraph::insertChar(pos_type pos, Paragraph::value_type c,
|
||||
Font const & font, Change const & change)
|
||||
Font const & font, Change const & change)
|
||||
{
|
||||
pimpl_->insertChar(pos, c, change);
|
||||
setFont(pos, font);
|
||||
@ -1237,14 +1237,14 @@ void Paragraph::insertChar(pos_type pos, Paragraph::value_type c,
|
||||
|
||||
|
||||
void Paragraph::insertInset(pos_type pos, Inset * inset,
|
||||
Change const & change)
|
||||
Change const & change)
|
||||
{
|
||||
pimpl_->insertInset(pos, inset, change);
|
||||
}
|
||||
|
||||
|
||||
void Paragraph::insertInset(pos_type pos, Inset * inset,
|
||||
Font const & font, Change const & change)
|
||||
Font const & font, Change const & change)
|
||||
{
|
||||
pimpl_->insertInset(pos, inset, change);
|
||||
setFont(pos, font);
|
||||
@ -1765,7 +1765,7 @@ void adjust_row_column(string const & str, TexRow & texrow, int & column)
|
||||
|
||||
// This could go to ParagraphParameters if we want to
|
||||
int Paragraph::startTeXParParams(BufferParams const & bparams,
|
||||
odocstream & os, TexRow & texrow,
|
||||
odocstream & os, TexRow & texrow,
|
||||
bool moving_arg) const
|
||||
{
|
||||
int column = 0;
|
||||
@ -1829,8 +1829,8 @@ int Paragraph::startTeXParParams(BufferParams const & bparams,
|
||||
|
||||
|
||||
// This could go to ParagraphParameters if we want to
|
||||
int Paragraph::endTeXParParams(BufferParams const & bparams,
|
||||
odocstream & os, TexRow & texrow,
|
||||
int Paragraph::endTeXParParams(BufferParams const & bparams,
|
||||
odocstream & os, TexRow & texrow,
|
||||
bool moving_arg) const
|
||||
{
|
||||
int column = 0;
|
||||
@ -1982,7 +1982,7 @@ bool Paragraph::simpleTeXOnePar(Buffer const & buf,
|
||||
}
|
||||
|
||||
if (!asdefault)
|
||||
column += startTeXParParams(bparams, os,
|
||||
column += startTeXParParams(bparams, os,
|
||||
texrow,
|
||||
runparams.moving_arg);
|
||||
}
|
||||
@ -2009,7 +2009,7 @@ bool Paragraph::simpleTeXOnePar(Buffer const & buf,
|
||||
}
|
||||
|
||||
++column;
|
||||
|
||||
|
||||
value_type const c = getChar(i);
|
||||
|
||||
// Fully instantiated font
|
||||
@ -2047,8 +2047,8 @@ bool Paragraph::simpleTeXOnePar(Buffer const & buf,
|
||||
i != body_pos - 1)
|
||||
{
|
||||
column += font.latexWriteStartChanges(os, bparams,
|
||||
runparams, basefont,
|
||||
last_font);
|
||||
runparams, basefont,
|
||||
last_font);
|
||||
running_font = font;
|
||||
open_font = true;
|
||||
}
|
||||
@ -2114,7 +2114,7 @@ bool Paragraph::simpleTeXOnePar(Buffer const & buf,
|
||||
}
|
||||
|
||||
if (!asdefault) {
|
||||
column += endTeXParParams(bparams, os, texrow,
|
||||
column += endTeXParParams(bparams, os, texrow,
|
||||
runparams.moving_arg);
|
||||
}
|
||||
|
||||
@ -2220,7 +2220,7 @@ pos_type Paragraph::getFirstWord(Buffer const & buf, odocstream & os, OutputPara
|
||||
if (c == ' ')
|
||||
break;
|
||||
os << sgml::escapeChar(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
@ -2280,9 +2280,9 @@ void Paragraph::simpleDocBookOnePar(Buffer const & buf,
|
||||
value_type c = getChar(i);
|
||||
|
||||
if (style->pass_thru)
|
||||
os.put(c);
|
||||
os.put(c);
|
||||
else
|
||||
os << sgml::escapeChar(c);
|
||||
os << sgml::escapeChar(c);
|
||||
}
|
||||
font_old = font;
|
||||
}
|
||||
@ -2595,7 +2595,7 @@ bool Paragraph::hfillExpansion(Row const & row, pos_type pos) const
|
||||
int Paragraph::checkBiblio(bool track_changes)
|
||||
{
|
||||
//FIXME From JS:
|
||||
//This is getting more and more a mess. ...We really should clean
|
||||
//This is getting more and more a mess. ...We really should clean
|
||||
//up this bibitem issue for 1.6. See also bug 2743.
|
||||
|
||||
// Add bibitem insets if necessary
|
||||
@ -2633,18 +2633,18 @@ int Paragraph::checkBiblio(bool track_changes)
|
||||
//have to erase one.
|
||||
if (hasbibitem && erasedInsetPosition < 0)
|
||||
return 0;
|
||||
|
||||
//There was an InsetBibitem at the beginning and we did have to
|
||||
|
||||
//There was an InsetBibitem at the beginning and we did have to
|
||||
//erase one. So we give its properties to the beginning inset.
|
||||
if (hasbibitem) {
|
||||
InsetBibitem * inset =
|
||||
InsetBibitem * inset =
|
||||
static_cast<InsetBibitem *>(insetlist.begin()->inset);
|
||||
if (!oldkey.empty())
|
||||
inset->setParam("key", oldkey);
|
||||
inset->setParam("label", oldlabel);
|
||||
return -erasedInsetPosition;
|
||||
}
|
||||
|
||||
|
||||
//There was no inset at the beginning, so we need to create one with
|
||||
//the key and label of the one we erased.
|
||||
InsetBibitem * inset(new InsetBibitem(InsetCommandParams("bibitem")));
|
||||
|
@ -115,11 +115,11 @@ public:
|
||||
void validate(LaTeXFeatures &) const;
|
||||
|
||||
///
|
||||
int startTeXParParams(BufferParams const &, odocstream &, TexRow &,
|
||||
int startTeXParParams(BufferParams const &, odocstream &, TexRow &,
|
||||
bool) const;
|
||||
|
||||
///
|
||||
int endTeXParParams(BufferParams const &, odocstream &, TexRow &,
|
||||
int endTeXParParams(BufferParams const &, odocstream &, TexRow &,
|
||||
bool) const;
|
||||
|
||||
|
||||
@ -293,21 +293,21 @@ public:
|
||||
pos_type endpos, Font_size def_size) const;
|
||||
///
|
||||
void insert(pos_type pos, docstring const & str,
|
||||
Font const & font, Change const & change);
|
||||
Font const & font, Change const & change);
|
||||
///
|
||||
void insertChar(pos_type pos, value_type c, bool trackChanges);
|
||||
///
|
||||
void insertChar(pos_type pos, value_type c,
|
||||
Font const &, bool trackChanges);
|
||||
Font const &, bool trackChanges);
|
||||
///
|
||||
void insertChar(pos_type pos, value_type c,
|
||||
Font const &, Change const & change);
|
||||
Font const &, Change const & change);
|
||||
///
|
||||
void insertInset(pos_type pos, Inset * inset,
|
||||
Change const & change);
|
||||
Change const & change);
|
||||
///
|
||||
void insertInset(pos_type pos, Inset * inset,
|
||||
Font const &, Change const & change);
|
||||
Font const &, Change const & change);
|
||||
///
|
||||
bool insetAllowed(Inset_code code);
|
||||
///
|
||||
@ -341,7 +341,7 @@ public:
|
||||
/// returns -1 if inset not found
|
||||
int getPositionOfInset(Inset const * inset) const;
|
||||
|
||||
/// returns true if at least one line break or line separator has been deleted
|
||||
/// returns true if at least one line break or line separator has been deleted
|
||||
/// at the beginning of the paragraph (either physically or logically)
|
||||
bool stripLeadingSpaces(bool trackChanges);
|
||||
|
||||
|
@ -68,7 +68,7 @@ public:
|
||||
/// The painter and others use this
|
||||
RowList const & rows() const { return rows_; }
|
||||
/// The painter and others use this
|
||||
std::vector<bool> const & rowChangeStatus() const
|
||||
std::vector<bool> const & rowChangeStatus() const
|
||||
{ return row_change_status_; }
|
||||
///
|
||||
void updateRowChangeStatus();
|
||||
|
@ -73,7 +73,7 @@ public:
|
||||
// bool duplex;
|
||||
|
||||
/** Test that all the fields contain valid entries. It's unlikely
|
||||
that the internal code will get this wrong however new ports
|
||||
that the internal code will get this wrong however new ports
|
||||
and external scripts might drive the wrong values in.
|
||||
*/
|
||||
void testInvariant() const;
|
||||
|
@ -145,4 +145,4 @@ extern Server & theServer();
|
||||
|
||||
} // namespace lyx
|
||||
|
||||
#endif // SERVER_H
|
||||
#endif // SERVER_H
|
||||
|
@ -75,14 +75,14 @@ void LastFilesSection::read(istream & is)
|
||||
getline(is, tmp);
|
||||
if (tmp == "" || tmp[0] == '#' || tmp[0] == ' ' || !absolutePath(tmp))
|
||||
continue;
|
||||
|
||||
|
||||
// read lastfiles
|
||||
FileName const file(tmp);
|
||||
if (fs::exists(file.toFilesystemEncoding()) &&
|
||||
!fs::is_directory(file.toFilesystemEncoding()) &&
|
||||
lastfiles.size() < num_lastfiles)
|
||||
lastfiles.push_back(file);
|
||||
else
|
||||
else
|
||||
LYXERR(Debug::INIT) << "LyX: Warning: Ignore last file: " << tmp << endl;
|
||||
} while (is.good());
|
||||
}
|
||||
@ -344,7 +344,7 @@ void ToolbarSection::read(istream & is)
|
||||
value >> posx;
|
||||
value >> posy;
|
||||
toolbars.push_back(boost::make_tuple(key, ToolbarInfo(state, location, posx, posy)));
|
||||
} else
|
||||
} else
|
||||
LYXERR(Debug::INIT) << "LyX: Warning: Ignore toolbar info: " << tmp << endl;
|
||||
} catch (...) {
|
||||
LYXERR(Debug::INIT) << "LyX: Warning: unknown Toolbar info: " << tmp << endl;
|
||||
|
@ -182,7 +182,7 @@ public:
|
||||
/// top_id is determined when a bookmark is restored from session; and
|
||||
/// bottom_pit and bottom_pos are determined from top_id when a bookmark
|
||||
/// is save to session. (What a mess! :-)
|
||||
///
|
||||
///
|
||||
/// TODO: bottom level pit and pos will be replaced by StableDocIterator
|
||||
class Bookmark {
|
||||
public:
|
||||
@ -203,7 +203,7 @@ public:
|
||||
: filename(f), bottom_pit(pit), bottom_pos(pos), top_id(id), top_pos(tpos) {}
|
||||
/// set bookmark top_id, this is because newly loaded bookmark
|
||||
/// may have zero par_id and par_pit can change during editing, see bug 3092
|
||||
void updatePos(pit_type pit, pos_type pos, int id) {
|
||||
void updatePos(pit_type pit, pos_type pos, int id) {
|
||||
bottom_pit = pit;
|
||||
bottom_pos = pos;
|
||||
top_id = id;
|
||||
@ -269,7 +269,7 @@ public:
|
||||
state(ON), location(NOTSET), posx(0), posy(0) { }
|
||||
///
|
||||
ToolbarInfo(int s, int loc, int x=0, int y=0) :
|
||||
state(static_cast<State>(s)),
|
||||
state(static_cast<State>(s)),
|
||||
location(static_cast<Location>(loc)),
|
||||
posx(x),
|
||||
posy(y)
|
||||
@ -301,7 +301,7 @@ public:
|
||||
|
||||
/// y-position of the toolbar
|
||||
int posy;
|
||||
|
||||
|
||||
/// potentially, icons
|
||||
};
|
||||
|
||||
@ -386,7 +386,7 @@ public:
|
||||
|
||||
///
|
||||
LastFilesSection & lastFiles() { return last_files; }
|
||||
|
||||
|
||||
///
|
||||
LastFilesSection const & lastFiles() const { return last_files; }
|
||||
|
||||
@ -395,10 +395,10 @@ public:
|
||||
|
||||
///
|
||||
LastOpenedSection const & lastOpened() const { return last_opened; }
|
||||
|
||||
|
||||
///
|
||||
LastFilePosSection & lastFilePos() { return last_file_pos; }
|
||||
|
||||
|
||||
///
|
||||
LastFilePosSection const & lastFilePos() const { return last_file_pos; }
|
||||
|
||||
|
38
src/Text.cpp
38
src/Text.cpp
@ -858,7 +858,7 @@ void Text::acceptOrRejectChanges(Cursor & cur, ChangeOp op)
|
||||
bool endsBeforeEndOfPar = (endPos < pars_[endPit].size());
|
||||
|
||||
// first, accept/reject changes within each individual paragraph (do not consider end-of-par)
|
||||
|
||||
|
||||
for (pit_type pit = begPit; pit <= endPit; ++pit) {
|
||||
pos_type parSize = pars_[pit].size();
|
||||
|
||||
@ -872,7 +872,7 @@ void Text::acceptOrRejectChanges(Cursor & cur, ChangeOp op)
|
||||
continue;
|
||||
|
||||
// do not consider last paragraph if the cursor ends at pos 0
|
||||
if (pit == endPit && endPos == 0)
|
||||
if (pit == endPit && endPos == 0)
|
||||
break; // last iteration anyway
|
||||
|
||||
pos_type left = (pit == begPit ? begPos : 0);
|
||||
@ -884,9 +884,9 @@ void Text::acceptOrRejectChanges(Cursor & cur, ChangeOp op)
|
||||
pars_[pit].rejectChanges(cur.buffer().params(), left, right);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// next, accept/reject imaginary end-of-par characters
|
||||
|
||||
|
||||
for (pit_type pit = begPit; pit <= endPit; ++pit) {
|
||||
pos_type pos = pars_[pit].size();
|
||||
|
||||
@ -933,7 +933,7 @@ void Text::acceptOrRejectChanges(Cursor & cur, ChangeOp op)
|
||||
|
||||
deleteEmptyParagraphMechanism(begPit, endPit, cur.buffer().params().trackChanges);
|
||||
|
||||
//
|
||||
//
|
||||
|
||||
finishUndo();
|
||||
cur.clearSelection();
|
||||
@ -945,12 +945,12 @@ void Text::acceptOrRejectChanges(Cursor & cur, ChangeOp op)
|
||||
|
||||
void Text::acceptChanges(BufferParams const & bparams)
|
||||
{
|
||||
pit_type pars_size = static_cast<pit_type>(pars_.size());
|
||||
pit_type pars_size = static_cast<pit_type>(pars_.size());
|
||||
|
||||
// first, accept changes within each individual paragraph
|
||||
// (do not consider end-of-par)
|
||||
for (pit_type pit = 0; pit < pars_size; ++pit) {
|
||||
if (!pars_[pit].empty()) // prevent assertion failure
|
||||
if (!pars_[pit].empty()) // prevent assertion failure
|
||||
pars_[pit].acceptChanges(bparams, 0, pars_[pit].size());
|
||||
}
|
||||
|
||||
@ -983,9 +983,9 @@ void Text::rejectChanges(BufferParams const & bparams)
|
||||
pit_type pars_size = static_cast<pit_type>(pars_.size());
|
||||
|
||||
// first, reject changes within each individual paragraph
|
||||
// (do not consider end-of-par)
|
||||
// (do not consider end-of-par)
|
||||
for (pit_type pit = 0; pit < pars_size; ++pit) {
|
||||
if (!pars_[pit].empty()) // prevent assertion failure
|
||||
if (!pars_[pit].empty()) // prevent assertion failure
|
||||
pars_[pit].rejectChanges(bparams, 0, pars_[pit].size());
|
||||
}
|
||||
|
||||
@ -1102,7 +1102,7 @@ void Text::changeCase(Cursor & cur, Text::TextCase action)
|
||||
pos_type pos = (pit == begPit ? begPos : 0);
|
||||
right = (pit == endPit ? endPos : parSize);
|
||||
|
||||
// process sequences of modified characters; in change
|
||||
// process sequences of modified characters; in change
|
||||
// tracking mode, this approach results in much better
|
||||
// usability than changing case on a char-by-char basis
|
||||
docstring changes;
|
||||
@ -1240,7 +1240,7 @@ bool Text::erase(Cursor & cur)
|
||||
cur.text()->setCursor(cur.top(), cur.pit(), cur.pos());
|
||||
checkBufferStructure(cur.buffer(), cur);
|
||||
}
|
||||
|
||||
|
||||
return needsUpdate;
|
||||
}
|
||||
|
||||
@ -1263,14 +1263,14 @@ bool Text::backspacePos0(Cursor & cur)
|
||||
Paragraph const & prevpar = prevcur.paragraph();
|
||||
|
||||
// is it an empty paragraph?
|
||||
if (cur.lastpos() == 0
|
||||
if (cur.lastpos() == 0
|
||||
|| (cur.lastpos() == 1 && par.isSeparator(0))) {
|
||||
recordUndo(cur, Undo::ATOMIC, prevcur.pit(), cur.pit());
|
||||
plist.erase(boost::next(plist.begin(), cur.pit()));
|
||||
needsUpdate = true;
|
||||
}
|
||||
// is previous par empty?
|
||||
else if (prevcur.lastpos() == 0
|
||||
else if (prevcur.lastpos() == 0
|
||||
|| (prevcur.lastpos() == 1 && prevpar.isSeparator(0))) {
|
||||
recordUndo(cur, Undo::ATOMIC, prevcur.pit(), cur.pit());
|
||||
plist.erase(boost::next(plist.begin(), prevcur.pit()));
|
||||
@ -1853,7 +1853,7 @@ docstring Text::getPossibleLabel(Cursor & cur) const
|
||||
// types of insets and take our abbreviation from them.
|
||||
if (name.empty()) {
|
||||
Inset::Code const codes[] = {
|
||||
Inset::FLOAT_CODE,
|
||||
Inset::FLOAT_CODE,
|
||||
Inset::WRAP_CODE,
|
||||
Inset::FOOT_CODE
|
||||
};
|
||||
@ -1865,7 +1865,7 @@ docstring Text::getPossibleLabel(Cursor & cur) const
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Create a correct prefix for prettyref
|
||||
if (name == "theorem")
|
||||
name = from_ascii("thm");
|
||||
@ -1873,7 +1873,7 @@ docstring Text::getPossibleLabel(Cursor & cur) const
|
||||
name = from_ascii("fn");
|
||||
else if (name == "listing")
|
||||
name = from_ascii("lst");
|
||||
|
||||
|
||||
if (!name.empty())
|
||||
text = name.substr(0, 3) + ':' + text;
|
||||
|
||||
@ -1916,7 +1916,7 @@ void Text::setCursorFromCoordinates(Cursor & cur, int const x, int const y)
|
||||
|
||||
bool bound = false;
|
||||
int xx = x;
|
||||
pos_type const pos = row.pos()
|
||||
pos_type const pos = row.pos()
|
||||
+ tm.getColumnNearX(pit, row, xx, bound);
|
||||
|
||||
LYXERR(Debug::DEBUG)
|
||||
@ -1943,7 +1943,7 @@ void Text::charsTranspose(Cursor & cur)
|
||||
|
||||
Paragraph & par = cur.paragraph();
|
||||
|
||||
// Get the positions of the characters to be transposed.
|
||||
// Get the positions of the characters to be transposed.
|
||||
pos_type pos1 = pos - 1;
|
||||
pos_type pos2 = pos;
|
||||
|
||||
@ -1966,7 +1966,7 @@ void Text::charsTranspose(Cursor & cur)
|
||||
char_type char1 = par.getChar(pos1);
|
||||
Font const font1 =
|
||||
par.getFontSettings(cur.buffer().params(), pos1);
|
||||
|
||||
|
||||
char_type char2 = par.getChar(pos2);
|
||||
Font const font2 =
|
||||
par.getFontSettings(cur.buffer().params(), pos2);
|
||||
|
@ -165,7 +165,7 @@ public:
|
||||
/// just selects the word the cursor is in
|
||||
void selectWord(Cursor & cur, word_location loc);
|
||||
|
||||
/// what type of change operation to make
|
||||
/// what type of change operation to make
|
||||
enum ChangeOp {
|
||||
ACCEPT,
|
||||
REJECT
|
||||
@ -207,7 +207,7 @@ public:
|
||||
/// FIXME: cleanup to use BufferView::getCoveringInset() and
|
||||
/// setCursorFromCoordinates() instead of checkInsetHit().
|
||||
Inset * editXY(Cursor & cur, int x, int y);
|
||||
|
||||
|
||||
/// Move cursor one line up.
|
||||
/**
|
||||
* Returns true if an update is needed after the move.
|
||||
|
@ -271,7 +271,7 @@ void Text::setCharFont(Buffer const & buffer, pit_type pit,
|
||||
pos_type pos, Font const & fnt)
|
||||
{
|
||||
BOOST_ASSERT(!pars_[pit].isInset(pos) ||
|
||||
!pars_[pit].getInset(pos)->noFontChange());
|
||||
!pars_[pit].getInset(pos)->noFontChange());
|
||||
|
||||
Font font = fnt;
|
||||
Layout_ptr const & layout = pars_[pit].layout();
|
||||
@ -314,7 +314,7 @@ void Text::setInsetFont(Buffer const & buffer, pit_type pit,
|
||||
pos_type pos, Font const & font, bool toggleall)
|
||||
{
|
||||
BOOST_ASSERT(pars_[pit].isInset(pos) &&
|
||||
pars_[pit].getInset(pos)->noFontChange());
|
||||
pars_[pit].getInset(pos)->noFontChange());
|
||||
|
||||
Inset * const inset = pars_[pit].getInset(pos);
|
||||
DocIterator dit = doc_iterator_begin(*inset);
|
||||
@ -489,7 +489,7 @@ void Text::setFont(Cursor & cur, Font const & font, bool toggleall)
|
||||
// And resolve it completely
|
||||
real_current_font.realize(layoutfont);
|
||||
|
||||
// if there is no selection that's all we need to do
|
||||
// if there is no selection that's all we need to do
|
||||
if (!cur.selection())
|
||||
return;
|
||||
|
||||
@ -497,7 +497,7 @@ void Text::setFont(Cursor & cur, Font const & font, bool toggleall)
|
||||
recordUndoSelection(cur);
|
||||
|
||||
setFont(cur.buffer(), cur.selectionBegin(), cur.selectionEnd(), font,
|
||||
toggleall);
|
||||
toggleall);
|
||||
}
|
||||
|
||||
|
||||
@ -674,9 +674,9 @@ void Text::insertInset(Cursor & cur, Inset * inset)
|
||||
{
|
||||
BOOST_ASSERT(this == cur.text());
|
||||
BOOST_ASSERT(inset);
|
||||
cur.paragraph().insertInset(cur.pos(), inset,
|
||||
cur.paragraph().insertInset(cur.pos(), inset,
|
||||
Change(cur.buffer().params().trackChanges ?
|
||||
Change::INSERTED : Change::UNCHANGED));
|
||||
Change::INSERTED : Change::UNCHANGED));
|
||||
}
|
||||
|
||||
|
||||
@ -767,7 +767,7 @@ void Text::setCurrentFont(Cursor & cur)
|
||||
|
||||
if (cur.boundary() && pos > 0 && pos < cur.lastpos()) {
|
||||
--pos;
|
||||
// We may have just moved to the previous row ---
|
||||
// We may have just moved to the previous row ---
|
||||
// we're going to be needing its bidi tables!
|
||||
bidi.computeTables(par, cur.buffer(), cur.textRow());
|
||||
}
|
||||
@ -967,7 +967,7 @@ bool Text::checkAndActivateInset(Cursor & cur, bool front)
|
||||
* from which we are entering. Otherwise, cursor placement goes awry,
|
||||
* and when we exit from the beginning, we'll be placed *after* the
|
||||
* inset.
|
||||
*/
|
||||
*/
|
||||
if (!front)
|
||||
--cur.pos();
|
||||
inset->edit(cur, front);
|
||||
@ -988,21 +988,21 @@ bool Text::cursorLeft(Cursor & cur)
|
||||
// If checkAndActivateInset returns true, that means that
|
||||
// the cursor was placed inside it, so we're done
|
||||
if (!checkAndActivateInset(cur, false)) {
|
||||
if (!cur.boundary() &&
|
||||
cur.textRow().pos() == cur.pos()
|
||||
if (!cur.boundary() &&
|
||||
cur.textRow().pos() == cur.pos()
|
||||
// FIXME: the following two conditions are copied
|
||||
// from cursorRight; however, isLineSeparator()
|
||||
// is definitely wrong here, isNewline I'm not sure
|
||||
// about. I'm leaving them as comments for now,
|
||||
// until we understand why they should or shouldn't
|
||||
// be here.
|
||||
/*&&
|
||||
/*&&
|
||||
!cur.paragraph().isLineSeparator(cur.pos()-1) &&
|
||||
!cur.paragraph().isNewline(cur.pos() - 1)*/) {
|
||||
updateNeeded |= setCursor(cur, cur.pit(), cur.pos(),
|
||||
updateNeeded |= setCursor(cur, cur.pit(), cur.pos(),
|
||||
true, true);
|
||||
}
|
||||
updateNeeded |= setCursor(cur, cur.pit(),cur.pos() - 1,
|
||||
updateNeeded |= setCursor(cur, cur.pit(),cur.pos() - 1,
|
||||
true, false);
|
||||
}
|
||||
return updateNeeded;
|
||||
@ -1027,7 +1027,7 @@ bool Text::cursorRight(Cursor & cur)
|
||||
true, false);
|
||||
|
||||
bool updateNeeded = false;
|
||||
// If checkAndActivateInset returns true, that means that
|
||||
// If checkAndActivateInset returns true, that means that
|
||||
// the cursor was placed inside it, so we're done
|
||||
if (!checkAndActivateInset(cur, true)) {
|
||||
if (cur.textRow().endpos() == cur.pos() + 1 &&
|
||||
@ -1065,9 +1065,9 @@ bool Text::cursorUp(Cursor & cur)
|
||||
cur.setTargetX();
|
||||
// We want to keep the x-target on subsequent up movements
|
||||
// that cross beyond the end of short lines. Thus a special
|
||||
// handling when the cursor is at the end of line: Use the new
|
||||
// handling when the cursor is at the end of line: Use the new
|
||||
// x-target only if the old one was before the end of line.
|
||||
if (cur.pos() != pm.rows()[row].endpos()
|
||||
if (cur.pos() != pm.rows()[row].endpos()
|
||||
|| (!isWithinRtlParagraph(cur) && x < cur.targetX())
|
||||
|| (isWithinRtlParagraph(cur) && x > cur.targetX())) {
|
||||
|
||||
@ -1132,9 +1132,9 @@ bool Text::cursorDown(Cursor & cur)
|
||||
cur.setTargetX();
|
||||
// We want to keep the x-target on subsequent down movements
|
||||
// that cross beyond the end of short lines. Thus a special
|
||||
// handling when the cursor is at the end of line: Use the new
|
||||
// handling when the cursor is at the end of line: Use the new
|
||||
// x-target only if the old one was before the end of line.
|
||||
if (cur.pos() != pm.rows()[row].endpos()
|
||||
if (cur.pos() != pm.rows()[row].endpos()
|
||||
|| (!isWithinRtlParagraph(cur) && x < cur.targetX())
|
||||
|| (isWithinRtlParagraph(cur) && x > cur.targetX())) {
|
||||
|
||||
@ -1156,7 +1156,7 @@ bool Text::cursorDown(Cursor & cur)
|
||||
Cursor dummy = cur;
|
||||
if (dummy == old)
|
||||
++dummy.pos();
|
||||
|
||||
|
||||
bool const changed = cur.bv().checkDepm(dummy, old);
|
||||
|
||||
// Make sure that cur gets back whatever happened to dummy(Lgb)
|
||||
@ -1350,7 +1350,7 @@ void Text::deleteEmptyParagraphMechanism(pit_type first, pit_type last, bool tra
|
||||
}
|
||||
|
||||
// don't delete anything if this is the only remaining paragraph within the given range
|
||||
// note: Text::acceptOrRejectChanges() sets the cursor to 'first' after calling DEPM
|
||||
// note: Text::acceptOrRejectChanges() sets the cursor to 'first' after calling DEPM
|
||||
if (first == last)
|
||||
continue;
|
||||
|
||||
|
@ -334,7 +334,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
||||
std::swap(pars_[pit], pars_[pit + 1]);
|
||||
|
||||
ParIterator begin(cur);
|
||||
// begin.pos() (== cur.pos()) may point beyond the end of the
|
||||
// begin.pos() (== cur.pos()) may point beyond the end of the
|
||||
// paragraph referenced by begin. This would cause a crash
|
||||
// in updateLabels()
|
||||
begin.pos() = 0;
|
||||
@ -353,7 +353,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
||||
std::swap(pars_[pit], pars_[pit - 1]);
|
||||
|
||||
ParIterator end = ParIterator(cur);
|
||||
// end.pos() (== cur.pos()) may point beyond the end of the
|
||||
// end.pos() (== cur.pos()) may point beyond the end of the
|
||||
// paragraph referenced by end. This would cause a crash
|
||||
// in boost::next()
|
||||
end.pos() = 0;
|
||||
@ -734,7 +734,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
||||
// FIXME (Abdel 01/02/2006):
|
||||
// What follows would be a partial fix for bug 2154:
|
||||
// http://bugzilla.lyx.org/show_bug.cgi?id=2154
|
||||
// This automatically put the label inset _after_ a
|
||||
// This automatically put the label inset _after_ a
|
||||
// numbered section. It should be possible to extend the mechanism
|
||||
// to any kind of LateX environement.
|
||||
// The correct way to fix that bug would be at LateX generation.
|
||||
@ -810,7 +810,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
||||
break;
|
||||
|
||||
case LFUN_CHARS_TRANSPOSE:
|
||||
charsTranspose(cur);
|
||||
charsTranspose(cur);
|
||||
break;
|
||||
|
||||
case LFUN_PASTE:
|
||||
@ -926,13 +926,13 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
||||
case LFUN_CLIPBOARD_PASTE:
|
||||
cur.clearSelection();
|
||||
pasteClipboard(cur, bv->buffer()->errorList("Paste"),
|
||||
cmd.argument() == "paragraph");
|
||||
cmd.argument() == "paragraph");
|
||||
bv->buffer()->errors("Paste");
|
||||
break;
|
||||
|
||||
case LFUN_PRIMARY_SELECTION_PASTE:
|
||||
pasteString(cur, theSelection().get(),
|
||||
cmd.argument() == "paragraph");
|
||||
cmd.argument() == "paragraph");
|
||||
break;
|
||||
|
||||
case LFUN_UNICODE_INSERT: {
|
||||
@ -949,7 +949,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case LFUN_QUOTE_INSERT: {
|
||||
Paragraph & par = cur.paragraph();
|
||||
pos_type pos = cur.pos();
|
||||
@ -1244,7 +1244,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
||||
pars.push_back(Paragraph());
|
||||
pars.back().setInsetOwner(pars[0].inInset());
|
||||
pars.back().layout(tclass.defaultLayout());
|
||||
|
||||
|
||||
}
|
||||
|
||||
// reposition the cursor to the caption
|
||||
@ -1602,7 +1602,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
||||
// update flag treatment.
|
||||
if (singleParUpdate) {
|
||||
// Inserting characters does not change par height
|
||||
ParagraphMetrics const & pms
|
||||
ParagraphMetrics const & pms
|
||||
= cur.bv().parMetrics(cur.bottom().text(), cur.bottom().pit());
|
||||
if (pms.dim().height()
|
||||
== olddim.height()) {
|
||||
@ -1624,7 +1624,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
||||
//
|
||||
//if (cur.result().update() != Update::FitCursor)
|
||||
// cur.noUpdate();
|
||||
//
|
||||
//
|
||||
// But some LFUNs do not set Update::FitCursor when needed, so we
|
||||
// do it for all. This is not very harmfull as FitCursor will provoke
|
||||
// a full redraw only if needed but still, a proper review of all LFUN
|
||||
|
@ -259,7 +259,7 @@ bool TextClass::read(FileName const & filename, bool merge)
|
||||
|
||||
if (tmp.empty()) {
|
||||
lexrc.printError("Could not find input"
|
||||
"file: " + inc);
|
||||
"file: " + inc);
|
||||
error = true;
|
||||
} else if (read(tmp, true)) {
|
||||
lexrc.printError("Error reading input"
|
||||
|
@ -103,7 +103,7 @@ bool TextClassList::read()
|
||||
|
||||
if (real_file.empty()) {
|
||||
lyxerr << "TextClassList::Read: unable to find "
|
||||
"textclass file `"
|
||||
"textclass file `"
|
||||
<< to_utf8(makeDisplayPath(real_file.absFilename(), 1000))
|
||||
<< "'. Exiting." << endl;
|
||||
return false;
|
||||
@ -122,7 +122,7 @@ bool TextClassList::read()
|
||||
|
||||
if (!lex.isOK()) {
|
||||
lyxerr << "TextClassList::Read: unable to open "
|
||||
"textclass file `"
|
||||
"textclass file `"
|
||||
<< to_utf8(makeDisplayPath(real_file.absFilename(), 1000))
|
||||
<< "'\nCheck your installation. LyX can't continue."
|
||||
<< endl;
|
||||
@ -199,7 +199,7 @@ TextClassList::addTextClass(std::string const & textclass, std::string const & p
|
||||
// returns: whole string, classtype (not used here), first option, description
|
||||
BOOST_ASSERT(sub.size()==4);
|
||||
// now, add the layout to textclass.
|
||||
TextClass tmpl(textclass, sub.str(2)==""?textclass:sub.str(2),
|
||||
TextClass tmpl(textclass, sub.str(2)==""?textclass:sub.str(2),
|
||||
sub.str(3) + " <" + path + ">", true);
|
||||
if (lyxerr.debugging(Debug::TCLASS))
|
||||
tmpl.load(path);
|
||||
@ -211,7 +211,7 @@ TextClassList::addTextClass(std::string const & textclass, std::string const & p
|
||||
// If .layout is not in local directory, or an invalid layout is found, return false
|
||||
return make_pair(false, textclass_type(0));
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Global variable: textclass table.
|
||||
TextClassList textclasslist;
|
||||
|
@ -50,11 +50,11 @@ public:
|
||||
|
||||
/// Read textclass list. Returns false if this fails.
|
||||
bool read();
|
||||
|
||||
/// add a textclass from user local directory.
|
||||
/// Return ture/false, and textclass number
|
||||
std::pair<bool, textclass_type> const
|
||||
addTextClass(std::string const & textclass, std::string const & path);
|
||||
|
||||
/// add a textclass from user local directory.
|
||||
/// Return ture/false, and textclass number
|
||||
std::pair<bool, textclass_type> const
|
||||
addTextClass(std::string const & textclass, std::string const & path);
|
||||
|
||||
private:
|
||||
///
|
||||
|
@ -147,7 +147,7 @@ bool TextMetrics::metrics(MetricsInfo & mi, Dimension & dim)
|
||||
|
||||
//lyxerr << "Text::metrics: width: " << mi.base.textwidth
|
||||
// << " maxWidth: " << max_width_ << "\nfont: " << mi.base.font << endl;
|
||||
|
||||
|
||||
bool changed = false;
|
||||
|
||||
unsigned int h = 0;
|
||||
@ -190,7 +190,7 @@ bool TextMetrics::redoParagraph(pit_type const pit)
|
||||
main_text_ = (text_ == &buffer.text());
|
||||
bool changed = false;
|
||||
|
||||
// FIXME This check ought to be done somewhere else. It is the reason
|
||||
// FIXME This check ought to be done somewhere else. It is the reason
|
||||
// why text_ is not const. But then, where else to do it?
|
||||
// Well, how can you end up with either (a) a biblio environment that
|
||||
// has no InsetBibitem or (b) a biblio environment with more than one
|
||||
@ -419,7 +419,7 @@ int TextMetrics::labelFill(Paragraph const & par, Row const & row) const
|
||||
if (label.empty())
|
||||
return 0;
|
||||
|
||||
FontMetrics const & fm
|
||||
FontMetrics const & fm
|
||||
= theFontMetrics(text_->getLabelFont(buffer, par));
|
||||
|
||||
return max(0, fm.width(label) - w);
|
||||
@ -782,8 +782,8 @@ void TextMetrics::setHeightOfRow(pit_type const pit,
|
||||
maxasc += int(layoutasc * 2 / (2 + pars[pit].getDepth()));
|
||||
maxdesc += int(layoutdesc * 2 / (2 + pars[pit].getDepth()));
|
||||
|
||||
// FIXME: the correct way is to do the following is to move the
|
||||
// following code in another method specially tailored for the
|
||||
// FIXME: the correct way is to do the following is to move the
|
||||
// following code in another method specially tailored for the
|
||||
// main Text. The following test is thus bogus.
|
||||
// Top and bottom margin of the document (only at top-level)
|
||||
if (main_text_) {
|
||||
@ -837,7 +837,7 @@ pos_type TextMetrics::getColumnNearX(pit_type const pit,
|
||||
return 0;
|
||||
}
|
||||
|
||||
frontend::FontMetrics const & fm
|
||||
frontend::FontMetrics const & fm
|
||||
= theFontMetrics(text_->getLabelFont(buffer, par));
|
||||
|
||||
while (vc < end && tmpx <= x) {
|
||||
|
@ -71,7 +71,7 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
///
|
||||
///
|
||||
ParagraphMetrics & parMetrics(pit_type, bool redo_paragraph);
|
||||
|
||||
/// the minimum space a manual label needs on the screen in pixels
|
||||
@ -100,7 +100,7 @@ public:
|
||||
|
||||
/// returns pos in given par at given x coord.
|
||||
pos_type x2pos(pit_type pit, int row, int x) const;
|
||||
|
||||
|
||||
// FIXME: is there a need for this?
|
||||
//int pos2x(pit_type pit, pos_type pos) const;
|
||||
|
||||
|
@ -123,7 +123,7 @@ Toc const & TocBackend::toc(std::string const & type) const
|
||||
|
||||
void TocBackend::updateItem(ParConstIterator const & par_it)
|
||||
{
|
||||
// TODO should not happen,
|
||||
// TODO should not happen,
|
||||
// a call to TocBackend::update() is missing somewhere
|
||||
if (toc("tableofcontents").empty())
|
||||
return;
|
||||
@ -144,7 +144,7 @@ void TocBackend::updateItem(ParConstIterator const & par_it)
|
||||
if (inset.lyxCode() == Inset::OPTARG_CODE) {
|
||||
if (!tocstring.empty())
|
||||
break;
|
||||
Paragraph const & par =
|
||||
Paragraph const & par =
|
||||
*static_cast<InsetOptArg&>(inset).paragraphs().begin();
|
||||
if (!toc_item->par_it_->getLabelstring().empty())
|
||||
tocstring = toc_item->par_it_->getLabelstring() + ' ';
|
||||
@ -189,7 +189,7 @@ void TocBackend::update()
|
||||
case Inset::OPTARG_CODE: {
|
||||
if (!tocstring.empty())
|
||||
break;
|
||||
Paragraph const & par =
|
||||
Paragraph const & par =
|
||||
*static_cast<InsetOptArg&>(inset).paragraphs().begin();
|
||||
if (!pit->getLabelstring().empty())
|
||||
tocstring = pit->getLabelstring() + ' ';
|
||||
|
@ -58,7 +58,7 @@ public:
|
||||
|
||||
/// the action corresponding to the goTo above
|
||||
FuncRequest action() const;
|
||||
|
||||
|
||||
protected:
|
||||
/// Current position of item.
|
||||
ParConstIterator par_it_;
|
||||
@ -114,7 +114,7 @@ public:
|
||||
void writePlaintextTocList(std::string const & type, odocstream & os) const;
|
||||
|
||||
private:
|
||||
///
|
||||
///
|
||||
TocList tocs_;
|
||||
///
|
||||
Buffer const * buffer_;
|
||||
|
@ -92,7 +92,7 @@ ToolbarInfo & ToolbarInfo::read(Lexer & lex)
|
||||
TO_ICONPALETTE,
|
||||
TO_LAST
|
||||
};
|
||||
|
||||
|
||||
struct keyword_item toolTags[TO_LAST - 1] = {
|
||||
{ "end", TO_ENDTOOLBAR },
|
||||
{ "iconpalette", TO_ICONPALETTE },
|
||||
@ -165,7 +165,7 @@ ToolbarInfo & ToolbarInfo::read(Lexer & lex)
|
||||
add(ToolbarItem(ToolbarItem::POPUPMENU, name, label));
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case TO_ICONPALETTE:
|
||||
if (lex.next(true)) {
|
||||
string const name = lex.getString();
|
||||
@ -174,12 +174,12 @@ ToolbarInfo & ToolbarInfo::read(Lexer & lex)
|
||||
add(ToolbarItem(ToolbarItem::ICONPALETTE, name, label));
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case TO_LAYOUTS:
|
||||
add(ToolbarItem(ToolbarItem::LAYOUTS,
|
||||
FuncRequest(kb_action(ToolbarItem::LAYOUTS))));
|
||||
break;
|
||||
|
||||
|
||||
case TO_TABLEINSERT:
|
||||
if (lex.next(true)) {
|
||||
docstring const tooltip = lex.getDocString();
|
||||
@ -187,7 +187,7 @@ ToolbarInfo & ToolbarInfo::read(Lexer & lex)
|
||||
FuncRequest(kb_action(ToolbarItem::TABLEINSERT)), tooltip));
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case TO_ENDTOOLBAR:
|
||||
quit = true;
|
||||
break;
|
||||
@ -218,7 +218,7 @@ void ToolbarBackend::readToolbars(Lexer & lex)
|
||||
TO_ENDTOOLBARSET,
|
||||
TO_LAST
|
||||
};
|
||||
|
||||
|
||||
struct keyword_item toolTags[TO_LAST - 1] = {
|
||||
{ "end", TO_ENDTOOLBARSET },
|
||||
{ "toolbar", TO_TOOLBAR }
|
||||
|
@ -36,7 +36,7 @@ public:
|
||||
LAYOUTS,
|
||||
/// a special widget to insert tabulars
|
||||
TABLEINSERT,
|
||||
///
|
||||
///
|
||||
POPUPMENU,
|
||||
///
|
||||
ICONPALETTE
|
||||
|
@ -149,7 +149,7 @@ private:
|
||||
docstring const & match(char_type c);
|
||||
///
|
||||
void insertException(KmodException & exclist, char_type c,
|
||||
docstring const & data, bool = false,
|
||||
docstring const & data, bool = false,
|
||||
tex_accent = TEX_NOACCENT);
|
||||
///
|
||||
void freeException(KmodException & exclist);
|
||||
|
@ -377,7 +377,7 @@ void setCaptionLabels(Inset & inset, string const & type,
|
||||
setCaptionLabels(icap, type, label, counters);
|
||||
if (icap.lyxCode() == Inset::CAPTION_CODE) {
|
||||
// We found a caption!
|
||||
counters.step(counter);
|
||||
counters.step(counter);
|
||||
int number = counters.value(counter);
|
||||
InsetCaption & ic = static_cast<InsetCaption &>(icap);
|
||||
ic.setType(type);
|
||||
@ -400,7 +400,7 @@ void setCaptions(Paragraph & par, TextClass const & textclass)
|
||||
InsetList::iterator end = par.insetlist.end();
|
||||
for (; it != end; ++it) {
|
||||
Inset & inset = *it->inset;
|
||||
if (inset.lyxCode() == Inset::FLOAT_CODE
|
||||
if (inset.lyxCode() == Inset::FLOAT_CODE
|
||||
|| inset.lyxCode() == Inset::WRAP_CODE) {
|
||||
docstring const name = inset.name();
|
||||
if (name.empty())
|
||||
|
@ -204,7 +204,7 @@ Point coordOffset(BufferView const & bv, DocIterator const & dit,
|
||||
Point getPos(BufferView const & bv, DocIterator const & dit, bool boundary)
|
||||
{
|
||||
CursorSlice const & bot = dit.bottom();
|
||||
CoordCache::ParPosCache::const_iterator cache_it =
|
||||
CoordCache::ParPosCache::const_iterator cache_it =
|
||||
bv.coordCache().getParPos().find(bot.text());
|
||||
if (cache_it == bv.coordCache().getParPos().end())
|
||||
return Point(-1, -1);
|
||||
|
@ -401,7 +401,7 @@ docstring const getContentsOfPlaintextFile(BufferView * bv, string const & f,
|
||||
// FIXME UNICODE: We don't know the encoding of the file
|
||||
docstring file_content = from_utf8(tmpstr);
|
||||
if (file_content.empty()) {
|
||||
Alert::error(_("Reading not UTF-8 encoded file"),
|
||||
Alert::error(_("Reading not UTF-8 encoded file"),
|
||||
_("The file is not UTF-8 encoded.\n"
|
||||
"It will be read as local 8Bit-encoded.\n"
|
||||
"If this does not give the correct result\n"
|
||||
@ -409,7 +409,7 @@ docstring const getContentsOfPlaintextFile(BufferView * bv, string const & f,
|
||||
"to UTF-8 with a program other than LyX.\n"));
|
||||
file_content = from_local8bit(tmpstr);
|
||||
}
|
||||
|
||||
|
||||
return normalize_kc(file_content);
|
||||
}
|
||||
|
||||
|
@ -635,4 +635,3 @@ void assertion_failed(char const* a, char const* b, char const* c, long d)
|
||||
}
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// -*- C++ -*-
|
||||
/**
|
||||
* \file debug.h
|
||||
*
|
||||
*
|
||||
* FIXME: It would be nice if, in lyx::use_gui mode, instead of
|
||||
* outputting to the console, we would pipe all messages onto a file
|
||||
* and visualise the contents dynamically in a Qt window if needed.
|
||||
|
@ -264,7 +264,7 @@ Inset * createInset(BufferView * bv, FuncRequest const & cmd)
|
||||
InsetCollapsable::CollapseStatus st;
|
||||
InsetERTMailer::string2params(to_utf8(cmd.argument()), st);
|
||||
return new InsetERT(params, st);
|
||||
|
||||
|
||||
} else if (name == "listings") {
|
||||
InsetListingsParams par;
|
||||
InsetListingsMailer::string2params(to_utf8(cmd.argument()), par);
|
||||
|
@ -31,4 +31,3 @@ void information_pimpl(docstring const & title, docstring const & warning);
|
||||
std::pair<bool, docstring> const askForText_pimpl(docstring const & msg, docstring const & dflt);
|
||||
|
||||
} // namespace lyx
|
||||
|
||||
|
@ -53,7 +53,7 @@ LyXView & Application::createView(unsigned int width,
|
||||
{
|
||||
LyXView & view = gui().createRegisteredView();
|
||||
int view_id = view.id();
|
||||
|
||||
|
||||
theLyXFunc().setLyXView(&view);
|
||||
|
||||
/*int workArea_id_ =*/ gui().newWorkArea(width, height, view_id);
|
||||
|
@ -38,7 +38,7 @@ initialisation should be done before the instanciation of this class.
|
||||
common to all frontends.
|
||||
|
||||
Model/View/Controller separation in LyX:
|
||||
|
||||
|
||||
1) The Model: \c Buffer
|
||||
|
||||
The Buffer is the in-memory representation of a LyX file format. The
|
||||
@ -46,10 +46,10 @@ common to all frontends.
|
||||
is represented on screen. There is one unique Buffer per opened LyX
|
||||
file.
|
||||
|
||||
|
||||
|
||||
2) The Controller: \c BufferView / \c Painter
|
||||
|
||||
The BufferView is a tool used by the view that translates a part of
|
||||
The BufferView is a tool used by the view that translates a part of
|
||||
the Buffer contents into drawing routines. The BufferView asks each
|
||||
inset of the Buffer to draw itself onto the screen using the Painter.
|
||||
There can be only one Buffer displayed in a BufferView. While there
|
||||
@ -60,12 +60,12 @@ common to all frontends.
|
||||
|
||||
The \c Painter is just a virtual interface to formalize each kind of
|
||||
drawing routines (text, line, rectangle, etc).
|
||||
|
||||
|
||||
The \c BufferView also contains a Cursor which may or may not be
|
||||
visible on screen. The cursor is really just a bookmark to remember
|
||||
where the next Buffer insertion/deletion is going to take place.
|
||||
|
||||
|
||||
|
||||
3) The View: \c WorkArea (and it's qt4 specialisation GuiWorkArea)
|
||||
|
||||
This contains the real screen area where the drawing is done by the
|
||||
@ -81,9 +81,9 @@ common to all frontends.
|
||||
- select char
|
||||
- etc.
|
||||
|
||||
|
||||
|
||||
4) The Window: \c LyXView (and its qt4 specialisation \c GuiView)
|
||||
|
||||
|
||||
This is a full window containing a menubar, toolbars, a tabbar and a
|
||||
WorkArea. One LyXView could in theory contain multiple WorkArea
|
||||
(ex: with split window) but this number is limited to one only for
|
||||
@ -95,7 +95,7 @@ common to all frontends.
|
||||
the WorkArea to switch to this another Buffer.
|
||||
|
||||
With a TabWidget, each Tab would own its own \c WorkArea. Clicking on a tab
|
||||
would switch a WorkArea instead of a Buffer.
|
||||
would switch a WorkArea instead of a Buffer.
|
||||
*/
|
||||
class Application
|
||||
{
|
||||
@ -174,11 +174,11 @@ public:
|
||||
LyXView & createView(unsigned int width, unsigned int height,
|
||||
int posx, int posy, int maximized,
|
||||
unsigned int iconSizeXY, const std::string & geometryArg);
|
||||
|
||||
///
|
||||
|
||||
///
|
||||
LyXView const * currentView() const;
|
||||
|
||||
///
|
||||
///
|
||||
LyXView * currentView();
|
||||
|
||||
///
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
namespace lyx {
|
||||
|
||||
namespace support { class FileFilterList; }
|
||||
namespace support { class FileFilterList; }
|
||||
|
||||
|
||||
/**
|
||||
|
@ -47,9 +47,9 @@ public:
|
||||
///
|
||||
virtual LyXView& view(int id) const = 0;
|
||||
///
|
||||
std::vector<int> const & viewIds()
|
||||
{
|
||||
return view_ids_;
|
||||
std::vector<int> const & viewIds()
|
||||
{
|
||||
return view_ids_;
|
||||
}
|
||||
|
||||
|
||||
|
@ -170,7 +170,7 @@ bool LyXView::loadLyXFile(FileName const & filename, bool tolastfiles)
|
||||
if (hadBuffer)
|
||||
disconnectBuffer();
|
||||
|
||||
bool const loaded =
|
||||
bool const loaded =
|
||||
work_area_->bufferView().loadLyXFile(filename, tolastfiles);
|
||||
|
||||
updateToc();
|
||||
@ -340,7 +340,7 @@ void LyXView::updateToolbars()
|
||||
bool const review =
|
||||
lyx::getStatus(FuncRequest(LFUN_CHANGES_TRACK)).enabled() &&
|
||||
lyx::getStatus(FuncRequest(LFUN_CHANGES_TRACK)).onoff(true);
|
||||
|
||||
|
||||
toolbars_->update(math, table, review);
|
||||
// update redaonly status of open dialogs. This could also be in
|
||||
// updateMenubar(), but since updateToolbars() and updateMenubar()
|
||||
|
@ -79,7 +79,7 @@ public:
|
||||
|
||||
/// return the current WorkArea (the one that has the focus).
|
||||
frontend::WorkArea const * currentWorkArea() const;
|
||||
/// FIXME: This non-const access is needed because of
|
||||
/// FIXME: This non-const access is needed because of
|
||||
/// a mis-designed \c ControlSpellchecker.
|
||||
frontend::WorkArea * currentWorkArea();
|
||||
|
||||
|
@ -32,33 +32,33 @@ public:
|
||||
virtual int maxAscent() const { return 1; }
|
||||
|
||||
virtual int maxDescent() const { return 1; }
|
||||
|
||||
|
||||
virtual Dimension const defaultDimension() const { return Dimension(1, 1, 1); }
|
||||
|
||||
virtual int width(char_type) const { return 1; }
|
||||
|
||||
virtual int ascent(char_type) const { return 1; }
|
||||
|
||||
|
||||
int descent(char_type) const { return 1; }
|
||||
|
||||
|
||||
virtual int lbearing(char_type) const { return 1; }
|
||||
|
||||
|
||||
virtual int rbearing(char_type) const { return 1; }
|
||||
|
||||
|
||||
virtual int width(docstring const & s) const { return s.size(); }
|
||||
|
||||
|
||||
virtual int signedWidth(docstring const & s) const
|
||||
{
|
||||
if (s.size() && s[0] == '-')
|
||||
return -width(s.substr(1, s.length() - 1));
|
||||
return width(s);
|
||||
}
|
||||
|
||||
|
||||
virtual Dimension const dimension(char_type) const { return Dimension(1, 1, 1); }
|
||||
|
||||
virtual void rectText(docstring const &,
|
||||
int & /*width*/, int & /*ascent*/, int & /*descent*/) const {}
|
||||
|
||||
|
||||
virtual void buttonText(docstring const &,
|
||||
int & /*width*/, int & /*ascent*/, int & /*descent*/) const {}
|
||||
};
|
||||
|
@ -69,7 +69,7 @@ void Painter::rectText(int x, int y,
|
||||
}
|
||||
|
||||
|
||||
void Painter::buttonText(int x, int y, docstring const & str,
|
||||
void Painter::buttonText(int x, int y, docstring const & str,
|
||||
Font const & font, bool mouseHover)
|
||||
{
|
||||
int width;
|
||||
|
@ -46,7 +46,7 @@ void Toolbars::initFlags(ToolbarInfo & tbinfo)
|
||||
|
||||
unsigned int flags = static_cast<unsigned int>(tbinfo.flags);
|
||||
|
||||
// Remove default.ui positions. Only when a valid postion is stored
|
||||
// Remove default.ui positions. Only when a valid postion is stored
|
||||
// in the session file the default.ui value will be overwritten
|
||||
unsigned int save = flags;
|
||||
TurnOffFlag(TOP);
|
||||
@ -86,16 +86,16 @@ void Toolbars::initFlags(ToolbarInfo & tbinfo)
|
||||
}
|
||||
/*
|
||||
std::cout << "State " << info.state << " FLAGS: " << flags
|
||||
<< " ON:" << (flags & ToolbarBackend::ON)
|
||||
<< " ON:" << (flags & ToolbarBackend::ON)
|
||||
<< " OFF:" << (flags & ToolbarBackend::OFF)
|
||||
<< " L:" << (flags & ToolbarBackend::LEFT)
|
||||
<< " R:" << (flags & ToolbarBackend::RIGHT)
|
||||
<< " T:" << (flags & ToolbarBackend::TOP)
|
||||
<< " B:" << (flags & ToolbarBackend::BOTTOM)
|
||||
<< " MA:" << (flags & ToolbarBackend::MATH)
|
||||
<< " RE:" << (flags & ToolbarBackend::REVIEW)
|
||||
<< " TB:" << (flags & ToolbarBackend::TABLE)
|
||||
<< " AU:" << (flags & ToolbarBackend::AUTO)
|
||||
<< " L:" << (flags & ToolbarBackend::LEFT)
|
||||
<< " R:" << (flags & ToolbarBackend::RIGHT)
|
||||
<< " T:" << (flags & ToolbarBackend::TOP)
|
||||
<< " B:" << (flags & ToolbarBackend::BOTTOM)
|
||||
<< " MA:" << (flags & ToolbarBackend::MATH)
|
||||
<< " RE:" << (flags & ToolbarBackend::REVIEW)
|
||||
<< " TB:" << (flags & ToolbarBackend::TABLE)
|
||||
<< " AU:" << (flags & ToolbarBackend::AUTO)
|
||||
<< std::endl;
|
||||
*/
|
||||
// now set the flags
|
||||
@ -170,7 +170,7 @@ void Toolbars::display(string const & name, bool show)
|
||||
|
||||
|
||||
ToolbarInfo::Flags Toolbars::getToolbarState(string const & name)
|
||||
{
|
||||
{
|
||||
ToolbarBackend::Toolbars::const_iterator cit = toolbarbackend.begin();
|
||||
ToolbarBackend::Toolbars::const_iterator end = toolbarbackend.end();
|
||||
|
||||
|
@ -138,7 +138,7 @@ void WorkArea::redraw()
|
||||
return;
|
||||
}
|
||||
|
||||
// No need to do anything if this is the current view. The BufferView
|
||||
// No need to do anything if this is the current view. The BufferView
|
||||
// metrics are already up to date.
|
||||
if (&lyx_view_ != theApp()->currentView()) {
|
||||
// FIXME: it would be nice to optimize for the off-screen case.
|
||||
@ -208,7 +208,7 @@ void WorkArea::dispatch(FuncRequest const & cmd0, key_modifier::state k)
|
||||
|
||||
// In order to avoid bad surprise in the middle of an operation, we better stop
|
||||
// the blinking cursor.
|
||||
if (!(cmd.action == LFUN_MOUSE_MOTION
|
||||
if (!(cmd.action == LFUN_MOUSE_MOTION
|
||||
&& cmd.button() == mouse_button::none))
|
||||
stopBlinkingCursor();
|
||||
|
||||
@ -216,7 +216,7 @@ void WorkArea::dispatch(FuncRequest const & cmd0, key_modifier::state k)
|
||||
|
||||
if (needRedraw)
|
||||
redraw();
|
||||
|
||||
|
||||
// Skip these when selecting
|
||||
if (cmd.action != LFUN_MOUSE_MOTION) {
|
||||
lyx_view_.updateLayoutChoice();
|
||||
@ -225,7 +225,7 @@ void WorkArea::dispatch(FuncRequest const & cmd0, key_modifier::state k)
|
||||
}
|
||||
|
||||
// GUI tweaks except with mouse motion with no button pressed.
|
||||
if (!(cmd.action == LFUN_MOUSE_MOTION
|
||||
if (!(cmd.action == LFUN_MOUSE_MOTION
|
||||
&& cmd.button() == mouse_button::none)) {
|
||||
// Slight hack: this is only called currently when we
|
||||
// clicked somewhere, so we force through the display
|
||||
@ -251,7 +251,7 @@ void WorkArea::resizeBufferView()
|
||||
|
||||
void WorkArea::updateScrollbar()
|
||||
{
|
||||
buffer_view_->updateScrollbar();
|
||||
buffer_view_->updateScrollbar();
|
||||
ScrollbarParameters const & scroll_ = buffer_view_->scrollbarParameters();
|
||||
setScrollbarParams(scroll_.height, scroll_.position,
|
||||
scroll_.lineScrollHeight);
|
||||
|
@ -67,7 +67,7 @@ public:
|
||||
|
||||
/// \return true if has the keyboard input focus.
|
||||
virtual bool hasFocus() const = 0;
|
||||
|
||||
|
||||
/// return the width of the work area in pixels
|
||||
virtual int width() const = 0;
|
||||
|
||||
|
@ -22,7 +22,7 @@ namespace lyx {
|
||||
namespace frontend {
|
||||
|
||||
ControlCommand::ControlCommand(Dialog & dialog, string const & command_name,
|
||||
string const & lfun_name)
|
||||
string const & lfun_name)
|
||||
: Dialog::Controller(dialog), params_(command_name),
|
||||
lfun_name_(lfun_name)
|
||||
{}
|
||||
|
@ -30,7 +30,7 @@ public:
|
||||
'Apply'.
|
||||
*/
|
||||
ControlCommand(Dialog &, std::string const & command_name,
|
||||
std::string const & lfun_name);
|
||||
std::string const & lfun_name);
|
||||
///
|
||||
virtual ~ControlCommand() {}
|
||||
///
|
||||
|
@ -125,7 +125,7 @@ void ControlDocument::dispatchParams()
|
||||
|
||||
// Apply the BufferParams.
|
||||
dispatch_bufferparams(kernel(), params(), LFUN_BUFFER_PARAMS_APPLY);
|
||||
|
||||
|
||||
// redo the numbering if necessary
|
||||
if (new_secnumdepth != old_secnumdepth)
|
||||
updateLabels(kernel().buffer());
|
||||
@ -185,13 +185,13 @@ void ControlDocument::saveAsDefault() const
|
||||
|
||||
bool const ControlDocument::isFontAvailable(std::string const & font) const
|
||||
{
|
||||
if (font == "default" || font == "cmr"
|
||||
if (font == "default" || font == "cmr"
|
||||
|| font == "cmss" || font == "cmtt")
|
||||
// these are standard
|
||||
return true;
|
||||
else if (font == "lmodern" || font == "lmss" || font == "lmtt")
|
||||
return LaTeXFeatures::isAvailable("lmodern");
|
||||
else if (font == "times" || font == "palatino"
|
||||
else if (font == "times" || font == "palatino"
|
||||
|| font == "helvet" || font == "courier")
|
||||
return LaTeXFeatures::isAvailable("psnfss");
|
||||
else if (font == "cmbr" || font == "cmtl")
|
||||
@ -199,7 +199,7 @@ bool const ControlDocument::isFontAvailable(std::string const & font) const
|
||||
else if (font == "utopia")
|
||||
return LaTeXFeatures::isAvailable("utopia")
|
||||
|| LaTeXFeatures::isAvailable("fourier");
|
||||
else if (font == "beraserif" || font == "berasans"
|
||||
else if (font == "beraserif" || font == "berasans"
|
||||
|| font == "beramono")
|
||||
return LaTeXFeatures::isAvailable("bera");
|
||||
else
|
||||
|
@ -150,7 +150,7 @@ ControlExternal::getTemplateFilters(string const & template_name) const
|
||||
external::Template const * const et_ptr =
|
||||
etm.getTemplateByName(template_name);
|
||||
|
||||
if (et_ptr)
|
||||
if (et_ptr)
|
||||
return et_ptr->fileRegExp;
|
||||
|
||||
return string();
|
||||
@ -163,7 +163,7 @@ docstring const ControlExternal::browse(docstring const & input,
|
||||
docstring const title = _("Select external file");
|
||||
|
||||
docstring const bufpath = lyx::from_utf8(kernel().bufferFilepath());
|
||||
FileFilterList const filter =
|
||||
FileFilterList const filter =
|
||||
FileFilterList(lyx::from_utf8(getTemplateFilters(lyx::to_utf8(template_name))));
|
||||
|
||||
std::pair<docstring, docstring> dir1(_("Documents|#o#O"),
|
||||
|
@ -65,7 +65,7 @@ public:
|
||||
///
|
||||
external::Template getTemplate(int) const;
|
||||
///
|
||||
std::string const
|
||||
std::string const
|
||||
getTemplateFilters(std::string const & template_name) const;
|
||||
///
|
||||
docstring const browse(docstring const & input_file,
|
||||
|
@ -35,7 +35,7 @@ ControlMath::ControlMath(Dialog & dialog)
|
||||
: Dialog::Controller(dialog)
|
||||
{
|
||||
// FIXME: Ideally, those unicode codepoints would be defined
|
||||
// in "lib/symbols". Unfortunately, some of those are already
|
||||
// in "lib/symbols". Unfortunately, some of those are already
|
||||
// defined with non-unicode ids for use within mathed.
|
||||
// FIXME 2: We should fill-in this map with the parsed "symbols"
|
||||
// file done in MathFactory.cpp.
|
||||
@ -139,11 +139,11 @@ MathSymbol const & ControlMath::mathSymbol(string tex_name) const
|
||||
{
|
||||
map<string, MathSymbol>::const_iterator it =
|
||||
math_symbols_.find(tex_name);
|
||||
|
||||
|
||||
static MathSymbol unknown_symbol;
|
||||
if (it == math_symbols_.end())
|
||||
return unknown_symbol;
|
||||
|
||||
|
||||
return it->second;
|
||||
}
|
||||
|
||||
@ -152,11 +152,11 @@ std::string const & ControlMath::texName(char_type math_symbol) const
|
||||
{
|
||||
map<char_type, string>::const_iterator it =
|
||||
tex_names_.find(math_symbol);
|
||||
|
||||
|
||||
static string empty_string;
|
||||
if (it == tex_names_.end())
|
||||
return empty_string;
|
||||
|
||||
|
||||
return it->second;
|
||||
}
|
||||
|
||||
@ -196,10 +196,10 @@ char const * latex_arrow[] = {
|
||||
"Downarrow", "Uparrow", "Updownarrow", "Leftrightarrow",
|
||||
"Longleftrightarrow", "Longleftarrow", "Longrightarrow",
|
||||
"longleftrightarrow", "longleftarrow", "longrightarrow",
|
||||
"leftharpoondown", "rightharpoondown",
|
||||
"leftharpoondown", "rightharpoondown",
|
||||
"mapsto", "longmapsto",
|
||||
"nwarrow", "nearrow",
|
||||
"leftharpoonup", "rightharpoonup",
|
||||
"leftharpoonup", "rightharpoonup",
|
||||
"hookleftarrow", "hookrightarrow",
|
||||
"swarrow", "searrow",
|
||||
"rightleftharpoons",
|
||||
@ -295,7 +295,7 @@ char const * latex_ams_misc[] = {
|
||||
int const nr_latex_ams_misc = sizeof(latex_ams_misc) / sizeof(char const *);
|
||||
|
||||
char const * latex_ams_arrows[] = {
|
||||
"dashleftarrow", "dashrightarrow",
|
||||
"dashleftarrow", "dashrightarrow",
|
||||
"leftleftarrows", "leftrightarrows",
|
||||
"rightrightarrows", "rightleftarrows",
|
||||
"Lleftarrow", "Rrightarrow",
|
||||
@ -322,7 +322,7 @@ char const * latex_ams_rel[] = {
|
||||
"leqq", "geqq",
|
||||
"leqslant", "geqslant",
|
||||
"eqslantless", "eqslantgtr",
|
||||
"lesssim", "gtrsim",
|
||||
"lesssim", "gtrsim",
|
||||
"lessapprox", "gtrapprox",
|
||||
"approxeq", "triangleq",
|
||||
"lessdot", "gtrdot",
|
||||
@ -334,21 +334,21 @@ char const * latex_ams_rel[] = {
|
||||
"thicksim", "thickapprox",
|
||||
"backsim", "backsimeq",
|
||||
"subseteqq", "supseteqq",
|
||||
"Subset", "Supset",
|
||||
"Subset", "Supset",
|
||||
"sqsubset", "sqsupset",
|
||||
"preccurlyeq", "succcurlyeq",
|
||||
"curlyeqprec", "curlyeqsucc",
|
||||
"precsim", "succsim",
|
||||
"precapprox", "succapprox",
|
||||
"vartriangleleft", "vartriangleright",
|
||||
"preccurlyeq", "succcurlyeq",
|
||||
"curlyeqprec", "curlyeqsucc",
|
||||
"precsim", "succsim",
|
||||
"precapprox", "succapprox",
|
||||
"vartriangleleft", "vartriangleright",
|
||||
"trianglelefteq", "trianglerighteq",
|
||||
"bumpeq", "Bumpeq",
|
||||
"bumpeq", "Bumpeq",
|
||||
"doteqdot", "risingdotseq", "fallingdotseq",
|
||||
"vDash", "Vvdash", "Vdash",
|
||||
"shortmid", "shortparallel",
|
||||
"shortmid", "shortparallel",
|
||||
"smallsmile", "smallfrown",
|
||||
"blacktriangleleft", "blacktriangleright",
|
||||
"because", "therefore",
|
||||
"because", "therefore",
|
||||
"backepsilon",
|
||||
"varpropto",
|
||||
"between",
|
||||
|
@ -157,7 +157,7 @@ bool ControlParagraph::inInset() const
|
||||
|
||||
bool ControlParagraph::canIndent() const
|
||||
{
|
||||
return kernel().buffer().params().paragraph_separation ==
|
||||
return kernel().buffer().params().paragraph_separation ==
|
||||
BufferParams::PARSEP_INDENT;
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ public:
|
||||
///
|
||||
bool canApply() const { return true; }
|
||||
|
||||
/// The title displayed by the dialog reflects source type.
|
||||
/// The title displayed by the dialog reflects source type.
|
||||
docstring const title() const;
|
||||
|
||||
/** get the source code of selected paragraphs, or the whole document
|
||||
|
@ -79,7 +79,7 @@ void test_RegexMatch()
|
||||
|
||||
try {
|
||||
RegexMatch rm(im, "h.*o", false);
|
||||
|
||||
|
||||
cout << rm("hello") << endl;
|
||||
cout << rm("hei") << endl;
|
||||
}
|
||||
|
@ -150,7 +150,7 @@ void BulletsModule::on_customCB_clicked(bool custom)
|
||||
current_font_ = bulletpaneCO->currentIndex();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// unselect previous item
|
||||
selectItem(current_font_, current_char_, false);
|
||||
current_font_ = -1;
|
||||
|
@ -27,7 +27,7 @@ namespace frontend {
|
||||
/// This template class that encapsulates a given Widget inside a
|
||||
/// DockWidget and presents a Dialog::View interface
|
||||
template<class Controller, class Widget>
|
||||
class DockView : public QDockWidget, public Dialog::View
|
||||
class DockView : public QDockWidget, public Dialog::View
|
||||
{
|
||||
public:
|
||||
DockView(
|
||||
@ -49,7 +49,7 @@ public:
|
||||
void apply() {}
|
||||
void hide() { QDockWidget::hide(); }
|
||||
void show() { QDockWidget::show(); }
|
||||
bool isVisible() const
|
||||
bool isVisible() const
|
||||
{ return QDockWidget::isVisible(); }
|
||||
void redraw() {}
|
||||
void update()
|
||||
|
@ -81,7 +81,7 @@ void EmptyTable::setNumberColumns(int nr_cols)
|
||||
setColumnCount(nr_cols);
|
||||
resetCellSize();
|
||||
updateGeometry();
|
||||
// emit signal
|
||||
// emit signal
|
||||
colsChanged(nr_cols);
|
||||
}
|
||||
|
||||
@ -95,7 +95,7 @@ void EmptyTable::setNumberRows(int nr_rows)
|
||||
setRowCount(nr_rows);
|
||||
resetCellSize();
|
||||
updateGeometry();
|
||||
// emit signal
|
||||
// emit signal
|
||||
rowsChanged(nr_rows);
|
||||
}
|
||||
|
||||
|
@ -124,7 +124,7 @@ FileDialog::Result const FileDialog::open(docstring const & path,
|
||||
docstring const startsWith = from_utf8(
|
||||
makeAbsPath(to_utf8(suggested), to_utf8(path)).absFilename());
|
||||
result.second = from_utf8(internal_path(fromqstr(
|
||||
QFileDialog::getOpenFileName(qApp->focusWidget(),
|
||||
QFileDialog::getOpenFileName(qApp->focusWidget(),
|
||||
toqstr(title_), toqstr(startsWith), toqstr(filters.as_string()) ))));
|
||||
#else
|
||||
LyXFileDialog dlg(title_, path, filters, private_->b1, private_->b2);
|
||||
|
@ -238,5 +238,3 @@ void FloatPlacement::checkAllowed()
|
||||
//} // namespace lyx
|
||||
|
||||
#include "FloatPlacement_moc.cpp"
|
||||
|
||||
|
||||
|
@ -64,7 +64,7 @@ docstring const GuiClipboard::getAsText() const
|
||||
QString const str = qApp->clipboard()->text(QClipboard::Clipboard)
|
||||
.normalized(QString::NormalizationForm_KC);
|
||||
LYXERR(Debug::ACTION) << "GuiClipboard::getAsText(): `"
|
||||
<< fromqstr(str) << "'" << endl;
|
||||
<< fromqstr(str) << "'" << endl;
|
||||
if (str.isNull())
|
||||
return docstring();
|
||||
|
||||
@ -75,7 +75,7 @@ docstring const GuiClipboard::getAsText() const
|
||||
void GuiClipboard::put(string const & lyx, docstring const & text)
|
||||
{
|
||||
LYXERR(Debug::ACTION) << "GuiClipboard::put(`" << lyx << "' `"
|
||||
<< to_utf8(text) << "')" << endl;
|
||||
<< to_utf8(text) << "')" << endl;
|
||||
// We don't convert the encoding of lyx since the encoding of the
|
||||
// clipboard contents is specified in the data itself
|
||||
QMimeData * data = new QMimeData;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user