]> git.lyx.org Git - lyx.git/blobdiff - src/insets/mailinset.C
fix #832
[lyx.git] / src / insets / mailinset.C
index bf2271ce6d3ac3b2eb2dd09aafac4cfc70aca945..b7563a0cb0be205cc713634c1ba56c29a229922b 100644 (file)
 #include "mailinset.h"
 #include "inset.h"
 #include "BufferView.h"
-#include "debug.h"
 #include "frontends/LyXView.h"
 #include "frontends/Dialogs.h"
+#include "support/LAssert.h"
 #include "Lsstream.h"
 
 
-void MailInset::showDialog() const
+void MailInset::showDialog(BufferView * bv) const
 {
-       BufferView * bv = inset().view();
-       if (!bv) {
-               lyxerr << "MailInset::showDialog:\n"
-                      << "The BufferView has not been cached!"
-                      << std::endl;
-               return;
-       }
-
+       lyx::Assert(bv);
        bv->owner()->getDialogs().show(name(), inset2string(), &inset());
 }
 
 
-void MailInset::updateDialog() const
+void MailInset::updateDialog(BufferView * bv) const
 {
-       BufferView * bv = inset().view();
-       if (!bv) {
-               lyxerr << "MailInset::showDialog:\n"
-                      << "The BufferView has not been cached!"
-                      << std::endl;
-               return;
-       }
-
+       lyx::Assert(bv);
        bv->owner()->getDialogs().update(name(), inset2string());
 }
 
 
 void MailInset::hideDialog() const
 {
-       BufferView * bv = inset().view();
-       if (!bv) {
-               lyxerr << "MailInset::showDialog:\n"
-                      << "The BufferView has not been cached!"
-                      << std::endl;
-               return;
-       }
-
-       InsetBase * cmp = bv->owner()->getDialogs().getOpenInset(name());
-       if (cmp == &inset())
-               bv->owner()->getDialogs().hide(name());
+       Dialogs::hide(name(), &inset());
 }