]> git.lyx.org Git - lyx.git/blobdiff - src/insets/mailinset.C
ws changes only
[lyx.git] / src / insets / mailinset.C
index 725ca45bafa91f8f605bcf402368c15c407595c2..c7861f0f7e9dee2fc05b4a9f6df9fbe5609bdf29 100644 (file)
@@ -1,4 +1,3 @@
-// -*- C++ -*-
 /**
  * \file mailinset.C
  * This file is part of LyX, the document processor.
@@ -6,44 +5,37 @@
  *
  * \author Angus Leeming
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
 
 #include "mailinset.h"
-#include "inset.h"
+
 #include "BufferView.h"
-#include "frontends/LyXView.h"
+
 #include "frontends/Dialogs.h"
-#include "Lsstream.h"
+#include "frontends/LyXView.h"
 
 
-void MailInset::showDialog() const
+void MailInset::showDialog(BufferView * bv) const
 {
-       BufferView * bv = inset().view();
-       if (!bv)
-               return;
-
-       bv->owner()->getDialogs().show(name(), inset2string(), &inset());
+       BOOST_ASSERT(bv);
+       bv->owner()->getDialogs().show(name(), inset2string(*bv->buffer()),
+                                      &inset());
 }
 
 
-void MailInset::updateDialog() const
+void MailInset::updateDialog(BufferView * bv) const
 {
-       BufferView * bv = inset().view();
-       if (!bv)
-               return;
-
-       bv->owner()->getDialogs().update(name(), inset2string());
+       BOOST_ASSERT(bv);
+       if(bv->owner()->getDialogs().visible(name()))
+               bv->owner()->getDialogs().update(name(),
+                                                inset2string(*bv->buffer()));
 }
 
 
 void MailInset::hideDialog() const
 {
-       BufferView * bv = inset().view();
-       if (!bv)
-               return;
-
-       bv->owner()->getDialogs().hide(name());
+       Dialogs::hide(name(), &inset());
 }