]> git.lyx.org Git - features.git/commitdiff
some formatting changes some simplifications and removal of dead code
authorLars Gullik Bjønnes <larsbj@gullik.org>
Sat, 4 Nov 2000 10:00:12 +0000 (10:00 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Sat, 4 Nov 2000 10:00:12 +0000 (10:00 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1198 a592a061-630c-0410-9148-cb99ea01b6c8

102 files changed:
ChangeLog
src/BufferView2.C
src/BufferView_pimpl.C
src/ColorHandler.C
src/CutAndPaste.C
src/DepTable.C
src/FontInfo.C
src/LyXView.C
src/LyXView.h
src/Makefile.am
src/MenuBackend.C
src/Painter.C
src/Spacing.C
src/ToolbarDefaults.C
src/bmtable.c
src/buffer.C
src/bufferlist.C
src/bufferparams.C
src/combox.C
src/commandtags.h
src/frontends/xforms/FormBase.h
src/frontends/xforms/FormCitation.C
src/frontends/xforms/FormCopyright.C
src/frontends/xforms/FormDocument.C
src/frontends/xforms/FormError.C
src/frontends/xforms/FormGraphics.C
src/frontends/xforms/FormIndex.C
src/frontends/xforms/FormParagraph.C
src/frontends/xforms/FormPreferences.C
src/frontends/xforms/FormPreferences.h
src/frontends/xforms/FormRef.C
src/frontends/xforms/FormTabular.C
src/frontends/xforms/FormTabularCreate.C
src/frontends/xforms/FormToc.C
src/frontends/xforms/FormUrl.C
src/frontends/xforms/Menubar_pimpl.C
src/frontends/xforms/Toolbar_pimpl.C
src/frontends/xforms/form_citation.C
src/frontends/xforms/form_copyright.C
src/frontends/xforms/form_document.C
src/frontends/xforms/form_error.C
src/frontends/xforms/form_graphics.C
src/frontends/xforms/form_index.C
src/frontends/xforms/form_paragraph.C
src/frontends/xforms/form_preferences.C
src/frontends/xforms/form_print.C
src/frontends/xforms/form_ref.C
src/frontends/xforms/form_tabular.C
src/frontends/xforms/form_tabular_create.C
src/frontends/xforms/form_toc.C
src/frontends/xforms/form_url.C
src/frontends/xforms/input_validators.c
src/frontends/xforms/xform_helpers.C
src/insets/ExternalTemplate.C
src/insets/figinset.C
src/insets/insetbib.C
src/insets/insetcite.C
src/insets/insetcommand.C
src/insets/insetcommand.h
src/insets/insetinclude.C
src/insets/insetinfo.C
src/insets/insetlatexaccent.C
src/insets/insetparent.C
src/insets/insetquotes.C
src/insets/insetref.C
src/insets/insettabular.C
src/insets/insettext.C
src/insets/insettoc.C
src/insets/inseturl.C
src/kbmap.C
src/kbsequence.C
src/layout.C
src/lyx_cb.C
src/lyx_gui.C
src/lyx_main.C
src/lyxfont.C
src/lyxfr1.C
src/lyxfunc.C
src/lyxfunc.h
src/lyxlex_pimpl.C
src/lyxlookup.C
src/lyxrc.C
src/lyxserver.C
src/mathed/formula.C
src/mathed/math_iter.C
src/mathed/math_symbols.C
src/mathed/math_write.C
src/paragraph.C
src/screen.C
src/spellchecker.C
src/support/FileInfo.C
src/support/FileInfo.h
src/support/filetools.C
src/support/lstrings.C
src/support/lyxstring.C
src/support/snprintf.c
src/tabular.C
src/texrow.C
src/text.C
src/text2.C
src/trans.C
src/vspace.C

index 76a64e26c01a52279018bc9c84b064fe02fd6afb..dccc44daf8a84acfc79d0d037fda52a084482cc3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2000-11-04  Lars Gullik Bjønnes  <larsbj@lyx.org>
+
+       * src/frontends/xforms/FormPreferences.h (operator=): move out of RGB
+       (operator!): ditto
+
+       * src/frontends/xforms/FormPreferences.C (WriteableFile): simplify
+       the use of FileInfo
+
+       * src/lyxfunc.C (processKeyEvent): removed
+
+       * src/bufferlist.C (emergencyWrite): removed the out commented
+       emergency write code.
+
+       * src/Makefile.am (lyx_main.o): add dep for commandtags.h
+
+       * src/LyXView.[Ch]: remove the outcommented raw_callback code
+
+       * many files: change formatting to be a bit more uniform for
+       if,while,for,switch statements, remove some parantesis not needed.
+       
+
 2000-11-03  John Levon  <moz@compsoc.man.ac.uk>
 
        * config/kde.m4: make config more robust when KDEDIR is set
index 5fe3075ef1b789daee52bbfa1639e6588e01c71c..606f2044e5ea75c767728a4bcbe4356484ffb700 100644 (file)
@@ -285,7 +285,7 @@ bool BufferView::gotoLabel(string const & label)
        for (Buffer::inset_iterator it = buffer()->inset_iterator_begin();
             it != buffer()->inset_iterator_end(); ++it) {
                vector<string> labels = (*it)->getLabelList();
-               if ( find(labels.begin(),labels.end(),label)
+               if (find(labels.begin(),labels.end(),label)
                     != labels.end()) {
                        beforeChange();
                        text->SetCursor(this, it.getPar(), it.getPos());
index a896c75edf5a698e83a0bcbda0f6aeed66167cf2..a649f64eea1beb264ba588a2ee8184c041d478df 100644 (file)
@@ -432,12 +432,12 @@ void BufferView::Pimpl::scrollCB(double value)
                LyXText * vbt = bv_->text;
                int height = vbt->DefaultHeight();
                
-               if (vbt->cursor.y() < (int)(bv_->text->first + height)) {
+               if (vbt->cursor.y() < static_cast<int>((bv_->text->first + height))) {
                        vbt->SetCursorFromCoordinates(bv_, 0,
                                                      bv_->text->first +
                                                      height);
                } else if (vbt->cursor.y() >
-                          (int)(bv_->text->first+workarea_->height()-height))
+                          static_cast<int>((bv_->text->first+workarea_->height()-height)))
                {
                        vbt->SetCursorFromCoordinates(bv_, 0,
                                                      bv_->text->first +
@@ -1221,11 +1221,11 @@ void BufferView::Pimpl::restorePosition()
 
        beforeChange();
 
-       if( fname != buffer_->fileName() ) {
+       if (fname != buffer_->fileName()) {
                Buffer * b = bufferlist.exists(fname) ?
                        bufferlist.getBuffer(fname) :
                        bufferlist.loadLyXFile(fname); // don't ask, just load it
-               ifb != 0 ) buffer(b);
+               if (b != 0 ) buffer(b);
        }
 
        bv_->text->SetCursorFromCoordinates(bv_, x, y);
@@ -1341,7 +1341,7 @@ void BufferView::Pimpl::toggleToggle()
 void BufferView::Pimpl::center() 
 {
        beforeChange();
-       if (bv_->text->cursor.y() > (int)(workarea_->height() / 2)) {
+       if (bv_->text->cursor.y() > static_cast<int>((workarea_->height() / 2))) {
                screen_->Draw(bv_->text, bv_->text->cursor.y() - workarea_->height() / 2);
        } else {
                screen_->Draw(bv_->text, 0);
index f3be43ba7dd8ad73df94330956667c169b9d8be0..56835fffe19bed8869ab96f487db68e13a220516 100644 (file)
@@ -105,7 +105,7 @@ GC LyXColorHandler::getGCForeground(LColor::color c)
 
                XColor * cmap = new XColor[vi->map_entries];
 
-               for(int i = 0; i < vi->map_entries; ++i) {
+               for (int i = 0; i < vi->map_entries; ++i) {
                        cmap[i].pixel = i;
                }
                XQueryColors(display, colormap, cmap, vi->map_entries);
@@ -114,7 +114,7 @@ GC LyXColorHandler::getGCForeground(LColor::color c)
                int closest_pixel = 0;
                double closest_distance = 1e20; // we want to minimize this
                double distance = 0;
-               for(int t = 0; t < vi->map_entries; ++t) {
+               for (int t = 0; t < vi->map_entries; ++t) {
                        // The Euclidean distance between two points in 
                        // a three-dimensional space, the RGB color-cube,
                        // is used as the distance measurement between two
index 66875041500f0acfb964a1f65c4d1e51557675d9..da51fb0ac635f2a91b89d5ae871284dd0ec30857 100644 (file)
@@ -85,7 +85,7 @@ bool CutAndPaste::cutSelection(LyXParagraph * startpar, LyXParagraph ** endpar,
 #else
        (startpar == (*endpar))
 #endif
-           ) {
+          ) {
        // only within one paragraph
        buf = new LyXParagraph;
        LyXParagraph::size_type i = start;
@@ -181,7 +181,7 @@ bool CutAndPaste::copySelection(LyXParagraph * startpar, LyXParagraph * endpar,
 #else
        (startpar == endpar)
 #endif
-           ) {
+          ) {
        // only within one paragraph
        buf = new LyXParagraph;
        LyXParagraph::size_type i = start;
index 8af0420aaf24255fb78069f60bce754c0405e432..e493d794aaab18d137bd5057ae5ef6efce5372cc 100644 (file)
@@ -46,7 +46,7 @@ void DepTable::insert(string const & fi,
 
 void DepTable::update()
 {
-       for(DepList::iterator itr = deplist.begin();
+       for (DepList::iterator itr = deplist.begin();
            itr != deplist.end();
            ++itr) {
                unsigned long const one = (*itr).second.second;
index db2b5b6e9a2155a1fe41b3c57a606acc24b4594e..a9117e6f946d7b7bb487afbfe4f9859392ea9224 100644 (file)
@@ -128,7 +128,7 @@ void FontInfo::query()
                strings = new string[matches];
 
                // We have matches. Run them through
-               for(int i = 0; i < matches; ++i) {
+               for (int i = 0; i < matches; ++i) {
                        string name(list[i]);
                        sizes[i] = lyx::atoi(token(name, '-', 7));
                        strings[i] = name;
index 292a2581a577802aff21d714112f4fa7aab28255..850fa02af1e21b30fe866d51a53f3f5a8aa64ddf 100644 (file)
@@ -302,12 +302,6 @@ void LyXView::create_form_form_main(int width, int height)
 }
 
 
-#if 0
-extern "C"
-int C_LyXView_KeyPressMask_raw_callback(FL_FORM * fl, void * xev);
-#endif
-
-
 void LyXView::init()
 {
        // Set the textclass choice
@@ -321,12 +315,6 @@ void LyXView::init()
                autosave_timeout.start();
        }
 
-#if 0
-       // Install the raw callback for keyboard events 
-       fl_register_raw_callback(form_,
-                                KeyPressMask,
-                                C_LyXView_KeyPressMask_raw_callback);
-#endif
         intl->InitKeyMapper(lyxrc.use_kbmap);
 }
 
@@ -366,71 +354,6 @@ void LyXView::updateLayoutChoice()
 }
 
 
-#if 0
-// This is necessary, since FL_FREE-Objects doesn't get all keypress events
-// as FL_KEYBOARD events :-(   Matthias 280596
-int LyXView::KeyPressMask_raw_callback(FL_FORM * fl, void * xev)
-{
-       LyXView * view = static_cast<LyXView*>(fl->u_vdata);
-       int retval = 0;  // 0 means XForms should have a look at this event
-
-       XKeyEvent * xke = static_cast<XKeyEvent*>(xev);
-       static Time last_time_pressed = 0;
-       static Time last_time_released = 0;
-       static unsigned int last_key_pressed = 0;
-       static unsigned int last_key_released = 0;
-       static unsigned int last_state_pressed = 0;
-       static unsigned int last_state_released = 0;
-
-       // funny. Even though the raw_callback is registered with KeyPressMask,
-       // also KeyRelease-events are passed through:-(
-       // [It seems that XForms puts them in pairs... (JMarc)]
-       if (static_cast<XEvent*>(xev)->type == KeyPress
-           && view->bufferview->focus()
-           && view->bufferview->active())
-               {
-               last_time_pressed = xke->time;
-               last_key_pressed = xke->keycode;
-               last_state_pressed = xke->state;
-               retval = view->getLyXFunc()
-                       ->processKeyEvent(static_cast<XEvent*>(xev));
-       }
-       else if (static_cast<XEvent*>(xev)->type == KeyRelease
-                && view->bufferview->focus()
-                && view->bufferview->active())
-{
-               last_time_released = xke->time;
-               last_key_released = xke->keycode;
-               last_state_released = xke->state;
-       }
-
-       if (last_key_released == last_key_pressed
-           && last_state_released == last_state_pressed
-           && last_time_released == last_time_pressed) {
-               // When the diff between last_time_released and
-               // last_time_pressed is 0, that sinifies an autoreapeat
-               // at least on my system. It like some feedback from
-               // others, especially from user running LyX remote.
-               lyxerr[Debug::KEY] << "Syncing - purging X events." << endl;
-               XSync(fl_get_display(), 1);
-               // This purge make f.ex. scrolling stop imidiatly when
-               // releaseing the PageDown button. The question is if this
-               // purging of XEvents can cause any harm...after some testing
-               // I can see no problems, but I'd like other reports too.
-       }
-       return retval;
-}
-
-
-// wrapper for the above
-extern "C"
-int C_LyXView_KeyPressMask_raw_callback(FL_FORM * fl, void * xev)
-{
-       return LyXView::KeyPressMask_raw_callback(fl, xev);
-}
-#endif
-
-
 // Updates the title of the window with the filename of the current document
 void LyXView::updateWindowTitle()
 {
index 5ce2b4efffc94a096ed28f04ff4b66dc3d646f33..8017453af51c88e2c90f1e80d9119653181f7626 100644 (file)
@@ -133,10 +133,6 @@ private:
        ///
        void invalidateLayoutChoice();
 public:
-#if 0
-       ///
-       static int KeyPressMask_raw_callback(FL_FORM *, void * xev);
-#endif
        /** This callback is run when a close event is sent from the
          window manager. */
        static int atCloseMainFormCB(FL_FORM *, void *);
index 6aa24829699674bdeb04e014d0ec1b9fa1a7013a..98747463ddef22e044a346cd76160f33737a2807 100644 (file)
@@ -228,7 +228,7 @@ lyx_SOURCES = \
 lyx_main.o: lyx_main.C lyx_main.h config.h version.h lyx_gui.h \
        lyx_gui_misc.h lyxrc.h support/path.h support/filetools.h \
        bufferlist.h debug.h support/FileInfo.h lastfiles.h intl.h \
-       lyxserver.h layout.h gettext.h kbmap.h 
+       lyxserver.h layout.h gettext.h kbmap.h commandtags.h
        $(CXXCOMPILE) -DLYX_DIR=\"$(pkgdatadir)\" \
          -DTOP_SRCDIR=\"$(top_srcdir)\" -c $(top_srcdir)/src/lyx_main.C
 
index 0289bf8928732951f51c5c18dcc30cd69b18901e..18d39b90b8665b1f726873606833041063fd640c 100644 (file)
@@ -46,7 +46,7 @@ MenuItem::MenuItem(Kind kind, string const & label,
                   string const & command, bool optional) 
        : kind_(kind), label_(label), optional_(optional)
 {
-       switch(kind) {
+       switch (kind) {
        case Separator:
        case Documents:
        case Lastfiles:
@@ -122,7 +122,7 @@ Menu & Menu::read(LyXLex & lex)
        bool optional = false;
 
        while (lex.IsOK() && !quit) {
-               switch(lex.lex()) {
+               switch (lex.lex()) {
                case md_optitem:
                        optional = true;
                        // fallback to md_item
@@ -351,7 +351,7 @@ void MenuBackend::read(LyXLex & lex)
        bool menubar = false;
 
        while (lex.IsOK() && !quit) {
-               switch(lex.lex()) {
+               switch (lex.lex()) {
                case md_menubar: 
                        menubar = true;
                        // fallback to md_menu
@@ -436,7 +436,7 @@ void MenuBackend::defaults()
        add(main_nobuffer);
 
        if (lyxerr.debugging(Debug::GUI)) {
-               for(const_iterator cit = begin();
+               for (const_iterator cit = begin();
                    cit != end() ; ++cit)
                        lyxerr << "Menu name: " << cit->name() 
                               << ", Menubar: " << cit->menubar() 
index 94943ff9579a0a293bc8e9fd18a0fb9744eb0569..30675e07c7bc660afcfa27b6fc0895ac15ac157f 100644 (file)
@@ -319,7 +319,7 @@ PainterBase & Painter::text(int x, int y, char const * s, size_t ls,
                smallfont.decSize().decSize().setShape(LyXFont::UP_SHAPE);
                char c;
                int tmpx = x;
-               for(size_t i = 0; i < ls; ++i) {
+               for (size_t i = 0; i < ls; ++i) {
                        c = s[i];
                        if (islower(static_cast<unsigned char>(c))) {
                                c = toupper(c);
@@ -359,7 +359,7 @@ PainterBase & Painter::text(int x, int y, XChar2b const * s, int ls,
                smallfont.decSize().decSize().setShape(LyXFont::UP_SHAPE);
                static XChar2b c = {0, 0};
                int tmpx = x;
-               for(int i = 0; i < ls; ++i) {
+               for (int i = 0; i < ls; ++i) {
                        if (s[i].byte1 == 0 && islower(s[i].byte2)) {
                                c.byte2 = toupper(s[i].byte2);
                                lyxfont::XSetFont(display, gc, smallfont);
index 6014dea5cb5f8a9fadfdf49c747179c0dd949ce5..b80f55ffb13c554ac0c93cb5d9cb57fe198d2f47 100644 (file)
@@ -28,7 +28,7 @@ char const * spacing_string[] = {"single", "onehalf", "double", "other"};
 
 float Spacing::getValue() const 
 {
-       switch(space) {
+       switch (space) {
        case Default: // nothing special should happen with this...
        case Single: return 1.0;
        case Onehalf: return 1.25;
@@ -43,7 +43,7 @@ void Spacing::set(Spacing::Space sp, float val)
 {
        space = sp;
        if (sp == Other) {
-               switch(int(val * 1000 + 0.5)) {
+               switch (int(val * 1000 + 0.5)) {
                case 1000: space = Single; break;
                case 1250: space = Onehalf; break;
                case 1667: space = Double; break;
@@ -81,7 +81,7 @@ void Spacing::writeFile(ostream & os, bool para) const
 
 string const Spacing::writeEnvirBegin() const
 {
-       switch(space) {
+       switch (space) {
        case Default: break; // do nothing
        case Single:
                return "\\begin{singlespace}";
@@ -103,7 +103,7 @@ string const Spacing::writeEnvirBegin() const
 
 string const Spacing::writeEnvirEnd() const
 {
-       switch(space) {
+       switch (space) {
        case Default: break; // do nothing
        case Single:
                return "\\end{singlespace}";
index 9e42b8c67be5a4ceaea4d88fbd0f1c28d2e2e799..c827c598e304eb84209c9822ff9304d0b7a1611a 100644 (file)
@@ -118,7 +118,7 @@ void ToolbarDefaults::read(LyXLex & lex)
        
        while (lex.IsOK() && !quit) {
 
-               switch(lex.lex()) {
+               switch (lex.lex()) {
                case TO_ADD:
                        if (lex.next()) {
                                func = lex.GetString();
index 60fba834d3450ca21779bef1880bfb807c8d3379..b0b6369457b962cdb0d2d599311620fe9c1aa48e 100644 (file)
@@ -298,7 +298,7 @@ void fl_set_bmtable_file(FL_OBJECT * ob, int nx, int ny, char const * filename)
    unsigned int bw, bh;
    unsigned char * bdata;
    
-   if(XReadBitmapFileData(filename, &bw, &bh,
+   if (XReadBitmapFileData(filename, &bw, &bh,
                          &bdata, &xh, &yh) == BitmapSuccess)
      fl_set_bmtable_data(ob, nx, ny, bw, bh, bdata);
    XFlush(fl_get_display());
index ff79a73d823f574347c4e7cf0229ed88c2ea61c2..152f7de180b9a29babbcf5eaaa0ab1dc60c33e76 100644 (file)
@@ -254,7 +254,7 @@ bool Buffer::readLyXformat2(LyXLex & lex, LyXParagraph * par)
        bool has_token = false;
        string pretoken;
 
-       if(!par) {
+       if (!par) {
                par = new LyXParagraph;
        } else {
                users->text->BreakParagraph(users);
@@ -550,7 +550,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
                if (tmpret != LYX_LAYOUT_DEFAULT) {
                        InsetQuotes::quote_language tmpl = 
                                InsetQuotes::EnglishQ;
-                       switch(tmpret) {
+                       switch (tmpret) {
                        case 0:
                                tmpl = InsetQuotes::EnglishQ;
                                break;
@@ -574,7 +574,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
                }
        } else if (token == "\\quotes_times") {
                lex.nextToken();
-               switch(lex.GetInteger()) {
+               switch (lex.GetInteger()) {
                case 1: 
                        params.quotes_times = InsetQuotes::SingleQ; 
                        break;
@@ -641,7 +641,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
                params.columns = lex.GetInteger();
        } else if (token == "\\papersides") {
                lex.nextToken();
-               switch(lex.GetInteger()) {
+               switch (lex.GetInteger()) {
                default:
                case 1: params.sides = LyXTextClass::OneSide; break;
                case 2: params.sides = LyXTextClass::TwoSides; break;
@@ -921,7 +921,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
                               "Inserting as text.");
                string::const_iterator cit = token.begin();
                string::const_iterator end = token.end();
-               for(; cit != end; ++cit) {
+               for (; cit != end; ++cit) {
                        par->InsertChar(pos, (*cit), font);
                        ++pos;
                }
@@ -1389,10 +1389,10 @@ void Buffer::writeFileAscii(string const & fname, int linelen)
                for (i = 0, actpos = 1; i < par->size(); ++i, ++actpos) {
                        if (!i && !footnoteflag && !noparbreak){
                                ofs << "\n\n";
-                               for(j = 0; j < depth; ++j)
+                               for (j = 0; j < depth; ++j)
                                        ofs << "  ";
                                currlinelen = depth * 2;
-                               switch(ltype) {
+                               switch (ltype) {
                                case 0: /* Standard */
                                case 4: /* (Sub)Paragraph */
                                 case 5: /* Description */
@@ -1411,7 +1411,7 @@ void Buffer::writeFileAscii(string const & fname, int linelen)
                                        break;
                                }
                                if (ltype_depth > depth) {
-                                       for(j = ltype_depth - 1; j > depth; --j)
+                                       for (j = ltype_depth - 1; j > depth; --j)
                                                ofs << "  ";
                                        currlinelen += (ltype_depth-depth)*2;
                                }
@@ -1439,11 +1439,11 @@ void Buffer::writeFileAscii(string const & fname, int linelen)
                                break;
                        case LyXParagraph::META_NEWLINE:
                                ofs << "\n";
-                               for(j = 0; j < depth; ++j)
+                               for (j = 0; j < depth; ++j)
                                        ofs << "  ";
                                currlinelen = depth * 2;
                                if (ltype_depth > depth) {
-                                       for(j = ltype_depth;
+                                       for (j = ltype_depth;
                                            j > depth; --j)
                                                ofs << "  ";
                                        currlinelen += (ltype_depth - depth) * 2;
@@ -1459,11 +1459,11 @@ void Buffer::writeFileAscii(string const & fname, int linelen)
                                if (currlinelen > linelen - 10
                                     && c == ' ' && i + 2 < par->size()) {
                                        ofs << "\n";
-                                       for(j = 0; j < depth; ++j)
+                                       for (j = 0; j < depth; ++j)
                                                ofs << "  ";
                                        currlinelen = depth * 2;
                                        if (ltype_depth > depth) {
-                                               for(j = ltype_depth;
+                                               for (j = ltype_depth;
                                                    j > depth; --j)
                                                        ofs << "  ";
                                                currlinelen += (ltype_depth-depth)*2;
@@ -1597,10 +1597,10 @@ string const Buffer::asciiParagraph(LyXParagraph const * par,
                if (!i && !footnoteflag && !noparbreak){
                        if (linelen > 0)
                                buffer << "\n\n";
-                       for(char j = 0; j < depth; ++j)
+                       for (char j = 0; j < depth; ++j)
                                buffer << "  ";
                        currlinelen = depth * 2;
-                       switch(ltype) {
+                       switch (ltype) {
                        case 0: /* Standard */
                        case 4: /* (Sub)Paragraph */
                        case 5: /* Description */
@@ -1625,7 +1625,7 @@ string const Buffer::asciiParagraph(LyXParagraph const * par,
                                break;
                        }
                        if (ltype_depth > depth) {
-                               for(char j = ltype_depth - 1; j > depth; --j)
+                               for (char j = ltype_depth - 1; j > depth; --j)
                                        buffer << "  ";
                                currlinelen += (ltype_depth-depth)*2;
                        }
@@ -1659,12 +1659,12 @@ string const Buffer::asciiParagraph(LyXParagraph const * par,
                case LyXParagraph::META_NEWLINE:
                        if (linelen > 0) {
                                buffer << "\n";
-                               for(char j = 0; j < depth; ++j)
+                               for (char j = 0; j < depth; ++j)
                                        buffer << "  ";
                        }
                        currlinelen = depth * 2;
                        if (ltype_depth > depth) {
-                               for(char j = ltype_depth;
+                               for (char j = ltype_depth;
                                    j > depth; --j)
                                        buffer << "  ";
                                currlinelen += (ltype_depth - depth) * 2;
@@ -1681,11 +1681,11 @@ string const Buffer::asciiParagraph(LyXParagraph const * par,
                            (c == ' ') && ((i + 2) < par->size()))
                        {
                                buffer << "\n";
-                               for(char j = 0; j < depth; ++j)
+                               for (char j = 0; j < depth; ++j)
                                        buffer << "  ";
                                currlinelen = depth * 2;
                                if (ltype_depth > depth) {
-                                       for(char j = ltype_depth;
+                                       for (char j = ltype_depth;
                                            j > depth; --j)
                                                buffer << "  ";
                                        currlinelen += (ltype_depth-depth)*2;
@@ -1856,7 +1856,7 @@ void Buffer::makeLaTeXFile(string const & fname,
                        features.UsedLanguages.insert(default_language);
 #ifdef DO_USE_DEFAULT_LANGUAGE
                if (params.language->lang() != "default" ||
-                   !features.UsedLanguages.empty() ) {
+                   !features.UsedLanguages.empty()) {
 #endif
                        use_babel = true;
                        for (LaTeXFeatures::LanguageList::const_iterator cit =
@@ -2372,7 +2372,7 @@ void Buffer::makeLinuxDocFile(string const & fname, bool nice, bool body_only)
        LaTeXFeatures features(params, tclass.numLayouts());
        validate(features);
 
-       //if(nice)
+       //if (nice)
        tex_code_break_column = lyxrc.ascii_linelen;
        //else
        //tex_code_break_column = 0;
@@ -2389,7 +2389,7 @@ void Buffer::makeLinuxDocFile(string const & fname, bool nice, bool body_only)
                            << params.preamble << sgml_includedfiles << " \n]>\n\n";
                }
 
-               if(params.options.empty())
+               if (params.options.empty())
                        sgmlOpenTag(ofs, 0, top_element);
                else {
                        string top = top_element;
@@ -2434,11 +2434,11 @@ void Buffer::makeLinuxDocFile(string const & fname, bool nice, bool body_only)
                // write opening SGML tags
                switch (style.latextype) {
                case LATEX_PARAGRAPH:
-                       if(depth == par->depth 
+                       if (depth == par->depth 
                           && !environment_stack[depth].empty()) {
                                sgmlCloseTag(ofs, depth, environment_stack[depth]);
                                environment_stack[depth].erase();
-                               if(depth) 
+                               if (depth) 
                                        --depth;
                                else
                                        ofs << "</p>";
@@ -2477,7 +2477,7 @@ void Buffer::makeLinuxDocFile(string const & fname, bool nice, bool body_only)
                               environment_stack[depth].erase();
                        }
                        if (environment_stack[depth] != style.latexname()) {
-                               if(depth == 0) {
+                               if (depth == 0) {
                                        string const temp = "p";
                                        sgmlOpenTag(ofs, depth, temp);
                                }
@@ -2485,11 +2485,11 @@ void Buffer::makeLinuxDocFile(string const & fname, bool nice, bool body_only)
                                sgmlOpenTag(ofs, depth,
                                            environment_stack[depth]);
                        }
-                       if(style.latextype == LATEX_ENVIRONMENT) break;
+                       if (style.latextype == LATEX_ENVIRONMENT) break;
 
                        desc_on = (style.labeltype == LABEL_MANUAL);
 
-                       if(desc_on)
+                       if (desc_on)
                                item_name = "tag";
                        else
                                item_name = "item";
@@ -2515,7 +2515,7 @@ void Buffer::makeLinuxDocFile(string const & fname, bool nice, bool body_only)
 
                ofs << "\n";
                // write closing SGML tags
-               switch(style.latextype) {
+               switch (style.latextype) {
                case LATEX_COMMAND:
                case LATEX_ENVIRONMENT:
                case LATEX_ITEM_ENVIRONMENT:
@@ -2527,10 +2527,10 @@ void Buffer::makeLinuxDocFile(string const & fname, bool nice, bool body_only)
        }
    
        // Close open tags
-       for(; depth > 0; --depth)
+       for (; depth > 0; --depth)
                sgmlCloseTag(ofs, depth, environment_stack[depth]);
 
-       if(!environment_stack[depth].empty())
+       if (!environment_stack[depth].empty())
                sgmlCloseTag(ofs, depth, environment_stack[depth]);
 
        if (!body_only) {
@@ -2579,7 +2579,7 @@ void Buffer::DocBookHandleCaption(ostream & os, string & inner_tag,
                SimpleDocBookOnePar(os, extra_par, tpar,
                                    desc_on, depth + 2);
                sgmlCloseTag(os, depth+1, inner_tag);
-               if(!extra_par.empty())
+               if (!extra_par.empty())
                        os << extra_par;
        }
 }
@@ -2678,9 +2678,9 @@ void Buffer::DocBookHandleFootnote(ostream & os, LyXParagraph * & par,
                par = par->next;
        }
        os << tmp_par;
-       if(!inner_tag.empty()) sgmlCloseTag(os, depth + 1, inner_tag);
-       if(!extra_par.empty()) os << extra_par;
-       if(!tag.empty()) sgmlCloseTag(os, depth, tag);
+       if (!inner_tag.empty()) sgmlCloseTag(os, depth + 1, inner_tag);
+       if (!extra_par.empty()) os << extra_par;
+       if (!tag.empty()) sgmlCloseTag(os, depth, tag);
 }
 #endif
 
@@ -2797,7 +2797,7 @@ void Buffer::SimpleLinuxDocOnePar(ostream & os, LyXParagraph * par,
                LyXFont const font2 = par->getFont(params, i);
 
                if (font1.family() != font2.family()) {
-                       switch(family_type) {
+                       switch (family_type) {
                        case 0:
                                if (font2.family() == LyXFont::TYPEWRITER_FAMILY) {
                                        push_tag(os, "tt", stack_num, stack);
@@ -2841,7 +2841,7 @@ void Buffer::SimpleLinuxDocOnePar(ostream & os, LyXParagraph * par,
 
                // handle italic and slanted fonts
                if (font1.shape() != font2.shape()) {
-                       switch(shape_type) {
+                       switch (shape_type) {
                        case 0:
                                if (font2.shape() == LyXFont::ITALIC_SHAPE) {
                                        push_tag(os, "it", stack_num, stack);
@@ -2931,7 +2931,7 @@ void Buffer::SimpleLinuxDocOnePar(ostream & os, LyXParagraph * par,
        }
 
        // resets description flag correctly
-       switch(desc_on){
+       switch (desc_on){
        case 1:
                // <tag> not closed...
                linux_doc_line_break(os, char_line_count, 6);
@@ -2986,7 +2986,7 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
        LaTeXFeatures features(params, tclass.numLayouts());
        validate(features);
 
-       //if(nice)
+       //if (nice)
        tex_code_break_column = lyxrc.ascii_linelen;
        //else
        //tex_code_break_column = 0;
@@ -2999,7 +2999,7 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
    
        texrow.reset();
 
-       if(!only_body) {
+       if (!only_body) {
                string sgml_includedfiles=features.getIncludedFiles();
 
                ofs << "<!doctype " << top_element
@@ -3011,7 +3011,7 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
                        ofs << "\n [ " << params.preamble 
                            << sgml_includedfiles << " \n]>\n\n";
 
-               if(params.options.empty())
+               if (params.options.empty())
                        sgmlOpenTag(ofs, 0, top_element);
                else {
                        string top = top_element;
@@ -3031,12 +3031,12 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
                                            par->layout);
 
                // environment tag closing
-               for; depth > par->depth; --depth) {
-                       if(environment_inner[depth] != "!-- --") {
+               for (; depth > par->depth; --depth) {
+                       if (environment_inner[depth] != "!-- --") {
                                item_name= "listitem";
                                sgmlCloseTag(ofs, command_depth + depth,
                                             item_name);
-                               ifenvironment_inner[depth] == "varlistentry")
+                               if (environment_inner[depth] == "varlistentry")
                                        sgmlCloseTag(ofs, depth+command_depth,
                                                     environment_inner[depth]);
                        }
@@ -3046,14 +3046,14 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
                        environment_inner[depth].erase();
                }
 
-               if(depth == par->depth
+               if (depth == par->depth
                   && environment_stack[depth] != style.latexname()
                   && !environment_stack[depth].empty()) {
-                       if(environment_inner[depth] != "!-- --") {
+                       if (environment_inner[depth] != "!-- --") {
                                item_name= "listitem";
                                sgmlCloseTag(ofs, command_depth+depth,
                                             item_name);
-                               ifenvironment_inner[depth] == "varlistentry")
+                               if (environment_inner[depth] == "varlistentry")
                                        sgmlCloseTag(ofs,
                                                     depth + command_depth,
                                                     environment_inner[depth]);
@@ -3067,9 +3067,9 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
                 }
 
                // Write opening SGML tags.
-               switch(style.latextype) {
+               switch (style.latextype) {
                case LATEX_PARAGRAPH:
-                       if(style.latexname() != "dummy")
+                       if (style.latexname() != "dummy")
                                sgmlOpenTag(ofs, depth+command_depth,
                                            style.latexname());
                        break;
@@ -3087,18 +3087,18 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
                        
                        cmd_depth= lyx::atoi(c_depth);
                        
-                       if(command_flag) {
-                               if(cmd_depth<command_base) {
-                                       for(int j = command_depth;
+                       if (command_flag) {
+                               if (cmd_depth<command_base) {
+                                       for (int j = command_depth;
                                            j >= command_base; --j)
-                                               if(!command_stack[j].empty())
+                                               if (!command_stack[j].empty())
                                                        sgmlCloseTag(ofs, j, command_stack[j]);
                                        command_depth= command_base= cmd_depth;
-                               } else if(cmd_depth <= command_depth) {
-                                       for(int j = command_depth;
+                               } else if (cmd_depth <= command_depth) {
+                                       for (int j = command_depth;
                                            j >= cmd_depth; --j)
 
-                                               if(!command_stack[j].empty())
+                                               if (!command_stack[j].empty())
                                                        sgmlCloseTag(ofs, j, command_stack[j]);
                                        command_depth= cmd_depth;
                                } else
@@ -3140,7 +3140,7 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
                                sgmlOpenTag(ofs, depth + command_depth,
                                            environment_stack[depth]);
                        } else {
-                               if(environment_inner[depth] != "!-- --") {
+                               if (environment_inner[depth] != "!-- --") {
                                        item_name= "listitem";
                                        sgmlCloseTag(ofs,
                                                     command_depth + depth,
@@ -3152,8 +3152,8 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
                                }
                        }
                        
-                       if(style.latextype == LATEX_ENVIRONMENT) {
-                               if(!style.latexparam().empty())
+                       if (style.latextype == LATEX_ENVIRONMENT) {
+                               if (!style.latexparam().empty())
                                        sgmlOpenTag(ofs, depth + command_depth,
                                                    style.latexparam());
                                break;
@@ -3161,7 +3161,7 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
 
                        desc_on = (style.labeltype == LABEL_MANUAL);
 
-                       if(desc_on)
+                       if (desc_on)
                                environment_inner[depth]= "varlistentry";
                        else
                                environment_inner[depth]= "listitem";
@@ -3169,7 +3169,7 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
                        sgmlOpenTag(ofs, depth + 1 + command_depth,
                                    environment_inner[depth]);
 
-                       if(desc_on) {
+                       if (desc_on) {
                                item_name= "term";
                                sgmlOpenTag(ofs, depth + 1 + command_depth,
                                            item_name);
@@ -3200,23 +3200,23 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
 #endif
                string end_tag;
                // write closing SGML tags
-               switch(style.latextype) {
+               switch (style.latextype) {
                case LATEX_COMMAND:
                        end_tag = "title";
                        sgmlCloseTag(ofs, depth + command_depth, end_tag);
                        break;
                case LATEX_ENVIRONMENT:
-                       if(!style.latexparam().empty())
+                       if (!style.latexparam().empty())
                                sgmlCloseTag(ofs, depth + command_depth,
                                             style.latexparam());
                        break;
                case LATEX_ITEM_ENVIRONMENT:
-                       if(desc_on == 1) break;
+                       if (desc_on == 1) break;
                        end_tag= "para";
                        sgmlCloseTag(ofs, depth + 1 + command_depth, end_tag);
                        break;
                case LATEX_PARAGRAPH:
-                       if(style.latexname() != "dummy")
+                       if (style.latexname() != "dummy")
                                sgmlCloseTag(ofs, depth + command_depth,
                                             style.latexname());
                        break;
@@ -3228,13 +3228,13 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
        }
 
        // Close open tags
-       for(; depth >= 0; --depth) {
-               if(!environment_stack[depth].empty()) {
-                       if(environment_inner[depth] != "!-- --") {
+       for (; depth >= 0; --depth) {
+               if (!environment_stack[depth].empty()) {
+                       if (environment_inner[depth] != "!-- --") {
                                item_name= "listitem";
                                sgmlCloseTag(ofs, command_depth + depth,
                                             item_name);
-                               ifenvironment_inner[depth] == "varlistentry")
+                               if (environment_inner[depth] == "varlistentry")
                                       sgmlCloseTag(ofs, depth + command_depth,
                                                    environment_inner[depth]);
                        }
@@ -3244,8 +3244,8 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
                }
        }
        
-       for(int j = command_depth; j >= command_base; --j)
-               if(!command_stack[j].empty())
+       for (int j = command_depth; j >= command_base; --j)
+               if (!command_stack[j].empty())
                        sgmlCloseTag(ofs, j, command_stack[j]);
 
        if (!only_body) {
@@ -3277,7 +3277,7 @@ void Buffer::SimpleDocBookOnePar(ostream & os, string & extra,
        LyXFont font1 = main_body > 0 ? style.labelfont : style.font;
        
        int char_line_count = depth;
-       if(!style.free_spacing)
+       if (!style.free_spacing)
                for (int j = 0; j < depth; ++j)
                        os << ' ';
 
@@ -3315,9 +3315,9 @@ void Buffer::SimpleDocBookOnePar(ostream & os, string & extra,
                        //   and title should come first
                        //         desc_on == 4
                        //
-                       if(desc_on!= 3 || i!= 0) {
-                               if(!tmp_out.empty() && tmp_out[0] == '@') {
-                                       if(desc_on == 4)
+                       if (desc_on!= 3 || i!= 0) {
+                               if (!tmp_out.empty() && tmp_out[0] == '@') {
+                                       if (desc_on == 4)
                                                extra += frontStrip(tmp_out, '@');
                                        else
                                                os << frontStrip(tmp_out, '@');
@@ -3360,7 +3360,7 @@ void Buffer::SimpleDocBookOnePar(ostream & os, string & extra,
        }
        
        // resets description flag correctly
-       switch(desc_on){
+       switch (desc_on){
        case 1:
                // <term> not closed...
                os << "</term>";
@@ -3714,7 +3714,7 @@ void Buffer::resizeInsets(BufferView * bv)
 {
        /// then remove all LyXText in text-insets
        LyXParagraph * par = paragraph;
-       for(; par; par = par->next) {
+       for (; par; par = par->next) {
            par->resizeInsetsLyXText(bv);
        }
 }
index 6de9f42223c0963636eeb49f0c9a49523e22be8e..fe8dba7576d3b02e4482e89349db3e56d4060c7d 100644 (file)
@@ -109,7 +109,7 @@ bool BufferList::QwriteAll()
                                fname = MakeDisplayPath((*it)->fileName(), 50);
                        bool reask = true;
                        while(reask) {
-                               switch(AskConfirmation(_("Changes in document:"),
+                               switch (AskConfirmation(_("Changes in document:"),
                                                       fname,
                                                       _("Save document?"))) {
                                case 1: // Yes
@@ -185,7 +185,7 @@ bool BufferList::close(Buffer * buf)
                        fname = MakeDisplayPath(buf->fileName(), 50);
                bool reask = true;
                while (reask) {
-                       switch(AskConfirmation(_("Changes in document:"),
+                       switch (AskConfirmation(_("Changes in document:"),
                                               fname,
                                               _("Save document?"))){
                        case 1: // Yes
@@ -291,50 +291,6 @@ void BufferList::emergencyWrite(Buffer * buf)
                      buf->isUnnamed() ? OnlyFilename(buf->fileName()).c_str()
                      : buf->fileName().c_str()) << endl;
        
-       //if (buf->isUnnamed())
-       //      lyxerr << OnlyFilename(buf->fileName());
-       //else
-       //      lyxerr << buf->fileName();
-       //lyxerr << _(" as...") << endl;
-       
-       // Let's unroll this loop (Lgb)
-#if 0
-       bool madeit = false;
-       
-       for (int i = 0; i < 3 && !madeit; ++i) {
-               string s;
-               
-               // We try to save three places:
-               // 1) Same place as document.
-               // 2) In HOME directory.
-               // 3) In "/tmp" directory.
-               if (i == 0) {
-                       if (buf->isUnnamed())
-                               continue;
-                       s = buf->fileName();
-               } else if (i == 1) {
-                       s = AddName(GetEnvPath("HOME"), buf->fileName());
-               } else {
-                       // MakeAbsPath to prepend the current
-                       // drive letter on OS/2
-                       s = AddName(MakeAbsPath("/tmp/"), buf->fileName());
-               }
-               s += ".emergency";
-               
-               lyxerr << "  " << i + 1 << ") " << s << endl;
-               
-               if (buf->writeFile(s, true)) {
-                       buf->markLyxClean();
-                       lyxerr << _("  Save seems successful. Phew.") << endl;
-                       madeit = true;
-               } else if (i != 2) {
-                       lyxerr << _("  Save failed! Trying...") << endl;
-               } else {
-                       lyxerr << _("  Save failed! Bummer. Document is lost.")
-                              << endl;
-               }
-       }
-#else
        // We try to save three places:
 
        // 1) Same place as document. Unless it is an unnamed doc.
@@ -375,7 +331,6 @@ void BufferList::emergencyWrite(Buffer * buf)
                return;
        }
        lyxerr << _("  Save failed! Bummer. Document is lost.") << endl;
-#endif
 }
 
 
index c3418377fc189ffbd237d9eb4afdc28f1c09b962..ae15380f54ddf1dbf4f4440a7674a78aa2a94b0a 100644 (file)
@@ -57,7 +57,7 @@ BufferParams::BufferParams()
        sides = LyXTextClass::OneSide;
        columns = 1;
        pagestyle = "default";
-       for(int iter = 0; iter < 4; ++iter) {
+       for (int iter = 0; iter < 4; ++iter) {
                user_defined_bullets[iter] = temp_bullets[iter] 
                                           = ITEMIZE_DEFAULTS[iter];
        }
@@ -139,7 +139,7 @@ void BufferParams::writeFile(ostream & os) const
           << "\n\\defskip " << defskip.asLyXCommand()
           << "\n\\quotes_language "
           << string_quotes_language[quotes_language] << '\n';
-       switch(quotes_times) {
+       switch (quotes_times) {
                // An output operator for insetquotes would be nice
        case InsetQuotes::SingleQ:
                os << "\\quotes_times 1\n"; break;
index bee3d125049555fc97abc4c2a8a7209957bf54a5..b472f8628d90fdb30ce122c96984493f8efd65f3 100644 (file)
@@ -160,7 +160,7 @@ void Combox::add(int x, int y, int w, int hmin, int hmax)
 {  
        FL_OBJECT * obj;
        
-       switch(type) {
+       switch (type) {
        case FL_COMBOX_DROPLIST:
        {
                button = obj = fl_add_button(FL_NORMAL_BUTTON,
index c84d89f27043c0655b1a87a6c1876f8eb9319369..adffe4c210ae31c47229be88c1449648ad0b299f 100644 (file)
@@ -58,8 +58,8 @@ enum kb_action {
        LFUN_ROMAN,
        LFUN_NOUN,
        LFUN_RIGHT,
-       LFUN_LEFT,
-       LFUN_UP,    // 40
+       LFUN_LEFT,  // 40
+       LFUN_UP,
        LFUN_DOWN,
        LFUN_PRIOR,
        LFUN_NEXT,
@@ -68,8 +68,8 @@ enum kb_action {
        LFUN_TAB,
        LFUN_SHIFT_TAB, // Jug 20000522
        LFUN_WORDRIGHT,
-       LFUN_WORDLEFT,
-       LFUN_BEGINNINGBUF,   // 50
+       LFUN_WORDLEFT,   // 50
+       LFUN_BEGINNINGBUF,
        LFUN_ENDBUF,
        LFUN_RIGHTSEL,
        LFUN_LEFTSEL,
@@ -78,8 +78,8 @@ enum kb_action {
        LFUN_PRIORSEL,
        LFUN_NEXTSEL,
        LFUN_HOMESEL,
-       LFUN_ENDSEL,
-       LFUN_WORDRIGHTSEL, // 60
+       LFUN_ENDSEL,  // 60
+       LFUN_WORDRIGHTSEL,
        LFUN_WORDLEFTSEL,
        LFUN_BEGINNINGBUFSEL,
        LFUN_ENDBUFSEL,
@@ -88,8 +88,8 @@ enum kb_action {
        LFUN_DELETE,
        LFUN_BACKSPACE,
        LFUN_BREAKLINE,
-       LFUN_BREAKPARAGRAPH,
-       LFUN_BREAKPARAGRAPHKEEPLAYOUT, // 70
+       LFUN_BREAKPARAGRAPH, // 70
+       LFUN_BREAKPARAGRAPHKEEPLAYOUT,
        LFUN_QUOTE,
        LFUN_CIRCUMFLEX,
        LFUN_GRAVE,
@@ -98,8 +98,8 @@ enum kb_action {
        LFUN_CEDILLA,
        LFUN_MACRON,
        LFUN_UNDERBAR,
-       LFUN_UNDERDOT,
-       LFUN_CIRCLE,  // 80
+       LFUN_UNDERDOT, // 80
+       LFUN_CIRCLE,
        LFUN_TIE,
        LFUN_BREVE,
        LFUN_CARON,
@@ -108,8 +108,8 @@ enum kb_action {
        LFUN_UMLAUT,
        LFUN_DOT,
        LFUN_OGONEK,
-       LFUN_VECTOR,        //  Alejandro 040696
-       LFUN_SELFINSERT,  // 90
+       LFUN_VECTOR,        //  Alejandro 040696 // 90
+       LFUN_SELFINSERT,
        LFUN_GETBUFNAME,
        LFUN_GETXY,
        LFUN_SETXY,
@@ -118,8 +118,8 @@ enum kb_action {
        LFUN_GETLAYOUT,
        LFUN_GETFONT,
        LFUN_GETLATEX,
-       LFUN_GETNAME,
-       LFUN_NOTIFY,  // 100
+       LFUN_GETNAME, // 100
+       LFUN_NOTIFY,
         LFUN_GOTOFILEROW,   // Edmar 12/23/98
        LFUN_INSERT_NOTE,
        LFUN_KMAP_OFF,
@@ -128,8 +128,8 @@ enum kb_action {
        LFUN_KMAP_TOGGLE,
        LFUN_INSERT_MATH,
        LFUN_INSERT_MATRIX,
-       LFUN_GREEK,
-       LFUN_MATH_LIMITS, // 110  
+       LFUN_GREEK,  // 110
+       LFUN_MATH_LIMITS,
        LFUN_GREEK_TOGGLE,
        LFUN_MATH_DELIM,    //  Alejandro 180696
        LFUN_MATH_DISPLAY,  // was INSERT_EQUATION  Alejandro 180696
@@ -138,8 +138,8 @@ enum kb_action {
        LFUN_MATH_NONUMBER,   //  Alejandro 180696
        LFUN_MATH_SIZE,   //  Alejandro 150896
        LFUN_MATH_MACRO, // ale970510
-       LFUN_MATH_MACROARG,  // ale970510
-       LFUN_MATH_PANEL, // 120
+       LFUN_MATH_MACROARG,  // ale970510  // 120
+       LFUN_MATH_PANEL,
        LFUN_FIGURE,
        LFUN_MELT,
        LFUN_DELETE_WORD_FORWARD,
@@ -148,8 +148,8 @@ enum kb_action {
        LFUN_MARK_OFF,
        LFUN_MARK_ON,
        LFUN_LAYOUT,
-       LFUN_LAYOUTNO,    // Lgb 97-06-10
-       LFUN_LAYOUT_CHARACTER,  // 130
+       LFUN_LAYOUTNO,    // Lgb 97-06-10  // 130
+       LFUN_LAYOUT_CHARACTER,
        LFUN_LAYOUT_PARAGRAPH,
        LFUN_LAYOUT_DOCUMENT,
        LFUN_LAYOUT_PREAMBLE,
@@ -158,8 +158,8 @@ enum kb_action {
        LFUN_CODE,
        LFUN_SANS,
        LFUN_DEFAULT,
-       LFUN_UNDERLINE,
-       LFUN_FONT_SIZE, // 140
+       LFUN_UNDERLINE,  // 140
+       LFUN_FONT_SIZE,
        LFUN_FONT_STATE,
        LFUN_UPCASE_WORD,
        LFUN_LOWCASE_WORD,
@@ -168,8 +168,8 @@ enum kb_action {
        LFUN_REF_INSERT,
        LFUN_PUSH_TOOLBAR,
        LFUN_ADD_TO_TOOLBAR,
-       LFUN_DEPTH_MIN,                // RVDK_PATCH_5
-       LFUN_DEPTH_PLUS,  // 150             // RVDK_PATCH_5
+       LFUN_DEPTH_MIN,   // 150             // RVDK_PATCH_5
+       LFUN_DEPTH_PLUS,                     // RVDK_PATCH_5
        LFUN_MENU_OPEN_BY_NAME,              // RVDK_PATCH_5
        LFUN_SPELLCHECK,                     // RVDK_PATCH_5
        LFUN_CANCEL,                         // RVDK_PATCH_5
@@ -178,8 +178,8 @@ enum kb_action {
        LFUN_FILE_INSERT,
        LFUN_FILE_INSERT_ASCII,         // CFO-G 1997-11-19
        LFUN_FILE_NEW,
-       LFUN_FILE_OPEN,
-       LFUN_UP_PARAGRAPH,  // 160     // Asger 1996-10-01
+       LFUN_FILE_OPEN,  // 160
+       LFUN_UP_PARAGRAPH,              // Asger 1996-10-01
        LFUN_UP_PARAGRAPHSEL,           // Asger 1996-10-01
        LFUN_DOWN_PARAGRAPH,            // Asger 1996-10-01
        LFUN_DOWN_PARAGRAPHSEL,         // Asger 1996-10-01
index 3eca8ca3ede88863cc09cd8c198ddaccd67770c1..6ac0321f99d33fb16afcb288ad7abc062f941de4 100644 (file)
@@ -70,7 +70,7 @@ protected: // methods
        /** Filter the inputs on callback from xforms
            Return true if inputs are valid.
         */
-       virtual bool input( FL_OBJECT *, long ) {
+       virtual bool input( FL_OBJECT *, long) {
                return true;
        }
        /// Apply from dialog (modify or create inset)
index d0dff54ef84614a1fc7385817f91398f65962b7a..8cdcfac7e690dc659cdedc504e3bbd45aef04df6 100644 (file)
@@ -52,7 +52,7 @@ FormCitation::~FormCitation()
 
 FL_FORM * FormCitation::form() const
 {
-       if ( dialog_ ) return dialog_->form;
+       if (dialog_ ) return dialog_->form;
        return 0;
 }
 
@@ -99,7 +99,7 @@ void FormCitation::update()
        vector<pair<string,string> > blist =
                lv_->buffer()->getBibkeyList();
 
-       for( unsigned int i = 0; i < blist.size(); ++i ) {
+       for (unsigned int i = 0; i < blist.size(); ++i) {
                bibkeys.push_back(blist[i].first);
                bibkeysInfo.push_back(blist[i].second);
        }
@@ -108,7 +108,7 @@ void FormCitation::update()
        citekeys.clear();
        string tmp, keys( params.getContents() );
        keys = frontStrip( split(keys, tmp, ',') );
-       while( !tmp.empty() ) {
+       while (!tmp.empty()) {
                citekeys.push_back( tmp );
                keys = frontStrip( split(keys, tmp, ',') );
        }
@@ -140,7 +140,7 @@ void FormCitation::updateBrowser( FL_OBJECT * browser,
 {
        fl_clear_browser( browser );
 
-       forunsigned int i = 0; i < keys.size(); ++i )
+       for (unsigned int i = 0; i < keys.size(); ++i )
                fl_add_browser_line( browser, keys[i].c_str());
 }
 
@@ -166,7 +166,7 @@ void FormCitation::setBibButtons( State status ) const
 
 void FormCitation::setCiteButtons( State status ) const
 {
-       switch( status ) {
+       switch (status) {
        case ON:
         {
                fl_activate_object( dialog_->delBtn );
@@ -174,7 +174,7 @@ void FormCitation::setCiteButtons( State status ) const
 
                int sel = fl_get_browser( dialog_->citeBrsr );
 
-               if ( sel != 1 ) {
+               if (sel != 1) {
                        fl_activate_object( dialog_->upBtn );
                        fl_set_object_lcol( dialog_->upBtn, FL_BLACK );
                } else {
@@ -182,7 +182,7 @@ void FormCitation::setCiteButtons( State status ) const
                        fl_set_object_lcol( dialog_->upBtn, FL_INACTIVE );
                }
 
-               if ( sel != fl_get_browser_maxline(dialog_->citeBrsr)) {
+               if (sel != fl_get_browser_maxline(dialog_->citeBrsr)) {
                        fl_activate_object( dialog_->downBtn );
                        fl_set_object_lcol( dialog_->downBtn, FL_BLACK );
                } else {
@@ -233,11 +233,11 @@ void FormCitation::setSize( int hbrsr, bool bibPresent ) const
        static int const hok    = dialog_->button_ok->h;
 
        int hform = dh1 + hbrsr + dh1;
-       if ( bibPresent ) hform += hinfo + dh1;
-       if ( natbib ) hform += hstyle + dh1 + htext + dh2;
+       if (bibPresent ) hform += hinfo + dh1;
+       if (natbib ) hform += hstyle + dh1 + htext + dh2;
        hform += htext + dh1 + hok + dh2;
 
-       if ( hform != minh_ ) {
+       if (hform != minh_) {
                minh_ = hform;
                fl_set_form_size( dialog_->form, minw_, minh_ );
        } else
@@ -264,7 +264,7 @@ void FormCitation::setSize( int hbrsr, bool bibPresent ) const
 
        y = dh1 + hbrsr + dh1; // in position for next element
 
-       if ( bibPresent ) {
+       if (bibPresent) {
                x = dialog_->infoBrsr->x;
                fl_set_object_position( dialog_->infoBrsr, x, y );
                fl_show_object( dialog_->infoBrsr );
@@ -272,7 +272,7 @@ void FormCitation::setSize( int hbrsr, bool bibPresent ) const
        } else
                fl_hide_object( dialog_->infoBrsr );
 
-       if ( natbib ) {
+       if (natbib) {
                x = dialog_->style->x;
                fl_set_object_position( dialog_->style, x, y );
                fl_show_object( dialog_->style );
@@ -309,13 +309,13 @@ bool FormCitation::input( FL_OBJECT *, long data )
        bool activate = false;
        State cb = static_cast<State>( data );
 
-       switch( cb ) {
+       switch (cb) {
        case BIBBRSR:
        {
                fl_deselect_browser( dialog_->citeBrsr );
                
                unsigned int sel = fl_get_browser( dialog_->bibBrsr );
-               if ( sel < 1 || sel > bibkeys.size() ) break;
+               if (sel < 1 || sel > bibkeys.size() ) break;
 
                // Put into infoBrsr the additional info associated with
                // the selected bibBrsr key
@@ -327,14 +327,14 @@ bool FormCitation::input( FL_OBJECT *, long data )
                vector<string>::iterator it =
                        find( citekeys.begin(), citekeys.end(), bibkeys[sel-1] );
 
-               if ( it != citekeys.end() ) {
+               if (it != citekeys.end()) {
                        int n = static_cast<int>( it - citekeys.begin() );
                        fl_select_browser_line( dialog_->citeBrsr, n+1 );
                        fl_set_browser_topline( dialog_->citeBrsr, n+1 );
                }
 
-               if ( !lv_->buffer()->isReadonly() ) {
-                       if ( it != citekeys.end() ) {
+               if (!lv_->buffer()->isReadonly()) {
+                       if (it != citekeys.end()) {
                                setBibButtons( OFF );
                                setCiteButtons( ON );
                        } else {
@@ -347,9 +347,9 @@ bool FormCitation::input( FL_OBJECT *, long data )
        case CITEBRSR:
        {
                unsigned int sel = fl_get_browser( dialog_->citeBrsr );
-               if ( sel < 1 || sel > citekeys.size() ) break;
+               if (sel < 1 || sel > citekeys.size() ) break;
 
-               if ( !lv_->buffer()->isReadonly() ) {
+               if (!lv_->buffer()->isReadonly()) {
                        setBibButtons( OFF );
                        setCiteButtons( ON );
                }
@@ -373,10 +373,10 @@ bool FormCitation::input( FL_OBJECT *, long data )
        break;
        case ADD:
        {
-               if ( lv_->buffer()->isReadonly() ) break;
+               if (lv_->buffer()->isReadonly() ) break;
 
                unsigned int sel = fl_get_browser( dialog_->bibBrsr );
-               if ( sel < 1 || sel > bibkeys.size() ) break;
+               if (sel < 1 || sel > bibkeys.size() ) break;
 
                // Add the selected bibBrsr key to citeBrsr
                fl_addto_browser( dialog_->citeBrsr,
@@ -393,10 +393,10 @@ bool FormCitation::input( FL_OBJECT *, long data )
        break;
        case DELETE:
        {
-               if ( lv_->buffer()->isReadonly() ) break;
+               if (lv_->buffer()->isReadonly() ) break;
 
                unsigned int sel = fl_get_browser( dialog_->citeBrsr );
-               if ( sel < 1 || sel > citekeys.size() ) break;
+               if (sel < 1 || sel > citekeys.size() ) break;
 
                // Remove the selected key from citeBrsr
                fl_delete_browser_line( dialog_->citeBrsr, sel ) ;
@@ -409,10 +409,10 @@ bool FormCitation::input( FL_OBJECT *, long data )
        break;
        case UP:
        {
-               if ( lv_->buffer()->isReadonly() ) break;
+               if (lv_->buffer()->isReadonly() ) break;
 
                unsigned int sel = fl_get_browser( dialog_->citeBrsr );
-               if ( sel < 2 || sel > citekeys.size() ) break;
+               if (sel < 2 || sel > citekeys.size() ) break;
 
                // Move the selected key up one line
                vector<string>::iterator it = citekeys.begin() + sel-1;
@@ -430,10 +430,10 @@ bool FormCitation::input( FL_OBJECT *, long data )
        break;
        case DOWN:
        {
-               if ( lv_->buffer()->isReadonly() ) break;
+               if (lv_->buffer()->isReadonly() ) break;
 
                unsigned int sel = fl_get_browser( dialog_->citeBrsr );
-               if ( sel < 1 || sel > citekeys.size()-1 ) break;
+               if (sel < 1 || sel > citekeys.size()-1 ) break;
 
                // Move the selected key down one line
                vector<string>::iterator it = citekeys.begin() + sel-1;
@@ -461,7 +461,7 @@ void FormCitation::apply()
        if (lv_->buffer()->isReadonly()) return;
 
        string contents;
-       for(unsigned int i = 0; i < citekeys.size(); ++i) {
+       for (unsigned int i = 0; i < citekeys.size(); ++i) {
                if (i > 0) contents += ", ";
                contents += citekeys[i];
        }
index 0cef3ce770b7d69240c3aeeea52a5218fdb4895b..b215e73efc0ce1c16349d3158f480ab177a9a480 100644 (file)
@@ -34,7 +34,7 @@ FormCopyright::~FormCopyright()
 
 FL_FORM * FormCopyright::form() const
 {
-       if ( dialog_ ) return dialog_->form;
+       if (dialog_ ) return dialog_->form;
        return 0;
 }
 
index 2c47d4c7e7d861a5f0bdec2b6b19eee94babf703..e05395849d63eebced5f516d16380eee53a9ab20 100644 (file)
@@ -209,7 +209,7 @@ void FormDocument::build()
 #ifdef DO_USE_DEFAULT_LANGUAGE
     combo_language->addto("default");
 #endif
-    for(Languages::const_iterator cit = languages.begin();
+    for (Languages::const_iterator cit = languages.begin();
        cit != languages.end(); ++cit) {
        combo_language->addto((*cit).second.lang());
     }
@@ -324,7 +324,7 @@ bool FormDocument::input( FL_OBJECT * ob, long data )
 {
        State cb = static_cast<State>( data );
 
-       switch( cb ) {
+       switch (cb) {
        case CHECKCHOICECLASS:
                CheckChoiceClass(ob, 0);
                break;
@@ -355,7 +355,7 @@ bool FormDocument::input( FL_OBJECT * ob, long data )
                break;
        }
        
-       switch( data ) {
+       switch (data) {
        case INPUT:
        case CHECKCHOICECLASS:
        case CHOICEBULLETSIZE:
@@ -476,7 +476,7 @@ bool FormDocument::class_apply()
                params.sides = LyXTextClass::OneSide;
        
        Spacing tmpSpacing = params.spacing;
-       switch(fl_get_choice(class_->choice_doc_spacing)) {
+       switch (fl_get_choice(class_->choice_doc_spacing)) {
        case 1:
                lyxerr[Debug::INFO] << "Spacing: SINGLE\n";
                params.spacing.set(Spacing::Single);
@@ -536,7 +536,7 @@ bool FormDocument::language_apply()
     InsetQuotes::quote_language lga = InsetQuotes::EnglishQ;
     bool redo = false;
 
-    switch(fl_get_choice(language_->choice_quotes_language) - 1) {
+    switch (fl_get_choice(language_->choice_quotes_language) - 1) {
     case 0:
        lga = InsetQuotes::EnglishQ;
        break;
@@ -952,13 +952,13 @@ void FormDocument::BulletDepth(FL_OBJECT * ob, State cb)
     BufferParams & param = lv_->buffer()->params;
 
     int data = 0;
-    ifcb == 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)) {
@@ -981,17 +981,17 @@ void FormDocument::BulletPanel(FL_OBJECT * /*ob*/, State cb)
     /* by the user. (eg. standard.xpm, psnfss1.xpm etc...)           */
     
     int data = 0;
-    ifcb == 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) {
index bdc2110f9055b84ce5a502688c8d4f5c2f069c75..b481b29d3a37847039998f5c55e10ce720b7e074 100644 (file)
@@ -39,7 +39,7 @@ FormError::~FormError()
 
 FL_FORM * FormError::form() const
 {
-       if ( dialog_ ) return dialog_->form;
+       if (dialog_ ) return dialog_->form;
        return 0;
 }
 
index 49cb50d87de065fa2f56fb950717b2548739ad51..c5d80831391088a0e0d9401446f0db161b247841 100644 (file)
@@ -147,7 +147,7 @@ void FormGraphics::build()
 
 FL_FORM * FormGraphics::form() const
 {
-       if ( dialog_ ) return dialog_->form;
+       if (dialog_ ) return dialog_->form;
        return 0;
 }
 
@@ -279,7 +279,7 @@ bool FormGraphics::input(FL_OBJECT *, long data )
 
        bool inputOK = true;
 
-       switch( cb ) {
+       switch (cb) {
        case CHECKINPUT:
                inputOK = checkInput();
                break;
index 45bcebe8dc2a4e41d21dc18d66ac2906853f9f77..fffc92d7427100c238c414cfc34c57977ab5c174 100644 (file)
@@ -44,7 +44,7 @@ FormIndex::~FormIndex()
 
 FL_FORM * FormIndex::form() const
 {
-       if ( dialog_ ) return dialog_->form;
+       if (dialog_ ) return dialog_->form;
        return 0;
 }
 
@@ -73,7 +73,7 @@ void FormIndex::update()
 {
        fl_set_input(dialog_->key, params.getContents().c_str());
 
-       if ( lv_->buffer()->isReadonly() ) {
+       if (lv_->buffer()->isReadonly()) {
                fl_deactivate_object( dialog_->key );
                fl_deactivate_object( dialog_->ok );
                fl_set_object_lcol( dialog_->ok, FL_INACTIVE );
index 0f9beea210d1f31ca2268c9f534332dd09787e7b..67f49a8d430474781abcab76ab418aada9e1bc4d 100644 (file)
@@ -469,7 +469,7 @@ void FormParagraph::extra_update()
                 par->pextra_width.c_str());
     fl_set_input(extra_->input_pextra_widthp,
                 par->pextra_widthp.c_str());
-    switch(par->pextra_alignment) {
+    switch (par->pextra_alignment) {
     case LyXParagraph::MINIPAGE_ALIGN_TOP:
        fl_set_button(extra_->radio_pextra_top, 1);
        break;
index 6ac12145236f04e6fe809dbb869405ad5c03384a..b7b3b5e13be5ac9775bb702a7ceac81eca758c4e 100644 (file)
@@ -46,7 +46,7 @@ extern Languages languages;
 typedef pair<string, FormPreferences::RGB> X11Colour;
 
 static vector<X11Colour> colourDB;
-static string const colourFile = "/usr/lib/X11/rgb.txt";
+static string const colourFile("/usr/lib/X11/rgb.txt");
 
 
 FormPreferences::FormPreferences(LyXView * lv, Dialogs * d)
@@ -260,29 +260,29 @@ void FormPreferences::feedback( FL_OBJECT * ob )
 {
        string str;
 
-       if( ob->form->fdui == colours_ ) {
+       if (ob->form->fdui == colours_) {
                str = feedbackColours( ob );
-       } else if( ob->form->fdui == converters_ ) {
+       } else if (ob->form->fdui == converters_) {
                str = feedbackConverters( ob );
-       } else if( ob->form->fdui == formats_ ) {
+       } else if (ob->form->fdui == formats_) {
                str = feedbackFormats( ob );
-       } else if( ob->form->fdui == inputs_misc_ ) {
+       } else if (ob->form->fdui == inputs_misc_) {
                str = feedbackInputsMisc( ob );
-       } else if( ob->form->fdui == interface_ ) {
+       } else if (ob->form->fdui == interface_) {
                str = feedbackInterface( ob );
-       } else if( ob->form->fdui == language_ ) {
+       } else if (ob->form->fdui == language_) {
                str = feedbackLanguage( ob );
-       } else if( ob->form->fdui == lnf_misc_ ) {
+       } else if (ob->form->fdui == lnf_misc_) {
                str = feedbackLnFmisc( ob );
-       } else if( ob->form->fdui == outputs_misc_ ) {
+       } else if (ob->form->fdui == outputs_misc_) {
                str = feedbackOutputsMisc( ob );
-       } else if( ob->form->fdui == paths_ ) {
+       } else if (ob->form->fdui == paths_) {
                str = feedbackPaths( ob );
-       } else if( ob->form->fdui == printer_ ) {
+       } else if (ob->form->fdui == printer_) {
                str = feedbackPrinter( ob );
-       } else if( ob->form->fdui == screen_fonts_ ) {
+       } else if (ob->form->fdui == screen_fonts_) {
                str = feedbackScreenFonts( ob );
-       } else if( ob->form->fdui == spellchecker_ ) {
+       } else if (ob->form->fdui == spellchecker_) {
                str = feedbackSpellChecker( ob );
        }
 
@@ -302,20 +302,20 @@ bool FormPreferences::input(FL_OBJECT * ob, long)
        // some totally ridiculous value somewhere.  Change activate to suit.
        // comments before each test describe what is _valid_
 
-       if( ob->form->fdui == colours_ ) {
-               if! inputColours( ob ) )
+       if (ob->form->fdui == colours_) {
+               if (! inputColours( ob ) )
                        activate = false;
-       } else if( ob->form->fdui == language_ ) {
-               if! inputLanguage( ob ) )
+       } else if (ob->form->fdui == language_) {
+               if (! inputLanguage( ob ) )
                        activate = false;
-       } else if( ob->form->fdui == paths_ ) {
-               if! inputPaths( ob ) )
+       } else if (ob->form->fdui == paths_) {
+               if (! inputPaths( ob ) )
                        activate = false;
-       } else if( ob->form->fdui == screen_fonts_ ) {
-               if! inputScreenFonts() )
+       } else if (ob->form->fdui == screen_fonts_) {
+               if (! inputScreenFonts() )
                        activate = false;
-       } else if( ob->form->fdui == spellchecker_ ) {
-               if! inputSpellChecker( ob ) )
+       } else if (ob->form->fdui == spellchecker_) {
+               if (! inputSpellChecker( ob ) )
                        activate = false;
        }
 
@@ -373,7 +373,7 @@ void FormPreferences::buildColours()
        
        fl_set_input_return(colours_->input_name, FL_RETURN_END_CHANGED);
 
-       ifColoursLoadBrowser(colourFile) )
+       if (ColoursLoadBrowser(colourFile) )
                fl_set_input(colours_->input_name, colourFile.c_str());
        else
                fl_set_input(colours_->input_name, N_("No file found"));
@@ -384,7 +384,7 @@ void FormPreferences::buildColours()
 }
 
 
-string FormPreferences::feedbackColours( FL_OBJECT const * const ) const
+string const FormPreferences::feedbackColours( FL_OBJECT const * const ) const
 {
        return string();
 }
@@ -394,22 +394,22 @@ bool FormPreferences::inputColours( FL_OBJECT const * const ob )
 {
        bool activate = true;
        
-       if( ob == colours_->browser_x11 ) {
+       if (ob == colours_->browser_x11) {
                int i = fl_get_browser(colours_->browser_x11);
-               ifi > 0) {
+               if (i > 0) {
                        ColoursUpdateBrowser(i-1);
                }
 
-       } else ifob == colours_->valslider_red
+       } else if (ob == colours_->valslider_red
                   || ob == colours_->valslider_green
-                  || ob == colours_->valslider_blue ) {
+                  || ob == colours_->valslider_blue) {
                ColoursUpdateRGB();
 
-       } else ifob == colours_->input_name) {
+       } else if (ob == colours_->input_name) {
                string file = fl_get_input(colours_->input_name);
-               ifColoursLoadBrowser(file) )
+               if (ColoursLoadBrowser(file) )
                        fl_set_input(colours_->input_name, file.c_str());
-               else ifColoursLoadBrowser(colourFile) )
+               else if (ColoursLoadBrowser(colourFile) )
                        fl_set_input(colours_->input_name, colourFile.c_str());
                else
                        fl_set_input(colours_->input_name, N_("No file found"));
@@ -419,7 +419,7 @@ bool FormPreferences::inputColours( FL_OBJECT const * const ob )
 }
 
 
-bool FormPreferences::ColoursLoadBrowser( string const & filename )
+bool FormPreferences::ColoursLoadBrowser(string const & filename)
 {
        LyXLex lex(0, 0);
 
@@ -432,38 +432,38 @@ bool FormPreferences::ColoursLoadBrowser( string const & filename )
        vector<RGB> cols;
        vector<string> names;
        
-       while( 1 ) {
+       while (true) {
                getline( is, line );
-               ifline.empty() )
+               if (line.empty() )
                        break;
 
-               if( line[0] != '!' ) {
+               if (line[0] != '!') {
                        RGB col;
                        string name;
                        
                        istringstream iss(line);
                        iss >> col.r >> col.g >> col.b;
-                       while( iss.good() ) {
+                       while (iss.good()) {
                                string next;
                                iss >> next;
-                               if!name.empty() ) name += " ";
+                               if (!name.empty() ) name += " ";
                                name += next;
                        }
 
                        // remove redundant entries on the fly
                        bool add = cols.empty();
-                       if( !add ) {
+                       if (!add) {
                                vector<RGB>::const_iterator it =
                                        find( cols.begin(), cols.end(), col );
                                add = (it == cols.end());
                        }
                        
-                       if ( add ) {
+                       if (add) {
                                name = lowercase( name );
-                               ifname == "gray0" )   name = "black";
-                               ifname == "gray100" ) name = "white";
+                               if (name == "gray0" )   name = "black";
+                               if (name == "gray100" ) name = "white";
 
-                               if( name == "black" || name == "white" ) {
+                               if (name == "black" || name == "white") {
                                        cols.insert(cols.begin(), col);
                                        names.insert(names.begin(), name);
                                } else {
@@ -475,8 +475,8 @@ bool FormPreferences::ColoursLoadBrowser( string const & filename )
        }
 
        vector<string>::iterator sit = names.begin();
-       forvector<RGB>::const_iterator iit = cols.begin();
-            iit != cols.end(); ++iit, ++sit ) {
+       for (vector<RGB>::const_iterator iit = cols.begin();
+            iit != cols.end(); ++iit, ++sit) {
                colourDB.push_back( X11Colour(*sit, *iit) );
        }
        
@@ -484,8 +484,8 @@ bool FormPreferences::ColoursLoadBrowser( string const & filename )
        fl_freeze_form(colours_->form);
        fl_clear_browser( colbr );
 
-       forvector<X11Colour>::const_iterator cit = colourDB.begin();
-            cit != colourDB.end(); ++cit ) {
+       for (vector<X11Colour>::const_iterator cit = colourDB.begin();
+            cit != colourDB.end(); ++cit) {
                string name = (*cit).first;
                //RGB col     = (*cit).second;
                //name += "  (" + tostr(col.r) + ", " + tostr(col.g) +
@@ -502,13 +502,13 @@ bool FormPreferences::ColoursLoadBrowser( string const & filename )
 }
 
 
-int FormPreferences::ColoursSearchEntry(RGB const & col ) const
+int FormPreferences::ColoursSearchEntry(RGB const & col) const
 {
        int mindiff = 0x7fffffff;
        vector<X11Colour>::const_iterator mincit = colourDB.begin();
 
-       forvector<X11Colour>::const_iterator cit = colourDB.begin();
-            cit != colourDB.end(); ++cit ) {
+       for (vector<X11Colour>::const_iterator cit = colourDB.begin();
+            cit != colourDB.end(); ++cit) {
                RGB colDB = (*cit).second;
                RGB diff;
                diff.r = col.r - colDB.r;
@@ -519,7 +519,7 @@ int FormPreferences::ColoursSearchEntry(RGB const & col ) const
                         3 * (diff.g * diff.g) +
                             (diff.b * diff.b));
 
-               if( mindiff > d ) {
+               if (mindiff > d) {
                        mindiff = d;
                        mincit = cit;
                }
@@ -560,7 +560,7 @@ void FormPreferences::ColoursUpdateRGB()
        int i = ColoursSearchEntry( col );
        // change topline only if necessary
        // int top = fl_get_browser_topline(colours_->browser_x11);
-       // if(i < top || i > (top+15))
+       // if (i < top || i > (top+15))
        fl_set_browser_topline(colours_->browser_x11, i-5);
        fl_select_browser_line(colours_->browser_x11, i + 1);
 
@@ -569,13 +569,11 @@ void FormPreferences::ColoursUpdateRGB()
 
 
 void FormPreferences::updateColours()
-{
-}
+{}
 
 
 void FormPreferences::applyConverters() const
-{
-}
+{}
 
 
 void FormPreferences::buildConverters()
@@ -585,20 +583,19 @@ void FormPreferences::buildConverters()
 }
 
 
-string FormPreferences::feedbackConverters( FL_OBJECT const * const ) const
+string const
+FormPreferences::feedbackConverters( FL_OBJECT const * const ) const
 {
        return string();
 }
 
 
 void FormPreferences::updateConverters()
-{
-}
+{}
 
 
 void FormPreferences::applyFormats() const
-{
-}
+{}
 
 
 void FormPreferences::buildFormats()
@@ -614,7 +611,7 @@ void FormPreferences::buildFormats()
 }
 
 
-string FormPreferences::feedbackFormats( FL_OBJECT const * const ) const
+string const FormPreferences::feedbackFormats( FL_OBJECT const * const ) const
 {
        string str;
 
@@ -629,13 +626,13 @@ bool FormPreferences::inputFormats( FL_OBJECT const * const )
 
 
 void FormPreferences::updateFormats()
-{
-}
+{}
 
 
 void FormPreferences::applyInputsMisc() const
 {
-       lyxrc.date_insert_format = fl_get_input(inputs_misc_->input_date_format);
+       lyxrc.date_insert_format =
+               fl_get_input(inputs_misc_->input_date_format);
 }
 
 
@@ -655,11 +652,12 @@ void FormPreferences::buildInputsMisc()
 }
 
 
-string FormPreferences::feedbackInputsMisc( FL_OBJECT const * const ob ) const
+string const
+FormPreferences::feedbackInputsMisc(FL_OBJECT const * const ob) const
 {
        string str;
 
-       ifob == inputs_misc_->input_date_format )
+       if (ob == inputs_misc_->input_date_format )
                str = lyxrc.getDescription( LyXRC::RC_DATE_INSERT_FORMAT );
 
        return str;
@@ -720,22 +718,22 @@ void FormPreferences::buildInterface()
 }
 
 
-
-string FormPreferences::feedbackInterface( FL_OBJECT const * const ob ) const
+string const
+FormPreferences::feedbackInterface( FL_OBJECT const * const ob ) const
 {
        string str;
 
-       ifob == interface_->input_popup_font )
+       if (ob == interface_->input_popup_font )
                str = lyxrc.getDescription( LyXRC::RC_SCREEN_FONT_POPUP );
-       else if ( ob == interface_->input_menu_font )
+       else if (ob == interface_->input_menu_font )
                str = lyxrc.getDescription( LyXRC::RC_SCREEN_FONT_MENU );
-       else if ( ob == interface_->input_popup_encoding )
+       else if (ob == interface_->input_popup_encoding )
                str = lyxrc.getDescription( LyXRC::RC_SCREEN_FONT_ENCODING_MENU );
-       else if ( ob == interface_->input_bind_file )
+       else if (ob == interface_->input_bind_file )
                str = lyxrc.getDescription( LyXRC::RC_BINDFILE );
-       else if ( ob == interface_->input_ui_file )
+       else if (ob == interface_->input_ui_file )
                str = lyxrc.getDescription( LyXRC::RC_UIFILE );
-       else if ( ob == interface_->check_override_x_dead_keys )
+       else if (ob == interface_->check_override_x_dead_keys )
                str = lyxrc.getDescription( LyXRC::RC_OVERRIDE_X_DEADKEYS );
 
        return str;
@@ -766,7 +764,7 @@ void FormPreferences::applyLanguage() const
        int button = fl_get_button(language_->check_use_kbmap);
        lyxrc.use_kbmap = static_cast<bool>(button);
 
-       if( button ) {
+       if (button) {
            lyxrc.primary_kbmap = combo_kbmap_1->getline();
            lyxrc.secondary_kbmap = combo_kbmap_2->getline();
        }
@@ -853,31 +851,32 @@ void FormPreferences::buildLanguage()
 }
 
 
-string FormPreferences::feedbackLanguage( FL_OBJECT const * const ob ) const
+string const
+FormPreferences::feedbackLanguage(FL_OBJECT const * const ob) const
 {
        string str;
 
-       ifreinterpret_cast<Combox const *>(ob) == combo_default_lang )
+       if (reinterpret_cast<Combox const *>(ob) == combo_default_lang )
                str = lyxrc.getDescription( LyXRC::RC_DEFAULT_LANGUAGE );
-       else ifob == language_->check_use_kbmap )
+       else if (ob == language_->check_use_kbmap )
                str = lyxrc.getDescription( LyXRC::RC_KBMAP );
-       else ifreinterpret_cast<Combox const *>(ob) == combo_kbmap_1)
+       else if (reinterpret_cast<Combox const *>(ob) == combo_kbmap_1)
                str = lyxrc.getDescription( LyXRC::RC_KBMAP_PRIMARY );
-       else ifreinterpret_cast<Combox const *>(ob) == combo_kbmap_2 )
+       else if (reinterpret_cast<Combox const *>(ob) == combo_kbmap_2 )
                str = lyxrc.getDescription( LyXRC::RC_KBMAP_SECONDARY );
-       else ifob == language_->check_rtl_support )
+       else if (ob == language_->check_rtl_support )
                str = lyxrc.getDescription( LyXRC::RC_RTL_SUPPORT );
-       else ifob == language_->check_auto_begin )
+       else if (ob == language_->check_auto_begin )
                str = lyxrc.getDescription( LyXRC::RC_LANGUAGE_AUTO_BEGIN );
-       else ifob == language_->check_auto_end )
+       else if (ob == language_->check_auto_end )
                str = lyxrc.getDescription( LyXRC::RC_LANGUAGE_AUTO_END );
-       else ifob == language_->check_mark_foreign )
+       else if (ob == language_->check_mark_foreign )
                str = lyxrc.getDescription( LyXRC::RC_MARK_FOREIGN_LANGUAGE );
-       else ifob == language_->input_package )
+       else if (ob == language_->input_package )
                str = lyxrc.getDescription( LyXRC::RC_LANGUAGE_PACKAGE );
-       else ifob == language_->input_command_begin )
+       else if (ob == language_->input_command_begin )
                str = lyxrc.getDescription( LyXRC::RC_LANGUAGE_COMMAND_BEGIN );
-       else ifob == language_->input_command_end )
+       else if (ob == language_->input_command_end )
                str = lyxrc.getDescription( LyXRC::RC_LANGUAGE_COMMAND_END );
 
        return str;
@@ -888,8 +887,8 @@ bool FormPreferences::inputLanguage( FL_OBJECT const * const ob )
 {
        bool activate = true;
 
-       if( !ob || ob == language_->check_use_kbmap ) {
-               if( fl_get_button(language_->check_use_kbmap) ) {
+       if (!ob || ob == language_->check_use_kbmap) {
+               if (fl_get_button(language_->check_use_kbmap)) {
                        combo_kbmap_1->activate();
                        combo_kbmap_2->activate();
                } else {
@@ -909,7 +908,7 @@ void FormPreferences::updateLanguage()
 
        combo_default_lang->select_text( lyxrc.default_language );
 
-       if( lyxrc.use_kbmap ) {
+       if (lyxrc.use_kbmap) {
                combo_kbmap_1->select_text( lyxrc.primary_kbmap );
                combo_kbmap_2->select_text( lyxrc.secondary_kbmap );
        } else {
@@ -938,7 +937,7 @@ void FormPreferences::updateLanguage()
 
 void FormPreferences::LanguagesAdd( Combox & combo ) const
 {
-       for(Languages::const_iterator cit = languages.begin();
+       for (Languages::const_iterator cit = languages.begin();
            cit != languages.end(); cit++) {
                combo.addto((*cit).second.lang());
        }
@@ -988,30 +987,31 @@ void FormPreferences::buildLnFmisc()
 }
 
 
-string FormPreferences::feedbackLnFmisc( FL_OBJECT const * const ob ) const
+string const FormPreferences::feedbackLnFmisc(FL_OBJECT const * const ob) const
 {
        string str;
 
-       ifob == lnf_misc_->check_banner )
+       if (ob == lnf_misc_->check_banner )
                str = lyxrc.getDescription( LyXRC::RC_SHOW_BANNER );
-       else ifob == lnf_misc_->check_auto_region_delete )
+       else if (ob == lnf_misc_->check_auto_region_delete )
                str = lyxrc.getDescription( LyXRC::RC_AUTOREGIONDELETE );
-       else ifob == lnf_misc_->check_exit_confirm )
+       else if (ob == lnf_misc_->check_exit_confirm )
                str = lyxrc.getDescription( LyXRC::RC_EXIT_CONFIRMATION );
-       else ifob == lnf_misc_->check_display_shortcuts )
+       else if (ob == lnf_misc_->check_display_shortcuts )
                str = lyxrc.getDescription( LyXRC::RC_DISPLAY_SHORTCUTS );
-       else ifob == lnf_misc_->check_ask_new_file )
+       else if (ob == lnf_misc_->check_ask_new_file )
                str = lyxrc.getDescription( LyXRC::RC_NEW_ASK_FILENAME );
-       else ifob == lnf_misc_->check_cursor_follows_scrollbar )
+       else if (ob == lnf_misc_->check_cursor_follows_scrollbar )
                str = lyxrc.getDescription( LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR );
-       else ifob == lnf_misc_->counter_autosave )
+       else if (ob == lnf_misc_->counter_autosave )
                str = lyxrc.getDescription( LyXRC::RC_AUTOSAVE );
-       else ifob == lnf_misc_->counter_wm_jump )
+       else if (ob == lnf_misc_->counter_wm_jump )
                str = lyxrc.getDescription( LyXRC::RC_WHEEL_JUMP );
 
        return str;
 }
 
+
 void FormPreferences::updateLnFmisc()
 {
        fl_set_button(lnf_misc_->check_banner,
@@ -1076,19 +1076,20 @@ void FormPreferences::buildOutputsMisc()
 }
 
 
-string FormPreferences::feedbackOutputsMisc(FL_OBJECT const * const ob ) const
+string const
+FormPreferences::feedbackOutputsMisc(FL_OBJECT const * const ob) const
 {
        string str;
 
-       ifob == outputs_misc_->counter_line_len )
+       if (ob == outputs_misc_->counter_line_len )
                str = lyxrc.getDescription( LyXRC::RC_ASCII_LINELEN );
-       else ifob == outputs_misc_->input_tex_encoding )
+       else if (ob == outputs_misc_->input_tex_encoding )
                str = lyxrc.getDescription( LyXRC::RC_FONT_ENCODING );
-       else ifob == outputs_misc_->input_ascii_roff )
+       else if (ob == outputs_misc_->input_ascii_roff )
                str = lyxrc.getDescription( LyXRC::RC_ASCIIROFF_COMMAND );
-       else ifob == outputs_misc_->input_checktex )
+       else if (ob == outputs_misc_->input_checktex )
                str = lyxrc.getDescription( LyXRC::RC_CHKTEX_COMMAND );
-       else ifob == outputs_misc_->choice_default_papersize )
+       else if (ob == outputs_misc_->choice_default_papersize )
                str = lyxrc.getDescription( LyXRC::RC_DEFAULT_PAPERSIZE );
 
        return str;
@@ -1117,14 +1118,14 @@ void FormPreferences::applyPaths()
 
        int button = fl_get_button(paths_->check_use_temp_dir);
        string str  = fl_get_input(paths_->input_temp_dir);
-       if!button ) str.erase();
+       if (!button ) str.erase();
 
        lyxrc.use_tempdir = button;
        lyxrc.tempdir_path = str;
 
        button = fl_get_button(paths_->check_last_files);
        str = fl_get_input(paths_->input_lastfiles);
-       if!button ) str.erase();
+       if (!button ) str.erase();
        
        lyxrc.check_lastfiles = button;
        lyxrc.lastfiles = str;
@@ -1133,7 +1134,7 @@ void FormPreferences::applyPaths()
 
        button = fl_get_button(paths_->check_make_backups);
        str = fl_get_input(paths_->input_backup_path);
-       if!button ) str.erase();
+       if (!button ) str.erase();
 
        lyxrc.make_backup = button;
        lyxrc.backupdir_path = str;
@@ -1195,29 +1196,29 @@ void FormPreferences::buildPaths()
 }
 
 
-string FormPreferences::feedbackPaths( FL_OBJECT const * const ob ) const
+string const FormPreferences::feedbackPaths( FL_OBJECT const * const ob ) const
 {
        string str;
 
-       ifob == paths_->input_default_path )
+       if (ob == paths_->input_default_path )
                str = lyxrc.getDescription( LyXRC::RC_DOCUMENTPATH );
-       else if ( ob == paths_->input_template_path )
+       else if (ob == paths_->input_template_path )
                str = lyxrc.getDescription( LyXRC::RC_TEMPLATEPATH );
-       else if ( ob == paths_->check_use_temp_dir )
+       else if (ob == paths_->check_use_temp_dir )
                str = lyxrc.getDescription( LyXRC::RC_USETEMPDIR );
-       else if ( ob == paths_->input_temp_dir )
+       else if (ob == paths_->input_temp_dir )
                str = lyxrc.getDescription( LyXRC::RC_TEMPDIRPATH );
-       else if ( ob == paths_->check_last_files )
+       else if (ob == paths_->check_last_files )
                str = lyxrc.getDescription( LyXRC::RC_CHECKLASTFILES );
-       else if ( ob == paths_->input_lastfiles )
+       else if (ob == paths_->input_lastfiles )
                str = lyxrc.getDescription( LyXRC::RC_LASTFILES );
-       else if ( ob == paths_->counter_lastfiles )
+       else if (ob == paths_->counter_lastfiles )
                str = lyxrc.getDescription( LyXRC::RC_NUMLASTFILES );
-       else if ( ob == paths_->check_make_backups )
+       else if (ob == paths_->check_make_backups )
                str = lyxrc.getDescription( LyXRC::RC_MAKE_BACKUP );
-       else if ( ob == paths_->input_backup_path )
+       else if (ob == paths_->input_backup_path )
                str = lyxrc.getDescription( LyXRC::RC_BACKUPDIR_PATH );
-       else if ( ob == paths_->input_serverpipe )
+       else if (ob == paths_->input_serverpipe )
                str = lyxrc.getDescription( LyXRC::RC_SERVERPIPE );
 
        return str;
@@ -1228,8 +1229,8 @@ bool FormPreferences::inputPaths( FL_OBJECT const * const ob )
 {
        bool activate = true;
        
-       if( !ob || ob == paths_->check_use_temp_dir ) {
-               if( fl_get_button(paths_->check_use_temp_dir) ) {
+       if (!ob || ob == paths_->check_use_temp_dir) {
+               if (fl_get_button(paths_->check_use_temp_dir)) {
                        fl_activate_object(paths_->input_temp_dir);
                        fl_set_object_lcol(paths_->input_temp_dir,
                                           FL_BLACK);
@@ -1240,8 +1241,8 @@ bool FormPreferences::inputPaths( FL_OBJECT const * const ob )
                }
        }
 
-       if( !ob || ob == paths_->check_last_files ) {
-               if( fl_get_button(paths_->check_last_files) ) {
+       if (!ob || ob == paths_->check_last_files) {
+               if (fl_get_button(paths_->check_last_files)) {
                        fl_activate_object(paths_->input_lastfiles);
                        fl_set_object_lcol(paths_->input_lastfiles,
                                           FL_BLACK);
@@ -1252,8 +1253,8 @@ bool FormPreferences::inputPaths( FL_OBJECT const * const ob )
                }
        }
 
-       if( !ob || ob == paths_->check_make_backups ) {
-               if( fl_get_button(paths_->check_make_backups) ) {
+       if (!ob || ob == paths_->check_make_backups) {
+               if (fl_get_button(paths_->check_make_backups)) {
                        fl_activate_object(paths_->input_backup_path);
                        fl_set_object_lcol(paths_->input_backup_path,
                                           FL_BLACK);
@@ -1264,48 +1265,48 @@ bool FormPreferences::inputPaths( FL_OBJECT const * const ob )
                }
        }
 
-       if( !ob || ob == paths_->input_default_path ) {
+       if (!ob || ob == paths_->input_default_path) {
                string name = fl_get_input(paths_->input_default_path);
-               if!WriteableDir(name) )
+               if (!WriteableDir(name) )
                        return false;
        }
 
-       if( !ob || ob == paths_->input_template_path ) {
+       if (!ob || ob == paths_->input_template_path) {
                string name = fl_get_input(paths_->input_template_path);
-               if!ReadableDir(name) )
+               if (!ReadableDir(name) )
                    return false;
        }
 
-       if( !ob || ob == paths_->input_temp_dir ) {
+       if (!ob || ob == paths_->input_temp_dir) {
                string name = fl_get_input(paths_->input_temp_dir);
-               iffl_get_button(paths_->check_make_backups)
+               if (fl_get_button(paths_->check_make_backups)
                    && !name.empty()
                    && !WriteableDir(name) )
                        return false;
        }
 
-       if( !ob || ob == paths_->input_backup_path ) {
+       if (!ob || ob == paths_->input_backup_path) {
                string name = fl_get_input(paths_->input_backup_path);
-               iffl_get_button(paths_->check_make_backups)
+               if (fl_get_button(paths_->check_make_backups)
                    && !name.empty()
                    && !WriteableDir(name) )
                        return false;
        }
 
-       if( !ob || ob == paths_->input_lastfiles ) {
+       if (!ob || ob == paths_->input_lastfiles) {
                string name = fl_get_input(paths_->input_lastfiles);
-               iffl_get_button(paths_->check_last_files)
+               if (fl_get_button(paths_->check_last_files)
                    && !name.empty()
                    && !WriteableFile(name) )
                        return false;
        }
 
-       if( !ob || ob == paths_->input_serverpipe ) {
+       if (!ob || ob == paths_->input_serverpipe) {
                string name = fl_get_input(paths_->input_serverpipe);
-               if( !name.empty() ) {
-                       if( !WriteableFile(name, ".in") )
+               if (!name.empty()) {
+                       if (!WriteableFile(name, ".in"))
                                return false;
-                       if( !WriteableFile(name, ".out") )
+                       if (!WriteableFile(name, ".out"))
                                return false;
                }
        }
@@ -1321,22 +1322,22 @@ void FormPreferences::updatePaths()
        fl_set_input(paths_->input_template_path,
                     lyxrc.template_path.c_str());
 
-       string str = string();
-       if( lyxrc.make_backup ) str = lyxrc.backupdir_path;
+       string str;
+       if (lyxrc.make_backup) str = lyxrc.backupdir_path;
 
        fl_set_button(paths_->check_make_backups,
                      lyxrc.make_backup);
        fl_set_input(paths_->input_backup_path, str.c_str());
 
        str.erase();
-       if( lyxrc.use_tempdir ) str = lyxrc.tempdir_path;
+       if (lyxrc.use_tempdir) str = lyxrc.tempdir_path;
 
        fl_set_button(paths_->check_use_temp_dir,
                      lyxrc.use_tempdir);
        fl_set_input(paths_->input_temp_dir, str.c_str());
 
        str.erase();
-       if( lyxrc.check_lastfiles ) str = lyxrc.lastfiles;
+       if (lyxrc.check_lastfiles) str = lyxrc.lastfiles;
 
        fl_set_button(paths_->check_last_files,
                      lyxrc.check_lastfiles);           
@@ -1380,45 +1381,45 @@ void FormPreferences::applyPrinter() const
 }
 
 
-string FormPreferences::feedbackPrinter( FL_OBJECT const * const ob ) const
+string const FormPreferences::feedbackPrinter(FL_OBJECT const * const ob) const
 {
        string str;
 
-       ifob == printer_->input_command )
+       if (ob == printer_->input_command )
                str = lyxrc.getDescription( LyXRC::RC_PRINT_COMMAND );
-       else ifob == printer_->check_adapt_output )
+       else if (ob == printer_->check_adapt_output )
                str = lyxrc.getDescription( LyXRC::RC_PRINT_ADAPTOUTPUT );
-       else ifob == printer_->input_to_printer )
+       else if (ob == printer_->input_to_printer )
                str = lyxrc.getDescription( LyXRC::RC_PRINTTOPRINTER );
-       else ifob == printer_->input_to_file )
+       else if (ob == printer_->input_to_file )
                str = lyxrc.getDescription( LyXRC::RC_PRINTTOFILE );
-       else ifob == printer_->input_file_extension )
+       else if (ob == printer_->input_file_extension )
                str = lyxrc.getDescription( LyXRC::RC_PRINTFILEEXTENSION );
-       else ifob == printer_->input_extra_options )
+       else if (ob == printer_->input_extra_options )
                str = lyxrc.getDescription( LyXRC::RC_PRINTEXSTRAOPTIONS );
-       else ifob == printer_->input_spool_command )
+       else if (ob == printer_->input_spool_command )
                str = lyxrc.getDescription( LyXRC::RC_PRINTSPOOL_COMMAND );
-       else ifob == printer_->input_spool_prefix )
+       else if (ob == printer_->input_spool_prefix )
                str = lyxrc.getDescription( LyXRC::RC_PRINTSPOOL_PRINTERPREFIX );
-       else ifob == printer_->input_name )
+       else if (ob == printer_->input_name )
                str = lyxrc.getDescription( LyXRC::RC_PRINTER );
-       else ifob == printer_->input_even_pages )
+       else if (ob == printer_->input_even_pages )
                str = lyxrc.getDescription( LyXRC::RC_PRINTEVENPAGEFLAG );
-       else ifob == printer_->input_odd_pages )
+       else if (ob == printer_->input_odd_pages )
                str = lyxrc.getDescription( LyXRC::RC_PRINTODDPAGEFLAG );
-       else ifob == printer_->input_page_range )
+       else if (ob == printer_->input_page_range )
                str = lyxrc.getDescription( LyXRC::RC_PRINTPAGERANGEFLAG );
-       else ifob == printer_->input_reverse )
+       else if (ob == printer_->input_reverse )
                str = lyxrc.getDescription( LyXRC::RC_PRINTREVERSEFLAG );
-       else ifob == printer_->input_landscape )
+       else if (ob == printer_->input_landscape )
                str = lyxrc.getDescription( LyXRC::RC_PRINTLANDSCAPEFLAG );
-       else ifob == printer_->input_copies )
+       else if (ob == printer_->input_copies )
                str = lyxrc.getDescription( LyXRC::RC_PRINTCOLLCOPIESFLAG );
-       else ifob == printer_->input_collated )
+       else if (ob == printer_->input_collated )
                str = lyxrc.getDescription( LyXRC::RC_PRINTCOPIESFLAG );
-       else ifob == printer_->input_paper_type )
+       else if (ob == printer_->input_paper_type )
                str = lyxrc.getDescription( LyXRC::RC_PRINTPAPERFLAG );
-       else ifob == printer_->input_paper_size )
+       else if (ob == printer_->input_paper_size )
                str = lyxrc.getDescription( LyXRC::RC_PRINTPAPERDIMENSIONFLAG );
 
        return str;
@@ -1519,38 +1520,38 @@ void FormPreferences::applyScreenFonts() const
        bool changed = false;
 
        string str = fl_get_input(screen_fonts_->input_roman);
-       if( lyxrc.roman_font_name != str ) {
+       if (lyxrc.roman_font_name != str) {
                changed = true;
                lyxrc.roman_font_name = str;
        }
 
        str = fl_get_input(screen_fonts_->input_sans);
-       if( lyxrc.sans_font_name != str ) {
+       if (lyxrc.sans_font_name != str) {
                changed = true;
                lyxrc.sans_font_name = str;
        }
 
        str = fl_get_input(screen_fonts_->input_typewriter);
-       if( lyxrc.typewriter_font_name != str ) {
+       if (lyxrc.typewriter_font_name != str) {
                changed = true;
                lyxrc.typewriter_font_name = str;
        }
 
        str = fl_get_input(screen_fonts_->input_screen_encoding);
-       if( lyxrc.font_norm != str ) {
+       if (lyxrc.font_norm != str) {
                changed = true;
                lyxrc.font_norm = str;
        }
 
        bool button = fl_get_button(screen_fonts_->check_scalable);
-       if( lyxrc.use_scalable_fonts != button ) {
+       if (lyxrc.use_scalable_fonts != button) {
                changed = true;
                lyxrc.use_scalable_fonts = button;
        }
 
        unsigned int ivalue = static_cast<unsigned int>
                (fl_get_counter_value(screen_fonts_->counter_zoom));
-       iflyxrc.zoom != ivalue) {
+       if (lyxrc.zoom != ivalue) {
                changed = true;
                lyxrc.zoom = ivalue;
        }
@@ -1563,66 +1564,66 @@ void FormPreferences::applyScreenFonts() const
        }
        
        double dvalue = strToDbl(fl_get_input(screen_fonts_->input_tiny));
-       if( lyxrc.font_sizes[LyXFont::SIZE_TINY] != dvalue ) {
+       if (lyxrc.font_sizes[LyXFont::SIZE_TINY] != dvalue) {
                changed = true;
                lyxrc.font_sizes[LyXFont::SIZE_TINY] = dvalue;
        }
 
        dvalue = strToDbl(fl_get_input(screen_fonts_->input_script));
-       if( lyxrc.font_sizes[LyXFont::SIZE_SCRIPT] != dvalue ) {
+       if (lyxrc.font_sizes[LyXFont::SIZE_SCRIPT] != dvalue) {
                changed = true;
                lyxrc.font_sizes[LyXFont::SIZE_SCRIPT] = dvalue;
        }
 
        dvalue = strToDbl(fl_get_input(screen_fonts_->input_footnote));
-       if( lyxrc.font_sizes[LyXFont::SIZE_FOOTNOTE] != dvalue ) {
+       if (lyxrc.font_sizes[LyXFont::SIZE_FOOTNOTE] != dvalue) {
                changed = true;
                lyxrc.font_sizes[LyXFont::SIZE_FOOTNOTE] = dvalue;
        }
 
        dvalue = strToDbl(fl_get_input(screen_fonts_->input_small));
-       if( lyxrc.font_sizes[LyXFont::SIZE_SMALL] != dvalue ) {
+       if (lyxrc.font_sizes[LyXFont::SIZE_SMALL] != dvalue) {
                changed = true;
                lyxrc.font_sizes[LyXFont::SIZE_SMALL] = dvalue;
        }
 
        dvalue = strToDbl(fl_get_input(screen_fonts_->input_normal));
-       if( lyxrc.font_sizes[LyXFont::SIZE_NORMAL] != dvalue ) {
+       if (lyxrc.font_sizes[LyXFont::SIZE_NORMAL] != dvalue) {
                changed = true;
                lyxrc.font_sizes[LyXFont::SIZE_NORMAL] = dvalue;
        }
 
        dvalue = strToDbl(fl_get_input(screen_fonts_->input_large));
-       if( lyxrc.font_sizes[LyXFont::SIZE_LARGE] != dvalue ) {
+       if (lyxrc.font_sizes[LyXFont::SIZE_LARGE] != dvalue) {
                changed = true;
                lyxrc.font_sizes[LyXFont::SIZE_LARGE] = dvalue;
        }
 
        dvalue = strToDbl(fl_get_input(screen_fonts_->input_larger));
-       if( lyxrc.font_sizes[LyXFont::SIZE_LARGER] != dvalue ) {
+       if (lyxrc.font_sizes[LyXFont::SIZE_LARGER] != dvalue) {
                changed = true;
                lyxrc.font_sizes[LyXFont::SIZE_LARGER] = dvalue;
        }
 
        dvalue = strToDbl(fl_get_input(screen_fonts_->input_largest));
-       if( lyxrc.font_sizes[LyXFont::SIZE_LARGEST] != dvalue ) {
+       if (lyxrc.font_sizes[LyXFont::SIZE_LARGEST] != dvalue) {
                changed = true;
                lyxrc.font_sizes[LyXFont::SIZE_LARGEST] = dvalue;
        }
 
        dvalue = strToDbl(fl_get_input(screen_fonts_->input_huge));
-       if( lyxrc.font_sizes[LyXFont::SIZE_HUGE] != dvalue ) {
+       if (lyxrc.font_sizes[LyXFont::SIZE_HUGE] != dvalue) {
                changed = true;
                lyxrc.font_sizes[LyXFont::SIZE_HUGE] = dvalue;
        }
 
        dvalue = strToDbl(fl_get_input(screen_fonts_->input_huger));
-       if( lyxrc.font_sizes[LyXFont::SIZE_HUGER] != dvalue ) {
+       if (lyxrc.font_sizes[LyXFont::SIZE_HUGER] != dvalue) {
                changed = true;
                lyxrc.font_sizes[LyXFont::SIZE_HUGER] = dvalue;
        }
 
-       if( changed ) {
+       if (changed) {
                // Now update the buffers
                // Can anything below here affect the redraw process?
                lv_->getLyXFunc()->Dispatch(LFUN_SCREEN_FONT_UPDATE);
@@ -1699,25 +1700,26 @@ void FormPreferences::buildScreenFonts()
 }
 
        
-string FormPreferences::feedbackScreenFonts(FL_OBJECT const * const ob ) const
+string const
+FormPreferences::feedbackScreenFonts(FL_OBJECT const * const ob ) const
 {
        string str;
 
-       ifob == screen_fonts_->input_roman )
+       if (ob == screen_fonts_->input_roman )
                str = lyxrc.getDescription( LyXRC::RC_SCREEN_FONT_ROMAN );
-       else ifob == screen_fonts_->input_sans )
+       else if (ob == screen_fonts_->input_sans )
                str = lyxrc.getDescription( LyXRC::RC_SCREEN_FONT_SANS );
-       else ifob == screen_fonts_->input_typewriter )
+       else if (ob == screen_fonts_->input_typewriter )
                str = lyxrc.getDescription( LyXRC::RC_SCREEN_FONT_TYPEWRITER );
-       else ifob == screen_fonts_->check_scalable )
+       else if (ob == screen_fonts_->check_scalable )
                str = lyxrc.getDescription( LyXRC::RC_SCREEN_FONT_SCALABLE );
-       else ifob == screen_fonts_->input_screen_encoding )
+       else if (ob == screen_fonts_->input_screen_encoding )
                str = lyxrc.getDescription( LyXRC::RC_SCREEN_FONT_ENCODING );
-       else ifob == screen_fonts_->counter_zoom )
+       else if (ob == screen_fonts_->counter_zoom )
                str = lyxrc.getDescription( LyXRC::RC_SCREEN_ZOOM );
-       else ifob == screen_fonts_->counter_dpi ) 
+       else if (ob == screen_fonts_->counter_dpi ) 
                str = lyxrc.getDescription( LyXRC::RC_SCREEN_DPI );
-       else ifob == screen_fonts_->input_tiny
+       else if (ob == screen_fonts_->input_tiny
                 || ob == screen_fonts_->input_script
                 || ob == screen_fonts_->input_footnote
                 || ob == screen_fonts_->input_small
@@ -1778,7 +1780,7 @@ bool FormPreferences::inputScreenFonts()
                str = N_("WARNING! Fonts must be input in the order tiny > script>\nfootnote > small > normal > large > larger > largest > huge > huger.");
        }
 
-       if( !activate ) {
+       if (!activate) {
                fl_set_object_label(dialog_->text_warning, str.c_str());
                fl_set_object_lsize(dialog_->text_warning, FL_SMALL_SIZE);
        }
@@ -1828,7 +1830,7 @@ void FormPreferences::applySpellChecker()
 {
 
        string choice = "none";
-       switch(fl_get_choice(spellchecker_->choice_spell_command)) {
+       switch (fl_get_choice(spellchecker_->choice_spell_command)) {
        case 1:
                choice = "none";
                break;
@@ -1844,7 +1846,7 @@ void FormPreferences::applySpellChecker()
        lyxrc.isp_command = choice;
 
        // If spell checker == "none", all other input set to off.
-       if( fl_get_choice(spellchecker_->choice_spell_command) == 1 ) {
+       if (fl_get_choice(spellchecker_->choice_spell_command) == 1) {
                lyxrc.isp_use_alt_lang = false;
                lyxrc.isp_alt_lang.erase();
 
@@ -1859,24 +1861,24 @@ void FormPreferences::applySpellChecker()
        } else {
                int button = fl_get_button(spellchecker_->check_alt_lang);
                choice = fl_get_input(spellchecker_->input_alt_lang);
-               ifbutton && choice.empty() ) button = 0;
-               if!button ) choice.erase();
+               if (button && choice.empty() ) button = 0;
+               if (!button ) choice.erase();
 
                lyxrc.isp_use_alt_lang = static_cast<bool>(button);
                lyxrc.isp_alt_lang = choice;
 
                button = fl_get_button(spellchecker_->check_escape_chars);
                choice = fl_get_input(spellchecker_->input_escape_chars);
-               ifbutton && choice.empty() ) button = 0;
-               if!button ) choice.erase();
+               if (button && choice.empty() ) button = 0;
+               if (!button ) choice.erase();
        
                lyxrc.isp_use_esc_chars = static_cast<bool>(button);
                lyxrc.isp_esc_chars = choice;
 
                button = fl_get_button(spellchecker_->check_personal_dict);
                choice = fl_get_input(spellchecker_->input_personal_dict);
-               ifbutton && choice.empty() ) button = 0;
-               if!button ) choice.erase();
+               if (button && choice.empty() ) button = 0;
+               if (!button ) choice.erase();
 
                lyxrc.isp_use_pers_dict = static_cast<bool>(button);
                lyxrc.isp_pers_dict = choice;
@@ -1929,27 +1931,28 @@ void FormPreferences::buildSpellchecker()
 }
 
 
-string FormPreferences::feedbackSpellChecker( FL_OBJECT const * const ob ) const
+string const
+FormPreferences::feedbackSpellChecker(FL_OBJECT const * const ob) const
 {
        string str;
 
-       ifob == spellchecker_->choice_spell_command )
+       if (ob == spellchecker_->choice_spell_command )
                str = lyxrc.getDescription( LyXRC::RC_SPELL_COMMAND );
-       else ifob == spellchecker_->check_alt_lang )
+       else if (ob == spellchecker_->check_alt_lang )
                str = lyxrc.getDescription( LyXRC::RC_USE_ALT_LANG );
-       else ifob == spellchecker_->input_alt_lang )
+       else if (ob == spellchecker_->input_alt_lang )
                str = lyxrc.getDescription( LyXRC::RC_ALT_LANG );
-       else ifob == spellchecker_->check_escape_chars )
+       else if (ob == spellchecker_->check_escape_chars )
                str = lyxrc.getDescription( LyXRC::RC_USE_ESC_CHARS );
-       else ifob == spellchecker_->input_escape_chars )
+       else if (ob == spellchecker_->input_escape_chars )
                str = lyxrc.getDescription( LyXRC::RC_ESC_CHARS );
-       else ifob == spellchecker_->check_personal_dict )
+       else if (ob == spellchecker_->check_personal_dict )
                str = lyxrc.getDescription( LyXRC::RC_USE_PERS_DICT );
-       else ifob == spellchecker_->input_personal_dict )
+       else if (ob == spellchecker_->input_personal_dict )
                str = lyxrc.getDescription( LyXRC::RC_PERS_DICT );
-       else ifob == spellchecker_->check_compound_words )
+       else if (ob == spellchecker_->check_compound_words )
                str = lyxrc.getDescription( LyXRC::RC_ACCEPT_COMPOUND );
-       else ifob == spellchecker_->check_input_enc )
+       else if (ob == spellchecker_->check_input_enc )
                str = lyxrc.getDescription( LyXRC::RC_USE_INP_ENC );
 
        return str;
@@ -1961,8 +1964,8 @@ bool FormPreferences::inputSpellChecker( FL_OBJECT const * const ob )
        // Allow/dissallow input
 
        // If spell checker == "none", disable all input.
-       if( !ob || ob == spellchecker_->choice_spell_command ) {
-               if( fl_get_choice(spellchecker_->choice_spell_command) == 1 ) {
+       if (!ob || ob == spellchecker_->choice_spell_command) {
+               if (fl_get_choice(spellchecker_->choice_spell_command) == 1) {
                        fl_deactivate_object( spellchecker_->check_alt_lang );
                        fl_deactivate_object( spellchecker_->input_alt_lang );
                        fl_deactivate_object( spellchecker_->check_escape_chars );
@@ -1981,8 +1984,8 @@ bool FormPreferences::inputSpellChecker( FL_OBJECT const * const ob )
                }
        }
 
-       if( !ob || ob == spellchecker_->check_alt_lang ) {
-               if( fl_get_button(spellchecker_->check_alt_lang) ) {
+       if (!ob || ob == spellchecker_->check_alt_lang) {
+               if (fl_get_button(spellchecker_->check_alt_lang)) {
                        fl_activate_object(spellchecker_->input_alt_lang);
                        fl_set_object_lcol(spellchecker_->input_alt_lang,
                                           FL_BLACK);
@@ -1993,8 +1996,8 @@ bool FormPreferences::inputSpellChecker( FL_OBJECT const * const ob )
                }
        }
 
-       if( !ob || ob == spellchecker_->check_escape_chars ) {
-               if( fl_get_button(spellchecker_->check_escape_chars) ) {
+       if (!ob || ob == spellchecker_->check_escape_chars) {
+               if (fl_get_button(spellchecker_->check_escape_chars)) {
                        fl_activate_object(spellchecker_->input_escape_chars);
                        fl_set_object_lcol(spellchecker_->input_escape_chars,
                                           FL_BLACK);
@@ -2005,8 +2008,8 @@ bool FormPreferences::inputSpellChecker( FL_OBJECT const * const ob )
                }
        }
 
-       if( !ob || ob == spellchecker_->check_personal_dict ) {
-               if( fl_get_button(spellchecker_->check_personal_dict) ) {
+       if (!ob || ob == spellchecker_->check_personal_dict) {
+               if (fl_get_button(spellchecker_->check_personal_dict)) {
                        fl_activate_object(spellchecker_->input_personal_dict);
                        fl_set_object_lcol(spellchecker_->input_personal_dict,
                                           FL_BLACK);
@@ -2024,30 +2027,30 @@ bool FormPreferences::inputSpellChecker( FL_OBJECT const * const ob )
 void FormPreferences::updateSpellChecker()
 {
        int choice = 1;
-       iflyxrc.isp_command == "none" )
+       if (lyxrc.isp_command == "none" )
                choice = 1;
-       else iflyxrc.isp_command == "ispell" )
+       else if (lyxrc.isp_command == "ispell" )
                choice = 2;
-       else iflyxrc.isp_command == "aspell" )
+       else if (lyxrc.isp_command == "aspell" )
                choice = 3;
        fl_set_choice(spellchecker_->choice_spell_command, choice);
        
        string str = string();
-       iflyxrc.isp_use_alt_lang ) str = lyxrc.isp_alt_lang;
+       if (lyxrc.isp_use_alt_lang ) str = lyxrc.isp_alt_lang;
 
        fl_set_button(spellchecker_->check_alt_lang,
                      lyxrc.isp_use_alt_lang);
        fl_set_input(spellchecker_->input_alt_lang, str.c_str());
        
        str.erase();
-       iflyxrc.isp_use_esc_chars ) str = lyxrc.isp_esc_chars;
+       if (lyxrc.isp_use_esc_chars ) str = lyxrc.isp_esc_chars;
 
        fl_set_button(spellchecker_->check_escape_chars,
                      lyxrc.isp_use_esc_chars);
        fl_set_input(spellchecker_->input_escape_chars, str.c_str());
 
        str.erase();
-       iflyxrc.isp_use_pers_dict ) str = lyxrc.isp_pers_dict;
+       if (lyxrc.isp_use_pers_dict ) str = lyxrc.isp_pers_dict;
 
        fl_set_button(spellchecker_->check_personal_dict,
                      lyxrc.isp_use_pers_dict);
@@ -2069,23 +2072,23 @@ bool FormPreferences::WriteableDir( string const & name ) const
        bool success = true;
        string str;
 
-       if( !AbsolutePath(name) ) {
+       if (!AbsolutePath(name)) {
                success = false;
                str = N_("WARNING! The absolute path is required.");
        }
 
-       FileInfo tp(name);
-       if( success && !tp.isDir() ) {
+       FileInfo const tp(name);
+       if (success && !tp.isDir()) {
                success = false;
                str = N_("WARNING! Directory does not exist.");
        }
 
-       if( success && !tp.writable() ) {
+       if (success && !tp.writable()) {
                success = false;
                str = N_("WARNING! Cannot write to this directory.");
        }
 
-       if( !success ) {
+       if (!success) {
                fl_set_object_label(dialog_->text_warning, str.c_str());
                fl_set_object_lsize(dialog_->text_warning, FL_SMALL_SIZE);
        }
@@ -2099,23 +2102,23 @@ bool FormPreferences::ReadableDir( string const & name ) const
        bool success = true;
        string str;
 
-       if( !AbsolutePath(name) ) {
+       if (!AbsolutePath(name)) {
                success = false;
                str = N_("WARNING! The absolute path is required.");
        }
 
-       FileInfo tp(name);
-       if( success && !tp.isDir() ) {
+       FileInfo const tp(name);
+       if (success && !tp.isDir()) {
                success = false;
                str = N_("WARNING! Directory does not exist.");
        }
 
-       if( success && !tp.readable() ) {
+       if (success && !tp.readable()) {
                success = false;
                str = N_("WARNING! Cannot read this directory.");
        }
 
-       if( !success ) {
+       if (!success) {
                fl_set_object_label(dialog_->text_warning, str.c_str());
                fl_set_object_lsize(dialog_->text_warning, FL_SMALL_SIZE);
        }
@@ -2124,7 +2127,8 @@ bool FormPreferences::ReadableDir( string const & name ) const
 }
 
 
-bool FormPreferences::WriteableFile( string const & name, string const & suffix ) const
+bool FormPreferences::WriteableFile(string const & name,
+                                   string const & suffix) const
 {
        // A writeable file is either:
        // * An existing file to which we have write access, or
@@ -2134,49 +2138,58 @@ bool FormPreferences::WriteableFile( string const & name, string const & suffix
        bool success = true;
        string str;
 
-       if( name.empty() ) {
+       if (name.empty()) {
                success = false;
                str = N_("WARNING! No file input.");
        }
 
-       string dir = OnlyPath(name);
-       if( success && !AbsolutePath(dir) ) {
+       string const dir = OnlyPath(name);
+       if (success && !AbsolutePath(dir)) {
                success = false;
                str = N_("WARNING! The absolute path is required.");
        }
 
+       // This is not a nice way to use FileInfo (Lgb)
+#if 0
        FileInfo d;
+       
        {
                FileInfo d1(dir);
                FileInfo d2(name);
-               ifd2.isDir() )
+               if (d2.isDir() )
                        d = d2;
                else
                        d = d1;
        }
-       
-       if( success && !d.isDir()) {
+#else
+       // This should be equivalent (Lgb)
+       FileInfo d(name);
+       if (!d.isDir()) {
+               d.newFile(dir);
+       }
+#endif
+       if (success && !d.isDir()) {
                success = false;
                str = N_("WARNING! Directory does not exist.");
        }
        
-       if( success && !d.writable() ) {
+       if (success && !d.writable()) {
                success = false;
                str = N_("WARNING! Cannot write to this directory.");
        }
 
        FileInfo f(name+suffix);
-       if( success && (dir == name || f.isDir()) ) {
+       if (success && (dir == name || f.isDir())) {
                success = false;
                str = N_("WARNING! A file is required, not a directory.");
        }
 
-       if( success && (f.exist() && !f.writable()) ) {
+       if (success && (f.exist() && !f.writable())) {
                success = false;
                str = N_("WARNING! Cannot write to this file.");
        }
        
-       if( !success ) {
+       if (!success) {
                fl_set_object_label(dialog_->text_warning, str.c_str());
                fl_set_object_lsize(dialog_->text_warning, FL_SMALL_SIZE);
        }
@@ -2197,6 +2210,7 @@ void FormPreferences::ComboLanguageCB(int, void * v, Combox * combox)
 // C functions for the timer callback used to give the user feedback
 C_GENERICCB(FormPreferences, FeedbackCB)
 
+       
 void FormPreferences::FeedbackCB(FL_OBJECT * ob, long)
 {
        FormPreferences * pre =
@@ -2204,13 +2218,15 @@ void FormPreferences::FeedbackCB(FL_OBJECT * ob, long)
        pre->feedback( pre->feedbackObj );
 }
 
-extern "C" int C_FormPreferencesFeedbackPost(FL_OBJECT * ob, int event,
-                                            FL_Coord, FL_Coord, int, void *)
+
+extern "C"
+int C_FormPreferencesFeedbackPost(FL_OBJECT * ob, int event,
+                                 FL_Coord, FL_Coord, int, void *)
 {
        // can occur when form is being deleted. This seems an easier fix than
        // a call "fl_set_object_posthandler(ob, 0)" for each and every object
        // in the destructor.
-       if!ob->form ) return 0;
+       if (!ob->form ) return 0;
 
        FormPreferences * pre =
                static_cast<FormPreferences*>(ob->form->u_vdata);
@@ -2220,10 +2236,10 @@ extern "C" int C_FormPreferencesFeedbackPost(FL_OBJECT * ob, int event,
 
 
 // post_handler for feedback messages
-void FormPreferences::feedbackPost(FL_OBJECT *ob, int event)
+void FormPreferences::feedbackPost(FL_OBJECT * ob, int event)
 {
        // We do not test for empty help here, since this can never happen
-       if(event == FL_ENTER){
+       if (event == FL_ENTER){
                // Used as a placeholder for ob, so that we don't have to
                // a horrible reinterpret_cast to long and pass it as an
                // argument in fl_set_object_callback.
@@ -2233,7 +2249,7 @@ void FormPreferences::feedbackPost(FL_OBJECT *ob, int event)
                                       0);
                fl_set_timer(dialog_->timer_feedback, 0.5);
        }
-       else if(event != FL_MOTION){
+       else if (event != FL_MOTION){
                fl_set_timer(dialog_->timer_feedback, 0);
                feedbackObj = 0;
                fl_set_object_label(dialog_->text_warning, "");
@@ -2241,7 +2257,7 @@ void FormPreferences::feedbackPost(FL_OBJECT *ob, int event)
 }
 
 
-void FormPreferences::setPostHandler( FL_OBJECT * ob ) const
+void FormPreferences::setPostHandler(FL_OBJECT * ob) const
 {
        fl_set_object_posthandler(ob, C_FormPreferencesFeedbackPost);
 }
index 99e50a30cff4e1fcfff56bba51a6530cf3c067a5..8abec739bdc6d68cbbca6ca66a2f91f338a46f77 100644 (file)
@@ -64,10 +64,6 @@ public:
                int b;
                RGB() : r(0), g(0), b(0) {}
                RGB(int red, int green, int blue) : r(red), g(green), b(blue) {}
-               bool operator==(RGB const & o) const
-                       { return( r == o.r && g == o.g && b == o.b ); }
-               bool operator!=(RGB const & o) const
-                       { return( r != o.r || g != o.g || b != o.b ); }
        };
 
 private:
@@ -148,29 +144,29 @@ private:
         */
        
        ///
-       string feedbackColours(FL_OBJECT const * const) const;
+       string const feedbackColours(FL_OBJECT const * const) const;
        ///
-       string feedbackConverters(FL_OBJECT const * const) const;
+       string const feedbackConverters(FL_OBJECT const * const) const;
        ///
-       string feedbackFormats( FL_OBJECT const * const ) const;
+       string const feedbackFormats( FL_OBJECT const * const ) const;
        ///
-       string feedbackInputsMisc(FL_OBJECT const * const) const;
+       string const feedbackInputsMisc(FL_OBJECT const * const) const;
        ///
-       string feedbackInterface(FL_OBJECT const * const) const;
+       string const feedbackInterface(FL_OBJECT const * const) const;
        ///
-       string feedbackLanguage(FL_OBJECT const * const) const;
+       string const feedbackLanguage(FL_OBJECT const * const) const;
        ///
-       string feedbackLnFmisc(FL_OBJECT const * const) const;
+       string const feedbackLnFmisc(FL_OBJECT const * const) const;
        ///
-       string feedbackOutputsMisc(FL_OBJECT const * const) const;
+       string const feedbackOutputsMisc(FL_OBJECT const * const) const;
        ///
-       string feedbackPaths(FL_OBJECT const * const) const;
+       string const feedbackPaths(FL_OBJECT const * const) const;
        ///
-       string feedbackPrinter(FL_OBJECT const * const) const;
+       string const feedbackPrinter(FL_OBJECT const * const) const;
        ///
-       string feedbackScreenFonts(FL_OBJECT const * const) const;
+       string const feedbackScreenFonts(FL_OBJECT const * const) const;
        ///
-       string feedbackSpellChecker(FL_OBJECT const * const) const;
+       string const feedbackSpellChecker(FL_OBJECT const * const) const;
 
        /** Folder specific input functions. Not all folders require one.
         */
@@ -282,10 +278,10 @@ private:
        /// Spellchecker, language stuff, etc
        FD_form_outer_tab * usage_tab_;
        ///
-       FD_form_converters * converters_;
-       ///
        FD_form_colours * colours_;
        ///
+       FD_form_converters * converters_;
+       ///
        FD_form_formats * formats_;
        ///
        FD_form_inputs_misc * inputs_misc_;
@@ -315,4 +311,20 @@ private:
        FL_OBJECT * feedbackObj;
 };
 
+
+inline
+bool operator==(FormPreferences::RGB const & c1,
+               FormPreferences::RGB const & c2)
+{
+       return (c1.r == c2.r && c1.g == c2.g && c1.b == c2.b);
+}
+
+
+inline
+bool operator!=(FormPreferences::RGB const & c1,
+               FormPreferences::RGB const & c2)
+{
+       return !(c1 == c2);
+}
+
 #endif
index fafb1475ec1dd879d6f9a3a5d428a467c0d68743..09ac1375a54620894e26049848f200eba1d898a3 100644 (file)
@@ -52,7 +52,7 @@ FormRef::~FormRef()
 
 FL_FORM * FormRef::form() const
 {
-       if ( dialog_ ) return dialog_->form;
+       if (dialog_ ) return dialog_->form;
        return 0;
 }
 
@@ -84,7 +84,7 @@ void FormRef::build()
        minw_sb = minw_;
 
        // Name is irrelevant to LaTeX documents
-       if ( lv_->buffer()->isLatex() ) {
+       if (lv_->buffer()->isLatex()) {
                fl_deactivate_object( dialog_->name );
                fl_set_object_lcol( dialog_->name, FL_INACTIVE );
        }
@@ -111,7 +111,7 @@ void FormRef::update()
        fl_set_object_label(dialog_->button_go, _("Goto reference"));
 
        refs.clear();
-       if ( inset_ == 0 ) {
+       if (inset_ == 0) {
                refs = lv_->buffer()->getLabelList();
                updateBrowser( refs );
                showBrowser();
@@ -124,15 +124,15 @@ void FormRef::update()
 
 void FormRef::updateBrowser( vector<string> keys ) const
 {
-       if ( fl_get_button( dialog_->sort ) )
+       if (fl_get_button( dialog_->sort ) )
                sort( keys.begin(), keys.end() );
 
        fl_clear_browser( dialog_->browser );
-       forvector<string>::const_iterator it = keys.begin();
+       for (vector<string>::const_iterator it = keys.begin();
             it != keys.end(); ++it )
                fl_add_browser_line( dialog_->browser, (*it).c_str());
 
-       if ( keys.empty() ) {
+       if (keys.empty()) {
                fl_add_browser_line( dialog_->browser,
                                     _("*** No labels found in document ***"));
 
@@ -203,7 +203,7 @@ void FormRef::setSize( int w, int dx ) const
        static int x6 = dialog_->button_cancel->x;
        static int y6 = dialog_->button_cancel->y;
 
-       if ( form()->w != w ) {
+       if (form()->w != w) {
                minw_ = w;
                fl_set_form_size( form(), minw_, minh_ );
        } else
@@ -218,7 +218,7 @@ void FormRef::setSize( int w, int dx ) const
 
        // These two must be reset apparently
        // Name is irrelevant to LaTeX documents
-       if ( lv_->buffer()->isLatex() ) {
+       if (lv_->buffer()->isLatex()) {
                fl_deactivate_object( dialog_->name );
                fl_set_object_lcol( dialog_->name, FL_INACTIVE );
        }
@@ -259,12 +259,12 @@ void FormRef::apply()
 bool FormRef::input( FL_OBJECT *, long data )
 {
        bool activate( true );
-       switch( data ) {
+       switch (data) {
        // goto reference / go back
        case 1:
        {
                toggle = static_cast<Goto>(toggle + 1);
-               if ( toggle == GOFIRST ) toggle = GOREF;
+               if (toggle == GOFIRST ) toggle = GOREF;
        
                switch (toggle) {
                case GOREF:
@@ -294,7 +294,7 @@ bool FormRef::input( FL_OBJECT *, long data )
        case 2:
        {
                unsigned int sel = fl_get_browser( dialog_->browser );
-               if ( sel < 1 || sel > refs.size() ) break;
+               if (sel < 1 || sel > refs.size() ) break;
 
                string s = fl_get_browser_line( dialog_->browser, sel );
                fl_set_input( dialog_->ref, s.c_str());
@@ -326,8 +326,8 @@ bool FormRef::input( FL_OBJECT *, long data )
        {
                Type type = static_cast<Type>( 
                        fl_get_choice(dialog_->type) - 1 );
-               if ( params.getCmdName() == getName( type )
-                   && inset_ ) {
+               if (params.getCmdName() == getName( type )
+                   && inset_) {
                        activate = false;
                }
        }
@@ -344,16 +344,16 @@ FormRef::Type FormRef::getType() const
 {
        Type type;
 
-       if ( params.getCmdName() == "ref" )
+       if (params.getCmdName() == "ref" )
                type = REF;
 
-       else if ( params.getCmdName() == "pageref" )
+       else if (params.getCmdName() == "pageref" )
                type = PAGEREF;
 
-       else if ( params.getCmdName() == "vref" )
+       else if (params.getCmdName() == "vref" )
                type = VREF;
 
-       else if ( params.getCmdName() == "vpageref" )
+       else if (params.getCmdName() == "vpageref" )
                type = VPAGEREF;
 
        else
@@ -367,7 +367,7 @@ string FormRef::getName( Type type ) const
 {
        string name;
 
-       switch( type ) {
+       switch (type) {
        case REF:
                name = "ref";
                break;
index 4c7806d7e1870d80856662855a9fe51c68874876..56d12593f54502a10b01513df926bbe35fe74edd 100644 (file)
@@ -48,7 +48,7 @@ FormTabular::~FormTabular()
 
 FL_FORM * FormTabular::form() const
 {
-       if ( dialog_ ) return dialog_->form;
+       if (dialog_ ) return dialog_->form;
        return 0;
 }
 
index 80f189ad0f9b89af08a43563b971c8a1820efa84..3789fb21affe2dc1846db5c1dbac763768eb7fb9 100644 (file)
@@ -44,7 +44,7 @@ FormTabularCreate::~FormTabularCreate()
 
 FL_FORM * FormTabularCreate::form() const
 {
-       if ( dialog_ ) return dialog_->form;
+       if (dialog_ ) return dialog_->form;
        return 0;
 }
 
index 40ca12b59567fa5dde0ab9848f1c7adbaf55da20..d9d22d728a264bb00a3c09d3aff6d1e5621e1930 100644 (file)
@@ -51,7 +51,7 @@ FormToc::~FormToc()
 
 FL_FORM * FormToc::form() const
 {
-       if ( dialog_ ) return dialog_->form;
+       if (dialog_ ) return dialog_->form;
        return 0;
 }
 
@@ -82,13 +82,13 @@ void FormToc::update()
 {
        Buffer::TocType type;
 
-       if ( params.getCmdName() == "tableofcontents" )
+       if (params.getCmdName() == "tableofcontents" )
                type = Buffer::TOC_TOC;
 
-       else if ( params.getCmdName() == "listofalgorithms" )
+       else if (params.getCmdName() == "listofalgorithms" )
                type = Buffer::TOC_LOA;
 
-       else if ( params.getCmdName() == "listoffigures" )
+       else if (params.getCmdName() == "listoffigures" )
                type = Buffer::TOC_LOF;
 
        else
index fc0ac2b40acb56cb36f5a4baaf7c89d4df6d9700..9078536b71bc54ed900b09f66c5396d9b2f8dee6 100644 (file)
@@ -44,7 +44,7 @@ FormUrl::~FormUrl()
 
 FL_FORM * FormUrl::form() const
 {
-       if ( dialog_ ) return dialog_->form;
+       if (dialog_ ) return dialog_->form;
        return 0;
 }
 
@@ -74,12 +74,12 @@ void FormUrl::update()
        fl_set_input(dialog_->url,  params.getContents().c_str());
        fl_set_input(dialog_->name, params.getOptions().c_str());
 
-       if ( params.getCmdName() == "url" )
+       if (params.getCmdName() == "url" )
                fl_set_button(dialog_->radio_html, 0);
        else
                fl_set_button(dialog_->radio_html, 1);
 
-       if ( lv_->buffer()->isReadonly() ) {
+       if (lv_->buffer()->isReadonly()) {
                fl_deactivate_object( dialog_->url );
                fl_deactivate_object( dialog_->name );
                fl_deactivate_object( dialog_->radio_html );
index 483af3bbad18015f69da21726d58a250ac1c02d0..07fc2cabbfe7f64cedea7d98a9fadd8c2792e085 100644 (file)
@@ -64,7 +64,7 @@ int string_width(string const & str)
 Menubar::Pimpl::Pimpl(LyXView * view, MenuBackend const & mb) 
        : owner_(view), menubackend_(&mb), current_group_(0)
 {
-       for(MenuBackend::const_iterator menu = menubackend_->begin();
+       for (MenuBackend::const_iterator menu = menubackend_->begin();
            menu != menubackend_->end() ; ++menu) {
                if (menu->menubar()) {
                        FL_OBJECT * group = fl_bgn_group();
@@ -169,7 +169,7 @@ void Menubar::Pimpl::set(string const & menu_name)
 
 void Menubar::Pimpl::openByName(string const & name)
 {
-       for(ButtonList::const_iterator cit = buttonlist_.begin();
+       for (ButtonList::const_iterator cit = buttonlist_.begin();
            cit != buttonlist_.end(); ++cit) {
                if ((*cit)->item_->submenu() == name) {
                        MenuCallback((*cit)->obj_, 1);
@@ -510,7 +510,7 @@ int Menubar::Pimpl::create_submenu(Window win, LyXView * view,
                MenuItem const & item = (*i);
                string & extra_label = *it;
 
-               switch(item.kind()) {
+               switch (item.kind()) {
                case MenuItem::Command: {
                        LyXFunc::func_status flag = 
                                view->getLyXFunc()->getStatus(item.action()); 
index d9a72639bc422e168f13dd0d38e86cebf8fed3d8..db5c7d0a0bccfaca4698faf8f670ea4c3d3d224d 100644 (file)
@@ -120,13 +120,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();
        }
@@ -252,7 +252,7 @@ void ToolbarCB(FL_OBJECT * ob, long ac)
        LyXView * owner = static_cast<LyXView *>(ob->u_vdata);
        
        string res = owner->getLyXFunc()->Dispatch(int(ac));
-       if(!res.empty())
+       if (!res.empty())
                lyxerr[Debug::GUI] << "ToolbarCB: Function returned: " 
                                   << res << endl;
 }
@@ -349,7 +349,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 eac60cccf59c1a485fde73a67cb0f52d14bfc44f..fea160b037ee84aecb3f2b5c19a9fbc6f00441be 100644 (file)
@@ -12,7 +12,7 @@
 
 FD_form_citation::~FD_form_citation()
 {
-  ifform->visible ) fl_hide_form( form );
+  if (form->visible ) fl_hide_form( form );
   fl_free_form( form );
 }
 
index 6604843a4b3d7c8da2070ba19e489fcea6e4fd47..edefc2543e38e28f68c8d08a65ce8ba636a7809e 100644 (file)
@@ -12,7 +12,7 @@
 
 FD_form_copyright::~FD_form_copyright()
 {
-  ifform->visible ) fl_hide_form( form );
+  if (form->visible ) fl_hide_form( form );
   fl_free_form( form );
 }
 
index 3a00bb83867f1b8551254c3344b03f7a929b5725..9600aeeee5df6f615d7d8d5f92d18da0dcf96ccf 100644 (file)
@@ -14,7 +14,7 @@
 
 FD_form_tabbed_document::~FD_form_tabbed_document()
 {
-  ifform->visible ) fl_hide_form( form );
+  if (form->visible ) fl_hide_form( form );
   fl_free_form( form );
 }
 
@@ -56,7 +56,7 @@ FD_form_tabbed_document * FormDocument::build_tabbed_document()
 
 FD_form_doc_paper::~FD_form_doc_paper()
 {
-  ifform->visible ) fl_hide_form( form );
+  if (form->visible ) fl_hide_form( form );
   fl_free_form( form );
 }
 
@@ -177,7 +177,7 @@ FD_form_doc_paper * FormDocument::build_doc_paper()
 
 FD_form_doc_class::~FD_form_doc_class()
 {
-  ifform->visible ) fl_hide_form( form );
+  if (form->visible ) fl_hide_form( form );
   fl_free_form( form );
 }
 
@@ -286,7 +286,7 @@ FD_form_doc_class * FormDocument::build_doc_class()
 
 FD_form_doc_language::~FD_form_doc_language()
 {
-  ifform->visible ) fl_hide_form( form );
+  if (form->visible ) fl_hide_form( form );
   fl_free_form( form );
 }
 
@@ -336,7 +336,7 @@ FD_form_doc_language * FormDocument::build_doc_language()
 
 FD_form_doc_options::~FD_form_doc_options()
 {
-  ifform->visible ) fl_hide_form( form );
+  if (form->visible ) fl_hide_form( form );
   fl_free_form( form );
 }
 
@@ -380,7 +380,7 @@ FD_form_doc_options * FormDocument::build_doc_options()
 
 FD_form_doc_bullet::~FD_form_doc_bullet()
 {
-  ifform->visible ) fl_hide_form( form );
+  if (form->visible ) fl_hide_form( form );
   fl_free_form( form );
 }
 
index e503369cad73ea15a6481bf77b723569fe22c383..0262f3a11183ef15896c08323917a83fc1c333d1 100644 (file)
@@ -12,7 +12,7 @@
 
 FD_form_error::~FD_form_error()
 {
-  ifform->visible ) fl_hide_form( form );
+  if (form->visible ) fl_hide_form( form );
   fl_free_form( form );
 }
 
index c78a6f83b428a03b52a85f1812dd583936926228..be0354509dd1b64e511b8666826c54bce170c3c0 100644 (file)
@@ -12,7 +12,7 @@
 
 FD_form_graphics::~FD_form_graphics()
 {
-  ifform->visible ) fl_hide_form( form );
+  if (form->visible ) fl_hide_form( form );
   fl_free_form( form );
 }
 
index 729e5a981f84fa03b92c0f891986ba62316ea88a..fbecb35f83251efd9d52323d9e37b8ffdd762b59 100644 (file)
@@ -12,7 +12,7 @@
 
 FD_form_index::~FD_form_index()
 {
-  ifform->visible ) fl_hide_form( form );
+  if (form->visible ) fl_hide_form( form );
   fl_free_form( form );
 }
 
index 04a3113e1fe5e60f420ef0e1249427890dd5d1a2..361d3fd3e6f6e8cf148da496ffb9f8c4a4a56c68 100644 (file)
@@ -12,7 +12,7 @@
 
 FD_form_paragraph_general::~FD_form_paragraph_general()
 {
-  ifform->visible ) fl_hide_form( form );
+  if (form->visible ) fl_hide_form( form );
   fl_free_form( form );
 }
 
@@ -136,7 +136,7 @@ FD_form_paragraph_general * FormParagraph::build_paragraph_general()
 
 FD_form_paragraph_extra::~FD_form_paragraph_extra()
 {
-  ifform->visible ) fl_hide_form( form );
+  if (form->visible ) fl_hide_form( form );
   fl_free_form( form );
 }
 
@@ -225,7 +225,7 @@ FD_form_paragraph_extra * FormParagraph::build_paragraph_extra()
 
 FD_form_tabbed_paragraph::~FD_form_tabbed_paragraph()
 {
-  ifform->visible ) fl_hide_form( form );
+  if (form->visible ) fl_hide_form( form );
   fl_free_form( form );
 }
 
index a411712c553f12bf22c71a9dc56866c297be58f7..cd2225d6a6de509d595fef76248e631ca712fbe4 100644 (file)
@@ -12,7 +12,7 @@
 
 FD_form_preferences::~FD_form_preferences()
 {
-  ifform->visible ) fl_hide_form( form );
+  if (form->visible ) fl_hide_form( form );
   fl_free_form( form );
 }
 
@@ -57,7 +57,7 @@ FD_form_preferences * FormPreferences::build_preferences()
 
 FD_form_outer_tab::~FD_form_outer_tab()
 {
-  ifform->visible ) fl_hide_form( form );
+  if (form->visible ) fl_hide_form( form );
   fl_free_form( form );
 }
 
@@ -83,7 +83,7 @@ FD_form_outer_tab * FormPreferences::build_outer_tab()
 
 FD_form_screen_fonts::~FD_form_screen_fonts()
 {
-  ifform->visible ) fl_hide_form( form );
+  if (form->visible ) fl_hide_form( form );
   fl_free_form( form );
 }
 
@@ -171,7 +171,7 @@ FD_form_screen_fonts * FormPreferences::build_screen_fonts()
 
 FD_form_outputs_misc::~FD_form_outputs_misc()
 {
-  ifform->visible ) fl_hide_form( form );
+  if (form->visible ) fl_hide_form( form );
   fl_free_form( form );
 }
 
@@ -223,7 +223,7 @@ FD_form_outputs_misc * FormPreferences::build_outputs_misc()
 
 FD_form_spellchecker::~FD_form_spellchecker()
 {
-  ifform->visible ) fl_hide_form( form );
+  if (form->visible ) fl_hide_form( form );
   fl_free_form( form );
 }
 
@@ -287,7 +287,7 @@ FD_form_spellchecker * FormPreferences::build_spellchecker()
 
 FD_form_inputs_misc::~FD_form_inputs_misc()
 {
-  ifform->visible ) fl_hide_form( form );
+  if (form->visible ) fl_hide_form( form );
   fl_free_form( form );
 }
 
@@ -314,7 +314,7 @@ FD_form_inputs_misc * FormPreferences::build_inputs_misc()
 
 FD_form_language::~FD_form_language()
 {
-  ifform->visible ) fl_hide_form( form );
+  if (form->visible ) fl_hide_form( form );
   fl_free_form( form );
 }
 
@@ -386,7 +386,7 @@ FD_form_language * FormPreferences::build_language()
 
 FD_form_colours::~FD_form_colours()
 {
-  ifform->visible ) fl_hide_form( form );
+  if (form->visible ) fl_hide_form( form );
   fl_free_form( form );
 }
 
@@ -449,7 +449,7 @@ FD_form_colours * FormPreferences::build_colours()
 
 FD_form_converters::~FD_form_converters()
 {
-  ifform->visible ) fl_hide_form( form );
+  if (form->visible ) fl_hide_form( form );
   fl_free_form( form );
 }
 
@@ -497,7 +497,7 @@ FD_form_converters * FormPreferences::build_converters()
 
 FD_form_formats::~FD_form_formats()
 {
-  ifform->visible ) fl_hide_form( form );
+  if (form->visible ) fl_hide_form( form );
   fl_free_form( form );
 }
 
@@ -549,7 +549,7 @@ FD_form_formats * FormPreferences::build_formats()
 
 FD_form_lnf_misc::~FD_form_lnf_misc()
 {
-  ifform->visible ) fl_hide_form( form );
+  if (form->visible ) fl_hide_form( form );
   fl_free_form( form );
 }
 
@@ -617,7 +617,7 @@ FD_form_lnf_misc * FormPreferences::build_lnf_misc()
 
 FD_form_interface::~FD_form_interface()
 {
-  ifform->visible ) fl_hide_form( form );
+  if (form->visible ) fl_hide_form( form );
   fl_free_form( form );
 }
 
@@ -666,7 +666,7 @@ FD_form_interface * FormPreferences::build_interface()
 
 FD_form_printer::~FD_form_printer()
 {
-  ifform->visible ) fl_hide_form( form );
+  if (form->visible ) fl_hide_form( form );
   fl_free_form( form );
 }
 
@@ -745,7 +745,7 @@ FD_form_printer * FormPreferences::build_printer()
 
 FD_form_paths::~FD_form_paths()
 {
-  ifform->visible ) fl_hide_form( form );
+  if (form->visible ) fl_hide_form( form );
   fl_free_form( form );
 }
 
index 6078fee5ac7f5259d210a4e2b70059458551a8ff..4d22c85c22861be558c86a554a5af57baf8a4e25 100644 (file)
@@ -12,7 +12,7 @@
 
 FD_form_print::~FD_form_print()
 {
-  ifform->visible ) fl_hide_form( form );
+  if (form->visible ) fl_hide_form( form );
   fl_free_form( form );
 }
 
index 932494f9343bb98114f25daaba31986c94a17062..ceade206bc1c5b2c5c6092a8e238c931bcfce4da 100644 (file)
@@ -12,7 +12,7 @@
 
 FD_form_ref::~FD_form_ref()
 {
-  ifform->visible ) fl_hide_form( form );
+  if (form->visible ) fl_hide_form( form );
   fl_free_form( form );
 }
 
index d2239f39e7b2a2f5469d8baba73670cd9cac937a..bab9f9c9b31639a2812abc2c419b42cace310891 100644 (file)
@@ -12,7 +12,7 @@
 
 FD_form_tabular::~FD_form_tabular()
 {
-  ifform->visible ) fl_hide_form( form );
+  if (form->visible ) fl_hide_form( form );
   fl_free_form( form );
 }
 
@@ -51,7 +51,7 @@ FD_form_tabular * FormTabular::build_tabular()
 
 FD_form_tabular_options::~FD_form_tabular_options()
 {
-  ifform->visible ) fl_hide_form( form );
+  if (form->visible ) fl_hide_form( form );
   fl_free_form( form );
 }
 
@@ -106,7 +106,7 @@ FD_form_tabular_options * FormTabular::build_tabular_options()
 
 FD_form_column_options::~FD_form_column_options()
 {
-  ifform->visible ) fl_hide_form( form );
+  if (form->visible ) fl_hide_form( form );
   fl_free_form( form );
 }
 
@@ -196,7 +196,7 @@ FD_form_column_options * FormTabular::build_column_options()
 
 FD_form_cell_options::~FD_form_cell_options()
 {
-  ifform->visible ) fl_hide_form( form );
+  if (form->visible ) fl_hide_form( form );
   fl_free_form( form );
 }
 
@@ -293,7 +293,7 @@ FD_form_cell_options * FormTabular::build_cell_options()
 
 FD_form_longtable_options::~FD_form_longtable_options()
 {
-  ifform->visible ) fl_hide_form( form );
+  if (form->visible ) fl_hide_form( form );
   fl_free_form( form );
 }
 
index 2f94d7bebb4ea0cd56f2b1831856f68e85316269..02fe6fd134b5a660781d1680441666310cbb9665 100644 (file)
@@ -12,7 +12,7 @@
 
 FD_form_tabular_create::~FD_form_tabular_create()
 {
-  ifform->visible ) fl_hide_form( form );
+  if (form->visible ) fl_hide_form( form );
   fl_free_form( form );
 }
 
index 40e1247de6ce34ec64d9d029056b459d1755ad9e..92edb0dcbe1c41e29bf3f2dbd10f742945a906cf 100644 (file)
@@ -12,7 +12,7 @@
 
 FD_form_toc::~FD_form_toc()
 {
-  ifform->visible ) fl_hide_form( form );
+  if (form->visible ) fl_hide_form( form );
   fl_free_form( form );
 }
 
index b35d9c4a7098d459bca929f521ccc96e60de2d8d..e142d9f4f3199b9f7dfcbf2c5748549b76dc992d 100644 (file)
@@ -12,7 +12,7 @@
 
 FD_form_url::~FD_form_url()
 {
-  ifform->visible ) fl_hide_form( form );
+  if (form->visible ) fl_hide_form( form );
   fl_free_form( form );
 }
 
index d3c2aafba87cd41f3509443e8b6ce8d25543c70d..5acafa6feccbefc7a261173c6c7aaee994806efd 100644 (file)
@@ -81,16 +81,16 @@ void fl_print_range_filter(FL_OBJECT * ob,
                pages = split (pages, piece, ',') ;
                piece = strip(piece) ;
                piece = frontStrip(piece) ;
-               if ( !stringOnlyContains (piece, "0123456789-") ) {
+               if (!stringOnlyContains (piece, "0123456789-")) {
                        WriteAlert(_("ERROR!  Unable to print!"),
                                   _("Check 'range of pages'!"));
                        return;
                }
                if (piece.find('-') == string::npos) { // not found
                        pageflag += lyxrc.print_pagerange_flag + piece + '-' + piece + ' ' ;
-               } else if (suffixIs(piece, "-") ) { // missing last page
+               } else if (suffixIs(piece, "-")) { // missing last page
                        pageflag += lyxrc.print_pagerange_flag + piece + "1000 ";
-               } else if (prefixIs(piece, "-") ) { // missing first page
+               } else if (prefixIs(piece, "-")) { // missing first page
                        pageflag += lyxrc.print_pagerange_flag + '1' + piece + ' ' ;
                } else {
                        pageflag += lyxrc.print_pagerange_flag + piece + ' ' ;
index 2fcc60514f3560cabf95f10c40bf4d017076bbb7..b3ed35d27a9c2ad554e9a1f2cee6cf13a0947ecb 100644 (file)
@@ -18,14 +18,14 @@ using std::vector;
 string formatted( string const & sin, int w, int size, int style )
 {
        string sout;
-       ifsin.empty() ) return sout;
+       if (sin.empty() ) return sout;
 
        // break sin up into a vector of individual words
        vector<string> sentence;
        string word;
-       forstring::const_iterator sit = sin.begin();
-            sit != sin.end(); ++sit ) {
-               if(*sit) == ' ' || (*sit) == '\n') {
+       for (string::const_iterator sit = sin.begin();
+            sit != sin.end(); ++sit) {
+               if ((*sit) == ' ' || (*sit) == '\n') {
                        sentence.push_back(word);
                        word.erase();
                } else {
@@ -33,17 +33,17 @@ 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, l1;
-       forvector<string>::const_iterator vit = sentence.begin();
-            vit != sentence.end(); ++vit ) {
-               if!l1.empty() ) l1 += ' ';
+       for (vector<string>::const_iterator vit = sentence.begin();
+            vit != sentence.end(); ++vit) {
+               if (!l1.empty() ) l1 += ' ';
                l1 += (*vit);
                int length = fl_get_string_width(style, size, l1.c_str(),
                                                 int(l1.length()));
-               if( length >= w ) {
-                       if!sout.empty() ) sout += '\n';
+               if (length >= w) {
+                       if (!sout.empty() ) sout += '\n';
                        sout += line;
                        l1 = (*vit);
                }
@@ -51,8 +51,8 @@ string formatted( string const & sin, int w, int size, int style )
                line = l1;
        }
        // Flush remaining contents of line
-       if( !line.empty() ) {
-               if!sout.empty() ) sout += '\n';
+       if (!line.empty()) {
+               if (!sout.empty() ) sout += '\n';
                sout += line;
        }
        
index 906cd9ad7913e025d2e230c903973f3f71ceab18..ffcdd4330535d653db87aaa1d70d97d4fa53ac98 100644 (file)
@@ -153,7 +153,7 @@ void ExternalTemplateManager::readTemplates(string const & path)
        }
        
        while (lex.IsOK()) {
-               switch(lex.lex()) {
+               switch (lex.lex()) {
                case TM_TEMPLATE: {
                        lex.next();
                        string temp = lex.GetString();
@@ -273,7 +273,7 @@ void ExternalTemplate::FormatTemplate::readFormat(LyXLex & lex)
        pushpophelper pph(lex, formattags, FO_END);
        
        while (lex.IsOK()) {
-               switch(lex.lex()) {
+               switch (lex.lex()) {
                case FO_PRODUCT:
                        lex.next(true);
                        product = lex.GetString();
index 60d10c5f3d97f680fee2dc18b599c68bbd869d40..a82b9deb1b011417d151510b919bfa770361a0a0 100644 (file)
@@ -168,7 +168,7 @@ int GhostscriptMsg(FL_OBJECT *, Window, int, int,
 {
        XClientMessageEvent * e = reinterpret_cast<XClientMessageEvent*>(ev);
 
-       if(lyxerr.debugging()) {
+       if (lyxerr.debugging()) {
                lyxerr << "ClientMessage, win:[xx] gs:[" << e->data.l[0]
                       << "] pm:[" << e->data.l[1] << "]" << endl;
        }
@@ -322,7 +322,7 @@ void AllocColors(int num)
                        if (i) XFreeColors(fl_get_display(),
                                           fl_state[fl_get_vclass()].colormap,
                                           gs_pixels, i, 0);
-                       if(lyxerr.debugging()) {
+                       if (lyxerr.debugging()) {
                                lyxerr << "Cannot allocate color cube "
                                       << num << endl;;
                        }
@@ -772,7 +772,7 @@ void getbitmap(figdata * p)
 static
 void makeupdatelist(figdata * p)
 {
-       for(figures_type::iterator it = figures.begin();
+       for (figures_type::iterator it = figures.begin();
            it != figures.end(); ++it)
                if ((*it)->data == p) {
                        if (lyxerr.debugging()) {
@@ -1158,7 +1158,7 @@ int InsetFig::DocBook(Buffer const *, ostream & os) const
        string buf1 = OnlyPath(owner->fileName());
        string figurename = MakeRelPath(fname, buf1);
 
-       if(suffixIs(figurename, ".eps"))
+       if (suffixIs(figurename, ".eps"))
                figurename.erase(figurename.length() - 4);
 
        os << "@<graphic fileref=\"" << figurename << "\"></graphic>";
@@ -1199,7 +1199,7 @@ void InsetFig::Edit(BufferView * bv, int, int, unsigned int)
        // We should have RO-versions of the form instead.
        // The actual prevention of altering a readonly doc
        // is done in CallbackFig()
-       if(bv->buffer()->isReadonly()) 
+       if (bv->buffer()->isReadonly()) 
                WarnReadonly(bv->buffer()->fileName());
 
        if (!form) {
@@ -1703,7 +1703,7 @@ void InsetFig::CallbackFig(long arg)
                break;
        case 7:                         /* apply */
        case 8:                         /* ok (apply and close) */
-               if(!current_view->buffer()->isReadonly()) {
+               if (!current_view->buffer()->isReadonly()) {
                        wtype = twtype;
                        htype = thtype;
                        xwid = atof(fl_get_input(form->Width));
@@ -1744,7 +1744,7 @@ void InsetFig::CallbackFig(long arg)
                        break;
                } //if not readonly
                //  The user has already been informed about RO in ::Edit
-               if(arg == 7) // if 'Apply'
+               if (arg == 7) // if 'Apply'
                        break;
                // fall through
        case 9:                         /* cancel = restore and close */
@@ -1888,7 +1888,7 @@ void InsetFig::RestoreForm()
        }
        else fl_set_input(form->EpsFile, "");
        fl_set_input(form->Subcaption, subcaption.c_str());
-       if(current_view->buffer()->isReadonly()) 
+       if (current_view->buffer()->isReadonly()) 
                DisableFigurePanel(form);
 
        TempRegenerate();
index 1ea8b95d3fabbdd57250a4ebaab20bc41b083d14..32f8b7ae6e09bdf8a4263198beffec28b413ffee 100644 (file)
@@ -84,7 +84,7 @@ InsetBibKey::InsetBibKey(InsetCommandParams const & p)
 
 InsetBibKey::~InsetBibKey()
 {
-       if(bibitem_form && bibitem_form->bibitem_form
+       if (bibitem_form && bibitem_form->bibitem_form
           && bibitem_form->bibitem_form->visible
           && bibitem_form->bibitem_form->u_vdata == &holder)
                fl_hide_form(bibitem_form->bibitem_form);
@@ -106,7 +106,7 @@ void InsetBibKey::callback( FD_bibitem_form * form, long data )
                // Do NOT change this to
                // holder.view->buffer() as this code is used by both
                // InsetBibKey and InsetBibtex! Ughhhhhhh!!!!
-               if(!current_view->buffer()->isReadonly()) {
+               if (!current_view->buffer()->isReadonly()) {
                        setContents(fl_get_input(form->key));
                        setOptions(fl_get_input(form->label));
                        // shouldn't mark the buffer dirty unless
@@ -176,7 +176,7 @@ string const InsetBibKey::getScreenLabel() const
 */
 void InsetBibKey::Edit(BufferView * bv, int, int, unsigned int)
 {
-       if(bv->buffer()->isReadonly())
+       if (bv->buffer()->isReadonly())
                WarnReadonly(bv->buffer()->fileName());
        
        if (!bibitem_form) {
@@ -213,7 +213,7 @@ InsetBibtex::InsetBibtex(InsetCommandParams const & p)
 
 InsetBibtex::~InsetBibtex()
 {
-       if(bibitem_form && bibitem_form->bibitem_form
+       if (bibitem_form && bibitem_form->bibitem_form
           && bibitem_form->bibitem_form->visible
           && bibitem_form->bibitem_form->u_vdata == &holder)
                fl_hide_form(bibitem_form->bibitem_form);
@@ -283,7 +283,7 @@ vector<pair<string, string> > const InsetBibtex::getKeys(Buffer const * buffer)
                        string linebuf0;
                        while (getline(ifs, linebuf0)) {
                                string linebuf = frontStrip(strip(linebuf0));
-                               iflinebuf.empty() ) continue;
+                               if (linebuf.empty() ) continue;
                                if (prefixIs(linebuf, "@")) {
                                        linebuf = subst(linebuf, '{', '(');
                                        linebuf = split(linebuf, tmp, '(');
@@ -296,7 +296,7 @@ vector<pair<string, string> > const InsetBibtex::getKeys(Buffer const * buffer)
                                                        keys.push_back(pair<string,string>(tmp,string()));
                                                }
                                        }
-                               } else if( !keys.empty() ) {
+                               } else if (!keys.empty()) {
                                        keys.back().second += linebuf + "\n";
                                }
                        }
index eea8607b70bcdea615fddb0ed59651beb9fb8079..7f70ba44d41b98a300ba052f2d375d7f2dff938b 100644 (file)
@@ -40,7 +40,7 @@ string const InsetCitation::getScreenLabel() const
                        keys = frontStrip(split(keys, key, ','));
 
                        string::size_type size = label.size() + 2 + key.size();
-                       if( size >= maxSize ) {
+                       if (size >= maxSize) {
                                label += ", ...";
                                break;
                        }
index e7ad117674fbdb1ed5bc8554467e9815f917e547..b3ff8cbba3d5aa5c2ef566cd104c52b50e846000 100644 (file)
@@ -44,7 +44,7 @@ string const InsetCommandParams::getAsString() const
 void InsetCommandParams::setFromString( string const & b )
 {
        string::size_type idx = b.find("|++|");
-       if( idx == string::npos ) {
+       if (idx == string::npos) {
                cmdname = "";
                options  = "";
                contents = "";
@@ -55,7 +55,7 @@ void InsetCommandParams::setFromString( string const & b )
        string tmp = b.substr(idx+4);
 
        idx = tmp.find("|++|");
-       if( idx == string::npos ) {
+       if (idx == string::npos) {
                options = tmp;
        } else {
                options  = tmp.substr(0, idx);
index 2e75be5bbe5efd67ed2d2228f5199cfabe1b1a15..0dd010df7e26091fcac2941a69f56b0ecf041d65 100644 (file)
@@ -58,7 +58,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; }
        ///
index 8153c087cc90fa6037ddcccc933a8ec8de4e32fb..718032141d15eb0c18f032f5f61022713d399a1f 100644 (file)
@@ -138,7 +138,7 @@ void include_cb(FL_OBJECT *, long arg)
        }
 
        case 1:
-               if(!current_view->buffer()->isReadonly()) {
+               if (!current_view->buffer()->isReadonly()) {
                        inset->setContents(fl_get_input(form->input));
                        // don't typeset
                        inset->setNoLoad(fl_get_button(form->flag1));
@@ -160,7 +160,7 @@ void include_cb(FL_OBJECT *, long arg)
                fl_hide_form(form->include);
                break;
        case 5:
-               if(!current_view->buffer()->isReadonly()) {
+               if (!current_view->buffer()->isReadonly()) {
                        inset->setContents(fl_get_input(form->input));
                        inset->setNoLoad(fl_get_button(form->flag1));
                        if (fl_get_button(form->flag2))
@@ -247,7 +247,7 @@ Inset * InsetInclude::Clone(Buffer const & buffer) const
 
 void InsetInclude::Edit(BufferView * bv, int, int, unsigned int)
 {
-       if(bv->buffer()->isReadonly())
+       if (bv->buffer()->isReadonly())
                WarnReadonly(bv->buffer()->fileName());
 
        if (!form) {
@@ -440,7 +440,7 @@ int InsetInclude::Linuxdoc(Buffer const * buffer, ostream & os) const
                } else
                        writefile = getFileName();
 
-               if(IsLyXFilename(getFileName()))
+               if (IsLyXFilename(getFileName()))
                        writefile = ChangeExtension(writefile, ".sgml");
 
                lyxerr[Debug::LATEX] << "incfile:" << incfile << endl;
@@ -476,7 +476,7 @@ int InsetInclude::DocBook(Buffer const * buffer, ostream & os) const
                        writefile = AddName(buffer->tmppath, incfile);
                } else
                        writefile = getFileName();
-               if(IsLyXFilename(getFileName()))
+               if (IsLyXFilename(getFileName()))
                        writefile = ChangeExtension(writefile, ".sgml");
 
                lyxerr[Debug::LATEX] << "incfile:" << incfile << endl;
@@ -507,7 +507,7 @@ void InsetInclude::Validate(LaTeXFeatures & features) const
                // Use the relative path.
                writefile = incfile;
 
-       if(IsLyXFilename(getFileName()))
+       if (IsLyXFilename(getFileName()))
                writefile = ChangeExtension(writefile, ".sgml");
 
        features.IncludedFiles[include_label] = writefile;
index f0d355a13f399a034469b679bf84bc7cf2fea164..66c7712191bd146c36b49b96bb4fc2e071e33e7c 100644 (file)
@@ -173,7 +173,7 @@ void InsetInfo::CloseInfoCB(FL_OBJECT * ob, long)
        InsetInfo * inset = static_cast<InsetInfo*>(ob->u_vdata);
        string tmp = fl_get_input(inset->strobj);
        Buffer * buffer = current_view->buffer();
-       if(tmp != inset->contents && !(buffer->isReadonly()) ) {
+       if (tmp != inset->contents && !(buffer->isReadonly())) {
                buffer->markDirty();
                inset->contents = tmp;
        }
@@ -203,7 +203,7 @@ void InsetInfo::Edit(BufferView *bv, int, int, unsigned int)
 {
        static int ow = -1, oh;
 
-       if(bv->buffer()->isReadonly())
+       if (bv->buffer()->isReadonly())
                WarnReadonly(bv->buffer()->fileName());
        
        if (!form) {
index 77619a2d766f878014ee8ebc814ca25a2572ca75..2fc222f235685a339ffa1e08139c9c0f950acb73 100644 (file)
@@ -191,7 +191,7 @@ void InsetLatexAccent::checkContents()
        // special clause for \i{}, \j{} \l{} and \L{}
        if ((modtype == DOT_LESS_I || modtype == DOT_LESS_J
             || modtype == lSLASH || modtype == LSLASH)
-           && contents[3] == '}' ) {
+           && contents[3] == '}') {
                switch (modtype) {
                case DOT_LESS_I: ic = 'i'; break;
                case DOT_LESS_J: ic = 'j'; break;
@@ -225,13 +225,13 @@ void InsetLatexAccent::checkContents()
                                remdot = true;
                        else
                                return;
-               } else if ( (ic == 'i'|| ic == 'j') && contents[4] == '}') {
+               } else if ((ic == 'i'|| ic == 'j') && contents[4] == '}') {
                        // Do a rewrite: \<foo>{i} --> \<foo>{\i}
                        string temp = contents;
                        temp.erase(3, string::npos);
                        temp += '\\';
                        temp += char(ic);
-                       for(string::size_type j = 4;
+                       for (string::size_type j = 4;
                            j < contents.length(); ++j)
                                temp+= contents[j];
                        contents= temp;
index 3c6a7f2975012366f569ad65159cb71c97b8b4b6..128ee44b04de2ae93e90427db13bc10c41512c47 100644 (file)
@@ -32,7 +32,7 @@ using std::ostream;
 InsetParent::InsetParent(InsetCommandParams const & p, Buffer const & bf)
        : InsetCommand(p)
 {
-       string fn = p.getContents();
+       string const fn = p.getContents();
        setContents(MakeAbsPath(fn, OnlyPath(bf.fileName())));
 }
 
index b66a7e0cefc30bb010780c13e3f22019fc0bb80e..41f4be19d5d635823e1f2a85144d85426a9e92ee 100644 (file)
@@ -78,7 +78,7 @@ InsetQuotes::InsetQuotes(char c, BufferParams const & params)
        : language(params.quotes_language), times(params.quotes_times)
 {
        // Decide whether left or right 
-       switch(c) {
+       switch (c) {
        case ' ': case '(': case '{': case '[': case '-': case ':':
        case LyXParagraph::META_HFILL:
        case LyXParagraph::META_NEWLINE: 
@@ -272,7 +272,7 @@ int InsetQuotes::Linuxdoc(Buffer const *, ostream & os) const
 
 int InsetQuotes::DocBook(Buffer const *, ostream & os) const
 {
-       if(times == InsetQuotes::DoubleQ) {
+       if (times == InsetQuotes::DoubleQ) {
                if (side == InsetQuotes::LeftQ)
                        os << "&ldquo;";
                else
index ff995a8a9f37a95f33db70b716e38b5ae6abf1e1..b936e53ad941b1301fba6f4c22964f94cabc9d8f 100644 (file)
@@ -23,10 +23,10 @@ InsetRef::InsetRef(InsetCommandParams const & p, Buffer const & buf)
 void InsetRef::Edit(BufferView * bv, int, int, unsigned int button)
 {
        // Eventually trigger dialog with button 3 not 1
-       ifbutton == 3 )
+       if (button == 3 )
                bv->owner()->getLyXFunc()->
                        Dispatch(LFUN_REF_GOTO, getContents());
-       else ifbutton == 1 )
+       else if (button == 1 )
                bv->owner()->getDialogs()->showRef( this );
 }
 
@@ -47,7 +47,7 @@ string const InsetRef::getScreenLabel() const
 
        temp += getContents();
 
-       if(!isLatex
+       if (!isLatex
           && !getOptions().empty()) {
                temp += "||";
                temp += getOptions();
@@ -59,7 +59,7 @@ string const InsetRef::getScreenLabel() const
 int InsetRef::Latex(Buffer const *, ostream & os,
                    bool /*fragile*/, bool /*fs*/) const
 {
-       if(getOptions().empty())
+       if (getOptions().empty())
                os << escape(getCommand());
        else {
                InsetCommandParams p( getCmdName(), getContents(), "" );
@@ -117,6 +117,6 @@ void InsetRef::Validate(LaTeXFeatures & features) const
 {
        if (getCmdName() == "vref" || getCmdName() == "vpageref")
                features.varioref = true;
-       else if(getCmdName() == "prettyref")
+       else if (getCmdName() == "prettyref")
                features.prettyref = true;
 }
index b16366a71eb25be82bd3d2e6effc6ad4324d4c1a..f97392473b2c2fedd11b7e238a3bd4b9fb6bbd91 100644 (file)
@@ -252,11 +252,11 @@ void InsetTabular::draw(BufferView * bv, LyXFont const & font, int baseline,
     bool dodraw;
     x += ADD_TO_TABULAR_WIDTH;
     if (cleared) {
-       for(i = 0; i < tabular->rows(); ++i) {
+       for (i = 0; i < tabular->rows(); ++i) {
            nx = int(x);
            dodraw = ((baseline + tabular->GetDescentOfRow(i)) > 0) &&
                    (baseline - tabular->GetAscentOfRow(i))<pain.paperHeight();
-           for(j = 0; j < tabular->columns(); ++j) {
+           for (j = 0; j < tabular->columns(); ++j) {
                if (tabular->IsPartOfMultiColumn(i, j))
                    continue;
                cx = nx + tabular->GetBeginningOfTextInCell(cell);
@@ -276,8 +276,8 @@ void InsetTabular::draw(BufferView * bv, LyXFont const & font, int baseline,
        }
     } else if (need_update == CELL) {
        nx = int(x);
-       for(i = 0; (cell < actcell) && (i < tabular->rows()); ++i) {
-           for(j = 0; (cell < actcell) && (j < tabular->columns()); ++j) {
+       for (i = 0; (cell < actcell) && (i < tabular->rows()); ++i) {
+           for (j = 0; (cell < actcell) && (j < tabular->columns()); ++j) {
                if (tabular->IsPartOfMultiColumn(i, j))
                    continue;
                nx += tabular->GetWidthOfColumn(cell);
@@ -402,7 +402,7 @@ void InsetTabular::update(BufferView * bv, LyXFont const & font, bool reinit)
 //     inset_x = cursor.x() - top_x + tabular->GetBeginningOfTextInCell(actcell);
 //     inset_y = cursor.y();
     }
-    switch(need_update) {
+    switch (need_update) {
     case INIT:
     case FULL:
     case CELL:
@@ -964,9 +964,9 @@ bool InsetTabular::calculate_dimensions_of_cells(BufferView * bv,
     InsetText * inset;
     bool changed = false;
     
-    for(int i = 0; i < tabular->rows(); ++i) {
+    for (int i = 0; i < tabular->rows(); ++i) {
        maxAsc = maxDesc = 0;
-       for(int j= 0; j < tabular->columns(); ++j) {
+       for (int j= 0; j < tabular->columns(); ++j) {
            if (tabular->IsPartOfMultiColumn(i,j))
                continue;
            ++cell;
@@ -1062,7 +1062,7 @@ void InsetTabular::setPos(BufferView * bv, int x, int y) const
        tabular->GetAdditionalWidth(actcell);
 #warning Jürgen, can you rewrite this to _not_ use the sequencing operator. (Lgb)
 #if 0
-    for(; !tabular->IsLastCellInRow(actcell) && (lx < x);
+    for (; !tabular->IsLastCellInRow(actcell) && (lx < x);
        ++actcell,lx += tabular->GetWidthOfColumn(actcell) +
            tabular->GetAdditionalWidth(actcell - 1));
 #else
@@ -1089,10 +1089,10 @@ int InsetTabular::getCellXPos(int cell) const
 {
     int c = cell;
 
-    for(; !tabular->IsFirstCellInRow(c); --c)
+    for (; !tabular->IsFirstCellInRow(c); --c)
        ;
     int lx = tabular->GetWidthOfColumn(cell);
-    for(; c < cell; ++c) {
+    for (; c < cell; ++c) {
        lx += tabular->GetWidthOfColumn(c);
     }
     return (lx - tabular->GetWidthOfColumn(cell) + top_x);
@@ -1108,7 +1108,7 @@ void InsetTabular::resetPos(BufferView * bv) const
     int cell = 0;
     actrow = 0;
     cursor.y(0);
-    for(; (cell < actcell) && !tabular->IsLastRow(cell); ++cell) {
+    for (; (cell < actcell) && !tabular->IsLastRow(cell); ++cell) {
        if (tabular->IsLastCellInRow(cell)) {
            cursor.y(cursor.y() + tabular->GetDescentOfRow(actrow) +
                tabular->GetAscentOfRow(actrow + 1) +
@@ -1239,7 +1239,7 @@ bool InsetTabular::TabularFeatures(BufferView * bv, string const & what)
     LyXTabular::Feature action = LyXTabular::LAST_ACTION;
 
     int i = 0;
-    for(; tabularFeatures[i].action != LyXTabular::LAST_ACTION; ++i) {
+    for (; tabularFeatures[i].action != LyXTabular::LAST_ACTION; ++i) {
        string const tmp = tabularFeatures[i].feature;
            
        if (tmp == what.substr(0, tmp.length())) {
@@ -1400,8 +1400,8 @@ void InsetTabular::TabularFeatures(BufferView * bv,
        flag = false;
     case LyXTabular::TOGGLE_LINE_TOP:
        lineSet = !tabular->TopLine(actcell, flag);
-       for(i=sel_row_start; i<=sel_row_end; ++i)
-           for(j=sel_col_start; j<=sel_col_end; ++j)
+       for (i=sel_row_start; i<=sel_row_end; ++i)
+           for (j=sel_col_start; j<=sel_col_end; ++j)
                tabular->SetTopLine(tabular->GetCellNumber(i,j),lineSet, flag);
        UpdateLocal(bv, INIT, true);
        break;
@@ -1410,8 +1410,8 @@ void InsetTabular::TabularFeatures(BufferView * bv,
        flag = false;
     case LyXTabular::TOGGLE_LINE_BOTTOM:
        lineSet = !tabular->BottomLine(actcell, flag); 
-       for(i=sel_row_start; i<=sel_row_end; ++i)
-           for(j=sel_col_start; j<=sel_col_end; ++j)
+       for (i=sel_row_start; i<=sel_row_end; ++i)
+           for (j=sel_col_start; j<=sel_col_end; ++j)
                tabular->SetBottomLine(tabular->GetCellNumber(i,j),lineSet,
                                       flag);
        UpdateLocal(bv, INIT, true);
@@ -1421,8 +1421,8 @@ void InsetTabular::TabularFeatures(BufferView * bv,
        flag = false;
     case LyXTabular::TOGGLE_LINE_LEFT:
        lineSet = !tabular->LeftLine(actcell, flag);
-       for(i=sel_row_start; i<=sel_row_end; ++i)
-           for(j=sel_col_start; j<=sel_col_end; ++j)
+       for (i=sel_row_start; i<=sel_row_end; ++i)
+           for (j=sel_col_start; j<=sel_col_end; ++j)
                tabular->SetLeftLine(tabular->GetCellNumber(i,j),lineSet,
                                     flag);
        UpdateLocal(bv, INIT, true);
@@ -1432,8 +1432,8 @@ void InsetTabular::TabularFeatures(BufferView * bv,
        flag = false;
     case LyXTabular::TOGGLE_LINE_RIGHT:
        lineSet = !tabular->RightLine(actcell, flag);
-       for(i=sel_row_start; i<=sel_row_end; ++i)
-           for(j=sel_col_start; j<=sel_col_end; ++j)
+       for (i=sel_row_start; i<=sel_row_end; ++i)
+           for (j=sel_col_start; j<=sel_col_end; ++j)
                tabular->SetRightLine(tabular->GetCellNumber(i,j),lineSet,
                                      flag);
        UpdateLocal(bv, INIT, true);
@@ -1445,8 +1445,8 @@ void InsetTabular::TabularFeatures(BufferView * bv,
     case LyXTabular::ALIGN_LEFT:
     case LyXTabular::ALIGN_RIGHT:
     case LyXTabular::ALIGN_CENTER:
-       for(i = sel_row_start; i <= sel_row_end; ++i)
-           for(j = sel_col_start; j <= sel_col_end; ++j)
+       for (i = sel_row_start; i <= sel_row_end; ++i)
+           for (j = sel_col_start; j <= sel_col_end; ++j)
                tabular->SetAlignment(tabular->GetCellNumber(i, j), setAlign,
                                      flag);
        if (hasSelection())
@@ -1461,8 +1461,8 @@ void InsetTabular::TabularFeatures(BufferView * bv,
     case LyXTabular::VALIGN_TOP:
     case LyXTabular::VALIGN_BOTTOM:
     case LyXTabular::VALIGN_CENTER:
-       for(i = sel_row_start; i <= sel_row_end; ++i)
-           for(j = sel_col_start; j <= sel_col_end; ++j)
+       for (i = sel_row_start; i <= sel_row_end; ++i)
+           for (j = sel_col_start; j <= sel_col_end; ++j)
                tabular->SetVAlignment(tabular->GetCellNumber(i, j),
                                       setVAlign, flag);
        if (hasSelection())
@@ -1513,8 +1513,8 @@ void InsetTabular::TabularFeatures(BufferView * bv,
     case LyXTabular::SET_ALL_LINES:
        setLines = 1;
     case LyXTabular::UNSET_ALL_LINES:
-       for(i=sel_row_start; i<=sel_row_end; ++i)
-           for(j=sel_col_start; j<=sel_col_end; ++j)
+       for (i=sel_row_start; i<=sel_row_end; ++i)
+           for (j=sel_col_start; j<=sel_col_end; ++j)
                tabular->SetAllLines(tabular->GetCellNumber(i,j), setLines);
        UpdateLocal(bv, INIT, true);
        break;
@@ -1533,13 +1533,13 @@ void InsetTabular::TabularFeatures(BufferView * bv,
        tabular->SetRotateTabular(false);
        break;
     case LyXTabular::SET_ROTATE_CELL:
-       for(i=sel_row_start; i<=sel_row_end; ++i)
-           for(j=sel_col_start; j<=sel_col_end; ++j)
+       for (i=sel_row_start; i<=sel_row_end; ++i)
+           for (j=sel_col_start; j<=sel_col_end; ++j)
                tabular->SetRotateCell(tabular->GetCellNumber(i,j),true);
        break;
     case LyXTabular::UNSET_ROTATE_CELL:
-       for(i = sel_row_start; i <= sel_row_end; ++i)
-           for(j = sel_col_start; j <= sel_col_end; ++j)
+       for (i = sel_row_start; i <= sel_row_end; ++i)
+           for (j = sel_col_start; j <= sel_col_end; ++j)
                tabular->SetRotateCell(tabular->GetCellNumber(i, j), false);
        break;
     case LyXTabular::SET_USEBOX:
@@ -1547,8 +1547,8 @@ void InsetTabular::TabularFeatures(BufferView * bv,
        LyXTabular::BoxType val = LyXTabular::BoxType(strToInt(value));
        if (val == tabular->GetUsebox(actcell))
            val = LyXTabular::BOX_NONE;
-       for(i = sel_row_start; i <= sel_row_end; ++i)
-           for(j = sel_col_start; j <= sel_col_end; ++j)
+       for (i = sel_row_start; i <= sel_row_end; ++i)
+           for (j = sel_col_start; j <= sel_col_end; ++j)
                tabular->SetUsebox(tabular->GetCellNumber(i, j), val);
        break;
     }
@@ -1604,16 +1604,16 @@ bool InsetTabular::ActivateCellInset(BufferView * bv, int x, int y, int button,
 bool InsetTabular::InsetHit(BufferView * bv, int x, int ) const
 {
     InsetText * inset = tabular->GetCellInset(actcell);
-    int x1 = x + top_x;
+    int const x1 = x + top_x;
 
     if (!cellstart(cursor.pos())) {
-       return (((x + top_x) < cursor.x()) &&
-               ((x + top_x) > (cursor.x() - inset->width(bv,
-                                                     LyXFont(LyXFont::ALL_SANE)))));
+       return ((x + top_x) < cursor.x() &&
+               (x + top_x) > (cursor.x() - inset->width(bv,
+                                                     LyXFont(LyXFont::ALL_SANE))));
     } else {
-       int x2 = cursor.x() + tabular->GetBeginningOfTextInCell(actcell);
-       return ((x1 > x2) &&
-               (x1 < (x2 + inset->width(bv, LyXFont(LyXFont::ALL_SANE)))));
+       int const x2 = cursor.x() + tabular->GetBeginningOfTextInCell(actcell);
+       return (x1 > x2 &&
+               x1 < (x2 + inset->width(bv, LyXFont(LyXFont::ALL_SANE))));
     }
 }
 
@@ -1635,7 +1635,7 @@ int InsetTabular::getMaxWidth(Painter & pain,
 {
     int const n = tabular->GetNumberOfCells();
     int cell = 0;
-    for(; cell < n; ++cell) {
+    for (; cell < n; ++cell) {
        if (tabular->GetCellInset(cell) == inset)
            break;
     }
@@ -1689,7 +1689,7 @@ LyXFunc::func_status InsetTabular::getStatus(string const & what) const
     LyXFunc::func_status status = LyXFunc::OK;
     
     int i = 0;
-    for(; tabularFeatures[i].action != LyXTabular::LAST_ACTION; ++i) {
+    for (; tabularFeatures[i].action != LyXTabular::LAST_ACTION; ++i) {
        string const tmp = tabularFeatures[i].feature;
        if (tmp == what.substr(0, tmp.length())) {                  
        //if (!strncmp(tabularFeatures[i].feature.c_str(), what.c_str(),
@@ -1934,14 +1934,14 @@ bool InsetTabular::copySelection(BufferView * bv)
 
     paste_tabular = new LyXTabular(this, *tabular); // rows, columns);
     int i;
-    for(i=0; i < sel_row_start; ++i)
+    for (i=0; i < sel_row_start; ++i)
        paste_tabular->DeleteRow(0);
     while(paste_tabular->rows() > rows)
        paste_tabular->DeleteRow(rows);
     paste_tabular->SetTopLine(0, true, true);
     paste_tabular->SetBottomLine(paste_tabular->GetFirstCellInRow(rows-1),
                                 true, true);
-    for(i=0; i < sel_col_start; ++i)
+    for (i=0; i < sel_col_start; ++i)
        paste_tabular->DeleteColumn(0);
     while(paste_tabular->columns() > columns)
        paste_tabular->DeleteColumn(columns);
@@ -1959,7 +1959,7 @@ bool InsetTabular::pasteSelection(BufferView * bv)
 {
     if (!paste_tabular)
        return false;
-    for(int j=0, i=actcell; j<paste_tabular->GetNumberOfCells(); ++j,++i) {
+    for (int j=0, i=actcell; j<paste_tabular->GetNumberOfCells(); ++j,++i) {
        while (paste_tabular->row_of_cell(j) > tabular->row_of_cell(i)-actrow)
            ++i;
        if (tabular->GetNumberOfCells() <= i)
@@ -2006,8 +2006,8 @@ bool InsetTabular::cutSelection()
            //sel_cell_end = tmp;
        swap(sel_cell_start, sel_cell_end);
     }
-    for(int i = sel_row_start; i <= sel_row_end; ++i) {
-       for(int j = sel_col_start; j <= sel_col_end; ++j) {
+    for (int i = sel_row_start; i <= sel_row_end; ++i) {
+       for (int j = sel_col_start; j <= sel_col_end; ++j) {
            tabular->GetCellInset(tabular->GetCellNumber(i, j))->clear();
        }
     }
index 6f17fbac6f35420b5b5f7de909f6c752cf5a5440..0d76778bcee863ffb005905eb04fd7d69ad05fb2 100644 (file)
@@ -114,7 +114,7 @@ InsetText::~InsetText()
 {
     // delete all instances of LyXText before deleting the paragraps used
     // by it.
-    for(Cache::const_iterator cit = cache.begin(); cit != cache.end(); ++cit)
+    for (Cache::const_iterator cit = cache.begin(); cit != cache.end(); ++cit)
        delete (*cit).second;
     LyXParagraph * p = par->next;
     delete par;
@@ -130,7 +130,7 @@ void InsetText::clear()
 {
     // delete all instances of LyXText before deleting the paragraps used
     // by it.
-    for(Cache::const_iterator cit = cache.begin(); cit != cache.end(); ++cit)
+    for (Cache::const_iterator cit = cache.begin(); cit != cache.end(); ++cit)
        delete (*cit).second;
     LyXParagraph * p = par->next;
     delete par;
@@ -177,7 +177,7 @@ void InsetText::Read(Buffer const * buf, LyXLex & lex)
 
     // delete all instances of LyXText before deleting the paragraps used
     // by it.
-    for(Cache::const_iterator cit = cache.begin(); cit != cache.end(); ++cit)
+    for (Cache::const_iterator cit = cache.begin(); cit != cache.end(); ++cit)
        delete (*cit).second;
 
     LyXParagraph * p = par->next;
@@ -644,7 +644,7 @@ void InsetText::InsetButtonPress(BufferView * bv, int x, int y, int button)
            paste_internally = true;
        }
        TEXT(bv)->SetCursorFromCoordinates(bv, x-drawTextXOffset,
-                                          y+insetAscent);
+                                          y + insetAscent);
        TEXT(bv)->sel_cursor = TEXT(bv)->cursor;
        UpdateLocal(bv, CURSOR, false);
        bv->owner()->setLayout(cpar(bv)->GetLayout());
@@ -742,7 +742,7 @@ InsetText::LocalDispatch(BufferView * bv,
            UpdateLocal(bv, CURSOR_PAR, false);
             return result;
         } else if (result == FINISHED) {
-           switch(action) {
+           switch (action) {
            case -1:
            case LFUN_RIGHT:
                moveRight(bv, false);
@@ -1390,7 +1390,7 @@ void InsetText::SetParagraphData(LyXParagraph *p)
 {
     // delete all instances of LyXText before deleting the paragraps used
     // by it.
-    for(Cache::const_iterator cit = cache.begin(); cit != cache.end(); ++cit)
+    for (Cache::const_iterator cit = cache.begin(); cit != cache.end(); ++cit)
        delete (*cit).second;
 
     LyXParagraph * np;
@@ -1509,7 +1509,7 @@ void InsetText::deleteLyXText(BufferView * bv, bool recursive) const
     if (recursive) {
        /// then remove all LyXText in text-insets
        LyXParagraph * p = par;
-       for(;p;p = p->next) {
+       for (;p;p = p->next) {
            p->deleteInsetsLyXText(bv);
        }
     }
@@ -1572,7 +1572,7 @@ void InsetText::resizeLyXText(BufferView * bv) const
        /// then resize all LyXText in text-insets
        inset_x = cx(bv) - top_x + drawTextXOffset;
        inset_y = cy(bv) + drawTextYOffset;
-       for(LyXParagraph * p = par; p; p = p->next) {
+       for (LyXParagraph * p = par; p; p = p->next) {
            p->resizeInsetsLyXText(bv);
        }
     }
@@ -1582,8 +1582,8 @@ void InsetText::resizeLyXText(BufferView * bv) const
 
 void InsetText::removeNewlines()
 {
-    for(LyXParagraph * p = par; p; p = p->next) {
-       for(int i = 0; i < p->Last(); ++i) {
+    for (LyXParagraph * p = par; p; p = p->next) {
+       for (int i = 0; i < p->Last(); ++i) {
            if (p->GetChar(i) == LyXParagraph::META_NEWLINE)
                p->Erase(i);
        }
index 6657beb0f6ab3843b6171c078acf23499d77d93d..27f94452fdc8df54480e56fbb4f49e0e338dad2e 100644 (file)
@@ -17,11 +17,11 @@ using std::ostream;
 string const InsetTOC::getScreenLabel() const 
 {
        string cmdname( getCmdName() );
-       ifcmdname == "tableofcontents" )
+       if (cmdname == "tableofcontents" )
                return _("Table of Contents");
-       else ifcmdname == "listofalgorithms" )
+       else if (cmdname == "listofalgorithms" )
                return _("List of Algorithms");
-       else ifcmdname == "listoffigures" )
+       else if (cmdname == "listoffigures" )
                return _("List of Figures");
        else
                return _("List of Tables");
@@ -31,11 +31,11 @@ string const InsetTOC::getScreenLabel() const
 Inset::Code InsetTOC::LyxCode() const
 {
        string cmdname( getCmdName() );
-       ifcmdname == "tableofcontents" )
+       if (cmdname == "tableofcontents" )
                return Inset::TOC_CODE;
-       else ifcmdname == "listofalgorithms" )
+       else if (cmdname == "listofalgorithms" )
                return Inset::LOA_CODE;
-       else ifcmdname == "listoffigures" )
+       else if (cmdname == "listoffigures" )
                return Inset::LOF_CODE; 
        else
                return Inset::LOT_CODE;
@@ -50,7 +50,7 @@ void InsetTOC::Edit(BufferView * bv, int, int, unsigned int)
 
 int InsetTOC::Linuxdoc(Buffer const *, ostream & os) const
 {
-       ifgetCmdName() == "tableofcontents" )
+       if (getCmdName() == "tableofcontents" )
                os << "<toc>";
        return 0;
 }
@@ -58,7 +58,7 @@ int InsetTOC::Linuxdoc(Buffer const *, ostream & os) const
 
 int InsetTOC::DocBook(Buffer const *, ostream & os) const
 {
-       ifgetCmdName() == "tableofcontents" )
+       if (getCmdName() == "tableofcontents" )
                os << "<toc></toc>";
        return 0;
 }
index 3f6cb00412fb1de1d2ce21d3dd62cbb577547976..b95bc270af6ac96a00976210b768fecb7f4eb572 100644 (file)
@@ -28,12 +28,12 @@ void InsetUrl::Edit(BufferView * bv, int, int, unsigned int)
 string const InsetUrl::getScreenLabel() const
 {
        string temp;
-       ifgetCmdName() == "url" )
+       if (getCmdName() == "url" )
                temp = _("Url: ");
        else 
                temp = _("HtmlUrl: ");
 
-       if(!getOptions().empty())
+       if (!getOptions().empty())
                temp += getOptions();
        else
                temp += getContents();
index bbdc5e5d7798e336756bb02688fd03afee48b606..389416e3e44c32be50c571f9c72637563365f7c5 100644 (file)
@@ -167,7 +167,7 @@ void kb_keymap::print(string & buf) const
 int kb_keymap::defkey(kb_sequence * seq, int action, int idx /*= 0*/)
 {
        unsigned int code = seq->sequence[idx];
-       if(code == NoSymbol) return -1;
+       if (code == NoSymbol) return -1;
 
        unsigned int modmsk = seq->modifiers[idx];
 
@@ -185,7 +185,7 @@ int kb_keymap::defkey(kb_sequence * seq, int action, int idx /*= 0*/)
                                        << buf
                                        << "' is overriding old binding..."
                                        << endl;
-                               if((*it).table) {
+                               if ((*it).table) {
                                        delete (*it).table;
                                        (*it).table = 0;
                                }
index d5bdd3c3c1099e2881c9afc105b863ddead6d0ce..26e13d412d8262d62a139f75de530db41e5cc2d7 100644 (file)
@@ -61,24 +61,24 @@ void printKeysym(unsigned int key, unsigned int mod, string & buf);
 int kb_sequence::addkey(unsigned int key,
                        unsigned int mod, unsigned int nmod /*= 0*/)
 {
-       if(length < 0) length = 0;
+       if (length < 0) length = 0;
 
-       if(length + 1 >= size) {
+       if (length + 1 >= size) {
                unsigned int * nseq = new unsigned int[size + KB_PREALLOC];
                size += KB_PREALLOC;
                memcpy(nseq, sequence, length * sizeof(unsigned int));
-               if(sequence != staticseq) delete sequence;
+               if (sequence != staticseq) delete sequence;
                sequence = nseq;
                nseq = new unsigned int[size];
                memcpy(nseq, modifiers, length * sizeof(unsigned int));
-               if(modifiers != staticmod) delete modifiers;
+               if (modifiers != staticmod) delete modifiers;
                modifiers = nseq;
        }
 
        modifiers[length]  = mod + (nmod << 16);
        sequence[length++] = key;
    
-       if(curmap)
+       if (curmap)
                return curmap->lookup(key, mod, this);
        
        return -1;
@@ -98,16 +98,16 @@ int kb_sequence::addkey(unsigned int key,
 
 int kb_sequence::parse(string const & s)
 {
-       if(s.empty()) return 1;
+       if (s.empty()) return 1;
 
        string::size_type i = 0;
        unsigned int mod = 0, nmod = 0;
        while (i < s.length()) {
-               if(s[i] && (s[i]) <= ' ') ++i;
-               if(i >= s.length()) break;
+               if (s[i] && (s[i]) <= ' ') ++i;
+               if (i >= s.length()) break;
                
-               if(s[i + 1] == '-')     { // is implicit that s[i] == true
-                       switch(s[i]) {
+               if (s[i + 1] == '-')    { // is implicit that s[i] == true
+                       switch (s[i]) {
                        case 's': case 'S':
                                mod |= ShiftMask;
                                i += 2;
@@ -123,8 +123,8 @@ int kb_sequence::parse(string const & s)
                        default:
                                return i + 1;
                        }
-               } else if(s[i] == '~' && s[i + 1] && s[i + 2] == '-') {
-                       switch(s[i + 1]) {
+               } else if (s[i] == '~' && s[i + 1] && s[i + 2] == '-') {
+                       switch (s[i + 1]) {
                        case 's': case 'S':
                                nmod |= ShiftMask;
                                i += 3;
@@ -143,11 +143,11 @@ int kb_sequence::parse(string const & s)
                } else {
                        string tbuf;
                        string::size_type j = i;
-                       for(; j < s.length() && s[j] > ' '; ++j)
+                       for (; j < s.length() && s[j] > ' '; ++j)
                                tbuf += s[j];    // (!!!check bounds :-)
                        
                        KeySym key = XStringToKeysym(tbuf.c_str());
-                       if(key == NoSymbol) {
+                       if (key == NoSymbol) {
                                lyxerr[Debug::KBMAP]
                                        << "kbmap.C: No such keysym: "
                                        << tbuf << endl;
@@ -179,15 +179,15 @@ int kb_sequence::print(string & buf, bool when_defined) const
        KeySym key;
        unsigned int mod;
        int l = length;
-       if ( l < 0 && !when_defined ) l = -l;
+       if (l < 0 && !when_defined ) l = -l;
        
-       for(int i = 0; i < l; ++i) {
+       for (int i = 0; i < l; ++i) {
                key = sequence[i];
                mod = modifiers[i] & 0xffff;
 
                printKeysym(key, mod, buf);  // RVDK_PATCH_5
 
-               if(i + 1 < l) {  // append a blank
+               if (i + 1 < l) {  // append a blank
                        buf += ' ';
                }
        }
@@ -243,8 +243,8 @@ void kb_sequence::delseq()
 unsigned int kb_sequence::getsym() const
 {
        int l = length;
-       if(l == 0) return NoSymbol;
-       if(l < 0) l = -l;
+       if (l == 0) return NoSymbol;
+       if (l < 0) l = -l;
        return sequence[l - 1];
 }
 
@@ -261,7 +261,7 @@ char kb_sequence::getiso() const
 {
        int c = getsym();
        
-       if(c > 0xff)
+       if (c > 0xff)
                return '\0';
        return c;
 }
index bad3b274118812ec634e630be50b5cb6c8520857..8652f06d8eb0c02dc846a2925dc48c638c547c8b 100644 (file)
@@ -188,7 +188,7 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
        while (!finished && lexrc.IsOK() && !error) {
                int le = lexrc.lex();
                // See comment in lyxrc.C.
-               switch(le) {
+               switch (le) {
                case LyXLex::LEX_FEOF:
                        continue; 
 
@@ -198,7 +198,7 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
                        continue; 
                default: break;
                }
-               switch(static_cast<LayoutTags>(le)) {
+               switch (static_cast<LayoutTags>(le)) {
                case LT_END:            // end of structure
                        finished = true;
                        break;
@@ -429,7 +429,7 @@ void LyXLayout::readAlign(LyXLex & lexrc)
                return; 
        default: break;
        };
-       switch(static_cast<AlignTags>(le)) {
+       switch (static_cast<AlignTags>(le)) {
        case AT_BLOCK:
                align = LYX_ALIGN_BLOCK;
                break;
@@ -610,7 +610,7 @@ void LyXLayout::readEndLabelType(LyXLex & lexrc)
        pushpophelper pph(lexrc, endlabelTypeTags,
                          END_LABEL_ENUM_LAST-END_LABEL_ENUM_FIRST+1);
        int le = lexrc.lex();
-       switch(le) {
+       switch (le) {
        case LyXLex::LEX_UNDEF:
                lexrc.printError("Unknown labeltype tag `$$Token'");
                break;
@@ -641,7 +641,7 @@ void LyXLayout::readMargin(LyXLex & lexrc)
        pushpophelper pph(lexrc, marginTags, MARGIN_RIGHT_ADDRESS_BOX);
 
        int le = lexrc.lex();
-       switch(le) {
+       switch (le) {
        case LyXLex::LEX_UNDEF:
                lexrc.printError("Unknown margin type tag `$$Token'");
                return;
@@ -710,13 +710,13 @@ void LyXLayout::readSpacing(LyXLex & lexrc)
 
        pushpophelper pph(lexrc, spacingTags, ST_OTHER);
        int le = lexrc.lex();
-       switch(le) {
+       switch (le) {
        case LyXLex::LEX_UNDEF:
                lexrc.printError("Unknown spacing token `$$Token'");
                return;
        default: break;
        }
-       switch(static_cast<SpacingTags>(le)) {
+       switch (static_cast<SpacingTags>(le)) {
        case ST_SPACING_SINGLE:
                spacing.set(Spacing::Single);
                break;
@@ -835,7 +835,7 @@ bool LyXTextClass::Read(string const & filename, bool merge)
        // parsing
        while (lexrc.IsOK() && !error) {
                int le = lexrc.lex();
-               switch(le) {
+               switch (le) {
                case LyXLex::LEX_FEOF:
                        continue; 
 
@@ -845,7 +845,7 @@ bool LyXTextClass::Read(string const & filename, bool merge)
                        continue; 
                default: break;
                }
-               switch(static_cast<TextClassTags>(le)) {
+               switch (static_cast<TextClassTags>(le)) {
                case TC_OUTPUTTYPE:   // output type definition
                        readOutputType(lexrc);
                        break;
@@ -901,7 +901,7 @@ bool LyXTextClass::Read(string const & filename, bool merge)
                        
                case TC_SIDES:
                        if (lexrc.next()) {
-                               switch(lexrc.GetInteger()) {
+                               switch (lexrc.GetInteger()) {
                                case 1: sides_ = OneSide; break;
                                case 2: sides_ = TwoSides; break;
                                default:
@@ -1003,7 +1003,7 @@ void LyXTextClass::readOutputType(LyXLex & lexrc)
        pushpophelper pph(lexrc, outputTypeTags, LITERATE);
 
        int le = lexrc.lex();
-       switch(le) {
+       switch (le) {
        case LyXLex::LEX_UNDEF:
                lexrc.printError("Unknown output type `$$Token'");
                return;
@@ -1053,7 +1053,7 @@ void LyXTextClass::readMaxCounter(LyXLex & lexrc)
 
        pushpophelper pph(lexrc, maxCounterTags, MC_COUNTER_ENUMIV);
        int le = lexrc.lex();
-       switch(le) {
+       switch (le) {
        case LyXLex::LEX_UNDEF:
                lexrc.printError("Unknown MaxCounter tag `$$Token'");
                return; 
@@ -1237,7 +1237,7 @@ LyXTextClassList::NumberOfLayout(LyXTextClassList::size_type textclass,
                                 string const & name) const
 {
        classlist[textclass].load();
-       for(unsigned int i = 0; i < classlist[textclass].numLayouts(); ++i) {
+       for (unsigned int i = 0; i < classlist[textclass].numLayouts(); ++i) {
                if (classlist[textclass][i].name() == name)
                        return make_pair(true, i);
        }
index 9787b712a6820711e5c30070d0db3fe6a83ab4ea..440abb97c68fce4d5afae848e4967d0a398fd602 100644 (file)
@@ -657,7 +657,7 @@ LyXFont const UserFreeFont(BufferParams const & params)
        LyXFont font(LyXFont::ALL_IGNORE);
 
        int pos = fl_get_choice(fd_form_character->choice_family);
-       switch(pos) {
+       switch (pos) {
        case 1: font.setFamily(LyXFont::IGNORE_FAMILY); break;
        case 2: font.setFamily(LyXFont::ROMAN_FAMILY); break;
        case 3: font.setFamily(LyXFont::SANS_FAMILY); break;
@@ -666,7 +666,7 @@ LyXFont const UserFreeFont(BufferParams const & params)
        }
 
        pos = fl_get_choice(fd_form_character->choice_series);
-       switch(pos) {
+       switch (pos) {
        case 1: font.setSeries(LyXFont::IGNORE_SERIES); break;
        case 2: font.setSeries(LyXFont::MEDIUM_SERIES); break;
        case 3: font.setSeries(LyXFont::BOLD_SERIES); break;
@@ -674,7 +674,7 @@ LyXFont const UserFreeFont(BufferParams const & params)
        }
 
        pos = fl_get_choice(fd_form_character->choice_shape);
-       switch(pos) {
+       switch (pos) {
        case 1: font.setShape(LyXFont::IGNORE_SHAPE); break;
        case 2: font.setShape(LyXFont::UP_SHAPE); break;
        case 3: font.setShape(LyXFont::ITALIC_SHAPE); break;
@@ -684,7 +684,7 @@ LyXFont const UserFreeFont(BufferParams const & params)
        }
 
        pos = fl_get_choice(fd_form_character->choice_size);
-       switch(pos) {
+       switch (pos) {
        case 1: font.setSize(LyXFont::IGNORE_SIZE); break;
        case 2: font.setSize(LyXFont::SIZE_TINY); break;
        case 3: font.setSize(LyXFont::SIZE_SCRIPT); break;
@@ -702,7 +702,7 @@ LyXFont const UserFreeFont(BufferParams const & params)
        }
 
        pos = fl_get_choice(fd_form_character->choice_bar);
-       switch(pos) {
+       switch (pos) {
        case 1: font.setEmph(LyXFont::IGNORE);
                font.setUnderbar(LyXFont::IGNORE);
                font.setNoun(LyXFont::IGNORE);
@@ -720,7 +720,7 @@ LyXFont const UserFreeFont(BufferParams const & params)
        }
 
        pos = fl_get_choice(fd_form_character->choice_color);
-       switch(pos) {
+       switch (pos) {
        case 1: font.setColor(LColor::ignore); break;
        case 2: font.setColor(LColor::none); break;
        case 3: font.setColor(LColor::black); break;
@@ -835,7 +835,7 @@ void FigureApplyCB(FL_OBJECT *, long)
                return;
 
        Buffer * buffer = current_view->buffer();
-       if(buffer->isReadonly()) // paranoia
+       if (buffer->isReadonly()) // paranoia
                return;
        
        current_view->owner()->getMiniBuffer()->Set(_("Inserting figure..."));
index 87a41cceb8eab9cdd5dfae1290638e27e9f79027..cd81b5ee20686a889bb96b21057814b2fd28603f 100644 (file)
@@ -131,14 +131,14 @@ LyXGUI::LyXGUI(LyX * owner, int * argc, char * argv[], bool GUI)
        if (height < 400) height = 400;
        
        // If width is not set by geometry, check it against monitor width
-       if ( !(geometryBitmask & 4) ) {
+       if (!(geometryBitmask & 4)) {
                Screen * scr = ScreenOfDisplay(fl_get_display(), fl_screen); //DefaultScreen(fl_get_display());
                if (WidthOfScreen(scr) - 8 < width)
                        width = WidthOfScreen(scr) - 8;
        }
 
        // If height is not set by geometry, check it against monitor height
-       if ( !(geometryBitmask & 8) ) {
+       if (!(geometryBitmask & 8)) {
                Screen * scr = ScreenOfDisplay(fl_get_display(), fl_screen); //DefaultScreen(fl_get_display());
                if (HeightOfScreen(scr) - 24 < height)
                        height = HeightOfScreen(scr) - 24;
@@ -340,7 +340,7 @@ void LyXGUI::create_forms()
        // build up the combox entries
        combo_language2->addline(_("No change"));
        combo_language2->addline(_("Reset"));
-       for(Languages::const_iterator cit = languages.begin();
+       for (Languages::const_iterator cit = languages.begin();
            cit != languages.end(); ++cit) {
 #ifdef DO_USE_DEFAULT_LANGUAGE
            if ((*cit).second.lang() != "default")
index 045e8cc72a57c5c34c570696fc88aa39a35523a7..324f2000c6fbc7c717b1abff70c2bb7cc657b0c5 100644 (file)
@@ -637,7 +637,7 @@ void LyX::ReadUIFile(string const & name)
                lex.printTable(lyxerr);
 
        while (lex.IsOK()) {
-               switch(lex.lex()) {
+               switch (lex.lex()) {
                case ui_menuset: 
                        menubackend.read(lex);
                        break;
@@ -717,7 +717,7 @@ bool LyX::easyParse(int * argc, char * argv[])
 {
        bool gui = true;
        int removeargs = 0; // used when options are read
-       for(int i = 1; i < *argc; ++i) {
+       for (int i = 1; i < *argc; ++i) {
                string arg = argv[i];
 
                // Check for -dbg int
@@ -857,7 +857,7 @@ void error_handler(int err_sig)
        bufferlist.emergencyWriteAll();
 
        lyxerr << "Bye." << endl;
-       if(err_sig!= SIGHUP && 
+       if (err_sig!= SIGHUP && 
           (!GetEnv("LYXDEBUG").empty() || err_sig == SIGSEGV))
                lyx::abort();
        exit(0);
index 86d7939f17ab11f3f8b4eff6795c29817e6deb26..fa54c547b5ae2fbb59bb53b5519684f2765e2367 100644 (file)
@@ -192,7 +192,7 @@ LyXFont & LyXFont::decSize()
 /// Increases font size by one
 LyXFont & LyXFont::incSize() 
 {
-       switch(size()) {
+       switch (size()) {
        case SIZE_HUGER:        break;
        case SIZE_HUGE:         setSize(SIZE_HUGER);    break;
        case SIZE_LARGEST:      setSize(SIZE_HUGE);     break;
@@ -245,7 +245,7 @@ LyXFont::FONT_MISC_STATE LyXFont::setMisc(FONT_MISC_STATE newfont,
 void LyXFont::update(LyXFont const & newfont,
                     Language const * document_language, bool toggleall)
 {
-       if(newfont.family() == family() && toggleall)
+       if (newfont.family() == family() && toggleall)
                setFamily(INHERIT_FAMILY); // toggle 'back'
        else if (newfont.family() != IGNORE_FAMILY)
                setFamily(newfont.family());
@@ -268,7 +268,7 @@ void LyXFont::update(LyXFont const & newfont,
                break;
        }
 
-       if(newfont.shape() == shape() && toggleall)
+       if (newfont.shape() == shape() && toggleall)
                setShape(INHERIT_SHAPE); // toggle 'back'
        else if (newfont.shape() != IGNORE_SHAPE)
                setShape(newfont.shape());
index ca5e9aa51a0469506b2a6b5fe5fe444fc38eea20..76a99e9cca994d5f5eee732329c6b65c132c7e04 100644 (file)
@@ -120,7 +120,7 @@ void LyXFindReplace::SearchReplaceCB()
        // in order to avoid endless loop :-(
        if (SF.SearchString().length() == 0
            || (SF.SearchString().length() == 1
-               && SF.SearchString()[0] == ' ') ) {
+               && SF.SearchString()[0] == ' ')) {
                WriteAlert(_("Sorry!"), _("You cannot replace a single space, "
                                          "nor an empty character."));
                return;
@@ -157,7 +157,7 @@ void LyXFindReplace::SearchReplaceAllCB()
        // in order to avoid endless loop :-(
        if (SF.SearchString().length() == 0
            || (SF.SearchString().length() == 1
-               && SF.SearchString()[0] == ' ') ) {
+               && SF.SearchString()[0] == ' ')) {
                WriteAlert(_("Sorry!"), _("You cannot replace a single space, "
                                          "nor an empty character."));
                return;
@@ -186,7 +186,7 @@ void LyXFindReplace::SearchReplaceAllCB()
                        ++replace_count;
                }
        } while (SearchCB(true));
-       if( replace_count == 0 ) {
+       if (replace_count == 0) {
                LyXBell();      
                bv->owner()->getMiniBuffer()->Set(
                        _("String not found!"));
index 9a64088e7feb9ec16ec8a784582c15a87a2258e0..893dc3b65217b0a7f9e8fb5e465e71f585abb346 100644 (file)
@@ -24,9 +24,6 @@
 #endif
 
 #include "version.h"
-#if 0
-#include "lyxlookup.h"
-#endif
 #include "kbmap.h"
 #include "lyxfunc.h"
 #include "bufferlist.h"
@@ -217,7 +214,7 @@ int LyXFunc::processKeySym(KeySym keysym, unsigned int state)
        // implementations? (Lgb)
        // This code snippet makes lyx ignore some keys. Perhaps
        // all of them should be explictly mentioned?
-       if((keysym >= XK_Shift_L && keysym <= XK_Hyper_R)
+       if ((keysym >= XK_Shift_L && keysym <= XK_Hyper_R)
           || keysym == XK_Mode_switch || keysym == 0x0)
                return 0;
 
@@ -232,7 +229,7 @@ int LyXFunc::processKeySym(KeySym keysym, unsigned int state)
        // When not cancel or meta-fake, do the normal lookup. 
        // Note how the meta_fake Mod1 bit is OR-ed in and reset afterwards.
        // Mostly, meta_fake_bit = 0. RVDK_PATCH_5.
-       if ( (action != LFUN_CANCEL) && (action != LFUN_META_FAKE) ) {
+       if ((action != LFUN_CANCEL) && (action != LFUN_META_FAKE)) {
 
                // remove Caps Lock and Mod2 as a modifiers
                action = keyseq.addkey(keysym,
@@ -258,7 +255,7 @@ int LyXFunc::processKeySym(KeySym keysym, unsigned int state)
        // why not return already here if action == -1 and
        // num_bytes == 0? (Lgb)
 
-       if(keyseq.length > 1 || keyseq.length < -1) {
+       if (keyseq.length > 1 || keyseq.length < -1) {
                string buf;
                keyseq.print(buf);
                owner->getMiniBuffer()->Set(buf);
@@ -296,141 +293,6 @@ int LyXFunc::processKeySym(KeySym keysym, unsigned int state)
 } 
 
 
-#if 0
-int LyXFunc::processKeyEvent(XEvent * ev)
-{
-       char s_r[10];
-       KeySym keysym_return = 0;
-       string argument;
-       XKeyEvent * keyevent = &ev->xkey;
-       int num_bytes = LyXLookupString(ev, s_r, 10, &keysym_return);
-       s_r[num_bytes] = '\0';
-
-       if (lyxerr.debugging(Debug::KEY)) {
-               char * tmp = XKeysymToString(keysym_return);
-               string stm = (tmp ? tmp : "");
-               lyxerr << "KeySym is "
-                      << stm
-                      << "["
-                      << keysym_return << "]"
-                      << " and num_bytes is "
-                      << num_bytes
-                      << " the string returned is \""
-                      << s_r << '\"'
-                      << endl;
-       }
-       // Do nothing if we have nothing (JMarc)
-       if (num_bytes == 0 && keysym_return == NoSymbol) {
-               lyxerr[Debug::KEY] << "Empty kbd action (probably composing)"
-                                  << endl;
-               return 0;
-       }
-       
-       // this function should be used always [asierra060396]
-       UpdatableInset * tli = owner->view()->theLockingInset();
-       if (owner->view()->available() && tli && (keysym_return==XK_Escape)) {
-               if (tli == tli->GetLockingInset()) {
-                       owner->view()->unlockInset(tli);
-                       owner->view()->text->CursorRight(owner->view());
-                       moveCursorUpdate(false);
-                       owner->showState();
-               } else {
-                       tli->UnlockInsetInInset(owner->view(),
-                                               tli->GetLockingInset(),true);
-               }
-               return 0;
-       }
-
-       // Can we be sure that this will work for all X-Windows
-       // implementations? (Lgb)
-       // This code snippet makes lyx ignore some keys. Perhaps
-       // all of them should be explictly mentioned?
-       if((keysym_return >= XK_Shift_L && keysym_return <= XK_Hyper_R)
-          || keysym_return == XK_Mode_switch || keysym_return == 0x0)
-               return 0;
-
-       // Do a one-deep top-level lookup for
-       // cancel and meta-fake keys. RVDK_PATCH_5
-       cancel_meta_seq.reset();
-
-       int action = cancel_meta_seq.addkey(keysym_return, keyevent->state
-                                           &(ShiftMask|ControlMask
-                                             |Mod1Mask)); 
-
-       // When not cancel or meta-fake, do the normal lookup. 
-       // Note how the meta_fake Mod1 bit is OR-ed in and reset afterwards.
-       // Mostly, meta_fake_bit = 0. RVDK_PATCH_5.
-       if ( (action != LFUN_CANCEL) && (action != LFUN_META_FAKE) ) {
-
-               // remove Caps Lock and Mod2 as a modifiers
-               action = keyseq.addkey(keysym_return,
-                                      (keyevent->state | meta_fake_bit)
-                                      &(ShiftMask|ControlMask
-                                        |Mod1Mask));      
-       }
-       // Dont remove this unless you know what you are doing.
-       meta_fake_bit = 0;
-               
-       if (action == 0) action = LFUN_PREFIX;
-
-       if (lyxerr.debugging(Debug::KEY)) {
-               string buf;
-               keyseq.print(buf);
-               lyxerr << "Key ["
-                      << action << "]["
-                      << buf << "]"
-                      << "["
-                      << num_bytes << "]"
-                      << endl;
-       }
-
-       // already here we know if it any point in going further
-       // why not return already here if action == -1 and
-       // num_bytes == 0? (Lgb)
-
-       if(keyseq.length > 1 || keyseq.length < -1) {
-               string buf;
-               keyseq.print(buf);
-               owner->getMiniBuffer()->Set(buf);
-       }
-
-       if (action == -1) {
-               if (keyseq.length < -1) { // unknown key sequence...
-                       string buf;
-                       LyXBell();
-                       keyseq.print(buf);
-                       owner->getMiniBuffer()->Set(_("Unknown sequence:"), buf);
-                       return 0;
-               }
-       
-               char isochar = keyseq.getiso();
-               if (!(keyevent->state&ControlMask) &&
-                   !(keyevent->state&Mod1Mask) &&
-                   (isochar && keysym_return < 0xF000)) {
-                       argument += isochar;
-               }
-               if (argument.empty()) {
-                       lyxerr.debug() << "Empty argument!" << endl;
-                       // This can`t possibly be of any use
-                       // so we`ll skip the dispatch.
-                       return 0;
-               }
-       }
-       else
-               if (action == LFUN_SELFINSERT) {
-                       argument = s_r[0];
-               }
-
-        bool tmp_sc = show_sc;
-       show_sc = false;
-       Dispatch(action, argument);
-       show_sc = tmp_sc;
-       
-       return 0;
-} 
-#endif
-
-
 LyXFunc::func_status LyXFunc::getStatus(int ac) const
 {
         kb_action action;
@@ -613,6 +475,9 @@ string const LyXFunc::Dispatch(string const & s)
 string const LyXFunc::Dispatch(int ac,
                         string const & do_not_use_this_arg)
 {
+       lyxerr[Debug::ACTION] << "LyXFunc::Dispatch: action[" << ac
+                             <<"] arg[" << do_not_use_this_arg << "]" << endl;
+       
        string argument;
        kb_action action;
        LyXText * text = 0;
@@ -743,7 +608,7 @@ string const LyXFunc::Dispatch(int ac,
                                return string();
                        else {
                                setMessage(N_("Text mode"));
-                               switch(action) {
+                               switch (action) {
                                case LFUN_UNKNOWN_ACTION:
                                case LFUN_BREAKPARAGRAPH:
                                case LFUN_BREAKLINE:
@@ -783,7 +648,7 @@ string const LyXFunc::Dispatch(int ac,
        if (!text)
            text = owner->view()->text;
 
-       switch(action) {
+       switch (action) {
                // --- Misc -------------------------------------------
        case LFUN_WORDFINDFORWARD  : 
        case LFUN_WORDFINDBACKWARD : {
@@ -813,7 +678,7 @@ string const LyXFunc::Dispatch(int ac,
                        owner->view()->text->ClearSelection();
 
                        // Move cursor so that successive C-s 's will not stand in place. 
-                       ifaction == LFUN_WORDFINDFORWARD ) 
+                       if (action == LFUN_WORDFINDFORWARD ) 
                                owner->view()->text->CursorRightOneWord(owner->view());
                        owner->view()->text->FinishUndo();
                        moveCursorUpdate(false);
@@ -849,7 +714,7 @@ string const LyXFunc::Dispatch(int ac,
        case LFUN_CANCEL:                   // RVDK_PATCH_5
                keyseq.reset();
                meta_fake_bit = 0;
-               if(owner->view()->available())
+               if (owner->view()->available())
                        // cancel any selection
                        Dispatch(LFUN_MARK_OFF);
                setMessage(N_("Cancel"));
@@ -971,11 +836,11 @@ string const LyXFunc::Dispatch(int ac,
        {
                InsetCommandParams p;
                
-               ifaction == LFUN_TOCVIEW )
+               if (action == LFUN_TOCVIEW )
                        p.setCmdName( "tableofcontents" );
-               else ifaction == LFUN_LOAVIEW )
+               else if (action == LFUN_LOAVIEW )
                        p.setCmdName( "listofalgorithms" );
-               else ifaction == LFUN_LOFVIEW )
+               else if (action == LFUN_LOFVIEW )
                        p.setCmdName( "listoffigures" );
                else
                        p.setCmdName( "listoftables" );
@@ -991,17 +856,17 @@ string const LyXFunc::Dispatch(int ac,
        {
                InsetCommandParams p;
                
-               ifaction == LFUN_TOC_INSERT )
+               if (action == LFUN_TOC_INSERT )
                        p.setCmdName( "tableofcontents" );
-               else ifaction == LFUN_LOA_INSERT )
+               else if (action == LFUN_LOA_INSERT )
                        p.setCmdName( "listofalgorithms" );
-               else ifaction == LFUN_LOF_INSERT )
+               else if (action == LFUN_LOF_INSERT )
                        p.setCmdName( "listoffigures" );
                else
                        p.setCmdName( "listoftables" );
 
                Inset * inset = new InsetTOC( p );
-               if!owner->view()->insertInset( inset, "Standard", true ) )
+               if (!owner->view()->insertInset( inset, "Standard", true ) )
                        delete inset;
                break;
        }
@@ -1165,7 +1030,7 @@ string const LyXFunc::Dispatch(int ac,
                    && owner->view()->text->cursor.par()->footnoteflag
                    != LyXParagraph::NO_FOOTNOTE)
                        { // only melt footnotes with FOOTMELT, not margins etc
-                               if(owner->view()->text->cursor.par()->footnotekind == LyXParagraph::FOOTNOTE)
+                               if (owner->view()->text->cursor.par()->footnotekind == LyXParagraph::FOOTNOTE)
                                        Melt(owner->view());
                        }
                else
@@ -1179,7 +1044,7 @@ string const LyXFunc::Dispatch(int ac,
                    && owner->view()->text->cursor.par()->footnoteflag
                    != LyXParagraph::NO_FOOTNOTE) {
                        // only melt margins
-                       if(owner->view()->text->cursor.par()->footnotekind == LyXParagraph::MARGIN)
+                       if (owner->view()->text->cursor.par()->footnotekind == LyXParagraph::MARGIN)
                                Melt(owner->view());
                } else
                        Margin(owner->view()); 
@@ -1567,7 +1432,7 @@ string const LyXFunc::Dispatch(int ac,
        {
                LyXText * tmptext = owner->view()->text;
                bool is_rtl = tmptext->cursor.par()->isRightToLeftPar(owner->buffer()->params);
-               if(!tmptext->mark_set)
+               if (!tmptext->mark_set)
                        owner->view()->beforeChange();
                owner->view()->update(BufferView::SELECT|BufferView::FITCUR);
                if (is_rtl)
@@ -1596,7 +1461,7 @@ string const LyXFunc::Dispatch(int ac,
                // it simpler? (Lgb)
                LyXText * txt = owner->view()->text;
                bool is_rtl = txt->cursor.par()->isRightToLeftPar(owner->buffer()->params);
-               if(!txt->mark_set) owner->view()->beforeChange();
+               if (!txt->mark_set) owner->view()->beforeChange();
                owner->view()->update(BufferView::SELECT|BufferView::FITCUR);
                LyXCursor cur = txt->cursor;
                if (!is_rtl)
@@ -1631,7 +1496,7 @@ string const LyXFunc::Dispatch(int ac,
        break;
                
        case LFUN_UP:
-               if(!owner->view()->text->mark_set) owner->view()->beforeChange();
+               if (!owner->view()->text->mark_set) owner->view()->beforeChange();
                owner->view()->update(BufferView::UPDATE);
                owner->view()->text->CursorUp(owner->view());
                owner->view()->text->FinishUndo();
@@ -1640,7 +1505,7 @@ string const LyXFunc::Dispatch(int ac,
                break;
                
        case LFUN_DOWN:
-               if(!owner->view()->text->mark_set)
+               if (!owner->view()->text->mark_set)
                        owner->view()->beforeChange();
                owner->view()->update(BufferView::UPDATE);
                owner->view()->text->CursorDown(owner->view());
@@ -1650,7 +1515,7 @@ string const LyXFunc::Dispatch(int ac,
                break;
 
        case LFUN_UP_PARAGRAPH:
-               if(!owner->view()->text->mark_set)
+               if (!owner->view()->text->mark_set)
                        owner->view()->beforeChange();
                owner->view()->update(BufferView::UPDATE);
                owner->view()->text->CursorUpParagraph(owner->view());
@@ -1660,7 +1525,7 @@ string const LyXFunc::Dispatch(int ac,
                break;
                
        case LFUN_DOWN_PARAGRAPH:
-               if(!owner->view()->text->mark_set)
+               if (!owner->view()->text->mark_set)
                        owner->view()->beforeChange();
                owner->view()->update(BufferView::UPDATE);
                owner->view()->text->CursorDownParagraph(owner->view());
@@ -1670,7 +1535,7 @@ string const LyXFunc::Dispatch(int ac,
                break;
                
        case LFUN_PRIOR:
-               if(!text->mark_set)
+               if (!text->mark_set)
                    owner->view()->beforeChange();
                owner->view()->update(BufferView::UPDATE);
                owner->view()->cursorPrevious(text);
@@ -1683,7 +1548,7 @@ string const LyXFunc::Dispatch(int ac,
                break;
                
        case LFUN_NEXT:
-               if(!text->mark_set)
+               if (!text->mark_set)
                        owner->view()->beforeChange();
                owner->view()->update(BufferView::UPDATE);
                owner->view()->cursorNext(text);
@@ -1696,7 +1561,7 @@ string const LyXFunc::Dispatch(int ac,
                break;
                
        case LFUN_HOME:
-               if(!owner->view()->text->mark_set)
+               if (!owner->view()->text->mark_set)
                        owner->view()->beforeChange();
                owner->view()->update(BufferView::SELECT|BufferView::FITCUR);
                owner->view()->text->CursorHome(owner->view());
@@ -1706,7 +1571,7 @@ string const LyXFunc::Dispatch(int ac,
                break;
                
        case LFUN_END:
-               if(!owner->view()->text->mark_set)
+               if (!owner->view()->text->mark_set)
                        owner->view()->beforeChange();
                owner->view()->update(BufferView::SELECT|BufferView::FITCUR);
                owner->view()->text->CursorEnd(owner->view());
@@ -1717,7 +1582,7 @@ string const LyXFunc::Dispatch(int ac,
                
        case LFUN_SHIFT_TAB:
        case LFUN_TAB:
-               if(!owner->view()->text->mark_set)
+               if (!owner->view()->text->mark_set)
                        owner->view()->beforeChange();
                owner->view()->update(BufferView::SELECT|BufferView::FITCUR);
                owner->view()->text->CursorTab(owner->view());
@@ -1727,7 +1592,7 @@ string const LyXFunc::Dispatch(int ac,
                break;
                
        case LFUN_WORDRIGHT:
-               if(!text->mark_set)
+               if (!text->mark_set)
                        owner->view()->beforeChange();
                owner->view()->update(BufferView::SELECT|BufferView::FITCUR);
                if (text->cursor.par()->isRightToLeftPar(owner->buffer()->params))
@@ -1742,7 +1607,7 @@ string const LyXFunc::Dispatch(int ac,
                break;
                
        case LFUN_WORDLEFT:
-               if(!text->mark_set)
+               if (!text->mark_set)
                        owner->view()->beforeChange();
                owner->view()->update(BufferView::SELECT|BufferView::FITCUR);
                if (text->cursor.par()->isRightToLeftPar(owner->buffer()->params))
@@ -1757,7 +1622,7 @@ string const LyXFunc::Dispatch(int ac,
                break;
                
        case LFUN_BEGINNINGBUF:
-               if(!owner->view()->text->mark_set)
+               if (!owner->view()->text->mark_set)
                        owner->view()->beforeChange();
                owner->view()->update(BufferView::SELECT|BufferView::FITCUR);
                owner->view()->text->CursorTop(owner->view());
@@ -1767,7 +1632,7 @@ string const LyXFunc::Dispatch(int ac,
                break;
                
        case LFUN_ENDBUF:
-               if(!owner->view()->text->mark_set)
+               if (!owner->view()->text->mark_set)
                        owner->view()->beforeChange();
                owner->view()->update(BufferView::SELECT|BufferView::FITCUR);
                owner->view()->text->CursorBottom(owner->view());
@@ -1933,7 +1798,7 @@ string const LyXFunc::Dispatch(int ac,
        break;
                
        case LFUN_SETMARK:
-               if(text->mark_set) {
+               if (text->mark_set) {
                        owner->view()->beforeChange();
                        owner->view()->update(BufferView::SELECT|BufferView::FITCUR);
                        setMessage(N_("Mark removed"));
@@ -2385,7 +2250,7 @@ string const LyXFunc::Dispatch(int ac,
        {
                LyXParagraph::size_type pos = 
                        owner->view()->text->cursor.pos();
-               if(pos < owner->view()->text->cursor.par()->size())
+               if (pos < owner->view()->text->cursor.par()->size())
                        //dispatch_buffer = owner->view()->text->
                        //      cursor.par()->text[pos];
                        dispatch_buffer =
@@ -2419,9 +2284,9 @@ string const LyXFunc::Dispatch(int ac,
        case LFUN_GETFONT:
        {
                LyXFont & font = owner->view()->text->current_font;
-                if(font.shape() == LyXFont::ITALIC_SHAPE)
+                if (font.shape() == LyXFont::ITALIC_SHAPE)
                        dispatch_buffer = 'E';
-                else if(font.shape() == LyXFont::SMALLCAPS_SHAPE)
+                else if (font.shape() == LyXFont::SMALLCAPS_SHAPE)
                        dispatch_buffer = 'N';
                 else
                        dispatch_buffer = '0';
@@ -2432,7 +2297,7 @@ string const LyXFunc::Dispatch(int ac,
        case LFUN_GETLATEX:
        {
                LyXFont & font = owner->view()->text->current_font;
-                if(font.latex() == LyXFont::ON)
+                if (font.latex() == LyXFont::ON)
                        dispatch_buffer = 'L';
                 else
                        dispatch_buffer = '0';
@@ -2755,13 +2620,13 @@ string const LyXFunc::Dispatch(int ac,
        {
                InsetCommandParams p( "index" );
                
-               if( argument.empty() ) {
+               if (argument.empty()) {
                        // Get the word immediately preceding the cursor
                        LyXParagraph::size_type curpos = 
                                owner->view()->text->cursor.pos() - 1;
 
                        string curstring;
-                       ifcurpos >= 0 )
+                       if (curpos >= 0 )
                                curstring = owner->view()->text
                                            ->cursor.par()->GetWord(curpos);
 
@@ -2793,7 +2658,7 @@ string const LyXFunc::Dispatch(int ac,
                LyXParagraph::size_type curpos = 
                        owner->view()->text->cursor.pos() - 1;
                // Can't do that at the beginning of a paragraph
-               ifcurpos < 0 ) break;
+               if (curpos < 0 ) break;
 
                string curstring( owner->view()->text
                                  ->cursor.par()->GetWord(curpos) );
@@ -3013,7 +2878,7 @@ string const LyXFunc::Dispatch(int ac,
 
        case LFUN_UNKNOWN_ACTION:
        {
-               if(!owner->buffer()) {
+               if (!owner->buffer()) {
                        LyXBell();
                        setErrorMessage(N_("No document open"));
                        break;
@@ -3033,7 +2898,7 @@ string const LyXFunc::Dispatch(int ac,
                         * "auto_region_delete", which defaults to
                         * true (on). */
                
-                       if ( lyxrc.auto_region_delete ) {
+                       if (lyxrc.auto_region_delete) {
                                if (owner->view()->text->selection){
                                        owner->view()->text->CutSelection(owner->view(), false);
                                        owner->view()->update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
@@ -3144,7 +3009,7 @@ void LyXFunc::MenuNew(bool fromTemplate)
 
                // Check if the document already is open
                if (bufferlist.exists(s)) {
-                       switch(AskConfirmation(_("Document is already open:"), 
+                       switch (AskConfirmation(_("Document is already open:"), 
                                               MakeDisplayPath(s, 50),
                                               _("Do you want to close that document now?\n"
                                                 "('No' will just switch to the open version)")))
@@ -3307,7 +3172,7 @@ void LyXFunc::doImport(string const & argument)
 
        // Check if the document already is open
        if (bufferlist.exists(lyxfile)) {
-               switch(AskConfirmation(_("Document is already open:"), 
+               switch (AskConfirmation(_("Document is already open:"), 
                                       MakeDisplayPath(lyxfile, 50),
                                       _("Do you want to close that document now?\n"
                                         "('No' will just switch to the open version)")))
index cfca897c925747455495419cc60b441d752c7efd..ae7a8683ec6ddff0100289de6ab14654675c043f 100644 (file)
@@ -49,13 +49,9 @@ public:
        /// Same again but for xtl buffers.  Still looking for better idea.
        bool Dispatch(int action, auto_mem_buffer &);
 
-#if 0
-       /// A keyboard event is processed to execute a lyx action. 
-       int processKeyEvent(XEvent * ev);
-#else
        ///
        int processKeySym(KeySym k, unsigned int state);
-#endif
+
        ///
        func_status getStatus(int ac) const;
        
index 1f8309193da6aa09c3e2d1404582670d6e31a91b..2dcd2c054cd4b4ac60ba4850c532522dec2d48ff 100644 (file)
@@ -53,7 +53,7 @@ void LyXLex::Pimpl::printError(string const & message) const
 void LyXLex::Pimpl::printTable(ostream & os)
 {
        os << "\nNumber of tags: " << no_items << '\n';
-       for(int i= 0; i < no_items; ++i)
+       for (int i= 0; i < no_items; ++i)
                os << "table[" << i
                   << "]:  tag: `" << table[i].tag
                   << "'  code:" << table[i].code << '\n';
index aecd62b01980971efc86ef599d7d7c0e9d4decf0..0b4854011618e79fb57f975ff6cd7ff5bff83bb8 100644 (file)
@@ -180,7 +180,7 @@ int LyXLookupString(XEvent * event,
                result =  XmbLookupString(xic, &event->xkey, buffer_return,
                                       bytes_buffer, keysym_return,
                                       &status_return);
-               switch(status_return) {
+               switch (status_return) {
                case XBufferOverflow:
                        lyxerr[Debug::KEY] << "XBufferOverflow" << endl;
                        break;
index 8f420b8f769e7e222b970e0d23a7623e337f90e5..36ba4f501c81342ed88d793bde7de900eee258bc 100644 (file)
@@ -285,7 +285,7 @@ int LyXRC::read(string const & filename)
                // compiler.
 
                int le = lexrc.lex();
-               switch(le) {
+               switch (le) {
                case LyXLex::LEX_UNDEF:
                        lexrc.printError("Unknown tag `$$Token'");
                        continue; 
@@ -849,7 +849,7 @@ int LyXRC::read(string const & filename)
                        break;
                        
                case RC_NEW_ASK_FILENAME:
-                       if ( lexrc.next())
+                       if (lexrc.next())
                                new_ask_filename = lexrc.GetBool();
                        break;
                case RC_CONVERTER: {
@@ -888,7 +888,7 @@ int LyXRC::read(string const & filename)
                        break;
                }
                case RC_DEFAULT_LANGUAGE:
-                       if ( lexrc.next())
+                       if (lexrc.next())
                                default_language = lexrc.GetString();
                        break;
 
@@ -938,7 +938,7 @@ void LyXRC::output(ostream & os) const
        // The nice thing is that we will get a warning from the compiler
        // if we forget an element.
        LyXRCTags tag = RC_LAST;
-       switch(tag) {
+       switch (tag) {
        case RC_LAST:
        case RC_INPUT:
                // input/include files are not done here
@@ -1495,7 +1495,7 @@ string LyXRC::getDescription(LyXRCTags tag)
 {
        string str;
        
-       switch( tag ) {
+       switch (tag) {
        case RC_FONT_ENCODING:
                str = N_("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
                break;
index 1760a0f6186ffe6384b23361e7d91917c3f0110b..eb9483dc020d243152a592d6e9d4ac2d7eb4678f 100644 (file)
@@ -72,7 +72,7 @@ using std::endl;
 // provide an empty mkfifo() if we do not have one. This disables the
 // lyxserver. 
 #ifndef HAVE_MKFIFO
-int mkfifo(char const * __path, mode_t __mode ) {
+int mkfifo(char const * __path, mode_t __mode) {
         return 0;
 }
 #endif
@@ -240,7 +240,7 @@ void LyXComm::closeConnection() {
                return;
        }
  
-       if(infd > -1) {
+       if (infd > -1) {
                fl_remove_io_callback(infd, FL_READ, C_LyXComm_callback);
  
                string tmp = pipename + ".in";
@@ -264,7 +264,7 @@ void LyXComm::closeConnection() {
                };
 #endif
        }
-       if(outfd > -1) {
+       if (outfd > -1) {
                string tmp = pipename + ".out";
 #ifdef __EMX__
                rc = DosDisConnectNPipe(outfd);
@@ -309,7 +309,7 @@ void LyXComm::callback(int fd, void *v)
        // the single = is intended here.
        while((status = read(fd, charbuf, CMDBUFLEN-1)))
        {// break and return in loop
-               if(status > 0) // got something
+               if (status > 0) // got something
                {
                        charbuf[status]= '\0'; // turn it into a c string
                        lsbuf += strip(charbuf, '\r');
@@ -325,22 +325,22 @@ void LyXComm::callback(int fd, void *v)
                                        << "LyXComm: status:" << status
                                        << ", lsbuf:" << lsbuf 
                                        << ", cmd:" << cmd << endl;
-                               if(!cmd.empty())
+                               if (!cmd.empty())
                                        c->clientcb(c->client, cmd); 
                                        //\n or not \n?
                        }
                }
-               if(errno == EAGAIN)
+               if (errno == EAGAIN)
                {  // EAGAIN is not really an error , it means we're
                   // only reading too fast for the writing process on
                   // the other end of the pipe. 
                        errno = 0;
                        return; // up to libforms select-loop (*crunch*)
                }
-               if(errno != 0 )
+               if (errno != 0 )
                {
                        lyxerr << "LyXComm: " << strerror(errno) << endl;
-                       if(!lsbuf.empty())
+                       if (!lsbuf.empty())
                        {
                                lyxerr << "LyxComm: truncated command: " 
                                       << lsbuf << endl;
@@ -434,7 +434,7 @@ void LyXServer::callback(LyXServer * serv, string const & msg)
 
                if (strncmp(p, "LYXSRV:", 7) == 0) {
                        server_only = true; 
-               } else if(0!= strncmp(p, "LYXCMD:", 7)) {
+               } else if (0!= strncmp(p, "LYXCMD:", 7)) {
                        lyxerr << "LyXServer: Unknown request" << endl;
                        return;
                }
@@ -444,8 +444,8 @@ void LyXServer::callback(LyXServer * serv, string const & msg)
                string client;
                while(*p && *p != ':')
                        client += char(*p++);
-               if(*p == ':') ++p;
-               if(!*p) return;
+               if (*p == ':') ++p;
+               if (!*p) return;
                
                // --- 3. get function name ---
                string cmd;
@@ -454,10 +454,10 @@ void LyXServer::callback(LyXServer * serv, string const & msg)
                
                // --- 4. parse the argument ---
                string arg;
-               if(!server_only && *p == ':' && *(++p)) {
+               if (!server_only && *p == ':' && *(++p)) {
                        while(*p && *p != '\n')
                                arg += char(*p++);
-                       if(*p) ++p;
+                       if (*p) ++p;
                }
  
                lyxerr[Debug::LYXSERVER]
@@ -473,7 +473,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 3b56a6ce2b55995d4004fec0c90cfdf064554527..674de866f1a85a54f128c735c3298888252b4cad 100644 (file)
@@ -1011,7 +1011,7 @@ InsetFormula::LocalDispatch(BufferView * bv,
             if (lf[1]) {
                 l = in_word_set(lf, strlen(lf));
                 // Long words will cause l == 0; so check.
-                if(l) ilf = l->id;
+                if (l) ilf = l->id;
             } else
             if (vdelim.find(lf[0]) != string::npos)
               ilf = lf[0];
@@ -1022,7 +1022,7 @@ InsetFormula::LocalDispatch(BufferView * bv,
               else 
                 if (rg[1]) {
                     l = in_word_set(rg, strlen(rg));
-                    if(l) irg = l->id;
+                    if (l) irg = l->id;
                 } else
                 if (vdelim.find(rg[0]) != string::npos)
                   irg = rg[0];
@@ -1274,7 +1274,7 @@ void mathedValidate(LaTeXFeatures & features, MathParInset * par)
     
     while (it.OK() && !(features.binom && features.boldsymbol)) {
        if (it.IsInset()) {
-           if(it.IsActive()) {
+           if (it.IsActive()) {
                MathParInset * p = it.GetActiveInset();
                if (!features.binom && p->GetType() == LM_OT_MACRO && 
                    p->GetName() == "binom") {
index a6ef6eaedf3240e6ac1ab707c2f8bb313abfd67c..cf72b48bd59654bb9aa7af92643649996346abc8 100644 (file)
@@ -43,7 +43,7 @@ void my_memcpy( void * ps_in, const void * pt_in, size_t n )
     char * ps = static_cast<char *>(ps_in);
     char const * pt = static_cast<char const *>(pt_in);
     /*
-    for(size_t i = n; i--;)
+    for (size_t i = n; i--;)
        *ps++ = *pt++;
        */
     while (n--) *ps++ = *pt++;
index f36000774d83b54a57dc58928bd7431f4412cd68..8d35d24bd69e42b80c5ae7b67731cbbbcd9cc9ec 100644 (file)
@@ -235,12 +235,12 @@ int peek_event(FL_FORM * /*form*/, void *xev)
    if (BitmapMenu::active == 0)
      return 0;
   
-   if(static_cast<XEvent *>(xev)->type == ButtonPress)
+   if (static_cast<XEvent *>(xev)->type == ButtonPress)
    {
         BitmapMenu::active->Hide();
         return 1;
    }
-   if(static_cast<XEvent *>(xev)->type == KeyPress)
+   if (static_cast<XEvent *>(xev)->type == KeyPress)
    {
       char c[5];
       KeySym keysym;
index f70873edbb1bc56c64f1a55abe300a80bc1ecba7..56e03464b5dbc86d9837ac1c702a6b313d12329e 100644 (file)
@@ -239,7 +239,7 @@ void MathParInset::Write(ostream & os, bool fragile)
                                        os << '}';
                                data.Next();
                        } else
-                               switch(cx) {
+                               switch (cx) {
                                case LM_TC_TAB:
                                {
                                        os << " & ";
index 2fd52c60b4467ced7ccb0de946511357873557c9..d3e63a193bedfd955a5f3c2fbb18fd5cfb715b1e 100644 (file)
@@ -1805,7 +1805,7 @@ int LyXParagraph::GetEndLabel(BufferParams const & bparams) const
                if (endlabeltype != END_LABEL_NO_LABEL) {
                        LyXParagraph const * last = this;
 #ifndef NEW_INSETS
-                       iffootnoteflag == NO_FOOTNOTE)
+                       if (footnoteflag == NO_FOOTNOTE)
                                last = LastPhysicalPar();
                        else if (next->footnoteflag == NO_FOOTNOTE)
                                return endlabeltype;
@@ -2315,7 +2315,7 @@ LyXParagraph * LyXParagraph::TeXOnePar(Buffer const * buf,
                                ? GetFontSettings(bparams,
                                                  size()-1).isRightToLeft()
                                : language->RightToLeft();
-                       if ( (p = NextAfterFootnote()) != 0 &&
+                       if ((p = NextAfterFootnote()) != 0 &&
                             p->size() > 0 &&
                             p->GetFontSettings(bparams, 0).isRightToLeft() != is_rtl)
                                is_rtl = getParLanguage(bparams)->RightToLeft();
@@ -2922,7 +2922,7 @@ void LyXParagraph::SimpleTeXSpecialChars(Buffer const * buf,
                                } 
                                // Otherwise, we use what LaTeX
                                // provides us.
-                               switch(c) {
+                               switch (c) {
                                case '<':
                                        os << "\\textless{}";
                                        column += 10;
@@ -3169,7 +3169,7 @@ LyXParagraph * LyXParagraph::TeXEnvironment(Buffer const * buf,
                        texrow.newline();
                }
                os << "\\begin{minipage}";
-               switch(pextra_alignment) {
+               switch (pextra_alignment) {
                case MINIPAGE_ALIGN_TOP:
                        os << "[t]";
                        break;
@@ -3308,7 +3308,7 @@ LyXParagraph * LyXParagraph::TeXEnvironment(Buffer const * buf,
                                texrow.newline();
                        }
                        os << "\\begin{minipage}";
-                       switch(par->pextra_alignment) {
+                       switch (par->pextra_alignment) {
                        case MINIPAGE_ALIGN_TOP:
                                os << "[t]";
                                break;
@@ -3842,7 +3842,7 @@ bool LyXParagraph::IsLetter(LyXParagraph::size_type pos) const
        if (IsLetterChar(c))
                return true;
        // '\0' is not a letter, allthough every string contains "" (below)
-       ifc == '\0')
+       if (c == '\0')
                return false;
        // We want to pass the ' and escape chars to ispell
        string extra = lyxrc.isp_esc_chars + '\'';
@@ -3892,7 +3892,7 @@ bool LyXParagraph::isRightToLeftPar(BufferParams const & bparams) const
 void LyXParagraph::ChangeLanguage(BufferParams const & bparams,
                                  Language const * from, Language const * to)
 {
-       for(size_type i = 0; i < size(); ++i) {
+       for (size_type i = 0; i < size(); ++i) {
                LyXFont font = GetFontSettings(bparams, i);
                if (font.language() == from) {
                        font.setLanguage(to);
index 8d7b8e90958704d31bde699470813d117b7633d0..438d48c2c7713ac27b1a62fcb38b645e99f6eb6a 100644 (file)
@@ -126,9 +126,8 @@ void LyXScreen::DrawOneRow(LyXText * text, Row * row, int y_text,
 {
        int y = y_text - text->first + y_offset;
 
-       if (((y+row->height()) > 0) &&
-           ((y-row->height()) <= (int)owner.height()))
-       {
+       if (((y + row->height()) > 0) &&
+           ((y - row->height()) <= static_cast<int>(owner.height()))) {
                // ok there is something visible
                LyXText::text_status st = text->status;
                do {
@@ -221,16 +220,16 @@ bool LyXScreen::FitManualCursor(LyXText * text,
 {
        int newtop = text->first;
   
-       if (y + desc - text->first >= (int)owner.height())
+       if (y + desc - text->first >= static_cast<int>(owner.height()))
                newtop = y - 3 * owner.height() / 4;  // the scroll region must be so big!!
-       else if (y - asc < (int)text->first
+       else if (y - asc < static_cast<int>(text->first)
                && text->first > 0) {
                newtop = y - owner.height() / 4;
        }
 
        newtop = max(newtop, 0); // can newtop ever be < 0? (Lgb)
   
-       if (newtop != (int)text->first) {
+       if (newtop != static_cast<int>(text->first)) {
                Draw(text, newtop);
                text->first = newtop;
                return true;
@@ -243,7 +242,7 @@ void LyXScreen::ShowManualCursor(LyXText const * text, int x, int y,
                                 int asc, int desc, Cursor_Shape shape)
 {
        int y1 = max(y - text->first - asc, 0);
-       int y2 = min(y - text->first + desc, (int)owner.height());
+       int y2 = min(y - text->first + desc, static_cast<int>(owner.height()));
 
        // Secure against very strange situations
        y2 = max(y2, y1);
@@ -253,11 +252,11 @@ void LyXScreen::ShowManualCursor(LyXText const * text, int x, int y,
                cursor_pixmap = 0;
        }
 
-       if ((y2 > 0) && (y1 < int(owner.height()))) {
+       if (y2 > 0 && y1 < int(owner.height())) {
                cursor_pixmap_h = y2 - y1 + 1;
                cursor_pixmap_y = y1;
 
-               switch(shape) {
+               switch (shape) {
                case BAR_SHAPE:
                        cursor_pixmap_w = 1;
                        cursor_pixmap_x = x;
@@ -294,7 +293,7 @@ void LyXScreen::ShowManualCursor(LyXText const * text, int x, int y,
                          y1 + owner.ypos(),
                          x + owner.xpos(),
                          y2 + owner.ypos());
-               switch(shape) {
+               switch (shape) {
                case BAR_SHAPE:
                        break;
                case L_SHAPE:
@@ -358,7 +357,7 @@ unsigned int LyXScreen::TopCursorVisible(LyXText const * text)
                else
                        newtop = text->cursor.y()
                                - 3 * owner.height() / 4;   /* the scroll region must be so big!! */
-       } else if ((int)(text->cursor.y() - text->cursor.row()->baseline()) <
+       } else if (static_cast<int>((text->cursor.y()) - text->cursor.row()->baseline()) <
                   text->first && text->first > 0)
        {
                if (text->cursor.row()->height() < owner.height()
@@ -391,7 +390,7 @@ bool LyXScreen::FitCursor(LyXText * text)
    
 void LyXScreen::Update(LyXText * text, int y_offset, int x_offset)
 {
-       switch(text->status) {
+       switch (text->status) {
        case LyXText::NEED_MORE_REFRESH:
        {
                int y = max(int(text->refresh_y - text->first), 0);
@@ -425,14 +424,15 @@ void LyXScreen::ToggleSelection(LyXText * text,  bool kill_selection,
        // only if there is a selection
        if (!text->selection) return;
 
-       int bottom = min(max((int)(text->sel_end_cursor.y()
+       int bottom = min(max(static_cast<int>(text->sel_end_cursor.y()
                              - text->sel_end_cursor.row()->baseline()
-                             + text->sel_end_cursor.row()->height()), text->first),
-                         (int)(text->first + owner.height()));
-       int top = min(max((int)(text->sel_start_cursor.y() -
+                             + text->sel_end_cursor.row()->height()),
+                                             text->first),
+                         static_cast<int>(text->first + owner.height()));
+       int top = min(max(static_cast<int>(text->sel_start_cursor.y() -
                          text->sel_start_cursor.row()->baseline()),
                          text->first),
-                     (int)(text->first + owner.height()));
+                     static_cast<int>(text->first + owner.height()));
 
        if (kill_selection)
                text->selection = 0;
@@ -456,8 +456,10 @@ void LyXScreen::ToggleToggle(LyXText * text, int y_offset, int x_offset)
                - text->toggle_end_cursor.row()->baseline() 
                + text->toggle_end_cursor.row()->height();
        
-       bottom = min(max(bottom, text->first), (int)(text->first + owner.height()));
-       top = min(max(top, text->first), (int)(text->first + owner.height()));
+       bottom = min(max(bottom, text->first),
+                    static_cast<int>(text->first + owner.height()));
+       top = min(max(top, text->first),
+                 static_cast<int>(text->first + owner.height()));
 
        DrawFromTo(text, top - text->first, bottom - text->first, y_offset,
                   x_offset);
index fa208ce3637a4c23a1e9fa0ffb014bfea7648986..53492cefbe31d49a770155bf9d9a3b4d79463f23 100644 (file)
@@ -301,7 +301,7 @@ void init_spell_checker(BufferParams const & params, string const & lang)
 
        isp_pid = -1;
 
-       if(pipe(pipein) == -1 || pipe(pipeout) == -1) {
+       if (pipe(pipein) == -1 || pipe(pipeout) == -1) {
                lyxerr << "LyX: Can't create pipe for spellchecker!" << endl;
                goto END;
        }
@@ -324,13 +324,13 @@ void init_spell_checker(BufferParams const & params, string const & lang)
 
        isp_pid = fork();
 
-       if(isp_pid == -1) {
+       if (isp_pid == -1) {
                lyxerr << "LyX: Can't create child process for spellchecker!"
                       << endl;
                goto END;
        }
        
-       if(isp_pid == 0) {        
+       if (isp_pid == 0) {        
                /* child process */
                dup2(pipein[0], STDIN_FILENO);
                dup2(pipeout[1], STDOUT_FILENO);
@@ -584,7 +584,7 @@ void sc_accept_word(string const & word)
 
 static inline
 void sc_store_replacement(string const & mis, string const & cor) {
-        if(actual_spell_checker == ASC_ASPELL) {
+        if (actual_spell_checker == ASC_ASPELL) {
                 ::fputs("$$ra ", out);
                 ::fputs(mis.c_str(), out);
                 ::fputc(',', out);
@@ -840,7 +840,7 @@ bool RunSpellChecker(BufferView * bv)
                
                // Update slider if and only if value has changed
                newvalue = int(100.0*newval);
-               if(newvalue!= oldval) {
+               if (newvalue!= oldval) {
                        oldval = newvalue;
                        fl_set_slider_value(fd_form_spell_check->slider, oldval);
                }
@@ -946,7 +946,7 @@ bool RunSpellChecker(BufferView * bv)
                }
        }
    
-       if(sc_still_alive()) {
+       if (sc_still_alive()) {
                close_spell_checker();
                string word_msg(tostr(word_count));
                if (word_count != 1) {
index 944652b9e1c3f79e0e5308521f3aafa02e0c01eb..aade9e243a76802474702015aafbfc15345d113b 100644 (file)
@@ -373,7 +373,7 @@ bool FileInfo::isSocket() const
 
 
 // should not be in FileInfo
-bool FileInfo::access(int p)
+bool FileInfo::access(int p) const
 {
        // if we don't have a filename we fail
        if (fname.empty()) return false;
index 93bbadc8fb860525800ed0831f709cd0b1a032db..d52034feff171f37548380b8afea2d0902c8f1cf 100644 (file)
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-
+#include <boost/utility.hpp>
 #include "LString.h"
 
 /** Use objects of this class to get information about files.
  */
-class FileInfo {
+class FileInfo : public noncopyable {
 public:
        ///
        FileInfo();
@@ -101,15 +101,15 @@ public:
                eperm = F_OK
        };
        /// Test whether the current user has a given set of permissions
-       bool access(int p);
+       bool access(int p) const;
        /// Is the file writable for the current user?
-       bool writable() { return access(FileInfo::wperm); }
+       bool writable() const { return access(FileInfo::wperm); }
        /// Is the file readable for the current user?
-       bool readable() { return access(FileInfo::rperm); }
+       bool readable() const { return access(FileInfo::rperm); }
        /// Is the file executable for the current user?
-       bool executable() { return access(FileInfo::xperm); }
+       bool executable() const { return access(FileInfo::xperm); }
        /// Does the file exist?
-       bool exist() { return access(FileInfo::eperm); }
+       bool exist() const { return access(FileInfo::eperm); }
        ///
        bool isLink() const;
        ///
index 748c210dbb0a278b5cf3d1138a949ae041368446..c1052a180a7b40891cb2ecce89d15de0b465475e 100644 (file)
@@ -546,7 +546,7 @@ string const MakeAbsPath(string const & RelPath, string const & BasePath)
        // checks for already absolute path
        if (AbsolutePath(RelPath))
 #ifdef __EMX__
-               if(RelPath[0]!= '/' && RelPath[0]!= '\\')
+               if (RelPath[0]!= '/' && RelPath[0]!= '\\')
 #endif
                return RelPath;
 
index 270af081b9172d8f60377ebf6d9f8cc999810452..547d0790aa234b5876a600fffa0b6cde410fc414 100644 (file)
@@ -88,7 +88,7 @@ bool isStrInt(string const & str)
        if (tmpstr.empty()) return false;
        
        string::const_iterator cit = tmpstr.begin();
-       if ( (*cit) == '-') ++cit;
+       if ((*cit) == '-') ++cit;
        string::const_iterator end = tmpstr.end();
        for (; cit != end; ++cit) {
                if (!isdigit((*cit))) return false;
@@ -121,7 +121,7 @@ bool isStrDbl(string const & str)
 
        string::const_iterator cit = tmpstr.begin();
        bool found_dot(false);
-       if ( (*cit) == '-') ++cit;
+       if ((*cit) == '-') ++cit;
        string::const_iterator end = tmpstr.end();
        for (; cit != end; ++cit) {
                if (!isdigit((*cit))
@@ -427,7 +427,7 @@ string const subst(string const & a, char oldchar, char newchar)
        string tmp(a);
        string::iterator lit = tmp.begin();
        string::iterator end = tmp.end();
-       for(; lit != end; ++lit)
+       for (; lit != end; ++lit)
                if ((*lit) == oldchar)
                        (*lit) = newchar;
        return tmp;
index 4e7438d69f5128183056ac42d59ea9d2311c9291..7bd6d90f2f2e392515e9f8fb2fdb1aeafd85af76 100644 (file)
@@ -1055,7 +1055,7 @@ lyxstring::size_type lyxstring::find_first_of(value_type const * ptr,
        if (!n) return npos;
 
        for (size_type t = i; t < rep->sz; ++t) {
-               if(memchr(ptr, rep->s[t], n) != 0) return t;
+               if (memchr(ptr, rep->s[t], n) != 0) return t;
        }
        return npos;
 }
@@ -1109,7 +1109,7 @@ lyxstring::size_type lyxstring::find_last_of(value_type const * ptr,
 
        size_type ii = min(rep->sz - 1, i);
        for (int t = ii; t >= 0; --t) {
-               if(memchr(ptr, rep->s[t], n) != 0) return t;
+               if (memchr(ptr, rep->s[t], n) != 0) return t;
        }
        return npos;
 }
@@ -1165,7 +1165,7 @@ lyxstring::size_type lyxstring::find_first_not_of(value_type const * ptr,
 
        if (!n) return (i < rep->sz) ? i : npos;
        for (size_type t = i; t < rep->sz; ++t) {
-               if(memchr(ptr, rep->s[t], n) == 0) return t;
+               if (memchr(ptr, rep->s[t], n) == 0) return t;
        }
        return npos;
 }
@@ -1222,7 +1222,7 @@ lyxstring::size_type lyxstring::find_last_not_of(value_type const * ptr,
        size_type ii = min(rep->sz - 1, i);
 
        for (int t = ii; t >= 0; --t) {
-               if(memchr(ptr, rep->s[t], n) == 0) return t;
+               if (memchr(ptr, rep->s[t], n) == 0) return t;
        }
        return npos;
 }
index 56d09ba754363534e92f32b1fb2d51f58126307c..f486cc6c770685f6145b48b4412412f88abc29dc 100644 (file)
@@ -691,7 +691,7 @@ int portable_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap) {
          /* Actually it uses 0x prefix even for a zero value. */
                    && long_arg != 0
 #endif
-                  ) { tmp[str_arg_l++] = '0'; tmp[str_arg_l++] = 'x'; }
+                 ) { tmp[str_arg_l++] = '0'; tmp[str_arg_l++] = 'x'; }
 #endif
         }
         zero_padding_insertion_ind = str_arg_l;
@@ -703,7 +703,7 @@ int portable_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap) {
           * converting a zero value with a precision of zero is a null string.
           * Actually it returns all zeroes. */
 #endif
-        ) {  /* converted to null string */  }
+       ) {  /* converted to null string */  }
         else {
           char f[5]; int f_l = 0;
           f[f_l++] = '%';
@@ -736,7 +736,7 @@ int portable_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap) {
               && !(zero_padding_insertion_ind < str_arg_l
                    && tmp[zero_padding_insertion_ind] == '0')
 #endif
-          ) {      /* assure leading zero for alternative-form octal numbers */
+         ) {      /* assure leading zero for alternative-form octal numbers */
             if (!precision_specified || precision < num_of_digits+1)
               { precision = num_of_digits+1; precision_specified = 1; }
           }
index cacf6279912d1b12cbd4ed4935e3190245e8a582..9e64f3a33e07cbb383f4e6a4022a8ab41abcb773 100644 (file)
@@ -135,8 +135,8 @@ LyXTabular * LyXTabular::Clone(InsetTabular * inset)
     LyXTabular * result = new LyXTabular(inset, *this);
     // don't know if this is good but I need to Clone also
     // the text-insets here, this is for the Undo-facility!
-    for(int i = 0; i < rows_; ++i) {
-       for(int j = 0; j < columns_; ++j) {
+    for (int i = 0; i < rows_; ++i) {
+       for (int j = 0; j < columns_; ++j) {
            result->cell_info[i][j].inset = cell_info[i][j].inset;
            result->cell_info[i][j].inset.setOwner(inset);
        }
@@ -201,13 +201,13 @@ void LyXTabular::AppendRow(int cell)
     cell_vvector c_info = cell_vvector(rows_, cell_vector(columns_,
                                                          cellstruct()));
 
-    for(int i = 0; i <= row; ++i) {
-       for(int j = 0; j < columns_; ++j) {
+    for (int i = 0; i <= row; ++i) {
+       for (int j = 0; j < columns_; ++j) {
            c_info[i][j] = cell_info[i][j];
        }
     }
-    for(int i = row + 1; i < rows_; ++i) {
-       for(int j = 0; j < columns_; ++j) {
+    for (int i = row + 1; i < rows_; ++i) {
+       for (int j = 0; j < columns_; ++j) {
            c_info[i][j] = cell_info[i-1][j];
        }
     }
@@ -307,10 +307,7 @@ void LyXTabular::Reinit()
 
 void LyXTabular::set_row_column_number_info(bool oldformat)
 {
-    //int c = 0;
-    //int column = 0;
     numberofcells = -1;
-    //int row = 0;
     for (int row = 0; row < rows_; ++row) {
        for (int column = 0; column<columns_; ++column) {
            if (cell_info[row][column].multicolumn
@@ -415,7 +412,7 @@ bool LyXTabular::BottomLine(int cell, bool onlycolumn) const
     // no bottom line underneath non-existent cells if you please
     // Isn't that a programming error? Is so this should
     // be an Assert instead. (Lgb)
-    if(cell >= numberofcells)
+    if (cell >= numberofcells)
        return false;
 
     if (!onlycolumn && IsMultiColumn(cell))
@@ -586,7 +583,7 @@ void LyXTabular::recalculateMulticolCells(int cell, int new_width)
     int i = column1;
     for (; i <= column2; ++i)
         cell_info[row][i].width_of_cell = 0;
-    for(i = cell + 1; (i < numberofcells) && (!IsMultiColumn(i)); ++i)
+    for (i = cell + 1; (i < numberofcells) && (!IsMultiColumn(i)); ++i)
         ;
     if (i < numberofcells)
         recalculateMulticolCells(i, GetWidthOfCell(i) - (2 * WIDTH_OF_LINE));
@@ -616,13 +613,13 @@ bool LyXTabular::SetWidthOfCell(int cell, int new_width)
     }
     if (tmp) {
         int i = 0;
-        for(; i<columns_; ++i)
+        for (; i<columns_; ++i)
             calculate_width_of_column_NMC(i);
-        for(i = 0; (i < numberofcells) && !IsMultiColumn(i); ++i)
+        for (i = 0; (i < numberofcells) && !IsMultiColumn(i); ++i)
             ;
         if (i < numberofcells)
             recalculateMulticolCells(i, GetWidthOfCell(i)-(2 * WIDTH_OF_LINE));
-        for(i = 0; i < columns_; ++i)
+        for (i = 0; i < columns_; ++i)
             calculate_width_of_column(i);
         calculate_width_of_tabular();
         return true;
@@ -659,7 +656,7 @@ bool LyXTabular::SetColumnPWidth(int cell, string const & width)
     column_info[j].p_width = width;
     if (flag) // do this only if there is a width
        SetAlignment(cell, LYX_ALIGN_LEFT);
-    for(int i = 0; i < rows_; ++i) {
+    for (int i = 0; i < rows_; ++i) {
        int c = GetCellNumber(i, j);
        flag = !GetPWidth(c).empty(); // because of multicolumns!
        GetCellInset(c)->SetAutoBreakRows(flag);
@@ -960,7 +957,7 @@ string const write_attribute(string const & name, string const & value)
 
 string const write_attribute(string const & name, bool value)
 {
-    string str = " " + name + "=\"" + tostr((int)value) + "\"";
+    string str = " " + name + "=\"" + tostr(static_cast<int>(value)) + "\"";
     return str;
 }
 #endif
@@ -1175,7 +1172,7 @@ void LyXTabular::Read(Buffer const * buf, LyXLex & lex)
     getTokenValue(line, "endfoot", endfoot);
     getTokenValue(line, "endlastfoot", endlastfoot);
 
-    for(int i = 0; i < rows_; ++i) {
+    for (int i = 0; i < rows_; ++i) {
        l_getline(is, line);
        if (!prefixIs(line, "<Row ")) {
            lyxerr << "Wrong tabular format (expected <Row ...> got" <<
@@ -1433,7 +1430,7 @@ void LyXTabular::OldFormatRead(LyXLex & lex, string const & fl)
     InsetText * inset = GetCellInset(cell);
     int row;
 
-    for(int i = 0; i < par->Last(); ++i) {
+    for (int i = 0; i < par->Last(); ++i) {
        if (par->IsNewline(i)) {
            ++cell;
            if (cell > GetNumberOfCells()) {
@@ -1947,7 +1944,7 @@ int LyXTabular::GetHeightOfTabular() const
 {
     int height = 0;
 
-    for(int row = 0; row < rows_; ++row)
+    for (int row = 0; row < rows_; ++row)
         height += GetAscentOfRow(row) + GetDescentOfRow(row) +
            GetAdditionalHeight(GetCellNumber(row, 0));
     return height;
@@ -2038,7 +2035,7 @@ int LyXTabular::TeXCellPreamble(ostream & os, int cell) const
            if (LeftLine(cell))
                os << '|';
            if (!GetPWidth(cell).empty()) {
-               switch(GetVAlignment(cell)) {
+               switch (GetVAlignment(cell)) {
                case LYX_VALIGN_TOP:
                    os << "p";
                    break;
@@ -2073,7 +2070,7 @@ int LyXTabular::TeXCellPreamble(ostream & os, int cell) const
     }
     if (GetUsebox(cell) == BOX_PARBOX) {
        os << "\\parbox[";
-       switch(GetVAlignment(cell)) {
+       switch (GetVAlignment(cell)) {
        case LYX_VALIGN_TOP:
            os << "t";
            break;
@@ -2087,7 +2084,7 @@ int LyXTabular::TeXCellPreamble(ostream & os, int cell) const
        os << "]{" << GetPWidth(cell) << "}{";
     } else if (GetUsebox(cell) == BOX_MINIPAGE) {
        os << "\\begin{minipage}[";
-       switch(GetVAlignment(cell)) {
+       switch (GetVAlignment(cell)) {
        case LYX_VALIGN_TOP:
            os << "t";
            break;
@@ -2151,7 +2148,7 @@ int LyXTabular::Latex(Buffer const * buf,
        if (!column_info[i].align_special.empty()) {
            os << column_info[i].align_special;
        } else if (!column_info[i].p_width.empty()) {
-           switch(column_info[i].valignment) {
+           switch (column_info[i].valignment) {
            case LYX_VALIGN_TOP:
                os << "p";
                break;
@@ -2189,7 +2186,7 @@ int LyXTabular::Latex(Buffer const * buf,
     //+---------------------------------------------------------------------
 
     //int bret;
-    for(int i = 0; i < rows_; ++i) {
+    for (int i = 0; i < rows_; ++i) {
        ret += TeXTopHLine(os, i);
        int bret = ret;
        if (IsLongTabular()) {
@@ -2215,7 +2212,7 @@ int LyXTabular::Latex(Buffer const * buf,
                ret += TeXBottomHLine(os, i-1);
            ret += TeXTopHLine(os, i);
        }
-       for(int j = 0; j < columns_; ++j) {
+       for (int j = 0; j < columns_; ++j) {
            if (IsPartOfMultiColumn(i,j))
                continue;
            ret += TeXCellPreamble(os, cell);
@@ -2307,14 +2304,14 @@ int LyXTabular::DocBook(Buffer const * buf, ostream & os) const
 
     int cell = 0;
     os << "<tbody>\n";
-    for(int i = 0; i < rows_; ++i) {
+    for (int i = 0; i < rows_; ++i) {
         os << "<row>\n";
-       for(int j = 0; j < columns_; ++j) {
+       for (int j = 0; j < columns_; ++j) {
            if (IsPartOfMultiColumn(i, j))
                continue;
            
            os << "<entry align=\"";
-           switch(GetAlignment(cell)) {
+           switch (GetAlignment(cell)) {
            case LYX_ALIGN_LEFT:
                os << "left";
                break;
@@ -2327,7 +2324,7 @@ int LyXTabular::DocBook(Buffer const * buf, ostream & os) const
            }
            
            os << "\" valign=\"";
-           switch(GetVAlignment(cell)) {
+           switch (GetVAlignment(cell)) {
            case LYX_VALIGN_TOP:
                os << "top";
                break;
@@ -2368,7 +2365,7 @@ inline
 void print_n_chars(ostream & os, unsigned char ch, int n)
 {
 #if 0
-       for(int i = 0; i < n; ++i)
+       for (int i = 0; i < n; ++i)
                os << ch;
 #else
        os << string(n, ch);
@@ -2381,9 +2378,6 @@ int LyXTabular::AsciiTopHLine(ostream & os, int row,
 {
     int const fcell = GetFirstCellInRow(row);
     int const n = NumberOfCellsInRow(fcell) + fcell;
-    //int len;
-    //int column = 0;
-    //unsigned char ch;
 
 #if 0
     int tmp = 0;
@@ -2438,9 +2432,7 @@ int LyXTabular::AsciiBottomHLine(ostream & os, int row,
 {
     int const fcell = GetFirstCellInRow(row);
     int const n = NumberOfCellsInRow(fcell) + fcell;
-    //int len;
-    //int column = 0;
-    //unsigned char ch;
+
 #if 0
     int tmp = 0;
 
@@ -2506,7 +2498,7 @@ int LyXTabular::AsciiPrintCell(Buffer const * buf, ostream & os,
        len2 += clen[column] + 4;
     len2 -= len1;
 
-    switch(GetAlignment(cell)) {
+    switch (GetAlignment(cell)) {
     default:
     case LYX_ALIGN_LEFT:
        len1 = 0;
@@ -2521,10 +2513,10 @@ int LyXTabular::AsciiPrintCell(Buffer const * buf, ostream & os,
        break;
     }
 
-    for(unsigned int i = 0; i < len1; ++i)
+    for (unsigned int i = 0; i < len1; ++i)
        os << " ";
     os << sstr.str();
-    for(unsigned int i = 0; i < len2; ++i)
+    for (unsigned int i = 0; i < len2; ++i)
        os << " ";
     if (RightLine(cell))
        os << " |";
@@ -2545,9 +2537,9 @@ int LyXTabular::Ascii(Buffer const * buf, ostream & os) const
     vector<unsigned int> clen(columns_);
 
     // first all non (real) multicolumn cells!
-    for(int j = 0; j < columns_; ++j) {
+    for (int j = 0; j < columns_; ++j) {
        clen[j] = 0;
-       for(int i = 0; i < rows_; ++i) {
+       for (int i = 0; i < rows_; ++i) {
            int cell = GetCellNumber(i, j);
            if (IsMultiColumn(cell, true))
                continue;
@@ -2558,8 +2550,8 @@ int LyXTabular::Ascii(Buffer const * buf, ostream & os) const
        }
     }
     // then all (real) multicolumn cells!
-    for(int j = 0; j < columns_; ++j) {
-       for(int i = 0; i < rows_; ++i) {
+    for (int j = 0; j < columns_; ++j) {
+       for (int i = 0; i < rows_; ++i) {
            int cell = GetCellNumber(i, j);
            if (!IsMultiColumn(cell, true) || IsPartOfMultiColumn(i, j))
                continue;
@@ -2574,9 +2566,9 @@ int LyXTabular::Ascii(Buffer const * buf, ostream & os) const
        }
     }
     int cell = 0;
-    for(int i = 0; i < rows_; ++i) {
+    for (int i = 0; i < rows_; ++i) {
        AsciiTopHLine(os, i, clen);
-       for(int j = 0; j < columns_; ++j) {
+       for (int j = 0; j < columns_; ++j) {
            if (IsPartOfMultiColumn(i,j))
                continue;
            ret += AsciiPrintCell(buf, os, cell, i, j, clen);
@@ -2601,7 +2593,7 @@ void LyXTabular::Validate(LaTeXFeatures & features) const
         features.longtable = true;
     if (NeedRotating())
        features.rotating = true;
-    for(int cell = 0; cell < numberofcells; ++cell) {
+    for (int cell = 0; cell < numberofcells; ++cell) {
        if (GetVAlignment(cell) != LYX_VALIGN_TOP)
            features.array = true;
        GetCellInset(cell)->Validate(features);
@@ -2613,8 +2605,8 @@ LyXTabular::BoxType LyXTabular::UseParbox(int cell) const
 {
     LyXParagraph * par = GetCellInset(cell)->par;
 
-    for(; par; par = par->next) {
-       for(int i = 0; i < par->Last(); ++i) {
+    for (; par; par = par->next) {
+       for (int i = 0; i < par->Last(); ++i) {
            if (par->GetChar(i) == LyXParagraph::META_NEWLINE)
                return BOX_PARBOX;
        }
index 8a1f5b7f4fbf37fe83024a2cdf42fd8753c97ec6..01c60fc96ef7d1742427b81587dd619dcec3753c 100644 (file)
@@ -82,7 +82,7 @@ bool TexRow::getIdFromRow(int row, int & id, int & pos) const
                // same id (and where the pos is larger)
                // to avoid putting errorinsets at the
                // same pos.
-               for(; kit != end; ++kit) {
+               for (; kit != end; ++kit) {
                        if (&(*kit) != &(*cit)
                            && (*kit).id() == (*cit).id()
                            && (*kit).pos() >= (*cit).pos())
@@ -108,7 +108,7 @@ void TexRow::increasePos(int id, int pos) const
 {
        RowList::iterator kit = rowlist.begin();
        RowList::iterator end = rowlist.end();
-       for(; kit != end; ++kit) {
+       for (; kit != end; ++kit) {
                if (id == (*kit).id()
                    && pos < (*kit).pos()) {
                        (*kit).pos((*kit).pos() + 1);
index e7383aa369963f48c1ab8c853127b1fb297e0760..e0dd58339befd81041edc4e7104da26dcba472db 100644 (file)
@@ -1027,8 +1027,8 @@ LyXText::NextBreakPoint(BufferView * bview, Row const * row, int width) const
                                // non-display
                                if (par->GetInset(i)->display() &&
                                    (layout.isCommand() ||
-                                    ((layout.labeltype == LABEL_MANUAL) &&
-                                     (i < BeginningOfMainBody(bview->buffer(), par))))) {
+                                    (layout.labeltype == LABEL_MANUAL
+                                     && i < BeginningOfMainBody(bview->buffer(), par)))) {
                                        // display istn't allowd
                                        par->GetInset(i)->display(false);
                                        x += SingleWidth(bview, par, i, c);
@@ -1633,7 +1633,7 @@ void LyXText::BreakAgain(BufferView * bview, Row * row) const
        LyXParagraph::size_type z = NextBreakPoint(bview, row, workWidth(bview));
       Row * tmprow = row;
       
-      if (z < row->par()->Last() ) {
+      if (z < row->par()->Last()) {
         if (!row->next() || (row->next() && row->next()->par() != row->par())) {
                 // insert a new row
            ++z;
@@ -1677,7 +1677,7 @@ void LyXText::BreakAgainOneRow(BufferView * bview, Row * row)
        LyXParagraph::size_type z = NextBreakPoint(bview, row, workWidth(bview));
        Row * tmprow = row;
        
-       if (z < row->par()->Last() ) {
+       if (z < row->par()->Last()) {
                if (!row->next()
                    || (row->next() && row->next()->par() != row->par())) {
                        /* insert a new row */ 
@@ -1923,7 +1923,7 @@ void LyXText::InsertChar(BufferView * bview, char c)
                                    (cursor.pos() == 1 ||
                                     cursor.par()->IsSeparator(cursor.pos() - 2) ||
                                     cursor.par()->IsNewline(cursor.pos() - 2) )
-                                   ) {
+                                  ) {
                                        SetCharFont(bview->buffer(),
                                                    cursor.par(),
                                                    cursor.pos() - 1,
@@ -2040,7 +2040,7 @@ void LyXText::InsertChar(BufferView * bview, char c)
                LyXParagraph::size_type z = NextBreakPoint(bview,
                                                           row->previous(),
                                                           workWidth(bview));
-               if ( z >= row->pos()) {
+               if (z >= row->pos()) {
                        row->pos(z + 1);
                        
                        // set the dimensions of the row above
@@ -2083,7 +2083,7 @@ void LyXText::InsertChar(BufferView * bview, char c)
                              * will set fill to -1. Otherwise
                              * we would not get a rebreak! */
                row->fill(Fill(bview, row, workWidth(bview)));
-       if (row->fill() < 0 ) {
+       if (row->fill() < 0) {
                refresh_y = y;
                refresh_row = row; 
                refresh_x = cursor.x();
@@ -2295,7 +2295,7 @@ void LyXText::CursorRightOneWord(BufferView * bview) const
                int steps = 0;
 
                // Skip through initial nonword stuff.
-               while ( tmpcursor.pos() < tmpcursor.par()->Last() &&
+               while (tmpcursor.pos() < tmpcursor.par()->Last() &&
                        ! tmpcursor.par()->IsWord( tmpcursor.pos() ) ) 
                {
                  //    printf("Current pos1 %d", tmpcursor.pos()) ;
@@ -2303,7 +2303,7 @@ void LyXText::CursorRightOneWord(BufferView * bview) const
                        ++steps;
                }
                // Advance through word.
-               while ( tmpcursor.pos() < tmpcursor.par()->Last() &&
+               while (tmpcursor.pos() < tmpcursor.par()->Last() &&
                        tmpcursor.par()->IsWord( tmpcursor.pos() ) )
                {
                  //     printf("Current pos2 %d", tmpcursor.pos()) ;
@@ -2376,17 +2376,17 @@ void LyXText::CursorLeftOneWord(BufferView * bview)  const
 void LyXText::SelectWord(BufferView * bview) 
 {
        // Move cursor to the beginning, when not already there.
-       if ( cursor.pos()
-            && !cursor.par()->IsSeparator(cursor.pos()-1)
-            && !cursor.par()->IsKomma(cursor.pos()-1) )
+       if (cursor.pos()
+           && !cursor.par()->IsSeparator(cursor.pos()-1)
+           && !cursor.par()->IsKomma(cursor.pos()-1) )
                CursorLeftOneWord(bview);
 
        // set the sel cursor
        sel_cursor = cursor;
 
-       while ( cursor.pos() < cursor.par()->Last()
-                       && !cursor.par()->IsSeparator(cursor.pos())
-                       && !cursor.par()->IsKomma(cursor.pos()) )
+       while (cursor.pos() < cursor.par()->Last()
+              && !cursor.par()->IsSeparator(cursor.pos())
+              && !cursor.par()->IsKomma(cursor.pos()) )
                cursor.pos(cursor.pos() + 1);
        SetCursor(bview, cursor.par(), cursor.pos() );
        
@@ -2406,7 +2406,7 @@ bool LyXText::SelectWordWhenUnderCursor(BufferView * bview)
            && !cursor.par()->IsSeparator(cursor.pos())
            && !cursor.par()->IsKomma(cursor.pos())
            && !cursor.par()->IsSeparator(cursor.pos() -1)
-           && !cursor.par()->IsKomma(cursor.pos() -1) ) {
+           && !cursor.par()->IsKomma(cursor.pos() -1)) {
                SelectWord(bview);
                return true;
        }
@@ -2900,7 +2900,7 @@ void LyXText::Backspace(BufferView * bview)
                if (row->previous() && row->previous()->par() == row->par()) {
                        z = NextBreakPoint(bview, row->previous(),
                                           workWidth(bview));
-                       if ( z >= row->pos()) {
+                       if (z >= row->pos()) {
                                row->pos(z + 1);
                                
                                Row * tmprow = row->previous();
@@ -3015,7 +3015,9 @@ void LyXText::GetVisibleRow(BufferView * bview, int y_offset, int x_offset,
        /* returns a printed row */
        Painter & pain = bview->painter();
        
-       bool is_rtl = row_ptr->par()->isRightToLeftPar(bview->buffer()->params);
+       bool const is_rtl =
+               row_ptr->par()->isRightToLeftPar(bview->buffer()->params);
+       
        LyXParagraph::size_type last = RowLastPrintable(row_ptr);
 
        LyXParagraph::size_type vpos, pos;
@@ -3048,9 +3050,9 @@ void LyXText::GetVisibleRow(BufferView * bview, int y_offset, int x_offset,
        bool clear_area = true;
        Inset * inset = 0;
 
-       if (!bview->screen()->forceClear() && (last == row_ptr->pos()) &&
-           (row_ptr->par()->GetChar(row_ptr->pos()) == LyXParagraph::META_INSET) &&
-           (inset = row_ptr->par()->GetInset(row_ptr->pos()))) {
+       if (!bview->screen()->forceClear() && last == row_ptr->pos()
+           && row_ptr->par()->GetChar(row_ptr->pos()) == LyXParagraph::META_INSET
+           && (inset = row_ptr->par()->GetInset(row_ptr->pos()))) {
                clear_area = inset->doClearArea();
        }
        // we don't need to clear it's already done!!!
@@ -3128,7 +3130,7 @@ void LyXText::GetVisibleRow(BufferView * bview, int y_offset, int x_offset,
                                                   row_ptr->height(),
                                                   LColor::selection);
                        }
-               } else if ( sel_start_cursor.row() != row_ptr &&
+               } else if (sel_start_cursor.row() != row_ptr &&
                            sel_end_cursor.row() != row_ptr &&
                            y > sel_start_cursor.y()
                            && y < sel_end_cursor.y()) {
@@ -3138,7 +3140,7 @@ void LyXText::GetVisibleRow(BufferView * bview, int y_offset, int x_offset,
                } else if (sel_start_cursor.row() == row_ptr ||
                           sel_end_cursor.row() == row_ptr) {
                        float tmpx = x;
-                       if ( (sel_start_cursor.row() != row_ptr && !is_rtl) ||
+                       if ((sel_start_cursor.row() != row_ptr && !is_rtl) ||
                             (sel_end_cursor.row() != row_ptr && is_rtl))
                                pain.fillRectangle(x_offset, y_offset,
                                                   int(tmpx),
@@ -3173,7 +3175,7 @@ void LyXText::GetVisibleRow(BufferView * bview, int y_offset, int x_offset,
                                } else
                                        tmpx += SingleWidth(bview, row_ptr->par(), pos);
                                
-                               if ( (sel_start_cursor.row() != row_ptr ||
+                               if ((sel_start_cursor.row() != row_ptr ||
                                      sel_start_cursor.pos() <= pos) &&
                                     (sel_end_cursor.row() != row_ptr ||
                                      pos < sel_end_cursor.pos()) )
@@ -3184,7 +3186,7 @@ void LyXText::GetVisibleRow(BufferView * bview, int y_offset, int x_offset,
                                                           LColor::selection);
                        }
 
-                       if ( (sel_start_cursor.row() != row_ptr && is_rtl) ||
+                       if ((sel_start_cursor.row() != row_ptr && is_rtl) ||
                             (sel_end_cursor.row() != row_ptr && !is_rtl) )
                                pain.fillRectangle(x_offset + int(tmpx),
                                                   y_offset,
@@ -3587,11 +3589,11 @@ void LyXText::GetVisibleRow(BufferView * bview, int y_offset, int x_offset,
 #endif
        if (
 #ifndef NEW_INSETS
-               (row_ptr->par()->ParFromPos(last + 1) == par)
+               row_ptr->par()->ParFromPos(last + 1) == par
 #else
-               (row_ptr->par() == par)
+               row_ptr->par() == par
 #endif
-           && (!row_ptr->next() || (row_ptr->next()->par() != row_ptr->par())))
+               && (!row_ptr->next() || row_ptr->next()->par() != row_ptr->par()))
        {
                /* think about the margins */ 
                if (!row_ptr->next() && bv_owner)
index d7047c5c301184334bbe1f1fa57080e9e6e29dfb..9564e41c7f8d2321fc38890b2aa826887c41628d 100644 (file)
@@ -1721,7 +1721,7 @@ void LyXText::SetCounter(Buffer const * buf, LyXParagraph * par) const
         // entry in the marginnote and the enclosing
         // environment is an enum/item then correct for the
         // LaTeX behaviour (ARRae)
-        if(par->footnoteflag == LyXParagraph::OPEN_FOOTNOTE
+        if (par->footnoteflag == LyXParagraph::OPEN_FOOTNOTE
           && par->footnotekind == LyXParagraph::MARGIN
            && par->Previous()
            && par->Previous()->footnoteflag != LyXParagraph::OPEN_FOOTNOTE
@@ -2663,7 +2663,7 @@ void LyXText::CheckParagraph(BufferView * bview, LyXParagraph * par,
        // is there a break one row above
        if (row->previous() && row->previous()->par() == row->par()) {
                z = NextBreakPoint(bview, row->previous(), workWidth(bview));
-               if ( z >= row->pos()) {
+               if (z >= row->pos()) {
                        // set the dimensions of the row above
                        y -= row->previous()->height();
                        refresh_y = y;
@@ -3094,7 +3094,7 @@ void LyXText::DeleteEmptyParagraphMechanism(BufferView * bview,
        LyXCursor tmpcursor;
 
        if (old_cursor.par() != cursor.par()) {
-               if ( (old_cursor.par()->Last() == 0
+               if ((old_cursor.par()->Last() == 0
                      || (old_cursor.par()->Last() == 1
                          && old_cursor.par()->IsLineSeparator(0)))
 #ifndef NEW_INSETS
index 98b6c45c0dd3cee30135d2739a8e15f3590b4223..b2d6543d457930fd819bceda122877060fbae412 100644 (file)
@@ -48,7 +48,7 @@ string const DefaultTrans::process(char c, TransManager & k)
 
 Trans::Trans()
 {
-       for(int i = 0; i < TEX_MAX_ACCENT + 1; ++i)
+       for (int i = 0; i < TEX_MAX_ACCENT + 1; ++i)
                kmod_list_[i] = 0;
 }
 
@@ -87,11 +87,11 @@ void Trans::FreeException(Trans::keyexc & exclist)
 
 void Trans::FreeKeymap()
 {
-       for(int i = 0; i < 256; ++i)
+       for (int i = 0; i < 256; ++i)
                if (!keymap_[i].empty()) {
                        keymap_[i].erase();
                }
-       for(int i = 0; i < TEX_MAX_ACCENT + 1; ++i)
+       for (int i = 0; i < TEX_MAX_ACCENT + 1; ++i)
                if (kmod_list_[i]) {
                        FreeException(kmod_list_[i]->exception_list);
                        delete kmod_list_[i];
@@ -150,18 +150,7 @@ void Trans::AddDeadkey(tex_accent accent, string const & keys,
                kmod_list_[accent]->allowed = allowed;
        }
        
-       for(string::size_type i = 0; i < keys.length(); ++i) {
-#if 0
-               string * temp =
-                       &keymap_[static_cast<unsigned char>(keys[i])];
-#warning this is not really clean we should find a cleaner way (Jug)
-               *temp = "xx"; /* this is needed for the being sure that
-                                the below assignment is not assigned to
-                                a nullpointer (if size of string = 0)
-                      */
-               (*temp)[0] = 0;
-               (*temp)[1] = accent;
-#else
+       for (string::size_type i = 0; i < keys.length(); ++i) {
                string & temp =
                        keymap_[static_cast<unsigned char>(keys[i])];
                if (!temp.empty())
@@ -172,7 +161,6 @@ void Trans::AddDeadkey(tex_accent accent, string const & keys,
                // Lgb
                temp += char(0);
                temp += char(accent);
-#endif
        }
        kmod_list_[accent]->exception_list = 0;
 }
@@ -183,7 +171,7 @@ int Trans::Load(LyXLex & lex)
        bool error = false;
 
        while (lex.IsOK() && !error) {
-               switch(lex.lex()) {
+               switch (lex.lex()) {
                case KMOD:
                {
                        if (lyxerr.debugging(Debug::KBMAP))
@@ -198,7 +186,7 @@ int Trans::Load(LyXLex & lex)
                        string keys = lex.GetString();
 
                        if (lex.next(true)) {
-                               if ( lyxerr.debugging(Debug::KBMAP))
+                               if (lyxerr.debugging(Debug::KBMAP))
                                        lyxerr << "accent\t`" << lex.text()
                                               << "'" << endl;
                        } else
@@ -250,7 +238,7 @@ int Trans::Load(LyXLex & lex)
                        // Find what key accent_2 is on - should
                        // check about accent_1 also
                        int key = 0;
-                       for(; key < 256; ++key) {
+                       for (; key < 256; ++key) {
                                if (!keymap_[key].empty()
                                    && keymap_[key][0] == 0
                                    && keymap_[key][1] == accent_2)
@@ -404,7 +392,7 @@ tex_accent getkeymod(string const & p)
                               << "].name = `" << lyx_accent_table[i].name
                               << "'" << endl;
                
-               if ( lyx_accent_table[i].name
+               if (lyx_accent_table[i].name
                     && contains(p, lyx_accent_table[i].name)) {
                        lyxerr[Debug::KBMAP] << "Found it!" << endl;
                        return static_cast<tex_accent>(i);
index e065ab83ce0a77c5fabb12012149d2f6f318ed1a..25d5d5ef511809b04a76fb881587a58ebda30cb4 100644 (file)
@@ -168,7 +168,7 @@ bool isValidGlueLength (string const & data, LyXGlueLength * result)
        // To make isValidGlueLength recognize negative values as
        // the first number this little hack is needed:
        short val_sign = 1; // positive as default
-       switch(buffer[0]) {
+       switch (buffer[0]) {
        case '-':
                lyx_advance(buffer, 1);
                val_sign = -1;
@@ -232,7 +232,7 @@ bool isValidLength(string const & data, LyXLength * result)
        // To make isValidLength recognize negative values
        // this little hack is needed:
        short val_sign = 1; // positive as default
-       switch(buffer[0]) {
+       switch (buffer[0]) {
        case '-':
                lyx_advance(buffer, 1);
                val_sign = -1;