#include "support/filetools.h"
#include "support/Package.h"
#include "support/FileName.h"
-#include "support/lstrings.h"
-#include "support/os.h"
#include <string>
#include <fstream>
using namespace std;
using namespace lyx::support;
-using namespace lyx::support::os;
namespace lyx {
LYXERR(Debug::FILES, "load personal dictionary from: " << fn);
ifstream ifs(fn.toFilesystemEncoding().c_str());
- dirty(words_.size() > 0);
+ dirty(!words_.empty());
words_.clear();
string line;
getline(ifs, line);
if (line == header()) {
while (ifs) {
getline(ifs, line);
- if (!line.empty() && !line[0] == '#') {
+ if (!line.empty() && !(line[0] == '#')) {
docstring const word = from_utf8(line);
insert(word);
}
docstring_list::const_iterator et = words_.end();
ofs << header() << "\n";
- ofs << "# encoding: utf-8\n";
- ofs << "# one word per line\n";
for (; it != et; ++it) {
ofs << to_utf8(*it) << "\n";
}
LYXERR(Debug::FILES, "count of saved items: " << words_.size());
}
+
bool PersonalWordList::equalwords(docstring const & w1, docstring const & w2) const
{
return w1 == w2;