summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterspellchecksettings.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2014-04-08 13:20:23 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2014-04-08 13:20:23 -0400
commitea7f34d37ac1861fc1e48e11ca5030e424a05a85 (patch)
treeef37281a22a1daec458eb8078287aad8a3af6063 /indra/newview/llfloaterspellchecksettings.cpp
parentd10ecef615953bfa8739282958a62d4fac2c1290 (diff)
parent7e966f28da79d2d24f93a2615c8807421300700c (diff)
merge
Diffstat (limited to 'indra/newview/llfloaterspellchecksettings.cpp')
-rwxr-xr-xindra/newview/llfloaterspellchecksettings.cpp35
1 files changed, 2 insertions, 33 deletions
diff --git a/indra/newview/llfloaterspellchecksettings.cpp b/indra/newview/llfloaterspellchecksettings.cpp
index 5ecdd11918..54c7b4c37d 100755
--- a/indra/newview/llfloaterspellchecksettings.cpp
+++ b/indra/newview/llfloaterspellchecksettings.cpp
@@ -307,12 +307,12 @@ void LLFloaterSpellCheckerImport::onBtnOK()
else
{
std::string settings_dic = LLSpellChecker::getDictionaryUserPath() + mDictionaryBasename + ".dic";
- if ( copyFile( dict_dic, settings_dic ) )
+ if ( LLFile::copy( dict_dic, settings_dic ) )
{
if (gDirUtilp->fileExists(dict_aff))
{
std::string settings_aff = LLSpellChecker::getDictionaryUserPath() + mDictionaryBasename + ".aff";
- if (copyFile( dict_aff, settings_aff ))
+ if ( LLFile::copy( dict_aff, settings_aff ))
{
imported = true;
}
@@ -385,37 +385,6 @@ void LLFloaterSpellCheckerImport::onBtnOK()
closeFloater(false);
}
-bool LLFloaterSpellCheckerImport::copyFile(const std::string from, const std::string to)
-{
- bool copied = false;
- LLFILE* in = LLFile::fopen(from, "rb"); /* Flawfinder: ignore */
- if (in)
- {
- LLFILE* out = LLFile::fopen(to, "wb"); /* Flawfinder: ignore */
- if (out)
- {
- char buf[16384]; /* Flawfinder: ignore */
- size_t readbytes;
- bool write_ok = true;
- while(write_ok && (readbytes = fread(buf, 1, 16384, in))) /* Flawfinder: ignore */
- {
- if (fwrite(buf, 1, readbytes, out) != readbytes)
- {
- LL_WARNS("SpellCheck") << "Short write" << LL_ENDL;
- write_ok = false;
- }
- }
- if ( write_ok )
- {
- copied = true;
- }
- fclose(out);
- }
- }
- fclose(in);
- return copied;
-}
-
std::string LLFloaterSpellCheckerImport::parseXcuFile(const std::string& file_path) const
{
LLXMLNodePtr xml_root;