mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-18 21:45:24 +00:00
* CutAndPaste.cpp:
- more improvements as suggested by Abdel. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@33245 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
3d15a23796
commit
8af73a3f93
@ -251,7 +251,7 @@ pasteSelectionHelper(Cursor & cur, ParagraphList const & parlist,
|
||||
itt != i_end; ++itt) {
|
||||
if (itt->lyxCode() == REF_CODE) {
|
||||
InsetCommand & ref =
|
||||
dynamic_cast<InsetCommand &>(*itt);
|
||||
static_cast<InsetCommand &>(*itt);
|
||||
if (ref.getParam("reference") == oldname)
|
||||
ref.setParam("reference", newname);
|
||||
}
|
||||
@ -273,7 +273,7 @@ pasteSelectionHelper(Cursor & cur, ParagraphList const & parlist,
|
||||
itt != i_end; ++itt) {
|
||||
if (itt->lyxCode() == REF_CODE) {
|
||||
InsetCommand & ref =
|
||||
dynamic_cast<InsetCommand &>(*itt);
|
||||
static_cast<InsetCommand &>(*itt);
|
||||
if (ref.getParam("reference") == oldname)
|
||||
ref.setParam("reference", newname);
|
||||
}
|
||||
@ -293,14 +293,16 @@ pasteSelectionHelper(Cursor & cur, ParagraphList const & parlist,
|
||||
docstring const oldkey = bib.getParam("key");
|
||||
bib.updateCommand(oldkey, false);
|
||||
docstring const newkey = bib.getParam("key");
|
||||
if (oldkey != newkey) {
|
||||
// adapt the references
|
||||
for (InsetIterator itt = inset_iterator_begin(in); itt != i_end; ++itt) {
|
||||
if (itt->lyxCode() == CITE_CODE) {
|
||||
InsetCommand & ref = dynamic_cast<InsetCommand &>(*itt);
|
||||
if (ref.getParam("key") == oldkey)
|
||||
ref.setParam("key", newkey);
|
||||
}
|
||||
if (oldkey == newkey)
|
||||
continue;
|
||||
// adapt the references
|
||||
for (InsetIterator itt = inset_iterator_begin(in);
|
||||
itt != i_end; ++itt) {
|
||||
if (itt->lyxCode() == CITE_CODE) {
|
||||
InsetCommand & ref =
|
||||
static_cast<InsetCommand &>(*itt);
|
||||
if (ref.getParam("key") == oldkey)
|
||||
ref.setParam("key", newkey);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user