diff --git a/src/ant/ant/antService.cc b/src/ant/ant/antService.cc index 37ead1bac..d4bd0acff 100644 --- a/src/ant/ant/antService.cc +++ b/src/ant/ant/antService.cc @@ -1766,6 +1766,7 @@ Service::edit_cancel () if (m_move_mode != MoveNone) { m_move_mode = MoveNone; + m_selected.clear (); selection_to_view (); } diff --git a/src/img/img/imgService.cc b/src/img/img/imgService.cc index fc45ffe99..9e27d9449 100644 --- a/src/img/img/imgService.cc +++ b/src/img/img/imgService.cc @@ -1080,6 +1080,7 @@ Service::edit_cancel () { if (m_move_mode != move_none) { m_move_mode = move_none; + m_selected.clear (); selection_to_view (); } } @@ -1118,14 +1119,27 @@ Service::paste () { if (db::Clipboard::instance ().begin () != db::Clipboard::instance ().end ()) { + std::vector new_objects; + for (db::Clipboard::iterator c = db::Clipboard::instance ().begin (); c != db::Clipboard::instance ().end (); ++c) { const db::ClipboardValue *value = dynamic_cast *> (*c); if (value) { img::Object *image = new img::Object (value->get ()); - mp_view->annotation_shapes ().insert (db::DUserObject (image)); + new_objects.push_back (&mp_view->annotation_shapes ().insert (db::DUserObject (image))); } } + // make new objects selected + + if (! new_objects.empty ()) { + + for (auto r = new_objects.begin (); r != new_objects.end (); ++r) { + m_selected.insert (mp_view->annotation_shapes ().iterator_from_pointer (*r)); + } + + selection_to_view (); + + } } } diff --git a/src/lay/lay/gsiDeclLayPlugin.cc b/src/lay/lay/gsiDeclLayPlugin.cc index 5ac999e8a..ca58818e8 100644 --- a/src/lay/lay/gsiDeclLayPlugin.cc +++ b/src/lay/lay/gsiDeclLayPlugin.cc @@ -1173,6 +1173,8 @@ Class decl_PluginFactory ("lay", "PluginFactory", "\n" "Menu items created this way will send a configuration request with 'cname' as the configuration parameter name " "and 'cvalue' as the configuration parameter value.\n" + "If 'cvalue' is a string with a single question mark (\"?\"), the item is a check box that reflects the boolean " + "value of the configuration item.\n" "\n" "This method has been introduced in version 0.27." ) + diff --git a/src/layui/layui/layLayoutViewFunctions.cc b/src/layui/layui/layLayoutViewFunctions.cc index ef359aaea..a0b04f0c8 100644 --- a/src/layui/layui/layLayoutViewFunctions.cc +++ b/src/layui/layui/layLayoutViewFunctions.cc @@ -1191,6 +1191,8 @@ LayoutViewFunctions::cm_remove_unused () void LayoutViewFunctions::do_cm_duplicate (bool interactive) { + view ()->cancel_edits (); + // Do duplicate simply by concatenating copy & paste currently. // Save the clipboard state before in order to preserve the current content db::Clipboard saved_clipboard; @@ -1199,7 +1201,6 @@ LayoutViewFunctions::do_cm_duplicate (bool interactive) try { bool transient_mode = ! view ()->has_selection (); view ()->copy_view_objects (); - view ()->cancel_edits (); if (interactive) { view ()->paste_interactive (transient_mode); } else {