r13949 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:25:22 CEST 2009
Revision: 13949
Author: fschmid
Date: 2009-09-02T10:22:11.702956Z
Commit message: Fixed Bug #8400: "Imported PDF images exports the same page regardless of individual setting"
Changeset:
M /trunk/Scribus/scribus/pdflib_core.cpp
M /trunk/Scribus/scribus/ui/propertiespalette.cpp
M /trunk/Scribus/scribus/pdflib_core.h
M /trunk/Scribus/scribus/pageitem.h
M /trunk/Scribus/scribus/pageitem_desaxe.cpp
Diffs:
Index: scribus/pdflib_core.cpp
===================================================================
--- scribus/pdflib_core.cpp (revision 13948)
+++ scribus/pdflib_core.cpp (revision 13949)
@@ -6811,6 +6811,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();
@@ -6825,7 +6826,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)
@@ -6853,6 +6855,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/pdflib_core.h
===================================================================
--- scribus/pdflib_core.h (revision 13948)
+++ scribus/pdflib_core.h (revision 13949)
@@ -69,6 +69,7 @@
int ResNum;
int Width;
int Height;
+ int Page;
double reso;
double sxa;
double sya;
Index: scribus/pageitem.h
===================================================================
--- scribus/pageitem.h (revision 13948)
+++ scribus/pageitem.h (revision 13949)
@@ -418,6 +418,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; }
Index: scribus/ui/propertiespalette.cpp
===================================================================
--- scribus/ui/propertiespalette.cpp (revision 13948)
+++ scribus/ui/propertiespalette.cpp (revision 13949)
@@ -2109,7 +2109,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 13948)
+++ scribus/pageitem_desaxe.cpp (revision 13949)
@@ -130,6 +130,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()));
@@ -767,6 +768,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 ));
More information about the scribus-commit
mailing list