]> git.lyx.org Git - lyx.git/commitdiff
to much stuff for my liking...
authorLars Gullik Bjønnes <larsbj@gullik.org>
Sat, 16 Feb 2002 15:59:55 +0000 (15:59 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Sat, 16 Feb 2002 15:59:55 +0000 (15:59 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3554 a592a061-630c-0410-9148-cb99ea01b6c8

160 files changed:
config/lyxinclude.m4
configure.in
po/POTFILES.in
sigc++/Makefile.am
src/BufferView2.C
src/BufferView_pimpl.C
src/Bullet.C
src/ChangeLog
src/DepTable.C
src/FontLoader.C
src/LaTeXFeatures.C
src/LyXSendto.C
src/LyXView.C
src/Makefile.am
src/Thesaurus.C
src/WorkArea.C
src/XFormsView.C
src/buffer.C
src/bufferlist.C
src/bufferview_funcs.C
src/frontends/Alert.C
src/frontends/Alert.h
src/frontends/Makefile.am
src/frontends/controllers/ControlCharacter.C
src/frontends/controllers/Makefile.am
src/frontends/controllers/biblio.C
src/frontends/controllers/helper_funcs.C
src/frontends/support/Makefile.am
src/frontends/xforms/Color.C
src/frontends/xforms/Color.h
src/frontends/xforms/DropDown.C
src/frontends/xforms/FormBase.C
src/frontends/xforms/FormBibtex.C
src/frontends/xforms/FormCharacter.C
src/frontends/xforms/FormCitation.C
src/frontends/xforms/FormDocument.C
src/frontends/xforms/FormDocument.h
src/frontends/xforms/FormGraphics.C
src/frontends/xforms/FormInset.C
src/frontends/xforms/FormMathsSpace.h
src/frontends/xforms/FormParagraph.C
src/frontends/xforms/FormPreferences.C
src/frontends/xforms/FormPreferences.h
src/frontends/xforms/FormSpellchecker.C
src/frontends/xforms/FormTabular.C
src/frontends/xforms/FormTabularCreate.C
src/frontends/xforms/FormTexinfo.C
src/frontends/xforms/FormThesaurus.C
src/frontends/xforms/FormToc.C
src/frontends/xforms/GUIRunTime.C
src/frontends/xforms/Makefile.am
src/frontends/xforms/Menubar_pimpl.C
src/frontends/xforms/RadioButtonGroup.C
src/frontends/xforms/RadioButtonGroup.h
src/frontends/xforms/Toolbar_pimpl.C
src/frontends/xforms/Tooltips.C
src/frontends/xforms/combox.C
src/frontends/xforms/xforms_helpers.C
src/graphics/GraphicsCacheItem.C
src/graphics/ImageLoaderXPM.C
src/graphics/Makefile.am
src/insets/ExternalTemplate.C
src/insets/Makefile.am
src/insets/figinset.C
src/insets/figinset.h
src/insets/inset.C
src/insets/insetbib.C
src/insets/insetcite.C
src/insets/insetcollapsable.C
src/insets/insetcommand.C
src/insets/insetcommand.h
src/insets/inseterror.C
src/insets/insetert.C
src/insets/insetexternal.C
src/insets/insetfloatlist.C
src/insets/insetfoot.C
src/insets/insetfootlike.C
src/insets/insetgraphics.C
src/insets/insetgraphicsParams.C
src/insets/insetgraphicsParams.h
src/insets/insetinclude.C
src/insets/insetindex.C
src/insets/insetlatexaccent.C
src/insets/insetmarginal.C
src/insets/insetref.C
src/insets/insettabular.C
src/insets/insettext.C
src/insets/insettoc.C
src/insets/inseturl.C
src/iterators.C
src/iterators.h
src/kbsequence.C
src/lastfiles.C
src/lyx_cb.C
src/lyx_gui.C
src/lyx_main.C
src/lyxfont.h
src/lyxfunc.C
src/lyxlength.C
src/lyxlex.C
src/lyxlex_pimpl.C
src/lyxlookup.C
src/lyxrc.C
src/lyxserver.C
src/lyxtextclass.C
src/mathed/Makefile.am
src/mathed/formula.C
src/mathed/formulabase.C
src/mathed/math_arrayinset.C
src/mathed/math_atom.C
src/mathed/math_binaryopinset.C
src/mathed/math_binominset.C
src/mathed/math_braceinset.C
src/mathed/math_charinset.C
src/mathed/math_cursor.C
src/mathed/math_deliminset.C
src/mathed/math_extern.C
src/mathed/math_fracinset.C
src/mathed/math_gridinset.C
src/mathed/math_hash.C
src/mathed/math_hullinset.C
src/mathed/math_inset.C
src/mathed/math_macro.C
src/mathed/math_macroarg.C
src/mathed/math_macrotemplate.C
src/mathed/math_mathmlstream.C
src/mathed/math_parser.C
src/mathed/math_pos.C
src/mathed/math_rootinset.C
src/mathed/math_scriptinset.C
src/mathed/math_stackrelinset.C
src/mathed/math_support.C
src/mathed/math_symbolinset.C
src/mathed/math_undersetinset.C
src/mathed/math_xdata.C
src/mathed/math_xyarrowinset.C
src/minibuffer.C
src/paragraph.C
src/paragraph_pimpl.C
src/screen.C
src/sp_base.h
src/support/Makefile.am
src/support/copy.C
src/support/lstrings.C
src/support/lstrings.h
src/support/lyxfunctional.h
src/support/lyxsum.C
src/support/os.C
src/support/smart_ptr.h
src/support/textutils.h
src/support/translator.h
src/tabular.C
src/tabular_funcs.C
src/tex-accent.C
src/texrow.C
src/text.C
src/text2.C
src/trans.C
src/undo_funcs.C
src/vspace.C

index 8053a27be3b69589527bc7b4dabfa3fd50560a27..834f7127e0df780973c2c3b7bcef4fe88e6cad2d 100644 (file)
@@ -210,7 +210,7 @@ if test x$GXX = xyes; then
       2.95.2)  CXXFLAGS="$lyx_opt -fno-rtti -fno-exceptions";;
       2.95.*)  CXXFLAGS="$lyx_opt -fno-exceptions";;
       2.96*)  CXXFLAGS="$lyx_opt -fno-exceptions";;
-      3.0*)    CXXFLAGS="$lyx_opt";;
+      3.0*)    CXXFLAGS="$lyx_opt -fno-rtti -fno-exceptions";;
       *2.91.*) CXXFLAGS="$lyx_opt -fno-rtti -fno-exceptions";;
       *)       CXXFLAGS="$lyx_opt -fno-rtti -fno-exceptions";;
     esac
index 1a495887071871027f125c6c8c0a1d7f00070c72..2db8f28988d7e58a236e5e26fc332d472afa6f00 100644 (file)
@@ -187,7 +187,7 @@ case "$lyx_use_frontend" in
   xforms) 
   # for now don't set it for xforms as this is always entered
     FRONTEND=""
-    FRONTEND_GUILIB="xforms/libxforms.la";;
+    FRONTEND_GUILIB="xforms/libxforms.o";;
   gnome)    
     AM_PATH_GTKMM(1.2.1,,
         AC_MSG_ERROR(Cannot find GTK--: Please install Version 1.2.1+))
index 35706095476e93fda12b88574623f68891dde2c1..5585e5ec15c9dea2d17ed5595ce4f35f2aaa8545 100644 (file)
@@ -9,6 +9,7 @@ src/converter.C
 src/CutAndPaste.C
 src/debug.C
 src/exporter.C
+src/ext_l10n.h
 src/figure_form.C
 src/figureForm.C
 src/FontLoader.C
index ab0104db7e8571459aa3559160ee4d28d9851412..898b40ffd3b2f6b9d4bd065c52041a1c24b3b7f7 100644 (file)
@@ -31,7 +31,7 @@ noinst_HEADERS = \
 Makefile: $(BUILT_SOURCES)
 
 %.h: $(M4_DIR)/%.h.m4 $(M4_DIR)/template.macros.m4        
-       $(M4) $(M4_INCLUDES) $(DEFINES) $<  > $(top_srcdir)/$@
+       $(M4) $(M4_INCLUDES) $(DEFINES) $<  > $(top_builddir)/$@
 
 all-local: $(noinst_LTLIBRARIES) 
 
index 892d36e22e68df11a66c015e61bcf72f1b69eaf6..a59f737df8d1a53236a2512081fdb4e21089d753 100644 (file)
@@ -118,7 +118,7 @@ bool BufferView::removeAutoInsets()
        // Iterate until we find a paragraph that won't be immediately deleted.
        // In reality this should mean we only execute the body of the while
        // loop once at most.  However for safety we iterate rather than just
-       // make this an if() conditional.
+       // make this an if () conditional.
        while ((cur_par_prev || cur_par_next)
               && text->setCursor(this,
                                  cur_par_prev ? cur_par_prev : cur_par_next,
@@ -675,12 +675,14 @@ bool BufferView::ChangeRefsIfUnique(string const & from, string const & to)
 }
 
 
-bool BufferView::ChangeCitationsIfUnique(string const & from, string const & to)
+bool BufferView::ChangeCitationsIfUnique(string const & from,
+                                        string const & to)
 {
-
-       vector<pair<string,string> > keys = buffer()->getBibkeyList();  
+       typedef pair<string, string> StringPair;
+       
+       vector<StringPair> keys = buffer()->getBibkeyList();    
        if (count_if(keys.begin(), keys.end(), 
-                    lyx::equal_1st_in_pair<string,string>(from)) 
+                    lyx::equal_1st_in_pair<StringPair>(from)) 
            > 1)
                return false;
 
index 7b0b902e541f683675f1c9420a19691e07616dc8..9b15c675dea602fa908aed6815e5f1c5500ca6ac 100644 (file)
@@ -115,7 +115,7 @@ void SetXtermCursor(Window win)
 {
        static Cursor cursor;
        static bool cursor_undefined = true;
-       if (cursor_undefined){
+       if (cursor_undefined) {
                cursor = XCreateFontCursor(fl_get_display(), XC_xterm);
                XFlush(fl_get_display());
                cursor_undefined = false;
@@ -1169,7 +1169,7 @@ void BufferView::Pimpl::cursorPrevious(LyXText * text)
                              text->cursor.y()
                              - text->cursor.row()->baseline()
                              + text->cursor.row()->height()
-                             - workarea_.height() + 1 );
+                             - workarea_.height() + 1);
        updateScrollbar();
 }
 
@@ -1241,7 +1241,7 @@ void BufferView::Pimpl::restorePosition(unsigned int i)
                Buffer * b = bufferlist.exists(fname) ?
                        bufferlist.getBuffer(fname) :
                        bufferlist.loadLyXFile(fname); // don't ask, just load it
-               if (b != 0 ) buffer(b);
+               if (b != 0) buffer(b);
        }
 
        Paragraph * par = buffer_->getParFromID(saved_positions[i].par_id);
@@ -2972,13 +2972,13 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
        case LFUN_CITATION_INSERT:
        {
                InsetCommandParams p;
-               p.setFromString( argument );
+               p.setFromString(argument);
 
-               InsetCitation * inset = new InsetCitation( p );
+               InsetCitation * inset = new InsetCitation(p);
                if (!insertInset(inset))
                        delete inset;
                else
-                       updateInset( inset, true );
+                       updateInset(inset, true);
        }
        break;
                    
@@ -2990,7 +2990,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
                string const db       = token(argument, ' ', 0);
                string const bibstyle = token(argument, ' ', 1);
 
-               InsetCommandParams p( "BibTeX", db, bibstyle );
+               InsetCommandParams p("BibTeX", db, bibstyle);
                InsetBibtex * inset = new InsetBibtex(p);
                
                if (insertInset(inset)) {
@@ -3088,7 +3088,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
        case LFUN_PARENTINSERT:
        {
                lyxerr << "arg " << argument << endl;
-               InsetCommandParams p( "lyxparent", argument );
+               InsetCommandParams p("lyxparent", argument);
                Inset * inset = new InsetParent(p, *buffer_);
                if (!insertInset(inset, "Standard"))
                        delete inset;
@@ -3428,7 +3428,7 @@ void BufferView::Pimpl::updateInset(Inset * inset, bool mark_dirty)
                } else if (bv_->theLockingInset()->updateInsetInInset(bv_, inset)) {
                        if (bv_->text->updateInset(bv_,  bv_->theLockingInset())) {
                                update();
-                               if (mark_dirty){
+                               if (mark_dirty) {
                                        buffer_->markDirty();
                                }
                                updateScrollbar();
index 8ea4a538ab1837078bff46132ad75d67a1e67cff..b53040a9e3f37e22a2fa009b57e7c076856df3e9 100644 (file)
 /** The four LaTeX itemize environment default bullets
  */
 extern
-Bullet const ITEMIZE_DEFAULTS[4] = { Bullet( 0, 8 ),//"\\(\\bullet\\)"
-                                    Bullet( 0, 0 ),//"\\normalfont\\bfseries{--}"
-                                    Bullet( 0, 6 ),//"\\(\\ast\\)"
-                                    Bullet( 0, 10 ) };//"\\(\\cdot\\)"
+Bullet const ITEMIZE_DEFAULTS[4] = { Bullet(0, 8),//"\\(\\bullet\\)"
+                                    Bullet(0, 0),//"\\normalfont\\bfseries{--}"
+                                    Bullet(0, 6),//"\\(\\ast\\)"
+                                    Bullet(0, 10) };//"\\(\\cdot\\)"
 
 // will need these later if still using full text as below
 // \usepackage{latexsym,pifont,amssymb}
index 7554898725627942f57865c5070abc9bf46ea2b2..2627bb7ba8cb28f440cbd62a03577dd5fe3d00e4 100644 (file)
@@ -1,3 +1,11 @@
+2002-02-16  Lars Gullik Bjønnes  <larsbj@lyx.org>
+
+       * a lot of small ws changes
+       * add a lot of using std::XXX
+       * use std construcs some places where approp.
+       * use some exisint stuff from lyxfunctional where approp.
+       * Make file changes to use partial linking (lets test this now...)
+       
 2002-02-16  Angus Leeming  <a.leeming@ic.ac.uk>
 
        * Chktex.C:
index 59ddbd77bfeeacc6f4ffdcc5b37edb9357d7b3d2..6a358dec460d62e4ca9926499fd7a44ae6a4eede 100644 (file)
@@ -152,11 +152,11 @@ bool DepTable::extchanged(string const & ext) const
 }
 
 
-bool DepTable::ext_exist(const string& ext ) const
+bool DepTable::ext_exist(const string& ext) const
 {
        DepList::const_iterator cit = deplist.begin();
        DepList::const_iterator end = deplist.end();
-       for (; cit != end; ++cit ) {
+       for (; cit != end; ++cit) {
                if (suffixIs(cit->first, ext)) {
                        return true;
                }
index 96645375b77800714583368f2dcd0b90b0b696df..b75d165e914871833756749a7fcd2330ac5b846c 100644 (file)
@@ -279,8 +279,8 @@ XFontStruct * FontLoader::doLoad(LyXFont::FONT_FAMILY family,
        }
 
        getFontinfo(family, series, shape);
-       int fsize = int( (lyxrc.font_sizes[size] * lyxrc.dpi * 
-                         (lyxrc.zoom/100.0) ) / 72.27 + 0.5 );
+       int fsize = int((lyxrc.font_sizes[size] * lyxrc.dpi * 
+                         (lyxrc.zoom/100.0)) / 72.27 + 0.5);
 
        string font = fontinfo[family][series][shape]->getFontname(fsize);
 
index 039beb85faeaf40bebb17e52b3c276243f977817..91301c5094e1ab276aa9896012744f0cddfad1e8 100644 (file)
@@ -33,6 +33,10 @@ using lyx::textclass_type;
 
 using std::endl;
 using std::set;
+using std::vector;
+using std::find;
+using std::ostream;
+
 
 LaTeXFeatures::LaTeXFeatures(BufferParams const & p, layout_type n)
        : layout(n, false), params(p)
@@ -53,7 +57,7 @@ void LaTeXFeatures::require(string const & name)
 }
 
 
-void LaTeXFeatures::useLayout(std::vector<bool>::size_type const & idx)
+void LaTeXFeatures::useLayout(vector<bool>::size_type const & idx)
 {
        layout[idx] = true;
 }
@@ -61,9 +65,9 @@ void LaTeXFeatures::useLayout(std::vector<bool>::size_type const & idx)
 
 bool LaTeXFeatures::isRequired(string const & name) const
 {
-       FeaturesList::const_iterator i = std::find(features.begin(), 
-                                                  features.end(),
-                                                  name);
+       FeaturesList::const_iterator i = find(features.begin(), 
+                                             features.end(),
+                                             name);
        return i != features.end();
 }
 
@@ -374,7 +378,7 @@ string const LaTeXFeatures::getIncludedFiles(string const & fname) const
        for (FileMap::const_iterator fi = IncludedFiles.begin();
             fi != end; ++fi)
                sgmlpreamble << "\n<!ENTITY " << fi->first
-                            << (IsSGMLFilename(fi->second) ? " SYSTEM \"" : " \"" )
+                            << (IsSGMLFilename(fi->second) ? " SYSTEM \"" : " \"")
                             << MakeRelPath(fi->second, basename) << "\">";
 
        return sgmlpreamble.str().c_str();
@@ -395,7 +399,7 @@ BufferParams const & LaTeXFeatures::bufferParams() const
        return params;
 }
 
-void LaTeXFeatures::getFloatDefinitions(std::ostream & os) const
+void LaTeXFeatures::getFloatDefinitions(ostream & os) const
 {
        // Here we will output the code to create the needed float styles.
        // We will try to do this as minimal as possible.
index 99022c6ae100c3cbd06a68d11105a14dfb596eba..fba1db3682251366334b1800bba9aaeb1cd16e07 100644 (file)
@@ -81,7 +81,7 @@ void SendtoApplyCB(FL_OBJECT *, long)
     command += " &"; // execute in background
     // push directorypath, if necessary 
     string path = buffer->filePath();
-    if (lyxrc.use_tempdir || !IsDirWriteable(path)){
+    if (lyxrc.use_tempdir || !IsDirWriteable(path)) {
         path = buffer->tmppath;
     }
     Path p(path);
index 5b913c99ac8d2df2e997aff4c4494810fbc65b19..3b049a538c0a549dafbb1f439de028f76e67f647 100644 (file)
@@ -226,7 +226,7 @@ void LyXView::updateWindowTitle()
 
        if (view()->available()) {
                string const cur_title = buffer()->fileName();
-               if (!cur_title.empty()){
+               if (!cur_title.empty()) {
                        title += ": " + MakeDisplayPath(cur_title, 30);
                        if (!buffer()->isLyxClean())
                                title += _(" (Changed)");
index 3190ecc44985ad873ec1f24aafc64ae921fd4dc1..f1fe39f42592af66ad8eb1f3a7f24dddccf5d609 100644 (file)
@@ -4,13 +4,13 @@ DISTCLEANFILES= *.orig *.rej *~ *.bak core libintl.h config.h
 MAINTAINERCLEANFILES = $(srcdir)/Makefile.in $(srcdir)/config.h.in
 bin_PROGRAMS = lyx
 
-lyx_DEPENDENCIES = mathed/libmathed.la insets/libinsets.la \
-       graphics/libgraphics.la \
-       frontends/libfrontends.la \
-       support/libsupport.la \
+lyx_DEPENDENCIES = mathed/libmathed.o insets/libinsets.o \
+       graphics/libgraphics.o \
+       frontends/libfrontends.o \
+       support/libsupport.o \
        @INCLUDED_SIGC@
 lyx_LDADD = $(lyx_DEPENDENCIES) @INTLLIBS@ $(SIGC_LIBS) \
-       $(PSPELL_LIBS) @AIKSAURUS_LIBS@
+       $(PSPELL_LIBS) @AIKSAURUS_LIBS@ @LYX_LIBS@
 
 #lyx_LDFLAGS=-Wl,-O1
 EXTRA_DIST = config.h.in stamp-h.in cheaders ext_l10n.h version.C.in \
index e41ecf5fb04b98733b3872c262c03b211b15dded..b8e8a7459437a530e17dedf4f6a2b216e4ebac06 100644 (file)
 
 #include "Thesaurus.h"
 
+#ifdef HAVE_LIBAIKSAURUS
+
 #include <algorithm>
  
-Thesaurus thesaurus; 
+using std::sort;
 
-#ifdef HAVE_LIBAIKSAURUS
 Thesaurus::Thesaurus()
 {
        aik_ = new Aiksaurus;
@@ -60,7 +60,7 @@ Thesaurus::Meanings Thesaurus::lookup(string const & text)
 
        for (Meanings::iterator it = meanings.begin();
                it != meanings.end(); ++it) {
-                       std::sort(it->second.begin(), it->second.end());
+                       sort(it->second.begin(), it->second.end());
        }
  
        return meanings;
@@ -84,3 +84,6 @@ Thesaurus::Meanings Thesaurus::lookup(string const &)
 }
 
 #endif // HAVE_LIBAIKSAURUS
+
+// Global instance
+Thesaurus thesaurus; 
index ad4751de09e88104465aac971c3e679018c0cf66..294174cd2db2f3ebf45699ed7dfcd0b2c318cadc 100644 (file)
@@ -37,6 +37,7 @@ FL_APPEVENT_CB fl_set_preemptive_callback(Window, FL_APPEVENT_CB, void *);
  
 using std::endl;
 using std::abs;
+using std::hex;
 
 FL_OBJECT * figinset_canvas;
 
@@ -354,7 +355,7 @@ int WorkArea::work_area_handler(FL_OBJECT * ob, int event,
 
        if (!area) return 1;
        
-       switch (event){
+       switch (event) {
        case FL_DRAW:
                if (!area->work_area ||
                    !area->work_area->form->visible)
@@ -614,8 +615,8 @@ string const WorkArea::getClipboard() const
                if (fl_check_forms() == FL_EVENT) {
                        fl_XNextEvent(&ev);
                        lyxerr << "Received unhandled X11 event" << endl; 
-                       lyxerr << "Type: 0x" << std::hex << ev.xany.type <<
-                               "Target: 0x" << std::hex << ev.xany.window << endl;
+                       lyxerr << "Type: 0x" << hex << ev.xany.type <<
+                               "Target: 0x" << hex << ev.xany.window << endl;
                }
        }
        return clipboard_selection;
index ee8c67f1ece47ac892336ac616fa733a71f8d2e0..9dac0798979bb0bbcf45f22b28b7678c406dbf9a 100644 (file)
@@ -233,7 +233,7 @@ void XFormsView::prohibitInput() const
        static Cursor cursor;
        static bool cursor_undefined = true;
    
-       if (cursor_undefined){
+       if (cursor_undefined) {
                cursor = XCreateFontCursor(fl_get_display(), XC_watch);
                XFlush(fl_get_display());
                cursor_undefined = false;
index e888e3588ea81529d03117dfe5d4169d4a920ae8..c42098707bacd16f6a317ccef77d38358371ece2 100644 (file)
@@ -1530,7 +1530,7 @@ void Buffer::readInset(LyXLex & lex, Paragraph *& par,
                } else if (tmptok == "Note") {
                        inset = new InsetNote;
                } else if (tmptok == "Include") {
-                       InsetCommandParams p( "Include" );
+                       InsetCommandParams p("Include");
                        inset = new InsetInclude(p, *this);
                } else if (tmptok == "ERT") {
                        inset = new InsetERT;
@@ -2086,7 +2086,7 @@ void Buffer::makeLaTeXFile(string const & fname,
        // original_path is set. This is done for usual tex-file, but not
        // for nice-latex-file. (Matthias 250696)
        if (!only_body) {
-               if (!nice){
+               if (!nice) {
                        // code for usual, NOT nice-latex-file
                        ofs << "\\batchmode\n"; // changed
                        // from \nonstopmode
@@ -2185,7 +2185,7 @@ void Buffer::makeLaTeXFile(string const & fname,
                }
 
                string strOptions(options.str().c_str());
-               if (!strOptions.empty()){
+               if (!strOptions.empty()) {
                        strOptions = strip(strOptions, ',');
                        ofs << '[' << strOptions << ']';
                }
@@ -2692,7 +2692,7 @@ void Buffer::makeLinuxDocFile(string const & fname, bool nice, bool body_only)
                if (par->isInset(0)) {
                        Inset * inset = par->getInset(0);
                        Inset::Code lyx_code = inset->lyxCode();
-                       if (lyx_code == Inset::TOC_CODE){
+                       if (lyx_code == Inset::TOC_CODE) {
                                string const temp = "toc";
                                sgmlOpenTag(ofs, depth, temp);
 
@@ -2728,7 +2728,7 @@ void Buffer::makeLinuxDocFile(string const & fname, bool nice, bool body_only)
                                          _("Error : Wrong depth for"
                                            " LatexType Command.\n"));
 
-                       if (!environment_stack[depth].empty()){
+                       if (!environment_stack[depth].empty()) {
                                sgmlCloseTag(ofs, depth,
                                             environment_stack[depth]);
                                ofs << "</p>";
@@ -2861,7 +2861,7 @@ void operator|=(PAR_TAG & p1, PAR_TAG const & p2)
 inline
 void reset(PAR_TAG & p1, PAR_TAG const & p2)
 {
-       p1 = static_cast<PAR_TAG>( p1 & ~p2);
+       p1 = static_cast<PAR_TAG>(p1 & ~p2);
 }
 
 } // namespace anon
@@ -2986,7 +2986,7 @@ void Buffer::simpleLinuxDocOnePar(ostream & os,
                }
 
                list < PAR_TAG > temp;
-               while (!tag_state.empty() && tag_close ) {
+               while (!tag_state.empty() && tag_close) {
                        PAR_TAG k =  tag_state.top();
                        tag_state.pop();
                        os << "</" << tag_name(k) << ">";
@@ -3227,7 +3227,7 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
                        if (par->isInset(0)) {
                                Inset * inset = par->getInset(0);
                                Inset::Code lyx_code = inset->lyxCode();
-                               if (lyx_code == Inset::LABEL_CODE){
+                               if (lyx_code == Inset::LABEL_CODE) {
                                        command_name += " id=\"";
                                        command_name += (static_cast<InsetCommand *>(inset))->getContents();
                                        command_name += "\"";
@@ -3251,7 +3251,7 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
                        }
 
                        if (environment_stack[depth] != style.latexname()) {
-                               if(environment_stack.size() == depth + 1) {
+                               if (environment_stack.size() == depth + 1) {
                                        environment_stack.push_back("!-- --");
                                        environment_inner.push_back("!-- --");
                                }
@@ -3274,7 +3274,7 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
                        
                        if (style.latextype == LATEX_ENVIRONMENT) {
                                if (!style.latexparam().empty()) {
-                                       if(style.latexparam() == "CDATA")
+                                       if (style.latexparam() == "CDATA")
                                                ofs << "<![CDATA[";
                                        else
                                                sgmlOpenTag(ofs, depth + command_depth,
@@ -3324,7 +3324,7 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
                        break;
                case LATEX_ENVIRONMENT:
                        if (!style.latexparam().empty()) {
-                               if(style.latexparam() == "CDATA")
+                               if (style.latexparam() == "CDATA")
                                        ofs << "]]>";
                                else
                                        sgmlCloseTag(ofs, depth + command_depth,
@@ -3398,17 +3398,17 @@ void Buffer::simpleDocBookOnePar(ostream & os,
                        if (font.emph() == LyXFont::ON) {
                                os << "<emphasis>";
                                emph_flag = true;
-                       }else if(i) {
+                       } else if (i) {
                                os << "</emphasis>";
                                emph_flag = false;
                        }
                }
       
 
-               if ( par->isInset(i) ) {
+               if (par->isInset(i)) {
                        Inset * inset = par->getInset(i);
                        // don't print the inset in position 0 if desc_on == 3 (label)
-                       if ( i || desc_on != 3)
+                       if (i || desc_on != 3)
                                inset->docbook(this, os);
                } else {
                        char c = par->getChar(i);
@@ -3417,7 +3417,7 @@ void Buffer::simpleDocBookOnePar(ostream & os,
 
                        if (style.pass_thru) {
                                os << c;
-                       } else if(style.free_spacing || par->isFreeSpacing() || c != ' ') {
+                       } else if (style.free_spacing || par->isFreeSpacing() || c != ' ') {
                                        os << sgml_string;
                        } else if (desc_on ==1) {
                                ++char_line_count;
@@ -3439,7 +3439,7 @@ void Buffer::simpleDocBookOnePar(ostream & os,
                // <term> not closed...
                os << "</term>";
        }
-       if(style.free_spacing) os << '\n';
+       if (style.free_spacing) os << '\n';
 }
 
 
@@ -3484,7 +3484,7 @@ int Buffer::runChktex()
 
        // if we removed error insets before we ran chktex or if we inserted
        // error insets after we ran chktex, this must be run:
-       if (removedErrorInsets || res){
+       if (removedErrorInsets || res) {
                users->redraw();
                users->fitCursor();
        }
index 8fd835dd35188f38cca2bfec5afbed46d74e27b3..060e6269fca6bfee6e6a6a887b6a2efc59bfc684 100644 (file)
@@ -198,7 +198,7 @@ bool BufferList::close(Buffer * buf)
                while (reask) {
                        switch (Alert::askConfirmation(_("Changes in document:"),
                                               fname,
-                                              _("Save document?"))){
+                                              _("Save document?"))) {
                        case 1: // Yes
                                if (buf->isUnnamed())
                                        reask = !WriteAs(current_view, buf);
index 7ab2815f37e98e8d186a80d11f2de3586fd7fd98..1331407e33f6b00bfdf8e7a1316f3253f15f4818 100644 (file)
@@ -233,7 +233,7 @@ void toggleAndShow(BufferView * bv, LyXFont const & font, bool toggleall)
                        text->computeBidiTables(bv->buffer(), cursor.row());
                        if (cursor.boundary() != 
                            text->isBoundary(bv->buffer(), cursor.par(), cursor.pos(),
-                                            text->real_current_font) )
+                                            text->real_current_font))
                                text->setCursor(bv, cursor.par(), cursor.pos(),
                                                false, !cursor.boundary());
                }
index 474d5367599a10953bba93b90644f42b5d2d7851..4463d63d7545afade1f8e02dda301baa17bd0b27 100644 (file)
@@ -7,82 +7,96 @@
  */
 
 #include <config.h>
-#include <cerrno>
+
+#include "Alert.h"
+
 #include "debug.h"
 #include "lyxrc.h" 
  
 #include "Alert_pimpl.h"
 
+#include <cerrno>
 using std::endl;
+using std::pair;
+using std::make_pair;
 
-namespace Alert {
-       void alert(string const & s1, string const & s2, string const & s3) {
-               if (!lyxrc.use_gui) {
-                       lyxerr << "----------------------------------------" << endl
-                              << s1 << endl << s2 << endl << s3 << endl
-                              << "----------------------------------------" << endl;
-               } else { 
-                       alert_pimpl(s1, s2, s3);
-               }
-       }
 
-       void err_alert(string const & s1, string const & s2) {
-               alert(s1, s2, strerror(errno));
+void Alert::alert(string const & s1, string const & s2, string const & s3)
+{
+       if (!lyxrc.use_gui) {
+               lyxerr << "------------------------------" << endl
+                      << s1 << endl << s2 << endl << s3 << endl
+                      << "------------------------------" << endl;
+       } else { 
+               alert_pimpl(s1, s2, s3);
        }
+}
 
-       bool askQuestion(string const & s1, string const & s2, string const & s3, bool default_value) {
-               if (!lyxrc.use_gui) {
-                               lyxerr << "----------------------------------------" << endl
-                                      << s1 << endl;
-                               if (!s2.empty())
-                                       lyxerr << s2 << endl;
-                               if (!s3.empty())
-                                       lyxerr << s3 << endl;
-                       lyxerr << "Assuming answer is "
-                              << (default_value ? "yes" : "no")
-                              << endl
-                              << "----------------------------------------" << endl;
-                       return default_value;
-               } else {
-                       return askQuestion_pimpl(s1, s2, s3);
-               }
+
+void Alert::err_alert(string const & s1, string const & s2)
+{
+       alert(s1, s2, strerror(errno));
+}
+
+
+bool Alert::askQuestion(string const & s1, string const & s2,
+                       string const & s3, bool default_value)
+{
+       if (!lyxrc.use_gui) {
+               lyxerr << "----------------------------------------" << endl
+                      << s1 << endl;
+               if (!s2.empty())
+                       lyxerr << s2 << endl;
+               if (!s3.empty())
+                       lyxerr << s3 << endl;
+               lyxerr << "Assuming answer is "
+                      << (default_value ? "yes" : "no")
+                      << endl
+                      << "----------------------------------------" << endl;
+               return default_value;
+       } else {
+               return askQuestion_pimpl(s1, s2, s3);
        }
+}
 
-       int askConfirmation(string const & s1, string const & s2, string const & s3, int default_value) {
-               if (!lyxrc.use_gui) {
-                       lyxerr << "----------------------------------------" << endl
-                              << s1 << endl;
-                       if (!s2.empty())
-                                       lyxerr << s2 << endl;
-                       if (!s3.empty())
-                               lyxerr << s3 << endl;
-                       lyxerr << "Assuming answer is ";
-                       if (default_value == 1)
-                               lyxerr << "yes";
-                       else if (default_value == 2)
-                               lyxerr << "no";
-                       else
-                               lyxerr << "cancel";
-                       lyxerr << endl
-                              << "----------------------------------------" << endl;
-                       return default_value;
-               } else {
-                       return askConfirmation_pimpl(s1, s2, s3);
-               }
+
+int Alert::askConfirmation(string const & s1, string const & s2,
+                          string const & s3, int default_value)
+{
+       if (!lyxrc.use_gui) {
+               lyxerr << "----------------------------------------" << endl
+                      << s1 << endl;
+               if (!s2.empty())
+                       lyxerr << s2 << endl;
+               if (!s3.empty())
+                       lyxerr << s3 << endl;
+               lyxerr << "Assuming answer is ";
+               if (default_value == 1)
+                       lyxerr << "yes";
+               else if (default_value == 2)
+                       lyxerr << "no";
+               else
+                       lyxerr << "cancel";
+               lyxerr << endl
+                      << "----------------------------------------" << endl;
+               return default_value;
+       } else {
+               return askConfirmation_pimpl(s1, s2, s3);
        }
-       std::pair<bool, string> const askForText(string const & msg, string const & dflt) {
-               if (!lyxrc.use_gui) {
-                       lyxerr << "----------------------------------------" << endl
-                              << msg << endl
-                              << "Assuming answer is " << dflt
-                              << "----------------------------------------" << endl;
-                       return std::make_pair<bool, string>(true, dflt);
-               } else {
-                       return askForText_pimpl(msg, dflt);
-               }
+}
+
+
+pair<bool, string> const Alert::askForText(string const & msg,
+                                          string const & dflt)
+{
+       if (!lyxrc.use_gui) {
+               lyxerr << "----------------------------------------" << endl
+                      << msg << endl
+                      << "Assuming answer is " << dflt
+                      << "----------------------------------------" << endl;
+               return make_pair<bool, string>(true, dflt);
+       } else {
+               return askForText_pimpl(msg, dflt);
        }
 }
index 0fe2a71417ef9bb3726a0ecc57257c86429d0783..6f8efd0e07f48778494c8f4bbf5fc541d23f6602 100644 (file)
@@ -1,3 +1,4 @@
+// -*- C++ -*-
 /**
  * \file Alert.h
  * Copyright 2001 the LyX Team
@@ -6,26 +7,35 @@
  * \author John Levon <moz@compsoc.man.ac.uk>
  */
 
+#ifndef LYX_ALERT_H
+#define LYX_ALERT_H
+
 #include "support/lstrings.h"
+
 #include <algorithm>
+
 namespace Alert {
-       /// show an alert message
-       void alert(string const & s1, string const & s2 = string(), 
-               string const & s3 = string());
 
-       /// show an alert message and strerror(errno)
-       void err_alert(string const & s1, string const & s2 = string());
+/// show an alert message
+void alert(string const & s1, string const & s2 = string(), 
+          string const & s3 = string());
+
+/// show an alert message and strerror(errno)
+void err_alert(string const & s1, string const & s2 = string());
 
-       /// ask a question 
-       bool askQuestion(string const & s1, string const & s2 = string(),
+/// ask a question 
+bool askQuestion(string const & s1, string const & s2 = string(),
                 string const & s3 = string(), bool default_value = true);
 
-       /// Returns 1 for yes, 2 for no, 3 for cancel.
-       int askConfirmation(string const & s1, string const & s2 = string(), 
-               string const & s3 = string(), int default_value = 1);
-       /// Asks for a text
-       std::pair<bool, string> const askForText(string const & msg, 
-               string const & dflt = string());
+/// Returns 1 for yes, 2 for no, 3 for cancel.
+int askConfirmation(string const & s1, string const & s2 = string(), 
+                   string const & s3 = string(), int default_value = 1);
+
+/// Asks for a text
+std::pair<bool, string> const
+askForText(string const & msg, 
+          string const & dflt = string());
+
 }
+
+#endif
index 5072965fbad6c9426c923a766f368195576cfe91..3cb18f2157b0faf5a4a828b8ebfadf1bec3a082f 100644 (file)
@@ -9,17 +9,16 @@ ETAGS_ARGS = --lang=c++
 BOOST_INCLUDES = -I$(top_srcdir)/boost
 INCLUDES = ${FRONTEND_INCLUDES} -I${srcdir}/.. -I${srcdir}/xforms ${SIGC_CFLAGS} $(BOOST_INCLUDES)
 LIBS =
-noinst_LTLIBRARIES = libfrontends.la
+noinst_LTLIBRARIES = libfrontends.o
 
-libfrontends_la_LIBADD= @FRONTEND_GUILIB@ \
-       support/libfrontendsupport.la \
-       controllers/libcontrollers.la
+libfrontends_o_LIBADD= `cat libxforms.objects` \
+       `cat libcontrollers.objects` \
+       support/libfrontendsupport.o
 
-libfrontends_la_DEPENDENCIES = @FRONTEND_GUILIB@ \
-       support/libfrontendsupport.la \
-       controllers/libcontrollers.la
+libfrontends_o_DEPENDENCIES = \
+       support/libfrontendsupport.o
 
-libfrontends_la_SOURCES=\
+libfrontends_o_SOURCES=\
        Alert.C \
        Alert.h \
        Alert_pimpl.h \
index a8c7f183973326c3c26913c8ee33d4c28929f292..2d108af96e0777e85de30262be30cb4137d7936a 100644 (file)
@@ -229,7 +229,7 @@ void ControlCharacter::setLanguage(string const & val)
        if (val == _("No change"))
                font_->setLanguage(ignore_language);
 
-       else if ( val == _("Reset"))
+       else if (val == _("Reset"))
                font_->setLanguage(lv_.buffer()->params.language);
 
        else
index 0942eb46079f60f9732892809abc54d1b8a033a9..c596a846d336a7f42429d199870882165d3b23b7 100644 (file)
@@ -1,7 +1,7 @@
 AUTOMAKE_OPTIONS = foreign 1.4
 DISTCLEANFILES= *.orig *.rej *~ *.bak core
 MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
-noinst_LTLIBRARIES = libcontrollers.la
+noinst_LTLIBRARIES = libcontrollers.o
 BOOST_INCLUDES = -I$(top_srcdir)/boost
 INCLUDES = -I${top_srcdir}/src/ \
        -I${top_srcdir}/src/frontends/ \
@@ -11,7 +11,7 @@ ETAGS_ARGS = --lang=c++
 
 EXTRA_DIST = ButtonController.tmpl ControlDialog.tmpl ControlInset.tmpl
 
-libcontrollers_la_SOURCES=\
+libcontrollers_o_SOURCES=\
        biblio.C \
        biblio.h \
        character.C \
@@ -87,3 +87,9 @@ libcontrollers_la_SOURCES=\
        ViewBase.h \
        helper_funcs.C \
        helper_funcs.h
+
+libcontrollers.o: $(libcontrollers_o_OBJECTS) $(libcontrollers_o_DEPENDENCIES)
+       rm -f ../libcontrollers.objects
+       for fil in $(libcontrollers_o_OBJECTS) ; do \
+               echo controllers/$$fil >> ../libcontrollers.objects ; \
+       done
index a973c6e84370936495ebc3ad1d1c82eab294b686..658160f5813b49b1fcde7c6dd38e43d9f15b9d2b 100644 (file)
@@ -302,7 +302,7 @@ searchKeys(InfoMap const & theMap,
           bool caseSensitive)
 {
        // Preliminary checks
-       if(start < keys.begin() || start >= keys.end())
+       if (start < keys.begin() || start >= keys.end())
                return keys.end();
        
        string search_expr = frontStrip(strip(expr));
index 0e5c135afefedb71d853dd7eaacacfd8ce109424..3648282defd828c789232c37102707a7c7411d55 100644 (file)
@@ -121,7 +121,7 @@ string const browseRelFile(LyXView * lv, string const & filename,
        string const outname = browseFile(lv, fname, title, pattern,
                                          dir1, dir2);
        string const reloutname = MakeRelPath(outname, refpath);
-       if(prefixIs(reloutname, "../"))
+       if (prefixIs(reloutname, "../"))
                return outname;
        else
                return reloutname;
index 661c59a82627cbf70a7ca6876d0cfef853543387..e227dc139006ed34288ecf9f39c8f8be164974cc 100644 (file)
@@ -1,12 +1,12 @@
 AUTOMAKE_OPTIONS = foreign 1.4
 DISTCLEANFILES= *.orig *.rej *~ *.bak core
 MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
-noinst_LTLIBRARIES = libfrontendsupport.la
+noinst_LTLIBRARIES = libfrontendsupport.o
 LIBS =
 ETAGS_ARGS = --lang=c++
 INCLUDES = -I${srcdir}/../../ $(SIGC_CFLAGS)
 
-libfrontendsupport_la_SOURCES = \
+libfrontendsupport_o_SOURCES = \
        LyXImage.h \
        LyXImage.C
 
index 262a29971227b4ca77b2cf560e9d2a462a84e171..82706e055ea04c05a4eb0552ef3c2f6ca8a4877b 100644 (file)
@@ -45,7 +45,7 @@ RGBColor::RGBColor(HSVColor const & hsv)
                h /= 60.0;
 
                int const j = max(0, static_cast<int>(::floor(h)));
-               //if( j < 0 ) j = 0;
+               //if (j < 0) j = 0;
 
                double const f = h - j;
                double const p = v * (1.0 - s);
@@ -91,9 +91,9 @@ RGBColor::RGBColor(HSVColor const & hsv)
                }
        }
 
-       r = static_cast<int>( ::floor((rd * 255.0) + 0.5) );
-       g = static_cast<int>( ::floor((gd * 255.0) + 0.5) );
-       b = static_cast<int>( ::floor((bd * 255.0) + 0.5) );
+       r = static_cast<int>(::floor((rd * 255.0) + 0.5));
+       g = static_cast<int>(::floor((gd * 255.0) + 0.5));
+       b = static_cast<int>(::floor((bd * 255.0) + 0.5));
 }
 
 
@@ -103,8 +103,8 @@ HSVColor::HSVColor(RGBColor const & rgb)
        double const g = rgb.g / 255.0;
        double const b = rgb.b / 255.0;
 
-       double const maxval = max( max( r, g ), b );
-       double const minval = min( min( r, g ), b );
+       double const maxval = max( max( r, g), b);
+       double const minval = min( min( r, g), b);
 
        v = maxval;
 
index 48b1d88599a829ec305b2a6d1a609877d18ae87f..a257867afd9a7209900a663e94713ef8da809a47 100644 (file)
@@ -43,7 +43,7 @@ struct RGBColor {
 struct NamedColor : public RGBColor {
        string name;
        NamedColor() : RGBColor() {}
-       NamedColor(string const & n, RGBColor const & c )
+       NamedColor(string const & n, RGBColor const & c)
                : RGBColor(c), name(n) {}
        RGBColor const & color() const { return *this; }
        string const & getname() const { return name; }
index 6d8791e12a78f0b6f658a236aca0ab2b6534f689..17cce0981ff57ed9e2b145d861fd7da66465bf82 100644 (file)
 
 #include <iostream>
 #include <cctype>
+
+
+using std::vector;
+
+
 namespace {
        
 extern "C" void C_CompletedCB(FL_OBJECT * ob, long)
@@ -54,15 +58,17 @@ DropDown::~DropDown()
 }
  
 
-void DropDown::select(std::vector<string> const & choices, int x, int y, int w)
+void DropDown::select(vector<string> const & choices, int x, int y, int w)
 {
        if (choices.empty())
                return;
 
        fl_set_form_geometry(form_, x, y-100, w, 100);
        fl_clear_browser(browser_);
-       for (std::vector<string>::const_iterator cit = choices.begin();
-               cit != choices.end(); ++cit) {
+
+       vector<string>::const_iterator cit = choices.begin();
+       vector<string>::const_iterator end = choices.end();
+       for (; cit != end; ++cit) {
                fl_add_browser_line(browser_, cit->c_str());
        }
        fl_select_browser_line(browser_, 1);
index a2e65732def76d8e79b7014c24d8f0ac9b9e8806..bb16b6fa75f0158f5c873bd7b53d5cfe38b7b1bc 100644 (file)
@@ -192,7 +192,7 @@ void FormBase::fillTooltipChoice(FL_OBJECT * ob)
        fl_clear_choice(ob);
        fl_addto_choice(ob, _(" None | Normal | Verbose "));
 
-       switch(tooltip_level_){
+       switch (tooltip_level_) {
        case NO_TOOLTIP:
                fl_set_choice(ob, 1);
                break;
@@ -211,7 +211,7 @@ void FormBase::setTooltipLevel(FL_OBJECT * ob)
        lyx::Assert(ob && ob->objclass == FL_CHOICE &&
                    fl_get_choice_maxitems(ob) == 3);
 
-       switch(fl_get_choice(ob)){
+       switch (fl_get_choice(ob)) {
        case 1:
                tooltip_level_ = NO_TOOLTIP;
                break;
@@ -313,7 +313,7 @@ static int C_FormBasePrehandler(FL_OBJECT * ob, int event,
                // using the middle mouse button.
                pre->InputCB(ob, 0);
 
-       } else if (event == FL_ENTER || event == FL_LEAVE){
+       } else if (event == FL_ENTER || event == FL_LEAVE) {
                // Post feedback as the mouse enters the object,
                // remove it as the mouse leaves.
                pre->FeedbackCB(ob, event);
index 27a2f1217f8041b1e88419a6adc38a5716f19d56..6dce7788cfc7ba5d13ba7235466c5019c5121520 100644 (file)
 #include "support/filetools.h"
 
 
+using std::vector;
+using std::sort;
+
+
 typedef FormCB<ControlBibtex, FormDB<FD_form_bibtex> > base_class;
 
 FormBibtex::FormBibtex(ControlBibtex & c)
@@ -133,17 +137,19 @@ namespace {
 
 // Remove all duplicate entries in c.
 // Taken stright out of Stroustrup
-template<class C> void eliminate_duplicates(C & c)
+template<class C>
+void eliminate_duplicates(C & c)
 {
-       std::sort(c.begin(), c.end()); // sort
-       typename C::iterator p = std::unique(c.begin(), c.end()); // compact
-       c.erase(p, c.end()); // shrink
+       sort(c.begin(), c.end());
+       typename C::iterator p = std::unique(c.begin(), c.end());
+       c.erase(p, c.end());
 }
 
+
 string const unique_and_no_extensions(string const & str_in)
 {
-       std::vector<string> dbase = getVectorFromString(str_in);
-       for (std::vector<string>::iterator it = dbase.begin();
+       vector<string> dbase = getVectorFromString(str_in);
+       for (vector<string>::iterator it = dbase.begin();
             it != dbase.end(); ++it) {
                *it = ChangeExtension(*it, "");
        }
@@ -183,7 +189,7 @@ void FormBibtex::apply()
                // bibtotoc and no style
                controller().params().setOptions("bibtotoc");
 
-       } else if (!bibstyle.empty()){
+       } else if (!bibstyle.empty()) {
                // only style
                controller().params().setOptions(bibstyle);
        }
index f9357d35d2c6559717b3e8efecab3802fcbfa2c5..25e135c3e847a6132265b86d1022c5320b3cd36a 100644 (file)
@@ -24,6 +24,8 @@
 #include "helper_funcs.h"
 
 using std::vector;
+using std::find;
+
 using namespace character;
 
 typedef FormCB<ControlCharacter, FormDB<FD_form_character> > base_class;
@@ -140,8 +142,7 @@ namespace {
 template<class A>
 typename vector<A>::size_type findPos(vector<A> const & vec, A const & val)
 {
-       vector<A>::const_iterator it =
-               std::find(vec.begin(), vec.end(), val);
+       vector<A>::const_iterator it = find(vec.begin(), vec.end(), val);
        if (it == vec.end())
                return 0;
        return it - vec.begin();
index 98ca7a4b6b1fc4ddc69afcf63ab137a7c55ff101..82b850c37d18886da86adbc1747278367910ba2b 100644 (file)
@@ -251,7 +251,7 @@ ButtonPolicy::SMInput FormCitation::input(FL_OBJECT * ob, long)
 
                string const tmp = formatted(biblio::getInfo(theMap,
                                                             bibkeys[sel-1]),
-                                             dialog_->browser_info->w-10 );
+                                             dialog_->browser_info->w-10);
                fl_add_browser_line(dialog_->browser_info, tmp.c_str());
 
                // Highlight the selected browser_bib key in browser_cite if
index c18b7d201cbee126888ce90f697cb87f06a612ec..7e91036be97c298001b37e3e2180e43cb4beed4c 100644 (file)
@@ -65,14 +65,14 @@ FormDocument::FormDocument(LyXView * lv, Dialogs * d)
 
 void FormDocument::redraw()
 {
-       if( form() && form()->visible )
-               fl_redraw_form( form() );
+       if (form() && form()->visible)
+               fl_redraw_form(form());
        else
                return;
 
        FL_FORM * outer_form = fl_get_active_folder(dialog_->tabbed_folder);
        if (outer_form && outer_form->visible)
-               fl_redraw_form( outer_form );
+               fl_redraw_form(outer_form);
 }
 
 
@@ -376,9 +376,9 @@ bool saveParamsAsDefault(BufferParams const &params)
 
 } //namespace
 
-bool FormDocument::input( FL_OBJECT * ob, long data )
+bool FormDocument::input(FL_OBJECT * ob, long data)
 {
-       State cb = static_cast<State>( data );
+       State cb = static_cast<State>(data);
 
        switch (cb) {
        case CHECKCHOICECLASS:
@@ -1272,7 +1272,7 @@ bool FormDocument::CheckDocumentInput(FL_OBJECT * ob, long)
 }
 
 
-void FormDocument::ChoiceBulletSize(FL_OBJECT * ob, long /*data*/ )
+void FormDocument::ChoiceBulletSize(FL_OBJECT * ob, long /*data*/)
 {
        BufferParams & param = lv_->buffer()->params;
 
@@ -1305,13 +1305,13 @@ void FormDocument::BulletDepth(FL_OBJECT * ob, State cb)
        BufferParams & param = lv_->buffer()->params;
 
        int data = 0;
-       if (cb == BULLETDEPTH1 )
+       if (cb == BULLETDEPTH1)
                data = 0;
-       else if (cb == BULLETDEPTH2 )
+       else if (cb == BULLETDEPTH2)
                data = 1;
-       else if (cb == BULLETDEPTH3 )
+       else if (cb == BULLETDEPTH3)
                data = 2;
-       else if (cb == BULLETDEPTH4 )
+       else if (cb == BULLETDEPTH4)
                data = 3;
 
        switch (fl_get_button_numb(ob)) {
@@ -1334,17 +1334,17 @@ void FormDocument::BulletPanel(FL_OBJECT * /*ob*/, State cb)
        /* by the user. (eg. standard.xpm, psnfss1.xpm etc...)           */
     
        int data = 0;
-       if (cb == BULLETPANEL1 )
+       if (cb == BULLETPANEL1)
                data = 0;
-       else if (cb == BULLETPANEL2 )
+       else if (cb == BULLETPANEL2)
                data = 1;
-       else if (cb == BULLETPANEL3 )
+       else if (cb == BULLETPANEL3)
                data = 2;
-       else if (cb == BULLETPANEL4 )
+       else if (cb == BULLETPANEL4)
                data = 3;
-       else if (cb == BULLETPANEL5 )
+       else if (cb == BULLETPANEL5)
                data = 4;
-       else if (cb == BULLETPANEL6 )
+       else if (cb == BULLETPANEL6)
                data = 5;
 
        if (data != current_bullet_panel) {
@@ -1390,7 +1390,7 @@ void FormDocument::BulletPanel(FL_OBJECT * /*ob*/, State cb)
 }
 
 
-void FormDocument::BulletBMTable(FL_OBJECT * ob, long /*data*/ )
+void FormDocument::BulletBMTable(FL_OBJECT * ob, long /*data*/)
 {
        /* handle the user input by setting the current bullet depth's pixmap */
        /* to that extracted from the current chosen position of the BMTable  */
index a27d9f659cff84cfc232fedb190738fa7813c285..f87f169c3cb3753a42bd4a4cf2dd13879b201c8b 100644 (file)
@@ -83,7 +83,7 @@ private:
        /// Build the dialog
        virtual void build();
        /// Filter the inputs
-       virtual bool input( FL_OBJECT *, long );
+       virtual bool input( FL_OBJECT *, long);
        /// Update the dialog.
        virtual void update();
        /// Apply from dialog
index bd961ae2a58a779cb099314482b51502c6ec7727..4222641bc64e9b50f225b44a3e2a331c6bd8f956 100644 (file)
@@ -56,7 +56,7 @@ FormGraphics::FormGraphics(ControlGraphics & c)
 
 void FormGraphics::redraw()
 {
-       if(form() && form()->visible)
+       if (form() && form()->visible)
                fl_redraw_form(form());
        else
                return;
index 3f0c6676f5b8457d9c316ea5fc9512c069901a72..5597c7f81ac70b82d7e05a4e99a461d409f58a0e 100644 (file)
@@ -91,7 +91,7 @@ void FormCommand::createInset(string const & arg)
        }
 
        params.setFromString(arg);
-       if ( !arg.empty() )
+       if ( !arg.empty())
                bc().valid(); // so that the user can press Ok
        show();
 }
index c7a1fafd4ae68da9ad6ee3609eca639a3025ebf8..f9e4f534bec694195d5a550e165eb13d5011d25e 100644 (file)
@@ -28,7 +28,7 @@ struct FD_form_maths_space;
 class FormMathsSpace : public FormMathsSub {
 public:
        ///
-       FormMathsSpace(LyXView *, Dialogs * , FormMathsPanel const & );
+       FormMathsSpace(LyXView *, Dialogs * , FormMathsPanel const &);
 
 private:
        /// Build the dialog
index c4fa2e4489588e66e9dcf7bbdf5d397b2261c068..bfe459e07bb91421fa39d6bf09731fca2a40dbbe 100644 (file)
 
 #include "support/lstrings.h"
 
+#include <functional>
+
 using Liason::setMinibuffer;
 using SigC::slot;
+using std::vector;
+using std::bind2nd;
 
 
 FormParagraph::FormParagraph(LyXView * lv, Dialogs * d)
@@ -91,8 +95,8 @@ void FormParagraph::changedParagraph()
 
 void FormParagraph::redraw()
 {
-       if( form() && form()->visible )
-               fl_redraw_form( form() );
+       if (form() && form()->visible)
+               fl_redraw_form(form());
 }
 
 
@@ -126,12 +130,22 @@ void FormParagraph::build()
 
     // Create the contents of the unit choices
     // Don't include the "%" terms...
-    std::vector<string> units_vec = getLatexUnits();
-    for (std::vector<string>::iterator it = units_vec.begin();
+#warning A bit dangerous... (Lgb)
+    vector<string> units_vec = getLatexUnits();
+#if 0
+    for (vector<string>::iterator it = units_vec.begin();
        it != units_vec.end(); ++it) {
        if (contains(*it, "%"))
                it = units_vec.erase(it, it+1) - 1;
     }
+#else
+    // Something similar to this is a better way to erase
+    vector<string>::iterator del =
+           remove_if(units_vec.begin(), units_vec.end(),
+                     bind2nd(contains_functor(), "%"));
+    units_vec.erase(del, units_vec.end());
+#endif
+    
     string units = getStringFromVector(units_vec, "|");
 
     fl_addto_choice(dialog_->choice_value_space_above,  units.c_str());
index a63609fc4db56a9ed55637b393e6d9181b28be9d..aba6c9ee75f893d87dea9516814638804854802a 100644 (file)
 #include "lyxrc.h"
 #include "combox.h"
 #include "debug.h"
-#include "support/filetools.h"
-#include "support/LAssert.h"
 #include "lyxlex.h"
 #include "input_validators.h"
 #include "xforms_helpers.h"
 #include "helper_funcs.h"
 #include "converter.h"
+
 #include "support/lyxfunctional.h"
 #include "support/lyxmanip.h"
+#include "support/filetools.h"
+#include "support/LAssert.h"
 
 using std::endl;
 using std::pair;
@@ -53,6 +54,9 @@ using std::make_pair;
 using std::max;
 using std::min;
 using std::vector;
+using std::setw;
+using std::setfill;
+
 using SigC::slot;
 
 extern string system_lyxdir;
@@ -564,7 +568,7 @@ void FormPreferences::Colors::AdjustVal(int colAdjust, int colParent,
 
        HSVColor hsv(rgb);
        hsv.v += addVal;
-       hsv.v = min( 1.0, max(0.0, hsv.v) );
+       hsv.v = min(1.0, max(0.0, hsv.v));
 
        rgb = RGBColor(hsv);
        fl_mapcolor(colAdjust, rgb.r, rgb.g, rgb.b);
@@ -580,7 +584,7 @@ void FormPreferences::Colors::InputBrowserLyX() const
        // Is the choice an Xforms color...
        RGBColor col;
 
-       if( selLyX-1 < xformsColorDB.size() ) {
+       if (selLyX - 1 < xformsColorDB.size()) {
                vector<XformsColor>::size_type const i = selLyX - 1;
                col = xformsColorDB[i].color();
        }
@@ -643,7 +647,7 @@ void FormPreferences::Colors::InputHSV()
        bool modify = false;
        
        // Is the choice an Xforms color...
-       if( selLyX-1 < xformsColorDB.size() ) {
+       if (selLyX - 1 < xformsColorDB.size()) {
                vector<XformsColor>::size_type const i = selLyX - 1;
                modify = (xformsColorDB[i].color() != col);
        }
@@ -684,7 +688,7 @@ void FormPreferences::Colors::InputRGB()
        bool modify = false;
        
        // Is the choice an Xforms color...
-       if( selLyX-1 < xformsColorDB.size() ) {
+       if (selLyX - 1 < xformsColorDB.size()) {
                vector<XformsColor>::size_type const i = selLyX - 1;
                modify = (xformsColorDB[i].color() != col);
        }
@@ -827,7 +831,7 @@ void FormPreferences::Colors::Modify()
        fl_getmcolor(GUI_COLOR_CHOICE, &col.r, &col.g, &col.b);
 
        // Is the choice an Xforms color...
-       if( selLyX-1 < xformsColorDB.size() ) {
+       if (selLyX - 1 < xformsColorDB.size()) {
                vector<XformsColor>::size_type const i = selLyX - 1;
                xformsColorDB[i].r  = col.r;
                xformsColorDB[i].g  = col.g;
@@ -915,10 +919,10 @@ string const FormPreferences::Colors::X11hexname(RGBColor const & col) const
 {
        ostringstream ostr;
 
-       ostr << "#" << std::setbase(16) << std::setfill('0')
-            << std::setw(2) << col.r
-            << std::setw(2) << col.g
-            << std::setw(2) << col.b;
+       ostr << "#" << std::setbase(16) << setfill('0')
+            << setw(2) << col.r
+            << setw(2) << col.g
+            << setw(2) << col.b;
 
        return ostr.str().c_str();
 }
@@ -1183,7 +1187,7 @@ void FormPreferences::Converters::UpdateChoices() const
 }
 
 
-FormPreferences::Formats::Formats( FormPreferences &  p )
+FormPreferences::Formats::Formats(FormPreferences &  p)
        : parent_(p)
 {}
 
@@ -1408,7 +1412,7 @@ bool FormPreferences::Formats::Input()
 }
 
 
-FormPreferences::InputsMisc::InputsMisc( FormPreferences &  p )
+FormPreferences::InputsMisc::InputsMisc(FormPreferences &  p)
        : parent_(p)
 {}
 
@@ -1456,7 +1460,7 @@ void FormPreferences::InputsMisc::update()
 }
 
 
-FormPreferences::Interface::Interface( FormPreferences &  p )
+FormPreferences::Interface::Interface(FormPreferences &  p)
        : parent_(p)
 {}
 
@@ -1573,7 +1577,7 @@ void FormPreferences::Interface::update()
 }
 
 
-FormPreferences::Language::Language( FormPreferences &  p )
+FormPreferences::Language::Language(FormPreferences &  p)
        : parent_(p)
 {}
 
@@ -1803,7 +1807,7 @@ void FormPreferences::Language::ComboCB(int, void * v, Combox * combox)
 }
 
 
-FormPreferences::LnFmisc::LnFmisc( FormPreferences &  p )
+FormPreferences::LnFmisc::LnFmisc(FormPreferences &  p)
        : parent_(p)
 {}
 
@@ -1931,7 +1935,7 @@ void FormPreferences::LnFmisc::update()
 }
 
 
-FormPreferences::OutputsMisc::OutputsMisc( FormPreferences &  p )
+FormPreferences::OutputsMisc::OutputsMisc(FormPreferences &  p)
        : parent_(p)
 {}
 
@@ -2029,7 +2033,7 @@ void FormPreferences::OutputsMisc::update()
 }
 
 
-FormPreferences::Paths::Paths( FormPreferences &  p )
+FormPreferences::Paths::Paths(FormPreferences &  p)
        : parent_(p)
 {}
 
@@ -2450,7 +2454,7 @@ void FormPreferences::Printer::update()
 }
 
 
-FormPreferences::ScreenFonts::ScreenFonts( FormPreferences &  p )
+FormPreferences::ScreenFonts::ScreenFonts(FormPreferences &  p)
        : parent_(p)
 {}
 
@@ -2758,7 +2762,7 @@ void FormPreferences::ScreenFonts::update()
 
 
 
-FormPreferences::SpellOptions::SpellOptions( FormPreferences &  p )
+FormPreferences::SpellOptions::SpellOptions(FormPreferences &  p)
        : parent_(p)
 {}
 
index 295292675870b3fd24f86d60024add6bd736044e..2dcb6c4190d4c5d4f282470c30c2bc7ef6c0dc1f 100644 (file)
@@ -89,11 +89,11 @@ private:
        /// The preemptive handler for feedback messages.
        void Feedback(FL_OBJECT *, int);
        /// Print a warning message and set warning flag.
-       void printWarning( string const & );
+       void printWarning(string const &);
        /** Launch a file dialog and modify input if it returns a new file.
            For an explanation of the various parameters, see xforms_helpers.h.
         */
-       void browse( FL_OBJECT * input,
+       void browse(FL_OBJECT * input,
                     string const & title, string const & pattern, 
                     std::pair<string,string> const & dir1= std::make_pair(string(),string()), 
                     std::pair<string,string> const & dir2 = std::make_pair(string(),string()));
@@ -156,7 +156,7 @@ private:
                        GUI_COLOR_CURSOR = FL_FREE_COL3
                };
                ///
-               Colors( FormPreferences & p );
+               Colors(FormPreferences & p);
                ///
                FD_form_colors const * dialog();
                ///
@@ -175,7 +175,7 @@ private:
 
        private:
                ///
-               void AdjustVal( int, int, double ) const;
+               void AdjustVal(int, int, double) const;
                ///
                void InputBrowserLyX() const;
                ///
@@ -208,7 +208,7 @@ private:
        class Converters {
        public:
                ///
-               Converters( FormPreferences & p );
+               Converters(FormPreferences & p);
                ///
                FD_form_converters const * dialog();
                ///
@@ -218,7 +218,7 @@ private:
                ///
                string const feedback(FL_OBJECT const * const) const;
                ///
-               bool input( FL_OBJECT const * const );
+               bool input(FL_OBJECT const * const);
                ///
                void update();
                ///
@@ -252,7 +252,7 @@ private:
        class Formats {
        public:
                ///
-               Formats( FormPreferences &  p );
+               Formats(FormPreferences &  p);
                ///
                FD_form_formats const * dialog();
                ///
@@ -262,7 +262,7 @@ private:
                ///
                string const feedback(FL_OBJECT const * const) const;
                ///
-               bool input( FL_OBJECT const * const );
+               bool input(FL_OBJECT const * const);
                ///
                void update();
 
@@ -290,7 +290,7 @@ private:
        class InputsMisc {
        public:
                ///
-               InputsMisc( FormPreferences &  p );
+               InputsMisc(FormPreferences &  p);
                ///
                FD_form_inputs_misc const * dialog();
                ///
@@ -315,7 +315,7 @@ private:
        class Interface {
        public:
                ///
-               Interface( FormPreferences &  p );
+               Interface(FormPreferences &  p);
                ///
                FD_form_interface const * dialog();
                ///
@@ -325,7 +325,7 @@ private:
                ///
                string const feedback(FL_OBJECT const * const) const;
                ///
-               bool input( FL_OBJECT const * const );
+               bool input(FL_OBJECT const * const);
                ///
                void update();
 
@@ -342,7 +342,7 @@ private:
        class Language {
        public:
                ///
-               Language( FormPreferences &  p );
+               Language(FormPreferences &  p);
                ///
                FD_form_language const * dialog();
                ///
@@ -352,7 +352,7 @@ private:
                ///
                string const feedback(FL_OBJECT const * const) const;
                ///
-               bool input( FL_OBJECT const * const );
+               bool input(FL_OBJECT const * const);
                ///
                void update();
                ///
@@ -373,7 +373,7 @@ private:
        class LnFmisc {
        public:
                ///
-               LnFmisc( FormPreferences &  p );
+               LnFmisc(FormPreferences &  p);
                ///
                FD_form_lnf_misc const * dialog();
                ///
@@ -398,7 +398,7 @@ private:
        class OutputsMisc {
        public:
                ///
-               OutputsMisc( FormPreferences &  p );
+               OutputsMisc(FormPreferences &  p);
                ///
                FD_form_outputs_misc const * dialog();
                ///
@@ -423,7 +423,7 @@ private:
        class Paths {
        public:
                ///
-               Paths( FormPreferences &  p );
+               Paths(FormPreferences &  p);
                ///
                FD_form_paths const * dialog();
                ///
@@ -450,7 +450,7 @@ private:
        class Printer {
        public:
                ///
-               Printer( FormPreferences &  p );
+               Printer(FormPreferences &  p);
                ///
                FD_form_printer const * dialog();
                ///
@@ -475,7 +475,7 @@ private:
        class ScreenFonts {
        public:
                ///
-               ScreenFonts( FormPreferences &  p );
+               ScreenFonts(FormPreferences &  p);
                ///
                FD_form_screen_fonts const * dialog();
                ///
@@ -502,7 +502,7 @@ private:
        class SpellOptions {
        public:
                ///
-               SpellOptions( FormPreferences &  p );
+               SpellOptions(FormPreferences &  p);
                ///
                FD_form_spelloptions const * dialog();
                ///
index 396c1399ebb6545af6d55713333660abee1687b7..97790852676ce535d728a5c91660e0500a15557f 100644 (file)
@@ -120,7 +120,7 @@ void FormSpellchecker::partialUpdate(int id)
                fl_set_input(dialog_->input, w.c_str());
                fl_set_object_label(dialog_->text, w.c_str());
                fl_clear_browser(dialog_->browser);
-               while ( !(w = controller().getSuggestion()).empty() ) {
+               while (!(w = controller().getSuggestion()).empty()) {
                        fl_add_browser_line(dialog_->browser, w.c_str());
                }
        }
index 9f9afcb501520f081e6bf1bf73cfd94e3d07e92d..4079decf545afb7a9745b99d93aa4b1368791926 100644 (file)
 #include "form_tabular.h"
 #include "LyXView.h"
 #include "Dialogs.h"
-#include "insets/insettabular.h"
 #include "buffer.h"
 #include "xforms_helpers.h"
 #include "lyxrc.h" // to set the default length values
 #include "helper_funcs.h"
 #include "input_validators.h"
+
+#include "insets/insettabular.h"
+
 #include "support/lstrings.h"
 
+#include <functional>
+
+
 using SigC::slot;
+using std::vector;
+using std::bind2nd;
+
 
 FormTabular::FormTabular(LyXView * lv, Dialogs * d)
        : FormInset(lv, d, _("Tabular Layout")),
@@ -45,7 +53,7 @@ FormTabular::FormTabular(LyXView * lv, Dialogs * d)
 
 void FormTabular::redraw()
 {
-       if(form() && form()->visible)
+       if (form() && form()->visible)
                fl_redraw_form(form());
        else
                return;
@@ -137,12 +145,21 @@ void FormTabular::build()
 
        // Create the contents of the unit choices
        // Don't include the "%" terms...
-       std::vector<string> units_vec = getLatexUnits();
-       for (std::vector<string>::iterator it = units_vec.begin();
+       vector<string> units_vec = getLatexUnits();
+#if 0
+       for (vector<string>::iterator it = units_vec.begin();
             it != units_vec.end(); ++it) {
                if (contains(*it, "%"))
                        it = units_vec.erase(it, it + 1) - 1;
        }
+#else
+       vector<string>::iterator ret =
+               remove_if(units_vec.begin(),
+                         units_vec.end(),
+                         bind2nd(contains_functor(), "%"));
+       units_vec.erase(ret, units_vec.end());
+#endif
+       
        string units = getStringFromVector(units_vec, "|");
 
        fl_addto_choice(column_options_->choice_value_column_width,
index 2ec372345c2f6a924f83a3a9e16833f32861ac1b..e7a297e7cdb005ece8cd73c67396bc685173756d 100644 (file)
 #include "form_tabular_create.h"
 #include "support/lstrings.h"
 
+
+using std::make_pair;
+
+
 typedef FormCB<ControlTabularCreate, FormDB<FD_form_tabular_create> > base_class;
 
 FormTabularCreate::FormTabularCreate(ControlTabularCreate & c)
@@ -53,5 +57,5 @@ void FormTabularCreate::apply()
        unsigned int ysize = (unsigned int)(fl_get_slider_value(dialog_->slider_columns) + 0.5);
        unsigned int xsize = (unsigned int)(fl_get_slider_value(dialog_->slider_rows) + 0.5);
 
-       controller().params() = std::make_pair(xsize, ysize);
+       controller().params() = make_pair(xsize, ysize);
 }
index 8efff8ca8d95ccffddd00946634918428f370034..75b32d911c3e7389941245c2951f59802b9ac4ee 100644 (file)
@@ -85,7 +85,7 @@ ButtonPolicy::SMInput FormTexinfo::input(FL_OBJECT * ob, long) {
                unsigned int selection = fl_get_browser(dialog_->browser);
                // a valid entry?
                if (selection > 0) {
-                       controller().viewFile( 
+                       controller().viewFile(
                                fl_get_browser_line(dialog_->browser,
                                                    selection));
                }
index b168ee56e1b8cdcd5f18e301e89a9c38836ed2cf..734a14ece9fcfe53ded6bad7a5c6eba89eb70c88 100644 (file)
 #include "form_thesaurus.h"
 #include "debug.h"
 
+
+using std::vector;
+
+
 typedef FormCB<ControlThesaurus, FormDB<FD_form_thesaurus> > base_class;
 
 FormThesaurus::FormThesaurus(ControlThesaurus & c)
@@ -65,17 +69,23 @@ void FormThesaurus::updateMeanings(string const & str)
        fl_freeze_form(form());
 
        Thesaurus::Meanings meanings = controller().getMeanings(str);
-       for (Thesaurus::Meanings::const_iterator cit = meanings.begin();
-               cit != meanings.end(); ++cit) {
-                       fl_add_browser_line(dialog_->browser_meanings, cit->first.c_str());
-                       for (std::vector<string>::const_iterator cit2 = cit->second.begin();
-                               cit2 != cit->second.end(); ++cit2) {
-                                       string ent = "   ";
-                                       ent += *cit2;
-                                       fl_add_browser_line(dialog_->browser_meanings, ent.c_str());
-                               }
+
+       Thesaurus::Meanings::const_iterator cit = meanings.begin();
+       Thesaurus::Meanings::const_iterator end = meanings.end();
+       for (; cit != end; ++cit) {
+               fl_add_browser_line(dialog_->browser_meanings,
+                                   cit->first.c_str());
+               
+               vector<string> const & tmpvec = cit->second;
+               vector<string>::const_iterator cit2 = tmpvec.begin();
+               vector<string>::const_iterator end2 = tmpvec.end();
+               for (; cit2 != end2; ++cit2) {
+                       string ent = "   ";
+                       ent += *cit2;
+                       fl_add_browser_line(dialog_->browser_meanings,
+                                           ent.c_str());
                }
+       }
  
        fl_unfreeze_form(form());
        fl_redraw_form(form());
@@ -92,10 +102,13 @@ void FormThesaurus::setReplace(string const & templ, string const & nstr)
        bool all_lower = true;
        bool all_upper = true;
 
-       for (string::const_iterator it = templ.begin(); it != templ.end(); ++it) {
-               if (isupper(*it))
+       string::const_iterator beg = templ.begin();
+       string::const_iterator end = templ.end();
+       string::const_iterator cit = beg;
+       for (; cit != end; ++cit) {
+               if (isupper(*cit))
                        all_lower = false;
-               if (islower(*it))
+               if (islower(*cit))
                        all_upper = false;
        }
 
@@ -105,9 +118,10 @@ void FormThesaurus::setReplace(string const & templ, string const & nstr)
                str = uppercase(nstr);
        } else if (templ.size() > 0 && isupper(templ[0])) {
                bool rest_lower = true;
-               for (string::const_iterator it = templ.begin() + 1;
-                       it != templ.end(); ++it) {
-                       if (isupper(*it))
+               string::const_iterator cit2 = beg + 1;
+               
+               for (; cit2 != end; ++cit2) {
+                       if (isupper(*cit2))
                                rest_lower = false;
                }
                
index c165545e79cddb6eeac2e30d521bce06b46ae2c5..11a5c322b2028f003101cefa4b20024475732fc8 100644 (file)
@@ -66,7 +66,7 @@ ButtonPolicy::SMInput FormToc::input(FL_OBJECT * ob, long)
  
        updateContents();
 
-       unsigned int const choice = fl_get_browser( dialog_->browser_toc );
+       unsigned int const choice = fl_get_browser(dialog_->browser_toc);
 
        if (choice - 1 < toclist_.size() && choice >= 1) {
                controller().Goto(toclist_[choice - 1].par->id());
@@ -134,7 +134,7 @@ void FormToc::updateContents()
                fl_get_browser_topline(dialog_->browser_toc);
        unsigned int const line = fl_get_browser(dialog_->browser_toc);
 
-       fl_clear_browser( dialog_->browser_toc );
+       fl_clear_browser(dialog_->browser_toc);
 
        Buffer::SingleList::const_iterator cit = toclist_.begin();
        Buffer::SingleList::const_iterator end = toclist_.end();
index 9d4305856ad91255adf62d93be521e0dc5756d73..423dd123063c57d55c64de96dfacdca05723ea46 100644 (file)
        If you want to try to compile anyway, delete this test in src/frontends/xforms/GUIRunTime.C.
 #endif
 
+
 using std::endl;
+using std::hex;
+
 
 extern bool finished;
 
@@ -74,8 +77,8 @@ void GUIRunTime::processEvents()
                XEvent ev;
                fl_XNextEvent(&ev);
                lyxerr << "Received unhandled X11 event" << endl;
-               lyxerr << "Type: 0x" << std::hex << ev.xany.type <<
-                       "Target: 0x" << std::hex << ev.xany.window << endl;
+               lyxerr << "Type: 0x" << hex << ev.xany.type <<
+                       "Target: 0x" << hex << ev.xany.window << endl;
        }
 }
 
@@ -87,8 +90,8 @@ void GUIRunTime::runTime()
                        XEvent ev;
                        fl_XNextEvent(&ev);
                        lyxerr << "Received unhandled X11 event" << endl;
-                       lyxerr << "Type: 0x" << std::hex << ev.xany.type <<
-                               "Target: 0x" << std::hex << ev.xany.window << endl;
+                       lyxerr << "Type: 0x" << hex << ev.xany.type <<
+                               "Target: 0x" << hex << ev.xany.window << endl;
                }
        }
 }
index 5c002c5251f9577e8aa630444ea4a756a176d2e2..896dc72350ff92d7f179350cec6838620c7679aa 100644 (file)
@@ -1,7 +1,7 @@
 AUTOMAKE_OPTIONS = foreign 1.4
 DISTCLEANFILES= *.orig *.rej *~ *.bak core
 MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
-noinst_LTLIBRARIES = libxforms.la
+noinst_LTLIBRARIES = libxforms.o
 BOOST_INCLUDES = -I$(top_srcdir)/boost
 INCLUDES = -I${top_srcdir}/images -I${top_srcdir}/src/ \
        -I${top_srcdir}/src/frontends/ \
@@ -12,7 +12,7 @@ LDFLAGS=
 LYXDATADIRS = forms
 ETAGS_ARGS = --lang=c++
 # Alphabetical order please.  It makes it easier to figure out what's missing. 
-libxforms_la_SOURCES = \
+libxforms_o_SOURCES = \
        Alert_pimpl.C \
        bmtable.c \
        bmtable.h \
@@ -205,7 +205,13 @@ libxforms_la_SOURCES = \
 #      GUI_runtime.C \
 #      GUI_applymenu.C
 
-libxforms_la_LIBADD = @LYX_LIBS@ @FRONTEND_LDFLAGS@ @FRONTEND_LIBS@
+libxforms_o_LIBADD = @LYX_LIBS@ @FRONTEND_LDFLAGS@ @FRONTEND_LIBS@
+
+libxforms.o: $(libxforms_o_OBJECTS) $(libxforms_o_DEPENDENCIES)
+       rm -f ../libxforms.objects
+       for fil in $(libxforms_o_OBJECTS) ; do \
+               echo xforms/$$fil >> ../libxforms.objects ; \
+       done
 
 # for convenience only
 updatesrc:
index 4f48be04aad09731417575226d81aa1cfde326e0..aa36561095d3cc5ddc9a106b79ad2280fd3172a7 100644 (file)
@@ -33,6 +33,7 @@ using std::endl;
 using std::vector;
 using std::max;
 using std::min;
+using std::for_each;
 
 typedef vector<int>::size_type size_type;
 
@@ -384,7 +385,7 @@ int Menubar::Pimpl::create_submenu(Window win, LyXView * view,
                                   string const & menu_name, 
                                   vector<int> & smn) 
 {
-       if (!menubackend_->hasMenu(menu_name)){ 
+       if (!menubackend_->hasMenu(menu_name)) 
                lyxerr << "ERROR:create_submenu: Unknown menu `" 
                       << menu_name << "'" << endl;
                return -1;
@@ -591,7 +592,7 @@ void Menubar::Pimpl::MenuCallback(FL_OBJECT * ob, long button)
                lyxerr << "Error in MenuCallback" << endl;
        }
        
-       std::for_each(submenus.begin(), submenus.end(), fl_freepup);
+       for_each(submenus.begin(), submenus.end(), fl_freepup);
        // restore tabstop length
        fl_set_tabstop(default_tabstop);
 
index 21fdb673b0b2fbd1606aba8014befb5820578718..007e77257059c448edfbc884ed3b4111cae242c5 100644 (file)
 
 #include <config.h> 
 
-#include <functional>
-#include <algorithm>
-#include <iterator>
-
 #ifdef __GNUG__
 #pragma implementation
 #endif 
 #include "RadioButtonGroup.h"
 
 #include "debug.h" // for lyxerr
+#include "support/lyxfunctional.h"
+
+//#include <functional>
+#include <algorithm>
+#include <iterator>
 
 using std::find_if;
-using std::bind2nd;
+//using std::bind2nd;
 using std::endl;
 
+
 void RadioButtonGroup::registerRadioButton(FL_OBJECT *button, int value)
 {
-       map.push_back( ButtonValuePair(button, value) );
+       map.push_back(ButtonValuePair(button, value));
 }
 
 
@@ -37,6 +39,8 @@ void RadioButtonGroup::reset()
        map.clear();
 }
 
+
+#if 0
 // Functor to help us in our work, we should try to find how to achieve
 // this with only STL predicates, but its easier to write this than to
 // dig. If you can find the equivalent STL predicate combination, let me
@@ -58,14 +62,22 @@ struct equal_to_second_in_pair
                return left.second == right;
        }
 };
+#endif
+
 
 void RadioButtonGroup::setButton(int value)
 {
+#if 0
        ButtonValueMap::const_iterator it =
            find_if(map.begin(), map.end(),
-                   bind2nd(equal_to_second_in_pair < ButtonValuePair > (),
+                   bind2nd(equal_to_second_in_pair<ButtonValuePair>(),
                            value));
-
+#else
+       ButtonValueMap::const_iterator it =
+               find_if(map.begin(), map.end(),
+                       lyx::equal_2nd_in_pair<ButtonValuePair>(value));
+#endif
+       
        // If we found nothing, report it and return
        if (it == map.end()) {
                lyxerr << "BUG: Requested value in RadioButtonGroup doesn't exists"
@@ -77,20 +89,22 @@ void RadioButtonGroup::setButton(int value)
 
 }
 
+
 template < typename T >
 struct is_set_button {
        bool operator() (T const & item) const
        {
-               return fl_get_button( (item).first );
+               return fl_get_button((item).first);
        }
 };
 
+
 int RadioButtonGroup::getButton()
 {
        // Find the first button that is active
        ButtonValueMap::iterator it =
            find_if(map.begin(), map.end(),
-                   is_set_button < ButtonValuePair > () );
+                   is_set_button<ButtonValuePair> ());
 
        // If such a button was found, return its value.
        if (it != map.end()) {
index ca3a9104ce184345d06dca8dcecd653e1bac7777..2b5623deb6a19e58200125eb7c1ad38c1fa51c7a 100644 (file)
@@ -22,9 +22,6 @@
 #pragma interface
 #endif 
 
-using std::vector;
-using std::pair;
-
 
 /** This class simplifies the work with a group of radio buttons,
  * the idea is that you register a bunch of radio buttons with the accompanying
@@ -38,7 +35,7 @@ public:
        RadioButtonGroup(unsigned n = 5) : map(n) {};
 
        /// Register a radio button with it's corresponding value.
-       void registerRadioButton(FL_OBJECT *button, int value);
+       void registerRadioButton(FL_OBJECT * button, int value);
        /// Reset registrations.
        void reset();
 
@@ -50,9 +47,9 @@ public:
 
 private:
        ///
-       typedef pair<FL_OBJECT *, int> ButtonValuePair;
+       typedef std::pair<FL_OBJECT *, int> ButtonValuePair;
        ///
-       typedef vector<ButtonValuePair> ButtonValueMap;
+       typedef std::vector<ButtonValuePair> ButtonValueMap;
        ///
        ButtonValueMap map;
 };
index 9d5471d3956fc28692f270ef6b5c90014eefb816..6bf013398c537dc34623149f3a9dac17b5c5e320 100644 (file)
@@ -130,13 +130,13 @@ int BubblePost(FL_OBJECT *ob, int event,
        FL_OBJECT * bubble_timer = reinterpret_cast<FL_OBJECT *>(ob->u_cdata);
        
        // We do not test for empty help here, since this can never happen
-       if (event == FL_ENTER){
+       if (event == FL_ENTER) {
                fl_set_object_callback(bubble_timer,
                                       C_Toolbar_BubbleTimerCB,
                                       reinterpret_cast<long>(ob));
                fl_set_timer(bubble_timer, 1);
        }
-       else if (event != FL_MOTION){
+       else if (event != FL_MOTION) {
                fl_set_timer(bubble_timer, 0);
                fl_hide_oneliner();
        }
@@ -390,7 +390,7 @@ void Toolbar::Pimpl::set(bool doingmain)
        ToolbarList::iterator item = toollist.begin();
        ToolbarList::iterator end = toollist.end();
        for (; item != end; ++item) {
-               switch (item->action){
+               switch (item->action) {
                case ToolbarDefaults::SEPARATOR:
                        xpos += sepspace;
                        break;
index ef82135d45bb36cfc7666346e388ff5e8766a6ad..022777504454bab6b74e0a829edc237af529bda9 100644 (file)
@@ -107,13 +107,13 @@ int TooltipHandler(FL_OBJECT *ob, int event)
        lyx::Assert(timer);
 
        // We do not test for empty help here, since this can never happen
-       if (event == FL_ENTER){
+       if (event == FL_ENTER) {
                fl_set_object_callback(timer,
                                       C_TooltipTimerCB,
                                       reinterpret_cast<long>(ob));
                fl_set_timer(timer, 1);
        }
-       else if (event != FL_MOTION){
+       else if (event != FL_MOTION) {
                fl_set_timer(timer, 0);
                fl_hide_oneliner();
        }
index 188b5cff716b80992f26489497ffaa5fcb2c233a..c4b30bbcfea36a0dc8421afa91bc1b659cb6c1fd 100644 (file)
@@ -235,7 +235,8 @@ void Combox::add(int x, int y, int w, int hmin, int hmax,
        FL_FORM * current_form = fl_current_form;
        fl_end_form();
 
-       bw = w + 20; bh = hmax - hmin - 12;
+       bw = w + 20;
+       bh = hmax - hmin - 12;
 
        form = fl_bgn_form(FL_NO_BOX, bw, bh);
        browser = obj = fl_add_browser(FL_HOLD_BROWSER, 0, 0, bw, bh, "");
@@ -291,14 +292,14 @@ void Combox::show()
                int folder_x, folder_y, folder_w, folder_h;
                fl_get_folder_area( tabfolder1,
                                    &folder_x, &folder_y,
-                                   &folder_w, &folder_h );
+                                   &folder_w, &folder_h);
                x += folder_x;
                y += folder_y;
 
                if (tabfolder2) {
                        fl_get_folder_area( tabfolder2,
                                            &folder_x, &folder_y,
-                                           &folder_w, &folder_h );
+                                           &folder_w, &folder_h);
                        x += tabfolder2->form->x + folder_x;
                        y += tabfolder2->form->y + folder_y;
                } else {
@@ -313,7 +314,7 @@ void Combox::show()
 
        fl_set_form_position(form, x, y);
        fl_show_form(form, FL_PLACE_POSITION, FL_NOBORDER, "");
-        if (sel>0) {
+        if (sel > 0) {
                fl_set_browser_topline(browser, sel);
                fl_select_browser_line(browser, sel);
        }
@@ -345,7 +346,7 @@ void Combox::hide(int who)
                XFlush(fl_get_display());
         }
        if (button) {
-               if (type != FL_COMBOX_NORMAL){
+               if (type != FL_COMBOX_NORMAL) {
                        fl_set_object_label(button, "@2->");
                        fl_redraw_object(button);
                }
index ea150ba2e27fea97877e1408eba54470995c0a75..2edbb87f75059b097f882491f28d1945a3114284 100644 (file)
@@ -318,7 +318,7 @@ string formatted(string const & sin, int w, int size, int style)
        }
 
        // Flush remaining contents of word
-       if (!word.empty() ) sentence.push_back(word);
+       if (!word.empty()) sentence.push_back(word);
 
        string line;
        string line_plus_word;
@@ -334,7 +334,7 @@ string formatted(string const & sin, int w, int size, int style)
                        line.erase();
                }
 
-               if (!line_plus_word.empty() ) line_plus_word += ' ';
+               if (!line_plus_word.empty()) line_plus_word += ' ';
                line_plus_word += word;
 
                int const length = fl_get_string_width(style, size,
index 918dfc2c67b8f38526df2ea9a59fd4f7bca016a2..a6ebdcc1cad1bbf750976541dcf7cf60313d2384 100644 (file)
 #pragma implementation
 #endif
 
-#include "graphics/GraphicsCache.h"
 #include "graphics/GraphicsCacheItem.h"
-#include "frontends/support/LyXImage.h"
+#include "graphics/GraphicsCache.h"
 #include "graphics/ImageLoaderXPM.h"
 #include "converter.h"
-#include "support/filetools.h"
-#include "support/lyxlib.h"
 #include "lyx_gui_misc.h"
 #include "debug.h"
 #include "support/LAssert.h"
 #include "gettext.h"
 #include "lyxfunc.h"
 
+#include "frontends/support/LyXImage.h"
+
+#include "support/filetools.h"
+#include "support/lyxlib.h"
+
 using std::endl;
 
+
 /*
  * The order of conversion:
  *
@@ -47,12 +50,10 @@ using std::endl;
 */
 
 GraphicsCacheItem::GraphicsCacheItem(string const & filename)
-       : imageStatus_(GraphicsCacheItem::Loading)
+       : filename_(filename), imageStatus_(GraphicsCacheItem::Loading)
 {
-       filename_ = filename;
-       
        bool success = convertImage(filename);
-       if (! success) // Conversion failed miserably (couldn't even start).
+       if (!success) // Conversion failed miserably (couldn't even start).
                setStatus(ErrorConverting);
 }
 
@@ -62,7 +63,10 @@ GraphicsCacheItem::~GraphicsCacheItem()
 
 
 GraphicsCacheItem::ImageStatus 
-GraphicsCacheItem::getImageStatus() const { return imageStatus_; }
+GraphicsCacheItem::getImageStatus() const
+{
+       return imageStatus_;
+}
 
 
 void GraphicsCacheItem::setStatus(ImageStatus new_status)
@@ -72,7 +76,10 @@ void GraphicsCacheItem::setStatus(ImageStatus new_status)
 
 
 LyXImage * 
-GraphicsCacheItem::getImage() const { return image_.get(); }
+GraphicsCacheItem::getImage() const
+{
+       return image_.get();
+}
 
 
 void GraphicsCacheItem::imageConverted(bool success)
@@ -112,7 +119,7 @@ string const findTargetFormat(string const & from)
        }
        if (iter == end) {
                // We do not know how to convert the image to something loadable.
-               lyxerr << "ERROR: Do not know how to convert image." << std::endl;
+               lyxerr << "ERROR: Do not know how to convert image." << endl;
                return string();
        }
        return (*iter);
@@ -124,6 +131,8 @@ string const findTargetFormat(string const & from)
 bool GraphicsCacheItem::convertImage(string const & filename)
 {
        setStatus(GraphicsCacheItem::Converting);
+#warning shadowing class variable (Lgb)
+       // Is this needed at all?
        string filename_ = string(filename);
        lyxerr << "try to convert image file: " << filename_ << endl;
 // maybe that other zip extensions also be useful, especially the
@@ -173,7 +182,7 @@ bool GraphicsCacheItem::convertImage(string const & filename)
        lyx::unlink(tempfile);
        if (zipped)
            lyx::unlink(filename_);
-       tempfile = string();
+       tempfile.erase();
        return true;
 }
 
index 720041ded53ef62d1cc2612dd852c440f9cc9401..94db3f947345f3ab30d00f02fbb5910679f3ef00 100644 (file)
@@ -7,31 +7,36 @@
  *
  * ================================================= */
 
+#include <config.h>
+
 #ifdef __GNUG__
 #pragma implementation
 #endif
 
-#include <config.h>
 #include "ImageLoaderXPM.h"
 #include "ColorHandler.h"
 #include "lyxrc.h"
+#include "debug.h"
+
 #include "frontends/support/LyXImage.h"
 #include "frontends/GUIRunTime.h"
+
 #include "support/filetools.h"
+#include "support/LAssert.h"
 
 #include XPM_H_LOCATION
 #include <iostream>
 #include <fstream>
 
-#include "support/LAssert.h"
-#include "debug.h"
 
+using std::ifstream;
 using std::endl;
 using std::ios;
 
+
 bool ImageLoaderXPM::isImageFormatOK(string const & filename) const
 {
-       std::ifstream is(filename.c_str(), ios::in);
+       ifstream is(filename.c_str(), ios::in);
 
        // The signature of the file without the spaces.
        static char const str[] = "/*XPM*/";
@@ -48,6 +53,7 @@ bool ImageLoaderXPM::isImageFormatOK(string const & filename) const
        return true;
 }
 
+
 ImageLoaderXPM::FormatList const 
 ImageLoaderXPM::loadableFormats() const 
 {
@@ -56,7 +62,8 @@ ImageLoaderXPM::loadableFormats() const
 
        return formats;
 }
-       
+
+
 ImageLoader::Result 
 ImageLoaderXPM::runImageLoader(string const & filename)
 {
index ce0b4c0b6444a8abd4bdc3deebff56a014ccc251..dd6d51661ecaa5bfa11e31f55592513170802c48 100644 (file)
@@ -1,13 +1,13 @@
 AUTOMAKE_OPTIONS = foreign
 DISTCLEANFILES= *.orig *.rej *~ *.bak core
 MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
-noinst_LTLIBRARIES = libgraphics.la
+noinst_LTLIBRARIES = libgraphics.o
 LIBS =
 ETAGS_ARGS = --lang=c++
 BOOST_INCLUDES = -I$(top_srcdir)/boost
 INCLUDES = -I${srcdir}/../ $(SIGC_CFLAGS) $(BOOST_INCLUDES)
 
-libgraphics_la_SOURCES = \
+libgraphics_o_SOURCES = \
        GraphicsCache.h \
        GraphicsCache.C \
        GraphicsCacheItem.h \
index da8fdf5063f879f9019d771be22a28b16f66e301..cdf429ea22951b613498d814fb4d6fd60e077803 100644 (file)
@@ -52,7 +52,7 @@ ExternalTemplateManager::ExternalTemplateManager()
 
 class dumpTemplate {
 public:
-       dumpTemplate(std::ostream & o) 
+       dumpTemplate(ostream & o) 
                : ost(o) {}
        void operator()(ExternalTemplateManager::Templates::value_type const & vt) {
                ExternalTemplate const & et = vt.second;
index 8ef545437a4c821d67731edc3f1fde438050239b..a2599e084497387f84c9ed9df69306acbd7c51a3 100644 (file)
@@ -1,7 +1,7 @@
 AUTOMAKE_OPTIONS = foreign
 DISTCLEANFILES= *.orig *.rej *~ *.bak core
 MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
-noinst_LTLIBRARIES = libinsets.la
+noinst_LTLIBRARIES = libinsets.o
 LIBS =
 ETAGS_ARGS = --lang=c++
 BOOST_INCLUDES = -I$(top_srcdir)/boost
@@ -15,7 +15,7 @@ EXTRA_DIST = \
        insettheorem.C \
        insettheorem.h
 
-libinsets_la_SOURCES = \
+libinsets_o_SOURCES = \
        ExternalTemplate.C \
        ExternalTemplate.h \
        figinset.C \
index 56898a86d5f0b129d33f3163c9450b85d49a2604..9bf32f5e6b47ba5a17f68a63a033ffbcb43e9815 100644 (file)
 
 #include <config.h>
 
-#include <fstream>
-#include <queue>
-#include <list>
-#include <algorithm>
-#include <vector>
-#include <utility>
-
-#include <unistd.h>
-#include <csignal>
-#include <sys/wait.h>
-
-#include FORMS_H_LOCATION
-#include <cstdlib>
-#include <cctype>
-#include <cmath>
-#include <cerrno>
-
 #include "figinset.h"
+
 #include "lyx_main.h"
 #include "buffer.h"
-#include "frontends/FileDialog.h"
-#include "support/filetools.h"
 #include "LyXView.h" // just because of form_main
 #include "debug.h"
 #include "LaTeXFeatures.h"
 #include "lyxrc.h"
 #include "gettext.h"
 #include "lyx_gui_misc.h" // CancelCloseBoxCB
-#include "frontends/Alert.h" 
-#include "support/FileInfo.h"
-#include "support/lyxlib.h"
-#include "support/os.h"
 #include "Painter.h"
 #include "font.h"
 #include "bufferview_funcs.h"
 #include "ColorHandler.h"
 #include "converter.h"
-#include "frontends/Dialogs.h" // redrawGUI
 #include "BufferView.h"
 
+#include "frontends/FileDialog.h"
+#include "frontends/Alert.h" 
+#include "frontends/Dialogs.h" // redrawGUI
+
+#include "support/FileInfo.h"
+#include "support/lyxlib.h"
+#include "support/os.h"
+#include "support/filetools.h"
+
+#include <fstream>
+#include <queue>
+#include <list>
+#include <algorithm>
+#include <vector>
+#include <utility>
+
+#include <unistd.h>
+#include <csignal>
+#include <sys/wait.h>
+#include <cstdlib>
+#include <cctype>
+#include <cmath>
+#include <cerrno>
+
 using std::ostream;
 using std::istream;
 using std::ofstream;
@@ -82,6 +83,7 @@ using std::copy;
 using std::pair;
 using std::make_pair;
 using std::ios;
+using std::ostream_iterator;
 
 #ifndef CXX_GLOBAL_CSTD
 using std::memcpy;
@@ -158,7 +160,7 @@ void addpidwait(int pid)
        if (lyxerr.debugging()) {
                lyxerr << "Pids to wait for: \n";
                copy(pidwaitlist.begin(), pidwaitlist.end(),
-                    std::ostream_iterator<int>(lyxerr, "\n"));
+                    ostream_iterator<int>(lyxerr, "\n"));
                lyxerr << flush;
        }
 }
@@ -419,10 +421,10 @@ void InitFigures()
                               vi->visualid, vi->c_class, 
                               vi->bits_per_rgb, vi->map_entries);
                }
-               color_visual = ( (vi->c_class == StaticColor) ||
+               color_visual = ((vi->c_class == StaticColor) ||
                                 (vi->c_class == PseudoColor) ||
                                 (vi->c_class == TrueColor) ||
-                                (vi->c_class == DirectColor) );
+                                (vi->c_class == DirectColor));
                if ((vi->c_class & 1) == 0) return;
                // now allocate colors
                if (vi->c_class == GrayScale) {
@@ -647,7 +649,7 @@ void runqueue()
                        env = new char_p[ne + 2];
                        string tmp = t2.str().c_str();
                        env[0] = new char[tmp.size() + 1];
-                       std::copy(tmp.begin(), tmp.end(), env[0]);
+                       copy(tmp.begin(), tmp.end(), env[0]);
                        env[0][tmp.size()] = '\0';
                        memcpy(&env[1], environ,
                               sizeof(char*) * (ne + 1));
@@ -1924,7 +1926,7 @@ void InsetFig::restoreForm()
        fl_set_input(form->Width, tostr(xwid).c_str());
        fl_set_input(form->Height, tostr(xhgh).c_str());
        fl_set_input(form->Angle, tostr(angle).c_str());
-       if (!fname.empty()){
+       if (!fname.empty()) {
                string buf1 = OnlyPath(owner->fileName());
                string fname2 = MakeRelPath(fname, buf1);
                fl_set_input(form->EpsFile, fname2.c_str());
index 73d70d95d159732a40900a35a60662969f2cb34a..02000371d9d5a224e689cc5fb3666ab50f025ed8 100644 (file)
@@ -7,6 +7,7 @@
 #ifndef FIGINSET_H
 #define FIGINSET_H
 
+#include FORMS_H_LOCATION
 #include "figure_form.h"
 #include "LString.h"
 #include "buffer.h"
index 6f25f38709d2751791399d9bd3ccdd2bbd3f1e8b..c8eba90eb3bfe80dd10e5e93b8149439b69f5a1c 100644 (file)
@@ -142,7 +142,7 @@ void Inset::id(int id_arg)
        id_ = id_arg;
 }
 
-void Inset::setFont(BufferView *, LyXFont const &, bool, bool )
+void Inset::setFont(BufferView *, LyXFont const &, bool, bool)
 {}
 
 
@@ -328,7 +328,7 @@ UpdatableInset::localDispatch(BufferView * bv,
 int UpdatableInset::getMaxWidth(BufferView * bv, UpdatableInset const *) const
 {
        int w;
-       if (owner()){
+       if (owner()) {
                w = static_cast<UpdatableInset*>
                        (owner())->getMaxWidth(bv, this);
        } else {
index 03adf891373dbe62b56fbbf2607684d9366ad8a4..d314ad7013c235f5c9cf0a11f710e4496a4bbb11 100644 (file)
@@ -252,7 +252,7 @@ vector<pair<string, string> > const InsetBibtex::getKeys(Buffer const * buffer)
                string linebuf0;
                while (getline(ifs, linebuf0)) {
                        string linebuf = frontStrip(strip(linebuf0));
-                       if (linebuf.empty() ) continue;
+                       if (linebuf.empty()) continue;
                        if (prefixIs(linebuf, "@")) {
                                linebuf = subst(linebuf, '{', '(');
                                string tmp;
index 7772349b6a31d32faf2864dceb26d6bf7ad8eba5..6eedb6df8ccf46d8bf539f5fe5370078359b374f 100644 (file)
 #include "BufferView.h"
 #include "LaTeXFeatures.h"
 #include "LyXView.h"
+
 #include "frontends/Dialogs.h"
+
 #include "support/lstrings.h"
 
+
+using std::ostream;
+
+
 InsetCitation::InsetCitation(InsetCommandParams const & p, bool)
        : InsetCommand(p)
 {}
@@ -36,7 +42,7 @@ string const InsetCitation::getScreenLabel(Buffer const *) const
                keys = frontStrip(split(keys, label, ',')) + ",";
 
                string::size_type const maxSize = 40;
-               while (contains( keys, "," )) {
+               while (contains(keys, ",")) {
                        string key;
                        keys = frontStrip(split(keys, key, ','));
 
@@ -68,7 +74,7 @@ void InsetCitation::edit(BufferView * bv, bool)
        edit(bv, 0, 0, 0);
 }
 
-int InsetCitation::ascii(Buffer const *, std::ostream & os, int) const
+int InsetCitation::ascii(Buffer const *, ostream & os, int) const
 {
         os << "[" << getContents() << "]";
         return 0;
@@ -78,7 +84,7 @@ int InsetCitation::ascii(Buffer const *, std::ostream & os, int) const
 // the \cite command is valid. Eg, the user has natbib enabled, inputs some
 // citations and then changes his mind, turning natbib support off. The output
 // should revert to \cite[]{}
-int InsetCitation::latex(Buffer const * buffer, std::ostream & os,
+int InsetCitation::latex(Buffer const * buffer, ostream & os,
                        bool /*fragile*/, bool/*fs*/) const
 {
        os << "\\";
index d05f943ba2b0cb38be9fc61640b08856d81d5047..e4015dd1cf24a5d968aec31aeb854c53e016e80d 100644 (file)
 #include "lyxfont.h"
 #include "BufferView.h"
 #include "Painter.h"
-#include "insets/insettext.h"
-#include "support/LOstream.h"
-#include "support/lstrings.h"
 #include "debug.h"
 #include "lyxtext.h"
 #include "font.h"
 #include "lyxlex.h"
 
-class LyXText;
+#include "insets/insettext.h"
 
+#include "support/LOstream.h"
+#include "support/lstrings.h"
+
+using std::vector;
 using std::ostream;
 using std::endl;
 using std::max;
 
 
+class LyXText;
+
+
 InsetCollapsable::InsetCollapsable(bool collapsed)
        : UpdatableInset(), collapsed_(collapsed), 
          button_length(0), button_top_y(0), button_bottom_y(0),
@@ -382,19 +386,19 @@ int InsetCollapsable::latex(Buffer const * buf, ostream & os,
 }
 
 
-int InsetCollapsable::ascii(Buffer const *buf, std::ostream & os, int ll) const
+int InsetCollapsable::ascii(Buffer const * buf, ostream & os, int ll) const
 {
        return inset.ascii(buf, os, ll);
 }
 
 
-int InsetCollapsable::linuxdoc(Buffer const *buf, std::ostream & os) const
+int InsetCollapsable::linuxdoc(Buffer const * buf, ostream & os) const
 {
        return inset.linuxdoc(buf, os);
 }
 
 
-int InsetCollapsable::docbook(Buffer const *buf, std::ostream & os) const
+int InsetCollapsable::docbook(Buffer const * buf, ostream & os) const
 {
        return inset.docbook(buf, os);
 }
@@ -564,7 +568,7 @@ void InsetCollapsable::resizeLyXText(BufferView * bv, bool force) const
 }
 
 
-std::vector<string> const InsetCollapsable::getLabelList() const
+vector<string> const InsetCollapsable::getLabelList() const
 {
        return inset.getLabelList();
 }
index cb40f395ea2c273ce5f86dce0795a15219caf33b..a5d2f391c5d230700939757af3c76fd4282d4bdd 100644 (file)
@@ -27,9 +27,9 @@ InsetCommandParams::InsetCommandParams()
 {}
 
 
-InsetCommandParams::InsetCommandParams( string const & n,
+InsetCommandParams::InsetCommandParams(string const & n,
                                        string const & c,
-                                       string const & o )
+                                       string const & o)
        : cmdname(n), contents(c), options(o)
 {}
 
@@ -40,7 +40,7 @@ string const InsetCommandParams::getAsString() const
 }
 
 
-void InsetCommandParams::setFromString( string const & b )
+void InsetCommandParams::setFromString(string const & b)
 {
        string::size_type idx = b.find("|++|");
        if (idx == string::npos) {
@@ -126,9 +126,9 @@ void InsetCommandParams::scanCommand(string const & cmd)
        }
 
        // Don't mess with this.
-       if (!tcmdname.empty())  setCmdName( tcmdname );
-       if (!toptions.empty())  setOptions( toptions );
-       if (!tcontents.empty()) setContents( tcontents ); 
+       if (!tcmdname.empty())  setCmdName(tcmdname);
+       if (!toptions.empty())  setOptions(toptions);
+       if (!tcontents.empty()) setContents(tcontents); 
 
        if (lyxerr.debugging(Debug::PARSER))
                lyxerr << "Command <" <<  cmd
@@ -181,15 +181,15 @@ string const InsetCommandParams::getCommand() const
 
 
 InsetCommand::InsetCommand(InsetCommandParams const & p, bool)
-       : p_( p.getCmdName(), p.getContents(), p.getOptions() )
+       : p_(p.getCmdName(), p.getContents(), p.getOptions())
 {}
 
 
-void InsetCommand::setParams(InsetCommandParams const & p )
+void InsetCommand::setParams(InsetCommandParams const & p)
 {
-       p_.setCmdName( p.getCmdName() );
-       p_.setContents( p.getContents() );
-       p_.setOptions( p.getOptions() );
+       p_.setCmdName(p.getCmdName());
+       p_.setContents(p.getContents());
+       p_.setOptions(p.getOptions());
 }
 
 
index c0aeaa615b6c36d38c232545c5020ad724119f2a..6428e667fd006611b40e9b12438cebb3777e6f71 100644 (file)
@@ -32,7 +32,7 @@ public:
        InsetCommandParams();
        ///
        explicit
-       InsetCommandParams( string const & n,
+       InsetCommandParams(string const & n,
                            string const & c = string(),
                            string const & o = string());
        ///
@@ -54,7 +54,7 @@ public:
        ///
        string const & getContents() const { return contents; }
        ///
-       void setCmdName( string const & n) { cmdname = n; }
+       void setCmdName(string const & n) { cmdname = n; }
        ///
        void setOptions(string const & o) { options = o; }
        ///
@@ -62,7 +62,7 @@ public:
        ///
        string const getAsString() const;
        ///
-       void setFromString( string const & );
+       void setFromString(string const &);
 private:
        ///    
        string cmdname;
@@ -83,12 +83,12 @@ public:
        virtual ~InsetCommand() { hideDialog(); }
        ///
        void write(Buffer const *, std::ostream & os) const
-               { p_.write( os ); }
+               { p_.write(os); }
        ///
        virtual void read(Buffer const *, LyXLex & lex)
-               { p_.read( lex ); }
+               { p_.read(lex); }
        /// Can remove one InsetBibKey is modified
-       void scanCommand(string const & c) { p_.scanCommand( c ); };
+       void scanCommand(string const & c) { p_.scanCommand(c); };
        /// 
        virtual int latex(Buffer const *, std::ostream &,
                          bool fragile, bool free_spc) const;
index 611558bcb4642928da13c1090e36908b2b7ebe68..cd4b51737c3d6bfcb4c3ceac13f4cad805d1849b 100644 (file)
@@ -88,7 +88,7 @@ string const InsetError::editMessage() const
 
 void InsetError::edit(BufferView * bv, int, int, unsigned int)
 {
-       bv->owner()->getDialogs()->showError( this );
+       bv->owner()->getDialogs()->showError(this);
 }
 
 
index 9f3ba06f301659851ae2429739ac9c8cc51dc235..9daea852d7b7aee8c56c8d537e6cb369fef6ae35 100644 (file)
 
 #include "support/LOstream.h"
 
+
 using std::ostream;
+using std::min;
+using std::endl;
+
 using lyx::pos_type;
 
 
@@ -125,7 +129,7 @@ void InsetERT::read(Buffer const * buf, LyXLex & lex)
                        token_found = true;
                } else {
                        lyxerr << "InsetERT::Read: Missing 'status'-tag!"
-                                  << std::endl;
+                                  << endl;
                        // take countermeasures
                        lex.pushToken(token);
                }
@@ -179,7 +183,7 @@ void InsetERT::write(Buffer const * buf, ostream & os) const
 {
        string st;
 
-       switch(status_) {
+       switch (status_) {
        case Open: 
                st = "Open";
                break;
@@ -207,7 +211,7 @@ void InsetERT::write(Buffer const * buf, ostream & os) const
                        case Paragraph::META_INSET:
                        case Paragraph::META_HFILL:
                                lyxerr << "Element is not allowed in insertERT"
-                                      << std::endl;
+                                      << endl;
                        case Paragraph::META_NEWLINE:
                                os << "\n\\newline \n";
                                break;
@@ -343,7 +347,7 @@ void InsetERT::insetMotionNotify(BufferView * bv,
 }
 
 
-int InsetERT::latex(Buffer const *, std::ostream & os, bool /*fragile*/,
+int InsetERT::latex(Buffer const *, ostream & os, bool /*fragile*/,
                    bool /*free_spc*/) const
 {
        Paragraph * par = inset.paragraph();
@@ -374,13 +378,13 @@ int InsetERT::latex(Buffer const *, std::ostream & os, bool /*fragile*/,
 
 
 int InsetERT::ascii(Buffer const *,
-                   std::ostream &, int /*linelen*/) const 
+                   ostream &, int /*linelen*/) const 
 {
        return 0;
 }
 
 
-int InsetERT::linuxdoc(Buffer const *, std::ostream & os) const
+int InsetERT::linuxdoc(Buffer const *, ostream & os) const
 {
        Paragraph * par = inset.paragraph();
        int lines = 0;
@@ -409,7 +413,7 @@ int InsetERT::linuxdoc(Buffer const *, std::ostream & os) const
 }
 
 
-int InsetERT::docbook(Buffer const *, std::ostream & os) const
+int InsetERT::docbook(Buffer const *, ostream & os) const
 {
        Paragraph * par = inset.paragraph();
        int lines = 0;
@@ -447,14 +451,14 @@ InsetERT::localDispatch(BufferView * bv, kb_action action, string const & arg)
                set_latex_font(bv);
        }
 
-       switch(action) {
+       switch (action) {
        case LFUN_LAYOUT:
                bv->owner()->setLayout(inset.paragraph()->getLayout());
                break;
        default:
                result = InsetCollapsable::localDispatch(bv, action, arg);
        }
-       switch(action) {
+       switch (action) {
        case LFUN_BREAKPARAGRAPH:
        case LFUN_BREAKPARAGRAPHKEEPLAYOUT:
        case LFUN_BACKSPACE:
@@ -478,7 +482,7 @@ string const InsetERT::get_new_label() const
        string la;
        pos_type const max_length = 15;
        pos_type const p_siz = inset.paragraph()->size();
-       pos_type const n = std::min(max_length, p_siz);
+       pos_type const n = min(max_length, p_siz);
        int i = 0;
        int j = 0;
        for(; i < n && j < p_siz; ++j) {
@@ -617,7 +621,7 @@ void InsetERT::status(BufferView * bv, ERTStatus const st) const
 {
        if (st != status_) {
                status_ = st;
-               switch(st) {
+               switch (st) {
                case Inlined:
                        inset.setAutoBreakRows(false);
                        break;
index 0349abad2bfc46bab2c6a12d49a2d5426dd3a071..c358447417ca0000761f84d3102c22b728563252 100644 (file)
 #pragma implementation
 #endif
 
-#include <cstdio>
-#include <utility>
-
 #include "insetexternal.h"
 #include "ExternalTemplate.h"
 #include "BufferView.h"
 #include "buffer.h"
 #include "LyXView.h"
-#include "frontends/Dialogs.h"
 #include "lyx_main.h"
 #include "LaTeXFeatures.h"
+#include "gettext.h"
+#include "debug.h"
+
+#include "frontends/Dialogs.h"
+
 #include "support/filetools.h"
 #include "support/lstrings.h"
 #include "support/path.h"
 #include "support/syscall.h"
-#include "gettext.h"
-#include "debug.h"
 #include "support/FileInfo.h"
 
+#include <cstdio>
+#include <utility>
+
+
+using std::ostream;
 using std::endl;
 
+
 InsetExternal::InsetExternal() 
        : view_(0)
 {
@@ -85,10 +90,10 @@ void InsetExternal::edit(BufferView * bv, bool)
 }
 
 
-void InsetExternal::write(Buffer const *, std::ostream & os) const
+void InsetExternal::write(Buffer const *, ostream & os) const
 {
-       os << "External " << params_.templ.lyxName << ",\"" << params_.filename 
-          << "\",\"" << params_.parameters << "\"\n";
+       os << "External " << params_.templ.lyxName << ",\""
+          << params_.filename << "\",\"" << params_.parameters << "\"\n";
 }
 
 
@@ -129,15 +134,15 @@ void InsetExternal::read(Buffer const *, LyXLex & lex)
 
 
 int InsetExternal::write(string const & format,
-                        Buffer const * buf, std::ostream & os) const
+                        Buffer const * buf, ostream & os) const
 {
        ExternalTemplate const & et = params_.templ;
        ExternalTemplate::Formats::const_iterator cit =
                et.formats.find(format);
        if (cit == et.formats.end()) {
                lyxerr << "External template format '" << format
-                      << "' not specified in template " << params_.templ.lyxName
-                      << endl;
+                      << "' not specified in template "
+                      << params_.templ.lyxName << endl;
                return 0;
        }
        
@@ -148,25 +153,25 @@ int InsetExternal::write(string const & format,
 
 
 int InsetExternal::latex(Buffer const * buf,
-                        std::ostream & os, bool, bool) const
+                        ostream & os, bool, bool) const
 {
        return write("LaTeX", buf, os);
 }
 
 
-int InsetExternal::ascii(Buffer const * buf, std::ostream & os, int) const
+int InsetExternal::ascii(Buffer const * buf, ostream & os, int) const
 {
        return write("Ascii", buf, os);
 }
 
 
-int InsetExternal::linuxdoc(Buffer const * buf, std::ostream & os) const
+int InsetExternal::linuxdoc(Buffer const * buf, ostream & os) const
 {
        return write("LinuxDoc", buf, os);
 }
 
 
-int InsetExternal::docbook(Buffer const * buf, std::ostream & os) const
+int InsetExternal::docbook(Buffer const * buf, ostream & os) const
 {
        return write("DocBook", buf, os);
 }
@@ -225,7 +230,7 @@ void InsetExternal::executeCommand(string const & s,
 
 
 string const InsetExternal::doSubstitution(Buffer const * buffer,
-                                    string const & s) const
+                                          string const & s) const
 {
        string result;
        string const basename = ChangeExtension(params_.filename, string());
index b51064490b5b1f910fc329fa6d60943d11dcadee..8d2c565f094cfedad4a40994294d6208c7612f2e 100644 (file)
 #include "gettext.h"
 #include "debug.h"
 
+
+using std::ostream;
 using std::endl;
 
+
 InsetFloatList::InsetFloatList()
        : InsetCommand(InsetCommandParams())
 {
@@ -45,7 +48,7 @@ Inset::Code InsetFloatList::lyxCode() const
 }
 
 
-void InsetFloatList::write(Buffer const *, std::ostream & os) const
+void InsetFloatList::write(Buffer const *, ostream & os) const
 {
        os << "FloatList " << getCmdName() << "\n";
 }
@@ -85,7 +88,7 @@ void InsetFloatList::edit(BufferView * bv, bool)
 }
 
 
-int InsetFloatList::latex(Buffer const *, std::ostream & os, bool, bool) const
+int InsetFloatList::latex(Buffer const *, ostream & os, bool, bool) const
 {
        FloatList::const_iterator cit = floatList[getCmdName()];
 
@@ -112,7 +115,7 @@ int InsetFloatList::latex(Buffer const *, std::ostream & os, bool, bool) const
 }
 
 
-int InsetFloatList::ascii(Buffer const * buffer, std::ostream & os, int) const
+int InsetFloatList::ascii(Buffer const * buffer, ostream & os, int) const
 {
        os << getScreenLabel(buffer) << "\n\n";
 
index a9a103db497d6d5451ef5559a55c431a759c1f08..a2297b6cd9133aee05ea456eb6f32c6a1dc16b6e 100644 (file)
@@ -24,6 +24,9 @@
 #include "debug.h"
 
 
+using std::ostream;
+
+
 InsetFoot::InsetFoot()
        : InsetFootlike()
 {
@@ -53,7 +56,7 @@ string const InsetFoot::editMessage() const
 
 
 int InsetFoot::latex(Buffer const * buf,
-                    std::ostream & os, bool fragile, bool fp) const
+                    ostream & os, bool fragile, bool fp) const
 {
        os << "%\n\\footnote{";
        
index edfd20dafbfde25e8841302eeef8e640de810b2e..fcbe711ba726fd024de2623296a59d577c1a6703 100644 (file)
@@ -21,6 +21,9 @@
 #include "support/LOstream.h"
 
 
+using std::ostream;
+
+
 InsetFootlike::InsetFootlike()
        : InsetCollapsable()
 {
@@ -43,7 +46,7 @@ InsetFootlike::InsetFootlike(InsetFootlike const & in, bool same_id)
 }
 
 
-void InsetFootlike::write(Buffer const * buf, std::ostream & os) const 
+void InsetFootlike::write(Buffer const * buf, ostream & os) const 
 {
        os << getInsetName() << "\n";
        InsetCollapsable::write(buf, os);
index 1373eedb337dbc3e9767b961b71b463dda95f586..e670ddda5e56ac29bb9c16e2a67a14d2ee847d7c 100644 (file)
@@ -91,39 +91,44 @@ TODO Before initial production release:
 
 #include "insets/insetgraphics.h"
 #include "insets/insetgraphicsParams.h"
+
 #include "graphics/GraphicsCache.h"
 #include "graphics/GraphicsCacheItem.h"
 
-#include "frontends/Dialogs.h"
-#include "frontends/Alert.h"
 #include "LyXView.h"
 #include "buffer.h"
 #include "BufferView.h"
 #include "converter.h"
-#include "frontends/support/LyXImage.h"
 #include "Painter.h"
 #include "lyx_gui_misc.h"
-#include "support/FileInfo.h"
-#include "support/filetools.h"
-#include "support/lyxalgo.h" // lyx::count
-#include "support/lyxlib.h"
-#include "frontends/controllers/helper_funcs.h"
 #include "lyxtext.h"
 #include "lyxrc.h"
-#include "font.h" // For the lyxfont class.
-#include "fstream" // for ifstream in isEPS
-#include <algorithm> // For the std::max
-#include "support/lyxmanip.h"
+#include "font.h"
 #include "debug.h"
 #include "gettext.h"
-//#include "LOStream.h"
+
+#include "frontends/Dialogs.h"
+#include "frontends/Alert.h"
+#include "frontends/controllers/helper_funcs.h"
+#include "frontends/support/LyXImage.h"
+
+#include "support/FileInfo.h"
+#include "support/filetools.h"
+#include "support/lyxlib.h"
+#include "support/lyxmanip.h"
 #include "support/lyxalgo.h"
 
+#include <fstream>
+#include <algorithm>
+
 extern string system_tempdir;
 
 using std::ifstream;
 using std::ostream;
 using std::endl;
+using std::max;
+using std::vector;
+
 
 ///////////////////////////////////////////////////////////////////////////
 int const VersionNumber = 1;
@@ -230,10 +235,10 @@ int InsetGraphics::width(BufferView *, LyXFont const & font) const
                if (!msg.empty()) {
                        msgFont.setSize(LyXFont::SIZE_TINY);
                        int const msg_width = lyxfont::width(msg, msgFont);
-                       font_width = std::max(font_width, msg_width);
+                       font_width = max(font_width, msg_width);
                }
                
-               return std::max(50, font_width + 15);
+               return max(50, font_width + 15);
        }
 }
 
@@ -342,7 +347,7 @@ void InsetGraphics::readInsetGraphics(Buffer const * buf, LyXLex & lex)
 
                string const token = lex.getString();
                lyxerr[Debug::INFO] << "Token: '" << token << '\'' 
-                                   << std::endl;
+                                   << endl;
 
                if (token.empty()) {
                        continue;
@@ -356,13 +361,13 @@ void InsetGraphics::readInsetGraphics(Buffer const * buf, LyXLex & lex)
                                << "This document was created with a newer Graphics widget"
                                ", You should use a newer version of LyX to read this"
                                " file."
-                               << std::endl;
+                               << endl;
                        // TODO: Possibly open up a dialog?
                }
                else {
                        if (! params.Read(buf, lex, token))
                                lyxerr << "Unknown token, " << token << ", skipping." 
-                                       << std::endl;
+                                       << endl;
                }
        }
 }
@@ -370,7 +375,7 @@ void InsetGraphics::readInsetGraphics(Buffer const * buf, LyXLex & lex)
 // FormatVersion < 1.0  (LyX < 1.2)
 void InsetGraphics::readFigInset(Buffer const * buf, LyXLex & lex)
 {
-       std::vector<string> const oldUnits =
+       vector<string> const oldUnits =
                getVectorFromString("pt,cm,in,p%,c%");
        bool finished = false;
        // set the display default      
index 94aa851d5b1d0fd6ead4cd8873424590373828e2..405368d2fff93711a48d207ddd486cf875bf461a 100644 (file)
 #endif 
 
 #include "insetgraphicsParams.h"
+
 #include "support/translator.h"
 #include "support/filetools.h"
 #include "support/lyxlib.h"
 #include "support/LOstream.h"
 #include "support/LAssert.h"
 
+
+using std::ostream;
+
+
 namespace {
 
 /// This variable keeps a tab on whether the translator was set with the
@@ -164,7 +169,7 @@ bool operator==(InsetGraphicsParams const & left,
                left.rotateOrigin == right.rotateOrigin &&
                lyx::float_equal(left.rotateAngle, right.rotateAngle, 0.001 &&
                left.special == right.special) 
-          )
+         )
                return true;
 
        return false;
index c218d0ecb4b2f16d169801d0f8266e58a5dd6374..130e530646a10d7fe611887922295b4f79752c6b 100644 (file)
@@ -22,8 +22,6 @@
 #include "buffer.h"
 #include "lyxlex.h"
 
-using std::ostream;
-
 /// This struct holds all the parameters needed by insetGraphics.
 struct InsetGraphicsParams
 {
@@ -90,7 +88,7 @@ struct InsetGraphicsParams
        ///
        InsetGraphicsParams & operator=(InsetGraphicsParams const &);
        /// Save the parameters in the LyX format stream.
-       void Write(Buffer const * buf, ostream & os) const;
+       void Write(Buffer const * buf, std::ostream & os) const;
        /// If the token belongs to our parameters, read it.
        bool Read(Buffer const * buf, LyXLex & lex, string const & token);
 
index 31609e076b073ba59725acab0e1a3e52fda0fdf4..4631d94ce587596beeae0149c5920ade38c8fbe6 100644 (file)
@@ -295,7 +295,7 @@ int InsetInclude::latex(Buffer const * buffer, ostream & os,
 }
 
 
-int InsetInclude::ascii(Buffer const *, std::ostream & os, int) const
+int InsetInclude::ascii(Buffer const *, ostream & os, int) const
 {
        if (isVerbatim())
                os << GetFileContents(getFileName());
index 02498e2be3c88ded7f6114b28b09444a9a708e5e..486aeb23111eb845002f76c2d95d5f78f60f3c40 100644 (file)
@@ -27,7 +27,7 @@ string const InsetIndex::getScreenLabel(Buffer const *) const
 
 void InsetIndex::edit(BufferView * bv, int, int, unsigned int)
 {
-       bv->owner()->getDialogs()->showIndex( this );
+       bv->owner()->getDialogs()->showIndex(this);
 }
 
 
index 5321f006ec78ffe8539f410fb058b6a68fc82c09..a7cc82eb0a2061db79a51636950434e99e42336f 100644 (file)
@@ -548,7 +548,7 @@ void InsetLatexAccent::draw(BufferView * bv, LyXFont const & font0,
                case UMLAUT:    // umlaut
                {
                        pain.text(int(x2 - (lyxfont::rbearing('¨', font) - lyxfont::lbearing('¨', font)) / 2),
-                                 baseline - lyxfont::ascent(ic, font) - lyxfont::descent('¨', font) - ( lyxfont::ascent('¨', font) + lyxfont::descent('¨', font)) / 2,
+                                 baseline - lyxfont::ascent(ic, font) - lyxfont::descent('¨', font) - (lyxfont::ascent('¨', font) + lyxfont::descent('¨', font)) / 2,
                                  '¨', font);
                        break;
                }
index 201c333a7ca6af9f0d907e4f0441d55be98af7a1..1a0eb1b5bece05e73a06a2be8b4033ca650be9d9 100644 (file)
@@ -24,6 +24,9 @@
 #include "debug.h"
 
 
+using std::ostream;
+
+
 InsetMarginal::InsetMarginal()
        : InsetFootlike()
 {
@@ -53,7 +56,7 @@ string const InsetMarginal::editMessage() const
 
 
 int InsetMarginal::latex(Buffer const * buf,
-                        std::ostream & os, bool fragile, bool fp) const
+                        ostream & os, bool fragile, bool fp) const
 {
        os << "%\n\\marginpar{";
        
index b35e77e7c7fb81362afe5efa3f48865ace07c28d..b6fccf4831454812d9da9976dabb845714e76d86 100644 (file)
@@ -25,11 +25,11 @@ InsetRef::InsetRef(InsetCommandParams const & p, Buffer const & buf, bool)
 void InsetRef::edit(BufferView * bv, int, int, unsigned int button)
 {
        // Eventually trigger dialog with button 3 not 1
-       if (button == 3 )
+       if (button == 3)
                bv->owner()->getLyXFunc()->
                        dispatch(LFUN_REF_GOTO, getContents());
-       else if (button == 1 )
-               bv->owner()->getDialogs()->showRef( this );
+       else if (button == 1)
+               bv->owner()->getDialogs()->showRef(this);
 }
 
 
@@ -63,7 +63,7 @@ int InsetRef::latex(Buffer const *, ostream & os,
        if (getOptions().empty())
                os << escape(getCommand());
        else {
-               InsetCommandParams p( getCmdName(), getContents(), "" );
+               InsetCommandParams p(getCmdName(), getContents(), "");
                os << escape(p.getCommand());
        }
        return 0;
index c504aa15ff5299e79a363437ba60731cfcf62cbe..2c4163911bb5c19501d9cc732d15898d0dcfa935 100644 (file)
@@ -48,6 +48,8 @@
 #include <map>
 //#include <signal.h>
 
+
+using std::vector;
 using std::ostream;
 using std::ifstream;
 using std::max;
@@ -1112,7 +1114,7 @@ InsetTabular::localDispatch(BufferView * bv, kb_action action,
 
                        while (p < len &&
                              ((p = clip.find_first_of("\t\n", p)) != string::npos)) {
-                               switch(clip[p]) {
+                               switch (clip[p]) {
                                case '\t':
                                        ++cols;
                                        break;
@@ -1136,7 +1138,7 @@ InsetTabular::localDispatch(BufferView * bv, kb_action action,
                              (p = clip.find_first_of("\t\n", p)) != string::npos) {
                                if (p >= len)
                                        break;
-                               switch(clip[p]) {
+                               switch (clip[p]) {
                                case '\t':
                                        paste_tabular->GetCellInset(cell)->setText(clip.substr(op, p-op));
                                        ++cols;
@@ -2352,7 +2354,7 @@ FuncStatus InsetTabular::getStatus(string const & what) const
 }
 
 
-std::vector<string> const InsetTabular::getLabelList() const
+vector<string> const InsetTabular::getLabelList() const
 {
        return tabular->getLabelList();
 }
@@ -2468,7 +2470,7 @@ bool InsetTabular::cutSelection()
 }
 
 
-bool InsetTabular::isRightToLeft(BufferView *bv )
+bool InsetTabular::isRightToLeft(BufferView * bv)
 {
        return bv->getParentLanguage(this)->RightToLeft();
 }
index 5c866725c636017dd8b2b46115163e6a654af820..8889f2869eaf74df095728353ab3e7f85d664d23 100644 (file)
@@ -62,6 +62,7 @@ using std::min;
 using std::max;
 using std::make_pair;
 using std::vector;
+using std::pair;
 
 using lyx::pos_type;
 using lyx::layout_type;
@@ -1086,7 +1087,7 @@ InsetText::localDispatch(BufferView * bv,
                        updateLocal(bv, CURSOR_PAR, false);
                        return result;
                } else if (result >= FINISHED) {
-                       switch(result) {
+                       switch (result) {
                        case FINISHED_RIGHT:
                                moveRightIntern(bv, false, false);
                                result = DISPATCHED;
@@ -1320,7 +1321,7 @@ InsetText::localDispatch(BufferView * bv,
                        // Derive layout number from given argument (string)
                        // and current buffer's textclass (number). */    
                        textclass_type tclass = bv->buffer()->params.textclass;
-                       std::pair <bool, layout_type> layout = 
+                       pair<bool, layout_type> layout = 
                                textclasslist.NumberOfLayout(tclass, arg);
 
                        // If the entry is obsolete, use the new one instead.
@@ -1524,7 +1525,7 @@ int InsetText::docbook(Buffer const * buf, ostream & os) const
                        }
 
                        if (environment_stack[depth] != style.latexname()) {
-                               if(environment_stack.size() == depth + 1) {
+                               if (environment_stack.size() == depth + 1) {
                                        environment_stack.push_back("!-- --");
                                        environment_inner.push_back("!-- --");
                                }
@@ -1547,7 +1548,7 @@ int InsetText::docbook(Buffer const * buf, ostream & os) const
                        
                        if (style.latextype == LATEX_ENVIRONMENT) {
                                if (!style.latexparam().empty()) {
-                                       if(style.latexparam() == "CDATA")
+                                       if (style.latexparam() == "CDATA")
                                                os << "<![CDATA[";
                                        else
                                                buf->sgmlOpenTag(os, depth + command_depth,
@@ -1591,7 +1592,7 @@ int InsetText::docbook(Buffer const * buf, ostream & os) const
                switch (style.latextype) {
                case LATEX_ENVIRONMENT:
                        if (!style.latexparam().empty()) {
-                               if(style.latexparam() == "CDATA")
+                               if (style.latexparam() == "CDATA")
                                        os << "]]>";
                                else
                                        buf->sgmlCloseTag(os, depth + command_depth,
@@ -1882,16 +1883,16 @@ bool InsetText::showInsetDialog(BufferView * bv) const
 }
 
 
-std::vector<string> const InsetText::getLabelList() const 
+vector<string> const InsetText::getLabelList() const 
 {
-       std::vector<string> label_list;
+       vector<string> label_list;
 
        Paragraph * tpar = par;
        while (tpar) {
                Paragraph::inset_iterator beg = tpar->inset_iterator_begin();
                Paragraph::inset_iterator end = tpar->inset_iterator_end();
                for (; beg != end; ++beg) {
-                       std::vector<string> const l = (*beg)->getLabelList();
+                       vector<string> const l = (*beg)->getLabelList();
                        label_list.insert(label_list.end(), l.begin(), l.end());
                }
                tpar = tpar->next();
index 5c52074cfad642178a534d920c599731e72f4676..c93c62e26acb11e63787d4aa6b65eab0022a139d 100644 (file)
 #include "debug.h"
 #include "buffer.h"
 
+
 using std::vector;
+using std::ostream;
+
 
 string const InsetTOC::getScreenLabel(Buffer const *) const 
 {
@@ -45,7 +48,7 @@ void InsetTOC::edit(BufferView * bv, bool)
 }
 
 
-int InsetTOC::ascii(Buffer const * buffer, std::ostream & os, int) const
+int InsetTOC::ascii(Buffer const * buffer, ostream & os, int) const
 {
        os << getScreenLabel(buffer) << "\n\n";
 
@@ -69,7 +72,7 @@ int InsetTOC::ascii(Buffer const * buffer, std::ostream & os, int) const
 }
 
 
-int InsetTOC::linuxdoc(Buffer const *, std::ostream & os) const
+int InsetTOC::linuxdoc(Buffer const *, ostream & os) const
 {
        if (getCmdName() == "tableofcontents")
                os << "<toc>";
@@ -77,7 +80,7 @@ int InsetTOC::linuxdoc(Buffer const *, std::ostream & os) const
 }
 
 
-int InsetTOC::docbook(Buffer const *, std::ostream & os) const
+int InsetTOC::docbook(Buffer const *, ostream & os) const
 {
        if (getCmdName() == "tableofcontents")
                os << "<toc></toc>";
index 58bd309f5e502144fe91d6df16abf01c04fc9529..848584044fbc0508b1678230eac65aaeacd97637 100644 (file)
@@ -23,7 +23,7 @@ InsetUrl::InsetUrl(InsetCommandParams const & p, bool)
 
 void InsetUrl::edit(BufferView * bv, int, int, unsigned int)
 {
-       bv->owner()->getDialogs()->showUrl( this );
+       bv->owner()->getDialogs()->showUrl(this);
 }
 
 
@@ -36,7 +36,7 @@ void InsetUrl::edit(BufferView * bv, bool)
 string const InsetUrl::getScreenLabel(Buffer const *) const
 {
        string temp;
-       if (getCmdName() == "url" )
+       if (getCmdName() == "url")
                temp = _("Url: ");
        else 
                temp = _("HtmlUrl: ");
index 86c1218e8579e919d1c7e7a8ec693fc7dcf428e3..6ae3a237e28863fb74ab08c2d387b5af57b83c9c 100644 (file)
@@ -5,14 +5,14 @@
 ParIterator & ParIterator::operator++()
 {
        while (!positions.empty()) {
-               ParPosition & p = positions.back();
+               ParPosition & p = positions.top();
 
                // Does the current inset contain more "cells" ?
                if (p.index >= 0) {
                        ++p.index;
                        Paragraph * par = (*p.it)->getFirstParagraph(p.index);
                        if (par) {
-                               positions.push_back(ParPosition(par));
+                               positions.push(ParPosition(par));
                                return *this;
                        }
                        ++p.it;
@@ -23,11 +23,12 @@ ParIterator & ParIterator::operator++()
                        p.it = p.par->inset_iterator_begin();
 
                // Try to find the next inset that contains paragraphs
-               for ( ; p.it != p.par->inset_iterator_end(); ++p.it) {
+               Paragraph::inset_iterator end = p.par->inset_iterator_end();
+               for (; p.it != end; ++p.it) {
                        Paragraph * par = (*p.it)->getFirstParagraph(0);
                        if (par) {
                                p.index = 0;
-                               positions.push_back(ParPosition(par));
+                               positions.push(ParPosition(par));
                                return *this;
                        }
                }
@@ -37,7 +38,7 @@ ParIterator & ParIterator::operator++()
                        return *this;
                }
 
-               positions.pop_back();
+               positions.pop();
        }
        return *this;
 }
index 712e3aed5c2a807bacca41348241902d42c0dfda..f34e76917dc7af37397a69723159abfd620056f6 100644 (file)
@@ -3,7 +3,7 @@
 #ifndef ITERATORS_H
 #define ITERATORS_H
 
-#include <vector>
+#include <stack>
 
 #include "paragraph.h"
 
@@ -35,24 +35,29 @@ bool operator!=(ParPosition const & pos1, ParPosition const & pos2) {
 
 class ParIterator {
 public:
+       ///
+       typedef std::stack<ParPosition> PosHolder;
        ///
        ParIterator() {}
-       //
-       ParIterator(Paragraph * par) 
-               : positions(1, ParPosition(par)) {}
+       ///
+       ParIterator(Paragraph * par) {
+               positions.push(ParPosition(par));
+       }
        ///
        ParIterator & operator++();
        ///
-       Paragraph * operator*() { return positions.back().par; }
+       Paragraph * operator*() {
+               return positions.top().par;
+       }
        ///
-       std::vector<ParPosition>::size_type size() const 
+       PosHolder::size_type size() const 
                { return positions.size(); }
        ///
        friend
        bool operator==(ParIterator const & iter1, ParIterator const & iter2);
 private:
        ///
-       std::vector<ParPosition> positions;
+       PosHolder positions;
 };
 
 
index db1759489895f069edde5cfcf784c1e6a897b0e2..a56440dfdf14613d200f4cc0aeab8c0aa32cf8e8 100644 (file)
 #include "commandtags.h"
 #include "debug.h"
 
+
+using std::vector;
 using std::endl;
+using std::hex;
+using std::dec;
+
 
 // The only modifiers that we handle. We want to throw away things
 // like NumLock.
@@ -137,7 +142,7 @@ string const kb_sequence::print() const
        if (deleted_)
                return buf;
        
-       for (std::vector<unsigned int>::size_type i = 0; i < length_; ++i) {
+       for (vector<unsigned int>::size_type i = 0; i < length_; ++i) {
                buf += kb_keymap::printKeysym(sequence[i], modifiers[i] & 0xffff);
 
                // append a blank
@@ -182,9 +187,9 @@ char kb_sequence::getiso() const
        unsigned int const c = getsym();
 
        lyxerr[Debug::KBMAP] << "Raw keysym: "
-                            << std::hex << c << std::dec << endl;
+                            << hex << c << dec << endl;
        lyxerr[Debug::KBMAP] << "byte 3: "
-                            << std::hex << (c & 0xff00) << std::dec
+                            << hex << (c & 0xff00) << dec
                             << endl;
        return kb_keymap::getiso(c);
 }
index a3b72d408fd87d44ebfd2e2b20418a6bac4ca31c..477b13f8c6e001ab7944a5b8c7ebbe058e36ef71 100644 (file)
 #include <algorithm>
 #include <iterator>
 
+
+using std::ifstream;
+using std::ofstream;
 using std::getline;
 using std::endl;
+using std::find;
+using std::copy;
+using std::ostream_iterator;
 
 
 LastFiles::LastFiles(string const & filename, bool st, unsigned int num)
@@ -53,7 +59,7 @@ void LastFiles::readFile(string const & filename)
 {
        // we will not complain if we can't find filename nor will
        // we issue a warning. (Lgb)
-       std::ifstream ifs(filename.c_str());
+       ifstream ifs(filename.c_str());
        string tmp;
        FileInfo fileInfo;
 
@@ -70,10 +76,10 @@ void LastFiles::readFile(string const & filename)
 
 void LastFiles::writeFile(string const & filename) const
 {
-       std::ofstream ofs(filename.c_str());
+       ofstream ofs(filename.c_str());
        if (ofs) {
-               std::copy(files.begin(), files.end(),
-                         std::ostream_iterator<string>(ofs, "\n"));
+               copy(files.begin(), files.end(),
+                    ostream_iterator<string>(ofs, "\n"));
        } else
                lyxerr << "LyX: Warning: unable to save LastFiles: "
                       << filename << endl;
@@ -83,7 +89,7 @@ void LastFiles::writeFile(string const & filename) const
 void LastFiles::newFile(string const & file)
 {
        // If file already exist, delete it and reinsert at front.
-       Files::iterator it = std::find(files.begin(), files.end(), file);
+       Files::iterator it = find(files.begin(), files.end(), file);
        if (it != files.end())
                files.erase(it);
        files.push_front(file);
index 2bbe4a334769bf137fe20e8356a72de56fa38f60..da4a2717d25f66b00521d0a62fb7882167f1645e 100644 (file)
@@ -521,9 +521,9 @@ void MenuInsertLabel(BufferView * bv, string const & arg)
                }
        }
        if (!label.empty()) {
-               InsetCommandParams p( "label", label );
-               InsetLabel * inset = new InsetLabel( p );
-               bv->insertInset( inset );
+               InsetCommandParams p("label", label);
+               InsetLabel * inset = new InsetLabel(p);
+               bv->insertInset(inset);
        }
        bv->owner()->allowInput();
 }
index 50ebac4742f04aa117abf3ecc2a87a34e46ce975..552819fdd7b78080967c0c427fc7d5e0e03a4737 100644 (file)
@@ -115,7 +115,7 @@ LyXGUI::LyXGUI(LyX * owner, int * argc, char * argv[], bool GUI)
        fl_get_app_resources(res, num_res);
 
        static const int geometryBitmask =
-               XParseGeometry( geometry,
+               XParseGeometry(geometry,
                                &xpos,
                                &ypos,
                                reinterpret_cast<unsigned int *>(&width),
@@ -302,7 +302,7 @@ void LyXGUI::create_forms()
        // This is probably as good a time as any to map the xform colours,
        // should a mapping exist.
        string const filename = AddName(user_lyxdir, "preferences.xform");
-       XformsColor::read( filename );
+       XformsColor::read(filename);
        
        // Show the main & title form
        int main_placement = FL_PLACE_CENTER | FL_FREE_SIZE;
index 3b6e3a7ba62513a93945c3cf5b755c7ab81cf62d..46143a7020e2fe952b26a3979831f6b1b878be6f 100644 (file)
@@ -667,7 +667,7 @@ bool LyX::readRcFile(string const & name)
        lyxerr[Debug::INIT] << "About to read " << name << "..." << endl;
        
        string const lyxrc_path = LibFileSearch(string(), name);
-       if (!lyxrc_path.empty()){
+       if (!lyxrc_path.empty()) {
                lyxerr[Debug::INIT] << "Found " << name
                                    << " in " << lyxrc_path << endl;
                if (lyxrc.read(lyxrc_path) < 0) { 
@@ -732,7 +732,7 @@ void LyX::readUIFile(string const & name)
                        break;
 
                default:
-                       if(!strip(lex.getString()).empty())
+                       if (!strip(lex.getString()).empty())
                                lex.printError("LyX::ReadUIFile: "
                                               "Unknown menu tag: `$$Token'");
                        break;
index 5d75c20f2eac7891981d12779e99584716bac2fc..28611e542959c8c43975f61d828896d3244615a3 100644 (file)
@@ -419,7 +419,7 @@ LyXFont::FONT_MISC_STATE LyXFont::noun() const
 inline
 bool LyXFont::isSymbolFont() const
 {
-       switch(family()) {
+       switch (family()) {
        case LyXFont::SYMBOL_FAMILY:
        case LyXFont::CMSY_FAMILY:
        case LyXFont::CMM_FAMILY:
index b626117250a5bf258e494ed85a3ef93db77d4f9c..3691d747cd729edd10e4c39a7bf59ee5b025ac8d 100644 (file)
@@ -106,6 +106,9 @@ using std::pair;
 using std::make_pair; 
 using std::endl;
 using std::find_if;
+using std::vector;
+using std::transform;
+using std::back_inserter;
 
 extern BufferList bufferlist;
 extern LyXServer * lyxserver;
@@ -880,7 +883,7 @@ string const LyXFunc::dispatch(kb_action action, string argument)
                                     (!keyseq.deleted())))
                {
                        if ((action == LFUN_UNKNOWN_ACTION)
-                           && argument.empty()){
+                           && argument.empty()) {
                                argument = keyseq.getiso();
                        }
                        // Undo/Redo is a bit tricky for insets.
@@ -1024,10 +1027,10 @@ string const LyXFunc::dispatch(kb_action action, string argument)
        // --- Misc -------------------------------------------
        case LFUN_EXEC_COMMAND:
        {
-               std::vector<string> allCmds;
-               std::transform(lyxaction.func_begin(), lyxaction.func_end(),
-                              std::back_inserter(allCmds), lyx::firster());
-               static std::vector<string> hist;
+               vector<string> allCmds;
+               transform(lyxaction.func_begin(), lyxaction.func_end(),
+                         back_inserter(allCmds), lyx::firster());
+               static vector<string> hist;
                owner->getMiniBuffer()->getString(MiniBuffer::spaces,
                                                  allCmds, hist);
        }
@@ -1143,7 +1146,7 @@ string const LyXFunc::dispatch(kb_action action, string argument)
 #endif
                        p.setCmdName("tableofcontents");
 #if 0
-               else if (action == LFUN_LOAVIEW )
+               else if (action == LFUN_LOAVIEW)
                        p.setCmdName("listof{algorithm}{List of Algorithms}");
                else if (action == LFUN_LOFVIEW)
                        p.setCmdName("listoffigures");
@@ -1412,7 +1415,7 @@ string const LyXFunc::dispatch(kb_action action, string argument)
                Paragraph * par = owner->buffer()->getParFromID(id);
                if (par == 0) {
                        lyxerr[Debug::INFO] << "No matching paragraph found! ["
-                                           << id << "]" << std::endl;
+                                           << id << "]" << endl;
                        break;
                } else {
                        lyxerr << "Paragraph " << par->id()
@@ -1498,7 +1501,7 @@ string const LyXFunc::dispatch(kb_action action, string argument)
        
        case LFUN_CITATION_CREATE:
        {
-               InsetCommandParams p( "cite" );
+               InsetCommandParams p("cite");
                
                if (!argument.empty()) {
                        // This should be set at source, ie when typing
@@ -1506,14 +1509,14 @@ string const LyXFunc::dispatch(kb_action action, string argument)
                        // Question: would pybibliographer also need to be
                        // changed. Suspect so. Leave as-is therefore.
                        if (contains(argument, "|")) {
-                               p.setContents( token(argument, '|', 0) );
-                               p.setOptions(  token(argument, '|', 1) );
+                               p.setContents(token(argument, '|', 0));
+                               p.setOptions( token(argument, '|', 1));
                        } else {
-                               p.setContents( argument );
+                               p.setContents(argument);
                        }
                        dispatch(LFUN_CITATION_INSERT, p.getAsString());
                } else
-                       owner->getDialogs()->createCitation( p.getAsString() );
+                       owner->getDialogs()->createCitation(p.getAsString());
        }
        break;
                    
index 1ae1de20986383cfded8dd10286ae487e3efe00c..7eb622220cdda516c5da01a5fefd733cd726543b 100644 (file)
@@ -57,7 +57,7 @@ string const LyXLength::asString() const
 string const LyXLength::asLatexString() const
 {
        ostringstream buffer;
-       switch(unit_) {
+       switch (unit_) {
        case PW:
            buffer << abs(static_cast<int>(val_/100)) << "."
                   << abs(static_cast<int>(val_)%100) << "\\textwidth";
index c44d5e0fe17146ac25f8545361eb797ba53cf3f7..86ec37b86b4ec4771691ce670ce637dedcf87066 100644 (file)
@@ -63,7 +63,7 @@ string const LyXLex::text() const
 }
 
 
-std::istream & LyXLex::getStream()
+istream & LyXLex::getStream()
 {
        return pimpl_->is;
 }
index 1dc807724e00ff4470132b768b7386a1ee3fdb63..fd4cb586a74a4bd98b13b5e729f16ed7013d1d9d 100644 (file)
@@ -222,7 +222,7 @@ bool LyXLex::Pimpl::next(bool esc /* = false */)
                                        is.get(cc);
                                        c = cc;
                                } while (c > ' ' && c != ',' && is
-                                        && (i != LEX_MAX_BUFF - 1) );
+                                        && (i != LEX_MAX_BUFF - 1));
                                if (i == LEX_MAX_BUFF - 1) {
                                        printError("Line too long");
                                }
@@ -273,7 +273,7 @@ bool LyXLex::Pimpl::next(bool esc /* = false */)
                                        is.get(cc);
                                        c = cc;
                                } while (c > ' ' && c != ',' && is
-                                        && (i != LEX_MAX_BUFF - 1) );
+                                        && (i != LEX_MAX_BUFF - 1));
                                if (i == LEX_MAX_BUFF - 1) {
                                        printError("Line too long");
                                }
@@ -352,7 +352,7 @@ bool LyXLex::Pimpl::next(bool esc /* = false */)
                                        is.get(cc);
                                        c = cc;
                                } while (c > ' ' && c != ',' && is
-                                        && (i != LEX_MAX_BUFF-1) );
+                                        && (i != LEX_MAX_BUFF-1));
                                if (i == LEX_MAX_BUFF-1) {
                                        printError("Line too long");
                                }
index 39916ed893366559d45c3e75fe4771ca26cda4ab..9fc627f957d2563912a663b02ae0d20884942a6d 100644 (file)
@@ -259,7 +259,7 @@ void CloseLyXLookup()
 XComposeStatus compose_status= {0, 0};
 
 // This is called after the main LyX window has been created
-void InitLyXLookup(Display *, Window 
+void InitLyXLookup(Display *, Window) 
 {
        //Nothing to do.
 }
index b0dc77ff74a9c404fece2430b68249de1c4b2e4c..79f7f72eb82253a0f477f3f231119c32d148283a 100644 (file)
@@ -1246,7 +1246,7 @@ void LyXRC::output(ostream & os) const
                   << "#\n\n";
                
        case RC_SET_COLOR:
-               for (int i = 0; i < LColor::ignore; ++i ) {
+               for (int i = 0; i < LColor::ignore; ++i) {
                        LColor::color lc = static_cast<LColor::color>(i);
                        
                        string const col(lcolor.getX11Name(lc));
index ba3e0856713dcda4bff3e9da40c60af9b3295dd4..69fa710eea49ee844e5adbe74db90e809784ce4d 100644 (file)
@@ -251,7 +251,7 @@ void LyXComm::endPipe(int & fd, string const & filename)
  
 // OS/2 pipes are deleted automatically
 #ifndef __EMX__
-       if (lyx::unlink(filename) < 0){
+       if (lyx::unlink(filename) < 0) {
                lyxerr << "LyXComm: Could not remove pipe " << filename
                       << '\n' << strerror(errno) << endl;
        };
@@ -318,7 +318,7 @@ void LyXComm::callback(int fd, void *v)
                        errno = 0;
                        return; // up to libforms select-loop (*crunch*)
                }
-               if (errno != 0 )
+               if (errno != 0)
                {
                        lyxerr << "LyXComm: " << strerror(errno) << endl;
                        if (!lsbuf.empty())
@@ -450,7 +450,7 @@ void LyXServer::callback(LyXServer * serv, string const & msg)
                        // we are listening.
                        if (cmd == "hello") {
                                // One more client
-                               if (serv->numclients == MAX_CLIENTS){ //paranoid check
+                               if (serv->numclients == MAX_CLIENTS) { //paranoid check
                                        lyxerr[Debug::LYXSERVER]
                                                << "LyXServer: too many clients..."
                                                << endl;
index b2ee820c70ecaeb027e7a900a31dffef7b1e90a3..110f2c7d8944ba090f3e82464d30d80ec33594c1 100644 (file)
@@ -29,6 +29,7 @@
 using std::endl;
 using std::find_if;
 using std::remove_if;
+using std::ostream;
 
 
 /* ******************************************************************* */
@@ -530,7 +531,7 @@ void LyXTextClass::load()
 }
 
 
-std::ostream & operator<<(std::ostream & os, LyXTextClass::PageSides p)
+ostream & operator<<(ostream & os, LyXTextClass::PageSides p)
 {
        switch (p) {
        case LyXTextClass::OneSide:
index d1491f253c77eb6d1e1d624f8cde308f7a21b3b8..c72aaedc3a8f602e5c021fb9ca7a1376b756525e 100644 (file)
@@ -1,13 +1,13 @@
 AUTOMAKE_OPTIONS = foreign 1.4
 DISTCLEANFILES= *.orig *.rej *~ *.bak core
 MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
-noinst_LTLIBRARIES = libmathed.la
+noinst_LTLIBRARIES = libmathed.o
 LIBS=
 ETAGS_ARGS = --lang=c++
 BOOST_INCLUDES = -I$(top_srcdir)/boost
 INCLUDES = -I${srcdir}/../ $(SIGC_CFLAGS) $(BOOST_INCLUDES)
 
-libmathed_la_SOURCES = \
+libmathed_o_SOURCES = \
        formulabase.C \
        formulabase.h \
        formula.C \
index 19b36006ff4e80064bc57b1ff23b7c99e96bd50d..121bef4c55cb09c843d8799cdaff851aa9c87504 100644 (file)
@@ -324,7 +324,7 @@ void InsetFormula::read(Buffer const *, LyXLex & lex)
 }
 
 
-//std::ostream & operator<<(std::ostream & os, LyXCursor const & c)
+//ostream & operator<<(ostream & os, LyXCursor const & c)
 //{
 //     os << '[' << c.x() << ' ' << c.y() << ' ' << c.pos() << ']';
 //     return os;
index f1c6113b5733e7c07c5cc44a24e6b08532489aa6..1f28e67f304a99a0bcd943dde48e0df87d34730a 100644 (file)
@@ -265,7 +265,7 @@ void InsetFormulaBase::toggleInsetSelection(BufferView * bv)
 
 vector<string> const InsetFormulaBase::getLabelList() const
 {
-  return std::vector<string>();
+  return vector<string>();
 }
 
 
@@ -739,7 +739,7 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action,
 }
 
 
-void InsetFormulaBase::revealCodes(BufferView * bv) const
+void InsetFormulaBase::revealCodes(BufferView * /*bv*/) const
 {
        if (!mathcursor)
                return;
index d0cd0094383bc354f5238c967aebaf26e39e26b5..e19bf8b25e9d5c896766cb9a34eb8dd08f4f6fc7 100644 (file)
@@ -15,6 +15,7 @@
 using std::vector;
 using std::istringstream;
 using std::getline;
+using std::istream_iterator;
 
 
 MathArrayInset::MathArrayInset(string const & name, int m, int n)
@@ -43,7 +44,7 @@ MathArrayInset::MathArrayInset(string const & name, string const & str)
                string line;
                getline(is, line);
                istringstream ls(line.c_str());
-               typedef std::istream_iterator<string> iter;
+               typedef istream_iterator<string> iter;
                vector<string> v = vector<string>(iter(ls), iter());
                if (v.size())
                        dat.push_back(v);
index 068a2943aa73a2a5fae7d7bcfba298f6ff0a4cfe..0e70a9b043ab4b38e0ace37a8225cf8badcd6179 100644 (file)
 
 #include <utility>
 
+
+using std::swap;
+
+
 MathAtom::MathAtom()
        : nucleus_(0)
 {}
@@ -44,7 +48,7 @@ void MathAtom::operator=(MathAtom const & p)
        if (&p == this)
                return;
        MathAtom tmp(p);
-       std::swap(tmp.nucleus_, nucleus_);
+       swap(tmp.nucleus_, nucleus_);
 }
 
 
index 40fc662fbb0e1eee34a64f998969b5a722a896b6..bd1300e07ef194649248817eea69ca21b132a234 100644 (file)
@@ -11,6 +11,9 @@
 #include "math_mathmlstream.h"
 
 
+using std::max;
+
+
 MathBinaryOpInset::MathBinaryOpInset(char op)
        : MathNestInset(2), op_(op)
 {}
@@ -34,8 +37,8 @@ void MathBinaryOpInset::metrics(MathMetricsInfo const & mi) const
        xcell(0).metrics(mi);
        xcell(1).metrics(mi);
        width_   = xcell(0).width() + xcell(1).width() + opwidth();
-       ascent_  = std::max(xcell(0).ascent(),  xcell(1).ascent());
-       descent_ = std::max(xcell(0).descent(), xcell(1).descent());
+       ascent_  = max(xcell(0).ascent(),  xcell(1).ascent());
+       descent_ = max(xcell(0).descent(), xcell(1).descent());
 }
 
 
index 35d1e7dbc9569e5ab52da2e26a3442534325c12b..f7aa2693dbb7c403bea28784088b8dc93d641d9a 100644 (file)
@@ -10,6 +10,9 @@
 #include "math_mathmlstream.h"
 
 
+using std::max;
+
+
 MathBinomInset::MathBinomInset()
 {}
 
@@ -39,7 +42,7 @@ void MathBinomInset::metrics(MathMetricsInfo const & st) const
        xcell(1).metrics(mi);
        ascent_  = xcell(0).height() + 4 + 5;
        descent_ = xcell(1).height() + 4 - 5; 
-       width_   = std::max(xcell(0).width(), xcell(1).width()) + 2 * dw() + 4; 
+       width_   = max(xcell(0).width(), xcell(1).width()) + 2 * dw() + 4; 
 }
 
 
index 65970370c4771051979066236077e44977b730ec..39994391aaea5f8ab3ac425a12db575cfeb92284 100644 (file)
@@ -10,6 +10,9 @@
 #include "math_mathmlstream.h"
 
 
+using std::max;
+
+
 MathBraceInset::MathBraceInset()
        : MathNestInset(1)
 {}
@@ -26,8 +29,8 @@ void MathBraceInset::metrics(MathMetricsInfo const & mi) const
        xcell(0).metrics(mi);
        int a, d;
        mathed_char_dim(LM_TC_TEX, mi, '{', a, d, wid_);
-       ascent_  = std::max(xcell(0).ascent(), a);
-       descent_ = std::max(xcell(0).descent(), a);
+       ascent_  = max(xcell(0).ascent(), a);
+       descent_ = max(xcell(0).descent(), a);
        width_   = xcell(0).width() + 2 * wid_;
 }
 
index e0ba2e9e8191dacfc9d969bee0178dc1998d45ea..bbc9bbcd13dfd75238fc5eeabdf22a93230fcf1d 100644 (file)
@@ -17,6 +17,9 @@
 #include "LaTeXFeatures.h"
 
 
+using std::ostream;
+
+
 MathCharInset::MathCharInset(char c)
        : char_(c), code_(nativeCode(c))
 {
@@ -60,21 +63,21 @@ void MathCharInset::draw(Painter & pain, int x, int y) const
 }
 
 
-void MathCharInset::writeHeader(std::ostream & os) const
+void MathCharInset::writeHeader(ostream & os) const
 {
        if (math_font_name(code_))
                os << '\\' << math_font_name(code_) << '{';
 }
 
 
-void MathCharInset::writeTrailer(std::ostream & os) const
+void MathCharInset::writeTrailer(ostream & os) const
 {
        if (math_font_name(code_))
                os << '}';
 }
 
 
-void MathCharInset::writeRaw(std::ostream & os) const
+void MathCharInset::writeRaw(ostream & os) const
 {
        os << char_;
 }
@@ -110,7 +113,7 @@ void MathCharInset::validate(LaTeXFeatures & features) const
 {
        // Make sure amssymb is put in preamble if Blackboard Bold or
        // Fraktur used:
-       if ( (code_ == LM_TC_BB) || (code_ == LM_TC_EUFRAK) )
+       if ((code_ == LM_TC_BB) || (code_ == LM_TC_EUFRAK))
                features.require("amssymb");
 }
 
index a3581aff1a7aad7c2911bc5abcc300000564a88c..2698c5bed3fa8cd72e072c5a7d47c9c2fde09905 100644 (file)
@@ -56,6 +56,8 @@ using std::min;
 using std::max;
 using std::swap;
 using std::isalnum;
+using std::vector;
+using std::ostringstream;
 
 namespace {
 
@@ -76,11 +78,11 @@ struct Selection
                c1 = p->col(i1.idx_);
                c2 = p->col(i2.idx_);
                if (c1 > c2)
-                       std::swap(c1, c2);
+                       swap(c1, c2);
                r1 = p->row(i1.idx_);
                r2 = p->row(i2.idx_);
                if (r1 > r2)
-                       std::swap(r1, r2);
+                       swap(r1, r2);
        }
 
        void grab(MathCursor const & cursor)
@@ -659,7 +661,7 @@ string MathCursor::macroName() const
 {
        string s;
        MathInset::difference_type i = macroNamePos();
-       for ( ; i >= 0 && i < int(pos()); ++i)
+       for (; i >= 0 && i < int(pos()); ++i)
                s += array().at(i)->getChar();
        return s;
 }
@@ -766,7 +768,7 @@ void MathCursor::drawSelection(Painter & pain) const
                int y2 = c.yo() + c.descent();
                pain.fillRectangle(x1, y1, x2 - x1, y2 - y1, LColor::selection);
        } else {
-               std::vector<MathInset::idx_type> indices
+               vector<MathInset::idx_type> indices
                        = i1.par_->idxBetween(i1.idx_, i2.idx_);
                for (unsigned i = 0; i < indices.size(); ++i) {
                        MathXArray & c = i1.xcell(indices[i]);
@@ -938,7 +940,7 @@ void MathCursor::normalize()
        {
                MathIterator it = ibegin(formula()->par().nucleus());
                MathIterator et = iend(formula()->par().nucleus());
-               for ( ; it != et; ++it)
+               for (; it != et; ++it)
                        if (it.par()->asBoxInset())
                                it.par()->asBoxInset()->rebreak();
        }
@@ -1264,7 +1266,7 @@ bool MathCursor::interpret(string const & s)
                unsigned int n = 1;
                istringstream is(s.substr(5).c_str());
                is >> n;
-               n = std::max(1u, n);
+               n = max(1u, n);
                niceInsert(MathAtom(new MathCasesInset(n)));
                return true;
        }
@@ -1276,8 +1278,8 @@ bool MathCursor::interpret(string const & s)
                string h_align;
                istringstream is(s.substr(6).c_str());
                is >> m >> n >> v_align >> h_align;
-               m = std::max(1u, m);
-               n = std::max(1u, n);
+               m = max(1u, m);
+               n = max(1u, n);
                v_align += 'c';
                niceInsert(MathAtom(new MathArrayInset("array", m, n, v_align[0], h_align)));
                return true;
@@ -1521,7 +1523,7 @@ void MathCursor::setSelection(cursor_type const & where, size_type n)
 
 string MathCursor::info() const
 {
-       std::ostringstream os;
+       ostringstream os;
        if (pos() > 0)
                prevAtom()->infoize(os);
        return os.str();
index b4cd2bc507f2cb4e83024eccc9117beea261275a..ad5697e3a307785e729fb2d6739cfaf3e54b8af8 100644 (file)
@@ -12,6 +12,9 @@
 #include "math_extern.h"
 
 
+using std::max;
+
+
 MathDelimInset::MathDelimInset(string const & l, string const & r)
        : MathNestInset(1), left_(l), right_(r)
 {}
@@ -54,10 +57,10 @@ void MathDelimInset::metrics(MathMetricsInfo const & mi) const
        int a, d, w;
        mathed_char_dim(LM_TC_VAR, mi, 'I', a, d, w);
        int h0   = (a + d) / 2;
-       int a0   = std::max(xcell(0).ascent(), a)   - h0;
-       int d0   = std::max(xcell(0).descent(), d)  + h0;
-       ascent_  = std::max(a0, d0) + h0;
-       descent_ = std::max(a0, d0) - h0;
+       int a0   = max(xcell(0).ascent(), a)   - h0;
+       int d0   = max(xcell(0).descent(), d)  + h0;
+       ascent_  = max(a0, d0) + h0;
+       descent_ = max(a0, d0) - h0;
        width_   = xcell(0).width() + 2 * dw() + 8;
 }
 
index c317f3fe57ab7b354b73d1a2ced07974b828cf99..1681338fc174ceeda7d209a250d9340dd93b187c 100644 (file)
 #include "debug.h"
 
 
-std::ostream & operator<<(std::ostream & os, MathArray const & ar)
+using std::ostream;
+using std::istringstream;
+using std::find_if;
+
+
+ostream & operator<<(ostream & os, MathArray const & ar)
 {
        NormalStream ns(os);    
        ns << ar;
@@ -194,7 +199,7 @@ bool extractNumber(MathArray const & ar, int & i)
        string s;
        MathTextCodes c;
        charSequence(ar.begin(), ar.end(), s, c);
-       std::istringstream is(s.c_str());
+       istringstream is(s.c_str());
        is >> i;
        return is;
 }
@@ -547,7 +552,7 @@ void extractSums(MathArray & ar)
                                        // try to figure out the summation index from the subscript
                                        MathArray & ar = sub->down().data_;
                                        MathArray::iterator it =
-                                               std::find_if(ar.begin(), ar.end(), &testEqualSign);
+                                               find_if(ar.begin(), ar.end(), &testEqualSign);
                                        if (it != ar.end()) {
                                                // we found a '=', use everything in front of that as index,
                                                // and everything behind as lower index
@@ -612,7 +617,7 @@ bool extractDiffExponent(MathArray::iterator it, int & i)
        string s;
        if (!extractString((*it).nucleus(), s))
                return false;
-       std::istringstream is(s.c_str());
+       istringstream is(s.c_str());
        is >> i;
        return is;
 }
@@ -659,9 +664,9 @@ void extractDiff(MathArray & ar)
 
                // collect denominator parts
                MathArray & denom = f->cell(1);
-               for (MathArray::iterator dt = denom.begin(); dt != denom.end(); ) {
+               for (MathArray::iterator dt = denom.begin(); dt != denom.end();) {
                        // find the next 'd'
-                       MathArray::iterator et = std::find_if(dt + 1, denom.end(), &testDiffItem);
+                       MathArray::iterator et = find_if(dt + 1, denom.end(), &testDiffItem);
 
                        // point before this
                        MathArray::iterator st = et - 1;
@@ -670,7 +675,7 @@ void extractDiff(MathArray & ar)
                                // things like   d.../dx^n
                                int mult = 1;
                                if (extractNumber(script->up().data_, mult)) {
-                                       //lyxerr << "mult: " << mult << std::endl;
+                                       //lyxerr << "mult: " << mult << endl;
                                        for (int i = 0; i < mult; ++i)
                                                diff->addDer(MathArray(dt + 1, st));
                                }
index 5b560c88a35804c8f9fa83583f0780f61c662f7d..01e7b8028605fcc5a979170f1f62a64e38f6c16b 100644 (file)
@@ -8,6 +8,9 @@
 #include "math_mathmlstream.h"
 
 
+using std::max;
+
+
 MathFracInset::MathFracInset(bool atop)
        : atop_(atop)
 {}
@@ -31,7 +34,7 @@ void MathFracInset::metrics(MathMetricsInfo const & mi) const
        smallerStyleFrac(m);
        xcell(0).metrics(m);
        xcell(1).metrics(m);
-       width_   = std::max(xcell(0).width(), xcell(1).width()) + 4; 
+       width_   = max(xcell(0).width(), xcell(1).width()) + 4; 
        ascent_  = xcell(0).height() + 2 + 5;
        descent_ = xcell(1).height() + 2 - 5; 
 }
index a766dac6708596de86eeb246a8c8c66b661c1f75..18bceae2b8c15b4c03c474dc4f300959751cc756 100644 (file)
 #include "debug.h"
 
 
+using std::swap;
+using std::max;
+using std::min;
+using std::vector;
+
+
 namespace {
 
 string verboseHLine(int n)
@@ -221,8 +227,8 @@ void MathGridInset::metrics(MathMetricsInfo const & mi) const
                int desc = 0;
                for (col_type col = 0; col < ncols(); ++col) {
                        MathXArray const & c = xcell(index(row, col));
-                       asc  = std::max(asc,  c.ascent());
-                       desc = std::max(desc, c.descent());
+                       asc  = max(asc,  c.ascent());
+                       desc = max(desc, c.descent());
                }
                rowinfo_[row].ascent_  = asc;
                rowinfo_[row].descent_ = desc;
@@ -263,7 +269,7 @@ void MathGridInset::metrics(MathMetricsInfo const & mi) const
        for (col_type col = 0; col < ncols(); ++col) {
                int wid = 0;
                for (row_type row = 0; row < nrows(); ++row) 
-                       wid = std::max(wid, xcell(index(row, col)).width());
+                       wid = max(wid, xcell(index(row, col)).width());
                colinfo_[col].width_ = wid;
        }
        colinfo_[ncols()].width_  = 0;
@@ -439,7 +445,7 @@ void MathGridInset::addCol(col_type newcol)
                for (col_type col = 0; col < nc; ++col)
                        new_cells[row * (nc + 1) + col + (col > newcol)]
                                = cells_[row * nc + col];
-       std::swap(cells_, new_cells);
+       swap(cells_, new_cells);
 
        ColInfo inf;
        inf.skip_  = defaultColSpace(newcol);
@@ -457,7 +463,7 @@ void MathGridInset::delCol(col_type col)
        for (col_type i = 0; i < nargs(); ++i) 
                if (i % ncols() != col)
                        tmpcells.push_back(cells_[i]);
-       std::swap(cells_, tmpcells);
+       swap(cells_, tmpcells);
 
        colinfo_.erase(colinfo_.begin() + col);
 }
@@ -637,14 +643,14 @@ MathGridInset::RowInfo & MathGridInset::rowinfo(row_type row)
 }
 
 
-std::vector<MathInset::idx_type>
+vector<MathInset::idx_type>
        MathGridInset::idxBetween(idx_type from, idx_type to) const
 {
-       row_type r1 = std::min(row(from), row(to));
-       row_type r2 = std::max(row(from), row(to));
-       col_type c1 = std::min(col(from), col(to));
-       col_type c2 = std::max(col(from), col(to));
-       std::vector<idx_type> res;
+       row_type r1 = min(row(from), row(to));
+       row_type r2 = max(row(from), row(to));
+       col_type c1 = min(col(from), col(to));
+       col_type c2 = max(col(from), col(to));
+       vector<idx_type> res;
        for (row_type i = r1; i <= r2; ++i)
                for (col_type j = c1; j <= c2; ++j)
                        res.push_back(index(i, j));
index 5878967be6b74ccc70b735085683790a2fb559ba..f3d20ce72e3a86ae4c849feef54b877e091f67fc 100644 (file)
@@ -8,11 +8,13 @@
 
 #include <map>
 
+using std::map;
 
 namespace {
 
-// global
-std::map<string, latexkeys> theWordList;
+// file scope
+typedef map<string, latexkeys> WordList;
+WordList theWordList;
 
 
 struct key_type {
@@ -197,6 +199,7 @@ void readSymbols(string const & filename)
        }
 }
 
+
 void initSymbols()
 {
        unsigned const n = sizeof(wordlist_array) / sizeof(wordlist_array[0]);
@@ -230,6 +233,6 @@ latexkeys const * in_word_set(string const & str)
                initialized = true;
        }
 
-       std::map<string, latexkeys>::iterator it = theWordList.find(str);
+       WordList::iterator it = theWordList.find(str);
        return (it != theWordList.end()) ? &(it->second) : 0;
 }
index 49928c5de54486181526effd017213066b5f23f4..4d34cb134f809f9e9296aeb994c6e248ecdbe6e2 100644 (file)
@@ -15,6 +15,8 @@
 
 #include <vector>
 
+using std::vector;
+using std::max;
 using std::endl;
 
 namespace {
@@ -168,7 +170,7 @@ void MathHullInset::metrics(MathMetricsInfo const & mi) const
        if (numberedType()) {
                int l = 0;
                for (row_type row = 0; row < nrows(); ++row)
-                       l = std::max(l, mathed_string_width(LM_TC_BF, mi_, nicelabel(row)));
+                       l = max(l, mathed_string_width(LM_TC_BF, mi_, nicelabel(row)));
 
                if (l)
                        width_ += 30 + l;
@@ -178,8 +180,8 @@ void MathHullInset::metrics(MathMetricsInfo const & mi) const
        int asc = 0;
        int des = 0;
        math_font_max_dim(LM_TC_TEXTRM, mi_, asc, des);
-       ascent_  = std::max(ascent_,  asc);
-       descent_ = std::max(descent_, des);
+       ascent_  = max(ascent_,  asc);
+       descent_ = max(descent_, des);
 }
 
 
@@ -244,9 +246,9 @@ bool MathHullInset::display() const
 }
 
 
-std::vector<string> const MathHullInset::getLabelList() const
+vector<string> const MathHullInset::getLabelList() const
 {
-       std::vector<string> res;
+       vector<string> res;
        for (row_type row = 0; row < nrows(); ++row)
                if (!label_[row].empty() && nonum_[row] != 1)
                        res.push_back(label_[row]);
index 5b1f844aed911e1a15cbd865402931ebeaf81f07..57605c13bec806c4da389f8d49003f82fa1bc1e7 100644 (file)
 #include "debug.h"
 
 
+using std::ostream;
+using std::vector;
+
+
 int MathInset::height() const
 {
        return ascent() + descent();
 }
 
 
-std::ostream & operator<<(std::ostream & os, MathInset const & inset)
+ostream & operator<<(ostream & os, MathInset const & inset)
 {
        WriteStream wi(os, false);
        inset.write(wi);
@@ -180,10 +184,10 @@ void MathInset::validate(LaTeXFeatures &) const
 {}
 
 
-std::vector<MathInset::idx_type>
+vector<MathInset::idx_type>
        MathInset::idxBetween(idx_type from, idx_type to) const
 {
-       std::vector<idx_type> res;
+       vector<idx_type> res;
        for (idx_type i = from; i <= to; ++i)
                res.push_back(i);
        return res;
index 70d066b1b67246c58c888b57000470a95a433d0a..b1697fa1198425de6e208bb19446669b11cf3bef 100644 (file)
@@ -31,6 +31,9 @@
 #include "LaTeXFeatures.h"
 
 
+using std::max;
+
+
 MathMacro::MathMacro(string const & name)
        : MathNestInset(MathMacroTable::provide(name)->asMacroTemplate()->numargs()),
                tmplate_(MathMacroTable::provide(name))
@@ -89,9 +92,9 @@ void MathMacro::metrics(MathMetricsInfo const & mi) const
                for (idx_type i = 0; i < nargs(); ++i) {
                        MathXArray const & c = xcell(i);
                        c.metrics(mi_);
-                       width_    = std::max(width_, c.width() + lwid);
-                       descent_ += std::max(c.ascent(),  lasc) + 5;
-                       descent_ += std::max(c.descent(), ldes) + 5;
+                       width_    = max(width_, c.width() + lwid);
+                       descent_ += max(c.ascent(),  lasc) + 5;
+                       descent_ += max(c.descent(), ldes) + 5;
                }
                return;
        } 
@@ -129,12 +132,12 @@ void MathMacro::draw(Painter & pain, int x, int y) const
 
                for (idx_type i = 0; i < nargs(); ++i) {
                        MathXArray const & c = xcell(i);
-                       h += std::max(c.ascent(), lasc) + 5;
+                       h += max(c.ascent(), lasc) + 5;
                        c.draw(pain, x + lwid, h);
                        char str[] = "#1:";
                        str[1] += static_cast<char>(i);
                        drawStr(pain, LM_TC_TEX, mi_, x + 3, h, str);
-                       h += std::max(c.descent(), ldes) + 5;
+                       h += max(c.descent(), ldes) + 5;
                }
                return;
        }
index 6898f15366914948f09109a3cb9a9968f2710f63..c19a56b920c15028d7b1f1143aa2426beca3b3a6 100644 (file)
 #include "debug.h"
 
 
+using std::endl;
+
 
 MathMacroArgument::MathMacroArgument(int n, MathTextCodes code)
        : MathNestInset(1), number_(n), expanded_(false), code_(code)
 {
        if (n < 1 || n > 9) {
                lyxerr << "MathMacroArgument::MathMacroArgument: wrong Argument id: "
-                       << n << std::endl;
+                       << n << endl;
        }
        str_[0] = '#';
        str_[1] = static_cast<unsigned char>('0' + n);
index 3fe31bc7b7477df0fb072a87e6973c080ebf6d9b..d4f97a21d7a0a5eed03cd13895e6665c49550c5a 100644 (file)
@@ -8,6 +8,9 @@
 #include "debug.h"
 
 
+using std::endl;
+
+
 MathMacroTemplate::MathMacroTemplate()
        : MathNestInset(1), numargs_(0), name_()
 {}
@@ -18,7 +21,7 @@ MathMacroTemplate::MathMacroTemplate(string const & nm, int numargs)
 {
        if (numargs_ > 9)
                lyxerr << "MathMacroTemplate::MathMacroTemplate: wrong # of arguments: "
-                       << numargs_ << std::endl;
+                       << numargs_ << endl;
 }
 
 
index a4bbcfce6cd9ef5d8c5dd85b67744f559be5c890..bb87b1d232f94cc210851fdca2cd9e9371406ea2 100644 (file)
@@ -7,7 +7,10 @@
 #include "support/lyxalgo.h"
 
 
-MathMLStream::MathMLStream(std::ostream & os)
+using std::ostream;
+
+
+MathMLStream::MathMLStream(ostream & os)
        : os_(os), tab_(0), line_(0), lastchar_(0)
 {}
 
@@ -184,12 +187,12 @@ NormalStream & operator<<(NormalStream & ns, char c)
 //////////////////////////////////////////////////////////////////////
 
 
-WriteStream::WriteStream(std::ostream & os, bool fragile)
+WriteStream::WriteStream(ostream & os, bool fragile)
        : os_(os), fragile_(fragile), firstitem_(false), line_(0)
 {}
 
 
-WriteStream::WriteStream(std::ostream & os)
+WriteStream::WriteStream(ostream & os)
        : os_(os), fragile_(false), firstitem_(false), line_(0)
 {}
 
index 5804afc3d0a198a886a593c572005752368cdfdc..b59643b9817e77d4d4c1238a021ec87dd141fbd9 100644 (file)
@@ -87,6 +87,7 @@ using std::ios;
 using std::endl;
 using std::stack;
 using std::fill;
+using std::vector;
 
 //#define FILEDEBUG
 
@@ -306,7 +307,7 @@ private:
        ///
        int lineno_;
        ///
-       std::vector<Token> tokens_;
+       vector<Token> tokens_;
        ///
        unsigned pos_;
        ///
index 7b57373f2ee9dab5d1a3dc1b677c274f18bf607c..4c36ba1a0c9e2bc588dd665442b34f00703c3c69 100644 (file)
@@ -8,6 +8,8 @@
 #include "support/LAssert.h"
 
 
+using std::ostream;
+
 MathCursorPos::MathCursorPos()
        : par_(0), idx_(0), pos_(0)
 {}
@@ -61,7 +63,7 @@ int MathCursorPos::ypos() const
 }
 
 
-std::ostream & operator<<(std::ostream & os, MathCursorPos const & p)
+ostream & operator<<(ostream & os, MathCursorPos const & p)
 {
        os << "(par: " << p.par_ << " idx: " << p.idx_ << " pos: " << p.pos_ << ")";
        return os;
index 41162470f11f2ebc8a6ead22fc90c34706a4e171..597cf0a9ce6f2002d47b6e5da6d3eb71930cc1c2 100644 (file)
@@ -20,6 +20,9 @@
 #include "Painter.h"
 
 
+using std::max;
+
+
 MathRootInset::MathRootInset()
        : MathNestInset(2)
 {}
@@ -34,8 +37,8 @@ MathInset * MathRootInset::clone() const
 void MathRootInset::metrics(MathMetricsInfo const & mi) const
 {
        MathNestInset::metrics(mi);
-       ascent_  = std::max(xcell(0).ascent()  + 5, xcell(1).ascent())  + 2;
-       descent_ = std::max(xcell(1).descent() + 5, xcell(0).descent()) + 2;
+       ascent_  = max(xcell(0).ascent()  + 5, xcell(1).ascent())  + 2;
+       descent_ = max(xcell(1).descent() + 5, xcell(0).descent()) + 2;
        width_   = xcell(0).width() + xcell(1).width() + 10;
 }
 
@@ -43,8 +46,10 @@ void MathRootInset::metrics(MathMetricsInfo const & mi) const
 void MathRootInset::draw(Painter & pain, int x, int y) const
 {
        int const w = xcell(0).width();
-       xcell(0).draw(pain, x, y - 5 - xcell(0).descent());       // the "exponent"
-       xcell(1).draw(pain, x + w + 8, y);   // the "base"
+       // the "exponent"
+       xcell(0).draw(pain, x, y - 5 - xcell(0).descent());
+       // the "base"
+       xcell(1).draw(pain, x + w + 8, y);
        int const a = ascent();
        int const d = descent();
        int xp[5];
index 68d975ee5e63c97064fd38f54564d7323c942e28..2576987dea0430ff576998ec41154e657d5f4acd 100644 (file)
@@ -10,6 +10,9 @@
 #include "debug.h"
 
 
+using std::max;
+
+
 MathScriptInset::MathScriptInset()
        : MathNestInset(2), limits_(0)
 {
@@ -83,7 +86,7 @@ int MathScriptInset::dy0(MathInset const * nuc) const
        if (hasLimits(nuc))
                des += nd + 2;
        else 
-               des = std::max(des, nd);
+               des = max(des, nd);
        return des;
 }
 
@@ -97,8 +100,8 @@ int MathScriptInset::dy1(MathInset const * nuc) const
        if (hasLimits(nuc))
                asc += na + 2;
        else 
-               asc = std::max(asc, na);
-       asc = std::max(asc, mathed_char_ascent(LM_TC_VAR, mi_, 'I'));
+               asc = max(asc, na);
+       asc = max(asc, mathed_char_ascent(LM_TC_VAR, mi_, 'I'));
        return asc;
 }
 
@@ -142,14 +145,14 @@ int MathScriptInset::width2(MathInset const * nuc) const
        if (hasLimits(nuc)) {
                wid = nwid(nuc);
                if (hasUp())
-                       wid = std::max(wid, up().width());
+                       wid = max(wid, up().width());
                if (hasDown())
-                       wid = std::max(wid, down().width());
+                       wid = max(wid, down().width());
        } else {
                if (hasUp())
-                       wid = std::max(wid, up().width());
+                       wid = max(wid, up().width());
                if (hasDown())
-                       wid = std::max(wid, down().width());
+                       wid = max(wid, down().width());
                wid += nwid(nuc);
        }
        return wid;
index 2c2e1887519c6a1413f082cb60899d1ad98e9302..6663718b20586529757615a558c172ddf4b4238f 100644 (file)
@@ -7,6 +7,9 @@
 #include "math_support.h"
 
 
+using std::max;
+
+
 MathStackrelInset::MathStackrelInset()
 {}
 
@@ -23,7 +26,7 @@ void MathStackrelInset::metrics(MathMetricsInfo const & mi) const
        smallerStyleFrac(m);
        xcell(0).metrics(m);
        xcell(1).metrics(mi);
-       width_   = std::max(xcell(0).width(), xcell(1).width()) + 4; 
+       width_   = max(xcell(0).width(), xcell(1).width()) + 4; 
        ascent_  = xcell(1).ascent() + xcell(0).height() + 4;
        descent_ = xcell(1).descent();
 }
index 8bea104b7d35149920c49c1c57dea63906b26f36..21ff9ae1eb0fb0a496ad14747d03cbc0531305f5 100644 (file)
@@ -702,7 +702,7 @@ void mathed_draw_deco(Painter & pain, int x, int y, int w, int h,
        if (r >= 2)
                x += w;
 
-       for (int i = 0; d[i]; ) {
+       for (int i = 0; d[i];) {
                int code = int(d[i++]);
                if (code & 1) {  // code == 1 || code == 3
                        double xx = d[i++];
index 121a1814cd44de3119bd9cd180c9e90cb9ac0689..9bc6066d4526c80fbc218dc1cfbb3c63662fe250 100644 (file)
@@ -9,6 +9,9 @@
 #include "debug.h"
 
 
+using std::ostream;
+
+
 MathSymbolInset::MathSymbolInset(const latexkeys * l)
        : sym_(l), h_(0)
 {}
@@ -33,7 +36,7 @@ MathInset * MathSymbolInset::clone() const
 
 MathTextCodes MathSymbolInset::code() const
 {
-       switch(sym_->token) {
+       switch (sym_->token) {
        case LM_TK_CMR:
                return LM_TC_CMR;
        case LM_TK_CMSY:
@@ -183,7 +186,7 @@ void MathSymbolInset::write(WriteStream & os) const
 }
 
 
-void MathSymbolInset::infoize(std::ostream & os) const
+void MathSymbolInset::infoize(ostream & os) const
 {
        os << '\\' << name();
 }
index 5e42606b42426fcb585bf81b7fe6087b209f43ec..112401e823eeb1a425646e38f882bca38413272e 100644 (file)
@@ -7,6 +7,9 @@
 #include "math_support.h"
 
 
+using std::max;
+
+
 MathUndersetInset::MathUndersetInset()
 {}
 
@@ -23,7 +26,7 @@ void MathUndersetInset::metrics(MathMetricsInfo const & mi) const
        smallerStyleFrac(m);
        xcell(0).metrics(m);
        xcell(1).metrics(mi);
-       width_   = std::max(xcell(0).width(), xcell(1).width()) + 4; 
+       width_   = max(xcell(0).width(), xcell(1).width()) + 4; 
        ascent_  = xcell(1).ascent();
        descent_ = xcell(1).descent() + xcell(0).height() + 4;
 }
index 8f4ba899bd87235b20bf1d0b1d8952a9d4d36a19..cab9a2c337f78aae32f2360e4e2ae0a1db0e6249 100644 (file)
 #include "debug.h"
 
 
+using std::max;
+using std::min;
+
+
 extern MathScriptInset const * asScript(MathArray::const_iterator it);
 
 
@@ -36,14 +40,14 @@ void MathXArray::metrics(MathMetricsInfo const & mi) const
                MathScriptInset const * q = (it + 1 == end()) ? 0 : asScript(it);
                if (q) {
                        q->metrics(p, mi);
-                       ascent_  = std::max(ascent_,  q->ascent2(p));
-                       descent_ = std::max(descent_, q->descent2(p));
+                       ascent_  = max(ascent_,  q->ascent2(p));
+                       descent_ = max(descent_, q->descent2(p));
                        width_  += q->width2(p);        
                        ++it;
                } else {
                        p->metrics(mi);
-                       ascent_  = std::max(ascent_,  p->ascent());
-                       descent_ = std::max(descent_, p->descent());
+                       ascent_  = max(ascent_,  p->ascent());
+                       descent_ = max(descent_, p->descent());
                        width_  += p->width();  
                }
        }
@@ -80,7 +84,7 @@ void MathXArray::draw(Painter & pain, int x, int y) const
 int MathXArray::pos2x(size_type targetpos) const
 {
        int x = 0;
-       const_iterator target = std::min(begin() + targetpos, end());
+       const_iterator target = min(begin() + targetpos, end());
        for (const_iterator it = begin(); it < target; ++it) {
                MathInset const * p = it->nucleus();
                MathScriptInset const * q = (it + 1 == end()) ? 0 : asScript(it);
@@ -102,7 +106,7 @@ MathArray::size_type MathXArray::x2pos(int targetx) const
        const_iterator it = begin();
        int lastx = 0;
        int currx = 0;
-       for ( ; currx < targetx && it < end(); ++it) {
+       for (; currx < targetx && it < end(); ++it) {
                lastx = currx;
 
                int wid = 0;
@@ -192,7 +196,7 @@ void MathXArray::towards(int & x, int & y) const
        center(cx, cy);
 
        double r = 1.0;
-       int dist = (x - cx) * (x - cx) + (y - cy) * (y - cy);
+       //int dist = (x - cx) * (x - cx) + (y - cy) * (y - cy);
 
        x = cx + int(r * (x - cx));
        y = cy + int(r * (y - cy));
index 73f14eac5f6816c1ca3dd81220ad08021dfb608f..39af945285b38c065238202392c26a572bcdc0ce 100644 (file)
@@ -13,6 +13,9 @@
 #include "debug.h"
 
 
+using std::max;
+
+
 MathXYArrowInset::MathXYArrowInset()
        : MathNestInset(2)
 {}
@@ -68,7 +71,7 @@ void MathXYArrowInset::metrics(MathMetricsInfo const & mi) const
 
        if (editing()) {
                int w    = mathed_string_width(LM_TC_TEXTRM, mi_, "target: ");
-               width_   = w + std::max(xcell(0).width(), xcell(1).width());
+               width_   = w + max(xcell(0).width(), xcell(1).width());
                ascent_  = xcell(0).ascent();
                descent_ = xcell(0).descent() + xcell(1).height() + 10;
        } else {
@@ -93,9 +96,9 @@ void MathXYArrowInset::draw(Painter & pain, int x, int y) const
 
                xcell(0).draw(pain, x + lwid, y);
                drawStr(pain, LM_TC_TEXTRM, mi_, x + 3, y, "target");
-               y += std::max(xcell(0).descent(), ldes) + 5;
+               y += max(xcell(0).descent(), ldes) + 5;
 
-               y += std::max(xcell(1).ascent(), lasc) + 5;
+               y += max(xcell(1).ascent(), lasc) + 5;
                xcell(1).draw(pain, x + lwid, y);
                drawStr(pain, LM_TC_TEXTRM, mi_, x + 3, y, "label");
 
index 152cd3eb8e31ff9d81e34529e5600699f2f87310..f660a6e69792f7e2af420f302eb7c64f8df11c2d 100644 (file)
@@ -36,6 +36,8 @@
 
 using SigC::slot;
 using std::vector;
+using std::back_inserter;
+using std::find;
 
 extern LyXAction lyxaction;
 
@@ -147,7 +149,7 @@ int MiniBuffer::peek_event(FL_OBJECT * ob, int event, int key)
                        vector<string> comp;
                        lyx::copy_if(completion_.begin(),
                                     completion_.end(),
-                                    std::back_inserter(comp), prefix(input));
+                                    back_inserter(comp), prefix(input));
 
                        if (comp.empty()) {
                                // No matches
@@ -171,7 +173,7 @@ int MiniBuffer::peek_event(FL_OBJECT * ob, int event, int key)
                                        vector<string> vtmp;
                                        lyx::copy_if(comp.begin(),
                                                     comp.end(),
-                                                    std::back_inserter(vtmp),
+                                                    back_inserter(vtmp),
                                                     prefix(test));
                                        if (vtmp.size() != comp.size()) {
                                                test.erase(test.length() - 1);
@@ -211,7 +213,7 @@ int MiniBuffer::peek_event(FL_OBJECT * ob, int event, int key)
                        // of argumetns LFUN's should have first. (Lgb)
                        // First check for match
                        vector<string>::const_iterator cit =
-                               std::find(completion_.begin(),
+                               find(completion_.begin(),
                                          completion_.end(),
                                          input);
                        if (cit == completion_.end()) {
index 3614a65d61d5add8d2e46ac51f62cfb92d7eb070..fd27bfb8460ec1e22c41b28a554b2c3b36f053fd 100644 (file)
@@ -1179,14 +1179,14 @@ Paragraph const * Paragraph::depthHook(depth_type depth) const
 
 Paragraph * Paragraph::outerHook()
 {
-       if(!getDepth())
+       if (!getDepth())
                return 0;
        return depthHook(depth_type(getDepth() - 1));
 }
 
 Paragraph const * Paragraph::outerHook() const
 {
-       if(!getDepth())
+       if (!getDepth())
                return 0;
        return depthHook(depth_type(getDepth() - 1));
 }
@@ -1248,7 +1248,7 @@ Paragraph * Paragraph::TeXOnePar(Buffer const * buf,
                        texrow.newline();
                }
        
-               if (tex_code_break_column && style.isCommand()){
+               if (tex_code_break_column && style.isCommand()) {
                        os << '\n';
                        texrow.newline();
                }
@@ -1268,7 +1268,7 @@ Paragraph * Paragraph::TeXOnePar(Buffer const * buf,
                        further_blank_line = true;
                }
 
-               if (further_blank_line){
+               if (further_blank_line) {
                        os << '\n';
                        texrow.newline();
                }
@@ -1400,7 +1400,7 @@ Paragraph * Paragraph::TeXOnePar(Buffer const * buf,
                        further_blank_line = true;
                }
 
-               if (further_blank_line){
+               if (further_blank_line) {
                        os << '\n';
                        texrow.newline();
                }
@@ -1929,7 +1929,7 @@ bool Paragraph::isLetter(pos_type pos) const
 }
  
  
-bool Paragraph::isWord(pos_type pos ) const
+bool Paragraph::isWord(pos_type pos) const
 {
        return IsWordChar(getChar(pos)) ;
 }
index ab9ba6d170a34ac7faba5461f7d2b9b6bcf8673e..aaa4125d38832cff1cd2467a05321d5fe1cdf759 100644 (file)
 #include "support/LAssert.h"
 
 using lyx::pos_type;
+using std::endl;
+using std::ostream;
+using std::upper_bound;
+using std::lower_bound;
 
 extern int tex_code_break_column;
 
@@ -112,7 +116,7 @@ void Paragraph::Pimpl::insertChar(pos_type pos, value_type c,
 
        // Update the font table.
        FontTable search_font(pos, LyXFont());
-       for (FontList::iterator it = std::lower_bound(fontlist.begin(),
+       for (FontList::iterator it = lower_bound(fontlist.begin(),
                                                      fontlist.end(),
                                                      search_font, matchFT());
             it != fontlist.end(); ++it)
@@ -122,7 +126,7 @@ void Paragraph::Pimpl::insertChar(pos_type pos, value_type c,
    
        // Update the inset table.
        InsetTable search_inset(pos, 0);
-       for (InsetList::iterator it = std::lower_bound(owner_->insetlist.begin(),
+       for (InsetList::iterator it = lower_bound(owner_->insetlist.begin(),
                                                       owner_->insetlist.end(),
                                                       search_inset, matchIT());
             it != owner_->insetlist.end(); ++it)
@@ -144,12 +148,12 @@ void Paragraph::Pimpl::insertInset(pos_type pos,
        
        // Add a new entry in the inset table.
        InsetTable search_inset(pos, 0);
-       InsetList::iterator it = std::lower_bound(owner_->insetlist.begin(),
+       InsetList::iterator it = lower_bound(owner_->insetlist.begin(),
                                                  owner_->insetlist.end(),
                                                  search_inset, matchIT());
        if (it != owner_->insetlist.end() && it->pos == pos) {
                lyxerr << "ERROR (Paragraph::InsertInset): "
-                       "there is an inset in position: " << pos << std::endl;
+                       "there is an inset in position: " << pos << endl;
        } else {
                owner_->insetlist.insert(it, InsetTable(pos, inset));
                inset->parOwner(owner_);
@@ -168,7 +172,7 @@ void Paragraph::Pimpl::erase(pos_type pos)
                // find the entry
                InsetTable search_inset(pos, 0);
                InsetList::iterator it =
-                       std::lower_bound(owner_->insetlist.begin(),
+                       lower_bound(owner_->insetlist.begin(),
                                         owner_->insetlist.end(),
                                         search_inset, matchIT());
                if (it != owner_->insetlist.end() && it->pos == pos) {
@@ -183,7 +187,7 @@ void Paragraph::Pimpl::erase(pos_type pos)
        FontTable search_font(pos, LyXFont());
        
        FontList::iterator it =
-               std::lower_bound(fontlist.begin(),
+               lower_bound(fontlist.begin(),
                            fontlist.end(),
                            search_font, matchFT());
        if (it != fontlist.end() && it->pos() == pos &&
@@ -213,7 +217,7 @@ void Paragraph::Pimpl::erase(pos_type pos)
        InsetTable search_inset(pos, 0);
        InsetList::iterator lend = owner_->insetlist.end();
        for (InsetList::iterator it =
-                    std::upper_bound(owner_->insetlist.begin(),
+                    upper_bound(owner_->insetlist.begin(),
                                      lend,
                                      search_inset, matchIT());
             it != lend; ++it)
@@ -221,7 +225,7 @@ void Paragraph::Pimpl::erase(pos_type pos)
 }
 
 
-void Paragraph::Pimpl::simpleTeXBlanks(std::ostream & os, TexRow & texrow,
+void Paragraph::Pimpl::simpleTeXBlanks(ostream & os, TexRow & texrow,
                                        pos_type const i,
                                        int & column, LyXFont const & font,
                                        LyXLayout const & style)
@@ -278,7 +282,7 @@ bool Paragraph::Pimpl::isTextAt(BufferParams const & bp,
  
 void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const * buf,
                                             BufferParams const & bparams,
-                                            std::ostream & os,
+                                            ostream & os,
                                             TexRow & texrow,
                                             bool moving_arg,
                                             LyXFont & font,
@@ -511,9 +515,9 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const * buf,
 
 Paragraph * Paragraph::Pimpl::TeXDeeper(Buffer const * buf,
                                        BufferParams const & bparams,
-                                       std::ostream & os, TexRow & texrow)
+                                       ostream & os, TexRow & texrow)
 {
-       lyxerr[Debug::LATEX] << "TeXDeeper...     " << this << std::endl;
+       lyxerr[Debug::LATEX] << "TeXDeeper...     " << this << endl;
        Paragraph * par = owner_;
 
        while (par && par->params().depth() == owner_->params().depth()) {
@@ -526,7 +530,7 @@ Paragraph * Paragraph::Pimpl::TeXDeeper(Buffer const * buf,
                                             os, texrow, false);
                }
        }
-       lyxerr[Debug::LATEX] << "TeXDeeper...done " << par << std::endl;
+       lyxerr[Debug::LATEX] << "TeXDeeper...done " << par << endl;
 
        return par;
 }
index 616b0916e4cd70ed6b560cef1b019e3ba0b30707..b76facc058abe6f18b866b6e1198f08b31494270 100644 (file)
@@ -290,7 +290,7 @@ void LyXScreen::showManualCursor(LyXText const * text, int x, int y,
        // Secure against very strange situations
        int const y2 = max(y_tmp, y1);
        
-       if (cursor_pixmap){
+       if (cursor_pixmap) {
                XFreePixmap(fl_get_display(), cursor_pixmap);
                cursor_pixmap = 0;
        }
@@ -360,7 +360,7 @@ void LyXScreen::hideCursor()
 {
        if (!cursor_visible) return;
 
-       if (cursor_pixmap){
+       if (cursor_pixmap) {
                XCopyArea (fl_get_display(), 
                           cursor_pixmap,
                           owner.getWin(),
index 5be10690471cb2a54f8a66b116dd8f52b9372d17..b15631b3e5daf86d346dc573c3b0f3cddbca34e2 100644 (file)
@@ -1,3 +1,4 @@
+// -*- C++ -*-
 #ifndef SP_BASE_H
 #define SP_BASE_H
 
@@ -23,7 +24,7 @@ class SpellBase
    
    virtual ~SpellBase() {}
 
-   virtual void initialize(BufferParams const & , string const & ) = 0;
+   virtual void initialize(BufferParams const & , string const &) = 0;
 
    virtual bool alive() = 0;
    
@@ -33,11 +34,11 @@ class SpellBase
 
    virtual void close() = 0;
 
-   virtual void insert(string const & ) = 0;
+   virtual void insert(string const &) = 0;
 
-   virtual void accept(string const & ) = 0;
+   virtual void accept(string const &) = 0;
 
-   virtual void store(string const & , string const & ) = 0;
+   virtual void store(string const & , string const &) = 0;
 
    virtual char const * error() = 0;
 
index 319d68fd9e5542965230d0f273f81c79c40b014a..a42cf9b87d731e578dac4d00ad4f682591c1da7e 100644 (file)
@@ -1,7 +1,7 @@
 AUTOMAKE_OPTIONS = foreign
 DISTCLEANFILES= *.orig *.rej *~ *.bak core
 MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
-noinst_LTLIBRARIES = libsupport.la
+noinst_LTLIBRARIES = libsupport.o
 LIBS =
 ETAGS_ARGS = --lang=c++
 BOOST_INCLUDES = -I$(top_srcdir)/boost
@@ -17,7 +17,7 @@ if USE_REGEX
 REGEX = regex.c lyxregex.h
 endif
 
-libsupport_la_SOURCES = \
+libsupport_o_SOURCES = \
        DebugStream.C \
        DebugStream.h \
        FileInfo.C \
index e9061065dce7aebba0c1bf765c72d22f3d14cb90..b89f2159494aa836f937e62e6292c69778ed059e 100644 (file)
@@ -5,14 +5,21 @@
 #include "support/lyxlib.h"
 #include "LString.h"
 
+using std::ifstream;
+using std::ofstream;
+using std::ios;
+
 bool lyx::copy(string const & from, string const & to)
 {
-       std::ifstream ifs(from.c_str());
-       if (!ifs) return false;
-       std::ofstream ofs(to.c_str(),
-                         std::ios::binary | std::ios::out | std::ios::trunc);
-       if (!ofs) return false;
+       ifstream ifs(from.c_str());
+       if (!ifs)
+               return false;
+       ofstream ofs(to.c_str(),
+                    ios::binary | ios::out | ios::trunc);
+       if (!ofs)
+               return false;
        ofs << ifs.rdbuf();
-       if (ofs.good()) return true;
+       if (ofs.good())
+               return true;
        return false;
 }
index 03760081a66de7f2449ede6071efb7bbdf9b0cd6..33a11b83861ab2c698fc228c91ff1aacdd141e87 100644 (file)
@@ -216,13 +216,13 @@ double strToDbl(string const & str)
 
 char lowercase(char c) 
 { 
-       return char( tolower(c) ); 
+       return char(tolower(c)); 
 }
 
 
 char uppercase(char c) 
 { 
-       return char( toupper(c) ); 
+       return char(toupper(c)); 
 }
 
 
index 6be7f9ddaa3823d49652b7b7dd440f756f5b7132..72001459ad8a7af7d14a4f615a4d3ecc428834f7 100644 (file)
@@ -145,6 +145,19 @@ bool contains(string const & a, char b);
 ///
 bool contains(char const * a, char const * b);
 
+/// This should probably we rewritten to be more general.
+class contains_functor {
+public:
+       typedef string first_argument_type;
+       typedef string second_argument_type;
+       typedef bool result_type;
+       
+       bool operator()(string const & haystack, string const & needle) const {
+               return contains(haystack, needle);
+       }
+};
+
+
 ///
 bool containsOnly(string const &, char const *);
 
index 94c8504418471879ae2d75c7cafa2db4d9f50ae4..fbbbb78076bc701ec382af79636e10cbdb577a39 100644 (file)
@@ -217,38 +217,42 @@ compare_memfun(R(C::*p)() const, A const & a)
 // Functors used in the template.
 
 ///
-template<typename T1, typename T2>
+template<typename T>
 class equal_1st_in_pair {
 public:
        ///
-       equal_1st_in_pair(T1 const & value) : value_(value) {}
+       typedef typename T::first_type first_type;
        ///
-       typedef std::pair<T1, T2> pair_type;
+       typedef T pair_type;
+       ///
+       equal_1st_in_pair(first_type const & value) : value_(value) {}
        ///
        bool operator() (pair_type const & p) const {
                return p.first == value_;
        }
 private:
        ///
-       T1 const & value_;
+       first_type const & value_;
 };
 
 
 ///
-template<typename T1, typename T2>
+template<typename T>
 class equal_2nd_in_pair {
 public:
        ///
-       equal_2nd_in_pair(T2 const & value) : value_(value) {}
+       typedef typename T::second_type second_type;
+       ///
+       typedef T pair_type;
        ///
-       typedef std::pair<T1, T2> pair_type;
+       equal_2nd_in_pair(second_type const & value) : value_(value) {}
        ///
        bool operator() (pair_type const & p) const {
                return p.second == value_;
        }
 private:
        ///
-       T2 const & value_;
+       second_type const & value_;
 };
 
 }  // end of namespace lyx
index 5981a75a35a7e7d40e666acb2c704ced219b4ada..a4a1eacb88aeca86d9a9bd3da830302661ec1b80 100644 (file)
@@ -16,8 +16,6 @@
 #include "support/lyxlib.h"
 #include "debug.h"
 
-using std::endl;
-
 // Various implementations of lyx::sum(), depending on what methods
 // are available. Order is faster to slowest.
 #if defined(HAVE_MMAP) && defined(HAVE_MUNMAP)
@@ -32,13 +30,21 @@ using std::endl;
 #include <unistd.h>
 #include <sys/mman.h>
 
+using std::ifstream;
+using std::endl;
+using std::for_each;
+using std::istreambuf_iterator;
+using std::istream_iterator;
+using std::ios;
+
+
 unsigned long lyx::sum(string const & file)
 {
        lyxerr[Debug::FILES] << "lyx::sum() using mmap (lightning fast)"
                             << endl;
        
        int fd = open(file.c_str(), O_RDONLY);
-       if(!fd)
+       if (!fd)
                return 0;
        
        struct stat info;
@@ -76,7 +82,7 @@ inline
 unsigned long do_crc(InputIterator first, InputIterator last)
 {
        boost::crc_32_type crc;
-       crc = std::for_each(first, last, crc);
+       crc = for_each(first, last, crc);
        return crc.checksum();
 }
 
@@ -88,11 +94,11 @@ unsigned long lyx::sum(string const & file)
        lyxerr[Debug::FILES] << "lyx::sum() using istreambuf_iterator (fast)"
                             << endl;
 
-       std::ifstream ifs(file.c_str());
+       ifstream ifs(file.c_str());
        if (!ifs) return 0;
        
-       std::istreambuf_iterator<char> beg(ifs);
-       std::istreambuf_iterator<char> end;
+       istreambuf_iterator<char> beg(ifs);
+       istreambuf_iterator<char> end;
        
        return do_crc(beg,end);
 }
@@ -103,12 +109,12 @@ unsigned long lyx::sum(string const & file)
                << "lyx::sum() using istream_iterator (slow as a snail)"
                << endl;
        
-       std::ifstream ifs(file.c_str());
+       ifstream ifs(file.c_str());
        if (!ifs) return 0;
        
-       ifs.unsetf(std::ios::skipws);
-       std::istream_iterator<char> beg(ifs);
-       std::istream_iterator<char> end;
+       ifs.unsetf(ios::skipws);
+       istream_iterator<char> beg(ifs);
+       istream_iterator<char> end;
        
        return do_crc(beg,end);
 }
index cafcb27ac278007b6ff644e15cc4b607bf4cfeb9..3713e4938c8cda6c45ce68802d20cf2318fd763b 100644 (file)
@@ -4,7 +4,7 @@
 
 #ifdef __EMX__
 #include "os_os2.C"
-#elif defined(__CYGWIN__) || defined( __CYGWIN32__)
+#elif defined(__CYGWIN__) || defined(__CYGWIN32__)
 #include "os_win32.C"
 #else
 #include "os_unix.C"
index 9891749314ee37996dd4d3a82bada984d59c10e1..3eb7186fa7d8d8b074ab68b7e854dda070a3a2e3 100644 (file)
@@ -103,7 +103,7 @@ template<typename T> class shared_c_ptr {
       return *this;
    }
 
-#if !defined( BOOST_NO_MEMBER_TEMPLATES )
+#if !defined(BOOST_NO_MEMBER_TEMPLATES)
    template<typename Y>
       shared_c_ptr(const shared_c_ptr<Y>& r) : px(r.px) {  // never throws 
          ++*(pn = r.pn); 
@@ -158,7 +158,7 @@ template<typename T> class shared_c_ptr {
 #endif
 
    void reset(T* p=0) {
-      if ( px == p ) return;  // fix: self-assignment safe
+      if (px == p) return;  // fix: self-assignment safe
       if (--*pn == 0) { checked_delete(px); }
       else { // allocate new reference counter
 #ifndef LYX_NO_EXCEPTIONS                
@@ -190,7 +190,7 @@ template<typename T> class shared_c_ptr {
 // Tasteless as this may seem, making all members public allows member templates
 // to work in the absence of member template friends. (Matthew Langston)
 // Don't split this line into two; that causes problems for some GCC 2.95.2 builds
-#if defined(BOOST_NO_MEMBER_TEMPLATES) || !defined( BOOST_NO_MEMBER_TEMPLATE_FRIENDS )
+#if defined(BOOST_NO_MEMBER_TEMPLATES) || !defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
    private:
 #endif
 
index 448decfd4389a506dcc109214ae1df19f7c9e91a..d399924c1d08fa5a70125e93d878665adaf7e3e3 100644 (file)
@@ -103,10 +103,10 @@ bool IsPrintableNonspace(unsigned char c) {
 /// Word is not IsSeparator or IsKomma or IsHfill or IsFloat or IsInset. 
 inline
 bool IsWordChar(unsigned char c) {
-       return !( IsSeparatorChar( c )
-                 || IsKommaChar( c )
-                 || IsHfillChar( c )
-                 || IsInsetChar( c ));
+       return !(IsSeparatorChar(c)
+                 || IsKommaChar(c)
+                 || IsHfillChar(c)
+                 || IsInsetChar(c));
 }
 
 
index e211aa468d447067215919fe83342c79796e35b3..aff39251d9f1c7bca82c396d83870fe346940c4a 100644 (file)
@@ -54,7 +54,7 @@ public:
                // For explanation see the next find() function.
                Map::const_iterator it =
                        std::find_if(map.begin(), map.end(),
-                                    lyx::equal_1st_in_pair<T1, T2>(first)
+                                    lyx::equal_1st_in_pair<MapPair>(first)
                                );
                
                if (it != map.end()) {
@@ -78,10 +78,10 @@ public:
                // to take only the second value of the pair to be compared.
                //
                // We can depict it as follows:
-               // equal_to( select2nd(pair) , second)
+               // equal_to(select2nd(pair) , second)
                Map::const_iterator it =
                        std::find_if(map.begin(), map.end(),
-                                    lyx::equal_2nd_in_pair<T1, T2>(second)
+                                    lyx::equal_2nd_in_pair<MapPair>(second)
                                );
                
                if (it != map.end())
index 97b1a00ad92576017d52ff6138bc6fbfd303cf8c..83a25fb9eb0f04240dff25cdb99175c529193ae8 100644 (file)
@@ -562,7 +562,7 @@ int LyXTabular::GetAdditionalHeight(int row) const
                }
        }
        for (int column = 0; column < columns_ && top; ++column) {
-               switch (cell_info[row][column].multicolumn){
+               switch (cell_info[row][column].multicolumn) {
                case LyXTabular::CELL_BEGIN_OF_MULTICOLUMN:
                        top = cell_info[row][column].top_line;
                        break;
@@ -885,7 +885,7 @@ int LyXTabular::GetBeginningOfTextInCell(int cell) const
 {
        int x = 0;
    
-       switch (GetAlignment(cell)){
+       switch (GetAlignment(cell)) {
        case LYX_ALIGN_CENTER:
                x += (GetWidthOfColumn(cell) - GetWidthOfCell(cell)) / 2;
                break;
@@ -1884,7 +1884,7 @@ int LyXTabular::TeXTopHLine(ostream & os, int row) const
                if (TopLine(i))
                        ++tmp;
        }
-       if (tmp == (n - fcell)){
+       if (tmp == (n - fcell)) {
                os << "\\hline ";
        } else if (tmp) {
                for (int i = fcell; i < n; ++i) {
@@ -1917,7 +1917,7 @@ int LyXTabular::TeXBottomHLine(ostream & os, int row) const
                if (BottomLine(i))
                        ++tmp;
        }
-       if (tmp == (n-fcell)){
+       if (tmp == (n - fcell)) {
                os << "\\hline";
        } else if (tmp) {
                for (int i = fcell; i < n; ++i) {
@@ -2036,7 +2036,7 @@ int LyXTabular::TeXCellPostamble(ostream & os, int cell) const
                os << "%\n\\end{minipage}";
                ret += 2;
        }
-       if (IsMultiColumn(cell)){
+       if (IsMultiColumn(cell)) {
                os << '}';
        }
        if (GetRotateCell(cell)) {
@@ -2360,27 +2360,27 @@ int LyXTabular::docBook(Buffer const * buf, ostream & os) const
 #warning Jose please have a look here I changed the longtable header/footer
 #warning ---- options so I had to disable the docbook code (Jug 20011219)
 #if 0
-       if ( IsLongTabular() ) {
+       if (IsLongTabular()) {
                // Header
-               if(endhead.row || endfirsthead.row ) {
+               if (endhead.row || endfirsthead.row) {
                        os << "<thead>\n";
-                       if( endfirsthead.row ) {
-                               docbookRow( buf, os, endfirsthead.row - 1);
+                       if (endfirsthead.row) {
+                               docbookRow(buf, os, endfirsthead.row - 1);
                        }
-                       ifendhead.row && endhead.row != endfirsthead.row) {
+                       if (endhead.row && endhead.row != endfirsthead.row) {
                                docbookRow(buf, os, endhead.row - 1);
                        }
                        os << "</thead>\n";
                }
 
                // Footer
-               if( endfoot.row || endlastfoot.row ) {
+               if (endfoot.row || endlastfoot.row) {
                        os << "<tfoot>\n";
-                       if( endfoot.row ) {
-                               docbookRow( buf, os, endfoot.row - 1);
+                       if (endfoot.row) {
+                               docbookRow(buf, os, endfoot.row - 1);
                        }
-                       ifendlastfoot.row && endlastfoot.row != endfoot.row) {
-                               docbookRow( buf, os, endlastfoot.row - 1);
+                       if (endlastfoot.row && endlastfoot.row != endfoot.row) {
+                               docbookRow(buf, os, endlastfoot.row - 1);
                        }
                        os << "</tfoot>\n";
                }
@@ -2392,10 +2392,10 @@ int LyXTabular::docBook(Buffer const * buf, ostream & os) const
 
        os << "<tbody>\n";
        for (int i = 0; i < rows_; ++i) {
-               if(!IsLongTabular() || (
+               if (!IsLongTabular() || (
                   !row_info[i].endhead && !row_info[i].endfirsthead &&
                   !row_info[i].endfoot && !row_info[i].endlastfoot)) {
-                       docbookRow( buf, os, i);
+                       docbookRow(buf, os, i);
                }
        }
        os << "</tbody>\n";
@@ -2701,12 +2701,12 @@ void LyXTabular::Validate(LaTeXFeatures & features) const
 }
 
 
-std::vector<string> const LyXTabular::getLabelList() const
+vector<string> const LyXTabular::getLabelList() const
 {
-       std::vector<string> label_list;
+       vector<string> label_list;
        for (int i = 0; i < rows_; ++i)
                for (int j = 0; j < columns_; ++j) {
-                       std::vector<string> const l =
+                       vector<string> const l =
                                GetCellInset(i, j)->getLabelList();
                        label_list.insert(label_list.end(),
                                          l.begin(), l.end());
index 72d28384a481154535b225a8c1d5b5c3aa733f94..a9d907f51384223003badbba950253a65c9114ea 100644 (file)
@@ -41,7 +41,7 @@ string const write_attribute(string const & name, LyXLength const & value)
 
 string const tostr(LyXAlignment const & num)
 {
-       switch(num) {
+       switch (num) {
        case LYX_ALIGN_NONE:
                return "none";
        case LYX_ALIGN_BLOCK:
@@ -63,7 +63,7 @@ string const tostr(LyXAlignment const & num)
 
 string const tostr(LyXTabular::VAlignment const & num)
 {
-       switch(num) {
+       switch (num) {
        case LyXTabular::LYX_VALIGN_TOP:
                return "top";
        case LyXTabular::LYX_VALIGN_CENTER:
@@ -77,7 +77,7 @@ string const tostr(LyXTabular::VAlignment const & num)
 
 string const tostr(LyXTabular::BoxType const & num)
 {
-       switch(num) {
+       switch (num) {
        case LyXTabular::BOX_NONE:
                return "none";
        case LyXTabular::BOX_PARBOX:
index bcbeff0399df1b73da3bdf0444c43e30545d39e2..a184f7429124b63843e9e97c75ef171f8bb703ca 100644 (file)
@@ -75,7 +75,7 @@ tex_accent_struct lyx_accent_table[18] = {
 tex_accent_struct get_accent(kb_action action)
 {
        int i = 0;
-       while (i <= TEX_MAX_ACCENT){
+       while (i <= TEX_MAX_ACCENT) {
                if (lyx_accent_table[i].action == action)
                        return lyx_accent_table[i];
                ++i;
index c67c88392e8fd7cf000439c2f6888098f7dc7fb0..5d9f3116d4a23042570c019a4517c64a3f4f80d5 100644 (file)
@@ -57,7 +57,7 @@ void TexRow::newline()
 
 class same_rownumber {
 public:
-       same_rownumber(TexRow::RowList::value_type const & v):vt(v){}
+       same_rownumber(TexRow::RowList::value_type const & v):vt(v) {}
        bool operator()(TexRow::RowList::value_type const & vt1) const {
                return vt.rownumber() == vt1.rownumber();
        }
index aebf486c8e8ba17e9567ade659b8418c644ccb27..b369b023308a556893af16fbc08ecb8a2bb8c144 100644 (file)
@@ -80,7 +80,7 @@ int LyXText::workWidth(BufferView * bview, Inset * inset) const
                        " fall back to the brute force method" << endl;
                Buffer::inset_iterator it = bview->buffer()->inset_iterator_begin();
                Buffer::inset_iterator end = bview->buffer()->inset_iterator_end();
-               for ( ; it != end; ++it) {
+               for (; it != end; ++it) {
                        if (*it == inset) {
                                par = it.getPar();
                                pos = it.getPos();
@@ -1824,7 +1824,7 @@ void LyXText::insertChar(BufferView * bview, char c)
                              getFont(bview->buffer(),
                                      cursor.par(),
                                      cursor.pos() - 1).number() == LyXFont::ON)
-                           )
+                          )
                                number(bview); // Set current_font.number to OFF
                } else if (IsDigit(c) &&
                           real_current_font.isVisibleRightToLeft()) {
@@ -1835,8 +1835,8 @@ void LyXText::insertChar(BufferView * bview, char c)
                                if (contains(number_unary_operators, c) &&
                                    (cursor.pos() == 1 ||
                                     cursor.par()->isSeparator(cursor.pos() - 2) ||
-                                    cursor.par()->isNewline(cursor.pos() - 2) )
-                                  ) {
+                                    cursor.par()->isNewline(cursor.pos() - 2))
+                                 ) {
                                        setCharFont(bview->buffer(),
                                                    cursor.par(),
                                                    cursor.pos() - 1,
@@ -2211,7 +2211,7 @@ void LyXText::cursorRightOneWord(BufferView * bview) const
                }
                // Advance through word.
                while (tmpcursor.pos() < tmpcursor.par()->size() &&
-                       tmpcursor.par()->isWord( tmpcursor.pos())) {
+                       tmpcursor.par()->isWord(tmpcursor.pos())) {
                  //     printf("Current pos2 %d", tmpcursor.pos()) ;
                        tmpcursor.pos(tmpcursor.pos() + 1);
                        ++steps;
@@ -2228,7 +2228,7 @@ void LyXText::cursorTab(BufferView * bview) const
            && !tmpcursor.par()->isNewline(tmpcursor.pos()))
         tmpcursor.pos(tmpcursor.pos() + 1);
 
-    if (tmpcursor.pos() == tmpcursor.par()->size()){
+    if (tmpcursor.pos() == tmpcursor.par()->size()) {
         if (tmpcursor.par()->next()) {
             tmpcursor.par(tmpcursor.par()->next());
             tmpcursor.pos(0);
@@ -2265,13 +2265,13 @@ void LyXText::cursorLeftOneWord(LyXCursor  & cur)  const
                || cur.par()->isHfill(cur.pos() - 1))) {
                cur.pos(cur.pos() - 1);
        } else if (!cur.pos()) {
-               if (cur.par()->previous()){
+               if (cur.par()->previous()) {
                        cur.par(cur.par()->previous());
                        cur.pos(cur.par()->size());
                }
        } else {                // Here, cur != 0 
                while (cur.pos() > 0 &&
-                      cur.par()->isWord(cur.pos()-1) )
+                      cur.par()->isWord(cur.pos()-1))
                        cur.pos(cur.pos() - 1);
        }
 }
@@ -2283,7 +2283,7 @@ void LyXText::getWord(LyXCursor & from, LyXCursor & to,
 {
        // first put the cursor where we wana start to select the word
        from = cursor;
-       switch(loc) {
+       switch (loc) {
        case WHOLE_WORD_STRICT:
                if (cursor.pos() == 0 || cursor.pos() == cursor.par()->size()
                    || cursor.par()->isSeparator(cursor.pos())
@@ -2315,7 +2315,7 @@ void LyXText::getWord(LyXCursor & from, LyXCursor & to,
        while (to.pos() < to.par()->size()
               && !to.par()->isSeparator(to.pos())
               && !to.par()->isKomma(to.pos())
-              && !to.par()->isHfill(to.pos()) )
+              && !to.par()->isHfill(to.pos()))
        {
                to.pos(to.pos() + 1);
        }
@@ -2332,7 +2332,7 @@ void LyXText::selectWord(BufferView * bview, word_location const loc)
        if (to == from)
                return;
        selection.cursor = cursor;
-       setCursor(bview, to.par(), to.pos() );
+       setCursor(bview, to.par(), to.pos());
        setSelection(bview);
 }
 
@@ -2408,7 +2408,7 @@ string const LyXText::selectNextWordToSpellcheck(BufferView * bview,
        }               
   
        // Update the value if we changed paragraphs
-       if (cursor.par() != tmppar){
+       if (cursor.par() != tmppar) {
                setCursor(bview, cursor.par(), cursor.pos());
                value = float(cursor.y())/float(height);
        }
@@ -3210,14 +3210,14 @@ int LyXText::getLengthMarkerHeight(BufferView * bv, VSpace const & vsp) const
  
        LyXFont font;
        font.decSize();
-       int const min_size = std::max(3 * arrow_size,
+       int const min_size = max(3 * arrow_size,
                                      lyxfont::maxAscent(font)
                                      + lyxfont::maxDescent(font));
 
        if (vsp.length().len().value() < 0.0)
                return min_size;
        else 
-               return std::max(min_size, space_size);
+               return max(min_size, space_size);
 }
 
  
@@ -3447,7 +3447,7 @@ void LyXText::paintFirstRow(DrawRowParams & p)
                        float x = p.x;
                        if (layout.labeltype == LABEL_CENTERED_TOP_ENVIRONMENT) {
                                x = ((is_rtl ? leftMargin(p.bv, p.row) : p.x)
-                                        + ww - rightMargin(buffer, p.row) ) / 2; 
+                                        + ww - rightMargin(buffer, p.row)) / 2; 
                                x -= lyxfont::width(str, font) / 2;
                        } else if (is_rtl) {
                                x = ww - leftMargin(p.bv, p.row) - 
@@ -3786,8 +3786,8 @@ LyXText::getColumnNearX(BufferView * bview, Row * row, int & x,
        if (row->pos() > last)  // Row is empty?
                c = row->pos();
        else if (lastrow &&
-                ( ( rtl &&  left_side && vc == row->pos() && x < tmpx - 5) ||
-                  (!rtl && !left_side && vc == last + 1   && x > tmpx + 5) ))
+                ((rtl &&  left_side && vc == row->pos() && x < tmpx - 5) ||
+                  (!rtl && !left_side && vc == last + 1   && x > tmpx + 5)))
                c = last + 1;
        else if (vc == row->pos()) {
                c = vis2log(vc);
index 2f5d16f52bd779099a767a5935180ed2ac5200fe..74e7dff93114ed93268a1ee77da8c00b33a8af29 100644 (file)
@@ -46,6 +46,7 @@
 #include "support/textutils.h"
 #include "support/lstrings.h"
 
+using std::vector;
 using std::copy;
 using std::find;
 using std::endl;
@@ -272,7 +273,7 @@ void LyXText::setCharFont(BufferView * bv, Paragraph * par,
                layoutfont = layout.font;
 
        // Realize against environment font information
-       if (par->getDepth()){
+       if (par->getDepth()) {
                Paragraph * tp = par;
                while (!layoutfont.resolved() && tp && tp->getDepth()) {
                        tp = tp->outerHook();
@@ -322,7 +323,7 @@ void LyXText::setCharFont(Buffer const * buf, Paragraph * par,
                layoutfont = layout.font;
 
        // Realize against environment font information
-       if (par->getDepth()){
+       if (par->getDepth()) {
                Paragraph * tp = par;
                while (!layoutfont.resolved() && tp && tp->getDepth()) {
                        tp = tp->outerHook();
@@ -1622,7 +1623,7 @@ void LyXText::setCounter(Buffer const * buf, Paragraph * par) const
                par->incCounter(i);
                int number = par->getCounter(i);
                if (!par->bibkey) {
-                       InsetCommandParams p( "bibitem" );
+                       InsetCommandParams p("bibitem" );
                        par->bibkey = new InsetBibKey(p);
                }
                par->bibkey->setCounter(number);
@@ -1953,7 +1954,7 @@ void LyXText::insertStringAsParagraphs(BufferView * bview, string const & str)
 
 
 bool LyXText::gotoNextInset(BufferView * bview,
-                           std::vector<Inset::Code> const & codes,
+                           vector<Inset::Code> const & codes,
                            string const & contents) const
 {
        LyXCursor res = cursor;
index 81c4b71dfedf32388f4103d18e97ee8cf0eb2275..87caa575a478bc0be7b236d35127559757a23e21 100644 (file)
@@ -13,6 +13,7 @@
 #include "debug.h"
 #include "trans_mgr.h"
 
+using std::map;
 using std::endl;
 
 
@@ -181,9 +182,9 @@ int Trans::Load(LyXLex & lex)
                        tex_accent accent_2= getkeymod(str);
                        if (accent_2 == TEX_NOACCENT) return -1;
 
-                       std::map<int, KmodInfo>::iterator it1 =
+                       map<int, KmodInfo>::iterator it1 =
                                kmod_list_.find(accent_1);
-                       std::map<int, KmodInfo>::iterator it2 =
+                       map<int, KmodInfo>::iterator it2 =
                                kmod_list_.find(accent_2);
                        if (it1 == kmod_list_.end()
                            || it2 == kmod_list_.end()) {
@@ -192,8 +193,8 @@ int Trans::Load(LyXLex & lex)
 
                        // Find what key accent_2 is on - should
                        // check about accent_1 also
-                       std::map<int, string>::iterator it = keymap_.begin();
-                       std::map<int, string>::iterator end = keymap_.end();
+                       map<int, string>::iterator it = keymap_.begin();
+                       map<int, string>::iterator end = keymap_.end();
                        for (; it != end; ++it) {
                                if (!it->second.empty()
                                    && it->second[0] == 0
@@ -288,7 +289,7 @@ int Trans::Load(LyXLex & lex)
 
 bool Trans::isAccentDefined(tex_accent accent, KmodInfo & i) const
 {
-       std::map<int, KmodInfo>::const_iterator cit = kmod_list_.find(accent);
+       map<int, KmodInfo>::const_iterator cit = kmod_list_.find(accent);
        if (cit != kmod_list_.end()) {
                i = cit->second;
                return true;
index e0b0e42117d517414b6e2151597628b46efd689d..dfd8d81c467de4bf8e1447a5500d793685b4d744 100644 (file)
@@ -28,6 +28,9 @@
 #include <vector>
 #endif
 
+using std::vector;
+
+
 /// the flag used by FinishUndo();
 bool undo_finished;
 /// a flag
@@ -149,7 +152,7 @@ bool textHandleUndo(BufferView * bv, Undo * undo)
     
                // now remove the old text if there is any
 #ifdef DELETE_UNUSED_PARAGRAPHS
-               std::vector<Paragraph *> vvpar;
+               vector<Paragraph *> vvpar;
 #endif
                if (before != behind || (!behind && !before)) {
                        if (before)
@@ -178,7 +181,7 @@ bool textHandleUndo(BufferView * bv, Undo * undo)
                }
     
                // put the new stuff in the list if there is one
-               if (tmppar3){
+               if (tmppar3) {
                        if (before)
                                before->next(tmppar3);
                        else
@@ -232,7 +235,7 @@ bool textHandleUndo(BufferView * bv, Undo * undo)
                        // which not always is true.
                        bv->text->redoParagraphs(bv, bv->text->cursor,
                                                 bv->text->cursor.par());
-                       if (tmppar){
+                       if (tmppar) {
                                it = static_cast<UpdatableInset*>(tmppar->inInset());
                                LyXText * t;
                                if (it) {
@@ -265,7 +268,7 @@ bool textHandleUndo(BufferView * bv, Undo * undo)
                delete undo;
 #ifdef DELETE_UNUSED_PARAGRAPHS
                // And here it's save enough to delete all removed paragraphs
-               std::vector<Paragraph *>::iterator pit = vvpar.begin();
+               vector<Paragraph *>::iterator pit = vvpar.begin();
                if (pit != vvpar.end()) {
                        lyxerr << "DEL: ";
                        for(;pit != vvpar.end(); ++pit) {
@@ -348,7 +351,7 @@ Undo * createUndo(BufferView * bv, Undo::undo_kind kind,
        // appear one by one when undoing. 
        // EDIT is special since only layout information, not the
        // contents of a paragaph are stored.
-       if (!undo_finished && (kind != Undo::EDIT) && (kind != Undo::FINISH)){
+       if (!undo_finished && (kind != Undo::EDIT) && (kind != Undo::FINISH)) {
                // check wether storing is needed
                if (!bv->buffer()->undostack.empty() && 
                    bv->buffer()->undostack.top()->kind == kind &&
index 103d3e9a404ac843f5dec0c571c4a99448476d60..c93722d99e19f6b16a92b52e4ef62654ecded2b6 100644 (file)
@@ -432,31 +432,46 @@ string const VSpace::asLatexCommand(BufferParams const & params) const
 int VSpace::inPixels(BufferView * bv) const
 {
        // Height of a normal line in pixels (zoom factor considered)
-       int default_height = bv->text->defaultHeight(); // [pixels]
-       int default_width  = bv->workWidth();
+       int const default_height = bv->text->defaultHeight(); // [pixels]
 
+       int retval = 0;
+       
        switch (kind_) {
        case NONE:
-               return 0;
+               // Value for this is already set
+               break;
        case DEFSKIP:
-               return bv->buffer()->params.getDefSkip().inPixels(bv);
-
+               retval = bv->buffer()->params.getDefSkip().inPixels(bv);
+               break;
+                       
                // This is how the skips are normally defined by
                // LateX.  But there should be some way to change
                // this per document.
        case SMALLSKIP:
-               return default_height / 4;
+               retval = default_height / 4;
+               break;
+                       
        case MEDSKIP:
-               return default_height / 2;
+               retval = default_height / 2;
+               break;
+                       
        case BIGSKIP:
-               return default_height;
+               retval = default_height;
+               break;
 
        case VFILL:
                // leave space for the vfill symbol
-               return 3 * default_height;
+               retval = 3 * default_height;
+               break;
+               
        case LENGTH:
-               return len_.len().inPixels(default_width, default_height);
+       {
+               int const default_width  = bv->workWidth();
+               retval = len_.len().inPixels(default_width, default_height);
+               break;
        }
-       // we cannot go there, but there is a compiler warning...
-       return 0;
+               
+       }
+
+       return retval;
 }