mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Following rev 21967: final touch to odocfstream:
- odocfstream: properly fix plaintext output by getting rid of ctor with std::string argument as this can be mixed up with std::ofstream(std::string) ctor where the argument is a file. UTF8 is now the default encoding. - PreviewLoader::Impl::startLoading(): catch another potential iconv exception. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22332 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
31496b4a16
commit
58729e1117
@ -1209,7 +1209,6 @@ void Buffer::makeDocBookFile(FileName const & fname,
|
||||
{
|
||||
LYXERR(Debug::LATEX, "makeDocBookFile...");
|
||||
|
||||
//ofstream ofs;
|
||||
odocfstream ofs;
|
||||
if (!openFileWrite(ofs, fname))
|
||||
return;
|
||||
|
@ -554,7 +554,14 @@ void PreviewLoader::Impl::startLoading()
|
||||
|
||||
// we use the encoding of the buffer
|
||||
Encoding const & enc = buffer_.params().encoding();
|
||||
odocfstream of(enc.iconvName());
|
||||
odocfstream of;
|
||||
try { of.reset(enc.iconvName()); }
|
||||
catch (iconv_codecvt_facet_exception & e) {
|
||||
LYXERR0("Caught iconv exception: " << e.what()
|
||||
<< "\nUnable to create LaTeX file: " << latexfile);
|
||||
return;
|
||||
}
|
||||
|
||||
TexRow texrow;
|
||||
OutputParams runparams(&enc);
|
||||
LaTeXFeatures features(buffer_, buffer_.params(), runparams);
|
||||
|
@ -35,7 +35,6 @@ void writePlaintextFile(Buffer const & buf, FileName const & fname,
|
||||
OutputParams const & runparams)
|
||||
{
|
||||
odocfstream ofs;
|
||||
ofs << setEncoding("UTF-8");
|
||||
if (!openFileWrite(ofs, fname))
|
||||
return;
|
||||
writePlaintextFile(buf, ofs, runparams);
|
||||
|
@ -298,12 +298,7 @@ idocfstream::idocfstream(const char* s, ios_base::openmode mode,
|
||||
|
||||
odocfstream::odocfstream(): base()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
odocfstream::odocfstream(string const & encoding) : base()
|
||||
{
|
||||
setEncoding(*this, encoding, out);
|
||||
setEncoding(*this, "UTF-8", out);
|
||||
}
|
||||
|
||||
|
||||
|
@ -58,7 +58,6 @@ class odocfstream : public std::basic_ofstream<char_type> {
|
||||
typedef std::basic_ofstream<char_type> base;
|
||||
public:
|
||||
odocfstream();
|
||||
odocfstream(std::string const & encoding);
|
||||
explicit odocfstream(const char* s,
|
||||
std::ios_base::openmode mode = std::ios_base::out|std::ios_base::trunc,
|
||||
std::string const & encoding = "UTF-8");
|
||||
|
Loading…
Reference in New Issue
Block a user