- if( inset_ != 0 )
- {
- inset_->setParams( *params );
- lv_->view()->updateInset( inset_, true );
- } else {
- lv_->getLyXFunc()->Dispatch( LFUN_INSERT_URL,
- params->getAsString().c_str() );
- }
-}
-
-
-void FormUrl::hide()
-{
- if (dialog_
- && dialog_->form_url
- && dialog_->form_url->visible) {
- fl_hide_form(dialog_->form_url);
- u_.disconnect();
- h_.disconnect();
- }
-
- // free up the dialog for another inset
- inset_ = 0;
- ih_.disconnect();
- dialogIsOpen = false;
-}
-
-
-void FormUrl::free()
-{
- // we don't need to delete u and h here because
- // hide() does that after disconnecting.
- if (dialog_) {
- if (dialog_->form_url
- && dialog_->form_url->visible) {
- hide();
+ if (inset_ != 0) {
+ // Only update if contents have changed
+ if (params != inset_->params()) {
+ inset_->setParams(params);
+ lv_->view()->updateInset(inset_, true);