]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetFootlike.cpp
Reduce caption hardcoding
[lyx.git] / src / insets / InsetFootlike.cpp
index afd23295307bb8d33da8bc6b29f4219728108ca9..cb92320cdfa048ff5a04c6ed28f6dec3888d7e97 100644 (file)
 #include "Font.h"
 #include "MetricsInfo.h"
 
+#include "support/lstrings.h"
+
 #include <iostream>
 
 using namespace std;
 
 namespace lyx {
 
+using support::token;
 
 InsetFootlike::InsetFootlike(Buffer * buf)
        : InsetCollapsable(buf)
@@ -50,14 +53,16 @@ void InsetFootlike::draw(PainterInfo & pi, int x, int y) const
 
 void InsetFootlike::write(ostream & os) const
 {
-       os << to_utf8(layoutName()) << "\n";
+       // The layoutName may contain a "InTitle" qualifier
+       os << to_utf8(token(layoutName(), char_type(':'), 0)) << "\n";
        InsetCollapsable::write(os);
 }
 
 
 bool InsetFootlike::insetAllowed(InsetCode code) const
 {
-       if (code == FOOT_CODE || code == MARGIN_CODE || code == FLOAT_CODE)
+       if (code == FOOT_CODE || code == MARGIN_CODE || code == FLOAT_CODE
+               || code == LISTINGS_CODE)
                return false;
        return InsetCollapsable::insetAllowed(code);
 }