]> git.lyx.org Git - features.git/commitdiff
whitespace and pass by const reference and use Inset::Code instead of char as type
authorLars Gullik Bjønnes <larsbj@gullik.org>
Thu, 18 May 2000 13:26:04 +0000 (13:26 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Thu, 18 May 2000 13:26:04 +0000 (13:26 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@739 a592a061-630c-0410-9148-cb99ea01b6c8

src/buffer.C
src/insets/inset.C
src/insets/insetfoot.C
src/paragraph.C
src/tabular.C
src/tabular.h

index a252e64c190be9dcca9d54bd1a4b199fd833dde8..7d167f3f35f13b2fab2140577bca4ebc9da0c9cc 100644 (file)
@@ -2280,7 +2280,7 @@ void Buffer::makeLinuxDocFile(string const & fname, int column)
                // treat <toc> as a special case for compatibility with old code
                if (par->GetChar(0) == LyXParagraph::META_INSET) {
                        Inset * inset = par->GetInset(0);
-                       char  lyx_code = inset->LyxCode();
+                       Inset::Code lyx_code = inset->LyxCode();
                        if (lyx_code == Inset::TOC_CODE){
                                string temp = "toc";
                                sgmlOpenTag(ofs, depth, temp);
@@ -2966,7 +2966,7 @@ void Buffer::makeDocBookFile(string const & fname, int column)
                        // more WYSIWYM handling.
                        if (par->GetChar(0) == LyXParagraph::META_INSET) {
                                Inset * inset = par->GetInset(0);
-                               char  lyx_code = inset->LyxCode();
+                               Inset::Code lyx_code = inset->LyxCode();
                                if (lyx_code == Inset::LABEL_CODE){
                                        command_name += " id=\"";
                                        command_name += (static_cast<InsetCommand *>(inset))->getContents();
@@ -2975,7 +2975,7 @@ void Buffer::makeDocBookFile(string const & fname, int column)
                                }
                        }
 
-                       sgmlOpenTag(ofs, depth+command_depth, command_name);
+                       sgmlOpenTag(ofs, depth + command_depth, command_name);
                        item_name = "title";
                        sgmlOpenTag(ofs, depth + 1 + command_depth, item_name);
                        break;
@@ -3824,11 +3824,11 @@ string Buffer::getBibkeyList(char delim)
 
                        // Search for Bibtex or Include inset
                        while ((inset = par->ReturnNextInsetPointer(pos))) {
-                               if (inset-> LyxCode() == Inset::BIBTEX_CODE) {
+                               if (inset->LyxCode() == Inset::BIBTEX_CODE) {
                                        if (!bibkeys.empty())
                                                bibkeys += delim;
                                        bibkeys += static_cast<InsetBibtex*>(inset)->getKeys(delim);
-                               } else if (inset-> LyxCode() == Inset::INCLUDE_CODE) {
+                               } else if (inset->LyxCode() == Inset::INCLUDE_CODE) {
                                        string bk = static_cast<InsetInclude*>(inset)->getKeys(delim);
                                        if (!bk.empty()) {
                                                if (!bibkeys.empty())
index 0cb824c21f82438082d34a6b2dc272cc15c51ccc..bf489a647570455fb599ab1770841d7fe7694379 100644 (file)
@@ -41,6 +41,7 @@ Inset::EDITABLE Inset::Editable() const
   return NOT_EDITABLE;
 }
 
+
 bool Inset::IsTextInset() const
 {
        return ((LyxCode() == TEXT_CODE) ||
@@ -49,6 +50,7 @@ bool Inset::IsTextInset() const
                (LyxCode() == MARGIN_CODE));
 }
 
+
 void Inset::Validate(LaTeXFeatures &) const
 {
 }
@@ -122,10 +124,12 @@ void UpdatableInset::ToggleInsetCursor(BufferView *)
 {
 }
 
+
 void UpdatableInset::ShowInsetCursor(BufferView *)
 {
 }
 
+
 void UpdatableInset::HideInsetCursor(BufferView *)
 {
 }
@@ -179,6 +183,7 @@ UpdatableInset::LocalDispatch(BufferView *, int, string const &)
     return UNDISPATCHED; 
 }
 
+
 int UpdatableInset::getMaxWidth(Painter & pain, UpdatableInset const *) const
 {
     if (owner())
index 6900078dc45261a2e69c05ee3740c84cf166221f..897b289888a543604d462a635685b1a42224672d 100644 (file)
@@ -24,7 +24,7 @@ using std::ostream;
 using std::endl;
 
 InsetFoot::InsetFoot(Buffer * bf)
-               : InsetCollapsable(bf)
+       : InsetCollapsable(bf)
 {
     setLabel(_("foot"));
     LyXFont font(LyXFont::ALL_SANE);
@@ -72,6 +72,7 @@ bool InsetFoot::InsertInset(BufferView * bv, Inset * inset)
     return InsetText::InsertInset(bv, inset);
 }
 
+
 bool InsetFoot::InsertInsetAllowed(Inset * inset) const
 {
     if ((inset->LyxCode() == Inset::FOOT_CODE) ||
@@ -81,10 +82,10 @@ bool InsetFoot::InsertInsetAllowed(Inset * inset) const
     return true;
 }
 
+
 LyXFont InsetFoot::GetDrawFont(LyXParagraph * p, int pos) const
 {
     LyXFont fn = InsetCollapsable::GetDrawFont(p, pos);
-    fn.decSize();
-    fn.decSize();
+    fn.decSize().decSize();
     return fn;
 }
index 3cc070c241e27ddb0fb92759ab4736881c2573f8..6cf88c4815038ba3e75b4e3629751cb94cd09876 100644 (file)
@@ -662,15 +662,16 @@ void LyXParagraph::InsertInset(LyXParagraph::size_type pos,
 }
 
 
-bool LyXParagraph::InsertInsetAllowed(Inset *inset)
+bool LyXParagraph::InsertInsetAllowed(Inset * inset)
 {
        if (inset_owner) {
-               printf("CODE:%d\n",inset->LyxCode());
+               lyxerr << "CODE: << " << inset->LyxCode() << endl;
                return inset_owner->InsertInsetAllowed(inset);
        }
        return true;
 }
 
+
 Inset * LyXParagraph::GetInset(LyXParagraph::size_type pos)
 {
        if (pos >= size()) {
index 2649941c18f82f0b6a2649380ca30b5b46dd8693..1499877bf38402ad03ad14f34e98a3f1bc06321c 100644 (file)
@@ -725,7 +725,7 @@ bool LyXTabular::SetAlignment(int cell, char align)
 }
 
 
-bool LyXTabular::SetPWidth(int cell, string width)
+bool LyXTabular::SetPWidth(int cell, string const & width)
 {
     bool flag = !width.empty();
 
@@ -748,7 +748,7 @@ bool LyXTabular::SetPWidth(int cell, string width)
 }
 
 
-bool LyXTabular::SetAlignSpecial(int cell, string special, int what)
+bool LyXTabular::SetAlignSpecial(int cell, string const & special, int what)
 {
     if (what == SET_SPECIAL_MULTI)
         cellinfo_of_cell(cell)->align_special = special;
@@ -1199,7 +1199,7 @@ void LyXTabular::Read(LyXLex & lex)
 }
 
 
-void LyXTabular::OldFormatRead(LyXLex & lex, string fl)
+void LyXTabular::OldFormatRead(LyXLex & lex, string const & fl)
 {
     int version;
     int i, j;
@@ -1217,14 +1217,13 @@ void LyXTabular::OldFormatRead(LyXLex & lex, string fl)
     int h = 0;
        
     istream & is = lex.getStream();
-    string s;
-    s = fl;
+    string s(fl);
     if (s.length() > 8)
        version = atoi(s.c_str() + 8);
     else
        version = 1;
 
-    int * cont_row_info;
+    //int * cont_row_info; // unused
 
     if (version < 5) {
        lyxerr << "Tabular format < 5 is not supported anymore\n"
index a3de0311319b60e6fe3f84271101d10006fb6e88..01cbc001e12a87857760c4ca359d73ea95b611e4 100644 (file)
@@ -134,9 +134,9 @@ public:
     /// Returns true if a complete update is necessary, otherwise false
     bool SetAlignment(int cell, char align);
     ///
-    bool SetPWidth(int cell, string width);
+    bool SetPWidth(int cell, string const & width);
     ///
-    bool SetAlignSpecial(int cell, string special, int what);
+    bool SetAlignSpecial(int cell, string const & special, int what);
     ///
     char GetAlignment(int cell) const; // add approp. signedness
     ///
@@ -176,7 +176,7 @@ public:
     ///
     void Read(LyXLex &);
     ///
-    void OldFormatRead(LyXLex &, string);
+    void OldFormatRead(LyXLex &, string const &);
     ///
     /// helper function for Latex returns number of newlines
     ///