r19223 by fschmid - Use the pdf/ps import plugin for certain old AI3 files with are real EPS-Files.
scribus-commit
scribus-commit at lists.scribus.net
Sat Jun 14 16:49:08 UTC 2014
Author: fschmid
Date: Sat Jun 14 16:49:07 2014
New Revision: 19223
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19223
Log:
Use the pdf/ps import plugin for certain old AI3 files with are real EPS-Files.
Modified:
trunk/Scribus/scribus/plugins/import/ai/importaiplugin.cpp
trunk/Scribus/scribus/plugins/import/pdf/importpdfplugin.cpp
Modified: trunk/Scribus/scribus/plugins/import/ai/importaiplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19223&path=/trunk/Scribus/scribus/plugins/import/ai/importaiplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/ai/importaiplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/ai/importaiplugin.cpp Sat Jun 14 16:49:07 2014
@@ -156,8 +156,8 @@
QFile fT(fileName);
if (fT.open(QIODevice::ReadOnly))
{
- QByteArray tempBuf(9, ' ');
- fT.read(tempBuf.data(), 8);
+ QByteArray tempBuf(25, ' ');
+ fT.read(tempBuf.data(), 24);
fT.close();
if (tempBuf.startsWith("%PDF"))
{
@@ -195,6 +195,29 @@
}
qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
}
+ else if (tempBuf.startsWith("%!PS-Adobe-3.0 EPSF-3.0"))
+ {
+ //Import EPS
+ const FileFormat *fmt = LoadSavePlugin::getFormatByExt("eps");
+ if (!fmt)
+ {
+ QMessageBox::warning(ScCore->primaryMainWindow(), CommonStrings::trWarning, tr("The EPS Import plugin could not be found"), 1, 0, 0);
+ return false;
+ }
+ qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
+ bool success = fmt->loadFile(fileName, flags);
+ if (activeTransaction)
+ {
+ activeTransaction->commit();
+ delete activeTransaction;
+ activeTransaction = NULL;
+ }
+ if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
+ UndoManager::instance()->setUndoEnabled(true);
+ if (!success)
+ QMessageBox::warning(ScCore->primaryMainWindow(), CommonStrings::trWarning, tr("The file could not be imported"), 1, 0, 0);
+ return success;
+ }
}
}
#endif
Modified: trunk/Scribus/scribus/plugins/import/pdf/importpdfplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19223&path=/trunk/Scribus/scribus/plugins/import/pdf/importpdfplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pdf/importpdfplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/pdf/importpdfplugin.cpp Sat Jun 14 16:49:07 2014
@@ -184,7 +184,7 @@
bool isCleanedFile = false;
QString cleanFile = "";
QFileInfo fi(fileName);
- QStringList exts = QStringList() << "eps" << "epsf" << "epsi" << "eps2" << "eps3" << "epi" << "ept" << "ps";
+ QStringList exts = QStringList() << "eps" << "epsf" << "epsi" << "eps2" << "eps3" << "epi" << "ept" << "ps" << "ai";
if (exts.contains(fi.suffix().toLower()))
{
if (ScCore->haveGS())
More information about the scribus-commit
mailing list