diff --git a/src/item.cpp b/src/item.cpp index 63bdd02..d1730a6 100755 --- a/src/item.cpp +++ b/src/item.cpp @@ -122,7 +122,7 @@ Item::Item() -Item::Item(const Item & i) : type(i.type), text(i.text), functions(i.functions) +Item::Item(const Item & i) : type(i.type), text(i.text), file_name(i.file_name), functions(i.functions) { CopyItemTable(i); } @@ -133,8 +133,10 @@ Item & Item::operator=(const Item & i) { type = i.type; text = i.text; + file_name = i.file_name; functions = i.functions; + ClearItems(); CopyItemTable(i); return *this; diff --git a/src/pattern.cpp b/src/pattern.cpp index 2176378..048096d 100755 --- a/src/pattern.cpp +++ b/src/pattern.cpp @@ -374,7 +374,7 @@ void Pattern::ReadFile(const wchar_t * name, std::wstring & result) { if( !IsFileCorrect(name) ) { - CreateMsg(result, L"incorrect file name:", name); + CreateMsg(result, L"incorrect file name: ", name); } else { @@ -388,7 +388,6 @@ void Pattern::ReadFile(const wchar_t * name, std::wstring & result) - bool Pattern::ReadFileFromDir(const std::wstring & dir, const wchar_t * name, std::wstring & result) { if( dir.empty() ) @@ -397,7 +396,6 @@ bool Pattern::ReadFileFromDir(const std::wstring & dir, const wchar_t * name, st file_name = dir; file_name += '/'; file_name += name; - WideToUTF8(file_name, afile_name); std::ifstream file(afile_name.c_str());