]> git.lyx.org Git - lyx.git/blobdiff - src/graphics/PreviewedInset.C
If the graphics loader has a copy c-tor it should have copy assignment that does...
[lyx.git] / src / graphics / PreviewedInset.C
index 6cb33c976948c78378b59bde2a57fd737dd06c7e..468d1f65ce0249efbde5901931c2873a2f8cbea8 100644 (file)
@@ -36,6 +36,12 @@ bool PreviewedInset::activated()
 }
 
 
+BufferView * PreviewedInset::view() const
+{
+       return inset_.view();
+}
+
+
 void PreviewedInset::generatePreview()
 {
        if (!Previews::activated() || !previewWanted() ||
@@ -55,8 +61,6 @@ void PreviewedInset::addPreview(grfx::PreviewLoader & ploader)
        if (!Previews::activated() || !previewWanted())
                return;
 
-       setView(ploader.buffer().getUser());
-
        snippet_ = trim(latexString());
        if (snippet_.empty())
                return;
@@ -105,18 +109,10 @@ bool PreviewedInset::previewReady() const
        if (!pimage_)
                return false;
 
-       return pimage_->image(inset_, *view());
+       return pimage_->image();
 }
 
 
-void PreviewedInset::setView(BufferView * bv)
-{
-       if (!bv)
-               return;
-
-       view_ = bv->owner()->view();
-}
-
 void PreviewedInset::imageReady(grfx::PreviewImage const & pimage) const
 {
        // Check snippet against the Inset's current contents
@@ -126,7 +122,7 @@ void PreviewedInset::imageReady(grfx::PreviewImage const & pimage) const
        pimage_ = &pimage;
 
        if (view())
-               view()->updateInset(&inset_, false);
+               view()->updateInset(&inset_);
 }
 
 } // namespace grfx