]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetoptarg.C
* BufferParams:
[lyx.git] / src / insets / insetoptarg.C
index 6b889fd726c74141f2e78636ec03fbf3a8b6471c..d1ee34b50d29b102c861f840846e2e343dffe30d 100644 (file)
@@ -19,6 +19,9 @@
 
 #include <sstream>
 
+
+namespace lyx {
+
 using std::string;
 using std::auto_ptr;
 using std::ostream;
@@ -26,7 +29,7 @@ using std::ostringstream;
 
 
 InsetOptArg::InsetOptArg(BufferParams const & ins)
-       : InsetCollapsable(ins, Collapsed)
+       : InsetCollapsable(ins)
 {
        LyXFont font(LyXFont::ALL_SANE);
        font.setColor(LColor::collapsable);
@@ -51,7 +54,7 @@ auto_ptr<InsetBase> InsetOptArg::doClone() const
 }
 
 
-string const InsetOptArg::editMessage() const
+docstring const InsetOptArg::editMessage() const
 {
        return _("Opened Optional Argument Inset");
 }
@@ -64,21 +67,38 @@ void InsetOptArg::write(Buffer const & buf, ostream & os) const
 }
 
 
-int InsetOptArg::latex(Buffer const &, ostream &,
-                      OutputParams const &) const
+int InsetOptArg::latex(Buffer const &, odocstream &,
+                       OutputParams const &) const
 {
        return 0;
 }
 
 
-int InsetOptArg::latexOptional(Buffer const & buf, ostream & os,
+int InsetOptArg::plaintext(Buffer const &, odocstream &,
+                           OutputParams const &) const
+{
+       return 0; // do not output optional arguments
+}
+
+
+int InsetOptArg::docbook(Buffer const &, odocstream &,
+                         OutputParams const &) const
+{
+       return 0;
+}
+
+
+int InsetOptArg::latexOptional(Buffer const & buf, odocstream & os,
                               OutputParams const & runparams) const
 {
-       ostringstream ss;
+       odocstringstream ss;
        int ret = InsetText::latex(buf, ss, runparams);
-       string str = ss.str();
-       if (str.find(']') != string::npos)
+       docstring str = ss.str();
+       if (str.find(']') != docstring::npos)
                str = '{' + str + '}';
        os << '[' << str << ']';
        return ret;
 }
+
+
+} // namespace lyx