]> git.lyx.org Git - lyx.git/commitdiff
put namespace toc inside namespace lxy
authorLars Gullik Bjønnes <larsbj@gullik.org>
Sun, 27 Jul 2003 13:18:55 +0000 (13:18 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Sun, 27 Jul 2003 13:18:55 +0000 (13:18 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7384 a592a061-630c-0410-9148-cb99ea01b6c8

17 files changed:
src/ChangeLog
src/MenuBackend.C
src/frontends/controllers/ChangeLog
src/frontends/controllers/ControlToc.C
src/frontends/controllers/ControlToc.h
src/frontends/xforms/ChangeLog
src/frontends/xforms/FormToc.C
src/frontends/xforms/FormToc.h
src/insets/ChangeLog
src/insets/insetfloat.C
src/insets/insetfloat.h
src/insets/insetfloatlist.C
src/insets/insettoc.C
src/insets/insetwrap.C
src/insets/insetwrap.h
src/toc.C
src/toc.h

index 11d8197f58a4d5ed307533f7c21f0b6d28fa00b0..8fa8ce7bde7306bfec3f2590ed49f6bc0dc0acfa 100644 (file)
@@ -1,5 +1,10 @@
 2003-07-27  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
+       * toc.[Ch]: put namespace toc inside namespace lyx
+
+       * MenuBackend.C (expandToc2): adjust for lyx::toc
+       (expandToc): ditto
+
        * lyxfunc.C (dispatch): adjust for lyx::find
 
        * lyxfind.[hC]: get rid of namespace lyxfind introduce namespace
index f8df5e66f3225d461c67a79e96f559a32fc09277..52e557a8ee90b6f9cade2600aae6a19ef1c9040e 100644 (file)
@@ -521,12 +521,14 @@ void expandFloatInsert(Menu & tomenu, LyXView const * view)
 
 Menu::size_type const max_number_of_items = 25;
 
-void expandToc2(Menu & tomenu, toc::Toc const & toc_list,
-               toc::Toc::size_type from, toc::Toc::size_type to, int depth)
+void expandToc2(Menu & tomenu,
+               lyx::toc::Toc const & toc_list,
+               lyx::toc::Toc::size_type from,
+               lyx::toc::Toc::size_type to, int depth)
 {
        int shortcut_count = 0;
        if (to - from <= max_number_of_items) {
-               for (toc::Toc::size_type i = from; i < to; ++i) {
+               for (lyx::toc::Toc::size_type i = from; i < to; ++i) {
                        int const action = toc_list[i].action();
                        string label(4 * max(0, toc_list[i].depth - depth),' ');
                        label += limit_string_length(toc_list[i].str);
@@ -537,9 +539,9 @@ void expandToc2(Menu & tomenu, toc::Toc const & toc_list,
                        tomenu.add(MenuItem(MenuItem::Command, label, action));
                }
        } else {
-               toc::Toc::size_type pos = from;
+               lyx::toc::Toc::size_type pos = from;
                while (pos < to) {
-                       toc::Toc::size_type new_pos = pos + 1;
+                       lyx::toc::Toc::size_type new_pos = pos + 1;
                        while (new_pos < to &&
                               toc_list[new_pos].depth > depth)
                                ++new_pos;
@@ -581,9 +583,9 @@ void expandToc(Menu & tomenu, LyXView const * view)
                return;
        }
 
-       toc::TocList toc_list = toc::getTocList(view->buffer());
-       toc::TocList::const_iterator cit = toc_list.begin();
-       toc::TocList::const_iterator end = toc_list.end();
+       lyx::toc::TocList toc_list = lyx::toc::getTocList(view->buffer());
+       lyx::toc::TocList::const_iterator cit = toc_list.begin();
+       lyx::toc::TocList::const_iterator end = toc_list.end();
        for (; cit != end; ++cit) {
                // Handle this later
                if (cit->first == "TOC")
@@ -591,8 +593,8 @@ void expandToc(Menu & tomenu, LyXView const * view)
 
                // All the rest is for floats
                Menu * menu = new Menu;
-               toc::Toc::const_iterator ccit = cit->second.begin();
-               toc::Toc::const_iterator eend = cit->second.end();
+               lyx::toc::Toc::const_iterator ccit = cit->second.begin();
+               lyx::toc::Toc::const_iterator eend = cit->second.end();
                for (; ccit != eend; ++ccit) {
                        string const label = limit_string_length(ccit->str);
                        menu->add(MenuItem(MenuItem::Command,
index 8ad00cdb73288f958dad1eea8340a9142dbc639e..588a6c09242775d884683a7b15ddcd89d9e9b934 100644 (file)
@@ -1,5 +1,9 @@
 2003-07-27  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
+       * ControlToc.C (goTo): adjust for lyx::toc
+       (getTypes): ditto
+       (getContents): ditto
+
        * ControlThesaurus.C (replace): adjust for lyx::find
 
        * ControlSearch.C (find): adjust for lyx::find
index f9daa70d044126afba42e1476babbaa3f0fa7602..c393d544b5ad03ce47ceeef2d4994c7f1661e398 100644 (file)
@@ -23,7 +23,7 @@ ControlToc::ControlToc(Dialog & d)
 {}
 
 
-void ControlToc::goTo(toc::TocItem const & item)
+void ControlToc::goTo(lyx::toc::TocItem const & item)
 {
        item.goTo(kernel().lyxview());
 }
@@ -31,21 +31,21 @@ void ControlToc::goTo(toc::TocItem const & item)
 
 vector<string> const ControlToc::getTypes() const
 {
-       return toc::getTypes(kernel().buffer());
+       return lyx::toc::getTypes(kernel().buffer());
 }
 
 
-toc::Toc const ControlToc::getContents(string const & type) const
+lyx::toc::Toc const ControlToc::getContents(string const & type) const
 {
-       toc::Toc empty_list;
+       lyx::toc::Toc empty_list;
 
        // This shouldn't be possible...
        if (!kernel().isBufferAvailable()) {
                return empty_list;
        }
 
-       toc::TocList tmp = toc::getTocList(kernel().buffer());
-       toc::TocList::iterator it = tmp.find(type);
+       lyx::toc::TocList tmp = lyx::toc::getTocList(kernel().buffer());
+       lyx::toc::TocList::iterator it = tmp.find(type);
        if (it == tmp.end()) {
                return empty_list;
        }
index 8a236ad25e11e387692e7806eea2fc909ad5b79f..64b630bd957c4830203dd6e029f8c040011bcf6c 100644 (file)
@@ -25,13 +25,13 @@ public:
        ControlToc(Dialog &);
 
        /// Goto this paragraph id
-       void goTo(toc::TocItem const &);
+       void goTo(lyx::toc::TocItem const &);
 
        /// Return the list of types available
        std::vector<string> const getTypes() const;
 
        /// Given a type, returns the contents
-       toc::Toc const getContents(string const & type) const;
+       lyx::toc::Toc const getContents(string const & type) const;
 };
 
 #endif // CONTROLTOC_H
index 9c398de5ca6685f0b42b92c7e1f8cdbd2eb88632..4f2f6881e4f6922b8a6a3c92c3db8ca67c7faa2c 100644 (file)
@@ -1,14 +1,19 @@
+2003-07-27  Lars Gullik Bjønnes  <larsbj@gullik.net>
+
+       * FormToc.C (updateType): adjust for lyx::toc
+       (updateContents): ditto
+
 2003-07-27  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
 
        * XPainter.C: include lyxfont.h
 
-       * FormParagraph.C: 
+       * FormParagraph.C:
        * FormGraphics.C:
        * FormDocument.C: adapt PAPER_* enums
 
 2003-07-25  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
 
-       * XFormsMenubar.h: 
+       * XFormsMenubar.h:
        * XFormsMenubar.C: derives from Menubar (replaces Menubar::Pimpl)
 
        * Menubar_pimpl.C:
@@ -18,7 +23,7 @@
 
 2003-07-25  Jean-Marc Lasgouttes <lasgouttes@lyx.org>
 
-       * XFormsToolbar.h: 
+       * XFormsToolbar.h:
        * XFormsToolbar.C: derives from Toolbar (replaces Toolbar::Pimpl)
 
        * Toolbar_pimpl.C:
index 9c35604e4b357bd25645d89e431f92dc159beed6..e38869cd1dd3ef7394da40dd164094cffaaace19 100644 (file)
@@ -88,7 +88,7 @@ void FormToc::updateType()
        fl_addto_choice(dialog_->choice_toc_type, choice.c_str());
 
        // And select the correct one
-       string const type = toc::getType(controller().params().getCmdName());
+       string const type = lyx::toc::getType(controller().params().getCmdName());
        fl_set_choice_text(dialog_->choice_toc_type, type.c_str());
 }
 
@@ -104,7 +104,7 @@ void FormToc::updateContents()
                return;
        }
 
-       toc::Toc const contents = controller().getContents(type);
+       lyx::toc::Toc const contents = controller().getContents(type);
 
        // Check if all elements are the same.
        if (toc_ == contents) {
@@ -129,8 +129,8 @@ void FormToc::updateContents()
        fl_clear_browser(dialog_->browser_toc);
        setEnabled(dialog_->browser_toc, true);
 
-       toc::Toc::const_iterator cit = contents.begin();
-       toc::Toc::const_iterator end = contents.end();
+       lyx::toc::Toc::const_iterator cit = contents.begin();
+       lyx::toc::Toc::const_iterator end = contents.end();
        for (; cit != end; ++cit) {
                fl_add_browser_line(dialog_->browser_toc,
                                    cit->asString().c_str());
index e5861c5081fcdf490a36a523f7ab4e78022b96bd..1db5a7809ee959edd5554ecf2ee6fba88fe7b3da 100644 (file)
@@ -41,7 +41,7 @@ private:
        void updateContents();
 
        ///
-       toc::Toc toc_;
+       lyx::toc::Toc toc_;
 };
 
 #endif // FORMTOC_H
index d53abe9b7f2cc361ac6c758bd7e0c23f7400f0b2..ee18918af706ad991282e31c9be7a9c1980c3119 100644 (file)
@@ -1,3 +1,11 @@
+2003-07-27  Lars Gullik Bjønnes  <larsbj@gullik.net>
+
+       * insetwrap.C (addToToc): adjust for lyx::toc
+
+       * insetfloatlist.C (ascii): adjust for lyx::toc
+
+       * insetfloat.C (addToToc): adjust for lyx::toc
+
 2003-07-27  José Matos  <jamatos@fep.up.pt>
 
        * insetnote.h (linuxdoc,docbook): update support.
index dbe0fb5651b09dae313158aa8b4701786f372023..0db037a0da8f5e9025cdb60450db76e224301da4 100644 (file)
@@ -400,7 +400,7 @@ void InsetFloat::wide(bool w, BufferParams const & bp)
 }
 
 
-void InsetFloat::addToToc(toc::TocList & toclist, Buffer const * buf) const
+void InsetFloat::addToToc(lyx::toc::TocList & toclist, Buffer const * buf) const
 {
        ParIterator pit(inset.paragraphs.begin(), inset.paragraphs);
        ParIterator end(inset.paragraphs.end(), inset.paragraphs);
@@ -412,7 +412,7 @@ void InsetFloat::addToToc(toc::TocList & toclist, Buffer const * buf) const
                        string const str =
                                tostr(toclist[name].size() + 1)
                                + ". " + pit->asString(buf, false);
-                       toc::TocItem const item(pit->id(), 0 , str);
+                       lyx::toc::TocItem const item(pit->id(), 0 , str);
                        toclist[name].push_back(item);
                }
        }
index 36c63c2c1aeb9a8e8e35903579d36e3da3394b42..9e48dbb7cc11208349804d2ce07c8b7da95986a9 100644 (file)
@@ -74,7 +74,7 @@ public:
        ///
        void wide(bool w, BufferParams const &);
        ///
-       void addToToc(toc::TocList &, Buffer const *) const;
+       void addToToc(lyx::toc::TocList &, Buffer const *) const;
        ///
        bool  showInsetDialog(BufferView *) const;
        ///
index c93f93a3a1912bfab6bc742712b74945f289fe94..449312d34755c639ae7e9fa9b35a262e99ce04c3 100644 (file)
@@ -143,7 +143,7 @@ int InsetFloatList::ascii(Buffer const * buffer, ostream & os, int) const
 {
        os << getScreenLabel(buffer) << "\n\n";
 
-       toc::asciiTocList(getCmdName(), buffer, os);
+       lyx::toc::asciiTocList(getCmdName(), buffer, os);
 
        os << "\n";
        return 0;
index d7ec85a7e6ed2b84be09b12a70094364563802ad..876c9b0e75a41397c942c1c95fb4fdd5358ca041 100644 (file)
@@ -70,7 +70,7 @@ int InsetTOC::ascii(Buffer const * buffer, ostream & os, int) const
 {
        os << getScreenLabel(buffer) << "\n\n";
 
-       toc::asciiTocList(toc::getType(getCmdName()), buffer, os);
+       lyx::toc::asciiTocList(lyx::toc::getType(getCmdName()), buffer, os);
 
        os << "\n";
        return 0;
index f5af8fe5a942aaa75d52a10512651ca3049f461b..fe2f618f0a8268088e29a4e27ab0c18bb797f8dd 100644 (file)
@@ -234,7 +234,7 @@ bool InsetWrap::showInsetDialog(BufferView * bv) const
 }
 
 
-void InsetWrap::addToToc(toc::TocList & toclist, Buffer const * buf) const
+void InsetWrap::addToToc(lyx::toc::TocList & toclist, Buffer const * buf) const
 {
        // Now find the caption in the float...
        ParagraphList::iterator tmp = inset.paragraphs.begin();
@@ -246,7 +246,7 @@ void InsetWrap::addToToc(toc::TocList & toclist, Buffer const * buf) const
                        string const str =
                                tostr(toclist[name].size() + 1)
                                + ". " + tmp->asString(buf, false);
-                       toc::TocItem const item(tmp->id(), 0 , str);
+                       lyx::toc::TocItem const item(tmp->id(), 0 , str);
                        toclist[name].push_back(item);
                }
        }
index 2c892384e913140a12891256029396e626a2a44f..5a6e6a011b148a5ffefc9ba74d99c722b215f2c6 100644 (file)
@@ -63,7 +63,7 @@ public:
        ///
        bool insetAllowed(InsetOld::Code) const;
        ///
-       void addToToc(toc::TocList &, Buffer const *) const;
+       void addToToc(lyx::toc::TocList &, Buffer const *) const;
        ///
        bool  showInsetDialog(BufferView *) const;
        ///
index b681a25530f7e10881bd7be4caefb9d6366864f8..e8d303412fd903503daa1ec9770a7c26e0b14bdd 100644 (file)
--- a/src/toc.C
+++ b/src/toc.C
@@ -34,8 +34,8 @@ using std::max;
 using std::endl;
 using std::ostream;
 
-namespace toc
-{
+namespace lyx {
+namespace toc {
 
 string const TocItem::asString() const
 {
@@ -104,6 +104,7 @@ TocList const getTocList(Buffer const * buf)
                        } else if (it->inset->lyxCode() == InsetOld::WRAP_CODE) {
                                InsetWrap * il =
                                        static_cast<InsetWrap*>(it->inset);
+
                                il->addToToc(toclist, buf);
                        }
                }
@@ -143,3 +144,4 @@ void asciiTocList(string const & type, Buffer const * buffer, ostream & os)
 
 
 } // namespace toc
+} // namespace lyx
index 956101d13296eac2b93c766631830193a83623f7..7ee44a0a88274b0b2410504b8479ee70451c630f 100644 (file)
--- a/src/toc.h
+++ b/src/toc.h
@@ -30,8 +30,8 @@ class Paragraph;
 
 /** Nice functions and objects to handle TOCs
  */
-namespace toc
-{
+namespace lyx {
+namespace toc {
 
 ///
 struct TocItem {
@@ -85,5 +85,6 @@ bool operator!=(TocItem const & a, TocItem const & b)
 
 
 } // namespace toc
+} // namespace lyx
 
 #endif // CONTROLTOC_H