r15364 by jghali - #9288: PDF icon button does not appear

scribus-commit scribus-commit at lists.scribus.net
Mon Jul 19 21:30:36 CEST 2010


Revision: 15364
Author: jghali
Date: 2010-07-19T19:03:55.971762Z
Commit message: #9288: PDF icon button does not appear

Changeset: 
M  /trunk/Scribus/scribus/pdflib_core.cpp
M  /trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
M  /trunk/Scribus/scribus/pageitem.cpp
M  /trunk/Scribus/scribus/fonts/scface.cpp
M  /trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
M  /trunk/Scribus/scribus/fonts/scface.h
M  /trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp

Diffs:
Index: scribus/pdflib_core.cpp
===================================================================
--- scribus/pdflib_core.cpp	(revision 15363)
+++ scribus/pdflib_core.cpp	(revision 15364)
@@ -1385,7 +1385,7 @@
 			// TODO: think about QByteArray ScFace::getFontDescriptor() -- AV
 			PutDoc("<<\n/Type /FontDescriptor\n");
 			PutDoc("/FontName /"+AllFonts[it.key()].psName().replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_" )+"\n");
-			PutDoc("/FontBBox [ "+AllFonts[it.key()].FontBBoxAsString()+" ]\n");
+			PutDoc("/FontBBox [ "+AllFonts[it.key()].fontBBoxAsString()+" ]\n");
 			PutDoc("/Flags ");
 			//FIXME: isItalic() should be queried from ScFace, not from Qt -- AV
 			//QFontInfo fo = QFontInfo(it.data());
@@ -1393,7 +1393,7 @@
 			if (AllFonts[it.key()].isFixedPitch())
 				pfl = pfl ^ 1;
 			//if (fo.italic())
-			if (AllFonts[it.key()].ItalicAngleAsString() != "0")
+			if (AllFonts[it.key()].italicAngleAsString() != "0")
 				pfl = pfl ^ 64;
 //			pfl = pfl ^ 4;
 			pfl = pfl ^ 32;
@@ -1401,7 +1401,7 @@
 			PutDoc("/Ascent "+AllFonts[it.key()].ascentAsString()+"\n");
 			PutDoc("/Descent "+AllFonts[it.key()].descentAsString()+"\n");
 			PutDoc("/CapHeight "+AllFonts[it.key()].capHeightAsString()+"\n");
-			PutDoc("/ItalicAngle "+AllFonts[it.key()].ItalicAngleAsString()+"\n");
+			PutDoc("/ItalicAngle "+AllFonts[it.key()].italicAngleAsString()+"\n");
 //			PutDoc("/Ascent "+QString::number(static_cast<int>(AllFonts[it.key()].ascent()))+"\n");
 //			PutDoc("/Descent "+QString::number(static_cast<int>(AllFonts[it.key()].descent()))+"\n");
 //			PutDoc("/CapHeight "+QString::number(static_cast<int>(AllFonts[it.key()].capHeight()))+"\n");
@@ -8721,14 +8721,8 @@
 	try
 	{
 		PoDoFo::PdfError::EnableDebug( false );
-#if (PODOFO_VERSION == 0 && PODOFO_MINOR > 6)
 		PoDoFo::PdfError::EnableLogging( false );
-#endif
-#if (PODOFO_VERSION == 0 && PODOFO_MINOR == 5 && PODOFO_REVISION == 99) || PODOFO_MINOR > 5
 		PoDoFo::PdfMemDocument doc( fn.toLocal8Bit().data() );
-#else
-		PoDoFo::PdfDocument doc( fn.toLocal8Bit().data() );
-#endif
 		PoDoFo::PdfPage*         page      = doc.GetPage(qMin(qMax(1, c->pixm.imgInfo.actualPageNumber), c->pixm.imgInfo.numberOfPages) - 1);
 		PoDoFo::PdfObject* contents  = page? page->GetContents() : NULL;
 		PoDoFo::PdfObject* resources = page? page->GetResources() : NULL;
Index: scribus/fonts/scface.cpp
===================================================================
--- scribus/fonts/scface.cpp	(revision 15363)
+++ scribus/fonts/scface.cpp	(revision 15364)
@@ -201,6 +201,45 @@
 	return NONE; 
 }
 
+QString ScFace::ascentAsString() const
+{
+	if (m->status == ScFace::UNKNOWN) {
+		m->load();
+	}
+	return m->ascentAsString();
+}
+
+QString ScFace::descentAsString() const
+{
+	if (m->status == ScFace::UNKNOWN) {
+		m->load();
+	}
+	return m->descentAsString();
+}
+QString ScFace::capHeightAsString() const
+{
+	if (m->status == ScFace::UNKNOWN) {
+		m->load();
+	}
+	return m->capHeightAsString();
+}
+
+QString ScFace::fontBBoxAsString() const
+{
+	if (m->status == ScFace::UNKNOWN) {
+		m->load();
+	}
+	return m->FontBBoxAsString();
+}
+
+QString ScFace::italicAngleAsString() const
+{
+	if (m->status == ScFace::UNKNOWN) {
+		m->load();
+	}
+	return m->ItalicAngleAsString();
+}
+
 qreal ScFace::ascent(qreal sz) const 
 {
 	if (m->status == ScFace::UNKNOWN) {
Index: scribus/fonts/scface.h
===================================================================
--- scribus/fonts/scface.h	(revision 15363)
+++ scribus/fonts/scface.h	(revision 15364)
@@ -308,11 +308,11 @@
 	QString variant()  const { return m->variant; }
 	
 	// font metrics
-	QString ascentAsString()    const { return m->ascentAsString() ; }
-	QString descentAsString()    const { return m->descentAsString() ; }
-	QString capHeightAsString()    const { return m->capHeightAsString() ; }
-	QString FontBBoxAsString()    const { return m->FontBBoxAsString() ; }
-	QString ItalicAngleAsString()    const { return m->ItalicAngleAsString() ; }
+	QString ascentAsString()      const;
+	QString descentAsString()     const;
+	QString capHeightAsString()   const;
+	QString fontBBoxAsString()    const;
+	QString italicAngleAsString() const;
 	qreal ascent(qreal sz=1.0)          const;
 	qreal descent(qreal sz=1.0)         const;
 	qreal xHeight(qreal sz=1.0)         const;
Index: scribus/pageitem.cpp
===================================================================
--- scribus/pageitem.cpp	(revision 15363)
+++ scribus/pageitem.cpp	(revision 15364)
@@ -6154,7 +6154,9 @@
 
 bool PageItem::loadImage(const QString& filename, const bool reload, const int gsResolution, bool showMsg)
 {
-	if (! asImageFrame())
+	bool useImage = (asImageFrame() != NULL);
+	useImage |= (isAnnotation() && annotation().UseIcons());
+	if (!useImage)
 		return false;
 	QFileInfo fi(filename);
 	QString clPath(pixm.imgInfo.usedPath);
Index: scribus/plugins/fileloader/scribus13format/scribus13format.cpp
===================================================================
--- scribus/plugins/fileloader/scribus13format/scribus13format.cpp	(revision 15363)
+++ scribus/plugins/fileloader/scribus13format/scribus13format.cpp	(revision 15364)
@@ -2144,58 +2144,12 @@
 		currItem = doc->Items->at(z);
 		if (pagenr > -2) 
 			currItem->OwnPage = pagenr;
-		UndoManager::instance()->setUndoEnabled(false);
-		if ((obj->attribute("ANNOTATION", "0").toInt()) && (static_cast<bool>(obj->attribute("ANICON", "0").toInt())))
-		{
-			currItem->ScaleType = obj->attribute("SCALETYPE", "1").toInt();
-			currItem->AspectRatio = obj->attribute("RATIO", "0").toInt();
-			currItem->setImageXYScale(scx, scy);
-			currItem->setImageXYOffset(offsX, offsY);
-			currItem->setImageRotation(rot);
-			currItem->Pfile  = Relative2Path(obj->attribute("PFILE" ,""), baseDir);
-			currItem->Pfile2 = Relative2Path(obj->attribute("PFILE2",""), baseDir);
-			currItem->Pfile3 = Relative2Path(obj->attribute("PFILE3",""), baseDir);
-			currItem->IProfile  = obj->attribute("PRFILE","");
-			currItem->EmProfile = obj->attribute("EPROF","");
-			currItem->IRender   = (eRenderIntent) obj->attribute("IRENDER", "1").toInt();
-			currItem->UseEmbedded = obj->attribute("EMBEDDED", "1").toInt();
-			doc->LoadPict(currItem->Pfile, z);
-			currItem->setImageXYScale(scx, scy);
-			currItem->setImageShown(obj->attribute("PICART").toInt());
-/*			currItem->BBoxX = obj->attribute("BBOXX").toDouble();
-			currItem->BBoxH = obj->attribute("BBOXH").toDouble(); */
-		}
-		//currItem->convertTo(pt);
-		UndoManager::instance()->setUndoEnabled(true);
 		break;
 	case PageItem::TextFrame:
 		z = doc->itemAdd(PageItem::TextFrame, PageItem::Unspecified, x, y, w, h, pw, CommonStrings::None, Pcolor, true);
 		currItem = doc->Items->at(z);
 		if (pagenr > -2) 
 			currItem->OwnPage = pagenr;
-		UndoManager::instance()->setUndoEnabled(false);
-		if ((obj->attribute("ANNOTATION", "0").toInt()) && (static_cast<bool>(obj->attribute("ANICON", "0").toInt())))
-		{
-			currItem->ScaleType = obj->attribute("SCALETYPE", "1").toInt();
-			currItem->AspectRatio = obj->attribute("RATIO", "0").toInt();
-			currItem->setImageXYScale(scx, scy);
-			currItem->setImageXYOffset(offsX, offsY);
-			currItem->setImageRotation(rot);
-			currItem->Pfile  = Relative2Path(obj->attribute("PFILE" ,""), baseDir);
-			currItem->Pfile2 = Relative2Path(obj->attribute("PFILE2",""), baseDir);
-			currItem->Pfile3 = Relative2Path(obj->attribute("PFILE3",""), baseDir);
-			currItem->IProfile  = obj->attribute("PRFILE","");
-			currItem->EmProfile = obj->attribute("EPROF","");
-			currItem->IRender   = (eRenderIntent) obj->attribute("IRENDER", "1").toInt();
-			currItem->UseEmbedded = obj->attribute("EMBEDDED", "1").toInt();
-			doc->LoadPict(currItem->Pfile, z);
-			currItem->setImageXYScale(scx, scy);
-			currItem->setImageShown(obj->attribute("PICART").toInt());
-/*			currItem->BBoxX = obj->attribute("BBOXX").toDouble();
-			currItem->BBoxH = obj->attribute("BBOXH").toDouble(); */
-		}
-		//currItem->convertTo(pt);
-		UndoManager::instance()->setUndoEnabled(true);
 		break;
 	case PageItem::Line:
 		z = doc->itemAdd(PageItem::Line, PageItem::Unspecified, x, y, w, h, pw, CommonStrings::None, Pcolor2, true);
@@ -2355,6 +2309,7 @@
 			currItem->AutoName = false;
 		}
 	}
+
 	currItem->annotation().setAction(obj->attribute("ANACTION",""));
 	currItem->annotation().setE_act(obj->attribute("ANEACT",""));
 	currItem->annotation().setX_act(obj->attribute("ANXACT",""));
@@ -2392,6 +2347,34 @@
 	currItem->annotation().setBorderColor(obj->attribute("ANBCOL", CommonStrings::None));
 	currItem->annotation().setIPlace(obj->attribute("ANPLACE", "1").toInt());
 	currItem->annotation().setScaleW(obj->attribute("ANSCALE", "0").toInt());
+
+	if (currItem->asTextFrame() || currItem->asPathText())
+	{
+		UndoManager::instance()->setUndoEnabled(false);
+		if (currItem->isAnnotation() && currItem->annotation().UseIcons())
+		{
+			currItem->ScaleType = obj->attribute("SCALETYPE", "1").toInt();
+			currItem->AspectRatio = obj->attribute("RATIO", "0").toInt();
+			currItem->setImageXYScale(scx, scy);
+			currItem->setImageXYOffset(offsX, offsY);
+			currItem->setImageRotation(rot);
+			currItem->Pfile  = Relative2Path(obj->attribute("PFILE" ,""), baseDir);
+			currItem->Pfile2 = Relative2Path(obj->attribute("PFILE2",""), baseDir);
+			currItem->Pfile3 = Relative2Path(obj->attribute("PFILE3",""), baseDir);
+			currItem->IProfile  = obj->attribute("PRFILE","");
+			currItem->EmProfile = obj->attribute("EPROF","");
+			currItem->IRender   = (eRenderIntent) obj->attribute("IRENDER", "1").toInt();
+			currItem->UseEmbedded = obj->attribute("EMBEDDED", "1").toInt();
+			doc->LoadPict(currItem->Pfile, z);
+			currItem->setImageXYScale(scx, scy);
+			currItem->setImageShown(obj->attribute("PICART").toInt());
+/*			currItem->BBoxX = obj->attribute("BBOXX").toDouble();
+			currItem->BBoxH = obj->attribute("BBOXH").toDouble(); */
+		}
+		//currItem->convertTo(pt);
+		UndoManager::instance()->setUndoEnabled(true);
+	}
+
 	currItem->TopLine = static_cast<bool>(obj->attribute("TopLine", "0").toInt());
 	currItem->LeftLine = static_cast<bool>(obj->attribute("LeftLine", "0").toInt());
 	currItem->RightLine = static_cast<bool>(obj->attribute("RightLine", "0").toInt());
Index: scribus/plugins/fileloader/scribus150format/scribus150format.cpp
===================================================================
--- scribus/plugins/fileloader/scribus150format/scribus150format.cpp	(revision 15363)
+++ scribus/plugins/fileloader/scribus150format/scribus150format.cpp	(revision 15364)
@@ -2428,58 +2428,12 @@
 		currItem = doc->Items->at(z);
 		if (pagenr > -2) 
 			currItem->OwnPage = pagenr;
-		UndoManager::instance()->setUndoEnabled(false);
-		if (attrs.valueAsInt("ANNOTATION", 0) && attrs.valueAsBool("ANICON", false))
-		{
-			currItem->setImageXYScale(scx, scy);
-			currItem->setImageXYOffset(attrs.valueAsDouble("LOCALX"), attrs.valueAsDouble("LOCALY"));
-			currItem->setImageRotation(attrs.valueAsDouble("LOCALROT"));
-			currItem->Pfile  = Relative2Path(attrs.valueAsString("PFILE" , "") , baseDir);
-			currItem->Pfile2 = Relative2Path(attrs.valueAsString("PFILE2", ""), baseDir);
-			currItem->Pfile3 = Relative2Path(attrs.valueAsString("PFILE3", ""), baseDir);
-			currItem->IProfile  = attrs.valueAsString("PRFILE", "");
-			currItem->EmProfile = attrs.valueAsString("EPROF", "");
-			currItem->IRender   = (eRenderIntent) attrs.valueAsInt("IRENDER", 1);
-			currItem->UseEmbedded = attrs.valueAsInt("EMBEDDED", 1);
-			doc->LoadPict(currItem->Pfile, z);
-			currItem->setImageXYScale(scx, scy);
-			currItem->setImageShown(attrs.valueAsInt("PICART"));
-/*			currItem->BBoxX = ScCLocale::toDoubleC( obj->attribute("BBOXX"));
-			currItem->BBoxH = ScCLocale::toDoubleC( obj->attribute("BBOXH")); */
-			currItem->ScaleType   = attrs.valueAsInt("SCALETYPE", 1);
-			currItem->AspectRatio = attrs.valueAsInt("RATIO", 0);
-		}
-		//currItem->convertTo(pt);
-		UndoManager::instance()->setUndoEnabled(true);
 		break;
 	case PageItem::TextFrame:
 		z = doc->itemAdd(PageItem::TextFrame, PageItem::Unspecified, x, y, w, h, pw, CommonStrings::None, Pcolor, true);
 		currItem = doc->Items->at(z);
 		if (pagenr > -2) 
 			currItem->OwnPage = pagenr;
-		UndoManager::instance()->setUndoEnabled(false);
-		if ((attrs.valueAsInt("ANNOTATION", 0)) && (attrs.valueAsBool("ANICON", false)))
-		{
-			currItem->setImageXYScale(scx, scy);
-			currItem->setImageXYOffset(attrs.valueAsDouble("LOCALX"), attrs.valueAsDouble("LOCALY"));
-			currItem->setImageRotation(attrs.valueAsDouble("LOCALROT"));
-			currItem->Pfile  = Relative2Path(attrs.valueAsString("PFILE" , ""), baseDir);
-			currItem->Pfile2 = Relative2Path(attrs.valueAsString("PFILE2", ""), baseDir);
-			currItem->Pfile3 = Relative2Path(attrs.valueAsString("PFILE3", ""), baseDir);
-			currItem->IProfile    = attrs.valueAsString("PRFILE", "");
-			currItem->EmProfile   = attrs.valueAsString("EPROF", "");
-			currItem->IRender     = (eRenderIntent) attrs.valueAsInt("IRENDER" , 1);
-			currItem->UseEmbedded = attrs.valueAsInt("EMBEDDED", 1);
-			doc->LoadPict(currItem->Pfile, z);
-			currItem->setImageXYScale(scx, scy);
-			currItem->setImageShown( attrs.valueAsInt("PICART"));
-/*			currItem->BBoxX = ScCLocale::toDoubleC( obj->attribute("BBOXX"));
-			currItem->BBoxH = ScCLocale::toDoubleC( obj->attribute("BBOXH")); */
-			currItem->ScaleType   = attrs.valueAsInt("SCALETYPE", 1);
-			currItem->AspectRatio = attrs.valueAsInt("RATIO", 0);
-		}
-		//currItem->convertTo(pt);
-		UndoManager::instance()->setUndoEnabled(true);
 		break;
 	case PageItem::Line:
 		z = doc->itemAdd(PageItem::Line, PageItem::Unspecified, x, y, w, h, pw, CommonStrings::None, Pcolor2, true);
@@ -2640,6 +2594,7 @@
 			currItem->AutoName = false;
 		}
 	}
+
 	currItem->annotation().setAction( attrs.valueAsString("ANACTION","") );
 	currItem->annotation().setE_act ( attrs.valueAsString("ANEACT","") );
 	currItem->annotation().setX_act ( attrs.valueAsString("ANXACT","") );
@@ -2674,6 +2629,33 @@
 	currItem->annotation().setBorderColor( attrs.valueAsString("ANBCOL", CommonStrings::None));
 	currItem->annotation().setIPlace(attrs.valueAsInt("ANPLACE", 1));
 	currItem->annotation().setScaleW(attrs.valueAsInt("ANSCALE", 0));
+
+	if (currItem->asTextFrame() || currItem->asPathText())
+	{
+		UndoManager::instance()->setUndoEnabled(false);
+		if (currItem->isAnnotation() && currItem->annotation().UseIcons())
+		{
+			currItem->setImageXYScale(scx, scy);
+			currItem->setImageXYOffset(attrs.valueAsDouble("LOCALX"), attrs.valueAsDouble("LOCALY"));
+			currItem->setImageRotation(attrs.valueAsDouble("LOCALROT"));
+			currItem->Pfile  = Relative2Path(attrs.valueAsString("PFILE" , ""), baseDir);
+			currItem->Pfile2 = Relative2Path(attrs.valueAsString("PFILE2", ""), baseDir);
+			currItem->Pfile3 = Relative2Path(attrs.valueAsString("PFILE3", ""), baseDir);
+			currItem->IProfile    = attrs.valueAsString("PRFILE", "");
+			currItem->EmProfile   = attrs.valueAsString("EPROF", "");
+			currItem->IRender     = (eRenderIntent) attrs.valueAsInt("IRENDER" , 1);
+			currItem->UseEmbedded = attrs.valueAsInt("EMBEDDED", 1);
+			doc->LoadPict(currItem->Pfile, z);
+			currItem->setImageXYScale(scx, scy);
+			currItem->setImageShown( attrs.valueAsInt("PICART"));
+/*			currItem->BBoxX = ScCLocale::toDoubleC( obj->attribute("BBOXX"));
+			currItem->BBoxH = ScCLocale::toDoubleC( obj->attribute("BBOXH")); */
+			currItem->ScaleType   = attrs.valueAsInt("SCALETYPE", 1);
+			currItem->AspectRatio = attrs.valueAsInt("RATIO", 0);
+		}
+		UndoManager::instance()->setUndoEnabled(true);
+	}
+
 	currItem->TopLine      = attrs.valueAsBool("TopLine", false);
 	currItem->LeftLine     = attrs.valueAsBool("LeftLine", false);
 	currItem->RightLine    = attrs.valueAsBool("RightLine", false);
Index: scribus/plugins/fileloader/scribus134format/scribus134format.cpp
===================================================================
--- scribus/plugins/fileloader/scribus134format/scribus134format.cpp	(revision 15363)
+++ scribus/plugins/fileloader/scribus134format/scribus134format.cpp	(revision 15364)
@@ -2397,58 +2397,12 @@
 		currItem = doc->Items->at(z);
 		if (pagenr > -2) 
 			currItem->OwnPage = pagenr;
-		UndoManager::instance()->setUndoEnabled(false);
-		if (attrs.valueAsInt("ANNOTATION", 0) && attrs.valueAsBool("ANICON", false))
-		{
-			currItem->ScaleType   = attrs.valueAsInt("SCALETYPE", 1);
-			currItem->AspectRatio = attrs.valueAsInt("RATIO", 0);
-			currItem->setImageXYScale(scx, scy);
-			currItem->setImageXYOffset(attrs.valueAsDouble("LOCALX"), attrs.valueAsDouble("LOCALY"));
-			currItem->setImageRotation(attrs.valueAsDouble("LOCALROT", 0));
-			currItem->Pfile  = Relative2Path(attrs.valueAsString("PFILE" , "") , baseDir);
-			currItem->Pfile2 = Relative2Path(attrs.valueAsString("PFILE2", ""), baseDir);
-			currItem->Pfile3 = Relative2Path(attrs.valueAsString("PFILE3", ""), baseDir);
-			currItem->IProfile  = attrs.valueAsString("PRFILE", "");
-			currItem->EmProfile = attrs.valueAsString("EPROF", "");
-			currItem->IRender   = (eRenderIntent) attrs.valueAsInt("IRENDER", 1);
-			currItem->UseEmbedded = attrs.valueAsInt("EMBEDDED", 1);
-			doc->LoadPict(currItem->Pfile, z);
-			currItem->setImageXYScale(scx, scy);
-			currItem->setImageShown(attrs.valueAsInt("PICART"));
-/*			currItem->BBoxX = ScCLocale::toDoubleC( obj->attribute("BBOXX"));
-			currItem->BBoxH = ScCLocale::toDoubleC( obj->attribute("BBOXH")); */
-		}
-		//currItem->convertTo(pt);
-		UndoManager::instance()->setUndoEnabled(true);
 		break;
 	case PageItem::TextFrame:
 		z = doc->itemAdd(PageItem::TextFrame, PageItem::Unspecified, x, y, w, h, pw, CommonStrings::None, Pcolor, true);
 		currItem = doc->Items->at(z);
 		if (pagenr > -2) 
 			currItem->OwnPage = pagenr;
-		UndoManager::instance()->setUndoEnabled(false);
-		if ((attrs.valueAsInt("ANNOTATION", 0)) && (attrs.valueAsBool("ANICON", false)))
-		{
-			currItem->ScaleType   = attrs.valueAsInt("SCALETYPE", 1);
-			currItem->AspectRatio = attrs.valueAsInt("RATIO", 0);
-			currItem->setImageXYScale(scx, scy);
-			currItem->setImageXYOffset(attrs.valueAsDouble("LOCALX"), attrs.valueAsDouble("LOCALY"));
-			currItem->setImageRotation(attrs.valueAsDouble("LOCALROT", 0));
-			currItem->Pfile  = Relative2Path(attrs.valueAsString("PFILE" , ""), baseDir);
-			currItem->Pfile2 = Relative2Path(attrs.valueAsString("PFILE2", ""), baseDir);
-			currItem->Pfile3 = Relative2Path(attrs.valueAsString("PFILE3", ""), baseDir);
-			currItem->IProfile    = attrs.valueAsString("PRFILE", "");
-			currItem->EmProfile   = attrs.valueAsString("EPROF", "");
-			currItem->IRender     = (eRenderIntent) attrs.valueAsInt("IRENDER" , 1);
-			currItem->UseEmbedded = attrs.valueAsInt("EMBEDDED", 1);
-			doc->LoadPict(currItem->Pfile, z);
-			currItem->setImageXYScale(scx, scy);
-			currItem->setImageShown( attrs.valueAsInt("PICART"));
-/*			currItem->BBoxX = ScCLocale::toDoubleC( obj->attribute("BBOXX"));
-			currItem->BBoxH = ScCLocale::toDoubleC( obj->attribute("BBOXH")); */
-		}
-		//currItem->convertTo(pt);
-		UndoManager::instance()->setUndoEnabled(true);
 		break;
 	case PageItem::Line:
 		z = doc->itemAdd(PageItem::Line, PageItem::Unspecified, x, y, w, h, pw, CommonStrings::None, Pcolor2, true);
@@ -2637,6 +2591,33 @@
 	currItem->annotation().setBorderColor( attrs.valueAsString("ANBCOL", CommonStrings::None));
 	currItem->annotation().setIPlace(attrs.valueAsInt("ANPLACE", 1));
 	currItem->annotation().setScaleW(attrs.valueAsInt("ANSCALE", 0));
+
+	if (currItem->asTextFrame() || currItem->asPathText())
+	{
+		UndoManager::instance()->setUndoEnabled(false);
+		if (currItem->isAnnotation() && currItem->annotation().UseIcons())
+		{
+			currItem->ScaleType   = attrs.valueAsInt("SCALETYPE", 1);
+			currItem->AspectRatio = attrs.valueAsInt("RATIO", 0);
+			currItem->setImageXYScale(scx, scy);
+			currItem->setImageXYOffset(attrs.valueAsDouble("LOCALX"), attrs.valueAsDouble("LOCALY"));
+			currItem->setImageRotation(attrs.valueAsDouble("LOCALROT", 0));
+			currItem->Pfile  = Relative2Path(attrs.valueAsString("PFILE" , ""), baseDir);
+			currItem->Pfile2 = Relative2Path(attrs.valueAsString("PFILE2", ""), baseDir);
+			currItem->Pfile3 = Relative2Path(attrs.valueAsString("PFILE3", ""), baseDir);
+			currItem->IProfile    = attrs.valueAsString("PRFILE", "");
+			currItem->EmProfile   = attrs.valueAsString("EPROF", "");
+			currItem->IRender     = (eRenderIntent) attrs.valueAsInt("IRENDER" , 1);
+			currItem->UseEmbedded = attrs.valueAsInt("EMBEDDED", 1);
+			doc->LoadPict(currItem->Pfile, z);
+			currItem->setImageXYScale(scx, scy);
+			currItem->setImageShown( attrs.valueAsInt("PICART"));
+/*			currItem->BBoxX = ScCLocale::toDoubleC( obj->attribute("BBOXX"));
+			currItem->BBoxH = ScCLocale::toDoubleC( obj->attribute("BBOXH")); */
+		}
+		UndoManager::instance()->setUndoEnabled(true);
+	}
+
 	currItem->TopLine      = attrs.valueAsBool("TopLine", false);
 	currItem->LeftLine     = attrs.valueAsBool("LeftLine", false);
 	currItem->RightLine    = attrs.valueAsBool("RightLine", false);




More information about the scribus-commit mailing list