#include "graphics/PreviewImage.h"
#include "graphics/PreviewLoader.h"
-#include "support/std_sstream.h"
-
#include <boost/bind.hpp>
+#include <sstream>
+
using lyx::cap::grabAndEraseSelection;
using std::endl;
BOOST_ASSERT(mi.base.bv && mi.base.bv->buffer());
bool use_preview = false;
- if (!editing(mi.base.bv) && RenderPreview::activated()) {
+ if (!editing(mi.base.bv) &&
+ RenderPreview::status() == LyXRC::PREVIEW_ON) {
lyx::graphics::PreviewImage const * pimage =
preview_->getPreviewImage(*mi.base.bv->buffer());
use_preview = pimage && pimage->image();
BOOST_ASSERT(pi.base.bv && pi.base.bv->buffer());
bool use_preview = false;
- if (!editing(pi.base.bv) && RenderPreview::activated()) {
+ if (!editing(pi.base.bv) &&
+ RenderPreview::status() == LyXRC::PREVIEW_ON) {
lyx::graphics::PreviewImage const * pimage =
preview_->getPreviewImage(*pi.base.bv->buffer());
use_preview = pimage && pimage->image();
void MathHullInset::addPreview(lyx::graphics::PreviewLoader & ploader) const
{
- string const snippet = latex_string(*this);
- preview_->addPreview(snippet, ploader);
+ if (RenderPreview::status() == LyXRC::PREVIEW_ON) {
+ string const snippet = latex_string(*this);
+ preview_->addPreview(snippet, ploader);
+ }
}
void MathHullInset::notifyCursorLeaves(LCursor & cur)
{
- if (!RenderPreview::activated())
+ if (RenderPreview::status() != LyXRC::PREVIEW_ON)
return;
Buffer const & buffer = cur.buffer();
bool MathHullInset::searchForward(BufferView * bv, string const & str,
bool, bool)
{
+#ifdef WITH_WARNINGS
#warning completely broken
+#endif
static MathHullInset * lastformula = 0;
static CursorBase current = DocIterator(ibegin(nucleus()));
static MathArray ar;
OutputParams const & runparams) const
{
MathMLStream ms(os);
- ms << MTag("equation");
+ string name="equation";
+ if (! label(0).empty()) name += " id=\"" + label(0)+ "\"";
+ ms << MTag(name.c_str());
ms << MTag("alt");
ms << "<[CDATA[";
int res = plaintext(buf, ms.os(), runparams);