r17904 by fschmid - Follow Up to Bug #11150: Better implementation, use default names in the PDF-Importer too.

scribus-commit scribus-commit at lists.scribus.net
Sat Nov 24 12:08:19 UTC 2012


Author: fschmid
Date: Sat Nov 24 12:08:18 2012
New Revision: 17904

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17904
Log:
Follow Up to Bug #11150: Better implementation, use default names in the PDF-Importer too.

Modified:
    trunk/Scribus/scribus/canvasmode_create.cpp
    trunk/Scribus/scribus/commonstrings.cpp
    trunk/Scribus/scribus/commonstrings.h
    trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp

Modified: trunk/Scribus/scribus/canvasmode_create.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17904&path=/trunk/Scribus/scribus/canvasmode_create.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_create.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_create.cpp Sat Nov 24 12:08:18 2012
@@ -738,34 +738,34 @@
 		case modeInsertPDFButton:
 			currItem->annotation().setType(2);
 			currItem->annotation().setFlag(65536);
-			currItem->setItemName( tr("Button") + QString("%1").arg(m_doc->TotalItems));
+			currItem->setItemName( CommonStrings::itemName_PushButton + QString("%1").arg(m_doc->TotalItems));
 			break;
 		case modeInsertPDFTextfield:
 			currItem->annotation().setType(3);
-			currItem->setItemName( tr("Textfield") + QString("%1").arg(m_doc->TotalItems));
+			currItem->setItemName( CommonStrings::itemName_TextField + QString("%1").arg(m_doc->TotalItems));
 			break;
 		case modeInsertPDFCheckbox:
 			currItem->annotation().setType(4);
-			currItem->setItemName( tr("Checkbox") + QString("%1").arg(m_doc->TotalItems));
+			currItem->setItemName( CommonStrings::itemName_CheckBox + QString("%1").arg(m_doc->TotalItems));
 			break;
 		case modeInsertPDFCombobox:
 			currItem->annotation().setType(5);
 			currItem->annotation().setFlag(131072);
-			currItem->setItemName( tr("Combobox") + QString("%1").arg(m_doc->TotalItems));
+			currItem->setItemName( CommonStrings::itemName_ComboBox + QString("%1").arg(m_doc->TotalItems));
 			break;
 		case modeInsertPDFListbox:
 			currItem->annotation().setType(6);
-			currItem->setItemName( tr("Listbox") + QString("%1").arg(m_doc->TotalItems));
+			currItem->setItemName( CommonStrings::itemName_ListBox + QString("%1").arg(m_doc->TotalItems));
 			break;
 		case modeInsertPDFTextAnnotation:
 			currItem->annotation().setType(10);
-			currItem->setItemName( tr("TextAnnot") + QString("%1").arg(m_doc->TotalItems));
+			currItem->setItemName( CommonStrings::itemName_TextAnnotation + QString("%1").arg(m_doc->TotalItems));
 			break;
 		case modeInsertPDFLinkAnnotation:
 			currItem->annotation().setType(11);
 			currItem->annotation().setZiel(m_doc->currentPage()->pageNr());
 			currItem->annotation().setAction("0 0");
-			currItem->setItemName( tr("Link") + QString("%1").arg(m_doc->TotalItems));
+			currItem->setItemName( CommonStrings::itemName_LinkAnnotation + QString("%1").arg(m_doc->TotalItems));
 			currItem->setTextFlowMode(PageItem::TextFlowDisabled);
 			break;
 		}

Modified: trunk/Scribus/scribus/commonstrings.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17904&path=/trunk/Scribus/scribus/commonstrings.cpp
==============================================================================
--- trunk/Scribus/scribus/commonstrings.cpp (original)
+++ trunk/Scribus/scribus/commonstrings.cpp Sat Nov 24 12:08:18 2012
@@ -62,13 +62,20 @@
 QString CommonStrings::itemType_Table			= "";
 QString CommonStrings::itemType_Multiple		= "";
 
-QString CommonStrings::itemSubType_PDF_PushButton;
-QString CommonStrings::itemSubType_PDF_TextField;
-QString CommonStrings::itemSubType_PDF_CheckBox;
-QString CommonStrings::itemSubType_PDF_ComboBox;
-QString CommonStrings::itemSubType_PDF_ListBox;
-QString CommonStrings::itemSubType_PDF_TextAnnotation;
-QString CommonStrings::itemSubType_PDF_LinkAnnotation;
+QString CommonStrings::itemSubType_PDF_PushButton		= "";
+QString CommonStrings::itemSubType_PDF_TextField		= "";
+QString CommonStrings::itemSubType_PDF_CheckBox			= "";
+QString CommonStrings::itemSubType_PDF_ComboBox			= "";
+QString CommonStrings::itemSubType_PDF_ListBox			= "";
+QString CommonStrings::itemSubType_PDF_TextAnnotation	= "";
+QString CommonStrings::itemSubType_PDF_LinkAnnotation	= "";
+QString CommonStrings::itemName_PushButton				= "";
+QString CommonStrings::itemName_TextField				= "";
+QString CommonStrings::itemName_CheckBox				= "";
+QString CommonStrings::itemName_ComboBox				= "";
+QString CommonStrings::itemName_ListBox					= "";
+QString CommonStrings::itemName_TextAnnotation			= "";
+QString CommonStrings::itemName_LinkAnnotation			= "";
 
 
 QString CommonStrings::pageSet1    = "";
@@ -305,6 +312,13 @@
 	CommonStrings::itemSubType_PDF_ListBox        = tr("PDF List Box");
 	CommonStrings::itemSubType_PDF_TextAnnotation = tr("PDF Text Annotation");
 	CommonStrings::itemSubType_PDF_LinkAnnotation = tr("PDF Link Annotation");
+	CommonStrings::itemName_PushButton				= tr("Button");
+	CommonStrings::itemName_TextField				= tr("Textfield");
+	CommonStrings::itemName_CheckBox				= tr("Checkbox");
+	CommonStrings::itemName_ComboBox				= tr("Combobox");
+	CommonStrings::itemName_ListBox					= tr("Listbox");
+	CommonStrings::itemName_TextAnnotation			= tr("TextAnnot");
+	CommonStrings::itemName_LinkAnnotation			= tr("Link");
 
 
 	CommonStrings::customPageSize = "Custom";

Modified: trunk/Scribus/scribus/commonstrings.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17904&path=/trunk/Scribus/scribus/commonstrings.h
==============================================================================
--- trunk/Scribus/scribus/commonstrings.h (original)
+++ trunk/Scribus/scribus/commonstrings.h Sat Nov 24 12:08:18 2012
@@ -130,6 +130,13 @@
 	static QString itemSubType_PDF_ListBox;
 	static QString itemSubType_PDF_TextAnnotation;
 	static QString itemSubType_PDF_LinkAnnotation;
+	static QString itemName_PushButton;
+	static QString itemName_TextField;
+	static QString itemName_CheckBox;
+	static QString itemName_ComboBox;
+	static QString itemName_ListBox;
+	static QString itemName_TextAnnotation;
+	static QString itemName_LinkAnnotation;
 
 	//Page Size
 	static QString customPageSize;

Modified: trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17904&path=/trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp Sat Nov 24 12:08:18 2012
@@ -339,6 +339,7 @@
 	ite->AutoName = false;
 	ite->annotation().setType(10);
 	ite->annotation().setActionType(0);
+	ite->setItemName( CommonStrings::itemName_TextAnnotation + QString("%1").arg(m_doc->TotalItems));
 	ite->itemText.insertChars(UnicodeParsedString(annota->getContents()));
 	return true;
 }
@@ -475,6 +476,7 @@
 			ite->annotation().setActionType(8);
 		}
 		ite->annotation().setType(11);
+		ite->setItemName( CommonStrings::itemName_LinkAnnotation + QString("%1").arg(m_doc->TotalItems));
 	}
 	return validLink;
 }




More information about the scribus-commit mailing list