]> git.lyx.org Git - features.git/commitdiff
Insets cleanup patch from Angus
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 17 Oct 2000 09:14:34 +0000 (09:14 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 17 Oct 2000 09:14:34 +0000 (09:14 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1127 a592a061-630c-0410-9148-cb99ea01b6c8

13 files changed:
ChangeLog
lib/CREDITS
po/POTFILES.in
src/combox.C
src/combox.h
src/frontends/xforms/FormDocument.C
src/insets/Makefile.am
src/insets/insetbutton.C
src/insets/insetcite.C
src/insets/insettabular.C
src/insets/insettabular.h
src/insets/insettext.C
src/insets/insettext.h

index 2bdc896f9ee079b05bf6b9324d6a3faae3cea0e7..244290d91741b0632f671b1d05149aebbfbb59c9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,40 @@
-2000-10-17  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
+2000-10-17  Angus Leeming <a.leeming@ic.ac.uk>
+
+       * lib/CREDITS: clean up
+
+2000-10-16  Angus Leeming <a.leeming@ic.ac.uk>
+
+       * src/combox.[Ch] (select): changed argument back to int
+       * src/combox.C (peek_event): removed num_bytes as it is declared but
+       never referenced.
+
+       * src/frontends/xforms/FormDocument.C (class_apply, bullets_apply):
+       modified calls to Combox::select() to remove warnings about type
+       conversion.
+
+       * src/insets/insetbutton.C (width): explicit cast to remove warning
+       about type conversion.
+
+       * src/insets/insetcite.C (getScreenLabel): use string::size_type not
+       size_t.
+
+       * src/insets/insettabular.[Ch]: variables inset_pos, sel_pos_start and
+       sel_pos_end, refering to cursor position are changed to
+       LyXParagraph::size_type.
+
+       * src/insets/insettext.h (cpos): returns LyXParagraph::size_type,
+       consistent with LyXCursor::pos().
+       (inset_pos): changed to LyXParagraph::size_type for same reason.
+
+       * src/insets/insettext.C (resizeLyXText): changed some temporary
+       variables refing to cursor position to LyXParagraph::size_type.
+
 2000-10-16  John Levon  <moz@compsoc.man.ac.uk>
 
        * src/frontends/kde/<various>: The Great Renaming,
        add FormParagraph
 
+2000-10-17  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
 
        * src/frontends/support/Makefile.am (EXTRA_DIST): re-fix.
 
 2000-10-13  Dekel Tsur  <dekelts@tau.ac.il>
 
        * src/text.C (GetColumnNearX): Fixed disabled code.
-                           
+
 2000-10-13  Lars Gullik Bjønnes  <larsbj@lyx.org>
 
        * configure.in (CPPFLAGS): add snprintf and vsnprintf to
        * src/insets/insetbutton.C (width): Changed to work with no GUI.
        * src/insets/insetbib.C (bibitemWidest): ditto.
        * src/lyx_gui_misc.C (AskQuestion,AskConfirmation,askForText): ditto.
-            
+
 2000-10-03  Juergen Vigna  <jug@sad.it>
 
        * src/BufferView2.C (theLockingInset): removed const because of
        * src/frontends/xforms/Toolbar_pimpl.C: 
        * src/lyx_cb.C (LayoutsCB): added Combox * to function call.
 
-2000-09-14  Garst Reese    <reese@isn.net>
+2000-09-14  Garst Reese  <reese@isn.net>
 
        * lib/tex/hollywood.cls changed length of parenthicals to 1.5in
        moved usepackage{xxx}'s to beginning of file. Changed left margin
        * src/lyxrc.C, src/lyxrc.h, src/BufferView_pimpl.C,
        lib/lyxrc.example: added option \wheel_jump
 
-2000-07-04   R. Lahaye  <lahaye@postech.ac.kr>
+2000-07-04  R. Lahaye  <lahaye@postech.ac.kr>
 
        * src/lyx_gui.C src/lyx_main.C: add support for -geometry, and
        remove support for -width,-height,-xpos and -ypos.
index 07598646f8339e3a36a1ec4ead8fccfcb2052e8b..45196a72471b12cfeeb7bd3d9a901f1fc01b681b 100644 (file)
 @bJohn Levon
 @iE-mail moz@compsoc.man.ac.uk
    KDE port
-@bJose' Matos
+@bJosé Matos
 @iE-mail: jamatos@novalis.fc.up.pt
    linuxdoc sgml support
 @bTino Meinen
 @bAndre Spiegel
 @iE-mail: spiegel@inf.fu-berlin.de
    vertical spaces
-@bDavid Sua'rez de Lis
+@bDavid Suárez de Lis
 @iE-mail: excalibor@iname.com
    maintaining es.po since v1.0.0 and other small i18n issues
    small fixes (some work, others didn't)
index 4047389a2143abe830c04df59ac859ef95d800c8..8579bdd0f0f76c28feaf4a3e81710e08e6194973 100644 (file)
@@ -24,20 +24,28 @@ src/frontends/gnome/FormRef.C
 src/frontends/gnome/FormToc.C
 src/frontends/gnome/FormUrl.C
 src/frontends/gnome/Menubar_pimpl.C
+src/frontends/kde/citationdlg.C
+src/frontends/kde/copyrightdlgdata.C
 src/frontends/kde/FormCitation.C
-src/frontends/kde/formcitationdialog.C
 src/frontends/kde/FormCopyright.C
-src/frontends/kde/formcopyrightdialogdata.C
 src/frontends/kde/FormIndex.C
-src/frontends/kde/formindexdialog.C
+src/frontends/kde/FormParagraph.C
 src/frontends/kde/FormPrint.C
-src/frontends/kde/formprintdialogdata.C
 src/frontends/kde/FormRef.C
-src/frontends/kde/formrefdialog.C
 src/frontends/kde/FormToc.C
-src/frontends/kde/formtocdialog.C
 src/frontends/kde/FormUrl.C
-src/frontends/kde/formurldialog.C
+src/frontends/kde/indexdlg.C
+src/frontends/kde/indexdlgdata.C
+src/frontends/kde/paradlg.C
+src/frontends/kde/paraextradlg.C
+src/frontends/kde/paraextradlgdata.C
+src/frontends/kde/parageneraldlg.C
+src/frontends/kde/parageneraldlgdata.C
+src/frontends/kde/printdlg.C
+src/frontends/kde/printdlgdata.C
+src/frontends/kde/refdlg.C
+src/frontends/kde/tocdlg.C
+src/frontends/kde/urldlg.C
 src/frontends/xforms/FormBase.h
 src/frontends/xforms/FormCitation.C
 src/frontends/xforms/form_citation.C
index 3f57d01d127adfcf64657b80affb3be72204800b..bee3d125049555fc97abc4c2a8a7209957bf54a5 100644 (file)
@@ -142,7 +142,7 @@ bool Combox::select_text(string const & t)
 }
 
 
-void Combox::select(size_t i)
+void Combox::select(int i)
 {
        if (!browser || !button) return;
        if (i > 0 && i <= fl_get_browser_maxline(browser)) sel = i; 
@@ -391,10 +391,9 @@ int Combox::peek_event(FL_FORM * form, void * xev)
        if (static_cast<XEvent*>(xev)->type != KeyPress) return 0;
        
        char s_r[10]; s_r[9] = '\0';
-       static int num_bytes;
        KeySym keysym_return;
-       num_bytes = XLookupString(&static_cast<XEvent*>(xev)->xkey, s_r, 10, 
-                                 &keysym_return, 0);
+       XLookupString(&static_cast<XEvent*>(xev)->xkey, s_r, 10, 
+                             &keysym_return, 0);
        XFlush(fl_get_display());
        switch (keysym_return) {
        case XK_Down:
index e37f6cd4ae7fa3e08aa9c5afe3af136fb19fcb0a..b4f78df680adec285769c81fbde463e649fb0131 100644 (file)
@@ -75,7 +75,7 @@ public:
        string const getline() const;
    
        ///  Select an arbitrary item
-       void select(size_t);
+       void select(int);
        ///
         bool select_text(string const &);
    
index 43594f30bb294c81068f6b67f127b845922f6eb7..27511bf231614ca9ba110148d9876d1c415df07b 100644 (file)
@@ -425,7 +425,7 @@ bool FormDocument::class_apply()
                                   _("Errors loading new document class."),
                                   _("Reverting to original document class."));
 #ifdef USE_CLASS_COMBO
-                       combo_doc_class->select(params.textclass + 1);
+                       combo_doc_class->select(int(params.textclass) + 1);
 #else
                        fl_set_choice(class_->choice_doc_class,
                                      params.textclass + 1);
@@ -1081,7 +1081,7 @@ void FormDocument::CheckChoiceClass(FL_OBJECT * ob, long)
                   _("Unable to switch to new document class."),
                   _("Reverting to original document class."));
 #ifdef USE_CLASS_COMBO
-       combo_doc_class->select(lv_->buffer()->params.textclass + 1);
+       combo_doc_class->select(int(lv_->buffer()->params.textclass) + 1);
 #else
        fl_set_choice(class_->choice_doc_class, 
                      lv_->buffer()->params.textclass + 1);
index a66dec59e5d81a3ae2b2c0f9d9c168c2894a8665..89a70b885ddd51d622327e048604ac532fc9bce0 100644 (file)
@@ -72,10 +72,10 @@ libinsets_la_SOURCES = \
        insetspecialchar.h \
        insettabular.C \
        insettabular.h \
-       insettheorem.C \
-       insettheorem.h \
        insettext.C \
        insettext.h \
+       insettheorem.C \
+       insettheorem.h \
        insettoc.C \
        insettoc.h \
        inseturl.C \
index a8a75095e9efcaf83978ae7abcfce2ea13a7c309..999984dbdac5883f53718b533090b8be7124ad65 100644 (file)
@@ -71,7 +71,7 @@ int InsetButton::width(BufferView * bv, LyXFont const &) const
        int width, ascent, descent;
         string s = getScreenLabel();
        if (!bv)
-               return s.length();
+               int(s.length());
        
         if (Editable()) {
                bv->painter().buttonText(0, 0, s, font,
index a74989a400a74f54a38111e36e15d8e3e879e502..eea8607b70bcdea615fddb0ed59651beb9fb8079 100644 (file)
@@ -34,12 +34,12 @@ string const InsetCitation::getScreenLabel() const
                // Final comma allows while loop to cover all keys
                keys = frontStrip(split(keys, label, ',')) + ",";
 
-               size_t const maxSize = 40;
+               string::size_type const maxSize = 40;
                while (contains( keys, "," )) {
                        string key;
                        keys = frontStrip(split(keys, key, ','));
 
-                       size_t size = label.size() + 2 + key.size();
+                       string::size_type size = label.size() + 2 + key.size();
                        if( size >= maxSize ) {
                                label += ", ...";
                                break;
index 608b25448a7fea8a798a96c7a628e5b407255963..6e47e90b13b9472d95c69fc8bf062d9d16889512 100644 (file)
@@ -660,7 +660,7 @@ void InsetTabular::InsetMotionNotify(BufferView * bv, int x, int y, int button)
     }
     if (!no_selection) {
        HideInsetCursor(bv);
-       int const old_pos = sel_pos_end;
+       LyXParagraph::size_type const old_pos = sel_pos_end;
        int const old_cell = actcell;
 
        setPos(bv, x, y);
index ad1807de1d2b6e3a73a7959f00b02542b112fae7..9cece3c8903570727e6fa74a485d38d5c2419318 100644 (file)
@@ -241,15 +241,15 @@ private:
     ///
     mutable LyXCursor old_cursor;
     ///
-    mutable int inset_pos;
+    mutable LyXParagraph::size_type inset_pos;
     ///
     mutable unsigned int inset_x;
     ///
     mutable unsigned int inset_y;
     ///
-    mutable int sel_pos_start;
+    mutable LyXParagraph::size_type sel_pos_start;
     ///
-    mutable int sel_pos_end;
+    mutable LyXParagraph::size_type sel_pos_end;
     ///
     mutable int sel_cell_start;
     ///
index 733f448ed15f4940ccd6069436f51b8087b735e1..21285dbe8a5cce64a1fff4199acd62fd30cf7a31 100644 (file)
@@ -1422,7 +1422,7 @@ int InsetText::cy(BufferView * bv) const
 }
 
 
-int InsetText::cpos(BufferView * bv) const
+LyXParagraph::size_type InsetText::cpos(BufferView * bv) const
 {
     return TEXT(bv)->cursor.pos();
 }
@@ -1480,9 +1480,9 @@ void InsetText::resizeLyXText(BufferView * bv) const
     LyXParagraph * lpar = 0;
     LyXParagraph * selstartpar = 0;
     LyXParagraph * selendpar = 0;
-    int pos = 0;
-    int selstartpos = 0;
-    int selendpos = 0;
+    LyXParagraph::size_type pos = 0;
+    LyXParagraph::size_type selstartpos = 0;
+    LyXParagraph::size_type selendpos = 0;
     int selection = 0;
     int mark_set = 0;
 
index 1e5354d345853261272de0b8b2520d770487b553..349caf60ea26059c12ef32fa51469327f8c7d1d8 100644 (file)
@@ -225,7 +225,7 @@ private:
     ///
     int cy(BufferView *) const;
     ///
-    int cpos(BufferView *) const;
+    LyXParagraph::size_type cpos(BufferView *) const;
     ///
     LyXParagraph * cpar(BufferView *) const;
     ///
@@ -254,7 +254,7 @@ private:
     ///
     LyXParagraph * inset_par;
     ///
-    int inset_pos;
+    LyXParagraph::size_type inset_pos;
     ///
     mutable int inset_x;
     ///