r16192 by fschmid - Fixed Bug #8423: "guides, frame borders and co disappear when deleting an item from a group"

scribus-commit scribus-commit at lists.scribus.net
Sat Jan 1 12:27:18 CET 2011


Author: fschmid
Date: Sat Jan  1 11:27:17 2011
New Revision: 16192

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16192
Log:
Fixed Bug #8423: "guides, frame borders and co disappear when deleting an item from a group"
+ some preparations for extending RegularPolygons.

Modified:
    trunk/Scribus/scribus/fileloader.cpp
    trunk/Scribus/scribus/pageitem_regularpolygon.cpp
    trunk/Scribus/scribus/pageitem_regularpolygon.h
    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/scribus.cpp
    trunk/Scribus/scribus/scribusdoc.cpp
    trunk/Scribus/scribus/scribusdoc.h
    trunk/Scribus/scribus/scribusview.cpp

Modified: trunk/Scribus/scribus/fileloader.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16192&path=/trunk/Scribus/scribus/fileloader.cpp
==============================================================================
--- trunk/Scribus/scribus/fileloader.cpp (original)
+++ trunk/Scribus/scribus/fileloader.cpp Sat Jan  1 11:27:17 2011
@@ -285,6 +285,8 @@
 	currDoc->itemToolPrefs().polyFactor = prefsManager->appPrefs.itemToolPrefs.polyFactor;
 	currDoc->itemToolPrefs().polyRotation = prefsManager->appPrefs.itemToolPrefs.polyRotation;
 	currDoc->itemToolPrefs().polyCurvature = prefsManager->appPrefs.itemToolPrefs.polyCurvature;
+	currDoc->itemToolPrefs().polyOuterCurvature = prefsManager->appPrefs.itemToolPrefs.polyOuterCurvature;
+	currDoc->itemToolPrefs().polyInnerRot = prefsManager->appPrefs.itemToolPrefs.polyInnerRot;
 	currDoc->itemToolPrefs().polyFactorGuiVal = prefsManager->appPrefs.itemToolPrefs.polyFactorGuiVal;
 	currDoc->itemToolPrefs().polyUseFactor = prefsManager->appPrefs.itemToolPrefs.polyUseFactor;
 	currDoc->setAutoSave(prefsManager->appPrefs.docSetupPrefs.AutoSave);

Modified: trunk/Scribus/scribus/pageitem_regularpolygon.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16192&path=/trunk/Scribus/scribus/pageitem_regularpolygon.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_regularpolygon.cpp (original)
+++ trunk/Scribus/scribus/pageitem_regularpolygon.cpp Sat Jan  1 11:27:17 2011
@@ -54,6 +54,7 @@
 	polyRotation = m_Doc->itemToolPrefs().polyRotation;
 	polyCurvature = m_Doc->itemToolPrefs().polyCurvature;
 	polyInnerRot = 0.0;
+	polyOuterCurvature = 0.0;
 	QPainterPath path = RegularPolygonPath(w, h, polyCorners, polyUseFactor, polyFactor, polyRotation, polyCurvature);
 	PoLine.fromQPainterPath(path);
 	Clip = FlattenPath(PoLine, Segments);

Modified: trunk/Scribus/scribus/pageitem_regularpolygon.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16192&path=/trunk/Scribus/scribus/pageitem_regularpolygon.h
==============================================================================
--- trunk/Scribus/scribus/pageitem_regularpolygon.h (original)
+++ trunk/Scribus/scribus/pageitem_regularpolygon.h Sat Jan  1 11:27:17 2011
@@ -54,6 +54,7 @@
 	double polyRotation; //! Rotation of a polygon
 	double polyCurvature; //! Curvature of polygon
 	double polyInnerRot;
+	double polyOuterCurvature;
 	
 protected:
 	virtual void DrawObj_Item(ScPainter *p, QRectF e);

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16192&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 Sat Jan  1 11:27:17 2011
@@ -1704,6 +1704,7 @@
 	doc->itemToolPrefs().polyRotation     = attrs.valueAsDouble("POLYR", 0.0);
 	doc->itemToolPrefs().polyInnerRot     = attrs.valueAsDouble("POLYIR", 0.0);
 	doc->itemToolPrefs().polyCurvature    = attrs.valueAsDouble("POLYCUR", 0.0);
+	doc->itemToolPrefs().polyOuterCurvature    = attrs.valueAsDouble("POLYOCUR", 0.0);
 	doc->itemToolPrefs().polyFactorGuiVal = attrs.valueAsInt("POLYFD", 0);
 	doc->itemToolPrefs().polyUseFactor    = attrs.valueAsBool("POLYS", false);
 
@@ -3670,6 +3671,7 @@
 		regitem->polyRotation     = attrs.valueAsDouble("POLYR", 0.0);
 		regitem->polyInnerRot     = attrs.valueAsDouble("POLYIR", 0.0);
 		regitem->polyCurvature    = attrs.valueAsDouble("POLYCUR", 0.0);
+		regitem->polyOuterCurvature    = attrs.valueAsDouble("POLYOCUR", 0.0);
 		regitem->polyFactorGuiVal = attrs.valueAsInt("POLYFD", 0);
 		regitem->polyUseFactor    = attrs.valueAsBool("POLYS", false);
 	}

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16192&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 Sat Jan  1 11:27:17 2011
@@ -259,6 +259,7 @@
 	docu.writeAttribute("POLYR", m_Doc->itemToolPrefs().polyRotation);
 	docu.writeAttribute("POLYIR", m_Doc->itemToolPrefs().polyInnerRot);
 	docu.writeAttribute("POLYCUR", m_Doc->itemToolPrefs().polyCurvature);
+	docu.writeAttribute("POLYOCUR", m_Doc->itemToolPrefs().polyOuterCurvature);
 	docu.writeAttribute("POLYFD", m_Doc->itemToolPrefs().polyFactorGuiVal);
 	docu.writeAttribute("POLYS", static_cast<int>(m_Doc->itemToolPrefs().polyUseFactor));
 	docu.writeAttribute("AutoSave", static_cast<int>(m_Doc->autoSave()));
@@ -1434,6 +1435,7 @@
 			docu.writeAttribute("POLYR", regitem->polyRotation);
 			docu.writeAttribute("POLYIR", regitem->polyInnerRot);
 			docu.writeAttribute("POLYCUR", regitem->polyCurvature);
+			docu.writeAttribute("POLYOCUR", regitem->polyOuterCurvature);
 			docu.writeAttribute("POLYFD", regitem->polyFactorGuiVal);
 			docu.writeAttribute("POLYS", static_cast<int>(regitem->polyUseFactor));
 		}

Modified: trunk/Scribus/scribus/prefsmanager.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16192&path=/trunk/Scribus/scribus/prefsmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/prefsmanager.cpp (original)
+++ trunk/Scribus/scribus/prefsmanager.cpp Sat Jan  1 11:27:17 2011
@@ -269,6 +269,7 @@
 	appPrefs.itemToolPrefs.polyRotation = 0.0;
 	appPrefs.itemToolPrefs.polyInnerRot = 0.0;
 	appPrefs.itemToolPrefs.polyCurvature = 0.0;
+	appPrefs.itemToolPrefs.polyOuterCurvature = 0.0;
 //	appPrefs.PSize = 40;
 	appPrefs.printerPrefs.ClipMargin = false;
 	appPrefs.printerPrefs.GCRMode = false;
@@ -1469,6 +1470,7 @@
 	dcItemTools.setAttribute("PolygonInnerRotation", ScCLocale::toQStringC(appPrefs.itemToolPrefs.polyInnerRot));
 	dcItemTools.setAttribute("PolygonFactorGUI", appPrefs.itemToolPrefs.polyFactorGuiVal);
 	dcItemTools.setAttribute("PolygonCurvature", ScCLocale::toQStringC(appPrefs.itemToolPrefs.polyCurvature));
+	dcItemTools.setAttribute("PolygonOuterCurvature", ScCLocale::toQStringC(appPrefs.itemToolPrefs.polyOuterCurvature));
 	dcItemTools.setAttribute("PolygonUseFactor", static_cast<int>(appPrefs.itemToolPrefs.polyUseFactor));
 	dcItemTools.setAttribute("ImageScaleType", static_cast<int>(appPrefs.itemToolPrefs.imageScaleType));
 	dcItemTools.setAttribute("ImageAspectRatio", static_cast<int>(appPrefs.itemToolPrefs.imageAspectRatio));
@@ -2053,6 +2055,7 @@
 			appPrefs.itemToolPrefs.polyRotation = ScCLocale::toDoubleC(dc.attribute("PolygonRotation"), 0.0);
 			appPrefs.itemToolPrefs.polyInnerRot = ScCLocale::toDoubleC(dc.attribute("PolygonInnerRotation"), 0.0);
 			appPrefs.itemToolPrefs.polyCurvature = ScCLocale::toDoubleC(dc.attribute("PolygonCurvature"), 0.0);
+			appPrefs.itemToolPrefs.polyOuterCurvature = ScCLocale::toDoubleC(dc.attribute("PolygonOuterCurvature"), 0.0);
 			appPrefs.itemToolPrefs.polyFactorGuiVal = dc.attribute("PolygonFactorGUI", "0").toInt();
 			appPrefs.itemToolPrefs.polyUseFactor  = static_cast<bool>(dc.attribute("PolygonUseFactor", "0").toInt());
 			appPrefs.itemToolPrefs.lineStartArrow = dc.attribute("LineStartArrow", "0").toInt();

Modified: trunk/Scribus/scribus/prefsstructs.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16192&path=/trunk/Scribus/scribus/prefsstructs.h
==============================================================================
--- trunk/Scribus/scribus/prefsstructs.h (original)
+++ trunk/Scribus/scribus/prefsstructs.h Sat Jan  1 11:27:17 2011
@@ -207,6 +207,7 @@
 	double polyRotation; //! Rotation of a polygon
 	double polyInnerRot; //! Rotation of the inner points of a star
 	double polyCurvature; //! Curvature of polygon
+	double polyOuterCurvature; //! outer Curvature of polygon
 	/* Image Tool */
 	QString imageFillColor; //! Default fill color of an image frame
 	int imageFillColorShade; //! Default shade of fill color of an image grame

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16192&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Sat Jan  1 11:27:17 2011
@@ -3121,7 +3121,7 @@
 			scrActions["itemDuplicate"]->setEnabled(setter);
 			scrActions["itemMulDuplicate"]->setEnabled(setter);
 			scrActions["itemTransform"]->setEnabled(setter);
-			scrActions["itemDelete"]->setEnabled(!currItem->isSingleSel);
+			scrActions["itemDelete"]->setEnabled(true);
 			scrActions["itemLowerToBottom"]->setEnabled(setter);
 			scrActions["itemRaiseToTop"]->setEnabled(setter);
 			scrActions["itemRaise"]->setEnabled(setter);

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16192&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Sat Jan  1 11:27:17 2011
@@ -8509,6 +8509,25 @@
 	}
 }
 
+QList<PageItem*>* ScribusDoc::GroupOfItem(QList<PageItem*>* itemList, PageItem* item)
+{
+	if (itemList->contains(item))
+		return itemList;
+	else
+	{
+		for (int a = 0; a < itemList->count(); a++)
+		{
+			if (itemList->at(a)->isGroup())
+			{
+				QList<PageItem*>* ite = GroupOfItem(&itemList->at(a)->groupItemList, item);
+				if (ite != NULL)
+					return ite;
+			}
+		}
+		return NULL;
+	}
+	return NULL;
+}
 
 void ScribusDoc::itemSelection_DeleteItem(Selection* customSelection, bool forceDeletion)
 {
@@ -8522,6 +8541,7 @@
 	QList<PageItem*> delItems;
 	QList<PageItem*> textInteractionItems;// text frames possibly interested in removal of selected items
 	PageItem *currItem;
+	QList<PageItem*>* itemList = Items;
 	uint offs = 0;
 	QString tooltip = Um::ItemsInvolved + "\n";
 	if (selectedItemCount > Um::ItemsInvolvedLimit)
@@ -8532,8 +8552,21 @@
 		currItem = itemSelection->itemAt(offs);
 		if ((((currItem->isSingleSel) && (!Items->contains(currItem))) || ((currItem->isSingleSel) && (currItem->isTableItem))) || (currItem->locked()))
 		{
-			offs++;
-			continue;
+			if (currItem->locked())
+			{
+				offs++;
+				continue;
+			}
+			else
+			{
+				itemList = GroupOfItem(Items, currItem);
+				if (itemList == NULL)
+				{
+					itemList = Items;
+					offs++;
+					continue;
+				}
+			}
 		}
 		//CB FIXME remove this and include of storyeditor.h too
 		if ((currItem->asTextFrame() || currItem->asPathText()) && currItem==m_ScMW->storyEditor->currentItem() && this==m_ScMW->storyEditor->currentDocument())
@@ -8603,7 +8636,7 @@
 		if (currItem->isBookmark)
 			//CB From view   emit DelBM(currItem);
 			m_ScMW->DelBookMark(currItem);
-		Items->removeAll(currItem);
+		itemList->removeAll(currItem);
 //		if (forceDeletion || !UndoManager::undoEnabled())
 		if (forceDeletion)
 			delete currItem;

Modified: trunk/Scribus/scribus/scribusdoc.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16192&path=/trunk/Scribus/scribus/scribusdoc.h
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.h (original)
+++ trunk/Scribus/scribus/scribusdoc.h Sat Jan  1 11:27:17 2011
@@ -914,6 +914,7 @@
 	bool sendItemSelectionToBack();
 	bool bringItemSelectionToFront();
 
+	QList<PageItem*>* GroupOfItem(QList<PageItem*>* itemList, PageItem* item);
 	PageItem* groupObjectsSelection(Selection* customSelection=0);
 	PageItem* groupObjectsList(QList<PageItem*> &itemList);
 	void groupObjectsToItem(PageItem* groupItem, QList<PageItem*> &itemList);

Modified: trunk/Scribus/scribus/scribusview.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16192&path=/trunk/Scribus/scribus/scribusview.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusview.cpp (original)
+++ trunk/Scribus/scribus/scribusview.cpp Sat Jan  1 11:27:17 2011
@@ -1816,7 +1816,7 @@
 	}
 	if (draw)
 	{
-		if (Doc->m_Selection->count() > 1)
+		if (Doc->m_Selection->count() > 0)
 		{
 			Doc->m_Selection->setGroupRect();
 			double x, y, w, h;




More information about the scribus-commit mailing list