r17317 by fschmid - Removed code for creating the old table frames, as its no longer needed anymore.
scribus-commit
scribus-commit at lists.scribus.net
Sun Feb 19 20:55:52 UTC 2012
Author: fschmid
Date: Sun Feb 19 20:55:51 2012
New Revision: 17317
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17317
Log:
Removed code for creating the old table frames, as its no longer needed anymore.
Modified:
trunk/Scribus/scribus/actionmanager.cpp
trunk/Scribus/scribus/canvasmode.cpp
trunk/Scribus/scribus/canvasmode_create.cpp
trunk/Scribus/scribus/canvasmode_drawcalligraphic.cpp
trunk/Scribus/scribus/canvasmode_drawfreehand.cpp
trunk/Scribus/scribus/canvasmode_framelinks.cpp
trunk/Scribus/scribus/canvasmode_magnifier.cpp
trunk/Scribus/scribus/scribus.cpp
trunk/Scribus/scribus/scribusstructs.h
trunk/Scribus/scribus/ui/modetoolbar.cpp
Modified: trunk/Scribus/scribus/actionmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17317&path=/trunk/Scribus/scribus/actionmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/actionmanager.cpp (original)
+++ trunk/Scribus/scribus/actionmanager.cpp Sun Feb 19 20:55:51 2012
@@ -732,8 +732,6 @@
scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/insert-image.png"), loadIcon("22/insert-image.png"), "", defaultKey(name), mainWindow, modeDrawImage));
name="toolsInsertRenderFrame";
scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/insert-renderframe.png"), loadIcon("22/insert-renderframe.png"), "", defaultKey(name), mainWindow, modeDrawLatex));
- name="toolsInsertTableFrame";
- scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/insert-table.png"), loadIcon("22/insert-table.png"), "", defaultKey(name), mainWindow, modeDrawTable));
name="toolsInsertTable";
scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/insert-table.png"), loadIcon("22/insert-table.png"), "", defaultKey(name), mainWindow, modeDrawTable2));
name="toolsInsertShape";
@@ -818,7 +816,7 @@
(*scrActions)["toolsToolbarTools"]->setToggleAction(true);
(*scrActions)["toolsToolbarPDF"]->setToggleAction(true);
- *modeActionNames << "toolsSelect" << "toolsInsertTextFrame" << "toolsInsertImageFrame" << "toolsInsertTableFrame" << "toolsInsertTable";
+ *modeActionNames << "toolsSelect" << "toolsInsertTextFrame" << "toolsInsertImageFrame" << "toolsInsertTable";
*modeActionNames << "toolsInsertShape" << "toolsInsertPolygon" << "toolsInsertArc" << "toolsInsertSpiral" << "toolsInsertLine" << "toolsInsertBezier";
*modeActionNames << "toolsInsertFreehandLine" << "toolsInsertCalligraphicLine" << "toolsInsertRenderFrame" << "toolsRotate" << "toolsZoom" << "toolsEditContents";
*modeActionNames << "toolsEditWithStoryEditor" << "toolsLinkTextFrame" << "toolsUnlinkTextFrame";
@@ -1555,8 +1553,7 @@
(*scrActions)["toolsInsertTextFrame"]->setText( tr("Insert &Text Frame"));
(*scrActions)["toolsInsertImageFrame"]->setText( tr("Insert &Image Frame"));
(*scrActions)["toolsInsertRenderFrame"]->setText( tr("Insert &Render Frame"));
- (*scrActions)["toolsInsertTableFrame"]->setText( tr("Insert T&able"));
- (*scrActions)["toolsInsertTable"]->setText( tr("Insert Table 2"));
+ (*scrActions)["toolsInsertTable"]->setText( tr("Insert T&able"));
(*scrActions)["toolsInsertShape"]->setText( tr("Insert &Shape"));
(*scrActions)["toolsInsertPolygon"]->setText( tr("Insert &Polygon"));
(*scrActions)["toolsInsertArc"]->setText( tr("Insert Arc"));
@@ -1728,7 +1725,7 @@
defKeys.insert("toolsSelect", Qt::Key_C);
defKeys.insert("toolsInsertTextFrame", QKeySequence(Qt::Key_T));
defKeys.insert("toolsInsertImageFrame", Qt::Key_I);
- defKeys.insert("toolsInsertTableFrame", Qt::Key_A);
+ defKeys.insert("toolsInsertTable", Qt::Key_A);
defKeys.insert("toolsInsertShape", Qt::Key_S);
defKeys.insert("toolsInsertPolygon", Qt::Key_P);
defKeys.insert("toolsInsertLine", Qt::Key_L);
@@ -1965,7 +1962,6 @@
<< "insertFrame"
<< "toolsInsertTextFrame"
<< "toolsInsertImageFrame"
- << "toolsInsertTableFrame"
<< "toolsInsertTable"
<< "toolsInsertShape"
<< "toolsInsertPolygon"
Modified: trunk/Scribus/scribus/canvasmode.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17317&path=/trunk/Scribus/scribus/canvasmode.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode.cpp (original)
+++ trunk/Scribus/scribus/canvasmode.cpp Sun Feb 19 20:55:51 2012
@@ -150,7 +150,6 @@
case modeDrawImage:
case modeDrawLatex:
case modeDrawText:
- case modeDrawTable:
case modeDrawTable2:
case modeDrawRegularPolygon:
case modeDrawArc:
@@ -688,9 +687,6 @@
break;
case modeDrawText:
qApp->changeOverrideCursor(QCursor(loadIcon("DrawTextFrame.xpm")));
- break;
- case modeDrawTable:
- qApp->changeOverrideCursor(QCursor(loadIcon("DrawTable.xpm")));
break;
case modeDrawTable2:
qApp->changeOverrideCursor(QCursor(loadIcon("DrawTable.xpm")));
Modified: trunk/Scribus/scribus/canvasmode_create.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17317&path=/trunk/Scribus/scribus/canvasmode_create.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_create.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_create.cpp Sun Feb 19 20:55:51 2012
@@ -371,9 +371,6 @@
switch (m_doc->appMode)
{
- case modeDrawTable:
- m_view->Deselect(false);
- break;
case modeDrawTable2:
m_view->Deselect(false);
break;
@@ -555,10 +552,6 @@
itemType = (int) PageItem::TextFrame;
frameType = (int) PageItem::Unspecified;
break;
- case modeDrawTable:
- itemType = (int) PageItem::TextFrame;
- frameType = (int) PageItem::Unspecified;
- break;
case modeDrawTable2:
itemType = (int) PageItem::Table;
frameType = (int) PageItem::Unspecified;
@@ -580,7 +573,7 @@
double wSize = canvasCurrCoord.x() - createObjectPos.x();
double hSize = canvasCurrCoord.y() - createObjectPos.y();
bool skipOneClick = (modifiers == Qt::ShiftModifier);
- if ((createObjectMode == modeDrawLine) || (createObjectMode == modeDrawTable) || (createObjectMode == modeDrawTable2) ||
+ if ((createObjectMode == modeDrawLine) || (createObjectMode == modeDrawTable2) ||
(createObjectMode == modeInsertPDFButton) || (createObjectMode == modeInsertPDFTextfield) ||
(createObjectMode == modeInsertPDFTextfield) || (createObjectMode == modeInsertPDFCheckbox) ||
(createObjectMode == modeInsertPDFCombobox) || (createObjectMode == modeInsertPDFListbox) ||
@@ -734,116 +727,6 @@
currItem->annotation().setAction("0 0");
currItem->setTextFlowMode(PageItem::TextFlowDisabled);
break;
- }
- break;
- case modeDrawTable:
- /*m_view->Deselect(false);
- Rxp = mousePointDoc.x();
- Ryp = mousePointDoc.y();
- npf = m_doc->ApplyGridF(FPoint(Rxp, Ryp));
- Rxp = npf.x();
- Ryp = npf.y();
- m_doc->ApplyGuides(&Rxp, &Ryp);
- canvasPressCoord.setXY(qRound(Rxp), qRound(Ryp));
- canvasCurrCoord = canvasPressCoord;
- mouseGlobalCoord.setXY(m->globalPos().x(), m->globalPos().y());
- m_view->redrawMarker->setGeometry(m->globalPos().x(), m->globalPos().y(), 1, 1);
- m_view->redrawMarker->show();*/
-
- if ((m_doc->m_Selection->count() == 0) && (m_view->HaveSelRect) && (!m_view->MidButt))
- {
- UndoTransaction * activeTransaction = NULL;
- m_view->HaveSelRect = false;
- double Tx, Ty, Tw, Th;
- FPoint np2 = m_doc->ApplyGridF(canvasPressCoord);
- Tx = np2.x();
- Ty = np2.y();
- m_doc->ApplyGuides(&Tx, &Ty);
- canvasPressCoord.setXY(qRound(Tx), qRound(Ty));
- np2 = m_doc->ApplyGridF(canvasCurrCoord);
- Tw = np2.x();
- Th = np2.y();
- m_doc->ApplyGuides(&Tw, &Th);
- canvasCurrCoord.setXY(qRound(Tw), qRound(Th));
- Tw = Tw - Tx;
- Th = Th - Ty;
- int Cols, Rows;
- double deltaX, deltaY, offX, offY;
- if ((Th < 6) || (Tw < 6))
- {
- m_view->requestMode(submodePaintingDone);
- break;
- }
- qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
- InsertTable *dia = new InsertTable(m_view, static_cast<int>(Th / 6), static_cast<int>(Tw / 6));
- if (!dia->exec())
- {
- m_view->requestMode(submodePaintingDone);
- delete dia;
- dia = NULL;
- break;
- }
- Cols = dia->Cols->value();
- Rows = dia->Rows->value();
- delete dia;
- dia=NULL;
- deltaX = Tw / Cols;
- deltaY = Th / Rows;
- offX = 0.0;
- offY = 0.0;
- m_doc->m_Selection->clear();
- if (UndoManager::undoEnabled())
- activeTransaction = new UndoTransaction(Um::instance()->beginTransaction(m_doc->currentPage()->getUName(),
- Um::ITable, Um::CreateTable,
- QString(Um::RowsCols).arg(Rows).arg(Cols),
- Um::ICreate));
- m_doc->m_Selection->delaySignalsOn();
- for (int rc = 0; rc < Rows; ++rc)
- {
- for (int cc = 0; cc < Cols; ++cc)
- {
- z = m_doc->itemAdd(PageItem::TextFrame, PageItem::Unspecified, Tx + offX, Ty + offY, deltaX, deltaY, m_doc->itemToolPrefs().shapeLineWidth, CommonStrings::None, m_doc->itemToolPrefs().textColor, true);
- currItem = m_doc->Items->at(z);
- currItem->isTableItem = true;
- currItem->setTextFlowMode(PageItem::TextFlowUsesBoundingBox);
- m_doc->m_Selection->addItem(currItem);
- offX += deltaX;
- }
- offY += deltaY;
- offX = 0.0;
- }
- for (int rc = 0; rc < Rows; ++rc)
- {
- for (int cc = 0; cc < Cols; ++cc)
- {
- currItem = m_doc->m_Selection->itemAt((rc * Cols) + cc);
- if (rc == 0)
- currItem->TopLink = 0;
- else
- currItem->TopLink = m_doc->m_Selection->itemAt(((rc-1)*Cols)+cc);
- if (rc == Rows-1)
- currItem->BottomLink = 0;
- else
- currItem->BottomLink = m_doc->m_Selection->itemAt(((rc+1)*Cols)+cc);
- if (cc == 0)
- currItem->LeftLink = 0;
- else
- currItem->LeftLink = m_doc->m_Selection->itemAt((rc*Cols)+cc-1);
- if (cc == Cols-1)
- currItem->RightLink = 0;
- else
- currItem->RightLink = m_doc->m_Selection->itemAt((rc*Cols)+cc+1);
- }
- }
- m_doc->itemSelection_GroupObjects(false, false);
- z = m_doc->Items->count() - 1;
- if (activeTransaction)
- {
- activeTransaction->commit();
- delete activeTransaction;
- activeTransaction = NULL;
- }
- m_doc->m_Selection->delaySignalsOff();
}
break;
case modeDrawTable2:
Modified: trunk/Scribus/scribus/canvasmode_drawcalligraphic.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17317&path=/trunk/Scribus/scribus/canvasmode_drawcalligraphic.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_drawcalligraphic.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_drawcalligraphic.cpp Sun Feb 19 20:55:51 2012
@@ -173,7 +173,7 @@
newY = qRound(mousePointDoc.y()); //m_view->translateToDoc(m->x(), m->y()).y());
SeRx = newX;
SeRy = newY;
- QPoint startP = m_canvas->canvasToGlobal(m_doc->appMode == modeDrawTable || m_doc->appMode == modeDrawTable2 ? QPointF(Dxp, Dyp) : QPointF(Mxp, Myp));
+ QPoint startP = m_canvas->canvasToGlobal(m_doc->appMode == modeDrawTable2 ? QPointF(Dxp, Dyp) : QPointF(Mxp, Myp));
m_view->redrawMarker->setGeometry(QRect(startP, m->globalPos()).normalized());
if (!m_view->redrawMarker->isVisible())
m_view->redrawMarker->show();
Modified: trunk/Scribus/scribus/canvasmode_drawfreehand.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17317&path=/trunk/Scribus/scribus/canvasmode_drawfreehand.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_drawfreehand.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_drawfreehand.cpp Sun Feb 19 20:55:51 2012
@@ -161,7 +161,7 @@
newY = qRound(mousePointDoc.y()); //m_view->translateToDoc(m->x(), m->y()).y());
SeRx = newX;
SeRy = newY;
- QPoint startP = m_canvas->canvasToGlobal(m_doc->appMode == modeDrawTable || m_doc->appMode == modeDrawTable2 ? QPointF(Dxp, Dyp) : QPointF(Mxp, Myp));
+ QPoint startP = m_canvas->canvasToGlobal(m_doc->appMode == modeDrawTable2 ? QPointF(Dxp, Dyp) : QPointF(Mxp, Myp));
m_view->redrawMarker->setGeometry(QRect(startP, m->globalPos()).normalized());
if (!m_view->redrawMarker->isVisible())
m_view->redrawMarker->show();
Modified: trunk/Scribus/scribus/canvasmode_framelinks.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17317&path=/trunk/Scribus/scribus/canvasmode_framelinks.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_framelinks.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_framelinks.cpp Sun Feb 19 20:55:51 2012
@@ -132,7 +132,7 @@
/*
m_view->redrawMarker->setGeometry(QRect(Mxp, Myp, m->globalPos().x() - Mxp, m->globalPos().y() - Myp).normalized());
*/
- QPoint startP = m_canvas->canvasToGlobal(m_doc->appMode == modeDrawTable || m_doc->appMode == modeDrawTable2 ? QPointF(Dxp, Dyp) : QPointF(Mxp, Myp));
+ QPoint startP = m_canvas->canvasToGlobal(m_doc->appMode == modeDrawTable2 ? QPointF(Dxp, Dyp) : QPointF(Mxp, Myp));
m_view->redrawMarker->setGeometry(QRect(startP, m->globalPos()).normalized());
if (!m_view->redrawMarker->isVisible())
m_view->redrawMarker->show();
Modified: trunk/Scribus/scribus/canvasmode_magnifier.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17317&path=/trunk/Scribus/scribus/canvasmode_magnifier.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_magnifier.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_magnifier.cpp Sun Feb 19 20:55:51 2012
@@ -131,7 +131,7 @@
/*
m_view->redrawMarker->setGeometry(QRect(Mxp, Myp, m->globalPos().x() - Mxp, m->globalPos().y() - Myp).normalized());
*/
- QPoint startP = m_canvas->canvasToGlobal(m_doc->appMode == modeDrawTable || m_doc->appMode == modeDrawTable2 ? QPointF(Dxp, Dyp) : QPointF(Mxp, Myp));
+ QPoint startP = m_canvas->canvasToGlobal(m_doc->appMode == modeDrawTable2 ? QPointF(Dxp, Dyp) : QPointF(Mxp, Myp));
m_view->redrawMarker->setGeometry(QRect(startP, m->globalPos()).normalized());
if (!m_view->redrawMarker->isVisible())
m_view->redrawMarker->show();
Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17317&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Sun Feb 19 20:55:51 2012
@@ -844,7 +844,6 @@
scrMenuMgr->addMenuItem(scrActions["toolsInsertTextFrame"], "Insert", false);
scrMenuMgr->addMenuItem(scrActions["toolsInsertImageFrame"], "Insert", false);
scrMenuMgr->addMenuItem(scrActions["toolsInsertRenderFrame"], "Insert", false);
- scrMenuMgr->addMenuItem(scrActions["toolsInsertTableFrame"], "Insert", false);
scrMenuMgr->addMenuItem(scrActions["toolsInsertTable"], "Insert", false);
scrMenuMgr->addMenuItem(scrActions["toolsInsertShape"], "Insert", false);
scrMenuMgr->addMenuItem(scrActions["toolsInsertPolygon"], "Insert", false);
@@ -2423,7 +2422,6 @@
scrActions["toolsZoom"]->setEnabled(true);
scrActions["toolsInsertTextFrame"]->setEnabled(true);
scrActions["toolsInsertImageFrame"]->setEnabled(true);
- scrActions["toolsInsertTableFrame"]->setEnabled(true);
scrActions["toolsInsertTable"]->setEnabled(true);
scrActions["toolsInsertShape"]->setEnabled(true);
scrActions["toolsInsertLine"]->setEnabled(true);
@@ -4640,7 +4638,6 @@
scrActions["toolsZoom"]->setEnabled(false);
scrActions["toolsInsertTextFrame"]->setEnabled(false);
scrActions["toolsInsertImageFrame"]->setEnabled(false);
- scrActions["toolsInsertTableFrame"]->setEnabled(false);
scrActions["toolsInsertShape"]->setEnabled(false);
scrActions["toolsInsertLine"]->setEnabled(false);
scrActions["toolsInsertBezier"]->setEnabled(false);
@@ -6134,7 +6131,6 @@
scrActions["toolsZoom"]->setEnabled(false);
scrActions["toolsInsertTextFrame"]->setEnabled(false);
scrActions["toolsInsertImageFrame"]->setEnabled(false);
- scrActions["toolsInsertTableFrame"]->setEnabled(false);
scrActions["toolsInsertTable"]->setEnabled(false);
scrActions["toolsInsertShape"]->setEnabled(false);
scrActions["toolsInsertLine"]->setEnabled(false);
@@ -6218,7 +6214,6 @@
scrActions["toolsZoom"]->setEnabled(true);
scrActions["toolsInsertTextFrame"]->setEnabled(true);
scrActions["toolsInsertImageFrame"]->setEnabled(true);
- scrActions["toolsInsertTableFrame"]->setEnabled(true);
scrActions["toolsInsertTable"]->setEnabled(true);
scrActions["toolsInsertShape"]->setEnabled(true);
scrActions["toolsInsertLine"]->setEnabled(true);
@@ -6314,7 +6309,6 @@
scrActions["toolsSelect"]->setChecked(mode==modeNormal);
scrActions["toolsInsertTextFrame"]->setChecked(mode==modeDrawText);
scrActions["toolsInsertImageFrame"]->setChecked(mode==modeDrawImage);
- scrActions["toolsInsertTableFrame"]->setChecked(mode==modeDrawTable);
scrActions["toolsInsertTable"]->setChecked(mode==modeDrawTable2);
scrActions["toolsInsertShape"]->setChecked(mode==modeDrawShapes);
scrActions["toolsInsertPolygon"]->setChecked(mode==modeDrawRegularPolygon);
@@ -6514,11 +6508,6 @@
if (docSelectionCount!=0)
view->Deselect(true);
qApp->changeOverrideCursor(QCursor(loadIcon("DrawTextFrame.xpm")));
- break;
- case modeDrawTable:
- if (docSelectionCount!=0)
- view->Deselect(true);
- qApp->changeOverrideCursor(QCursor(loadIcon("DrawTable.xpm")));
break;
case modeDrawTable2:
if (docSelectionCount!=0)
@@ -9003,7 +8992,6 @@
scrActions["toolsSelect"]->setEnabled(setter);
scrActions["toolsInsertTextFrame"]->setEnabled(setter);
scrActions["toolsInsertImageFrame"]->setEnabled(setter);
- scrActions["toolsInsertTableFrame"]->setEnabled(setter);
scrActions["toolsInsertTable"]->setEnabled(setter);
scrActions["toolsInsertShape"]->setEnabled(setter);
scrActions["toolsInsertLine"]->setEnabled(setter);
Modified: trunk/Scribus/scribus/scribusstructs.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17317&path=/trunk/Scribus/scribus/scribusstructs.h
==============================================================================
--- trunk/Scribus/scribus/scribusstructs.h (original)
+++ trunk/Scribus/scribus/scribusstructs.h Sun Feb 19 20:55:51 2012
@@ -301,7 +301,7 @@
modeInsertPDFTextAnnotation,
modeInsertPDFLinkAnnotation,
modeDrawFreehandLine,
- modeDrawTable,
+ modeDrawTable, // Now deprecated as new tables are working now.
modeDrawTable2, // Temporary name for new tables.
modePanning,
modeMeasurementTool,
Modified: trunk/Scribus/scribus/ui/modetoolbar.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17317&path=/trunk/Scribus/scribus/ui/modetoolbar.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/modetoolbar.cpp (original)
+++ trunk/Scribus/scribus/ui/modetoolbar.cpp Sun Feb 19 20:55:51 2012
@@ -50,7 +50,6 @@
this->addAction(m_ScMW->scrActions["toolsInsertTextFrame"]);
this->addAction(m_ScMW->scrActions["toolsInsertImageFrame"]);
this->addAction(m_ScMW->scrActions["toolsInsertRenderFrame"]);
- this->addAction(m_ScMW->scrActions["toolsInsertTableFrame"]);
this->addAction(m_ScMW->scrActions["toolsInsertTable"]);
this->addAction(m_ScMW->scrActions["toolsInsertShape"]);
More information about the scribus-commit
mailing list