]> git.lyx.org Git - lyx.git/commitdiff
Change Assert to BOOST_ASSERT.
authorLars Gullik Bjønnes <larsbj@gullik.org>
Tue, 9 Sep 2003 17:25:35 +0000 (17:25 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Tue, 9 Sep 2003 17:25:35 +0000 (17:25 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7722 a592a061-630c-0410-9148-cb99ea01b6c8

104 files changed:
ChangeLog
configure.ac
src/BranchList.C
src/BufferView.C
src/Bullet.C
src/ChangeLog
src/CutAndPaste.C
src/LColor.C
src/MenuBackend.C
src/PrinterParams.C
src/aspell.C
src/author.C
src/boost.C
src/buffer.C
src/bufferlist.C
src/bufferparams.C
src/changes.C
src/counters.C
src/frontends/ChangeLog
src/frontends/Timeout.C
src/frontends/controllers/ButtonController.C
src/frontends/controllers/ChangeLog
src/frontends/controllers/ControlButtons.C
src/frontends/controllers/ControlDocument.C
src/frontends/controllers/ControlExternal.C
src/frontends/controllers/ControlMath.C
src/frontends/controllers/ControlParagraph.C
src/frontends/controllers/ControlPrint.C
src/frontends/controllers/ControlTabular.C
src/frontends/controllers/Dialog.C
src/frontends/controllers/Kernel.C
src/frontends/controllers/ViewBase.C
src/frontends/controllers/biblio.C
src/frontends/gnome/ChangeLog
src/frontends/gnome/GView.C
src/frontends/gnome/GnomeBase.C
src/frontends/gtk/ChangeLog
src/frontends/gtk/GPainter.C
src/frontends/qt2/BulletsModule.C
src/frontends/qt2/ChangeLog
src/frontends/qt2/QDocument.C
src/frontends/qt2/panelstack.C
src/frontends/xforms/ChangeLog
src/frontends/xforms/Color.C
src/frontends/xforms/FormBase.C
src/frontends/xforms/FormColorpicker.C
src/frontends/xforms/FormDialogView.C
src/frontends/xforms/FormMathsBitmap.C
src/frontends/xforms/FormMathsMatrix.C
src/frontends/xforms/FormParagraph.C
src/frontends/xforms/FormPreferences.C
src/frontends/xforms/RadioButtonGroup.C
src/frontends/xforms/Tooltips.C
src/frontends/xforms/XFormsMenubar.C
src/frontends/xforms/checkedwidgets.C
src/frontends/xforms/xformsImage.C
src/frontends/xforms/xforms_helpers.C
src/frontends/xforms/xforms_resize.C
src/graphics/ChangeLog
src/graphics/GraphicsCacheItem.C
src/graphics/Previews.C
src/insets/ChangeLog
src/insets/ExternalTemplate.C
src/insets/insetcaption.C
src/insets/insetcollapsable.C
src/insets/insetexternal.C
src/insets/insetgraphics.C
src/insets/insetinclude.C
src/insets/insetquotes.C
src/insets/insettabular.C
src/insets/mailinset.C
src/insets/renderers.C
src/lyxfunc.C
src/lyxrow_funcs.C
src/lyxtextclass.C
src/mathed/formulabase.C
src/mathed/math_cursor.C
src/mathed/math_data.C
src/mathed/math_hullinset.C
src/mathed/math_iterator.C
src/mathed/math_parser.C
src/mathed/math_pos.C
src/mathed/math_scriptinset.C
src/paragraph.C
src/paragraph_funcs.C
src/paragraph_pimpl.C
src/pspell.C
src/rowpainter.C
src/support/ChangeLog
src/support/FileInfo.C
src/support/LAssert.C [deleted file]
src/support/LAssert.h [deleted file]
src/support/Makefile.am
src/support/filename.C
src/support/filetools.C
src/support/lstrings.C
src/support/lyxstring.C
src/support/translator.h
src/support/userinfo.C
src/tabular.C
src/tex2lyx/tex2lyx.C
src/text.C
src/text2.C
src/text3.C

index 52f1fcfbdc3e25e9620a5cd4e9fdbfded95375ef..546cd0c1265954981015b86089a06517063f4e84 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2003-09-09  Lars Gullik Bjønnes  <larsbj@lyx.org>
+
+       * configure.ac (AH_BOTTOM): add blurb for BOOST_ASSERT
+
 2003-09-08  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
 
        * README.MacOSX: new file.
index 9ae83b7af5d5dce13f7a469d74bd64149d13efb7..0602771db3212ca9bd4852ce5243ace728b7c724 100644 (file)
@@ -190,7 +190,7 @@ for frontend in $FRONTENDS ; do
   dnl  ;;
     gtk)
          XFORMS_DO_IT_ALL
-         PKG_CHECK_MODULES(GTK_FRONTEND, gtkmm-2.0 libglademm-2.0)
+         PKG_CHECK_MODULES(GTK_FRONTEND, gtkmm-2.0 libglademm-2.0)
          FRONTENDS_PROGS="$FRONTENDS_PROGS lyx-gtk\$(EXEEXT)"
          FRONTENDS_SUBDIRS="$FRONTENDS_SUBDIRS xforms gtk"
          RPM_FRONTEND="gtk"
@@ -371,6 +371,12 @@ int mkstemp(char*);
 #define USE_BOOST_FORMAT 0
 #endif
 
+#if defined(ENABLE_ASSERTIONS)
+#define BOOST_ENABLE_ASSERT_HANDLER 1
+#else
+#define BOOST_DISABLE_ASSERTS 1
+#endif
+
 #define BOOST_DISABLE_THREADS 1
 #define BOOST_NO_WREGEX 1
 #define BOOST_NO_WSTRING 1
index f9ab44df823e0681dddd30fe498190a42c0c7cf8..fab0607e0f15fe7ee476fed229632e64dae85c3f 100644 (file)
@@ -1,23 +1,23 @@
 /**
- * \file BranchList.C 
+ * \file BranchList.C
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
  * \author Martin Vermeer
- * 
+ *
  * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
 
 #include "BranchList.h"
-#include "support/LAssert.h"
+
+#include <boost/assert.hpp>
 
 #include <functional>
 
 using std::bind2nd;
 using std::binary_function;
-using namespace lyx::support;
 
 
 string const Branch::getBranch() const
@@ -71,7 +71,7 @@ string BranchList::getColor(string const & s) const
                        return it->getColor();
                }
        }
-       Assert(false); // Always
+       BOOST_ASSERT(false); // Always
        return string(); // never gets here
 }
 
@@ -87,7 +87,7 @@ void BranchList::setColor(string const & s, string const & val)
                        return;
                }
        }
-       Assert(false);
+       BOOST_ASSERT(false);
 }
 
 
@@ -131,7 +131,7 @@ void BranchList::add(string const & s)
                }
                if (j == string::npos)
                        break;
-               i = j + 1; 
+               i = j + 1;
        }
 }
 
@@ -141,7 +141,7 @@ namespace {
 struct match : public binary_function<Branch, string, bool> {
        bool operator()(Branch const & br, string const & s) const {
        return (br.getBranch() == s);
-       }                                                                       
+       }
 };
 
 } // namespace anon.
@@ -158,7 +158,7 @@ bool BranchList::selected(string const & s) const
        List::const_iterator it = list.begin();
        List::const_iterator end = list.end();
        for (; it != end; ++it) {
-               if (s == it->getBranch()) 
+               if (s == it->getBranch())
                        return it->getSelected();
        }
        return false;
@@ -182,12 +182,12 @@ string BranchList::allBranches() const
 
 
 string BranchList::allSelected() const
-{      
+{
        List::const_iterator it = list.begin();
        List::const_iterator end = list.end();
        string ret;
        for (; it != end; ++it) {
-               if (it->getSelected()) 
+               if (it->getSelected())
                        ret += it->getBranch() + separator();
        }
        // remove final '|':
index 1dae06d81ef7e0b75c86be7ec4fe4ab274bf23ca..0517a129fae4c5b1a4378a2cf8c1de45ab106acd 100644 (file)
@@ -40,7 +40,6 @@
 #include "insets/updatableinset.h"
 
 #include "support/filetools.h"
-#include "support/LAssert.h"
 #include "support/lyxalgo.h" // lyx_count
 
 
@@ -260,7 +259,7 @@ bool BufferView::insertLyXFile(string const & filen)
        //
        // Moved from lyx_cb.C (Lgb)
 {
-       Assert(!filen.empty());
+       BOOST_ASSERT(!filen.empty());
 
        string const fname = MakeAbsPath(filen);
 
index d33b7ef662cb111896ec08a46f6907fcc5886af2..b8416577747109e02a1a1f3d7f96b29d99aa07c7 100644 (file)
@@ -17,9 +17,9 @@
 #include <config.h>
 
 #include "Bullet.h"
-#include "support/LAssert.h"
 
-using namespace lyx::support;
+#include <boost/assert.hpp>
+
 
 /** The four LaTeX itemize environment default bullets
  */
@@ -354,25 +354,25 @@ string const Bullet::bulletEntry(int f, int c)
 void Bullet::testInvariant() const
 {
 #ifdef ENABLE_ASSERTIONS
-       Assert(font >= MIN);
-       Assert(font < FONTMAX);
-       Assert(character >= MIN);
-       Assert(character < CHARMAX);
-       Assert(size >= MIN);
-       Assert(size < SIZEMAX);
-       Assert(user_text >= -1);
-       Assert(user_text <= 1);
+       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);
        // now some relational/operational tests
        if (user_text == 1) {
-               Assert(font == -1 && (character == -1 && size == -1));
-               //        Assert(!text.empty()); // this isn't necessarily an error
+               BOOST_ASSERT(font == -1 && (character == -1 && size == -1));
+               //        BOOST_ASSERT(!text.empty()); // this isn't necessarily an error
        }
        //      else if (user_text == -1) {
-       //        Assert(!text.empty()); // this also isn't necessarily an error
+       //        BOOST_ASSERT(!text.empty()); // this also isn't necessarily an error
        //      }
        //      else {
        //        // user_text == 0
-       //        Assert(text.empty()); // not usually true
+       //        BOOST_ASSERT(text.empty()); // not usually true
        //      }
 #endif
 }
index 6206b6c6e62110ef2c3ddd4fcd530113b6fceb0b..3a34294a06b1ac944a043bc7c095b91509afd805 100644 (file)
@@ -1,13 +1,22 @@
+2003-09-09  Lars Gullik Bjønnes  <larsbj@lyx.org>
+
+       * boost.C (emergencyCleanup): moved here from LAssert.c
+       (assertion_failed): new function, called by BOOST_ASSERT
+
+       * several files: change Assert to BOOST_ASSERT
+
 2003-09-09  Angus Leeming  <leeming@lyx.org>
 
-       * buffer.[Ch]: Add an Impl class and move Buffer's member variables into it.
-       As a result move several header files out of buffer.h.
+       * buffer.[Ch]: Add an Impl class and move Buffer's member
+       variables into it. As a result move several header files out of
+       buffer.h. 
 
        Add header files to lots of .C files all over the tree as a result.
 
 2003-09-09  Angus Leeming  <leeming@lyx.org>
 
-       * buffer.[Ch]: make Buffer's member variables private. Add accessor functions.
+       * buffer.[Ch]: make Buffer's member variables private. Add
+       accessor functions. 
 
        Lots of changes all over the tree as a result.
 
        * insets/insetminipage.C:
        * insets/insetnote.C:
        * insets/insetoptarg.C: add header files needed to compile again.
-       
+
 2003-09-06  Angus Leeming  <leeming@lyx.org>
 
        * RowList_fwd.h: new file, forward-declaring Row rather than
index f3224be904e6bc3feb9f7aa16c0f974f3dfa9d8b..41a4d82bf3794528d4731be539db844c99808573 100644 (file)
@@ -27,9 +27,9 @@
 #include "insets/insetinclude.h"
 #include "insets/insettabular.h"
 
-#include "support/LAssert.h"
 #include "support/lstrings.h"
 
+
 using std::for_each;
 using std::make_pair;
 using std::pair;
@@ -178,9 +178,9 @@ bool CutAndPaste::copySelection(ParagraphList::iterator startpit,
                                ParagraphList::iterator endpit,
                                int start, int end, textclass_type tc)
 {
-       Assert(0 <= start && start <= startpit->size());
-       Assert(0 <= end && end <= endpit->size());
-       Assert(startpit != endpit || start <= end);
+       BOOST_ASSERT(0 <= start && start <= startpit->size());
+       BOOST_ASSERT(0 <= end && end <= endpit->size());
+       BOOST_ASSERT(startpit != endpit || start <= end);
 
        ParagraphList paragraphs;
 
@@ -225,7 +225,7 @@ CutAndPaste::pasteSelection(Buffer const & buffer,
        if (!checkPastePossible())
                return make_pair(PitPosPair(pit, pos), pit);
 
-       Assert (pos <= pit->size());
+       BOOST_ASSERT (pos <= pit->size());
 
        // Make a copy of the CaP paragraphs.
        ParagraphList simple_cut_clone = cuts[cut_index].first;
@@ -380,7 +380,7 @@ int CutAndPaste::SwitchLayoutsBetweenClasses(textclass_type c1,
                                             ParagraphList & pars,
                                             ErrorList & errorlist)
 {
-       Assert(!pars.empty());
+       BOOST_ASSERT(!pars.empty());
 
        int ret = 0;
        if (c1 == c2)
index b5aeb412cc10e6c1120b4c364367da8a31c64e3d..a1eca5898309fbe4f3a0ed1e1fb732395aa3fd27 100644 (file)
@@ -18,7 +18,6 @@
 
 #include "debug.h"
 #include "LColor.h"
-#include "support/LAssert.h"
 #include "gettext.h"
 #include "support/lstrings.h"
 
@@ -172,18 +171,18 @@ void LColor::operator=(LColor const & c)
 }
 
 
-void LColor::fill(LColor::color c, 
+void LColor::fill(LColor::color c,
                                string const & lyxname,
-                               string const & x11name, 
-                               string const & latexname, 
-                               string const & guiname) 
+                               string const & x11name,
+                               string const & latexname,
+                               string const & guiname)
 {
        ColorEntry ce;
        ce.lcolor = c;
-       ce.guiname = guiname.c_str();   
-       ce.latexname = latexname.c_str();       
-       ce.x11name = x11name.c_str();   
-       ce.lyxname = lyxname.c_str();   
+       ce.guiname = guiname.c_str();
+       ce.latexname = latexname.c_str();
+       ce.x11name = x11name.c_str();
+       ce.lyxname = lyxname.c_str();
        pimpl_->fill(ce);
 }
 
@@ -201,10 +200,10 @@ string const LColor::getGUIName(string const &  s) const
 {
        Pimpl::Transform::const_iterator ici = pimpl_->transform.find(s);
        if (ici != pimpl_->transform.end()) {
-               Pimpl::InfoTab::const_iterator 
+               Pimpl::InfoTab::const_iterator
                        it = pimpl_->infotab.find(ici->second);
-               if (it != pimpl_->infotab.end()) 
-                       return it->second.guiname;      
+               if (it != pimpl_->infotab.end())
+                       return it->second.guiname;
        }
        return "none";
 }
@@ -227,9 +226,9 @@ string const LColor::getX11Name(string const & s) const
 {
        Pimpl::Transform::const_iterator ici = pimpl_->transform.find(s);
        if (ici != pimpl_->transform.end()) {
-               Pimpl::InfoTab::const_iterator 
+               Pimpl::InfoTab::const_iterator
                        it = pimpl_->infotab.find(ici->second);
-               if (it != pimpl_->infotab.end()) 
+               if (it != pimpl_->infotab.end())
                        return it->second.x11name;
        }
        lyxerr << "LyX internal error: Missing color"
@@ -252,9 +251,9 @@ string const LColor::getLaTeXName(string const & s) const
 {
        Pimpl::Transform::const_iterator ici = pimpl_->transform.find(s);
        if (ici != pimpl_->transform.end()) {
-               Pimpl::InfoTab::const_iterator 
+               Pimpl::InfoTab::const_iterator
                        it = pimpl_->infotab.find(ici->second);
-               if (it != pimpl_->infotab.end()) 
+               if (it != pimpl_->infotab.end())
                        return it->second.latexname;
        }
        return "black";
@@ -284,7 +283,7 @@ void LColor::setColor(LColor::color col, string const & x11name)
                return;
        }
        lyxerr << "LyX internal error: color and such." << endl;
-       Assert(false);
+       BOOST_ASSERT(false);
 }
 
 
index d043b8313cdd86f1bb694c33923797a4befae768..b1379b29ca1034ed8ae80c7c53951903ddc3c09b 100644 (file)
@@ -40,7 +40,6 @@
 #include "frontends/LyXView.h"
 
 #include "support/filetools.h"
-#include "support/LAssert.h"
 #include "support/lyxfunctional.h"
 #include "support/lstrings.h"
 #include "support/tostr.h"
@@ -829,7 +828,7 @@ Menu const & MenuBackend::getMenu(string const & name) const
                                     lyx::compare_memfun(&Menu::name, name));
        if (cit == end())
                lyxerr << "No submenu named " << name << endl;
-       Assert(cit != end());
+       BOOST_ASSERT(cit != end());
        return (*cit);
 }
 
@@ -839,7 +838,7 @@ Menu & MenuBackend::getMenu(string const & name)
        MenuList::iterator it =
                find_if(menulist_.begin(), menulist_.end(),
                        lyx::compare_memfun(&Menu::name, name));
-       Assert(it != menulist_.end());
+       BOOST_ASSERT(it != menulist_.end());
        return (*it);
 }
 
index 3eb8bed6fb5b9d392b71dbce80e69be5ecc89398..0813327dcc386581472ba5114e91b378947bf521 100644 (file)
@@ -13,7 +13,8 @@
 #include "PrinterParams.h"
 
 #include "support/lstrings.h"
-#include "support/LAssert.h"
+
+#include <boost/assert.hpp>
 
 
 PrinterParams::PrinterParams(Target t,
@@ -65,13 +66,13 @@ void PrinterParams::testInvariant() const
 #ifdef ENABLE_ASSERTIONS
        switch (target) {
        case PRINTER:
-               //lyx::support::Assert(!printer_name.empty());
+               //BOOST_ASSERT(!printer_name.empty());
                break;
        case FILE:
-               lyx::support::Assert(!file_name.empty());
+               BOOST_ASSERT(!file_name.empty());
                break;
        default:
-               lyx::support::Assert(false);
+               BOOST_ASSERT(false);
                break;
        }
 #endif
index 6d7a2fa27856606ce493d9202b211b81fec5bd12..4dc3ccef0d92b75e8d900cc4e4f714c5b2474ac8 100644 (file)
@@ -13,7 +13,6 @@
 
 #ifdef USE_ASPELL
 
-#include "support/LAssert.h"
 #include "debug.h"
 
 #include <aspell.h>
@@ -89,14 +88,14 @@ enum ASpell::Result ASpell::check(WordLangTuple const & word)
        AspellSpeller * m = it->second.speller;
 
        int word_ok = aspell_speller_check(m, word.word().c_str(), -1);
-       Assert(word_ok != -1);
+       BOOST_ASSERT(word_ok != -1);
 
        if (word_ok) {
                res = OK;
        } else {
                AspellWordList const * sugs =
                        aspell_speller_suggest(m, word.word().c_str(), -1);
-               Assert(sugs != 0);
+               BOOST_ASSERT(sugs != 0);
                els = aspell_word_list_elements(sugs);
                if (aspell_word_list_empty(sugs))
                        res = UNKNOWN;
index a8eae33e0d1db3875cac42b0426eb018ac65d789..093c2d5c035ecb0f862c6f09bb5874ef34ce0fe3 100644 (file)
 
 #include "author.h"
 
-#include "support/LAssert.h"
 #include "support/std_istream.h"
 #include "support/lstrings.h"
 
+#include <boost/assert.hpp>
+
+
 using namespace lyx::support;
 
 bool operator==(Author const & l, Author const & r)
@@ -63,7 +65,7 @@ int AuthorList::record(Author const & a)
 
 void AuthorList::record(int id, Author const & a)
 {
-       Assert(unsigned(id) < authors_.size());
+       BOOST_ASSERT(unsigned(id) < authors_.size());
 
        authors_[id] = a;
 }
@@ -72,7 +74,7 @@ void AuthorList::record(int id, Author const & a)
 Author const & AuthorList::get(int id)
 {
        Authors::const_iterator it(authors_.find(id));
-       Assert(it != authors_.end());
+       BOOST_ASSERT(it != authors_.end());
        return it->second;
 }
 
index f16fcfe92f46e4afab46d71ef5ba3b061285b601..e4d3cf44ed293fc301943ff19854195cf39ccef4 100644 (file)
 
 #include <config.h>
 
+#include "lyx_main.h"
 #include "debug.h"
-#include "support/LAssert.h"
 
-#include <exception>
+#include <boost/assert.hpp>
 
-using namespace lyx::support;
+#include <exception>
 
 using std::endl;
 
@@ -25,7 +25,33 @@ void throw_exception(std::exception const & e)
 {
        lyxerr << "Exception caught:\n"
            << e.what() << endl;
-       Assert(false);
+       BOOST_ASSERT(false);
+}
+
+
+namespace {
+
+void emergencyCleanup()
+{
+        static bool didCleanup;
+        if (didCleanup)
+                return;
+
+        didCleanup = true;
+
+        LyX::emergencyCleanup();
+}
+
+}
+
+
+void assertion_failed(char const * expr, char const * function,
+                     char const * file, long line)
+{
+       lyxerr << "Assertion triggered in " << function << " by \"" <<
+               expr << " in file " << file << ":" << line << endl;
+       emergencyCleanup();
+       assert(false);
 }
 
 
index 45f9484dbb1ede7c322467a07882c607fe20c0db..bd00debb58bbcf81c0c1cda4f75c5f2db2fd0bb2 100644 (file)
@@ -51,7 +51,6 @@
 #include "support/FileInfo.h"
 #include "support/filetools.h"
 #include "support/gzstream.h"
-#include "support/LAssert.h"
 #include "support/lyxlib.h"
 #include "support/os.h"
 #include "support/path.h"
@@ -115,7 +114,7 @@ bool openFileWrite(ofstream & ofs, string const & fname)
 
 typedef std::map<string, bool> DepClean;
 
-struct Buffer::Impl 
+struct Buffer::Impl
 {
        Impl(Buffer & parent, string const & file, bool readonly);
 
@@ -573,7 +572,7 @@ bool Buffer::readFile(string const & filename, ParagraphList::iterator pit)
 bool Buffer::readFile(LyXLex & lex, string const & filename,
                      ParagraphList::iterator pit)
 {
-       Assert(!filename.empty());
+       BOOST_ASSERT(!filename.empty());
 
        if (!lex.isOK()) {
                Alert::error(_("Document could not be read"),
index d0597d6b42fa1f3106325fec304d448fd52e06ad..98fba65f204d7b45f8ee0ea781405a8101dd6d4d 100644 (file)
@@ -26,7 +26,6 @@
 #include "frontends/Alert.h"
 
 #include "support/filetools.h"
-#include "support/LAssert.h"
 #include "support/lyxfunctional.h"
 
 #include <boost/bind.hpp>
@@ -110,7 +109,7 @@ bool BufferList::quitWriteAll()
 
 void BufferList::release(Buffer * buf)
 {
-       Assert(buf);
+       BOOST_ASSERT(buf);
        BufferStorage::iterator it = find(bstore.begin(), bstore.end(), buf);
        if (it != bstore.end()) {
                // Make sure that we don't store a LyXText in
@@ -149,7 +148,7 @@ void BufferList::closeAll()
 
 bool BufferList::close(Buffer * buf, bool ask)
 {
-       Assert(buf);
+       BOOST_ASSERT(buf);
 
        // FIXME: is the quitting check still necessary ?
        if (!ask || buf->isClean() || quitting || buf->paragraphs().empty()) {
@@ -308,8 +307,8 @@ bool BufferList::exists(string const & s) const
 
 bool BufferList::isLoaded(Buffer const * b) const
 {
-       Assert(b);
-       
+       BOOST_ASSERT(b);
+
        BufferStorage::const_iterator cit =
                find(bstore.begin(), bstore.end(), b);
        return cit != bstore.end();
index 4ed8a2e915e19ad5f819c40359f97f0cc016a540..b6416b0b13d475e772562860b05d154d9168b8a6 100644 (file)
@@ -36,7 +36,6 @@
 
 #include "frontends/Alert.h"
 
-#include "support/LAssert.h"
 #include "support/lyxalgo.h" // for lyx::count
 
 #include <boost/array.hpp>
@@ -148,28 +147,28 @@ BranchList const & BufferParams::branchlist() const
 
 Bullet & BufferParams::temp_bullet(lyx::size_type index)
 {
-       support::Assert(index < 4);
+       BOOST_ASSERT(index < 4);
        return pimpl_->temp_bullets[index];
 }
 
 
 Bullet const & BufferParams::temp_bullet(lyx::size_type index) const
 {
-       support::Assert(index < 4);
+       BOOST_ASSERT(index < 4);
        return pimpl_->temp_bullets[index];
 }
 
 
 Bullet & BufferParams::user_defined_bullet(lyx::size_type index)
 {
-       support::Assert(index < 4);
+       BOOST_ASSERT(index < 4);
        return pimpl_->user_defined_bullets[index];
 }
 
 
 Bullet const & BufferParams::user_defined_bullet(lyx::size_type index) const
 {
-       support::Assert(index < 4);
+       BOOST_ASSERT(index < 4);
        return pimpl_->user_defined_bullets[index];
 }
 
@@ -328,9 +327,9 @@ string const BufferParams::readToken(LyXLex & lex, string const & token)
                                string color = lex.getString();
                                branchlist().setColor(branch, color);
                                // Update also the LColor table:
-                               if (color == "none") 
+                               if (color == "none")
                                        color = lcolor.getX11Name(LColor::background);
-                               lcolor.fill(static_cast<LColor::color>(lcolor.size()), 
+                               lcolor.fill(static_cast<LColor::color>(lcolor.size()),
                                                branch, color);
                        }
                }
@@ -527,9 +526,9 @@ void BufferParams::writeFile(ostream & os) const
        std::list<Branch>::const_iterator end = branchlist().end();
        for (; it != end; ++it) {
                os << "\\branch " << it->getBranch()
-                  << "\n\\selected " << it->getSelected()      
-                  << "\n\\color " << it->getColor()    
-                  << "\n\\end_branch" 
+                  << "\n\\selected " << it->getSelected()
+                  << "\n\\color " << it->getColor()
+                  << "\n\\end_branch"
                   << "\n";
        }
 
index f27207aa98dcc91e531398282a5af4ff2769c47d..68d267850fdae2532722e560b75165d683fe0e2f 100644 (file)
 #include "changes.h"
 #include "debug.h"
 
-#include "support/LAssert.h"
+#include <boost/assert.hpp>
 
-using namespace lyx::support;
 
 using std::endl;
 using lyx::pos_type;
 
+
 bool operator==(Change const & l, Change const & r)
 {
        return l.type == r.type && l.author == r.author
@@ -326,7 +326,7 @@ Change const Changes::lookupFull(pos_type pos) const
        }
 
        check();
-       Assert(false);
+       BOOST_ASSERT(false);
        return Change(Change::UNCHANGED);
 }
 
@@ -348,7 +348,7 @@ Change::Type Changes::lookup(pos_type pos) const
        }
 
        check();
-       Assert(0);
+       BOOST_ASSERT(0);
        return Change::UNCHANGED;
 }
 
@@ -486,7 +486,7 @@ void Changes::check() const
        if (lyxerr.debugging(Debug::CHANGES))
                lyxerr[Debug::CHANGES] << "End" << endl;
 
-       Assert(dont_assert);
+       BOOST_ASSERT(dont_assert);
 }
 
 
index b1ae79a1d9418162c5392994012863b5ec1d2916..4f66ef083ee6bc3c44be9b01a0b980336aa4d775 100644 (file)
 
 #include "counters.h"
 #include "debug.h"
-#include "support/std_sstream.h"
 
+#include "support/std_sstream.h"
 #include "support/lstrings.h"
-#include "support/LAssert.h"
+
+#include <boost/assert.hpp>
 
 using namespace lyx::support;
 
@@ -171,7 +172,7 @@ void Counters::reset()
 
 void Counters::reset(string const & match)
 {
-       Assert(!match.empty());
+       BOOST_ASSERT(!match.empty());
 
        CounterList::iterator it = counterList.begin();
        CounterList::iterator end = counterList.end();
index 9247923c7ce55d86a6cc91979c3caa12bbe4c781..8b136aec5c2470308e0706144440dd9593cebd00 100644 (file)
@@ -1,3 +1,7 @@
+2003-09-09  Lars Gullik Bjønnes  <larsbj@lyx.org>
+
+       * Timeout.C: change Assert to BOOST_ASSERT
+
 2003-09-07  Angus Leeming  <leeming@lyx.org>
 
        * Alert.h: remove #include <algorithm>.
index 64f1faf062454f73999949acee3d7106de1c831e..99ee026f82cbed1be3686c35fdcd1eb329b17cc2 100644 (file)
 
 #include "Timeout.h"
 
-#include "support/LAssert.h"
-
-using namespace lyx::support;
-
 
 Timeout::~Timeout()
 {
@@ -68,7 +64,7 @@ Timeout & Timeout::setType(Type t)
 Timeout & Timeout::setTimeout(unsigned int msec)
 {
        // Can't have a timeout of zero!
-       Assert(msec);
+       BOOST_ASSERT(msec);
 
        timeout_ms = msec;
        return * this;
index 2eadabf6d5c6011031ad5d7c7a28c59be44dd141..63df789dff5d4d9cb0c2083e39a097e82cfdcf6d 100644 (file)
@@ -8,17 +8,15 @@
  * Full author contact details are available in file CREDITS.
  */
 
-
 #include <config.h>
+
 #include "ButtonController.h"
 #include "BCView.h"
-#include "support/LAssert.h"
 
-using namespace lyx::support;
 
 BCView & ButtonController::view() const
 {
-       Assert(view_.get());
+       BOOST_ASSERT(view_.get());
        return *view_.get();
 }
 
@@ -30,7 +28,7 @@ void ButtonController::view(BCView * view)
 
 ButtonPolicy & ButtonController::bp() const
 {
-       Assert(bp_.get());
+       BOOST_ASSERT(bp_.get());
        return *bp_.get();
 }
 
index c79de908df935389c93e78cfe7197d6e07fc9161..f2d27996a864d90ff1d4f752a45cb5384167dc44 100644 (file)
@@ -1,3 +1,7 @@
+2003-09-09  Lars Gullik Bjønnes  <larsbj@lyx.org>
+
+       * several files: change Assert to BOOST_ASSERT
+
 2003-09-08  Angus Leeming  <leeming@lyx.org>
 
        * ControlCommandBuffer.C:
index b5205a2af50f27c481fc709d42bd0caa8bc9b391..cc71a97cb639b93883290c29fec6379f52490965 100644 (file)
@@ -15,9 +15,7 @@
 #include "ButtonController.h"
 #include "BCView.h"
 #include "lyxrc.h"
-#include "support/LAssert.h"
 
-using namespace lyx::support;
 
 ControlButtons::ControlButtons()
        : emergency_exit_(false), is_closing_(false),
@@ -68,14 +66,14 @@ bool ControlButtons::IconifyWithMain() const
 
 ButtonController & ControlButtons::bc()
 {
-       Assert(bc_ptr_.get());
+       BOOST_ASSERT(bc_ptr_.get());
        return *bc_ptr_.get();
 }
 
 
 ViewBase & ControlButtons::view()
 {
-       Assert(view_ptr_);
+       BOOST_ASSERT(view_ptr_);
        return *view_ptr_;
 }
 
index e2ff56b86d7275067275f5635f2cc352f0e3325d..c820de23ca066813bc12c65cd318dfb0fa6102eb 100644 (file)
@@ -29,7 +29,6 @@
 #include "frontends/LyXView.h"
 
 #include "support/filetools.h"
-#include "support/LAssert.h"
 #include "support/path_defines.h"
 
 using namespace lyx::support;
@@ -46,7 +45,7 @@ ControlDocument::~ControlDocument()
 
 BufferParams & ControlDocument::params()
 {
-       Assert(bp_.get());
+       BOOST_ASSERT(bp_.get());
        return *bp_;
 }
 
index 9e0c27f1e7bb54213bfe1506ae54885d6784645e..1a01fb679773134f7b8a350ed9c3cdf448c10d71 100644 (file)
@@ -20,7 +20,6 @@
 
 #include "insets/ExternalTemplate.h"
 
-#include "support/LAssert.h"
 
 using namespace lyx::support;
 using std::vector;
@@ -55,21 +54,21 @@ void ControlExternal::dispatchParams()
 
 void ControlExternal::setParams(InsetExternal::Params const & p)
 {
-       Assert(params_.get());
+       BOOST_ASSERT(params_.get());
        *params_ = p;
 }
 
 
 InsetExternal::Params const & ControlExternal::params() const
 {
-       Assert(params_.get());
+       BOOST_ASSERT(params_.get());
        return *params_;
 }
 
 
 void ControlExternal::editExternal()
 {
-       Assert(params_.get());
+       BOOST_ASSERT(params_.get());
 
        dialog().view().apply();
        string const lfun =
index bcd4d2575b8c35c2ba9529971ac5167f8ceaf955..242300a89ecb50134e713578ba5f4276643ba94a 100644 (file)
@@ -14,7 +14,6 @@
 #include "debug.h"
 #include "funcrequest.h"
 
-#include "support/LAssert.h"
 #include "support/lyxalgo.h" // sorted
 #include "support/lstrings.h"
 #include "support/filetools.h"
@@ -340,7 +339,7 @@ string const find_xpm(string const & name)
 {
        XPMmap const * const begin = sorted_xpm_map;
        XPMmap const * const end = begin + nr_sorted_xpm_map;
-       Assert(lyx::sorted(begin, end));
+       BOOST_ASSERT(lyx::sorted(begin, end));
 
        XPMmap const * const it =
                std::find_if(begin, end, CompareKey(name));
index 4e37670216e8e417912e08f236dd9bfbe15ac33f..f37fba3105f344672588267a8071a7638f32ee3e 100644 (file)
 #include "lyxlex.h"
 #include "paragraph.h"
 #include "ParagraphParameters.h"
-#include "support/LAssert.h"
 #include "support/std_sstream.h"
 
-using namespace lyx::support;
-
 using std::istringstream;
 using std::ostringstream;
 
@@ -130,14 +127,14 @@ void ControlParagraph::dispatchParams()
 
 ParagraphParameters & ControlParagraph::params()
 {
-       Assert(params_.get());
+       BOOST_ASSERT(params_.get());
        return *params_;
 }
 
 
 ParagraphParameters const & ControlParagraph::params() const
 {
-       Assert(params_.get());
+       BOOST_ASSERT(params_.get());
        return *params_;
 }
 
index 71f21dbfb26a28f9ca1b39adbd3d0eb75beec950..ab8b5d29ce92be9b72e55154af3df42b0a93cb81 100644 (file)
@@ -26,7 +26,6 @@
 
 #include "support/tostr.h"
 #include "support/filetools.h"
-#include "support/LAssert.h"
 #include "support/path.h"
 #include "support/systemcall.h"
 
@@ -44,7 +43,7 @@ ControlPrint::ControlPrint(LyXView & lv, Dialogs & d)
 
 PrinterParams & ControlPrint::params() const
 {
-       Assert(params_);
+       BOOST_ASSERT(params_);
        return *params_;
 }
 
index af098ff8a99db57006e027369003f50087b265f7..9f5b523434bd6e579063e44b7f17f4c1173b3fb1 100644 (file)
@@ -15,9 +15,6 @@
 #include "lyxrc.h"
 #include "paragraph.h"
 #include "insets/insettabular.h"
-#include "support/LAssert.h"
-
-using namespace lyx::support;
 
 
 ControlTabular::ControlTabular(Dialog & parent)
@@ -54,7 +51,7 @@ int ControlTabular::getActiveCell() const
 
 LyXTabular const & ControlTabular::tabular() const
 {
-       Assert(params_.get());
+       BOOST_ASSERT(params_.get());
        return *params_.get();
 }
 
index a97386b45a40664d980d4edbf079a90de6b889a2..6b7e91ef3232af83861219029fbb764214bd7bbe 100644 (file)
@@ -14,9 +14,7 @@
 
 #include "ButtonController.h"
 #include "BCView.h"
-#include "support/LAssert.h"
 
-using namespace lyx::support;
 
 Dialog::Dialog(LyXView & lv, string const & name)
        : is_closing_(false), kernel_(lv), name_(name),
@@ -142,21 +140,21 @@ void Dialog::redraw()
 
 ButtonController & Dialog::bc() const
 {
-       Assert(bc_ptr_.get());
+       BOOST_ASSERT(bc_ptr_.get());
        return *bc_ptr_.get();
 }
 
 
 void Dialog::setController(Controller * i)
 {
-       Assert(i && !controller_ptr_.get());
+       BOOST_ASSERT(i && !controller_ptr_.get());
        controller_ptr_.reset(i);
 }
 
 
 void Dialog::setView(View * v)
 {
-       Assert(v && !view_ptr_.get());
+       BOOST_ASSERT(v && !view_ptr_.get());
        view_ptr_.reset(v);
 }
 
@@ -168,7 +166,7 @@ Dialog::Controller::Controller(Dialog & parent)
 
 Dialog::Controller & Dialog::controller() const
 {
-       Assert(controller_ptr_.get());
+       BOOST_ASSERT(controller_ptr_.get());
        return *controller_ptr_.get();
 }
 
@@ -180,7 +178,7 @@ Dialog::View::View(Dialog & parent, string title) :
 
 Dialog::View & Dialog::view() const
 {
-       Assert(view_ptr_.get());
+       BOOST_ASSERT(view_ptr_.get());
        return *view_ptr_.get();
 }
 
index 133ba5040efe322a8120c09a2a16660e1eb73111..2cfd0a23e79621db329be12fded0a8766bf8c241 100644 (file)
@@ -19,9 +19,6 @@
 #include "frontends/Dialogs.h"
 #include "frontends/LyXView.h"
 
-#include "support/LAssert.h"
-
-using lyx::support::Assert;
 
 Kernel::Kernel(LyXView & lyxview)
        : lyxview_(lyxview)
@@ -94,13 +91,13 @@ BufferView const * Kernel::bufferview() const
 
 Buffer & Kernel::buffer()
 {
-       Assert(lyxview_.buffer());
+       BOOST_ASSERT(lyxview_.buffer());
        return *lyxview_.buffer();
 }
 
 
 Buffer const & Kernel::buffer() const
 {
-       Assert(lyxview_.buffer());
+       BOOST_ASSERT(lyxview_.buffer());
        return *lyxview_.buffer();
 }
index cfd22b561dd6b81f236dd91957d4e041661f3da0..4c2753202463c29d2a68fc207abbb53e861ee916 100644 (file)
@@ -12,9 +12,7 @@
 
 #include "ViewBase.h"
 #include "ControlButtons.h"
-#include "support/LAssert.h"
 
-using namespace lyx::support;
 
 ViewBase::ViewBase(string const & t)
        : controller_ptr_(0), title_(t)
@@ -41,14 +39,14 @@ string const & ViewBase::getTitle() const
 
 ControlButtons & ViewBase::getController()
 {
-       Assert(controller_ptr_);
+       BOOST_ASSERT(controller_ptr_);
        return *controller_ptr_;
 }
 
 
 ControlButtons const & ViewBase::getController() const
 {
-       Assert(controller_ptr_);
+       BOOST_ASSERT(controller_ptr_);
        return *controller_ptr_;
 }
 
index 632fcc0b0305e52036accdc05d9f1e82caf00afe..3e106eb16a4932cc0bc2bedbe8dc2729977a6c49 100644 (file)
@@ -17,7 +17,6 @@
 #include "gettext.h" // for _()
 
 #include "support/lstrings.h"
-#include "support/LAssert.h"
 
 #include <boost/regex.hpp>
 
@@ -57,7 +56,7 @@ string const familyName(string const & name)
 
 string const getAbbreviatedAuthor(InfoMap const & map, string const & key)
 {
-       Assert(!map.empty());
+       BOOST_ASSERT(!map.empty());
 
        InfoMap::const_iterator it = map.find(key);
        if (it == map.end())
@@ -109,7 +108,7 @@ string const getAbbreviatedAuthor(InfoMap const & map, string const & key)
 
 string const getYear(InfoMap const & map, string const & key)
 {
-       Assert(!map.empty());
+       BOOST_ASSERT(!map.empty());
 
        InfoMap::const_iterator it = map.find(key);
        if (it == map.end())
@@ -173,7 +172,7 @@ vector<string> const getKeys(InfoMap const & map)
 
 string const getInfo(InfoMap const & map, string const & key)
 {
-       Assert(!map.empty());
+       BOOST_ASSERT(!map.empty());
 
        InfoMap::const_iterator it = map.find(key);
        if (it == map.end())
index a03db39b141e602f4d783e916e5210e8275cc529..e0dd396bef6e8003c9f614ed66f475af6355dba5 100644 (file)
@@ -1,3 +1,8 @@
+2003-09-09  Lars Gullik Bjønnes  <larsbj@lyx.org>
+
+       * GView.C: change Assert to BOOST_ASSERT
+       * GnomeBase.C: ditto
+
 2003-07-21  Angus Leeming  <leeming@lyx.org>
 
        * lyx_gui.C (reset): use namespace lyx::graphics rather than grfx
index 203716066acf5ccf46aeb71e540f37565ebf6099..b2f3efc780178f1645ebcabdc86b438e9673ed81 100644 (file)
@@ -8,13 +8,13 @@
  * Full author contact details are available in file CREDITS.
  */
 
-
 #include <config.h>
+
 #include "GView.h"
-#include "support/LAssert.h"
 #include "debug.h"
 #include "support/filetools.h"
 #include "ControlButtons.h"
+
 #include <glib.h>
 #include <gtkmm/dialog.h>
 
@@ -49,7 +49,7 @@ void GView::loadXML()
 
        if (file.empty()) {
                lyxerr << "Cannot find glade file. Aborting." << endl;
-               lyx::Assert(true);
+               BOOST_ASSERT(true);
        }
 
        lyxerr[Debug::GUI] << "Glade file to open is " << file << endl;
index 9478c64e48e3dc4a9800f38faf6f6ebfa83a90ff..645d1bd019876c40cb2870eaff9e76bc9c6ae417 100644 (file)
@@ -8,16 +8,17 @@
  * Full author contact details are available in file CREDITS.
  */
 
-
 #include <config.h>
+
 #include "GnomeBase.h"
-#include "support/LAssert.h"
 #include "debug.h"
 #include "support/filetools.h"
 #include "ControlButtons.h"
+
 #include <glib.h>
 #include <gtkmm/dialog.h>
 
+
 GnomeBase::GnomeBase(string const & name)
        : ViewBase(),
          updating_(false),
@@ -49,7 +50,7 @@ void GnomeBase::loadXML()
 
        if (file.empty()) {
                lyxerr << "Cannot find glade file. Aborting." << std::endl;
-               lyx::Assert(true);
+               BOOST_ASSERT(true);
        }
 
        lyxerr[Debug::GUI] << "Glade file to open is " << file << endl;
index f285224c181c778cb33a160c9f16d88d4f9ab870..92706a8397fc895d6bcccb64eb8bc7b95e0bfb73 100644 (file)
@@ -1,3 +1,7 @@
+2003-09-09  Lars Gullik Bjønnes  <larsbj@lyx.org>
+
+       * GPainter.C: change Assert to BOOST_ASSERT
+
 2003-09-08  Angus Leeming  <leeming@lyx.org>
 
        * GPainter.h: do not #include <config.h> in header files.
index 7d580fcaca5634b8bc5eeb4037b5eafc595039cf..e3eac76778576dcc6474bd85238c9ee1386c8384 100644 (file)
 #include "frontends/font_metrics.h"
 #include "codeConvert.h"
 
-#include "support/LAssert.h"
 #include "support/lstrings.h"
 
 #include <boost/scoped_array.hpp>
+
 #include <X11/Xft/Xft.h>
+
 #include <cmath>
 
 
@@ -190,8 +191,8 @@ Painter & GPainter::text(int x, int y,
        string const & s, LyXFont const & f)
 {
        size_t size = s.length() + 1;
-       wchar_t * wcs = (wchar_t *) alloca(size * sizeof(wchar_t));     
-       size = mbstowcs(wcs, s.c_str(), size);  
+       wchar_t * wcs = (wchar_t *) alloca(size * sizeof(wchar_t));
+       size = mbstowcs(wcs, s.c_str(), size);
        return text(x, y, wcs, size, f);
 }
 
@@ -239,7 +240,7 @@ Painter & GPainter::text(int x, int y, wchar_t const * s, int ls,
                for(int i = 0; i < ls; ++i) {
                        c = lyx::support::uppercase(s[i]);
                        if(c != s[i]) {
-                               XftDrawString32(draw, xftClr, fontS, tmpx, y, 
+                               XftDrawString32(draw, xftClr, fontS, tmpx, y,
                                                wcsToFcChar32StrFast(&c), 1);
                                tmpx += font_metrics::width(c, smallfont);
                        } else {
@@ -254,7 +255,7 @@ Painter & GPainter::text(int x, int y, wchar_t const * s, int ls,
        return *this;
 }
 
-                                                               
+
 Painter & GPainter::text(int x, int y,
        char const * s, size_t ls,
        LyXFont const & f)
index 34b17505bc74eed9efe406ccd1da8ceb2505c47d..2c53e26e1d63b17052fc6105941fc79f32986801 100644 (file)
  */
 
 #include <config.h>
+
 #include "qt_helpers.h"
 
 #include "support/filetools.h"
-#include "support/LAssert.h"
 
 #include "QBrowseBox.h"
 #include "BulletsModule.h"
@@ -236,7 +236,7 @@ void BulletsModule::setBullet(int level, const Bullet & bullet)
                case 1: pb = bullet2PB; co = bulletsize2CO; break;
                case 2: pb = bullet3PB; co = bulletsize3CO; break;
                case 3: pb = bullet4PB; co = bulletsize4CO; break;
-               default: Assert(false); break;
+               default: BOOST_ASSERT(false); break;
        }
 
        setBullet(pb, co, bullet);
index 6b2e1a33086ae3689463be4767cafdc5a300a042..4fc27685f86bb6a0e2d76bd516b4b10acd532f2b 100644 (file)
@@ -1,10 +1,16 @@
+2003-09-09  Lars Gullik Bjønnes  <larsbj@lyx.org>
+
+       * BulletsModule.C: change Assert to BOOST_ASSERT
+       * panelstack.C: ditto
+       * QDocument.C: ditto
+
 2003-09-08  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
 
        * QLToolbar.C: include <qtoolbar.h>
 
        * QLPopupMenu.h: include <utility>
 
-       * qt_helpers.C: 
+       * qt_helpers.C:
        * qfont_loader.C: include <algorithm>
 
 2003-09-08  Angus Leeming  <leeming@lyx.org>
 
 2003-09-05  Angus Leeming  <leeming@lyx.org>
 
-       * QCitation.h: 
-       * QGraphics.h: 
-       * QPrefs.h: 
-       * qscreen.[Ch]: 
+       * QCitation.h:
+       * QGraphics.h:
+       * QPrefs.h:
+       * qscreen.[Ch]:
        ensure that the header files can be compiled stand-alone.
 
 2003-09-05  Angus Leeming  <leeming@lyx.org>
 
 2003-08-05  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
 
-       * QWorkArea.C (QWorkArea): 
-       (dragEnterEvent): 
+       * QWorkArea.C (QWorkArea):
+       (dragEnterEvent):
        (dropEvent): add support for drag and drop of URIs
 
 2003-08-03  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
 
 2003-08-02  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
 
-       * ui/Makefile.am (INCLUDES): 
-       * moc/Makefile.am (INCLUDES): 
+       * ui/Makefile.am (INCLUDES):
+       * moc/Makefile.am (INCLUDES):
        * Makefile.am (INCLUDES): use QT_INCLUDES
 
        * QLToolbar.C (clearLayoutList): call Toolbar::clearLayoutList
 
 2003-07-29  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
 
-       * qfont_loader.C: 
-       * QLPopupMenu.h: add includes needed by gcc 2.95.3 
+       * qfont_loader.C:
+       * QLPopupMenu.h: add includes needed by gcc 2.95.3
 
 2003-07-27  John Levon  <levon@movementarian.org>
 
 
 2003-07-26  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
 
-       * QPrefs.C: 
-       * QDocumentDialog.C: 
-       * QDocument.C: 
+       * QPrefs.C:
+       * QDocumentDialog.C:
+       * QDocument.C:
        * QGraphics.C: adapt PAPER_* enums
 
 2003-07-25  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
 
-       * QLMenubar.h: 
+       * QLMenubar.h:
        * QLMenubar.C: derives from Menubar (replaces Menubar::Pimpl)
 
        * Menubar_pimpl.C:
 
 2003-07-25  Jean-Marc Lasgouttes <lasgouttes@lyx.org>
 
-       * QLToolbar.h: 
+       * QLToolbar.h:
        * QLToolbar.C: derives from Toolbar (replaces Toolbar::Pimpl)
 
        * Toolbar_pimpl.C:
index a006d25b96097a5c79eb4da957c6f991fea1bbf1..ba5a459002508c383669518d5624408c1c196641 100644 (file)
@@ -99,9 +99,9 @@ void QDocument::build_dialog()
        // paper
        QComboBox * cb = dialog_->pageLayoutModule->papersizeCO;
        cb->insertItem(qt_("Default"));
-               cb->insertItem(qt_("Custom"));
-               cb->insertItem(qt_("US letter"));
-               cb->insertItem(qt_("US legal"));
+       cb->insertItem(qt_("Custom"));
+       cb->insertItem(qt_("US letter"));
+       cb->insertItem(qt_("US legal"));
        cb->insertItem(qt_("US executive"));
        cb->insertItem(qt_("A3"));
        cb->insertItem(qt_("A4"));
index 26d6d8a83b6347827940e055f4992090edf93123..ce4a5ff8f4afe5c1193abda963bed61d5066499b 100644 (file)
@@ -12,8 +12,6 @@
 
 #include "panelstack.h"
 
-#include "support/LAssert.h"
-
 #include "qt_helpers.h"
 
 #include <qwidgetstack.h>
@@ -61,7 +59,7 @@ void PanelStack::addCategory(string const & n, string const & parent)
 
        if (!parent.empty()) {
                PanelMap::iterator it = panel_map_.find(parent);
-               Assert(it != panel_map_.end());
+               BOOST_ASSERT(it != panel_map_.end());
 
                QListViewItem * before = it->second->firstChild();
                if (before) {
@@ -110,7 +108,7 @@ void PanelStack::addPanel(QWidget * panel, string const & name, string const & p
 void PanelStack::setCurrentPanel(string const & name)
 {
        PanelMap::const_iterator cit = panel_map_.find(name);
-       Assert(cit != panel_map_.end());
+       BOOST_ASSERT(cit != panel_map_.end());
 
        // force on first set
        if (list_->currentItem() ==  cit->second)
index f954b1302bd2e127041b719d2a489a1a02dc9f56..c8a32273cebbe45ae3e73ef3b786bc4f58e8dfaf 100644 (file)
@@ -1,3 +1,7 @@
+2003-09-09  Lars Gullik Bjønnes  <larsbj@lyx.org>
+
+       * several files: change Assert to BOOST_ASSERT
+
 2003-09-08  Angus Leeming  <leeming@lyx.org>
 
        * FormFiledialog.C (UserCache::add, GroupCache::add): convert
@@ -62,7 +66,7 @@
 
        * Alert_pimpl.C:  move #include "debug.h" out of the header file.
 
-2003-08-17  Martin Vermeer  <martin.vermeer@hut.fi>    
+2003-08-17  Martin Vermeer  <martin.vermeer@hut.fi>
 
        * FormDocument.C: fix crash on doc settings for non-branched doc
 
 
        * FormShowFile.C (build): Remove redundant "LyX:" string from title.
 
-2003-08-21  Martin Vermeer  <martin.vermeer@hut.fi>    
+2003-08-21  Martin Vermeer  <martin.vermeer@hut.fi>
 
        * FormNote.C: cosmetic fix.
 
-2003-08-17  Martin Vermeer  <martin.vermeer@hut.fi>    
+2003-08-17  Martin Vermeer  <martin.vermeer@hut.fi>
 
        * FormDocument.C: make the layout file's "Other" class option
        appear on the document panel as "Extra Options".
@@ -88,7 +92,7 @@
 
        * form/form_tabular.fd: fix shortcut ("Middle|#m" => "Middle|#M")
 
-2003-08-17  Martin Vermeer  <martin.vermeer@hut.fi>    
+2003-08-17  Martin Vermeer  <martin.vermeer@hut.fi>
 
        * ColorHandler.[Ch]:
        * Dialogs.C:
        tab of the document settings dialog. Branches are user definable
        and have a "display colour" to distinguish them on-screen.
 
-       ColorHandler was somewhat cleaned up. 
+       ColorHandler was somewhat cleaned up.
        (1) make possible a dynamically growing LColor list by allowing
-       the graphic context cache to grow along (vector); 
+       the graphic context cache to grow along (vector);
        (2) eliminate an IMHO unnecessary step in colour allocation.
 
 2003-08-12  Michael Schmitt  <michael.schmitt@teststep.org>
 2003-08-06  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
 
        * .cvsignore: add lyx_forms.h-tmp, stamp-forms, lyx_xpm.h-tmp,
-       stamp-xpm. 
+       stamp-xpm.
 
 2003-08-06  Martin Vermeer  <martin.vermeer@hut.di>
 
        * Color.[Ch]:
        * FormPreferences.C: moved the RGB to hex string method
        from FormPreferences to Color and added a hex string to RGB
-       method. 
+       method.
 
 2003-08-04  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
 
index edb334378d55d58e589c410e21062e494ece38e5..49d1cd0408ade0e924c107ce30df1501e0998782 100644 (file)
@@ -12,8 +12,6 @@
 
 #include "Color.h"
 
-#include "support/LAssert.h"
-
 #include "lyx_forms.h"
 
 #include "support/std_sstream.h"
@@ -21,7 +19,6 @@
 #include <cmath>
 #include <iomanip>
 
-namespace support = lyx::support;
 
 #ifndef CXX_GLOBAL_CSTD
 using std::floor;
@@ -87,9 +84,9 @@ string const X11hexname(RGBColor const & col)
 
 
 RGBColor::RGBColor(string const & x11hexname)
-       : r(0), g(0), b(0) 
+       : r(0), g(0), b(0)
 {
-       support::Assert(x11hexname.size() == 7 && x11hexname[0] == '#');
+       BOOST_ASSERT(x11hexname.size() == 7 && x11hexname[0] == '#');
        r = hexstrToInt(x11hexname.substr(1,2));
        g = hexstrToInt(x11hexname.substr(3,2));
        b = hexstrToInt(x11hexname.substr(5,2));
index 5b25b5cb29a564e2fe2954df36e3399edab3a388..31cba0cffc85ce1dc687d231ff2e6ebeb6bea9fd 100644 (file)
@@ -21,7 +21,6 @@
 #include "controllers/ControlButtons.h"
 
 #include "support/filetools.h" //  LibFileSearch
-#include "support/LAssert.h"
 #include "support/lstrings.h"
 
 #include "lyx_forms.h"
@@ -125,7 +124,7 @@ void FormBase::show()
 {
        // build() is/should be called from the controller, so form() should
        // always exist.
-       Assert(form());
+       BOOST_ASSERT(form());
 
        // we use minw_ to flag whether the dialog has ever been shown.
        // In turn, prepare_to_show() initialises various bits 'n' pieces
@@ -184,14 +183,14 @@ void FormBase::hide()
 
 void FormBase::setPrehandler(FL_OBJECT * ob)
 {
-       Assert(ob);
+       BOOST_ASSERT(ob);
        fl_set_object_prehandler(ob, C_PrehandlerCB);
 }
 
 
 void FormBase::setMessageWidget(FL_OBJECT * ob)
 {
-       Assert(ob && ob->objclass == FL_TEXT);
+       BOOST_ASSERT(ob && ob->objclass == FL_TEXT);
        message_widget_ = ob;
        fl_set_object_lsize(message_widget_, FL_NORMAL_SIZE);
 }
@@ -218,7 +217,7 @@ ButtonPolicy::SMInput FormBase::input(FL_OBJECT *, long)
 // preemptive handler for feedback messages
 void FormBase::MessageCB(FL_OBJECT * ob, int event)
 {
-       Assert(ob);
+       BOOST_ASSERT(ob);
 
        switch (event) {
        case FL_ENTER:
@@ -245,7 +244,7 @@ void FormBase::MessageCB(FL_OBJECT * ob, int event)
 
 void FormBase::PrehandlerCB(FL_OBJECT * ob, int event, int key)
 {
-       Assert(ob);
+       BOOST_ASSERT(ob);
 
        if (ob->objclass == FL_INPUT && event == FL_PUSH && key == 2) {
                // Trigger an input event when pasting in an xforms input object
@@ -297,7 +296,7 @@ void FormBase::postWarning(string const & warning)
 
 void FormBase::clearMessage()
 {
-       Assert(message_widget_);
+       BOOST_ASSERT(message_widget_);
 
        warning_posted_ = false;
 
@@ -314,7 +313,7 @@ void FormBase::clearMessage()
 
 void FormBase::postMessage(string const & message)
 {
-       Assert(message_widget_);
+       BOOST_ASSERT(message_widget_);
 
        int const width = message_widget_->w - 10;
        string const tmp = warning_posted_ ?
@@ -336,7 +335,7 @@ namespace {
 
 FormBase * GetForm(FL_OBJECT * ob)
 {
-       Assert(ob && ob->form && ob->form->u_vdata);
+       BOOST_ASSERT(ob && ob->form && ob->form->u_vdata);
        FormBase * ptr = static_cast<FormBase *>(ob->form->u_vdata);
        return ptr;
 }
@@ -380,7 +379,7 @@ void C_FormBaseInputCB(FL_OBJECT * ob, long d)
 static int C_WMHideCB(FL_FORM * form, void *)
 {
        // Close the dialog cleanly, even if the WM is used to do so.
-       Assert(form && form->u_vdata);
+       BOOST_ASSERT(form && form->u_vdata);
        FormBase * ptr = static_cast<FormBase *>(form->u_vdata);
        ptr->getController().CancelButton();
        return FL_CANCEL;
@@ -391,11 +390,11 @@ static int C_PrehandlerCB(FL_OBJECT * ob, int event,
 {
        // Note that the return value is important in the pre-emptive handler.
        // Don't return anything other than 0.
-       Assert(ob);
+       BOOST_ASSERT(ob);
 
        // Don't Assert this one, as it can happen quite naturally when things
        // are being deleted in the d-tor.
-       //Assert(ob->form);
+       //BOOST_ASSERT(ob->form);
        if (!ob->form) return 0;
 
        FormBase * ptr = static_cast<FormBase *>(ob->form->u_vdata);
index a1bcf4aafd90b64b9caf5a9b40244ca240e4d45a..f2ba3c28d9bba7493aa4e9fa2bc9c33935a19fce 100644 (file)
@@ -20,7 +20,6 @@
 #include "lyxrc.h"
 
 #include "support/filetools.h" //  LibFileSearch
-#include "support/LAssert.h"
 #include "support/tostr.h"
 
 #include "lyx_forms.h"
@@ -346,7 +345,7 @@ extern "C" {
 
 void C_FormColorpickerInputCB(FL_OBJECT * ob, long d)
 {
-       lyx::support::Assert(ob && ob->form && ob->form->u_vdata);
+       BOOST_ASSERT(ob && ob->form && ob->form->u_vdata);
        FormColorpicker * ptr =
                static_cast<FormColorpicker *>(ob->form->u_vdata);
        ptr->input(ob, d);
@@ -356,7 +355,7 @@ void C_FormColorpickerInputCB(FL_OBJECT * ob, long d)
 static int C_WMHideCB(FL_FORM * form, void *)
 {
        // Close the dialog cleanly, even if the WM is used to do so.
-       lyx::support::Assert(form && form->u_vdata);
+       BOOST_ASSERT(form && form->u_vdata);
        FormColorpicker * ptr = static_cast<FormColorpicker *>(form->u_vdata);
        ptr->input(0, 0);
        return FL_CANCEL;
index 49ad1bf6e7eef5233c09d9608f263df64f05d7d3..c5d1c3037b746bc9f33bb76221157306c6afcb1f 100644 (file)
@@ -22,7 +22,6 @@
 #include "lyxrc.h"
 
 #include "support/filetools.h" //  LibFileSearch
-#include "support/LAssert.h"
 #include "support/lstrings.h"
 
 #include "lyx_forms.h"
@@ -186,14 +185,14 @@ void FormDialogView::hide()
 
 void FormDialogView::setPrehandler(FL_OBJECT * ob)
 {
-       Assert(ob);
+       BOOST_ASSERT(ob);
        fl_set_object_prehandler(ob, C_PrehandlerCB);
 }
 
 
 void FormDialogView::setMessageWidget(FL_OBJECT * ob)
 {
-       Assert(ob && ob->objclass == FL_TEXT);
+       BOOST_ASSERT(ob && ob->objclass == FL_TEXT);
        message_widget_ = ob;
        fl_set_object_lsize(message_widget_, FL_NORMAL_SIZE);
 }
@@ -220,7 +219,7 @@ ButtonPolicy::SMInput FormDialogView::input(FL_OBJECT *, long)
 // preemptive handler for feedback messages
 void FormDialogView::MessageCB(FL_OBJECT * ob, int event)
 {
-       Assert(ob);
+       BOOST_ASSERT(ob);
 
        switch (event) {
        case FL_ENTER:
@@ -247,7 +246,7 @@ void FormDialogView::MessageCB(FL_OBJECT * ob, int event)
 
 void FormDialogView::PrehandlerCB(FL_OBJECT * ob, int event, int key)
 {
-       Assert(ob);
+       BOOST_ASSERT(ob);
 
        if (ob->objclass == FL_INPUT && event == FL_PUSH && key == 2) {
                // Trigger an input event when pasting in an xforms input
@@ -299,7 +298,7 @@ void FormDialogView::postWarning(string const & warning)
 
 void FormDialogView::clearMessage()
 {
-       Assert(message_widget_);
+       BOOST_ASSERT(message_widget_);
 
        warning_posted_ = false;
 
@@ -316,7 +315,7 @@ void FormDialogView::clearMessage()
 
 void FormDialogView::postMessage(string const & message)
 {
-       Assert(message_widget_);
+       BOOST_ASSERT(message_widget_);
 
        int const width = message_widget_->w - 10;
        string const tmp = warning_posted_ ?
@@ -338,7 +337,7 @@ namespace {
 
 FormDialogView * GetForm(FL_OBJECT * ob)
 {
-       Assert(ob && ob->form && ob->form->u_vdata);
+       BOOST_ASSERT(ob && ob->form && ob->form->u_vdata);
        FormDialogView * ptr =
                static_cast<FormDialogView *>(ob->form->u_vdata);
        return ptr;
@@ -383,7 +382,7 @@ void C_FormDialogView_InputCB(FL_OBJECT * ob, long d)
 static int C_WMHideCB(FL_FORM * form, void *)
 {
        // Close the dialog cleanly, even if the WM is used to do so.
-       Assert(form && form->u_vdata);
+       BOOST_ASSERT(form && form->u_vdata);
        FormDialogView * ptr = static_cast<FormDialogView *>(form->u_vdata);
        ptr->dialog().CancelButton();
        return FL_CANCEL;
@@ -394,11 +393,11 @@ static int C_PrehandlerCB(FL_OBJECT * ob, int event,
 {
        // Note that the return value is important in the pre-emptive handler.
        // Don't return anything other than 0.
-       Assert(ob);
+       BOOST_ASSERT(ob);
 
        // Don't Assert this one, as it can happen quite naturally when things
        // are being deleted in the d-tor.
-       //Assert(ob->form);
+       //BOOST_ASSERT(ob->form);
        if (!ob->form) return 0;
 
        FormDialogView * ptr =
index 1f806424397b851c8a5ce44f29a12834b3f4ffc2..3d90c09a587486e9c89833289276691fe056ed43 100644 (file)
@@ -20,9 +20,6 @@
 
 #include "ControlMath.h"
 
-#include "support/LAssert.h"
-
-using namespace lyx::support;
 
 using std::max;
 using std::vector;
@@ -74,7 +71,7 @@ void FormMathsBitmap::addBitmap(BitmapStore const & bm)
 
 void FormMathsBitmap::build()
 {
-       Assert(bitmaps_.size() > 0);
+       BOOST_ASSERT(bitmaps_.size() > 0);
 
        h_+= 42; // Allow room for a Close button
 
index 0ed67fb302eb36a31d4e2c53c28f8e39612267a8..2e950f1710187e797db4c1d4e1f1aa1089622350 100644 (file)
 
 #include "controllers/ButtonController.h"
 
-#include "support/LAssert.h"
 #include "support/lyxalgo.h" // lyx::count
 
 #include "lyx_forms.h"
 
 #include "support/std_sstream.h"
 
-using namespace lyx::support;
 
 using std::ostringstream;
 
@@ -47,10 +45,10 @@ extern "C" {
        int C_FormMathsMatrixAlignFilter(FL_OBJECT * ob, char const *,
                                         char const * cur, int c)
        {
-               Assert(ob);
+               BOOST_ASSERT(ob);
                FormMathsMatrix * pre =
                        static_cast<FormMathsMatrix *>(ob->u_vdata);
-               Assert(pre);
+               BOOST_ASSERT(pre);
                return pre->AlignFilter(cur, c);
        }
 
index 8895e22ef17c70078b5bb5c929b0888f7ea9d37c..478dde261d1888e4eee62c07afd362d3f2094307 100644 (file)
@@ -28,7 +28,6 @@
 #include "Spacing.h"
 #include "vspace.h"
 
-#include "support/LAssert.h"
 #include "support/lstrings.h"
 #include "support/tostr.h"
 
@@ -442,7 +441,7 @@ namespace {
 void validateVSpaceWidgets(FL_OBJECT * choice_type, FL_OBJECT * input_length)
 {
        // Paranoia check!
-       Assert(choice_type  && choice_type->objclass  == FL_CHOICE &&
+       BOOST_ASSERT(choice_type  && choice_type->objclass  == FL_CHOICE &&
                    input_length && input_length->objclass == FL_INPUT);
 
        if (fl_get_choice(choice_type) != 7)
@@ -462,7 +461,7 @@ VSpace const setVSpaceFromWidgets(FL_OBJECT * choice_type,
                                  FL_OBJECT * check_keep)
 {
        // Paranoia check!
-       Assert(choice_type   && choice_type->objclass   == FL_CHOICE &&
+       BOOST_ASSERT(choice_type   && choice_type->objclass   == FL_CHOICE &&
                    input_length  && input_length->objclass  == FL_INPUT &&
                    choice_length && choice_length->objclass == FL_CHOICE &&
                    check_keep    && check_keep->objclass    == FL_CHECKBUTTON);
@@ -510,7 +509,7 @@ void setWidgetsFromVSpace(VSpace const & space,
                          FL_OBJECT * check_keep)
 {
        // Paranoia check!
-       Assert(choice_type   && choice_type->objclass   == FL_CHOICE &&
+       BOOST_ASSERT(choice_type   && choice_type->objclass   == FL_CHOICE &&
                    input_length  && input_length->objclass  == FL_INPUT &&
                    choice_length && choice_length->objclass == FL_CHOICE &&
                    check_keep    && check_keep->objclass    == FL_CHECKBUTTON);
index 1b64cdbeeafbe4ef85cd8b27a6eada823b762213..194c1197d04a5ddc373c4ea07eb9e12b669900a7 100644 (file)
@@ -27,7 +27,6 @@
 #include "frnt_lang.h"
 #include "lyxfont.h"
 
-#include "support/LAssert.h"
 #include "support/lstrings.h"
 #include "support/tostr.h"
 #include "support/path_defines.h"
@@ -308,7 +307,7 @@ void FormPreferences::apply()
 
 string const FormPreferences::getFeedback(FL_OBJECT * ob)
 {
-       Assert(ob);
+       BOOST_ASSERT(ob);
 
        if (ob->form->fdui == colors_.dialog())
                return colors_.feedback(ob);
@@ -341,7 +340,7 @@ string const FormPreferences::getFeedback(FL_OBJECT * ob)
 
 ButtonPolicy::SMInput FormPreferences::input(FL_OBJECT * ob, long)
 {
-       Assert(ob);
+       BOOST_ASSERT(ob);
 
        bool valid = true;
 
index 51b28c7093b9418c8e5a35eb9877a90b437f7e89..ecc5369754d04a4c1e356996f3009c6610ceb366 100644 (file)
 
 #include "debug.h"
 
-#include "support/LAssert.h"
 #include "support/lyxfunctional.h"
 
 #include "lyx_forms.h"
 
-using namespace lyx::support;
-
 using std::endl;
 
 
@@ -31,7 +28,7 @@ void RadioButtonGroup::init(FL_OBJECT * ob, size_type value)
 {
        // Object must be a ROUND3DBUTTON (let all radio buttons look the same)
        // and of type RADIO_BUTTON (otherwise it ain't work).
-       Assert(ob && ob->objclass == FL_ROUND3DBUTTON
+       BOOST_ASSERT(ob && ob->objclass == FL_ROUND3DBUTTON
                        && ob->type == FL_RADIO_BUTTON);
 
        map.push_back(ButtonValuePair(ob, value));
index 76cbf85e1c777292208cd6887b9c3e73e3516e49..ae9c8be635cbb991136220cf8cc4b00abb023ac0 100644 (file)
@@ -20,7 +20,6 @@
 
 #include "xforms_helpers.h" // formatted
 
-#include "support/LAssert.h"
 #include "support/lstrings.h"
 
 #include "lyx_forms.h"
@@ -65,7 +64,7 @@ void Tooltips::set()
 
 void Tooltips::init(FL_OBJECT * ob, string const & tip)
 {
-       Assert(ob && ob->form);
+       BOOST_ASSERT(ob && ob->form);
 
        // Store the tooltip string
        string const str = formatted(trim(tip), 400);
index 6d420f14869ad4f0795e902ed5ac4908558e1e96..6e92aacb4c991c705c658f2a851c76318eb5cb65 100644 (file)
@@ -20,7 +20,6 @@
 #include "lyxfunc.h"
 #include "MenuBackend.h"
 
-#include "support/LAssert.h"
 #include "support/lstrings.h"
 #include "support/tostr.h"
 
@@ -343,7 +342,7 @@ void XFormsMenubar::MenuCallback(FL_OBJECT * ob, long button)
        }
 
        // Paranoia check
-       Assert(item->kind() == MenuItem::Submenu);
+       BOOST_ASSERT(item->kind() == MenuItem::Submenu);
 
        // set tabstop length
        fl_set_tabstop(menu_tabstop);
index 1088a8fd4fb1a21801544144c6f7d01bea9df2df..726e5009f58ebe1804aefa0c384fc20dc7706e65 100644 (file)
@@ -15,7 +15,6 @@
 #include "xforms_helpers.h"
 #include "lyxgluelength.h"
 
-#include "support/LAssert.h"
 #include "support/lstrings.h"
 
 #include "lyx_forms.h"
@@ -66,7 +65,7 @@ void setWidget(bool valid, FL_OBJECT * input, FL_OBJECT * label)
 CheckedLyXLength::CheckedLyXLength(FL_OBJECT * input, FL_OBJECT * label)
        : input_(input), label_(label ? label : input)
 {
-       Assert(input && input->objclass == FL_INPUT);
+       BOOST_ASSERT(input && input->objclass == FL_INPUT);
 }
 
 
@@ -86,7 +85,7 @@ bool CheckedLyXLength::check() const
 CheckedGlueLength::CheckedGlueLength(FL_OBJECT * input, FL_OBJECT * label)
        : input_(input), label_(label ? label : input)
 {
-       Assert(input && input->objclass == FL_INPUT);
+       BOOST_ASSERT(input && input->objclass == FL_INPUT);
 }
 
 
index ea97d222b3d5c549803f71774ba90c0a123d6c40..0746a9cf6f41395dc95083da6dd7ea97709529a4 100644 (file)
@@ -15,7 +15,6 @@
 #include "Color.h"
 #include "format.h"
 #include "debug.h"
-#include "support/LAssert.h"
 #include "support/lstrings.h"
 #include "support/lyxfunctional.h"  // compare_memfun
 #include "support/lyxlib.h"
@@ -376,7 +375,7 @@ extern "C" {
 
 int status_report(FL_IMAGE * ob, const char *s)
 {
-       Assert(ob && ob->u_vdata);
+       BOOST_ASSERT(ob && ob->u_vdata);
 
        string const str = s ? rtrim(s) : string();
        if (str.empty())
@@ -395,7 +394,7 @@ int status_report(FL_IMAGE * ob, const char *s)
 
 static void error_report(FL_IMAGE * ob, const char *s)
 {
-       Assert(ob && ob->u_vdata);
+       BOOST_ASSERT(ob && ob->u_vdata);
 
        string const str = s ? rtrim(s) : string();
        if (str.empty())
index 51107927ce08097f2b23cbdaacf572ada8b101bb..cc97b7461aba9a36c134b829bb65f2256b45eae2 100644 (file)
@@ -18,7 +18,6 @@
 
 #include "support/FileInfo.h"
 #include "support/filetools.h"
-#include "support/LAssert.h"
 #include "support/lstrings.h" // frontStrip, strip
 #include "support/tostr.h"
 
@@ -100,7 +99,7 @@ vector<string> const getVector(FL_OBJECT * ob)
                }
                break;
        default:
-               Assert(0);
+               BOOST_ASSERT(false);
        }
 
        return vec;
@@ -111,7 +110,7 @@ vector<string> const getVector(FL_OBJECT * ob)
 string const getString(FL_OBJECT * ob, int line)
 {
        // Negative line value does not make sense.
-       Assert(line >= 0);
+       BOOST_ASSERT(line >= 0);
 
        char const * tmp = 0;
        switch (ob->objclass) {
@@ -140,7 +139,7 @@ string const getString(FL_OBJECT * ob, int line)
                break;
 
        default:
-               Assert(0);
+               BOOST_ASSERT(false);
        }
 
        return tmp ? trim(tmp) : string();
@@ -149,7 +148,7 @@ string const getString(FL_OBJECT * ob, int line)
 string getLengthFromWidgets(FL_OBJECT * input, FL_OBJECT * choice)
 {
        // Paranoia check
-       Assert(input  && input->objclass  == FL_INPUT &&
+       BOOST_ASSERT(input  && input->objclass  == FL_INPUT &&
                    choice && choice->objclass == FL_CHOICE);
 
        string const length = trim(fl_get_input(input));
@@ -190,7 +189,7 @@ void updateWidgetsFromLength(FL_OBJECT * input, FL_OBJECT * choice,
                             string const & default_unit)
 {
        // Paranoia check
-       Assert(input  && input->objclass  == FL_INPUT &&
+       BOOST_ASSERT(input  && input->objclass  == FL_INPUT &&
                    choice && choice->objclass == FL_CHOICE);
 
        if (len.empty()) {
index ad21bb09c698ada112ed52e84dda36ba4a3d2712..ddfc76907847f817d7276bdca59dda99f3864924 100644 (file)
 
 
 #include "xforms_resize.h"
-#include "support/LAssert.h"
+
+#include <boost/assert.hpp>
+
 #include <algorithm> // std::max. Use FL_max in .c code...
 #include "lyx_forms.h"
 
-using namespace lyx::support;
 
 namespace {
 
@@ -95,7 +96,7 @@ double get_scaling_factor(FL_FORM * form)
 
 double get_tabfolder_scale_to_fit(FL_OBJECT * folder)
 {
-       Assert(folder && folder->objclass == FL_TABFOLDER);
+       BOOST_ASSERT(folder && folder->objclass == FL_TABFOLDER);
 
        fl_freeze_form(folder->form);
        int const saved_folder_id = fl_get_folder_number(folder);
@@ -117,7 +118,7 @@ double get_tabfolder_scale_to_fit(FL_OBJECT * folder)
 
 void scale_tabfolder_horizontally(FL_OBJECT * folder, double factor)
 {
-       Assert(folder && folder->objclass == FL_TABFOLDER);
+       BOOST_ASSERT(folder && folder->objclass == FL_TABFOLDER);
 
        fl_freeze_form(folder->form);
        int const saved_folder_id = fl_get_folder_number(folder);
@@ -138,7 +139,7 @@ void scale_tabfolder_horizontally(FL_OBJECT * folder, double factor)
 
 double get_scale_to_fit(FL_FORM * form)
 {
-       Assert(form);
+       BOOST_ASSERT(form);
 
        double factor = get_scaling_factor(form);
        for (FL_OBJECT * ob = form->first; ob; ob = ob->next) {
@@ -152,7 +153,7 @@ double get_scale_to_fit(FL_FORM * form)
 
 void scale_form_horizontally(FL_FORM * form, double factor)
 {
-       Assert(form);
+       BOOST_ASSERT(form);
 
        if (factor <= 1.0)
                return;
index aa3c67c34c37ca9eb29f0c024e872d0fc9e26075..65f8f66612ef6ba38275309efead1e3e77be059a 100644 (file)
@@ -1,3 +1,8 @@
+2003-09-09  Lars Gullik Bjønnes  <larsbj@lyx.org>
+
+       * GraphicsCacheItem.C: change Assert to BOOST_ASSERT
+       * Previews.C: ditto
+
 2003-09-08  Angus Leeming  <leeming@lyx.org>
 
        * GraphicsImage.C:
@@ -19,7 +24,7 @@
 
 2003-09-04  Angus Leeming  <leeming@lyx.org>
 
-       * LoaderQueue.C (get): 
+       * LoaderQueue.C (get):
 
 2003-09-04  Angus Leeming  <leeming@lyx.org>
 
index 69cb8e33f9d3a0f3eaa5346c34246e87a2aa2549..68eb0a4c1dc746a4275556c0a0ccdb5dde689dd6 100644 (file)
 
 #include "support/filetools.h"
 #include "support/FileMonitor.h"
-#include "support/LAssert.h"
 #include "support/lyxlib.h"
 
 #include <boost/bind.hpp>
 
 namespace support = lyx::support;
 
-using support::Assert;
 using support::ChangeExtension;
 using support::FileMonitor;
 using support::IsFileReadable;
@@ -333,7 +331,7 @@ string const findTargetFormat(string const & from)
        FormatList const formats = lyx::graphics::Image::loadableFormats();
 
        // There must be a format to load from.
-       Assert(!formats.empty());
+       BOOST_ASSERT(!formats.empty());
 
        // First ascertain if we can load directly with no conversion
        FormatList::const_iterator it  = formats.begin();
index 3aa53e5bdfd57cc99c9a795cf4d577069d31bf8d..6c0d5436172459e5f84b20d33dad0433cc615c3e 100644 (file)
 
 #include "insets/inset.h"
 
-#include "support/LAssert.h"
-
-namespace support = lyx::support;
-
 
 namespace lyx {
 namespace graphics {
index 607f2c72c7f8198b5b1d0efea322dfd51abcb1a0..1e591c440f6b86116b3d7c19290f61c4d5262b87 100644 (file)
@@ -1,3 +1,7 @@
+2003-09-09  Lars Gullik Bjønnes  <larsbj@lyx.org>
+
+       * several files: change Assert to BOOST_ASSERT
+
 2003-09-09  Martin Vermeer  <martin.vermeer@hut.fi>
 
        * insettext.[Ch]: remove drawText[XY]Offset
@@ -57,8 +61,8 @@
        * insettabular.h: move #include "FuncStatus.h" out of the header file.
        * insettoc.[Ch]: move #include "metricsinfo.h" out of the header file.
 
-       * insetcollapsable.h: 
-       * insetbranch.C: 
+       * insetcollapsable.h:
+       * insetbranch.C:
        * insetnote.C: move #include "funcrequest.h" out of the header file.
 
 2003-09-03  Angus Leeming  <leeming@lyx.org>
index b568448126f2d8ddb614733a9184f909ceccb83d..7fe3f5b08041934acfa4559a2bbf5ee5728f0c5f 100644 (file)
 #include "lyxlex.h"
 
 #include "support/filetools.h"
-#include "support/LAssert.h"
 #include "support/lstrings.h"
 #include "support/path.h"
 #include "support/path_defines.h"
 
+#include <boost/assert.hpp>
+
 #include <algorithm>
 
 namespace support = lyx::support;
@@ -307,7 +308,7 @@ void ExternalTemplate::readTemplate(LyXLex & lex)
                default:
                        lex.printError("ExternalTemplate::readTemplate: "
                                       "Wrong tag: $$Token");
-                       support::Assert(false);
+                       BOOST_ASSERT(false);
                        break;
                }
        }
index 434ee2a3cbc70f07d054a77a1ed99af8b1439f8d..76b23ccec3ce5579c03730ea247612e7488d9dab 100644 (file)
@@ -26,7 +26,6 @@
 #include "frontends/font_metrics.h"
 #include "frontends/Painter.h"
 
-#include "support/LAssert.h"
 #include "support/lstrings.h"
 
 #include "support/std_sstream.h"
@@ -93,7 +92,7 @@ void InsetCaption::draw(PainterInfo & pi, int x, int y) const
        else if (i2->lyxCode() == WRAP_CODE)
                type = static_cast<InsetWrap *>(i2)->params().type;
        else
-               Assert(0);
+               BOOST_ASSERT(false);
 
        FloatList const & floats =
                pi.base.bv->buffer()->params().getLyXTextClass().floats();
index 45ec67327013d295929a29104589b1488c07ace8..afb41605711f68e826c340226fd1e9d9e1c214de 100644 (file)
@@ -27,9 +27,6 @@
 #include "frontends/Painter.h"
 #include "frontends/LyXView.h"
 
-#include "support/LAssert.h"
-
-using namespace lyx::support;
 using namespace lyx::graphics;
 
 using std::endl;
@@ -140,7 +137,7 @@ void InsetCollapsable::draw_collapsed(PainterInfo & pi, int x, int y) const
 
 void InsetCollapsable::draw(PainterInfo & pi, int x, int y, bool inlined) const
 {
-       Assert(pi.base.bv);
+       BOOST_ASSERT(pi.base.bv);
        cache(pi.base.bv);
 
        Dimension dim_collapsed;
index 436afd3e18188b9acfb6bdb16bdc76f394921de1..66721facd3e4c0ee67b20ae80beb4b106685740c 100644 (file)
@@ -132,7 +132,7 @@ dispatch_result InsetExternal::localDispatch(FuncRequest const & cmd)
        switch (cmd.action) {
 
        case LFUN_EXTERNAL_EDIT: {
-               support::Assert(cmd.view());
+               BOOST_ASSERT(cmd.view());
 
                Buffer const & buffer = *cmd.view()->buffer();
                InsetExternal::Params p;
@@ -142,7 +142,7 @@ dispatch_result InsetExternal::localDispatch(FuncRequest const & cmd)
        }
 
        case LFUN_INSET_MODIFY: {
-               support::Assert(cmd.view());
+               BOOST_ASSERT(cmd.view());
 
                Buffer const & buffer = *cmd.view()->buffer();
                InsetExternal::Params p;
@@ -528,7 +528,7 @@ void InsetExternal::updateExternal(string const & format,
 
                // Cannot proceed...
                if (!support::copy(from_file, temp_file))
-                       return;
+                       return;
                from_file = temp_file;
        }
 
@@ -540,7 +540,7 @@ void InsetExternal::updateExternal(string const & format,
        // Yes if to_file does not exist or if from_file is newer than to_file
        if (support::compare_timestamps(from_file, abs_to_file) < 0)
                return;
-       
+
        string const to_filebase = support::ChangeExtension(to_file, string());
        converters.convert(&buf, from_file, to_filebase, from_format, to_format);
 }
index 2cf6305551d4df8f20c36e84d0672fefbe5e0bd6..d7439717503188a0e15d3dd04198d96286605834 100644 (file)
@@ -70,7 +70,6 @@ TODO
 #include "frontends/Alert.h"
 
 #include "support/filetools.h"
-#include "support/LAssert.h"
 #include "support/lyxalgo.h" // lyx::count
 #include "support/lyxlib.h" // float_equal
 #include "support/os.h"
@@ -342,7 +341,7 @@ copyToDirIfNeeded(string const & file_in, string const & dir)
 {
        using support::rtrim;
 
-       support::Assert(AbsolutePath(file_in));
+       BOOST_ASSERT(AbsolutePath(file_in));
 
        string const only_path = support::OnlyPath(file_in);
        if (rtrim(support::OnlyPath(file_in) , "/") == rtrim(dir, "/"))
@@ -358,7 +357,7 @@ copyToDirIfNeeded(string const & file_in, string const & dir)
                mangled = FileName(file_in).mangledFilename();
 
        string const file_out = support::MakeAbsPath(mangled, dir);
-       
+
        unsigned long const checksum_in  = support::sum(file_in);
        unsigned long const checksum_out = support::sum(file_out);
 
@@ -439,7 +438,7 @@ string const InsetGraphics::prepareFile(Buffer const & buf,
                                << "\tunzipped to " << orig_file << endl;
                }
        }
-       
+
        string const from = getExtFromContents(orig_file);
        string const to   = findTargetFormat(from, runparams);
        lyxerr[Debug::GRAPHICS]
index 8e7300e83f6cee0ca69a17d35a51778634c6560d..f3ae71be0a3c5c57d2b83d2b69acf0f593ed0351 100644 (file)
@@ -149,7 +149,7 @@ dispatch_result InsetInclude::localDispatch(FuncRequest const & cmd)
                if (button_.box().contains(cmd.x, cmd.y))
                        InsetIncludeMailer(*this).showDialog(cmd.view());
                return DISPATCHED;
-       
+
        case LFUN_INSET_DIALOG_SHOW:
                InsetIncludeMailer(*this).showDialog(cmd.view());
                return DISPATCHED;
@@ -537,7 +537,7 @@ void InsetInclude::metrics(MetricsInfo & mi, Dimension & dim) const
                }
                button_.metrics(mi, dim);
        }
-       int center_indent = (params_.flag == INPUT ? 0 : 
+       int center_indent = (params_.flag == INPUT ? 0 :
                (mi.base.textwidth - dim.wid) / 2);
        Box b(center_indent, center_indent + dim.wid, -dim.asc, dim.des);
        button_.setBox(b);
index b360672baf109756434497ec1c1bf6064ce6a334..21c205d6f56a1019fc5f66ca044ae7963b3b9743 100644 (file)
@@ -27,7 +27,6 @@
 #include "frontends/font_metrics.h"
 #include "frontends/Painter.h"
 
-#include "support/LAssert.h"
 #include "support/lstrings.h"
 
 using namespace lyx::support;
@@ -257,7 +256,7 @@ int InsetQuotes::latex(Buffer const & buf, ostream & os,
 {
        // How do we get the local language here??
        lyx::pos_type curr_pos = ownerPar(buf, this).getPositionOfInset(this);
-       Assert(curr_pos != -1);
+       BOOST_ASSERT(curr_pos != -1);
 
 #warning FIXME. We _must_ find another way to get the language. (Lgb)
 #if 0
index 43924e5616e124fb7ce1d24d879473a620ba17de..456ea27580685c83097bf6fa708dd3ba5039a6ca 100644 (file)
@@ -34,8 +34,6 @@
 #include "frontends/LyXView.h"
 #include "frontends/Painter.h"
 
-#include "support/LAssert.h"
-
 #include "support/std_sstream.h"
 
 using namespace lyx::support;
@@ -199,7 +197,7 @@ Buffer const & InsetTabular::buffer() const
 
 BufferView * InsetTabular::view() const
 {
-       Assert(false);
+       BOOST_ASSERT(false);
        return 0;
 }
 
@@ -245,7 +243,7 @@ void InsetTabular::metrics(MetricsInfo & mi, Dimension & dim) const
        //      mi.base.textwidth << "\n";
        if (!mi.base.bv) {
                lyxerr << "InsetTabular::metrics: need bv" << endl;
-               Assert(0);
+               BOOST_ASSERT(false);
        }
 
        calculate_dimensions_of_cells(mi);
@@ -361,7 +359,7 @@ void InsetTabular::drawCellLines(Painter & pain, int x, int y,
 void InsetTabular::drawCellSelection(Painter & pain, int x, int y,
                                     int row, int column, int cell) const
 {
-       Assert(hasSelection());
+       BOOST_ASSERT(hasSelection());
        int cs = tabular.column_of_cell(sel_cell_start);
        int ce = tabular.column_of_cell(sel_cell_end);
        if (cs > ce) {
@@ -2400,7 +2398,7 @@ InsetTabular::selectNextWordToSpellcheck(BufferView * bv, float & value) const
 WordLangTuple InsetTabular::selectNextWordInt(BufferView * bv, float & value) const
 {
        // when entering this function the inset should be ALWAYS locked!
-       Assert(the_locking_inset);
+       BOOST_ASSERT(the_locking_inset);
 
        WordLangTuple word(the_locking_inset->selectNextWordToSpellcheck(bv, value));
        if (!word.word().empty())
index ff9e07727c253c011cc767c86270869b3cd5a6a8..c7861f0f7e9dee2fc05b4a9f6df9fbe5609bdf29 100644 (file)
 #include "frontends/Dialogs.h"
 #include "frontends/LyXView.h"
 
-#include "support/LAssert.h"
-
-using namespace lyx::support;
-
 
 void MailInset::showDialog(BufferView * bv) const
 {
-       Assert(bv);
+       BOOST_ASSERT(bv);
        bv->owner()->getDialogs().show(name(), inset2string(*bv->buffer()),
                                       &inset());
 }
@@ -32,7 +28,7 @@ void MailInset::showDialog(BufferView * bv) const
 
 void MailInset::updateDialog(BufferView * bv) const
 {
-       Assert(bv);
+       BOOST_ASSERT(bv);
        if(bv->owner()->getDialogs().visible(name()))
                bv->owner()->getDialogs().update(name(),
                                                 inset2string(*bv->buffer()));
index 9018865f32334db746089be1953719b2c696a1b3..f010b24306537f51bfc1fdf51f30b86ec2ec470c 100644 (file)
@@ -25,7 +25,6 @@
 #include "graphics/GraphicsImage.h"
 
 #include "support/filetools.h"
-#include "support/LAssert.h"
 
 using namespace lyx::support;
 
@@ -77,7 +76,7 @@ void ButtonRenderer::update(string const & text, bool editable)
 
 void ButtonRenderer::metrics(MetricsInfo & mi, Dimension & dim) const
 {
-       Assert(mi.base.bv);
+       BOOST_ASSERT(mi.base.bv);
 
        LyXFont font(LyXFont::ALL_SANE);
        font.decSize();
@@ -93,7 +92,7 @@ void ButtonRenderer::metrics(MetricsInfo & mi, Dimension & dim) const
 
 void ButtonRenderer::draw(PainterInfo & pi, int x, int y) const
 {
-       Assert(pi.base.bv);
+       BOOST_ASSERT(pi.base.bv);
        view_ = pi.base.bv->owner()->view();
 
        // Draw it as a box with the LaTeX text
@@ -133,7 +132,7 @@ void GraphicRenderer::update(lyx::graphics::Params const & params)
        params_ = params;
 
        if (!params_.filename.empty()) {
-               Assert(AbsolutePath(params_.filename));
+               BOOST_ASSERT(AbsolutePath(params_.filename));
                loader_.reset(params_.filename, params_);
        }
 }
@@ -231,7 +230,7 @@ void GraphicRenderer::metrics(MetricsInfo & mi, Dimension & dim) const
 
 void GraphicRenderer::draw(PainterInfo & pi, int x, int y) const
 {
-       Assert(pi.base.bv);
+       BOOST_ASSERT(pi.base.bv);
        view_ = pi.base.bv->owner()->view();
 
 #if 0
index 829d89e2715aa7b4fee612be2a632c5e931a4fba..613c2f318cf92b54fb1b076b6f14637dae02f4c5 100644 (file)
@@ -67,7 +67,6 @@
 #include "support/FileInfo.h"
 #include "support/filetools.h"
 #include "support/forkedcontr.h"
-#include "support/LAssert.h"
 #include "support/path.h"
 #include "support/path_defines.h"
 #include "support/tostr.h"
@@ -680,9 +679,9 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & ev) const
                        disable = !inset;
                        if (!disable) {
                                code = inset->lyxCode();
-                               if (!(code == InsetOld::INCLUDE_CODE 
-                                       || code == InsetOld::BIBTEX_CODE 
-                                       || code == InsetOld::FLOAT_LIST_CODE 
+                               if (!(code == InsetOld::INCLUDE_CODE
+                                       || code == InsetOld::BIBTEX_CODE
+                                       || code == InsetOld::FLOAT_LIST_CODE
                                        || code == InsetOld::TOC_CODE))
                                        disable = true;
                        }
@@ -1466,9 +1465,9 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
                        FuncRequest cmd(view(), LFUN_INSET_DIALOG_SHOW);
                        inset->localDispatch(cmd);
                }
-       }
-       break;                                                   
-       
+       }
+       break;
+
        case LFUN_DIALOG_UPDATE: {
                string const & name = argument;
                // Can only update a dialog connected to an existing inset
@@ -1982,7 +1981,7 @@ string const LyXFunc::view_status_message()
 
 BufferView * LyXFunc::view() const
 {
-       Assert(owner);
+       BOOST_ASSERT(owner);
        return owner->view().get();
 }
 
index 46ff329d1d9cd144b96eca8d36842d1c3814ba66..a8a28e5172e847dd3f045eb7f0ab2d54c70a0aa4 100644 (file)
 #include "lyxtext.h"
 #include "paragraph.h"
 
-#include "support/LAssert.h"
-
 #include <boost/next_prior.hpp>
 
 using lyx::pos_type;
-using lyx::support::Assert;
 
 using std::max;
 using std::min;
@@ -38,7 +35,7 @@ bool isParEnd(Paragraph const & par, RowList::iterator rit)
                lyxerr << "broken row 1: end: " << rit->end() << " next: "
                        << boost::next(rit)->pos() << endl;
                lyxerr << endl;
-               Assert(false);
+               BOOST_ASSERT(false);
        }
 #endif
        return boost::next(rit) == par.rows.end();
@@ -58,7 +55,7 @@ pos_type lastPos(Paragraph const & par, RowList::iterator rit)
                lyxerr << "broken row 2: end: " << rit->end() << " next: "
                        << boost::next(rit)->pos() << endl;
                lyxerr << endl;
-               Assert(false);
+               BOOST_ASSERT(false);
        }
        return boost::next(rit)->pos() - 1;
 }
index e2a2d4362ccda5047fbebc7adf935ada8695818b..9ed063af57e58aa7d84094c648687c376841ce10 100644 (file)
@@ -22,7 +22,6 @@
 #include "FloatList.h"
 
 #include "support/lstrings.h"
-#include "support/LAssert.h"
 #include "support/filetools.h"
 
 
@@ -760,7 +759,7 @@ bool LyXTextClass::hasLayout(string const & n) const
 
 LyXLayout_ptr const & LyXTextClass::operator[](string const & name) const
 {
-       Assert(!name.empty());
+       BOOST_ASSERT(!name.empty());
 
        LayoutList::const_iterator cit =
                find_if(layoutlist_.begin(),
@@ -776,7 +775,7 @@ LyXLayout_ptr const & LyXTextClass::operator[](string const & name) const
                        lyxerr  << " " << it->get()->name() << endl;
 
                // we require the name to exist
-               Assert(false);
+               BOOST_ASSERT(false);
        }
 
        return (*cit);
index caaf250321554f461d4e50dd69732bb905a2c72c..2530e8897acbb8ce36a5bf05aa0a4a5f4048ca20 100644 (file)
@@ -13,7 +13,6 @@
 
 #include "formulabase.h"
 #include "support/std_sstream.h"
-#include "support/LAssert.h"
 #include "formula.h"
 #include "formulamacro.h"
 #include "funcrequest.h"
@@ -712,7 +711,7 @@ dispatch_result InsetFormulaBase::localDispatch(FuncRequest const & cmd)
        mathcursor->normalize();
        mathcursor->touch();
 
-       Assert(mathcursor);
+       BOOST_ASSERT(mathcursor);
 
        if (mathcursor->selection() || was_selection)
                toggleInsetSelection(bv);
index ff3cda14a85955527caa61b0985bf12bdc7faf42..a878c210e28c40513ff6ad1e1d8663d094bb1442 100644 (file)
@@ -12,7 +12,6 @@
 #include <config.h>
 
 #include "lyxrc.h"
-#include "support/LAssert.h"
 #include "support/limited_stack.h"
 #include "debug.h"
 #include "support/std_sstream.h"
@@ -35,8 +34,6 @@
 
 //#define FILEDEBUG 1
 
-using namespace lyx::support;
-
 using std::endl;
 using std::isalpha;
 using std::min;
@@ -823,28 +820,28 @@ bool MathCursor::hasNextAtom() const
 
 MathAtom const & MathCursor::prevAtom() const
 {
-       Assert(pos() > 0);
+       BOOST_ASSERT(pos() > 0);
        return array()[pos() - 1];
 }
 
 
 MathAtom & MathCursor::prevAtom()
 {
-       Assert(pos() > 0);
+       BOOST_ASSERT(pos() > 0);
        return array()[pos() - 1];
 }
 
 
 MathAtom const & MathCursor::nextAtom() const
 {
-       Assert(pos() < size());
+       BOOST_ASSERT(pos() < size());
        return array()[pos()];
 }
 
 
 MathAtom & MathCursor::nextAtom()
 {
-       Assert(pos() < size());
+       BOOST_ASSERT(pos() < size());
        return array()[pos()];
 }
 
@@ -910,14 +907,14 @@ void MathCursor::getSelection(CursorPos & i1, CursorPos & i2) const
 
 CursorPos & MathCursor::cursor()
 {
-       Assert(depth());
+       BOOST_ASSERT(depth());
        return Cursor_.back();
 }
 
 
 CursorPos const & MathCursor::cursor() const
 {
-       Assert(depth());
+       BOOST_ASSERT(depth());
        return Cursor_.back();
 }
 
@@ -1392,7 +1389,7 @@ CursorPos MathCursor::normalAnchor() const
                Anchor_ = Cursor_;
                lyxerr << "unusual Anchor size" << endl;
        }
-       //lyx::Assert(Anchor_.size() >= cursor.depth());
+       //lyx::BOOST_ASSERT(Anchor_.size() >= cursor.depth());
        // use Anchor on the same level as Cursor
        CursorPos normal = Anchor_[depth() - 1];
        if (depth() < Anchor_.size() && !(normal < cursor())) {
index a63c627710915947f825b63d4e51904cffeba55d..0bb3b984e220acfc61ae1b6e2cea9d79ff0e0a35 100644 (file)
 #include "math_support.h"
 #include "math_replace.h"
 #include "debug.h"
-#include "support/LAssert.h"
 #include "frontends/Painter.h"
 
-using namespace lyx::support;
-
 using std::abs;
 using std::endl;
 using std::min;
@@ -47,14 +44,14 @@ void MathArray::substitute(MathMacro const & m)
 
 MathAtom & MathArray::operator[](pos_type pos)
 {
-       Assert(pos < size());
+       BOOST_ASSERT(pos < size());
        return base_type::operator[](pos);
 }
 
 
 MathAtom const & MathArray::operator[](pos_type pos) const
 {
-       Assert(pos < size());
+       BOOST_ASSERT(pos < size());
        return base_type::operator[](pos);
 }
 
@@ -67,7 +64,7 @@ void MathArray::insert(size_type pos, MathAtom const & t)
 
 void MathArray::insert(size_type pos, MathArray const & ar)
 {
-       Assert(pos <= size());
+       BOOST_ASSERT(pos <= size());
        base_type::insert(begin() + pos, ar.begin(), ar.end());
 }
 
index c392b34d72d4c1aa0203cfbf07b9b4275a6d0885..d39611c0d4658609187c760e52201782ee39d0a1 100644 (file)
@@ -22,7 +22,6 @@
 #include "funcrequest.h"
 #include "support/std_sstream.h"
 #include "LaTeXFeatures.h"
-#include "support/LAssert.h"
 
 #include "frontends/Alert.h"
 #include "lyxrc.h"
@@ -263,7 +262,7 @@ void MathHullInset::drawT(TextPainter & pain, int x, int y) const
 string MathHullInset::label(row_type row) const
 {
        row_type n = nrows();
-       Assert(row < n);
+       BOOST_ASSERT(row < n);
        return label_[row];
 }
 
@@ -672,8 +671,8 @@ void MathHullInset::infoize(std::ostream & os) const
 
 void MathHullInset::check() const
 {
-       Assert(nonum_.size() == nrows());
-       Assert(label_.size() == nrows());
+       BOOST_ASSERT(nonum_.size() == nrows());
+       BOOST_ASSERT(label_.size() == nrows());
 }
 
 
index b599e604fc289dfce3e9c74cfb79e8a9e69a41ab..aa2d5a8b55220d9ab503946651372e505c4e9775 100644 (file)
@@ -12,9 +12,9 @@
 
 #include "math_iterator.h"
 #include "math_inset.h"
-#include "support/LAssert.h"
 
-using namespace lyx::support;
+#include <boost/assert.hpp>
+
 
 MathIterator::MathIterator()
 {}
@@ -56,7 +56,7 @@ void MathIterator::push(MathInset * p)
 void MathIterator::pop()
 {
        //lyxerr << "pop: " << endl;
-       Assert(size());
+       BOOST_ASSERT(size());
        pop_back();
 }
 
@@ -124,8 +124,8 @@ void MathIterator::operator++()
 void MathIterator::jump(difference_type i)
 {
        back().pos_ += i;
-       //Assert(back().pos_ >= 0);
-       Assert(back().pos_ <= cell().size());
+       //BOOST_ASSERT(back().pos_ >= 0);
+       BOOST_ASSERT(back().pos_ <= cell().size());
 }
 
 
index f849d5c22ad5c3c93e020d3ae2fb1198d7b95148..3f812cb99d479a228cbe8a95705b19601af627c6 100644 (file)
@@ -721,7 +721,7 @@ void Parser::parse1(MathGridInset & grid, unsigned flags,
                        if (flags & FLAG_BRACE_LAST)
                                return;
                        error("found '}' unexpectedly");
-                       //lyx::Assert(0);
+                       //BOOST_ASSERT(false);
                        //add(cell, '}', LM_TC_TEX);
                }
 
index 6546268d3f033f57ae7def6d1aa8a9da6ef214a2..15165e9ba3c0cfb0027a4ad60e06242944d894c4 100644 (file)
@@ -13,9 +13,8 @@
 #include "math_pos.h"
 #include "math_inset.h"
 #include "debug.h"
-#include "support/LAssert.h"
 
-using namespace lyx::support;
+#include <boost/assert.hpp>
 
 using std::endl;
 
@@ -28,21 +27,21 @@ CursorPos::CursorPos()
 CursorPos::CursorPos(MathInset * p)
        : inset_(p), idx_(0), pos_(0)
 {
-       Assert(inset_);
+       BOOST_ASSERT(inset_);
 }
 
 
 
 MathArray & CursorPos::cell(MathArray::idx_type idx) const
 {
-       Assert(inset_);
+       BOOST_ASSERT(inset_);
        return inset_->cell(idx);
 }
 
 
 MathArray & CursorPos::cell() const
 {
-       Assert(inset_);
+       BOOST_ASSERT(inset_);
        return inset_->cell(idx_);
 }
 
index ba4d7a8a7a750d2c1ac9ca396a97190b1691f39e..fad41bd229fbc8dc89e8d153f91868f0c0e5f551 100644 (file)
@@ -17,9 +17,6 @@
 #include "math_symbolinset.h"
 #include "debug.h"
 #include "funcrequest.h"
-#include "support/LAssert.h"
-
-using namespace lyx::support;
 
 using std::max;
 using std::auto_ptr;
@@ -159,14 +156,14 @@ int MathScriptInset::dy1() const
 
 int MathScriptInset::dx0() const
 {
-       Assert(hasDown());
+       BOOST_ASSERT(hasDown());
        return hasLimits() ? (dim_.wid - down().width()) / 2 : nwid();
 }
 
 
 int MathScriptInset::dx1() const
 {
-       Assert(hasUp());
+       BOOST_ASSERT(hasUp());
        return hasLimits() ? (dim_.wid - up().width()) / 2 : nwid();
 }
 
index ecd3c96a3bb5fecd7dd0bd541ecbc157d36aec35..6ab5f5d49ec5d18e136ff98fc80a55b7407da5ee 100644 (file)
@@ -36,9 +36,7 @@
 #include "insets/insetoptarg.h"
 
 #include "support/lstrings.h"
-#include "support/LAssert.h"
 #include "support/textutils.h"
-
 #include "support/std_sstream.h"
 
 
@@ -294,14 +292,14 @@ bool Paragraph::insetAllowed(InsetOld::Code code)
 
 InsetOld * Paragraph::getInset(pos_type pos)
 {
-       Assert(pos < size());
+       BOOST_ASSERT(pos < size());
        return insetlist.get(pos);
 }
 
 
 InsetOld const * Paragraph::getInset(pos_type pos) const
 {
-       Assert(pos < size());
+       BOOST_ASSERT(pos < size());
        return insetlist.get(pos);
 }
 
@@ -310,7 +308,7 @@ InsetOld const * Paragraph::getInset(pos_type pos) const
 LyXFont const Paragraph::getFontSettings(BufferParams const & bparams,
                                         pos_type pos) const
 {
-       Assert(pos <= size());
+       BOOST_ASSERT(pos <= size());
 
        Pimpl::FontList::const_iterator cit = pimpl_->fontlist.begin();
        Pimpl::FontList::const_iterator end = pimpl_->fontlist.end();
@@ -330,7 +328,7 @@ LyXFont const Paragraph::getFontSettings(BufferParams const & bparams,
 
 lyx::pos_type Paragraph::getEndPosOfFontSpan(lyx::pos_type pos) const
 {
-       Assert(pos <= size());
+       BOOST_ASSERT(pos <= size());
 
        Pimpl::FontList::const_iterator cit = pimpl_->fontlist.begin();
        Pimpl::FontList::const_iterator end = pimpl_->fontlist.end();
@@ -363,7 +361,7 @@ LyXFont const Paragraph::getFirstFontSettings() const
 LyXFont const Paragraph::getFont(BufferParams const & bparams, pos_type pos,
                                 LyXFont const & outerfont) const
 {
-       Assert(pos >= 0);
+       BOOST_ASSERT(pos >= 0);
 
        LyXLayout_ptr const & lout = layout();
 
@@ -485,7 +483,7 @@ Paragraph::getUChar(BufferParams const & bparams, pos_type pos) const
 
 void Paragraph::setFont(pos_type pos, LyXFont const & font)
 {
-       Assert(pos <= size());
+       BOOST_ASSERT(pos <= size());
 
        // First, reduce font against layout/label font
        // Update: The SetCharFont() routine in text2.C already
@@ -1208,14 +1206,14 @@ void Paragraph::cleanChanges()
 
 Change::Type Paragraph::lookupChange(lyx::pos_type pos) const
 {
-       Assert(!size() || pos < size());
+       BOOST_ASSERT(!size() || pos < size());
        return pimpl_->lookupChange(pos);
 }
 
 
 Change const Paragraph::lookupChangeFull(lyx::pos_type pos) const
 {
-       Assert(!size() || pos < size());
+       BOOST_ASSERT(!size() || pos < size());
        return pimpl_->lookupChangeFull(pos);
 }
 
index 18b07d4366d21b8407177599cf310c901d3eea47..be520c2e93fc356ff244140d353d293f9d50fa1f 100644 (file)
@@ -37,9 +37,7 @@
 #include "insets/insetspecialchar.h"
 #include "insets/insettabular.h"
 
-#include "support/LAssert.h"
 #include "support/lstrings.h"
-
 #include "support/std_sstream.h"
 
 using namespace lyx::support;
@@ -1072,7 +1070,7 @@ ParagraphList::iterator outerPar(Buffer const & buf, InsetOld const * inset)
                                return pit.outerPar();
        }
        lyxerr << "outerPar: should not happen" << endl;
-       Assert(false);
+       BOOST_ASSERT(false);
        return const_cast<Buffer &>(buf).paragraphs().end(); // shut up compiler
 }
 
@@ -1095,6 +1093,6 @@ Paragraph const & ownerPar(Buffer const & buf, InsetOld const * inset)
                                return *pit.pit();
        }
        lyxerr << "ownerPar: should not happen" << endl;
-       Assert(false);
+       BOOST_ASSERT(false);
        return buf.paragraphs().front(); // shut up compiler
 }
index 9d9c952159bf0db74a9560f537f0e1b3cb98f37e..413f49d4c324a4aca30a4ab9e507c6e35965370f 100644 (file)
@@ -25,9 +25,6 @@
 #include "lyxrc.h"
 #include "texrow.h"
 
-#include "support/LAssert.h"
-
-using namespace lyx::support;
 
 using lyx::pos_type;
 
@@ -177,7 +174,7 @@ Change const Paragraph::Pimpl::lookupChangeFull(pos_type pos) const
 
 void Paragraph::Pimpl::markErased()
 {
-       Assert(tracking());
+       BOOST_ASSERT(tracking());
 
        // FIXME: we should actually remove INSERTED chars.
        // difficult because owning insettexts/tabulars need
@@ -262,7 +259,7 @@ Paragraph::value_type Paragraph::Pimpl::getChar(pos_type pos) const
        // This is in the critical path for loading!
        pos_type const siz = size();
 
-       Assert(pos <= siz);
+       BOOST_ASSERT(pos <= siz);
 
        if (pos == siz) {
                lyxerr << "getChar() on pos " << pos << " in par id "
@@ -273,7 +270,7 @@ Paragraph::value_type Paragraph::Pimpl::getChar(pos_type pos) const
 
        return text[pos];
 #else
-       Assert(pos < size());
+       BOOST_ASSERT(pos < size());
        return text[pos];
 #endif
 }
@@ -289,7 +286,7 @@ void Paragraph::Pimpl::setChar(pos_type pos, value_type c)
 void Paragraph::Pimpl::insertChar(pos_type pos, value_type c,
                                  LyXFont const & font, Change change)
 {
-       Assert(pos <= size());
+       BOOST_ASSERT(pos <= size());
 
        if (tracking()) {
                changes_->record(change, pos);
@@ -326,11 +323,11 @@ void Paragraph::Pimpl::insertChar(pos_type pos, value_type c,
 void Paragraph::Pimpl::insertInset(pos_type pos,
                                   InsetOld * inset, LyXFont const & font, Change change)
 {
-       Assert(inset);
-       Assert(pos <= size());
+       BOOST_ASSERT(inset);
+       BOOST_ASSERT(pos <= size());
 
        insertChar(pos, META_INSET, font, change);
-       Assert(text[pos] == META_INSET);
+       BOOST_ASSERT(text[pos] == META_INSET);
 
        // Add a new entry in the insetlist.
        owner_->insetlist.insert(inset, pos);
@@ -386,7 +383,7 @@ void Paragraph::Pimpl::eraseIntern(pos_type pos)
 
 bool Paragraph::Pimpl::erase(pos_type pos)
 {
-       Assert(pos < size());
+       BOOST_ASSERT(pos < size());
 
        if (tracking()) {
                Change::Type changetype(changes_->lookup(pos));
index 1b335e930679743b1322f0afa265eb9d5745ebc1..047f9d0e14e8026ff2b2faf162ced32a16061b72 100644 (file)
@@ -13,7 +13,6 @@
 
 #ifdef USE_PSPELL
 
-#include "support/LAssert.h"
 #include "debug.h"
 
 #define USE_ORIGINAL_MANAGER_FUNCS 1
@@ -96,14 +95,14 @@ enum PSpell::Result PSpell::check(WordLangTuple const & word)
        PspellManager * m = it->second.manager;
 
        int word_ok = pspell_manager_check(m, word.word().c_str());
-       Assert(word_ok != -1);
+       BOOST_ASSERT(word_ok != -1);
 
        if (word_ok) {
                res = OK;
        } else {
                PspellWordList const * sugs =
                        pspell_manager_suggest(m, word.word().c_str());
-               Assert(sugs != 0);
+               BOOST_ASSERT(sugs != 0);
                els = pspell_word_list_elements(sugs);
                if (pspell_word_list_empty(sugs))
                        res = UNKNOWN;
index 3e45053f0459cb9cbce7fdf33ac82d52653fc3f4..723b4342b2b83bc2c065c13c5c052b596f16eb5a 100644 (file)
 
 #include "insets/insettext.h"
 
-#include "support/LAssert.h"
 #include "support/textutils.h"
 
-using namespace lyx::support;
 
 using std::max;
 using lyx::pos_type;
@@ -178,7 +176,7 @@ void RowPainter::paintInset(pos_type const pos)
 {
        InsetOld * inset = const_cast<InsetOld*>(pit_->getInset(pos));
 
-       Assert(inset);
+       BOOST_ASSERT(inset);
 
        PainterInfo pi(perv(bv_));
        pi.base.font = getFont(pos);
index 9aed3748f9448a6a380d5d5c93c964496afc1987..ce82f3f96e72b975ee0bf8a23a4b85eb9436c817 100644 (file)
@@ -1,6 +1,15 @@
+2003-09-09  Lars Gullik Bjønnes  <larsbj@lyx.org>
+
+       * Makefile.am (libsupport_la_SOURCES): remove LAssert.C and LAssert.h
+
+       * several files: change Assert to BOOST_ASSERT
+
+       * LAssert.C:
+       * LAssert.h: remove files
+
 2003-09-08  Angus Leeming  <leeming@lyx.org>
 
-       * filename.C: 
+       * filename.C:
        * filetools.C: tell the world where to find author contact details.
 
 2003-09-08  Angus Leeming  <leeming@lyx.org>
@@ -24,8 +33,8 @@
 
 2003-09-05  Angus Leeming  <leeming@lyx.org>
 
-       * lyxmanip.h: 
-       * textutils.h: 
+       * lyxmanip.h:
+       * textutils.h:
        ensure that the header file can be compiled stand-alone.
 
 2003-09-04  Lars Gullik Bjønnes  <larsbj@lyx.org>
index 4dd40fc73b9026f690bb302e595793dc452f3035..a118056160b3cd5131c8fbd04493556cd70418b4 100644 (file)
 
 #include <config.h>
 
-#include <cerrno>
 #include "FileInfo.h"
-#include "LAssert.h"
+
+#include <boost/assert.hpp>
+
+#include <cerrno>
 
 #if !S_IRUSR
 # if S_IREAD
@@ -207,7 +209,7 @@ FileInfo & FileInfo::newFile(int fildes)
 // should not be in FileInfo
 char FileInfo::typeIndicator() const
 {
-       Assert(isOK());
+       BOOST_ASSERT(isOK());
        if (S_ISDIR(buf_.st_mode))
                return '/';
 #ifdef S_ISLNK
@@ -230,7 +232,7 @@ char FileInfo::typeIndicator() const
 
 mode_t FileInfo::getMode() const
 {
-       Assert(isOK());
+       BOOST_ASSERT(isOK());
        return buf_.st_mode;
 }
 
@@ -238,7 +240,7 @@ mode_t FileInfo::getMode() const
 // should not be in FileInfo
 string FileInfo::modeString() const
 {
-       Assert(isOK());
+       BOOST_ASSERT(isOK());
        char str[11];
        str[0] = typeLetter(buf_.st_mode);
        flagRWX((buf_.st_mode & 0700) << 0, &str[1]);
@@ -253,49 +255,49 @@ string FileInfo::modeString() const
 
 time_t FileInfo::getModificationTime() const
 {
-       Assert(isOK());
+       BOOST_ASSERT(isOK());
        return buf_.st_mtime;
 }
 
 
 time_t FileInfo::getAccessTime() const
 {
-       Assert(isOK());
+       BOOST_ASSERT(isOK());
        return buf_.st_atime;
 }
 
 
 time_t FileInfo::getStatusChangeTime() const
 {
-       Assert(isOK());
+       BOOST_ASSERT(isOK());
        return buf_.st_ctime;
 }
 
 
 nlink_t FileInfo::getNumberOfLinks() const
 {
-       Assert(isOK());
+       BOOST_ASSERT(isOK());
        return buf_.st_nlink;
 }
 
 
 uid_t FileInfo::getUid() const
 {
-       Assert(isOK());
+       BOOST_ASSERT(isOK());
        return buf_.st_uid;
 }
 
 
 gid_t FileInfo::getGid() const
 {
-       Assert(isOK());
+       BOOST_ASSERT(isOK());
        return buf_.st_gid;
 }
 
 
 off_t FileInfo::getSize() const
 {
-       Assert(isOK());
+       BOOST_ASSERT(isOK());
        return buf_.st_size;
 }
 
@@ -314,49 +316,49 @@ bool FileInfo::isOK() const
 
 bool FileInfo::isLink() const
 {
-       Assert(isOK());
+       BOOST_ASSERT(isOK());
        return S_ISLNK(buf_.st_mode);
 }
 
 
 bool FileInfo::isRegular() const
 {
-       Assert(isOK());
+       BOOST_ASSERT(isOK());
        return S_ISREG(buf_.st_mode);
 }
 
 
 bool FileInfo::isDir() const
 {
-       Assert(isOK());
+       BOOST_ASSERT(isOK());
        return S_ISDIR(buf_.st_mode);
 }
 
 
 bool FileInfo::isChar() const
 {
-       Assert(isOK());
+       BOOST_ASSERT(isOK());
        return S_ISCHR(buf_.st_mode);
 }
 
 
 bool FileInfo::isBlock() const
 {
-       Assert(isOK());
+       BOOST_ASSERT(isOK());
        return S_ISBLK(buf_.st_mode);
 }
 
 
 bool FileInfo::isFifo() const
 {
-       Assert(isOK());
+       BOOST_ASSERT(isOK());
        return S_ISFIFO(buf_.st_mode);
 }
 
 
 bool FileInfo::isSocket() const
 {
-       Assert(isOK());
+       BOOST_ASSERT(isOK());
 #ifdef S_ISSOCK
        return S_ISSOCK(buf_.st_mode);
 #else
diff --git a/src/support/LAssert.C b/src/support/LAssert.C
deleted file mode 100644 (file)
index fb18db0..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * \file LAssert.C
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author Lars Gullik Bjønnes
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#include <config.h>
-
-#include "LAssert.h"
-#include "support/lyxlib.h"
-
-#ifdef ENABLE_ASSERTIONS
-#include "lyx_main.h"
-#include "errorlist.h"
-
-namespace lyx {
-namespace support {
-
-namespace {
-
-void emergencyCleanup()
-{
-       static bool didCleanup;
-       if (didCleanup)
-               return;
-
-       didCleanup = true;
-
-       LyX::emergencyCleanup();
-}
-
-} // namespace anon
-
-void Assert(bool assertion)
-{
-       if (!assertion) {
-               emergencyCleanup();
-               lyx::support::abort();
-       }
-}
-
-} // namespace support
-} // namespace lyx
-
-#endif
diff --git a/src/support/LAssert.h b/src/support/LAssert.h
deleted file mode 100644 (file)
index e87739b..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-// -*- C++ -*-
-/**
- * \file LAssert.h
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author Lars Gullik Bjønnes
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#ifndef LASSERT_H
-#define LASSERT_H
-
-namespace lyx {
-namespace support {
-
-#ifdef ENABLE_ASSERTIONS
-
-/** Live assertion.
-    This is a debug tool to ensure that the assertion holds. If it don't hole
-    we run #emergencyCleanup()# and then #lyx::abort".
-    @param assertion this should evaluate to true unless you want an abort.
-*/
-void Assert(bool assertion);
-
-#else
-
-/** Dummy assertion.
-    When compiling without assertions we use this no-op function.
-*/
-inline
-void Assert(bool /*assertion*/) {}
-
-#endif /* ENABLE_ASSERTIONS */
-
-} // namespace support
-} // namespace lyx
-
-#endif /* LASSERT_H */
index ae25732d74bac2e55dce97a4e512a3ce7673733d..9d7c22a366cc9cb4c36bf9d8c688242950105b89 100644 (file)
@@ -27,8 +27,6 @@ libsupport_la_SOURCES = \
        FileInfo.h \
        FileMonitor.h \
        FileMonitor.C \
-       LAssert.C \
-       LAssert.h \
        abort.C \
        atoi.C \
        boost-inst.C \
index ca193052e0644f28902359007a766bf74b69f807..4c4095855519efedf2ed097cc933a335b29ea83e 100644 (file)
 
 #include "filename.h"
 
-#include "LAssert.h"
 #include "filetools.h"
 #include "lstrings.h"
 #include "os.h"
 
+#include <boost/assert.hpp>
+
 
 namespace lyx {
 namespace support {
@@ -30,7 +31,7 @@ FileName::FileName()
 FileName::FileName(string const & abs_filename, bool save_abs)
        : name_(abs_filename), save_abs_path_(save_abs)
 {
-       Assert(AbsolutePath(name_));
+       BOOST_ASSERT(AbsolutePath(name_));
 }
 
 
index ccd0334f35ad9e30ae22edeabd8a46e7b648e6b4..de34abb607b0994c45a92112868ab71a237215af 100644 (file)
@@ -24,7 +24,6 @@
 #include "debug.h"
 #include "support/tostr.h"
 #include "support/systemcall.h"
-#include "support/LAssert.h"
 
 #include "filetools.h"
 #include "lstrings.h"
@@ -37,7 +36,9 @@
 
 #include "support/std_sstream.h"
 
+#include <boost/assert.hpp>
 #include <boost/cregex.hpp>
+
 #include <cctype>
 #include <cstdlib>
 #include <cstdio>
@@ -514,7 +515,7 @@ bool createDirectory(string const & path, int permission)
 {
        string temp(rtrim(os::slashify_path(path), "/"));
 
-       Assert(!temp.empty());
+       BOOST_ASSERT(!temp.empty());
 
        if (mkdir(temp, permission))
                return false;
@@ -1343,7 +1344,7 @@ string const readBB_from_PSFile(string const & file)
 
 int compare_timestamps(string const & file1, string const & file2)
 {
-       Assert(AbsolutePath(file1) && AbsolutePath(file2));
+       BOOST_ASSERT(AbsolutePath(file1) && AbsolutePath(file2));
 
        // If the original is newer than the copy, then copy the original
        // to the new directory.
index 023484ee231ffad46aef401d5caf492d3e78b39e..f865c2cab7f0457e7d7f82d7c1f3a411bebca3a8 100644 (file)
@@ -13,7 +13,6 @@
 
 #include "support/std_string.h"
 #include "lstrings.h"
-#include "LAssert.h"
 #include "support/std_sstream.h"
 #include "debug.h"
 #include "BoostFormat.h"
@@ -434,7 +433,7 @@ string const subst(string const & a,
 
 string const trim(string const & a, char const * p)
 {
-       Assert(p);
+       BOOST_ASSERT(p);
 
        if (a.empty() || !*p)
                return a;
@@ -452,7 +451,7 @@ string const trim(string const & a, char const * p)
 
 string const rtrim(string const & a, char const * p)
 {
-       Assert(p);
+       BOOST_ASSERT(p);
 
        if (a.empty() || !*p)
                return a;
@@ -469,7 +468,7 @@ string const rtrim(string const & a, char const * p)
 
 string const ltrim(string const & a, char const * p)
 {
-       Assert(p);
+       BOOST_ASSERT(p);
 
        if (a.empty() || !*p)
                return a;
@@ -662,7 +661,7 @@ string bformat(string const & fmt, string const & arg1, string const & arg2,
 
 string bformat(string const & fmt, string const & arg1)
 {
-       Assert(contains(fmt, "%1$s"));
+       BOOST_ASSERT(contains(fmt, "%1$s"));
        string const str = subst(fmt, "%1$s", arg1);
        return subst(str, "%%", "%");
 }
@@ -670,8 +669,8 @@ string bformat(string const & fmt, string const & arg1)
 
 string bformat(string const & fmt, string const & arg1, string const & arg2)
 {
-       Assert(contains(fmt, "%1$s"));
-       Assert(contains(fmt, "%2$s"));
+       BOOST_ASSERT(contains(fmt, "%1$s"));
+       BOOST_ASSERT(contains(fmt, "%2$s"));
        string str = subst(fmt, "%1$s", arg1);
        str = subst(str, "%2$s", arg2);
        return subst(str, "%%", "%");
@@ -680,8 +679,8 @@ string bformat(string const & fmt, string const & arg1, string const & arg2)
 
 string bformat(string const & fmt, int arg1, int arg2)
 {
-       Assert(contains(fmt, "%1$d"));
-       Assert(contains(fmt, "%2$d"));
+       BOOST_ASSERT(contains(fmt, "%1$d"));
+       BOOST_ASSERT(contains(fmt, "%2$d"));
        string str = subst(fmt, "%1$d", tostr(arg1));
        str = subst(str, "%2$d", tostr(arg2));
        return subst(str, "%%", "%");
@@ -691,9 +690,9 @@ string bformat(string const & fmt, int arg1, int arg2)
 string bformat(string const & fmt, string const & arg1, string const & arg2,
        string const & arg3)
 {
-       Assert(contains(fmt, "%1$s"));
-       Assert(contains(fmt, "%2$s"));
-       Assert(contains(fmt, "%3$s"));
+       BOOST_ASSERT(contains(fmt, "%1$s"));
+       BOOST_ASSERT(contains(fmt, "%2$s"));
+       BOOST_ASSERT(contains(fmt, "%3$s"));
        string str = subst(fmt, "%1$s", arg1);
        str = subst(str, "%2$s", arg2);
        str = subst(str, "%3$s", arg3);
@@ -704,10 +703,10 @@ string bformat(string const & fmt, string const & arg1, string const & arg2,
 string bformat(string const & fmt, string const & arg1, string const & arg2,
        string const & arg3, string const & arg4)
 {
-       Assert(contains(fmt, "%1$s"));
-       Assert(contains(fmt, "%2$s"));
-       Assert(contains(fmt, "%3$s"));
-       Assert(contains(fmt, "%4$s"));
+       BOOST_ASSERT(contains(fmt, "%1$s"));
+       BOOST_ASSERT(contains(fmt, "%2$s"));
+       BOOST_ASSERT(contains(fmt, "%3$s"));
+       BOOST_ASSERT(contains(fmt, "%4$s"));
        string str = subst(fmt, "%1$s", arg1);
        str = subst(str, "%2$s", arg2);
        str = subst(str, "%3$s", arg3);
@@ -719,11 +718,11 @@ string bformat(string const & fmt, string const & arg1, string const & arg2,
 string bformat(string const & fmt, string const & arg1, string const & arg2,
        string const & arg3, string const & arg4, string const & arg5)
 {
-       Assert(contains(fmt, "%1$s"));
-       Assert(contains(fmt, "%2$s"));
-       Assert(contains(fmt, "%3$s"));
-       Assert(contains(fmt, "%4$s"));
-       Assert(contains(fmt, "%5$s"));
+       BOOST_ASSERT(contains(fmt, "%1$s"));
+       BOOST_ASSERT(contains(fmt, "%2$s"));
+       BOOST_ASSERT(contains(fmt, "%3$s"));
+       BOOST_ASSERT(contains(fmt, "%4$s"));
+       BOOST_ASSERT(contains(fmt, "%5$s"));
        string str = subst(fmt, "%1$s", arg1);
        str = subst(str, "%2$s", arg2);
        str = subst(str, "%3$s", arg3);
index b0b9e58f195f904262ca30f23b36ec3d04c9083b..444a81368d7e8c822f913d43f6e14a6351d60293 100644 (file)
@@ -14,8 +14,6 @@
 
 #include "lyxstring.h"
 
-#include "LAssert.h"
-
 #include "debug.h"
 
 #include <iostream>
@@ -63,7 +61,7 @@ using std::ostream;
 
 namespace lyx {
 
-using support::Assert;
+using support::BOOST_ASSERT;
 
 ///////////////////////////////////////
 // The internal string representation
@@ -375,13 +373,13 @@ void stringInvariant::helper() const
        // test every last little thing we *know* should be true.
        // I may have missed a test or two, so feel free to fill
        // in the gaps.  ARRae.
-       Assert(object);
-       Assert(object->rep);
-       Assert(object->rep->s);    // s is never 0
-       Assert(object->rep->res);  // res cannot be 0
-       Assert(object->rep->sz <= object->rep->res);
-       Assert(object->rep->ref >= 1);  // its in use so it must be referenced
-       Assert(object->rep->ref < 1UL << (8UL * sizeof(object->rep->ref) - 1));
+       BOOST_ASSERT(object);
+       BOOST_ASSERT(object->rep);
+       BOOST_ASSERT(object->rep->s);    // s is never 0
+       BOOST_ASSERT(object->rep->res);  // res cannot be 0
+       BOOST_ASSERT(object->rep->sz <= object->rep->res);
+       BOOST_ASSERT(object->rep->ref >= 1);  // its in use so it must be referenced
+       BOOST_ASSERT(object->rep->ref < 1UL << (8UL * sizeof(object->rep->ref) - 1));
        // if it does ever == then we should be generating a new copy
        // and starting again.  (Is char always 8-bits?)
 }
@@ -409,7 +407,7 @@ string::string()
 
 string::string(string const & x, size_type pos, size_type n)
 {
-       Assert(pos <= x.rep->sz); // STD!
+       BOOST_ASSERT(pos <= x.rep->sz); // STD!
        if (pos == 0 && n >= x.length()) { // this is the default
                x.rep->ref++;
                rep = x.rep;
@@ -421,7 +419,7 @@ string::string(string const & x, size_type pos, size_type n)
 
 string::string(value_type const * s, size_type n)
 {
-       Assert(s && n < npos); // STD!
+       BOOST_ASSERT(s && n < npos); // STD!
        static Srep empty_rep(0, "");
        if (n) { // n > 0
                rep = new Srep(n, s);
@@ -434,7 +432,7 @@ string::string(value_type const * s, size_type n)
 
 string::string(value_type const * s)
 {
-       Assert(s); // STD!
+       BOOST_ASSERT(s); // STD!
        static Srep empty_rep(0, "");
        if (*s) { // s is not empty string
                rep = new Srep(strlen(s), s);
@@ -447,7 +445,7 @@ string::string(value_type const * s)
 
 string::string(size_type n, value_type c)
 {
-       Assert(n < npos); // STD!
+       BOOST_ASSERT(n < npos); // STD!
        rep = new Srep(n, c);
 }
 
@@ -534,7 +532,7 @@ string::size_type string::size() const
 
 void string::resize(size_type n, value_type c)
 {
-       Assert(n <= npos); // STD!
+       BOOST_ASSERT(n <= npos); // STD!
        TeststringInvariant(this);
 
        // This resets sz to res_arg
@@ -572,7 +570,7 @@ string & string::operator=(string const & x)
 
 string & string::operator=(value_type const * s)
 {
-       Assert(s); // OURS!
+       BOOST_ASSERT(s); // OURS!
        TeststringInvariant(this);
 //     printf("string::operator= (value_type const *)\n");
 
@@ -609,7 +607,7 @@ string & string::assign(string const & x)
 
 string & string::assign(string const & x, size_type pos, size_type n)
 {
-       Assert(pos <= x.rep->sz); // STD!
+       BOOST_ASSERT(pos <= x.rep->sz); // STD!
        TeststringInvariant(this);
 
        return assign(x.substr(pos, n));
@@ -618,7 +616,7 @@ string & string::assign(string const & x, size_type pos, size_type n)
 
 string & string::assign(value_type const * s, size_type n)
 {
-       Assert(s && n < npos); // STD!
+       BOOST_ASSERT(s && n < npos); // STD!
        TeststringInvariant(this);
 
        if (rep->ref == 1) // recycle rep
@@ -633,7 +631,7 @@ string & string::assign(value_type const * s, size_type n)
 
 string & string::assign(value_type const * s)
 {
-       Assert(s); // OURS!
+       BOOST_ASSERT(s); // OURS!
        TeststringInvariant(this);
 
        return assign(s, strlen(s));
@@ -668,13 +666,13 @@ string::const_reference string::operator[](size_type pos) const
 {
 #if 0
        // This is actually what the standard requires,
-       Assert(pos <= rep->sz); // OURS!
+       BOOST_ASSERT(pos <= rep->sz); // OURS!
        static char const helper = '\0';
        return pos == rep->sz ? helper : rep->s[pos];
 #else
        // but we use this one since it is stricter
        // and more according to the real intent of std::string.
-       Assert(pos < rep->sz); // OURS!
+       BOOST_ASSERT(pos < rep->sz); // OURS!
        return rep->s[pos];
 #endif
 }
@@ -682,7 +680,7 @@ string::const_reference string::operator[](size_type pos) const
 
 string::reference string::operator[](size_type pos)
 {
-       Assert(pos < rep->sz); // OURS!
+       BOOST_ASSERT(pos < rep->sz); // OURS!
        TeststringInvariant(this);
 
        rep = rep->get_own_copy();
@@ -692,14 +690,14 @@ string::reference string::operator[](size_type pos)
 
 string::const_reference string::at(size_type n) const
 {
-       Assert(n < rep->sz); // STD!
+       BOOST_ASSERT(n < rep->sz); // STD!
        return rep->s[n];
 }
 
 
 string::reference string::at(size_type n)
 {
-       Assert(n < rep->sz); // STD!
+       BOOST_ASSERT(n < rep->sz); // STD!
        TeststringInvariant(this);
 
        rep = rep->get_own_copy();
@@ -721,7 +719,7 @@ string & string::operator+=(string const & x)
 
 string & string::operator+=(value_type const * x)
 {
-       Assert(x); // OURS!
+       BOOST_ASSERT(x); // OURS!
        TeststringInvariant(this);
 
        return append(x);
@@ -759,7 +757,7 @@ string & string::append(string const & x)
 
 string & string::append(string const & x, size_type pos, size_type n)
 {
-       Assert(pos <= x.rep->sz); // STD!
+       BOOST_ASSERT(pos <= x.rep->sz); // STD!
        TeststringInvariant(this);
 
        return append(x.substr(pos, n));
@@ -768,7 +766,7 @@ string & string::append(string const & x, size_type pos, size_type n)
 
 string & string::append(value_type const * p, size_type n)
 {
-       Assert(p); // OURS!
+       BOOST_ASSERT(p); // OURS!
        TeststringInvariant(this);
 
        if (!*p || !n) return *this;
@@ -780,7 +778,7 @@ string & string::append(value_type const * p, size_type n)
 
 string & string::append(value_type const * p)
 {
-       Assert(p); // OURS!
+       BOOST_ASSERT(p); // OURS!
        return append(p, strlen(p));
 }
 
@@ -820,7 +818,7 @@ string & string::insert(size_type pos, string const & x)
 string & string::insert(size_type pos, string const & x,
                              size_type pos2, size_type n)
 {
-       Assert(pos <= rep->sz && pos2 <= x.rep->sz); // STD!
+       BOOST_ASSERT(pos <= rep->sz && pos2 <= x.rep->sz); // STD!
        TeststringInvariant(this);
 
        rep = rep->get_own_copy();
@@ -831,7 +829,7 @@ string & string::insert(size_type pos, string const & x,
 
 string & string::insert(size_type pos, value_type const * p, size_type n)
 {
-       Assert(p); // OURS!
+       BOOST_ASSERT(p); // OURS!
        TeststringInvariant(this);
 
        if (*p && n) {
@@ -845,7 +843,7 @@ string & string::insert(size_type pos, value_type const * p, size_type n)
 
 string & string::insert(size_type pos, value_type const * p)
 {
-       Assert(p); // OURS!
+       BOOST_ASSERT(p); // OURS!
        return insert(pos, p, strlen(p));
 }
 
@@ -928,7 +926,7 @@ string::size_type string::find(string const & a, size_type i) const
 string::size_type string::find(value_type const * ptr, size_type i,
                                     size_type n) const
 {
-       Assert(ptr); // OURS!
+       BOOST_ASSERT(ptr); // OURS!
        if (!rep->sz || !*ptr || i >= rep->sz) return npos;
 
        TeststringInvariant(this);
@@ -959,7 +957,7 @@ string::size_type string::find(value_type const * ptr, size_type i,
 
 string::size_type string::find(value_type const * s, size_type i) const
 {
-       Assert(s); // OURS!
+       BOOST_ASSERT(s); // OURS!
        if (!rep->sz || i >= rep->sz) return npos;
 
        TeststringInvariant(this);
@@ -1011,7 +1009,7 @@ string::size_type string::rfind(string const & a, size_type i) const
 string::size_type string::rfind(value_type const * ptr, size_type i,
                                      size_type n) const
 {
-       Assert(ptr); // OURS!
+       BOOST_ASSERT(ptr); // OURS!
        TeststringInvariant(this);
 
        n = min(n, strlen(ptr));
@@ -1039,7 +1037,7 @@ string::size_type string::rfind(value_type const * ptr, size_type i,
 string::size_type string::rfind(value_type const * ptr,
                                      size_type i) const
 {
-       Assert(ptr); // OURS!
+       BOOST_ASSERT(ptr); // OURS!
 
        if (!ptr || !*ptr) return npos;
        return rfind(ptr, i, strlen(ptr));
@@ -1063,7 +1061,7 @@ string::size_type string::rfind(value_type c, size_type i) const
 string::size_type string::find_first_of(string const & a,
                                              size_type i) const
 {
-       Assert(i <= rep->sz); // OURS!
+       BOOST_ASSERT(i <= rep->sz); // OURS!
        TeststringInvariant(this);
 
        for (size_type t = i; t < rep->sz; ++t) {
@@ -1077,7 +1075,7 @@ string::size_type string::find_first_of(value_type const * ptr,
                                              size_type i,
                                              size_type n) const
 {
-       Assert(ptr && i <= rep->sz); // OURS!
+       BOOST_ASSERT(ptr && i <= rep->sz); // OURS!
        TeststringInvariant(this);
        if (!n) return npos;
 
@@ -1091,7 +1089,7 @@ string::size_type string::find_first_of(value_type const * ptr,
 string::size_type string::find_first_of(value_type const * ptr,
                                              size_type i) const
 {
-       Assert(ptr && i <= rep->sz); // OURS!
+       BOOST_ASSERT(ptr && i <= rep->sz); // OURS!
        TeststringInvariant(this);
 
        for (size_type t = i; t < rep->sz; ++t) {
@@ -1103,7 +1101,7 @@ string::size_type string::find_first_of(value_type const * ptr,
 
 string::size_type string::find_first_of(value_type c, size_type i) const
 {
-       Assert(i <= rep->sz); // OURS!
+       BOOST_ASSERT(i <= rep->sz); // OURS!
        TeststringInvariant(this);
 
        for (size_type t = i; t < rep->sz; ++t) {
@@ -1130,7 +1128,7 @@ string::size_type string::find_last_of(value_type const * ptr,
                                             size_type i,
                                             size_type n) const
 {
-       Assert(ptr); // OURS!
+       BOOST_ASSERT(ptr); // OURS!
        TeststringInvariant(this);
        if (!n) return npos;
 
@@ -1145,7 +1143,7 @@ string::size_type string::find_last_of(value_type const * ptr,
 string::size_type string::find_last_of(value_type const * ptr,
                                             size_type i) const
 {
-       Assert(ptr); // OURS!
+       BOOST_ASSERT(ptr); // OURS!
        TeststringInvariant(this);
 
        size_type ii = min(rep->sz - 1, i);
@@ -1175,7 +1173,7 @@ string::size_type string::find_first_not_of(string const & a,
        TeststringInvariant(this);
 
        if (!rep->sz) return npos;
-       Assert(i <= rep->sz);
+       BOOST_ASSERT(i <= rep->sz);
        for (size_type t = i; t < rep->sz; ++t) {
                if (a.find(rep->s[t]) == npos) return t;
        }
@@ -1187,7 +1185,7 @@ string::size_type string::find_first_not_of(value_type const * ptr,
                                                  size_type i,
                                                  size_type n) const
 {
-       Assert(ptr && i <= rep->sz); // OURS!
+       BOOST_ASSERT(ptr && i <= rep->sz); // OURS!
        TeststringInvariant(this);
 
        if (!n) return (i < rep->sz) ? i : npos;
@@ -1201,7 +1199,7 @@ string::size_type string::find_first_not_of(value_type const * ptr,
 string::size_type string::find_first_not_of(value_type const * ptr,
                                                  size_type i) const
 {
-       Assert(ptr && i <= rep->sz); // OURS!
+       BOOST_ASSERT(ptr && i <= rep->sz); // OURS!
        TeststringInvariant(this);
 
        for (size_type t = i; t < rep->sz; ++t) {
@@ -1215,7 +1213,7 @@ string::size_type string::find_first_not_of(value_type c,
                                                  size_type i) const
 {
        if (!rep->sz) return npos;
-       Assert(i <= rep->sz); // OURS!
+       BOOST_ASSERT(i <= rep->sz); // OURS!
        TeststringInvariant(this);
 
        for (size_type t = i; t < rep->sz; ++t) {
@@ -1242,7 +1240,7 @@ string::size_type string::find_last_not_of(value_type const * ptr,
                                                 size_type i,
                                                 size_type n) const
 {
-       Assert(ptr); // OURS!
+       BOOST_ASSERT(ptr); // OURS!
        TeststringInvariant(this);
 
        if (!n) return npos;
@@ -1258,7 +1256,7 @@ string::size_type string::find_last_not_of(value_type const * ptr,
 string::size_type string::find_last_not_of(value_type const * ptr,
                                                 size_type i) const
 {
-       Assert(ptr); // OURS!
+       BOOST_ASSERT(ptr); // OURS!
        TeststringInvariant(this);
 
        size_type ii = min(rep->sz - 1, i);
@@ -1288,7 +1286,7 @@ string::size_type string::find_last_not_of(value_type c,
 
 string & string::replace(size_type i, size_type n, string const & x)
 {
-       Assert(i <= rep->sz); // OURS!
+       BOOST_ASSERT(i <= rep->sz); // OURS!
        TeststringInvariant(this);
 
        return replace(i, n, x, 0, x.rep->sz);
@@ -1298,7 +1296,7 @@ string & string::replace(size_type i, size_type n, string const & x)
 string & string::replace(size_type i, size_type n, string const & x,
                               size_type i2, size_type n2)
 {
-       Assert(i <= rep->sz && i2 <= x.rep->sz); // STD!
+       BOOST_ASSERT(i <= rep->sz && i2 <= x.rep->sz); // STD!
        TeststringInvariant(this);
 
        rep = rep->get_own_copy();
@@ -1310,7 +1308,7 @@ string & string::replace(size_type i, size_type n, string const & x,
 string & string::replace(size_type i, size_type n,
                               value_type const * p, size_type n2)
 {
-       Assert(p && i <= rep->sz); // OURS!
+       BOOST_ASSERT(p && i <= rep->sz); // OURS!
        TeststringInvariant(this);
 
        rep = rep->get_own_copy();
@@ -1321,7 +1319,7 @@ string & string::replace(size_type i, size_type n,
 
 string & string::replace(size_type i, size_type n, value_type const * p)
 {
-       Assert(p && i <= rep->sz); // OURS!
+       BOOST_ASSERT(p && i <= rep->sz); // OURS!
        TeststringInvariant(this);
 
        return replace(i, min(n, rep->sz), p, (!p) ? 0 : strlen(p));
@@ -1331,7 +1329,7 @@ string & string::replace(size_type i, size_type n, value_type const * p)
 string & string::replace(size_type i, size_type n,
                               size_type n2, value_type c)
 {
-       Assert(i <= rep->sz);  // OURS!
+       BOOST_ASSERT(i <= rep->sz);  // OURS!
        TeststringInvariant(this);
 
        rep = rep->get_own_copy();
@@ -1361,7 +1359,7 @@ string & string::replace(iterator i, iterator i2, const string & str)
 string & string::replace(iterator i, iterator i2,
                               value_type const * p, size_type n)
 {
-       Assert(p); // OURS!
+       BOOST_ASSERT(p); // OURS!
        TeststringInvariant(this);
 
        return replace(i - begin(), i2 - i, p, n);
@@ -1370,7 +1368,7 @@ string & string::replace(iterator i, iterator i2,
 
 string & string::replace(iterator i, iterator i2, value_type const * p)
 {
-       Assert(p); // OURS!
+       BOOST_ASSERT(p); // OURS!
        TeststringInvariant(this);
 
        return replace(i - begin(), i2 - i, p);
@@ -1406,7 +1404,7 @@ void string::swap(string & str)
 
 string & string::erase(size_type i, size_type n)
 {
-       Assert(i <= rep->sz); // STD!
+       BOOST_ASSERT(i <= rep->sz); // STD!
        TeststringInvariant(this);
 
        rep = rep->get_own_copy();
@@ -1461,8 +1459,8 @@ string::value_type const * string::data() const
 string::size_type string::copy(value_type * buf, size_type len,
                                     size_type pos) const
 {
-       Assert(buf); // OURS!
-       Assert(pos <= rep->sz); // STD!
+       BOOST_ASSERT(buf); // OURS!
+       BOOST_ASSERT(pos <= rep->sz); // STD!
        TeststringInvariant(this);
 
        register int nn = min(len, length() - pos);
@@ -1510,7 +1508,7 @@ int string::compare(string const & str) const
 
 int string::compare(value_type const * s) const
 {
-       Assert(s); //OURS!
+       BOOST_ASSERT(s); //OURS!
        TeststringInvariant(this);
        int n = (!s) ? 0 : strlen(s);
        return internal_compare(0, rep->sz, s, n, n);
@@ -1520,7 +1518,7 @@ int string::compare(value_type const * s) const
 int string::compare(size_type pos, size_type n,
                       string const & str) const
 {
-       Assert(pos <= rep->sz); // OURS!
+       BOOST_ASSERT(pos <= rep->sz); // OURS!
        TeststringInvariant(this);
        return internal_compare(pos, n, str.rep->s, str.rep->sz, str.rep->sz);
 }
@@ -1529,8 +1527,8 @@ int string::compare(size_type pos, size_type n,
 int string::compare(size_type pos, size_type n, string const & str,
                       size_type pos2, size_type n2) const
 {
-       Assert(pos <= rep->sz); // OURS!
-       Assert(pos2 <= str.rep->sz); // OURS!
+       BOOST_ASSERT(pos <= rep->sz); // OURS!
+       BOOST_ASSERT(pos2 <= str.rep->sz); // OURS!
        TeststringInvariant(this);
        return internal_compare(pos, n,
                                str.rep->s + pos2,
@@ -1541,7 +1539,7 @@ int string::compare(size_type pos, size_type n, string const & str,
 int string::compare(size_type pos, size_type n, value_type const * s,
                       size_type n2) const
 {
-       Assert(s && pos <= rep->sz); // OURS!
+       BOOST_ASSERT(s && pos <= rep->sz); // OURS!
        TeststringInvariant(this);
        return internal_compare(pos, n, s, (!s) ? 0 : strlen(s), n2);
 }
@@ -1554,7 +1552,7 @@ int string::compare(size_type pos, size_type n, value_type const * s,
 // i = index, n = length
 string string::substr(size_type i, size_type n) const
 {
-       Assert(i <= rep->sz); // STD!
+       BOOST_ASSERT(i <= rep->sz); // STD!
        TeststringInvariant(this);
 
        return string(*this, i, n);
@@ -1573,14 +1571,14 @@ bool operator==(string const & a, string const & b)
 
 bool operator==(string::value_type const * a, string const & b)
 {
-       Assert(a); // OURS!
+       BOOST_ASSERT(a); // OURS!
        return b.compare(a) == 0;
 }
 
 
 bool operator==(string const & a, string::value_type const * b)
 {
-       Assert(b); // OURS!
+       BOOST_ASSERT(b); // OURS!
        return a.compare(b) == 0;
 }
 
@@ -1593,14 +1591,14 @@ bool operator!=(string const & a, string const & b)
 
 bool operator!=(string::value_type const * a, string const & b)
 {
-       Assert(a); // OURS!
+       BOOST_ASSERT(a); // OURS!
        return b.compare(a) != 0;
 }
 
 
 bool operator!=(string const & a, string::value_type const * b)
 {
-       Assert(b); // OURS!
+       BOOST_ASSERT(b); // OURS!
        return a.compare(b) != 0;
 }
 
@@ -1613,14 +1611,14 @@ bool operator>(string const & a, string const & b)
 
 bool operator>(string::value_type const * a, string const & b)
 {
-       Assert(a); // OURS!
+       BOOST_ASSERT(a); // OURS!
        return b.compare(a) < 0; // since we reverse the parameters
 }
 
 
 bool operator>(string const & a, string::value_type const * b)
 {
-       Assert(b); // OURS!
+       BOOST_ASSERT(b); // OURS!
        return a.compare(b) > 0;
 }
 
@@ -1633,14 +1631,14 @@ bool operator<(string const & a, string const & b)
 
 bool operator<(string::value_type const * a, string const & b)
 {
-       Assert(a); // OURS!
+       BOOST_ASSERT(a); // OURS!
        return b.compare(a) > 0; // since we reverse the parameters
 }
 
 
 bool operator<(string const & a, string::value_type const * b)
 {
-       Assert(b); // OURS!
+       BOOST_ASSERT(b); // OURS!
        return a.compare(b) < 0;
 }
 
@@ -1653,14 +1651,14 @@ bool operator>=(string const & a, string const & b)
 
 bool operator>=(string::value_type const * a, string const & b)
 {
-       Assert(a); // OURS!
+       BOOST_ASSERT(a); // OURS!
        return b.compare(a) <= 0; // since we reverse the parameters
 }
 
 
 bool operator>=(string const & a, string::value_type const * b)
 {
-       Assert(b); // OURS!
+       BOOST_ASSERT(b); // OURS!
        return a.compare(b) >= 0;
 }
 
@@ -1673,14 +1671,14 @@ bool operator<=(string const & a, string const & b)
 
 bool operator<=(string::value_type const * a, string const & b)
 {
-       Assert(a); // OURS!
+       BOOST_ASSERT(a); // OURS!
        return b.compare(a) >= 0; // since we reverse the parameters
 }
 
 
 bool operator<=(string const & a, string::value_type const * b)
 {
-       Assert(b); // OURS!
+       BOOST_ASSERT(b); // OURS!
        return a.compare(b) <= 0;
 }
 
@@ -1695,7 +1693,7 @@ string operator+(string const & a, string const & b)
 
 string operator+(string::value_type const * a, string const & b)
 {
-       Assert(a); // OURS!
+       BOOST_ASSERT(a); // OURS!
        string tmp(a);
        tmp += b;
        return tmp;
@@ -1713,7 +1711,7 @@ string operator+(string::value_type a, string const & b)
 
 string operator+(string const & a, string::value_type const * b)
 {
-       Assert(b); // OURS!
+       BOOST_ASSERT(b); // OURS!
        string tmp(a);
        tmp += b;
        return tmp;
index fb42297b38311dc3761d25f80d6fb2abd55e8684..57fac8e988342034db5cd597fa9a57362ae377b0 100644 (file)
@@ -17,7 +17,6 @@
 #include <algorithm>
 #include <functional>
 
-#include "support/LAssert.h"
 #include "support/lyxfunctional.h"
 /**
  * This class template is used to translate between two elements, specifically
@@ -50,7 +49,7 @@ public:
 
        /// Find the mapping for the first argument
        T2 const & find(T1 const & first) const {
-               lyx::support::Assert(!map.empty());
+               BOOST_ASSERT(!map.empty());
 
                // For explanation see the next find() function.
                typename Map::const_iterator it =
@@ -67,7 +66,7 @@ public:
 
        /// Find the mapping for the second argument
        T1 const & find(T2 const & second) const {
-               lyx::support::Assert(!map.empty());
+               BOOST_ASSERT(!map.empty());
 
                // The idea is as follows:
                // find_if() will try to compare the data in the vector with
index 5bcc9a3ac454d33f546c02e6177d63fc2b524586..7ecbc16b6bfe613c7b959cd4d2e01edf186a4934 100644 (file)
 #include <config.h>
 
 #include "userinfo.h"
-#include "LAssert.h"
 #include "filetools.h"
 
+#include <boost/assert.hpp>
+
 #include <pwd.h>
 #include <unistd.h>
 #include <sys/types.h>
@@ -24,7 +25,7 @@ namespace support {
 string const user_name()
 {
        struct passwd * pw(getpwuid(geteuid()));
-       Assert(pw);
+       BOOST_ASSERT(pw);
 
        string name = pw->pw_gecos;
        if (name.empty())
index 1de4f606ca673afe861c9bd9150d551457298f25..f7afb26ddb5a4d175b05c185be042f02781a9721 100644 (file)
@@ -28,7 +28,6 @@
 
 #include "insets/insettabular.h"
 
-#include "support/LAssert.h"
 #include "support/lstrings.h"
 #include "support/tostr.h"
 
@@ -1298,14 +1297,14 @@ void LyXTabular::read(Buffer const & buf, LyXLex & lex)
        l_getline(is, line);
        if (!prefixIs(line, "<lyxtabular ")
                && !prefixIs(line, "<LyXTabular ")) {
-               Assert(false);
+               BOOST_ASSERT(false);
                return;
        }
 
        int version;
        if (!getTokenValue(line, "version", version))
                return;
-       Assert(version >= 2);
+       BOOST_ASSERT(version >= 2);
 
        int rows_arg;
        if (!getTokenValue(line, "rows", rows_arg))
@@ -1589,7 +1588,7 @@ int LyXTabular::getLastCellBelow(int cell) const
 
 int LyXTabular::getCellNumber(int row, int column) const
 {
-       Assert(column >= 0 || column < columns_ || row >= 0 || row < rows_);
+       BOOST_ASSERT(column >= 0 || column < columns_ || row >= 0 || row < rows_);
        return cell_info[row][column].cellno;
 }
 
index b357b03be8196ec16fe7d2c597c0b3afb4a06ba8..fc0d05b266cb8d9ba9a9374afc75703c2c129fcd 100644 (file)
@@ -62,7 +62,7 @@ void handle_comment(Parser & p)
 
 string const trim(string const & a, char const * p)
 {
-       // lyx::Assert(p);
+       // BOOST_ASSERT(p);
 
        if (a.empty() || !*p)
                return a;
index 4d10a9d2c24c517f3447a809dcb3997631e5f683..d72daeba57d47f91f7ab60c247b965d8eb300a8d 100644 (file)
@@ -43,7 +43,6 @@
 
 #include "insets/insettext.h"
 
-#include "support/LAssert.h"
 #include "support/lstrings.h"
 #include "support/textutils.h"
 
@@ -72,14 +71,14 @@ int bibitemMaxWidth(BufferView *, LyXFont const &);
 
 BufferView * LyXText::bv()
 {
-       Assert(bv_owner != 0);
+       BOOST_ASSERT(bv_owner != 0);
        return bv_owner;
 }
 
 
 BufferView * LyXText::bv() const
 {
-       Assert(bv_owner != 0);
+       BOOST_ASSERT(bv_owner != 0);
        return bv_owner;
 }
 
@@ -193,7 +192,7 @@ int LyXText::singleWidth(ParagraphList::iterator pit,
 {
        if (pos >= pit->size()) {
                lyxerr << "in singleWidth(), pos: " << pos << endl;
-               Assert(false);
+               BOOST_ASSERT(false);
                return 0;
        }
 
@@ -217,7 +216,7 @@ int LyXText::singleWidth(ParagraphList::iterator pit,
 
        if (c == Paragraph::META_INSET) {
                InsetOld * tmpinset = pit->getInset(pos);
-               Assert(tmpinset);
+               BOOST_ASSERT(tmpinset);
                if (tmpinset->lyxCode() == InsetOld::HFILL_CODE) {
                        // Because of the representation as vertical lines
                        return 3;
@@ -846,7 +845,7 @@ int LyXText::labelFill(ParagraphList::iterator pit, Row const & row) const
 {
        pos_type last = pit->beginningOfBody();
 
-       Assert(last > 0);
+       BOOST_ASSERT(last > 0);
 
        // -1 because a label ends either with a space that is in the label,
        // or with the beginning of a footnote that is outside the label.
@@ -2066,7 +2065,7 @@ void LyXText::previousRow(ParagraphList::iterator & pit,
        if (rit != pit->rows.begin())
                --rit;
        else {
-               Assert(pit != ownerParagraphs().begin());
+               BOOST_ASSERT(pit != ownerParagraphs().begin());
                --pit;
                rit = boost::prior(pit->rows.end());
        }
index 5afe64d0dbd819909c89233954cc4e85b0908eac..4e12656abe5d1f3c16105581e640a0110b9cd5d5 100644 (file)
@@ -51,7 +51,6 @@
 #include "insets/insetfloat.h"
 #include "insets/insetwrap.h"
 
-#include "support/LAssert.h"
 #include "support/lstrings.h"
 #include "support/textutils.h"
 
@@ -108,7 +107,7 @@ void LyXText::init(BufferView * bview)
 // smaller. (Asger)
 LyXFont LyXText::getFont(ParagraphList::iterator pit, pos_type pos) const
 {
-       Assert(pos >= 0);
+       BOOST_ASSERT(pos >= 0);
 
        LyXLayout_ptr const & layout = pit->layout();
 #warning broken?
@@ -623,7 +622,7 @@ void LyXText::metrics(MetricsInfo & mi, Dimension & dim)
 {
        //lyxerr << "LyXText::metrics: width: " << mi.base.textwidth
        //      << " workWidth: " << workWidth() << endl;
-       //Assert(mi.base.textwidth);
+       //BOOST_ASSERT(mi.base.textwidth);
 
        // rebuild row cache
        width  = 0;
@@ -1003,7 +1002,7 @@ void LyXText::setCounter(Buffer const & buf, ParagraphList::iterator pit)
                                else if (in->lyxCode() == InsetOld::WRAP_CODE)
                                        type = static_cast<InsetWrap*>(in)->params().type;
                                else
-                                       Assert(0);
+                                       BOOST_ASSERT(false);
 
                                Floating const & fl = textclass.floats().getType(type);
 
@@ -1333,7 +1332,7 @@ void LyXText::redoCursor()
 void LyXText::setCursor(LyXCursor & cur, ParagraphList::iterator pit,
                        pos_type pos, bool boundary)
 {
-       Assert(pit != ownerParagraphs().end());
+       BOOST_ASSERT(pit != ownerParagraphs().end());
 
        cur.par(pit);
        cur.pos(pos);
index 4c500484c4bc4024b98965c96b6d1b88345247c7..b3797f0333cc5c6fbcd8869bcc24212eb92fe945 100644 (file)
@@ -42,7 +42,6 @@
 #include "insets/insetspecialchar.h"
 #include "insets/insettext.h"
 
-#include "support/LAssert.h"
 #include "support/lstrings.h"
 #include "support/tostr.h"
 
@@ -114,7 +113,7 @@ namespace {
                        return 0;
 
                // get inset dimensions
-               Assert(par->getInset(pos));
+               BOOST_ASSERT(par->getInset(pos));
 
                LyXFont const & font = text.getFont(par, pos);
 
@@ -881,7 +880,7 @@ InsetOld::RESULT LyXText::dispatch(FuncRequest const & cmd)
        }
 
        case LFUN_INSET_SETTINGS:
-               Assert(bv->theLockingInset());
+               BOOST_ASSERT(bv->theLockingInset());
                bv->theLockingInset()->getLockingInset()->showInsetDialog(bv);
                break;