]> git.lyx.org Git - features.git/commitdiff
Make some functions return const refs, and add a comment.
authorRichard Heck <rgheck@lyx.org>
Mon, 7 Apr 2014 01:53:54 +0000 (21:53 -0400)
committerRichard Heck <rgheck@lyx.org>
Mon, 21 Apr 2014 15:52:00 +0000 (11:52 -0400)
src/insets/InsetLayout.h

index 74e1af9db6862a7fba2106cafae580493a41e05c..83bbb2d0de48ba29c340d38fff8173dcc7d2935d 100644 (file)
@@ -85,13 +85,18 @@ public:
        FontInfo labelfont() const { return labelfont_; }
        ///
        ColorCode bgcolor() const { return bgcolor_; }
-       ///
+       /// 
+       Layout::LaTeXArgMap const & latexargs() const { return latexargs_; }
+       ///
+       Layout::LaTeXArgMap const & postcommandargs() const { return postcommandargs_; }
+       /// Returns latexargs() + postcommandargs().
+       /// But note that it returns a *copy*, not a reference, so do not do 
+       /// anything like:
+       ///   Layout::LaTeXArgMap it = args().begin();
+       ///   Layout::LaTeXArgMap en = args().end();
+       /// Those are iterators for different containers.
        Layout::LaTeXArgMap args() const;
        ///
-       Layout::LaTeXArgMap latexargs() const { return latexargs_; }
-       ///
-       Layout::LaTeXArgMap postcommandargs() const { return postcommandargs_; }
-       ///
        unsigned int optArgs() const;
        ///
        unsigned int requiredArgs() const;