]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetref.C
* In the process of fixing the math background color bug, this commit transfer backgr...
[lyx.git] / src / insets / insetref.C
index 3d80f05332d5a07018fd221cb512fd1390fc2c14..85dca1c86529ab7fdf0bfa45524a34ee86ee0f8f 100644 (file)
@@ -24,9 +24,9 @@
 #include "support/lstrings.h"
 
 
-using lyx::docstring;
-using lyx::odocstream;
-using lyx::support::escape;
+namespace lyx {
+
+using support::escape;
 
 using std::string;
 using std::ostream;
@@ -84,7 +84,7 @@ docstring const InsetRef::getScreenLabel(Buffer const &) const
 
 
 int InsetRef::latex(Buffer const &, odocstream & os,
-                   OutputParams const &) const
+                    OutputParams const &) const
 {
        // Don't output p_["name"], this is only used in docbook
        InsetCommandParams p(getCmdName());
@@ -95,30 +95,31 @@ int InsetRef::latex(Buffer const &, odocstream & os,
 
 
 int InsetRef::plaintext(Buffer const &, odocstream & os,
-                   OutputParams const &) const
+                        OutputParams const &) const
 {
-       os << '[' << getParam("reference") << ']';
-       return 0;
+       docstring const str = getParam("reference");
+       os << '[' << str << ']';
+       return 2 + str.size();
 }
 
 
 int InsetRef::docbook(Buffer const & buf, odocstream & os,
-                     OutputParams const & runparams) const
+                      OutputParams const & runparams) const
 {
        docstring const & name = getParam("name");
        if (name.empty()) {
                if (runparams.flavor == OutputParams::XML) {
                        os << "<xref linkend=\"" 
-                          << lyx::from_ascii(sgml::cleanID(buf, runparams, lyx::to_ascii(getParam("reference")))) 
+                          << sgml::cleanID(buf, runparams, getParam("reference")) 
                           << "\" />";
                } else {
                        os << "<xref linkend=\"" 
-                          << lyx::from_ascii(sgml::cleanID(buf, runparams, lyx::to_ascii(getParam("reference")))) 
+                          << sgml::cleanID(buf, runparams, getParam("reference")) 
                           << "\">";
                }
        } else {
                os << "<link linkend=\"" 
-                  << lyx::from_ascii(sgml::cleanID(buf, runparams, lyx::to_ascii(getParam("reference"))))
+                  << sgml::cleanID(buf, runparams, getParam("reference"))
                   << "\">" 
                   << getParam("name")
                   << "</link>";
@@ -152,7 +153,7 @@ InsetRef::type_info InsetRef::types[] = {
        { "pageref",   N_("Page Number"),           N_("Page: ")},
        { "vpageref",  N_("Textual Page Number"),   N_("TextPage: ")},
        { "vref",      N_("Standard+Textual Page"), N_("Ref+Text: ")},
-       { "prettyref", N_("PrettyRef"),             N_("PrettyRef: ")},
+       { "prettyref", N_("PrettyRef"),             N_("FormatRef: ")},
        { "", "", "" }
 };
 
@@ -170,3 +171,6 @@ string const & InsetRef::getName(int type)
 {
        return types[type].latex_name;
 }
+
+
+} // namespace lyx