r16457 by jghali - #9852: Doc prefs do not save PDF marks related settings

scribus-commit scribus-commit at lists.scribus.net
Thu Mar 17 23:08:03 CET 2011


Author: jghali
Date: Thu Mar 17 22:08:03 2011
New Revision: 16457

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16457
Log:
#9852: Doc prefs do not save PDF marks related settings

Modified:
    branches/Version135/Scribus/scribus/reformdoc.cpp
    branches/Version135/Scribus/scribus/tabpdfoptions.cpp
    branches/Version135/Scribus/scribus/tabpdfoptions.h

Modified: branches/Version135/Scribus/scribus/reformdoc.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16457&path=/branches/Version135/Scribus/scribus/reformdoc.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/reformdoc.cpp (original)
+++ branches/Version135/Scribus/scribus/reformdoc.cpp Thu Mar 17 22:08:03 2011
@@ -535,106 +535,7 @@
 	for (it3a = uf.begin(); it3a != it3aend; ++it3a)
 		currDoc->AddFont(*it3a);
 
-	currDoc->PDF_Options.Thumbnails = tabPDF->CheckBox1->isChecked();
-	currDoc->PDF_Options.Compress = tabPDF->Compression->isChecked();
-	currDoc->PDF_Options.CompressMethod = (PDFOptions::PDFCompression) tabPDF->CMethod->currentIndex();
-	currDoc->PDF_Options.Quality = tabPDF->CQuality->currentIndex();
-	currDoc->PDF_Options.embedPDF = tabPDF->EmbedPDF->isChecked();
-	currDoc->PDF_Options.Resolution = tabPDF->Resolution->value();
-	currDoc->PDF_Options.RecalcPic = tabPDF->DSColor->isChecked();
-	currDoc->PDF_Options.PicRes = tabPDF->ValC->value();
-	currDoc->PDF_Options.Bookmarks = tabPDF->CheckBM->isChecked();
-	currDoc->PDF_Options.Binding = tabPDF->ComboBind->currentIndex();
-	currDoc->PDF_Options.MirrorH = tabPDF->MirrorH->isChecked();
-	currDoc->PDF_Options.MirrorV = tabPDF->MirrorV->isChecked();
-	currDoc->PDF_Options.RotateDeg = tabPDF->RotateDeg->currentIndex() * 90;
-	currDoc->PDF_Options.Articles = tabPDF->Article->isChecked();
-	currDoc->PDF_Options.Encrypt = tabPDF->Encry->isChecked();
-	currDoc->PDF_Options.UseLPI = tabPDF->UseLPI->isChecked();
-	currDoc->PDF_Options.useLayers = tabPDF->useLayers->isChecked();
-	currDoc->PDF_Options.UseSpotColors = !tabPDF->useSpot->isChecked();
-	currDoc->PDF_Options.doMultiFile = false;
-	currDoc->PDF_Options.bleeds.Bottom = tabPDF->BleedBottom->value() / currDoc->unitRatio();
-	currDoc->PDF_Options.bleeds.Top = tabPDF->BleedTop->value() / currDoc->unitRatio();
-	currDoc->PDF_Options.bleeds.Left = tabPDF->BleedLeft->value() / currDoc->unitRatio();
-	currDoc->PDF_Options.bleeds.Right = tabPDF->BleedRight->value() / currDoc->unitRatio();
-	currDoc->PDF_Options.doClip = tabPDF->ClipMarg->isChecked();
-	/* DISABLED CR 2006-12-07 Work around #2964
-	currDoc->PDF_Options.displayBookmarks = tabPDF->useBookmarks->isChecked();
-	currDoc->PDF_Options.displayFullscreen = tabPDF->useFullScreen->isChecked();
-	currDoc->PDF_Options.displayLayers = tabPDF->useLayers2->isChecked();
-	currDoc->PDF_Options.displayThumbs = tabPDF->useThumbnails->isChecked();
-	int pgl = PDFOptions::SinglePage;
-	if (tabPDF->singlePage->isChecked())
-		pgl = PDFOptions::SinglePage;
-	else if (tabPDF->continuousPages->isChecked())
-		pgl = PDFOptions::OneColumn;
-	else if (tabPDF->doublePageLeft->isChecked())
-		pgl = PDFOptions::TwoColumnLeft;
-	else if (tabPDF->doublePageRight->isChecked())
-		pgl = PDFOptions::TwoColumnRight;
-	currDoc->PDF_Options.PageLayout = pgl;
-	*/
-	currDoc->PDF_Options.openAction = "";
-	if (tabPDF->Encry->isChecked())
-	{
-		int Perm = -64;
-		if (tabPDF->PDFVersionCombo->currentIndex() == 1)
-			Perm &= ~0x00240000;
-		if (tabPDF->PrintSec->isChecked())
-			Perm += 4;
-		if (tabPDF->ModifySec->isChecked())
-			Perm += 8;
-		if (tabPDF->CopySec->isChecked())
-			Perm += 16;
-		if (tabPDF->AddSec->isChecked())
-			Perm += 32;
-		currDoc->PDF_Options.Permissions = Perm;
-		currDoc->PDF_Options.PassOwner = tabPDF->PassOwner->text();
-		currDoc->PDF_Options.PassUser = tabPDF->PassUser->text();
-	}
-	if (tabPDF->PDFVersionCombo->currentIndex() == 0)
-		currDoc->PDF_Options.Version = PDFOptions::PDFVersion_13;
-	if (tabPDF->PDFVersionCombo->currentIndex() == 1)
-		currDoc->PDF_Options.Version = PDFOptions::PDFVersion_14;
-	if (tabPDF->PDFVersionCombo->currentIndex() == 2)
-		currDoc->PDF_Options.Version = PDFOptions::PDFVersion_15;
-	if (tabPDF->PDFVersionCombo->currentIndex() == 3)
-		currDoc->PDF_Options.Version = PDFOptions::PDFVersion_X3;
-	if (tabPDF->OutCombo->currentIndex() == 0)
-	{
-		currDoc->PDF_Options.isGrayscale = false;
-		currDoc->PDF_Options.UseRGB = true;
-		currDoc->PDF_Options.UseProfiles = false;
-		currDoc->PDF_Options.UseProfiles2 = false;
-	}
-	else
-	{
-		if (tabPDF->OutCombo->currentIndex() == 3)
-		{
-			currDoc->PDF_Options.isGrayscale = true;
-			currDoc->PDF_Options.UseRGB = false;
-			currDoc->PDF_Options.UseProfiles = false;
-			currDoc->PDF_Options.UseProfiles2 = false;
-		}
-		else
-		{
-			currDoc->PDF_Options.isGrayscale = false;
-			currDoc->PDF_Options.UseRGB = false;
-			if (currDoc->HasCMS)
-			{
-				currDoc->PDF_Options.UseProfiles = tabPDF->EmbedProfs->isChecked();
-				currDoc->PDF_Options.UseProfiles2 = tabPDF->EmbedProfs2->isChecked();
-				currDoc->PDF_Options.Intent = tabPDF->IntendS->currentIndex();
-				currDoc->PDF_Options.Intent2 = tabPDF->IntendI->currentIndex();
-				currDoc->PDF_Options.EmbeddedI = tabPDF->NoEmbedded->isChecked();
-				currDoc->PDF_Options.SolidProf = tabPDF->SolidPr->currentText();
-				currDoc->PDF_Options.ImageProf = tabPDF->ImageP->currentText();
-				currDoc->PDF_Options.PrintProf = tabPDF->PrintProfC->currentText();
-				currDoc->PDF_Options.Info      = tabPDF->InfoString->text();
-			}
-		}
-	}
+	tabPDF->updateDocumentSettings(currDoc);
 
 	currDoc->documentInfo = docInfos->getDocInfo();
 	currDoc->docItemAttributes = *(tabDocItemAttributes->getNewAttributes());

Modified: branches/Version135/Scribus/scribus/tabpdfoptions.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16457&path=/branches/Version135/Scribus/scribus/tabpdfoptions.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/tabpdfoptions.cpp (original)
+++ branches/Version135/Scribus/scribus/tabpdfoptions.cpp Thu Mar 17 22:08:03 2011
@@ -1475,6 +1475,118 @@
 	}
 }
 
+// Specifically to update doc settings from doc prefs
+void TabPDFOptions::updateDocumentSettings(ScribusDoc *doc)
+{
+	doc->PDF_Options.Thumbnails = CheckBox1->isChecked();
+	doc->PDF_Options.Compress = Compression->isChecked();
+	doc->PDF_Options.CompressMethod = (PDFOptions::PDFCompression) CMethod->currentIndex();
+	doc->PDF_Options.Quality = CQuality->currentIndex();
+	doc->PDF_Options.embedPDF = EmbedPDF->isChecked();
+	doc->PDF_Options.Resolution = Resolution->value();
+	doc->PDF_Options.RecalcPic = DSColor->isChecked();
+	doc->PDF_Options.PicRes = ValC->value();
+	doc->PDF_Options.Bookmarks = CheckBM->isChecked();
+	doc->PDF_Options.Binding = ComboBind->currentIndex();
+	doc->PDF_Options.MirrorH = MirrorH->isChecked();
+	doc->PDF_Options.MirrorV = MirrorV->isChecked();
+	doc->PDF_Options.RotateDeg = RotateDeg->currentIndex() * 90;
+	doc->PDF_Options.Articles = Article->isChecked();
+	doc->PDF_Options.Encrypt = Encry->isChecked();
+	doc->PDF_Options.UseLPI = UseLPI->isChecked();
+	doc->PDF_Options.useLayers = useLayers->isChecked();
+	doc->PDF_Options.UseSpotColors = !useSpot->isChecked();
+	doc->PDF_Options.doMultiFile = false;
+	doc->PDF_Options.cropMarks  = cropMarks->isChecked();
+	doc->PDF_Options.bleedMarks = bleedMarks->isChecked();
+	doc->PDF_Options.registrationMarks = registrationMarks->isChecked();
+	doc->PDF_Options.colorMarks = colorMarks->isChecked();
+	doc->PDF_Options.docInfoMarks = docInfoMarks->isChecked();
+	doc->PDF_Options.markOffset = markOffset->value() / unitRatio;
+	doc->PDF_Options.useDocBleeds = docBleeds->isChecked();
+	doc->PDF_Options.bleeds.Bottom = BleedBottom->value() / doc->unitRatio();
+	doc->PDF_Options.bleeds.Top = BleedTop->value() / doc->unitRatio();
+	doc->PDF_Options.bleeds.Left = BleedLeft->value() / doc->unitRatio();
+	doc->PDF_Options.bleeds.Right = BleedRight->value() / doc->unitRatio();
+	doc->PDF_Options.doClip = ClipMarg->isChecked();
+	/* DISABLED CR 2006-12-07 Work around #2964
+	doc->PDF_Options.displayBookmarks = useBookmarks->isChecked();
+	doc->PDF_Options.displayFullscreen = useFullScreen->isChecked();
+	doc->PDF_Options.displayLayers = useLayers2->isChecked();
+	doc->PDF_Options.displayThumbs = useThumbnails->isChecked();
+	int pgl = PDFOptions::SinglePage;
+	if (singlePage->isChecked())
+		pgl = PDFOptions::SinglePage;
+	else if (continuousPages->isChecked())
+		pgl = PDFOptions::OneColumn;
+	else if (doublePageLeft->isChecked())
+		pgl = PDFOptions::TwoColumnLeft;
+	else if (doublePageRight->isChecked())
+		pgl = PDFOptions::TwoColumnRight;
+	doc->PDF_Options.PageLayout = pgl;
+	*/
+	doc->PDF_Options.openAction = "";
+	if (Encry->isChecked())
+	{
+		int Perm = -64;
+		if (PDFVersionCombo->currentIndex() == 1)
+			Perm &= ~0x00240000;
+		if (PrintSec->isChecked())
+			Perm += 4;
+		if (ModifySec->isChecked())
+			Perm += 8;
+		if (CopySec->isChecked())
+			Perm += 16;
+		if (AddSec->isChecked())
+			Perm += 32;
+		doc->PDF_Options.Permissions = Perm;
+		doc->PDF_Options.PassOwner = PassOwner->text();
+		doc->PDF_Options.PassUser = PassUser->text();
+	}
+	if (PDFVersionCombo->currentIndex() == 0)
+		doc->PDF_Options.Version = PDFOptions::PDFVersion_13;
+	if (PDFVersionCombo->currentIndex() == 1)
+		doc->PDF_Options.Version = PDFOptions::PDFVersion_14;
+	if (PDFVersionCombo->currentIndex() == 2)
+		doc->PDF_Options.Version = PDFOptions::PDFVersion_15;
+	if (PDFVersionCombo->currentIndex() == 3)
+		doc->PDF_Options.Version = PDFOptions::PDFVersion_X3;
+	if (OutCombo->currentIndex() == 0)
+	{
+		doc->PDF_Options.isGrayscale = false;
+		doc->PDF_Options.UseRGB = true;
+		doc->PDF_Options.UseProfiles = false;
+		doc->PDF_Options.UseProfiles2 = false;
+	}
+	else
+	{
+		if (OutCombo->currentIndex() == 3)
+		{
+			doc->PDF_Options.isGrayscale = true;
+			doc->PDF_Options.UseRGB = false;
+			doc->PDF_Options.UseProfiles = false;
+			doc->PDF_Options.UseProfiles2 = false;
+		}
+		else
+		{
+			doc->PDF_Options.isGrayscale = false;
+			doc->PDF_Options.UseRGB = false;
+			if (doc->HasCMS)
+			{
+				doc->PDF_Options.UseProfiles = EmbedProfs->isChecked();
+				doc->PDF_Options.UseProfiles2 = EmbedProfs2->isChecked();
+				doc->PDF_Options.Intent = IntendS->currentIndex();
+				doc->PDF_Options.Intent2 = IntendI->currentIndex();
+				doc->PDF_Options.EmbeddedI = NoEmbedded->isChecked();
+				doc->PDF_Options.SolidProf = SolidPr->currentText();
+				doc->PDF_Options.ImageProf = ImageP->currentText();
+				doc->PDF_Options.PrintProf = PrintProfC->currentText();
+				doc->PDF_Options.Info      = InfoString->text();
+			}
+		}
+	}
+}
+
 void TabPDFOptions::doDocBleeds()
 {
 	if (docBleeds->isChecked())

Modified: branches/Version135/Scribus/scribus/tabpdfoptions.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16457&path=/branches/Version135/Scribus/scribus/tabpdfoptions.h
==============================================================================
--- branches/Version135/Scribus/scribus/tabpdfoptions.h (original)
+++ branches/Version135/Scribus/scribus/tabpdfoptions.h Thu Mar 17 22:08:03 2011
@@ -56,6 +56,9 @@
 						 ScribusDoc *mdoc, bool exporting);
 
 	void storeValues(PDFOptions& options);
+
+	// Specifically to update doc settings from doc prefs
+	void updateDocumentSettings(ScribusDoc *doc);
 
 	void unitChange(QString unit, int docUnitIndex, double invUnitConversion);
 




More information about the scribus-commit mailing list