diff options
Diffstat (limited to 'source/blender/blenkernel/intern/library.c')
-rw-r--r-- | source/blender/blenkernel/intern/library.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 752c2961f28..fa4f9c6ed52 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -378,7 +378,8 @@ bool id_copy(ID *id, ID **newid, bool test) case ID_WM: return false; /* can't be copied from here */ case ID_GD: - return false; /* not implemented */ + if (!test) *newid = (ID *)gpencil_data_duplicate((bGPdata *)id, false); + return true; case ID_MSK: if (!test) *newid = (ID *)BKE_mask_copy((Mask *)id); return true; @@ -1202,7 +1203,7 @@ static ID *is_dupid(ListBase *lb, ID *id, const char *name) /* do not test alphabetic! */ /* optimized */ if (idtest->name[2] == name[0]) { - if (strcmp(name, idtest->name + 2) == 0) break; + if (STREQ(name, idtest->name + 2)) break; } } } @@ -1260,7 +1261,7 @@ static bool check_for_dupid(ListBase *lb, ID *id, char *name) if ( (id != idtest) && (idtest->lib == NULL) && (*name == *(idtest->name + 2)) && - (strncmp(name, idtest->name + 2, left_len) == 0) && + STREQLEN(name, idtest->name + 2, left_len) && (BLI_split_name_num(leftest, &nrtest, idtest->name + 2, '.') == left_len) ) { @@ -1571,7 +1572,7 @@ void test_idbutton(char *name) ID *idtest; - lb = which_libbase(G.main, GS(name) ); + lb = which_libbase(G.main, GS(name)); if (lb == NULL) return; /* search for id */ @@ -1590,7 +1591,7 @@ void rename_id(ID *id, const char *name) ListBase *lb; BLI_strncpy(id->name + 2, name, sizeof(id->name) - 2); - lb = which_libbase(G.main, GS(id->name) ); + lb = which_libbase(G.main, GS(id->name)); new_id(lb, id, name); } |