Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 10552 → Rev 10553

/trunk/Scribus/scribus/prefs.cpp
285,7 → 285,7
{
tabDocument->marginGroup->setFacingPages(!(layout == singlePage));
tabDocument->choosenLayout = layout;
tabDocument->docLayout->firstPage->setCurrentItem(prefsManager->appPrefs.pageSets[tabDocument->choosenLayout].FirstPage);
tabDocument->docLayout->firstPage->setCurrentIndex(prefsManager->appPrefs.pageSets[tabDocument->choosenLayout].FirstPage);
tabView->gapHorizontal->setValue(prefsManager->appPrefs.pageSets[tabDocument->choosenLayout].GapHorizontal * unitRatio);
tabView->gapVertical->setValue(prefsManager->appPrefs.pageSets[tabDocument->choosenLayout].GapVertical * unitRatio);
}
293,7 → 293,7
void Preferences::unitChange()
{
double oldUnitRatio = unitRatio;
docUnitIndex = tabDocument->unitCombo->currentItem();
docUnitIndex = tabDocument->unitCombo->currentIndex();
unitRatio = unitGetRatioFromIndex(docUnitIndex);
QString suffix = unitGetSuffixFromIndex(docUnitIndex);
double invUnitConversion = 1.0 / oldUnitRatio * unitRatio;
334,7 → 334,7
 
void Preferences::updatePreferences()
{
double prefsUnitRatio = unitGetRatioFromIndex(tabDocument->unitCombo->currentItem());
double prefsUnitRatio = unitGetRatioFromIndex(tabDocument->unitCombo->currentIndex());
 
prefsManager->appPrefs.AppFontSize = tabGeneral->GFsize->value();
prefsManager->appPrefs.PaletteFontSize = tabGeneral->GTFsize->value();
386,7 → 386,7
tabTools->polyWidget->getValues(&prefsManager->appPrefs.toolSettings.polyC, &prefsManager->appPrefs.toolSettings.polyFd, &prefsManager->appPrefs.toolSettings.polyF, &prefsManager->appPrefs.toolSettings.polyS, &prefsManager->appPrefs.toolSettings.polyR);
 
prefsManager->appPrefs.pageSize = tabDocument->prefsPageSizeName;
prefsManager->appPrefs.pageOrientation = tabDocument->pageOrientationComboBox->currentItem();
prefsManager->appPrefs.pageOrientation = tabDocument->pageOrientationComboBox->currentIndex();
prefsManager->appPrefs.PageWidth = tabDocument->pageW;
prefsManager->appPrefs.PageHeight = tabDocument->pageH;
 
399,7 → 399,7
prefsManager->appPrefs.bleeds.Top = tabDocument->marginGroup->topBleed();
prefsManager->appPrefs.bleeds.Left = tabDocument->marginGroup->leftBleed();
prefsManager->appPrefs.bleeds.Right = tabDocument->marginGroup->rightBleed();
prefsManager->appPrefs.pageSets[tabDocument->choosenLayout].FirstPage = tabDocument->docLayout->firstPage->currentItem();
prefsManager->appPrefs.pageSets[tabDocument->choosenLayout].FirstPage = tabDocument->docLayout->firstPage->currentIndex();
 
prefsManager->setImageEditorExecutable(tabExtTools->newImageTool());
prefsManager->setExtBrowserExecutable(tabExtTools->newExtBrowserTool());
424,7 → 424,7
prefsManager->appPrefs.useStandardLI = tabMiscellaneous->useStandardLI->isChecked();
prefsManager->appPrefs.paragraphsLI = tabMiscellaneous->paragraphsLI->value();
 
prefsManager->appPrefs.docUnitIndex = tabDocument->unitCombo->currentItem();
prefsManager->appPrefs.docUnitIndex = tabDocument->unitCombo->currentIndex();
 
prefsManager->appPrefs.toolSettings.defFont = tabTools->fontComboText->currentText();
prefsManager->appPrefs.toolSettings.defSize = tabTools->sizeComboText->currentText().left(2).toInt() * 10;
483,7 → 483,7
prefsManager->appPrefs.toolSettings.dBrush = CommonStrings::None;
prefsManager->appPrefs.toolSettings.dShade = tabTools->shadingFillShape->value();
prefsManager->appPrefs.toolSettings.dShade2 = tabTools->shadingLineShape->value();
switch (tabTools->tabFillCombo->currentItem())
switch (tabTools->tabFillCombo->currentIndex())
{
case 0:
prefsManager->appPrefs.toolSettings.tabFillChar = "";
501,7 → 501,7
prefsManager->appPrefs.toolSettings.tabFillChar = tabTools->tabFillCombo->currentText().right(1);
break;
}
switch (tabTools->comboStyleShape->currentItem())
switch (tabTools->comboStyleShape->currentIndex())
{
case 0:
prefsManager->appPrefs.toolSettings.dLineArt = Qt::SolidLine;
524,7 → 524,7
if (prefsManager->appPrefs.toolSettings.dPenLine == CommonStrings::tr_NoneColor)
prefsManager->appPrefs.toolSettings.dPenLine = CommonStrings::None;
prefsManager->appPrefs.toolSettings.dShadeLine = tabTools->shadingLine->value();
switch (tabTools->comboStyleLine->currentItem())
switch (tabTools->comboStyleLine->currentIndex())
{
case 0:
prefsManager->appPrefs.toolSettings.dLstyleLine = Qt::SolidLine;
543,8 → 543,8
break;
}
prefsManager->appPrefs.toolSettings.dWidthLine = tabTools->lineWidthLine->value();
prefsManager->appPrefs.toolSettings.dStartArrow = tabTools->startArrow->currentItem();
prefsManager->appPrefs.toolSettings.dEndArrow = tabTools->endArrow->currentItem();
prefsManager->appPrefs.toolSettings.dStartArrow = tabTools->startArrow->currentIndex();
prefsManager->appPrefs.toolSettings.dEndArrow = tabTools->endArrow->currentIndex();
prefsManager->appPrefs.toolSettings.magMin = tabTools->minimumZoom->value();
prefsManager->appPrefs.toolSettings.magMax = tabTools->maximumZoom->value();
prefsManager->appPrefs.toolSettings.magStep = tabTools->zoomStep->value();
594,16 → 594,16
prefsManager->appPrefs.GFontSub[itfsu.key()] = tabFonts->FlagsRepl.at(a++)->currentText();
prefsManager->appPrefs.PDF_Options.Thumbnails = tabPDF->CheckBox1->isChecked();
prefsManager->appPrefs.PDF_Options.Compress = tabPDF->Compression->isChecked();
prefsManager->appPrefs.PDF_Options.CompressMethod = tabPDF->CMethod->currentItem();
prefsManager->appPrefs.PDF_Options.Quality = tabPDF->CQuality->currentItem();
prefsManager->appPrefs.PDF_Options.CompressMethod = tabPDF->CMethod->currentIndex();
prefsManager->appPrefs.PDF_Options.Quality = tabPDF->CQuality->currentIndex();
prefsManager->appPrefs.PDF_Options.Resolution = tabPDF->Resolution->value();
prefsManager->appPrefs.PDF_Options.RecalcPic = tabPDF->DSColor->isChecked();
prefsManager->appPrefs.PDF_Options.PicRes = tabPDF->ValC->value();
prefsManager->appPrefs.PDF_Options.Bookmarks = tabPDF->CheckBM->isChecked();
prefsManager->appPrefs.PDF_Options.Binding = tabPDF->ComboBind->currentItem();
prefsManager->appPrefs.PDF_Options.MirrorH = tabPDF->MirrorH->isOn();
prefsManager->appPrefs.PDF_Options.MirrorV = tabPDF->MirrorV->isOn();
prefsManager->appPrefs.PDF_Options.RotateDeg = tabPDF->RotateDeg->currentItem() * 90;
prefsManager->appPrefs.PDF_Options.Binding = tabPDF->ComboBind->currentIndex();
prefsManager->appPrefs.PDF_Options.MirrorH = tabPDF->MirrorH->isChecked();
prefsManager->appPrefs.PDF_Options.MirrorV = tabPDF->MirrorV->isChecked();
prefsManager->appPrefs.PDF_Options.RotateDeg = tabPDF->RotateDeg->currentIndex() * 90;
prefsManager->appPrefs.PDF_Options.Articles = tabPDF->Article->isChecked();
prefsManager->appPrefs.PDF_Options.Encrypt = tabPDF->Encry->isChecked();
prefsManager->appPrefs.PDF_Options.UseLPI = tabPDF->UseLPI->isChecked();
618,7 → 618,7
if (tabPDF->Encry->isChecked())
{
int Perm = -64;
if (tabPDF->PDFVersionCombo->currentItem() == 1)
if (tabPDF->PDFVersionCombo->currentIndex() == 1)
Perm &= ~0x00240000;
if (tabPDF->PrintSec->isChecked())
Perm += 4;
632,15 → 632,15
prefsManager->appPrefs.PDF_Options.PassOwner = tabPDF->PassOwner->text();
prefsManager->appPrefs.PDF_Options.PassUser = tabPDF->PassUser->text();
}
if (tabPDF->PDFVersionCombo->currentItem() == 0)
if (tabPDF->PDFVersionCombo->currentIndex() == 0)
prefsManager->appPrefs.PDF_Options.Version = PDFOptions::PDFVersion_13;
if (tabPDF->PDFVersionCombo->currentItem() == 1)
if (tabPDF->PDFVersionCombo->currentIndex() == 1)
prefsManager->appPrefs.PDF_Options.Version = PDFOptions::PDFVersion_14;
if (tabPDF->PDFVersionCombo->currentItem() == 2)
if (tabPDF->PDFVersionCombo->currentIndex() == 2)
prefsManager->appPrefs.PDF_Options.Version = PDFOptions::PDFVersion_15;
if (tabPDF->PDFVersionCombo->currentItem() == 3)
if (tabPDF->PDFVersionCombo->currentIndex() == 3)
prefsManager->appPrefs.PDF_Options.Version = PDFOptions::PDFVersion_X3;
if (tabPDF->OutCombo->currentItem() == 0)
if (tabPDF->OutCombo->currentIndex() == 0)
{
prefsManager->appPrefs.PDF_Options.isGrayscale = false;
prefsManager->appPrefs.PDF_Options.UseRGB = true;
649,7 → 649,7
}
else
{
if (tabPDF->OutCombo->currentItem() == 2)
if (tabPDF->OutCombo->currentIndex() == 2)
{
prefsManager->appPrefs.PDF_Options.isGrayscale = true;
prefsManager->appPrefs.PDF_Options.UseRGB = false;
664,8 → 664,8
{
prefsManager->appPrefs.PDF_Options.UseProfiles = tabPDF->EmbedProfs->isChecked();
prefsManager->appPrefs.PDF_Options.UseProfiles2 = tabPDF->EmbedProfs2->isChecked();
prefsManager->appPrefs.PDF_Options.Intent = tabPDF->IntendS->currentItem();
prefsManager->appPrefs.PDF_Options.Intent2 = tabPDF->IntendI->currentItem();
prefsManager->appPrefs.PDF_Options.Intent = tabPDF->IntendS->currentIndex();
prefsManager->appPrefs.PDF_Options.Intent2 = tabPDF->IntendI->currentIndex();
prefsManager->appPrefs.PDF_Options.EmbeddedI = tabPDF->NoEmbedded->isChecked();
prefsManager->appPrefs.PDF_Options.SolidProf = tabPDF->SolidPr->currentText();
prefsManager->appPrefs.PDF_Options.ImageProf = tabPDF->ImageP->currentText();
/trunk/Scribus/scribus/prefsmanager.cpp
718,7 → 718,7
QTextStream tsx(&fontPrefsFile12);
QString extraPath = tsx.readAll();
fontPrefsFile12.close();
QStringList extraFonts = QStringList::split("\n",extraPath);
QStringList extraFonts = extraPath.split("\n");
for (int i = 0; i < extraFonts.count(); ++i)
fontPrefs->set(i, 0, extraFonts[i]);
}
1046,7 → 1046,7
appPrefs.KeyActions.insert(actName, ke);
}
else
qDebug("%s", QString("Action Name: %1 does not exist").arg(actName).ascii());
qDebug("%s", QString("Action Name: %1 does not exist").arg(actName).toAscii().constData());
}
}
 
1533,7 → 1533,7
if(!f.open(QIODevice::WriteOnly))
{
m_lastError = tr("Could not open preferences file \"%1\" for writing: %2")
.arg(ho).arg(qApp->translate("QFile",f.errorString()));
.arg(ho).arg(qApp->translate("QFile",f.errorString().toLatin1().constData()));
}
else
{
1546,7 → 1546,7
else
m_lastError = tr("Writing to preferences file \"%1\" failed: "
"QIODevice status code %2")
.arg(ho).arg(f.status());
.arg(ho).arg(f.errorString());
}
if (f.isOpen())
f.close();
1560,7 → 1560,7
if(!f.open(QIODevice::ReadOnly))
{
m_lastError = tr("Failed to open prefs file \"%1\": %2")
.arg(ho).arg( qApp->translate("QFile",f.errorString()) );
.arg(ho).arg( qApp->translate("QFile",f.errorString().toLatin1().constData()) );
return false;
}
QTextStream ts(&f);
2168,7 → 2168,7
}
QFont apf = qApp->font();
apf.setPointSize(appPrefs.AppFontSize);
qApp->setFont(apf,true);
qApp->setFont(apf);
return true;
}
 
/trunk/Scribus/scribus/picsearchoptions.cpp
35,9 → 35,10
//#include "picsearchoptions.moc"
#include "filesearch.h"
 
PicSearchOptions::PicSearchOptions(QWidget* parent, const QString & fileName, const QString & searchBase) : QDialog( parent, "PicSearchOptions", true, 0 )
PicSearchOptions::PicSearchOptions(QWidget* parent, const QString & fileName, const QString & searchBase) : QDialog( parent )
{
setupUi(this);
setModal(true);
m_fileName = fileName;
fileEdit->setText(fileName);
directoryEdit->setText(searchBase);
79,7 → 80,7
workDir = QDir::homePath();
#endif
QString searchBase;
searchBase = QFileDialog::getExistingDirectory( workDir, NULL, NULL, tr("Select a base directory for search"));
searchBase = QFileDialog::getExistingDirectory( this, workDir, tr("Select a base directory for search"));
if( searchBase.isEmpty() || !QDir().exists(searchBase) )
return;
directoryEdit->setText(searchBase);
/trunk/Scribus/scribus/picstatus.cpp
83,7 → 83,7
p.begin(&pm);
p.fillRect(0, 0, 128, 128, imageViewArea->palette().window());
p.setPen(QPen(Qt::black, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin));
p.setBrush(paletteBackgroundColor());
p.setBrush(palette().window());
p.drawRoundRect(0, 0, 127, 127, 10, 10);
p.setPen(Qt::NoPen);
p.setBrush(b);
146,9 → 146,9
if (currItem->PicAvail)
{
QFileInfo fi = QFileInfo(currItem->Pfile);
QString ext = fi.extension(false).toLower();
QString ext = fi.suffix().toLower();
displayName->setText(fi.fileName());
displayPath->setText(QDir::convertSeparators(fi.dirPath()));
displayPath->setText(QDir::convertSeparators(fi.path()));
QString format = "";
switch (currItem->pixm.imgInfo.type)
{
201,7 → 201,7
{
QFileInfo fi = QFileInfo(currItem->Pfile);
displayName->setText(fi.fileName());
displayPath->setText(QDir::convertSeparators(fi.dirPath()));
displayPath->setText(QDir::convertSeparators(fi.path()));
}
else
{
/trunk/Scribus/scribus/pageitem.cpp
1962,7 → 1962,7
for (QList<uint>::Iterator it2 = Segments.begin(); it2 != it2end; ++it2)
{
if (NamedLStyle.isEmpty())
p->drawPolyline(pts, FirstVal, (*it2)-FirstVal);
p->drawPolyline(pts.constData() + FirstVal, (*it2)-FirstVal);
else
{
multiLine ml = m_Doc->MLineStyles[NamedLStyle];
1974,13 → 1974,13
static_cast<Qt::PenStyle>(ml[it].Dash),
static_cast<Qt::PenCapStyle>(ml[it].LineEnd),
static_cast<Qt::PenJoinStyle>(ml[it].LineJoin)));
p->drawPolyline(pts, FirstVal, (*it2)-FirstVal);
p->drawPolyline(pts.constData() + FirstVal, (*it2)-FirstVal);
}
}
FirstVal = (*it2);
}
if (NamedLStyle.isEmpty())
p->drawPolyline(pts, FirstVal);
p->drawPolyline(pts.constData() + FirstVal, pts.size() - FirstVal);
else
{
multiLine ml = m_Doc->MLineStyles[NamedLStyle];
1992,7 → 1992,7
static_cast<Qt::PenStyle>(ml[it].Dash),
static_cast<Qt::PenCapStyle>(ml[it].LineEnd),
static_cast<Qt::PenJoinStyle>(ml[it].LineJoin)));
p->drawPolyline(pts, FirstVal);
p->drawPolyline(pts.constData() + FirstVal, pts.size() - FirstVal);
}
}
}
2767,7 → 2767,6
bool SnapGuidesBackup = m_Doc->SnapGuides;
m_Doc->useRaster = false;
m_Doc->SnapGuides = false;
ScribusView* view = m_Doc->view();
SimpleState *ss = dynamic_cast<SimpleState*>(state);
bool oldMPMode=m_Doc->masterPageMode();
m_Doc->setMasterPageMode(!OnMasterPage.isEmpty());
3384,7 → 3383,7
// Copy of fred (5)
// ^^^^^^^^^^^^ ^ (where ^ means captured)
static QRegExp rx("^(.*)\\s+\\((\\d+)\\)$");
int numMatches = rx.searchRev(newname);
int numMatches = rx.lastIndexIn(newname);
// Add a (number) suffix to the end of the name. We start at the
// old suffix's value if there was one, or at 2 if there was not.
int suffixnum = 2;
3746,16 → 3745,14
return itemRect.contains(x, y);
}
 
bool PageItem::mouseWithinItem(QWidget* vport, const int x, const int y, double scale) const
bool PageItem::mouseWithinItem(const int x, const int y, double scale) const
{
QPainter p;
QRect transRect;
p.begin(vport);
p.translate(static_cast<int>(Xpos * scale), static_cast<int>(Ypos*scale));
QMatrix p;
QRectF transRect;
p.translate(Xpos * scale, Ypos*scale);
p.scale(scale, scale);
p.rotate(rotation());
transRect = p.xForm(QRect(0, 0, static_cast<int>(width()), static_cast<int>(height())));
p.end();
transRect = p.mapRect(QRectF(0.0, 0.0, width(), height()));
return transRect.contains(x, y);
}
 
3779,7 → 3776,7
CMSettings cms(m_Doc, IProfile, IRender);
if (!pixm.LoadPicture(filename, cms, UseEmbedded, true, ScImage::RGBProof, gsRes, &dummy, showMsg))
{
Pfile = fi.absFilePath();
Pfile = fi.absoluteFilePath();
PicAvail = false;
// PicArt = false;
return false;
3822,7 → 3819,7
}
}
Pfile = fi.absFilePath();
Pfile = fi.absoluteFilePath();
if (reload && pixm.imgInfo.PDSpathData.contains(clPath))
{
imageClip = pixm.imgInfo.PDSpathData[clPath].copy();
3836,7 → 3833,7
BBoxH = pixm.imgInfo.BBoxH;
OrigW = pixm.width();
OrigH = pixm.height();
QString ext = fi.extension(false).toLower();
QString ext = fi.suffix().toLower();
isRaster = !(extensionIndicatesPDF(ext) || extensionIndicatesEPSorPS(ext));
UseEmbedded=pixm.imgInfo.isEmbedded;
if (pixm.imgInfo.isEmbedded)
/trunk/Scribus/scribus/pageitem_textframe.cpp
26,7 → 26,7
#include <QMatrix>
#include <QPoint>
#include <QRegion>
 
#include <QPalette>
#include <cmath>
#include <cassert>
 
205,7 → 205,7
 
static void dumpIt(const ParagraphStyle& pstyle, QString indent = QString("->"))
{
qDebug(QString("%6%1/%2 @ %3: %4--%5 linespa%6: %7 align%8")
QString db = QString("%6%1/%2 @ %3: %4--%5 linespa%6: %7 align%8")
.arg(pstyle.name())
.arg(pstyle.parent())
.arg( (unsigned long int) &pstyle)
214,7 → 214,8
.arg(indent)
.arg(pstyle.lineSpacingMode())
.arg(pstyle.lineSpacing())
.arg(pstyle.alignment()));
.arg(pstyle.alignment());
qDebug(db.toLatin1().constData());
static QString more(" ");
if (pstyle.hasParent())
dumpIt(*dynamic_cast<const ParagraphStyle*>(pstyle.parentStyle()), more + indent);
223,12 → 224,12
 
static const bool legacy = true;
 
 
/*
static void layoutDropCap(GlyphLayout layout, double curX, double curY, double offsetX, double offsetY, double dropCapDrop)
{
}
*/
 
 
/**
Clones the tab fill char as often as necssary after all distances are known
*/
730,7 → 731,7
invalid = false;
PageItem_TextFrame* prevInChain = dynamic_cast<PageItem_TextFrame*>(BackBox);
if (!prevInChain)
qDebug(QString("layout(): backBox=%1 is no textframe!!").arg((ulong)BackBox));
qDebug(QString("layout(): backBox=%1 is no textframe!!").arg((ulong)BackBox).toLatin1().constData());
else
BackBox->layout();
return;
2339,7 → 2340,7
{
wide = hl->glyph.xadvance;
p->setFillMode(1);
p->setBrush(qApp->palette().color(QPalette::Active, QColorGroup::Highlight));
p->setBrush(qApp->palette().color(QPalette::Active, QPalette::Highlight));
p->setLineWidth(0);
// if ((a > 0) && (QChar(hl->glyph.glyph) == SpecialChars::TAB))
// {
2348,7 → 2349,7
// }
if (!m_Doc->RePos)
p->drawRect(xcoZli, ls.y + hl->glyph.yoffset - asce * hl->glyph.scaleV, wide+1, (asce+desc) * (hl->glyph.scaleV));
p->setBrush(qApp->palette().color(QPalette::Active, QColorGroup::HighlightedText));
p->setBrush(qApp->palette().color(QPalette::Active, QPalette::HighlightedText));
}
// FIXME temporary solution to have at least something like a cursor
if ((a == CPos-1) && (m_Doc->appMode == modeEdit))
2547,7 → 2548,7
{
int oldPos = CPos; // 15-mar-2004 jjsa for cursor movement with Shift + Arrow key
int kk = k->key();
int as = k->ascii();
int as = k->text()[0].unicode();
QString uc = k->text();
QString cr, Tcha, Twort;
uint Tcoun;
2570,8 → 2571,8
view->slotDoCurs(false);
switch (kk)
{
case Qt::Key_Prior:
case Qt::Key_Next:
case Qt::Key_PageDown:
case Qt::Key_PageUp:
case Qt::Key_End:
case Qt::Key_Home:
case Qt::Key_Right:
2781,13 → 2782,13
// view->RefreshItem(this);
m_Doc->scMW()->setTBvals(this);
break;
case Qt::Key_Prior:
case Qt::Key_PageUp:
CPos = itemText.startOfFrame(CPos);
if ( buttonModifiers & Qt::ShiftModifier )
ExpandSel(-1, oldPos);
m_Doc->scMW()->setTBvals(this);
break;
case Qt::Key_Next:
case Qt::Key_PageDown:
CPos = itemText.endOfFrame(CPos);
if ( buttonModifiers & Qt::ShiftModifier )
ExpandSel(1, oldPos);
/trunk/Scribus/scribus/pdflib_core.cpp
85,11 → 85,11
ResCount(0),
NDnam("LI"),
NDnum(0),
KeyGen(32),
OwnerKey(32),
UserKey(32),
FileID(16),
EncryKey(5),
KeyGen(""),
OwnerKey(""),
UserKey(""),
FileID(""),
EncryKey(""),
Encrypt(0),
KeyLen(5),
colorsToUse(),
99,6 → 99,11
abortExport(false),
usingGUI(ScCore->usingGUI())
{
KeyGen.resize(32);
OwnerKey.resize(32);
UserKey.resize(32);
FileID.resize(16);
EncryKey.resize(5);
Catalog.Outlines = 2;
Catalog.PageTree = 3;
Catalog.Dest = 4;
272,11 → 277,11
rc4_context_t rc4;
int dlen = 0;
QString tmp(in);
QByteArray us(tmp.length());
QByteArray ou(tmp.length());
QByteArray us(tmp.length(), ' ');
QByteArray ou(tmp.length(), ' ');
for (int a = 0; a < tmp.length(); ++a)
us[a] = QChar(tmp.at(a)).cell();
QByteArray data(10);
QByteArray data(10, ' ');
if (KeyLen > 5)
data.resize(21);
for (int cd = 0; cd < KeyLen; ++cd)
289,7 → 294,7
data[dlen++] = ObjNum >> 16;
data[dlen++] = 0;
data[dlen++] = 0;
QByteArray step1(16);
QByteArray step1(16, ' ');
step1 = ComputeMD5Sum(&data);
rc4_init(&rc4, reinterpret_cast<uchar*>(step1.data()), qMin(KeyLen+5, 16));
rc4_encrypt(&rc4, reinterpret_cast<uchar*>(us.data()), reinterpret_cast<uchar*>(ou.data()), tmp.length());
307,8 → 312,8
return in;
rc4_context_t rc4;
int dlen = 0;
QByteArray out(in.size());
QByteArray data(10);
QByteArray out(in.size(), ' ');
QByteArray data(10, ' ');
if (KeyLen > 5)
data.resize(21);
for (int cd = 0; cd < KeyLen; ++cd)
321,7 → 326,7
data[dlen++] = ObjNum >> 16;
data[dlen++] = 0;
data[dlen++] = 0;
QByteArray step1(16);
QByteArray step1(16, ' ');
step1 = ComputeMD5Sum(&data);
rc4_init(&rc4, reinterpret_cast<uchar*>(step1.data()), qMin(KeyLen+5, 16));
rc4_encrypt(&rc4, reinterpret_cast<const uchar*>(in.constData()), reinterpret_cast<uchar*>(out.data()), in.size());
338,11 → 343,11
if (in.length() < 3)
return "<>";
tmp = in.mid(1, in.length()-2);
QByteArray us(tmp.length());
QByteArray ou(tmp.length());
QByteArray us(tmp.length(), ' ');
QByteArray ou(tmp.length(), ' ');
for (int a = 0; a < tmp.length(); ++a)
us[a] = static_cast<uchar>(QChar(tmp.at(a)).cell());
QByteArray data(10);
QByteArray data(10, ' ');
if (KeyLen > 5)
data.resize(21);
for (int cd = 0; cd < KeyLen; ++cd)
355,7 → 360,7
data[dlen++] = ObjNum >> 16;
data[dlen++] = 0;
data[dlen++] = 0;
QByteArray step1(16);
QByteArray step1(16, ' ');
step1 = ComputeMD5Sum(&data);
rc4_init(&rc4, reinterpret_cast<uchar*>(step1.data()), qMin(KeyLen+5, 16));
rc4_encrypt(&rc4, reinterpret_cast<uchar*>(us.data()), reinterpret_cast<uchar*>(ou.data()), tmp.length());
384,8 → 389,8
int dlen = 0;
tmp = in.mid(1, in.length()-2);
QByteArray us = EncodeUTF16(tmp);
QByteArray ou(us.size());
QByteArray data(10);
QByteArray ou(us.size(), ' ');
QByteArray data(10, ' ');
if (KeyLen > 5)
data.resize(21);
for (int cd = 0; cd < KeyLen; ++cd)
398,7 → 403,7
data[dlen++] = ObjNum >> 16;
data[dlen++] = 0;
data[dlen++] = 0;
QByteArray step1(16);
QByteArray step1(16, ' ');
step1 = ComputeMD5Sum(&data);
rc4_init(&rc4, reinterpret_cast<uchar*>(step1.data()), qMin(KeyLen+5, 16));
rc4_encrypt(&rc4, reinterpret_cast<uchar*>(us.data()), reinterpret_cast<uchar*>(ou.data()), ou.size());
428,7 → 433,7
rc4_context_t rc4;
QString pw(FitKey(User));
QString pw2(FitKey(Owner.isEmpty() ? User : Owner));
QByteArray step1(16);
QByteArray step1(16, ' ');
step1 = ComputeMD5(pw2);
if (KeyLen > 5)
{
435,8 → 440,8
for (int kl = 0; kl < 50; ++kl)
step1 = ComputeMD5Sum(&step1);
}
QByteArray us(32);
QByteArray enk(16);
QByteArray us(32, ' ');
QByteArray enk(16, ' ');
if (KeyLen > 5)
{
for (uint a2 = 0; a2 < 32; ++a2)
464,8 → 469,8
{
rc4_context_t rc4;
QString pw(FitKey(User));
QByteArray step1(16);
QByteArray perm(4);
QByteArray step1(16, ' ');
QByteArray perm(4, ' ');
uint perm_value = static_cast<uint>(Permission);
perm[0] = perm_value;
perm[1] = perm_value >> 8;
494,7 → 499,7
for (uint a4 = 0; a4 < 16; ++a4)
pr2 += QChar(FileID[a4]);
step1 = ComputeMD5(pr2);
QByteArray enk(16);
QByteArray enk(16, ' ');
for (uint a3 = 0; a3 < 16; ++a3)
UserKey[a3] = step1[a3];
for (int rl = 0; rl < 20; rl++)
515,7 → 520,7
QByteArray PDFLibCore::ComputeMD5(const QString& in)
{
uint inlen=in.length();
QByteArray TBytes(inlen);
QByteArray TBytes(inlen, ' ');
for (uint a = 0; a < inlen; ++a)
TBytes[a] = static_cast<uchar>(QChar(in.at(a)).cell());
return ComputeMD5Sum(&TBytes);
523,7 → 528,7
 
bool PDFLibCore::PDF_Begin_Doc(const QString& fn, SCFonts &AllFonts, QMap<QString, QMap<uint, FPointArray> > DocFonts, BookMView* vi)
{
Spool.setName(fn);
Spool.setFileName(fn);
if (!Spool.open(QIODevice::WriteOnly))
return false;
outStream.setDevice(&Spool);
2099,7 → 2104,7
Seite.AObjects.clear();
if (Options.Thumbnails)
{
ScImage img(pm.convertToImage());
ScImage img(pm.toImage());
QByteArray array = img.ImageToArray();
if ((Options.Compress) && (CompAvail))
array = CompressArray(&array);
4546,7 → 4551,7
if (Options.isGrayscale)
{
tmpR = ScColorEngine::getShadeColor(tmpC, &doc, Shade);
tmpR.rgb(&h, &s, &v);
tmpR.getRgb(&h, &s, &v);
tmp = FToStr((0.3 * h + 0.59 * s + 0.11 * v) / 255.0);
return tmp;
}
4553,7 → 4558,7
if (Options.UseRGB)
{
tmpR = ScColorEngine::getShadeColor(tmpC, &doc, Shade);
tmpR.rgb(&h, &s, &v);
tmpR.getRgb(&h, &s, &v);
tmp = FToStr(h / 255.0)+" "+FToStr(s / 255.0)+" "+FToStr(v / 255.0);
}
else
4603,7 → 4608,7
if (Options.isGrayscale)
{
tmpR = ScColorEngine::getShadeColor(tmpC, &doc, Shade);
tmpR.rgb(&h, &s, &v);
tmpR.getRgb(&h, &s, &v);
tmp = FToStr((0.3 * h + 0.59 * s + 0.11 * v) / 255.0);
return tmp;
}
4610,7 → 4615,7
if (Options.UseRGB)
{
tmpR = ScColorEngine::getShadeColor(tmpC, &doc, Shade);
tmpR.rgb(&h, &s, &v);
tmpR.getRgb(&h, &s, &v);
tmp = FToStr(h / 255.0)+" "+FToStr(s / 255.0)+" "+FToStr(v / 255.0);
}
else
/trunk/Scribus/scribus/pdfopts.cpp
61,13 → 61,13
PDFExportLayout = new QVBoxLayout( this );
PDFExportLayout->setSpacing( 5 );
PDFExportLayout->setMargin( 10 );
Name = new QGroupBox( this, "GroupBox" );
Name = new QGroupBox( this );
Name->setTitle( tr( "O&utput to File:" ) );
NameLayout = new QGridLayout( Name );
NameLayout->setSpacing( 5 );
NameLayout->setMargin( 10 );
NameLayout->setAlignment( Qt::AlignTop );
fileNameLineEdit = new QLineEdit( Name, "fileNameLineEdit" );
fileNameLineEdit = new QLineEdit( Name );
fileNameLineEdit->setMinimumSize( QSize( 268, 22 ) );
if (!Opts.Datei.isEmpty())
fileNameLineEdit->setText( QDir::convertSeparators(Opts.Datei) );
76,13 → 76,13
QFileInfo fi(docFileName);
if (fi.exists())
{
QString fileName(fi.dirPath()+"/"+fi.baseName()+".pdf");
QString fileName(fi.path()+"/"+fi.baseName()+".pdf");
fileNameLineEdit->setText( QDir::convertSeparators(fileName) );
}
else
{
PrefsContext* dirs = PrefsManager::instance()->prefsFile->getContext("dirs");
QString pdfdir = dirs->get("pdf", fi.dirPath());
QString pdfdir = dirs->get("pdf", fi.path());
if (pdfdir.right(1) != "/")
pdfdir += "/";
QString fileName(pdfdir+fi.baseName()+".pdf");
90,11 → 90,11
}
}
NameLayout->addWidget( fileNameLineEdit, 0, 0 );
FileC = new QToolButton( Name, "FileC" );
FileC = new QToolButton( Name );
FileC->setText( tr( "Cha&nge..." ) );
FileC->setMinimumSize( QSize( 88, 24 ) );
NameLayout->addWidget( FileC, 0, 1 );
multiFile = new QCheckBox( tr( "Output one file for eac&h page" ), Name, "multiFile" );
multiFile = new QCheckBox( tr( "Output one file for eac&h page" ), Name );
multiFile->setChecked(Opts.doMultiFile);
NameLayout->addWidget( multiFile, 1, 0 );
PDFExportLayout->addWidget( Name );
107,11 → 107,11
Layout7->setMargin( 0 );
QSpacerItem* spacer_2 = new QSpacerItem( 2, 2, QSizePolicy::Expanding, QSizePolicy::Minimum );
Layout7->addItem( spacer_2 );
OK = new QPushButton( tr( "&Save" ), this, "OK" );
OK = new QPushButton( tr( "&Save" ), this );
OK->setAutoDefault( true );
OK->setDefault( true );
Layout7->addWidget( OK );
Cancel = new QPushButton( CommonStrings::tr_Cancel, this, "Cancel" );
Cancel = new QPushButton( CommonStrings::tr_Cancel, this );
Layout7->addWidget( Cancel );
PDFExportLayout->addLayout( Layout7 );
if ((Opts.Version == PDFOptions::PDFVersion_X3) && (Options->InfoString->text().isEmpty()))
146,8 → 146,8
QString fn = ScPaths::separatorsToSlashes(fileNameLineEdit->text());
// Checking if the path exists
QFileInfo fi(fn);
QString dirPath = QDir::convertSeparators(fi.dirPath(true));
if (!QFile::exists(fi.dirPath(true)))
QString dirPath = QDir::convertSeparators(fi.absolutePath());
if (!QFile::exists(fi.absolutePath()))
{
if (QMessageBox::question(this, tr( "Save as PDF" ),
tr("%1 does not exists and will be created, continue?").arg(dirPath),
159,7 → 159,7
}
// NOTE: Qt4 contains QDir::mkpath()
QDir d(fn);
QStringList dirList = QStringList::split(QDir::separator(), dirPath);
QStringList dirList = dirPath.split(QDir::separator());
QString existingPath;
#ifndef _WIN32
existingPath = QDir::separator();
190,13 → 190,13
EffVal = Options->EffVal;
EffVal[Options->PgSel].pageViewDuration = Options->PageTime->value();
EffVal[Options->PgSel].pageEffectDuration = Options->EffectTime->value();
EffVal[Options->PgSel].effectType = Options->EffectType->currentItem();
EffVal[Options->PgSel].Dm = Options->EDirection->currentItem();
EffVal[Options->PgSel].M = Options->EDirection_2->currentItem();
EffVal[Options->PgSel].Di = Options->EDirection_2_2->currentItem();
EffVal[Options->PgSel].effectType = Options->EffectType->currentIndex();
EffVal[Options->PgSel].Dm = Options->EDirection->currentIndex();
EffVal[Options->PgSel].M = Options->EDirection_2->currentIndex();
EffVal[Options->PgSel].Di = Options->EDirection_2_2->currentIndex();
Opts.LPISettings[Options->SelLPIcolor].Frequency = Options->LPIfreq->value();
Opts.LPISettings[Options->SelLPIcolor].Angle = Options->LPIangle->value();
Opts.LPISettings[Options->SelLPIcolor].SpotFunc = Options->LPIfunc->currentItem();
Opts.LPISettings[Options->SelLPIcolor].SpotFunc = Options->LPIfunc->currentIndex();
accept();
}
else
233,8 → 233,8
Opts.doMultiFile = multiFile->isChecked();
Opts.Thumbnails = Options->CheckBox1->isChecked();
Opts.Compress = Options->Compression->isChecked();
Opts.CompressMethod = Options->CMethod->currentItem();
Opts.Quality = Options->CQuality->currentItem();
Opts.CompressMethod = Options->CMethod->currentIndex();
Opts.Quality = Options->CQuality->currentIndex();
Opts.Resolution = Options->Resolution->value();
Opts.EmbedList = Options->FontsToEmbed;
Opts.SubsetList = Options->FontsToOutline;
241,11 → 241,11
Opts.RecalcPic = Options->DSColor->isChecked();
Opts.PicRes = Options->ValC->value();
Opts.Bookmarks = Options->CheckBM->isChecked();
Opts.Binding = Options->ComboBind->currentItem();
Opts.MirrorH = Options->MirrorH->isOn();
Opts.MirrorV = Options->MirrorV->isOn();
Opts.Binding = Options->ComboBind->currentIndex();
Opts.MirrorH = Options->MirrorH->isChecked();
Opts.MirrorV = Options->MirrorV->isChecked();
Opts.doClip = Options->ClipMarg->isChecked();
Opts.RotateDeg = Options->RotateDeg->currentItem() * 90;
Opts.RotateDeg = Options->RotateDeg->currentIndex() * 90;
Opts.PresentMode = Options->CheckBox10->isChecked();
Opts.PresentVals = EffVal;
Opts.Articles = Options->Article->isChecked();
285,7 → 285,7
else if (Options->doublePageRight->isChecked())
pgl = PDFOptions::TwoColumnRight;
Opts.PageLayout = pgl;
if (Options->actionCombo->currentItem() != 0)
if (Options->actionCombo->currentIndex() != 0)
Opts.openAction = Options->actionCombo->currentText();
else
Opts.openAction = "";
292,7 → 292,7
if (Options->Encry->isChecked())
{
int Perm = -64;
if (Options->PDFVersionCombo->currentItem() == 1)
if (Options->PDFVersionCombo->currentIndex() == 1)
Perm &= ~0x00240000;
if (Options->PrintSec->isChecked())
Perm += 4;
306,15 → 306,15
Opts.PassOwner = Options->PassOwner->text();
Opts.PassUser = Options->PassUser->text();
}
if (Options->PDFVersionCombo->currentItem() == 0)
if (Options->PDFVersionCombo->currentIndex() == 0)
Opts.Version = PDFOptions::PDFVersion_13;
if (Options->PDFVersionCombo->currentItem() == 1)
if (Options->PDFVersionCombo->currentIndex() == 1)
Opts.Version = PDFOptions::PDFVersion_14;
if (Options->PDFVersionCombo->currentItem() == 2)
if (Options->PDFVersionCombo->currentIndex() == 2)
Opts.Version = PDFOptions::PDFVersion_15;
if (Options->PDFVersionCombo->currentItem() == 3)
if (Options->PDFVersionCombo->currentIndex() == 3)
Opts.Version = PDFOptions::PDFVersion_X3;
if (Options->OutCombo->currentItem() == 0)
if (Options->OutCombo->currentIndex() == 0)
{
Opts.UseRGB = true;
Opts.isGrayscale = false;
323,7 → 323,7
}
else
{
if (Options->OutCombo->currentItem() == 2)
if (Options->OutCombo->currentIndex() == 2)
{
Opts.isGrayscale = true;
Opts.UseRGB = false;
338,8 → 338,8
{
Opts.UseProfiles = Options->EmbedProfs->isChecked();
Opts.UseProfiles2 = Options->EmbedProfs2->isChecked();
Opts.Intent = Options->IntendS->currentItem();
Opts.Intent2 = Options->IntendI->currentItem();
Opts.Intent = Options->IntendS->currentIndex();
Opts.Intent2 = Options->IntendI->currentIndex();
Opts.EmbeddedI = Options->NoEmbedded->isChecked();
Opts.SolidProf = Options->SolidPr->currentText();
Opts.ImageProf = Options->ImageP->currentText();
/trunk/Scribus/scribus/polygonwidget.cpp
41,11 → 41,12
Layout2 = new QHBoxLayout;
Layout2->setMargin(0);
Layout2->setSpacing(5);
Ecken = new QSpinBox( this, "Ecken" );
Ecken = new QSpinBox( this );
Ecken->setMaximum( 999 );
Ecken->setMinimum( 3 );
Ecken->setValue(polyC);
Text1 = new QLabel( Ecken, tr("Corn&ers:"), this, "Text1" );
Text1 = new QLabel( tr("Corn&ers:"), this );
Text1->setBuddy(Ecken);
Layout2->addWidget( Text1 );
Layout2->addWidget( Ecken );
Layout10->addLayout( Layout2 );
59,26 → 60,27
Layout7_2 = new QHBoxLayout;
Layout7_2->setMargin(0);
Layout7_2->setSpacing(5);
Faktor2 = new QSpinBox( this, "Faktor_2" );
Faktor2 = new QSpinBox( this );
Faktor2->setSuffix(" ");
Faktor2->setMaximum( 180 );
Faktor2->setMinimum( -180 );
Faktor2->setValue(static_cast<int>(polyR));
Text2_2 = new QLabel( Faktor2, tr("&Rotation:"), this, "Text2_2" );
Text2_2 = new QLabel( tr("&Rotation:"), this );
Text2_2->setBuddy(Faktor2);
Layout7_2->addWidget( Text2_2 );
Layout7_2->addWidget( Faktor2 );
Layout8_2->addLayout( Layout7_2 );
Slider2 = new QSlider( this, "Slider1_2" );
Slider2 = new QSlider( this );
Slider2->setMinimum( -180 );
Slider2->setMaximum( 180 );
Slider2->setValue(static_cast<int>(polyR));
Slider2->setOrientation( Qt::Horizontal );
Slider2->setTickmarks( QSlider::TicksRight );
Slider2->setTickPosition( QSlider::TicksRight );
Layout8_2->addWidget( Slider2 );
Layout9_2->addLayout( Layout8_2 );
Layout10->addLayout( Layout9_2 );
 
Konvex = new QCheckBox( this, "Konvex" );
Konvex = new QCheckBox( this );
Konvex->setText( tr( "Apply &Factor" ) );
Konvex->setChecked(polyS);
Layout10->addWidget( Konvex );
93,20 → 95,21
Layout7 = new QHBoxLayout;
Layout7->setMargin(0);
Layout7->setSpacing(5);
Faktor = new QSpinBox( this, "Faktor" );
Faktor = new QSpinBox( this );
Faktor->setSuffix( tr( " %" ) );
Faktor->setMaximum( 100 );
Faktor->setMinimum( -100 );
Faktor->setValue(polyFd);
Text2 = new QLabel( Faktor, tr("&Factor:"), this, "Text2" );
Text2 = new QLabel( tr("&Factor:"), this );
Text2->setBuddy(Faktor);
Layout7->addWidget( Text2 );
Layout7->addWidget( Faktor );
Layout8->addLayout( Layout7 );
Slider1 = new QSlider( this, "Slider1" );
Slider1->setMinValue( -100 );
Slider1->setMaxValue( 100 );
Slider1 = new QSlider( this );
Slider1->setMinimum( -100 );
Slider1->setMaximum( 100 );
Slider1->setOrientation( Qt::Horizontal );
Slider1->setTickmarks(QSlider::TicksRight);
Slider1->setTickPosition(QSlider::TicksRight);
Slider1->setValue(polyFd);
if (polyFd == 0)
Konvex->setChecked(false);
114,7 → 117,7
Layout9->addLayout( Layout8 );
Layout10->addLayout( Layout9 );
Layout11->addLayout( Layout10 );
Preview = new QLabel( this, "Preview" );
Preview = new QLabel( this );
Preview->setMinimumSize( QSize( 106, 106 ) );
Preview->setMaximumSize( QSize( 106, 106 ) );
Preview->setFrameShape( QLabel::Panel );
/trunk/Scribus/scribus/pslib.h
27,7 → 27,7
#include <vector>
#include <utility>
 
#include <Q3TextStream>
#include <QTextStream>
#include <QFile>
#include <QList>
#include <QPen>
148,7 → 148,7
QMap<QString, GListe> GlyphsOfFont;
bool isPDF;
QFile Spool;
Q3TextStream spoolStream;
QTextStream spoolStream;
bool CompAvail;
int Plate;
bool DoSep;
/trunk/Scribus/scribus/patterndialog.cpp
78,7 → 78,7
else
pm=QPixmap::fromImage(it.value().getPattern()->scaledToHeight(48, Qt::SmoothTransformation));
QPixmap pm2(48, 48);
pm2.fill(palette().base());
pm2.fill(palette().color(QPalette::Base));
QPainter p;
p.begin(&pm2);
p.drawPixmap(24 - pm.width() / 2, 24 - pm.height() / 2, pm);
92,7 → 92,7
{
PrefsContext* dirs = PrefsManager::instance()->prefsFile->getContext("dirs");
QString wdir = dirs->get("patterns", ".");
QString fileName = QFileDialog::getExistingDirectory(wdir, this, "d", tr("Choose a Directory"), true);
QString fileName = QFileDialog::getExistingDirectory(this, wdir, tr("Choose a Directory"));
if (!fileName.isEmpty())
{
QStringList formats;
124,13 → 124,13
mainWin->mainWindowProgressBar->reset();
mainWin->mainWindowProgressBar->setMaximum(d.count() * 2);
qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
qApp->processEvents(QEventLoop::ExcludeUserInput);
qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
for (uint dc = 0; dc < d.count(); ++dc)
{
mainWin->mainWindowProgressBar->setValue(dc);
qApp->processEvents(QEventLoop::ExcludeUserInput);
qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
QFileInfo fi(QDir::cleanPath(QDir::convertSeparators(fileName + "/" + d[dc])));
QString ext = fi.extension(true).toLower();
QString ext = fi.suffix().toLower();
if ((ext == "sml") || (ext == "shape") || (ext == "sce"))
loadVectors(QDir::cleanPath(QDir::convertSeparators(fileName + "/" + d[dc])));
}
137,9 → 137,9
for (uint dc = 0; dc < d.count(); ++dc)
{
mainWin->mainWindowProgressBar->setValue(d.count() + dc);
qApp->processEvents(QEventLoop::ExcludeUserInput);
qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
QFileInfo fi(QDir::cleanPath(QDir::convertSeparators(fileName + "/" + d[dc])));
QString ext = fi.extension(true).toLower();
QString ext = fi.suffix().toLower();
if ((ext == "sml") || (ext == "shape") || (ext == "sce"))
continue;
else if (formats.contains(ext))
157,7 → 157,7
continue;
}
d.cdUp();
dirs->set("patterns", d.absPath());
dirs->set("patterns", d.absolutePath());
qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
mainWin->setStatusBarInfoText("");
mainWin->mainWindowProgressBar->reset();
207,7 → 207,7
{
PrefsManager::instance()->prefsFile->getContext("dirs")->set("patterns", fileName.left(fileName.lastIndexOf("/")));
QFileInfo fi(fileName);
if ((fi.extension(true).toLower() == "sml") || (fi.extension(true).lower() == "shape") || (fi.extension(true).lower() == "sce"))
if ((fi.suffix().toLower() == "sml") || (fi.suffix().toLower() == "shape") || (fi.suffix().toLower() == "sce"))
{
loadVectors(fileName);
updatePatternList();
231,7 → 231,7
{
QFileInfo fi(data);
QString patNam = fi.baseName().trimmed().simplified().replace(" ", "_");
if (fi.extension(true).toLower() == "sml")
if (fi.suffix().toLower() == "sml")
{
QString f = "";
loadText(data, &f);
239,7 → 239,7
data = pre->createObjects(f);
delete pre;
}
else if (fi.extension(true).toLower() == "shape")
else if (fi.suffix().toLower() == "shape")
{
QString f = "";
loadText(data, &f);
247,7 → 247,7
data = pre->createShape(f);
delete pre;
}
else if (fi.extension(true).toLower() == "sce")
else if (fi.suffix().toLower() == "sce")
{
QString f = "";
loadText(data, &f);
/trunk/Scribus/scribus/preview.cpp
272,20 → 272,20
scaleBox = new QComboBox(this);
scaleBox->setEditable(false);
scaleBox->setFocusPolicy(Qt::NoFocus);
scaleBox->insertItem("50%");
scaleBox->insertItem("100%");
scaleBox->insertItem("150%");
scaleBox->insertItem("200%");
scaleBox->insertItem( tr("Fit to Width"));
scaleBox->insertItem( tr("Fit to Height"));
scaleBox->insertItem( tr("Fit to Page"));
scaleBox->setCurrentItem(1);
scaleBox->addItem("50%");
scaleBox->addItem("100%");
scaleBox->addItem("150%");
scaleBox->addItem("200%");
scaleBox->addItem( tr("Fit to Width"));
scaleBox->addItem( tr("Fit to Height"));
scaleBox->addItem( tr("Fit to Page"));
scaleBox->setCurrentIndex(1);
Layout6->addWidget(scaleLabel);
Layout6->addWidget(scaleBox);
QSpacerItem* spacer = new QSpacerItem( 2, 2, QSizePolicy::Expanding, QSizePolicy::Minimum );
Layout6->addItem( spacer );
PGSel = new PageSelector(this, doc->DocPages.count());
PGSel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, 0, 0, PGSel->sizePolicy().hasHeightForWidth() ) );
PGSel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
Layout6->addWidget(PGSel);
QSpacerItem* spacer2 = new QSpacerItem( 2, 2, QSizePolicy::Expanding, QSizePolicy::Minimum );
Layout6->addItem( spacer2 );
776,7 → 776,7
double b = doc->Pages->at(Seite)->width() * Res / 72.0;
double h = doc->Pages->at(Seite)->height() * Res / 72.0;
qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
if ((Seite != APage) || (EnableCMYK->isChecked() != CMode) || (SMode != scaleBox->currentItem())
if ((Seite != APage) || (EnableCMYK->isChecked() != CMode) || (SMode != scaleBox->currentIndex())
|| (AntiAlias->isChecked() != GsAl) || ((AliasTr->isChecked() != Trans) || (EnableGCR->isChecked() != GMode)
|| (EnableOverprint->isChecked() != OMode) && (!EnableCMYK->isChecked()))
|| (useGray->isChecked() != fGray) || (MirrorHor->isChecked() != mHor) || (MirrorVert->isChecked() != mVer)
800,7 → 800,7
bool loaderror;
if (HaveTiffSep == 0)
{
if ((Seite != APage) || (EnableCMYK->isChecked() != CMode) || (SMode != scaleBox->currentItem())
if ((Seite != APage) || (EnableCMYK->isChecked() != CMode) || (SMode != scaleBox->currentIndex())
|| (AntiAlias->isChecked() != GsAl) || (AliasTr->isChecked() != Trans) || (EnableGCR->isChecked() != GMode)
|| (EnableOverprint->isChecked() != OMode) || (useGray->isChecked() != fGray) || (MirrorHor->isChecked() != mHor)
|| (MirrorVert->isChecked() != mVer) || (ClipMarg->isChecked() != fClip) || (UseICC->isChecked() != fICC) || (spotColors->isChecked() != fSpot))
816,7 → 816,7
bool mode;
int w = qRound(b);
int h2 = qRound(h);
image = QImage(w, h2, 32);
image = QImage(w, h2, QImage::Format_ARGB32);
QRgb clean = qRgba(0, 0, 0, 0);
for( int yi=0; yi < h2; ++yi )
{
955,8 → 955,8
int w = qRound(b);
int w2 = 4*w;
int h2 = qRound(h);
image = QImage(w, h2, 32);
QByteArray imgc(w2);
image = QImage(w, h2, QImage::Format_ARGB32);
QByteArray imgc(w2, ' ');
QFile f(ScPaths::getTempFileDir()+"/sc.png");
if (f.open(QIODevice::ReadOnly))
{
968,7 → 968,7
for (int y=0; y < h2; ++y )
{
LPBYTE ptr = image.scanLine( y );
f.readBlock(imgc.data(), w2);
f.read(imgc.data(), w2);
p = (uint *)image.scanLine( y );
for (int x=0; x < w2; x += 4 )
{
1012,7 → 1012,7
for (int y=0; y < h2; ++y )
{
p = (uint *)image.scanLine( y );
f.readBlock(imgc.data(), w2);
f.read(imgc.data(), w2);
for (int x=0; x < w2; x += 4 )
{
cyan = uchar(imgc[x]);
1052,7 → 1052,7
imageLoadError(Bild, Seite);
return Bild;
}
image = image.convertDepth(32);
image = image.convertToFormat(QImage::Format_ARGB32);
if ((AliasTr->isChecked()) && (HavePngAlpha == 0))
{
int wi = image.width();
1069,7 → 1069,6
}
}
}
image.setAlphaBuffer(true);
if (AliasTr->isChecked())
{
Bild = QPixmap(image.width(), image.height());
1081,7 → 1080,7
p.end();
}
else
Bild=QPixmap::fromImage(image);
Bild = QPixmap::fromImage(image);
qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
getUserSelection(Seite);
return Bild;
1112,7 → 1111,7
GsAl = AntiAlias->isChecked();
Trans = AliasTr->isChecked();
GMode = EnableGCR->isChecked();
SMode = scaleBox->currentItem();
SMode = scaleBox->currentIndex();
OMode = EnableOverprint->isChecked();
mHor = MirrorHor->isChecked();
mVer = MirrorVert->isChecked();
1124,7 → 1123,7
 
void PPreview::imageLoadError(QPixmap &Bild, int page)
{
Bild.resize(1,1);
Bild = QPixmap(1,1);
qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
getUserSelection(page);
}
/trunk/Scribus/scribus/query.cpp
13,12 → 13,10
#include "util_icon.h"
 
Query::Query( QWidget* parent, const char* name, bool modal, Qt::WFlags fl, QString text, QString titel )
: QDialog( parent, name, modal, fl )
: QDialog( parent )
{
if ( !name )
setName( "Query" );
setWindowTitle( titel );
setIcon(loadIcon("AppIcon.png"));
setWindowIcon(loadIcon("AppIcon.png"));
setModal(modal);
queryLayout = new QVBoxLayout( this );
queryLayout->setMargin(5);
26,8 → 24,9
editLayout = new QHBoxLayout;
editLayout->setSpacing( 5 );
editLayout->setMargin( 0 );
answerEdit = new QLineEdit( this, "answerEdit" );
questionLabel = new QLabel( answerEdit, text, this, "questionLabel" );
answerEdit = new QLineEdit( this );
questionLabel = new QLabel( text, this );
questionLabel->setBuddy(answerEdit);
//Qt4 questionLabel->setFrameShape( QLabel::MShape );
//Qt4 questionLabel->setFrameShadow( QLabel::MShadow );
questionLabel->adjustSize();
39,10 → 38,10
okCancelLayout->setMargin( 0 );
QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
okCancelLayout->addItem( spacer );
okButton = new QPushButton( CommonStrings::tr_OK, this, "okButton" );
okButton = new QPushButton( CommonStrings::tr_OK, this);
okButton->setDefault( true );
okCancelLayout->addWidget( okButton );
cancelButton = new QPushButton( CommonStrings::tr_Cancel, this, "cancelButton" );
cancelButton = new QPushButton( CommonStrings::tr_Cancel, this );
okCancelLayout->addWidget( cancelButton );
queryLayout->addLayout( okCancelLayout );
setMaximumSize(sizeHint());
/trunk/Scribus/scribus/pageitem.h
274,7 → 274,7
@param scale scale of the vport
* @return bool true if the x, y is in the bounds
*/
bool mouseWithinItem(QWidget* vport, const int x, const int y, double scale) const;
bool mouseWithinItem(const int x, const int y, double scale) const;
void copyToCopyPasteBuffer(struct CopyPasteBuffer *Buffer);
virtual void handleModeEditKey(QKeyEvent *k, bool &keyRepeat);
/trunk/Scribus/scribus/pdfoptionsio.cpp
37,11 → 37,11
if (!f.open(QIODevice::WriteOnly|QIODevice::Truncate))
{
m_error = QObject::tr("Could not open output file %1")
.arg(qApp->translate("QFile",f.errorString()));
.arg(qApp->translate("QFile",f.errorString().toLatin1().constData()));
return false;
}
QTextStream ts(&f);
ts.setEncoding(QTextStream::UnicodeUTF8);
ts.setCodec("UTF-8");
ts << xml;
m_includePasswords = false; // just to be paranoid
m_error = QString::null;
60,7 → 60,7
if (xml.isNull())
return false;
QTextStream ts(&outDevice);
ts.setEncoding(QTextStream::UnicodeUTF8);
ts.setCodec("UTF-8");
ts << xml;
m_includePasswords = false; // just to be paranoid
m_error = QString::null;
278,7 → 278,7
if (!f.open(QIODevice::ReadOnly))
{
m_error = QObject::tr("Could not open input file %1")
.arg(qApp->translate("QFile",f.errorString()));
.arg(qApp->translate("QFile",f.errorString().toLatin1().constData()));
return false;
}
return readFrom(f);
/trunk/Scribus/scribus/pslib.cpp
246,7 → 246,9
 
void PSLib::PutSeite(QString c)
{
spoolStream.writeRawBytes(c, c.length());
spoolStream.flush();
spoolStream.device()->write(c.toUtf8().data(), c.length());
// spoolStream.writeRawBytes(c, c.length());
}
 
void PSLib::PutSeite(QByteArray& array, bool hexEnc)
266,7 → 268,11
}
}
else
spoolStream.writeRawBytes(array, array.size());
{
spoolStream.flush();
spoolStream.device()->write(array.data(), array.size());
}
// spoolStream.writeRawBytes(array, array.size());
}
 
void PSLib::PutSeite(const char* array, int length, bool hexEnc)
286,12 → 292,18
}
}
else
spoolStream.writeRawBytes(array, length);
{
spoolStream.flush();
spoolStream.device()->write(array, length);
}
// spoolStream.writeRawBytes(array, length);
}
 
void PSLib::PutDoc(QString c)
{
spoolStream.writeRawBytes(c, c.length());
spoolStream.flush();
spoolStream.device()->write(c.toUtf8().data(), c.length());
// spoolStream.writeRawBytes(c, c.length());
}
 
void PSLib::PutDoc(QByteArray& array, bool hexEnc)
311,7 → 323,11
}
}
else
spoolStream.writeRawBytes(array, array.size());
{
spoolStream.flush();
spoolStream.device()->write(array.data(), array.size());
}
// spoolStream.writeRawBytes(array, array.size());
}
 
void PSLib::PutDoc(const char* array, int length, bool hexEnc)
331,7 → 347,11
}
}
else
spoolStream.writeRawBytes(array, length);
{
spoolStream.flush();
spoolStream.device()->write(array, length);
}
// spoolStream.writeRawBytes(array, length);
}
 
QString PSLib::ToStr(double c)
358,7 → 378,7
 
bool PSLib::PS_set_file(QString fn)
{
Spool.setName(fn);
Spool.setFileName(fn);
if (Spool.exists())
Spool.remove();
bool ret = Spool.open(QIODevice::WriteOnly);
1074,8 → 1094,8
if (DoSep)
{
int pla = Plate - 1 < 0 ? 3 : Plate - 1;
QStringList cols1 = QStringList::split(" ", Colors[c+1]);
QStringList cols2 = QStringList::split(" ", Colors[c]);
QStringList cols1 = Colors[c+1].split(" ");
QStringList cols2 = Colors[c].split(" ");
PutSeite("/C1 ["+ToStr(1-cols1[pla].toDouble())+"]\n");
PutSeite("/C0 ["+ToStr(1-cols2[pla].toDouble())+"]\n");
}
1234,8 → 1254,8
if (DoSep)
{
int pla = Plate - 1 < 0 ? 3 : Plate - 1;
QStringList cols1 = QStringList::split(" ", Colors[c]);
QStringList cols2 = QStringList::split(" ", Colors[c+1]);
QStringList cols1 = Colors[c].split(" ");
QStringList cols2 = Colors[c+1].split(" ");
PutSeite("/C1 ["+ToStr(1-cols1[pla].toDouble())+"]\n");
PutSeite("/C0 ["+ToStr(1-cols2[pla].toDouble())+"]\n");
}
1305,7 → 1325,7
bool dummy;
QByteArray tmp;
QFileInfo fi = QFileInfo(fn);
QString ext = fi.extension(false).toLower();
QString ext = fi.suffix().toLower();
if (ext.isEmpty())
ext = getImageType(fn);
if (extensionIndicatesEPS(ext) && (c->pixm.imgInfo.type != 7))
1374,7 → 1394,7
bool dummy;
QByteArray tmp;
QFileInfo fi = QFileInfo(fn);
QString ext = fi.extension(false).toLower();
QString ext = fi.suffix().toLower();
if (ext.isEmpty())
ext = getImageType(fn);
if (extensionIndicatesEPS(ext) && (c->pixm.imgInfo.type != 7))
/trunk/Scribus/scribus/pagelayout.cpp
76,7 → 76,7
layoutsCombo = new ScComboBox( this );
layoutGroupLayout->addWidget( layoutsCombo );
}
layoutLabel1 = new QLabel( this, "layoutLabel1" );
layoutLabel1 = new QLabel( this );
layoutGroupLayout->addWidget( layoutLabel1 );
firstPage = new ScComboBox( this );
layoutGroupLayout->addWidget( firstPage );
99,15 → 99,15
{
QString psname=CommonStrings::translatePageSetString(pageSets[pg].Name);
if (pg == 0)
layoutsCombo->insertItem(loadIcon("16/page-simple.png"), psname);
layoutsCombo->addItem(loadIcon("16/page-simple.png"), psname);
else if (pg == 1)
layoutsCombo->insertItem(loadIcon("16/page-doublesided.png"), psname);
layoutsCombo->addItem(loadIcon("16/page-doublesided.png"), psname);
else if (pg == 2)
layoutsCombo->insertItem(loadIcon("16/page-3fold.png"), psname);
layoutsCombo->addItem(loadIcon("16/page-3fold.png"), psname);
else if (pg == 3)
layoutsCombo->insertItem(loadIcon("16/page-4fold.png"), psname);
layoutsCombo->addItem(loadIcon("16/page-4fold.png"), psname);
else
layoutsCombo->insertItem(loadIcon("16/page-simple.png"), psname);
layoutsCombo->addItem(loadIcon("16/page-simple.png"), psname);
}
connect(layoutsCombo, SIGNAL(activated(int)), this, SLOT(itemSelected(int)));
}
115,7 → 115,7
void PageLayouts::selectFirstP(int nr)
{
disconnect(firstPage, SIGNAL(activated(int)), this, SIGNAL(selectedFirstPage(int)));
firstPage->setCurrentItem(nr);
firstPage->setCurrentIndex(nr);
connect(firstPage, SIGNAL(activated(int)), this, SIGNAL(selectedFirstPage(int)));
}
 
133,13 → 133,13
QStringList::Iterator pNames;
for(pNames = pageSets[nr].pageNames.begin(); pNames != pageSets[nr].pageNames.end(); ++pNames )
{
firstPage->insertItem(CommonStrings::translatePageSetLocString((*pNames)));
firstPage->addItem(CommonStrings::translatePageSetLocString((*pNames)));
}
}
else
{
firstPage->clear();
firstPage->insertItem(" ");
firstPage->addItem(" ");
firstPage->setEnabled(false);
}
if (modus)
166,13 → 166,13
QStringList::Iterator pNames;
for(pNames = pageSets[choosen].pageNames.begin(); pNames != pageSets[choosen].pageNames.end(); ++pNames )
{
firstPage->insertItem(CommonStrings::translatePageSetLocString((*pNames)));
firstPage->addItem(CommonStrings::translatePageSetLocString((*pNames)));
}
}
else
{
firstPage->clear();
firstPage->insertItem(" ");
firstPage->addItem(" ");
firstPage->setEnabled(false);
}
connect(firstPage, SIGNAL(activated(int)), this, SIGNAL(selectedFirstPage(int)));
233,34 → 233,34
else
{
disconnect(layoutsCombo, SIGNAL(activated(int)), this, SLOT(itemSelected(int)));
int currIndex=layoutsCombo->currentItem();
int currIndex=layoutsCombo->currentIndex();
layoutsCombo->clear();
for (int pg = 0; pg < pageSets.count(); ++pg)
{
QString psname=CommonStrings::translatePageSetString(pageSets[pg].Name);
if (pg == 0)
layoutsCombo->insertItem(loadIcon("16/page-simple.png"), psname);
layoutsCombo->addItem(loadIcon("16/page-simple.png"), psname);
else if (pg == 1)
layoutsCombo->insertItem(loadIcon("16/page-doublesided.png"), psname);
layoutsCombo->addItem(loadIcon("16/page-doublesided.png"), psname);
else if (pg == 2)
layoutsCombo->insertItem(loadIcon("16/page-3fold.png"), psname);
layoutsCombo->addItem(loadIcon("16/page-3fold.png"), psname);
else if (pg == 3)
layoutsCombo->insertItem(loadIcon("16/page-4fold.png"), psname);
layoutsCombo->addItem(loadIcon("16/page-4fold.png"), psname);
else
layoutsCombo->insertItem(loadIcon("16/page-simple.png"), psname);
layoutsCombo->addItem(loadIcon("16/page-simple.png"), psname);
}
layoutsCombo->setCurrentItem(currIndex);
layoutsCombo->setCurrentIndex(currIndex);
connect(layoutsCombo, SIGNAL(activated(int)), this, SLOT(itemSelected(int)));
disconnect(firstPage, SIGNAL(activated(int)), this, SIGNAL(selectedFirstPage(int)));
int currFirstPageIndex=firstPage->currentItem();
int currFirstPageIndex=firstPage->currentIndex();
firstPage->clear();
if (currIndex>=0 && currIndex<pageSets.count())
for(QStringList::Iterator pNames = pageSets[currIndex].pageNames.begin(); pNames != pageSets[currIndex].pageNames.end(); ++pNames )
{
firstPage->insertItem(CommonStrings::translatePageSetLocString((*pNames)));
firstPage->addItem(CommonStrings::translatePageSetLocString((*pNames)));
}
firstPage->setCurrentItem(currFirstPageIndex);
firstPage->setCurrentIndex(currFirstPageIndex);
connect(firstPage, SIGNAL(activated(int)), this, SIGNAL(selectedFirstPage(int)));
}
layoutLabel1->setText( tr( "First Page is:" ) );
/trunk/Scribus/scribus/pluginmanager.cpp
49,7 → 49,7
void* lib = NULL;
#ifdef HAVE_DLFCN_H
QString libpath = QDir::convertSeparators( plugin );
lib = dlopen(libpath, RTLD_LAZY | RTLD_GLOBAL);
lib = dlopen(libpath.toLocal8Bit().data(), RTLD_LAZY | RTLD_GLOBAL);
if (!lib)
{
const char* error = dlerror();
135,7 → 135,7
fileName.toLocal8Bit().data());
return QString();
}
return baseName.latin1();
return baseName.toLatin1();
}
 
int PluginManager::initPlugin(const QString fileName)
205,7 → 205,7
{
++loaded;
++changes;
failedPlugs.remove(it.key());
failedPlugs.removeAll(it.key());
}
}
}
358,7 → 358,7
return false;
 
getPluginAPIVersion = (getPluginAPIVersionPtr)
resolveSym(pda.pluginDLL, pda.pluginName + "_getPluginAPIVersion");
resolveSym(pda.pluginDLL, QString(pda.pluginName + "_getPluginAPIVersion").toLocal8Bit().data());
if (getPluginAPIVersion)
{
int gotVersion = (*getPluginAPIVersion)();
370,7 → 370,7
else
{
getPlugin = (getPluginPtr)
resolveSym(pda.pluginDLL, pda.pluginName + "_getPlugin");
resolveSym(pda.pluginDLL, QString(pda.pluginName + "_getPlugin").toLocal8Bit().data());
if (getPlugin)
{
pda.plugin = (*getPlugin)();
406,7 → 406,7
disablePlugin(pda);
Q_ASSERT(!pda.enabled);
freePluginPtr freePlugin =
(freePluginPtr) resolveSym(pda.pluginDLL, pda.pluginName + "_freePlugin");
(freePluginPtr) resolveSym(pda.pluginDLL, QString(pda.pluginName + "_freePlugin").toLocal8Bit().data());
if ( freePlugin )
(*freePlugin)( pda.plugin );
pda.plugin = 0;
/trunk/Scribus/scribus/picsearch.cpp
18,11 → 18,10
#include "util_icon.h"
 
 
PicSearch::PicSearch(QWidget* parent, const QString & fileName, const QStringList & avalableFiles)
: QDialog( parent, "PicSearch", true, 0 ),
currentImage(QString())
PicSearch::PicSearch(QWidget* parent, const QString & fileName, const QStringList & avalableFiles) : QDialog(parent), currentImage(QString())
{
setupUi(this);
setModal(true);
cancelButton->setText(CommonStrings::tr_Cancel);
previewLabel->hide();
fileNameLabel->setText(fileName);
66,7 → 65,7
int w = 200;
int h = 200;
bool mode = false;
QString ext = fi.extension(false).toLower();
QString ext = fi.suffix().toLower();
if (ext.isEmpty())
ext = getImageType(currentImage);
ScImage im;