r22396 by jghali -

scribus-commit scribus-commit at lists.scribus.net
Thu Feb 15 23:35:48 UTC 2018


Author: jghali
Date: Thu Feb 15 23:35:48 2018
New Revision: 22396

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22396
Log:
refactoring of bookmwin.h/cpp

Modified:
    trunk/Scribus/scribus/pdflib_core.cpp
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/ui/bookmwin.cpp
    trunk/Scribus/scribus/ui/bookmwin.h

Modified: trunk/Scribus/scribus/pdflib_core.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22396&path=/trunk/Scribus/scribus/pdflib_core.cpp
==============================================================================
--- trunk/Scribus/scribus/pdflib_core.cpp	(original)
+++ trunk/Scribus/scribus/pdflib_core.cpp	Thu Feb 15 23:35:48 2018
@@ -9772,7 +9772,7 @@
 
 void PDFLibCore::PDF_Bookmark(PageItem *currItem, double ypos)
 {
-	Bvie->SetAction(currItem, "/XYZ 0 "+FToStr(ypos)+" 0]");
+	Bvie->setAction(currItem, "/XYZ 0 "+FToStr(ypos)+" 0]");
 	BookMinUse = true;
 }
 

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22396&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp	(original)
+++ trunk/Scribus/scribus/scribus.cpp	Thu Feb 15 23:35:48 2018
@@ -725,9 +725,9 @@
 	connect(nodePalette, SIGNAL(DocChanged()), this, SLOT(slotDocCh()));
 	connect(layerPalette, SIGNAL(LayerChanged()), this, SLOT(showLayer()));
 
-	connect(bookmarkPalette->BView, SIGNAL(MarkMoved()), this, SLOT(StoreBookmarks()));
+	connect(bookmarkPalette->BView, SIGNAL(markMoved()), this, SLOT(StoreBookmarks()));
 	connect(bookmarkPalette->BView, SIGNAL(changed()), this, SLOT(slotDocCh()));
-	connect(bookmarkPalette->BView, SIGNAL(SelectElement(PageItem *, bool)), this, SLOT(selectItemsFromOutlines(PageItem *, bool)));
+	connect(bookmarkPalette->BView, SIGNAL(selectElement(PageItem *, bool)), this, SLOT(selectItemsFromOutlines(PageItem *, bool)));
 	// guides
 	connect(scrActions["pageManageGuides"], SIGNAL(toggled(bool)), guidePalette, SLOT(setPaletteShown(bool)));
 	connect(guidePalette, SIGNAL(paletteShown(bool)), scrActions["pageManageGuides"], SLOT(setChecked(bool)));
@@ -3958,7 +3958,7 @@
 			for (int a = 0; a < doc->Items->count(); ++a)
 			{
 				if (doc->Items->at(a)->isBookmark)
-					bookmarkPalette->BView->ChangeText(doc->Items->at(a));
+					bookmarkPalette->BView->changeText(doc->Items->at(a));
 			}
 			if (!impsetup.textOnly)
 				doc->flag_NumUpdateRequest = true;
@@ -4010,7 +4010,7 @@
 	for (int a = 0; a < doc->Items->count(); ++a)
 	{
 		if (doc->Items->at(a)->isBookmark)
-			bookmarkPalette->BView->ChangeText(doc->Items->at(a));
+			bookmarkPalette->BView->changeText(doc->Items->at(a));
 	}
 	view->DrawNew();
 	slotDocCh();
@@ -7332,19 +7332,19 @@
 //CB-->Doc, stop _storing_ bookmarks in the palette
 void ScribusMainWindow::AddBookMark(PageItem *ite)
 {
-	bookmarkPalette->BView->AddPageItem(ite);
+	bookmarkPalette->BView->addPageItem(ite);
 }
 
 //CB-->Doc, stop _storing_ bookmarks in the palette
 void ScribusMainWindow::DelBookMark(PageItem *ite)
 {
-	bookmarkPalette->BView->DeleteItem(ite);
+	bookmarkPalette->BView->deleteItem(ite);
 }
 
 //CB-->Doc, stop _storing_ bookmarks in the palette
 void ScribusMainWindow::BookMarkTxT(PageItem *ite)
 {
-	bookmarkPalette->BView->ChangeText(ite);
+	bookmarkPalette->BView->changeText(ite);
 }
 
 //CB-->Doc, stop _storing_ bookmarks in the palette

Modified: trunk/Scribus/scribus/ui/bookmwin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22396&path=/trunk/Scribus/scribus/ui/bookmwin.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/bookmwin.cpp	(original)
+++ trunk/Scribus/scribus/ui/bookmwin.cpp	Thu Feb 15 23:35:48 2018
@@ -29,25 +29,25 @@
 BookMItem::BookMItem(QTreeWidgetItem* parent, struct ScribusDoc::BookMa *Bm)
 	: QTreeWidgetItem(parent)
 {
-	SetUp(Bm);
+	setup(Bm);
 }
 
 BookMItem::BookMItem(QTreeWidgetItem* parent, QTreeWidgetItem* after, struct ScribusDoc::BookMa *Bm)
 	: QTreeWidgetItem(parent, after)
 {
-	SetUp(Bm);
+	setup(Bm);
 }
 
 BookMItem::BookMItem(QTreeWidget* parent, QTreeWidgetItem* after, struct ScribusDoc::BookMa *Bm)
 	: QTreeWidgetItem(parent, after)
 {
-	SetUp(Bm);
+	setup(Bm);
 }
 
 BookMItem::BookMItem(QTreeWidget* parent, struct ScribusDoc::BookMa *Bm)
 	: QTreeWidgetItem(parent)
 {
-	SetUp(Bm);
+	setup(Bm);
 }
 
 BookMItem::BookMItem(QTreeWidget* parent, QTreeWidgetItem* after, int nr, PageItem* PObject)
@@ -55,7 +55,6 @@
 {
 	ItemNr = nr;
 	PageObject = PObject;
-	PdfObj = 0;
 	Action = "";
 	First = 0;
 	Last = 0;
@@ -69,7 +68,6 @@
 {
 	ItemNr = nr;
 	PageObject = PObject;
-	PdfObj = 0;
 	Action = "";
 	First = 0;
 	Last = 0;
@@ -78,10 +76,9 @@
 	Pare = 0;
 }
 
-void BookMItem::SetUp(struct ScribusDoc::BookMa *Bm)
+void BookMItem::setup(struct ScribusDoc::BookMa *Bm)
 {
 	ItemNr = Bm->ItemNr;
-	PdfObj = 0;
 	Action = Bm->Aktion;
 	First = Bm->First;
 	Last = Bm->Last;
@@ -131,14 +128,13 @@
 			this, SLOT(setPageItem(QTreeWidgetItem *, QTreeWidgetItem *)));
 }
 
-void BookMView::AddPageItem(PageItem* ite)
+void BookMView::addPageItem(PageItem* ite)
 {
 	QChar ch;
 	QString bm, bm2;
-	QString str;
 
 	getTextAndTitle(ite, bm, bm2);
-	AddItem(bm, bm2, ite);
+	addItem(bm, bm2, ite);
 	Last = NrItems;
 }
 
@@ -180,7 +176,7 @@
 	BookMItem * i = dynamic_cast<BookMItem*>(current);
 	// something weird here at 1st call...
 	if (i)
-		emit SelectElement(i->PageObject, false);
+		emit selectElement(i->PageObject, false);
 }
 
 void BookMView::dropEvent(QDropEvent *e)
@@ -251,11 +247,11 @@
 
 	NrItems = Last;
 
-	emit MarkMoved();
+	emit markMoved();
 	emit changed();
 }
 
-void BookMView::AddItem(QString text, QString Tit, PageItem *PageObject)
+void BookMView::addItem(QString text, QString Tit, PageItem *PageObject)
 {
 	BookMItem * ite = new BookMItem(this, NrItems+1, PageObject);
 	ite->setText(0, text);
@@ -263,7 +259,7 @@
 	rebuildTree();
 }
 
-void BookMView::DeleteItem(PageItem *pObject)
+void BookMView::deleteItem(PageItem *pObject)
 {
 	QTreeWidgetItemIterator it(this);
 	BookMItem * item;
@@ -280,7 +276,7 @@
 	rebuildTree();
 }
 
-void BookMView::SetAction(PageItem *currItem, QString Act)
+void BookMView::setAction(PageItem *currItem, QString Act)
 {
 	BookMItem *ite;
 	QTreeWidgetItemIterator it(this);
@@ -296,12 +292,10 @@
 	}
 }
 
-void BookMView::ChangeText(PageItem *currItem)
+void BookMView::changeText(PageItem *currItem)
 {
 	BookMItem *ite;
-	QString bm = "";
-	QString bm2 = "";
-	QString cc;
+	QString bm, bm2;
 
 	getTextAndTitle(currItem, bm, bm2);
 

Modified: trunk/Scribus/scribus/ui/bookmwin.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22396&path=/trunk/Scribus/scribus/ui/bookmwin.h
==============================================================================
--- trunk/Scribus/scribus/ui/bookmwin.h	(original)
+++ trunk/Scribus/scribus/ui/bookmwin.h	Thu Feb 15 23:35:48 2018
@@ -47,11 +47,13 @@
 	BookMItem(QTreeWidget* parent, QTreeWidgetItem* after, int nr, PageItem *PObject);
 	BookMItem(QTreeWidget* parent, int nr, PageItem *PObject);
 	~BookMItem() {};
-	void SetUp(struct ScribusDoc::BookMa *Bm);
+
+	int level();
+	void setup(struct ScribusDoc::BookMa *Bm);
 	virtual QString key(int, bool) const;
+
 	PageItem *PageObject;
 	int ItemNr;
-	int PdfObj;
 	QString Action;
 	QString Title;
 	int First;
@@ -59,8 +61,6 @@
 	int Prev;
 	int Next;
 	int Pare;
-
-	int level();
 };
 
 
@@ -79,9 +79,10 @@
 public:
 	BookMView(QWidget* parent);
 	~BookMView() {};
-	void AddItem(QString text, QString Tit, PageItem *PageObject);
-	void DeleteItem(PageItem *PageObject);
-	void SetAction(PageItem *currItem, QString Act);
+
+	void addItem(QString text, QString Tit, PageItem *PageObject);
+	void deleteItem(PageItem *PageObject);
+	void setAction(PageItem *currItem, QString Act);
 
 	int NrItems;
 	int First;
@@ -95,13 +96,13 @@
 	void rebuildTree();
 
 public slots:
-	void AddPageItem(PageItem* ite);
-	void ChangeText(PageItem *currItem);
+	void addPageItem(PageItem* ite);
+	void changeText(PageItem *currItem);
 
 signals:
-	void MarkMoved();
-	void SelectElement(PageItem *, bool);
 	void changed();
+	void markMoved();
+	void selectElement(PageItem *, bool);
 
 protected:
 	void dropEvent(QDropEvent *e);




More information about the scribus-commit mailing list