X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fcounters.C;h=0fa97db461f040137e307a809a0810d7d6b6dd11;hb=d899c547de3f689b09cd440a76a46e45cf75c7b0;hp=2a72bf99f4f50f1409a6c18a0c0438db6748f140;hpb=0b1b6dfa4ed99f2b7c2a36cb56dcbb9d5553ac33;p=lyx.git diff --git a/src/counters.C b/src/counters.C index 2a72bf99f4..0fa97db461 100644 --- a/src/counters.C +++ b/src/counters.C @@ -1,13 +1,23 @@ +/* This file is part of + * ====================================================== + * + * LyX, The Document Processor + * + * Copyright 1995 Matthias Ettrich + * Copyright 1995-2001 The LyX Team. + * + * + * ====================================================== */ + +#ifdef __GNUG__ +#pragma implementation +#endif + #include #include "counters.h" #include "debug.h" -#ifdef SIGC_CXX_NAMESPACES -using SigC::Connection; -using SigC::slot; -#endif - using std::endl; @@ -55,14 +65,14 @@ Counters::~Counters() for (CounterList::iterator it = counterList.begin(); it != counterList.end(); ++it) - delete (*it).second; + delete it->second; } void Counters::newCounter(string const & newc) { // First check if newc already exist - CounterList::const_iterator cit = counterList.find(newc); + CounterList::iterator cit = counterList.find(newc); // if alrady exist give warning and return if (cit != counterList.end()) { lyxerr << "The new counter already exist." << endl; @@ -75,7 +85,7 @@ void Counters::newCounter(string const & newc) void Counters::newCounter(string const & newc, string const & oldc) { // First check if newc already exist - CounterList::const_iterator cit = counterList.find(newc); + CounterList::iterator cit = counterList.find(newc); // if already existant give warning and return if (cit != counterList.end()) { lyxerr << "The new counter already exist." << endl; @@ -90,8 +100,8 @@ void Counters::newCounter(string const & newc, string const & oldc) } Counter * tmp = new Counter; - (*it).second->onstep.connect(slot(tmp, - &Counter::reset)); + it->second->onstep.connect(SigC::slot(tmp, + &Counter::reset)); counterList[newc] = tmp; } @@ -103,7 +113,7 @@ void Counters::set(string const & ctr, int val) lyxerr << "Counter does not exist." << endl; return; } - (*it).second->set(val); + it->second->set(val); } @@ -114,7 +124,7 @@ void Counters::addto(string const & ctr, int val) lyxerr << "Counter does not exist." << endl; return; } - (*it).second->addto(val); + it->second->addto(val); } @@ -125,7 +135,7 @@ int Counters::value(string const & ctr) const lyxerr << "Counter does not exist." << endl; return 0; } - return (*cit).second->value(); + return cit->second->value(); } @@ -136,5 +146,5 @@ void Counters::step(string const & ctr) lyxerr << "Counter does not exist." << endl; return; } - (*it).second->step(); + it->second->step(); }