|
|
@ -106,7 +106,7 @@ bool KXEDocument::save(const TQString &strFileName)
|
|
|
|
if(strEncoding.length() <= 0)
|
|
|
|
if(strEncoding.length() <= 0)
|
|
|
|
pTextCodec = TQTextCodec::codecForLocale(); // default
|
|
|
|
pTextCodec = TQTextCodec::codecForLocale(); // default
|
|
|
|
else
|
|
|
|
else
|
|
|
|
pTextCodec = TQTextCodec::codecForName(strEncoding);
|
|
|
|
pTextCodec = TQTextCodec::codecForName(strEncoding.latin1());
|
|
|
|
|
|
|
|
|
|
|
|
if(pTextCodec == 0)
|
|
|
|
if(pTextCodec == 0)
|
|
|
|
{ if(KMessageBox::questionYesNo(0, i18n("Codec for encoding %1 not found ! Continue saving ?").arg(strEncoding)) != KMessageBox::Yes)
|
|
|
|
{ if(KMessageBox::questionYesNo(0, i18n("Codec for encoding %1 not found ! Continue saving ?").arg(strEncoding)) != KMessageBox::Yes)
|
|
|
@ -222,7 +222,7 @@ bool KXEDocument::open(const TQString &strFileName)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
line = stream.readLine(); // line of text excluding '\n'
|
|
|
|
line = stream.readLine(); // line of text excluding '\n'
|
|
|
|
//printf( "%3d: %s\n", i++, line.latin1() );
|
|
|
|
//printf( "%3d: %s\n", i++, line.latin1() );
|
|
|
|
fileTemporary.writeBlock(line, line.length());
|
|
|
|
fileTemporary.writeBlock(line.utf8(), line.utf8().length());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
pIODevice->close();
|
|
|
|
pIODevice->close();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -244,7 +244,7 @@ bool KXEDocument::open(const TQString &strFileName)
|
|
|
|
|
|
|
|
|
|
|
|
// For KOffice files let user to choose maindoc or documentinfo
|
|
|
|
// For KOffice files let user to choose maindoc or documentinfo
|
|
|
|
if(strCompressedTarEntryName.length() == 0)
|
|
|
|
if(strCompressedTarEntryName.length() == 0)
|
|
|
|
{ KXEChooseStringDialog dlgChooseString(0, 0, i18n("Choose file"), i18n("File:"));
|
|
|
|
{ KXEChooseStringDialog dlgChooseString(0, 0, i18n("Choose file").utf8(), i18n("File:").utf8());
|
|
|
|
dlgChooseString.m_pComboBox->insertItem("maindoc.xml");
|
|
|
|
dlgChooseString.m_pComboBox->insertItem("maindoc.xml");
|
|
|
|
dlgChooseString.m_pComboBox->insertItem("documentinfo.xml");
|
|
|
|
dlgChooseString.m_pComboBox->insertItem("documentinfo.xml");
|
|
|
|
|
|
|
|
|
|
|
@ -321,7 +321,7 @@ bool KXEDocument::open(const TQString &strFileName)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
strEncoding = strFirstLine.mid(iStart, iEnd - iStart);
|
|
|
|
strEncoding = strFirstLine.mid(iStart, iEnd - iStart);
|
|
|
|
|
|
|
|
|
|
|
|
TQTextCodec *pTextCodec = TQTextCodec::codecForName(strEncoding);
|
|
|
|
TQTextCodec *pTextCodec = TQTextCodec::codecForName(strEncoding.latin1());
|
|
|
|
if(pTextCodec)
|
|
|
|
if(pTextCodec)
|
|
|
|
txtStreamLocal.setCodec(pTextCodec);
|
|
|
|
txtStreamLocal.setCodec(pTextCodec);
|
|
|
|
else
|
|
|
|
else
|
|
|
|