#include "BufferParams.h"
#include "Counters.h"
#include "Cursor.h"
-#include "debug.h"
+#include "support/debug.h"
#include "DispatchResult.h"
#include "Exporter.h"
#include "FuncRequest.h"
#include "FuncStatus.h"
-#include "gettext.h"
+#include "support/gettext.h"
#include "LaTeXFeatures.h"
#include "Lexer.h"
#include "MetricsInfo.h"
#include "OutputParams.h"
+#include "TextClass.h"
#include "support/docstream.h"
#include "support/Translator.h"
#include <algorithm>
#include <sstream>
+using namespace std;
namespace lyx {
-using std::string;
-using std::istringstream;
-using std::ostream;
-using std::ostringstream;
-
-
namespace {
-typedef Translator<std::string, InsetNoteParams::Type> NoteTranslator;
+typedef Translator<string, InsetNoteParams::Type> NoteTranslator;
typedef Translator<docstring, InsetNoteParams::Type> NoteTranslatorLoc;
NoteTranslator const init_notetranslator()
NoteTranslator translator("Note", InsetNoteParams::Note);
translator.addPair("Comment", InsetNoteParams::Comment);
translator.addPair("Greyedout", InsetNoteParams::Greyedout);
- translator.addPair("Framed", InsetNoteParams::Framed);
- translator.addPair("Shaded", InsetNoteParams::Shaded);
return translator;
}
NoteTranslatorLoc const init_notetranslator_loc()
{
- NoteTranslatorLoc translator(_("Note"), InsetNoteParams::Note);
+ NoteTranslatorLoc translator(_("Note[[InsetNote]]"), InsetNoteParams::Note);
translator.addPair(_("Comment"), InsetNoteParams::Comment);
translator.addPair(_("Greyed out"), InsetNoteParams::Greyedout);
- translator.addPair(_("Framed"), InsetNoteParams::Framed);
- translator.addPair(_("Shaded"), InsetNoteParams::Shaded);
return translator;
}
: InsetCollapsable(bp)
{
params_.type = notetranslator().find(label);
- setButtonLabel();
}
InsetNote::InsetNote(InsetNote const & in)
: InsetCollapsable(in), params_(in.params_)
-{
- setButtonLabel();
-}
+{}
InsetNote::~InsetNote()
Inset::DisplayType InsetNote::display() const
{
- switch (params_.type) {
- case InsetNoteParams::Framed:
- case InsetNoteParams::Shaded:
- return AlignLeft;
- default:
- return Inline;
- }
+ return Inline;
}
}
+bool InsetNote::isMacroScope(Buffer const & buf) const
+{
+ // LyX note has no latex output
+ if (params_.type == InsetNoteParams::Note)
+ return true;
+
+ return InsetCollapsable::isMacroScope(buf);
+}
+
+
int InsetNote::latex(Buffer const & buf, odocstream & os,
OutputParams const & runparams_in) const
{
os << str;
runparams_in.encoding = runparams.encoding;
// Return how many newlines we issued.
- return int(std::count(str.begin(), str.end(), '\n'));
+ return int(count(str.begin(), str.end(), '\n'));
}
features.require("color");
features.require("lyxgreyedout");
}
- if (params_.type == InsetNoteParams::Shaded) {
- features.require("color");
- features.require("framed");
- }
- if (params_.type == InsetNoteParams::Framed)
- features.require("framed");
InsetText::validate(features);
}