infrastructure for 'graceful asserts'

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24216 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2008-04-10 21:49:34 +00:00
parent d4276b4222
commit 7f461f4392
104 changed files with 627 additions and 595 deletions

View File

@ -19,7 +19,7 @@
#include "LyXRC.h"
#include "WordLangTuple.h"
#include <boost/assert.hpp>
#include "support/assert.h"
using namespace std;
@ -104,14 +104,14 @@ ASpell::Result ASpell::check(WordLangTuple const & word)
AspellSpeller * m = it->second.speller;
int const word_ok = aspell_speller_check(m, to_utf8(word.word()).c_str(), -1);
BOOST_ASSERT(word_ok != -1);
LASSERT(word_ok != -1, /**/);
if (word_ok)
return OK;
AspellWordList const * sugs =
aspell_speller_suggest(m, to_utf8(word.word()).c_str(), -1);
BOOST_ASSERT(sugs != 0);
LASSERT(sugs != 0, /**/);
els = aspell_word_list_elements(sugs);
if (aspell_word_list_empty(sugs))
res = UNKNOWN_WORD;

View File

@ -14,7 +14,7 @@
#include "support/lstrings.h"
#include <boost/assert.hpp>
#include "support/assert.h"
#include <istream>
@ -71,7 +71,7 @@ int AuthorList::record(Author const & a)
void AuthorList::record(int id, Author const & a)
{
BOOST_ASSERT(unsigned(id) < authors_.size());
LASSERT(unsigned(id) < authors_.size(), /**/);
authors_[id] = a;
}
@ -80,7 +80,7 @@ void AuthorList::record(int id, Author const & a)
Author const & AuthorList::get(int id) const
{
Authors::const_iterator it(authors_.find(id));
BOOST_ASSERT(it != authors_.end());
LASSERT(it != authors_.end(), /**/);
return it->second;
}

View File

@ -24,6 +24,7 @@
#include "insets/InsetBibtex.h"
#include "insets/InsetInclude.h"
#include "support/assert.h"
#include "support/docstream.h"
#include "support/gettext.h"
#include "support/lstrings.h"
@ -423,7 +424,7 @@ void BiblioInfo::fillWithBibKeys(Buffer const * const buf)
/// if this is a child document and the parent is already loaded
/// use the parent's list instead [ale990412]
Buffer const * const tmp = buf->masterBuffer();
BOOST_ASSERT(tmp);
LASSERT(tmp, /**/);
if (tmp != buf) {
this->fillWithBibKeys(tmp);
return;

View File

@ -77,6 +77,7 @@
#include "graphics/Previews.h"
#include "support/assert.h"
#include "support/convert.h"
#include "support/debug.h"
#include "support/ExceptionMessage.h"
@ -214,6 +215,7 @@ public:
InsetText inset;
};
/// Creates the per buffer temporary directory
static FileName createBufferTmpDir()
{
@ -294,7 +296,7 @@ void Buffer::changed() const
frontend::WorkAreaManager & Buffer::workAreaManager() const
{
BOOST_ASSERT(d->wa_);
LASSERT(d->wa_, /**/);
return *d->wa_;
}
@ -546,7 +548,7 @@ bool Buffer::readDocument(Lexer & lex)
}
// we are reading in a brand new document
BOOST_ASSERT(paragraphs().empty());
LASSERT(paragraphs().empty(), /**/);
readHeader(lex);
@ -727,7 +729,7 @@ void Buffer::setFullyLoaded(bool value)
Buffer::ReadStatus Buffer::readFile(Lexer & lex, FileName const & filename,
bool fromstring)
{
BOOST_ASSERT(!filename.empty());
LASSERT(!filename.empty(), /**/);
// the first (non-comment) token _must_ be...
if (!lex.checkFor("\\lyxformat")) {
@ -1460,8 +1462,8 @@ bool Buffer::dispatch(FuncRequest const & func, bool * result)
void Buffer::changeLanguage(Language const * from, Language const * to)
{
BOOST_ASSERT(from);
BOOST_ASSERT(to);
LASSERT(from, /**/);
LASSERT(to, /**/);
for_each(par_iterator_begin(),
par_iterator_end(),
@ -1552,7 +1554,7 @@ bool Buffer::isBakClean() const
bool Buffer::isExternallyModified(CheckMethod method) const
{
BOOST_ASSERT(d->filename.exists());
LASSERT(d->filename.exists(), /**/);
// if method == timestamp, check timestamp before checksum
return (method == checksum_method
|| d->timestamp_ != d->filename.lastModified())
@ -2049,7 +2051,7 @@ void Buffer::changeRefsIfUnique(docstring const & from, docstring const & to,
InsetCode code)
{
//FIXME: This does not work for child documents yet.
BOOST_ASSERT(code == CITE_CODE);
LASSERT(code == CITE_CODE, /**/);
// Check if the label 'from' appears more than once
vector<docstring> labels;
string paramName;

View File

@ -29,7 +29,7 @@
#include "support/lstrings.h"
#include "support/Package.h"
#include <boost/assert.hpp>
#include "support/assert.h"
#include <boost/bind.hpp>
#include <algorithm>
@ -81,12 +81,12 @@ BufferList::const_iterator BufferList::end() const
void BufferList::release(Buffer * buf)
{
BOOST_ASSERT(buf);
LASSERT(buf, /**/);
BufferStorage::iterator const it =
find(bstore.begin(), bstore.end(), buf);
if (it != bstore.end()) {
Buffer * tmp = (*it);
BOOST_ASSERT(tmp);
LASSERT(tmp, /**/);
bstore.erase(it);
delete tmp;
}
@ -157,13 +157,13 @@ Buffer * BufferList::getBuffer(unsigned int choice)
Buffer * BufferList::next(Buffer const * buf) const
{
BOOST_ASSERT(buf);
LASSERT(buf, /**/);
if (bstore.empty())
return 0;
BufferStorage::const_iterator it = find(bstore.begin(),
bstore.end(), buf);
BOOST_ASSERT(it != bstore.end());
LASSERT(it != bstore.end(), /**/);
++it;
if (it == bstore.end())
return bstore.front();
@ -174,13 +174,13 @@ Buffer * BufferList::next(Buffer const * buf) const
Buffer * BufferList::previous(Buffer const * buf) const
{
BOOST_ASSERT(buf);
LASSERT(buf, /**/);
if (bstore.empty())
return 0;
BufferStorage::const_iterator it = find(bstore.begin(),
bstore.end(), buf);
BOOST_ASSERT(it != bstore.end());
LASSERT(it != bstore.end(), /**/);
if (it == bstore.begin())
return bstore.back();
else
@ -285,7 +285,7 @@ bool BufferList::exists(string const & s) const
bool BufferList::isLoaded(Buffer const * b) const
{
BOOST_ASSERT(b);
LASSERT(b, /**/);
BufferStorage::const_iterator cit =
find(bstore.begin(), bstore.end(), b);
return cit != bstore.end();

View File

@ -302,7 +302,7 @@ BufferParams::Impl::Impl()
BufferParams::Impl *
BufferParams::MemoryTraits::clone(BufferParams::Impl const * ptr)
{
BOOST_ASSERT(ptr);
LASSERT(ptr, /**/);
return new BufferParams::Impl(*ptr);
}
@ -361,7 +361,7 @@ BufferParams::BufferParams()
docstring BufferParams::B_(string const & l10n) const
{
BOOST_ASSERT(language);
LASSERT(language, /**/);
return getMessages(language->code()).get(l10n);
}
@ -404,28 +404,28 @@ BranchList const & BufferParams::branchlist() const
Bullet & BufferParams::temp_bullet(lyx::size_type const index)
{
BOOST_ASSERT(index < 4);
LASSERT(index < 4, /**/);
return pimpl_->temp_bullets[index];
}
Bullet const & BufferParams::temp_bullet(lyx::size_type const index) const
{
BOOST_ASSERT(index < 4);
LASSERT(index < 4, /**/);
return pimpl_->temp_bullets[index];
}
Bullet & BufferParams::user_defined_bullet(lyx::size_type const index)
{
BOOST_ASSERT(index < 4);
LASSERT(index < 4, /**/);
return pimpl_->user_defined_bullets[index];
}
Bullet const & BufferParams::user_defined_bullet(lyx::size_type const index) const
{
BOOST_ASSERT(index < 4);
LASSERT(index < 4, /**/);
return pimpl_->user_defined_bullets[index];
}

View File

@ -787,7 +787,7 @@ void BufferView::showCursor(DocIterator const & dit)
if (tm.contains(bot_pit)) {
ParagraphMetrics const & pm = tm.parMetrics(bot_pit);
BOOST_ASSERT(!pm.rows().empty());
LASSERT(!pm.rows().empty(), /**/);
// FIXME: smooth scrolling doesn't work in mathed.
CursorSlice const & cs = dit.innerTextSlice();
int offset = coordOffset(dit, dit.boundary()).y_;
@ -1774,7 +1774,7 @@ bool BufferView::checkDepm(Cursor & cur, Cursor & old)
bool BufferView::mouseSetCursor(Cursor & cur, bool select)
{
BOOST_ASSERT(&cur.bv() == this);
LASSERT(&cur.bv() == this, /**/);
if (!select)
// this event will clear selection so we save selection for
@ -1975,7 +1975,7 @@ void BufferView::updateMetrics()
void BufferView::insertLyXFile(FileName const & fname)
{
BOOST_ASSERT(d->cursor_.inTexted());
LASSERT(d->cursor_.inTexted(), /**/);
// Get absolute path of file and add ".lyx"
// to the filename if necessary
@ -2060,7 +2060,7 @@ Point BufferView::coordOffset(DocIterator const & dit, bool boundary) const
CursorSlice const & sl = dit[0];
TextMetrics const & tm = textMetrics(sl.text());
ParagraphMetrics const & pm = tm.parMetrics(sl.pit());
BOOST_ASSERT(!pm.rows().empty());
LASSERT(!pm.rows().empty(), /**/);
y -= pm.rows()[0].ascent();
#if 1
// FIXME: document this mess

View File

@ -18,7 +18,7 @@
#include "Bullet.h"
#include <boost/assert.hpp>
#include "support/assert.h"
using namespace std;
@ -348,25 +348,25 @@ docstring const Bullet::bulletEntry(int f, int c)
void Bullet::testInvariant() const
{
#ifdef ENABLE_ASSERTIONS
BOOST_ASSERT(font >= MIN);
BOOST_ASSERT(font < FONTMAX);
BOOST_ASSERT(character >= MIN);
BOOST_ASSERT(character < CHARMAX);
BOOST_ASSERT(size >= MIN);
BOOST_ASSERT(size < SIZEMAX);
BOOST_ASSERT(user_text >= -1);
BOOST_ASSERT(user_text <= 1);
LASSERT(font >= MIN, /**/);
LASSERT(font < FONTMAX, /**/);
LASSERT(character >= MIN, /**/);
LASSERT(character < CHARMAX, /**/);
LASSERT(size >= MIN, /**/);
LASSERT(size < SIZEMAX, /**/);
LASSERT(user_text >= -1, /**/);
LASSERT(user_text <= 1, /**/);
// now some relational/operational tests
if (user_text == 1) {
BOOST_ASSERT(font == -1 && (character == -1 && size == -1));
// BOOST_ASSERT(!text.empty()); // this isn't necessarily an error
LASSERT(font == -1 && (character == -1 && size == -1), /**/);
// LASSERT(!text.empty(), /**/); // this isn't necessarily an error
}
// else if (user_text == -1) {
// BOOST_ASSERT(!text.empty()); // this also isn't necessarily an error
// LASSERT(!text.empty(), /**/); // this also isn't necessarily an error
// }
// else {
// // user_text == 0
// BOOST_ASSERT(text.empty()); // not usually true
// LASSERT(text.empty(), /**/); // not usually true
// }
#endif
}

View File

@ -20,7 +20,7 @@
#include "support/debug.h"
#include <boost/assert.hpp>
#include "support/assert.h"
#include <ostream>

View File

@ -22,7 +22,7 @@
#include "support/gettext.h"
#include "support/lstrings.h"
#include <boost/assert.hpp>
#include "support/assert.h"
#include <map>
#include <cmath>
@ -77,7 +77,7 @@ string const X11hexname(RGBColor const & col)
RGBColor rgbFromHexName(string const & x11hexname)
{
RGBColor c;
BOOST_ASSERT(x11hexname.size() == 7 && x11hexname[0] == '#');
LASSERT(x11hexname.size() == 7 && x11hexname[0] == '#', /**/);
c.r = hexstrToInt(x11hexname.substr(1,2));
c.g = hexstrToInt(x11hexname.substr(3,2));
c.b = hexstrToInt(x11hexname.substr(5,2));

View File

@ -25,7 +25,7 @@
#include "support/lyxtime.h"
#include "support/Package.h"
#include <boost/assert.hpp>
#include "support/assert.h"
#include <boost/crc.hpp>
#include <algorithm>
@ -409,7 +409,7 @@ FileName const & ConverterCache::cacheName(FileName const & orig_from,
LYXERR(Debug::FILES, orig_from << ' ' << to_format);
CacheItem * const item = pimpl_->find(orig_from, to_format);
BOOST_ASSERT(item);
LASSERT(item, /**/);
return item->cache_name;
}
@ -433,7 +433,7 @@ bool ConverterCache::copy(FileName const & orig_from, string const & to_format,
}
CacheItem * const item = pimpl_->find(orig_from, to_format);
BOOST_ASSERT(item);
LASSERT(item, /**/);
Mover const & mover = getMover(to_format);
return mover.copy(item->cache_name, dest,
onlyFilename(dest.absFilename()));

View File

@ -18,7 +18,7 @@
#include "insets/Inset.h"
#include <boost/assert.hpp>
#include "support/assert.h"
namespace lyx {
@ -26,10 +26,10 @@ namespace lyx {
Point::Point(int x, int y)
: x_(x), y_(y)
{
BOOST_ASSERT(x > -1000000);
BOOST_ASSERT(x < 1000000);
BOOST_ASSERT(y > -1000000);
BOOST_ASSERT(y < 1000000);
LASSERT(x > -1000000, /**/);
LASSERT(x < 1000000, /**/);
LASSERT(y > -1000000, /**/);
LASSERT(y < 1000000, /**/);
}
// just a helper to be able to set a breakpoint
@ -37,7 +37,7 @@ void lyxbreaker(void const * data, const char * hint, int size)
{
LYXERR0("break on pointer: " << data << " hint: " << hint
<< " size: " << size);
BOOST_ASSERT(false);
LASSERT(false, /**/);
}

View File

@ -19,7 +19,7 @@
#include "support/debug.h"
#include "support/lstrings.h"
#include <boost/assert.hpp>
#include "support/assert.h"
#include <sstream>
@ -183,7 +183,7 @@ void Counters::reset()
void Counters::reset(docstring const & match)
{
BOOST_ASSERT(!match.empty());
LASSERT(!match.empty(), /**/);
CounterList::iterator it = counterList.begin();
CounterList::iterator end = counterList.end();

View File

@ -36,6 +36,7 @@
#include "TextMetrics.h"
#include "TocBackend.h"
#include "support/assert.h"
#include "support/debug.h"
#include "support/docstream.h"
@ -49,7 +50,6 @@
#include "mathed/MathData.h"
#include "mathed/MathMacro.h"
#include <boost/assert.hpp>
#include <boost/bind.hpp>
#include <sstream>
@ -134,7 +134,7 @@ DocIterator bruteFind2(Cursor const & c, int x, int y)
bool bruteFind(Cursor & cursor,
int x, int y, int xlow, int xhigh, int ylow, int yhigh)
{
BOOST_ASSERT(!cursor.empty());
LASSERT(!cursor.empty(), return false);
Inset & inset = cursor[0].inset();
BufferView & bv = cursor.bv();
@ -304,9 +304,9 @@ void Cursor::dispatch(FuncRequest const & cmd0)
for (; depth(); pop(), boundary(false)) {
LYXERR(Debug::DEBUG, "Cursor::dispatch: cmd: "
<< cmd0 << endl << *this);
BOOST_ASSERT(pos() <= lastpos());
BOOST_ASSERT(idx() <= lastidx());
BOOST_ASSERT(pit() <= lastpit());
LASSERT(pos() <= lastpos(), /**/);
LASSERT(idx() <= lastidx(), /**/);
LASSERT(pit() <= lastpit(), /**/);
// The common case is 'LFUN handled, need update', so make the
// LFUN handler's life easier by assuming this as default value.
@ -341,21 +341,21 @@ DispatchResult Cursor::result() const
BufferView & Cursor::bv() const
{
BOOST_ASSERT(bv_);
LASSERT(bv_, /**/);
return *bv_;
}
Buffer & Cursor::buffer() const
{
BOOST_ASSERT(bv_);
LASSERT(bv_, /**/);
return bv_->buffer();
}
void Cursor::pop()
{
BOOST_ASSERT(depth() >= 1);
LASSERT(depth() >= 1, /**/);
pop_back();
}
@ -369,7 +369,7 @@ void Cursor::push(Inset & p)
void Cursor::pushBackward(Inset & p)
{
BOOST_ASSERT(!empty());
LASSERT(!empty(), /**/);
//lyxerr << "Entering inset " << t << " front" << endl;
push(p);
p.idxFirst(*this);
@ -378,7 +378,7 @@ void Cursor::pushBackward(Inset & p)
bool Cursor::popBackward()
{
BOOST_ASSERT(!empty());
LASSERT(!empty(), /**/);
if (depth() == 1)
return false;
pop();
@ -388,7 +388,7 @@ bool Cursor::popBackward()
bool Cursor::popForward()
{
BOOST_ASSERT(!empty());
LASSERT(!empty(), /**/);
//lyxerr << "Leaving inset from in back" << endl;
const pos_type lp = (depth() > 1) ? (*this)[depth() - 2].lastpos() : 0;
if (depth() == 1)
@ -401,7 +401,7 @@ bool Cursor::popForward()
int Cursor::currentMode()
{
BOOST_ASSERT(!empty());
LASSERT(!empty(), /**/);
for (int i = depth() - 1; i >= 0; --i) {
int res = operator[](i).inset().currentMode();
if (res != Inset::UNDECIDED_MODE)
@ -423,7 +423,7 @@ Row const & Cursor::textRow() const
{
CursorSlice const & cs = innerTextSlice();
ParagraphMetrics const & pm = bv().parMetrics(cs.text(), cs.pit());
BOOST_ASSERT(!pm.rows().empty());
LASSERT(!pm.rows().empty(), /**/);
return pm.getRow(pos(), boundary());
}
@ -724,7 +724,7 @@ void Cursor::posVisToRowExtremity(bool left)
CursorSlice Cursor::anchor() const
{
BOOST_ASSERT(anchor_.depth() >= depth());
LASSERT(anchor_.depth() >= depth(), /**/);
CursorSlice normal = anchor_[depth() - 1];
if (depth() < anchor_.depth() && top() <= normal) {
// anchor is behind cursor -> move anchor behind the inset
@ -1003,7 +1003,7 @@ void Cursor::insert(docstring const & str)
void Cursor::insert(char_type c)
{
//lyxerr << "Cursor::insert char '" << c << "'" << endl;
BOOST_ASSERT(!empty());
LASSERT(!empty(), /**/);
if (inMathed()) {
cap::selClearOrDel(*this);
insert(new InsetMathChar(c));
@ -1024,7 +1024,7 @@ void Cursor::insert(MathAtom const & t)
void Cursor::insert(Inset * inset0)
{
BOOST_ASSERT(inset0);
LASSERT(inset0, /**/);
if (inMathed())
insert(MathAtom(inset0));
else {
@ -1495,7 +1495,7 @@ bool Cursor::upDownInMath(bool up)
bool Cursor::upDownInText(bool up, bool & updateNeeded)
{
BOOST_ASSERT(text());
LASSERT(text(), /**/);
// where are we?
int xo = 0;

View File

@ -25,7 +25,7 @@
#include "mathed/InsetMath.h"
#include "mathed/MathData.h"
#include <boost/assert.hpp>
#include "support/assert.h"
#include <ostream>
@ -42,7 +42,7 @@ CursorSlice::CursorSlice()
CursorSlice::CursorSlice(Inset & p)
: inset_(&p), idx_(0), pit_(0), pos_(0)
{
BOOST_ASSERT(inset_);
LASSERT(inset_, /**/);
}
@ -60,7 +60,7 @@ Paragraph & CursorSlice::paragraph() const
pos_type CursorSlice::lastpos() const
{
BOOST_ASSERT(inset_);
LASSERT(inset_, /**/);
return inset_->asInsetMath() ? cell().size()
: (text()->empty() ? 0 : paragraph().size());
}
@ -76,14 +76,14 @@ pit_type CursorSlice::lastpit() const
CursorSlice::row_type CursorSlice::row() const
{
BOOST_ASSERT(asInsetMath());
LASSERT(asInsetMath(), /**/);
return asInsetMath()->row(idx_);
}
CursorSlice::col_type CursorSlice::col() const
{
BOOST_ASSERT(asInsetMath());
LASSERT(asInsetMath(), /**/);
return asInsetMath()->col(idx_);
}
@ -108,7 +108,7 @@ void CursorSlice::forwardPos()
// otherwise move on one cell
//lyxerr << "... next idx" << endl;
BOOST_ASSERT(idx_ < nargs());
LASSERT(idx_ < nargs(), /**/);
++idx_;
pit_ = 0;
@ -118,7 +118,7 @@ void CursorSlice::forwardPos()
void CursorSlice::forwardIdx()
{
BOOST_ASSERT(idx_ < nargs());
LASSERT(idx_ < nargs(), /**/);
++idx_;
pit_ = 0;
@ -146,7 +146,7 @@ void CursorSlice::backwardPos()
return;
}
BOOST_ASSERT(false);
LASSERT(false, /**/);
}
@ -185,7 +185,7 @@ bool operator<(CursorSlice const & p, CursorSlice const & q)
if (p.inset_ != q.inset_) {
LYXERR0("can't compare cursor and anchor in different insets\n"
<< "p: " << p << '\n' << "q: " << q);
BOOST_ASSERT(false);
LASSERT(false, /**/);
}
if (p.idx_ != q.idx_)
return p.idx_ < q.idx_;

View File

@ -363,9 +363,9 @@ void copySelectionHelper(Buffer const & buf, ParagraphList & pars,
pit_type startpit, pit_type endpit,
int start, int end, DocumentClass const * const dc, CutStack & cutstack)
{
BOOST_ASSERT(0 <= start && start <= pars[startpit].size());
BOOST_ASSERT(0 <= end && end <= pars[endpit].size());
BOOST_ASSERT(startpit != endpit || start <= end);
LASSERT(0 <= start && start <= pars[startpit].size(), /**/);
LASSERT(0 <= end && end <= pars[endpit].size(), /**/);
LASSERT(startpit != endpit || start <= end, /**/);
// Clone the paragraphs within the selection.
ParagraphList copy_pars(boost::next(pars.begin(), startpit),
@ -478,7 +478,7 @@ void switchBetweenClasses(DocumentClass const * const oldone,
{
errorlist.clear();
BOOST_ASSERT(!in.paragraphs().empty());
LASSERT(!in.paragraphs().empty(), /**/);
if (oldone == newone)
return;
@ -584,7 +584,7 @@ void cutSelection(Cursor & cur, bool doclear, bool realcut)
if (cur.inTexted()) {
Text * text = cur.text();
BOOST_ASSERT(text);
LASSERT(text, /**/);
saveSelection(cur);
@ -670,7 +670,7 @@ void copySelectionToStack(Cursor & cur, CutStack & cutstack)
if (cur.inTexted()) {
Text * text = cur.text();
BOOST_ASSERT(text);
LASSERT(text, /**/);
// ok we have a selection. This is always between cur.selBegin()
// and sel_end cursor
@ -780,7 +780,7 @@ void pasteParagraphList(Cursor & cur, ParagraphList const & parlist,
{
if (cur.inTexted()) {
Text * text = cur.text();
BOOST_ASSERT(text);
LASSERT(text, /**/);
pit_type endpit;
PitPosPair ppp;
@ -793,7 +793,7 @@ void pasteParagraphList(Cursor & cur, ParagraphList const & parlist,
}
// mathed is handled in InsetMathNest/InsetMathGrid
BOOST_ASSERT(!cur.inMathed());
LASSERT(!cur.inMathed(), /**/);
}
@ -851,7 +851,7 @@ void pasteClipboardText(Cursor & cur, ErrorList & errorList, bool asParagraphs)
void pasteClipboardGraphics(Cursor & cur, ErrorList & /* errorList */,
Clipboard::GraphicsType preferedType)
{
BOOST_ASSERT(theClipboard().hasGraphicsContents(preferedType));
LASSERT(theClipboard().hasGraphicsContents(preferedType), /**/);
// get picture from clipboard
FileName filename = theClipboard().getAsGraphics(cur, preferedType);

View File

@ -25,7 +25,7 @@
#include "support/debug.h"
#include <boost/assert.hpp>
#include "support/assert.h"
#include <ostream>
@ -69,7 +69,7 @@ LyXErr & operator<<(LyXErr & os, DocIterator const & it)
Inset * DocIterator::nextInset() const
{
BOOST_ASSERT(!empty());
LASSERT(!empty(), /**/);
if (pos() == lastpos())
return 0;
if (pos() > lastpos()) {
@ -84,7 +84,7 @@ Inset * DocIterator::nextInset() const
Inset * DocIterator::prevInset() const
{
BOOST_ASSERT(!empty());
LASSERT(!empty(), /**/);
if (pos() == 0)
return 0;
if (inMathed()) {
@ -102,7 +102,7 @@ Inset * DocIterator::prevInset() const
Inset * DocIterator::realInset() const
{
BOOST_ASSERT(inTexted());
LASSERT(inTexted(), /**/);
// if we are in a tabular, we need the cell
if (inset().lyxCode() == TABULAR_CODE) {
InsetTabular & tabular = static_cast<InsetTabular&>(inset());
@ -114,24 +114,24 @@ Inset * DocIterator::realInset() const
MathAtom & DocIterator::prevAtom() const
{
BOOST_ASSERT(!empty());
BOOST_ASSERT(pos() > 0);
LASSERT(!empty(), /**/);
LASSERT(pos() > 0, /**/);
return cell()[pos() - 1];
}
MathAtom & DocIterator::nextAtom() const
{
BOOST_ASSERT(!empty());
LASSERT(!empty(), /**/);
//lyxerr << "lastpos: " << lastpos() << " next atom:\n" << *this << endl;
BOOST_ASSERT(pos() < lastpos());
LASSERT(pos() < lastpos(), /**/);
return cell()[pos()];
}
Text * DocIterator::text() const
{
BOOST_ASSERT(!empty());
LASSERT(!empty(), /**/);
return top().text();
}
@ -140,21 +140,21 @@ Paragraph & DocIterator::paragraph() const
{
if (!inTexted())
LYXERR0(*this);
BOOST_ASSERT(inTexted());
LASSERT(inTexted(), /**/);
return top().paragraph();
}
Paragraph & DocIterator::innerParagraph() const
{
BOOST_ASSERT(!empty());
LASSERT(!empty(), /**/);
return innerTextSlice().paragraph();
}
CursorSlice const & DocIterator::innerTextSlice() const
{
BOOST_ASSERT(!empty());
LASSERT(!empty(), /**/);
// go up until first non-0 text is hit
// (innermost text is 0 in mathed)
for (int i = depth() - 1; i >= 0; --i)
@ -163,7 +163,7 @@ CursorSlice const & DocIterator::innerTextSlice() const
// This case is in principe not possible. We _must_
// be inside a Text.
BOOST_ASSERT(false);
LASSERT(false, /**/);
static CursorSlice dummy;
return dummy;
}
@ -222,14 +222,14 @@ DocIterator::col_type DocIterator::col() const
MathData & DocIterator::cell() const
{
// BOOST_ASSERT(inMathed());
// LASSERT(inMathed(), /**/);
return top().cell();
}
Text * DocIterator::innerText() const
{
BOOST_ASSERT(!empty());
LASSERT(!empty(), /**/);
// go up until first non-0 text is hit
// (innermost text is 0 in mathed)
for (int i = depth() - 1; i >= 0; --i)
@ -416,7 +416,7 @@ void DocIterator::updateInsets(Inset * inset)
size_t const n = slices_.size();
slices_.resize(0);
for (size_t i = 0 ; i < n; ++i) {
BOOST_ASSERT(inset);
LASSERT(inset, /**/);
push_back(dit[i]);
top().inset_ = inset;
if (i + 1 != n)

View File

@ -34,7 +34,7 @@
#include "support/ExceptionMessage.h"
#include "support/FileZipListDir.h"
#include <boost/assert.hpp>
#include "support/assert.h"
#include <sstream>
#include <fstream>
@ -71,7 +71,7 @@ void EmbeddedFile::setInzipName(std::string const & name)
return;
// an enabled EmbeededFile should have this problem handled
BOOST_ASSERT(!isEnabled());
LASSERT(!isEnabled(), /**/);
// file will be synced when it is enabled
inzip_name_ = name;
}
@ -79,7 +79,7 @@ void EmbeddedFile::setInzipName(std::string const & name)
string EmbeddedFile::embeddedFile() const
{
BOOST_ASSERT(isEnabled());
LASSERT(isEnabled(), /**/);
return temp_path_ + inzip_name_;
}
@ -142,7 +142,7 @@ void EmbeddedFile::enable(bool enabled, Buffer const & buf, bool updateFile)
bool EmbeddedFile::extract() const
{
BOOST_ASSERT(isEnabled());
LASSERT(isEnabled(), /**/);
string ext_file = absFilename();
string emb_file = embeddedFile();
@ -201,7 +201,7 @@ bool EmbeddedFile::extract() const
bool EmbeddedFile::updateFromExternalFile() const
{
BOOST_ASSERT(isEnabled());
LASSERT(isEnabled(), /**/);
string ext_file = absFilename();
string emb_file = embeddedFile();
@ -391,7 +391,7 @@ std::string EmbeddedFile::calcInzipName(std::string const & buffer_path)
void EmbeddedFile::syncInzipFile(std::string const & buffer_path)
{
BOOST_ASSERT(isEnabled());
LASSERT(isEnabled(), /**/);
string old_emb_file = temp_path_ + '/' + inzip_name_;
FileName old_emb(old_emb_file);
@ -490,7 +490,7 @@ void EmbeddedFileList::enable(bool enabled, Buffer & buffer, bool updateFile)
void EmbeddedFileList::registerFile(EmbeddedFile const & file,
Inset const * inset, Buffer const & buffer)
{
BOOST_ASSERT(!buffer.embedded() || file.isEnabled());
LASSERT(!buffer.embedded() || file.isEnabled(), /**/);
string newfile = file.absFilename();
iterator efp = findFile(newfile);

View File

@ -26,6 +26,7 @@
#include "output_latex.h"
#include "OutputParams.h"
#include "support/assert.h"
#include "support/convert.h"
#include "support/debug.h"
#include "support/gettext.h"
@ -623,7 +624,7 @@ int Font::latexWriteEndChanges(odocstream & os, BufferParams const & bparams,
Encoding const * const ascii = encodings.fromLyXName("ascii");
pair<bool, int> const c = switchEncoding(os, bparams,
runparams, *ascii);
BOOST_ASSERT(c.first);
LASSERT(c.first, /**/);
count += c.second;
runparams.encoding = ascii;
open_encoding_ = false;

View File

@ -13,7 +13,7 @@
#include "InsetIterator.h"
#include <boost/assert.hpp>
#include "support/assert.h"
namespace lyx {

View File

@ -18,6 +18,7 @@
#include "Lexer.h"
#include "TextClass.h"
#include "support/assert.h"
#include "support/debug.h"
#include "support/FileName.h"
#include "support/filetools.h"
@ -68,7 +69,7 @@ bool LayoutFileList::haveClass(string const & classname) const
LayoutFile const & LayoutFileList::operator[](string const & classname) const
{
BOOST_ASSERT(haveClass(classname));
LASSERT(haveClass(classname), /**/);
return *classmap_[classname];
}
@ -76,7 +77,7 @@ LayoutFile const & LayoutFileList::operator[](string const & classname) const
LayoutFile &
LayoutFileList::operator[](string const & classname)
{
BOOST_ASSERT(haveClass(classname));
LASSERT(haveClass(classname), /**/);
return *classmap_[classname];
}
@ -175,7 +176,7 @@ std::vector<LayoutFileIndex> LayoutFileList::classList() const
void LayoutFileList::reset(LayoutFileIndex const & classname) {
BOOST_ASSERT(haveClass(classname));
LASSERT(haveClass(classname), /**/);
LayoutFile * tc = classmap_[classname];
LayoutFile * tmpl =
new LayoutFile(tc->name(), tc->latexname(), tc->description(),
@ -227,7 +228,7 @@ LayoutFileIndex
smatch sub;
if (regex_match(line, sub, reg)) {
// returns: whole string, classtype (not used here), class name, description
BOOST_ASSERT(sub.size() == 4);
LASSERT(sub.size() == 4, /**/);
// now, create a TextClass with description containing path information
string className(sub.str(2) == "" ? textclass : sub.str(2));
LayoutFile * tmpl =

View File

@ -45,6 +45,7 @@
#include "frontends/alert.h"
#include "frontends/Application.h"
#include "support/assert.h"
#include "support/debug.h"
#include "support/environment.h"
#include "support/ExceptionMessage.h"
@ -204,14 +205,14 @@ void LyX::exit(int exit_code) const
LyX & LyX::ref()
{
BOOST_ASSERT(singleton_);
LASSERT(singleton_, /**/);
return *singleton_;
}
LyX const & LyX::cref()
{
BOOST_ASSERT(singleton_);
LASSERT(singleton_, /**/);
return *singleton_;
}
@ -238,14 +239,14 @@ BufferList const & LyX::bufferList() const
Session & LyX::session()
{
BOOST_ASSERT(pimpl_->session_.get());
LASSERT(pimpl_->session_.get(), /**/);
return *pimpl_->session_.get();
}
Session const & LyX::session() const
{
BOOST_ASSERT(pimpl_->session_.get());
LASSERT(pimpl_->session_.get(), /**/);
return *pimpl_->session_.get();
}
@ -264,42 +265,42 @@ LyXFunc const & LyX::lyxFunc() const
Server & LyX::server()
{
BOOST_ASSERT(pimpl_->lyx_server_.get());
LASSERT(pimpl_->lyx_server_.get(), /**/);
return *pimpl_->lyx_server_.get();
}
Server const & LyX::server() const
{
BOOST_ASSERT(pimpl_->lyx_server_.get());
LASSERT(pimpl_->lyx_server_.get(), /**/);
return *pimpl_->lyx_server_.get();
}
ServerSocket & LyX::socket()
{
BOOST_ASSERT(pimpl_->lyx_socket_.get());
LASSERT(pimpl_->lyx_socket_.get(), /**/);
return *pimpl_->lyx_socket_.get();
}
ServerSocket const & LyX::socket() const
{
BOOST_ASSERT(pimpl_->lyx_socket_.get());
LASSERT(pimpl_->lyx_socket_.get(), /**/);
return *pimpl_->lyx_socket_.get();
}
frontend::Application & LyX::application()
{
BOOST_ASSERT(pimpl_->application_.get());
LASSERT(pimpl_->application_.get(), /**/);
return *pimpl_->application_.get();
}
frontend::Application const & LyX::application() const
{
BOOST_ASSERT(pimpl_->application_.get());
LASSERT(pimpl_->application_.get(), /**/);
return *pimpl_->application_.get();
}
@ -332,7 +333,7 @@ Messages & LyX::getMessages(string const & language)
pair<map<string, Messages>::iterator, bool> result =
pimpl_->messages_.insert(make_pair(language, Messages(language)));
BOOST_ASSERT(result.second);
LASSERT(result.second, /**/);
return result.first->second;
}
@ -478,7 +479,7 @@ void LyX::prepareExit()
void LyX::earlyExit(int status)
{
BOOST_ASSERT(pimpl_->application_.get());
LASSERT(pimpl_->application_.get(), /**/);
// LyX::pimpl_::application_ is not initialised at this
// point so it's safe to just exit after some cleanup.
prepareExit();
@ -1326,7 +1327,7 @@ LyXFunc & theLyXFunc()
Server & theServer()
{
// FIXME: this should not be use_gui dependent
BOOST_ASSERT(use_gui);
LASSERT(use_gui, /**/);
return LyX::ref().server();
}
@ -1334,7 +1335,7 @@ Server & theServer()
ServerSocket & theServerSocket()
{
// FIXME: this should not be use_gui dependent
BOOST_ASSERT(use_gui);
LASSERT(use_gui, /**/);
return LyX::ref().socket();
}

View File

@ -20,7 +20,7 @@
#include "support/debug.h"
#include "support/lstrings.h"
#include <boost/assert.hpp>
#include "support/assert.h"
using namespace std;
using namespace lyx::support;
@ -1897,7 +1897,7 @@ bool LyXAction::funcHasFlag(FuncCode action,
if (ici == lyx_info_map.end()) {
LYXERR0("action: " << action << " is not known.");
BOOST_ASSERT(false);
LASSERT(false, /**/);
}
return ici->second.attrib & flag;

View File

@ -153,9 +153,9 @@ bool getLocalStatus(Cursor cursor, FuncRequest const & cmd, FuncStatus & status)
bool res = false;
for ( ; cursor.depth(); cursor.pop()) {
//lyxerr << "\nCursor::getStatus: cmd: " << cmd << endl << *this << endl;
BOOST_ASSERT(cursor.idx() <= cursor.lastidx());
BOOST_ASSERT(cursor.pit() <= cursor.lastpit());
BOOST_ASSERT(cursor.pos() <= cursor.lastpos());
LASSERT(cursor.idx() <= cursor.lastidx(), /**/);
LASSERT(cursor.pit() <= cursor.lastpit(), /**/);
LASSERT(cursor.pos() <= cursor.lastpos(), /**/);
// The inset's getStatus() will return 'true' if it made
// a definitive decision on whether it want to handle the
@ -224,7 +224,7 @@ void LyXFunc::handleKeyFunc(FuncCode action)
if (keyseq.length())
c = 0;
BOOST_ASSERT(lyx_view_ && lyx_view_->view());
LASSERT(lyx_view_ && lyx_view_->view(), /**/);
lyx_view_->view()->getIntl().getTransManager().deadkey(
c, get_accent(action).accent, view()->cursor().innerText(), view()->cursor());
// Need to clear, in case the minibuffer calls these
@ -239,11 +239,11 @@ void LyXFunc::handleKeyFunc(FuncCode action)
// to GuiView and be GuiView and be window dependent.
void LyXFunc::gotoBookmark(unsigned int idx, bool openFile, bool switchToBuffer)
{
BOOST_ASSERT(lyx_view_);
LASSERT(lyx_view_, /**/);
if (!LyX::ref().session().bookmarks().isValid(idx))
return;
BookmarksSection::Bookmark const & bm = LyX::ref().session().bookmarks().bookmark(idx);
BOOST_ASSERT(!bm.filename.empty());
LASSERT(!bm.filename.empty(), /**/);
string const file = bm.filename.absFilename();
// if the file is not opened, open it.
if (!theBufferList().exists(file)) {
@ -763,7 +763,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
case LFUN_WORD_FIND_FORWARD:
case LFUN_WORD_FIND_BACKWARD: {
BOOST_ASSERT(lyx_view_ && lyx_view_->view());
LASSERT(lyx_view_ && lyx_view_->view(), /**/);
static docstring last_search;
docstring searched_string;
@ -785,12 +785,12 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
}
case LFUN_COMMAND_PREFIX:
BOOST_ASSERT(lyx_view_);
LASSERT(lyx_view_, /**/);
lyx_view_->message(keyseq.printOptions(true));
break;
case LFUN_CANCEL:
BOOST_ASSERT(lyx_view_ && lyx_view_->view());
LASSERT(lyx_view_ && lyx_view_->view(), /**/);
keyseq.reset();
meta_fake_bit = NoModifier;
if (lyx_view_->buffer())
@ -805,7 +805,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
break;
case LFUN_BUFFER_TOGGLE_READ_ONLY: {
BOOST_ASSERT(lyx_view_ && lyx_view_->view() && lyx_view_->buffer());
LASSERT(lyx_view_ && lyx_view_->view() && lyx_view_->buffer(), /**/);
Buffer * buf = lyx_view_->buffer();
if (buf->lyxvc().inUse())
buf->lyxvc().toggleReadOnly();
@ -821,7 +821,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
break;
case LFUN_BUFFER_RELOAD: {
BOOST_ASSERT(lyx_view_ && lyx_view_->buffer());
LASSERT(lyx_view_ && lyx_view_->buffer(), /**/);
docstring const file = makeDisplayPath(lyx_view_->buffer()->absFileName(), 20);
docstring text = bformat(_("Any changes will be lost. Are you sure "
"you want to revert to the saved version of the document %1$s?"), file);
@ -834,37 +834,37 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
}
case LFUN_BUFFER_UPDATE:
BOOST_ASSERT(lyx_view_ && lyx_view_->buffer());
LASSERT(lyx_view_ && lyx_view_->buffer(), /**/);
lyx_view_->buffer()->doExport(argument, true);
break;
case LFUN_BUFFER_VIEW:
BOOST_ASSERT(lyx_view_ && lyx_view_->buffer());
LASSERT(lyx_view_ && lyx_view_->buffer(), /**/);
lyx_view_->buffer()->preview(argument);
break;
case LFUN_MASTER_BUFFER_UPDATE:
BOOST_ASSERT(lyx_view_ && lyx_view_->buffer() && lyx_view_->buffer()->masterBuffer());
LASSERT(lyx_view_ && lyx_view_->buffer() && lyx_view_->buffer()->masterBuffer(), /**/);
lyx_view_->buffer()->masterBuffer()->doExport(argument, true);
break;
case LFUN_MASTER_BUFFER_VIEW:
BOOST_ASSERT(lyx_view_ && lyx_view_->buffer() && lyx_view_->buffer()->masterBuffer());
LASSERT(lyx_view_ && lyx_view_->buffer() && lyx_view_->buffer()->masterBuffer(), /**/);
lyx_view_->buffer()->masterBuffer()->preview(argument);
break;
case LFUN_BUILD_PROGRAM:
BOOST_ASSERT(lyx_view_ && lyx_view_->buffer());
LASSERT(lyx_view_ && lyx_view_->buffer(), /**/);
lyx_view_->buffer()->doExport("program", true);
break;
case LFUN_BUFFER_CHKTEX:
BOOST_ASSERT(lyx_view_ && lyx_view_->buffer());
LASSERT(lyx_view_ && lyx_view_->buffer(), /**/);
lyx_view_->buffer()->runChktex();
break;
case LFUN_BUFFER_EXPORT:
BOOST_ASSERT(lyx_view_ && lyx_view_->buffer());
LASSERT(lyx_view_ && lyx_view_->buffer(), /**/);
if (argument == "custom")
dispatch(FuncRequest(LFUN_DIALOG_SHOW, "sendto"));
else
@ -872,7 +872,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
break;
case LFUN_BUFFER_EXPORT_CUSTOM: {
BOOST_ASSERT(lyx_view_ && lyx_view_->buffer());
LASSERT(lyx_view_ && lyx_view_->buffer(), /**/);
string format_name;
string command = split(argument, format_name, ' ');
Format const * format = formats.getFormat(format_name);
@ -914,7 +914,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
}
case LFUN_BUFFER_PRINT: {
BOOST_ASSERT(lyx_view_ && lyx_view_->buffer());
LASSERT(lyx_view_ && lyx_view_->buffer(), /**/);
// FIXME: cmd.getArg() might fail if one of the arguments
// contains double quotes
string target = cmd.getArg(0);
@ -1037,7 +1037,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
break;
case LFUN_HELP_OPEN: {
BOOST_ASSERT(lyx_view_);
LASSERT(lyx_view_, /**/);
string const arg = argument;
if (arg.empty()) {
setErrorMessage(from_ascii(N_("Missing argument")));
@ -1063,7 +1063,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
// --- version control -------------------------------
case LFUN_VC_REGISTER:
BOOST_ASSERT(lyx_view_ && lyx_view_->buffer());
LASSERT(lyx_view_ && lyx_view_->buffer(), /**/);
if (!ensureBufferClean(view()))
break;
if (!lyx_view_->buffer()->lyxvc().inUse()) {
@ -1074,7 +1074,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
break;
case LFUN_VC_CHECK_IN:
BOOST_ASSERT(lyx_view_ && lyx_view_->buffer());
LASSERT(lyx_view_ && lyx_view_->buffer(), /**/);
if (!ensureBufferClean(view()))
break;
if (lyx_view_->buffer()->lyxvc().inUse()
@ -1085,7 +1085,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
break;
case LFUN_VC_CHECK_OUT:
BOOST_ASSERT(lyx_view_ && lyx_view_->buffer());
LASSERT(lyx_view_ && lyx_view_->buffer(), /**/);
if (!ensureBufferClean(view()))
break;
if (lyx_view_->buffer()->lyxvc().inUse()
@ -1096,20 +1096,20 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
break;
case LFUN_VC_REVERT:
BOOST_ASSERT(lyx_view_ && lyx_view_->buffer());
LASSERT(lyx_view_ && lyx_view_->buffer(), /**/);
lyx_view_->buffer()->lyxvc().revert();
reloadBuffer();
break;
case LFUN_VC_UNDO_LAST:
BOOST_ASSERT(lyx_view_ && lyx_view_->buffer());
LASSERT(lyx_view_ && lyx_view_->buffer(), /**/);
lyx_view_->buffer()->lyxvc().undoLast();
reloadBuffer();
break;
// --- lyxserver commands ----------------------------
case LFUN_SERVER_GET_NAME:
BOOST_ASSERT(lyx_view_ && lyx_view_->buffer());
LASSERT(lyx_view_ && lyx_view_->buffer(), /**/);
setMessage(from_utf8(lyx_view_->buffer()->absFileName()));
LYXERR(Debug::INFO, "FNAME["
<< lyx_view_->buffer()->absFileName() << ']');
@ -1121,7 +1121,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
break;
case LFUN_SERVER_GOTO_FILE_ROW: {
BOOST_ASSERT(lyx_view_);
LASSERT(lyx_view_, /**/);
string file_name;
int row;
istringstream is(argument);
@ -1161,7 +1161,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
case LFUN_DIALOG_SHOW_NEW_INSET: {
BOOST_ASSERT(lyx_view_);
LASSERT(lyx_view_, /**/);
string const name = cmd.getArg(0);
InsetCode code = insetCode(name);
string data = trim(to_utf8(cmd.argument()).substr(name.size()));
@ -1263,7 +1263,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
}
case LFUN_CITATION_INSERT: {
BOOST_ASSERT(lyx_view_);
LASSERT(lyx_view_, /**/);
if (!argument.empty()) {
// we can have one optional argument, delimited by '|'
// citation-insert <key>|<text_before>
@ -1288,7 +1288,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
}
case LFUN_BUFFER_CHILD_OPEN: {
BOOST_ASSERT(lyx_view_ && lyx_view_->buffer());
LASSERT(lyx_view_ && lyx_view_->buffer(), /**/);
Buffer * parent = lyx_view_->buffer();
FileName filename = makeAbsPath(argument, parent->filePath());
view()->saveBookmark(false);
@ -1322,27 +1322,27 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
}
case LFUN_CURSOR_FOLLOWS_SCROLLBAR_TOGGLE:
BOOST_ASSERT(lyx_view_);
LASSERT(lyx_view_, /**/);
lyxrc.cursor_follows_scrollbar = !lyxrc.cursor_follows_scrollbar;
break;
case LFUN_KEYMAP_OFF:
BOOST_ASSERT(lyx_view_ && lyx_view_->view());
LASSERT(lyx_view_ && lyx_view_->view(), /**/);
lyx_view_->view()->getIntl().keyMapOn(false);
break;
case LFUN_KEYMAP_PRIMARY:
BOOST_ASSERT(lyx_view_ && lyx_view_->view());
LASSERT(lyx_view_ && lyx_view_->view(), /**/);
lyx_view_->view()->getIntl().keyMapPrim();
break;
case LFUN_KEYMAP_SECONDARY:
BOOST_ASSERT(lyx_view_ && lyx_view_->view());
LASSERT(lyx_view_ && lyx_view_->view(), /**/);
lyx_view_->view()->getIntl().keyMapSec();
break;
case LFUN_KEYMAP_TOGGLE:
BOOST_ASSERT(lyx_view_ && lyx_view_->view());
LASSERT(lyx_view_ && lyx_view_->view(), /**/);
lyx_view_->view()->getIntl().toggleKeyMap();
break;
@ -1436,13 +1436,13 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
}
case LFUN_MESSAGE:
BOOST_ASSERT(lyx_view_);
LASSERT(lyx_view_, /**/);
lyx_view_->message(from_utf8(argument));
break;
case LFUN_ALL_INSETS_TOGGLE: {
BOOST_ASSERT(lyx_view_);
LASSERT(lyx_view_, /**/);
string action;
string const name = split(argument, action, ' ');
InsetCode const inset_code = insetCode(name);
@ -1467,7 +1467,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
}
case LFUN_BUFFER_LANGUAGE: {
BOOST_ASSERT(lyx_view_);
LASSERT(lyx_view_, /**/);
Buffer & buffer = *lyx_view_->buffer();
Language const * oldL = buffer.params().language;
Language const * newL = languages.getLanguage(argument);
@ -1507,7 +1507,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
}
case LFUN_BUFFER_PARAMS_APPLY: {
BOOST_ASSERT(lyx_view_);
LASSERT(lyx_view_, /**/);
Buffer * buffer = lyx_view_->buffer();
DocumentClass * oldClass = buffer->params().documentClassPtr();
@ -1537,7 +1537,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
}
case LFUN_LAYOUT_MODULES_CLEAR: {
BOOST_ASSERT(lyx_view_);
LASSERT(lyx_view_, /**/);
Buffer * buffer = lyx_view_->buffer();
DocumentClass * oldClass = buffer->params().documentClassPtr();
view()->cursor().recordUndoFullDocument();
@ -1549,7 +1549,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
}
case LFUN_LAYOUT_MODULE_ADD: {
BOOST_ASSERT(lyx_view_);
LASSERT(lyx_view_, /**/);
Buffer * buffer = lyx_view_->buffer();
DocumentClass * oldClass = buffer->params().documentClassPtr();
view()->cursor().recordUndoFullDocument();
@ -1561,7 +1561,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
}
case LFUN_TEXTCLASS_APPLY: {
BOOST_ASSERT(lyx_view_);
LASSERT(lyx_view_, /**/);
Buffer * buffer = lyx_view_->buffer();
if (!loadLayoutFile(argument, buffer->temppath()) &&
@ -1586,7 +1586,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
}
case LFUN_LAYOUT_RELOAD: {
BOOST_ASSERT(lyx_view_);
LASSERT(lyx_view_, /**/);
Buffer * buffer = lyx_view_->buffer();
DocumentClass * oldClass = buffer->params().documentClassPtr();
LayoutFileIndex bc = buffer->params().baseClassID();
@ -1639,7 +1639,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
break;
default:
BOOST_ASSERT(theApp());
LASSERT(theApp(), /**/);
// Let the frontend dispatch its own actions.
if (theApp()->dispatch(cmd))
// Nothing more to do.
@ -1656,7 +1656,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
break;
}
BOOST_ASSERT(lyx_view_->view());
LASSERT(lyx_view_->view(), /**/);
// Let the current BufferView dispatch its own actions.
if (view()->dispatch(cmd)) {
// The BufferView took care of its own updates if needed.
@ -1816,7 +1816,7 @@ docstring LyXFunc::viewStatusMessage()
if (keyseq.length() > 0 && !keyseq.deleted())
return keyseq.printOptions(true);
BOOST_ASSERT(lyx_view_);
LASSERT(lyx_view_, /**/);
if (!lyx_view_->buffer())
return _("Welcome to LyX!");
@ -1826,7 +1826,7 @@ docstring LyXFunc::viewStatusMessage()
BufferView * LyXFunc::view() const
{
BOOST_ASSERT(lyx_view_);
LASSERT(lyx_view_, /**/);
return lyx_view_->view();
}

View File

@ -20,7 +20,7 @@
#include "support/docstring.h"
#include <boost/assert.hpp>
#include "support/assert.h"
using namespace std;

View File

@ -22,7 +22,7 @@ extern "C" {
#include "PSpell.h"
#include "WordLangTuple.h"
#include <boost/assert.hpp>
#include "support/assert.h"
using namespace std;
using namespace lyx::support;
@ -98,14 +98,14 @@ enum PSpell::Result PSpell::check(WordLangTuple const & word)
PspellManager * m = it->second.manager;
int word_ok = pspell_manager_check(m, to_utf8(word.word()).c_str());
BOOST_ASSERT(word_ok != -1);
LASSERT(word_ok != -1, /**/);
if (word_ok) {
res = OK;
} else {
PspellWordList const * sugs =
pspell_manager_suggest(m, to_utf8(word.word()).c_str());
BOOST_ASSERT(sugs != 0);
LASSERT(sugs != 0, /**/);
els = pspell_word_list_elements(sugs);
if (pspell_word_list_empty(sugs))
res = UNKNOWN_WORD;

View File

@ -49,6 +49,7 @@
#include "insets/InsetBibitem.h"
#include "insets/InsetLabel.h"
#include "support/assert.h"
#include "support/convert.h"
#include "support/debug.h"
#include "support/gettext.h"
@ -248,8 +249,8 @@ Paragraph::Private::Private(Private const & p, Paragraph * owner)
bool Paragraph::isChanged(pos_type start, pos_type end) const
{
BOOST_ASSERT(start >= 0 && start <= size());
BOOST_ASSERT(end > start && end <= size() + 1);
LASSERT(start >= 0 && start <= size(), /**/);
LASSERT(end > start && end <= size() + 1, /**/);
return d->changes_.isChanged(start, end);
}
@ -294,7 +295,7 @@ void Paragraph::setChange(Change const & change)
void Paragraph::setChange(pos_type pos, Change const & change)
{
BOOST_ASSERT(pos >= 0 && pos <= size());
LASSERT(pos >= 0 && pos <= size(), /**/);
d->changes_.set(change, pos);
// see comment in setChange(Change const &) above
@ -306,7 +307,7 @@ void Paragraph::setChange(pos_type pos, Change const & change)
Change const & Paragraph::lookupChange(pos_type pos) const
{
BOOST_ASSERT(pos >= 0 && pos <= size());
LASSERT(pos >= 0 && pos <= size(), /**/);
return d->changes_.lookup(pos);
}
@ -314,8 +315,8 @@ Change const & Paragraph::lookupChange(pos_type pos) const
void Paragraph::acceptChanges(BufferParams const & bparams, pos_type start,
pos_type end)
{
BOOST_ASSERT(start >= 0 && start <= size());
BOOST_ASSERT(end > start && end <= size() + 1);
LASSERT(start >= 0 && start <= size(), /**/);
LASSERT(end > start && end <= size() + 1, /**/);
for (pos_type pos = start; pos < end; ++pos) {
switch (lookupChange(pos).type) {
@ -350,8 +351,8 @@ void Paragraph::acceptChanges(BufferParams const & bparams, pos_type start,
void Paragraph::rejectChanges(BufferParams const & bparams,
pos_type start, pos_type end)
{
BOOST_ASSERT(start >= 0 && start <= size());
BOOST_ASSERT(end > start && end <= size() + 1);
LASSERT(start >= 0 && start <= size(), /**/);
LASSERT(end > start && end <= size() + 1, /**/);
for (pos_type pos = start; pos < end; ++pos) {
switch (lookupChange(pos).type) {
@ -386,7 +387,7 @@ void Paragraph::rejectChanges(BufferParams const & bparams,
void Paragraph::Private::insertChar(pos_type pos, char_type c,
Change const & change)
{
BOOST_ASSERT(pos >= 0 && pos <= int(text_.size()));
LASSERT(pos >= 0 && pos <= int(text_.size()), /**/);
// track change
changes_.insert(change, pos);
@ -412,11 +413,11 @@ void Paragraph::Private::insertChar(pos_type pos, char_type c,
void Paragraph::insertInset(pos_type pos, Inset * inset,
Change const & change)
{
BOOST_ASSERT(inset);
BOOST_ASSERT(pos >= 0 && pos <= size());
LASSERT(inset, /**/);
LASSERT(pos >= 0 && pos <= size(), /**/);
d->insertChar(pos, META_INSET, change);
BOOST_ASSERT(d->text_[pos] == META_INSET);
LASSERT(d->text_[pos] == META_INSET, /**/);
// Add a new entry in the insetlist_.
d->insetlist_.insert(inset, pos);
@ -425,7 +426,7 @@ void Paragraph::insertInset(pos_type pos, Inset * inset,
bool Paragraph::eraseChar(pos_type pos, bool trackChanges)
{
BOOST_ASSERT(pos >= 0 && pos <= size());
LASSERT(pos >= 0 && pos <= size(), /**/);
// keep the logic here in sync with the logic of isMergedOnEndOfParDeletion()
@ -474,8 +475,8 @@ bool Paragraph::eraseChar(pos_type pos, bool trackChanges)
int Paragraph::eraseChars(pos_type start, pos_type end, bool trackChanges)
{
BOOST_ASSERT(start >= 0 && start <= size());
BOOST_ASSERT(end >= start && end <= size() + 1);
LASSERT(start >= 0 && start <= size(), /**/);
LASSERT(end >= start && end <= size() + 1, /**/);
pos_type i = start;
for (pos_type count = end - start; count; --count) {
@ -647,7 +648,7 @@ void Paragraph::Private::latexInset(
unsigned int & column)
{
Inset * inset = owner_->getInset(i);
BOOST_ASSERT(inset);
LASSERT(inset, /**/);
if (style.pass_thru) {
inset->plaintext(os, runparams);
@ -1273,7 +1274,7 @@ Font const Paragraph::getFontSettings(BufferParams const & bparams,
{
if (pos > size()) {
LYXERR0("pos: " << pos << " size: " << size());
BOOST_ASSERT(pos <= size());
LASSERT(pos <= size(), /**/);
}
FontList::const_iterator cit = d->fontlist_.fontIterator(pos);
@ -1289,7 +1290,7 @@ Font const Paragraph::getFontSettings(BufferParams const & bparams,
FontSpan Paragraph::fontSpan(pos_type pos) const
{
BOOST_ASSERT(pos <= size());
LASSERT(pos <= size(), /**/);
pos_type start = 0;
FontList::const_iterator cit = d->fontlist_.begin();
@ -1331,7 +1332,7 @@ Font const Paragraph::getFirstFontSettings(BufferParams const & bparams) const
Font const Paragraph::getFont(BufferParams const & bparams, pos_type pos,
Font const & outerfont) const
{
BOOST_ASSERT(pos >= 0);
LASSERT(pos >= 0, /**/);
Font font = getFontSettings(bparams, pos);
@ -1417,7 +1418,7 @@ char_type Paragraph::getUChar(BufferParams const & bparams, pos_type pos) const
void Paragraph::setFont(pos_type pos, Font const & font)
{
BOOST_ASSERT(pos <= size());
LASSERT(pos <= size(), /**/);
// First, reduce font against layout/label font
// Update: The setCharFont() routine in text2.cpp already
@ -2748,7 +2749,7 @@ void Paragraph::registerWords()
void Paragraph::updateWords(CursorSlice const & sl)
{
BOOST_ASSERT(&sl.paragraph() == this);
LASSERT(&sl.paragraph() == this, /**/);
deregisterWords();
collectWords(sl);
registerWords();

View File

@ -42,6 +42,7 @@
#include "insets/InsetBibitem.h"
#include "insets/InsetOptArg.h"
#include "support/assert.h"
#include "support/convert.h"
#include "support/debug.h"
#include "support/gettext.h"
@ -136,7 +137,7 @@ void ParagraphMetrics::setInsetDimension(Inset const * inset,
Row & ParagraphMetrics::getRow(pos_type pos, bool boundary)
{
BOOST_ASSERT(!rows().empty());
LASSERT(!rows().empty(), /**/);
// If boundary is set we should return the row on which
// the character before is inside.
@ -155,7 +156,7 @@ Row & ParagraphMetrics::getRow(pos_type pos, bool boundary)
Row const & ParagraphMetrics::getRow(pos_type pos, bool boundary) const
{
BOOST_ASSERT(!rows().empty());
LASSERT(!rows().empty(), /**/);
// If boundary is set we should return the row on which
// the character before is inside.
@ -174,7 +175,7 @@ Row const & ParagraphMetrics::getRow(pos_type pos, bool boundary) const
size_t ParagraphMetrics::pos2row(pos_type pos) const
{
BOOST_ASSERT(!rows().empty());
LASSERT(!rows().empty(), /**/);
RowList::const_iterator rit = rows_.end();
RowList::const_iterator const begin = rows_.begin();
@ -243,7 +244,7 @@ bool ParagraphMetrics::hfillExpansion(Row const & row, pos_type pos) const
if (!par_->isHfill(pos))
return false;
BOOST_ASSERT(pos >= row.pos() && pos < row.endpos());
LASSERT(pos >= row.pos() && pos < row.endpos(), /**/);
// expand at the end of a row only if there is another hfill on the same row
if (pos == row.endpos() - 1) {

View File

@ -14,7 +14,7 @@
#include "support/lstrings.h"
#include <boost/assert.hpp>
#include "support/assert.h"
using namespace std;
@ -71,13 +71,13 @@ void PrinterParams::testInvariant() const
#ifdef ENABLE_ASSERTIONS
switch (target) {
case PRINTER:
//BOOST_ASSERT(!printer_name.empty());
//LASSERT(!printer_name.empty(), /**/);
break;
case FILE:
BOOST_ASSERT(!file_name.empty());
LASSERT(!file_name.empty(), /**/);
break;
default:
BOOST_ASSERT(false);
LASSERT(false, /**/);
break;
}
#endif

View File

@ -59,6 +59,7 @@
#include "insets/InsetSpecialChar.h"
#include "insets/InsetTabular.h"
#include "support/assert.h"
#include "support/convert.h"
#include "support/debug.h"
#include "support/docstream.h"
@ -340,7 +341,7 @@ double Text::spacing(Buffer const & buffer, Paragraph const & par) const
void Text::breakParagraph(Cursor & cur, bool inverse_logic)
{
BOOST_ASSERT(this == cur.text());
LASSERT(this == cur.text(), /**/);
Paragraph & cpar = cur.paragraph();
pit_type cpit = cur.pit();
@ -417,7 +418,7 @@ void Text::breakParagraph(Cursor & cur, bool inverse_logic)
// same Paragraph one to the right and make a rebreak
void Text::insertChar(Cursor & cur, char_type c)
{
BOOST_ASSERT(this == cur.text());
LASSERT(this == cur.text(), /**/);
cur.recordUndo(INSERT_UNDO);
@ -529,7 +530,7 @@ void Text::insertChar(Cursor & cur, char_type c)
}
return;
}
BOOST_ASSERT(cur.pos() > 0);
LASSERT(cur.pos() > 0, /**/);
if ((par.isLineSeparator(cur.pos() - 1) || par.isNewline(cur.pos() - 1))
&& !par.isDeleted(cur.pos() - 1)) {
static bool sent_space_message = false;
@ -570,7 +571,7 @@ void Text::charInserted(Cursor & cur)
&& par.isLetter(cur.pos() - 2)
&& !par.isLetter(cur.pos() - 1)) {
// get the word in front of cursor
BOOST_ASSERT(this == cur.text());
LASSERT(this == cur.text(), /**/);
cur.paragraph().updateWords(cur.top());
}
}
@ -581,7 +582,7 @@ void Text::charInserted(Cursor & cur)
bool Text::cursorForwardOneWord(Cursor & cur)
{
BOOST_ASSERT(this == cur.text());
LASSERT(this == cur.text(), /**/);
Cursor old = cur;
@ -602,7 +603,7 @@ bool Text::cursorForwardOneWord(Cursor & cur)
bool Text::cursorBackwardOneWord(Cursor & cur)
{
BOOST_ASSERT(this == cur.text());
LASSERT(this == cur.text(), /**/);
Cursor old = cur;
@ -623,7 +624,7 @@ bool Text::cursorBackwardOneWord(Cursor & cur)
void Text::selectWord(Cursor & cur, word_location loc)
{
BOOST_ASSERT(this == cur.text());
LASSERT(this == cur.text(), /**/);
CursorSlice from = cur.top();
CursorSlice to = cur.top();
getWord(from, to, loc);
@ -641,7 +642,7 @@ void Text::selectWord(Cursor & cur, word_location loc)
// selection is currently set
bool Text::selectWordWhenUnderCursor(Cursor & cur, word_location loc)
{
BOOST_ASSERT(this == cur.text());
LASSERT(this == cur.text(), /**/);
if (cur.selection())
return false;
selectWord(cur, loc);
@ -651,7 +652,7 @@ bool Text::selectWordWhenUnderCursor(Cursor & cur, word_location loc)
void Text::acceptOrRejectChanges(Cursor & cur, ChangeOp op)
{
BOOST_ASSERT(this == cur.text());
LASSERT(this == cur.text(), /**/);
if (!cur.selection())
return;
@ -797,7 +798,7 @@ void Text::rejectChanges(BufferParams const & bparams)
void Text::deleteWordForward(Cursor & cur)
{
BOOST_ASSERT(this == cur.text());
LASSERT(this == cur.text(), /**/);
if (cur.lastpos() == 0)
cursorForward(cur);
else {
@ -813,7 +814,7 @@ void Text::deleteWordForward(Cursor & cur)
void Text::deleteWordBackward(Cursor & cur)
{
BOOST_ASSERT(this == cur.text());
LASSERT(this == cur.text(), /**/);
if (cur.lastpos() == 0)
cursorBackward(cur);
else {
@ -830,7 +831,7 @@ void Text::deleteWordBackward(Cursor & cur)
// Kill to end of line.
void Text::changeCase(Cursor & cur, TextCase action)
{
BOOST_ASSERT(this == cur.text());
LASSERT(this == cur.text(), /**/);
CursorSlice from;
CursorSlice to;
@ -912,7 +913,7 @@ bool Text::handleBibitems(Cursor & cur)
bool Text::erase(Cursor & cur)
{
BOOST_ASSERT(this == cur.text());
LASSERT(this == cur.text(), /**/);
bool needsUpdate = false;
Paragraph & par = cur.paragraph();
@ -959,7 +960,7 @@ bool Text::erase(Cursor & cur)
bool Text::backspacePos0(Cursor & cur)
{
BOOST_ASSERT(this == cur.text());
LASSERT(this == cur.text(), /**/);
if (cur.pit() == 0)
return false;
@ -1012,7 +1013,7 @@ bool Text::backspacePos0(Cursor & cur)
bool Text::backspace(Cursor & cur)
{
BOOST_ASSERT(this == cur.text());
LASSERT(this == cur.text(), /**/);
bool needsUpdate = false;
if (cur.pos() == 0) {
if (cur.pit() == 0)
@ -1061,7 +1062,7 @@ bool Text::backspace(Cursor & cur)
bool Text::dissolveInset(Cursor & cur) {
BOOST_ASSERT(this == cur.text());
LASSERT(this == cur.text(), /**/);
if (isMainText(cur.bv().buffer()) || cur.inset().nargs() != 1)
return false;
@ -1214,7 +1215,7 @@ bool Text::read(Buffer const & buf, Lexer & lex,
// Returns the current font and depth as a message.
docstring Text::currentState(Cursor & cur)
{
BOOST_ASSERT(this == cur.text());
LASSERT(this == cur.text(), /**/);
Buffer & buf = cur.buffer();
Paragraph const & par = cur.paragraph();
odocstringstream os;
@ -1370,7 +1371,7 @@ docstring Text::getPossibleLabel(Cursor & cur) const
void Text::charsTranspose(Cursor & cur)
{
BOOST_ASSERT(this == cur.text());
LASSERT(this == cur.text(), /**/);
pos_type pos = cur.pos();
@ -1469,7 +1470,7 @@ CompletionList const * Text::createCompletionList(Cursor const & cur) const
bool Text::insertCompletion(Cursor & cur, docstring const & s, bool /*finished*/)
{
BOOST_ASSERT(cur.bv().cursor() == cur);
LASSERT(cur.bv().cursor() == cur, /**/);
cur.insert(s);
cur.bv().cursor() = cur;
if (!(cur.disp_.update() & Update::Force))

View File

@ -50,6 +50,7 @@
#include "mathed/InsetMathHull.h"
#include "support/assert.h"
#include "support/debug.h"
#include "support/gettext.h"
#include "support/textutils.h"
@ -158,7 +159,7 @@ void Text::setInsetFont(BufferView const & bv, pit_type pit,
pos_type pos, Font const & font, bool toggleall)
{
Inset * const inset = pars_[pit].getInset(pos);
BOOST_ASSERT(inset && inset->noFontChange());
LASSERT(inset && inset->noFontChange(), /**/);
CursorSlice::idx_type endidx = inset->nargs();
for (CursorSlice cs(*inset); cs.idx() != endidx; ++cs.idx()) {
@ -196,7 +197,7 @@ pit_type Text::undoSpan(pit_type pit)
void Text::setLayout(Buffer const & buffer, pit_type start, pit_type end,
docstring const & layout)
{
BOOST_ASSERT(start != end);
LASSERT(start != end, /**/);
BufferParams const & bufparams = buffer.params();
Layout const & lyxlayout = bufparams.documentClass()[layout];
@ -214,7 +215,7 @@ void Text::setLayout(Buffer const & buffer, pit_type start, pit_type end,
// set layout over selection and make a total rebreak of those paragraphs
void Text::setLayout(Cursor & cur, docstring const & layout)
{
BOOST_ASSERT(this == cur.text());
LASSERT(this == cur.text(), /**/);
// special handling of new environment insets
BufferView & bv = cur.bv();
BufferParams const & params = bv.buffer().params();
@ -257,7 +258,7 @@ static bool changeDepthAllowed(Text::DEPTH_CHANGE type,
bool Text::changeDepthAllowed(Cursor & cur, DEPTH_CHANGE type) const
{
BOOST_ASSERT(this == cur.text());
LASSERT(this == cur.text(), /**/);
// this happens when selecting several cells in tabular (bug 2630)
if (cur.selBegin().idx() != cur.selEnd().idx())
return false;
@ -277,7 +278,7 @@ bool Text::changeDepthAllowed(Cursor & cur, DEPTH_CHANGE type) const
void Text::changeDepth(Cursor & cur, DEPTH_CHANGE type)
{
BOOST_ASSERT(this == cur.text());
LASSERT(this == cur.text(), /**/);
pit_type const beg = cur.selBegin().pit();
pit_type const end = cur.selEnd().pit() + 1;
cur.recordUndoSelection();
@ -302,7 +303,7 @@ void Text::changeDepth(Cursor & cur, DEPTH_CHANGE type)
void Text::setFont(Cursor & cur, Font const & font, bool toggleall)
{
BOOST_ASSERT(this == cur.text());
LASSERT(this == cur.text(), /**/);
// Set the current_font
// Determine basis font
FontInfo layoutfont;
@ -369,21 +370,21 @@ void Text::setFont(BufferView const & bv, CursorSlice const & begin,
bool Text::cursorTop(Cursor & cur)
{
BOOST_ASSERT(this == cur.text());
LASSERT(this == cur.text(), /**/);
return setCursor(cur, 0, 0);
}
bool Text::cursorBottom(Cursor & cur)
{
BOOST_ASSERT(this == cur.text());
LASSERT(this == cur.text(), /**/);
return setCursor(cur, cur.lastpit(), boost::prior(paragraphs().end())->size());
}
void Text::toggleFree(Cursor & cur, Font const & font, bool toggleall)
{
BOOST_ASSERT(this == cur.text());
LASSERT(this == cur.text(), /**/);
// If the mask is completely neutral, tell user
if (font.fontInfo() == ignore_font &&
(font.language() == 0 || font.language() == ignore_language)) {
@ -416,7 +417,7 @@ void Text::toggleFree(Cursor & cur, Font const & font, bool toggleall)
docstring Text::getStringToIndex(Cursor const & cur)
{
BOOST_ASSERT(this == cur.text());
LASSERT(this == cur.text(), /**/);
if (cur.selection())
return cur.selectionAsString(false);
@ -440,7 +441,7 @@ docstring Text::getStringToIndex(Cursor const & cur)
void Text::setParagraphs(Cursor & cur, docstring arg, bool merge)
{
BOOST_ASSERT(cur.text());
LASSERT(cur.text(), /**/);
// make sure that the depth behind the selection are restored, too
pit_type undopit = undoSpan(cur.selEnd().pit());
recUndo(cur, cur.selBegin().pit(), undopit - 1);
@ -462,7 +463,7 @@ void Text::setParagraphs(Cursor & cur, docstring arg, bool merge)
//quite so much.
void Text::setParagraphs(Cursor & cur, ParagraphParameters const & p)
{
BOOST_ASSERT(cur.text());
LASSERT(cur.text(), /**/);
// make sure that the depth behind the selection are restored, too
pit_type undopit = undoSpan(cur.selEnd().pit());
recUndo(cur, cur.selBegin().pit(), undopit - 1);
@ -478,8 +479,8 @@ void Text::setParagraphs(Cursor & cur, ParagraphParameters const & p)
// this really should just insert the inset and not move the cursor.
void Text::insertInset(Cursor & cur, Inset * inset)
{
BOOST_ASSERT(this == cur.text());
BOOST_ASSERT(inset);
LASSERT(this == cur.text(), /**/);
LASSERT(inset, /**/);
cur.paragraph().insertInset(cur.pos(), inset, cur.current_font,
Change(cur.buffer().params().trackChanges
? Change::INSERTED : Change::UNCHANGED));
@ -534,7 +535,7 @@ bool Text::setCursor(Cursor & cur, pit_type par, pos_type pos,
void Text::setCursor(CursorSlice & cur, pit_type par, pos_type pos)
{
BOOST_ASSERT(par != int(paragraphs().size()));
LASSERT(par != int(paragraphs().size()), /**/);
cur.pit() = par;
cur.pos() = pos;
@ -544,14 +545,14 @@ void Text::setCursor(CursorSlice & cur, pit_type par, pos_type pos)
// None of these should happen, but we're scaredy-cats
if (pos < 0) {
lyxerr << "dont like -1" << endl;
BOOST_ASSERT(false);
LASSERT(false, /**/);
}
if (pos > para.size()) {
lyxerr << "dont like 1, pos: " << pos
<< " size: " << para.size()
<< " par: " << par << endl;
BOOST_ASSERT(false);
LASSERT(false, /**/);
}
}
@ -559,7 +560,7 @@ void Text::setCursor(CursorSlice & cur, pit_type par, pos_type pos)
void Text::setCursorIntern(Cursor & cur,
pit_type par, pos_type pos, bool setfont, bool boundary)
{
BOOST_ASSERT(this == cur.text());
LASSERT(this == cur.text(), /**/);
cur.boundary(boundary);
setCursor(cur.top(), par, pos);
if (setfont)
@ -1040,7 +1041,7 @@ bool Text::deleteEmptyParagraphMechanism(Cursor & cur,
void Text::deleteEmptyParagraphMechanism(pit_type first, pit_type last, bool trackChanges)
{
BOOST_ASSERT(first >= 0 && first <= last && last < (int) pars_.size());
LASSERT(first >= 0 && first <= last && last < (int) pars_.size(), /**/);
for (pit_type pit = first; pit <= last; ++pit) {
Paragraph & par = pars_[pit];

View File

@ -131,7 +131,7 @@ static void mathDispatch(Cursor & cur, FuncRequest const & cmd, bool display)
const int old_pos = cur.pos();
#endif
cur.insert(new InsetMathHull(hullSimple));
BOOST_ASSERT(old_pos == cur.pos());
LASSERT(old_pos == cur.pos(), /**/);
cur.nextInset()->edit(cur, true);
// don't do that also for LFUN_MATH_MODE
// unless you want end up with always changing
@ -390,7 +390,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
// at the end?
cur.noUpdate();
BOOST_ASSERT(cur.text() == this);
LASSERT(cur.text() == this, /**/);
CursorSlice oldTopSlice = cur.top();
bool oldBoundary = cur.boundary();
bool sel = cur.selection();
@ -924,7 +924,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
else if (arg == "linkback")
type = Clipboard::LinkBackGraphicsType;
else
BOOST_ASSERT(false);
LASSERT(false, /**/);
pasteClipboardGraphics(cur, bv->buffer().errorList("Paste"), type);
}
@ -1487,7 +1487,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
cap::replaceSelection(cur);
cur.insert(new InsetMathHull(hullSimple));
checkAndActivateInset(cur, true);
BOOST_ASSERT(cur.inMathed());
LASSERT(cur.inMathed(), /**/);
cur.dispatch(cmd);
break;
}
@ -1827,7 +1827,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & flag) const
{
BOOST_ASSERT(cur.text() == this);
LASSERT(cur.text() == this, /**/);
Font const & font = cur.real_current_font;
FontInfo const & fontinfo = font.fontInfo();

View File

@ -27,6 +27,7 @@
#include "frontends/alert.h"
#include "support/assert.h"
#include "support/debug.h"
#include "support/ExceptionMessage.h"
#include "support/FileName.h"
@ -39,8 +40,6 @@
#include <fstream>
#include <sstream>
#include "boost/assert.hpp"
using namespace std;
using namespace lyx::support;
@ -254,7 +253,7 @@ bool TextClass::read(FileName const & filename, ReadType rt)
if (!readStyle(lex, lay)) {
// The only way this happens is because the hardcoded layout above
// is wrong.
BOOST_ASSERT(false);
LASSERT(false, /**/);
};
layoutlist_.push_back(lay);
}
@ -921,7 +920,7 @@ bool TextClass::hasLayout(docstring const & n) const
Layout const & TextClass::operator[](docstring const & name) const
{
BOOST_ASSERT(!name.empty());
LASSERT(!name.empty(), /**/);
const_iterator it =
find_if(begin(), end(), LayoutNamesEqual(name));
@ -934,7 +933,7 @@ Layout const & TextClass::operator[](docstring const & name) const
lyxerr << " " << to_utf8(cit->name()) << endl;
// we require the name to exist
BOOST_ASSERT(false);
LASSERT(false, /**/);
}
return *it;
@ -943,7 +942,7 @@ Layout const & TextClass::operator[](docstring const & name) const
Layout & TextClass::operator[](docstring const & name)
{
BOOST_ASSERT(!name.empty());
LASSERT(!name.empty(), /**/);
iterator it = find_if(begin(), end(), LayoutNamesEqual(name));
@ -954,7 +953,7 @@ Layout & TextClass::operator[](docstring const & name)
LYXERR0(" " << to_utf8(cit->name()));
// we require the name to exist
BOOST_ASSERT(false);
LASSERT(false, /**/);
}
return *it;

View File

@ -49,7 +49,7 @@
#include "support/debug.h"
#include <cstdlib>
#include <boost/assert.hpp>
#include "support/assert.h"
using namespace std;
@ -124,7 +124,7 @@ static int numberOfHfills(Paragraph const & par, Row const & row)
TextMetrics::TextMetrics(BufferView * bv, Text * text)
: bv_(bv), text_(text)
{
BOOST_ASSERT(bv_);
LASSERT(bv_, /**/);
max_width_ = bv_->workWidth();
dim_.wid = max_width_;
dim_.asc = 10;
@ -187,7 +187,7 @@ int TextMetrics::parPosition(pit_type pit) const
bool TextMetrics::metrics(MetricsInfo & mi, Dimension & dim, int min_width)
{
BOOST_ASSERT(mi.base.textwidth);
LASSERT(mi.base.textwidth, /**/);
max_width_ = mi.base.textwidth;
// backup old dimension.
Dimension const old_dim = dim_;
@ -249,7 +249,7 @@ void TextMetrics::applyOuterFont(Font & font) const
Font TextMetrics::displayFont(pit_type pit, pos_type pos) const
{
BOOST_ASSERT(pos >= 0);
LASSERT(pos >= 0, /**/);
ParagraphList const & pars = text_->paragraphs();
Paragraph const & par = pars[pit];
@ -392,7 +392,7 @@ bool TextMetrics::redoParagraph(pit_type const pit)
<< " the context is better then.");
updateLabels(bv_->buffer());
parPos = text_->macrocontextPosition();
BOOST_ASSERT(!parPos.empty());
LASSERT(!parPos.empty(), /**/);
parPos.pit() = pit;
}
@ -501,7 +501,7 @@ void TextMetrics::computeRowMetrics(pit_type const pit,
double w = width - row.width();
// FIXME: put back this assertion when the crash on new doc is solved.
//BOOST_ASSERT(w >= 0);
//LASSERT(w >= 0, /**/);
//lyxerr << "\ndim_.wid " << dim_.wid << endl;
//lyxerr << "row.width() " << row.width() << endl;
@ -647,7 +647,7 @@ int TextMetrics::labelFill(pit_type const pit, Row const & row) const
Paragraph const & par = text_->getPar(pit);
pos_type last = par.beginOfBody();
BOOST_ASSERT(last > 0);
LASSERT(last > 0, /**/);
// -1 because a label ends with a space that is in the label
--last;
@ -1184,7 +1184,7 @@ pos_type TextMetrics::getColumnNearX(pit_type const pit,
left_side = true;
}
BOOST_ASSERT(vc <= end); // This shouldn't happen.
LASSERT(vc <= end, /**/); // This shouldn't happen.
boundary = false;
// This (rtl_support test) is not needed, but gives
@ -1263,7 +1263,7 @@ pos_type TextMetrics::x2pos(pit_type pit, int row, int x) const
// upDownInText() while in selection mode.
ParagraphMetrics const & pm = parMetrics(pit);
BOOST_ASSERT(row < int(pm.rows().size()));
LASSERT(row < int(pm.rows().size()), /**/);
bool bound = false;
Row const & r = pm.rows()[row];
return r.pos() + getColumnNearX(pit, r, x, bound);
@ -1300,7 +1300,7 @@ void TextMetrics::newParMetricsUp()
// y is screen coordinate
pit_type TextMetrics::getPitNearY(int y)
{
BOOST_ASSERT(!text_->paragraphs().empty());
LASSERT(!text_->paragraphs().empty(), /**/);
LYXERR(Debug::DEBUG, "y: " << y << " cache size: " << par_metrics_.size());
// look for highest numbered paragraph with y coordinate less than given y
@ -1363,7 +1363,7 @@ Row const & TextMetrics::getRowNearY(int y, pit_type pit) const
ParagraphMetrics const & pm = par_metrics_[pit];
int yy = pm.position() - pm.ascent();
BOOST_ASSERT(!pm.rows().empty());
LASSERT(!pm.rows().empty(), /**/);
RowList::const_iterator rit = pm.rows().begin();
RowList::const_iterator rlast = pm.rows().end();
--rlast;
@ -1383,7 +1383,7 @@ Inset * TextMetrics::editXY(Cursor & cur, int x, int y)
cur.bv().coordCache().dump();
}
pit_type pit = getPitNearY(y);
BOOST_ASSERT(pit != -1);
LASSERT(pit != -1, /**/);
Row const & row = getRowNearY(y, pit);
bool bound = false;
@ -1414,8 +1414,8 @@ Inset * TextMetrics::editXY(Cursor & cur, int x, int y)
// This should be just before or just behind the
// cursor position set above.
BOOST_ASSERT((pos != 0 && inset == insetBefore)
|| inset == pars[pit].getInset(pos));
LASSERT((pos != 0 && inset == insetBefore)
|| inset == pars[pit].getInset(pos), /**/);
// Make sure the cursor points to the position before
// this inset.
@ -1435,7 +1435,7 @@ Inset * TextMetrics::editXY(Cursor & cur, int x, int y)
void TextMetrics::setCursorFromCoordinates(Cursor & cur, int const x, int const y)
{
BOOST_ASSERT(text_ == cur.text());
LASSERT(text_ == cur.text(), /**/);
pit_type pit = getPitNearY(y);
ParagraphMetrics const & pm = par_metrics_[pit];
@ -1445,7 +1445,7 @@ void TextMetrics::setCursorFromCoordinates(Cursor & cur, int const x, int const
" pit: " << pit << " yy: " << yy);
int r = 0;
BOOST_ASSERT(pm.rows().size());
LASSERT(pm.rows().size(), /**/);
for (; r < int(pm.rows().size()) - 1; ++r) {
Row const & row = pm.rows()[r];
if (int(yy + row.height()) > y)
@ -1473,7 +1473,7 @@ void TextMetrics::setCursorFromCoordinates(Cursor & cur, int const x, int const
Inset * TextMetrics::checkInsetHit(int x, int y)
{
pit_type pit = getPitNearY(y);
BOOST_ASSERT(pit != -1);
LASSERT(pit != -1, /**/);
Paragraph const & par = text_->paragraphs()[pit];
ParagraphMetrics const & pm = par_metrics_[pit];
@ -1515,7 +1515,7 @@ Inset * TextMetrics::checkInsetHit(int x, int y)
int TextMetrics::cursorX(CursorSlice const & sl,
bool boundary) const
{
BOOST_ASSERT(sl.text() == text_);
LASSERT(sl.text() == text_, /**/);
pit_type const pit = sl.pit();
Paragraph const & par = text_->paragraphs()[pit];
ParagraphMetrics const & pm = par_metrics_[pit];
@ -1679,7 +1679,7 @@ int TextMetrics::cursorY(CursorSlice const & sl, bool boundary) const
bool TextMetrics::cursorHome(Cursor & cur)
{
BOOST_ASSERT(text_ == cur.text());
LASSERT(text_ == cur.text(), /**/);
ParagraphMetrics const & pm = par_metrics_[cur.pit()];
Row const & row = pm.getRow(cur.pos(),cur.boundary());
return text_->setCursor(cur, cur.pit(), row.pos());
@ -1688,7 +1688,7 @@ bool TextMetrics::cursorHome(Cursor & cur)
bool TextMetrics::cursorEnd(Cursor & cur)
{
BOOST_ASSERT(text_ == cur.text());
LASSERT(text_ == cur.text(), /**/);
// if not on the last row of the par, put the cursor before
// the final space exept if I have a spanning inset or one string
// is so long that we force a break.
@ -1710,7 +1710,7 @@ bool TextMetrics::cursorEnd(Cursor & cur)
void TextMetrics::deleteLineForward(Cursor & cur)
{
BOOST_ASSERT(text_ == cur.text());
LASSERT(text_ == cur.text(), /**/);
if (cur.lastpos() == 0) {
// Paragraph is empty, so we just go forward
text_->cursorForward(cur);
@ -1745,8 +1745,8 @@ bool TextMetrics::isFirstRow(pit_type pit, Row const & row) const
int TextMetrics::leftMargin(int max_width, pit_type pit) const
{
BOOST_ASSERT(pit >= 0);
BOOST_ASSERT(pit < int(text_->paragraphs().size()));
LASSERT(pit >= 0, /**/);
LASSERT(pit < int(text_->paragraphs().size()), /**/);
return leftMargin(max_width, pit, text_->paragraphs()[pit].size());
}
@ -1756,11 +1756,11 @@ int TextMetrics::leftMargin(int max_width,
{
ParagraphList const & pars = text_->paragraphs();
BOOST_ASSERT(pit >= 0);
BOOST_ASSERT(pit < int(pars.size()));
LASSERT(pit >= 0, /**/);
LASSERT(pit < int(pars.size()), /**/);
Paragraph const & par = pars[pit];
BOOST_ASSERT(pos >= 0);
BOOST_ASSERT(pos <= par.size());
LASSERT(pos >= 0, /**/);
LASSERT(pos <= par.size(), /**/);
Buffer const & buffer = bv_->buffer();
//lyxerr << "TextMetrics::leftMargin: pit: " << pit << " pos: " << pos << endl;
DocumentClass const & tclass = buffer.params().documentClass();

View File

@ -30,7 +30,7 @@
#include "support/debug.h"
#include "support/docstream.h"
#include <boost/assert.hpp>
#include "support/assert.h"
using namespace std;
@ -89,7 +89,7 @@ Toc const & TocBackend::toc(string const & type) const
{
// Is the type already supported?
TocList::const_iterator it = tocs_.find(type);
BOOST_ASSERT(it != tocs_.end());
LASSERT(it != tocs_.end(), /**/);
return it->second;
}
@ -202,7 +202,7 @@ TocIterator TocBackend::item(string const & type,
{
TocList::const_iterator toclist_it = tocs_.find(type);
// Is the type supported?
BOOST_ASSERT(toclist_it != tocs_.end());
LASSERT(toclist_it != tocs_.end(), /**/);
Toc const & toc_vector = toclist_it->second;
TocIterator last = toc_vector.begin();

View File

@ -33,7 +33,7 @@
#include "support/debug.h"
#include "support/limited_stack.h"
#include <boost/assert.hpp>
#include "support/assert.h"
#include <algorithm>
#include <ostream>
@ -222,7 +222,7 @@ void Undo::Private::doRecordUndo(UndoKind kind,
// main Text _is_ the whole document.
// record the relevant paragraphs
Text const * text = cell.text();
BOOST_ASSERT(text);
LASSERT(text, /**/);
ParagraphList const & plist = text->paragraphs();
ParagraphList::const_iterator first = plist.begin();
advance(first, first_pit);
@ -243,8 +243,8 @@ void Undo::Private::doRecordUndo(UndoKind kind,
void Undo::Private::recordUndo(UndoKind kind, DocIterator & cur,
pit_type first_pit, pit_type last_pit)
{
BOOST_ASSERT(first_pit <= cur.lastpit());
BOOST_ASSERT(last_pit <= cur.lastpit());
LASSERT(first_pit <= cur.lastpit(), /**/);
LASSERT(last_pit <= cur.lastpit(), /**/);
doRecordUndo(kind, cur, first_pit, last_pit, cur,
false, true);
@ -287,7 +287,7 @@ bool Undo::Private::textUndoOrRedo(DocIterator & cur, bool isUndoOperation)
bool labelsUpdateNeeded = false;
DocIterator dit = undo.cell.asDocIterator(&buffer_.inset());
if (undo.isFullBuffer) {
BOOST_ASSERT(undo.pars);
LASSERT(undo.pars, /**/);
// This is a full document
otherstack.top().bparams = buffer_.params();
buffer_.params() = undo.bparams;
@ -299,15 +299,15 @@ bool Undo::Private::textUndoOrRedo(DocIterator & cur, bool isUndoOperation)
// gained by storing just 'a few' paragraphs (most if not
// all math inset cells have just one paragraph!)
//LYXERR0("undo.array: " << *undo.array);
BOOST_ASSERT(undo.array);
LASSERT(undo.array, /**/);
dit.cell().swap(*undo.array);
delete undo.array;
undo.array = 0;
} else {
// Some finer machinery is needed here.
Text * text = dit.text();
BOOST_ASSERT(text);
BOOST_ASSERT(undo.pars);
LASSERT(text, /**/);
LASSERT(undo.pars, /**/);
ParagraphList & plist = text->paragraphs();
// remove new stuff between first and last
@ -332,8 +332,8 @@ bool Undo::Private::textUndoOrRedo(DocIterator & cur, bool isUndoOperation)
undo.pars = 0;
labelsUpdateNeeded = true;
}
BOOST_ASSERT(undo.pars == 0);
BOOST_ASSERT(undo.array == 0);
LASSERT(undo.pars == 0, /**/);
LASSERT(undo.array == 0, /**/);
cur = undo.cursor.asDocIterator(&buffer_.inset());

View File

@ -23,7 +23,7 @@
#include "support/convert.h"
#include "support/lstrings.h"
#include <boost/assert.hpp>
#include "support/assert.h"
#include <cstring>
@ -458,7 +458,7 @@ string const VSpace::asLatexCommand(BufferParams const & params) const
: "\\vspace{" + len_.asLatexString() + '}';
default:
BOOST_ASSERT(false);
LASSERT(false, /**/);
return string();
}
}
@ -522,7 +522,7 @@ int VSpace::inPixels(BufferView const & bv) const
return len_.len().inPixels(bv.workWidth());
default:
BOOST_ASSERT(false);
LASSERT(false, /**/);
return 0;
}
}

View File

@ -17,7 +17,7 @@
#include "support/docstring.h"
#include "support/weighted_btree.h"
#include <boost/assert.hpp>
#include "support/assert.h"
namespace lyx {
@ -62,7 +62,7 @@ WordList::~WordList()
docstring const & WordList::word(size_t idx) const
{
Impl::Words::const_iterator it = d->words_.find_summed_weight(idx);
BOOST_ASSERT(it != d->words_.end());
LASSERT(it != d->words_.end(), /**/);
// We use the key() method here, and not something like it->first
// because the btree only returns (iterator-) temporary value pairs.

View File

@ -14,7 +14,7 @@
#include "support/debug.h"
#include <boost/assert.hpp>
#include "support/assert.h"
#include <exception>
#include <iomanip>
@ -30,7 +30,7 @@ namespace boost {
void throw_exception(exception const & e)
{
lyxerr << "Exception caught:\n" << e.what() << endl;
BOOST_ASSERT(false);
LASSERT(false, /**/);
}
#endif

View File

@ -41,6 +41,7 @@
#include "insets/InsetBibitem.h"
#include "insets/InsetInclude.h"
#include "support/assert.h"
#include "support/convert.h"
#include "support/debug.h"
#include "support/filetools.h"
@ -274,7 +275,7 @@ depth_type getItemDepth(ParIterator const & it)
bool needEnumCounterReset(ParIterator const & it)
{
Paragraph const & par = *it;
BOOST_ASSERT(par.layout().labeltype == LABEL_ENUMERATE);
LASSERT(par.layout().labeltype == LABEL_ENUMERATE, /**/);
depth_type const cur_depth = par.getDepth();
ParIterator prev_it = it;
while (prev_it.pit()) {
@ -443,7 +444,7 @@ void setLabel(Buffer const & buf, ParIterator & it)
void updateLabels(Buffer const & buf, ParIterator & parit)
{
BOOST_ASSERT(parit.pit() == 0);
LASSERT(parit.pit() == 0, /**/);
// set the position of the text in the buffer to be able
// to resolve macros in it. This has nothing to do with

View File

@ -28,12 +28,10 @@ lyxclient_LDADD = \
SOURCEFILES = \
boost.cpp \
client.cpp \
debug.cpp \
gettext.cpp \
Messages.cpp
HEADERFILES = \
debug.h \
Messages.h

View File

@ -64,7 +64,7 @@
#include "support/lstrings.h"
#include "support/ExceptionMessage.h"
#include <boost/assert.hpp>
#include "support/assert.h"
#include <sstream>

View File

@ -25,7 +25,7 @@
#include <QSettings>
#include <QString>
#include <boost/assert.hpp>
#include "support/assert.h"
#include <string>
@ -117,14 +117,14 @@ BufferView const * Dialog::bufferview() const
Buffer & Dialog::buffer()
{
BOOST_ASSERT(lyxview_->buffer());
LASSERT(lyxview_->buffer(), /**/);
return *lyxview_->buffer();
}
Buffer const & Dialog::buffer() const
{
BOOST_ASSERT(lyxview_->buffer());
LASSERT(lyxview_->buffer(), /**/);
return *lyxview_->buffer();
}

View File

@ -36,6 +36,7 @@
#include "Session.h"
#include "version.h"
#include "support/assert.h"
#include "support/debug.h"
#include "support/ExceptionMessage.h"
#include "support/FileName.h"
@ -666,8 +667,8 @@ void GuiApplication::addMenuTranslator()
bool GuiApplication::unregisterView(int id)
{
updateIds(views_, view_ids_);
BOOST_ASSERT(views_.find(id) != views_.end());
BOOST_ASSERT(views_[id]);
LASSERT(views_.find(id) != views_.end(), /**/);
LASSERT(views_[id], /**/);
map<int, GuiView *>::iterator it;
for (it = views_.begin(); it != views_.end(); ++it) {
@ -702,7 +703,7 @@ bool GuiApplication::closeAllViews()
GuiView & GuiApplication::view(int id) const
{
BOOST_ASSERT(views_.find(id) != views_.end());
LASSERT(views_.find(id) != views_.end(), /**/);
return *views_.find(id)->second;
}
@ -812,7 +813,7 @@ void hideDialogs(std::string const & name, Inset * inset)
frontend::FontLoader & theFontLoader()
{
BOOST_ASSERT(frontend::guiApp);
LASSERT(frontend::guiApp, /**/);
return frontend::guiApp->fontLoader();
}
@ -825,7 +826,7 @@ frontend::FontMetrics const & theFontMetrics(Font const & f)
frontend::FontMetrics const & theFontMetrics(FontInfo const & f)
{
BOOST_ASSERT(frontend::guiApp);
LASSERT(frontend::guiApp, /**/);
return frontend::guiApp->fontLoader().metrics(f);
}
@ -838,14 +839,14 @@ frontend::FontMetrics const & theFontMetrics(FontInfo const & f)
frontend::Clipboard & theClipboard()
{
BOOST_ASSERT(frontend::guiApp);
LASSERT(frontend::guiApp, /**/);
return frontend::guiApp->clipboard();
}
frontend::Selection & theSelection()
{
BOOST_ASSERT(frontend::guiApp);
LASSERT(frontend::guiApp, /**/);
return frontend::guiApp->selection();
}

View File

@ -17,18 +17,22 @@
#include "GuiClipboard.h"
#include "qt_helpers.h"
#include "frontends/alert.h"
#include "Buffer.h"
#include "BufferView.h"
#include "Cursor.h"
#include "support/assert.h"
#include "support/convert.h"
#include "support/debug.h"
#include "support/filetools.h"
#include "support/FileFilterList.h"
#include "support/gettext.h"
#include "support/lstrings.h"
#ifdef Q_WS_MACX
#include "support/linkback/LinkBackProxy.h"
#endif // Q_WS_MACX
#include "frontends/alert.h"
#include <QApplication>
#include <QBuffer>
@ -49,14 +53,8 @@
#include <objidl.h>
#endif // Q_WS_WIN
#include "boost/assert.hpp"
#include <map>
#ifdef Q_WS_MACX
#include "support/linkback/LinkBackProxy.h"
#endif // Q_WS_MACX
using namespace std;
using namespace lyx::support;
@ -310,7 +308,7 @@ FileName GuiClipboard::getPastedGraphicsFileName(Cursor const & cur,
if (hasGraphicsContents(Clipboard::JpegGraphicsType))
types.push_back(Clipboard::JpegGraphicsType);
BOOST_ASSERT(!types.empty());
LASSERT(!types.empty(), /**/);
// select prefered type if AnyGraphicsType was passed
if (type == Clipboard::AnyGraphicsType)
@ -439,7 +437,7 @@ FileName GuiClipboard::getAsGraphics(Cursor const & cur, GraphicsType type) cons
else if (type == JpegGraphicsType)
image.save(toqstr(filename.absFilename()), "JPEG");
else
BOOST_ASSERT(false);
LASSERT(false, /**/);
return filename;
}
@ -459,7 +457,7 @@ FileName GuiClipboard::getAsGraphics(Cursor const & cur, GraphicsType type) cons
case LinkBackGraphicsType: mime = pdf_mime_type; break;
case EmfGraphicsType: mime = emf_mime_type; break;
case WmfGraphicsType: mime = wmf_mime_type; break;
default: BOOST_ASSERT(false);
default: LASSERT(false, /**/);
}
// get data
@ -490,7 +488,7 @@ FileName GuiClipboard::getAsGraphics(Cursor const & cur, GraphicsType type) cons
ds << pdfLen; // big endian by default
#else
// only non-Mac this should never happen
BOOST_ASSERT(false);
LASSERT(false, /**/);
#endif // Q_WS_MACX
}
@ -579,7 +577,7 @@ bool GuiClipboard::hasGraphicsContents(Clipboard::GraphicsType type) const
case EmfGraphicsType: mime = emf_mime_type; break;
case WmfGraphicsType: mime = wmf_mime_type; break;
case PdfGraphicsType: mime = pdf_mime_type; break;
default: BOOST_ASSERT(false);
default: LASSERT(false, /**/);
}
return source && source->hasFormat(mime);

View File

@ -24,6 +24,7 @@
#include "Paragraph.h"
#include "version.h"
#include "support/assert.h"
#include "support/debug.h"
#include <QApplication>
@ -41,10 +42,12 @@ using namespace lyx::support;
namespace lyx {
namespace frontend {
class RtlItemDelegate : public QItemDelegate {
class RtlItemDelegate : public QItemDelegate
{
public:
explicit RtlItemDelegate(QObject * parent = 0)
: QItemDelegate(parent), enabled_(false) {}
explicit RtlItemDelegate(QObject * parent)
: QItemDelegate(parent), enabled_(false)
{}
void setEnabled(bool enabled = true)
{
@ -52,7 +55,7 @@ public:
}
protected:
virtual void drawDisplay(QPainter * painter,
void drawDisplay(QPainter * painter,
QStyleOptionViewItem const & option,
QRect const & rect, QString const & text) const
{
@ -72,10 +75,12 @@ private:
};
class PixmapItemDelegate : public QItemDelegate {
class PixmapItemDelegate : public QItemDelegate
{
public:
explicit PixmapItemDelegate(QObject *parent = 0)
: QItemDelegate(parent) {}
explicit PixmapItemDelegate(QObject * parent)
: QItemDelegate(parent)
{}
protected:
void paint(QPainter *painter, const QStyleOptionViewItem &option,
@ -100,21 +105,21 @@ protected:
};
class GuiCompletionModel : public QAbstractListModel {
class GuiCompletionModel : public QAbstractListModel
{
public:
///
GuiCompletionModel(QObject * parent, CompletionList const * l)
: QAbstractListModel(parent), list_(l) {}
: QAbstractListModel(parent), list_(l)
{}
///
~GuiCompletionModel()
{ delete list_; }
~GuiCompletionModel() { delete list_; }
///
bool sorted() const
{
if (list_)
return list_->sorted();
else
return false;
return false;
}
///
int columnCount(const QModelIndex & /*parent*/ = QModelIndex()) const
@ -144,7 +149,8 @@ public:
if (index.column() == 0)
return toqstr(list_->data(index.row()));
else if (index.column() == 1) {
if (index.column() == 1) {
// get icon from cache
QPixmap scaled;
QString const name = ":" + toqstr(list_->icon(index.row()));
@ -786,7 +792,7 @@ void GuiCompleter::setCurrentCompletion(QString const & s)
i = n;
else
i = l;
BOOST_ASSERT(i <= n);
LASSERT(i <= n, /**/);
}
// select the first if none was found

View File

@ -30,7 +30,7 @@
#include <QFontInfo>
#include <QFontDatabase>
#include <boost/assert.hpp>
#include "support/assert.h"
using namespace std;
using namespace lyx::support;
@ -91,10 +91,10 @@ static GuiFontInfo * fontinfo_[NUM_FAMILIES][2][4][10];
// if not cached, create it.
GuiFontInfo & fontinfo(FontInfo const & f)
{
BOOST_ASSERT(f.family() < NUM_FAMILIES);
BOOST_ASSERT(f.series() < 2);
BOOST_ASSERT(f.realShape() < 4);
BOOST_ASSERT(f.size() < 10);
LASSERT(f.family() < NUM_FAMILIES, /**/);
LASSERT(f.series() < 2, /**/);
LASSERT(f.realShape() < 4, /**/);
LASSERT(f.size() < 10, /**/);
// fi is a reference to the pointer type (GuiFontInfo *) in the
// fontinfo_ table.
GuiFontInfo * & fi =

View File

@ -20,7 +20,7 @@
#include "insets/Inset.h"
#include <boost/assert.hpp>
#include "support/assert.h"
using namespace std;
@ -36,7 +36,7 @@ namespace frontend {
*/
static inline QChar const ucs4_to_qchar(char_type const ucs4)
{
BOOST_ASSERT(is_utf16(ucs4));
LASSERT(is_utf16(ucs4), /**/);
return QChar(static_cast<unsigned short>(ucs4));
}

View File

@ -14,6 +14,7 @@
#include "qt_helpers.h"
#include "support/assert.h"
#include "support/debug.h"
#include "Encoding.h"
@ -24,8 +25,6 @@
#include <QEvent>
#include <QTextCodec>
#include "boost/assert.hpp"
#include <map>
#include <string>
@ -669,7 +668,7 @@ char_type KeySymbol::getUCSEncoded() const
return 0;
// UTF16 has a maximum of two characters.
BOOST_ASSERT(text_.size() <= 2);
LASSERT(text_.size() <= 2, /**/);
if (lyxerr.debugging() && text_.size() > 1) {
// We don't know yet how well support the full ucs4 range.

View File

@ -22,6 +22,7 @@
#include "Language.h"
#include "LyXRC.h"
#include "support/assert.h"
#include "support/debug.h"
#include <QPixmapCache>
@ -150,7 +151,7 @@ void GuiPainter::enterMonochromeMode(ColorCode const & min, ColorCode const & ma
void GuiPainter::leaveMonochromeMode()
{
BOOST_ASSERT(!monochrome_min_.empty());
LASSERT(!monochrome_min_.empty(), /**/);
monochrome_min_.pop();
monochrome_max_.pop();
}

View File

@ -2446,7 +2446,7 @@ GuiPreferences::GuiPreferences(GuiView & lv)
void GuiPreferences::add(PrefModule * module)
{
BOOST_ASSERT(module);
LASSERT(module, /**/);
if (module->category().isEmpty())
prefsPS->addPanel(module, module->title());
else

View File

@ -34,7 +34,7 @@
#include "support/debug.h"
#include "support/gettext.h"
#include <boost/assert.hpp>
#include "support/assert.h"
#include <algorithm>
@ -89,7 +89,7 @@ QStandardItemModel * GuiToc::tocModel(int type)
LYXERR(Debug::GUI, "GuiToc: type " << type
<< " toc_models_.size() " << toc_models_.size());
BOOST_ASSERT(type >= 0 && type < int(toc_models_.size()));
LASSERT(type >= 0 && type < int(toc_models_.size()), /**/);
return toc_models_[type];
}
@ -111,7 +111,7 @@ void GuiToc::goTo(int type, QModelIndex const & index)
return;
}
BOOST_ASSERT(type >= 0 && type < int(toc_models_.size()));
LASSERT(type >= 0 && type < int(toc_models_.size()), /**/);
TocIterator const it = toc_models_[type]->tocIterator(index);
@ -212,7 +212,7 @@ void GuiToc::updateBackend()
TocIterator GuiToc::currentTocItem(int type) const
{
BOOST_ASSERT(bufferview());
LASSERT(bufferview(), /**/);
ParConstIterator it(bufferview()->cursor());
return buffer().masterBuffer()->tocBackend().item(fromqstr(types_[type]), it);
}

View File

@ -64,7 +64,7 @@
#include <QToolButton>
#include <QVariant>
#include <boost/assert.hpp>
#include "support/assert.h"
#include <map>
#include <vector>
@ -155,7 +155,7 @@ QString findPng(QString const & name)
{
PngMap const * const begin = sorted_png_map;
PngMap const * const end = begin + nr_sorted_png_map;
BOOST_ASSERT(sorted(begin, end));
LASSERT(sorted(begin, end), /**/);
PngMap const * const it = find_if(begin, end, CompareKey(name));
@ -434,7 +434,7 @@ private:
p->filter();
for (int i = 0; i < f.length(); ++i) {
int p = s.indexOf(f[i], lastp + 1, Qt::CaseInsensitive);
BOOST_ASSERT(p != -1);
LASSERT(p != -1, /**/);
if (lastp == p - 1 && lastp != -1) {
// remove ")" and append "x)"
r = r.left(r.length() - 4) + s[p] + "</u>";
@ -529,7 +529,7 @@ void GuiLayoutBox::setFilter(QString const & s)
// We do not call our implementation of showPopup because that
// would reset the filter again. This is only needed if the user clicks
// on the QComboBox.
BOOST_ASSERT(!inShowPopup_);
LASSERT(!inShowPopup_, /**/);
inShowPopup_ = true;
QComboBox::showPopup();
inShowPopup_ = false;
@ -599,7 +599,7 @@ void GuiLayoutBox::showPopup()
// call QComboBox::showPopup. But set the inShowPopup_ flag to switch on
// the hack in the item delegate to make space for the headers.
BOOST_ASSERT(!inShowPopup_);
LASSERT(!inShowPopup_, /**/);
inShowPopup_ = true;
QComboBox::showPopup();
inShowPopup_ = false;

View File

@ -31,7 +31,7 @@
#include "support/debug.h"
#include "support/gettext.h"
#include <boost/assert.hpp>
#include "support/assert.h"
using namespace std;
@ -298,7 +298,7 @@ void GuiToolbars::saveToolbarInfo()
for (ToolbarBackend::Toolbars::iterator cit = toolbarbackend.begin();
cit != toolbarbackend.end(); ++cit) {
ToolbarsMap::iterator it = toolbars_.find(cit->name);
BOOST_ASSERT(it != toolbars_.end());
LASSERT(it != toolbars_.end(), /**/);
// get toolbar info from session.
ToolbarSection::ToolbarInfo & info = tb.load(cit->name);
if (cit->flags & ToolbarInfo::ON)
@ -340,7 +340,7 @@ void GuiToolbars::displayToolbar(ToolbarInfo const & tbinfo,
bool show_it)
{
ToolbarsMap::iterator it = toolbars_.find(tbinfo.name);
BOOST_ASSERT(it != toolbars_.end());
LASSERT(it != toolbars_.end(), /**/);
if (show_it) {
if (it->second->isVisible())

View File

@ -88,7 +88,7 @@
#include <QUrl>
#include <QScrollBar>
#include <boost/assert.hpp>
#include "support/assert.h"
#include <boost/bind.hpp>
#ifdef HAVE_SYS_TIME_H
@ -764,7 +764,7 @@ GuiWorkArea const * GuiView::currentWorkArea() const
void GuiView::setCurrentWorkArea(GuiWorkArea * wa)
{
BOOST_ASSERT(wa);
LASSERT(wa, /**/);
// Changing work area can result from opening a file so
// update the toc in any case.
@ -780,7 +780,7 @@ void GuiView::setCurrentWorkArea(GuiWorkArea * wa)
void GuiView::removeWorkArea(GuiWorkArea * wa)
{
BOOST_ASSERT(wa);
LASSERT(wa, /**/);
if (wa == d.current_work_area_) {
disconnectBuffer();
disconnectBufferView();
@ -869,7 +869,7 @@ Buffer const * GuiView::buffer() const
void GuiView::setBuffer(Buffer * newBuffer)
{
BOOST_ASSERT(newBuffer);
LASSERT(newBuffer, /**/);
setBusy(true);
GuiWorkArea * wa = workArea(*newBuffer);
@ -1074,7 +1074,7 @@ FuncStatus GuiView::getStatus(FuncRequest const & cmd)
FuncStatus fs;
if (!inset->getStatus(view()->cursor(), fr, fs)) {
// Every inset is supposed to handle this
BOOST_ASSERT(false);
LASSERT(false, /**/);
}
flag |= fs;
} else {
@ -2255,7 +2255,7 @@ Dialog * createGuiWrap(GuiView & lv);
Dialog * GuiView::build(string const & name)
{
BOOST_ASSERT(isValidName(name));
LASSERT(isValidName(name), /**/);
if (name == "aboutlyx")
return createGuiAbout(*this);

View File

@ -23,6 +23,7 @@
#include "Paragraph.h"
#include "TexRow.h"
#include "support/assert.h"
#include "support/docstream.h"
#include "support/gettext.h"
@ -166,7 +167,7 @@ QString GuiViewSource::title() const
case LITERATE:
return qt_("Literate Source");
}
BOOST_ASSERT(false);
LASSERT(false, /**/);
return QString();
}

View File

@ -1256,7 +1256,7 @@ GuiWorkArea * TabWorkArea::currentWorkArea()
return 0;
GuiWorkArea * wa = dynamic_cast<GuiWorkArea *>(currentWidget());
BOOST_ASSERT(wa);
LASSERT(wa, /**/);
return wa;
}
@ -1265,7 +1265,7 @@ GuiWorkArea * TabWorkArea::workArea(Buffer & buffer)
{
for (int i = 0; i != count(); ++i) {
GuiWorkArea * wa = dynamic_cast<GuiWorkArea *>(widget(i));
BOOST_ASSERT(wa);
LASSERT(wa, /**/);
if (&wa->bufferView().buffer() == &buffer)
return wa;
}
@ -1277,7 +1277,7 @@ void TabWorkArea::closeAll()
{
while (count()) {
GuiWorkArea * wa = dynamic_cast<GuiWorkArea *>(widget(0));
BOOST_ASSERT(wa);
LASSERT(wa, /**/);
removeTab(0);
delete wa;
}
@ -1286,7 +1286,7 @@ void TabWorkArea::closeAll()
bool TabWorkArea::setCurrentWorkArea(GuiWorkArea * work_area)
{
BOOST_ASSERT(work_area);
LASSERT(work_area, /**/);
int index = indexOf(work_area);
if (index == -1)
return false;
@ -1326,7 +1326,7 @@ GuiWorkArea * TabWorkArea::addWorkArea(Buffer & buffer, GuiView & view)
bool TabWorkArea::removeWorkArea(GuiWorkArea * work_area)
{
BOOST_ASSERT(work_area);
LASSERT(work_area, /**/);
int index = indexOf(work_area);
if (index == -1)
return false;
@ -1353,7 +1353,7 @@ bool TabWorkArea::removeWorkArea(GuiWorkArea * work_area)
void TabWorkArea::on_currentTabChanged(int i)
{
GuiWorkArea * wa = dynamic_cast<GuiWorkArea *>(widget(i));
BOOST_ASSERT(wa);
LASSERT(wa, /**/);
BufferView & bv = wa->bufferView();
bv.cursor().fixIfBroken();
bv.updateMetrics();
@ -1383,7 +1383,7 @@ void TabWorkArea::closeCurrentTab()
removeWorkArea(currentWorkArea());
else {
GuiWorkArea * wa = dynamic_cast<GuiWorkArea *>(widget(clicked_tab_));
BOOST_ASSERT(wa);
LASSERT(wa, /**/);
removeWorkArea(wa);
}
}

View File

@ -45,6 +45,7 @@
#include "TocBackend.h"
#include "ToolbarBackend.h"
#include "support/assert.h"
#include "support/convert.h"
#include "support/debug.h"
#include "support/filetools.h"
@ -139,7 +140,7 @@ public:
bool optional = false)
: kind_(kind), label_(label), submenuname_(submenu), optional_(optional)
{
BOOST_ASSERT(kind == Submenu);
LASSERT(kind == Submenu, /**/);
}
MenuItem(Kind kind,
@ -725,7 +726,7 @@ void MenuDefinition::expandFormats(MenuItem::Kind kind, Buffer const * buf)
continue;
break;
default:
BOOST_ASSERT(false);
LASSERT(false, /**/);
break;
}
// FIXME: if we had proper support for translating the
@ -1375,7 +1376,7 @@ MenuDefinition const & Menus::Impl::getMenu(QString const & name) const
MenuNamesEqual(name));
if (cit == menulist_.end())
lyxerr << "No submenu named " << fromqstr(name) << endl;
BOOST_ASSERT(cit != menulist_.end());
LASSERT(cit != menulist_.end(), /**/);
return (*cit);
}
@ -1386,7 +1387,7 @@ MenuDefinition & Menus::Impl::getMenu(QString const & name)
MenuNamesEqual(name));
if (it == menulist_.end())
lyxerr << "No submenu named " << fromqstr(name) << endl;
BOOST_ASSERT(it != menulist_.end());
LASSERT(it != menulist_.end(), /**/);
return (*it);
}
@ -1480,10 +1481,7 @@ void Menus::fillMenuBar(QMenuBar * qmb, GuiView * view, bool initial)
<< fromqstr(d->menubar_.name()));
return;
}
else {
LYXERR(Debug::GUI, "menu bar entries "
<< d->menubar_.size());
}
LYXERR(Debug::GUI, "menu bar entries " << d->menubar_.size());
MenuDefinition menu;
Buffer * buf = 0;

View File

@ -22,7 +22,7 @@
#include <QHBoxLayout>
#include <QHeaderView>
#include <boost/assert.hpp>
#include "support/assert.h"
#include <iostream>
@ -104,7 +104,7 @@ void PanelStack::addPanel(QWidget * panel, QString const & name, QString const &
void PanelStack::setCurrentPanel(QString const & name)
{
QTreeWidgetItem * item = panel_map_.value(name, 0);
BOOST_ASSERT(item);
LASSERT(item, /**/);
// force on first set
if (list_->currentItem() == item)

View File

@ -15,7 +15,7 @@
#include "support/debug.h"
#include <boost/assert.hpp>
#include "support/assert.h"
#include <climits>
using namespace std;
@ -29,7 +29,7 @@ typedef std::pair<QModelIndex, TocIterator> TocPair;
TocIterator TocModel::tocIterator(QModelIndex const & index) const
{
TocMap::const_iterator map_it = toc_map_.find(index);
BOOST_ASSERT(map_it != toc_map_.end());
LASSERT(map_it != toc_map_.end(), /**/);
return map_it->second;
}
@ -37,7 +37,7 @@ TocIterator TocModel::tocIterator(QModelIndex const & index) const
QModelIndex TocModel::modelIndex(TocIterator const & it) const
{
ModelMap::const_iterator map_it = model_map_.find(it);
//BOOST_ASSERT(it != model_map_.end());
//LASSERT(it != model_map_.end(), /**/);
if (map_it == model_map_.end())
return QModelIndex();

View File

@ -10,7 +10,7 @@
#include <config.h>
#include <boost/assert.hpp>
#include "support/assert.h"
#include <cstdlib>
#include <exception>
@ -22,7 +22,7 @@ namespace boost {
#ifndef BOOST_NO_EXCEPTIONS
void throw_exception(exception const & /*e*/)
{
BOOST_ASSERT(false);
LASSERT(false, /**/);
}
#endif

View File

@ -324,7 +324,7 @@ static string const findTargetFormat(string const & from)
FormatList const formats = lyx::graphics::Image::loadableFormats();
// There must be a format to load from.
BOOST_ASSERT(!formats.empty());
LASSERT(!formats.empty(), /**/);
// Use the standard converter if we don't know the format to load
// from.

View File

@ -15,6 +15,7 @@
#include "Converter.h"
#include "Format.h"
#include "support/assert.h"
#include "support/convert.h"
#include "support/debug.h"
#include "support/FileName.h"
@ -257,7 +258,7 @@ static void build_script(FileName const & from_file,
string const & to_format,
ostream & script)
{
BOOST_ASSERT(from_format != to_format);
LASSERT(from_format != to_format, /**/);
LYXERR(Debug::GRAPHICS, "build_script ... ");
typedef Converters::EdgePath EdgePath;

View File

@ -366,7 +366,7 @@ void Template::readTemplate(Lexer & lex)
default:
lex.printError("external::Template::readTemplate: "
"Wrong tag: $$Token");
BOOST_ASSERT(false);
LASSERT(false, /**/);
break;
}
}

View File

@ -33,6 +33,7 @@
#include "frontends/Painter.h"
#include "frontends/Application.h"
#include "support/assert.h"
#include "support/convert.h"
#include "support/debug.h"
#include "support/docstream.h"
@ -133,7 +134,7 @@ Buffer & Inset::buffer()
odocstringstream s;
lyxerr << "LyX Code: " << lyxCode() << " name: " << name() << std::endl;
s << "LyX Code: " << lyxCode() << " name: " << name();
BOOST_ASSERT(false);
LASSERT(false, /**/);
throw ExceptionMessage(BufferException,
from_ascii("Inset::buffer_ member not initialized!"), s.str());
}

View File

@ -34,14 +34,15 @@
#include "frontends/FontMetrics.h"
#include "frontends/Painter.h"
#include "support/assert.h"
#include "support/debug.h"
#include "support/docstream.h"
#include "support/gettext.h"
using namespace std;
namespace lyx {
namespace lyx {
InsetCollapsable::CollapseStatus InsetCollapsable::status() const
{
@ -184,7 +185,7 @@ void InsetCollapsable::read(Lexer & lex)
Dimension InsetCollapsable::dimensionCollapsed() const
{
BOOST_ASSERT(layout_);
LASSERT(layout_, /**/);
Dimension dim;
theFontMetrics(layout_->labelfont()).buttonText(
labelstring_, dim.wid, dim.asc, dim.des);
@ -194,7 +195,7 @@ Dimension InsetCollapsable::dimensionCollapsed() const
void InsetCollapsable::metrics(MetricsInfo & mi, Dimension & dim) const
{
BOOST_ASSERT(layout_);
LASSERT(layout_, /**/);
autoOpen_ = mi.base.bv->cursor().isInside(this);
@ -259,7 +260,7 @@ bool InsetCollapsable::setMouseHover(bool mouse_hover)
void InsetCollapsable::draw(PainterInfo & pi, int x, int y) const
{
BOOST_ASSERT(layout_);
LASSERT(layout_, /**/);
autoOpen_ = pi.base.bv->cursor().isInside(this);
ColorCode const old_color = pi.background_color;
@ -384,7 +385,7 @@ void InsetCollapsable::cursorPos(BufferView const & bv,
{
if (geometry() == ButtonOnly)
status_ = Open;
BOOST_ASSERT(geometry() != ButtonOnly);
LASSERT(geometry() != ButtonOnly, /**/);
InsetText::cursorPos(bv, sl, boundary, x, y);
Dimension const textdim = InsetText::dimension(bv);
@ -448,8 +449,7 @@ docstring const InsetCollapsable::getNewLabel(docstring const & l) const
}
void InsetCollapsable::edit(
Cursor & cur, bool front, EntryDirection entry_from)
void InsetCollapsable::edit(Cursor & cur, bool front, EntryDirection entry_from)
{
//lyxerr << "InsetCollapsable: edit left/right" << endl;
cur.push(*this);

View File

@ -35,7 +35,7 @@
#include "support/gettext.h"
#include "support/lstrings.h"
#include <boost/assert.hpp>
#include "support/assert.h"
using namespace std;
using namespace lyx::support;
@ -75,7 +75,7 @@ static ParamInfo const & findInfo(InsetCode code, string const & cmdName)
case TOC_CODE:
return InsetTOC::findInfo(cmdName);
default:
BOOST_ASSERT(false);
LASSERT(false, /**/);
}
static const ParamInfo pi;
return pi; // to silence the warning
@ -134,7 +134,7 @@ bool ParamInfo::operator==(ParamInfo const & rhs) const
ParamInfo::ParamData const &
ParamInfo::operator[](std::string const & name) const
{
BOOST_ASSERT(hasParam(name));
LASSERT(hasParam(name), /**/);
const_iterator it = begin();
const_iterator last = end();
for (; it != last; ++it) {
@ -202,7 +202,7 @@ string InsetCommandParams::getDefaultCmd(InsetCode code)
case TOC_CODE:
return InsetTOC::defaultCommand();
default:
BOOST_ASSERT(false);
LASSERT(false, /**/);
}
return string(); // silence the warning
}
@ -236,7 +236,7 @@ bool InsetCommandParams::isCompatibleCommand(InsetCode code, string const & s)
case TOC_CODE:
return InsetTOC::isCompatibleCommand(s);
default:
BOOST_ASSERT(false);
LASSERT(false, /**/);
}
return false; // silence the warning
}
@ -325,7 +325,7 @@ void InsetCommandParams::write(ostream & os) const
bool InsetCommandParams::writeEmptyOptional(ParamInfo::const_iterator ci) const
{
if (!ci->isOptional())
BOOST_ASSERT(false);
LASSERT(false, /**/);
++ci; // we want to start with the next one
ParamInfo::const_iterator end = info_.end();
for (; ci != end; ++ci) {
@ -395,7 +395,7 @@ docstring InsetCommandParams::getFirstNonOptParam() const
find_if(info_.begin(), info_.end(),
not1(mem_fun_ref(&ParamInfo::ParamData::isOptional)));
if (it == info_.end())
BOOST_ASSERT(false);
LASSERT(false, /**/);
return (*this)[it->name()];
}
@ -403,7 +403,7 @@ docstring InsetCommandParams::getFirstNonOptParam() const
docstring const & InsetCommandParams::operator[](string const & name) const
{
static const docstring dummy; //so we don't return a ref to temporary
BOOST_ASSERT(info_.hasParam(name));
LASSERT(info_.hasParam(name), /**/);
ParamMap::const_iterator data = params_.find(name);
if (data == params_.end() || data->second.empty())
return dummy;
@ -413,7 +413,7 @@ docstring const & InsetCommandParams::operator[](string const & name) const
docstring & InsetCommandParams::operator[](string const & name)
{
BOOST_ASSERT(info_.hasParam(name));
LASSERT(info_.hasParam(name), /**/);
return params_[name];
}

View File

@ -594,7 +594,7 @@ graphics::Params get_grfx_params(InsetExternalParams const & eparams)
gparams.display = graphics::NoDisplay;
break;
default:
BOOST_ASSERT(false);
LASSERT(false, /**/);
}
if (gparams.display == graphics::DefaultDisplay)
gparams.display = graphics::DisplayType(lyxrc.display_graphics);
@ -724,7 +724,7 @@ void InsetExternal::fileChanged() const
return;
RenderMonitoredPreview * const ptr = renderer_->asMonitoredPreview();
BOOST_ASSERT(ptr);
LASSERT(ptr, /**/);
ptr->removePreview(*buffer);
add_preview_and_start_loading(*ptr, *this, *buffer);

View File

@ -45,6 +45,7 @@
#include "insets/InsetListingsParams.h"
#include "insets/RenderPreview.h"
#include "support/assert.h"
#include "support/debug.h"
#include "support/docstream.h"
#include "support/ExceptionMessage.h"
@ -257,7 +258,7 @@ bool InsetInclude::isCompatibleCommand(string const & s)
void InsetInclude::doDispatch(Cursor & cur, FuncRequest & cmd)
{
BOOST_ASSERT(&cur.buffer() == &buffer());
LASSERT(&cur.buffer() == &buffer(), /**/);
switch (cmd.action) {
case LFUN_INSET_MODIFY: {
@ -327,7 +328,7 @@ docstring InsetInclude::screenLabel() const
temp = listings_label_;
break;
case NONE:
BOOST_ASSERT(false);
LASSERT(false, /**/);
}
temp += ": ";
@ -656,7 +657,7 @@ void InsetInclude::validate(LaTeXFeatures & features) const
string incfile = to_utf8(params()["filename"]);
string writefile;
BOOST_ASSERT(&buffer() == &features.buffer());
LASSERT(&buffer() == &features.buffer(), /**/);
string const included_file =
includedFilename(buffer(), params()).availableFile().absFilename();
@ -743,7 +744,7 @@ EmbeddedFileList const &
void InsetInclude::metrics(MetricsInfo & mi, Dimension & dim) const
{
BOOST_ASSERT(mi.base.bv);
LASSERT(mi.base.bv, /**/);
bool use_preview = false;
if (RenderPreview::status() != LyXRC::PREVIEW_OFF) {
@ -769,7 +770,7 @@ void InsetInclude::metrics(MetricsInfo & mi, Dimension & dim) const
void InsetInclude::draw(PainterInfo & pi, int x, int y) const
{
BOOST_ASSERT(pi.base.bv);
LASSERT(pi.base.bv, /**/);
bool use_preview = false;
if (RenderPreview::status() != LyXRC::PREVIEW_OFF) {

View File

@ -21,7 +21,7 @@
#include "support/textutils.h"
#include "support/convert.h"
#include <boost/assert.hpp>
#include "support/assert.h"
#include <sstream>

View File

@ -50,6 +50,7 @@
#include "frontends/Painter.h"
#include "frontends/Selection.h"
#include "support/assert.h"
#include "support/convert.h"
#include "support/debug.h"
#include "support/docstream.h"
@ -1329,14 +1330,14 @@ void Tabular::read(Lexer & lex)
l_getline(is, line);
if (!prefixIs(line, "<lyxtabular ") && !prefixIs(line, "<Tabular ")) {
BOOST_ASSERT(false);
LASSERT(false, /**/);
return;
}
int version;
if (!getTokenValue(line, "version", version))
return;
BOOST_ASSERT(version >= 2);
LASSERT(version >= 2, /**/);
int rows_arg;
if (!getTokenValue(line, "rows", rows_arg))
@ -1766,7 +1767,7 @@ int Tabular::rowAscent(row_type row) const
int Tabular::rowDescent(row_type row) const
{
BOOST_ASSERT(row < rowCount());
LASSERT(row < rowCount(), /**/);
return row_info[row].descent;
}
@ -1783,8 +1784,8 @@ int Tabular::height() const
bool Tabular::isPartOfMultiColumn(row_type row, col_type column) const
{
BOOST_ASSERT(row < rowCount());
BOOST_ASSERT(column < columnCount());
LASSERT(row < rowCount(), /**/);
LASSERT(column < columnCount(), /**/);
return cell_info[row][column].multicolumn == CELL_PART_OF_MULTICOLUMN;
}
@ -1792,8 +1793,8 @@ bool Tabular::isPartOfMultiColumn(row_type row, col_type column) const
int Tabular::TeXTopHLine(odocstream & os, row_type row) const
{
// FIXME: assert or return 0 as in TeXBottomHLine()?
BOOST_ASSERT(row != npos);
BOOST_ASSERT(row < rowCount());
LASSERT(row != npos, /**/);
LASSERT(row < rowCount(), /**/);
idx_type const fcell = getFirstCellInRow(row);
idx_type const n = numberOfCellsInRow(fcell) + fcell;
@ -2666,7 +2667,7 @@ Tabular::cellFromInset(Inset const * inset) const
// is this inset part of the tabular?
if (!inset) {
lyxerr << "Error: this is not a cell of the tabular!" << endl;
BOOST_ASSERT(false);
LASSERT(false, /**/);
}
for (idx_type cell = 0, n = cellCount(); cell < n; ++cell)
@ -2679,7 +2680,7 @@ Tabular::cellFromInset(Inset const * inset) const
// We should have found a cell at this point
lyxerr << "Tabular::cellFromInset: Cell of inset "
<< inset << " not found!" << endl;
BOOST_ASSERT(false);
LASSERT(false, /**/);
// shut up compiler
return 0;
}
@ -2732,15 +2733,15 @@ InsetTableCell::InsetTableCell(Buffer const & buf,
bool InsetTableCell::forceEmptyLayout(idx_type) const
{
BOOST_ASSERT(table_);
BOOST_ASSERT(cell_data_);
LASSERT(table_, /**/);
LASSERT(cell_data_, /**/);
return table_->getPWidth(cell_data_->cellno).zero();
}
bool InsetTableCell::allowParagraphCustomization(idx_type) const
{
BOOST_ASSERT(table_);
BOOST_ASSERT(cell_data_);
LASSERT(table_, /**/);
LASSERT(cell_data_, /**/);
return !table_->getPWidth(cell_data_->cellno).zero();
}
@ -2866,7 +2867,7 @@ void InsetTabular::metrics(MetricsInfo & mi, Dimension & dim) const
// mi.base.textwidth << "\n";
if (!mi.base.bv) {
LYXERR0("need bv");
BOOST_ASSERT(false);
LASSERT(false, /**/);
}
row_type i = 0;
@ -4587,7 +4588,7 @@ void InsetTabular::cutSelection(Cursor & cur)
bool InsetTabular::isRightToLeft(Cursor & cur) const
{
BOOST_ASSERT(cur.depth() > 1);
LASSERT(cur.depth() > 1, /**/);
Paragraph const & parentpar = cur[cur.depth() - 2].paragraph();
pos_type const parentpos = cur[cur.depth() - 2].pos();
return parentpar.getFontSettings(cur.bv().buffer().params(),

View File

@ -52,7 +52,7 @@
#include "support/lstrings.h"
#include <boost/bind.hpp>
#include <boost/assert.hpp>
#include "support/assert.h"
using namespace std;
using namespace lyx::support;
@ -91,7 +91,7 @@ InsetText::InsetText()
void InsetText::initParagraphs(Buffer const & buf)
{
BOOST_ASSERT(paragraphs().empty());
LASSERT(paragraphs().empty(), /**/);
buffer_ = const_cast<Buffer *>(&buf);
paragraphs().push_back(Paragraph());
Paragraph & ourpar = paragraphs().back();
@ -109,7 +109,7 @@ void InsetText::setParagraphOwner()
void InsetText::clear()
{
ParagraphList & pars = paragraphs();
BOOST_ASSERT(!pars.empty());
LASSERT(!pars.empty(), /**/);
// This is a gross hack...
Layout const & old_layout = pars.begin()->layout();
@ -432,7 +432,7 @@ void InsetText::updateLabels(ParIterator const & it)
{
ParIterator it2 = it;
it2.forwardPos();
BOOST_ASSERT(&it2.inset() == this && it2.pit() == 0);
LASSERT(&it2.inset() == this && it2.pit() == 0, /**/);
lyx::updateLabels(buffer(), it2);
}
@ -445,9 +445,9 @@ bool InsetText::notifyCursorLeaves(Cursor const & old, Cursor & cur)
// find text inset in old cursor
Cursor insetCur = old;
int scriptSlice = insetCur.find(this);
BOOST_ASSERT(scriptSlice != -1);
LASSERT(scriptSlice != -1, /**/);
insetCur.cutOff(scriptSlice);
BOOST_ASSERT(&insetCur.inset() == this);
LASSERT(&insetCur.inset() == this, /**/);
// update the old paragraph's words
insetCur.paragraph().updateWords(insetCur.top());

View File

@ -25,6 +25,7 @@
#include "MetricsInfo.h"
#include "OutputParams.h"
#include "support/assert.h"
#include "support/debug.h"
#include "support/gettext.h"
@ -107,7 +108,7 @@ void InsetVSpace::edit(Cursor & cur, bool, EntryDirection)
void InsetVSpace::read(Lexer & lex)
{
BOOST_ASSERT(lex.isOK());
LASSERT(lex.isOK(), /**/);
string vsp;
lex >> vsp;
if (lex)

View File

@ -27,6 +27,7 @@
#include "graphics/PreviewLoader.h"
#include "graphics/Previews.h"
#include "support/assert.h"
#include "support/FileName.h"
#include "support/lstrings.h"
@ -82,7 +83,7 @@ graphics::PreviewLoader & getPreviewLoader(Buffer const & buffer)
docstring const statusMessage(BufferView const * bv, string const & snippet)
{
BOOST_ASSERT(bv);
LASSERT(bv, /**/);
Buffer const & buffer = bv->buffer();
graphics::PreviewLoader const & loader = getPreviewLoader(buffer);
@ -118,7 +119,7 @@ RenderPreview::getPreviewImage(Buffer const & buffer) const
void RenderPreview::metrics(MetricsInfo & mi, Dimension & dim) const
{
BOOST_ASSERT(mi.base.bv);
LASSERT(mi.base.bv, /**/);
graphics::PreviewImage const * const pimage =
getPreviewImage(mi.base.bv->buffer());
@ -142,7 +143,7 @@ void RenderPreview::metrics(MetricsInfo & mi, Dimension & dim) const
void RenderPreview::draw(PainterInfo & pi, int x, int y) const
{
BOOST_ASSERT(pi.base.bv);
LASSERT(pi.base.bv, /**/);
graphics::PreviewImage const * const pimage =
getPreviewImage(pi.base.bv->buffer());

View File

@ -21,7 +21,7 @@
#include "support/lstrings.h"
#include "support/textutils.h"
#include <boost/assert.hpp>
#include "support/assert.h"
using namespace std;
@ -80,7 +80,7 @@ void InsetMath::write(WriteStream & os) const
int InsetMath::plaintext(odocstream &, OutputParams const &) const
{
// all math plain text output shall take place in InsetMathHull
BOOST_ASSERT(false);
LASSERT(false, /**/);
return 0;
}

View File

@ -32,7 +32,7 @@
#include "support/gettext.h"
#include "support/lstrings.h"
#include <boost/assert.hpp>
#include "support/assert.h"
#include <sstream>
@ -1208,7 +1208,7 @@ void InsetMathGrid::doDispatch(Cursor & cur, FuncRequest & cmd)
docstring & special = colinfo_[cur.col()].special_;
if (!special.empty()) {
docstring::size_type i = special.rfind('|');
BOOST_ASSERT(i != docstring::npos);
LASSERT(i != docstring::npos, /**/);
special.erase(i, 1);
}
}
@ -1217,7 +1217,7 @@ void InsetMathGrid::doDispatch(Cursor & cur, FuncRequest & cmd)
docstring & special = colinfo_[cur.col()+1].special_;
if (!special.empty()) {
docstring::size_type i = special.find('|');
BOOST_ASSERT(i != docstring::npos);
LASSERT(i != docstring::npos, /**/);
special.erase(i, 1);
}
}

View File

@ -51,6 +51,7 @@
#include "frontends/Painter.h"
#include "support/assert.h"
#include "support/debug.h"
#include "support/gettext.h"
#include "support/lstrings.h"
@ -144,8 +145,8 @@ docstring hullName(HullType type)
static InsetLabel * dummy_pointer = 0;
InsetMathHull::InsetMathHull()
: InsetMathGrid(1, 1), type_(hullNone), nonum_(1, false), label_(1, dummy_pointer),
preview_(new RenderPreview(this))
: InsetMathGrid(1, 1), type_(hullNone), nonum_(1, false),
label_(1, dummy_pointer), preview_(new RenderPreview(this))
{
//lyxerr << "sizeof InsetMath: " << sizeof(InsetMath) << endl;
//lyxerr << "sizeof MetricsInfo: " << sizeof(MetricsInfo) << endl;
@ -157,8 +158,8 @@ InsetMathHull::InsetMathHull()
InsetMathHull::InsetMathHull(HullType type)
: InsetMathGrid(getCols(type), 1), type_(type), nonum_(1, false), label_(1, dummy_pointer),
preview_(new RenderPreview(this))
: InsetMathGrid(getCols(type), 1), type_(type), nonum_(1, false),
label_(1, dummy_pointer), preview_(new RenderPreview(this))
{
initMath();
setDefaults();
@ -478,7 +479,7 @@ bool InsetMathHull::notifyCursorLeaves(Cursor const & /*old*/, Cursor & cur)
docstring InsetMathHull::label(row_type row) const
{
BOOST_ASSERT(row < nrows());
LASSERT(row < nrows(), /**/);
if (InsetLabel * il = label_[row])
return il->screenLabel();
return docstring();
@ -769,7 +770,7 @@ void InsetMathHull::glueall()
void InsetMathHull::splitTo2Cols()
{
BOOST_ASSERT(ncols() == 1);
LASSERT(ncols() == 1, /**/);
InsetMathGrid::addCol(1);
for (row_type row = 0; row < nrows(); ++row) {
idx_type const i = 2 * row;
@ -782,7 +783,7 @@ void InsetMathHull::splitTo2Cols()
void InsetMathHull::splitTo3Cols()
{
BOOST_ASSERT(ncols() < 3);
LASSERT(ncols() < 3, /**/);
if (ncols() < 2)
splitTo2Cols();
InsetMathGrid::addCol(2);
@ -1027,8 +1028,8 @@ void InsetMathHull::infoize(odocstream & os) const
void InsetMathHull::check() const
{
BOOST_ASSERT(nonum_.size() == nrows());
BOOST_ASSERT(label_.size() == nrows());
LASSERT(nonum_.size() == nrows(), /**/);
LASSERT(label_.size() == nrows(), /**/);
}

View File

@ -52,6 +52,7 @@
#include "frontends/Painter.h"
#include "frontends/Selection.h"
#include "support/assert.h"
#include "support/debug.h"
#include "support/gettext.h"
#include "support/lstrings.h"
@ -111,7 +112,7 @@ void InsetMathNest::cursorPos(BufferView const & bv,
// to touch all (math)inset's draw() methods. Right now, we'll store
// absolute value, and make them here relative, only to make them
// absolute again when actually drawing the cursor. What a mess.
BOOST_ASSERT(&sl.inset() == this);
LASSERT(&sl.inset() == this, /**/);
MathData const & ar = sl.cell();
CoordCache const & coord_cache = bv.coordCache();
if (!coord_cache.getArrays().has(&ar)) {
@ -156,7 +157,7 @@ void InsetMathNest::metrics(MetricsInfo const & mi) const
bool InsetMathNest::idxNext(Cursor & cur) const
{
BOOST_ASSERT(&cur.inset() == this);
LASSERT(&cur.inset() == this, /**/);
if (cur.idx() == cur.lastidx())
return false;
++cur.idx();
@ -173,7 +174,7 @@ bool InsetMathNest::idxForward(Cursor & cur) const
bool InsetMathNest::idxPrev(Cursor & cur) const
{
BOOST_ASSERT(&cur.inset() == this);
LASSERT(&cur.inset() == this, /**/);
if (cur.idx() == 0)
return false;
--cur.idx();
@ -190,7 +191,7 @@ bool InsetMathNest::idxBackward(Cursor & cur) const
bool InsetMathNest::idxFirst(Cursor & cur) const
{
BOOST_ASSERT(&cur.inset() == this);
LASSERT(&cur.inset() == this, /**/);
if (nargs() == 0)
return false;
cur.idx() = 0;
@ -201,7 +202,7 @@ bool InsetMathNest::idxFirst(Cursor & cur) const
bool InsetMathNest::idxLast(Cursor & cur) const
{
BOOST_ASSERT(&cur.inset() == this);
LASSERT(&cur.inset() == this, /**/);
if (nargs() == 0)
return false;
cur.idx() = cur.lastidx();
@ -1421,7 +1422,7 @@ bool InsetMathNest::interpretChar(Cursor & cur, char_type c)
cur.backspace();
cur.niceInsert(MathAtom(new InsetMathComment));
} else if (c == '#') {
BOOST_ASSERT(cur.activeMacro());
LASSERT(cur.activeMacro(), /**/);
cur.activeMacro()->setName(name + docstring(1, c));
} else {
cur.backspace();

View File

@ -23,7 +23,7 @@
#include "support/debug.h"
#include <boost/assert.hpp>
#include "support/assert.h"
#include <ostream>
@ -45,7 +45,7 @@ InsetMathScript::InsetMathScript(bool up)
InsetMathScript::InsetMathScript(MathAtom const & at, bool up)
: InsetMathNest(2), cell_1_is_up_(up), limits_(0)
{
BOOST_ASSERT(nargs() >= 1);
LASSERT(nargs() >= 1, /**/);
cell(0).push_back(at);
}
@ -88,7 +88,7 @@ MathData const & InsetMathScript::down() const
{
if (nargs() == 3)
return cell(2);
BOOST_ASSERT(nargs() > 1);
LASSERT(nargs() > 1, /**/);
return cell(1);
}
@ -97,21 +97,21 @@ MathData & InsetMathScript::down()
{
if (nargs() == 3)
return cell(2);
BOOST_ASSERT(nargs() > 1);
LASSERT(nargs() > 1, /**/);
return cell(1);
}
MathData const & InsetMathScript::up() const
{
BOOST_ASSERT(nargs() > 1);
LASSERT(nargs() > 1, /**/);
return cell(1);
}
MathData & InsetMathScript::up()
{
BOOST_ASSERT(nargs() > 1);
LASSERT(nargs() > 1, /**/);
return cell(1);
}
@ -245,7 +245,7 @@ int InsetMathScript::dy1(BufferView const & bv) const
int InsetMathScript::dx0(BufferView const & bv) const
{
BOOST_ASSERT(hasDown());
LASSERT(hasDown(), /**/);
Dimension const dim = dimension(bv);
return hasLimits() ? (dim.wid - down().dimension(bv).width()) / 2 : nwid(bv);
}
@ -253,7 +253,7 @@ int InsetMathScript::dx0(BufferView const & bv) const
int InsetMathScript::dx1(BufferView const & bv) const
{
BOOST_ASSERT(hasUp());
LASSERT(hasUp(), /**/);
Dimension const dim = dimension(bv);
return hasLimits() ? (dim.wid - up().dimension(bv).width()) / 2 : nwid(bv) + nker(&bv);
}
@ -462,7 +462,7 @@ Inset::idx_type InsetMathScript::idxOfScript(bool up) const
return (cell_1_is_up_ == up) ? 1 : 0;
if (nargs() == 3)
return up ? 1 : 2;
BOOST_ASSERT(false);
LASSERT(false, /**/);
// Silence compiler
return 0;
}
@ -694,7 +694,7 @@ bool InsetMathScript::notifyCursorLeaves(Cursor const & old, Cursor & cur)
// should be on top of the cursor old.
Cursor insetCur = old;
int scriptSlice = insetCur.find(this);
BOOST_ASSERT(scriptSlice != -1);
LASSERT(scriptSlice != -1, /**/);
insetCur.cutOff(scriptSlice);
insetCur.recordUndoInset();

View File

@ -25,7 +25,7 @@
#include "support/debug.h"
#include <boost/assert.hpp>
#include "support/assert.h"
#include <sstream>
@ -107,7 +107,7 @@ vector<docstring> const & MacroData::defaults() const
void MacroData::unlock() const
{
--lockCount_;
BOOST_ASSERT(lockCount_ >= 0);
LASSERT(lockCount_ >= 0, /**/);
}
@ -133,7 +133,7 @@ void MacroData::updateData() const
if (queried_)
return;
BOOST_ASSERT(buffer_ != 0);
LASSERT(buffer_ != 0, /**/);
// Try to fix position DocIterator. Should not do anything in theory.
pos_.fixIfBroken();

View File

@ -36,7 +36,7 @@
#include "frontends/FontMetrics.h"
#include "frontends/Painter.h"
#include <boost/assert.hpp>
#include "support/assert.h"
#include <boost/next_prior.hpp>
#include <cstdlib>
@ -53,14 +53,14 @@ MathData::MathData(const_iterator from, const_iterator to)
MathAtom & MathData::operator[](pos_type pos)
{
BOOST_ASSERT(pos < size());
LASSERT(pos < size(), /**/);
return base_type::operator[](pos);
}
MathAtom const & MathData::operator[](pos_type pos) const
{
BOOST_ASSERT(pos < size());
LASSERT(pos < size(), /**/);
return base_type::operator[](pos);
}
@ -73,7 +73,7 @@ void MathData::insert(size_type pos, MathAtom const & t)
void MathData::insert(size_type pos, MathData const & ar)
{
BOOST_ASSERT(pos <= size());
LASSERT(pos <= size(), /**/);
base_type::insert(begin() + pos, ar.begin(), ar.end());
}
@ -459,7 +459,7 @@ void MathData::updateMacros(Cursor * cur, MacroContext const & mc)
InsetMath * inset = operator[](i).nucleus();
if (inset->asScriptInset())
inset = inset->asScriptInset()->nuc()[0].nucleus();
BOOST_ASSERT(inset->asMacro());
LASSERT(inset->asMacro(), /**/);
inset->asMacro()->updateRepresentation();
}
}

View File

@ -32,6 +32,7 @@
#include "frontends/Painter.h"
#include "support/assert.h"
#include "support/debug.h"
#include <ostream>
@ -194,7 +195,7 @@ void MathMacro::metrics(MetricsInfo & mi, Dimension & dim) const
&& editing_[mi.base.bv]) {
// Macro will be edited in a old-style list mode here:
BOOST_ASSERT(macro_ != 0);
LASSERT(macro_ != 0, /**/);
Dimension fontDim;
FontInfo labelFont = sane_font;
math_font_max_dim(labelFont, fontDim.asc, fontDim.des);
@ -231,7 +232,7 @@ void MathMacro::metrics(MetricsInfo & mi, Dimension & dim) const
dim.wid += 2;
metricsMarkers2(dim);
} else {
BOOST_ASSERT(macro_ != 0);
LASSERT(macro_ != 0, /**/);
// metrics are computed here for the cells,
// in the proxy we will then use the dim from the cache
@ -546,7 +547,7 @@ Inset * MathMacro::editXY(Cursor & cur, int x, int y)
void MathMacro::removeArgument(Inset::pos_type pos) {
if (displayMode_ == DISPLAY_NORMAL) {
BOOST_ASSERT(size_t(pos) < cells_.size());
LASSERT(size_t(pos) < cells_.size(), /**/);
cells_.erase(cells_.begin() + pos);
if (size_t(pos) < attachedArgsNum_)
--attachedArgsNum_;
@ -561,7 +562,7 @@ void MathMacro::removeArgument(Inset::pos_type pos) {
void MathMacro::insertArgument(Inset::pos_type pos) {
if (displayMode_ == DISPLAY_NORMAL) {
BOOST_ASSERT(size_t(pos) <= cells_.size());
LASSERT(size_t(pos) <= cells_.size(), /**/);
cells_.insert(cells_.begin() + pos, MathData());
if (size_t(pos) < attachedArgsNum_)
++attachedArgsNum_;
@ -575,7 +576,7 @@ void MathMacro::insertArgument(Inset::pos_type pos) {
void MathMacro::detachArguments(vector<MathData> & args, bool strip)
{
BOOST_ASSERT(displayMode_ == DISPLAY_NORMAL);
LASSERT(displayMode_ == DISPLAY_NORMAL, /**/);
args = cells_;
// strip off empty cells, but not more than arity-attachedArgsNum_
@ -596,7 +597,7 @@ void MathMacro::detachArguments(vector<MathData> & args, bool strip)
void MathMacro::attachArguments(vector<MathData> const & args, size_t arity, int optionals)
{
BOOST_ASSERT(displayMode_ == DISPLAY_NORMAL);
LASSERT(displayMode_ == DISPLAY_NORMAL, /**/);
cells_ = args;
attachedArgsNum_ = args.size();
cells_.resize(arity);
@ -662,7 +663,7 @@ void MathMacro::write(WriteStream & os) const
}
// normal mode
BOOST_ASSERT(macro_);
LASSERT(macro_, /**/);
// optional arguments make macros fragile
if (optionals_ > 0 && os.fragile())

View File

@ -36,6 +36,7 @@
#include "frontends/Painter.h"
#include "support/assert.h"
#include "support/convert.h"
#include "support/debug.h"
#include "support/gettext.h"
@ -618,7 +619,7 @@ bool MathMacroTemplate::notifyCursorLeaves(Cursor const & old, Cursor & cur)
// find this in cursor old
Cursor insetCur = old;
int scriptSlice = insetCur.find(this);
BOOST_ASSERT(scriptSlice != -1);
LASSERT(scriptSlice != -1, /**/);
insetCur.cutOff(scriptSlice);
commitEditChanges(insetCur);

View File

@ -817,7 +817,7 @@ void Parser::parse1(InsetMathGrid & grid, unsigned flags,
if (flags & FLAG_BRACE_LAST)
return;
error("found '}' unexpectedly");
//BOOST_ASSERT(false);
//LASSERT(false, /**/);
//add(cell, '}', LM_TC_TEX);
}

View File

@ -26,6 +26,7 @@
#include "sgml.h"
#include "TextClass.h"
#include "support/assert.h"
#include "support/convert.h"
#include "support/debug.h"
#include "support/lstrings.h"
@ -302,7 +303,7 @@ void docbookParagraphs(ParagraphList const & paragraphs,
ParagraphList::const_iterator par = paragraphs.begin();
ParagraphList::const_iterator pend = paragraphs.end();
BOOST_ASSERT(runparams.par_begin <= runparams.par_end);
LASSERT(runparams.par_begin <= runparams.par_end, /**/);
// if only part of the paragraphs will be outputed
if (runparams.par_begin != runparams.par_end) {
par = boost::next(paragraphs.begin(), runparams.par_begin);

View File

@ -30,6 +30,7 @@
#include "insets/InsetBibitem.h"
#include "insets/InsetOptArg.h"
#include "support/assert.h"
#include "support/debug.h"
#include "support/lstrings.h"
@ -38,11 +39,11 @@
using namespace std;
using namespace lyx::support;
namespace lyx {
namespace {
enum OpenEncoding {
none,
inputenc,
@ -745,7 +746,7 @@ void latexParagraphs(Buffer const & buf,
ParagraphList::const_iterator par = paragraphs.begin();
ParagraphList::const_iterator endpar = paragraphs.end();
BOOST_ASSERT(runparams.par_begin <= runparams.par_end);
LASSERT(runparams.par_begin <= runparams.par_end, /**/);
// if only part of the paragraphs will be outputed
if (runparams.par_begin != runparams.par_end) {
par = boost::next(paragraphs.begin(), runparams.par_begin);

View File

@ -23,7 +23,7 @@
#include "support/debug.h"
#include <boost/assert.hpp>
#include "support/assert.h"
#include <boost/next_prior.hpp>
using namespace std;
@ -164,7 +164,7 @@ void breakParagraphConservative(BufferParams const & bparams,
tmp.makeSameLayout(par);
BOOST_ASSERT(pos <= par.size());
LASSERT(pos <= par.size(), /**/);
if (pos < par.size()) {
// move everything behind the break position to the new paragraph

View File

@ -43,7 +43,7 @@
#include "support/debug.h"
#include "support/textutils.h"
#include <boost/assert.hpp>
#include "support/assert.h"
#include <boost/crc.hpp>
#include <ostream>
@ -71,8 +71,8 @@ RowPainter::RowPainter(PainterInfo & pi,
//lyxerr << "RowPainter: x: " << x_ << " xo: " << xo_ << " yo: " << yo_ << endl;
//row_.dump();
BOOST_ASSERT(pit >= 0);
BOOST_ASSERT(pit < int(text.paragraphs().size()));
LASSERT(pit >= 0, /**/);
LASSERT(pit < int(text.paragraphs().size()), /**/);
}
@ -97,7 +97,7 @@ void RowPainter::paintInset(Inset const * inset, pos_type const pos)
{
Font const font = text_metrics_.displayFont(pit_, pos);
BOOST_ASSERT(inset);
LASSERT(inset, /**/);
// Backup full_repaint status because some insets (InsetTabular)
// requires a full repaint
bool pi_full_repaint = pi_.full_repaint;
@ -126,7 +126,7 @@ void RowPainter::paintInset(Inset const * inset, pos_type const pos)
#ifdef DEBUG_METRICS
int const x1 = int(x_ - dim.width());
Dimension dim2;
BOOST_ASSERT(max_witdh_ > 0);
LASSERT(max_witdh_ > 0, /**/);
int right_margin = text_metrics_.rightMargin(pm_);
int const w = max_witdh_ - leftMargin() - right_margin;
MetricsInfo mi(pi_.base.bv, font.fontInfo(), w);
@ -143,9 +143,9 @@ void RowPainter::paintInset(Inset const * inset, pos_type const pos)
lyxerr << "Error: inset " << to_ascii(inset->getInsetName())
<< " draw ascent " << dim.descent()
<< "> metrics descent " << dim2.des << "." << endl;
BOOST_ASSERT(dim2.wid == dim.wid);
BOOST_ASSERT(dim2.asc == dim.asc);
BOOST_ASSERT(dim2.des == dim.des);
LASSERT(dim2.wid == dim.wid, /**/);
LASSERT(dim2.asc == dim.asc, /**/);
LASSERT(dim2.des == dim.des, /**/);
int const x2 = x1 + dim.wid;
int const y1 = yo_ + dim.des;
int const y2 = yo_ - dim.asc;

View File

@ -28,7 +28,7 @@
#include <QList>
#include <QTime>
#include <boost/assert.hpp>
#include "support/assert.h"
#include <boost/scoped_array.hpp>
#include <map>
@ -523,14 +523,14 @@ static int mymkdir(char const * pathname, unsigned long int mode)
bool FileName::createDirectory(int permission) const
{
BOOST_ASSERT(!empty());
LASSERT(!empty(), /**/);
return mymkdir(toFilesystemEncoding().c_str(), permission) == 0;
}
bool FileName::createPath() const
{
BOOST_ASSERT(!empty());
LASSERT(!empty(), /**/);
if (isDirectory())
return true;

View File

@ -41,6 +41,7 @@ liblyxsupport_la_SOURCES = \
FileMonitor.h \
FileMonitor.cpp \
RandomAccessList.h \
assert.h \
convert.cpp \
convert.h \
copied_ptr.h \

View File

@ -17,7 +17,7 @@
#include "support/Package.h"
#include "support/unicode.h"
#include <boost/assert.hpp>
#include "support/assert.h"
#include <cerrno>
@ -158,7 +158,7 @@ docstring const Messages::get(string const & m) const
pair<TranslationCache::iterator, bool> result =
cache_.insert(make_pair(m, trans));
BOOST_ASSERT(result.second);
LASSERT(result.second, /**/);
return result.first->second;
}

View File

@ -73,7 +73,7 @@ Package const & package()
// Commented out because package().locale_dir() can be called
// from the message translation code in Messages.cpp before
// init_package() is called. Lars is on the case...
// BOOST_ASSERT(initialised_);
// LASSERT(initialised_, /**/);
return package_;
}

View File

@ -134,7 +134,7 @@ Timeout & Timeout::setType(Type t)
Timeout & Timeout::setTimeout(unsigned int msec)
{
// Can't have a timeout of zero!
BOOST_ASSERT(msec);
LASSERT(msec, /**/);
timeout_ms = msec;
return *this;

View File

@ -12,7 +12,7 @@
#ifndef TRANSLATOR_H
#define TRANSLATOR_H
#include <boost/assert.hpp>
#include "support/assert.h"
#include <vector>
#include <utility>
@ -63,7 +63,7 @@ public:
/// Find the mapping for the first argument
T2 const & find(T1 const & first) const
{
BOOST_ASSERT(!map.empty());
LASSERT(!map.empty(), /**/);
const_iterator it = map.begin();
const_iterator end = map.end();
for (; it != end; ++it)
@ -75,7 +75,7 @@ public:
/// Find the mapping for the second argument
T1 const & find(T2 const & second) const
{
BOOST_ASSERT(!map.empty());
LASSERT(!map.empty(), /**/);
const_iterator it = map.begin();
const_iterator end = map.end();
for (; it != end; ++it)

View File

@ -17,6 +17,8 @@
#include "support/lstrings.h"
#include "support/FileName.h"
#include <boost/assert.hpp>
#include <iostream>
#include <iomanip>
@ -185,5 +187,11 @@ LyXErr & operator<<(LyXErr & l, ios_base &(*t)(ios_base &))
// The global instance
LyXErr lyxerr;
void doAssert(char const * expr, char const * file, long line)
{
LYXERR0("ASSERTION " << expr << " VIOLATED in " << file << ":" << line);
// comment this out if not needed
BOOST_ASSERT(false);
}
} // namespace lyx

View File

@ -22,7 +22,7 @@
#include <QFile>
#include <boost/assert.hpp>
#include "support/assert.h"
using namespace std;
@ -33,7 +33,7 @@ docstring const from_ascii(char const * ascii)
{
docstring s;
for (char const * c = ascii; *c; ++c) {
BOOST_ASSERT(static_cast<unsigned char>(*c) < 0x80);
LASSERT(static_cast<unsigned char>(*c) < 0x80, /**/);
s.push_back(*c);
}
return s;
@ -44,7 +44,7 @@ docstring const from_ascii(string const & ascii)
{
int const len = ascii.length();
for (int i = 0; i < len; ++i)
BOOST_ASSERT(static_cast<unsigned char>(ascii[i]) < 0x80);
LASSERT(static_cast<unsigned char>(ascii[i]) < 0x80, /**/);
return docstring(ascii.begin(), ascii.end());
}
@ -55,7 +55,7 @@ string const to_ascii(docstring const & ucs4)
string ascii;
ascii.resize(len);
for (int i = 0; i < len; ++i) {
BOOST_ASSERT(ucs4[i] < 0x80);
LASSERT(ucs4[i] < 0x80, /**/);
ascii[i] = static_cast<char>(ucs4[i]);
}
return ascii;
@ -161,7 +161,7 @@ bool operator==(lyx::docstring const & l, char const * r)
lyx::docstring::const_iterator it = l.begin();
lyx::docstring::const_iterator end = l.end();
for (; it != end; ++it, ++r) {
BOOST_ASSERT(static_cast<unsigned char>(*r) < 0x80);
LASSERT(static_cast<unsigned char>(*r) < 0x80, /**/);
if (!*r)
return false;
if (*it != static_cast<lyx::docstring::value_type>(*r))
@ -175,7 +175,7 @@ lyx::docstring operator+(lyx::docstring const & l, char const * r)
{
lyx::docstring s(l);
for (char const * c = r; *c; ++c) {
BOOST_ASSERT(static_cast<unsigned char>(*c) < 0x80);
LASSERT(static_cast<unsigned char>(*c) < 0x80, /**/);
s.push_back(*c);
}
return s;
@ -186,7 +186,7 @@ lyx::docstring operator+(char const * l, lyx::docstring const & r)
{
lyx::docstring s;
for (char const * c = l; *c; ++c) {
BOOST_ASSERT(static_cast<unsigned char>(*c) < 0x80);
LASSERT(static_cast<unsigned char>(*c) < 0x80, /**/);
s.push_back(*c);
}
s += r;
@ -196,7 +196,7 @@ lyx::docstring operator+(char const * l, lyx::docstring const & r)
lyx::docstring operator+(lyx::docstring const & l, char r)
{
BOOST_ASSERT(static_cast<unsigned char>(r) < 0x80);
LASSERT(static_cast<unsigned char>(r) < 0x80, /**/);
docstring s = l;
s += docstring::value_type(r);
return s;
@ -205,7 +205,7 @@ lyx::docstring operator+(lyx::docstring const & l, char r)
lyx::docstring operator+(char l, lyx::docstring const & r)
{
BOOST_ASSERT(static_cast<unsigned char>(l) < 0x80);
LASSERT(static_cast<unsigned char>(l) < 0x80, /**/);
return lyx::docstring::value_type(l) + r;
}
@ -213,7 +213,7 @@ lyx::docstring operator+(char l, lyx::docstring const & r)
lyx::docstring & operator+=(lyx::docstring & l, char const * r)
{
for (char const * c = r; *c; ++c) {
BOOST_ASSERT(static_cast<unsigned char>(*c) < 0x80);
LASSERT(static_cast<unsigned char>(*c) < 0x80, /**/);
l.push_back(*c);
}
return l;
@ -222,7 +222,7 @@ lyx::docstring & operator+=(lyx::docstring & l, char const * r)
lyx::docstring & operator+=(lyx::docstring & l, char r)
{
BOOST_ASSERT(static_cast<unsigned char>(r) < 0x80);
LASSERT(static_cast<unsigned char>(r) < 0x80, /**/);
l.push_back(r);
return l;
}

View File

@ -36,7 +36,7 @@
#include <QDir>
#include <boost/assert.hpp>
#include "support/assert.h"
#include <boost/regex.hpp>
#include <fcntl.h>

View File

@ -18,7 +18,7 @@
#include "support/textutils.h"
#include <boost/tokenizer.hpp>
#include <boost/assert.hpp>
#include "support/assert.h"
#include <algorithm>
@ -51,7 +51,7 @@ string const & empty_string()
*/
static inline char_type qchar_to_ucs4(QChar const & qchar)
{
BOOST_ASSERT(is_utf16(static_cast<char_type>(qchar.unicode())));
LASSERT(is_utf16(static_cast<char_type>(qchar.unicode())), /**/);
return static_cast<char_type>(qchar.unicode());
}
@ -65,7 +65,7 @@ static inline char_type qchar_to_ucs4(QChar const & qchar)
*/
static inline QChar const ucs4_to_qchar(char_type const ucs4)
{
BOOST_ASSERT(is_utf16(ucs4));
LASSERT(is_utf16(ucs4), /**/);
return QChar(static_cast<unsigned short>(ucs4));
}
@ -372,14 +372,14 @@ bool isAscii(string const & str)
char lowercase(char c)
{
BOOST_ASSERT(static_cast<unsigned char>(c) < 0x80);
LASSERT(static_cast<unsigned char>(c) < 0x80, /**/);
return char(tolower(c));
}
char uppercase(char c)
{
BOOST_ASSERT(static_cast<unsigned char>(c) < 0x80);
LASSERT(static_cast<unsigned char>(c) < 0x80, /**/);
return char(toupper(c));
}
@ -628,7 +628,7 @@ template<typename String> inline
String const subst_string(String const & a,
String const & oldstr, String const & newstr)
{
BOOST_ASSERT(!oldstr.empty());
LASSERT(!oldstr.empty(), /**/);
String lstr = a;
size_t i = 0;
size_t const olen = oldstr.length();
@ -643,7 +643,7 @@ String const subst_string(String const & a,
docstring const subst_string(docstring const & a,
docstring const & oldstr, docstring const & newstr)
{
BOOST_ASSERT(!oldstr.empty());
LASSERT(!oldstr.empty(), /**/);
docstring lstr = a;
size_t i = 0;
size_t const olen = oldstr.length();
@ -687,7 +687,7 @@ docstring const subst(docstring const & a,
docstring const trim(docstring const & a, char const * p)
{
BOOST_ASSERT(p);
LASSERT(p, /**/);
if (a.empty() || !*p)
return a;
@ -706,7 +706,7 @@ docstring const trim(docstring const & a, char const * p)
string const trim(string const & a, char const * p)
{
BOOST_ASSERT(p);
LASSERT(p, /**/);
if (a.empty() || !*p)
return a;
@ -724,7 +724,7 @@ string const trim(string const & a, char const * p)
string const rtrim(string const & a, char const * p)
{
BOOST_ASSERT(p);
LASSERT(p, /**/);
if (a.empty() || !*p)
return a;
@ -741,7 +741,7 @@ string const rtrim(string const & a, char const * p)
docstring const rtrim(docstring const & a, char const * p)
{
BOOST_ASSERT(p);
LASSERT(p, /**/);
if (a.empty() || !*p)
return a;
@ -758,7 +758,7 @@ docstring const rtrim(docstring const & a, char const * p)
string const ltrim(string const & a, char const * p)
{
BOOST_ASSERT(p);
LASSERT(p, /**/);
if (a.empty() || !*p)
return a;
size_t l = a.find_first_not_of(p);
@ -770,7 +770,7 @@ string const ltrim(string const & a, char const * p)
docstring const ltrim(docstring const & a, char const * p)
{
BOOST_ASSERT(p);
LASSERT(p, /**/);
if (a.empty() || !*p)
return a;
size_t l = a.find_first_not_of(from_ascii(p));
@ -872,7 +872,7 @@ docstring const escape(docstring const & lab)
// encode bigger values. Test for 2^24 because we
// can encode that with the 6 hex digits that are
// needed for 21 bits anyway.
BOOST_ASSERT(c < (1 << 24));
LASSERT(c < (1 << 24), /**/);
enc += '=';
enc += hexdigit[(c>>20) & 15];
enc += hexdigit[(c>>16) & 15];
@ -995,7 +995,7 @@ docstring const internalLineEnding(docstring const & str)
template<>
docstring bformat(docstring const & fmt, int arg1)
{
BOOST_ASSERT(contains(fmt, from_ascii("%1$d")));
LASSERT(contains(fmt, from_ascii("%1$d")), /**/);
docstring const str = subst(fmt, from_ascii("%1$d"), convert<docstring>(arg1));
return subst(str, from_ascii("%%"), from_ascii("%"));
}
@ -1004,7 +1004,7 @@ docstring bformat(docstring const & fmt, int arg1)
template<>
docstring bformat(docstring const & fmt, long arg1)
{
BOOST_ASSERT(contains(fmt, from_ascii("%1$d")));
LASSERT(contains(fmt, from_ascii("%1$d")), /**/);
docstring const str = subst(fmt, from_ascii("%1$d"), convert<docstring>(arg1));
return subst(str, from_ascii("%%"), from_ascii("%"));
}
@ -1013,7 +1013,7 @@ docstring bformat(docstring const & fmt, long arg1)
template<>
docstring bformat(docstring const & fmt, unsigned int arg1)
{
BOOST_ASSERT(contains(fmt, from_ascii("%1$d")));
LASSERT(contains(fmt, from_ascii("%1$d")), /**/);
docstring const str = subst(fmt, from_ascii("%1$d"), convert<docstring>(arg1));
return subst(str, from_ascii("%%"), from_ascii("%"));
}
@ -1022,7 +1022,7 @@ docstring bformat(docstring const & fmt, unsigned int arg1)
template<>
docstring bformat(docstring const & fmt, docstring arg1)
{
BOOST_ASSERT(contains(fmt, from_ascii("%1$s")));
LASSERT(contains(fmt, from_ascii("%1$s")), /**/);
docstring const str = subst(fmt, from_ascii("%1$s"), arg1);
return subst(str, from_ascii("%%"), from_ascii("%"));
}
@ -1031,7 +1031,7 @@ docstring bformat(docstring const & fmt, docstring arg1)
template<>
docstring bformat(docstring const & fmt, char * arg1)
{
BOOST_ASSERT(contains(fmt, from_ascii("%1$s")));
LASSERT(contains(fmt, from_ascii("%1$s")), /**/);
docstring const str = subst(fmt, from_ascii("%1$s"), from_ascii(arg1));
return subst(str, from_ascii("%%"), from_ascii("%"));
}
@ -1040,8 +1040,8 @@ docstring bformat(docstring const & fmt, char * arg1)
template<>
docstring bformat(docstring const & fmt, docstring arg1, docstring arg2)
{
BOOST_ASSERT(contains(fmt, from_ascii("%1$s")));
BOOST_ASSERT(contains(fmt, from_ascii("%2$s")));
LASSERT(contains(fmt, from_ascii("%1$s")), /**/);
LASSERT(contains(fmt, from_ascii("%2$s")), /**/);
docstring str = subst(fmt, from_ascii("%1$s"), arg1);
str = subst(str, from_ascii("%2$s"), arg2);
return subst(str, from_ascii("%%"), from_ascii("%"));
@ -1051,8 +1051,8 @@ docstring bformat(docstring const & fmt, docstring arg1, docstring arg2)
template<>
docstring bformat(docstring const & fmt, char const * arg1, docstring arg2)
{
BOOST_ASSERT(contains(fmt, from_ascii("%1$s")));
BOOST_ASSERT(contains(fmt, from_ascii("%2$s")));
LASSERT(contains(fmt, from_ascii("%1$s")), /**/);
LASSERT(contains(fmt, from_ascii("%2$s")), /**/);
docstring str = subst(fmt, from_ascii("%1$s"), from_ascii(arg1));
str = subst(fmt, from_ascii("%2$s"), arg2);
return subst(str, from_ascii("%%"), from_ascii("%"));
@ -1062,8 +1062,8 @@ docstring bformat(docstring const & fmt, char const * arg1, docstring arg2)
template<>
docstring bformat(docstring const & fmt, int arg1, int arg2)
{
BOOST_ASSERT(contains(fmt, from_ascii("%1$d")));
BOOST_ASSERT(contains(fmt, from_ascii("%2$d")));
LASSERT(contains(fmt, from_ascii("%1$d")), /**/);
LASSERT(contains(fmt, from_ascii("%2$d")), /**/);
docstring str = subst(fmt, from_ascii("%1$d"), convert<docstring>(arg1));
str = subst(str, from_ascii("%2$d"), convert<docstring>(arg2));
return subst(str, from_ascii("%%"), from_ascii("%"));
@ -1073,9 +1073,9 @@ docstring bformat(docstring const & fmt, int arg1, int arg2)
template<>
docstring bformat(docstring const & fmt, docstring arg1, docstring arg2, docstring arg3)
{
BOOST_ASSERT(contains(fmt, from_ascii("%1$s")));
BOOST_ASSERT(contains(fmt, from_ascii("%2$s")));
BOOST_ASSERT(contains(fmt, from_ascii("%3$s")));
LASSERT(contains(fmt, from_ascii("%1$s")), /**/);
LASSERT(contains(fmt, from_ascii("%2$s")), /**/);
LASSERT(contains(fmt, from_ascii("%3$s")), /**/);
docstring str = subst(fmt, from_ascii("%1$s"), arg1);
str = subst(str, from_ascii("%2$s"), arg2);
str = subst(str, from_ascii("%3$s"), arg3);
@ -1087,10 +1087,10 @@ template<>
docstring bformat(docstring const & fmt,
docstring arg1, docstring arg2, docstring arg3, docstring arg4)
{
BOOST_ASSERT(contains(fmt, from_ascii("%1$s")));
BOOST_ASSERT(contains(fmt, from_ascii("%2$s")));
BOOST_ASSERT(contains(fmt, from_ascii("%3$s")));
BOOST_ASSERT(contains(fmt, from_ascii("%4$s")));
LASSERT(contains(fmt, from_ascii("%1$s")), /**/);
LASSERT(contains(fmt, from_ascii("%2$s")), /**/);
LASSERT(contains(fmt, from_ascii("%3$s")), /**/);
LASSERT(contains(fmt, from_ascii("%4$s")), /**/);
docstring str = subst(fmt, from_ascii("%1$s"), arg1);
str = subst(str, from_ascii("%2$s"), arg2);
str = subst(str, from_ascii("%3$s"), arg3);

View File

@ -24,7 +24,7 @@
#include "support/lstrings.h"
#include "support/ExceptionMessage.h"
#include <boost/assert.hpp>
#include "support/assert.h"
#include <cstdlib>
#include <vector>
@ -211,7 +211,7 @@ static string const get_long_path(string const & short_path)
long_path.resize(result);
result = GetLongPathName(short_path.c_str(),
&long_path[0], long_path.size());
BOOST_ASSERT(result <= long_path.size());
LASSERT(result <= long_path.size(), /**/);
}
return (result == 0) ? short_path : to_utf8(from_filesystem8bit(&long_path[0]));
@ -329,7 +329,7 @@ string const GetFolderPath::operator()(folder_id _id) const
id = CSIDL_APPDATA;
break;
default:
BOOST_ASSERT(false);
LASSERT(false, /**/);
}
HRESULT const result = (folder_path_func_)(0, id, 0,
SHGFP_TYPE_CURRENT,

View File

@ -10,7 +10,7 @@
#include <config.h>
#include <boost/assert.hpp>
#include "support/assert.h"
#include <cstdlib>
#include <exception>
@ -22,7 +22,7 @@ namespace boost {
#ifndef BOOST_NO_EXCEPTIONS
void throw_exception(exception const & /*e*/)
{
BOOST_ASSERT(false);
LASSERT(false, /**/);
}
#endif

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