r13948 by fschmid - Fixed Bug #8400: "Imported PDF images exports the same page regardless of individual setting"
scribus-commit
scribus-commit at lists.scribus.net
Wed Sep 2 12:20:23 CEST 2009
Revision: 13948
Author: fschmid
Date: 2009-09-02T10:20:38.787692Z
Commit message: Fixed Bug #8400: "Imported PDF images exports the same page regardless of individual setting"
Changeset:
M /branches/Version135/Scribus/scribus/pdflib_core.cpp
M /branches/Version135/Scribus/scribus/propertiespalette.cpp
M /branches/Version135/Scribus/scribus/pdflib_core.h
M /branches/Version135/Scribus/scribus/pageitem.h
M /branches/Version135/Scribus/scribus/pageitem_desaxe.cpp
Diffs:
Index: scribus/pdflib_core.h
===================================================================
--- scribus/pdflib_core.h (revision 13947)
+++ scribus/pdflib_core.h (revision 13948)
@@ -68,6 +68,7 @@
int ResNum;
int Width;
int Height;
+ int Page;
double reso;
double sxa;
double sya;
Index: scribus/propertiespalette.cpp
===================================================================
--- scribus/propertiespalette.cpp (revision 13947)
+++ scribus/propertiespalette.cpp (revision 13948)
@@ -2089,7 +2089,10 @@
}
if (CurItem->asImageFrame())
{
+ disconnect(imagePageNumber, SIGNAL(valueChanged(int)), this, SLOT(NewPage()));
imagePageNumber->setMaximum(CurItem->pixm.imgInfo.numberOfPages);
+ imagePageNumber->setValue(CurItem->pixm.imgInfo.actualPageNumber);
+ connect(imagePageNumber, SIGNAL(valueChanged(int)), this, SLOT(NewPage()));
}
Revert->setChecked(CurItem->reversed());
setTextFlowMode(CurItem->textFlowMode());
Index: scribus/pageitem_desaxe.cpp
===================================================================
--- scribus/pageitem_desaxe.cpp (revision 13947)
+++ scribus/pageitem_desaxe.cpp (revision 13948)
@@ -126,6 +126,7 @@
result.insert("image-embedded-profile", item->embeddedImageProfile());
result.insert("image-flipped-hor", toXMLString(item->imageFlippedH()));
result.insert("image-flipped-vert", toXMLString(item->imageFlippedV()));
+ result.insert("pagenumber", toXMLString(item->pixm.imgInfo.actualPageNumber));
result.insert("cms-profile", item->cmsProfile());
result.insert("cms-intent", toXMLString(item->cmsRenderingIntent()));
@@ -627,6 +628,7 @@
ruleset.addRule(itemPrefix, SetAttributeWithConversion<PageItem,double>( & PageItem::setImageYScale, "image-y-scale", &parseDouble ));
ruleset.addRule(itemPrefix, SetAttributeWithConversion<PageItem,double>( & PageItem::setImageXOffset, "image-x-position", &parseDouble ));
ruleset.addRule(itemPrefix, SetAttributeWithConversion<PageItem,double>( & PageItem::setImageYOffset, "image-y-position", &parseDouble ));
+ ruleset.addRule(itemPrefix, SetAttributeWithConversion<PageItem,int>( & PageItem::setImagePagenumber, "pagenumber", &parseInt ));
// ruleset.addRule(itemPrefix, SetAttributeWithConversion<PageItem,double>("image-x-dpi", &parseDouble )); //NYI
// ruleset.addRule(itemPrefix, SetAttributeWithConversion<PageItem,double>("image-y-dpi", &parseDouble )); //NYI
ruleset.addRule(itemPrefix, SetAttributeWithConversion<PageItem,bool>( & PageItem::setImageShown, "image-shown", &parseBool ));
Index: scribus/pdflib_core.cpp
===================================================================
--- scribus/pdflib_core.cpp (revision 13947)
+++ scribus/pdflib_core.cpp (revision 13948)
@@ -6671,6 +6671,7 @@
ImInfo.reso = Options.Resolution / 72.0;
ImInfo.Width = 0;
ImInfo.Height = 0;
+ ImInfo.Page = 0;
ImInfo.xa = x;
ImInfo.ya = y;
ImInfo.origXsc = c->imageXScale();
@@ -6685,7 +6686,8 @@
|| (c->asLatexFrame())
|| (c->effectsInUse.count() != 0)
|| ((ImInfo2.origXsc != ImInfo.origXsc) || (ImInfo2.origYsc != ImInfo.origYsc))
- || (ImInfo2.RequestProps != c->pixm.imgInfo.RequestProps))
+ || (ImInfo2.RequestProps != c->pixm.imgInfo.RequestProps)
+ || (ImInfo2.Page != c->pixm.imgInfo.actualPageNumber))
{
bool imageLoaded = false;
if ((extensionIndicatesPDF(ext) || ((extensionIndicatesEPSorPS(ext)) && (c->pixm.imgInfo.type != ImageType7))) && c->effectsInUse.count() == 0)
@@ -6713,6 +6715,7 @@
else
imageLoaded = PDF_EmbeddedPDF(c, fn, sx, sy, x, y, fromAN, Profil, Embedded, Intent, ImInfo, output);
isEmbeddedPDF = true;
+ ImInfo.Page = c->pixm.imgInfo.actualPageNumber;
}
if(!imageLoaded && extensionIndicatesPDF(ext) && c->effectsInUse.count() == 0 && Options.embedPDF)
qDebug() << "Failed to embed the PDF file";
Index: scribus/pageitem.h
===================================================================
--- scribus/pageitem.h (revision 13947)
+++ scribus/pageitem.h (revision 13948)
@@ -404,6 +404,7 @@
QString Pfile3;
QString externalFile() const { return Pfile; }
void setExternalFile(QString val);
+ void setImagePagenumber(int num) { pixm.imgInfo.actualPageNumber = num; }
//FIXME: maybe these should go into annotation?
QString fileIconPressed() const { return Pfile2; }
More information about the scribus-commit
mailing list