mirror of https://github.com/KLayout/klayout.git
[consider merging] Bugfix: internal error when copying while move/copy operation of images and rulers
This commit is contained in:
parent
0187abfafc
commit
6a9269a9ae
|
|
@ -1766,6 +1766,7 @@ Service::edit_cancel ()
|
||||||
if (m_move_mode != MoveNone) {
|
if (m_move_mode != MoveNone) {
|
||||||
|
|
||||||
m_move_mode = MoveNone;
|
m_move_mode = MoveNone;
|
||||||
|
m_selected.clear ();
|
||||||
selection_to_view ();
|
selection_to_view ();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1080,6 +1080,7 @@ Service::edit_cancel ()
|
||||||
{
|
{
|
||||||
if (m_move_mode != move_none) {
|
if (m_move_mode != move_none) {
|
||||||
m_move_mode = move_none;
|
m_move_mode = move_none;
|
||||||
|
m_selected.clear ();
|
||||||
selection_to_view ();
|
selection_to_view ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1118,14 +1119,27 @@ Service::paste ()
|
||||||
{
|
{
|
||||||
if (db::Clipboard::instance ().begin () != db::Clipboard::instance ().end ()) {
|
if (db::Clipboard::instance ().begin () != db::Clipboard::instance ().end ()) {
|
||||||
|
|
||||||
|
std::vector<const db::DUserObject *> new_objects;
|
||||||
|
|
||||||
for (db::Clipboard::iterator c = db::Clipboard::instance ().begin (); c != db::Clipboard::instance ().end (); ++c) {
|
for (db::Clipboard::iterator c = db::Clipboard::instance ().begin (); c != db::Clipboard::instance ().end (); ++c) {
|
||||||
const db::ClipboardValue<img::Object> *value = dynamic_cast<const db::ClipboardValue<img::Object> *> (*c);
|
const db::ClipboardValue<img::Object> *value = dynamic_cast<const db::ClipboardValue<img::Object> *> (*c);
|
||||||
if (value) {
|
if (value) {
|
||||||
img::Object *image = new img::Object (value->get ());
|
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 ();
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1173,6 +1173,8 @@ Class<gsi::PluginFactoryBase> decl_PluginFactory ("lay", "PluginFactory",
|
||||||
"\n"
|
"\n"
|
||||||
"Menu items created this way will send a configuration request with 'cname' as the configuration parameter name "
|
"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"
|
"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"
|
"\n"
|
||||||
"This method has been introduced in version 0.27."
|
"This method has been introduced in version 0.27."
|
||||||
) +
|
) +
|
||||||
|
|
|
||||||
|
|
@ -1191,6 +1191,8 @@ LayoutViewFunctions::cm_remove_unused ()
|
||||||
void
|
void
|
||||||
LayoutViewFunctions::do_cm_duplicate (bool interactive)
|
LayoutViewFunctions::do_cm_duplicate (bool interactive)
|
||||||
{
|
{
|
||||||
|
view ()->cancel_edits ();
|
||||||
|
|
||||||
// Do duplicate simply by concatenating copy & paste currently.
|
// Do duplicate simply by concatenating copy & paste currently.
|
||||||
// Save the clipboard state before in order to preserve the current content
|
// Save the clipboard state before in order to preserve the current content
|
||||||
db::Clipboard saved_clipboard;
|
db::Clipboard saved_clipboard;
|
||||||
|
|
@ -1199,7 +1201,6 @@ LayoutViewFunctions::do_cm_duplicate (bool interactive)
|
||||||
try {
|
try {
|
||||||
bool transient_mode = ! view ()->has_selection ();
|
bool transient_mode = ! view ()->has_selection ();
|
||||||
view ()->copy_view_objects ();
|
view ()->copy_view_objects ();
|
||||||
view ()->cancel_edits ();
|
|
||||||
if (interactive) {
|
if (interactive) {
|
||||||
view ()->paste_interactive (transient_mode);
|
view ()->paste_interactive (transient_mode);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue