if (!PathFileExists(res.files[0].c_str()) || !PathFileExists(res.files[1].c_str()))\r
{\r
// not a Perry style patch: diff with itself...\r
- res.files[0] = res.files[1] = path;\r
+ res.files[0] = path;\r
+ res.files[1] = std::move(path);\r
}\r
else\r
{\r
if (ind != 0)
keyname.insert(0, _T("Software\\"));
- m_registryRoot = keyname;
+ m_registryRoot = std::move(keyname);
LONG retValReg = RegCreateKeyEx(HKEY_CURRENT_USER, m_registryRoot.c_str(), 0, nullptr,
REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, nullptr, &hKey, &action);
return false;
}
- m_pShellContextMenu2 = pCMenu2;
- m_pShellContextMenu3 = pCMenu3;
+ m_pShellContextMenu2 = std::move(pCMenu2);
+ m_pShellContextMenu3 = std::move(pCMenu3);
return true;
}
try
{
TFile(m_tempFilenameDst).renameTo(tempFilenameDstNew);
- m_tempFilenameDst = tempFilenameDstNew;
+ m_tempFilenameDst = std::move(tempFilenameDstNew);
}
catch (Exception& e)
{
sLine.append(GetLineChars(line), nLineLength);
}
else
- sLine = _T("");
+ sLine.clear();
if (bTempFile && m_bTableEditing && m_bAllowNewlinesInQuotes)
{
void CDiffWrapper::SetSubstitutionList(std::shared_ptr<SubstitutionList> pSubstitutionList)
{
- m_pSubstitutionList = pSubstitutionList;
+ m_pSubstitutionList = std::move(pSubstitutionList);
}
void CDiffWrapper::SetFilterCommentsSourceDef(const String& ext)
strDest = paths::AddTrailingSlash(dest);
exp.m_question = question;
- exp.m_fromText = sOrig;
- exp.m_toText = sDest;
- exp.m_fromPath = strSrc;
- exp.m_toPath = strDest;
+ exp.m_fromText = std::move(sOrig);
+ exp.m_toText = std::move(sDest);
+ exp.m_fromPath = std::move(strSrc);
+ exp.m_toPath = std::move(strDest);
throw exp;
}
{
String sFileName, sParentDir;
paths::SplitFilename((const TCHAR *)m_pFile->GetFilePath(), &sParentDir, &sFileName, nullptr);
- String sRelDestDir = sFileName.substr(0, sFileName.find_last_of(_T("."))) + _T(".files");
+ String sRelDestDir = sFileName.substr(0, sFileName.find_last_of(_T('.'))) + _T(".files");
String sDestDir = paths::ConcatPath(sParentDir, sRelDestDir);
if (!xml && m_bIncludeFileCmpReport && m_pFileCmpReport != nullptr)
paths::CreateIfNeeded(sDestDir);
try {
// First we build a list of desired actions
FileActionScript actionScript;
- actionScript.m_destBase = destPath;
+ actionScript.m_destBase = std::move(destPath);
DirItemWithIndexIterator begin(m_pIList.get(), -1, true);
DirItemWithIndexIterator end;
FileActionScript *rsltScript;
{
case ID_PREDIFFER_SETTINGS_NONE:
case ID_UNPACKER_SETTINGS_NONE:
- pluginPipeline = _T("");
+ pluginPipeline.clear();
break;
case ID_PREDIFFER_SETTINGS_AUTO:
case ID_UNPACKER_SETTINGS_AUTO:
}
else if (r == CDiffContext::DIFFS_UNKNOWN)
{ // Unique item
- s = _T("");
+ s.clear();
}
else
{
paths::SplitFilename(szFilepath, nullptr, &fileName, nullptr);
FileFilter *pfilter = new FileFilter;
pfilter->fullpath = szFilepath;
- pfilter->name = fileName; // Filename is the default name
+ pfilter->name = std::move(fileName); // Filename is the default name
String sLine;
bool lossy = false;
// Returns false when last line is read
String tmpLine;
bLinesLeft = file.ReadString(tmpLine, &lossy);
- sLine = tmpLine;
+ sLine = std::move(tmpLine);
sLine = strutils::trim_ws(sLine);
if (0 == sLine.compare(0, 5, _T("name:"), 5))
String str = sLine.substr(5);
str = strutils::trim_ws_begin(str);
if (!str.empty())
- pfilter->name = str;
+ pfilter->name = std::move(str);
}
else if (0 == sLine.compare(0, 5, _T("desc:"), 5))
{
String str = sLine.substr(5);
str = strutils::trim_ws_begin(str);
if (!str.empty())
- pfilter->description = str;
+ pfilter->description = std::move(str);
}
else if (0 == sLine.compare(0, 4, _T("def:"), 4))
{
m_filePaths[nBuffer] = path;
m_nBufferType[nBuffer] = BUFFERTYPE::NORMAL;
- m_strDesc[nBuffer] = _T("");
+ m_strDesc[nBuffer].clear();
int nActivePane = m_pImgMergeWindow->GetActivePane();
OpenImages();
else if (localName == ExtendedPropertiesElement)
plugin.m_extendedProperties = value;
else if (localName == ArgumentsElement)
- plugin.m_arguments = value;
+ plugin.m_arguments = std::move(value);
}
else if (localName == PrediffFileElement)
{
// Draw only colored blocks
if (cr != CLR_NONE && cr != GetSysColor(COLOR_WINDOW))
{
- CBrush brush(cr);
CRect drawRect(r);
drawRect.DeflateRect(1, 0);
PropBackups::FOLDER_ORIGINAL)
{
// Put backups to same folder than original file
- bakPath = path;
+ bakPath = std::move(path);
}
else if (GetOptionsMgr()->GetInt(OPT_BACKUP_LOCATION) ==
PropBackups::FOLDER_GLOBAL)
// Put backups to global folder defined in options
bakPath = GetOptionsMgr()->GetString(OPT_BACKUP_GLOBALFOLDER);
if (bakPath.empty())
- bakPath = path;
+ bakPath = std::move(path);
else
bakPath = paths::GetLongPath(bakPath);
}
bool bFileExists = false;
String s;
String str;
- CString title;
if (!strSavePath.empty())
{
if (SelectFile(GetActiveMergeView()->GetSafeHwnd(), s, false, strPath.c_str(), title))
{
CDiffTextBuffer *pBuffer = m_ptBuf[nBuffer].get();
- strSavePath = s;
+ strSavePath = std::move(s);
nSaveResult = pBuffer->SaveToFile(strSavePath, false, sError,
infoTempUnpacker);
}
m_ptBuf[nBuffer]->SetModified(false);
- m_pSaveFileInfo[nBuffer]->Update(strSavePath.c_str());
- m_filePaths[nBuffer] = strSavePath;
- m_pRescanFileInfo[nBuffer]->Update(m_filePaths[nBuffer].c_str());
+ m_pSaveFileInfo[nBuffer]->Update(strSavePath);
+ m_filePaths[nBuffer] = std::move(strSavePath);
+ m_pRescanFileInfo[nBuffer]->Update(m_filePaths[nBuffer]);
UpdateHeaderPath(nBuffer);
bSaveSuccess = true;
result = true;
if (nSaveErrorCode == SAVE_DONE)
{
m_pSaveFileInfo[nBuffer]->Update(strSavePath);
- m_filePaths[nBuffer] = strSavePath;
+ m_filePaths[nBuffer] = std::move(strSavePath);
m_pRescanFileInfo[nBuffer]->Update(m_filePaths[nBuffer]);
UpdateHeaderPath(nBuffer);
bSaveSuccess = true;
}
std::copy_n(m_strDesc, m_nBuffers, strDesc);
- strDesc[nBuffer] = _T("");
+ strDesc[nBuffer].clear();
fileloc[nBuffer].setPath(path);
fileloc[nBuffer].encoding = codepage_detect::Guess(path, GetOptionsMgr()->GetInt(OPT_CP_DETECT));
sTitle += _("Right");\r
sTitle += _T("\n");\r
}\r
- String flags;\r
if (pInfoUnpacker && !pInfoUnpacker->GetPluginPipeline().empty())\r
sTitle += strutils::format(_T("%s: %s\n"), _("Unpacker"), pInfoUnpacker->GetPluginPipeline());\r
if (pInfoPrediffer && !pInfoPrediffer->GetPluginPipeline().empty())\r
if (SelectFileOrFolder(GetSafeHwnd(), s, sfolder.c_str()))
{
m_strPath[index] = s;
- m_strBrowsePath[index] = s;
+ m_strBrowsePath[index] = std::move(s);
UpdateData(FALSE);
UpdateButtonStates();
}
{
m_strPath[0] = paths[0];
m_strPath[1] = paths[1];
- m_strPath[2] = _T("");
+ m_strPath[2].clear();
m_bReadOnly[0] = projItem.GetLeftReadOnly();
m_bReadOnly[1] = projItem.GetRightReadOnly();
m_bReadOnly[2] = false;
void COpenView::DropDown(NMHDR* pNMHDR, LRESULT* pResult, UINT nID, UINT nPopupID)
{
- CRect rcButton, rcView;
+ CRect rcButton;
GetDlgItem(nID)->GetWindowRect(&rcButton);
BCMenu menu;
VERIFY(menu.LoadMenu(nPopupID));
{
String name = strutils::format(_T("%s/%s.exts"), Section, def->name);
String exts = pOptionsMgr->GetDefault<String>(name);
- pExtension[i-1] = exts;
+ pExtension[i-1] = std::move(exts);
}
}
}
{
String name = strutils::format(_T("%s/%s.exts"), Section, def->name);
String exts = pOptionsMgr->GetString(name);
- pExtension[i-1] = exts;
+ pExtension[i-1] = std::move(exts);
}
}
}
PATCHFILES tFiles = m_fileList[0];
if (tFiles.lfile != m_file1 && !tFiles.pathLeft.empty())
- tFiles.pathLeft = _T("");
+ tFiles.pathLeft.clear();
if (tFiles.rfile != m_file2 && !tFiles.pathRight.empty())
- tFiles.pathRight = _T("");
+ tFiles.pathRight.clear();
tFiles.lfile = m_file1;
tFiles.rfile = m_file2;
m_fileList[0] = tFiles;
if (!sDir1.empty())
pathLeft = sDir1 + backslash;
pathLeft += ent1->filename.get();
- tFiles.pathLeft = pathLeft;
+ tFiles.pathLeft = std::move(pathLeft);
}
if (ent2 != nullptr)
pathRight = sDir2 + backslash;
pathRight += ent2->filename.get();
- tFiles.pathRight = pathRight;
+ tFiles.pathRight = std::move(pathRight);
}
fileList->push_back(tFiles);
String nameNew = name + strutils::format(_T("(%d)"), i + 2);
if (pluginNames.find(nameNew) == pluginNames.end())
{
- name = nameNew;
+ name = std::move(nameNew);
break;
}
}
//{{AFX_DATA_INIT(CSelectPluginDlg)
m_bNoExtensionCheck = false;
m_bOpenInSameFrameType = false;
- m_strDescription = _T("");
- m_strExtensions = _T("");
- m_strArguments = _T("");
+ m_strDescription.clear();
+ m_strExtensions.clear();
+ m_strArguments.clear();
//}}AFX_DATA_INIT
// texts for the default unpackers
{
String tempext = temp + ext;
if (MoveFile(temp.c_str(), tempext.c_str()))
- temp = tempext;
+ temp = std::move(tempext);
}
m_path = temp;
}
if (!m_path.empty())
success = !!DeleteFile(m_path.c_str());
if (success)
- m_path = _T("");
+ m_path.clear();
return success;
}
/**
HANDLE h = FindFirstFile(TFile(sTemp).wpath().c_str(), &ffd);
if (h == INVALID_HANDLE_VALUE)
{
- sLong = sTemp;
+ sLong = std::move(sTemp);
if (ptr != nullptr)
{
sLong += '\\';