r16980 by jghali - #10371: Adobe Reader states "Too few operands" when opening a Scribus-generated PDF containing form fields

scribus-commit scribus-commit at lists.scribus.net
Tue Nov 15 21:46:16 UTC 2011


Author: jghali
Date: Tue Nov 15 21:46:16 2011
New Revision: 16980

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=16980
Log:
#10371: Adobe Reader states "Too few operands" when opening a Scribus-generated PDF containing form fields

Modified:
    trunk/Scribus/scribus/scribusdoc.cpp
    trunk/Scribus/scribus/ui/tabpdfoptions.cpp

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16980&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Tue Nov 15 21:46:16 2011
@@ -3659,6 +3659,16 @@
 	QChar chstr;
 	if ((it->itemType() == PageItem::TextFrame) || (it->itemType() == PageItem::PathText))
 	{
+		/* May be needed for fixing #10371 completely
+		if (it->isAnnotation())
+		{
+			int annotType  = it->annotation().Type();
+			bool mustEmbed = ((annotType >= 2) && (annotType <= 6) && (annotType != 4));
+			if (mustEmbed && (!Really.contains(it->itemText.defaultStyle().charStyle().font().replacementName())))
+			{
+				Really.insert(it->itemText.defaultStyle().charStyle().font().replacementName(), QMap<uint, FPointArray>());
+			}
+		}*/
 		for (int e = 0; e < it->itemText.length(); ++e)
 		{
 			if (! Really.contains(it->itemText.charStyle(e).font().replacementName()) )

Modified: trunk/Scribus/scribus/ui/tabpdfoptions.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16980&path=/trunk/Scribus/scribus/ui/tabpdfoptions.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/tabpdfoptions.cpp (original)
+++ trunk/Scribus/scribus/ui/tabpdfoptions.cpp Tue Nov 15 21:46:16 2011
@@ -1071,8 +1071,13 @@
 			for (int ii = 0; ii < allItems.count(); ii++)
 			{
 				pgit = allItems.at(ii);
-				if (((pgit->itemType() == PageItem::TextFrame) || (pgit->itemType() == PageItem::PathText)) && (pgit->isAnnotation()) && (pgit->itemText.length() > 0))
-					AnnotationFonts.insert(pgit->itemText.defaultStyle().charStyle().font().replacementName(), "");
+				if (((pgit->itemType() == PageItem::TextFrame) || (pgit->itemType() == PageItem::PathText)) && (pgit->isAnnotation()))
+				{
+					int annotType  = pgit->annotation().Type();
+					bool mustEmbed = ((annotType >= 2) && (annotType <= 6) && (annotType != 4));
+					if (pgit->itemText.length() > 0 || mustEmbed)
+						AnnotationFonts.insert(pgit->itemText.defaultStyle().charStyle().font().replacementName(), "");
+				}
 			}
 			allItems.clear();
 		}
@@ -1086,8 +1091,13 @@
 			for (int ii = 0; ii < allItems.count(); ii++)
 			{
 				pgit = allItems.at(ii);
-				if (((pgit->itemType() == PageItem::TextFrame) || (pgit->itemType() == PageItem::PathText)) && (pgit->isAnnotation()) && (pgit->itemText.length() > 0))
-					AnnotationFonts.insert(pgit->itemText.defaultStyle().charStyle().font().replacementName(), "");
+				if (((pgit->itemType() == PageItem::TextFrame) || (pgit->itemType() == PageItem::PathText)) && (pgit->isAnnotation()))
+				{
+					int annotType  = pgit->annotation().Type();
+					bool mustEmbed = ((annotType >= 2) && (annotType <= 6) && (annotType != 4));
+					if (pgit->itemText.length() > 0 || mustEmbed)
+						AnnotationFonts.insert(pgit->itemText.defaultStyle().charStyle().font().replacementName(), "");
+				}
 			}
 			allItems.clear();
 		}
@@ -1101,8 +1111,13 @@
 			for (int ii = 0; ii < allItems.count(); ii++)
 			{
 				pgit = allItems.at(ii);
-				if (((pgit->itemType() == PageItem::TextFrame) || (pgit->itemType() == PageItem::PathText)) && (pgit->isAnnotation()) && (pgit->itemText.length() > 0))
-					AnnotationFonts.insert(pgit->itemText.defaultStyle().charStyle().font().replacementName(), "");
+				if (((pgit->itemType() == PageItem::TextFrame) || (pgit->itemType() == PageItem::PathText)) && (pgit->isAnnotation()))
+				{
+					int annotType  = pgit->annotation().Type();
+					bool mustEmbed = ((annotType >= 2) && (annotType <= 6) && (annotType != 4));
+					if (pgit->itemText.length() > 0 || mustEmbed)
+						AnnotationFonts.insert(pgit->itemText.defaultStyle().charStyle().font().replacementName(), "");
+				}
 			}
 			allItems.clear();
 		}




More information about the scribus-commit mailing list