]> git.lyx.org Git - features.git/commitdiff
Missing pieces for InsetLayout arguments
authorJuergen Spitzmueller <spitz@lyx.org>
Sat, 24 Nov 2012 14:46:20 +0000 (15:46 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Sat, 24 Nov 2012 14:46:20 +0000 (15:46 +0100)
lib/layouts/stdinsets.inc
src/insets/InsetCaption.cpp
src/insets/InsetCaption.h
src/insets/InsetText.cpp
src/insets/InsetText.h

index 76eeee84e2a7bc908c7153221f81917e1ddcf6db..9f1deb977c3bf5d5f79d5d4e608e187fa494a3ef 100644 (file)
@@ -469,6 +469,8 @@ InsetLayout Info:shortcuts
 End
 
 InsetLayout Caption
+       LaTeXType            command
+       LatexName            caption
        Argument 1
                LabelString   "Short Title|S"
                Tooltip       "The caption as it appears in the list of figures/tables"
index a637d90e5adeaa3eca0fa0b393b6e033a3408bf5..22548a4b7761bc8826cbd8a014107e9bf73a5478 100644 (file)
@@ -227,11 +227,7 @@ void InsetCaption::latex(otexstream & os,
        // FIXME: actually, it is moving only when there is no
        // optional argument.
        runparams.moving_arg = true;
-       os << "\\caption";
-       getOptArg(os, runparams);
-       os << '{';
        InsetText::latex(os, runparams);
-       os << "}\n";
        runparams_in.encoding = runparams.encoding;
 }
 
@@ -280,13 +276,6 @@ void InsetCaption::getArgument(otexstream & os,
 }
 
 
-void InsetCaption::getOptArg(otexstream & os,
-                       OutputParams const & runparams) const
-{
-       latexArgInsets(paragraphs()[0], os, runparams, getLayout().latexargs());
-}
-
-
 int InsetCaption::getCaptionAsPlaintext(odocstream & os,
                        OutputParams const & runparams) const
 {
index dc28873fb109acd464d1789f6f7688a0f5ed2186..d446da8fd3eaa464ad154c2a7bd68342bf40eb33 100644 (file)
@@ -28,8 +28,6 @@ public:
        docstring layoutName() const;
        /// return the mandatory argument (LaTeX format) only
        void getArgument(otexstream & os, OutputParams const &) const;
-       /// return the optional argument(s) only
-       void getOptArg(otexstream & os, OutputParams const &) const;
        /// return the caption text
        int getCaptionAsPlaintext(odocstream & os, OutputParams const &) const;
        /// return the caption text as HTML
index 06644ad6579b79c7981c3d3c9b512a115afd51ca..7432f5a9829b5923bb23975c9f4a135327676d87 100644 (file)
@@ -436,6 +436,7 @@ void InsetText::latex(otexstream & os, OutputParams const & runparams) const
                        if (runparams.moving_arg)
                                os << "\\protect";
                        os << '\\' << from_utf8(il.latexname());
+                       getOptArg(os, runparams);
                        if (!il.latexparam().empty())
                                os << from_utf8(il.latexparam());
                        os << '{';
@@ -590,6 +591,12 @@ docstring InsetText::insetAsXHTML(XHTMLStream & xs, OutputParams const & rp,
        return docstring();
 }
 
+void InsetText::getOptArg(otexstream & os,
+                       OutputParams const & runparams) const
+{
+       latexArgInsets(paragraphs()[0], os, runparams, getLayout().latexargs());
+}
+
 
 void InsetText::cursorPos(BufferView const & bv,
                CursorSlice const & sl, bool boundary, int & x, int & y) const
index 0110adf867a999ea9792f7bd6b0a207d502124ff..4fb9fc35d8804c3fcf7fc2f813955d05fb7da863 100644 (file)
@@ -93,6 +93,9 @@ public:
                               XHTMLOptions) const;
        ///
        void validate(LaTeXFeatures & features) const;
+       
+       /// return the optional argument(s) only
+       void getOptArg(otexstream & os, OutputParams const &) const;
 
        /// return x,y of given position relative to the inset's baseline
        void cursorPos(BufferView const & bv, CursorSlice const & sl,