Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 24688 → Rev 24689

/trunk/Scribus/scribus/pageitem.h
802,7 → 802,7
* of its Qt name.
* See also PageItem::setItemName()
*/
QString itemName() const { return m_itemName; }
const QString& itemName() const { return m_itemName; }
/**
* @brief Set name of the item
* @param newName name for the item
/trunk/Scribus/scribus/pdflib_core.cpp
1368,6 → 1368,13
return Pdf::toPdfDocEncoding(fn.replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_"));
}
 
static QString sanitizeItemName(const QString& itemName)
{
QString sanitizedName = itemName;
sanitizedName.replace(".", "_");
return sanitizedName;
}
 
static QList<Pdf::Resource> asColorSpace(const QList<PdfICCD>& iccCSlist)
{
QList<Pdf::Resource> result;
4694,7 → 4701,7
if (ite->Parent == nullptr)
radioButtonGroup.groupName = "Page" + Pdf::toPdf(ActPageP->pageNr() + 1);
else
radioButtonGroup.groupName = Pdf::toPdfDocEncoding(ite->Parent->itemName().replace(".", "_"));
radioButtonGroup.groupName = Pdf::toPdfDocEncoding( sanitizeItemName(ite->Parent->itemName()) );
pageData.radioButtonGroups.insert(ite->Parent, radioButtonGroup);
}
PdfRadioButtonGroup& radioButtonGroup = pageData.radioButtonGroups[ite->Parent];
8796,10 → 8803,10
PutDoc("/3DD " + Pdf::toPdf(appearanceObj) + " 0 R\n");
PutDoc("/3DV " + Pdf::toPdf(viewObj) + " 0 R\n");
PutDoc("/3DA <<\n/A /PV\n/TB true\n/NP true\n>>\n");
QByteArray onState = Pdf::toName(ite->itemName().replace(".", "_"));
QByteArray onState = Pdf::toName( sanitizeItemName(ite->itemName()) );
PutDoc("/AS " + onState + "\n");
PutDoc("/AP << /N <<\n" + onState + " " + Pdf::toPdf(appearanceObj1) + " 0 R >> >>\n");
PutDoc("/Rect [ " + FToStr(x+bleedDisplacementX) + " " + FToStr(y2+bleedDisplacementY) + " " + FToStr(x2+bleedDisplacementX) + " " + FToStr(y+bleedDisplacementY) + " ]\n");
PutDoc("/Rect [ " + FToStr(x + bleedDisplacementX) + " " + FToStr(y2 + bleedDisplacementY) + " " + FToStr(x2 + bleedDisplacementX) + " " + FToStr(y + bleedDisplacementY) + " ]\n");
PutDoc(">>");
writer.endObj(annotationObj);
delete tempImageFile;
8840,7 → 8847,7
{
PageItem* radioKid = radioList[j];
if (radioKid->annotation().IsChk())
onState = Pdf::toName(radioKid->itemName().replace(".", "_"));
onState = Pdf::toName( sanitizeItemName(radioKid->itemName()) );
}
writer.startObj(parentObject);
pageData.AObjects.append(parentObject);
8936,7 → 8943,7
PutDoc("/R " + Pdf::toPdf(rot) + " ");
}
PutDoc(">>\n");
QByteArray onState = Pdf::toName(ite->itemName().replace(".", "_"));
QByteArray onState = Pdf::toName( sanitizeItemName(ite->itemName()) );
if (ite->annotation().IsChk())
PutDoc("/AS " + onState + "\n");
else
9046,7 → 9053,7
bmUtf16 += (cc == QChar(13) ? QChar(10) : cc);
}
}
QByteArray anTitle = Pdf::toPdfDocEncoding(ite->itemName().replace(".", "_"));
QByteArray anTitle = Pdf::toPdfDocEncoding( sanitizeItemName(ite->itemName()) );
QStringList bmstUtf16 = bmUtf16.split(QChar(10), Qt::SkipEmptyParts);
const QByteArray m[] = {"4", "5", "F", "l", "H", "n"};
QByteArray ct(m[ite->annotation().ChkStil()]);
/trunk/Scribus/scribus/pslib.cpp
241,6 → 241,13
m_ps->PS_restore();
}
 
static QString sanitizeItemName(const QString& itemName)
{
QString sanitizedName = itemName;
sanitizedName.replace(".", "_");
return sanitizedName;
}
 
PSLib::PSLib(ScribusDoc* doc, PrintOptions &options, OutputFormat outputFmt, ColorList *docColors)
: m_Doc(doc), m_outputFormat(outputFmt)
{
1549,7 → 1556,7
}
if ((item->annotation().Type() < 2) || (item->annotation().Type() > 9))
PutStream("/Border [ 0 0 0 ]\n");
PutStream("/Title (" + item->itemName().replace(".", "_" ) + ")\n");
PutStream("/Title (" + sanitizeItemName(item->itemName()) + ")\n");
PutStream("/ANN pdfmark\n");
}