r16979 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:45:12 UTC 2011
Author: jghali
Date: Tue Nov 15 21:45:12 2011
New Revision: 16979
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=16979
Log:
#10371: Adobe Reader states "Too few operands" when opening a Scribus-generated PDF containing form fields
Modified:
branches/Version135/Scribus/scribus/scribusdoc.cpp
branches/Version135/Scribus/scribus/tabpdfoptions.cpp
Modified: branches/Version135/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16979&path=/branches/Version135/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/scribusdoc.cpp (original)
+++ branches/Version135/Scribus/scribus/scribusdoc.cpp Tue Nov 15 21:45:12 2011
@@ -3083,6 +3083,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()) )
@@ -4856,7 +4866,7 @@
bool ScribusDoc::itemNameExists(const QString checkItemName)
{
bool found = false;
- uint docItemCount=Items->count();
+ uint docItemCount = Items->count();
for (uint i = 0; i < docItemCount; ++i)
{
if (checkItemName == Items->at(i)->itemName())
Modified: branches/Version135/Scribus/scribus/tabpdfoptions.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16979&path=/branches/Version135/Scribus/scribus/tabpdfoptions.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/tabpdfoptions.cpp (original)
+++ branches/Version135/Scribus/scribus/tabpdfoptions.cpp Tue Nov 15 21:45:12 2011
@@ -1054,20 +1054,35 @@
for (int c = 0; c < doc->FrameItems.count(); ++c)
{
pgit = doc->FrameItems.at(c);
- 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(), "");
+ }
}
for (int c = 0; c < doc->MasterItems.count(); ++c)
{
pgit = doc->MasterItems.at(c);
- 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(), "");
+ }
}
for (int c = 0; c < doc->DocItems.count(); ++c)
{
pgit = doc->DocItems.at(c);
- 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(), "");
+ }
}
QMap<QString,int>::const_iterator it;
AvailFlist->clear();
More information about the scribus-commit
mailing list