]> 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 44aa30c048485116a2112ae3461f1a3bfc869cc3..468d1f65ce0249efbde5901931c2873a2f8cbea8 100644 (file)
@@ -1,17 +1,14 @@
 // -*- C++ -*-
 /**
  *  \file PreviewedInset.C
- *  Read the file COPYING
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- * \author Angus Leeming 
+ * \author Angus Leeming
  *
  * Full author contact details are available in file CREDITS
  */
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
 #include <config.h>
 
 #include "PreviewedInset.h"
@@ -39,6 +36,12 @@ bool PreviewedInset::activated()
 }
 
 
+BufferView * PreviewedInset::view() const
+{
+       return inset_.view();
+}
+
+
 void PreviewedInset::generatePreview()
 {
        if (!Previews::activated() || !previewWanted() ||
@@ -58,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;
@@ -108,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
@@ -129,7 +122,7 @@ void PreviewedInset::imageReady(grfx::PreviewImage const & pimage) const
        pimage_ = &pimage;
 
        if (view())
-               view()->updateInset(&inset_, false);
+               view()->updateInset(&inset_);
 }
 
 } // namespace grfx