]> git.lyx.org Git - features.git/commitdiff
constify vars
authorLars Gullik Bjønnes <larsbj@gullik.org>
Wed, 4 Apr 2001 21:35:36 +0000 (21:35 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Wed, 4 Apr 2001 21:35:36 +0000 (21:35 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1890 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/MenuBackend.C
src/Painter.h

index cd7cfecb5759a649ed42aba4f5110566c694f70c..4c2806022fad674fbd11c28130995264189a5bc9 100644 (file)
@@ -1,5 +1,9 @@
 2001-04-04  Lars Gullik Bjønnes  <larsbj@birdstep.com>
 
+       * MenuBackend.C (class compare_format): put into anon namespace
+       (expand): constify label, names, action, action2
+       (expand): 
+
        * text.C (SingleWidth): constify font
        (IsBoundary): constify rtl2
        (GetVisibleRow): constify ww
index 53cdc1200de8d420482f2a0f42ab057e77bc1795..d757f4a699a54cdc469ad64724f8c110ec5526bb 100644 (file)
@@ -219,6 +219,9 @@ void Menu::checkShortcuts() const
        }
 }
 
+
+namespace {
+
 class compare_format {
 public:
        bool operator()(Format const * p1, Format const * p2) {
@@ -226,6 +229,9 @@ public:
        }
 };
 
+} // namespace anon
+
+
 void Menu::expand(Menu & tomenu, Buffer * buf) const
 {
        for (const_iterator cit = begin();
@@ -236,10 +242,10 @@ void Menu::expand(Menu & tomenu, Buffer * buf) const
                        for (LastFiles::const_iterator lfit = lastfiles->begin();
                             lfit != lastfiles->end() && ii < 10;
                             ++lfit, ++ii) {
-                               string label = tostr(ii) + ". "
+                               string const label = tostr(ii) + ". "
                                        + MakeDisplayPath((*lfit), 30)
                                        + '|' + tostr(ii);
-                               int action = lyxaction.
+                               int const action = lyxaction.
                                        getPseudoAction(LFUN_FILE_OPEN,
                                                        (*lfit));
                                tomenu.add(MenuItem(MenuItem::Command,
@@ -249,7 +255,7 @@ void Menu::expand(Menu & tomenu, Buffer * buf) const
                break;
                
                case MenuItem::Documents: {
-                       vector<string> names = bufferlist.getFileNames();
+                       vector<string> const names = bufferlist.getFileNames();
                        
                        if (names.empty()) {
                                tomenu.add(MenuItem(MenuItem::Command,
@@ -260,9 +266,10 @@ void Menu::expand(Menu & tomenu, Buffer * buf) const
 
                        for (vector<string>::const_iterator docit = names.begin();
                             docit != names.end() ; ++docit) {
-                               int action =
+                               int const action =
                                        lyxaction.getPseudoAction(LFUN_SWITCHBUFFER, *docit);
-                               string label = MakeDisplayPath(*docit, 30);
+                               string const label =
+                                       MakeDisplayPath(*docit, 30);
                                tomenu.add(MenuItem(MenuItem::Command,
                                                    label, action));
                        }
@@ -306,7 +313,7 @@ void Menu::expand(Menu & tomenu, Buffer * buf) const
                                                label = _("Ascii text as paragraphs");
                                if (!(*fit)->shortcut().empty())
                                        label += "|" + (*fit)->shortcut();
-                               int action2 = lyxaction.
+                               int const action2 = lyxaction.
                                        getPseudoAction(action, (*fit)->name());
                                tomenu.add(MenuItem(MenuItem::Command,
                                                    label, action2));
index 6470a8b445165cb726ef65a9ba7a42682970b1ba..ba001988a45c41a2dcc74d00612b472225383276 100644 (file)
@@ -4,7 +4,7 @@
  * 
  *           LyX, The Document Processor
  *      
- *         Copyright 1995-2000 The LyX Team
+ *         Copyright 1995-2001 The LyX Team
  *
  * ======================================================*/
 
@@ -15,7 +15,7 @@
 #pragma interface
 #endif
 
-#include "config.h"
+#include <config.h>
 #include "LString.h"
 
 // This is only included to provide stuff for the non-public sections