Whitespace cleanup.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13565 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2006-04-05 23:56:29 +00:00
parent e7fc677261
commit 3b9338a3a8
151 changed files with 812 additions and 825 deletions

View File

@ -374,13 +374,13 @@ void BufferView::putSelectionAt(DocIterator const & cur,
bool const BufferView::repaintAll() const
{
{
return pimpl_->repaintAll();
}
void const BufferView::repaintAll(bool r) const
{
{
pimpl_->repaintAll(r);
}

View File

@ -144,7 +144,7 @@ T * getInsetByCode(LCursor & cur, InsetBase::Code code)
BufferView::Pimpl::Pimpl(BufferView & bv, LyXView * owner,
int width, int height)
: bv_(&bv), owner_(owner), buffer_(0), wh_(0), cursor_timeout(400),
using_xterm_cursor(false), cursor_(bv),
using_xterm_cursor(false), cursor_(bv),
anchor_ref_(0), offset_ref_(0)
{
xsel_cache_.set = false;
@ -176,7 +176,7 @@ BufferView::Pimpl::Pimpl(BufferView & bv, LyXView * owner,
bm != bmList.end(); ++bm)
if (bm->get<0>() < saved_positions_num)
saved_positions[bm->get<0>()] = Position( bm->get<1>(), bm->get<2>(), bm->get<3>() );
// and then clear them
// and then clear them
bmList.clear();
}
@ -302,14 +302,14 @@ bool BufferView::Pimpl::loadLyXFile(string const & filename, bool tolastfiles)
setBuffer(b);
bv_->showErrorList(_("Parse"));
// scroll to the position when the file was last closed
if (lyxrc.use_lastfilepos) {
lyx::pit_type pit;
lyx::pos_type pos;
boost::tie(pit, pos) = LyX::ref().session().loadFilePosition(s);
// I am not sure how to separate the following part to a function
// so I will leave this to Lars.
// so I will leave this to Lars.
//
// check pit since the document may be externally changed.
if ( static_cast<size_t>(pit) < b->paragraphs().size() ) {
@ -321,7 +321,7 @@ bool BufferView::Pimpl::loadLyXFile(string const & filename, bool tolastfiles)
bv_->setCursor(makeDocIterator(it, min(pos, it->size())));
bv_->update(Update::FitCursor);
break;
}
}
}
}
@ -434,7 +434,7 @@ void BufferView::Pimpl::setBuffer(Buffer * b)
BOOST_ASSERT(i>0);
--i;
}
}
}
if (buffer_ && lyx::graphics::Previews::status() != LyXRC::PREVIEW_OFF)
lyx::graphics::Previews::get().generateBufferPreviews(*buffer_);
@ -491,7 +491,7 @@ void BufferView::Pimpl::updateScrollbar()
// estimated average paragraph height:
if (wh_ == 0)
wh_ = workarea().workHeight() / 4;
wh_ = workarea().workHeight() / 4;
int h = t.getPar(anchor_ref_).height();
// Normalize anchor/offset (MV):
@ -506,7 +506,7 @@ void BufferView::Pimpl::updateScrollbar()
for (lyx::pit_type pit = anchor_ref_; pit <= parsize; ++pit) {
if (sumh > workarea().workHeight())
break;
int const h2 = t.getPar(pit).height();
int const h2 = t.getPar(pit).height();
sumh += h2;
nh++;
}
@ -514,9 +514,9 @@ void BufferView::Pimpl::updateScrollbar()
// More realistic average paragraph height
if (hav > wh_)
wh_ = hav;
workarea().setScrollbarParams((parsize + 1) * wh_,
anchor_ref_ * wh_ + int(offset_ref_ * wh_ / float(h)),
workarea().setScrollbarParams((parsize + 1) * wh_,
anchor_ref_ * wh_ + int(offset_ref_ * wh_ / float(h)),
int(wh_ * defaultRowHeight() / float(h)));
}
@ -706,11 +706,11 @@ bool BufferView::Pimpl::multiParSel()
void BufferView::Pimpl::update(Update::flags flags)
{
lyxerr[Debug::DEBUG]
<< BOOST_CURRENT_FUNCTION
<< "[fitcursor = " << (flags & Update::FitCursor)
<< ", forceupdate = " << (flags & Update::Force)
<< ", singlepar = " << (flags & Update::SinglePar)
<< "] buffer: " << buffer_ << endl;
<< BOOST_CURRENT_FUNCTION
<< "[fitcursor = " << (flags & Update::FitCursor)
<< ", forceupdate = " << (flags & Update::Force)
<< ", singlepar = " << (flags & Update::SinglePar)
<< "] buffer: " << buffer_ << endl;
// Check needed to survive LyX startup
if (buffer_) {
@ -853,7 +853,7 @@ void BufferView::Pimpl::saveSavedPositions()
for (unsigned int i=1; i < saved_positions_num; ++i) {
if ( isSavedPosition(i) )
LyX::ref().session().saveBookmark( boost::tie(
i,
i,
saved_positions[i].filename,
saved_positions[i].par_id,
saved_positions[i].par_pos) );
@ -946,7 +946,7 @@ void BufferView::Pimpl::MenuInsertLyXFile(string const & filenm)
Buffer buf("", false);
buf.error.connect(boost::bind(&BufferView::Pimpl::addError, this, _1));
if (::loadLyXFile(&buf, MakeAbsPath(filename))) {
lyx::cap::pasteParagraphList(cursor_, buf.paragraphs(),
lyx::cap::pasteParagraphList(cursor_, buf.paragraphs(),
buf.params().textclass);
res = _("Document %1$s inserted.");
} else
@ -1257,7 +1257,7 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & cmd)
updateCounters(*buffer_);
update();
}
case LFUN_GOTOERROR:
bv_funcs::gotoInset(bv_, InsetBase::ERROR_CODE, false);
break;
@ -1424,7 +1424,7 @@ ViewMetricsInfo BufferView::Pimpl::metrics(bool singlepar)
// Rebreak anchor paragraph. In Single Paragraph mode, rebreak only
// the (main text, not inset!) paragraph containing the cursor.
// (if this paragraph contains insets etc., rebreaking will
// (if this paragraph contains insets etc., rebreaking will
// recursively descend)
if (!singlepar || pit == cursor_.bottom().pit())
text->redoParagraph(pit);
@ -1476,8 +1476,8 @@ ViewMetricsInfo BufferView::Pimpl::metrics(bool singlepar)
y += text->getPar(pit).ascent();
theCoords.parPos()[text][pit] = Point(0, y);
if (singlepar && pit == cursor_.bottom().pit()) {
// In Single Paragraph mode, collect here the
// y1 and y2 of the (one) paragraph the cursor is in
// In Single Paragraph mode, collect here the
// y1 and y2 of the (one) paragraph the cursor is in
y1 = y - text->getPar(pit).ascent();
y2 = y + text->getPar(pit).descent();
}
@ -1489,17 +1489,17 @@ ViewMetricsInfo BufferView::Pimpl::metrics(bool singlepar)
pit1 = cursor_.bottom().pit();
pit2 = cursor_.bottom().pit();
}
lyxerr[Debug::DEBUG]
<< BOOST_CURRENT_FUNCTION
<< " y1: " << y1
<< " y2: " << y2
<< " pit1: " << pit1
<< " pit2: " << pit2
<< " npit: " << npit
<< " singlepar: " << singlepar
<< "size: " << size
<< endl;
<< BOOST_CURRENT_FUNCTION
<< " y1: " << y1
<< " y2: " << y2
<< " pit1: " << pit1
<< " pit2: " << pit2
<< " npit: " << npit
<< " singlepar: " << singlepar
<< "size: " << size
<< endl;
return ViewMetricsInfo(pit1, pit2, y1, y2, singlepar, size);
}

View File

@ -200,6 +200,6 @@ private:
ViewMetricsInfo metrics(bool singlepar = false);
/// Working variable indicating a full screen refresh
mutable bool refresh_inside_;
};
#endif // BUFFERVIEW_PIMPL_H

View File

@ -38,10 +38,10 @@ int const nohue = -1;
int hexstrToInt(string const & str)
{
int val = 0;
istringstream is(str);
is >> std::setbase(16) >> val;
return val;
int val = 0;
istringstream is(str);
is >> std::setbase(16) >> val;
return val;
}
} // namespace anon

View File

@ -69,7 +69,7 @@ typedef limited_stack<pair<ParagraphList, textclass_type> > CutStack;
CutStack theCuts(10);
// store whether the tabular stack is newer than the normal copy stack
// FIXME: this is a workaround for bug 1919. Should be removed for 1.5,
// FIXME: this is a workaround for bug 1919. Should be removed for 1.5,
// when we (hopefully) have a one-for-all paste mechanism.
bool dirty_tabular_stack_;
@ -105,9 +105,9 @@ bool checkPastePossible(int index)
pair<PitPosPair, pit_type>
pasteSelectionHelper(Buffer const & buffer,
pasteSelectionHelper(Buffer const & buffer,
ParagraphList & pars, pit_type pit, int pos,
ParagraphList const & parlist, textclass_type textclass,
ParagraphList const & parlist, textclass_type textclass,
ErrorList & errorlist)
{
if (parlist.empty())
@ -216,15 +216,15 @@ pasteSelectionHelper(Buffer const & buffer,
if (empty) {
pars.insert(boost::next(pars.begin(), pit),
insertion.begin(),
insertion.end());
insertion.end());
// merge the empty par with the last par of the insertion
mergeParagraph(buffer.params(), pars,
pit + insertion.size() - 1);
pit + insertion.size() - 1);
} else {
pars.insert(boost::next(pars.begin(), pit + 1),
insertion.begin(),
insertion.end());
insertion.end());
// merge the first par of the insertion with the current par
mergeParagraph(buffer.params(), pars, pit);
@ -262,12 +262,12 @@ PitPosPair eraseSelectionHelper(BufferParams const & params,
pit_type startpit, pit_type endpit,
int startpos, int endpos, bool doclear)
{
// Start of selection is really invalid.
// Start of selection is really invalid.
if (startpit == pit_type(pars.size()) ||
(startpos > pars[startpit].size()))
return PitPosPair(endpit, endpos);
// Start and end is inside same paragraph
// Start and end is inside same paragraph
if (endpit == pit_type(pars.size()) ||
startpit == endpit) {
endpos -= pars[startpit].erase(startpos, endpos);
@ -296,7 +296,7 @@ PitPosPair eraseSelectionHelper(BufferParams const & params,
--endpit;
if (pit == endpit)
endpos += thissize;
} else
} else
++pit;
}
@ -584,8 +584,8 @@ std::string getSelection(Buffer const & buf, size_t sel_index)
}
void pasteParagraphList(LCursor & cur, ParagraphList const & parlist,
textclass_type textclass)
void pasteParagraphList(LCursor & cur, ParagraphList const & parlist,
textclass_type textclass)
{
if (cur.inTexted()) {
LyXText * text = cur.text();
@ -599,10 +599,10 @@ void pasteParagraphList(LCursor & cur, ParagraphList const & parlist,
boost::tie(ppp, endpit) =
pasteSelectionHelper(cur.buffer(),
text->paragraphs(),
cur.pit(), cur.pos(),
parlist, textclass,
el);
text->paragraphs(),
cur.pit(), cur.pos(),
parlist, textclass,
el);
bufferErrors(cur.buffer(), el);
updateCounters(cur.buffer());
cur.clearSelection();

View File

@ -58,8 +58,8 @@ void copySelection(LCursor & cur);
void pasteSelection(LCursor & cur, size_t sel_index = 0);
///
void pasteParagraphList(LCursor & cur, ParagraphList const & parlist,
textclass_type textclass);
void pasteParagraphList(LCursor & cur, ParagraphList const & parlist,
textclass_type textclass);
/** Needed to switch between different classes. This works
@ -91,7 +91,7 @@ void selClearOrDel(LCursor & cur);
void selPaste(LCursor & cur, size_t n);
/** Tabular has its own paste stack for multiple cells
* but it needs to know whether there is a more recent
* but it needs to know whether there is a more recent
* ordinary paste. Therefore which one is newer.
*/
//FIXME: this is a workaround for bug 1919. Replace this by

View File

@ -188,7 +188,7 @@ string const LColor::getX11Name(LColor::color c) const
return it->second.x11name;
lyxerr << "LyX internal error: Missing color"
" entry in LColor.C for " << c << '\n'
" entry in LColor.C for " << c << '\n'
<< "Using black." << endl;
return "black";
}

View File

@ -50,7 +50,7 @@ LaTeXFeatures::PackagesList LaTeXFeatures::packages_;
LaTeXFeatures::LaTeXFeatures(Buffer const & b, BufferParams const & p,
OutputParams const & r)
OutputParams const & r)
: buffer_(&b), params_(p), runparams_(r)
{}

View File

@ -42,7 +42,7 @@ class LaTeXFeatures {
public:
///
LaTeXFeatures(Buffer const &, BufferParams const &,
OutputParams const &);
OutputParams const &);
/// The packages needed by the document
std::string const getPackages() const;
/// The macros definitions needed by the document

View File

@ -1575,4 +1575,3 @@ void Buffer::changeRefsIfUnique(string const & from, string const & to)
}
}
}

View File

@ -216,13 +216,13 @@ void bufferErrors(Buffer const & buf, TeXErrors const & terr)
int pos_start = -1;
int errorrow = cit->error_in_line;
bool found = buf.texrow().getIdFromRow(errorrow, id_start,
pos_start);
pos_start);
int id_end = -1;
int pos_end = -1;
do {
++errorrow;
found = buf.texrow().getIdFromRow(errorrow, id_end,
pos_end);
pos_end);
} while (found && id_start == id_end && pos_start == pos_end);
buf.error(ErrorItem(cit->error_desc, cit->error_text,
@ -277,7 +277,7 @@ namespace {
lyx::depth_type getDepth(DocIterator const & it)
{
lyx::depth_type depth = 0;
for (size_t i = 0 ; i < it.depth() ; ++i)
for (size_t i = 0 ; i < it.depth() ; ++i)
if (!it[i].inset().inMathed())
depth += it[i].paragraph().getDepth() + 1;
// remove 1 since the outer inset does not count
@ -285,12 +285,12 @@ lyx::depth_type getDepth(DocIterator const & it)
}
lyx::depth_type getItemDepth(ParIterator const & it)
{
{
Paragraph const & par = *it;
LYX_LABEL_TYPES const labeltype = par.layout()->labeltype;
if (labeltype != LABEL_ENUMERATE && labeltype != LABEL_ITEMIZE)
return 0;
return 0;
// this will hold the lowest depth encountered up to now.
lyx::depth_type min_depth = getDepth(it);
@ -306,12 +306,12 @@ lyx::depth_type getItemDepth(ParIterator const & it)
return 0;
}
}
// We search for the first paragraph with same label
// that is not more deeply nested.
Paragraph & prev_par = *prev_it;
lyx::depth_type const prev_depth = getDepth(prev_it);
if (labeltype == prev_par.layout()->labeltype) {
if (labeltype == prev_par.layout()->labeltype) {
if (prev_depth < min_depth) {
return prev_par.itemdepth + 1;
}
@ -545,5 +545,3 @@ string expandLabel(Buffer const & buf,
return tclass.counters().counterLabel(fmt);
}

View File

@ -414,7 +414,7 @@ string const BufferParams::readToken(LyXLex & lex, string const & token)
bformat(_("The document uses a missing "
"TeX class \"%1$s\".\n"), classname);
Alert::warning(_("Document class not available"),
msg + _("LyX will not be able to produce output."));
msg + _("LyX will not be able to produce output."));
}
} else if (token == "\\begin_preamble") {
readPreamble(lex);

View File

@ -277,7 +277,7 @@ bool findInset(DocIterator & dit, vector<InsetBase_code> const & codes,
} else
return false;
}
dit = tmpdit;
return true;
}

View File

@ -502,8 +502,8 @@ bool Converters::move(string const & fmt,
if (!moved && no_errors) {
Alert::error(_("Cannot convert file"),
bformat(copy ?
_("Could not copy a temporary file from %1$s to %2$s.") :
_("Could not move a temporary file from %1$s to %2$s."),
_("Could not copy a temporary file from %1$s to %2$s.") :
_("Could not move a temporary file from %1$s to %2$s."),
from2, to2));
no_errors = false;
}
@ -515,7 +515,7 @@ bool Converters::move(string const & fmt,
bool Converters::convert(Buffer const * buffer,
string const & from_file, string const & to_file_base,
string const & from_format, string const & to_format,
bool try_default)
bool try_default)
{
string to_file;
return convert(buffer, from_file, to_file_base, from_format, to_format,

View File

@ -107,12 +107,12 @@ public:
bool convert(Buffer const * buffer,
std::string const & from_file, std::string const & to_file_base,
std::string const & from_format, std::string const & to_format,
std::string & to_file, bool try_default = false);
std::string & to_file, bool try_default = false);
///
bool convert(Buffer const * buffer,
std::string const & from_file, std::string const & to_file_base,
std::string const & from_format, std::string const & to_format,
bool try_default = false);
bool try_default = false);
///
void update(Formats const & formats);
///

View File

@ -143,7 +143,7 @@ public:
{
return boundary ? slices1_ : slices0_;
}
private:
/// MathArrays
CoordCacheBase<MathArray> arrays_;

View File

@ -138,7 +138,7 @@ namespace {
et.pit() = boost::prior(cache.end())->first;
if (et.pit() >= et.lastpit())
et = doc_iterator_end(inset);
else
else
++et.pit();
double best_dist = std::numeric_limits<double>::max();;
@ -189,8 +189,8 @@ namespace {
//lyxerr << "Pit start: " << from << endl;
//lyxerr << "bruteFind3: x: " << x << " y: " << y
// << " xlow: " << xlow << " xhigh: " << xhigh
// << " ylow: " << ylow << " yhigh: " << yhigh
// << " xlow: " << xlow << " xhigh: " << xhigh
// << " ylow: " << ylow << " yhigh: " << yhigh
// << endl;
InsetBase & inset = bv.buffer()->inset();
DocIterator it = doc_iterator_begin(inset);
@ -1015,7 +1015,7 @@ bool LCursor::goUpDown(bool up)
// FIXME: Switch this on for more robust movement
#if 0
return bruteFind3(*this, xo, yo, up);
return bruteFind3(*this, xo, yo, up);
#else
//xarray().boundingBox(xlow, xhigh, ylow, yhigh);

View File

@ -300,7 +300,7 @@ void DocIterator::forwardPos(bool ignorecollapsed)
// jump over collapsables if they are collapsed
// FIXME: the check for asMathInset() shouldn't be necessary
// but math insets do not return a sensible editable() state yet.
if (ignorecollapsed && nextInset() && (!nextInset()->asMathInset()
if (ignorecollapsed && nextInset() && (!nextInset()->asMathInset()
&& nextInset()->editable() != InsetBase::HIGHLY_EDITABLE)) {
++top().pos();
return;
@ -512,7 +512,7 @@ bool DocIterator::hasPart(DocIterator const & it) const
}
void DocIterator::updateInsets(InsetBase * inset)
void DocIterator::updateInsets(InsetBase * inset)
{
// this function re-creates the cache of inset pointers.
// code taken in part from StableDocIterator::asDocIterator.
@ -587,4 +587,3 @@ bool operator==(StableDocIterator const & dit1, StableDocIterator const & dit2)
{
return dit1.data_ == dit2.data_;
}

View File

@ -76,11 +76,11 @@ int checkOverwrite(string const & filename)
if (fs::exists(filename)) {
string text = bformat(_("The file %1$s already exists.\n\n"
"Do you want to over-write that file?"),
MakeDisplayPath(filename));
MakeDisplayPath(filename));
return Alert::prompt(_("Over-write file?"),
text, 0, 2,
_("&Over-write"), _("Over-write &all"),
_("&Cancel export"));
text, 0, 2,
_("&Over-write"), _("Over-write &all"),
_("&Cancel export"));
}
return 0;
}
@ -102,8 +102,8 @@ enum CopyStatus {
* - CANCEL if the export should be cancelled
*/
CopyStatus copyFile(string const & format,
string const & sourceFile, string const & destFile,
string const & latexFile, bool force)
string const & sourceFile, string const & destFile,
string const & latexFile, bool force)
{
CopyStatus ret = force ? FORCE : SUCCESS;
@ -130,9 +130,9 @@ CopyStatus copyFile(string const & format,
Mover const & mover = movers(format);
if (!mover.copy(sourceFile, destFile, latexFile))
Alert::error(_("Couldn't copy file"),
bformat(_("Copying %1$s to %2$s failed."),
MakeDisplayPath(sourceFile),
MakeDisplayPath(destFile)));
bformat(_("Copying %1$s to %2$s failed."),
MakeDisplayPath(sourceFile),
MakeDisplayPath(destFile)));
return ret;
}
@ -222,7 +222,7 @@ bool Exporter::Export(Buffer * buffer, string const & format,
if (!put_in_tempdir) {
string const tmp_result_file = result_file;
result_file = ChangeExtension(buffer->fileName(),
formats.extension(format));
formats.extension(format));
// We need to copy referenced files (e. g. included graphics
// if format == "dvi") to the result dir.
vector<ExportedFile> const files =
@ -234,24 +234,24 @@ bool Exporter::Export(Buffer * buffer, string const & format,
string const fmt =
formats.getFormatFromFile(it->sourceName);
status = copyFile(fmt, it->sourceName,
MakeAbsPath(it->exportName, dest),
it->exportName, status == FORCE);
MakeAbsPath(it->exportName, dest),
it->exportName, status == FORCE);
}
if (status == CANCEL) {
buffer->message(_("Document export cancelled."));
} else if (fs::exists(tmp_result_file)) {
// Finally copy the main file
status = copyFile(format, tmp_result_file,
result_file, result_file,
status == FORCE);
result_file, result_file,
status == FORCE);
buffer->message(bformat(_("Document exported as %1$s "
"to file `%2$s'"),
formats.prettyName(format),
MakeDisplayPath(result_file)));
"to file `%2$s'"),
formats.prettyName(format),
MakeDisplayPath(result_file)));
} else {
// This must be a dummy converter like fax (bug 1888)
buffer->message(bformat(_("Document exported as %1$s"),
formats.prettyName(format)));
formats.prettyName(format)));
}
}

View File

@ -73,15 +73,15 @@ public:
* or relative to the exported document.
*/
void addExternalFile(std::string const & format,
std::string const & sourceName,
std::string const & exportName);
std::string const & sourceName,
std::string const & exportName);
/** add a referenced file for one format.
* The final name is the source file name without path.
* \param format format that references the given file
* \param sourceName source file name. Needs to be absolute
*/
void addExternalFile(std::string const & format,
std::string const & sourceName);
std::string const & sourceName);
/// get referenced files for \p format
std::vector<ExportedFile> const
externalFiles(std::string const & format) const;

View File

@ -164,7 +164,7 @@ InsetBase * createInset(BufferView * bv, FuncRequest const & cmd)
}
case LFUN_TABULAR_INSERT: {
if (cmd.argument.empty())
if (cmd.argument.empty())
return 0;
std::istringstream ss(cmd.argument);
int r = 0, c = 0;
@ -475,9 +475,9 @@ InsetBase * readInset(LyXLex & lex, Buffer const & buf)
MacroTable::globalMacros().insert
(tmpl->name(), tmpl->asMacroData());
lyxerr[Debug::DEBUG]
<< BOOST_CURRENT_FUNCTION
<< ": creating local macro " << tmpl->name()
<< endl;
<< BOOST_CURRENT_FUNCTION
<< ": creating local macro " << tmpl->name()
<< endl;
}
}

View File

@ -135,12 +135,12 @@ string Formats::getFormatFromFile(string const & filename) const
// try to find a format from the file extension.
string const ext(lyx::support::GetExtension(filename));
if (!ext.empty()) {
if (!ext.empty()) {
// this is ambigous if two formats have the same extension,
// but better than nothing
Formats::const_iterator cit =
find_if(formatlist.begin(), formatlist.end(),
FormatExtensionsEqual(ext));
FormatExtensionsEqual(ext));
if (cit != formats.end()) {
lyxerr[Debug::GRAPHICS]
<< "\twill guess format from file extension: "
@ -270,7 +270,7 @@ bool Formats::view(Buffer const & buffer, string const & filename,
bool Formats::edit(Buffer const & buffer, string const & filename,
string const & format_name) const
string const & format_name) const
{
if (filename.empty())
return false;

View File

@ -99,8 +99,8 @@ 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);
std::string const & prettyname, std::string const & shortcut,
std::string const & viewer, std::string const & editor);
///
void erase(std::string const & name);
///

View File

@ -29,7 +29,7 @@ namespace Alert {
* slap you with fish, and not in an enjoyable way either.
*/
int prompt(std::string const & title, std::string const & question,
int default_button, int cancel_button,
int default_button, int cancel_button,
std::string const & b1, std::string const & b2, std::string const & b3 = std::string());
/**

View File

@ -38,9 +38,9 @@ void Painter::buttonFrame(int x, int y, int w, int h)
fillRectangle(x, y + h - d, w, d, LColor::bottom);
for (int i = 0 ; i < d ; ++i) {
line(x + i, y + i,
line(x + i, y + i,
x + i, y + h - 1 - i, LColor::left);
line(x + w - 1 - i, y + i + 1,
line(x + w - 1 - i, y + i + 1,
x + w - 1 - i, y + h - 1 - i, LColor::right);
}
}

View File

@ -176,5 +176,3 @@ void layoutSelected(LyXView & lv, string const & name)
lyxerr << "ERROR (layoutSelected): layout not found!"
<< endl;
}

View File

@ -40,7 +40,7 @@ public:
/// Are there changes to be merged at current location?
bool changed();
/// return date of change
std::string const getChangeDate();

View File

@ -120,9 +120,9 @@ void ControlDocument::dispatchParams()
string const str = current_branch + ' ' + x11hexname;
kernel().dispatch(FuncRequest(LFUN_SET_COLOR, str));
}
// Open insets of selected branches, close deselected ones
kernel().dispatch(FuncRequest(LFUN_ALL_INSETS_TOGGLE,
kernel().dispatch(FuncRequest(LFUN_ALL_INSETS_TOGGLE,
"assign branch"));
}
// update the bufferview

View File

@ -72,7 +72,7 @@ void ControlErrorList::goTo(int item)
// This should be implemented using an LFUN. (Angus)
// if pos_end is 0, this means it is end-of-paragraph
pos_type const end = err.pos_end ? std::min(err.pos_end, pit->size())
: pit->size();
: pit->size();
pos_type const start = std::min(err.pos_start, end);
pos_type const range = end - start;
DocIterator const dit = makeDocIterator(pit, start);

View File

@ -68,7 +68,7 @@ namespace {
SpellBase * getSpeller(BufferParams const & bp)
{
string lang = (lyxrc.isp_use_alt_lang)
? lyxrc.isp_alt_lang
? lyxrc.isp_alt_lang
: bp.language->code();
#if defined(USE_ASPELL)
@ -265,7 +265,7 @@ bool ControlSpellchecker::checkAlive()
message = _("The spellchecker has died for some reason.\n"
"Maybe it has been killed.");
else
message = _("The spellchecker has failed.\n")
message = _("The spellchecker has failed.\n")
+ speller_->error();
dialog().CancelButton();

View File

@ -40,7 +40,7 @@ void ControlToc::goTo(toc::TocItem const & item)
void ControlToc::outline(toc::OutlineOp op)
{
std::ostringstream o;
o << op << std::flush;
o << op << std::flush;
kernel().dispatch(FuncRequest(LFUN_OUTLINE, o.str()));
}

View File

@ -188,7 +188,7 @@ public:
virtual bool disconnectOnApply() const { return false; }
/** \return true if Dialog::View::show() should not display the dialog
* after running update. Currently, only ControlSpellchecker
* after running update. Currently, only ControlSpellchecker
* makes use of that.
*/
virtual bool exitEarly() const { return false; }

View File

@ -441,7 +441,7 @@ searchKeys(InfoMap const & theMap,
if (type == SIMPLE)
// We must escape special chars in the search_expr so that
// it is treated as a simple string by boost::regex.
expr = escape_special_chars(expr);
expr = escape_special_chars(expr);
try {
// Build the functor that will be passed to find_if.
@ -456,7 +456,7 @@ searchKeys(InfoMap const & theMap,
vector<string>::const_reverse_iterator rit(start);
vector<string>::const_reverse_iterator rend = keys.rend();
rit = std::find_if(rit, rend, match);
if (rit == rend)
return keys.end();
// This is correct and always safe.

View File

@ -83,7 +83,7 @@ void QCitationDialog::openFind()
if (form_->readOnly())
return;
if (isVisible() && selectedLB->count() == 0
if (isVisible() && selectedLB->count() == 0
&& add_->availableLB->count() != 0){
// open the find dialog
add();

View File

@ -262,7 +262,7 @@ void QContentPane::wheelEvent(QWheelEvent * e)
// documentation of QWheelEvent)
int const lines = QApplication::wheelScrollLines() * e->delta() / 120;
wa_->scrollbar_->setValue(wa_->scrollbar_->value() -
lines * wa_->scrollbar_->lineStep());
lines * wa_->scrollbar_->lineStep());
}

View File

@ -46,7 +46,7 @@ char const encode(string const & encoding, QString const & str)
EncodingMap::const_iterator cit = encoding_map.find(encoding);
if (cit == encoding_map.end()) {
lyxerr[Debug::KEY] << "Unrecognised encoding '" << encoding
<< "'." << endl;
<< "'." << endl;
codec = encoding_map.find("")->second;
} else {
codec = cit->second;
@ -54,7 +54,7 @@ char const encode(string const & encoding, QString const & str)
if (!codec) {
lyxerr[Debug::KEY] << "No codec for encoding '" << encoding
<< "' found." << endl;
<< "' found." << endl;
return 0;
}
@ -88,14 +88,14 @@ void initEncodings()
}
}
if (s.find("UTF") != string::npos || s.find("utf") != string::npos)
if (s.find("UTF") != string::npos || s.find("utf") != string::npos)
//if (contains(c, "UTF") || contains(c, "utf"))
lyxerr[Debug::KEY] << "Warning: this system's locale uses Unicode." << endl;
// strip off any encoding suffix
string::size_type i = s.find(".");
s = s.substr(0, i);
encoding_map["iso8859-1"] = QTextCodec::codecForName("ISO 8859-1");
encoding_map["iso8859-2"] = QTextCodec::codecForName("ISO 8859-2");
encoding_map["iso8859-3"] = QTextCodec::codecForName("ISO 8859-3");

View File

@ -440,7 +440,7 @@ void setComboxFont(QComboBox * cb, string const & family, string const & foundry
font.setFamily(family.c_str());
} else {
lyxerr << "FAILED to find the default font: '"
<< foundry << "', '" << family << '\''<< endl;
<< foundry << "', '" << family << '\''<< endl;
return;
}
@ -459,7 +459,7 @@ void setComboxFont(QComboBox * cb, string const & family, string const & foundry
}
lyxerr << "FAILED to find the font: '"
<< foundry << "', '" << family << '\'' <<endl;
<< foundry << "', '" << family << '\'' <<endl;
}
} // end namespace anon

View File

@ -109,7 +109,7 @@ void QToc::updateToc(int newdepth)
QListViewItem * item;
QListViewItem * selected_item = 0;
bool multiple = false;
// Yes, it is this ugly. Two reasons - root items must have
// a QListView parent, rather than QListViewItem; and the
// TOC can move in and out an arbitrary number of levels
@ -173,7 +173,7 @@ void QToc::updateToc(int newdepth)
dialog_->tocLV->setUpdatesEnabled(true);
dialog_->tocLV->update();
if (!multiple) {
dialog_->tocLV->scrollBy(0, selected_item->itemPos()
dialog_->tocLV->scrollBy(0, selected_item->itemPos()
- dialog_->tocLV->height() / 2);
dialog_->tocLV->setSelected(selected_item, true);
}

View File

@ -239,24 +239,24 @@ void start(string const & batch, vector<string> const & files)
val = LyX::ref().session().loadSessionInfo("WindowHeight");
if (val != "")
height = convert<unsigned int>(val);
}
}
boost::shared_ptr<QtView> view_ptr(new QtView(width, height));
LyX::ref().addLyXView(view_ptr);
QtView & view = *view_ptr.get();
// if user wants to restore window position
if (lyxrc.geometry_xysaved) {
QPoint p = view.pos();
string val = LyX::ref().session().loadSessionInfo("WindowPosX");
if (val != "")
p.setX(convert<unsigned int>(val));
p.setX(convert<unsigned int>(val));
val = LyX::ref().session().loadSessionInfo("WindowPosY");
if (val != "")
p.setY(convert<unsigned int>(val));
view.move(p);
}
}
view.show();
view.init();

View File

@ -44,7 +44,7 @@ PanelStack::PanelStack(QWidget * parent, const char * name)
w->hide();
connect(list_, SIGNAL(currentChanged(QListViewItem*)),
this, SLOT(switchPanel(QListViewItem *)));
this, SLOT(switchPanel(QListViewItem *)));
QHBoxLayout * layout = new QHBoxLayout(this);
layout->addWidget(list_, 0);

View File

@ -238,9 +238,9 @@ FontLoader::FontLoader()
void FontLoader::update()
{
for (int i1 = 0; i1 < LyXFont::NUM_FAMILIES; ++i1)
for (int i2 = 0; i2 < 2; ++i2)
for (int i3 = 0; i3 < 4; ++i3)
for (int i1 = 0; i1 < LyXFont::NUM_FAMILIES; ++i1)
for (int i2 = 0; i2 < 2; ++i2)
for (int i3 = 0; i3 < 4; ++i3)
for (int i4 = 0; i4 < 10; ++i4) {
delete fontinfo_[i1][i2][i3][i4];
fontinfo_[i1][i2][i3][i4] = 0;

View File

@ -78,7 +78,7 @@ public:
/// Called the first time when available() can't load a symbol font
static void addToFontPath();
/// Get font info (font + metrics) for the given LyX font.
/// Get font info (font + metrics) for the given LyX font.
QLFontInfo & fontinfo(LyXFont const & f) {
QLFontInfo * & fi =
fontinfo_[f.family()][f.series()][f.realShape()][f.size()];

View File

@ -141,7 +141,7 @@ int width(char const * s, size_t ls, LyXFont const & f)
Encoding const * encoding = fontencoding(f);
QLFontInfo & fi = fontloader.fontinfo(f);
if (ls == 1)
if (ls == 1)
return fi.width(encoding->ucs(s[0]));
int w = 0;
@ -184,4 +184,3 @@ void buttonText(string const & str, LyXFont const & f,
}
} // namespace font_metrics

View File

@ -35,7 +35,7 @@ public:
/// connect a connection notification from the LyXServerSocket
socket_callback(int fd, boost::function<void()> func);
public slots:
void data_received();
void data_received();
private:
/// our notifier
boost::scoped_ptr<QSocketNotifier> sn_;

View File

@ -127,7 +127,7 @@ QValidator::State PathValidator::validate(QString & qtext, int &) const
string const text = lyx::support::trim(fromqstr(qtext));
if (text.empty())
return acceptable_if_empty_ ?
return acceptable_if_empty_ ?
QValidator::Acceptable : QValidator::Intermediate;
string invalid_chars("#$%{}()[]\"^");

View File

@ -52,7 +52,7 @@ void QBranches::update(BufferParams const & params)
void QBranches::update()
{
// store the selected branch
Q3ListViewItem * selItem =
branchesLV->selectedItem();

View File

@ -30,13 +30,13 @@ namespace lyx {
namespace frontend {
class QBranches: public QWidget, public Ui::BranchesUi
class QBranches: public QWidget, public Ui::BranchesUi
{
Q_OBJECT
public:
QBranches(QWidget * parent=0, Qt::WFlags f=0);
~QBranches();
void update(BufferParams const & params);
void apply(BufferParams & params) const;

View File

@ -40,7 +40,7 @@ QBrowseBox::QBrowseBox(int rows, int cols, QWidget* parent, const char * name, Q
setFrameStyle(QFrame::WinPanel | QFrame::Raised);
setVScrollBarMode(Q3ScrollView::AlwaysOff);
setHScrollBarMode(Q3ScrollView::AlwaysOff);

View File

@ -98,7 +98,7 @@ void QCitation::build_dialog()
void QCitation::update_contents()
{
QStringList keys;
// Make the list of all available bibliography keys
toQStringList(keys,
biblio::getKeys(controller().bibkeysInfo()));
@ -160,14 +160,14 @@ void QCitation::addKeys(QModelIndexList const & indexes)
return;
QStringList keys = selected_keys_.stringList();
foreach(index, indexes) {
if (keys.indexOf(index.data().toString()) == -1)
keys.append(index.data().toString());
}
selected_keys_.setStringList(keys);
changed();
}
@ -179,7 +179,7 @@ void QCitation::deleteKeys(QModelIndexList const & indexes)
return;
QStringList keys = selected_keys_.stringList();
foreach(index, indexes) {
int const pos = keys.indexOf(index.data().toString());
if (pos != -1)
@ -187,7 +187,7 @@ void QCitation::deleteKeys(QModelIndexList const & indexes)
}
selected_keys_.setStringList(keys);
changed();
}
@ -203,7 +203,7 @@ void QCitation::upKey(QModelIndexList const & indexes)
QStringList keys = selected_keys_.stringList();
keys.swap(pos, pos-1);
selected_keys_.setStringList(keys);
changed();
}
@ -219,7 +219,7 @@ void QCitation::downKey(QModelIndexList const & indexes)
QStringList keys = selected_keys_.stringList();
keys.swap(pos, pos+1);
selected_keys_.setStringList(keys);
changed();
}

View File

@ -31,15 +31,15 @@ public:
///
QCitation(Dialog &);
QStringListModel * available()
QStringListModel * available()
{ return &available_keys_; }
QStringListModel * selected()
QStringListModel * selected()
{ return &selected_keys_; }
QStringListModel * found()
QStringListModel * found()
{ return &found_keys_; }
QModelIndex findKey(QString const & str, QModelIndex const & index) const;
QModelIndex findKey(QString const & str) const;

View File

@ -60,7 +60,7 @@ QCitationDialog::QCitationDialog(QCitation * form)
: form_(form)
{
setupUi(this);
/* connect(restorePB, SIGNAL(clicked()),
form, SLOT(slotRestore()));
connect(okPB, SIGNAL(clicked()),
@ -99,7 +99,7 @@ QCitationDialog::QCitationDialog(QCitation * form)
// find_ = new QCitationFind(form_, this);
// connect(selectedLV, SIGNAL(doubleClicked(const QModelIndex & index)),
// form_, SLOT(on_okPB_clicked()));//SLOT(slotOK()));
}
@ -229,7 +229,7 @@ void QCitationDialog::fillStyles()
if (selectedLV->selectionModel()->selectedIndexes().empty())
return;
int curr = selectedLV->selectionModel()->selectedIndexes()[0].row();//selectedLV->currentItem();
string key = fromqstr(selected_keys[curr]);
@ -261,7 +261,7 @@ void QCitationDialog::setButtons()
int sel_nr=-1;
if (! selectedLV->selectionModel()->selectedIndexes().empty()) {
sel_nr =
sel_nr =
selectedLV->selectionModel()->selectedIndexes()[0].row();
}

View File

@ -46,7 +46,7 @@ public:
protected slots:
// void on_selectedLB_currentChanged(Q3ListBoxItem*);
void on_okPB_clicked();
void on_cancelPB_clicked();
void on_restorePB_clicked();

View File

@ -42,7 +42,7 @@ namespace lyx {
namespace frontend {
typedef QController<ControlDocument, QView<QDocumentDialog> > base_class;
QDocument::QDocument(Dialog & parent)
: base_class(parent, _("Document Settings"))

View File

@ -67,7 +67,7 @@ char const * encodings[] = { "LaTeX default", "latin1", "latin2",
}
QDocumentDialog::QDocumentDialog(QDocument * form)
: form_(form),
: form_(form),
lang_(getSecond(getLanguageData(false)))
{
setupUi(this);
@ -80,7 +80,7 @@ QDocumentDialog::QDocumentDialog(QDocument * form)
form, SLOT(slotClose()));
connect(restorePB, SIGNAL(clicked()),
form, SLOT(slotRestore()));
connect( savePB, SIGNAL( clicked() ), this, SLOT( saveDefaultClicked() ) );
connect( defaultPB, SIGNAL( clicked() ), this, SLOT( useDefaultsClicked() ) );
@ -136,13 +136,13 @@ QDocumentDialog::QDocumentDialog(QDocument * form)
qt_("Double"), Spacing::Double);
textLayoutModule->lspacingCO->insertItem(
qt_("Custom"), Spacing::Other);
// initialize the length validator
addCheckedLineEdit(form_->bcview(), textLayoutModule->skipLE);
pageLayoutModule = new UiWidget<Ui::PageLayoutUi>;
// page layout
connect(pageLayoutModule->papersizeCO, SIGNAL(activated(int)), this, SLOT(setCustomPapersize(int)));
@ -166,7 +166,7 @@ QDocumentDialog::QDocumentDialog(QDocument * form)
pageLayoutModule->paperheightL);
addCheckedLineEdit(form_->bcview(), pageLayoutModule->paperwidthLE,
pageLayoutModule->paperwidthL);
// paper
QComboBox * cb = pageLayoutModule->papersizeCO;
cb->insertItem(qt_("Default"));
@ -208,7 +208,7 @@ QDocumentDialog::QDocumentDialog(QDocument * form)
connect(marginsModule->headsepLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
connect(marginsModule->headsepUnit, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
connect(marginsModule->footskipLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
connect(marginsModule->footskipUnit, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
connect(marginsModule->footskipUnit, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
marginsModule->topLE->setValidator(unsignedLengthValidator(
marginsModule->topLE));
marginsModule->bottomLE->setValidator(unsignedLengthValidator(
@ -240,7 +240,7 @@ QDocumentDialog::QDocumentDialog(QDocument * form)
marginsModule->footskipL);
langModule = new UiWidget<Ui::LanguageUi>;
@ -298,15 +298,15 @@ QDocumentDialog::QDocumentDialog(QDocument * form)
biblioModule->citeStyleCO->insertItem(qt_("Numerical"));
biblioModule->citeStyleCO->setCurrentItem(0);
mathsModule = new UiWidget<Ui::MathsUi>;
connect( mathsModule->amsautoCB, SIGNAL( toggled(bool) ), mathsModule->amsCB, SLOT( setDisabled(bool) ) );
// maths
connect(mathsModule->amsCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
connect(mathsModule->amsautoCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
latexModule = new UiWidget<Ui::LaTeXUi>;
// latex class
connect(latexModule->classCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
@ -329,12 +329,12 @@ QDocumentDialog::QDocumentDialog(QDocument * form)
latexModule->classCO->insertItem(toqstr(item));
}
}
branchesModule = new QBranches;
connect(branchesModule, SIGNAL(changed()), this, SLOT(change_adaptor()));
preambleModule = new UiWidget<Ui::PreambleUi>;
// preamble
@ -345,7 +345,7 @@ QDocumentDialog::QDocumentDialog(QDocument * form)
// bullets
connect(bulletsModule, SIGNAL(changed()), this, SLOT(change_adaptor()));
floatModule = new FloatPlacement(this);
// float
connect(floatModule, SIGNAL(changed()), this, SLOT(change_adaptor()));
@ -363,7 +363,7 @@ QDocumentDialog::QDocumentDialog(QDocument * form)
docPS->addPanel(branchesModule, _("Branches"));
docPS->addPanel(preambleModule, _("LaTeX Preamble"));
docPS->setCurrentPanel(_("Document Class"));
}
}
QDocumentDialog::~QDocumentDialog()

View File

@ -86,7 +86,7 @@ protected:
void closeEvent(QCloseEvent * e);
private:
UiWidget<Ui::TextLayoutUi> *textLayoutModule;
UiWidget<Ui::PageLayoutUi> *pageLayoutModule;
UiWidget<Ui::MarginsUi> *marginsModule;
@ -96,7 +96,7 @@ private:
UiWidget<Ui::MathsUi> *mathsModule;
UiWidget<Ui::LaTeXUi> *latexModule;
UiWidget<Ui::PreambleUi> *preambleModule;
QBranches *branchesModule;
BulletsModule * bulletsModule;

View File

@ -72,7 +72,7 @@ void QLAction::setAction(FuncRequest const & func)
void QLAction::update()
{
FuncStatus const status = lyxView_.getLyXFunc().getStatus(func_);
this->setChecked(status.onoff(true));
this->setEnabled(status.enabled());
}

View File

@ -87,7 +87,7 @@ Image::FormatList QLImage::loadableFormats()
for (QList<QByteArray>::const_iterator it =qt_formats.begin(); it != qt_formats.end(); ++it) {
lyxerr[Debug::GRAPHICS] << (const char *) *it << ", ";
string ext = lowercase((const char *) *it);
// special case

View File

@ -50,7 +50,7 @@ namespace frontend {
// MacOSX specific stuff is at the end.
QLPopupMenu::QLPopupMenu(QLMenubar * owner,
QLPopupMenu::QLPopupMenu(QLMenubar * owner,
MenuItem const & mi, bool topLevelMenu)
: owner_(owner)
{
@ -76,7 +76,7 @@ void QLPopupMenu::update()
Menu const & fromLyxMenu = owner_->backend().getMenu(name_);
owner_->backend().expand(fromLyxMenu, topLevelMenu_, owner_->view());
if (!owner_->backend().hasMenu(topLevelMenu_.name())) {
lyxerr[Debug::GUI] << "\tWARNING: menu seems empty" << topLevelMenu_.name() << endl;
}
@ -98,28 +98,28 @@ void QLPopupMenu::populate(QMenu* qMenu, Menu * menu)
Menu::const_iterator m = menu->begin();
Menu::const_iterator end = menu->end();
for (; m != end; ++m) {
if (m->kind() == MenuItem::Separator) {
qMenu->addSeparator();
lyxerr[Debug::GUI] << "adding Menubar Separator" << endl;
} else if (m->kind() == MenuItem::Submenu) {
lyxerr[Debug::GUI] << "** creating New Sub-Menu " << getLabel(*m) << endl;
QMenu * subMenu = qMenu->addMenu(toqstr(getLabel(*m)));
populate(subMenu, m->submenu());
} else { // we have a MenuItem::Command
FuncStatus status = m->status();
lyxerr[Debug::GUI] << "creating Menu Item " << m->label() << endl;
string label = getLabel(*m);
addBinding(label, *m);
QLAction * action = new QLAction(*(owner_->view()), label, m->func());
action->setEnabled(m->status().enabled());
action->setChecked(m->status().onoff(true));

View File

@ -31,7 +31,7 @@ class QLPopupMenu : public QMenu {
public:
QLPopupMenu(QLMenubar * owner, MenuItem const & mi, bool topLevelMenu=false);
/// populates the menu or one of its submenu
/// This is used as a recursive function
void populate(QMenu* qMenu, Menu * menu);
@ -48,7 +48,7 @@ private:
/// the name of this menu
std::string name_;
private:
private:
/// Get a Menu item label from the menu backend
std::string const getLabel(MenuItem const & mi);

View File

@ -238,7 +238,7 @@ void QLToolbar::add(FuncRequest const & func, string const & tooltip)
default: {
if (owner_.getLyXFunc().getStatus(func).unknown())
break;
QLAction * action = new QLAction(owner_, toolbarbackend.getIcon(func), "", func, tooltip);
toolbar_->addAction(action);
ActionVector.push_back(action);

View File

@ -62,7 +62,7 @@ class QLToolbar : public QObject, public Toolbar {
Q_OBJECT
public:
QLToolbar(ToolbarBackend::Toolbar const &, LyXView &);
//~QLToolbar();
void add(FuncRequest const & func, std::string const & tooltip);
@ -72,13 +72,13 @@ public:
LayoutBox * layout() const { return layout_.get(); }
private:
std::vector<QLAction *> ActionVector;
QtView & owner_;
QToolBar * toolbar_;
boost::scoped_ptr<QLayoutBox> layout_;
Qt::ToolBarArea tba;
};

View File

@ -49,7 +49,7 @@ char const encode(string const & encoding, QString const & str)
EncodingMap::const_iterator cit = encoding_map.find(encoding);
if (cit == encoding_map.end()) {
lyxerr[Debug::KEY] << "Unrecognised encoding '" << encoding
<< "'." << endl;
<< "'." << endl;
codec = encoding_map.find("")->second;
} else {
codec = cit->second;
@ -57,7 +57,7 @@ char const encode(string const & encoding, QString const & str)
if (!codec) {
lyxerr[Debug::KEY] << "No codec for encoding '" << encoding
<< "' found." << endl;
<< "' found." << endl;
return 0;
}
@ -91,14 +91,14 @@ void initEncodings()
}
}
if (s.find("UTF") != string::npos || s.find("utf") != string::npos)
if (s.find("UTF") != string::npos || s.find("utf") != string::npos)
//if (contains(c, "UTF") || contains(c, "utf"))
lyxerr << "Warning: this system's locale uses Unicode." << endl;
// strip off any encoding suffix
string::size_type i = s.find(".");
s = s.substr(0, i);
encoding_map["iso8859-1"] = QTextCodec::codecForName("ISO 8859-1");
encoding_map["iso8859-2"] = QTextCodec::codecForName("ISO 8859-2");
encoding_map["iso8859-3"] = QTextCodec::codecForName("ISO 8859-3");

View File

@ -113,11 +113,11 @@ QPrefsDialog::QPrefsDialog(QPrefs * form)
connect(asciiModule->asciiLinelengthSB, SIGNAL(valueChanged(int)), this, SLOT(change_adaptor()));
connect(asciiModule->asciiRoffED, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
dateModule = new UiWidget<Ui::QPrefDateUi>(this);
connect(dateModule->DateED, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
keyboardModule = new UiWidget<Ui::QPrefKeyboardUi>(this);
connect( keyboardModule->keymapCB, SIGNAL( toggled(bool) ),
@ -148,7 +148,7 @@ QPrefsDialog::QPrefsDialog(QPrefs * form)
connect(latexModule->latexAutoresetCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
connect(latexModule->latexDviPaperED, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
connect(latexModule->latexPaperSizeCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
@ -202,7 +202,7 @@ QPrefsDialog::QPrefsDialog(QPrefs * form)
screenfontsModule->screenHugerED));
colorsModule = new UiWidget<Ui::QPrefColorsUi>(this);
// FIXME: put in controller
@ -242,7 +242,7 @@ QPrefsDialog::QPrefsDialog(QPrefs * form)
displayModule = new UiWidget<Ui::QPrefDisplayUi>(this);
connect(displayModule->instantPreviewCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
connect(displayModule->displayGraphicsCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
pathsModule = new UiWidget<Ui::QPrefPathsUi>(this);
@ -257,7 +257,7 @@ QPrefsDialog::QPrefsDialog(QPrefs * form)
connect(pathsModule->tempDirED, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
connect(pathsModule->lyxserverDirED, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
connect(pathsModule->pathPrefixED, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
spellcheckerModule = new UiWidget<Ui::QPrefSpellcheckerUi>(this);
@ -283,7 +283,7 @@ QPrefsDialog::QPrefsDialog(QPrefs * form)
#endif
#endif
convertersModule = new UiWidget<Ui::QPrefConvertersUi>(this);
connect(convertersModule->converterNewPB, SIGNAL(clicked()), this, SLOT(new_converter()));
@ -298,7 +298,7 @@ QPrefsDialog::QPrefsDialog(QPrefs * form)
connect(convertersModule->converterRemovePB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
connect(convertersModule->converterModifyPB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
copiersModule = new UiWidget<Ui::QPrefCopiersUi>(this);
connect(copiersModule->copierNewPB, SIGNAL(clicked()), this, SLOT(new_copier()));
@ -311,7 +311,7 @@ QPrefsDialog::QPrefsDialog(QPrefs * form)
connect(copiersModule->copierModifyPB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
connect(copiersModule->copierFormatCO, SIGNAL(activated(const QString&)), this, SLOT(copiers_changed()));
connect(copiersModule->copierED, SIGNAL(textChanged(const QString&)), this, SLOT(copiers_changed()));
@ -329,7 +329,7 @@ QPrefsDialog::QPrefsDialog(QPrefs * form)
connect(fileformatsModule->formatNewPB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
connect(fileformatsModule->formatRemovePB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
connect(fileformatsModule->formatModifyPB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
@ -361,8 +361,8 @@ QPrefsDialog::QPrefsDialog(QPrefs * form)
printerModule = new UiWidget<Ui::QPrefPrinterUi>(this);
connect(printerModule->printerAdaptCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
connect(printerModule->printerCommandED, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
@ -382,7 +382,7 @@ QPrefsDialog::QPrefsDialog(QPrefs * form)
connect(printerModule->printerExtraED, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
connect(printerModule->printerSpoolPrefixED, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
connect(printerModule->printerPaperSizeED, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
@ -1280,9 +1280,9 @@ void QPrefsDialog::apply(LyXRC & rc) const
form_->controller().updateScreenFonts();
}
unsigned int i;
for (i = 0; i < colorsModule->lyxObjectsLB->count(); ++i) {
Q3ListBoxItem * ib(colorsModule->lyxObjectsLB->item(i));
@ -1370,7 +1370,7 @@ void setComboxFont(QComboBox * cb, string const & family, string const & foundry
font.setFamily(family.c_str());
} else {
lyxerr << "FAILED to find the default font: '"
<< foundry << "', '" << family << '\''<< endl;
<< foundry << "', '" << family << '\''<< endl;
return;
}
@ -1389,7 +1389,7 @@ void setComboxFont(QComboBox * cb, string const & family, string const & foundry
}
lyxerr << "FAILED to find the font: '"
<< foundry << "', '" << family << '\'' <<endl;
<< foundry << "', '" << family << '\'' <<endl;
}
} // end namespace anon

View File

@ -65,7 +65,7 @@ public:
QPrefsDialog(QPrefs *);
~QPrefsDialog();
void apply(LyXRC & rc) const;
void update(LyXRC const & rc);

View File

@ -96,8 +96,8 @@ void QRefDialog::refSelected(const QString & sel)
int const cur_item = refsLB->currentItem();
bool const cur_item_selected = cur_item >= 0 ?
refsLB->isSelected(cur_item) : false;
if (cur_item_selected)
if (cur_item_selected)
referenceED->setText(sel);
// <enter> or double click, inserts ref and closes dialog
form_->slotOK();

View File

@ -28,7 +28,7 @@ QSpellcheckerDialog::QSpellcheckerDialog(QSpellchecker * form)
connect(closePB, SIGNAL(clicked()),
form, SLOT(slotClose()));
connect( replaceCO, SIGNAL( highlighted(const QString&) ), this, SLOT( replaceChanged(const QString &) ) );
connect( replacePB, SIGNAL( clicked() ), this, SLOT( replaceClicked() ) );
connect( ignorePB, SIGNAL( clicked() ), this, SLOT( ignoreClicked() ) );

View File

@ -78,7 +78,7 @@ void QTocDialog::on_updatePB_clicked()
form_->update();
}
void QTocDialog::on_depthSL_valueChanged(int depth)
void QTocDialog::on_depthSL_valueChanged(int depth)
{
if (depth == depth_)
return;
@ -208,7 +208,7 @@ void QTocDialog::populateItem(QTreeWidgetItem * parentItem, toc::Toc::const_iter
QTreeWidgetItem * item;
while (iter != form_->get_toclist().end()) {
++iter;
if (iter == form_->get_toclist().end())
@ -248,4 +248,3 @@ void QTocDialog::closeEvent(QCloseEvent * e)
} // namespace frontend
} // namespace lyx

View File

@ -58,7 +58,7 @@ protected:
void closeEvent(QCloseEvent * e);
private:
void populateItem(QTreeWidgetItem * parentItem, toc::Toc::const_iterator& iter);
QToc * form_;

View File

@ -49,7 +49,7 @@
using lyx::support::subst;
#endif
// You can find other qt-immodule, X11 and MACX specific stuff
// You can find other qt-immodule, X11 and MACX specific stuff
// at the end of this file...
///////////////////////////////////////////////////////////////
@ -149,13 +149,13 @@ QWorkArea::QWorkArea(LyXView &, int w, int h)
synthetic_mouse_event_.timeout.timeout.connect(
boost::bind(&QWorkArea::generateSyntheticMouseEvent,
this));
// Initialize the vertical Scroll Bar
QObject::connect(verticalScrollBar(), SIGNAL(actionTriggered(int)),
this, SLOT(adjustViewWithScrollBar(int)));
// PageStep only depends on the viewport height.
verticalScrollBar()->setPageStep(workHeight_);
verticalScrollBar()->setPageStep(workHeight_);
lyxerr[Debug::GUI] << BOOST_CURRENT_FUNCTION
<< "\n Area width\t" << width()
@ -263,9 +263,9 @@ void QWorkArea::putClipboard(string const & str) const
#ifdef Q_WS_MACX
// The MAC clipboard uses \r for lineendings, and we use \n
QApplication::clipboard()->setText(toqstr(subst(str, '\n', '\r')),
QClipboard::Selection);
QClipboard::Selection);
#else
QApplication::clipboard()->setText(toqstr(str), QClipboard::Selection);
QApplication::clipboard()->setText(toqstr(str), QClipboard::Selection);
#endif
lyxerr[Debug::ACTION] << "putClipboard: " << str << endl;
}
@ -277,7 +277,7 @@ void QWorkArea::dragEnterEvent(QDragEnterEvent * event)
/// \todo Ask lyx-devel is this is enough:
/// if (event->mimeData()->hasFormat("text/plain"))
/// event->acceptProposedAction();
/// event->acceptProposedAction();
}
@ -429,8 +429,8 @@ void QWorkArea::keyPressEvent(QKeyEvent * e)
boost::shared_ptr<QLyXKeySym> sym(new QLyXKeySym);
sym->set(e);
this->workAreaKeyPress(sym, q_key_state(e->state()));
this->workAreaKeyPress(sym, q_key_state(e->state()));
}
// This is not used for now...
@ -514,7 +514,7 @@ void QWorkArea::update(int x, int y, int w, int h)
//screen_device_.fromImage(paint_device_);
QPainter q(&screen_device_);
q.drawImage(x, y, paint_device_.copy(x, y, w, h));
viewport()->update(x, y, w, h);
}
@ -561,7 +561,7 @@ void QWorkArea::drawScreen(int x, int y, QPixmap pixmap)
#if USE_INPUT_METHODS
// to make qt-immodule work
void QWorkArea::inputMethodEvent(QInputMethodEvent * e)
void QWorkArea::inputMethodEvent(QInputMethodEvent * e)
{
QString const text = e->text();
if (!text.isEmpty()) {

View File

@ -117,16 +117,16 @@ public:
///
virtual std::string const getClipboard() const;
///
virtual void putClipboard(std::string const &) const;
///
virtual void dragEnterEvent(QDragEnterEvent * event);
///
virtual void dropEvent(QDropEvent* event);
/// return the widget's painter
virtual Painter & getPainter() { return (Painter &) painter_; }
@ -167,7 +167,7 @@ protected:
#if USE_INPUT_METHODS
protected:
/// IM events
void QWorkArea::inputMethodEvent(QInputMethodEvent * e)
void QWorkArea::inputMethodEvent(QInputMethodEvent * e)
#endif
public slots:
@ -179,7 +179,7 @@ public slots:
/// Adjust the LyX buffer view with the position of the scrollbar.
/**
* The action argument is not used in the the code, it is there
* only for the connection to the vertical srollbar signal which
* only for the connection to the vertical srollbar signal which
* emits an 'int' action.
*/
void adjustViewWithScrollBar(int action = 0);

View File

@ -32,7 +32,7 @@ QWrapDialog::QWrapDialog(QWrap * form)
form, SLOT(slotOK()));
connect(applyPB, SIGNAL(clicked()),
form, SLOT(slotApply()));
connect(closePB, SIGNAL(clicked()),
connect(closePB, SIGNAL(clicked()),
form, SLOT(slotClose()));
connect( widthED, SIGNAL( textChanged(const QString&) ), this, SLOT( change_adaptor() ) );

View File

@ -231,24 +231,24 @@ void start(string const & batch, vector<string> const & files)
val = LyX::ref().session().loadSessionInfo("WindowHeight");
if (val != "")
height = convert<unsigned int>(val);
}
}
boost::shared_ptr<QtView> view_ptr(new QtView(width, height));
LyX::ref().addLyXView(view_ptr);
QtView & view = *view_ptr.get();
// if user wants to restore window position
if (lyxrc.geometry_xysaved) {
QPoint p = view.pos();
string val = LyX::ref().session().loadSessionInfo("WindowPosX");
if (val != "")
p.setX(convert<unsigned int>(val));
p.setX(convert<unsigned int>(val));
val = LyX::ref().session().loadSessionInfo("WindowPosY");
if (val != "")
p.setY(convert<unsigned int>(val));
view.move(p);
}
}
view.show();
view.init();

View File

@ -51,7 +51,7 @@ PanelStack::PanelStack(QWidget * parent)
list_->setHeaderLabels(HeaderLabels);
connect(list_, SIGNAL(currentItemChanged (QTreeWidgetItem*, QTreeWidgetItem*)),
this, SLOT(switchPanel(QTreeWidgetItem *, QTreeWidgetItem*)));
this, SLOT(switchPanel(QTreeWidgetItem *, QTreeWidgetItem*)));
QHBoxLayout * layout = new QHBoxLayout(this);
layout->addWidget(list_, 0);

View File

@ -239,9 +239,9 @@ FontLoader::FontLoader()
void FontLoader::update()
{
for (int i1 = 0; i1 < LyXFont::NUM_FAMILIES; ++i1)
for (int i2 = 0; i2 < 2; ++i2)
for (int i3 = 0; i3 < 4; ++i3)
for (int i1 = 0; i1 < LyXFont::NUM_FAMILIES; ++i1)
for (int i2 = 0; i2 < 2; ++i2)
for (int i3 = 0; i3 < 4; ++i3)
for (int i4 = 0; i4 < 10; ++i4) {
delete fontinfo_[i1][i2][i3][i4];
fontinfo_[i1][i2][i3][i4] = 0;

View File

@ -78,7 +78,7 @@ public:
/// Called the first time when available() can't load a symbol font
static void addToFontPath();
/// Get font info (font + metrics) for the given LyX font.
/// Get font info (font + metrics) for the given LyX font.
QLFontInfo & fontinfo(LyXFont const & f) {
QLFontInfo * & fi =
fontinfo_[f.family()][f.series()][f.realShape()][f.size()];

View File

@ -141,7 +141,7 @@ int width(char const * s, size_t ls, LyXFont const & f)
Encoding const * encoding = fontencoding(f);
QLFontInfo & fi = fontloader.fontinfo(f);
if (ls == 1)
if (ls == 1)
return fi.width(encoding->ucs(s[0]));
int w = 0;
@ -184,4 +184,3 @@ void buttonText(string const & str, LyXFont const & f,
}
} // namespace font_metrics

View File

@ -61,7 +61,7 @@ void QScreen::showCursor(int x, int y, int h, Cursor_Shape shape)
owner_.drawScreen(cursor_x_, cursor_y_, vcursor_);
return;
}
// Cache the dimensions of the cursor.
cursor_x_ = x;
cursor_y_ = y;

View File

@ -35,7 +35,7 @@ public:
/// connect a connection notification from the LyXServerSocket
socket_callback(int fd, boost::function<void()> func);
public slots:
void data_received();
void data_received();
private:
/// our notifier
boost::scoped_ptr<QSocketNotifier> sn_;

View File

@ -127,7 +127,7 @@ QValidator::State PathValidator::validate(QString & qtext, int &) const
string const text = lyx::support::trim(fromqstr(qtext));
if (text.empty())
return acceptable_if_empty_ ?
return acceptable_if_empty_ ?
QValidator::Acceptable : QValidator::Intermediate;
string invalid_chars("#$%{}()[]\"^");

View File

@ -220,7 +220,7 @@ void LyXScreen::redraw(BufferView & bv, ViewMetricsInfo const & vi)
paintText(bv, vi);
lyxerr[Debug::DEBUG] << "Redraw screen" << endl;
int const ymin = std::max(vi.y1, 0);
int const ymax =
int const ymax =
( vi.p2 < vi.size - 1 ? vi.y2 : workarea().workHeight() );
expose(0, ymin, workarea().workWidth(), ymax - ymin);
workarea().getPainter().end();

View File

@ -50,7 +50,7 @@ void information_pimpl(string const &, string const & message)
int prompt_pimpl(string const &, string const & question,
int default_button, int /*escape_button*/,
int default_button, int /*escape_button*/,
string const & b1, string const & b2, string const & b3)
{
string b1label, b1sc;

View File

@ -59,17 +59,17 @@ void FormBox::build()
}
string str = _("Frameless: No border\n"
"Boxed: Rectangular\n"
"ovalbox: Oval, thin border\n"
"Ovalbox: Oval, thick border\n"
"Shadowbox: Box casting shadow\n"
"Doublebox: Double line border");
"Boxed: Rectangular\n"
"ovalbox: Oval, thin border\n"
"Ovalbox: Oval, thick border\n"
"Shadowbox: Box casting shadow\n"
"Doublebox: Double line border");
tooltips().init(dialog_->choice_type, str);
bcview().addReadOnly(dialog_->check_inner_box);
str = _("The inner box may be a parbox or a minipage,\n"
"with appropriate arguments from this dialog.");
"with appropriate arguments from this dialog.");
tooltips().init(dialog_->check_inner_box, str);
bcview().addReadOnly(dialog_->radio_parbox);

View File

@ -165,11 +165,11 @@ void FormTabular::update()
fl_activate_object(column_options_->input_column_width);
fl_activate_object(column_options_->choice_value_column_width);
fl_set_input(dialog_->input_tabular_column,
convert<string>(column).c_str());
convert<string>(column).c_str());
fl_deactivate_object(dialog_->input_tabular_column);
LyXTabular::row_type row = tabular.row_of_cell(cell);
fl_set_input(dialog_->input_tabular_row,
convert<string>(row + 1).c_str());
convert<string>(row + 1).c_str());
fl_deactivate_object(dialog_->input_tabular_row);
if (tabular.isMultiColumn(cell)) {
fl_set_button(cell_options_->check_multicolumn, 1);

View File

@ -169,7 +169,7 @@ Converter::Impl::Impl(string const & from_file, string const & to_file_base,
script_command_ =
"sh " +
QuoteName(LibFileSearch("scripts", "convertDefault.sh")) +
' ' +
' ' +
QuoteName((from_format.empty() ? "" : from_format + ':') + from_file) +
' ' +
QuoteName(to_format + ':' + to_file_);

View File

@ -498,7 +498,7 @@ void PreviewLoader::Impl::startLoading()
// The conversion command.
ostringstream cs;
cs << pconverter_->command << ' ' << pconverter_->to << ' '
<< support::QuoteName(latexfile) << ' '
<< support::QuoteName(latexfile) << ' '
<< int(font_scaling_factor_) << ' '
<< lyx_gui::hexname(LColor::preview) << ' '
<< lyx_gui::hexname(LColor::background);

View File

@ -61,7 +61,7 @@ bool Importer::Import(LyXView * lv, string const & filename,
if (loader_format.empty()) {
Alert::error(_("Couldn't import file"),
bformat(_("No information for importing the format %1$s."),
formats.prettyName(format)));
formats.prettyName(format)));
return false;
}
} else

View File

@ -57,7 +57,7 @@ void editExternal(InsetExternalParams const & params, Buffer const & buffer)
{
string const file_with_path = params.filename.absFilename();
formats.edit(buffer, file_with_path,
formats.getFormatFromFile(file_with_path));
formats.getFormatFromFile(file_with_path));
}
@ -66,9 +66,9 @@ namespace {
string const subst_path(string const & input,
string const & placeholder,
string const & path,
bool use_latex_path,
support::latex_path_extension ext = support::PROTECT_EXTENSION,
support::latex_path_dots dots = support::LEAVE_DOTS)
bool use_latex_path,
support::latex_path_extension ext = support::PROTECT_EXTENSION,
support::latex_path_dots dots = support::LEAVE_DOTS)
{
if (input.find(placeholder) == string::npos)
return input;
@ -83,9 +83,9 @@ string const subst_path(string const & input,
string const doSubstitution(InsetExternalParams const & params,
Buffer const & buffer, string const & s,
bool use_latex_path,
bool use_latex_path,
bool external_in_tmpdir,
Substitute what)
Substitute what)
{
Buffer const * m_buffer = buffer.getMasterBuffer();
string const parentpath = external_in_tmpdir ?
@ -115,39 +115,39 @@ string const doSubstitution(InsetExternalParams const & params,
relToParentPath.clear();
result = subst_path(result, "$$FPath", filepath,
use_latex_path,
support::PROTECT_EXTENSION,
support::ESCAPE_DOTS);
use_latex_path,
support::PROTECT_EXTENSION,
support::ESCAPE_DOTS);
result = subst_path(result, "$$AbsPath", abspath,
use_latex_path,
support::PROTECT_EXTENSION,
support::ESCAPE_DOTS);
use_latex_path,
support::PROTECT_EXTENSION,
support::ESCAPE_DOTS);
result = subst_path(result, "$$RelPathMaster",
relToMasterPath, use_latex_path,
support::PROTECT_EXTENSION,
support::ESCAPE_DOTS);
relToMasterPath, use_latex_path,
support::PROTECT_EXTENSION,
support::ESCAPE_DOTS);
result = subst_path(result, "$$RelPathParent",
relToParentPath, use_latex_path,
support::PROTECT_EXTENSION,
support::ESCAPE_DOTS);
relToParentPath, use_latex_path,
support::PROTECT_EXTENSION,
support::ESCAPE_DOTS);
if (support::AbsolutePath(filename)) {
result = subst_path(result, "$$AbsOrRelPathMaster",
abspath, use_latex_path,
support::PROTECT_EXTENSION,
support::ESCAPE_DOTS);
abspath, use_latex_path,
support::PROTECT_EXTENSION,
support::ESCAPE_DOTS);
result = subst_path(result, "$$AbsOrRelPathParent",
abspath, use_latex_path,
support::PROTECT_EXTENSION,
support::ESCAPE_DOTS);
abspath, use_latex_path,
support::PROTECT_EXTENSION,
support::ESCAPE_DOTS);
} else {
result = subst_path(result, "$$AbsOrRelPathMaster",
relToMasterPath, use_latex_path,
support::PROTECT_EXTENSION,
support::ESCAPE_DOTS);
relToMasterPath, use_latex_path,
support::PROTECT_EXTENSION,
support::ESCAPE_DOTS);
result = subst_path(result, "$$AbsOrRelPathParent",
relToParentPath, use_latex_path,
support::PROTECT_EXTENSION,
support::ESCAPE_DOTS);
relToParentPath, use_latex_path,
support::PROTECT_EXTENSION,
support::ESCAPE_DOTS);
}
}
@ -155,9 +155,9 @@ string const doSubstitution(InsetExternalParams const & params,
return result;
result = subst_path(result, "$$FName", filename, use_latex_path,
support::EXCLUDE_EXTENSION);
support::EXCLUDE_EXTENSION);
result = subst_path(result, "$$Basename", basename, use_latex_path,
support::PROTECT_EXTENSION, support::ESCAPE_DOTS);
support::PROTECT_EXTENSION, support::ESCAPE_DOTS);
result = subst_path(result, "$$Extension",
'.' + support::GetExtension(filename), use_latex_path);
result = subst_path(result, "$$Tempname", params.tempname(), use_latex_path);
@ -197,7 +197,7 @@ namespace {
void updateExternal(InsetExternalParams const & params,
string const & format,
Buffer const & buffer,
ExportData & exportdata,
ExportData & exportdata,
bool external_in_tmpdir)
{
Template const * const et_ptr = getTemplatePtr(params);
@ -273,7 +273,7 @@ void updateExternal(InsetExternalParams const & params,
// the generated file (always in the temp dir)
string const to_file = doSubstitution(params, buffer,
outputFormat.updateResult,
false, true);
false, true);
string const abs_to_file =
support::MakeAbsPath(to_file, m_buffer->temppath());
@ -288,7 +288,7 @@ void updateExternal(InsetExternalParams const & params,
for (; fit != fend; ++fit) {
string const source = support::MakeAbsPath(
doSubstitution(params, buffer, *fit,
false, true),
false, true),
m_buffer->temppath());
// The path of the referenced file is never the
// temp path, but the filename may be the mangled
@ -297,10 +297,10 @@ void updateExternal(InsetExternalParams const & params,
string file = support::subst(*fit, "$$FName",
"$$FPath$$Basename$$Extension");
file = doSubstitution(params, buffer, file, false, false,
PATHS);
PATHS);
file = doSubstitution(params, buffer, file,
false, external_in_tmpdir,
ALL_BUT_PATHS);
false, external_in_tmpdir,
ALL_BUT_PATHS);
// if file is a relative name, it is interpreted
// relative to the master document.
exportdata.addExternalFile(rit->first, source, file);
@ -332,9 +332,9 @@ string const substituteOptions(InsetExternalParams const & params,
int writeExternal(InsetExternalParams const & params,
string const & format,
Buffer const & buffer, ostream & os,
ExportData & exportdata,
bool external_in_tmpdir,
bool external_in_comment)
ExportData & exportdata,
bool external_in_tmpdir,
bool external_in_comment)
{
Template const * const et_ptr = getTemplatePtr(params);
if (!et_ptr)
@ -352,11 +352,11 @@ int writeExternal(InsetExternalParams const & params,
if (!external_in_comment)
updateExternal(params, format, buffer, exportdata,
external_in_tmpdir);
external_in_tmpdir);
bool const use_latex_path = format == "LaTeX";
string str = doSubstitution(params, buffer, cit->second.product,
use_latex_path, external_in_tmpdir);
use_latex_path, external_in_tmpdir);
str = substituteCommands(params, str, format);
str = substituteOptions(params, str, format);
os << str;

View File

@ -49,10 +49,10 @@ enum Substitute {
*/
std::string const doSubstitution(InsetExternalParams const & params,
Buffer const & buffer,
std::string const & s,
bool use_latex_path,
std::string const & s,
bool use_latex_path,
bool external_in_tmpdir = false,
Substitute what = ALL);
Substitute what = ALL);
/** Write the output for a specific file format
@ -65,8 +65,8 @@ int writeExternal(InsetExternalParams const &,
Buffer const &,
std::ostream &,
ExportData &,
bool external_in_tmpdir,
bool external_in_comment);
bool external_in_tmpdir,
bool external_in_comment);
} // namespace external
} // namespace lyx

View File

@ -81,7 +81,7 @@ public:
std::map<TransformID, TransformStore> option_transformers;
typedef std::map<std::string,
std::vector<std::string> > FileMap;
std::vector<std::string> > FileMap;
/// Referenced files for some formats
FileMap referencedFiles;
};

View File

@ -184,15 +184,15 @@ bool InsetBase::getStatus(LCursor &, FuncRequest const & cmd,
void InsetBase::edit(LCursor &, bool)
{
lyxerr[Debug::INSETS] << BOOST_CURRENT_FUNCTION
<< ": edit left/right" << std::endl;
<< ": edit left/right" << std::endl;
}
InsetBase * InsetBase::editXY(LCursor &, int x, int y)
{
lyxerr[Debug::INSETS] << BOOST_CURRENT_FUNCTION
<< ": x=" << x << " y= " << y
<< std::endl;
<< ": x=" << x << " y= " << y
<< std::endl;
return this;
}
@ -201,10 +201,10 @@ InsetBase::idx_type InsetBase::index(row_type row, col_type col) const
{
if (row != 0)
lyxerr << BOOST_CURRENT_FUNCTION
<< ": illegal row: " << row << std::endl;
<< ": illegal row: " << row << std::endl;
if (col != 0)
lyxerr << BOOST_CURRENT_FUNCTION
<< ": illegal col: " << col << std::endl;
<< ": illegal col: " << col << std::endl;
return 0;
}

View File

@ -197,7 +197,7 @@ public:
OutputParams const &) const { return 0; };
/** This enum indicates by which means the inset can be modified:
- NOT_EDITABLE: the inset's content can not be modified at all
- NOT_EDITABLE: the inset's content can not be modified at all
(e.g. printindex, insetspecialchar)
- IS_EDITABLE: content can be edited via dialog (e.g. bibtex, index, url)
- HIGHLY_EDITABLE: content can be edited on screen (normally means that
@ -398,7 +398,7 @@ public:
/// mark the inset as erased or not
virtual void markErased(bool erased);
/// pretty arbitrary
virtual int width() const { return 10; }
/// pretty arbitrary

View File

@ -298,17 +298,17 @@ int InsetCharStyle::docbook(Buffer const & buf, ostream & os,
{
ParagraphList::const_iterator beg = paragraphs().begin();
ParagraphList::const_iterator par = paragraphs().begin();
ParagraphList::const_iterator end = paragraphs().end();
ParagraphList::const_iterator end = paragraphs().end();
if (!undefined())
sgml::openTag(os, params_.latexname,
par->getID(buf, runparams) + params_.latexparam);
for (; par != end; ++par) {
for (; par != end; ++par) {
par->simpleDocBookOnePar(buf, os, runparams,
outerFont(std::distance(beg, par),
paragraphs()));
}
}
if (!undefined())
sgml::closeTag(os, params_.latexname);

View File

@ -206,9 +206,9 @@ void InsetCollapsable::cursorPos
(CursorSlice const & sl, bool boundary, int & x, int & y) const
{
BOOST_ASSERT(status() != Collapsed);
InsetText::cursorPos(sl, boundary, x, y);
if (status() == Open) {
if (openinlined_)
x += dimensionCollapsed().wid;
@ -342,7 +342,7 @@ void InsetCollapsable::doDispatch(LCursor & cur, FuncRequest & cmd)
setStatus(cur, Open);
else if (cmd.argument == "close")
setStatus(cur, Collapsed);
else if (cmd.argument == "toggle" || cmd.argument.empty())
else if (cmd.argument == "toggle" || cmd.argument.empty())
if (isOpen()) {
setStatus(cur, Collapsed);
cur.forwardPosNoDescend();
@ -399,4 +399,3 @@ void InsetCollapsable::setLabelFont(LyXFont & font)
{
labelfont_ = font;
}

View File

@ -46,7 +46,7 @@ InsetCommand::~InsetCommand()
void InsetCommand::metrics(MetricsInfo & mi, Dimension & dim) const
{
if (updateButtonLabel_) {
if (updateButtonLabel_) {
updateButtonLabel_ = false;
button_.update(getScreenLabel(*mi.base.bv->buffer()),
editable() != NOT_EDITABLE);

View File

@ -67,10 +67,10 @@ public:
std::string const & getContents() const { return p_.getContents(); }
///
void setContents(std::string const & c)
{
updateButtonLabel_ = true;
p_.setContents(c);
}
{
updateButtonLabel_ = true;
p_.setContents(c);
}
///
std::string const & getOptions() const { return p_.getOptions(); }
///
@ -89,22 +89,22 @@ protected:
std::string const & getCmdName() const { return p_.getCmdName(); }
///
void setCmdName(std::string const & n)
{
updateButtonLabel_ = true;
p_.setCmdName(n);
}
{
updateButtonLabel_ = true;
p_.setCmdName(n);
}
///
void setOptions(std::string const & o)
{
updateButtonLabel_ = true;
p_.setOptions(o);
}
{
updateButtonLabel_ = true;
p_.setOptions(o);
}
///
void setSecOptions(std::string const & s)
{
updateButtonLabel_ = true;
p_.setSecOptions(s);
}
{
updateButtonLabel_ = true;
p_.setSecOptions(s);
}
///
void setParams(InsetCommandParams const &);
/// This should provide the text for the button

View File

@ -36,8 +36,8 @@ public:
///
LyXLayout_ptr const & layout() const;
/** returns true if, when outputing LaTeX, font changes should
be closed before generating this inset. This is needed for
insets that may contain several paragraphs */
be closed before generating this inset. This is needed for
insets that may contain several paragraphs */
bool noFontChange() const { return true; }
protected:
InsetEnvironment(InsetEnvironment const &);

View File

@ -703,15 +703,15 @@ int InsetExternal::latex(Buffer const & buf, ostream & os,
et.formats.find("PDFLaTeX");
if (cit != et.formats.end())
return external::writeExternal(params_, "PDFLaTeX",
buf, os,
*(runparams.exportdata),
external_in_tmpdir,
runparams.inComment);
buf, os,
*(runparams.exportdata),
external_in_tmpdir,
runparams.inComment);
}
return external::writeExternal(params_, "LaTeX", buf, os,
*(runparams.exportdata),
external_in_tmpdir,
runparams.inComment);
*(runparams.exportdata),
external_in_tmpdir,
runparams.inComment);
}
@ -719,8 +719,8 @@ int InsetExternal::plaintext(Buffer const & buf, ostream & os,
OutputParams const & runparams) const
{
return external::writeExternal(params_, "Ascii", buf, os,
*(runparams.exportdata), false,
runparams.inComment);
*(runparams.exportdata), false,
runparams.inComment);
}
@ -728,8 +728,8 @@ int InsetExternal::linuxdoc(Buffer const & buf, ostream & os,
OutputParams const & runparams) const
{
return external::writeExternal(params_, "LinuxDoc", buf, os,
*(runparams.exportdata), false,
runparams.inComment);
*(runparams.exportdata), false,
runparams.inComment);
}
@ -737,8 +737,8 @@ int InsetExternal::docbook(Buffer const & buf, ostream & os,
OutputParams const & runparams) const
{
return external::writeExternal(params_, "DocBook", buf, os,
*(runparams.exportdata), false,
runparams.inComment);
*(runparams.exportdata), false,
runparams.inComment);
}

View File

@ -523,12 +523,12 @@ string const stripExtensionIfPossible(string const & file)
// The automatic format selection does not work if the file
// name is escaped.
string const latex_name = latex_path(file,
lyx::support::EXCLUDE_EXTENSION);
lyx::support::EXCLUDE_EXTENSION);
if (contains(latex_name, '"'))
return latex_name;
return latex_path(removeExtension(file),
lyx::support::PROTECT_EXTENSION,
lyx::support::ESCAPE_DOTS);
lyx::support::PROTECT_EXTENSION,
lyx::support::ESCAPE_DOTS);
}
@ -634,7 +634,7 @@ string const InsetGraphics::prepareFile(Buffer const & buf,
// We can't strip the extension, because we don't know
// the unzipped file format
return latex_path(output_file,
lyx::support::EXCLUDE_EXTENSION);
lyx::support::EXCLUDE_EXTENSION);
}
string const unzipped_temp_file = unzippedFileName(temp_file);
@ -673,9 +673,9 @@ string const InsetGraphics::prepareFile(Buffer const & buf,
if (from == to) {
// The extension of temp_file might be != ext!
runparams.exportdata->addExternalFile(tex_format, source_file,
output_file);
output_file);
runparams.exportdata->addExternalFile("dvi", source_file,
output_file);
output_file);
return stripExtensionIfPossible(output_file, to);
}
@ -690,9 +690,9 @@ string const InsetGraphics::prepareFile(Buffer const & buf,
rel_file)
<< std::endl;
runparams.exportdata->addExternalFile(tex_format, to_file,
output_to_file);
output_to_file);
runparams.exportdata->addExternalFile("dvi", to_file,
output_to_file);
output_to_file);
return stripExtensionIfPossible(output_file);
}
@ -750,7 +750,7 @@ int InsetGraphics::latex(Buffer const & buf, ostream & os,
if (runparams.moving_arg)
before += "\\protect";
// We never use the starred form, we use the "clip" option instead.
before += "\\includegraphics";
@ -804,7 +804,7 @@ int InsetGraphics::linuxdoc(Buffer const & buf, ostream & os,
params().filename.absFilename();
runparams.exportdata->addExternalFile("linuxdoc",
params().filename.absFilename());
params().filename.absFilename());
os << "<eps file=\"" << file_name << "\">\n";
os << "<img src=\"" << file_name << "\">";
return 0;
@ -874,7 +874,7 @@ void InsetGraphics::validate(LaTeXFeatures & features) const
return;
features.includeFile(graphic_label,
removeExtension(params().filename.absFilename()));
removeExtension(params().filename.absFilename()));
features.require("graphicx");
@ -918,11 +918,11 @@ InsetGraphicsParams const & InsetGraphics::params() const
void InsetGraphics::editGraphics(InsetGraphicsParams const & p,
Buffer const & buffer) const
Buffer const & buffer) const
{
string const file_with_path = p.filename.absFilename();
formats.edit(buffer, file_with_path,
formats.getFormatFromFile(file_with_path));
formats.getFormatFromFile(file_with_path));
}

View File

@ -344,13 +344,13 @@ int InsetInclude::latex(Buffer const & buffer, ostream & os,
// buffer directory.
if (!AbsolutePath(incfile)) {
incfile = MakeRelPath(included_file,
m_buffer->filePath());
m_buffer->filePath());
}
// write it to a file (so far the complete file)
string const exportfile = ChangeExtension(incfile, ".tex");
string const mangled = FileName(ChangeExtension(included_file,
".tex")).mangledFilename();
".tex")).mangledFilename();
string const writefile = MakeAbsPath(mangled, m_buffer->temppath());
if (!runparams.nice)
@ -367,11 +367,11 @@ int InsetInclude::latex(Buffer const & buffer, ostream & os,
if (tmp->params().textclass != m_buffer->params().textclass) {
string text = bformat(_("Included file `%1$s'\n"
"has textclass `%2$s'\n"
"while parent file has textclass `%3$s'."),
MakeDisplayPath(included_file),
tmp->params().getLyXTextClass().name(),
m_buffer->params().getLyXTextClass().name());
"has textclass `%2$s'\n"
"while parent file has textclass `%3$s'."),
MakeDisplayPath(included_file),
tmp->params().getLyXTextClass().name(),
m_buffer->params().getLyXTextClass().name());
Alert::warning(_("Different textclasses"), text);
//return 0;
}
@ -399,8 +399,8 @@ int InsetInclude::latex(Buffer const & buffer, ostream & os,
if (!copy(included_file, writefile)) {
lyxerr[Debug::LATEX]
<< bformat(_("Could not copy the file\n%1$s\n"
"into the temporary directory."),
included_file)
"into the temporary directory."),
included_file)
<< endl;
return 0;
}
@ -414,7 +414,7 @@ int InsetInclude::latex(Buffer const & buffer, ostream & os,
os << '\\' << params_.getCmdName() << '{' << incfile << '}';
} else if (type(params_) == INPUT) {
runparams.exportdata->addExternalFile(tex_format, writefile,
exportfile);
exportfile);
// \input wants file with extension (default is .tex)
if (!IsLyXFilename(included_file)) {
@ -429,7 +429,7 @@ int InsetInclude::latex(Buffer const & buffer, ostream & os,
}
} else {
runparams.exportdata->addExternalFile(tex_format, writefile,
exportfile);
exportfile);
// \include don't want extension and demands that the
// file really have .tex
@ -472,7 +472,7 @@ int InsetInclude::linuxdoc(Buffer const & buffer, ostream & os,
Buffer * tmp = bufferlist.getBuffer(included_file);
writefile = MakeAbsPath(FileName(writefile).mangledFilename(),
buffer.getMasterBuffer()->temppath());
buffer.getMasterBuffer()->temppath());
if (!runparams.nice)
incfile = writefile;
@ -489,7 +489,7 @@ int InsetInclude::linuxdoc(Buffer const & buffer, ostream & os,
<< "]]>";
} else {
runparams.exportdata->addExternalFile("linuxdoc", writefile,
exportfile);
exportfile);
os << '&' << include_label << ';';
}
@ -517,7 +517,7 @@ int InsetInclude::docbook(Buffer const & buffer, ostream & os,
string const mangled = FileName(writefile).mangledFilename();
writefile = MakeAbsPath(mangled,
buffer.getMasterBuffer()->temppath());
buffer.getMasterBuffer()->temppath());
if (!runparams.nice)
incfile = mangled;
@ -529,9 +529,9 @@ int InsetInclude::docbook(Buffer const & buffer, ostream & os,
}
runparams.exportdata->addExternalFile("docbook", writefile,
exportfile);
exportfile);
runparams.exportdata->addExternalFile("docbook-xml", writefile,
exportfile);
exportfile);
if (isVerbatim(params_)) {
os << "<inlinegraphic fileref=\""
@ -561,7 +561,7 @@ void InsetInclude::validate(LaTeXFeatures & features) const
if (!features.runparams().nice && !isVerbatim(params_)) {
incfile = FileName(writefile).mangledFilename();
writefile = MakeAbsPath(incfile,
buffer.getMasterBuffer()->temppath());
buffer.getMasterBuffer()->temppath());
}
features.includeFile(include_label, writefile);

View File

@ -231,7 +231,7 @@ bool InsetNote::getStatus(LCursor & cur, FuncRequest const & cmd,
int InsetNote::latex(Buffer const & buf, ostream & os,
OutputParams const & runparams_in) const
OutputParams const & runparams_in) const
{
if (params_.type == InsetNoteParams::Note)
return 0;
@ -259,7 +259,7 @@ int InsetNote::latex(Buffer const & buf, ostream & os,
int InsetNote::linuxdoc(Buffer const & buf, std::ostream & os,
OutputParams const & runparams_in) const
OutputParams const & runparams_in) const
{
if (params_.type == InsetNoteParams::Note)
return 0;
@ -286,7 +286,7 @@ int InsetNote::linuxdoc(Buffer const & buf, std::ostream & os,
int InsetNote::docbook(Buffer const & buf, std::ostream & os,
OutputParams const & runparams_in) const
OutputParams const & runparams_in) const
{
if (params_.type == InsetNoteParams::Note)
return 0;
@ -313,7 +313,7 @@ int InsetNote::docbook(Buffer const & buf, std::ostream & os,
int InsetNote::plaintext(Buffer const & buf, std::ostream & os,
OutputParams const & runparams_in) const
OutputParams const & runparams_in) const
{
if (params_.type == InsetNoteParams::Note)
return 0;

Some files were not shown because too many files have changed in this diff Show More