#include "Buffer.h"
#include "BufferParams.h"
#include "BufferView.h"
-<<<<<<< .mine
#include "BufferParams.h"
-=======
#include "Counters.h"
->>>>>>> .r19497
#include "Cursor.h"
#include "debug.h"
#include "DispatchResult.h"
#include "MetricsInfo.h"
#include "OutputParams.h"
+#include "support/docstream.h"
#include "support/Translator.h"
#include <algorithm>
namespace lyx {
using std::string;
-using std::auto_ptr;
using std::istringstream;
using std::ostream;
using std::ostringstream;
: InsetCollapsable(bp)
{
params_.type = notetranslator().find(label);
- setLayout(bp);
setButtonLabel();
}
}
-auto_ptr<Inset> InsetNote::doClone() const
+Inset * InsetNote::clone() const
{
- return auto_ptr<Inset>(new InsetNote(*this));
+ return new InsetNote(*this);
}
{
params_.read(lex);
InsetCollapsable::read(buf, lex);
- setLayout(buf.params());
- setButtonLabel();
}
{
docstring const label = notetranslator_loc().find(params_.type);
setLabel(label);
- setLabelFont(layout_.labelfont);
-}
-
-
-Color_color InsetNote::backgroundColor() const
-{
- Color_color c;
- switch (params_.type) {
- case InsetNoteParams::Note:
- c = Color::notebg;
- break;
- case InsetNoteParams::Comment:
- c = Color::commentbg;
- break;
- case InsetNoteParams::Greyedout:
- c = Color::greyedoutbg;
- break;
- case InsetNoteParams::Framed:
- c = Color::greyedoutbg;
- break;
- case InsetNoteParams::Shaded:
- c = Color::shadedbg;
- break;
- }
- return c;
}
InsetNoteMailer::string2params(to_utf8(cmd.argument()), params_);
// get a bp from cur:
setLayout(cur.buffer().params());
- setButtonLabel();
break;
case LFUN_INSET_DIALOG_UPDATE:
InsetNoteMailer(*this).updateDialog(&cur.bv());
break;
-
- case LFUN_MOUSE_RELEASE:
- if (cmd.button() == mouse_button::button3 && hitButton(cmd))
- InsetNoteMailer(*this).showDialog(&cur.bv());
- else
- InsetCollapsable::doDispatch(cur, cmd);
- break;
-
default:
InsetCollapsable::doDispatch(cur, cmd);
break;
return 0;
OutputParams runparams(runparams_in);
- string type;
if (params_.type == InsetNoteParams::Comment) {
- type = "comment";
runparams.inComment = true;
// Ignore files that are exported inside a comment
runparams.exportdata.reset(new ExportData);
- } else if (params_.type == InsetNoteParams::Greyedout)
- type = "lyxgreyedout";
- else if (params_.type == InsetNoteParams::Framed)
- type = "framed";
- else if (params_.type == InsetNoteParams::Shaded)
- type = "shaded";
+ }
odocstringstream ss;
- ss << "%\n\\begin{" << from_ascii(type) << "}\n";
- InsetText::latex(buf, ss, runparams);
- ss << "\n\\end{" << from_ascii(type) << "}\n";
+ InsetCollapsable::latex(buf, ss, runparams);
// the space after the comment in 'a[comment] b' will be eaten by the
// comment environment since the space before b is ignored with the
// following latex output: