r20557 by jghali -

scribus-commit scribus-commit at lists.scribus.net
Mon Nov 16 22:34:38 UTC 2015


Author: jghali
Date: Mon Nov 16 22:34:37 2015
New Revision: 20557

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20557
Log:
remove avoidable noteframe related argument from ScribusDoc itemAdd() function

Modified:
    trunk/Scribus/scribus/pageitem.h
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
    trunk/Scribus/scribus/scribusdoc.cpp
    trunk/Scribus/scribus/scribusdoc.h

Modified: trunk/Scribus/scribus/pageitem.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20557&path=/trunk/Scribus/scribus/pageitem.h
==============================================================================
--- trunk/Scribus/scribus/pageitem.h	(original)
+++ trunk/Scribus/scribus/pageitem.h	Mon Nov 16 22:34:37 2015
@@ -188,6 +188,7 @@
 		Arc				= 14,
 		Spiral			= 15,
 		Table			= 16,
+		NoteFrame       = 17,
 		Multiple		= 99
 	};
 

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20557&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 Nov 16 22:34:37 2015
@@ -4674,6 +4674,8 @@
 	if (isGroupFlag)
 		pt = PageItem::Group;
 	bool isNoteFrameFlag = attrs.valueAsBool("isNoteFrame", 0);
+	if (isNoteFrameFlag && (pt == PageItem::TextFrame))
+		pt = PageItem::NoteFrame;
 	double xf, yf;
 	double x   = attrs.valueAsDouble("XPOS");
 	double y   = attrs.valueAsDouble("YPOS");
@@ -4798,8 +4800,9 @@
 		if (pagenr > -2) 
 			currItem->OwnPage = pagenr;
 		break;
+	case PageItem::NoteFrame:
 	case PageItem::TextFrame:
-		z = doc->itemAdd(PageItem::TextFrame, PageItem::Unspecified, x, y, w, h, pw, CommonStrings::None, Pcolor, true, isNoteFrameFlag);
+		z = doc->itemAdd(pt, PageItem::Unspecified, x, y, w, h, pw, CommonStrings::None, Pcolor, true);
 		currItem = doc->Items->at(z);
 		if (pagenr > -2) 
 			currItem->OwnPage = pagenr;

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20557&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp	(original)
+++ trunk/Scribus/scribus/scribusdoc.cpp	Mon Nov 16 22:34:37 2015
@@ -5572,7 +5572,7 @@
 	return newItem;
 }
 
-int ScribusDoc::itemAdd(const PageItem::ItemType itemType, const PageItem::ItemFrameType frameType, const double x, const double y, const double b, const double h, const double w, const QString& fill, const QString& outline, const bool itemFinalised, const bool noteFrame)
+int ScribusDoc::itemAdd(const PageItem::ItemType itemType, const PageItem::ItemFrameType frameType, const double x, const double y, const double b, const double h, const double w, const QString& fill, const QString& outline, const bool itemFinalised)
 {
 	assert(itemFinalised); // av: caller must wrap transaction around this if wanted
 	
@@ -5583,10 +5583,10 @@
 	}
 	
 	PageItem* newItem;
-	if (noteFrame)
+	if (itemType == PageItem::NoteFrame)
 	{
 		newItem = new PageItem_NoteFrame(this, x, y, b, h, w, CommonStrings::None, outline);
-		itemAddDetails(itemType, frameType, newItem);
+		itemAddDetails(PageItem::TextFrame, frameType, newItem);
 	}
 	else
 		newItem = createPageItem(itemType, frameType, x, y, b, h, w, fill, outline); 
@@ -5788,6 +5788,7 @@
 			newItem->setFillShade(docPrefsData.itemToolPrefs.imageFillColorShade);
 			newItem->setLineShade(docPrefsData.itemToolPrefs.imageStrokeColorShade);
 			break;
+		case PageItem::NoteFrame:
 		case PageItem::TextFrame:
 //			newItem->setFontFillShade(itemToolPrefs.textShade);
 //			newItem->setFontStrokeShade(itemToolPrefs.textStrokeShade);
@@ -5825,7 +5826,7 @@
 			break;
 	}
 
-	if (frameType==PageItem::Rectangle || itemType==PageItem::TextFrame || itemType==PageItem::ImageFrame || itemType==PageItem::LatexFrame || itemType==PageItem::OSGFrame || itemType==PageItem::Symbol || itemType==PageItem::Group || itemType==PageItem::Table)
+	if (frameType==PageItem::Rectangle || itemType==PageItem::TextFrame || itemType==PageItem::ImageFrame || itemType==PageItem::LatexFrame || itemType==PageItem::OSGFrame || itemType==PageItem::Symbol || itemType==PageItem::Group || itemType==PageItem::Table || itemType==PageItem::NoteFrame)
 	{
 		newItem->SetRectFrame();
 		//TODO one day hopefully, if (ScCore->usingGUI())

Modified: trunk/Scribus/scribus/scribusdoc.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20557&path=/trunk/Scribus/scribus/scribusdoc.h
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.h	(original)
+++ trunk/Scribus/scribus/scribusdoc.h	Mon Nov 16 22:34:37 2015
@@ -784,7 +784,7 @@
 	\param outline outline color name
 	\param noteFrame optional (default false) indicates that noteframes should be created, not text frame
 	*/
-	int itemAdd(const PageItem::ItemType itemType, const PageItem::ItemFrameType frameType, const double x, const double y, const double b, const double h, const double w, const QString& fill, const QString& outline, const bool itemFinalised, const bool noteFrame = false);
+	int itemAdd(const PageItem::ItemType itemType, const PageItem::ItemFrameType frameType, const double x, const double y, const double b, const double h, const double w, const QString& fill, const QString& outline, const bool itemFinalised);
 
 	/** Add an item to the page based on the x/y position. Item will be fitted to the closest guides/margins */
 	int itemAddArea(const PageItem::ItemType itemType, const PageItem::ItemFrameType frameType, const double x, const double y, const double w, const QString& fill, const QString& outline, const bool itemFinalised);




More information about the scribus-commit mailing list