Use Buffer const reference in most placees possible.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7623 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2003-08-28 07:41:31 +00:00
parent ab039d998b
commit b881ed2d5a
137 changed files with 824 additions and 819 deletions

View File

@ -183,6 +183,7 @@ src/mathed/ref_inset.C
src/paragraph.C
src/paragraph_funcs.C
src/rowpainter.C
src/support/path_defines.C
src/text.C
src/text2.C
src/text3.C

View File

@ -456,7 +456,7 @@ void BufferView::replaceWord(string const & replacestring)
tt->setSelectionRange(replacestring.length());
// Go back so that replacement string is also spellchecked
for (string::size_type i = 0; i < replacestring.length() + 1; ++i)
for (string::size_type i = 0; i < replacestring.length() + 1; ++i)
tt->cursorLeft(this);
// FIXME: should be done through LFUN

View File

@ -66,10 +66,10 @@ public:
/// return the visible top y
int top_y() const;
/// set the visible top y
void top_y(int);
void top_y(int);
/// resize event has happened
void resize();

View File

@ -306,7 +306,7 @@ void BufferView::Pimpl::buffer(Buffer * b)
buffer_ = b;
top_y_ = 0;
// if we're quitting lyx, don't bother updating stuff
if (quitting)
return;
@ -590,7 +590,7 @@ void BufferView::Pimpl::selectionRequested()
text->selection.end != bv_->text->xsel_cache.end))
{
bv_->text->xsel_cache = text->selection;
sel = text->selectionAsString(bv_->buffer(), false);
sel = text->selectionAsString(*bv_->buffer(), false);
} else if (!text->selection.set()) {
sel = string();
bv_->text->xsel_cache.set(false);
@ -988,7 +988,7 @@ bool BufferView::Pimpl::workAreaDispatch(FuncRequest const & ev)
screen().hideCursor();
bool const res = dispatch(ev);
// see workAreaKeyPress
cursor_timeout.restart();
screen().showCursor(*bv_);
@ -1259,14 +1259,14 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev_in)
string arg = ev.argument;
if (arg.empty()) {
arg = bv_->getLyXText()->selectionAsString(buffer_,
arg = bv_->getLyXText()->selectionAsString(*buffer_,
false);
// FIXME
if (arg.size() > 100 || arg.empty()) {
// Get word or selection
bv_->getLyXText()->selectWordWhenUnderCursor(lyx::WHOLE_WORD);
arg = bv_->getLyXText()->selectionAsString(buffer_, false);
arg = bv_->getLyXText()->selectionAsString(*buffer_, false);
// FIXME: where is getLyXText()->unselect(bv_) ?
}
}

View File

@ -1,3 +1,7 @@
2003-08-28 Lars Gullik Bjønnes <larsbj@gullik.net>
* most files: change to use const Buffer refs
2003-08-27 André Pönitz <poenitz@gmx.net>
* BufferView.[Ch]: remove getParentText, implement getParentLanguage
@ -17,14 +21,14 @@
* BufferView_pimpl.[Ch]: to here
* frontends/screen.C:
* insets/insettabular.C:
* insets/insettext.C: adjust
* insets/insettext.C: adjust
* rowpainter.[Ch] (paintRows): remove LyXText & argument
2003-08-27 Alfredo Braunstein <abraunst@libero.it>
* BufferView.[Ch]:
* BufferView_pimpl.[Ch] (updateInset): add an InsetOld * argument
2003-08-26 André Pönitz <poenitz@gmx.net>
* paragraph_func.[Ch] (outerPar): new function
@ -36,7 +40,7 @@
* text2.C: remove Inset::par_owner
2003-08-25 Martin Vermeer <martin.vermeer@hut.fi>
* lyxrow_funcs.C:
* lyxtext.h:
* text.C:
@ -45,8 +49,8 @@
2003-08-25 Alfredo Braunstein <abraunst@libero.it>
* text2.C (redoParagraphInternal, redoParagraphs):
* text.C (redoParagraph): add a call to updateRowPositions at the
* text2.C (redoParagraphInternal, redoParagraphs):
* text.C (redoParagraph): add a call to updateRowPositions at the
end of each 'metrics-like' call. Remove all others.
(getRow): remove the 'y-computing' version.
(getRowNearY): do not compute nor return the real y. Solve the
@ -61,7 +65,7 @@
* lyxrow.[Ch]: add x_ and *fill_ members
* lyxtext.h:
* lyxtext.h:
* text.C:
* rowpainter.C:
* text2.C: adjust/remove prepareToPrint() calls
@ -100,7 +104,7 @@
* MenuBackend.C: fix branchlist related crash
2003-08-17 Martin Vermeer <martin.vermeer@hut.fi>
2003-08-17 Martin Vermeer <martin.vermeer@hut.fi>
* BranchList.[Ch]:
* InsetList.[Ch]:
@ -128,7 +132,7 @@
2003-08-15 Kayvan A. Sylvan <kayvan@sylvan.com>
* BufferView_pimpl.C: compile fix
2003-08-15 André Pönitz <poenitz@gmx.net>
* rowpainter.C: remove extra metrics calls
@ -213,7 +217,7 @@
2003-08-05 Alfredo Braunstein <abraunst@libero.it>
* text2.C (DEPM): fix part of bug 1255 and 1256
* text2.C (DEPM): fix part of bug 1255 and 1256
2003-08-05 Jean-Marc Lasgouttes <lasgouttes@lyx.org>

View File

@ -68,7 +68,7 @@ CutAndPaste::availableSelections(Buffer const & buffer)
ParagraphList::const_iterator pit = pars.begin();
ParagraphList::const_iterator pend = pars.end();
for (; pit != pend; ++pit) {
asciiSel += pit->asString(&buffer, false);
asciiSel += pit->asString(buffer, false);
if (asciiSel.size() > 25) {
asciiSel.replace(22, string::npos, "...");
break;

View File

@ -440,15 +440,15 @@ void expandFormats(MenuItem::Kind kind, Menu & tomenu, LyXView const * view)
action = LFUN_IMPORT;
break;
case MenuItem::ViewFormats:
formats = Exporter::GetExportableFormats(view->buffer(), true);
formats = Exporter::GetExportableFormats(*view->buffer(), true);
action = LFUN_PREVIEW;
break;
case MenuItem::UpdateFormats:
formats = Exporter::GetExportableFormats(view->buffer(), true);
formats = Exporter::GetExportableFormats(*view->buffer(), true);
action = LFUN_UPDATE;
break;
default:
formats = Exporter::GetExportableFormats(view->buffer(), false);
formats = Exporter::GetExportableFormats(*view->buffer(), false);
action = LFUN_EXPORT;
}
sort(formats.begin(), formats.end(), compare_format());
@ -594,7 +594,7 @@ void expandToc(Menu & tomenu, LyXView const * view)
return;
}
lyx::toc::TocList toc_list = lyx::toc::getTocList(view->buffer());
lyx::toc::TocList toc_list = lyx::toc::getTocList(*view->buffer());
lyx::toc::TocList::const_iterator cit = toc_list.begin();
lyx::toc::TocList::const_iterator end = toc_list.end();
for (; cit != end; ++cit) {
@ -658,7 +658,7 @@ void expandBranches(Menu & tomenu, LyXView const * view)
std::list<Branch>::const_iterator cit = params.branchlist.begin();
std::list<Branch>::const_iterator end = params.branchlist.end();
for (int ii = 1; cit != end; ++cit, ++ii) {
string label = cit->getBranch();
int const action = lyxaction.

View File

@ -169,7 +169,7 @@ Buffer::~Buffer()
paragraphs.clear();
// Remove any previewed LaTeX snippets associated with this buffer.
lyx::graphics::Previews::get().removeLoader(this);
lyx::graphics::Previews::get().removeLoader(*this);
}
@ -697,7 +697,7 @@ bool Buffer::do_writeFile(ostream & ofs) const
ParagraphList::const_iterator pit = paragraphs.begin();
ParagraphList::const_iterator pend = paragraphs.end();
for (; pit != pend; ++pit)
pit->write(this, ofs, params, depth);
pit->write(*this, ofs, params, depth);
// Write marker that shows file is complete
ofs << "\n\\end_document" << endl;
@ -873,7 +873,7 @@ string const Buffer::asciiParagraph(Paragraph const & par,
currlinelen += word.length();
word.erase();
}
if (inset->ascii(this, buffer, linelen)) {
if (inset->ascii(*this, buffer, linelen)) {
// to be sure it breaks paragraph
currlinelen += linelen;
}
@ -1036,7 +1036,7 @@ void Buffer::makeLaTeXFile(ostream & os,
texrow.newline();
}
latexParagraphs(this, paragraphs, os, texrow, runparams);
latexParagraphs(*this, paragraphs, os, texrow, runparams);
// add this just in case after all the paragraphs
os << endl;
@ -1485,7 +1485,7 @@ void Buffer::simpleLinuxDocOnePar(ostream & os,
if (c == Paragraph::META_INSET) {
InsetOld * inset = par->getInset(i);
inset->linuxdoc(this, os);
inset->linuxdoc(*this, os);
font_old = font;
continue;
}
@ -1855,7 +1855,7 @@ void Buffer::simpleDocBookOnePar(ostream & os,
if (i || desc_on != 3) {
if (style->latexparam() == "CDATA")
os << "]]>";
inset->docbook(this, os, false);
inset->docbook(*this, os, false);
if (style->latexparam() == "CDATA")
os << "<![CDATA[";
}
@ -2023,7 +2023,7 @@ void Buffer::fillWithBibKeys(std::vector<std::pair<string, string> > & keys) con
for (inset_iterator it = inset_const_iterator_begin();
it != inset_const_iterator_end(); ++it) {
if (it->lyxCode() == InsetOld::BIBTEX_CODE)
static_cast<InsetBibtex &>(*it).fillWithBibKeys(this, keys);
static_cast<InsetBibtex &>(*it).fillWithBibKeys(*this, keys);
else if (it->lyxCode() == InsetOld::INCLUDE_CODE)
static_cast<InsetInclude &>(*it).fillWithBibKeys(keys);
else if (it->lyxCode() == InsetOld::BIBITEM_CODE) {

View File

@ -319,7 +319,7 @@ bool BufferList::exists(string const & s) const
bool BufferList::isLoaded(Buffer const * b) const
{
Assert(b);
BufferStorage::const_iterator cit =
find(bstore.begin(), bstore.end(), b);
return cit != bstore.end();

View File

@ -390,10 +390,10 @@ void toggleAndShow(BufferView * bv, LyXFont const & font, bool toggleall)
if (font.language() != ignore_language ||
font.number() != LyXFont::IGNORE) {
LyXCursor & cursor = text->cursor;
text->computeBidiTables(text->cursor.par(), bv->buffer(),
text->computeBidiTables(text->cursor.par(), *bv->buffer(),
text->cursorRow());
if (cursor.boundary() !=
text->isBoundary(bv->buffer(), *cursor.par(), cursor.pos(),
text->isBoundary(*bv->buffer(), *cursor.par(), cursor.pos(),
text->real_current_font))
text->setCursor(cursor.par(), cursor.pos(),
false, !cursor.boundary());

View File

@ -126,7 +126,7 @@ bool operator<(Converter const & a, Converter const & b)
int const i = compare_ascii_no_case(a.From->prettyname(),
b.From->prettyname());
if (i == 0)
return compare_ascii_no_case(a.To->prettyname(),
return compare_ascii_no_case(a.To->prettyname(),
b.To->prettyname()) < 0;
else
return i < 0;
@ -317,7 +317,7 @@ bool Converters::convert(Buffer const * buffer,
run_latex = true;
string command = subst(conv.command, token_from, "");
lyxerr[Debug::FILES] << "Running " << command << endl;
if (!runLaTeX(buffer, command, runparams))
if (!runLaTeX(*buffer, command, runparams))
return false;
} else {
if (conv.need_aux && !run_latex
@ -325,7 +325,7 @@ bool Converters::convert(Buffer const * buffer,
lyxerr[Debug::FILES]
<< "Running " << latex_command_
<< " to update aux file"<< endl;
runLaTeX(buffer, latex_command_, runparams);
runLaTeX(*buffer, latex_command_, runparams);
}
string infile2 = (conv.original_dir)
@ -350,13 +350,13 @@ bool Converters::convert(Buffer const * buffer,
dvipdfm_options(buffer->params));
lyxerr[Debug::FILES] << "Calling " << command << endl;
if (buffer)
buffer->message(_("Executing command: ") + command);
buffer->message(_("Executing command: ") + command);
Systemcall::Starttype type = (dummy)
? Systemcall::DontWait : Systemcall::Wait;
Systemcall one;
int res;
if (conv.original_dir && buffer) {
if (conv.original_dir) {
Path p(buffer->filePath());
res = one.startscript(type, command);
} else
@ -379,7 +379,7 @@ bool Converters::convert(Buffer const * buffer,
" < " + QuoteName(infile2 + ".out") +
" > " + QuoteName(logfile);
one.startscript(Systemcall::Wait, command2);
if (!scanLog(buffer, command, logfile))
if (!scanLog(*buffer, command, logfile))
return false;
}
@ -484,12 +484,9 @@ bool Converters::formatIsUsed(string const & format)
}
bool Converters::scanLog(Buffer const * buffer, string const & /*command*/,
bool Converters::scanLog(Buffer const & buffer, string const & /*command*/,
string const & filename)
{
if (!buffer)
return false;
LatexRunParams runparams;
runparams.flavor = LatexRunParams::LATEX;
LaTeX latex("", runparams, filename, "");
@ -497,7 +494,7 @@ bool Converters::scanLog(Buffer const * buffer, string const & /*command*/,
int result = latex.scanLogFile(terr);
if (result & LaTeX::ERRORS)
bufferErrors(*buffer, terr);
bufferErrors(buffer, terr);
return true;
}
@ -506,37 +503,34 @@ namespace {
class showMessage : public boost::signals::trackable {
public:
showMessage(Buffer const * b) : buffer_(b) {};
void operator()(string m)
showMessage(Buffer const & b) : buffer_(b) {};
void operator()(string const & m)
{
buffer_->message(m);
buffer_.message(m);
}
private:
Buffer const * buffer_;
Buffer const & buffer_;
};
}
bool Converters::runLaTeX(Buffer const * buffer, string const & command,
bool Converters::runLaTeX(Buffer const & buffer, string const & command,
LatexRunParams const & runparams)
{
// when is this needed?
if (!buffer)
return false;
buffer->busy(true);
buffer->message(_("Running LaTeX..."));
buffer.busy(true);
buffer.message(_("Running LaTeX..."));
// do the LaTeX run(s)
string name = buffer->getLatexName();
LaTeX latex(command, runparams, name, buffer->filePath());
string name = buffer.getLatexName();
LaTeX latex(command, runparams, name, buffer.filePath());
TeXErrors terr;
showMessage show(buffer);
latex.message.connect(show);
int result = latex.run(terr);
if (result & LaTeX::ERRORS)
bufferErrors(*buffer, terr);
bufferErrors(buffer, terr);
// check return value from latex.run().
if ((result & LaTeX::NO_LOGFILE)) {
@ -549,8 +543,8 @@ bool Converters::runLaTeX(Buffer const * buffer, string const & command,
_("An empty output file was generated."));
}
buffer->busy(false);
buffer.busy(false);
int const ERROR_MASK =
LaTeX::NO_LOGFILE |

View File

@ -126,10 +126,10 @@ private:
std::vector<Format const *> const
Converters::intToFormat(std::vector<int> const & input);
///
bool scanLog(Buffer const * buffer, string const & command,
bool scanLog(Buffer const & buffer, string const & command,
string const & filename);
///
bool runLaTeX(Buffer const * buffer, string const & command,
bool runLaTeX(Buffer const & buffer, string const & command,
LatexRunParams const &);
///
ConverterList converterlist_;

View File

@ -36,11 +36,11 @@ using std::find;
namespace {
vector<string> const Backends(Buffer const * buffer)
vector<string> const Backends(Buffer const & buffer)
{
vector<string> v;
if (buffer->params.getLyXTextClass().isTeXClassAvailable())
v.push_back(BufferFormat(*buffer));
if (buffer.params.getLyXTextClass().isTeXClassAvailable())
v.push_back(BufferFormat(buffer));
v.push_back("text");
return v;
}
@ -54,7 +54,7 @@ bool Exporter::Export(Buffer * buffer, string const & format,
string backend_format;
LatexRunParams runparams;
runparams.flavor = LatexRunParams::LATEX;
vector<string> backends = Backends(buffer);
vector<string> backends = Backends(*buffer);
if (find(backends.begin(), backends.end(), format) == backends.end()) {
for (vector<string>::const_iterator it = backends.begin();
it != backends.end(); ++it) {
@ -133,11 +133,11 @@ bool Exporter::Preview(Buffer * buffer, string const & format)
string result_file;
if (!Export(buffer, format, true, result_file))
return false;
return formats.view(buffer, result_file, format);
return formats.view(*buffer, result_file, format);
}
bool Exporter::IsExportable(Buffer const * buffer, string const & format)
bool Exporter::IsExportable(Buffer const & buffer, string const & format)
{
vector<string> backends = Backends(buffer);
for (vector<string>::const_iterator it = backends.begin();
@ -149,7 +149,7 @@ bool Exporter::IsExportable(Buffer const * buffer, string const & format)
vector<Format const *> const
Exporter::GetExportableFormats(Buffer const * buffer, bool only_viewable)
Exporter::GetExportableFormats(Buffer const & buffer, bool only_viewable)
{
vector<string> backends = Backends(buffer);
vector<Format const *> result =

View File

@ -34,11 +34,11 @@ public:
bool Preview(Buffer * buffer, string const & format);
///
static
bool IsExportable(Buffer const * buffer, string const & format);
bool IsExportable(Buffer const & buffer, string const & format);
///
static
std::vector<Format const *> const
GetExportableFormats(Buffer const * buffer, bool only_viewable);
GetExportableFormats(Buffer const & buffer, bool only_viewable);
///
};
#endif

View File

@ -199,7 +199,7 @@ InsetOld * createInset(FuncRequest const & cmd)
InsetCommandParams icp;
InsetCommandMailer::string2params(cmd.argument, icp);
InsetCitation * inset = new InsetCitation(icp);
inset->setLoadingBuffer(bv->buffer(), false);
inset->setLoadingBuffer(*bv->buffer(), false);
return inset;
} else if (name == "ert") {
@ -210,10 +210,10 @@ InsetOld * createInset(FuncRequest const & cmd)
return inset;
} else if (name == "external") {
Buffer const * buffer = cmd.view()->buffer();
Buffer const & buffer = *cmd.view()->buffer();
InsetExternal::Params iep;
InsetExternalMailer::string2params(cmd.argument,
*buffer, iep);
buffer, iep);
InsetExternal * inset = new InsetExternal;
inset->setParams(iep, buffer);
return inset;
@ -367,7 +367,7 @@ InsetOld * readInset(LyXLex & lex, Buffer const & buf)
|| tmptok == "Greyedout") {
inset = new InsetNote(buf.params, tmptok);
} else if (tmptok == "Branch") {
inset = new InsetBranch(buf.params, tmptok);
inset = new InsetBranch(buf.params, tmptok);
} else if (tmptok == "Include") {
InsetCommandParams p("Include");
inset = new InsetInclude(p, buf);
@ -411,7 +411,7 @@ InsetOld * readInset(LyXLex & lex, Buffer const & buf)
}
if (inset)
inset->read(&buf, lex);
inset->read(buf, lex);
}
return inset;

View File

@ -150,7 +150,7 @@ void Formats::setViewer(string const & name, string const & command)
}
bool Formats::view(Buffer const * buffer, string const & filename,
bool Formats::view(Buffer const & buffer, string const & filename,
string const & format_name) const
{
if (filename.empty())
@ -174,12 +174,11 @@ bool Formats::view(Buffer const * buffer, string const & filename,
if (format_name == "dvi" &&
!lyxrc.view_dvi_paper_option.empty()) {
command += ' ' + lyxrc.view_dvi_paper_option;
string paper_size = buffer->params.paperSizeName();
string paper_size = buffer.params.paperSizeName();
if (paper_size == "letter")
paper_size = "us";
command += ' ' + paper_size;
if (buffer->params.orientation
== ORIENTATION_LANDSCAPE)
if (buffer.params.orientation == ORIENTATION_LANDSCAPE)
command += 'r';
}
@ -191,7 +190,7 @@ bool Formats::view(Buffer const * buffer, string const & filename,
command = subst(command, token_path, QuoteName(OnlyPath(filename)));
lyxerr[Debug::FILES] << "Executing command: " << command << std::endl;
buffer->message(_("Executing command: ") + command);
buffer.message(_("Executing command: ") + command);
Path p(OnlyPath(filename));
Systemcall one;

View File

@ -96,7 +96,7 @@ public:
///
void setViewer(string const & name, string const & command);
///
bool view(Buffer const * buffer, string const & filename,
bool view(Buffer const & buffer, string const & filename,
string const & format_name) const;
///
string const prettyName(string const & name) const;

View File

@ -1,11 +1,14 @@
2003-08-28 Lars Gullik Bjønnes <larsbj@gullik.net>
2003-08-16 Martin Vermeer <martin.vermeer@hut.fi>
* most files: change to use const buffer refs.
2003-08-16 Martin Vermeer <martin.vermeer@hut.fi>
* ControlBranch.[Ch]:
* ControlDocument.C:
* Makefile.am: implements the 'branch
inset' idea. This allows the output of various versions of a
document from a single source version, selectively outputing or
inset' idea. This allows the output of various versions of a
document from a single source version, selectively outputing or
suppressing output of parts of the text.
This implementation contains a 'branch list editor' in a separate
tab of the document settings dialog. Branches are user definable
@ -38,7 +41,7 @@
2003-07-30 Martin Vermeer <martin.vermeer@hut.fi>
* ControlNote.[Ch]: add i18n support.
2003-07-27 Lars Gullik Bjønnes <larsbj@gullik.net>
* ControlToc.C (goTo): adjust for lyx::toc

View File

@ -49,7 +49,7 @@ string const ControlChanges::getChangeAuthor()
if (c.type == Change::UNCHANGED)
return string();
Author const & a(kernel().buffer()->authors().get(c.author));
Author const & a(kernel().buffer().authors().get(c.author));
string author(a.name());

View File

@ -218,7 +218,7 @@ void ControlCharacter::setLanguage(string const & val)
font_->setLanguage(ignore_language);
else if (val == "reset")
font_->setLanguage(kernel().buffer()->params.language);
font_->setLanguage(kernel().buffer().params.language);
else
font_->setLanguage(languages.getLanguage(val));

View File

@ -32,7 +32,7 @@ bool ControlCitation::initialiseParams(string const & data)
ControlCommand::initialiseParams(data);
vector<pair<string,string> > blist;
kernel().buffer()->fillWithBibKeys(blist);
kernel().buffer().fillWithBibKeys(blist);
typedef std::map<string, string>::value_type InfoMapValue;
@ -70,7 +70,7 @@ biblio::InfoMap const & ControlCitation::bibkeysInfo() const
bool ControlCitation::usingNatbib() const
{
return kernel().buffer()->params.use_natbib;
return kernel().buffer().params.use_natbib;
}
@ -81,7 +81,7 @@ vector<string> const ControlCitation::getCiteStrings(string const & key) const
vector<biblio::CiteStyle> const cs =
biblio::getCiteStyles(usingNatbib());
if (kernel().buffer()->params.use_numerical_citations)
if (kernel().buffer().params.use_numerical_citations)
styles = biblio::getNumericalStrings(key, bibkeysInfo_, cs);
else
styles = biblio::getAuthorYearStrings(key, bibkeysInfo_, cs);

View File

@ -84,9 +84,9 @@ Buffer * ControlConnectBase::buffer()
}
Buffer const * ControlConnectBase::buffer() const
Buffer const & ControlConnectBase::buffer() const
{
return lv_.buffer();
return *lv_.buffer();
}

View File

@ -85,7 +85,7 @@ protected:
/// a wrapper for LyXView::buffer()
Buffer * buffer();
///
Buffer const * buffer() const;
Buffer const & buffer() const;
/// a wrapper for LyXView::getLyXFunc()
LyXFunc & lyxfunc();
///

View File

@ -59,10 +59,10 @@ void ControlErrorList::goTo(int item)
if (err.par_id == -1)
return;
Buffer * const buf = kernel().buffer();
ParIterator pit = buf->getParFromID(err.par_id);
Buffer & buf = kernel().buffer();
ParIterator pit = buf.getParFromID(err.par_id);
if (pit == buf->par_iterator_end()) {
if (pit == buf.par_iterator_end()) {
lyxerr << "par id not found" << endl;
return;
}

View File

@ -36,7 +36,7 @@ ControlExternal::ControlExternal(Dialog & parent)
bool ControlExternal::initialiseParams(string const & data)
{
params_.reset(new InsetExternal::Params);
InsetExternalMailer::string2params(data, *kernel().buffer(), *params_);
InsetExternalMailer::string2params(data, kernel().buffer(), *params_);
return true;
}
@ -50,7 +50,7 @@ void ControlExternal::clearParams()
void ControlExternal::dispatchParams()
{
string const lfun = InsetExternalMailer::params2string(params(),
*kernel().buffer());
kernel().buffer());
kernel().dispatch(FuncRequest(LFUN_INSET_APPLY, lfun));
}
@ -75,7 +75,7 @@ void ControlExternal::editExternal()
dialog().view().apply();
string const lfun =
InsetExternalMailer::params2string(params(), *kernel().buffer());
InsetExternalMailer::params2string(params(), kernel().buffer());
kernel().dispatch(FuncRequest(LFUN_EXTERNAL_EDIT, lfun));
}

View File

@ -47,7 +47,7 @@ ControlGraphics::ControlGraphics(Dialog & parent)
bool ControlGraphics::initialiseParams(string const & data)
{
InsetGraphicsParams params;
InsetGraphicsMailer::string2params(data, *kernel().buffer(), params);
InsetGraphicsMailer::string2params(data, kernel().buffer(), params);
params_.reset(new InsetGraphicsParams(params));
return true;
}
@ -63,7 +63,7 @@ void ControlGraphics::dispatchParams()
{
InsetGraphicsParams tmp_params(params());
string const lfun =
InsetGraphicsMailer::params2string(tmp_params, *kernel().buffer());
InsetGraphicsMailer::params2string(tmp_params, kernel().buffer());
kernel().dispatch(FuncRequest(LFUN_INSET_APPLY, lfun));
}

View File

@ -21,7 +21,7 @@ ControlLog::ControlLog(Dialog & parent)
bool ControlLog::initialiseParams(string const &)
{
logfile_ = kernel().buffer()->getLogName();
logfile_ = kernel().buffer().getLogName();
return true;
}

View File

@ -33,11 +33,9 @@ ControlRef::ControlRef(Dialog & d)
vector<string> const ControlRef::getLabelList(string const & name) const
{
Buffer const * buf = bufferlist.getBuffer(MakeAbsPath(name));
if (!buf)
buf = kernel().buffer();
Buffer const & buf = *bufferlist.getBuffer(MakeAbsPath(name));
vector<string> list;
buf->getLabelList(list);
buf.getLabelList(list);
return list;
}
@ -70,7 +68,7 @@ vector<string> const ControlRef::getBufferList() const
int ControlRef::getBufferNum() const
{
vector<string> buffers = bufferlist.getFileNames();
string const name = kernel().buffer()->fileName();
string const name = kernel().buffer().fileName();
vector<string>::const_iterator cit =
find(buffers.begin(), buffers.end(), name);
if (cit == buffers.end())

View File

@ -43,13 +43,15 @@ vector<Format const *> const ControlSendto::allFormats() const
exports.push_back("lyx");
exports.push_back("text");
if (buffer()->isLatex())
#warning Can the doc ever be all/any of these at the same time? (Lgb)
// I think some if else if is in order.
if (buffer().isLatex())
exports.push_back("latex");
if (buffer()->isLinuxDoc())
if (buffer().isLinuxDoc())
exports.push_back("linuxdoc");
if (buffer()->isDocBook())
if (buffer().isDocBook())
exports.push_back("docbook");
if (buffer()->isLiterate())
if (buffer().isLiterate())
exports.push_back("literate");
// Loop over these native formats and ascertain what formats we

View File

@ -148,7 +148,6 @@ void ControlSpellchecker::check()
SpellBase::Result res = SpellBase::OK;
// clear any old selection
LyXText * text = bufferview()->getLyXText();
bufferview()->update();
while (res == SpellBase::OK || res == SpellBase::IGNORE) {

View File

@ -26,11 +26,9 @@ ControlTabular::ControlTabular(Dialog & parent)
bool ControlTabular::initialiseParams(string const & data)
{
Buffer * buffer = kernel().buffer();
if (!buffer)
return false;
Buffer & buffer = kernel().buffer();
InsetTabular tmp(*buffer);
InsetTabular tmp(buffer);
int cell = InsetTabularMailer::string2params(data, tmp);
if (cell != -1) {
params_.reset(new LyXTabular(tmp.tabular));

View File

@ -30,13 +30,13 @@ ControlVCLog::ControlVCLog(Dialog & parent)
string const ControlVCLog::getBufferFileName() const
{
return kernel().buffer()->fileName();
return kernel().buffer().fileName();
}
void ControlVCLog::getVCLogFile(ostream & ss) const
{
string const name = kernel().buffer()->lyxvc.getLogFile();
string const name = kernel().buffer().lyxvc.getLogFile();
std::ifstream in(name.c_str());

View File

@ -19,6 +19,10 @@
#include "frontends/Dialogs.h"
#include "frontends/LyXView.h"
#include "support/LAssert.h"
using lyx::support::Assert;
Kernel::Kernel(LyXView & lyxview)
: lyxview_(lyxview)
{}
@ -59,19 +63,16 @@ bool Kernel::isBufferReadonly() const
string const Kernel::bufferFilepath() const
{
return buffer()->filePath();
return buffer().filePath();
}
Kernel::DocTypes Kernel::docType() const
{
if (!buffer())
if (buffer().isLatex())
return LATEX;
if (buffer()->isLatex())
return LATEX;
if (buffer()->isLiterate())
if (buffer().isLiterate())
return LITERATE;
if (buffer()->isLinuxDoc())
if (buffer().isLinuxDoc())
return LINUXDOC;
return DOCBOOK;
@ -90,13 +91,15 @@ BufferView const * Kernel::bufferview() const
}
Buffer * Kernel::buffer()
Buffer & Kernel::buffer()
{
return lyxview_.buffer();
Assert(lyxview_.buffer());
return *lyxview_.buffer();
}
Buffer const * Kernel::buffer() const
Buffer const & Kernel::buffer() const
{
return lyxview_.buffer();
Assert(lyxview_.buffer());
return *lyxview_.buffer();
}

View File

@ -88,8 +88,8 @@ public:
LyXView & lyxview() { return lyxview_; }
LyXView const & lyxview() const { return lyxview_; }
Buffer * buffer();
Buffer const * buffer() const;
Buffer & buffer();
Buffer const & buffer() const;
BufferView * bufferview();
BufferView const * bufferview() const;

View File

@ -224,14 +224,14 @@ void LyXScreen::toggleCursor(BufferView & bv)
}
bool LyXScreen::fitManualCursor(BufferView * bv, LyXText * text,
bool LyXScreen::fitManualCursor(BufferView * bv, LyXText *,
int /*x*/, int y, int asc, int desc)
{
int const vheight = workarea().workHeight();
int const topy = bv->top_y();
int newtop = topy;
if (y + desc - topy >= vheight)
newtop = y - 3 * vheight / 4; // the scroll region must be so big!!
else if (y - asc < topy && topy > 0)
@ -252,7 +252,7 @@ unsigned int LyXScreen::topCursorVisible(LyXText * text)
LyXCursor const & cursor = text->cursor;
int top_y = text->bv()->top_y();
int newtop = top_y;
int const vheight = workarea().workHeight();
unsigned int const vheight = workarea().workHeight();
RowList::iterator row = text->cursorRow();

View File

@ -579,7 +579,7 @@ void PreviewLoader::Impl::dumpPreamble(ostream & os) const
// FIXME! This is a HACK! The proper fix is to control the 'true'
// passed to WriteStream below:
// int InsetFormula::latex(Buffer const *, ostream & os,
// int InsetFormula::latex(Buffer const &, ostream & os,
// LatexRunParams const & runparams) const
// {
// WriteStream wi(os, runparams.moving_arg, true);
@ -596,7 +596,7 @@ void PreviewLoader::Impl::dumpPreamble(ostream & os) const
for (; it != end; ++it)
if (it->lyxCode() == InsetOld::MATHMACRO_CODE)
it->latex(&buffer_, os, runparams);
it->latex(buffer_, os, runparams);
// All equation lables appear as "(#)" + preview.sty's rendering of
// the label name

View File

@ -51,7 +51,7 @@ void PreviewedInset::generatePreview()
return;
Previews & previews = Previews::get();
PreviewLoader & loader = previews.loader(view()->buffer());
PreviewLoader & loader = previews.loader(*view()->buffer());
addPreview(loader);
if (!snippet_.empty())
loader.startLoading();
@ -89,7 +89,7 @@ void PreviewedInset::removePreview()
return;
Previews & previews = Previews::get();
PreviewLoader & loader = previews.loader(view()->buffer());
PreviewLoader & loader = previews.loader(*view()->buffer());
loader.remove(snippet_);
snippet_.erase();
pimage_ = 0;
@ -104,7 +104,7 @@ bool PreviewedInset::previewReady() const
if (!pimage_ || snippet_ != pimage_->snippet()) {
PreviewLoader & ploader =
Previews::get().loader(view()->buffer());
Previews::get().loader(*view()->buffer());
pimage_ = ploader.preview(snippet_);
}

View File

@ -60,15 +60,13 @@ Previews::~Previews()
{}
PreviewLoader & Previews::loader(Buffer const * buffer) const
PreviewLoader & Previews::loader(Buffer const & buffer) const
{
Assert(buffer);
Impl::CacheType::iterator it = pimpl_->cache.find(buffer);
Impl::CacheType::iterator it = pimpl_->cache.find(&buffer);
if (it == pimpl_->cache.end()) {
Impl::PreviewLoaderPtr ptr(new PreviewLoader(*buffer));
pimpl_->cache[buffer] = ptr;
Impl::PreviewLoaderPtr ptr(new PreviewLoader(buffer));
pimpl_->cache[&buffer] = ptr;
return *ptr.get();
}
@ -76,12 +74,9 @@ PreviewLoader & Previews::loader(Buffer const * buffer) const
}
void Previews::removeLoader(Buffer const * buffer) const
void Previews::removeLoader(Buffer const & buffer) const
{
if (!buffer)
return;
Impl::CacheType::iterator it = pimpl_->cache.find(buffer);
Impl::CacheType::iterator it = pimpl_->cache.find(&buffer);
if (it != pimpl_->cache.end())
pimpl_->cache.erase(it);
@ -90,7 +85,7 @@ void Previews::removeLoader(Buffer const * buffer) const
void Previews::generateBufferPreviews(Buffer const & buffer) const
{
PreviewLoader & ploader = loader(&buffer);
PreviewLoader & ploader = loader(buffer);
Buffer::inset_iterator it = buffer.inset_const_iterator_begin();
Buffer::inset_iterator end = buffer.inset_const_iterator_end();

View File

@ -39,12 +39,12 @@ public:
* We assert that (buffer != 0) but do not pass a Buffer &
* so that insets do not need to #include buffer.h
*/
PreviewLoader & loader(Buffer const * buffer) const;
PreviewLoader & loader(Buffer const & buffer) const;
/** Called from the Buffer d-tor.
* If (buffer == 0), does nothing.
*/
void removeLoader(Buffer const * buffer) const;
void removeLoader(Buffer const & buffer) const;
/** For a particular buffer, initiate the generation of previews
* for each and every snippetof LaTeX that's of interest with

View File

@ -1,3 +1,7 @@
2003-08-28 Lars Gullik Bjønnes <larsbj@gullik.net>
* most files: change to use const Buffer refs
2003-08-26 Martin Vermeer <martin.vermeer@hut.fi>
* insetfootlike.C: whitespace.
@ -48,7 +52,7 @@
* insetref.C: require amsmath for eqref
2003-08-17 Martin Vermeer <martin.vermeer@hut.fi>
2003-08-17 Martin Vermeer <martin.vermeer@hut.fi>
* Makefile.am:
* inset.h:

View File

@ -178,19 +178,19 @@ public:
/// wrapper around the above
bool insetAllowed(InsetOld * in) const;
///
virtual void write(Buffer const *, std::ostream &) const = 0;
virtual void write(Buffer const &, std::ostream &) const = 0;
///
virtual void read(Buffer const *, LyXLex & lex) = 0;
virtual void read(Buffer const &, LyXLex & lex) = 0;
/// returns the number of rows (\n's) of generated tex code.
virtual int latex(Buffer const *, std::ostream &,
virtual int latex(Buffer const &, std::ostream &,
LatexRunParams const &) const = 0;
///
virtual int ascii(Buffer const *,
virtual int ascii(Buffer const &,
std::ostream &, int linelen = 0) const = 0;
///
virtual int linuxdoc(Buffer const *, std::ostream &) const = 0;
virtual int linuxdoc(Buffer const &, std::ostream &) const = 0;
///
virtual int docbook(Buffer const *, std::ostream &, bool) const = 0;
virtual int docbook(Buffer const &, std::ostream &, bool) const = 0;
/// returns LyX code associated with the inset. Used for TOC, ...)
virtual InsetOld::Code lyxCode() const { return NO_CODE; }

View File

@ -87,7 +87,7 @@ void InsetBibitem::setCounter(int c)
// as a LyX 2.x command, and lyxlex is not enough smart to understand
// real LaTeX commands. Yes, that could be fixed, but would be a waste
// of time cause LyX3 won't use lyxlex anyway. (ale)
void InsetBibitem::write(Buffer const *, std::ostream & os) const
void InsetBibitem::write(Buffer const &, std::ostream & os) const
{
os << "\n\\bibitem ";
if (!getOptions().empty())
@ -98,7 +98,7 @@ void InsetBibitem::write(Buffer const *, std::ostream & os) const
// This is necessary here because this is written without begin_inset
// This should be changed!!! (Jug)
void InsetBibitem::read(Buffer const *, LyXLex & lex)
void InsetBibitem::read(Buffer const &, LyXLex & lex)
{
if (lex.eatLine()) {
scanCommand(lex.getString());
@ -119,7 +119,7 @@ string const InsetBibitem::getBibLabel() const
}
string const InsetBibitem::getScreenLabel(Buffer const *) const
string const InsetBibitem::getScreenLabel(Buffer const &) const
{
return getContents() + " [" + getBibLabel() + ']';
}
@ -146,7 +146,7 @@ int bibitemMaxWidth(BufferView * bv, LyXFont const &)
// ale070405
string const bibitemWidest(Buffer const * buffer)
string const bibitemWidest(Buffer const & buffer)
{
int w = 0;
// Does look like a hack? It is! (but will change at 0.13)
@ -154,8 +154,8 @@ string const bibitemWidest(Buffer const * buffer)
InsetBibitem const * bitem = 0;
LyXFont font;
ParagraphList::const_iterator it = buffer->paragraphs.begin();
ParagraphList::const_iterator end = buffer->paragraphs.end();
ParagraphList::const_iterator it = buffer.paragraphs.begin();
ParagraphList::const_iterator end = buffer.paragraphs.end();
for (; it != end; ++it) {
if (it->bibitem()) {

View File

@ -35,11 +35,11 @@ public:
/** Currently \bibitem is used as a LyX2.x command,
so we need this method.
*/
void write(Buffer const *, std::ostream &) const;
void write(Buffer const &, std::ostream &) const;
///
void read(Buffer const *, LyXLex & lex);
void read(Buffer const &, LyXLex & lex);
///
virtual string const getScreenLabel(Buffer const *) const;
virtual string const getScreenLabel(Buffer const &) const;
///
EDITABLE editable() const { return IS_EDITABLE; }
///

View File

@ -92,13 +92,13 @@ dispatch_result InsetBibtex::localDispatch(FuncRequest const & cmd)
}
string const InsetBibtex::getScreenLabel(Buffer const *) const
string const InsetBibtex::getScreenLabel(Buffer const &) const
{
return _("BibTeX Generated References");
}
int InsetBibtex::latex(Buffer const * buffer, ostream & os,
int InsetBibtex::latex(Buffer const & buffer, ostream & os,
LatexRunParams const & runparams) const
{
// changing the sequence of the commands
@ -120,8 +120,8 @@ int InsetBibtex::latex(Buffer const * buffer, ostream & os,
}
if (!runparams.nice
&& IsFileReadable(MakeAbsPath(style, buffer->filePath()) + ".bst")) {
style = MakeAbsPath(style, buffer->filePath());
&& IsFileReadable(MakeAbsPath(style, buffer.filePath()) + ".bst")) {
style = MakeAbsPath(style, buffer.filePath());
}
if (!style.empty()) { // we want no \biblio...{}
@ -134,9 +134,9 @@ int InsetBibtex::latex(Buffer const * buffer, ostream & os,
// part of its name, because it's than book.
// For the "official" lyx-layouts it's no problem to support
// all well
if (!contains(buffer->params.getLyXTextClass().name(),
if (!contains(buffer.params.getLyXTextClass().name(),
"art")) {
if (buffer->params.sides == LyXTextClass::OneSide) {
if (buffer.params.sides == LyXTextClass::OneSide) {
// oneside
os << "\\clearpage";
} else {
@ -160,8 +160,8 @@ int InsetBibtex::latex(Buffer const * buffer, ostream & os,
string db_out;
while (!adb.empty()) {
if (!runparams.nice &&
IsFileReadable(MakeAbsPath(adb, buffer->filePath())+".bib"))
adb = os::external_path(MakeAbsPath(adb, buffer->filePath()));
IsFileReadable(MakeAbsPath(adb, buffer.filePath())+".bib"))
adb = os::external_path(MakeAbsPath(adb, buffer.filePath()));
db_out += adb;
db_out += ',';
db_in = split(db_in, adb,',');
@ -198,11 +198,10 @@ vector<string> const InsetBibtex::getFiles(Buffer const & buffer) const
// This method returns a comma separated list of Bibtex entries
void InsetBibtex::fillWithBibKeys(Buffer const * buffer,
void InsetBibtex::fillWithBibKeys(Buffer const & buffer,
std::vector<std::pair<string, string> > & keys) const
{
Assert(buffer);
vector<string> const files = getFiles(*buffer);
vector<string> const files = getFiles(buffer);
for (vector<string>::const_iterator it = files.begin();
it != files.end(); ++ it) {
// This is a _very_ simple parser for Bibtex database

View File

@ -33,16 +33,16 @@ public:
/// small wrapper for the time being
virtual dispatch_result localDispatch(FuncRequest const & cmd);
///
string const getScreenLabel(Buffer const *) const;
string const getScreenLabel(Buffer const &) const;
///
EDITABLE editable() const { return IS_EDITABLE; }
///
InsetOld::Code lyxCode() const { return InsetOld::BIBTEX_CODE; }
///
int latex(Buffer const *, std::ostream &,
int latex(Buffer const &, std::ostream &,
LatexRunParams const &) const;
///
void fillWithBibKeys(Buffer const * buffer,
void fillWithBibKeys(Buffer const & buffer,
std::vector<std::pair<string,string> > & keys) const;
///
std::vector<string> const getFiles(Buffer const &) const;

View File

@ -73,14 +73,14 @@ string const InsetBranch::editMessage() const
}
void InsetBranch::write(Buffer const * buf, ostream & os) const
void InsetBranch::write(Buffer const & buf, ostream & os) const
{
params_.write(os);
InsetCollapsable::write(buf, os);
}
void InsetBranch::read(Buffer const * buf, LyXLex & lex)
void InsetBranch::read(Buffer const & buf, LyXLex & lex)
{
if (lex.isOK()) {
lex.next();
@ -129,7 +129,7 @@ dispatch_result InsetBranch::localDispatch(FuncRequest const & cmd)
return DISPATCHED;
}
case LFUN_INSET_EDIT:
if (cmd.button() != mouse_button::button3)
if (cmd.button() != mouse_button::button3)
return InsetCollapsable::localDispatch(cmd);
return UNDISPATCHED;
case LFUN_INSET_DIALOG_UPDATE:
@ -148,35 +148,35 @@ dispatch_result InsetBranch::localDispatch(FuncRequest const & cmd)
int InsetBranch::latex(Buffer const * buf, ostream & os,
int InsetBranch::latex(Buffer const & buf, ostream & os,
LatexRunParams const & runparams) const
{
string const branch_sel = buf->params.branchlist.allSelected();
string const branch_sel = buf.params.branchlist.allSelected();
if (branch_sel.find(params_.branch, 0) != string::npos)
return inset.latex(buf, os, runparams);
return 0;
}
int InsetBranch::linuxdoc(Buffer const *, std::ostream &) const
{
return 0;
int InsetBranch::linuxdoc(Buffer const &, std::ostream &) const
{
return 0;
}
int InsetBranch::docbook(Buffer const * buf, std::ostream & os, bool mixcont) const
int InsetBranch::docbook(Buffer const & buf, std::ostream & os, bool mixcont) const
{
// untested - MV
string const branch_sel = buf->params.branchlist.allSelected();
if (branch_sel.find(params_.branch, 0) != string::npos)
string const branch_sel = buf.params.branchlist.allSelected();
if (branch_sel.find(params_.branch, 0) != string::npos)
return inset.docbook(buf, os, mixcont);
return 0;
}
int InsetBranch::ascii(Buffer const * buf, std::ostream & os, int ll) const
int InsetBranch::ascii(Buffer const & buf, std::ostream & os, int ll) const
{
string const branch_sel = buf->params.branchlist.allSelected();
string const branch_sel = buf.params.branchlist.allSelected();
if (branch_sel.find(params_.branch, 0) != string::npos) {
return inset.ascii(buf, os, ll);
}
@ -260,4 +260,3 @@ void InsetBranchParams::read(LyXLex & lex)
branch = lex.getString();
}
}

View File

@ -17,17 +17,17 @@
#include "BranchList.h"
struct InsetBranchParams {
///
void write(std::ostream & os) const;
///
void read(LyXLex & lex);
///
string branch;
///
void write(std::ostream & os) const;
///
void read(LyXLex & lex);
///
string branch;
/// Hack -- MV
BranchList branchlist;
};
/** The Branch inset for alternative, conditional output.
*/
@ -35,44 +35,44 @@ class InsetBranch : public InsetCollapsable {
public:
///
InsetBranch(BufferParams const &, string const &);
/// Copy constructor
InsetBranch(InsetBranch const &);
///
InsetBranch(BufferParams const &, string const &);
/// Copy constructor
InsetBranch(InsetBranch const &);
///
~InsetBranch();
///
///
virtual std::auto_ptr<InsetBase> clone() const;
///
string const editMessage() const;
///
InsetOld::Code lyxCode() const { return InsetOld::BRANCH_CODE; }
///
void write(Buffer const *, std::ostream &) const;
void write(Buffer const &, std::ostream &) const;
///
void read(Buffer const * buf, LyXLex & lex);
void read(Buffer const & buf, LyXLex & lex);
///
void setButtonLabel();
///
bool showInsetDialog(BufferView *) const;
///
dispatch_result localDispatch(FuncRequest const &);
dispatch_result localDispatch(FuncRequest const &);
///
int latex(Buffer const *, std::ostream &,
LatexRunParams const &) const;
int latex(Buffer const &, std::ostream &,
LatexRunParams const &) const;
///
int linuxdoc(Buffer const *, std::ostream &) const;
int linuxdoc(Buffer const &, std::ostream &) const;
///
int docbook(Buffer const *, std::ostream &, bool) const;
int docbook(Buffer const &, std::ostream &, bool) const;
///
int ascii(Buffer const *, std::ostream &, int) const;
int ascii(Buffer const &, std::ostream &, int) const;
///
void validate(LaTeXFeatures &) const;
///
InsetBranchParams const & params() const { return params_; }
///
void setParams(InsetBranchParams const & params) { params_ = params; }
private:
friend class InsetBranchParams;

View File

@ -41,14 +41,14 @@ InsetCaption::InsetCaption(BufferParams const & bp)
}
void InsetCaption::write(Buffer const * buf, ostream & os) const
void InsetCaption::write(Buffer const & buf, ostream & os) const
{
os << "Caption\n";
writeParagraphData(buf, os);
}
void InsetCaption::read(Buffer const * buf, LyXLex & lex)
void InsetCaption::read(Buffer const & buf, LyXLex & lex)
{
#if 0
// We will enably this check again when the compability
@ -104,7 +104,7 @@ void InsetCaption::draw(PainterInfo & pi, int x, int y) const
}
int InsetCaption::latex(Buffer const * buf, ostream & os,
int InsetCaption::latex(Buffer const & buf, ostream & os,
LatexRunParams const & runparams) const
{
// This is a bit too simplistic to take advantage of
@ -119,7 +119,7 @@ int InsetCaption::latex(Buffer const * buf, ostream & os,
}
int InsetCaption::ascii(Buffer const * /*buf*/,
int InsetCaption::ascii(Buffer const & /*buf*/,
ostream & /*os*/, int /*linelen*/) const
{
// FIX: Implement me!
@ -127,7 +127,7 @@ int InsetCaption::ascii(Buffer const * /*buf*/,
}
int InsetCaption::docbook(Buffer const * buf, ostream & os, bool mixcont) const
int InsetCaption::docbook(Buffer const & buf, ostream & os, bool mixcont) const
{
int ret;
os << "<title>";

View File

@ -22,9 +22,9 @@ public:
///
InsetCaption(BufferParams const &);
///
void write(Buffer const * buf, std::ostream & os) const;
void write(Buffer const & buf, std::ostream & os) const;
///
void read(Buffer const * buf, LyXLex & lex);
void read(Buffer const & buf, LyXLex & lex);
///
virtual bool display() const;
///
@ -34,12 +34,12 @@ public:
///
virtual void draw(PainterInfo & pi, int x, int y) const;
///
virtual int latex(Buffer const * buf, std::ostream & os,
virtual int latex(Buffer const & buf, std::ostream & os,
LatexRunParams const &) const;
///
int ascii(Buffer const * buf, std::ostream & os, int linelen) const;
int ascii(Buffer const & buf, std::ostream & os, int linelen) const;
///
int docbook(Buffer const * buf, std::ostream & os, bool mixcont) const;
int docbook(Buffer const & buf, std::ostream & os, bool mixcont) const;
};

View File

@ -36,7 +36,7 @@ namespace {
// reload the bibkey list
std::map<Buffer const *, bool> loading_buffer;
string const getNatbibLabel(Buffer const * buffer,
string const getNatbibLabel(Buffer const & buffer,
string const & citeType, string const & keyList,
string const & before, string const & after,
bool numerical)
@ -46,13 +46,13 @@ string const getNatbibLabel(Buffer const * buffer,
// Only load the bibkeys once if we're loading up the buffer,
// else load them afresh each time.
map<Buffer const *, bool>::iterator lit = loading_buffer.find(buffer);
map<Buffer const *, bool>::iterator lit = loading_buffer.find(&buffer);
if (lit == loading_buffer.end())
loading_buffer[buffer] = true;
loading_buffer[&buffer] = true;
bool loadkeys = !loading_buffer[buffer];
bool loadkeys = !loading_buffer[&buffer];
if (!loadkeys) {
CachedMap::iterator kit = cached_keys.find(buffer);
CachedMap::iterator kit = cached_keys.find(&buffer);
loadkeys = kit == cached_keys.end();
}
@ -60,7 +60,7 @@ string const getNatbibLabel(Buffer const * buffer,
// build the keylist
typedef vector<std::pair<string, string> > InfoType;
InfoType bibkeys;
buffer->fillWithBibKeys(bibkeys);
buffer.fillWithBibKeys(bibkeys);
InfoType::const_iterator bit = bibkeys.begin();
InfoType::const_iterator bend = bibkeys.end();
@ -72,10 +72,10 @@ string const getNatbibLabel(Buffer const * buffer,
if (infomap.empty())
return string();
cached_keys[buffer] = infomap;
cached_keys[&buffer] = infomap;
}
biblio::InfoMap infomap = cached_keys[buffer];
biblio::InfoMap infomap = cached_keys[&buffer];
// the natbib citation-styles
// CITET: author (year)
@ -240,13 +240,13 @@ InsetCitation::~InsetCitation()
}
string const InsetCitation::generateLabel(Buffer const * buffer) const
string const InsetCitation::generateLabel(Buffer const & buffer) const
{
string const before = string();
string const after = getOptions();
string label;
if (buffer->params.use_natbib) {
if (buffer.params.use_natbib) {
string cmd = getCmdName();
if (cmd == "cite") {
// We may be "upgrading" from an older LyX version.
@ -254,14 +254,14 @@ string const InsetCitation::generateLabel(Buffer const * buffer) const
// author/year info is not present in the biblio
// database, then getNatbibLabel will exit gracefully
// and we'll call getBasicLabel.
if (buffer->params.use_numerical_citations)
if (buffer.params.use_numerical_citations)
cmd = "citep";
else
cmd = "citet";
}
label = getNatbibLabel(buffer, cmd, getContents(),
before, after,
buffer->params.use_numerical_citations);
buffer.params.use_numerical_citations);
}
// Fallback to fail-safe
@ -273,12 +273,12 @@ string const InsetCitation::generateLabel(Buffer const * buffer) const
}
InsetCitation::Cache::Style InsetCitation::getStyle(Buffer const * buffer) const
InsetCitation::Cache::Style InsetCitation::getStyle(Buffer const & buffer) const
{
Cache::Style style = Cache::BASIC;
if (buffer->params.use_natbib) {
if (buffer->params.use_numerical_citations) {
if (buffer.params.use_natbib) {
if (buffer.params.use_numerical_citations) {
style = Cache::NATBIB_NUM;
} else {
style = Cache::NATBIB_AY;
@ -289,7 +289,7 @@ InsetCitation::Cache::Style InsetCitation::getStyle(Buffer const * buffer) const
}
string const InsetCitation::getScreenLabel(Buffer const * buffer) const
string const InsetCitation::getScreenLabel(Buffer const & buffer) const
{
Cache::Style const style = getStyle(buffer);
if (cache.params == params() && cache.style == style)
@ -318,10 +318,10 @@ string const InsetCitation::getScreenLabel(Buffer const * buffer) const
}
void InsetCitation::setLoadingBuffer(Buffer const * buffer, bool state) const
void InsetCitation::setLoadingBuffer(Buffer const & buffer, bool state) const
{
// Doesn't matter if there is no bv->buffer() entry in the map.
loading_buffer[buffer] = state;
loading_buffer[&buffer] = state;
}
@ -331,7 +331,7 @@ dispatch_result InsetCitation::localDispatch(FuncRequest const & cmd)
case LFUN_INSET_EDIT:
// A call to edit indicates that we're no longer loading the
// buffer but doing some real work.
setLoadingBuffer(cmd.view()->buffer(), false);
setLoadingBuffer(*cmd.view()->buffer(), false);
InsetCommandMailer("citation", *this).showDialog(cmd.view());
return DISPATCHED;
@ -341,7 +341,7 @@ dispatch_result InsetCitation::localDispatch(FuncRequest const & cmd)
}
int InsetCitation::ascii(Buffer const * buffer, ostream & os, int) const
int InsetCitation::ascii(Buffer const & buffer, ostream & os, int) const
{
if (cache.params == params() && cache.style == getStyle(buffer))
os << cache.generated_label;
@ -355,11 +355,11 @@ int InsetCitation::ascii(Buffer const * buffer, ostream & os, int) const
// the \cite command is valid. Eg, the user has natbib enabled, inputs some
// citations and then changes his mind, turning natbib support off. The output
// should revert to \cite[]{}
int InsetCitation::latex(Buffer const * buffer, ostream & os,
int InsetCitation::latex(Buffer const & buffer, ostream & os,
LatexRunParams const &) const
{
os << "\\";
if (buffer->params.use_natbib)
if (buffer.params.use_natbib)
os << getCmdName();
else
os << "cite";
@ -373,7 +373,7 @@ int InsetCitation::latex(Buffer const * buffer, ostream & os,
string const before = string();
string const after = getOptions();
if (!before.empty() && buffer->params.use_natbib)
if (!before.empty() && buffer.params.use_natbib)
os << '[' << before << "][" << after << ']';
else if (!after.empty())
os << '[' << after << ']';

View File

@ -29,15 +29,15 @@ public:
return std::auto_ptr<InsetBase>(new InsetCitation(params()));
}
///
string const getScreenLabel(Buffer const *) const;
string const getScreenLabel(Buffer const &) const;
///
EDITABLE editable() const { return IS_EDITABLE; }
///
InsetOld::Code lyxCode() const { return InsetOld::CITE_CODE; }
///
int ascii(Buffer const *, std::ostream &, int linelen) const;
int ascii(Buffer const &, std::ostream &, int linelen) const;
///
int latex(Buffer const *, std::ostream &,
int latex(Buffer const &, std::ostream &,
LatexRunParams const &) const;
///
dispatch_result localDispatch(FuncRequest const & cmd);
@ -47,7 +47,7 @@ public:
is inserted. Tells us that the buffer is no longer being loaded
and that the cache of BibTeX keys should be reloaded in the future.
*/
void setLoadingBuffer(Buffer const * buffer, bool state) const;
void setLoadingBuffer(Buffer const & buffer, bool state) const;
private:
struct Cache {
///
@ -72,9 +72,9 @@ private:
};
/// This function does the donkey work of creating the pretty label
string const generateLabel(Buffer const *) const;
string const generateLabel(Buffer const &) const;
///
Cache::Style getStyle(Buffer const * buffer) const;
Cache::Style getStyle(Buffer const & buffer) const;
///
mutable Cache cache;

View File

@ -84,14 +84,14 @@ bool InsetCollapsable::insertInset(BufferView * bv, InsetOld * in)
}
void InsetCollapsable::write(Buffer const * buf, ostream & os) const
void InsetCollapsable::write(Buffer const & buf, ostream & os) const
{
os << "collapsed " << (collapsed_ ? "true" : "false") << "\n";
inset.writeParagraphData(buf, os);
}
void InsetCollapsable::read(Buffer const * buf, LyXLex & lex)
void InsetCollapsable::read(Buffer const & buf, LyXLex & lex)
{
if (lex.isOK()) {
lex.next();
@ -252,26 +252,26 @@ void InsetCollapsable::lfunMouseRelease(FuncRequest const & cmd)
}
int InsetCollapsable::latex(Buffer const * buf, ostream & os,
int InsetCollapsable::latex(Buffer const & buf, ostream & os,
LatexRunParams const & runparams) const
{
return inset.latex(buf, os, runparams);
}
int InsetCollapsable::ascii(Buffer const * buf, ostream & os, int ll) const
int InsetCollapsable::ascii(Buffer const & buf, ostream & os, int ll) const
{
return inset.ascii(buf, os, ll);
}
int InsetCollapsable::linuxdoc(Buffer const * buf, ostream & os) const
int InsetCollapsable::linuxdoc(Buffer const & buf, ostream & os) const
{
return inset.linuxdoc(buf, os);
}
int InsetCollapsable::docbook(Buffer const * buf, ostream & os, bool mixcont) const
int InsetCollapsable::docbook(Buffer const & buf, ostream & os, bool mixcont) const
{
return inset.docbook(buf, os, mixcont);
}

View File

@ -42,9 +42,9 @@ public:
///
InsetCollapsable(InsetCollapsable const & in);
///
void read(Buffer const *, LyXLex &);
void read(Buffer const &, LyXLex &);
///
void write(Buffer const *, std::ostream &) const;
void write(Buffer const &, std::ostream &) const;
///
void metrics(MetricsInfo &, Dimension &) const;
///
@ -75,14 +75,14 @@ public:
///
RESULT localDispatch(FuncRequest const &);
///
int latex(Buffer const *, std::ostream &,
int latex(Buffer const &, std::ostream &,
LatexRunParams const &) const;
///
int ascii(Buffer const *, std::ostream &, int) const;
int ascii(Buffer const &, std::ostream &, int) const;
///
int linuxdoc(Buffer const *, std::ostream &) const;
int linuxdoc(Buffer const &, std::ostream &) const;
///
int docbook(Buffer const *, std::ostream &, bool mixcont) const;
int docbook(Buffer const &, std::ostream &, bool mixcont) const;
///
void validate(LaTeXFeatures & features) const;
/// FIXME, document

View File

@ -43,7 +43,7 @@ void InsetCommand::metrics(MetricsInfo & mi, Dimension & dim) const
{
if (!set_label_) {
set_label_ = true;
button_.update(getScreenLabel(mi.base.bv->buffer()),
button_.update(getScreenLabel(*mi.base.bv->buffer()),
editable() != NOT_EDITABLE);
}
button_.metrics(mi, dim);
@ -66,7 +66,7 @@ void InsetCommand::setParams(InsetCommandParams const & p)
}
int InsetCommand::latex(Buffer const *, ostream & os,
int InsetCommand::latex(Buffer const &, ostream & os,
LatexRunParams const &) const
{
os << getCommand();
@ -74,19 +74,19 @@ int InsetCommand::latex(Buffer const *, ostream & os,
}
int InsetCommand::ascii(Buffer const *, ostream &, int) const
int InsetCommand::ascii(Buffer const &, ostream &, int) const
{
return 0;
}
int InsetCommand::linuxdoc(Buffer const *, ostream &) const
int InsetCommand::linuxdoc(Buffer const &, ostream &) const
{
return 0;
}
int InsetCommand::docbook(Buffer const *, ostream &, bool) const
int InsetCommand::docbook(Buffer const &, ostream &, bool) const
{
return 0;
}

View File

@ -37,22 +37,22 @@ public:
///
void draw(PainterInfo & pi, int x, int y) const;
///
void write(Buffer const *, std::ostream & os) const
void write(Buffer const &, std::ostream & os) const
{ p_.write(os); }
///
virtual void read(Buffer const *, LyXLex & lex)
virtual void read(Buffer const &, LyXLex & lex)
{ p_.read(lex); }
/// Can remove one InsetBibKey is modified
void scanCommand(string const & c) { p_.scanCommand(c); };
///
virtual int latex(Buffer const *, std::ostream &,
virtual int latex(Buffer const &, std::ostream &,
LatexRunParams const &) const;
///
int ascii(Buffer const *, std::ostream &, int linelen) const;
int ascii(Buffer const &, std::ostream &, int linelen) const;
///
virtual int linuxdoc(Buffer const *, std::ostream &) const;
virtual int linuxdoc(Buffer const &, std::ostream &) const;
///
virtual int docbook(Buffer const *, std::ostream &, bool) const;
virtual int docbook(Buffer const &, std::ostream &, bool) const;
///
InsetOld::Code lyxCode() const { return InsetOld::NO_CODE; }
@ -81,7 +81,7 @@ protected:
///
virtual BufferView * view() const;
/// This should provide the text for the button
virtual string const getScreenLabel(Buffer const *) const = 0;
virtual string const getScreenLabel(Buffer const &) const = 0;
private:
///

View File

@ -46,14 +46,14 @@ auto_ptr<InsetBase> InsetEnvironment::clone() const
}
void InsetEnvironment::write(Buffer const * buf, ostream & os) const
void InsetEnvironment::write(Buffer const & buf, ostream & os) const
{
os << "Environment " << getInsetName() << "\n";
InsetText::write(buf, os);
}
void InsetEnvironment::read(Buffer const * buf, LyXLex & lex)
void InsetEnvironment::read(Buffer const & buf, LyXLex & lex)
{
InsetText::read(buf, lex);
}
@ -65,7 +65,7 @@ string const InsetEnvironment::editMessage() const
}
int InsetEnvironment::latex(Buffer const * buf, ostream & os,
int InsetEnvironment::latex(Buffer const & buf, ostream & os,
LatexRunParams const & runparams) const
{
os << layout_->latexheader;

View File

@ -22,15 +22,15 @@ public:
///
InsetEnvironment(InsetEnvironment const &);
///
void write(Buffer const * buf, std::ostream & os) const;
void write(Buffer const & buf, std::ostream & os) const;
///
void read(Buffer const * buf, LyXLex & lex);
void read(Buffer const & buf, LyXLex & lex);
///
virtual std::auto_ptr<InsetBase> clone() const;
///
InsetOld::Code lyxCode() const { return InsetOld::ENVIRONMENT_CODE; }
///
int latex(Buffer const *, std::ostream &,
int latex(Buffer const &, std::ostream &,
LatexRunParams const &) const;
///
string const editMessage() const;

View File

@ -112,7 +112,7 @@ InsetERT::~InsetERT()
}
void InsetERT::read(Buffer const * buf, LyXLex & lex)
void InsetERT::read(Buffer const & buf, LyXLex & lex)
{
bool token_found = false;
if (lex.isOK()) {
@ -182,7 +182,7 @@ void InsetERT::read(Buffer const * buf, LyXLex & lex)
}
void InsetERT::write(Buffer const * buf, ostream & os) const
void InsetERT::write(Buffer const & buf, ostream & os) const
{
string st;
@ -202,7 +202,7 @@ void InsetERT::write(Buffer const * buf, ostream & os) const
<< "status "<< st << "\n";
//inset.writeParagraphData(buf, os);
string const layout(buf->params.getLyXTextClass().defaultLayoutName());
string const layout(buf.params.getLyXTextClass().defaultLayoutName());
ParagraphList::iterator par = inset.paragraphs.begin();
ParagraphList::iterator end = inset.paragraphs.end();
for (; par != end; ++par) {
@ -325,7 +325,7 @@ void InsetERT::lfunMouseMotion(FuncRequest const & cmd)
}
int InsetERT::latex(Buffer const *, ostream & os,
int InsetERT::latex(Buffer const &, ostream & os,
LatexRunParams const &) const
{
ParagraphList::iterator par = inset.paragraphs.begin();
@ -357,13 +357,13 @@ int InsetERT::latex(Buffer const *, ostream & os,
}
int InsetERT::ascii(Buffer const *, ostream &, int /*linelen*/) const
int InsetERT::ascii(Buffer const &, ostream &, int /*linelen*/) const
{
return 0;
}
int InsetERT::linuxdoc(Buffer const *, ostream & os) const
int InsetERT::linuxdoc(Buffer const &, ostream & os) const
{
ParagraphList::iterator par = inset.paragraphs.begin();
ParagraphList::iterator end = inset.paragraphs.end();
@ -390,7 +390,7 @@ int InsetERT::linuxdoc(Buffer const *, ostream & os) const
}
int InsetERT::docbook(Buffer const *, ostream & os, bool) const
int InsetERT::docbook(Buffer const &, ostream & os, bool) const
{
ParagraphList::iterator par = inset.paragraphs.begin();
ParagraphList::iterator end = inset.paragraphs.end();

View File

@ -49,9 +49,9 @@ public:
///
InsetOld::Code lyxCode() const { return InsetOld::ERT_CODE; }
///
void read(Buffer const * buf, LyXLex & lex);
void read(Buffer const & buf, LyXLex & lex);
///
void write(Buffer const * buf, std::ostream & os) const;
void write(Buffer const & buf, std::ostream & os) const;
///
string const editMessage() const;
///
@ -64,15 +64,15 @@ public:
///
EDITABLE editable() const;
///
int latex(Buffer const *, std::ostream &,
int latex(Buffer const &, std::ostream &,
LatexRunParams const &) const;
///
int ascii(Buffer const *,
int ascii(Buffer const &,
std::ostream &, int linelen = 0) const;
///
int linuxdoc(Buffer const *, std::ostream &) const;
int linuxdoc(Buffer const &, std::ostream &) const;
///
int docbook(Buffer const *, std::ostream &, bool mixcont) const;
int docbook(Buffer const &, std::ostream &, bool mixcont) const;
///
void validate(LaTeXFeatures &) const {}
///

View File

@ -68,10 +68,10 @@ unsigned int defaultLyxScale = 100;
/// Substitute meta-variables in string s, makeing use of params and buffer.
string const doSubstitution(InsetExternal::Params const & params,
Buffer const * buffer, string const & s);
Buffer const & buffer, string const & s);
/// Invoke the external editor.
void editExternal(InsetExternal::Params const & params, Buffer const * buffer);
void editExternal(InsetExternal::Params const & params, Buffer const & buffer);
} // namespace anon
@ -141,16 +141,16 @@ dispatch_result InsetExternal::localDispatch(FuncRequest const & cmd)
Buffer const & buffer = *cmd.view()->buffer();
InsetExternal::Params p;
InsetExternalMailer::string2params(cmd.argument, buffer, p);
editExternal(p, &buffer);
editExternal(p, buffer);
return DISPATCHED_NOUPDATE;
}
case LFUN_INSET_MODIFY: {
Assert(cmd.view());
Buffer const * buffer = cmd.view()->buffer();
Buffer const & buffer = *cmd.view()->buffer();
InsetExternal::Params p;
InsetExternalMailer::string2params(cmd.argument, *buffer, p);
InsetExternalMailer::string2params(cmd.argument, buffer, p);
setParams(p, buffer);
cmd.view()->updateInset(this);
return DISPATCHED;
@ -216,7 +216,7 @@ ExternalTemplate const * getTemplatePtr(InsetExternal::Params const & params)
string const getScreenLabel(InsetExternal::Params const & params,
Buffer const * buffer)
Buffer const & buffer)
{
ExternalTemplate const * const ptr = getTemplatePtr(params);
if (!ptr)
@ -234,7 +234,7 @@ InsetExternal::Params const & InsetExternal::params() const
}
void InsetExternal::setParams(Params const & p, Buffer const * buffer)
void InsetExternal::setParams(Params const & p, Buffer const & buffer)
{
// The stored params; what we would like to happen in an ideal world.
params_.filename = p.filename;
@ -272,14 +272,14 @@ void InsetExternal::setParams(Params const & p, Buffer const * buffer)
}
void InsetExternal::write(Buffer const * buffer, ostream & os) const
void InsetExternal::write(Buffer const & buffer, ostream & os) const
{
os << "External\n"
<< "\ttemplate " << params_.templatename << '\n';
if (!params_.filename.empty())
os << "\tfilename "
<< params_.filename.outputFilename(buffer->filePath())
<< params_.filename.outputFilename(buffer.filePath())
<< '\n';
if (params_.display != defaultDisplayType)
@ -291,7 +291,7 @@ void InsetExternal::write(Buffer const * buffer, ostream & os) const
}
void InsetExternal::read(Buffer const * buffer, LyXLex & lex)
void InsetExternal::read(Buffer const & buffer, LyXLex & lex)
{
enum ExternalTags {
EX_TEMPLATE = 1,
@ -326,7 +326,7 @@ void InsetExternal::read(Buffer const * buffer, LyXLex & lex)
case EX_FILENAME: {
lex.next();
string const name = lex.getString();
params.filename.set(name, buffer->filePath());
params.filename.set(name, buffer.filePath());
break;
}
@ -376,7 +376,7 @@ void InsetExternal::read(Buffer const * buffer, LyXLex & lex)
int InsetExternal::write(string const & format,
Buffer const * buf, ostream & os,
Buffer const & buf, ostream & os,
bool external_in_tmpdir) const
{
ExternalTemplate const * const et_ptr = getTemplatePtr(params_);
@ -400,7 +400,7 @@ int InsetExternal::write(string const & format,
}
int InsetExternal::latex(Buffer const * buf, ostream & os,
int InsetExternal::latex(Buffer const & buf, ostream & os,
LatexRunParams const & runparams) const
{
// "nice" means that the buffer is exported to LaTeX format but not
@ -408,7 +408,7 @@ int InsetExternal::latex(Buffer const * buf, ostream & os,
// If we're running through the LaTeX compiler, we should write the
// generated files in the bufer's temporary directory.
bool const external_in_tmpdir =
lyxrc.use_tempdir && !buf->tmppath.empty() && !runparams.nice;
lyxrc.use_tempdir && !buf.tmppath.empty() && !runparams.nice;
// If the template has specified a PDFLaTeX output, then we try and
// use that.
@ -428,19 +428,19 @@ int InsetExternal::latex(Buffer const * buf, ostream & os,
}
int InsetExternal::ascii(Buffer const * buf, ostream & os, int) const
int InsetExternal::ascii(Buffer const & buf, ostream & os, int) const
{
return write("Ascii", buf, os);
}
int InsetExternal::linuxdoc(Buffer const * buf, ostream & os) const
int InsetExternal::linuxdoc(Buffer const & buf, ostream & os) const
{
return write("LinuxDoc", buf, os);
}
int InsetExternal::docbook(Buffer const * buf, ostream & os, bool) const
int InsetExternal::docbook(Buffer const & buf, ostream & os, bool) const
{
return write("DocBook", buf, os);
}
@ -469,7 +469,7 @@ void InsetExternal::validate(LaTeXFeatures & features) const
void InsetExternal::updateExternal(string const & format,
Buffer const * buf,
Buffer const & buf,
bool external_in_tmpdir) const
{
ExternalTemplate const * const et_ptr = getTemplatePtr(params_);
@ -518,7 +518,7 @@ void InsetExternal::updateExternal(string const & format,
if (external_in_tmpdir && !from_file.empty()) {
// We are running stuff through LaTeX
from_file = copyFileToDir(buf->tmppath, from_file);
from_file = copyFileToDir(buf.tmppath, from_file);
if (from_file.empty())
return;
}
@ -536,7 +536,7 @@ void InsetExternal::updateExternal(string const & format,
fi.getModificationTime()) >= 0) {
} else {
string const to_filebase = ChangeExtension(to_file, string());
converters.convert(buf, from_file, to_filebase,
converters.convert(&buf, from_file, to_filebase,
from_format, to_format);
}
}
@ -546,10 +546,10 @@ namespace {
/// Substitute meta-variables in this string
string const doSubstitution(InsetExternal::Params const & params,
Buffer const * buffer, string const & s)
Buffer const & buffer, string const & s)
{
string result;
string const buffer_path = buffer ? buffer->filePath() : string();
string const buffer_path = buffer.filePath();
string const filename = params.filename.outputFilename(buffer_path);
string const basename = ChangeExtension(filename, string());
string const filepath = OnlyPath(filename);
@ -567,15 +567,15 @@ string const doSubstitution(InsetExternal::Params const & params,
string::size_type const end = result.find("\")", pos);
string const file = result.substr(pos + 12, end - (pos + 12));
string contents;
if (buffer) {
Path p(buffer->filePath());
if (!IsFileReadable(file))
Path p(buffer->tmppath);
if (IsFileReadable(file))
contents = GetFileContents(file);
} else {
contents = GetFileContents(file);
Path p(buffer.filePath());
if (!IsFileReadable(file)) {
#warning Is this really working as intended?
Path p(buffer.tmppath);
}
if (IsFileReadable(file))
contents = GetFileContents(file);
result = subst(result,
("$$Contents(\"" + file + "\")").c_str(),
contents);
@ -585,11 +585,8 @@ string const doSubstitution(InsetExternal::Params const & params,
}
void editExternal(InsetExternal::Params const & params, Buffer const * buffer)
void editExternal(InsetExternal::Params const & params, Buffer const & buffer)
{
if (!buffer)
return;
ExternalTemplate const * const et_ptr = getTemplatePtr(params);
if (!et_ptr)
return;
@ -600,11 +597,11 @@ void editExternal(InsetExternal::Params const & params, Buffer const * buffer)
string const command = doSubstitution(params, buffer, et.editCommand);
Path p(buffer->filePath());
Path p(buffer.filePath());
Forkedcall call;
if (lyxerr.debugging()) {
lyxerr << "Executing '" << command << "' in '"
<< buffer->filePath() << '\'' << endl;
<< buffer.filePath() << '\'' << endl;
}
call.startscript(Forkedcall::DontWait, command);
}
@ -655,7 +652,7 @@ void InsetExternalMailer::string2params(string const & in,
if (lex.isOK()) {
InsetExternal inset;
inset.read(&buffer, lex);
inset.read(buffer, lex);
params = inset.params();
}
}
@ -666,10 +663,10 @@ InsetExternalMailer::params2string(InsetExternal::Params const & params,
Buffer const & buffer)
{
InsetExternal inset;
inset.setParams(params, &buffer);
inset.setParams(params, buffer);
ostringstream data;
data << name_ << ' ';
inset.write(&buffer, data);
inset.write(buffer, data);
data << "\\end_inset\n";
return STRCONV(data.str());
}

View File

@ -56,9 +56,9 @@ public:
///
virtual EDITABLE editable() const { return IS_EDITABLE; }
///
virtual void write(Buffer const *, std::ostream &) const;
virtual void write(Buffer const &, std::ostream &) const;
///
virtual void read(Buffer const *, LyXLex & lex);
virtual void read(Buffer const &, LyXLex & lex);
/** returns the number of rows (\n's) of generated tex code.
fragile == true means, that the inset should take care about
@ -66,14 +66,14 @@ public:
If the free_spc (freespacing) variable is set, then this inset
is in a free-spacing paragraph.
*/
virtual int latex(Buffer const *, std::ostream &,
virtual int latex(Buffer const &, std::ostream &,
LatexRunParams const &) const;
/// write ASCII output to the ostream
virtual int ascii(Buffer const *, std::ostream &, int linelen) const;
virtual int ascii(Buffer const &, std::ostream &, int linelen) const;
/// write LinuxDoc output to the ostream
virtual int linuxdoc(Buffer const *, std::ostream &) const;
virtual int linuxdoc(Buffer const &, std::ostream &) const;
/// write DocBook output to the ostream
virtual int docbook(Buffer const *, std::ostream &, bool mixcont) const;
virtual int docbook(Buffer const &, std::ostream &, bool mixcont) const;
/// Updates needed features for this inset.
virtual void validate(LaTeXFeatures & features) const;
@ -88,13 +88,13 @@ public:
Params const & params() const;
/// Set the inset parameters.
virtual void setParams(Params const &, Buffer const *);
virtual void setParams(Params const &, Buffer const &);
/** update the file represented by the template.
If \param external_in_tmpdir == true, then the generated file is
place in the buffer's temporary directory.
*/
void updateExternal(string const &, Buffer const *,
void updateExternal(string const &, Buffer const &,
bool external_in_tmpdir) const;
private:
@ -108,7 +108,7 @@ private:
If \param external_in_tmpdir == true, then the generated file is
place in the buffer's temporary directory.
*/
int write(string const & format, Buffer const *, std::ostream &,
int write(string const & format, Buffer const &, std::ostream &,
bool external_in_tmpdir = false) const;
/// the current params

View File

@ -230,17 +230,17 @@ void InsetFloatParams::read(LyXLex & lex)
}
void InsetFloat::write(Buffer const * buf, ostream & os) const
void InsetFloat::write(Buffer const & buf, ostream & os) const
{
params_.write(os);
InsetCollapsable::write(buf, os);
}
void InsetFloat::read(Buffer const * buf, LyXLex & lex)
void InsetFloat::read(Buffer const & buf, LyXLex & lex)
{
params_.read(lex);
wide(params_.wide, buf->params);
wide(params_.wide, buf.params);
InsetCollapsable::read(buf, lex);
}
@ -268,10 +268,10 @@ string const InsetFloat::editMessage() const
}
int InsetFloat::latex(Buffer const * buf, ostream & os,
int InsetFloat::latex(Buffer const & buf, ostream & os,
LatexRunParams const & runparams) const
{
FloatList const & floats = buf->params.getLyXTextClass().floats();
FloatList const & floats = buf.params.getLyXTextClass().floats();
string const tmptype = (params_.wide ? params_.type + "*" : params_.type);
// Figure out the float placement to use.
// From lowest to highest:
@ -279,7 +279,7 @@ int InsetFloat::latex(Buffer const * buf, ostream & os,
// - document wide default placement
// - specific float placement
string placement;
string const buf_placement = buf->params.float_placement;
string const buf_placement = buf.params.float_placement;
string const def_placement = floats.defaultPlacement(params_.type);
if (!params_.placement.empty()
&& params_.placement != def_placement) {
@ -310,9 +310,9 @@ int InsetFloat::latex(Buffer const * buf, ostream & os,
}
int InsetFloat::linuxdoc(Buffer const * buf, ostream & os) const
int InsetFloat::linuxdoc(Buffer const & buf, ostream & os) const
{
FloatList const & floats = buf->params.getLyXTextClass().floats();
FloatList const & floats = buf.params.getLyXTextClass().floats();
string const tmptype = params_.type;
// Figure out the float placement to use.
// From lowest to highest:
@ -322,7 +322,7 @@ int InsetFloat::linuxdoc(Buffer const * buf, ostream & os) const
// This is the same as latex, as linuxdoc is modeled after latex.
string placement;
string const buf_placement = buf->params.float_placement;
string const buf_placement = buf.params.float_placement;
string const def_placement = floats.defaultPlacement(params_.type);
if (!params_.placement.empty()
&& params_.placement != def_placement) {
@ -347,7 +347,7 @@ int InsetFloat::linuxdoc(Buffer const * buf, ostream & os) const
}
int InsetFloat::docbook(Buffer const * buf, ostream & os, bool mixcont) const
int InsetFloat::docbook(Buffer const & buf, ostream & os, bool mixcont) const
{
os << '<' << params_.type << '>';
int const i = inset.docbook(buf, os, mixcont);
@ -394,7 +394,7 @@ void InsetFloat::wide(bool w, BufferParams const & bp)
}
void InsetFloat::addToToc(lyx::toc::TocList & toclist, Buffer const * buf) const
void InsetFloat::addToToc(lyx::toc::TocList & toclist, Buffer const & buf) const
{
ParIterator pit(inset.paragraphs.begin(), inset.paragraphs);
ParIterator end(inset.paragraphs.end(), inset.paragraphs);
@ -402,7 +402,7 @@ void InsetFloat::addToToc(lyx::toc::TocList & toclist, Buffer const * buf) const
// Find a caption layout in one of the (child inset's) pars
for (; pit != end; ++pit) {
if (pit->layout()->name() == caplayout) {
string const name = floatname(params_.type, buf->params);
string const name = floatname(params_.type, buf.params);
string const str =
tostr(toclist[name].size() + 1)
+ ". " + pit->asString(buf, false);

View File

@ -47,9 +47,9 @@ public:
///
virtual dispatch_result localDispatch(FuncRequest const & cmd);
///
void write(Buffer const * buf, std::ostream & os) const;
void write(Buffer const & buf, std::ostream & os) const;
///
void read(Buffer const * buf, LyXLex & lex);
void read(Buffer const & buf, LyXLex & lex);
///
void validate(LaTeXFeatures & features) const;
///
@ -57,12 +57,12 @@ public:
///
InsetOld::Code lyxCode() const { return InsetOld::FLOAT_CODE; }
///
int latex(Buffer const *, std::ostream &,
int latex(Buffer const &, std::ostream &,
LatexRunParams const &) const;
///
int linuxdoc(Buffer const *, std::ostream &) const;
int linuxdoc(Buffer const &, std::ostream &) const;
///
int docbook(Buffer const *, std::ostream &, bool mixcont) const;
int docbook(Buffer const &, std::ostream &, bool mixcont) const;
///
string const editMessage() const;
///
@ -74,7 +74,7 @@ public:
///
void wide(bool w, BufferParams const &);
///
void addToToc(lyx::toc::TocList &, Buffer const *) const;
void addToToc(lyx::toc::TocList &, Buffer const &) const;
///
bool showInsetDialog(BufferView *) const;
///

View File

@ -50,9 +50,9 @@ InsetFloatList::~InsetFloatList()
}
string const InsetFloatList::getScreenLabel(Buffer const * buf) const
string const InsetFloatList::getScreenLabel(Buffer const & buf) const
{
FloatList const & floats = buf->params.getLyXTextClass().floats();
FloatList const & floats = buf.params.getLyXTextClass().floats();
FloatList::const_iterator it = floats[getCmdName()];
if (it != floats.end())
return _(it->second.listName());
@ -67,15 +67,15 @@ InsetOld::Code InsetFloatList::lyxCode() const
}
void InsetFloatList::write(Buffer const *, ostream & os) const
void InsetFloatList::write(Buffer const &, ostream & os) const
{
os << "FloatList " << getCmdName() << "\n";
}
void InsetFloatList::read(Buffer const * buf, LyXLex & lex)
void InsetFloatList::read(Buffer const & buf, LyXLex & lex)
{
FloatList const & floats = buf->params.getLyXTextClass().floats();
FloatList const & floats = buf.params.getLyXTextClass().floats();
string token;
if (lex.eatLine()) {
@ -125,10 +125,10 @@ dispatch_result InsetFloatList::localDispatch(FuncRequest const & cmd)
}
int InsetFloatList::latex(Buffer const * buf, ostream & os,
int InsetFloatList::latex(Buffer const & buf, ostream & os,
LatexRunParams const &) const
{
FloatList const & floats = buf->params.getLyXTextClass().floats();
FloatList const & floats = buf.params.getLyXTextClass().floats();
FloatList::const_iterator cit = floats[getCmdName()];
if (cit != floats.end()) {
@ -155,7 +155,7 @@ int InsetFloatList::latex(Buffer const * buf, ostream & os,
}
int InsetFloatList::ascii(Buffer const * buffer, ostream & os, int) const
int InsetFloatList::ascii(Buffer const & buffer, ostream & os, int) const
{
os << getScreenLabel(buffer) << "\n\n";

View File

@ -36,24 +36,24 @@ public:
///
dispatch_result localDispatch(FuncRequest const & cmd);
///
string const getScreenLabel(Buffer const *) const;
string const getScreenLabel(Buffer const &) const;
///
EDITABLE editable() const { return IS_EDITABLE; }
///
InsetOld::Code lyxCode() const;
///
void write(Buffer const *, std::ostream &) const;
void write(Buffer const &, std::ostream &) const;
///
void read(Buffer const *, LyXLex &);
void read(Buffer const &, LyXLex &);
///
int latex(Buffer const *, std::ostream &,
int latex(Buffer const &, std::ostream &,
LatexRunParams const &) const;
///
int linuxdoc(Buffer const *, std::ostream &) const { return 0; }
int linuxdoc(Buffer const &, std::ostream &) const { return 0; }
///
int docbook(Buffer const *, std::ostream &, bool) const { return 0; }
int docbook(Buffer const &, std::ostream &, bool) const { return 0; }
///
int ascii(Buffer const *, std::ostream &, int linelen) const;
int ascii(Buffer const &, std::ostream &, int linelen) const;
///
void validate(LaTeXFeatures & features) const;
private:

View File

@ -58,13 +58,11 @@ string const InsetFoot::editMessage() const
}
int InsetFoot::latex(Buffer const * buf, ostream & os,
int InsetFoot::latex(Buffer const & buf, ostream & os,
LatexRunParams const & runparams_in) const
{
LatexRunParams runparams = runparams_in;
if (buf) {
runparams.moving_arg |= ownerPar(*buf, this).layout()->intitle;
}
runparams.moving_arg |= ownerPar(buf, this).layout()->intitle;
os << "%\n\\footnote{";
@ -75,7 +73,7 @@ int InsetFoot::latex(Buffer const * buf, ostream & os,
}
int InsetFoot::docbook(Buffer const * buf, ostream & os, bool mixcont) const
int InsetFoot::docbook(Buffer const & buf, ostream & os, bool mixcont) const
{
os << "<footnote>";
int const i = inset.docbook(buf, os, mixcont);

View File

@ -31,10 +31,10 @@ public:
///
InsetOld::Code lyxCode() const { return InsetOld::FOOT_CODE; }
///
int latex(Buffer const *, std::ostream &,
int latex(Buffer const &, std::ostream &,
LatexRunParams const &) const;
///
int docbook(Buffer const *, std::ostream &, bool mixcont) const;
int docbook(Buffer const &, std::ostream &, bool mixcont) const;
///
string const editMessage() const;
};

View File

@ -46,13 +46,13 @@ InsetFootlike::InsetFootlike(InsetFootlike const & in)
void InsetFootlike::metrics(MetricsInfo & mi, Dimension & dim) const
{
InsetCollapsable::metrics(mi, dim);
if (isOpen())
if (isOpen())
dim.wid = mi.base.textwidth;
dim_ = dim;
}
void InsetFootlike::write(Buffer const * buf, ostream & os) const
void InsetFootlike::write(Buffer const & buf, ostream & os) const
{
os << getInsetName() << "\n";
InsetCollapsable::write(buf, os);

View File

@ -26,7 +26,7 @@ public:
///
void metrics(MetricsInfo &, Dimension &) const;
///
void write(Buffer const * buf, std::ostream & os) const;
void write(Buffer const & buf, std::ostream & os) const;
///
bool insetAllowed(InsetOld::Code) const;
/** returns true if, when outputing LaTeX, font changes should

View File

@ -223,19 +223,19 @@ InsetOld::EDITABLE InsetGraphics::editable() const
}
void InsetGraphics::write(Buffer const * buf, ostream & os) const
void InsetGraphics::write(Buffer const & buf, ostream & os) const
{
os << "Graphics\n";
params().Write(os, buf->filePath());
params().Write(os, buf.filePath());
}
void InsetGraphics::read(Buffer const * buf, LyXLex & lex)
void InsetGraphics::read(Buffer const & buf, LyXLex & lex)
{
string const token = lex.getString();
if (token == "Graphics")
readInsetGraphics(lex, buf->filePath());
readInsetGraphics(lex, buf.filePath());
else
lyxerr[Debug::GRAPHICS] << "Not a Graphics inset!" << endl;
@ -328,13 +328,13 @@ string const InsetGraphics::createLatexOptions() const
}
string const InsetGraphics::prepareFile(Buffer const * buf,
string const InsetGraphics::prepareFile(Buffer const & buf,
LatexRunParams const & runparams) const
{
// LaTeX can cope if the graphics file doesn't exist, so just return the
// filename.
string orig_file = params().filename.absFilename();
string const rel_file = params().filename.relFilename(buf->filePath());
string const rel_file = params().filename.relFilename(buf.filePath());
if (!IsFileReadable(orig_file)) {
lyxerr[Debug::GRAPHICS]
@ -364,7 +364,7 @@ string const InsetGraphics::prepareFile(Buffer const * buf,
// Uncompress the file if necessary.
// If it has been uncompressed in a previous call to
// prepareFile, do nothing.
temp_file = MakeAbsPath(OnlyFilename(temp_file), buf->tmppath);
temp_file = MakeAbsPath(OnlyFilename(temp_file), buf.tmppath);
lyxerr[Debug::GRAPHICS]
<< "\ttemp_file: " << temp_file << endl;
if (graphic_->hasFileChanged() || !IsFileReadable(temp_file)) {
@ -411,7 +411,7 @@ string const InsetGraphics::prepareFile(Buffer const * buf,
<< "\tthe orig file is: " << orig_file << endl;
if (lyxrc.use_tempdir) {
temp_file = copyFileToDir(buf->tmppath, orig_file);
temp_file = copyFileToDir(buf.tmppath, orig_file);
if (temp_file.empty()) {
string str = bformat(_("Could not copy the file\n%1$s\n"
"into the temporary directory."),
@ -439,7 +439,7 @@ string const InsetGraphics::prepareFile(Buffer const * buf,
// if no special converter defined, than we take the default one
// from ImageMagic: convert from:inname.from to:outname.to
if (!converters.convert(buf, temp_file, outfile_base, from, to)) {
if (!converters.convert(&buf, temp_file, outfile_base, from, to)) {
string const command =
LibFileSearch("scripts", "convertDefault.sh") +
' ' + from + ':' + temp_file + ' ' +
@ -461,7 +461,7 @@ string const InsetGraphics::prepareFile(Buffer const * buf,
}
int InsetGraphics::latex(Buffer const * buf, ostream & os,
int InsetGraphics::latex(Buffer const & buf, ostream & os,
LatexRunParams const & runparams) const
{
// If there is no file specified or not existing,
@ -471,7 +471,7 @@ int InsetGraphics::latex(Buffer const * buf, ostream & os,
<< params().filename.absFilename() << endl;
string const relative_file =
params().filename.relFilename(buf->filePath());
params().filename.relFilename(buf.filePath());
// A missing (e)ps-extension is no problem for LaTeX, so
// we have to test three different cases
@ -539,7 +539,7 @@ int InsetGraphics::latex(Buffer const * buf, ostream & os,
}
int InsetGraphics::ascii(Buffer const *, ostream & os, int) const
int InsetGraphics::ascii(Buffer const &, ostream & os, int) const
{
// No graphics in ascii output. Possible to use gifscii to convert
// images to ascii approximation.
@ -552,10 +552,10 @@ int InsetGraphics::ascii(Buffer const *, ostream & os, int) const
}
int InsetGraphics::linuxdoc(Buffer const * buf, ostream & os) const
int InsetGraphics::linuxdoc(Buffer const & buf, ostream & os) const
{
string const file_name = buf->niceFile ?
params().filename.relFilename(buf->filePath()):
string const file_name = buf.niceFile ?
params().filename.relFilename(buf.filePath()):
params().filename.absFilename();
os << "<eps file=\"" << file_name << "\">\n";
@ -567,7 +567,7 @@ int InsetGraphics::linuxdoc(Buffer const * buf, ostream & os) const
// For explanation on inserting graphics into DocBook checkout:
// http://en.tldp.org/LDP/LDP-Author-Guide/inserting-pictures.html
// See also the docbook guide at http://www.docbook.org/
int InsetGraphics::docbook(Buffer const *, ostream & os,
int InsetGraphics::docbook(Buffer const &, ostream & os,
bool /*mixcont*/) const
{
// In DocBook v5.0, the graphic tag will be eliminated from DocBook, will

View File

@ -42,22 +42,22 @@ public:
///
EDITABLE editable() const;
///
void write(Buffer const *, std::ostream &) const;
void write(Buffer const &, std::ostream &) const;
///
void read(Buffer const *, LyXLex & lex);
void read(Buffer const &, LyXLex & lex);
/** returns the number of rows (\n's) of generated tex code.
#fragile == true# means, that the inset should take care about
fragile commands by adding a #\protect# before.
*/
int latex(Buffer const *, std::ostream &,
int latex(Buffer const &, std::ostream &,
LatexRunParams const &) const;
///
int ascii(Buffer const *, std::ostream &, int linelen) const;
int ascii(Buffer const &, std::ostream &, int linelen) const;
///
int linuxdoc(Buffer const *, std::ostream &) const;
int linuxdoc(Buffer const &, std::ostream &) const;
///
int docbook(Buffer const *, std::ostream &, bool mixcont) const;
int docbook(Buffer const &, std::ostream &, bool mixcont) const;
/** Tell LyX what the latex features you need i.e. what latex packages
you need to be included.
@ -95,7 +95,7 @@ private:
/// Create the options for the latex command.
string const createLatexOptions() const;
/// Convert the file if needed, and return the location of the file.
string const prepareFile(Buffer const * buf, LatexRunParams const &) const;
string const prepareFile(Buffer const & buf, LatexRunParams const &) const;
///
InsetGraphicsParams params_;

View File

@ -21,7 +21,7 @@ InsetHFill::InsetHFill()
{}
int InsetHFill::latex(Buffer const *, ostream & os,
int InsetHFill::latex(Buffer const &, ostream & os,
LatexRunParams const &) const
{
os << getCommand();
@ -29,27 +29,27 @@ int InsetHFill::latex(Buffer const *, ostream & os,
}
int InsetHFill::ascii(Buffer const *, ostream & os, int) const
int InsetHFill::ascii(Buffer const &, ostream & os, int) const
{
os << '\t';
return 0;
}
int InsetHFill::linuxdoc(Buffer const *, std::ostream & os) const
int InsetHFill::linuxdoc(Buffer const &, std::ostream & os) const
{
os << '\n';
return 0;
}
int InsetHFill::docbook(Buffer const *, std::ostream & os, bool) const
int InsetHFill::docbook(Buffer const &, std::ostream & os, bool) const
{
os << '\n';
return 0;
}
void InsetHFill::write(Buffer const *, ostream & os) const
void InsetHFill::write(Buffer const &, ostream & os) const
{
os << "\n\\hfill \n";
}

View File

@ -24,20 +24,20 @@ public:
return std::auto_ptr<InsetBase>(new InsetHFill);
}
///
string const getScreenLabel(Buffer const *) const { return getContents(); }
string const getScreenLabel(Buffer const &) const { return getContents(); }
///
InsetOld::Code lyxCode() const { return InsetOld::HFILL_CODE; }
///
int latex(Buffer const *, std::ostream &,
int latex(Buffer const &, std::ostream &,
LatexRunParams const &) const;
///
int ascii(Buffer const *, std::ostream &, int linelen) const;
int ascii(Buffer const &, std::ostream &, int linelen) const;
///
int linuxdoc(Buffer const *, std::ostream &) const;
int linuxdoc(Buffer const &, std::ostream &) const;
///
int docbook(Buffer const *, std::ostream &, bool) const;
int docbook(Buffer const &, std::ostream &, bool) const;
///
void write(Buffer const * buf, std::ostream & os) const;
void write(Buffer const & buf, std::ostream & os) const;
/// We don't need \begin_inset and \end_inset
bool directWrite() const { return true; }
};

View File

@ -218,14 +218,26 @@ auto_ptr<InsetBase> InsetInclude::clone() const
}
void InsetInclude::write(Buffer const *, ostream & os) const
void InsetInclude::write(Buffer const &, ostream & os) const
{
write(os);
}
void InsetInclude::write(ostream & os) const
{
os << "Include " << params_.cparams.getCommand() << '\n'
<< "preview " << tostr(params_.cparams.preview()) << '\n';
}
void InsetInclude::read(Buffer const *, LyXLex & lex)
void InsetInclude::read(Buffer const &, LyXLex & lex)
{
read(lex);
}
void InsetInclude::read(LyXLex & lex)
{
params_.cparams.read(lex);
@ -242,7 +254,7 @@ void InsetInclude::read(Buffer const *, LyXLex & lex)
}
string const InsetInclude::getScreenLabel(Buffer const *) const
string const InsetInclude::getScreenLabel(Buffer const &) const
{
string temp;
@ -297,7 +309,7 @@ bool InsetInclude::loadIfNeeded() const
}
int InsetInclude::latex(Buffer const * buffer, ostream & os,
int InsetInclude::latex(Buffer const & buffer, ostream & os,
LatexRunParams const & runparams) const
{
string incfile(params_.cparams.getContents());
@ -310,13 +322,13 @@ int InsetInclude::latex(Buffer const * buffer, ostream & os,
Buffer * tmp = bufferlist.getBuffer(getFileName());
// FIXME: this should be a GUI warning
if (tmp->params.textclass != buffer->params.textclass) {
if (tmp->params.textclass != buffer.params.textclass) {
lyxerr << "WARNING: Included file `"
<< MakeDisplayPath(getFileName())
<< "' has textclass `"
<< tmp->params.getLyXTextClass().name()
<< "' while parent file has textclass `"
<< buffer->params.getLyXTextClass().name()
<< buffer.params.getLyXTextClass().name()
<< "'." << endl;
//return 0;
}
@ -324,19 +336,19 @@ int InsetInclude::latex(Buffer const * buffer, ostream & os,
// write it to a file (so far the complete file)
string writefile = ChangeExtension(getFileName(), ".tex");
if (!buffer->tmppath.empty() && !runparams.nice) {
if (!buffer.tmppath.empty() && !runparams.nice) {
incfile = subst(incfile, '/','@');
#ifdef __EMX__
incfile = subst(incfile, ':', '$');
#endif
writefile = AddName(buffer->tmppath, incfile);
writefile = AddName(buffer.tmppath, incfile);
} else
writefile = getFileName();
writefile = ChangeExtension(writefile, ".tex");
lyxerr[Debug::LATEX] << "incfile:" << incfile << endl;
lyxerr[Debug::LATEX] << "writefile:" << writefile << endl;
tmp->markDepClean(buffer->tmppath);
tmp->markDepClean(buffer.tmppath);
tmp->makeLaTeXFile(writefile, OnlyPath(getMasterFilename()),
runparams, false);
@ -365,7 +377,7 @@ int InsetInclude::latex(Buffer const * buffer, ostream & os,
}
int InsetInclude::ascii(Buffer const *, ostream & os, int) const
int InsetInclude::ascii(Buffer const &, ostream & os, int) const
{
if (isVerbatim())
os << GetFileContents(getFileName());
@ -373,7 +385,7 @@ int InsetInclude::ascii(Buffer const *, ostream & os, int) const
}
int InsetInclude::linuxdoc(Buffer const * buffer, ostream & os) const
int InsetInclude::linuxdoc(Buffer const & buffer, ostream & os) const
{
string incfile(params_.cparams.getContents());
@ -386,9 +398,9 @@ int InsetInclude::linuxdoc(Buffer const * buffer, ostream & os) const
// write it to a file (so far the complete file)
string writefile = ChangeExtension(getFileName(), ".sgml");
if (!buffer->tmppath.empty() && !buffer->niceFile) {
if (!buffer.tmppath.empty() && !buffer.niceFile) {
incfile = subst(incfile, '/','@');
writefile = AddName(buffer->tmppath, incfile);
writefile = AddName(buffer.tmppath, incfile);
} else
writefile = getFileName();
@ -398,7 +410,7 @@ int InsetInclude::linuxdoc(Buffer const * buffer, ostream & os) const
lyxerr[Debug::LATEX] << "incfile:" << incfile << endl;
lyxerr[Debug::LATEX] << "writefile:" << writefile << endl;
tmp->makeLinuxDocFile(writefile, buffer->niceFile, true);
tmp->makeLinuxDocFile(writefile, buffer.niceFile, true);
}
if (isVerbatim()) {
@ -412,7 +424,7 @@ int InsetInclude::linuxdoc(Buffer const * buffer, ostream & os) const
}
int InsetInclude::docbook(Buffer const * buffer, ostream & os,
int InsetInclude::docbook(Buffer const & buffer, ostream & os,
bool /*mixcont*/) const
{
string incfile(params_.cparams.getContents());
@ -426,9 +438,9 @@ int InsetInclude::docbook(Buffer const * buffer, ostream & os,
// write it to a file (so far the complete file)
string writefile = ChangeExtension(getFileName(), ".sgml");
if (!buffer->tmppath.empty() && !buffer->niceFile) {
if (!buffer.tmppath.empty() && !buffer.niceFile) {
incfile = subst(incfile, '/','@');
writefile = AddName(buffer->tmppath, incfile);
writefile = AddName(buffer.tmppath, incfile);
} else
writefile = getFileName();
if (IsLyXFilename(getFileName()))
@ -437,7 +449,7 @@ int InsetInclude::docbook(Buffer const * buffer, ostream & os,
lyxerr[Debug::LATEX] << "incfile:" << incfile << endl;
lyxerr[Debug::LATEX] << "writefile:" << writefile << endl;
tmp->makeDocBookFile(writefile, buffer->niceFile, true);
tmp->makeDocBookFile(writefile, buffer.niceFile, true);
}
if (isVerbatim()) {
@ -457,11 +469,11 @@ void InsetInclude::validate(LaTeXFeatures & features) const
string incfile(params_.cparams.getContents());
string writefile;
Buffer const * const b = bufferlist.getBuffer(getMasterFilename());
Buffer const & b = *bufferlist.getBuffer(getMasterFilename());
if (b && !b->tmppath.empty() && !b->niceFile && !isVerbatim()) {
if (!b.tmppath.empty() && !b.niceFile && !isVerbatim()) {
incfile = subst(incfile, '/','@');
writefile = AddName(b->tmppath, incfile);
writefile = AddName(b.tmppath, incfile);
} else
writefile = getFileName();
@ -480,8 +492,7 @@ void InsetInclude::validate(LaTeXFeatures & features) const
// a file got loaded
Buffer * const tmp = bufferlist.getBuffer(getFileName());
if (tmp) {
if (b)
tmp->niceFile = b->niceFile;
tmp->niceFile = b.niceFile;
tmp->validate(features);
}
}
@ -519,7 +530,7 @@ void InsetInclude::metrics(MetricsInfo & mi, Dimension & dim) const
} else {
if (!set_label_) {
set_label_ = true;
button_.update(getScreenLabel(mi.base.bv->buffer()),
button_.update(getScreenLabel(*mi.base.bv->buffer()),
editable() != NOT_EDITABLE);
}
button_.metrics(mi, dim);
@ -581,7 +592,7 @@ string const InsetInclude::PreviewImpl::latexString() const
ostringstream os;
LatexRunParams runparams;
runparams.flavor = LatexRunParams::LATEX;
parent().latex(view()->buffer(), os, runparams);
parent().latex(*view()->buffer(), os, runparams);
return STRCONV(os.str());
}
@ -648,7 +659,7 @@ void InsetIncludeMailer::string2params(string const & in,
if (lex.isOK()) {
InsetInclude inset(params);
inset.read(0, lex);
inset.read(lex);
params = inset.params();
}
}
@ -661,7 +672,7 @@ InsetIncludeMailer::params2string(InsetInclude::Params const & params)
inset.set(params);
ostringstream data;
data << name_ << ' ';
inset.write(0, data);
inset.write(data);
data << "\\end_inset\n";
return STRCONV(data.str());
}

View File

@ -86,19 +86,19 @@ public:
{
return IS_EDITABLE;
}
/// With lyx3 we won't overload these 3 methods
void write(Buffer const *, std::ostream &) const;
///
void read(Buffer const *, LyXLex &);
void write(Buffer const &, std::ostream &) const;
///
int latex(Buffer const *, std::ostream &,
void read(Buffer const &, LyXLex &);
///
int latex(Buffer const &, std::ostream &,
LatexRunParams const &) const;
///
int ascii(Buffer const *, std::ostream &, int linelen) const;
int ascii(Buffer const &, std::ostream &, int linelen) const;
///
int linuxdoc(Buffer const *, std::ostream &) const;
int linuxdoc(Buffer const &, std::ostream &) const;
///
int docbook(Buffer const *, std::ostream &, bool mixcont) const;
int docbook(Buffer const &, std::ostream &, bool mixcont) const;
///
void validate(LaTeXFeatures &) const;
@ -109,8 +109,14 @@ public:
void addPreview(lyx::graphics::PreviewLoader &) const;
private:
friend class InsetIncludeMailer;
///
void write(std::ostream &) const;
///
void read(LyXLex &);
/// get the text displayed on the button
string const getScreenLabel(Buffer const *) const;
string const getScreenLabel(Buffer const &) const;
/// is this a verbatim include ?
bool isVerbatim() const;
/// get the filename of the master buffer

View File

@ -39,7 +39,7 @@ InsetIndex::~InsetIndex()
}
string const InsetIndex::getScreenLabel(Buffer const *) const
string const InsetIndex::getScreenLabel(Buffer const &) const
{
return _("Idx");
}
@ -73,7 +73,7 @@ dispatch_result InsetIndex::localDispatch(FuncRequest const & cmd)
}
int InsetIndex::docbook(Buffer const *, ostream & os, bool) const
int InsetIndex::docbook(Buffer const &, ostream & os, bool) const
{
os << "<indexterm><primary>" << getContents()
<< "</primary></indexterm>";
@ -102,7 +102,7 @@ InsetPrintIndex::~InsetPrintIndex()
{}
string const InsetPrintIndex::getScreenLabel(Buffer const *) const
string const InsetPrintIndex::getScreenLabel(Buffer const &) const
{
return _("Index");
}

View File

@ -32,13 +32,13 @@ public:
///
dispatch_result localDispatch(FuncRequest const & cmd);
///
string const getScreenLabel(Buffer const *) const;
string const getScreenLabel(Buffer const &) const;
///
EDITABLE editable() const { return IS_EDITABLE; }
///
InsetOld::Code lyxCode() const;
///
int docbook(Buffer const *, std::ostream &, bool mixcont) const;
int docbook(Buffer const &, std::ostream &, bool mixcont) const;
};
@ -61,7 +61,7 @@ public:
///
InsetOld::Code lyxCode() const;
///
string const getScreenLabel(Buffer const *) const;
string const getScreenLabel(Buffer const &) const;
///
void metrics(MetricsInfo &, Dimension &) const;
///

View File

@ -78,7 +78,7 @@ dispatch_result InsetLabel::localDispatch(FuncRequest const & cmd)
}
int InsetLabel::latex(Buffer const *, ostream & os,
int InsetLabel::latex(Buffer const &, ostream & os,
LatexRunParams const &) const
{
os << escape(getCommand());
@ -86,21 +86,21 @@ int InsetLabel::latex(Buffer const *, ostream & os,
}
int InsetLabel::ascii(Buffer const *, ostream & os, int) const
int InsetLabel::ascii(Buffer const &, ostream & os, int) const
{
os << '<' << getContents() << '>';
return 0;
}
int InsetLabel::linuxdoc(Buffer const *, ostream & os) const
int InsetLabel::linuxdoc(Buffer const &, ostream & os) const
{
os << "<label id=\"" << getContents() << "\" >";
return 0;
}
int InsetLabel::docbook(Buffer const *, ostream & os, bool) const
int InsetLabel::docbook(Buffer const &, ostream & os, bool) const
{
os << "<anchor id=\"" << getContents() << "\">";
return 0;

View File

@ -28,7 +28,7 @@ public:
///
virtual dispatch_result localDispatch(FuncRequest const & cmd);
///
string const getScreenLabel(Buffer const *) const { return getContents(); }
string const getScreenLabel(Buffer const &) const { return getContents(); }
///
EDITABLE editable() const { return IS_EDITABLE; }
///
@ -36,14 +36,14 @@ public:
///
void getLabelList(std::vector<string> &) const;
///
int latex(Buffer const *, std::ostream &,
int latex(Buffer const &, std::ostream &,
LatexRunParams const &) const;
///
int ascii(Buffer const *, std::ostream &, int linelen) const;
int ascii(Buffer const &, std::ostream &, int linelen) const;
///
int linuxdoc(Buffer const *, std::ostream &) const;
int linuxdoc(Buffer const &, std::ostream &) const;
///
int docbook(Buffer const *, std::ostream &, bool mixcont) const;
int docbook(Buffer const &, std::ostream &, bool mixcont) const;
};
#endif

View File

@ -601,13 +601,13 @@ void InsetLatexAccent::draw(PainterInfo & pi, int x, int baseline) const
}
void InsetLatexAccent::write(Buffer const *, ostream & os) const
void InsetLatexAccent::write(Buffer const &, ostream & os) const
{
os << "\\i " << contents << "\n";
}
void InsetLatexAccent::read(Buffer const *, LyXLex & lex)
void InsetLatexAccent::read(Buffer const &, LyXLex & lex)
{
lex.eatLine();
contents = lex.getString();
@ -615,7 +615,7 @@ void InsetLatexAccent::read(Buffer const *, LyXLex & lex)
}
int InsetLatexAccent::latex(Buffer const *, ostream & os,
int InsetLatexAccent::latex(Buffer const &, ostream & os,
LatexRunParams const &) const
{
os << contents;
@ -623,21 +623,21 @@ int InsetLatexAccent::latex(Buffer const *, ostream & os,
}
int InsetLatexAccent::ascii(Buffer const *, ostream & os, int) const
int InsetLatexAccent::ascii(Buffer const &, ostream & os, int) const
{
os << contents;
return 0;
}
int InsetLatexAccent::linuxdoc(Buffer const *, ostream & os) const
int InsetLatexAccent::linuxdoc(Buffer const &, ostream & os) const
{
os << contents;
return 0;
}
int InsetLatexAccent::docbook(Buffer const *, ostream & os, bool) const
int InsetLatexAccent::docbook(Buffer const &, ostream & os, bool) const
{
os << contents;
return 0;

View File

@ -42,18 +42,18 @@ public:
///
bool displayISO8859_9(PainterInfo & pi, int x, int y) const;
///
void write(Buffer const *, std::ostream &) const;
void write(Buffer const &, std::ostream &) const;
///
void read(Buffer const *, LyXLex & lex);
void read(Buffer const &, LyXLex & lex);
///
int latex(Buffer const *, std::ostream &,
int latex(Buffer const &, std::ostream &,
LatexRunParams const &) const;
///
int ascii(Buffer const *, std::ostream &, int linelen) const;
int ascii(Buffer const &, std::ostream &, int linelen) const;
///
int linuxdoc(Buffer const *, std::ostream &) const;
int linuxdoc(Buffer const &, std::ostream &) const;
///
int docbook(Buffer const *, std::ostream &, bool mixcont) const;
int docbook(Buffer const &, std::ostream &, bool mixcont) const;
///
bool directWrite() const;
///

View File

@ -23,11 +23,11 @@ public:
///
InsetList();
///
void write(Buffer const * buf, std::ostream & os) const;
void write(Buffer const & buf, std::ostream & os) const;
///
Inset::Code lyxCode() const { return Inset::FOOT_CODE; }
///
int latex(Buffer const *, std::ostream &,
int latex(Buffer const &, std::ostream &,
LatexRunParams const &) const;
///
string const editMessage() const;

View File

@ -54,7 +54,7 @@ string const InsetMarginal::editMessage() const
}
int InsetMarginal::latex(Buffer const * buf, ostream & os,
int InsetMarginal::latex(Buffer const & buf, ostream & os,
LatexRunParams const & runparams) const
{
os << "%\n\\marginpar{";

View File

@ -30,7 +30,7 @@ public:
///
InsetOld::Code lyxCode() const { return InsetOld::MARGIN_CODE; }
///
int latex(Buffer const *, std::ostream &,
int latex(Buffer const &, std::ostream &,
LatexRunParams const &) const;
///
string const editMessage() const;

View File

@ -192,14 +192,14 @@ void InsetMinipage::Params::read(LyXLex & lex)
}
void InsetMinipage::write(Buffer const * buf, ostream & os) const
void InsetMinipage::write(Buffer const & buf, ostream & os) const
{
params_.write(os);
InsetCollapsable::write(buf, os);
}
void InsetMinipage::read(Buffer const * buf, LyXLex & lex)
void InsetMinipage::read(Buffer const & buf, LyXLex & lex)
{
params_.read(lex);
InsetCollapsable::read(buf, lex);
@ -241,7 +241,7 @@ string const InsetMinipage::editMessage() const
}
int InsetMinipage::latex(Buffer const * buf, ostream & os,
int InsetMinipage::latex(Buffer const & buf, ostream & os,
LatexRunParams const & runparams) const
{
string s_pos;

View File

@ -62,9 +62,9 @@ public:
///
virtual dispatch_result localDispatch(FuncRequest const & cmd);
///
void write(Buffer const * buf, std::ostream & os) const;
void write(Buffer const & buf, std::ostream & os) const;
///
void read(Buffer const * buf, LyXLex & lex);
void read(Buffer const & buf, LyXLex & lex);
///
virtual std::auto_ptr<InsetBase> clone() const;
///
@ -72,7 +72,7 @@ public:
///
InsetOld::Code lyxCode() const { return InsetOld::MINIPAGE_CODE; }
///
int latex(Buffer const *, std::ostream &,
int latex(Buffer const &, std::ostream &,
LatexRunParams const &) const;
///
string const editMessage() const;

View File

@ -29,13 +29,13 @@ using std::ostream;
using std::endl;
void InsetNewline::read(Buffer const *, LyXLex &)
void InsetNewline::read(Buffer const &, LyXLex &)
{
/* Nothing to read */
}
void InsetNewline::write(Buffer const *, ostream & os) const
void InsetNewline::write(Buffer const &, ostream & os) const
{
os << "\n\\newline \n";
}
@ -51,7 +51,7 @@ void InsetNewline::metrics(MetricsInfo & mi, Dimension & dim) const
}
int InsetNewline::latex(Buffer const *, ostream &,
int InsetNewline::latex(Buffer const &, ostream &,
LatexRunParams const &) const
{
lyxerr << "Eek, calling InsetNewline::latex !" << endl;
@ -59,21 +59,21 @@ int InsetNewline::latex(Buffer const *, ostream &,
}
int InsetNewline::ascii(Buffer const *, ostream & os, int) const
int InsetNewline::ascii(Buffer const &, ostream & os, int) const
{
os << '\n';
return 0;
}
int InsetNewline::linuxdoc(Buffer const *, std::ostream & os) const
int InsetNewline::linuxdoc(Buffer const &, std::ostream & os) const
{
os << '\n';
return 0;
}
int InsetNewline::docbook(Buffer const *, std::ostream & os, bool) const
int InsetNewline::docbook(Buffer const &, std::ostream & os, bool) const
{
os << '\n';
return 0;

View File

@ -30,18 +30,18 @@ public:
virtual void draw(PainterInfo & pi, int x, int y) const;
virtual int latex(Buffer const *, std::ostream &,
virtual int latex(Buffer const &, std::ostream &,
LatexRunParams const &) const;
virtual int ascii(Buffer const *, std::ostream &, int linelen) const;
virtual int ascii(Buffer const &, std::ostream &, int linelen) const;
virtual int linuxdoc(Buffer const *, std::ostream &) const;
virtual int linuxdoc(Buffer const &, std::ostream &) const;
virtual int docbook(Buffer const *, std::ostream &, bool) const;
virtual int docbook(Buffer const &, std::ostream &, bool) const;
virtual void read(Buffer const *, LyXLex & lex);
virtual void read(Buffer const &, LyXLex & lex);
virtual void write(Buffer const * buf, std::ostream & os) const;
virtual void write(Buffer const & buf, std::ostream & os) const;
/// We don't need \begin_inset and \end_inset
virtual bool directWrite() const { return true; }
};

View File

@ -74,14 +74,14 @@ string const InsetNote::editMessage() const
}
void InsetNote::write(Buffer const * buf, ostream & os) const
void InsetNote::write(Buffer const & buf, ostream & os) const
{
params_.write(os);
InsetCollapsable::write(buf, os);
}
void InsetNote::read(Buffer const * buf, LyXLex & lex)
void InsetNote::read(Buffer const & buf, LyXLex & lex)
{
InsetCollapsable::read(buf, lex);
setButtonLabel();
@ -167,7 +167,7 @@ dispatch_result InsetNote::localDispatch(FuncRequest const & cmd)
}
int InsetNote::latex(Buffer const * buf, ostream & os,
int InsetNote::latex(Buffer const & buf, ostream & os,
LatexRunParams const & runparams) const
{
string const pt = params_.type;
@ -194,7 +194,7 @@ int InsetNote::latex(Buffer const * buf, ostream & os,
}
int InsetNote::linuxdoc(Buffer const * buf, std::ostream & os) const
int InsetNote::linuxdoc(Buffer const & buf, std::ostream & os) const
{
string const pt = params_.type;
@ -213,7 +213,7 @@ int InsetNote::linuxdoc(Buffer const * buf, std::ostream & os) const
}
int InsetNote::docbook(Buffer const * buf, std::ostream & os, bool mixcont) const
int InsetNote::docbook(Buffer const & buf, std::ostream & os, bool mixcont) const
{
string const pt = params_.type;
@ -232,7 +232,7 @@ int InsetNote::docbook(Buffer const * buf, std::ostream & os, bool mixcont) cons
}
int InsetNote::ascii(Buffer const * buf, std::ostream & os, int ll) const
int InsetNote::ascii(Buffer const & buf, std::ostream & os, int ll) const
{
int i = 0;
string const pt = params_.type;

View File

@ -46,9 +46,9 @@ public:
///
InsetOld::Code lyxCode() const { return InsetOld::NOTE_CODE; }
///
void write(Buffer const *, std::ostream &) const;
void write(Buffer const &, std::ostream &) const;
///
void read(Buffer const * buf, LyXLex & lex);
void read(Buffer const & buf, LyXLex & lex);
///
void setButtonLabel();
///
@ -58,14 +58,14 @@ public:
/// show the note dialog
bool showInsetDialog(BufferView * bv) const;
///
int latex(Buffer const *, std::ostream &,
int latex(Buffer const &, std::ostream &,
LatexRunParams const &) const;
///
int linuxdoc(Buffer const *, std::ostream &) const;
int linuxdoc(Buffer const &, std::ostream &) const;
///
int docbook(Buffer const *, std::ostream &, bool) const;
int docbook(Buffer const &, std::ostream &, bool) const;
///
int ascii(Buffer const *, std::ostream &, int) const;
int ascii(Buffer const &, std::ostream &, int) const;
///
void validate(LaTeXFeatures &) const;
///

View File

@ -61,21 +61,21 @@ string const InsetOptArg::editMessage() const
}
void InsetOptArg::write(Buffer const * buf, ostream & os) const
void InsetOptArg::write(Buffer const & buf, ostream & os) const
{
os << "OptArg" << "\n";
InsetCollapsable::write(buf, os);
}
int InsetOptArg::latex(Buffer const *, ostream &,
int InsetOptArg::latex(Buffer const &, ostream &,
LatexRunParams const &) const
{
return 0;
}
int InsetOptArg::latexOptional(Buffer const * buf, ostream & os,
int InsetOptArg::latexOptional(Buffer const & buf, ostream & os,
LatexRunParams const & runparams) const
{
os << '[';

View File

@ -36,13 +36,13 @@ public:
string const editMessage() const;
/// Standard LaTeX output -- short-circuited
int latex(Buffer const *, std::ostream &,
int latex(Buffer const &, std::ostream &,
LatexRunParams const &) const;
/// Outputting the optional parameter of a LaTeX command
int latexOptional(Buffer const *, std::ostream &,
int latexOptional(Buffer const &, std::ostream &,
LatexRunParams const &) const;
/// Write out tothe .lyx file
void write(Buffer const * buf, std::ostream & os) const;
void write(Buffer const & buf, std::ostream & os) const;
};
#endif // INSETOPTARG_H

View File

@ -232,7 +232,7 @@ void InsetQuotes::draw(PainterInfo & pi, int x, int y) const
}
void InsetQuotes::write(Buffer const *, ostream & os) const
void InsetQuotes::write(Buffer const &, ostream & os) const
{
string text;
text += language_char[language_];
@ -242,7 +242,7 @@ void InsetQuotes::write(Buffer const *, ostream & os) const
}
void InsetQuotes::read(Buffer const *, LyXLex & lex)
void InsetQuotes::read(Buffer const &, LyXLex & lex)
{
lex.nextToken();
parseString(lex.getString());
@ -253,11 +253,11 @@ void InsetQuotes::read(Buffer const *, LyXLex & lex)
}
int InsetQuotes::latex(Buffer const * buf, ostream & os,
int InsetQuotes::latex(Buffer const & buf, ostream & os,
LatexRunParams const & runparams) const
{
// How do we get the local language here??
lyx::pos_type curr_pos = ownerPar(*buf, this).getPositionOfInset(this);
lyx::pos_type curr_pos = ownerPar(buf, this).getPositionOfInset(this);
Assert(curr_pos != -1);
#warning FIXME. We _must_ find another way to get the language. (Lgb)
@ -267,7 +267,7 @@ int InsetQuotes::latex(Buffer const * buf, ostream & os,
parOwner()->getFont(buf->params, curr_pos).language()->babel();
#else
// And this is not the way... (Lgb)
string const curr_lang = buf->params.language->lang();
string const curr_lang = buf.params.language->lang();
#endif
const int quoteind = quote_index[side_][language_];
string qstr;
@ -305,21 +305,21 @@ int InsetQuotes::latex(Buffer const * buf, ostream & os,
}
int InsetQuotes::ascii(Buffer const *, ostream & os, int) const
int InsetQuotes::ascii(Buffer const &, ostream & os, int) const
{
os << '"';
return 0;
}
int InsetQuotes::linuxdoc(Buffer const *, ostream & os) const
int InsetQuotes::linuxdoc(Buffer const &, ostream & os) const
{
os << '"';
return 0;
}
int InsetQuotes::docbook(Buffer const *, ostream & os, bool) const
int InsetQuotes::docbook(Buffer const &, ostream & os, bool) const
{
if (times_ == DoubleQ) {
if (side_ == LeftQ)

View File

@ -78,18 +78,18 @@ public:
LyXFont const convertFont(LyXFont const & font) const;
#endif
///
void write(Buffer const *, std::ostream &) const;
void write(Buffer const &, std::ostream &) const;
///
void read(Buffer const *, LyXLex & lex);
void read(Buffer const &, LyXLex & lex);
///
int latex(Buffer const *, std::ostream &,
int latex(Buffer const &, std::ostream &,
LatexRunParams const &) const;
///
int ascii(Buffer const *, std::ostream &, int linelen) const;
int ascii(Buffer const &, std::ostream &, int linelen) const;
///
int linuxdoc(Buffer const *, std::ostream &) const;
int linuxdoc(Buffer const &, std::ostream &) const;
///
int docbook(Buffer const *, std::ostream &, bool mixcont) const;
int docbook(Buffer const &, std::ostream &, bool mixcont) const;
///
void validate(LaTeXFeatures &) const;
///

View File

@ -60,7 +60,7 @@ dispatch_result InsetRef::localDispatch(FuncRequest const & cmd)
}
string const InsetRef::getScreenLabel(Buffer const *) const
string const InsetRef::getScreenLabel(Buffer const &) const
{
string temp;
for (int i = 0; !types[i].latex_name.empty(); ++ i)
@ -79,7 +79,7 @@ string const InsetRef::getScreenLabel(Buffer const *) const
}
int InsetRef::latex(Buffer const *, ostream & os,
int InsetRef::latex(Buffer const &, ostream & os,
LatexRunParams const &) const
{
if (getOptions().empty())
@ -92,14 +92,14 @@ int InsetRef::latex(Buffer const *, ostream & os,
}
int InsetRef::ascii(Buffer const *, ostream & os, int) const
int InsetRef::ascii(Buffer const &, ostream & os, int) const
{
os << '[' << getContents() << ']';
return 0;
}
int InsetRef::linuxdoc(Buffer const *, ostream & os) const
int InsetRef::linuxdoc(Buffer const &, ostream & os) const
{
os << "<ref id=\"" << getContents()
<< "\" name=\"" << getOptions() << "\" >";
@ -107,7 +107,7 @@ int InsetRef::linuxdoc(Buffer const *, ostream & os) const
}
int InsetRef::docbook(Buffer const *, ostream & os, bool) const
int InsetRef::docbook(Buffer const &, ostream & os, bool) const
{
if (getOptions().empty()) {
os << "<xref linkend=\"" << getContents() << "\">";

View File

@ -48,7 +48,7 @@ public:
///
dispatch_result localDispatch(FuncRequest const & cmd);
///
string const getScreenLabel(Buffer const *) const;
string const getScreenLabel(Buffer const &) const;
///
EDITABLE editable() const { return IS_EDITABLE; }
///
@ -56,14 +56,14 @@ public:
///
bool display() const { return false; }
///
int latex(Buffer const *, std::ostream &,
int latex(Buffer const &, std::ostream &,
LatexRunParams const &) const;
///
int ascii(Buffer const *, std::ostream &, int linelen) const;
int ascii(Buffer const &, std::ostream &, int linelen) const;
///
int linuxdoc(Buffer const *, std::ostream &) const;
int linuxdoc(Buffer const &, std::ostream &) const;
///
int docbook(Buffer const *, std::ostream &, bool mixcont) const;
int docbook(Buffer const &, std::ostream &, bool mixcont) const;
///
void validate(LaTeXFeatures & features) const;
private:

View File

@ -101,7 +101,7 @@ void InsetSpace::draw(PainterInfo & pi, int x, int y) const
}
void InsetSpace::write(Buffer const *, ostream & os) const
void InsetSpace::write(Buffer const &, ostream & os) const
{
string command;
switch (kind_) {
@ -135,7 +135,7 @@ void InsetSpace::write(Buffer const *, ostream & os) const
// This function will not be necessary when lyx3
void InsetSpace::read(Buffer const *, LyXLex & lex)
void InsetSpace::read(Buffer const &, LyXLex & lex)
{
lex.nextToken();
string const command = lex.getString();
@ -161,7 +161,7 @@ void InsetSpace::read(Buffer const *, LyXLex & lex)
}
int InsetSpace::latex(Buffer const *, ostream & os,
int InsetSpace::latex(Buffer const &, ostream & os,
LatexRunParams const & runparams) const
{
switch (kind_) {
@ -194,7 +194,7 @@ int InsetSpace::latex(Buffer const *, ostream & os,
}
int InsetSpace::ascii(Buffer const *, ostream & os, int) const
int InsetSpace::ascii(Buffer const &, ostream & os, int) const
{
switch (kind_) {
case NORMAL:
@ -212,7 +212,7 @@ int InsetSpace::ascii(Buffer const *, ostream & os, int) const
}
int InsetSpace::linuxdoc(Buffer const *, ostream & os) const
int InsetSpace::linuxdoc(Buffer const &, ostream & os) const
{
switch (kind_) {
case NORMAL:
@ -232,7 +232,7 @@ int InsetSpace::linuxdoc(Buffer const *, ostream & os) const
}
int InsetSpace::docbook(Buffer const *, ostream & os, bool) const
int InsetSpace::docbook(Buffer const &, ostream & os, bool) const
{
switch (kind_) {
case NORMAL:

View File

@ -58,18 +58,18 @@ public:
///
void draw(PainterInfo & pi, int x, int y) const;
///
void write(Buffer const *, std::ostream &) const;
void write(Buffer const &, std::ostream &) const;
/// Will not be used when lyxf3
void read(Buffer const *, LyXLex & lex);
void read(Buffer const &, LyXLex & lex);
///
int latex(Buffer const *, std::ostream &,
int latex(Buffer const &, std::ostream &,
LatexRunParams const &) const;
///
int ascii(Buffer const *, std::ostream &, int linelen) const;
int ascii(Buffer const &, std::ostream &, int linelen) const;
///
int linuxdoc(Buffer const *, std::ostream &) const;
int linuxdoc(Buffer const &, std::ostream &) const;
///
int docbook(Buffer const *, std::ostream &, bool mixcont) const;
int docbook(Buffer const &, std::ostream &, bool mixcont) const;
///
virtual std::auto_ptr<InsetBase> clone() const;
///

View File

@ -111,7 +111,7 @@ void InsetSpecialChar::draw(PainterInfo & pi, int x, int y) const
// In lyxf3 this will be just LaTeX
void InsetSpecialChar::write(Buffer const *, ostream & os) const
void InsetSpecialChar::write(Buffer const &, ostream & os) const
{
string command;
switch (kind_) {
@ -136,7 +136,7 @@ void InsetSpecialChar::write(Buffer const *, ostream & os) const
// This function will not be necessary when lyx3
void InsetSpecialChar::read(Buffer const *, LyXLex & lex)
void InsetSpecialChar::read(Buffer const &, LyXLex & lex)
{
lex.nextToken();
string const command = lex.getString();
@ -156,7 +156,7 @@ void InsetSpecialChar::read(Buffer const *, LyXLex & lex)
}
int InsetSpecialChar::latex(Buffer const *, ostream & os,
int InsetSpecialChar::latex(Buffer const &, ostream & os,
LatexRunParams const &) const
{
switch (kind_) {
@ -180,7 +180,7 @@ int InsetSpecialChar::latex(Buffer const *, ostream & os,
}
int InsetSpecialChar::ascii(Buffer const *, ostream & os, int) const
int InsetSpecialChar::ascii(Buffer const &, ostream & os, int) const
{
switch (kind_) {
case HYPHENATION:
@ -200,7 +200,7 @@ int InsetSpecialChar::ascii(Buffer const *, ostream & os, int) const
}
int InsetSpecialChar::linuxdoc(Buffer const *, ostream & os) const
int InsetSpecialChar::linuxdoc(Buffer const &, ostream & os) const
{
switch (kind_) {
case HYPHENATION:
@ -220,7 +220,7 @@ int InsetSpecialChar::linuxdoc(Buffer const *, ostream & os) const
}
int InsetSpecialChar::docbook(Buffer const *, ostream & os, bool) const
int InsetSpecialChar::docbook(Buffer const &, ostream & os, bool) const
{
switch (kind_) {
case HYPHENATION:

View File

@ -50,18 +50,18 @@ public:
///
void draw(PainterInfo & pi, int x, int y) const;
///
void write(Buffer const *, std::ostream &) const;
void write(Buffer const &, std::ostream &) const;
/// Will not be used when lyxf3
void read(Buffer const *, LyXLex & lex);
void read(Buffer const &, LyXLex & lex);
///
int latex(Buffer const *, std::ostream &,
int latex(Buffer const &, std::ostream &,
LatexRunParams const &) const;
///
int ascii(Buffer const *, std::ostream &, int linelen) const;
int ascii(Buffer const &, std::ostream &, int linelen) const;
///
int linuxdoc(Buffer const *, std::ostream &) const;
int linuxdoc(Buffer const &, std::ostream &) const;
///
int docbook(Buffer const *, std::ostream &, bool mixcont) const;
int docbook(Buffer const &, std::ostream &, bool mixcont) const;
///
virtual std::auto_ptr<InsetBase> clone() const;
///

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