r18491 by craig - #11504: Check for empty text frames in Preflight Verifier

scribus-commit scribus-commit at lists.scribus.net
Mon Sep 23 21:13:06 UTC 2013


Author: craig
Date: Mon Sep 23 21:13:05 2013
New Revision: 18491

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18491
Log:
#11504: Check for empty text frames in Preflight Verifier

Modified:
    trunk/Scribus/scribus/documentchecker.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
    trunk/Scribus/scribus/prefsmanager.cpp
    trunk/Scribus/scribus/prefsstructs.h
    trunk/Scribus/scribus/scribusstructs.h
    trunk/Scribus/scribus/ui/checkDocument.cpp
    trunk/Scribus/scribus/ui/checkDocument.h
    trunk/Scribus/scribus/ui/prefs_preflightverifier.cpp
    trunk/Scribus/scribus/ui/prefs_preflightverifierbase.ui

Modified: trunk/Scribus/scribus/documentchecker.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18491&path=/trunk/Scribus/scribus/documentchecker.cpp
==============================================================================
--- trunk/Scribus/scribus/documentchecker.cpp (original)
+++ trunk/Scribus/scribus/documentchecker.cpp Mon Sep 23 21:13:05 2013
@@ -50,6 +50,8 @@
 bool DocumentChecker::checkDocument(ScribusDoc *currDoc)
 {
 	struct CheckerPrefs checkerSettings;
+	checkerSettings=currDoc->checkerProfiles()[currDoc->curCheckProfile()];
+	/*
 	checkerSettings.ignoreErrors = currDoc->checkerProfiles()[currDoc->curCheckProfile()].ignoreErrors;
 	checkerSettings.autoCheck = currDoc->checkerProfiles()[currDoc->curCheckProfile()].autoCheck;
 	checkerSettings.checkGlyphs = currDoc->checkerProfiles()[currDoc->curCheckProfile()].checkGlyphs;
@@ -72,6 +74,7 @@
 	checkerSettings.checkFontIsOpenType = currDoc->checkerProfiles()[currDoc->curCheckProfile()].checkFontIsOpenType;
 	checkerSettings.checkOppositePageMaster = currDoc->checkerProfiles()[currDoc->curCheckProfile()].checkOppositePageMaster;
 	checkerSettings.checkAppliedMasterDifferentSide = currDoc->checkerProfiles()[currDoc->curCheckProfile()].checkAppliedMasterDifferentSide;
+	*/
 	currDoc->pageErrors.clear();
 	currDoc->docItemErrors.clear();
 	currDoc->masterItemErrors.clear();
@@ -360,6 +363,7 @@
 	#ifndef NLS_PROTO
 				if ( currItem->frameOverflows() && (checkerSettings.checkOverflow) && (!((currItem->isAnnotation()) && ((currItem->annotation().Type() == Annotation::Combobox) || (currItem->annotation().Type() == Annotation::Listbox)))))
 					itemError.insert(TextOverflow, 0);
+
 				if (currItem->isAnnotation())
 				{
 					ScFace::FontFormat fformat = currItem->itemText.defaultStyle().charStyle().font().format();
@@ -651,6 +655,10 @@
 	#ifndef NLS_PROTO
 				if ( currItem->frameOverflows() && (checkerSettings.checkOverflow) && (!((currItem->isAnnotation()) && ((currItem->annotation().Type() == Annotation::Combobox) || (currItem->annotation().Type() == Annotation::Listbox)))))
 					itemError.insert(TextOverflow, 0);
+
+				if (checkerSettings.checkEmptyTextFrames && currItem->itemText.length()==0)
+					itemError.insert(EmptyTextFrame, 0);
+
 				if (currItem->isAnnotation())
 				{
 					ScFace::FontFormat fformat = currItem->itemText.defaultStyle().charStyle().font().format();

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18491&path=/trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp Mon Sep 23 21:13:05 2013
@@ -1121,6 +1121,7 @@
 	checkerSettings.checkFontNotEmbedded = attrs.valueAsBool("checkFontNotEmbedded", false);
 	checkerSettings.checkFontIsOpenType  = attrs.valueAsBool("checkFontIsOpenType", false);
 	checkerSettings.checkAppliedMasterDifferentSide = attrs.valueAsBool("checkAppliedMasterDifferentSide", true);
+	checkerSettings.checkEmptyTextFrames     = attrs.valueAsBool("checkEmptyTextFrames", true);
 	doc->set1CheckerProfile(profileName, checkerSettings);
 	return true;
 }

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18491&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp Mon Sep 23 21:13:05 2013
@@ -2342,6 +2342,7 @@
 	checkerSettings.checkFontNotEmbedded = attrs.valueAsBool("checkFontNotEmbedded", false);
 	checkerSettings.checkFontIsOpenType  = attrs.valueAsBool("checkFontIsOpenType", false);
 	checkerSettings.checkAppliedMasterDifferentSide  = attrs.valueAsBool("checkAppliedMasterDifferentSide", true);
+	checkerSettings.checkEmptyTextFrames     = attrs.valueAsBool("checkEmptyTextFrames", true);
 	doc->set1CheckerProfile(profileName, checkerSettings);
 	return true;
 }

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18491&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp Mon Sep 23 21:13:05 2013
@@ -455,6 +455,7 @@
 		docu.writeAttribute("checkFontNotEmbedded", static_cast<int>(itcp.value().checkFontNotEmbedded));
 		docu.writeAttribute("checkFontIsOpenType", static_cast<int>(itcp.value().checkFontIsOpenType));
 		docu.writeAttribute("checkAppliedMasterDifferentSide", static_cast<int>(itcp.value().checkAppliedMasterDifferentSide));
+		docu.writeAttribute("checkEmptyTextFrames", static_cast<int>(itcp.value().checkEmptyTextFrames));
 	}
 }
 

Modified: trunk/Scribus/scribus/prefsmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18491&path=/trunk/Scribus/scribus/prefsmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/prefsmanager.cpp (original)
+++ trunk/Scribus/scribus/prefsmanager.cpp Mon Sep 23 21:13:05 2013
@@ -1620,6 +1620,7 @@
 		dcVerifierProfile.setAttribute("CheckFontNotEmbedded", static_cast<int>(itcp.value().checkFontNotEmbedded));
 		dcVerifierProfile.setAttribute("CheckFontIsOpenType", static_cast<int>(itcp.value().checkFontIsOpenType));
 		dcVerifierProfile.setAttribute("CheckAppliedMasterDifferentSide", static_cast<int>(itcp.value().checkAppliedMasterDifferentSide));
+		dcVerifierProfile.setAttribute("CheckEmptyTextFrames", static_cast<int>(itcp.value().checkEmptyTextFrames));
 		elem.appendChild(dcVerifierProfile);
 	}
 	QDomElement dcColorManagement=docu.createElement("ColorManagement");
@@ -2329,6 +2330,7 @@
 			checkerSettings.checkFontNotEmbedded = static_cast<bool>(dc.attribute("CheckFontNotEmbedded", "0").toInt());
 			checkerSettings.checkFontIsOpenType = static_cast<bool>(dc.attribute("CheckFontIsOpenType", "0").toInt());
 			checkerSettings.checkAppliedMasterDifferentSide = static_cast<bool>(dc.attribute("CheckAppliedMasterDifferentSide", "1").toInt());
+			checkerSettings.checkEmptyTextFrames = static_cast<bool>(dc.attribute("CheckEmptyTextFrames", "1").toInt());
 			appPrefs.verifierPrefs.checkerPrefsList[name] = checkerSettings;
 		}
 		if (dc.tagName()=="Printer")
@@ -2645,6 +2647,7 @@
 		checkerSettings.checkFontNotEmbedded = false;
 		checkerSettings.checkFontIsOpenType = false;
 		checkerSettings.checkAppliedMasterDifferentSide = true;
+		checkerSettings.checkEmptyTextFrames = true;
 		//TODO Stop translating these into settings!!!!!!!!!
 		cp->insert( CommonStrings::PostScript, checkerSettings);
 		checkerSettings.checkFontNotEmbedded = true;

Modified: trunk/Scribus/scribus/prefsstructs.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18491&path=/trunk/Scribus/scribus/prefsstructs.h
==============================================================================
--- trunk/Scribus/scribus/prefsstructs.h (original)
+++ trunk/Scribus/scribus/prefsstructs.h Mon Sep 23 21:13:05 2013
@@ -54,6 +54,7 @@
 	bool checkPartFilledImageFrames;
 	bool checkOppositePageMaster;
 	bool checkAppliedMasterDifferentSide;
+	bool checkEmptyTextFrames;
 };
 
 typedef QMap<QString, CheckerPrefs> CheckerPrefsList;

Modified: trunk/Scribus/scribus/scribusstructs.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18491&path=/trunk/Scribus/scribus/scribusstructs.h
==============================================================================
--- trunk/Scribus/scribus/scribusstructs.h (original)
+++ trunk/Scribus/scribus/scribusstructs.h Mon Sep 23 21:13:05 2013
@@ -260,26 +260,27 @@
 };
 
 typedef enum {
-	MissingGlyph=1,
-	TextOverflow=2,
-	ObjectNotOnPage=3,
-	MissingImage=4,
-	ImageDPITooLow=5,
-	Transparency=6,
-	PDFAnnotField=7,
-	PlacedPDF=8,
-	ImageDPITooHigh=9,
-	ImageIsGIF=10,
-	BlendMode=11,
-	WrongFontInAnnotation=12,
-	NotCMYKOrSpot=13,
-	DeviceColorsAndOutputIntent=14,
-	FontNotEmbedded=15,
-	EmbeddedFontIsOpenType=16,
-	OffConflictLayers=17,
-	PartFilledImageFrame= 18,
+	MissingGlyph = 1,
+	TextOverflow = 2,
+	ObjectNotOnPage = 3,
+	MissingImage = 4,
+	ImageDPITooLow = 5,
+	Transparency = 6,
+	PDFAnnotField = 7,
+	PlacedPDF = 8,
+	ImageDPITooHigh = 9,
+	ImageIsGIF = 10,
+	BlendMode = 11,
+	WrongFontInAnnotation = 12,
+	NotCMYKOrSpot = 13,
+	DeviceColorsAndOutputIntent = 14,
+	FontNotEmbedded = 15,
+	EmbeddedFontIsOpenType = 16,
+	OffConflictLayers = 17,
+	PartFilledImageFrame = 18,
 	MarksChanged = 19,
-	AppliedMasterDifferentSide = 20
+	AppliedMasterDifferentSide = 20,
+	EmptyTextFrame = 21
 } PreflightError;
 
 typedef QMap<PreflightError, int> errorCodes;

Modified: trunk/Scribus/scribus/ui/checkDocument.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18491&path=/trunk/Scribus/scribus/ui/checkDocument.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/checkDocument.cpp (original)
+++ trunk/Scribus/scribus/ui/checkDocument.cpp Mon Sep 23 21:13:05 2013
@@ -278,6 +278,11 @@
 		case FontNotEmbedded:
 			item->setText(COLUMN_PROBLEM, fontNotEmbedded);
 			item->setIcon(COLUMN_ITEM, graveError);
+			itemError = true;
+			break;
+		case EmptyTextFrame:
+			item->setText(COLUMN_PROBLEM, emptyTextFrame);
+			item->setIcon(COLUMN_ITEM, onlyWarning);
 			itemError = true;
 			break;
 		default:
@@ -686,6 +691,7 @@
 	fontNotEmbedded =  tr("Imported document contains non embedded fonts");
 	//isGIFtoolTip = "<qt>" + tr("GIF images are not recommended for print. See the online docs for more info") + "</qt>";
 	appliedMasterDifferentSide = tr("Applied master page has different page destination (left, middle, right side)");
+	emptyTextFrame = tr("Empty Image Frame");
 }
 
 void CheckDocument::setIgnoreEnabled(bool state)

Modified: trunk/Scribus/scribus/ui/checkDocument.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18491&path=/trunk/Scribus/scribus/ui/checkDocument.h
==============================================================================
--- trunk/Scribus/scribus/ui/checkDocument.h (original)
+++ trunk/Scribus/scribus/ui/checkDocument.h Mon Sep 23 21:13:05 2013
@@ -141,6 +141,7 @@
 	QString notCMYKOrSpot;
 	QString fontNotEmbedded;
 	QString appliedMasterDifferentSide;
+	QString emptyTextFrame;
 
 	//! \brief Flag if is ignore button shown. true = hidden, false = shown.
 	bool noButton;

Modified: trunk/Scribus/scribus/ui/prefs_preflightverifier.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18491&path=/trunk/Scribus/scribus/ui/prefs_preflightverifier.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_preflightverifier.cpp (original)
+++ trunk/Scribus/scribus/ui/prefs_preflightverifier.cpp Mon Sep 23 21:13:05 2013
@@ -37,6 +37,7 @@
 	connect(removeProfilePushButton, SIGNAL(clicked()), this, SLOT(delProf()));
 	connect(addProfilePushButton, SIGNAL(clicked()), this, SLOT(addProf()));
 	connect(checkAppliedMasterPageLocationCheckBox, SIGNAL(clicked()), this, SLOT(putProfile()));
+	connect(checkEmptyTextFramesCheckBox, SIGNAL(clicked()), this, SLOT(putProfile()));
 }
 
 Prefs_PreflightVerifier::~Prefs_PreflightVerifier()
@@ -74,6 +75,7 @@
 	checkNonPrintableLayersCheckBox->setChecked(checkerProfile[prefProfile].ignoreOffLayers);
 	checkVisiblePrintableLayersCheckBox->setChecked(checkerProfile[prefProfile].checkOffConflictLayers);
 	checkAppliedMasterPageLocationCheckBox->setChecked(checkerProfile[prefProfile].checkAppliedMasterDifferentSide);
+	checkEmptyTextFramesCheckBox->setChecked(checkerProfile[prefProfile].checkEmptyTextFrames);
 	minimumResolutionSpinBox->setValue( qRound(checkerProfile[prefProfile].minResolution) );
 	maximumResolutionSpinBox->setValue( qRound(checkerProfile[prefProfile].maxResolution) );
 	currentProfile = prefProfile;

Modified: trunk/Scribus/scribus/ui/prefs_preflightverifierbase.ui
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18491&path=/trunk/Scribus/scribus/ui/prefs_preflightverifierbase.ui
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_preflightverifierbase.ui (original)
+++ trunk/Scribus/scribus/ui/prefs_preflightverifierbase.ui Mon Sep 23 21:13:05 2013
@@ -216,6 +216,13 @@
         </widget>
        </item>
        <item>
+        <widget class="QCheckBox" name="checkEmptyTextFramesCheckBox">
+         <property name="text">
+          <string>Check for empty text frames</string>
+         </property>
+        </widget>
+       </item>
+       <item>
         <widget class="QCheckBox" name="checkTextOverflowCheckBox">
          <property name="text">
           <string>Check for overflow in text frames</string>




More information about the scribus-commit mailing list