r20692 by craig -

scribus-commit scribus-commit at lists.scribus.net
Sun Jan 17 15:35:39 UTC 2016


Author: craig
Date: Sun Jan 17 15:35:39 2016
New Revision: 20692

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20692
Log:
#13544: Remove some old commented out code <as.bahanta>

Modified:
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/scribus.h
    trunk/Scribus/scribus/scribusdoc.cpp
    trunk/Scribus/scribus/scribusdoc.h

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20692&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp	(original)
+++ trunk/Scribus/scribus/scribus.cpp	Sun Jan 17 15:35:39 2016
@@ -308,20 +308,6 @@
 }
 
 /*
-static QCoreApplication::EventFilter origEventFilter = 0;
-
-bool reportFocusChanges(void *message, long *result)
-{
-	unsigned* data = static_cast<unsigned*>(message);
-	if (QApplication::focusWidget())
-		qDebug() << QApplication::applicationFilePath() << reinterpret_cast<void*>(QApplication::focusWidget()) << typeid(*QApplication::focusWidget()).name() << QApplication::focusWidget()->objectName() << message << data[0] << data[1] << data[2] << data[3] << data[4] << data[5] << data[6] << data[7];
-	else
-		qDebug() << QApplication::applicationFilePath() << "no focus" << message << data[0] << data[1] << data[2] << data[3] << data[4] << data[5] << data[6] << data[7];
-	return origEventFilter && origEventFilter(message, result);
-}
-*/
-
-/*
  * retval 0 - ok, 1 - no fonts, ...
  */
 int ScribusMainWindow::initScMW(bool primaryMainWindow)
@@ -333,8 +319,6 @@
 	{
 		qApp->setStyleSheet(QString(stylesheet));
 	}
-
-//	origEventFilter = qApp->setEventFilter(reportFocusChanges);
 
 	previewDinUse = false;
 	printDinUse = false;
@@ -380,10 +364,6 @@
 
 
 	actionManager->init(this);
-//	if (primaryMainWindow)
-//		ScCore->setSplashStatus( tr("Applying User Shortcuts") );
-//	prefsManager->applyLoadedShortCuts();
-//	initKeyboardShortcuts();
 	initMenuBar();
 	createMenuBar();
 	initToolBars();
@@ -721,18 +701,14 @@
 	connect( nsEditor, SIGNAL(paletteShown(bool)), scrActions["editNotesStyles"], SLOT(setChecked(bool)));
 	nsEditor->installEventFilter(this);
 
-//	connect(docCheckerPalette, SIGNAL(selectElement(int, int)), this, SLOT(selectItemsFromOutlines(int, int)));
 	connect(docCheckerPalette, SIGNAL(selectElementByItem(PageItem *, bool)), this, SLOT(selectItemsFromOutlines(PageItem *, bool)));
 	connect(docCheckerPalette, SIGNAL(selectElement(PageItem *, bool, int)), this, SLOT(selectItemFromOutlines(PageItem *, bool, int)));
 	connect(docCheckerPalette, SIGNAL(selectPage(int)), this, SLOT(selectPagesFromOutlines(int)));
 	connect(docCheckerPalette, SIGNAL(selectMasterPage(QString)), this, SLOT(editMasterPagesStart(QString)));
-//	connect(outlinePalette, SIGNAL(selectElement(int, int, bool)), this, SLOT(selectItemsFromOutlines(int, int, bool)));
 	connect(outlinePalette, SIGNAL(selectElementByItem(PageItem *, bool)), this, SLOT(selectItemsFromOutlines(PageItem *, bool)));
 	connect(outlinePalette, SIGNAL(editElementByItem(PageItem *)), this, SLOT(editItemsFromOutlines(PageItem *)));
 	connect(outlinePalette, SIGNAL(selectPage(int)), this, SLOT(selectPagesFromOutlines(int)));
 	connect(outlinePalette, SIGNAL(selectMasterPage(QString)), this, SLOT(editMasterPagesStart(QString)));
-//	connect(propertiesPalette, SIGNAL(EditLSt()), this, SLOT(slotEditLineStyles()));
-//	connect(nodePalette, SIGNAL(paletteClosed()), propertiesPalette, SLOT(endEdit2()));
 	connect(nodePalette, SIGNAL(paletteClosed()), this, SLOT(slotSelect()));
 	connect(nodePalette, SIGNAL(DocChanged()), this, SLOT(slotDocCh()));
 	connect(layerPalette, SIGNAL(LayerChanged()), this, SLOT(showLayer()));
@@ -1307,32 +1283,12 @@
 	mainWindowYPosDataLabel->setMinimumWidth(mainWindowYPosDataLabel->fontMetrics().width("99999.999"));
 	statusBarLanguageChange();
 
-	/*
-	QByteArray stylesheet;
-	if (loadRawText(ScPaths::instance().libDir() + "scribus.css", stylesheet))
-	{
-		QString downArrow(IconManager::instance()->pathForIcon("16/go-down.png"));
-		QByteArray da;
-		da.append(downArrow);
-		stylesheet.replace("___downArrow___", da);
-	}
-	*/
-
 	layerMenu->setObjectName("layerMenu");
 	unitSwitcher->setObjectName("unitSwitcher");
 	zoomDefaultToolbarButton->setObjectName("zoomDefaultToolbarButton");
 	zoomInToolbarButton->setObjectName("zoomInToolbarButton");
 	zoomOutToolbarButton->setObjectName("zoomOutToolbarButton");
 	zoomSpinBox->setObjectName("zoomSpinBox");
-
-	/*
-	layerMenu->setStyleSheet(stylesheet);
-	unitSwitcher->setStyleSheet(stylesheet);
-	zoomDefaultToolbarButton->setStyleSheet(stylesheet);
-	zoomInToolbarButton->setStyleSheet(stylesheet);
-	zoomOutToolbarButton->setStyleSheet(stylesheet);
-	zoomSpinBox->setStyleSheet(stylesheet);
-	*/
 
 	statusBar()->setFont(fo);
 	statusBar()->addPermanentWidget(m_mainWindowStatusLabel, 5);
@@ -2274,11 +2230,7 @@
 	if (requiresGUI)
 	{
 		w->setSubWin(mdiArea->addSubWindow(w));
-		//#9250 : transfered to newActWin()
-		//connect(undoManager, SIGNAL(undoRedoBegin()), tempDoc, SLOT(undoRedoBegin()));
-		//connect(undoManager, SIGNAL(undoRedoDone()), tempDoc, SLOT(undoRedoDone()));
-		//connect(undoManager, SIGNAL(undoRedoDone()), tempView, SLOT(DrawNew()));
-		connect(tempView, SIGNAL(signalGuideInformation(int, qreal)), alignDistributePalette, SLOT(setGuide(int, qreal)));
+			connect(tempView, SIGNAL(signalGuideInformation(int, qreal)), alignDistributePalette, SLOT(setGuide(int, qreal)));
 	}
 	//Independent finishing tasks after tempDoc setup
 	if (showView)
@@ -2364,8 +2316,6 @@
 	if (windowsListNotEmpty)
 	{
 		int windowCount=static_cast<int>(windows.count());
-	//	if (windowCount>1)
-	//		scrMenuMgr->addMenuItemString("SEPARATOR", "Windows");
 		for ( int i = 0; i < windowCount; ++i )
 		{
 			QString docInWindow(windows.at(i)->windowTitle());
@@ -2514,11 +2464,7 @@
 	actionManager->connectNewDocActions(doc);
 	connect(view, SIGNAL(signalGuideInformation(int, qreal)), alignDistributePalette, SLOT(setGuide(int, qreal)));
 	if (ScCore->usingGUI())
-	{
-		//connect(doc->m_Selection, SIGNAL(selectionIsMultiple(bool)), propertiesPalette, SLOT( setMultipleSelection(bool)));
 		connect(doc->m_Selection, SIGNAL(selectionIsMultiple(bool)), actionManager, SLOT( handleMultipleSelections(bool)));
-		//connect(doc->m_Selection, SIGNAL(empty()), propertiesPalette, SLOT( unsetItem()));
-	}
 	pagePalette->setView(view);
 	alignDistributePalette->setDoc(doc);
 	if (!doc->isLoading())
@@ -3207,7 +3153,6 @@
 	else
 		docDir = docContext->get("docsopen", ".");
 	QString formats(FileLoader::getLoadFilterString());
-//	formats.remove("PDF (*.pdf *.PDF);;");
 	QString fileName(CFileDialog( docDir, tr("Open"), formats));
 	if (fileName.isEmpty()) // User cancelled
 		return false;
@@ -3350,25 +3295,12 @@
 		for (uint i = oldItemsCount; i < docItemsCount; ++i)
 		{
 			PageItem *ite = doc->Items->at(i);
-//			if ((docItemsCount - oldItemsCount) > 1)
-//				ite->Groups.push(doc->GroupCounter);
-//	#5386: allow locked imported items to remain locked
-// 			if (ite->locked())
-// 				ite->setLocked(false);
 			if ((ite->asTextFrame()) && (ite->isBookmark))
 				AddBookMark(ite);
 		}
-//		if ((docItemsCount - oldItemsCount) > 1)
-//			doc->GroupCounter++;
 		propertiesPalette->updateColorList();
 		emit UpdateRequest(reqArrowStylesUpdate | reqLineStylesUpdate | reqStyleComboDocUpdate | reqInlinePalUpdate);
 		symbolPalette->updateSymbolList();
-//		inlinePalette->updateItemList();
-//		if (!Mpa)
-//		{
-//			scanDocument();
-//			docCheckerPalette->buildErrorList(doc);
-//		}
 		slotDocCh();
 		rebuildLayersList();
 		updateLayerMenu();
@@ -3485,7 +3417,6 @@
 		doc->is12doc=is12doc;
 		doc->appMode = modeNormal;
 		doc->HasCMS = false;
-		//doc->setActiveLayer(0); //CB should not need this, the file load process sets it to ALAYER from the doc
 		doc->OpenNodes.clear();
 		doc->setLoading(true);
 		m_mainWindowStatusLabel->setText( tr("Loading..."));
@@ -3514,7 +3445,6 @@
 		{
 			view->close();
 			delete fileLoader;
-// 			delete view;
 			delete doc;
 			doc=NULL;
 			mdiArea->removeSubWindow(w->getSubWin());
@@ -3673,8 +3603,6 @@
 		{
 			doc->cmsSettings().CMSinUse = false;
 		}
-//		propertiesPalette->updateColorList();
-//		propertiesPalette->Cpal->showGradient(0);
 		if (fileLoader->fileType() > FORMATID_NATIVEIMPORTEND)
 		{
 			doc->setName(FName+ tr("(converted)"));
@@ -3685,11 +3613,8 @@
 		else
 			doc->setName(FName);
 		doc->setMasterPageMode(false);
-		//IL doc->setHyphLanguage(GetLang(doc->hyphLanguage()));
 		doc->createHyphenator();
 		HaveNewDoc();
-//		propertiesPalette->Cpal->showGradient(0);
-//		propertiesPalette->updateCList();
 		doc->hasName = true;
 		if (doc->MasterPages.count() == 0)
 		{
@@ -3724,7 +3649,6 @@
 //			qDebug() << QString("load M: %1 %2 %3").arg(azz).arg((uint)ite).arg(ite->itemType());
 			ite->layout();
 		}
-//		RestoreBookMarks();
 		doc->setMasterPageMode(false);
 		/*QTime t;
 		t.start();*/
@@ -3763,8 +3687,6 @@
 		}
 		view->reformPages(false);
 		doc->setLoading(false);
-//		if (fileLoader->fileType() > FORMATID_NATIVEIMPORTEND)
-//			scrActions["fileSave"]->setEnabled(false);
 		delete fileLoader;
 		view->updatesOn(true);
 		w->setUpdatesEnabled(true);
@@ -4123,7 +4045,6 @@
 			return false;
 	//Turn off the warnings once the docs is saved.
 	doc->is12doc=false;
-	//
 	bool ret = false;
 	QString filename;
 	PrefsContext* docContext = m_prefsManager->prefsFile->getContext("docdirs", false);
@@ -4271,7 +4192,6 @@
 		plugin->unsetDoc();
 	}
 	view->close();
-// 	delete view;
 	//CB Yes, we are setting it to NULL without deleting it. ActWin(ScribusWin) owns the view
 	//due to it being the central widget and will delete it at the correct moment from its own pointer.
 	view = NULL;
@@ -4563,9 +4483,7 @@
 	scrActions["editPaste"]->setEnabled(true);
 	scrMenuMgr->setMenuEnabled("EditPasteRecent", scrapbookPalette->tempBView->objectMap.count() != 0);
 	if (activeTransaction)
-	{
 		activeTransaction.commit();
-	}
 }
 
 void ScribusMainWindow::slotEditCopy()
@@ -4589,7 +4507,6 @@
 			StoryText itemText(doc);
 			itemText.setDefaultStyle(cItem->itemText.defaultStyle());
 			itemText.insert(0, cItem->itemText, true);
-//				BufferI = itemText.text(0, itemText.length());
 			std::ostringstream xmlString;
 			SaxXML xmlStream(xmlString);
 			xmlStream.beginDoc();
@@ -4734,7 +4651,6 @@
 			doc->SnapGrid = savedAlignGrid;
 			doc->SnapGuides = savedAlignGuides;
 			doc->SnapElement = savedAlignElement;
-			//int tempList=doc->m_Selection->backupToTempList(0);
 			Selection tempSelection(*doc->m_Selection);
 			doc->m_Selection->clear();
 			if (doc->Items->count() - ac > 1)
@@ -4763,10 +4679,7 @@
 				doc->Items->takeAt(ac);
 			}
 			doc->m_Selection->clear();
-			//doc->m_Selection->restoreFromTempList(0, tempList);
 			*doc->m_Selection=tempSelection;
-//				view->resizeContents(qRound((maxSize.x() - minSize.x()) * view->scale()), qRound((maxSize.y() - minSize.y()) * view->scale()));
-//				view->scrollBy(qRound((doc->minCanvasCoordinate.x() - minSize.x()) * view->scale()), qRound((doc->minCanvasCoordinate.y() - minSize.y()) * view->scale()));
 			doc->minCanvasCoordinate = minSize;
 			doc->maxCanvasCoordinate = maxSize;
 			if (outlinePalette->isVisible())
@@ -4884,7 +4797,6 @@
 			else
 			{
 				QString buffer  = ScMimeData::clipboardScribusElem();
-			//	qDebug()<<buffer;
 				slotElemRead(buffer, doc->currentPage()->xOffset(), doc->currentPage()->yOffset(), false, true, doc, view);
 			}
 			// update style lists:
@@ -5871,7 +5783,6 @@
 	if (!doc->m_Selection->isEmpty())
 	{
 		PageItem *currItem = doc->m_Selection->itemAt(0);
-//			view->MarkClip(currItem, currItem->PoLine, true);
 		nodePalette->EditCont->setEnabled(currItem->ContourLine.size() != 0);
 		nodePalette->ResetCont->setEnabled(false);
 		nodePalette->ResetContClip->setEnabled(false);
@@ -6246,40 +6157,6 @@
 	propertiesPalette->textPal->showFontSize(fs*10);
 }
 
-/*
-//CB-->Doc partly
-void ScribusMainWindow::setItemShade(int id)
-{
-	int c = id;
-	bool ok = false;
-	if (!doc->m_Selection->isEmpty())
-	{
-		PageItem *currItem = doc->m_Selection->itemAt(0);
-		if (c != -1)
-		{
-			if ((currItem->itemType() == PageItem::TextFrame) || (currItem->itemType() == PageItem::PathText))
-				doc->itemSelection_SetFillShade(c);
-			else
-				doc->itemSelection_SetItemBrushShade(c);
-		}
-		else
-		{
-			Query dia(this, "New", 1, tr("&Shade:"), tr("Shade"));
-			if (dia.exec())
-			{
-				c = dia.getEditText().toInt(&ok);
-				if (ok)
-				{
-					if ((currItem->itemType() == PageItem::TextFrame) || (currItem->itemType() == PageItem::PathText))
-						doc->itemSelection_SetFillShade(c);
-					else
-						doc->itemSelection_SetItemBrushShade(c);
-				}
-			}
-		}
-	}
-}
-*/
 //CB-->Doc
 void ScribusMainWindow::setNewAlignment(int a)
 {
@@ -6717,32 +6594,6 @@
 
 int ScribusMainWindow::ShowSubs()
 {
-	bool showGSHelp=false;
-	/*
-	if (!ScCore->haveGS())
-	{
-		ScMessageBox mb(this);
-		QString msg = tr("Ghostscript is not installed on your system, or Scribus is not configured with the path to the software.");
-		QString msg2("<qt>");
-#ifndef _WIN32
-		msg2 += tr("Until this is remedied, you cannot import EPS images or use Print Preview. ")+"\n";
-#else
-		msg2 += tr("Until this is remedied, you cannot import EPS images or use PostScript Print Preview. ")+"\n";
-#endif
-		//msg2 += tr("Please read our <a href=\"http://wiki.scribus.net/index.php/Ghostscript\">help and installation instructions</a>.") + "</qt>";
-		msg2 += tr("Click the Help button to read Scribus-related Ghostscript help and installation instructions.") + "</qt>";
-		ScMessageBox msgBox;
-		msgBox.addButton(QMessageBox::Ok);
-		msgBox.addButton(QMessageBox::Help);
-		msgBox.setIcon(QMessageBox::Warning);
-		msgBox.setWindowTitle( tr("Ghostscript is missing") );
-		msgBox.setText(msg);
-		msgBox.setInformativeText(msg2);
-		int i=msgBox.exec();
-		if (i==QMessageBox::Help)
-			showGSHelp=true;
-	}
-*/
 	propertiesPalette->startup();
 	outlinePalette->startup();
 	scrapbookPalette->startup();
@@ -6750,7 +6601,6 @@
 	downloadsPalette->startup();
 	pagePalette->startup();
 	layerPalette->startup();
-//	measurementPalette->startup();
 	docCheckerPalette->startup();
 	alignDistributePalette->startup();
 	undoPalette->startup();
@@ -6770,14 +6620,7 @@
 
 	activateWindow();
 	if (!scriptIsRunning())
-	{
 		raise();
-		if (showGSHelp)
-		{
-			slotOnlineHelp("", "toolbox5.html");
-			return QMessageBox::Help;
-		}
-	}
 	return 0;
 }
 
@@ -6828,7 +6671,6 @@
 		prefsManager->appPrefs.printPreviewPrefs.PrPr_InkCoverage = dia->EnableInkCover->isChecked();
 		prefsManager->appPrefs.printPreviewPrefs.PrPr_InkThreshold = dia->CoverThresholdValue->value();
 	}
-//		prefsManager->appPrefs.Gcr_Mode = dia->EnableGCR->isChecked();
 	disconnect(dia, SIGNAL(doPrint()), this, SLOT(slotReallyPrint()));
 	previewDinUse = false;
 	delete dia;
@@ -7064,11 +6906,7 @@
 		scrActions["toolsPreflightVerifier"]->setChecked(false);
 		disconnect(docCheckerPalette, SIGNAL(ignoreAllErrors()), this, SLOT(doSaveAsPDF()));
 	}
-/*	if (bookmarkPalette->BView->childCount() == 0)
-		doc->PDF_Options.Bookmarks = false; */
-// reenabling the following line fixes Bug #7630, not sure why this line was commented out.
-// 	doc->reorganiseFonts();
-	QMap<QString, int> ReallyUsed = doc->reorganiseFonts(); //doc->UsedFonts;
+	QMap<QString, int> ReallyUsed = doc->reorganiseFonts();
 	if (doc->pdfOptions().EmbedList.count() != 0)
 	{
 		QList<QString> tmpEm;
@@ -7647,8 +7485,6 @@
 	}
 	view->reformPages();
 	view->DrawNew();
-	//CB done by doc::reformpages
-	//slotDocCh();
 	pagePalette->Rebuild();
 	// #9476 : call setupPage with false arg to setup only guidePalette GUI
 	// Otherwise setupPage() will apply guides to current page, doesn't need that, 
@@ -7980,7 +7816,6 @@
 
 void ScribusMainWindow::ModifyAnnot()
 {
-//	Q_ASSERT(!doc->masterPageMode());
 	if (doc->m_Selection->isEmpty())
 		return;
 
@@ -8162,7 +7997,6 @@
 	}
 	//For each hyphenation file, grab the strings and the hyphenation data.
 	QString lang = QString(QLocale::system().name()).left(2);
-//IL	LangTransl.clear();
 	m_prefsManager->appPrefs.hyphPrefs.Language = "en_GB";
 	if (!LanguageManager::instance()->getHyphFilename(lang).isEmpty() )
 		m_prefsManager->appPrefs.hyphPrefs.Language = lang;
@@ -9951,27 +9785,6 @@
 	m_qqview->deleteLater();
 }
 
-/*
-void ScribusMainWindow::adjustCMS()
-{
-	if (!HaveDoc)
-		return;
-	AdjustCmsDialog* dia = new AdjustCmsDialog(this, doc);
-	if (dia->exec())
-	{
-		dia->tabColorManagement->updateDocSettings(doc);
-		if (dia->tabColorManagement->changed)
-		{
-			doc->enableCMS(doc->cmsSettings().CMSinUse);
-			cmsToolbarButton->setChecked(doc->HasCMS);
-			requestUpdate(reqCmsOptionsUpdate);
-			doc->view()->DrawNew();
-		}
-	}
-	delete dia;
-}
-*/
-
 void ScribusMainWindow::changePreviewQuality(int index)
 {
 	if (!HaveDoc)

Modified: trunk/Scribus/scribus/scribus.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20692&path=/trunk/Scribus/scribus/scribus.h
==============================================================================
--- trunk/Scribus/scribus/scribus.h	(original)
+++ trunk/Scribus/scribus/scribus.h	Sun Jan 17 15:35:39 2016
@@ -447,7 +447,6 @@
 	void slotSelect();
 	/** \brief Switch appMode
 	\param mode TODO learn modes*/
-	//void setAppMode(int mode);
 	void setAppModeByToggle(bool isOn, int newMode);
 	/** \brief Neues Dokument erzeugt */
 	void HaveNewDoc();
@@ -477,7 +476,6 @@
 	void generateTableOfContents();
 	void updateDocument();
 
-//	void saveStyles(StilFormate *dia); //still required for style save from SE
 	void setNewAlignment(int a);
 	void setNewParStyle(const QString& name);
 	void setNewCharStyle(const QString& name);
@@ -569,14 +567,12 @@
 	void testQT_slot2(double);
 	void testQT_slot3(int);
 	void testQT_slot4();
-	//void adjustCMS();
 	void changePreviewQuality(int index);
 	void enablePalettes(bool b);
 	void ToggleFrameEdit();
 	void NoFrameEdit();
 
 signals:
-	//void AppModeChanged(int oldMode, int newMode);
 	void TextStyle(const ParagraphStyle&);
 //deprecated: (av)
 	void TextEffects(int);

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20692&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp	(original)
+++ trunk/Scribus/scribus/scribusdoc.cpp	Sun Jan 17 15:35:39 2016
@@ -918,7 +918,6 @@
 //AV: eeks. That should not be used
 ScribusView* ScribusDoc::view() const
 {
-// 	return (WinHan ? (((ScribusWin*) WinHan)->view()) : 0);
 	return m_View;
 }
 
@@ -1169,8 +1168,6 @@
 		m_docTableStyles[i].getNamedResources(lists);
 	for (int i = 0; i < m_docCellStyles.count(); ++i)
 		m_docCellStyles[i].getNamedResources(lists);
-//	for (uint i = 0; i < docLineStyles.count(); ++i)
-//		docLineStyles[i].getNamedResources(lists);
 	
 	QHash<QString,ScPattern>::ConstIterator it;
 	for (it = docPatterns.begin(); it != docPatterns.end(); ++it)
@@ -1340,12 +1337,6 @@
 void ScribusDoc::replaceNamedResources(ResourceCollection& newNames)
 {
 	// replace names in items
-
-//#ifndef QT_NO_CONCURRENT
-//	QtConcurrent::blockingMap(DocItems, ResMapped(newNames));
-//	QtConcurrent::blockingMap(MasterItems, ResMapped(newNames));
-//#else
-
 	QList<PageItem*> * itemlist = & MasterItems;
 	while (itemlist != NULL)
 	{
@@ -1360,7 +1351,6 @@
 		else
 			itemlist = NULL;
 	}
-//#endif
 	foreach (NotesStyle* nStyle, m_docNotesStylesList)
 	{ //update styles names in notes styles
 		if (nStyle == NULL)
@@ -1472,44 +1462,6 @@
 	ResourceCollection newNames;
 	newNames.mapCharStyles(newNameForOld);
 	replaceNamedResources(newNames);
-	
-	/*
-	// replace style in items
-	QPtrList<PageItem> * itemlist = & MasterItems;
-	while (itemlist != NULL)
-	{
-		for (uint i=0; i < itemlist->count(); ++i)
-		{
-			PageItem_TextFrame * currItem = itemlist->at(i)->asTextFrame();
-			if (currItem)
-				currItem->itemText.replaceCharStyles(newNameForOld);
-		}
-		if (itemlist == &MasterItems)
-			itemlist = &DocItems;
-		else if (itemlist == &DocItems)
-			itemlist = &FrameItems;
-		else
-			itemlist = NULL;
-	}
-	// replace names in styles 
-	for (uint i=0; i < docParagraphStyles.count(); ++i)
-	{
-		// ...parent of parstyle's charstyle
-		const QString& parent(docParagraphStyles[i].charStyle().parent());
-		if (newNameForOld.contains(parent))
-			docParagraphStyles[i].charStyle().setParent(newNameForOld[parent]);
-	}
-	for (int i=docCharStyles.count()-1; i >= 0; --i)
-	{
-		// ...parent of charstyle
-		const QString& parent(docCharStyles[i].parent());
-		if (newNameForOld.contains(parent))
-			docCharStyles[i].setParent(newNameForOld[parent]);
-		// ... as name
-		if (newNameForOld.contains(docCharStyles[i].name()))
-			docCharStyles.remove(i);
-	}
-	*/
 }
 
 void ScribusDoc::replaceTableStyles(const QMap<QString, QString>& newNameForOld)
@@ -1550,7 +1502,6 @@
 		{
 			sty.breakImplicitCharStyleInheritance(true);
 			sty.charStyle().setContext( & m_docCharStyles );
-//			sty.charStyle().setName( "cdocdefault" ); // DON'T TRANSLATE
 		}
 		else {
 			sty.breakImplicitCharStyleInheritance(false);
@@ -1706,8 +1657,6 @@
 		// Sadly StyleSet is not updated at import
 		// and it might break something to do so. 
 		// We need to loop then - pm
-// 		ParagraphStyle* parDefault(wrkStyles->getDefault());
-// 		CharStyle* charDefault(wrkCharStyles->getDefault());
 				
 		QFileInfo fi(fileName);
 		QString importPrefix(tr("Imported ","Prefix of imported default style"));
@@ -2417,10 +2366,6 @@
 	}
 	setMasterPageMode(oldMPMode);
 	setCurrentPage(oldPage);
-//	m_View->reformPages();
-//	m_View->DrawNew();
-//	scMW()->pagePalette->Rebuild();
-//	scMW()->guidePalette->setupPage(false);
 }
 
 void ScribusDoc::restoreGrouping(SimpleState* ss, bool isUndo)
@@ -2486,12 +2431,6 @@
 	PageSpa = ab;
 	m_docPrefsData.docSetupPrefs.pagePositioning = fp;
 	m_automaticTextFrames = atf;
-
-	//CB Moved from scribus.cpp. Overrides the defaults...
-//	PDF_Options.BleedTop = pageMargins.top();
-//	PDF_Options.BleedLeft = pageMargins.left();
-//	PDF_Options.BleedRight = pageMargins.right();
-//	PDF_Options.BleedBottom = pageMargins.bottom();
 }
 
 void ScribusDoc::resetPage(int fp, MarginStruct* newMargins)
@@ -2505,49 +2444,12 @@
 bool ScribusDoc::AddFont(QString name, int fsize)
 {
 	bool ret = false;
-//	FT_Face      face;
-
 	if (UsedFonts.contains(name))
 		return true;
 
 	if (! AllFonts->contains(name) || name == "" )
 		return false;
 
-//	face = (*AllFonts)[name]->ftFace();
-//	if ( !face )
-//		return false;
-
-/*	if ((*AllFonts)[name].ReadMetrics())         FIXME: needed?
-	{
-//		(*AllFonts)[name]->CharWidth[13] = 0;
-//		(*AllFonts)[name]->CharWidth[28] = 0;
-//		(*AllFonts)[name]->CharWidth[26] = 0;
-//		(*AllFonts)[name]->CharWidth[9] = 1;
-		QString afnm = (*AllFonts)[name].fontFilePath().left((*AllFonts)[name].fontFilePath().length()-3);
-		QFile afm(afnm+"afm");
-		if (!(afm.exists()))
-		{
-			afm.setName(afnm+"pfm");
-		}
-		if (!(afm.exists())) {
-			afm.setName(afnm+"AFM");
-		}
-		if (!(afm.exists()))
-		{
-			afm.setName(afnm+"PFM");
-		}
-		if (!(afm.exists()))
-		{
-			afm.setName(afnm+"Afm");
-		}
-		if (!(afm.exists()))
-		{
-			afm.setName(afnm+"Pfm");
-		}
-		if (afm.exists())
-			FT_Attach_File(face, afm.name());
-	}
-	*/
 	UsedFonts[name] = fsize;
 	(*AllFonts)[name].increaseUsage();
 	ret = true;
@@ -2685,22 +2587,17 @@
 	DocPages.insert(pageIndex, addedPage);
 	assert(DocPages.at(pageIndex)!=NULL);
 	setCurrentPage(addedPage);
-	//if (!masterPageMode())
 	if (!masterPageName.isEmpty())
 		applyMasterPage(masterPageName, pageIndex);
 	setLocationBasedPageLRMargins(pageIndex);
 	if (addAutoFrame && m_automaticTextFrames)
 		addAutomaticTextFrame(pageIndex);
-//	if (!isLoading())
-//		changed();
 	return addedPage;
 }
 
 
 ScPage* ScribusDoc::addMasterPage(const int pageNumber, const QString& pageName)
 {
-	//CB We don't create master pages (yet) with a pageCount based location
-	//Page* addedPage = new Page(ScratchLeft, MasterPages.count()*(pageHeight+ScratchBottom+ScratchTop)+ScratchTop, pageWidth, pageHeight);
 	ScPage* addedPage = new ScPage(m_docPrefsData.displayPrefs.scratch.left(), m_docPrefsData.displayPrefs.scratch.top(), m_docPrefsData.docSetupPrefs.pageWidth, m_docPrefsData.docSetupPrefs.pageHeight);
 	assert(addedPage!=NULL);
 	addedPage->setDocument(this);
@@ -2789,20 +2686,6 @@
 		if (MasterItems.at(i)->OwnPage > pageNumber)
 			MasterItems.at(i)->OwnPage--;
 	}
-	// remove the master page from the master page name list
-	//MasterNames.remove(page->PageNam);
-	/*CB TODO moved back to muster.cpp for now as this must happen after reformPages
-	MasterNames.clear();
-	for (uint a = 0; a < Pages->count(); ++a)
-		MasterNames[Pages->at(a)->PageNam] = Pages->at(a)->pageNr();
-	// and fix up any pages that refer to the deleted master page
-	for (Page* docPage = DocPages.first(); docPage; docPage = DocPages.next() )
-	{
-		if (docPage->MPageNam == oldPageName)
-			docPage->MPageNam = CommonStrings::masterPageNormal;
-	}
-	*/
-	//QPtrList docs: The item after the removed item becomes the new current list item if the removed item is not the last item in the list. If the last item is removed, the new last item becomes the current item.
 	changed();
 }
 
@@ -2822,7 +2705,6 @@
 	QListIterator<ScPage *> dpIt(DocPages);
 	ScPage* docPage=NULL;
 	while(dpIt.hasNext())
-	//for (Page* docPage = currentDoc->DocPages.first(); docPage; docPage = currentDoc->DocPages.next() )
 	{
 		docPage=dpIt.next();
 		if (docPage->MPageNam == oldMasterPage)
@@ -4362,12 +4244,8 @@
 
 QMap<QString,int> ScribusDoc::reorganiseFonts()
 {
-//	QTime t;
-//	t.start();
 	QMap<QString,int> Really;
 	QList<PageItem*> allItems;
-	//QMap<QString,QFont> DocF;
-	//DocF = UsedFonts;
 	uint counter = 0;
 	for (uint lc = 0; lc < 2; ++lc)
 	{
@@ -4508,7 +4386,6 @@
 	PrefsManager* prefsManager=PrefsManager::instance();
 	AddFont(prefsManager->appPrefs.itemToolPrefs.textFont);//, prefsManager->appPrefs.AvailFonts[prefsManager->appPrefs.itemToolPrefs.textFont]->Font);
 	AddFont(m_docPrefsData.itemToolPrefs.textFont);//, prefsManager->appPrefs.AvailFonts[itemToolPrefs.textFont]->Font);
-//	qDebug( "Time elapsed: %d ms", t.elapsed() );
 	return Really;
 }
 
@@ -4686,7 +4563,6 @@
 					pageNumberText=SpecialChars::ZWNBSPACE;
 				else if (lc!=0) //If not on a master page just get the page number for the page and the text
 				{
-//					pageNumberText=getSectionPageNumberForPageIndex(it->OwnPage);
 					pageNumberText = QString("%1").arg(getSectionPageNumberForPageIndex(it->OwnPage),
 									getSectionPageNumberWidthForPageIndex(it->OwnPage),
 									getSectionPageNumberFillCharForPageIndex(it->OwnPage));
@@ -4703,7 +4579,6 @@
 					{
 						if (DocPages.at(a)->MPageNam == it->OnMasterPage)
 						{
-//								newText=getSectionPageNumberForPageIndex(a);
 							newText = QString("%1").arg(getSectionPageNumberForPageIndex(a),
 											getSectionPageNumberWidthForPageIndex(a),
 											getSectionPageNumberFillCharForPageIndex(a));
@@ -4894,27 +4769,11 @@
 			m_undoManager->action(this, ss);
 		}
 	}
-
-// 	QString mna = pageName;
-// 	if (mna == CommonStrings::trMasterPageNormal)
-// 		mna = CommonStrings::masterPageNormal;
-// 	if (!MasterNames.contains(mna))
-// 		mna = CommonStrings::masterPageNormal;
 	ScPage* Ap = DocPages.at(pageNumber);
 	Ap->MPageNam = pageName;
 	const int MpNr = MasterNames[pageName];
 	ScPage* Mp = MasterPages.at(MpNr);
 	PageItem *currItem;
-
-// 	for (currItem = Ap->FromMaster.first(); currItem; currItem = Ap->FromMaster.next())
-// 	{
-// 		if (currItem->ChangedMasterItem)
-// 		{
-// 			Ap->FromMaster.remove(currItem);
-// 			delete currItem;
-// 		}
-// 	}
-
 	Ap->FromMaster.clear();
 	for (int itn = 0; itn < MasterItems.count(); ++itn)
 	{
@@ -5250,14 +5109,8 @@
 		}
 	}
 
-//#ifndef QT_NO_CONCURRENT
-//	QtConcurrent::blockingMap(DocItems, &ScribusDoc::recalculateColorItem);
-//	QtConcurrent::blockingMap(MasterItems, &ScribusDoc::recalculateColorItem);
-//#else
-
 	recalculateColorsList(&DocItems);
 	recalculateColorsList(&MasterItems);
-//#endif
 	QList<PageItem*> itemList = FrameItems.values();
 	recalculateColorsList(&itemList);
 	QList<PageItem*> allItems;
@@ -5370,14 +5223,6 @@
 		docPatterns[patterns[c]].pattern = ite->DrawObj_toImage(qMin(qMax(maxx - minx, maxy - miny), 500.0));
 	}
 }
-
-
-//void ScribusDoc::setScTextDefaultsFromDoc(ScText *sctextdata)
-//{
-//	if (sctextdata==NULL)
-//		return;
-//	reinterpret_cast<CharStyle&>(*sctextdata) = currentStyle.charStyle();
-//}
 
 bool ScribusDoc::copyPageToMasterPage(const int pageNumber, const int leftPage, const int maxLeftPage,  const QString& masterPageName, bool copyFromAppliedMaster)
 {
@@ -5799,8 +5644,6 @@
 			break;
 		case PageItem::NoteFrame:
 		case PageItem::TextFrame:
-//			newItem->setFontFillShade(itemToolPrefs.textShade);
-//			newItem->setFontStrokeShade(itemToolPrefs.textStrokeShade);
 			newItem->setFillColor(m_docPrefsData.itemToolPrefs.textFillColor);
 			newItem->setFillShade(m_docPrefsData.itemToolPrefs.textFillColorShade);
 			newItem->setLineColor(m_docPrefsData.itemToolPrefs.textLineColor);
@@ -5840,7 +5683,6 @@
 		newItem->SetRectFrame();
 		//TODO one day hopefully, if (ScCore->usingGUI())
 		newItem->setRedrawBounding();
-		//m_View->setRedrawBounding(newItem);
 		newItem->ContourLine = newItem->PoLine.copy();
 	}
 
@@ -5849,7 +5691,6 @@
 		newItem->SetOvalFrame();
 		//TODO one day hopefully, if (ScCore->usingGUI())
 		newItem->setRedrawBounding();
-		//m_View->setRedrawBounding(newItem);
 		newItem->ContourLine = newItem->PoLine.copy();
 	}
 
@@ -6326,7 +6167,6 @@
 			page->setYOffset(currentYPos);
 			if (counter < pageSets()[m_docPrefsData.docSetupPrefs.pagePositioning].Columns-1)
 			{
-//				currentXPos += Seite->width() + pageSets[currentPageLayout].GapHorizontal;
 				currentXPos += page->width() + m_docPrefsData.displayPrefs.pageGapHorizontal;
 				lastYPos = qMax(lastYPos, page->height());
 				if (counter == 0)
@@ -6345,11 +6185,8 @@
 				currentXPos = m_docPrefsData.displayPrefs.scratch.left();
 				if (pageSets()[m_docPrefsData.docSetupPrefs.pagePositioning].Columns > 1)
 					currentYPos += qMax(lastYPos, page->height())+m_docPrefsData.displayPrefs.pageGapVertical;
-//					currentYPos += qMax(lastYPos, Seite->height())+pageSets[currentPageLayout].GapVertical;
 				else
 					currentYPos += page->height()+m_docPrefsData.displayPrefs.pageGapVertical;
-//					currentYPos += Seite->height()+pageSets[currentPageLayout].GapVertical;
-//				lastYPos = qMax(lastYPos, Seite->height());
 				lastYPos = 0;
 				page->Margins.setRight(page->initialMargins.right());
 				page->Margins.setLeft(page->initialMargins.left());
@@ -6360,11 +6197,7 @@
 				counter = 0;
 				rowcounter++;
 				if (rowcounter > pageSets()[m_docPrefsData.docSetupPrefs.pagePositioning].Rows-1)
-				{
-//					currentYPos += GapVertical;
-//					currentYPos += pageSets[currentPageLayout].GapBelow;
 					rowcounter = 0;
-				}
 			}
 		}
 		page->Margins.setTop(page->initialMargins.top());
@@ -6522,14 +6355,8 @@
 	if (currItem == NULL)
 		return NULL;
 	//Don't attempt a Line conversion
-//	if (currItem->itemType()==PageItem::Line || newType==PageItem::Line)
 	if (newType==PageItem::Line)
 		return NULL;
-	//Take the item to convert from the docs Items list
-//	PageItem *oldItem = Items->take(currItem->ItemNr);
-	// Don't use take as we will insert the new item later at the same position
-	// PageItem *oldItem = Items->at(Items->indexOf(currItem));
-	// wtf ?? why not simply
 	PageItem *oldItem = currItem;
 	uint oldItemNr;
 	if (currItem->isGroupChild())
@@ -6601,7 +6428,6 @@
 				polyLineItem->ClipEdited = true;
 				polyLineItem->FrameType = 3;
 				polyLineItem->setRotation(currItem->rotation());
-//				polyLineItem->setPolyClip(qRound(qMax(polyLineItem->lineWidth() / 2, 1)));
 				AdjustItemSize(polyLineItem);
 
 				newItem->setLineColor(CommonStrings::None);
@@ -6655,11 +6481,8 @@
 				newItem->PLineArt = secondaryItem->PLineArt;
 				newItem->PLineEnd = secondaryItem->PLineEnd;
 				newItem->PLineJoin = secondaryItem->PLineJoin;
-				/*	if (!Doc->loading)
-					emit UpdtObj(Doc->currentPage->pageNr(), b->ItemNr); */
 				//FIXME: Stop using the view here
 				AdjustItemSize(newItem);
-//				newItem->updatePolyClip();
 				double dx = secondaryItem->xPos() - newItem->xPos();
 				double dy = secondaryItem->yPos() - newItem->yPos();
 				MoveItem(dx, dy, newItem);
@@ -6671,12 +6494,6 @@
 			newItem=NULL;
 			break;
 	}
-	//Append the new item to the docs items list
-	//Items->append(newItem);
-	//We could append and renumber the list, or, we can insert at the same position..
-	//for (uint a = 0; a < Items->count(); ++a)
-	//	Items->at(a)->ItemNr = a;
-//	Items->insert(oldItem->ItemNr, newItem);
 	newItem->uniqueNr = oldItem->uniqueNr;
 	if (oldItem->isGroupChild())
 	{
@@ -7454,62 +7271,6 @@
 		pageToAdjust->Margins.setLeft(pageToAdjust->initialMargins.left());
 		pageToAdjust->Margins.setRight(pageToAdjust->initialMargins.left());
 	}
-	/* Can also calc the X pos of the frame too, and Y pos, but thats not done yet
-	int myRow=(pageIndex+pageSets[currentPageLayout].FirstPage)/setcol;
-	double xOffset=ScratchLeft;
-	double yOffset=ScratchTop;
-	if (myRow==0)
-	{
-		if (pageIndex==0)
-		{
-			for (int i=0; i<myCol; ++i)
-				xOffset+=pageWidth+pageSets[currentPageLayout].GapHorizontal;
-		}
-		else
-		{
-			xOffset=DocPages.at(0)->xOffset();
-			for (int i=0; i<pageIndex; ++i)
-				xOffset+=DocPages.at(i)->width()+pageSets[currentPageLayout].GapHorizontal;
-		}
-	}
-	if (myRow>0)
-	{
-		int firstPageOnRow=pageIndex-myCol;
-		for (int i=firstPageOnRow; i<pageIndex; ++i)
-			xOffset+=DocPages.at(i)->width()+pageSets[currentPageLayout].GapHorizontal;
-	}
-	pageToAdjust->setXOffset(xOffset);
-
-
-	if (myRow!=0)
-	{
-		for (int i=0;i<myRow;++i)
-		{
-			double maxHeightOfRow=0.0;
-			yOffset+=DocPages.at(i)->width()+pageSets[currentPageLayout].GapHorizontal;
-		}
-
-		if (pageIndex==0)
-		{
-			for (int i=0; i<myCol; ++i)
-				xOffset+=pageWidth+pageSets[currentPageLayout].GapHorizontal;
-		}
-		else
-		{
-			xOffset=DocPages.at(0)->xOffset();
-			for (int i=0; i<pageIndex; ++i)
-				xOffset+=DocPages.at(i)->width()+pageSets[currentPageLayout].GapHorizontal;
-		}
-	}
-	if (myRow>0)
-	{
-		int firstPageOnRow=pageIndex-myCol;
-	int setcol=pageSets[currentPageLayout].Columns;
-		for (int i=firstPageOnRow; i<pageIndex; ++i)
-			xOffset+=DocPages.at(i)->width()+pageSets[currentPageLayout].GapHorizontal;
-	}
-	pageToAdjust->setXOffset(xOffset);
-	*/
 }
 
 
@@ -7530,7 +7291,6 @@
 	return ((pageIndex % setcol) + pageSets()[m_docPrefsData.docSetupPrefs.pagePositioning].FirstPage) % setcol;
 }
 
-//CB Moved from view
 void ScribusDoc::RecalcPictures(ProfilesL *Pr, ProfilesL *PrCMYK, QProgressBar *dia)
 {
 	RecalcPictures(&MasterItems, Pr, PrCMYK, dia);
@@ -9074,53 +8834,6 @@
 	CharStyle newStyle;
 	newStyle.setFeatures(static_cast<StyleFlag>(s).featureList());
 	itemSelection_ApplyCharStyle(newStyle, customSelection, "EFFECTS");
-	return;
-	
-	/*uint selectedItemCount=m_Selection->count();
-	if (selectedItemCount != 0 && s != ScStyle_None)
-	{
-		UndoTransaction activeTransaction;
-		m_updateManager.setUpdatesDisabled();
-		if (selectedItemCount > 1)
-			activeTransaction = undoManager->beginTransaction(Um::SelectionGroup, Um::IGroup, Um::SetFontEffect, "", Um::IFont);
-		for (uint aa = 0; aa < selectedItemCount; ++aa)
-		{
-			PageItem *currItem = m_Selection->itemAt(aa);
-//			if (appMode != modeEdit)
-//				currItem->setFontEffects(s);
-			if (currItem->itemText.length() != 0)
-			{
-				if ((appMode == modeEdit) || (appMode == modeEditTable))
-				{
-					for (int a = 0; a < currItem->itemText.length(); ++a)
-					{
-						if (currItem->itemText.selected(a))
-						{
-							StyleFlag fl = currItem->itemText.item(a)->effects();
-							fl &= static_cast<StyleFlag>(~1919); // 0x11101111111
-							fl |= static_cast<StyleFlag>(s & 1919);
-							currItem->itemText.item(a)->setFeatures(fl.featureList());
-						}
-					}
-				}
-				else
-				{
-					for (int a = 0; a < currItem->itemText.length(); ++a)
-					{
-						StyleFlag fl = currItem->itemText.item(a)->effects();
-						fl &= static_cast<StyleFlag>(~1919); // 1024+512+256+64+32+16+8+4+2+1
-						fl |= static_cast<StyleFlag>(s & 1919);
-						currItem->itemText.item(a)->setFeatures(fl.featureList());
-					}
-				}
-				currItem->update();
-			}
-		}
-		if (activeTransaction)
-			activeTransaction.commit();
-		m_updateManager.setUpdatesEnabled();
-		changed();
-	}*/
 }
 
 void ScribusDoc::itemSelection_SetOpticalMargins(int i, Selection* customSelection)
@@ -9181,30 +8894,9 @@
 
 void ScribusDoc::itemSelection_SetFontSize(int size, Selection* customSelection)
 {
-	//if (true || ((appMode == modeEdit) || (appMode == modeEditTable)))
-	//{
-		CharStyle newStyle;
-		newStyle.setFontSize(size);
-		itemSelection_ApplyCharStyle(newStyle, customSelection, "FONT_SIZE");
-	/*}
-	else
-	{
-		ParagraphStyle storyStyle;
-		storyStyle.charStyle().setFontSize(size);
-		if (storyStyle.lineSpacingMode() == ParagraphStyle::AutomaticLineSpacing)
-		{
-			storyStyle.setLineSpacing((size / 10.0) * (static_cast<double>(m_docPrefsData.typoPrefs.autoLineSpacing) / 100));
-		}
-		else if (storyStyle.lineSpacingMode() == ParagraphStyle::FixedLineSpacing)
-		{
-			storyStyle.setLineSpacing(storyStyle.charStyle().font().height(size));
-		}
-		else
-		{
-			storyStyle.setLineSpacing(m_docPrefsData.guidesPrefs.valueBaselineGrid-1);
-		}
-		itemSelection_ApplyParagraphStyle(storyStyle, customSelection);
-	}*/
+	CharStyle newStyle;
+	newStyle.setFontSize(size);
+	itemSelection_ApplyCharStyle(newStyle, customSelection, "FONT_SIZE");
 }
 
 void ScribusDoc::itemSelection_ToggleBookMark(Selection *customSelection)
@@ -9308,8 +9000,6 @@
 	for (uint aa = 0; aa < selectedItemCount; ++aa)
 	{
 		PageItem *currItem = itemSelection->itemAt(aa);
-//		int currItemTextCount = currItem->lastInFrame() + 1 - currItem->firstInFrame();
-//		if (currItemTextCount > 0 && ( appMode == modeEdit || !FRAMESELECTION_EDITS_DEFAULTSTYLE))
 		int currItemTextCount = currItem->itemText.length();
 		if ((currItemTextCount > 0) && ((appMode == modeEdit) || (appMode == modeEditTable)))
 		{
@@ -9363,8 +9053,6 @@
 	for (uint aa = 0; aa < selectedItemCount; ++aa)
 	{
 		PageItem *currItem = itemSelection->itemAt(aa);
-//		int currItemTextCount = currItem->lastInFrame() + 1 - currItem->firstInFrame();
-//		if (currItemTextCount > 0 && ( appMode == modeEdit || !FRAMESELECTION_EDITS_DEFAULTSTYLE))
 		int currItemTextCount = currItem->itemText.length();
 		if ((currItemTextCount > 0) && ((appMode == modeEdit) || (appMode == modeEditTable)))
 		{
@@ -9623,8 +9311,6 @@
 		PageItem *currItem = itemSelection->itemAt(aa);
 		if (currItem->isTable() && appMode == modeEditTable)
 			currItem = currItem->asTable()->activeCell().textFrame();
-//		int currItemTextCount = currItem->lastInFrame() + 1 - currItem->firstInFrame();
-//		if (currItemTextCount > 0 && ( appMode == modeEdit || !FRAMESELECTION_EDITS_DEFAULTSTYLE))
 		int currItemTextCount = currItem->itemText.length();
 		if ((currItemTextCount > 0) && ((appMode == modeEdit) || (appMode == modeEditTable)))
 		{
@@ -9640,7 +9326,6 @@
 				else
 				{
 					start = qMax(currItem->firstInFrame(), currItem->itemText.cursorPosition());
-//9876					length = (start + 1) < currItem->itemText.length() ? 1 : 0;
 					length = start < currItem->itemText.length() ? 1 : 0;
 				}
 			}
@@ -9718,7 +9403,6 @@
 				}
 			}
 			currItem->itemText.setDefaultStyle(dstyle);
-//			if (currItem->asPathText())
 			currItem->itemText.applyCharStyle(0, currItem->itemText.length(), newStyle);
 			currItem->invalid = true;
 			if (currItem->isNoteFrame())
@@ -9768,7 +9452,6 @@
 				else
 				{
 					start = qMax(currItem->firstInFrame(), currItem->itemText.cursorPosition());
-//9876					length = (start + 1) < currItem->itemText.length()? 1 : 0;
 					length = start < currItem->itemText.length() ? 1 : 0;
 				}
 			}
@@ -9803,7 +9486,6 @@
 				m_undoManager->action(currItem, ist);
 			}
 			currItem->itemText.setDefaultStyle(dstyle);
-//			if (currItem->asPathText())
 			currItem->itemText.setCharStyle(0, currItem->itemText.length(), newStyle);
 			if (currItem->isNoteFrame())
 				setNotesChanged(true);
@@ -9835,8 +9517,6 @@
 	for (uint aa = 0; aa < selectedItemCount; ++aa)
 	{
 		PageItem *currItem = itemSelection->itemAt(aa);
-//		int currItemTextCount = currItem->lastInFrame() + 1 - currItem->firstInFrame();
-//		if (currItemTextCount > 0 && ( appMode == modeEdit || !FRAMESELECTION_EDITS_DEFAULTSTYLE))
 		int currItemTextCount = currItem->itemText.length();
 		if ((currItemTextCount > 0) && ((appMode == modeEdit) || (appMode == modeEditTable)))
 		{
@@ -9852,7 +9532,6 @@
 				else
 				{
 					start = qMax(currItem->firstInFrame(), currItem->itemText.cursorPosition());
-//9876					length = (start + 1) < currItem->itemText.length()? 1 : 0;
 					length = start < currItem->itemText.length() ? 1 : 0;
 				}
 			}
@@ -9930,75 +9609,6 @@
 	regionsChanged()->update(QRectF());
 }
 
-
-
-/*
-template<typename Arg, void (PageItem::*Fun)(Arg)>
-void ScribusDoc::itemSelection_forall(Arg newVal)
-{
-	uint docSelectionCount=m_Selection->count();
-	if (docSelectionCount != 0)
-	{
-		if (docSelectionCount > 1)
-			undoManager->beginTransaction(Um::SelectionGroup, Um::IGroup, Um::ApplyTextStyle,
-										  newStyle.asString(), Um::IFont);
-		for (uint aa = 0; aa < docSelectionCount; ++aa)
-		{
-			PageItem *currItem = m_Selection->itemAt(aa);
-			currItem->Fun(newVal);
-		}
-	}
-	if (docSelectionCount > 1)
-		undoManager->commit();
-	emit updateContents();
-}
-*/
-
-
-
-
-/* CB Don't delete, backups
-void ScribusDoc::FlipImageH()
-{
-	uint docSelectionCount=m_Selection->count();
-	if (docSelectionCount != 0)
-	{
-		if (docSelectionCount > 1)
-			undoManager->beginTransaction(Um::SelectionGroup, Um::IGroup,
-										  Um::FlipH, 0, Um::IFlipH);
-		for (uint a = 0; a < docSelectionCount; ++a)
-		{
-			m_Selection->itemAt(a)->flipImageH();
-			emit refreshItem(m_Selection->itemAt(a));
-		}
-		changed();
-		if (docSelectionCount > 1)
-			undoManager->commit();
-	}
-}
-
-void ScribusDoc::FlipImageV()
-{
-	uint docSelectionCount=m_Selection->count();
-	if (docSelectionCount != 0)
-	{
-		if (docSelectionCount > 1)
-			undoManager->beginTransaction(Um::SelectionGroup, Um::IGroup,
-										  Um::FlipV, 0, Um::IFlipV);
-		for (uint a = 0; a < docSelectionCount; ++a)
-		{
-			m_Selection->itemAt(a)->flipImageV();
-			emit refreshItem(m_Selection->itemAt(a));
-		}
-		changed();
-		if (docSelectionCount > 1)
-			undoManager->commit();
-	}
-}
-
-*/
-
-
 //AV -> NodeEditContext
 //CB removed looping, called by itemSelection_FlipH
 void ScribusDoc::MirrorPolyH(PageItem* currItem)
@@ -10164,34 +9774,12 @@
 		newMinX = qMin(minCanvasCoordinate.x(), minPos.x());
 		newMinY = qMin(minCanvasCoordinate.y(), minPos.y());
 	}
-	/*<< CB: comment out as avox is falling asleep and this is b0rken
-	// try to limit expansion of canvas to reasonable area:
-	
-	int columns = pageSets[currentPageLayout].Columns;
-	int rows = 1 + DocPages.count() / columns;
-	newMinX = qMax(newMinX, -pageWidth);
-	newMinY = qMax(newMinY, -pageHeight);
-	newMaxX = qMin(newMaxX, (bleeds.Left + pageWidth + bleeds.Right) * columns + pageWidth + scratch.Left + scratch.Right + GapHorizontal*(columns-1) );
-	newMaxY = qMin(newMaxY, (bleeds.Top + pageHeight + bleeds.Bottom) * columns + pageHeight + scratch.Top + scratch.Bottom + GapVertical*(rows-1));
-	>>*/
 	if ((newMaxX != maxCanvasCoordinate.x()) || (newMaxY != maxCanvasCoordinate.y())
 	|| (newMinX != minCanvasCoordinate.x()) || (newMinY != minCanvasCoordinate.y()))
 	{
-//		//Save the old values for the emit, but update now to ensure we are all ready
-//		double oldMinX=minCanvasCoordinate.x();
-//		double oldMinY=minCanvasCoordinate.y();
 		maxCanvasCoordinate = FPoint(newMaxX, newMaxY);
 		minCanvasCoordinate = FPoint(newMinX, newMinY);
 		regionsChanged()->update(QRectF());
-
-		//CB TODO Make a list of views we belong to and make this the doc's active view via an internal*
-//		if (ScCore->usingGUI()) 
-//		{
-//			// Why using a signal here ? much slower than a direct call
-//			emit canvasAdjusted(newMaxX - newMinX, newMaxY - newMinY, oldMinX - newMinX, oldMinY - newMinY);
-//FIXME: stop using m_View
-//			m_View->adjustCanvas(newMaxX - newMinX, newMaxY - newMinY, oldMinX - newMinX, oldMinY - newMinY);
-//		}
 	}
 }
 
@@ -10511,14 +10099,6 @@
 	m_ScMW->mainWindowProgressBar->reset();
 	QList<PageItem*> allItems;
 	QStringList patterns = docPatterns.keys();
-
-//#ifndef QT_NO_CONCURRENT
-//	int lowRes = 0;
-//	if (applyNewRes)
-//		lowRes = docPrefsData.itemToolPrefs.imageLowResType;
-//	QtConcurrent::blockingMap(DocItems, PicResMapped(applyNewRes, lowRes));
-//	QtConcurrent::blockingMap(MasterItems, PicResMapped(applyNewRes, lowRes));
-//#else
 	int cc = 0;
 	for (int a = 0; a < DocItems.count(); ++a)
 	{
@@ -10653,7 +10233,7 @@
 		}
 		allItems.clear();
 	}
-//#endif
+
 	for (QHash<int, PageItem*>::iterator it = FrameItems.begin(); it != FrameItems.end(); ++it)
 	{
 		PageItem *currItem = it.value();
@@ -11257,9 +10837,7 @@
 				currItem->ContourLine.map(comulatedMatrix);
 				currItem->ContourLine.map(matrixAft);
 				currItem->ContourLine.translate(-deltaX, -deltaY);
-//				currItem->Frame = false;
 				currItem->ClipEdited = true;
-//				currItem->FrameType = 3;
 				m_undoManager->setUndoEnabled(false);
 				AdjustItemSize(currItem);
 				m_undoManager->setUndoEnabled(true);
@@ -11283,7 +10861,6 @@
 		m_Selection->connectItemToGUI();
 	}
 	m_updateManager.setUpdatesEnabled();
-	//view()->DrawNew();
 	regionsChanged()->update(QRectF());
 	changed();
 }
@@ -11926,18 +11503,13 @@
 	regionsChanged()->update(QRectF());
 	if (m_View)
 		m_View->setCursor(QCursor(Qt::ArrowCursor));
-	//CB FIXME remove this and tree.h too
-//	m_ScMW->outlinePalette->BuildTree();
 
 	if (itemSelection->isGUISelection() && !itemSelection->signalsDelayed())
 	{
 		if (itemSelection->count() == 0)
 			emit firstSelectedItemType(-1);
 		else
-		{
-			//emit HaveSel();
 			itemSelection->itemAt(0)->emitAllToGUI();
-		}
 	}
 	changed();
 }
@@ -12076,11 +11648,8 @@
 		currItem->setStrokeGradient(newGradient);
 		currItem->update();
 	}
-	/*if (selectedItemCount>1)
-		regionsChanged()->update(QRectF());*/
 	m_updateManager.setUpdatesEnabled();
 	changed();
-//Teaser for jghali
 }
 
 void ScribusDoc::itemSelection_SetFillGradient(VGradient& newGradient, Selection* customSelection)
@@ -12212,10 +11781,6 @@
 									 Um::ILayerAction);
 		}
 	}
-
-	//CB why not just the following as we are calling for updatecontents anyway and we arent reflowing text
-	//Doc->m_Selection->clear();
-	//FIXME: stop using m_View
 	m_View->Deselect(true);
 	regionsChanged()->update(QRectF());
 	changed();
@@ -14706,9 +14271,6 @@
 		double my = ma.m12() * currItem->width() + ma.dy();
 		MoveItem(newX.x(), newX.y(), currItem);
 		double newRot=xy2Deg(mx - currItem->xPos(), my - currItem->yPos());
-		//CB Hmm should work, doesnt. (constraining on the first point of a line) FIXME
-		//if (constrainRotation)
-		//	qDebug() << QString("%1").arg(constrainAngle(newRot)));
 		currItem->setRotation(newRot);
 		currItem->setWidthHeight(sqrt(pow(mx - currItem->xPos(),2)+pow(my - currItem->yPos(),2)), 1.0);
 		currItem->updateClip();
@@ -14719,7 +14281,6 @@
 			regionsChanged()->update(oldR);
 			regionsChanged()->update(newR);
 		}
-//		updateContents(newR.unite(oldR));
 	}
 	else
 	{
@@ -14841,10 +14402,7 @@
 	double gx, gy, gw, gh;
 	itemSelection->setGroupRect();
 	itemSelection->getGroupRect(&gx, &gy, &gw, &gh);
-	//QPoint in(qRound(gx*Scale), qRound(gy*Scale));
-	//in -= QPoint(qRound(Doc->minCanvasCoordinate.x() * Scale), qRound(Doc->minCanvasCoordinate.y() * Scale));
-	//QPoint out = in;//contentsToViewport(in);
-	QRectF OldRect = QRectF(gx, gy, gw, gh); //out.x(), out.y(), qRound(gw*Scale), qRound(gh*Scale));
+	QRectF OldRect = QRectF(gx, gy, gw, gh);
 	QList<PageItem*> weldL;
 	for (uint a = 0; a < selectedItemCount; ++a)
 	{
@@ -14865,7 +14423,6 @@
 		GroupOnPage(currItem);
 	}
 	QPoint in2(qRound(gx*Scale), qRound(gy*Scale));
-	//in2 -= QPoint(qRound(Doc->minCanvasCoordinate.x() * Scale), qRound(Doc->minCanvasCoordinate.y() * Scale));
 	OldRect = OldRect.united(QRectF(in2.x()/*+contentsX()*/, in2.y()/*+contentsY()*/, qRound(gw*Scale), qRound(gh*Scale))); //FIXME:av
 	regionsChanged()->update(OldRect.adjusted(-10, -10, 20, 20));
 }
@@ -14904,8 +14461,6 @@
 	ma.translate(RCenter.x(), RCenter.y());
 	ma.scale(1, 1);
 	ma.rotate(angle);
-//	gxS -= minCanvasCoordinate.x();
-//	gyS -= minCanvasCoordinate.y();
 	QRect oldR = QRect(static_cast<int>(gxS*sc-5), static_cast<int>(gyS*sc-5), static_cast<int>(gwS*sc+10), static_cast<int>(ghS*sc+10));
 	FPoint n;
 	for (int a = 0; a < itemSelection->count(); ++a)
@@ -14920,8 +14475,6 @@
 	GroupOnPage(currItem);
 	itemSelection->setGroupRect();
 	itemSelection->getGroupRect(&gxS, &gyS, &gwS, &ghS);
-//	gxS -= minCanvasCoordinate.x();
-//	gyS -= minCanvasCoordinate.y();
 	regionsChanged()->update(QRectF(gxS-5, gyS-5, gwS+10, ghS+10).united(oldR));
 }
 
@@ -14940,8 +14493,6 @@
 	int drm = m_rotMode;
 	m_rotMode = 0;
 	itemSelection->getGroupRect(&gx, &gy, &gw, &gh);
-//	gx -= minCanvasCoordinate.x();
-//	gy -= minCanvasCoordinate.y();
 	QRect oldR = QRect(static_cast<int>(gx*sc-5), static_cast<int>(gy*sc-5), static_cast<int>(gw*sc+10), static_cast<int>(gh*sc+10));
 	itemSelection->getGroupRect(&gx, &gy, &gw, &gh);
 	double origGW = gw;
@@ -15080,10 +14631,8 @@
 		}
 		if (scaleText)
 		{
-//			bb->setFontSize(qMax(qRound(bb->fontSize()*((scx+scy)/2)), 1));
 			if (bb->itemText.length() != 0)
 			{
-//				bb->setLineSpacing(((bb->fontSize() / 10.0) * static_cast<double>(Doc->typographicSettings.autoLineSpacing) / 100));
 				for (aa = 0; aa < bb->itemText.length(); ++aa)
 				{
 					CharStyle fsStyle;
@@ -15145,8 +14694,6 @@
 			break;
 		}
 	}
-//	gx -= minCanvasCoordinate.x();
-//	gy -= minCanvasCoordinate.y();
 	updateManager()->setUpdatesEnabled();
 	regionsChanged()->update(QRectF(gx-5, gy-5, gw+10, gh+10).united(oldR));
 	itemSelection->setGroupRect();
@@ -15356,8 +14903,6 @@
 		{
 			currItem = selectedItems.at(c);
 			currItem->setLocked(lock);
-			//if (m_ScMW && ScCore->usingGUI())
-			//	m_ScMW->scrActions["itemLock"]->setChecked(lock);
 			if (selectedItemCount <= Um::ItemsInvolvedLimit)
 				tooltip += "\t" + currItem->getUName() + "\n";
 		}
@@ -15510,16 +15055,6 @@
 	if (activeTransaction)
 		activeTransaction.commit();
 
-/*		QMap<int, QList<PageItem*> >::iterator groupIt;
-	for (it = toDelete.begin(); it != toDelete.end(); ++it)
-	{
-//			PageItem* groupItem = it.key();
-		int groupId = it.value();
-		groupIt = groupObjects.find(groupId);
-		if (groupIt == groupObjects.end()) 
-			continue;
-		QList<PageItem*> groupItems = groupIt.value();
-	}*/
 	double x, y, w, h;
 	itemSelection->connectItemToGUI();
 	itemSelection->getGroupRect(&x, &y, &w, &h);
@@ -15832,7 +15367,6 @@
 			currItem->PoLine.setMarker();
 			currItem->PoLine.putPoints(currItem->PoLine.size(), bb->PoLine.size(), bb->PoLine);
 		}
-//		currItem->Clip = FlattenPath(currItem->PoLine, currItem->Segments);
 		AdjustItemSize(currItem);
 		currItem->ContourLine = currItem->PoLine.copy();
 		m_undoManager->setUndoEnabled(true);
@@ -16492,8 +16026,6 @@
 			m_ScMW->mainWindowProgressBar->reset();
 		}
 	}
-//	PrefsManager* prefsManager=PrefsManager::instance();
-
 	QStringList uf(UsedFonts.keys());
 	QMap<QString,int>::Iterator it3;
 	UsedFonts.clear();
@@ -16501,9 +16033,6 @@
 	QStringList::Iterator it3aend=uf.end();
 	for (it3a = uf.begin(); it3a != it3aend; ++it3a)
 		AddFont(*it3a);
-
-//	currDoc->documentInfo = docInfos->getDocInfo();
-//	currDoc->sections = tabDocSections->getNewSections();
 
 	uint itemCount=Items->count();
 	for (uint b=0; b<itemCount; ++b)
@@ -17118,11 +16647,6 @@
 							{
 								BulNumMark* bnMark = new BulNumMark;
 								item->itemText.insertMark(bnMark,pos);
-//								hl = item->itemText.item(pos);
-//								hl->applyCharStyle(item->itemText.paragraphStyle(pos).charStyle());
-//								hl->setEffects(ScStyle_Default);
-//								const StyleContext* cStyleContext = item->itemText.paragraphStyle(pos).charStyleContext();
-//								hl->setContext(cStyleContext);
 								CharStyle emptyCS;
 								item->itemText.setCharStyle(pos, 1, emptyCS);
 							}
@@ -17202,7 +16726,6 @@
 
 TextNote *ScribusDoc::newNote(NotesStyle* NS)
 {
-//	if (newNote == NULL)
 	TextNote* newNote = new TextNote(NS);
 	m_docNotesList.append(newNote);
 	setNotesChanged(true);

Modified: trunk/Scribus/scribus/scribusdoc.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20692&path=/trunk/Scribus/scribus/scribusdoc.h
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.h	(original)
+++ trunk/Scribus/scribus/scribusdoc.h	Sun Jan 17 15:35:39 2016
@@ -752,10 +752,6 @@
 	static void recalculateColorItem(PageItem *item);
 	void recalculateColors();
 	/**
-	 * @brief Sets up the ScText defaults from the document
-	 */
-	//void setScTextDefaultsFromDoc(ScText *);
-	/**
 	 * @brief Copies a normal page to be a master pages
 	 */
 	bool copyPageToMasterPage(const int, const int, const int, const QString&, bool);
@@ -828,11 +824,6 @@
 	bool usesAutomaticTextFrames() const;
 	void setUsesAutomaticTextFrames(const bool);
 	
-	/**
-	 * @brief Load images into an image frame, moved from the view
-	 * @retval Return false on failure
-	 */
-//	bool LoadPict(QString fn, int ItNr, bool reload = false, bool showMsg = false);
 	/**
 	 * 
 	 * @param fn 




More information about the scribus-commit mailing list