]> git.lyx.org Git - features.git/commitdiff
more type changes, some consts added
authorLars Gullik Bjønnes <larsbj@gullik.org>
Fri, 29 Sep 2000 18:44:07 +0000 (18:44 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Fri, 29 Sep 2000 18:44:07 +0000 (18:44 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1061 a592a061-630c-0410-9148-cb99ea01b6c8

45 files changed:
ChangeLog
src/BufferView.h
src/BufferView2.C
src/BufferView_pimpl.C
src/buffer.C
src/buffer.h
src/combox.h
src/frontends/xforms/FormBase.C
src/frontends/xforms/FormCitation.C
src/frontends/xforms/FormCitation.h
src/frontends/xforms/FormIndex.h
src/frontends/xforms/FormRef.C
src/frontends/xforms/FormRef.h
src/frontends/xforms/FormToc.h
src/frontends/xforms/FormUrl.h
src/insets/figinset.C
src/insets/insetcollapsable.C
src/insets/insetcollapsable.h
src/insets/insettabular.C
src/insets/insettabular.h
src/insets/insettext.C
src/insets/insettext.h
src/insets/lyxinset.h
src/lyx_cb.C
src/lyxcursor.C
src/lyxcursor.h
src/lyxfunc.C
src/lyxscreen.h
src/lyxtext.h
src/mathed/formula.C
src/mathed/math_cursor.C
src/mathed/math_defs.h
src/mathed/math_draw.C
src/mathed/math_inset.h
src/mathed/math_iter.C
src/mathed/math_iter.h
src/mathed/math_macro.C
src/mathed/math_macro.h
src/mathed/math_parser.C
src/mathed/math_root.h
src/screen.C
src/support/kill.C
src/support/lyxlib.h
src/text.C
src/text2.C

index 56836104232f965abb7bb2b65f00887a03407c65..daf4846950dfd6223cb4ffea9003fecefc713331 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2000-09-29  Lars Gullik Bjønnes  <larsbj@lyx.org>
+
+       * several files: type canges to reduce the number of warnings and
+       to unify type hangling a bit. Still much to do. 
+
 2000-09-29  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
 
        * lib/images/*: rename a bunch of icons to match Dekel converter
index d811704302efe3fe2ce18421d1690a1e6b318a36..00cfc04917ff37d24ebf2e6ee067103afc0bb62f 100644 (file)
@@ -192,11 +192,11 @@ public:
        ///
        bool lockInset(UpdatableInset * inset);
        ///
-       void showLockedInsetCursor(long x, long y, int asc, int desc);
+       void showLockedInsetCursor(int x, int y, int asc, int desc);
        ///
        void hideLockedInsetCursor();
        ///
-       void fitLockedInsetCursor(long x, long y, int asc, int desc);
+       void fitLockedInsetCursor(int x, int y, int asc, int desc);
        ///
        int unlockInset(UpdatableInset * inset);
        ///
index ab4e5ca3fc07de801cf786329a486270de18ab2f..524a4f100189c65bc43ebc735cb3440eb7d0e6b8 100644 (file)
@@ -726,7 +726,7 @@ bool BufferView::lockInset(UpdatableInset * inset)
 }
 
 
-void BufferView::showLockedInsetCursor(long x, long y, int asc, int desc)
+void BufferView::showLockedInsetCursor(int x, int y, int asc, int desc)
 {
        if (the_locking_inset && available()) {
                LyXCursor cursor = text->cursor;
@@ -752,7 +752,7 @@ void BufferView::hideLockedInsetCursor()
 }
 
 
-void BufferView::fitLockedInsetCursor(long x, long y, int asc, int desc)
+void BufferView::fitLockedInsetCursor(int x, int y, int asc, int desc)
 {
        if (the_locking_inset && available()){
                y += text->cursor.y() + the_locking_inset->InsetInInsetY();
index bc6b57134808bcf755615f1698ffb75e7ff920d8..36dbfa07c3744369fb5bc1e43b0bedd0c5c6fcf6 100644 (file)
@@ -1136,7 +1136,7 @@ void BufferView::Pimpl::cursorPrevious()
 {
        if (!bv_->text->cursor.row()->previous()) return;
        
-       long y = bv_->text->first;
+       int y = bv_->text->first;
        Row * cursorrow = bv_->text->cursor.row();
        bv_->text->SetCursorFromCoordinates(bv_, bv_->text->cursor.x_fix(), y);
        bv_->text->FinishUndo();
@@ -1158,7 +1158,7 @@ void BufferView::Pimpl::cursorNext()
 {
        if (!bv_->text->cursor.row()->next()) return;
        
-       long y = bv_->text->first;
+       int y = bv_->text->first;
        bv_->text->GetRowNearY(y);
        Row * cursorrow = bv_->text->cursor.row();
        bv_->text->SetCursorFromCoordinates(bv_, bv_->text->cursor.x_fix(), y
index a8f510ba1af615cc6b633fd73a95cc7df7ba14ba..034b7e787f3958cd8f666af34bb2bf395e66828e 100644 (file)
@@ -1257,7 +1257,7 @@ void Buffer::writeFileAscii(string const & fname, int linelen)
        int actcell = 0;
        int actpos = 0;
        int currlinelen = 0;
-       long fpos = 0;
+       int fpos = 0;
        bool ref_printed = false;
 
        ofstream ofs(fname.c_str());
@@ -1465,14 +1465,12 @@ string const Buffer::asciiParagraph(LyXParagraph const * par,
                                    unsigned int linelen) const
 {
        ostringstream buffer;
-       LyXFont font1, font2;
+       LyXFont font1;
+       LyXFont font2;
        Inset const * inset;
        char c;
        LyXParagraph::footnote_flag footnoteflag = LyXParagraph::NO_FOOTNOTE;
        char depth = 0;
-       string tmp;
-       LyXParagraph::size_type i;
-       unsigned int j;
        int ltype = 0;
        int ltype_depth = 0;
        unsigned int currlinelen = 0;
@@ -1494,16 +1492,15 @@ string const Buffer::asciiParagraph(LyXParagraph const * par,
                if (footnoteflag != par->footnoteflag) {
                        footnoteflag = par->footnoteflag;
                        if (footnoteflag) {
-                               j = strlen(string_footnotekinds[par->footnotekind])+4;
+                               size_t const j = strlen(string_footnotekinds[par->footnotekind]) + 4;
                                if ((linelen > 0) &&
                                    ((currlinelen + j) > linelen)) {
                                        buffer << "\n";
                                        currlinelen = 0;
                                }
-                               buffer <<
-                                   "([" <<
-                                   string_footnotekinds[par->footnotekind] <<
-                                   "] ";
+                               buffer << "(["
+                                      << string_footnotekinds[par->footnotekind]
+                                      << "] ";
                                currlinelen += j;
                        }
                }
@@ -1523,7 +1520,7 @@ string const Buffer::asciiParagraph(LyXParagraph const * par,
                }
                
                /* First write the layout */
-               tmp = textclasslist.NameOfLayout(params.textclass, par->layout);
+               string const tmp = textclasslist.NameOfLayout(params.textclass, par->layout);
                if (tmp == "Itemize") {
                        ltype = 1;
                        ltype_depth = depth+1;
@@ -1573,10 +1570,10 @@ string const Buffer::asciiParagraph(LyXParagraph const * par,
        }
       
        font1 = LyXFont(LyXFont::ALL_INHERIT, params.language_info);
-       for (i = 0; i < par->size(); ++i) {
+       for (LyXParagraph::size_type i = 0; i < par->size(); ++i) {
                if (!i && !footnoteflag && !noparbreak){
                        buffer << "\n\n";
-                       for(j = 0; j < depth; ++j)
+                       for(char j = 0; j < depth; ++j)
                                buffer << "  ";
                        currlinelen = depth * 2;
                        switch(ltype) {
@@ -1598,7 +1595,7 @@ string const Buffer::asciiParagraph(LyXParagraph const * par,
                                break;
                        }
                        if (ltype_depth > depth) {
-                               for(j = ltype_depth - 1; j > depth; --j)
+                               for(char j = ltype_depth - 1; j > depth; --j)
                                        buffer << "  ";
                                currlinelen += (ltype_depth-depth)*2;
                        }
@@ -1631,11 +1628,11 @@ string const Buffer::asciiParagraph(LyXParagraph const * par,
                        break;
                case LyXParagraph::META_NEWLINE:
                        buffer << "\n";
-                       for(j = 0; j < depth; ++j)
+                       for(char j = 0; j < depth; ++j)
                                buffer << "  ";
                        currlinelen = depth * 2;
                        if (ltype_depth > depth) {
-                               for(j = ltype_depth;
+                               for(char j = ltype_depth;
                                    j > depth; --j)
                                        buffer << "  ";
                                currlinelen += (ltype_depth - depth) * 2;
@@ -1652,11 +1649,11 @@ string const Buffer::asciiParagraph(LyXParagraph const * par,
                            (c == ' ') && ((i + 2) < par->size()))
                        {
                                buffer << "\n";
-                               for(j = 0; j < depth; ++j)
+                               for(char j = 0; j < depth; ++j)
                                        buffer << "  ";
                                currlinelen = depth * 2;
                                if (ltype_depth > depth) {
-                                       for(j = ltype_depth;
+                                       for(char j = ltype_depth;
                                            j > depth; --j)
                                                buffer << "  ";
                                        currlinelen += (ltype_depth-depth)*2;
index 39d57306bd5a44966d315526f9bb3cdd9f27652c..d3c2054dca32ea5791e7fd2dcdbbe1a04f3870ec 100644 (file)
@@ -358,16 +358,16 @@ private:
 #ifndef NEW_INSETS
         ///
         void linuxDocHandleFootnote(std::ostream & os,
-                                   LyXParagraph * & par, int const depth);
+                                   LyXParagraph * & par, int depth);
 #endif
         ///
        void DocBookHandleCaption(std::ostream & os, string & inner_tag,
-                                 int const depth, int desc_on,
+                                 int depth, int desc_on,
                                  LyXParagraph * & par);
 #ifndef NEW_INSETS
         ///
        void DocBookHandleFootnote(std::ostream & os,
-                                  LyXParagraph * & par, int const depth);
+                                  LyXParagraph * & par, int depth);
 #endif
        ///
         void sgmlOpenTag(std::ostream & os, int depth,
@@ -380,11 +380,11 @@ private:
                           string const & message);
         ///
        void SimpleLinuxDocOnePar(std::ostream & os, LyXParagraph * par,
-                                 int desc_on, int const depth);
+                                 int desc_on, int depth);
         ///
        void SimpleDocBookOnePar(std::ostream &, string & extra,
                                 LyXParagraph * par, int & desc_on,
-                                int const depth);
+                                int depth);
 
        /// LinuxDoc.
        void push_tag(std::ostream & os, string const & tag,
index 96a01be42a6a905fc368f1e21fb71829b1c205cc..32a0aa334a9923dd0ed09e7c27237dcb403f40a8 100644 (file)
@@ -221,7 +221,8 @@ string const Combox::getline()
     if (type == FL_COMBOX_INPUT) 
       return fl_get_input(label);
     else
-      return (browser && sel > 0) ? fl_get_browser_line(browser, sel) : string();
+      return (browser && sel > 0) ?
+             fl_get_browser_line(browser, sel) : string();
 }
 
 #endif
index 5239d69125020e30a59a8bb0c60a8a0fb4814600..51eaa3b2aa55a41b56eea4acab81b293705d0455 100644 (file)
@@ -130,7 +130,7 @@ void FormBase::HideCB(FL_OBJECT * ob, long)
 }
 
 
-void FormBase::InputCB(FL_OBJECT * ob, long data )
+void FormBase::InputCB(FL_OBJECT * ob, long data)
 {
        FormBase * pre = static_cast<FormBase*>(ob->form->u_vdata);
        pre->input( data );
index 5d8fd82cecbf566ec93e4782bb5f20c4723cad6f..6e66de9d350ba43061d9f1bb9f80175fedd91e9b 100644 (file)
@@ -290,7 +290,7 @@ void FormCitation::setSize( int hbrsr, bool bibPresent ) const
 }
 
 
-void FormCitation::input( long data )
+void FormCitation::input(long data)
 {
        State cb = static_cast<FormCitation::State>( data );
 
index c0c002ef3380f9f28426da26c2674ca4f3bb7282..de5de6000841b9793c1164893f0de4b3b0e3d603 100644 (file)
@@ -50,7 +50,7 @@ private:
        /// Build the dialog
        virtual void build();
        /// Filter the inputs
-       virtual void input( long );
+       virtual void input(long);
        /// Update dialog before showing it
        virtual void update();
        /// Apply from dialog (modify or create inset)
index 5b8958542dcd285081bdaaac23cb701717de2654..bcd94511cde546bd90cbc9c9712c74565beede74 100644 (file)
@@ -31,7 +31,7 @@ private:
        /// Build the dialog
        virtual void build();
        /// Not used but must be instantiated
-       virtual void input( long ) {}
+       virtual void input(long) {}
        /// Update dialog before showing it
        virtual void update();
        /// Apply from dialog (modify or create inset)
index a60ca919572003ba8adbb21a6c24769ad0aed839..bfe09ee2d776ccb1595a73c11696679b70498b19 100644 (file)
@@ -252,7 +252,7 @@ void FormRef::apply()
 }
 
 
-void FormRef::input( long data )
+void FormRef::input(long data)
 {
        switch( data ) {
        // goto reference / go back
index f0548cfb66532f93831e676e0ac9dee715c3fd1a..f71931fa3174a6242ae45f8e7f6de37385f66add 100644 (file)
@@ -54,7 +54,7 @@ private:
        /// Build the dialog
        virtual void build();
        /// Filter the input
-       virtual void input( long );
+       virtual void input(long);
        /// Update dialog before showing it
        virtual void update();
        /// Not used but must be instantiated
index 78cbaa5263090b0e42ff1a6429dfb73ff9611aee..c3e20a32182e194f889696f7612dc865fdc82115 100644 (file)
@@ -32,7 +32,7 @@ private:
        /// Build the dialog
        virtual void build();
        /// Not used but must be instantiated
-       virtual void input( long ) {}
+       virtual void input(long) {}
        /// Update dialog before showing it
        virtual void update();
        /// Apply from dialog (modify or create inset)
index 1c7703ea29e6deafe6b5260f7cb44d029776459a..981ab6b671ee445d8fed810a471d9d9ac6284a03 100644 (file)
@@ -31,7 +31,7 @@ private:
        /// Build the dialog
        virtual void build();
        /// Not used but must be instantiated
-       virtual void input( long ) {}
+       virtual void input(long) {}
        /// Update dialog before showing it
        virtual void update();
        /// Apply from dialog (modify or create inset)
index f4cecabc6333b93aba6f027763a395af2a992e1b..61cefa102ed40bc4a3d072cade1b80f0ddae71ad 100644 (file)
@@ -353,7 +353,7 @@ void AllocGrays(int num)
        if (num > 128) num = 128;
        XColor xcol;
        for (int i = 0; i < num; ++i) {
-               xcol.red = xcol.green = xcol.blue = 65535 * i / (num - 1);
+               xcol.red = xcol.green = xcol.blue = short(65535 * i / (num - 1));
                xcol.flags = DoRed | DoGreen | DoBlue;
                if (!XAllocColor(fl_display,
                                 fl_state[fl_get_vclass()].colormap, &xcol)) {
@@ -591,7 +591,7 @@ void runqueue()
                                        XInternAtom(tempdisp, "STRING", false),
                                        8, PropModeAppend, 
                                        reinterpret_cast<unsigned char*>(const_cast<char*>(t1.str().c_str())),
-                                       t1.str().size());
+                                       int(t1.str().size()));
                        XUngrabServer(tempdisp);
                        XFlush(tempdisp);
 
@@ -620,7 +620,7 @@ void runqueue()
                                        XInternAtom(tempdisp, "STRING", false),
                                        8, PropModeReplace, 
                                        reinterpret_cast<unsigned char*>(const_cast<char*>(t3.str().c_str())),
-                                       t3.str().size());
+                                       int(t3.str().size()));
                        XUngrabServer(tempdisp);
                        XFlush(tempdisp);
                        
index e73bdd0cd29aea4fd3ccb9d0733edf7eecda0ddd..345cd2b42dd10bd90bf64d44d1fff0598f3b0f4f 100644 (file)
@@ -379,7 +379,7 @@ bool InsetCollapsable::UpdateInsetInInset(BufferView * bv, Inset *in)
 }
 
 
-int InsetCollapsable::InsetInInsetY()
+unsigned int InsetCollapsable::InsetInInsetY()
 {
     return inset->InsetInInsetY();
 }
index 52b317f5ca940845ec2fab9785ccbf55e0cf5229..907d7b0ea789c87d3b5512b85f29581399e5d2fd 100644 (file)
@@ -79,7 +79,7 @@ public:
     ///
     bool UpdateInsetInInset(BufferView *, Inset *);
     ///
-    int InsetInInsetY();
+    unsigned int InsetInInsetY();
     ///
     void InsetButtonRelease(BufferView *, int, int, int);
     ///
index 11211b1b1b263f6f6bee2c2f4c1e651d6f5688f2..8fe7d70f658b9d1cf35b26f1fedef67d6b6209b1 100644 (file)
@@ -434,7 +434,9 @@ void InsetTabular::Edit(BufferView * bv, int x, int y, unsigned int button)
     }
     locked = true;
     the_locking_inset = 0;
-    inset_pos = inset_x = inset_y = 0;
+    inset_pos = 0;
+    inset_x = 0;
+    inset_y = 0;
     setPos(bv, x, y);
     sel_pos_start = sel_pos_end = cursor.pos();
     sel_cell_start = sel_cell_end = actcell;
@@ -550,7 +552,7 @@ bool InsetTabular::UpdateInsetInInset(BufferView * bv, Inset * inset)
 }
 
 
-int InsetTabular::InsetInInsetY()
+unsigned int InsetTabular::InsetInInsetY()
 {
     if (!the_locking_inset)
        return 0;
@@ -959,7 +961,7 @@ bool InsetTabular::calculate_dimensions_of_cells(BufferView * bv,
 
 
 void InsetTabular::GetCursorPos(BufferView *,
-                               unsigned long & x, unsigned long & y) const
+                               int & x, int & y) const
 {
     x = cursor.x() - top_x;
     y = cursor.y();
@@ -1017,12 +1019,12 @@ void InsetTabular::setPos(BufferView * bv, int x, int y) const
     cursor.pos(0);
        
     actcell = actrow = actcol = 0;
-    int ly = tabular->GetDescentOfRow(actrow);
+    unsigned int ly = tabular->GetDescentOfRow(actrow);
 
     // first search the right row
     while((ly < y) && (actrow < tabular->rows())) {
         cursor.y(cursor.y() + tabular->GetDescentOfRow(actrow) +
-           tabular->GetAscentOfRow(actrow+1) +
+           tabular->GetAscentOfRow(actrow + 1) +
             tabular->GetAdditionalHeight(tabular->GetCellNumber(actrow + 1,
                                                                actcol)));
         ++actrow;
@@ -1031,7 +1033,7 @@ void InsetTabular::setPos(BufferView * bv, int x, int y) const
     actcell = tabular->GetCellNumber(actrow, actcol);
 
     // now search the right column
-    int lx = tabular->GetWidthOfColumn(actcell) -
+    unsigned int lx = tabular->GetWidthOfColumn(actcell) -
        tabular->GetAdditionalWidth(actcell);
     for(; !tabular->IsLastCellInRow(actcell) && (lx < x);
        ++actcell,lx += tabular->GetWidthOfColumn(actcell) +
index 6b2513efc55a7e377da8e90ef8f47f1966394f51..9d54ffcdd123cca4d164c7580a3e954b05998438 100644 (file)
@@ -111,7 +111,7 @@ public:
     ///
     bool UpdateInsetInInset(BufferView *, Inset *);
     ///
-    int InsetInInsetY();
+    unsigned int InsetInInsetY();
     ///
     UpdatableInset * GetLockingInset();
     ///
@@ -145,8 +145,7 @@ public:
     ///
     Inset::Code LyxCode() const { return Inset::TABULAR_CODE; }
     ///
-    void GetCursorPos(BufferView *, unsigned long & x,
-                     unsigned long & y) const;
+    void GetCursorPos(BufferView *, int & x, int & y) const;
     ///
     void ToggleInsetCursor(BufferView *);
     ///
@@ -244,9 +243,9 @@ private:
     ///
     mutable int inset_pos;
     ///
-    mutable int inset_x;
+    mutable unsigned int inset_x;
     ///
-    mutable unsigned long inset_y;
+    mutable unsigned int inset_y;
     ///
     mutable int sel_pos_start;
     ///
index 89ce5d7e38b6c915ebd9a6bb5dc0d36f71c18ec5..9040338c6074c632d1d4a652e619be353527d686 100644 (file)
@@ -82,14 +82,19 @@ InsetText & InsetText::operator=(InsetText const & it)
 
 void InsetText::init(InsetText const * ins)
 {
-    top_y = last_width = last_height = 0;
-    insetAscent = insetDescent = insetWidth = 0;
+    top_y = 0;
+    last_width = 0;
+    last_height = 0;
+    insetAscent = 0;
+    insetDescent = 0;
+    insetWidth = 0;
     the_locking_inset = 0;
     cursor_visible = false;
     interline_space = 1;
     no_selection = false;
     need_update = INIT;
-    drawTextXOffset = drawTextYOffset = 0;
+    drawTextXOffset = 0;
+    drawTextYOffset = 0;
     autoBreakRows = false;
     drawFrame = NEVER;
     xpos = 0.0;
@@ -211,7 +216,7 @@ void InsetText::Read(Buffer const * buf, LyXLex & lex)
 
 int InsetText::ascent(BufferView * bv, LyXFont const &) const
 {
-    long int y_temp = 0;
+    int y_temp = 0;
     Row * row = TEXT(bv)->GetRowNearY(y_temp);
     insetAscent = row->ascent_of_text() + TEXT_TO_INSET_OFFSET;
     return insetAscent;
@@ -220,7 +225,7 @@ int InsetText::ascent(BufferView * bv, LyXFont const &) const
 
 int InsetText::descent(BufferView * bv, LyXFont const &) const
 {
-    long int y_temp = 0;
+    int y_temp = 0;
     Row * row = TEXT(bv)->GetRowNearY(y_temp);
     insetDescent = TEXT(bv)->height - row->ascent_of_text() +
        TEXT_TO_INSET_OFFSET;
@@ -268,7 +273,7 @@ void InsetText::draw(BufferView * bv, LyXFont const & f,
     if (!cleared && ((need_update==FULL) || (top_x!=int(x)) ||
                     (top_baseline!=baseline))) {
        int w =  insetWidth;
-       int h = insetAscent + insetDescent;
+       unsigned int h = insetAscent + insetDescent;
        int ty = baseline - insetAscent;
        
        if (ty < 0) {
@@ -308,7 +313,7 @@ void InsetText::draw(BufferView * bv, LyXFont const & f,
        return;
     }
     x += TEXT_TO_INSET_OFFSET;
-    long int y = 0;
+    int y = 0;
     Row * row = TEXT(bv)->GetRowNearY(y);
     y += baseline - row->ascent_of_text();
     if (cleared || !locked || (need_update == FULL)) {
@@ -409,7 +414,7 @@ void InsetText::update(BufferView * bv, LyXFont const & font, bool reinit)
     if (TEXT(bv)->status == LyXText::NEED_MORE_REFRESH)
        need_update = FULL;
 
-    long int y_temp = 0;
+    int y_temp = 0;
     Row * row = TEXT(bv)->GetRowNearY(y_temp);
     insetAscent = row->ascent_of_text() + TEXT_TO_INSET_OFFSET;
     insetDescent = TEXT(bv)->height - row->ascent_of_text() +
@@ -1060,14 +1065,15 @@ int InsetText::BeginningOfMainBody(Buffer const * buf, LyXParagraph * p) const
 }
 
 
-void InsetText::GetCursorPos(BufferView * bv, int & x, int & y) const
+void InsetText::GetCursorPos(BufferView * bv,
+                            int & x, int & y) const
 {
     x = cx(bv);
     y = cy(bv);
 }
 
 
-int InsetText::InsetInInsetY()
+unsigned int InsetText::InsetInInsetY()
 {
     if (!the_locking_inset)
        return 0;
@@ -1226,12 +1232,14 @@ void InsetText::SetFont(BufferView * bv, LyXFont const & font, bool toggleall)
 bool InsetText::checkAndActivateInset(BufferView * bv, bool behind)
 {
     if (cpar(bv)->GetChar(cpos(bv)) == LyXParagraph::META_INSET) {
-       int x, y;
+       unsigned int x;
+       unsigned int y;
        Inset * inset =
            static_cast<UpdatableInset*>(cpar(bv)->GetInset(cpos(bv)));
        if (!inset || inset->Editable() != Inset::HIGHLY_EDITABLE)
            return false;
-       LyXFont font = TEXT(bv)->GetFont(bv->buffer(), cpar(bv), cpos(bv));
+       LyXFont const font =
+               TEXT(bv)->GetFont(bv->buffer(), cpar(bv), cpos(bv));
        if (behind) {
            x = inset->width(bv, font);
            y = inset->descent(bv, font);
@@ -1240,7 +1248,7 @@ bool InsetText::checkAndActivateInset(BufferView * bv, bool behind)
        }
        inset_x = cx(bv) - top_x + drawTextXOffset;
        inset_y = cy(bv) + drawTextYOffset;
-       inset->Edit(bv, x-inset_x, y-inset_y, 0);
+       inset->Edit(bv, x - inset_x, y - inset_y, 0);
        if (!the_locking_inset)
            return false;
        UpdateLocal(bv, CURSOR_PAR, false);
@@ -1253,9 +1261,9 @@ bool InsetText::checkAndActivateInset(BufferView * bv, bool behind)
 bool InsetText::checkAndActivateInset(BufferView * bv, int x, int y,
                                      int button)
 {
-    int tmp_x = x - drawTextXOffset;
-    int tmp_y = y + insetAscent;
-    Inset * inset = bv->checkInsetHit(TEXT(bv), tmp_x, tmp_y, button);
+    x = x - drawTextXOffset;
+    y = y + insetAscent;
+    Inset * inset = bv->checkInsetHit(TEXT(bv), x, y, button);
 
     if (inset) {
        if (x < 0)
@@ -1355,13 +1363,13 @@ LyXFont InsetText::GetDrawFont(BufferView * bv, LyXParagraph * p, int pos) const
 #endif
 
 
-long InsetText::cx(BufferView * bv) const
+int InsetText::cx(BufferView * bv) const
 {
     return TEXT(bv)->cursor.x() + top_x + TEXT_TO_INSET_OFFSET;
 }
 
 
-long InsetText::cy(BufferView * bv) const
+int InsetText::cy(BufferView * bv) const
 {
     LyXFont font;
     return TEXT(bv)->cursor.y() - ascent(bv, font) + TEXT_TO_INSET_OFFSET;
index 23dfb2ae00a20a5957426a6b20de2bdbca3c1d41..0080b9894e831a86eec1cca1385a1d9d16f58165 100644 (file)
@@ -138,7 +138,7 @@ public:
     ///
     void GetCursorPos(BufferView *, int & x, int & y) const;
     ///
-    int InsetInInsetY();
+    unsigned int InsetInInsetY();
     ///
     void ToggleInsetCursor(BufferView *);
     ///
@@ -221,9 +221,9 @@ private:
     void removeNewlines();
 
     ///
-    long cx(BufferView *) const;
+    int cx(BufferView *) const;
     ///
-    long cy(BufferView *) const;
+    int cy(BufferView *) const;
     ///
     int cpos(BufferView *) const;
     ///
@@ -242,7 +242,7 @@ private:
     ///
     mutable int insetAscent;
     ///
-    mutable long insetDescent;
+    mutable int insetDescent;
     ///
     mutable int insetWidth;
     ///
index 49ba016fa0e9a0b1d90ef0dd64f5ba5b4aea781c..5a33df2bc73318d155a3339b5bc05b6a0dcdfe6e 100644 (file)
@@ -338,7 +338,7 @@ public:
        virtual UpdatableInset * GetFirstLockingInsetOfType(Inset::Code c)
                { return (c == LyxCode()) ? this : 0; }
        ///
-       virtual int InsetInInsetY() { return 0; }
+       virtual unsigned int InsetInInsetY() { return 0; }
        ///
        virtual bool UpdateInsetInInset(BufferView *, Inset *)
                { return false; }
index 84550020d584594e1cb4ee2783b9b936453e4762..fbd206e801fba99d00d3002d1f9ddc3e5b67000d 100644 (file)
@@ -127,7 +127,7 @@ bool toggleall = true;
    otherwise 0 */
 // Now they work only for updatable insets. [Alejandro 080596]
 //int LockInset(UpdatableInset * inset);
-void ToggleLockedInsetCursor(long x, long y, int asc, int desc);
+void ToggleLockedInsetCursor(int x, int y, int asc, int desc);
 //void FitLockedInsetCursor(long x, long y, int asc, int desc);
 //int UnlockInset(UpdatableInset * inset);
 //void LockedInsetStoreUndo(Undo::undo_kind kind);
index e30bd08eb3bba3d0e7df412970a0fb82b96d50f4..37d65db951f273c1eadbe139b94ff3fe4685fd64 100644 (file)
@@ -82,13 +82,13 @@ int LyXCursor::x_fix() const
 }
 
 
-void LyXCursor::y(unsigned long i)
+void LyXCursor::y(int i)
 {
        y_ = i;
 }
 
 
-unsigned long LyXCursor::y() const
+int LyXCursor::y() const
 {
        return y_;
 }
index 60ad1e0bfbe4386b2fc85d2dd55c3fc1703c4f4a..8a9ac616e0abd040e81027cc550b9b7efa591a2e 100644 (file)
@@ -47,9 +47,9 @@ public:
        ///
        int x_fix() const;
        ///
-       void y(unsigned long i);
+       void y(int i);
        ///
-       unsigned long y() const;
+       int y() const;
        ///
        void row(Row * r);
        ///
@@ -68,7 +68,7 @@ private:
        ///
        int x_fix_;
        ///
-       unsigned long y_;
+       int y_;
        ///
        Row * row_;
 };
index 00195488d487d3644f3010ed371b06cd9d194689..cad787a85599f02f211fa107e4054c42c962ca79 100644 (file)
@@ -698,7 +698,8 @@ string const LyXFunc::Dispatch(int ac,
                        }
                        // Undo/Redo pre 0.13 is a bit tricky for insets.
                        if (action == LFUN_UNDO) {
-                               int slx, sly;
+                               int slx;
+                               int sly;
                                UpdatableInset * inset = 
                                        owner->view()->the_locking_inset;
                                inset->GetCursorPos(owner->view(), slx, sly);
@@ -717,7 +718,8 @@ string const LyXFunc::Dispatch(int ac,
                                        inset->Edit(owner->view(),slx,sly,0);
                                return string();
                        } else if (action == LFUN_REDO) {
-                               int slx, sly;
+                               int slx;
+                               int sly;
                                UpdatableInset * inset = owner->view()->
                                        the_locking_inset;
                                inset->GetCursorPos(owner->view(), slx, sly);
@@ -2345,9 +2347,9 @@ string const LyXFunc::Dispatch(int ac,
                
        case LFUN_SETXY:
        {
-               int  x;
-               long y;
-               ::sscanf(argument.c_str(), " %d %ld", &x, &y);
+               int x;
+               int y;
+               ::sscanf(argument.c_str(), " %d %d", &x, &y);
                owner->view()->text->SetCursorFromCoordinates(owner->view(), x, y);
        }
        break;
index 5a4dc7f2ba732595852212509b5b4484c29069aa..6dc1f038f92d6db902462b7b560ec18070f710f8 100644 (file)
@@ -51,13 +51,13 @@ public:
 
        /** Draws the screen form textposition y. Uses as much of
            the already printed pixmap as possible */
-       void Draw(LyXText *, unsigned long y);
+       void Draw(LyXText *, unsigned int y);
 
        /// Redraws the screen, without using existing pixmap
        void Redraw(LyXText *);
    
        /// Returns a new top so that the cursor is visible
-       unsigned long TopCursorVisible(LyXText const *);
+       unsigned int TopCursorVisible(LyXText const *);
        /// Redraws the screen such that the cursor is visible
        bool FitCursor(LyXText *);
        ///
@@ -67,11 +67,11 @@ public:
        ///
        void CursorToggle(LyXText const *);
        ///
-       void ShowManualCursor(LyXText const *, long x, long y,
+       void ShowManualCursor(LyXText const *, int x, int y,
                              int asc, int desc,
                              Cursor_Shape shape);
        /// returns 1 if first has changed, otherwise 0
-       bool FitManualCursor(LyXText *, long, long, int, int);
+       bool FitManualCursor(LyXText *, int, int, int, int);
        ///
        void ToggleSelection(LyXText *, bool = true, int y_offset = 0,
                             int x_offset = 0);
@@ -94,11 +94,12 @@ private:
        void expose(int x, int y, int exp_width, int exp_height); 
 
        /// y1 and y2 are coordinates of the screen
-       void DrawFromTo(LyXText *, int y1, int y2, int y_offset=0, int x_offset=0);
+       void DrawFromTo(LyXText *, int y1, int y2,
+                       int y_offset = 0, int x_offset = 0);
 
        /// y is a coordinate of the text
-       void DrawOneRow(LyXText *, Row * row, long y_text, int y_offset=0,
-                       int x_offset=0);
+       void DrawOneRow(LyXText *, Row * row, int y_text, int y_offset = 0,
+                       int x_offset = 0);
 
        ///
        WorkArea & owner;
index 55dbb9e0f9d4149608c0b59c786d026ab1d070e3..d80ecd259afd733c26e51765316191c1e213fa0f 100644 (file)
@@ -58,7 +58,7 @@ public:
        ///
        mutable int number_of_rows;
        ///
-       mutable long height;
+       mutable int height;
        ///
        mutable unsigned int width;
        /// the current font settings
@@ -66,7 +66,7 @@ public:
        /// the current font
        mutable LyXFont real_current_font;
        /// first visible pixel-row is set from LyXScreen!!!
-       unsigned long first;
+       unsigned int first;
        ///
        BufferView * bv_owner;
        ///
@@ -158,7 +158,7 @@ public:
        ///
        Row * need_break_row;
        ///
-       mutable long refresh_y;
+       mutable int refresh_y;
        ///
        int refresh_height;
        ///
@@ -179,7 +179,7 @@ public:
          (relative to the whole text). y is set to the real beginning
          of this row
          */ 
-       Row * GetRowNearY(long & y) const;
+       Row * GetRowNearY(int & y) const;
        
        /** returns the column near the specified x-coordinate of the row 
         x is set to the real beginning of this column
@@ -191,7 +191,7 @@ public:
         of the row
         */
        Row * GetRow(LyXParagraph * par,
-                    LyXParagraph::size_type pos, long & y) const;
+                    LyXParagraph::size_type pos, int & y) const;
 
        /** returns the height of a default row, needed  for scrollbar
         */
@@ -271,10 +271,10 @@ public:
                         LyXFont const & font) const;
 
        ///
-       void SetCursorFromCoordinates(BufferView *, int x, long y) const;
+       void SetCursorFromCoordinates(BufferView *, int x, int y) const;
        ///
        void SetCursorFromCoordinates(BufferView *, LyXCursor &,
-                                     int x, long y) const;
+                                     int x, int y) const;
        ///
        void CursorUp(BufferView *) const;
        ///
@@ -330,7 +330,7 @@ public:
          solution but faster.
         */
        void GetVisibleRow(BufferView *, int y_offset, int x_offset,
-                          Row * row_ptr, long y, bool cleared=false);
+                          Row * row_ptr, int y, bool cleared=false);
 
 #ifndef NEW_INSETS
        /* footnotes: */
index 7cae85ba81a6874900fa74dd4f9575b7f46d4c21..6d7f75a58816dc32792a15f1ec35f1d66b8194fd 100644 (file)
@@ -56,9 +56,11 @@ LyXFont * Math_Fonts = 0; // this is only used by Whichfont and mathed_init_font
 
 static LyXFont::FONT_SIZE lfont_size = LyXFont::SIZE_NORMAL;
 
-// local global 
-static int sel_x, sel_y;
+// local global
+static int sel_x;
+static int sel_y;
 static bool sel_flag;
+
 MathedCursor * InsetFormula::mathcursor = 0; 
 
 
@@ -536,7 +538,8 @@ void InsetFormula::ToggleInsetCursor(BufferView * bv)
   if (!mathcursor)
     return;
 
-  int x, y;
+  int x;
+  int y;
   mathcursor->GetPos(x, y);
 //  x -= par->xo; 
   y -= par->yo; 
@@ -556,7 +559,8 @@ void InsetFormula::ShowInsetCursor(BufferView * bv)
 {
   if (!cursor_visible) {
     if (mathcursor) {
-      int x, y;
+      int x;
+      int y;
       mathcursor->GetPos(x, y);
       //  x -= par->xo; 
       y -= par->yo;
@@ -690,8 +694,7 @@ void InsetFormula::InsetMotionNotify(BufferView * bv,
        mathcursor->SelStart();
        ShowInsetCursor(bv); 
        mathcursor->GetPos(sel_x, sel_y);
-    } else
-      if (sel_flag) {
+    } else if (sel_flag) {
          HideInsetCursor(bv);
          x += par->xo;
          y += par->yo;
@@ -827,7 +830,10 @@ InsetFormula::LocalDispatch(BufferView * bv,
 //      break;
     case LFUN_SETXY:
       {
-        int x, y, x1, y1;
+        int x;
+        int y;
+        int x1;
+        int y1;
         istringstream ist(arg.c_str());
         ist >> x >> y;
         par->GetXY(x1, y1);
index b9068ca739488cd5744b9e51e9f28976713d09d9..7bdd91bdd638de7cd456f91b7743264e15e11733 100644 (file)
@@ -162,7 +162,8 @@ void MathedCursor::Redraw(Painter & pain)
        lyxerr[Debug::MATHED] << "Mathed: Redrawing!" << endl;
        par->Metrics();
        int w = par->Width(), h = par->Height();
-       int x, y;
+       int x;
+       int y;
        par->GetXY(x, y);
        //mathed_set_font(LM_TC_VAR, 1);
        pain.fillRectangle(x, y - par->Ascent(),
@@ -376,7 +377,7 @@ void MathedCursor::Insert(byte c, MathedTextCodes t)
       } else // Navigate between arguments
         if (p && p->GetType() == LM_OT_MACRO) {
             if (p->getArgumentIdx() < p->getMaxArgumentIdx()) {
-                p->setArgumentIdx(p->getArgumentIdx()+1);
+                p->setArgumentIdx(p->getArgumentIdx() + 1);
                 cursor->SetData(p);
                 return;
             }
@@ -499,7 +500,7 @@ bool MathedCursor::Up(bool sel)
        } else {
            result = (p->getArgumentIdx() > 0);
            if (result) {
-               p->setArgumentIdx(p->getArgumentIdx()-1);
+               p->setArgumentIdx(p->getArgumentIdx() - 1);
                cursor->SetData(p);
            }
        }
@@ -551,7 +552,7 @@ bool MathedCursor::Down(bool sel)
        } else {
            result = (p->getArgumentIdx() < p->getMaxArgumentIdx());
            if (result) {
-               p->setArgumentIdx(p->getArgumentIdx()+1);
+               p->setArgumentIdx(p->getArgumentIdx() + 1);
                cursor->SetData(p);
            }
        }
@@ -923,15 +924,25 @@ void MathedCursor::SelGetArea(int ** xp, int ** yp, int & np)
     }
     
     // single row selection
-    int i = 0, x, y, a, d, xo, yo, x1, y1, a1, d1;
+    int i = 0;
+    int a;
+    int d;
+    int a1;
+    int d1;
 
     // Balance anchor and cursor
     SelBalance();
  
+    int xo;
+    int yo;
     cursor->p->GetXY(xo, yo);
     int w = cursor->p->Width();
+    int x1;
+    int y1;
     cursor->GetPos(x1, y1);
     cursor->getAD(a1, d1);
+    int x;
+    int y;
     anchor->GetPos(x, y);
     anchor->getAD(a, d);
 
index 8ade1d3a5aeb36dd3f33073e6def38434f4980e1..609ad44e1c0dc353639dcbe17bfb2dfc3a07b131 100644 (file)
@@ -45,9 +45,9 @@ enum math_align {
        MATH_ALIGN_TOP = 8
 };
 ///
-#define MATH_COLSEP 8
+static int const MATH_COLSEP = 8;
 ///
-#define MATH_ROWSEP 8
+static int const MATH_ROWSEP = 8;
 
 
 /// Standard Math Sizes (Math mode styles)
@@ -358,20 +358,20 @@ class MathParInset: public MathedInset  {
     ///
     virtual void SetAlign(char, string const &) {}
     ///
-    virtual int GetColumns() { return 1; }
+    virtual int GetColumns() const { return 1; }
     ///
-    virtual int GetRows() { return 1; }
+    virtual int GetRows() const { return 1; }
     ///
-    virtual bool isMatrix() { return false; }
+    virtual bool isMatrix() const { return false; }
     // Vertical switching
     ///
     virtual bool setArgumentIdx(int i) { return (i == 0); }
     ///
     virtual bool setNextArgIdx() { return false; }
     ///
-    virtual int  getArgumentIdx() { return 0; }
+    virtual int getArgumentIdx() const { return 0; }
     ///
-    virtual int  getMaxArgumentIdx() { return 0; }
+    virtual int getMaxArgumentIdx() const { return 0; }
     ///
     virtual void SetStyle(short);
     ///
@@ -497,11 +497,11 @@ class MathMatrixInset: public MathParInset {
        return h_align;
     }
     ///
-    int GetColumns() { return nc; }
+    int GetColumns() const { return nc; }
     ///
-    int GetRows() { return nr; }
+    int GetRows() const { return nr; }
     ///
-    virtual bool isMatrix() { return true; }
+    virtual bool isMatrix() const { return true; }
 
     /// Use this to manage the extra information independently of paragraph
     MathedRowSt * getRowSt() const { return row; }
index 8373db25dc65c64066ab3049e61b7f1cf0474a6d..d677e1d1cad994c1c27671617195cb1e0af114aa 100644 (file)
@@ -84,8 +84,7 @@ MathParInset::draw(Painter & pain, int x, int y)
            int yy = y;
            MathedInset * p = data.GetInset();
            if (cx == LM_TC_UP) {
-              if (limits) {
-                 x -= (xp>p->Width()) ? p->Width()+(xp-p->Width())/2: xp;  
+              if (limits) {              x -= (xp>p->Width()) ? p->Width()+(xp-p->Width())/2: xp;  
                  yy -= (asc + p->Descent()+4);
               } else
                  yy -= (p->Descent()>asc) ? p->Descent()+4: asc;
index 1b374a866d7b25c2c94939a5936d0d52ec2065d8..0c1b0e22936e2788de4e7b9bfcff6ffd5c5359ca 100644 (file)
@@ -218,14 +218,14 @@ public:
        ///
        bool setArgumentIdx(int i); // was bool Up/down(void);
        ///
-       int  getArgumentIdx() { return int(idx); }
+       int getArgumentIdx() const { return idx; }
        ///
-       int  getMaxArgumentIdx() { return 1; }
+       int getMaxArgumentIdx() const { return 1; }
        ///
        void  SetStyle(short);
 protected:
        ///
-       short idx;
+       int idx;
        ///
        MathParInset * den;
        ///
index f1e98866401be8d70c9559d99d69e14169c975ac..86d2ef94544bc0faa6e433a7c3e3c49a2c5dd276 100644 (file)
@@ -546,7 +546,8 @@ void MathedXIter::Merge(LyxArrayBase *a0)
 //-----------  XIter
 
 
-MathedXIter::MathedXIter(MathParInset* pp): p(pp) 
+MathedXIter::MathedXIter(MathParInset * pp)
+       : p(pp) 
 { 
     x = y = 0;
     sx = sw = 0;   
@@ -560,7 +561,7 @@ MathedXIter::MathedXIter(MathParInset* pp): p(pp)
     }
 }
 
-void MathedXIter::SetData(MathParInset *pp)
+void MathedXIter::SetData(MathParInset * pp)
 {
     p = pp;
     x = y = 0;
@@ -843,14 +844,15 @@ void MathedXIter::ipop()
 
 void MathedXIter::fitCoord(int /*xx*/, int yy)
 {
-    int xo = 0, yo = 0;
+    int xo = 0;
+    int yo = 0;
     
     GoBegin();
     if (p) 
       p->GetXY(xo, yo);
     // first fit vertically
     while (crow && OK()) {
-       if (yy>= yo+y-crow->asc && yy<= yo+y+crow->desc) 
+       if (yy >= yo + y - crow->asc && yy <= yo + y + crow->desc) 
          break;
        goNextCode(LM_TC_CR);
        Next();
@@ -859,6 +861,7 @@ void MathedXIter::fitCoord(int /*xx*/, int yy)
 //    while (x<xx && Next());
 }
 
+
 void MathedXIter::setTab(int tx, int tab)
 {
     if (crow && tab<= ncols) {
@@ -881,11 +884,13 @@ void MathedXIter::subMetrics(int a, int d)
 
 
 // This function is not recursive, as MathPar::Metrics is
-void MathedXIter::IMetrics(int pos2, int& width, int& ascent, int& descent)
+void MathedXIter::IMetrics(int pos2, int & width, int & ascent, int & descent)
 {  
-       byte cx, cxp= 0;// *s;
-       int x1;// ls;
-    int asc= 0, des= 0;
+    byte cx;
+    byte cxp = 0; // *s;
+    int x1; // ls;
+    int asc = 0;
+    int des = 0;
     bool limit = false;
   
     descent = ascent = width = 0;
@@ -905,20 +910,22 @@ void MathedXIter::IMetrics(int pos2, int& width, int& ascent, int& descent)
            MathedInset *pp = GetInset();
            if (cx == LM_TC_UP) {
                if (!asc && p) {
-                   int xx, yy;
+                   int xx;
+                   int yy;
                    p->GetXY(xx, yy);
                    static_cast<MathParInset*>(pp)->GetXY(xx, asc);
                    asc = yy - asc;
                }
-               asc += ((limits) ? pp->Height()+4: pp->Ascent());
+               asc += ((limits) ? pp->Height() + 4 : pp->Ascent());
            } else
              if (cx == LM_TC_DOWN) {
                  if (!des && p) {
-                     int xx, yy;
+                     int xx;
+                     int yy;
                      p->GetXY(xx, yy);
                      static_cast<MathParInset*>(pp)->GetXY(xx, des);
-                     if (des-pp->Height()<yy && !asc)
-                       asc = yy - (des-pp->Height());
+                     if (des - pp->Height() < yy && !asc)
+                       asc = yy - (des - pp->Height());
                      des -= yy;
                  }
                  des += (limit ? pp->Height()+4: pp->Height()-pp->Ascent()/2);
index 84f0d76e820580d14d18bc1e414d8796a9e4db5d..9261ab3d2f4b1270e0c602d5c58b0f4b3669b909 100644 (file)
@@ -352,16 +352,18 @@ void MathedXIter::GetPos(int & xx, int & yy) const
 inline 
 int MathedXIter::GetX() const
 { 
-    int xx, yy;
-    GetPos(xx, yy);
+    int xx;
+    int dummy_y;
+    GetPos(xx, dummy_y);
     return xx; 
 }
 
 inline 
 int MathedXIter::GetY() const
 { 
-    int xx, yy;
-    GetPos(xx, yy);
+    int dummy_x;
+    int yy;
+    GetPos(dummy_x, yy);
     return yy; 
 }
 
index 6b7313341e85e2b8f1992066650360d8f6c00a79..3f88d4790758a8586d9fbdac420b639e62cf57f9 100644 (file)
@@ -128,12 +128,13 @@ void MathMacro::draw(Painter & pain, int x, int y)
     tmplate->update(this);
     tmplate->SetStyle(size);
     tmplate->draw(pain, x, y);
-    for (int i = 0; i < nargs; ++i)
-      tmplate->GetMacroXY(i, args[i].x, args[i].y);
+    for (int i = 0; i < nargs; ++i) {
+           tmplate->GetMacroXY(i, args[i].x, args[i].y);
+    }
 }
 
 
-int MathMacro::GetColumns()
+int MathMacro::GetColumns() const
 {
     return tmplate->getMacroPar(idx)->GetColumns();
 }
@@ -321,7 +322,7 @@ void MathMacroTemplate::draw(Painter & pain, int x, int y)
 
 void MathMacroTemplate::Metrics()
 {
-    bool expnd = (nargs>0) ? args[0].getExpand(): false;
+    bool expnd = (nargs > 0) ? args[0].getExpand(): false;
     
     if (flags & MMF_Edit) {
        for (int i = 0; i < nargs; ++i) {
@@ -342,12 +343,12 @@ void MathMacroTemplate::Metrics()
 
 void MathMacroTemplate::update(MathMacro * macro)
 {
-    int idx = (macro) ? macro->getArgumentIdx(): 0;
+    int idx = (macro) ? macro->getArgumentIdx() : 0;
     for (int i = 0; i < nargs; ++i) {
        if (macro) {
            macro->setArgumentIdx(i);
            args[i].SetData(macro->GetData());
-           MathedRowSt *row = macro->getRowSt();
+           MathedRowSt * row = macro->getRowSt();
            args[i].setRowSt(row);
        }
     }  
index 800cf83c55aa87ecceb7297a17095c169a4a9a80..a4d14bc49f4ffbf1a48c0743c8cf3be14de6cf8a 100644 (file)
@@ -55,11 +55,11 @@ public:
     ///
     bool setArgumentIdx(int);
     ///
-    int  getArgumentIdx();
+    int getArgumentIdx() const;
     ///
-    int  getMaxArgumentIdx();
+    int getMaxArgumentIdx() const;
     ///
-    int GetColumns();
+    int GetColumns() const;
     ///
     void GetXY(int &, int &) const;
     ///
@@ -71,7 +71,7 @@ public:
     ///
     void SetData(LyxArrayBase *);
     ///
-    MathedTextCodes getTCode() { return tcode; }
+    MathedTextCodes getTCode() const { return tcode; }
     ///
     bool Permit(short);
     
@@ -128,7 +128,7 @@ public:
     /// Is expanded or not
     void setExpand(bool e) { expnd_mode = e; }
     /// Is expanded or not
-    bool getExpand() { return expnd_mode; }
+    bool getExpand() const { return expnd_mode; }
 private:
     ///
     bool expnd_mode;
@@ -154,11 +154,11 @@ public:
     /// useful for special insets
     void  setTCode(MathedTextCodes t) { tcode = t; }
     ///
-    MathedTextCodes getTCode() { return tcode; }
+    MathedTextCodes getTCode() const { return tcode; }
     /// 
     void setArgument(LyxArrayBase *, int i= 0);
     /// Number of arguments
-    int getNoArgs() { return nargs; }
+    int getNoArgs() const { return nargs; }
     ///
     void GetMacroXY(int, int &, int &) const;
     ///
@@ -235,13 +235,13 @@ bool MathMacro::setArgumentIdx(int i)
 }
 
 inline
-int  MathMacro::getArgumentIdx() 
+int MathMacro::getArgumentIdx() const 
 { 
     return idx; 
 }
 
 inline
-int  MathMacro::getMaxArgumentIdx() 
+int MathMacro::getMaxArgumentIdx() const 
 { 
     return nargs - 1; 
 } 
index 26a88be831304d3bfcb4a6e9dadd8101c59812b9..ae85eaa062aba48da6e6882450048080228cd177 100644 (file)
@@ -542,7 +542,7 @@ LyxArrayBase * mathed_parse(unsigned flags, LyxArrayBase * array,
       
     case '&':    // Tab
       {
-        if ((flags & FLAG_END) && mt && data.getCol()<mt->GetColumns()-1) {
+        if ((flags & FLAG_END) && mt && data.getCol()<mt->GetColumns() - 1) {
             data.setNumCols(mt->GetColumns());
             data.Insert('T', LM_TC_TAB);
         } else 
@@ -557,7 +557,7 @@ LyxArrayBase * mathed_parse(unsigned flags, LyxArrayBase * array,
          if (mt && (flags & FLAG_END)) {
              if (mt->Permit(LMPF_ALLOW_CR)) {
                  if (crow) {
-                         crow->setNext(new MathedRowSt(mt->GetColumns()+1)); // this leaks
+                         crow->setNext(new MathedRowSt(mt->GetColumns() + 1)); // this leaks
                      crow = crow->getNext();
                  }
                  data.Insert('K', LM_TC_CR);
index 5a8aa95bc48e4d686ba0015f4878085760f08762..cdeae572335d7d5dfce406509ad65e1dce8e362a 100644 (file)
@@ -53,11 +53,11 @@ public:
     ///
     bool setArgumentIdx(int i);
     ///
-    int  getArgumentIdx() { return idx; }
+    int getArgumentIdx() const { return idx; }
     ///
-    int  getMaxArgumentIdx() { return 1; }
+    int getMaxArgumentIdx() const { return 1; }
     ///
-    void  SetStyle(short);
+    void SetStyle(short);
 
 protected:
     ///
index 38effb1e19b64b285c19f72be1e8c128f4772644..477dba02798724c8505d9ff8b753a02907fb06c5 100644 (file)
@@ -86,15 +86,16 @@ void LyXScreen::expose(int x, int y, int exp_width, int exp_height)
 }
 
 
-void LyXScreen::DrawFromTo(LyXText * text, int y1, int y2, int y_offset, int x_offset)
+void LyXScreen::DrawFromTo(LyXText * text,
+                          int y1, int y2, int y_offset, int x_offset)
 {
-       long y_text = text->first + y1;
+       int y_text = text->first + y1;
    
        // get the first needed row 
        Row * row = text->GetRowNearY(y_text);
        // y_text is now the real beginning of the row
    
-       long y = y_text - text->first;
+       int y = y_text - text->first;
        // y1 is now the real beginning of row on the screen
        
        while (row != 0 && y < y2) {
@@ -120,13 +121,13 @@ void LyXScreen::DrawFromTo(LyXText * text, int y1, int y2, int y_offset, int x_o
 }
 
 
-void LyXScreen::DrawOneRow(LyXText * text, Row * row, long y_text,
+void LyXScreen::DrawOneRow(LyXText * text, Row * row, int y_text,
                           int y_offset, int x_offset)
 {
-       long y = y_text - text->first + y_offset;
+       int y = y_text - text->first + y_offset;
       
        if (y + row->height() > 0
-           && y - row->height() <= long(owner.height())) {
+           && y - row->height() <= owner.height()) {
                // ok there is something visible
                LyXText::text_status st = text->status;
                do {
@@ -142,11 +143,11 @@ void LyXScreen::DrawOneRow(LyXText * text, Row * row, long y_text,
 
 /* draws the screen, starting with textposition y. uses as much already
 * printed pixels as possible */
-void LyXScreen::Draw(LyXText * text, unsigned long y)
+void LyXScreen::Draw(LyXText * text, unsigned int y)
 {
        if (cursor_visible) HideCursor();
 
-       unsigned long old_first = text->first;
+       unsigned int old_first = text->first;
        text->first = y;
 
        // is any optimiziation possible?
@@ -215,20 +216,20 @@ void LyXScreen::ShowCursor(LyXText const * text)
 
 /* returns true if first has changed, otherwise false */ 
 bool LyXScreen::FitManualCursor(LyXText * text,
-                               long /*x*/, long y, int asc, int desc)
+                               int /*x*/, int y, int asc, int desc)
 {
-       long newtop = text->first;
+       int newtop = text->first;
   
        if (y + desc - text->first >= owner.height())
                newtop = y - 3 * owner.height() / 4;  // the scroll region must be so big!!
-       else if (y - asc < long(text->first)
+       else if (y - asc < text->first
                && text->first > 0) {
                newtop = y - owner.height() / 4;
        }
 
-       newtop = max(newtop, 0L); // can newtop ever be < 0? (Lgb)
+       newtop = max(newtop, 0); // can newtop ever be < 0? (Lgb)
   
-       if (newtop != long(text->first)) {
+       if (newtop != text->first) {
                Draw(text, newtop);
                text->first = newtop;
                return true;
@@ -237,13 +238,13 @@ bool LyXScreen::FitManualCursor(LyXText * text,
 }
 
 
-void LyXScreen::ShowManualCursor(LyXText const * text, long x, long y,
+void LyXScreen::ShowManualCursor(LyXText const * text, int x, int y,
                                 int asc, int desc, Cursor_Shape shape)
 {
-       unsigned long y1 = max(y - text->first - asc, 0UL);
-       typedef unsigned long ulong;
+       unsigned int y1 = max(y - text->first - asc, 0U);
+       typedef unsigned int uint;
        
-       unsigned long y2 = min(y - text->first + desc, ulong(owner.height()));
+       unsigned int y2 = min(y - text->first + desc, owner.height());
 
        // Secure against very strange situations
        y2 = max(y2, y1);
@@ -342,9 +343,9 @@ void LyXScreen::CursorToggle(LyXText const * text)
 
 
 /* returns a new top so that the cursor is visible */ 
-unsigned long LyXScreen::TopCursorVisible(LyXText const * text)
+unsigned int LyXScreen::TopCursorVisible(LyXText const * text)
 {
-       long newtop = text->first;
+       int newtop = text->first;
 
        if (text->cursor.y()
            - text->cursor.row()->baseline()
@@ -365,11 +366,11 @@ unsigned long LyXScreen::TopCursorVisible(LyXText const * text)
                        newtop = text->cursor.y() - text->cursor.row()->baseline();
                else {
                        newtop = text->cursor.y() - owner.height() / 4;
-                       newtop = min(newtop, long(text->first));
+                       newtop = min(newtop, int(text->first));
                }
        }
 
-       newtop = max(newtop, 0L);
+       newtop = max(newtop, 0);
 
        return newtop;
 }
@@ -380,7 +381,7 @@ unsigned long LyXScreen::TopCursorVisible(LyXText const * text)
 bool LyXScreen::FitCursor(LyXText * text)
 {
        // Is a change necessary?
-       unsigned long newtop = TopCursorVisible(text);
+       unsigned int newtop = TopCursorVisible(text);
        bool result = (newtop != text->first);
        if (result)
                Draw(text, newtop);
@@ -393,7 +394,7 @@ void LyXScreen::Update(LyXText * text, int y_offset, int x_offset)
        switch(text->status) {
        case LyXText::NEED_MORE_REFRESH:
        {
-               long y = max(text->refresh_y - long(text->first), 0L);
+               int y = max(int(text->refresh_y - text->first), 0);
                int height;
                if (text->inset_owner)
                        height = text->inset_owner->ascent(owner.owner(),
@@ -433,11 +434,11 @@ void LyXScreen::ToggleSelection(LyXText * text,  bool kill_selection,
        // only if there is a selection
        if (!text->selection) return;
 
-       long bottom = min(max(text->sel_end_cursor.y()
+       int bottom = min(max(text->sel_end_cursor.y()
                              - text->sel_end_cursor.row()->baseline()
                              + text->sel_end_cursor.row()->height(), text->first),
                          text->first + owner.height());
-       long top = min(max(text->sel_start_cursor.y()
+       int top = min(max(text->sel_start_cursor.y()
                           - text->sel_start_cursor.row()->baseline(), text->first),
                       text->first + owner.height());
 
@@ -457,16 +458,16 @@ void LyXScreen::ToggleToggle(LyXText * text, int y_offset, int x_offset)
            && text->toggle_cursor.pos() == text->toggle_end_cursor.pos())
                return;
        
-       long top = text->toggle_cursor.y()
+       int top = text->toggle_cursor.y()
                - text->toggle_cursor.row()->baseline();
-       long bottom = text->toggle_end_cursor.y()
+       int bottom = text->toggle_end_cursor.y()
                - text->toggle_end_cursor.row()->baseline() 
                + text->toggle_end_cursor.row()->height();
        
-       typedef unsigned long ulong;
+       typedef unsigned int uint;
        
-       bottom = min(max(ulong(bottom), text->first), text->first + owner.height());
-       top = min(max(ulong(top), text->first), text->first + owner.height());
+       bottom = min(max(uint(bottom), text->first), text->first + owner.height());
+       top = min(max(uint(top), text->first), text->first + owner.height());
 
        DrawFromTo(text, top - text->first, bottom - text->first, y_offset,
                   x_offset);
index f9f462d91692df1439b020e05617c330d393be70..241dc31524ece2aee99b0f759cfb5d7270f4efc0 100644 (file)
@@ -5,7 +5,7 @@
 
 #ifdef CXX_WORKING_NAMESPACES
 namespace lyx {
-       int kill(long int pid, int sig)
+       int kill(int pid, int sig)
        {
                return ::kill(pid, sig);
        }
@@ -13,7 +13,7 @@ namespace lyx {
 #else
 #include "lyxlib.h"
 
-int lyx::kill(long int pid, int sig)
+int lyx::kill(int pid, int sig)
 {
        return ::kill(pid, sig);
 }
index 4d8deccf390f66bd873c0cbd0c44b3d03a66f747..acaa2b0e4eb70f065d89683d6d8f0ddb5f25791a 100644 (file)
@@ -43,7 +43,7 @@ namespace lyx {
        /// returns the name of the user (not used currently)
        string const getUserName();
        ///
-       int kill(long int pid, int sig);
+       int kill(int pid, int sig);
        ///
        void abort();
         ///
@@ -81,7 +81,7 @@ struct lyx {
        /// returns the name of the user (not used currently)
        static string const getUserName();
        ///
-       static int kill(long int pid, int sig);
+       static int kill(int pid, int sig);
        ///
        static void abort();
        ///
index aa793d5d10878ea3aa1cb812821d39d1164193c7..9457af664d9c44801b168f35f2128c0ead438dee 100644 (file)
@@ -1281,7 +1281,7 @@ void LyXText::SetHeightOfRow(BufferView * bview, Row * row_ptr) const
 
    /* this must not happen before the currentrow for clear reasons.
       so the trick is just to set the current row onto this row */
-   long unused_y;
+   int unused_y;
    GetRow(row_ptr->par(), row_ptr->pos(), unused_y);
 
    /* ok , let us initialize the maxasc and maxdesc value. 
@@ -1962,7 +1962,7 @@ void LyXText::InsertChar(BufferView * bview, char c)
 
        // get the cursor row fist
        Row * row = cursor.row();
-       long y = cursor.y() - row->baseline();
+       int y = cursor.y() - row->baseline();
        if (c != LyXParagraph::META_INSET) /* Here case LyXText::InsertInset 
                                            * already insertet the character */
                cursor.par()->InsertChar(cursor.pos(), c);
@@ -2780,7 +2780,7 @@ void LyXText::Backspace(BufferView * bview)
                }
                
                Row * row = cursor.row();
-               long y = cursor.y() - row->baseline();
+               int y = cursor.y() - row->baseline();
                LyXParagraph::size_type z;
                /* remember that a space at the end of a row doesnt count
                 * when calculating the fill */ 
@@ -2945,7 +2945,7 @@ void LyXText::Backspace(BufferView * bview)
 
 
 void LyXText::GetVisibleRow(BufferView * bview, int y_offset, int x_offset,
-                           Row * row_ptr, long y, bool cleared)
+                           Row * row_ptr, int y, bool cleared)
 {
        /* returns a printed row */
        Painter & pain = bview->painter();
@@ -3056,16 +3056,16 @@ void LyXText::GetVisibleRow(BufferView * bview, int y_offset, int x_offset,
                                                           sel_end_cursor.x(),
                                                           row_ptr->height(),
                                                           LColor::selection);
-                       } else if (y > long(sel_start_cursor.y())
-                                  && y < long(sel_end_cursor.y())) {
+                       } else if (y > sel_start_cursor.y()
+                                  && y < sel_end_cursor.y()) {
                                pain.fillRectangle(x_offset, y_offset, w,
                                                   row_ptr->height(),
                                                   LColor::selection);
                        }
                } else if ( sel_start_cursor.row() != row_ptr &&
                            sel_end_cursor.row() != row_ptr &&
-                           y > long(sel_start_cursor.y())
-                           && y < long(sel_end_cursor.y())) {
+                           y > sel_start_cursor.y()
+                           && y < sel_end_cursor.y()) {
                        pain.fillRectangle(x_offset, y_offset, w,
                                           row_ptr->height(),
                                           LColor::selection);
@@ -3973,7 +3973,7 @@ void LyXText::InsertFootnoteEnvironment(BufferView * bview,
 
 // returns pointer to a specified row
 Row * LyXText::GetRow(LyXParagraph * par,
-                     LyXParagraph::size_type pos, long & y) const
+                     LyXParagraph::size_type pos, int & y) const
 {
        Row * tmprow = firstrow;
        y = 0;
index 24f1f000dcde2dc4acddc485b4b01c52c1a37282..8836bccca5ba1bfe941f8a9cfa2930966de4116c 100644 (file)
@@ -345,7 +345,7 @@ void LyXText::RemoveRow(Row * row) const
        /* this must not happen before the currentrow for clear reasons.
           so the trick is just to set the current row onto the previous
           row of this row */
-       long unused_y;
+       int unused_y;
        GetRow(row->par(), row->pos(), unused_y);
    
        if (row->next())
@@ -941,7 +941,7 @@ void LyXText::SetFont(BufferView * bview, LyXFont const & font, bool toggleall)
 void LyXText::RedoHeightOfParagraph(BufferView * bview, LyXCursor const & cur)
 {
        Row * tmprow = cur.row();
-       long y = cur.y() - tmprow->baseline();
+       int y = cur.y() - tmprow->baseline();
 
        SetHeightOfRow(bview, tmprow);
 #ifndef NEW_INSETS
@@ -975,7 +975,7 @@ void LyXText::RedoDrawingOfParagraph(BufferView * bview, LyXCursor const & cur)
 {
        Row * tmprow = cur.row();
    
-       long y = cur.y() - tmprow->baseline();
+       int y = cur.y() - tmprow->baseline();
        SetHeightOfRow(bview, tmprow);
 #ifndef NEW_INSETS
        LyXParagraph * first_phys_par = tmprow->par()->FirstPhysicalPar();
@@ -1014,7 +1014,7 @@ void LyXText::RedoParagraphs(BufferView * bview, LyXCursor const & cur,
    
        Row * tmprow = cur.row();
    
-       long y = cur.y() - tmprow->baseline();
+       int y = cur.y() - tmprow->baseline();
    
        if (!tmprow->previous()){
                first_phys_par = FirstParagraph();   // a trick/hack for UNDO
@@ -1247,10 +1247,10 @@ void  LyXText::CursorBottom(BufferView * bview) const
 /* returns a pointer to the row near the specified y-coordinate
 * (relative to the whole text). y is set to the real beginning
 * of this row */
-Row * LyXText::GetRowNearY(long & y) const
+Row * LyXText::GetRowNearY(int & y) const
 {
        Row * tmprow = firstrow;
-       long tmpy = 0;
+       int tmpy = 0;
 
        while (tmprow->next() && tmpy + tmprow->height() <= y) {
                tmpy += tmprow->height();
@@ -2651,7 +2651,7 @@ void LyXText::CheckParagraph(BufferView * bview, LyXParagraph * par,
 {
        LyXCursor tmpcursor;                    
 
-       long y = 0;
+       int y = 0;
        LyXParagraph::size_type z;
        Row * row = GetRow(par, pos, y);
        
@@ -2799,7 +2799,7 @@ void LyXText::SetCursor(BufferView *bview, LyXCursor & cur, LyXParagraph * par,
        cur.boundary(boundary);
 
        /* get the cursor y position in text  */
-       long y = 0;
+       int y = 0;
        Row * row = GetRow(par, pos, y);
        /* y is now the beginning of the cursor row */ 
        y += row->baseline();
@@ -2918,7 +2918,7 @@ void LyXText::SetCurrentFont(BufferView * bview) const
 }
 
 
-void LyXText::SetCursorFromCoordinates(BufferView * bview, int x, long y) const
+void LyXText::SetCursorFromCoordinates(BufferView * bview, int x, int y) const
 {
        LyXCursor old_cursor = cursor;
    
@@ -2940,7 +2940,7 @@ void LyXText::SetCursorFromCoordinates(BufferView * bview, int x, long y) const
 
 
 void LyXText::SetCursorFromCoordinates(BufferView * bview, LyXCursor & cur,
-                                      int x, long y) const
+                                      int x, int y) const
 {
        /* get the row first */