From 62e038c59470b3dab4c3fe5206a46ff65463b844 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Tue, 17 Oct 2000 09:14:34 +0000 Subject: [PATCH] Insets cleanup patch from Angus git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1127 a592a061-630c-0410-9148-cb99ea01b6c8 --- ChangeLog | 41 +++++++++++++++++++++++++---- lib/CREDITS | 4 +-- po/POTFILES.in | 22 +++++++++++----- src/combox.C | 7 +++-- src/combox.h | 2 +- src/frontends/xforms/FormDocument.C | 4 +-- src/insets/Makefile.am | 4 +-- src/insets/insetbutton.C | 2 +- src/insets/insetcite.C | 4 +-- src/insets/insettabular.C | 2 +- src/insets/insettabular.h | 6 ++--- src/insets/insettext.C | 8 +++--- src/insets/insettext.h | 4 +-- 13 files changed, 74 insertions(+), 36 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2bdc896f9e..244290d917 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,40 @@ -2000-10-17 Jean-Marc Lasgouttes +2000-10-17 Angus Leeming + + * lib/CREDITS: clean up + +2000-10-16 Angus Leeming + + * 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 * src/frontends/kde/: The Great Renaming, add FormParagraph +2000-10-17 Jean-Marc Lasgouttes * src/frontends/support/Makefile.am (EXTRA_DIST): re-fix. @@ -77,7 +108,7 @@ 2000-10-13 Dekel Tsur * src/text.C (GetColumnNearX): Fixed disabled code. - + 2000-10-13 Lars Gullik Bjønnes * configure.in (CPPFLAGS): add snprintf and vsnprintf to @@ -961,7 +992,7 @@ * 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 * src/BufferView2.C (theLockingInset): removed const because of @@ -1917,7 +1948,7 @@ * src/frontends/xforms/Toolbar_pimpl.C: * src/lyx_cb.C (LayoutsCB): added Combox * to function call. -2000-09-14 Garst Reese +2000-09-14 Garst Reese * lib/tex/hollywood.cls changed length of parenthicals to 1.5in moved usepackage{xxx}'s to beginning of file. Changed left margin @@ -4448,7 +4479,7 @@ * src/lyxrc.C, src/lyxrc.h, src/BufferView_pimpl.C, lib/lyxrc.example: added option \wheel_jump -2000-07-04 R. Lahaye +2000-07-04 R. Lahaye * src/lyx_gui.C src/lyx_main.C: add support for -geometry, and remove support for -width,-height,-xpos and -ypos. diff --git a/lib/CREDITS b/lib/CREDITS index 07598646f8..45196a7247 100644 --- a/lib/CREDITS +++ b/lib/CREDITS @@ -114,7 +114,7 @@ @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 @@ -171,7 +171,7 @@ @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) diff --git a/po/POTFILES.in b/po/POTFILES.in index 4047389a21..8579bdd0f0 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -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 diff --git a/src/combox.C b/src/combox.C index 3f57d01d12..bee3d12504 100644 --- a/src/combox.C +++ b/src/combox.C @@ -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(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(xev)->xkey, s_r, 10, - &keysym_return, 0); + XLookupString(&static_cast(xev)->xkey, s_r, 10, + &keysym_return, 0); XFlush(fl_get_display()); switch (keysym_return) { case XK_Down: diff --git a/src/combox.h b/src/combox.h index e37f6cd4ae..b4f78df680 100644 --- a/src/combox.h +++ b/src/combox.h @@ -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 &); diff --git a/src/frontends/xforms/FormDocument.C b/src/frontends/xforms/FormDocument.C index 43594f30bb..27511bf231 100644 --- a/src/frontends/xforms/FormDocument.C +++ b/src/frontends/xforms/FormDocument.C @@ -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); diff --git a/src/insets/Makefile.am b/src/insets/Makefile.am index a66dec59e5..89a70b885d 100644 --- a/src/insets/Makefile.am +++ b/src/insets/Makefile.am @@ -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 \ diff --git a/src/insets/insetbutton.C b/src/insets/insetbutton.C index a8a75095e9..999984dbda 100644 --- a/src/insets/insetbutton.C +++ b/src/insets/insetbutton.C @@ -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, diff --git a/src/insets/insetcite.C b/src/insets/insetcite.C index a74989a400..eea8607b70 100644 --- a/src/insets/insetcite.C +++ b/src/insets/insetcite.C @@ -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; diff --git a/src/insets/insettabular.C b/src/insets/insettabular.C index 608b25448a..6e47e90b13 100644 --- a/src/insets/insettabular.C +++ b/src/insets/insettabular.C @@ -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); diff --git a/src/insets/insettabular.h b/src/insets/insettabular.h index ad1807de1d..9cece3c890 100644 --- a/src/insets/insettabular.h +++ b/src/insets/insettabular.h @@ -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; /// diff --git a/src/insets/insettext.C b/src/insets/insettext.C index 733f448ed1..21285dbe8a 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -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; diff --git a/src/insets/insettext.h b/src/insets/insettext.h index 1e5354d345..349caf60ea 100644 --- a/src/insets/insettext.h +++ b/src/insets/insettext.h @@ -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; ///