r18922 by craig - Finally move set frame rounded functions to the doc after all these years

scribus-commit scribus-commit at lists.scribus.net
Wed Mar 19 20:37:10 UTC 2014


Author: craig
Date: Wed Mar 19 20:37:10 2014
New Revision: 18922

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18922
Log:
Finally move set frame rounded functions to the doc after all these years

Modified:
    trunk/Scribus/scribus/pageitem.cpp
    trunk/Scribus/scribus/plugins/scriptplugin/cmdsetprop.cpp
    trunk/Scribus/scribus/scribusdoc.cpp
    trunk/Scribus/scribus/scribusdoc.h
    trunk/Scribus/scribus/scribusview.cpp
    trunk/Scribus/scribus/scribusview.h
    trunk/Scribus/scribus/ui/propertiespalette_shape.cpp

Modified: trunk/Scribus/scribus/pageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18922&path=/trunk/Scribus/scribus/pageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem.cpp (original)
+++ trunk/Scribus/scribus/pageitem.cpp Wed Mar 19 20:37:10 2014
@@ -6499,7 +6499,7 @@
 	Selection tmpSelection(doc()->m_Selection);
 	doc()->m_Selection->clear();
 	doc()->m_Selection->addItem(this);
-	doc()->scMW()->view->SetFrameRounded();
+	doc()->setFrameRounded();
 	*(doc()->m_Selection) = tmpSelection;
 }
 

Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdsetprop.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18922&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdsetprop.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdsetprop.cpp (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdsetprop.cpp Wed Mar 19 20:37:10 2014
@@ -358,7 +358,7 @@
 	currItem->setCornerRadius(w);
 	currItem->SetFrameRound();
 	ScCore->primaryMainWindow()->doc->setRedrawBounding(currItem);
-	ScCore->primaryMainWindow()->view->SetFrameRounded();
+	ScCore->primaryMainWindow()->doc->setFrameRounded();
 	Py_RETURN_NONE;
 }
 

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18922&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Wed Mar 19 20:37:10 2014
@@ -9851,6 +9851,56 @@
 	changed();
 }
 
+bool ScribusDoc::getItem(PageItem **currItem, int nr)
+{
+	int n=nr;
+	if (n == -1)
+		n=0;
+	*(currItem) = m_Selection->itemAt(n);
+	return (*(currItem)!=NULL);
+}
+
+void ScribusDoc::setFrameRect()
+{
+	nodeEdit.deselect();
+	PageItem *currItem;
+	if (getItem(&currItem))
+	{
+		currItem->SetRectFrame();
+		setRedrawBounding(currItem);
+		regionsChanged()->update(currItem->getRedrawBounding(1.0));
+	}
+}
+
+void ScribusDoc::setFrameRounded()
+{
+	nodeEdit.deselect();
+	PageItem *currItem;
+	if (getItem(&currItem))
+	{
+		if (currItem->cornerRadius() == 0)
+		{
+			setFrameRect();
+			return;
+		}
+		currItem->SetFrameRound();
+		setRedrawBounding(currItem);
+		regionsChanged()->update(currItem->getRedrawBounding(1.0));
+	}
+}
+
+void ScribusDoc::setFrameOval()
+{
+	nodeEdit.deselect();
+	PageItem *currItem;
+	if (getItem(&currItem))
+	{
+		currItem->SetOvalFrame();
+		setRedrawBounding(currItem);
+		regionsChanged()->update(currItem->getRedrawBounding(1.0));
+	}
+}
+
 
 void ScribusDoc::setRedrawBounding(PageItem *currItem)
 {

Modified: trunk/Scribus/scribus/scribusdoc.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18922&path=/trunk/Scribus/scribus/scribusdoc.h
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.h (original)
+++ trunk/Scribus/scribus/scribusdoc.h Wed Mar 19 20:37:10 2014
@@ -1077,17 +1077,17 @@
 	void itemSelection_SetRenderIntent(int intentIndex, Selection* customSelection=0);
 	void itemSelection_SetCompressionMethod(int cmIndex, Selection* customSelection=0);
 	void itemSelection_SetCompressionQuality(int cqIndex, Selection* customSelection=0);
-
-	
-//	void chAbStyle(PageItem *currItem, int s);
-
 	void itemSelection_SetTracking(int us, Selection* customSelection=0);
 	void itemSelection_SetFontSize(int size, Selection* customSelection=0);
 	//void FlipImageH();
 	//void FlipImageV();
 	void MirrorPolyH(PageItem *currItem);
 	void MirrorPolyV(PageItem *currItem);
-	
+	bool getItem(PageItem **currItem, int nr = -1);
+	void setFrameRect();
+	void setFrameRounded();
+	void setFrameOval();
+
 	void setRedrawBounding(PageItem *currItem);
 	void adjustCanvas(FPoint minPos, FPoint maxPos, bool absolute = false);
 	struct PicResMapped

Modified: trunk/Scribus/scribus/scribusview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18922&path=/trunk/Scribus/scribus/scribusview.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusview.cpp (original)
+++ trunk/Scribus/scribus/scribusview.cpp Wed Mar 19 20:37:10 2014
@@ -1652,7 +1652,7 @@
 bool ScribusView::slotSetCurs(int x, int y)
 {
 	PageItem *item;
-	if (!GetItem(&item))
+	if (!Doc->getItem(&item))
 		return false;
 
 	PageItem_TextFrame *textFrame;
@@ -1839,15 +1839,6 @@
 			//EmitValues(currItem);
 			//currItem->emitAllToGUI();
 	}
-}
-
-bool ScribusView::GetItem(PageItem **currItem, int nr)
-{
-	int n=nr;
-	if (n == -1)
-		n=0;
-	*(currItem) = Doc->m_Selection->itemAt(n);
-	return (*(currItem)!=NULL);
 }
 
 //CB Remove bookmark interaction here, item/doc should do it
@@ -3234,50 +3225,6 @@
 }
 #endif
 
-//CB-->Doc
-void ScribusView::SetFrameRect()
-{
-	Doc->nodeEdit.deselect();
-	PageItem *currItem;
-	if (GetItem(&currItem))
-	{
-		currItem->SetRectFrame();
-		Doc->setRedrawBounding(currItem);
-		updateContents(currItem->getRedrawBounding(m_canvas->scale()));
-	}
-}
-
-//CB-->Doc
-void ScribusView::SetFrameRounded()
-{
-	Doc->nodeEdit.deselect();
-	PageItem *currItem;
-	if (GetItem(&currItem))
-	{
-		if (currItem->cornerRadius() == 0)
-		{
-			SetFrameRect();
-			return;
-		}
-		currItem->SetFrameRound();
-		Doc->setRedrawBounding(currItem);
-		updateContents(currItem->getRedrawBounding(m_canvas->scale()));
-	}
-}
-
-//CB-->Doc
-void ScribusView::SetFrameOval()
-{
-	Doc->nodeEdit.deselect();
-	PageItem *currItem;
-	if (GetItem(&currItem))
-	{
-		currItem->SetOvalFrame();
-		Doc->setRedrawBounding(currItem);
-		updateContents(currItem->getRedrawBounding(m_canvas->scale()));
-	}
-}
-
 void ScribusView::editExtendedImageProperties()
 {
 	if (Doc->m_Selection->count() != 0)
@@ -3390,7 +3337,7 @@
 void ScribusView::FromPathText()
 {
 	PageItem *currItem;
-	if (GetItem(&currItem))
+	if (Doc->getItem(&currItem))
 	{
 		Deselect(true);
 		PageItem* newItem=Doc->convertItemTo(currItem, PageItem::TextFrame);

Modified: trunk/Scribus/scribus/scribusview.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18922&path=/trunk/Scribus/scribus/scribusview.h
==============================================================================
--- trunk/Scribus/scribus/scribusview.h (original)
+++ trunk/Scribus/scribus/scribusview.h Wed Mar 19 20:37:10 2014
@@ -208,13 +208,9 @@
 	void TransformPoly(int mode, int rot = 1, double scaling = 1.0);
 	bool slotSetCurs(int x, int y);
 	void HandleCurs(PageItem *currItem, QRect mpo);
-	bool GetItem(PageItem **b, int nr = -1);
 	void Deselect(bool prop = true);
 	void SelectItemNr(uint nr, bool draw = true, bool single = false);
 	void SelectItem(PageItem *pi, bool draw = true, bool single = false);
-	void SetFrameRect();
-	void SetFrameRounded();
-	void SetFrameOval();
 	void rememberOldZoomLocation(int mx=0, int my=0);
 	bool groupTransactionStarted() { return m_groupTransactions > 0; }
 	void startGroupTransaction(const QString &actionName = "",

Modified: trunk/Scribus/scribus/ui/propertiespalette_shape.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18922&path=/trunk/Scribus/scribus/ui/propertiespalette_shape.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_shape.cpp (original)
+++ trunk/Scribus/scribus/ui/propertiespalette_shape.cpp Wed Mar 19 20:37:10 2014
@@ -478,8 +478,9 @@
 	if (!m_haveDoc || !m_haveItem || !m_ScMW || m_ScMW->scriptIsRunning())
 		return;
 	m_item->setCornerRadius(roundRect->value() / m_unitRatio);
-	m_ScMW->view->SetFrameRounded();
+	m_doc->setFrameRounded();
 	m_doc->changed();
+	//called from setFrameRounded already!
 	m_doc->regionsChanged()->update(QRect());
 }
 




More information about the scribus-commit mailing list