View Issue Details

IDProjectCategoryView StatusLast Update
0009560ScribusUsabilitypublic2011-12-30 16:34
Reportercezaryece Assigned Tofschmid  
PrioritynormalSeveritytweakReproducibilityN/A
Status closedResolutionfixed 
Product Version1.4.0svn 
Fixed in Version1.5.0svn 
Summary0009560: [patch] Preflight Verifier - making text based error items put cursor in error place
DescriptionThis patch is change Preflight Verifier behaviour when error item is clicked.
For text based errors (now only for Missing Glyphs, but I have uploaded patch for RGB text check and ready for upload patch for widows/orphans check) selecting item error in verifier palette not only select text frame, but also put text cursor in place of error.
So, after this patch finding errors in text is very easy.
After commit of this patch I will upload patch for widows/orphans and new fixed patch for RGB text.
TagsNo tags attached.
Patch

Relationships

has duplicate 0004424 closedcbradney Preflight: Glyphs missing: provide more information 

Activities

cezaryece

2010-12-06 20:04

updater  

verifier-CPos.patch (8,625 bytes)   
Index: Scribus/scribus/checkDocument.cpp
===================================================================
--- Scribus/scribus/checkDocument.cpp	(wersja 16076)
+++ Scribus/scribus/checkDocument.cpp	(kopia robocza)
@@ -183,6 +183,7 @@
        checkMode = checkNULL;
        languageChange();
        itemMap.clear();
+	posMap.clear();
        pageMap.clear();
        masterPageMap.clear();
        masterPageItemMap.clear();
@@ -198,7 +199,7 @@
        if (itemMap.contains(ite))
        {
                ScCore->primaryMainWindow()->closeActiveWindowMasterPageEditor();
-		emit selectElement(m_Doc->DocItems.at(itemMap[ite])->OwnPage, itemMap[ite]);
+		emit selectElement(m_Doc->DocItems.at(itemMap[ite])->OwnPage, itemMap[ite], posMap[ite]);
                return;
        }
        if (pageMap.contains(ite))
@@ -216,7 +217,7 @@
        {
                if (!m_Doc->masterPageMode())
                        emit selectMasterPage(m_Doc->MasterItems.at(masterPageItemMap[ite])->OnMasterPage);
-		emit selectElement(-1, masterPageItemMap[ite]);
+		emit selectElement(-1, masterPageItemMap[ite],0);
                return;
        }
 }
@@ -242,6 +243,7 @@
        reportDisplay->clear();
        reportDisplay->setSortingEnabled(false);
        itemMap.clear();
+	posMap.clear();
        pageMap.clear();
        masterPageMap.clear();
        masterPageItemMap.clear();
@@ -532,6 +534,7 @@
                                        {
                                                it3 = docItemErrorsIt.value().begin();
                                                buildItem(object, it3.key(), doc->DocItems.at(docItemErrorsIt.key()));
+						posMap.insert(object, it3.value());
                                        }
                                        else
                                        {
@@ -539,6 +542,7 @@
                                                {
                                                        QTreeWidgetItem * errorText = new QTreeWidgetItem( object);
                                                        buildItem(errorText, it3.key(), doc->DocItems.at(docItemErrorsIt.key()));
+							posMap.insert(object, it3.value());
                                                }
                                                object->setExpanded( true );
                                        }
Index: Scribus/scribus/scribus.cpp
===================================================================
--- Scribus/scribus/scribus.cpp	(wersja 16076)
+++ Scribus/scribus/scribus.cpp	(kopia robocza)
@@ -528,7 +528,7 @@
        connect( styleManager, SIGNAL(paletteShown(bool)), scrActions["editStyles"], SLOT(setChecked(bool)));
        styleManager->installEventFilter(this);

-	connect(docCheckerPalette, SIGNAL(selectElement(int, int)), this, SLOT(selectItemsFromOutlines(int, int)));
+	connect(docCheckerPalette, SIGNAL(selectElement(int, int, int)), this, SLOT(selectItemsFromOutlines(int, int, int)));
        connect(docCheckerPalette, SIGNAL(selectPage(int)), this, SLOT(selectPagesFromOutlines(int)));
        connect(docCheckerPalette, SIGNAL(selectMasterPage(QString)), this, SLOT(manageMasterPages(QString)));
        connect(outlinePalette, SIGNAL(selectElement(int, int, bool)), this, SLOT(selectItemsFromOutlines(int, int, bool)));
@@ -7606,6 +7606,49 @@
                }
        }
 }
+void ScribusMainWindow::selectItemsFromOutlines(int Page, int Item, int cPos)
+{
+	if (HaveDoc && doc->appMode == modeEditClip)
+		view->requestMode(submodeEndNodeEdit);
+	activateWindow();
+	view->Deselect(true);
+	if ((Page != -1) && (Page != static_cast<int>(doc->currentPage()->pageNr())))
+		view->GotoPage(Page);
+	doc->m_Selection->delaySignalsOn();
+	view->SelectItemNr(Item, true, false);
+	doc->m_Selection->delaySignalsOff();
+	doc->m_Selection->connectItemToGUI();
+	if (doc->m_Selection->count() != 0)
+	{
+		PageItem *currItem = doc->m_Selection->itemAt(0);
+	 	double rotation=currItem->rotation();
+		if ( rotation != 0.0 )
+		{
+			double MPI180=1.0/(180.0*M_PI);
+			double y1 = sin(rotation*MPI180) * currItem->width();
+			double x1 = cos(rotation*MPI180) * currItem->width();
+			double y2 = sin((rotation+90.0)*MPI180) * currItem->height();
+			double x2 = cos((rotation+90.0)*MPI180) * currItem->height();
+			double mx = currItem->xPos() + ((x1 + x2)/2.0);
+			double my = currItem->yPos() + ((y1 + y2)/2.0);
+			view->SetCCPo(mx, my);
+		}
+		else
+		{
+			view->SetCCPo(currItem->xPos() + currItem->width() / 2.0, currItem->yPos() + currItem->height() / 2.0);
+		}
+		//FIX ME - all above is the same as in selectItemsFromOutlines(int Page, int Item, bool single)
+		//maybe we should make this as separate privet method called in these both slots?
+		// placing cursor at position of error for text
+		// for Missing Glyphs, in future for widows/orphans and RGB text error items
+		if (currItem->isTextFrame())
+		{
+			view->requestMode(modeEdit);
+			currItem->CPos = cPos;
+			currItem->update();
+		}
+	}
+}

 void ScribusMainWindow::selectPagesFromOutlines(int Page)
 {
Index: Scribus/scribus/checkDocument.h
===================================================================
--- Scribus/scribus/checkDocument.h	(wersja 16076)
+++ Scribus/scribus/checkDocument.h	(kopia robocza)
@@ -78,7 +78,7 @@
 signals:
        //void rescan();
        //! \brief Signal emitted when user selects any page item in error list.
-	void selectElement(int, int);
+	void selectElement(int, int, int);
        //! \brief Signal emitted when user selects any page in error list.
        void selectPage(int);
        //! \brief Signal emitted when user selects any master page in error list.
@@ -100,6 +100,8 @@
 private:
        //! \brief Mappping Page Item - item nr.
        QMap<QTreeWidgetItem*, int> itemMap;
+	//! \brief Mappping Page Item - cursor position in item
+	QMap<QTreeWidgetItem*, int> posMap;
        //! \brief Mappping Page - page nr.
        QMap<QTreeWidgetItem*, int> pageMap;
        //! \brief Mappping Master Page - MP nr.
Index: Scribus/scribus/documentchecker.cpp
===================================================================
--- Scribus/scribus/documentchecker.cpp	(wersja 16076)
+++ Scribus/scribus/documentchecker.cpp	(kopia robocza)
@@ -280,7 +280,7 @@
                                                }
                                                chr = chstr[0].unicode();
                                                if ((!currItem->itemText.charStyle(e).font().canRender(chr)) && (checkerSettings.checkGlyphs))
-							itemError.insert(MissingGlyph, 0);
+							itemError.insert(MissingGlyph, e);
                                        }
                                        for (int t1 = 0; t1 < currItem->itemText.defaultStyle().tabValues().count(); t1++)
                                        {
@@ -294,7 +294,7 @@
                                                }
                                                chr = chstr[0].unicode();
                                                if ((!currItem->itemText.charStyle(e).font().canRender(chr)) && (checkerSettings.checkGlyphs))
-							itemError.insert(MissingGlyph, 0);
+							itemError.insert(MissingGlyph, e);
                                        }
                                        continue;
                                }
@@ -303,12 +303,12 @@
                                        for (uint numco = 0x30; numco < 0x3A; ++numco)
                                        {
                                                if ((!currItem->itemText.charStyle(e).font().canRender(numco)) && (checkerSettings.checkGlyphs))
-							itemError.insert(MissingGlyph, 0);
+							itemError.insert(MissingGlyph, e);
                                        }
                                        continue;
                                }
                                if ((!currItem->itemText.charStyle(e).font().canRender(chr)) && (checkerSettings.checkGlyphs))
-					itemError.insert(MissingGlyph, 0);
+					itemError.insert(MissingGlyph, e);
                        }
 #endif
                }
Index: Scribus/scribus/scribus.h
===================================================================
--- Scribus/scribus/scribus.h	(wersja 16076)
+++ Scribus/scribus/scribus.h	(kopia robocza)
@@ -488,6 +488,7 @@
        void setAbsValue(int a);
        void selectItemsFromOutlines(PageItem *ite);
        void selectItemsFromOutlines(int Page, int Item, bool single = false);
+	void selectItemsFromOutlines(int Page, int Item, int cPos);
        void selectPagesFromOutlines(int Page);
        void doPrintPreview();
        void printPreview();
verifier-CPos.patch (8,625 bytes)   

Issue History

Date Modified Username Field Change
2010-12-06 20:04 cezaryece New Issue
2010-12-06 20:04 cezaryece File Added: verifier-CPos.patch
2010-12-06 20:18 plinnell Assigned To => fschmid
2010-12-06 20:18 plinnell Status new => assigned
2011-11-23 12:29 fschmid Status assigned => resolved
2011-11-23 12:29 fschmid Fixed in Version => 1.5.0svn
2011-11-23 12:29 fschmid Resolution open => fixed
2011-12-30 16:34 cbradney Status resolved => closed
2013-09-23 19:15 cbradney Relationship added has duplicate 0004424