From 67d3d471946bd6e2a4b513e0f967e14f6e7d4df8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Wed, 4 Apr 2001 21:35:36 +0000 Subject: [PATCH] constify vars git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1890 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 4 ++++ src/MenuBackend.C | 19 +++++++++++++------ src/Painter.h | 4 ++-- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index cd7cfecb57..4c2806022f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,9 @@ 2001-04-04 Lars Gullik Bjønnes + * 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 diff --git a/src/MenuBackend.C b/src/MenuBackend.C index 53cdc1200d..d757f4a699 100644 --- a/src/MenuBackend.C +++ b/src/MenuBackend.C @@ -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 names = bufferlist.getFileNames(); + vector 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::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)); diff --git a/src/Painter.h b/src/Painter.h index 6470a8b445..ba001988a4 100644 --- a/src/Painter.h +++ b/src/Painter.h @@ -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 #include "LString.h" // This is only included to provide stuff for the non-public sections