r18326 by jghali - #11586: refactoring ScribusDoc* data members to m_Doc, first part
scribus-commit
scribus-commit at lists.scribus.net
Mon Jun 17 23:03:51 UTC 2013
Author: jghali
Date: Mon Jun 17 23:03:50 2013
New Revision: 18326
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18326
Log:
#11586: refactoring ScribusDoc* data members to m_Doc, first part
Modified:
trunk/Scribus/scribus/plugins/picbrowser/picturebrowser.cpp
trunk/Scribus/scribus/plugins/picbrowser/picturebrowser.h
trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortion.cpp
trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortion.h
trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.cpp
trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.h
trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinderdialog.cpp
trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinderdialog.h
trunk/Scribus/scribus/tocgenerator.cpp
trunk/Scribus/scribus/tocgenerator.h
trunk/Scribus/scribus/ui/hruler.cpp
trunk/Scribus/scribus/ui/hruler.h
trunk/Scribus/scribus/ui/inlinepalette.cpp
trunk/Scribus/scribus/ui/inlinepalette.h
trunk/Scribus/scribus/ui/javadocs.cpp
trunk/Scribus/scribus/ui/javadocs.h
trunk/Scribus/scribus/ui/masterpagepalette.cpp
trunk/Scribus/scribus/ui/masterpagepalette.h
trunk/Scribus/scribus/ui/pagepalette.cpp
trunk/Scribus/scribus/ui/pagepalette_masterpages.cpp
trunk/Scribus/scribus/ui/pagepalette_masterpages.h
trunk/Scribus/scribus/ui/pdfopts.cpp
trunk/Scribus/scribus/ui/pdfopts.h
trunk/Scribus/scribus/ui/smlinestyle.cpp
trunk/Scribus/scribus/ui/smlinestyle.h
trunk/Scribus/scribus/ui/smtextstyles.cpp
trunk/Scribus/scribus/ui/smtextstyles.h
trunk/Scribus/scribus/ui/stylemanager.cpp
trunk/Scribus/scribus/ui/vruler.cpp
trunk/Scribus/scribus/ui/vruler.h
Modified: trunk/Scribus/scribus/plugins/picbrowser/picturebrowser.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18326&path=/trunk/Scribus/scribus/plugins/picbrowser/picturebrowser.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/picbrowser/picturebrowser.cpp (original)
+++ trunk/Scribus/scribus/plugins/picbrowser/picturebrowser.cpp Mon Jun 17 23:03:50 2013
@@ -29,8 +29,8 @@
setupUi ( this );
//set Scribusdoc
- srcDoc = doc;
- ScMW = doc->scMW();
+ m_Doc = doc;
+ m_ScMW = doc->scMW();
//load settings
pbSettings.load();
@@ -174,7 +174,7 @@
insertPagesCombobox->addItem ( "Current Page", 1 );
insertPagesCombobox->addItem ( "All Pages", 0 );
- for ( int i = 0 ; i < ( int ) ( srcDoc->Pages->count() ) ; ++i )
+ for ( int i = 0 ; i < ( int ) ( m_Doc->Pages->count() ) ; ++i )
{
insertPagesCombobox->addItem ( QString ( "Page %1" ).arg ( i+1 ), 0 );
}
@@ -185,9 +185,9 @@
PageItem *pItem;
QList<PageItem*> allItems;
- for (int a = 0; a < srcDoc->MasterItems.count(); ++a)
- {
- PageItem *currItem = srcDoc->MasterItems.at(a);
+ for (int a = 0; a < m_Doc->MasterItems.count(); ++a)
+ {
+ PageItem *currItem = m_Doc->MasterItems.at(a);
if (currItem->isGroup())
allItems = currItem->getItemList();
else
@@ -207,9 +207,9 @@
}
allItems.clear();
}
- for (int a = 0; a < srcDoc->Items->count(); ++a)
- {
- PageItem *currItem = srcDoc->Items->at(a);
+ for (int a = 0; a < m_Doc->Items->count(); ++a)
+ {
+ PageItem *currItem = m_Doc->Items->at(a);
if (currItem->isGroup())
allItems = currItem->getItemList();
else
@@ -317,7 +317,7 @@
if ( row >= 0 )
{
- ScribusDoc *currentDoc ( ScMW->doc );
+ ScribusDoc *currentDoc ( m_ScMW->doc );
Imagedialog *id ( new Imagedialog ( pImages->previewImagesList.at ( row )->fileInformation.absoluteFilePath(), currentDoc ,this ) );
if ( id )
@@ -434,7 +434,7 @@
iafData.linkToExistingFrame = false;
iafData.linkToExistingFramePtr=NULL;
- tmpImage->insertIntoDocument ( srcDoc, iafData );
+ tmpImage->insertIntoDocument ( m_Doc, iafData );
}
else if ( index == 1 )
{
@@ -608,9 +608,9 @@
QStringList imageFiles;
int id = item->data ( 0, Qt::UserRole ).toInt();
QList<PageItem*> allItems;
- for (int a = 0; a < srcDoc->MasterItems.count(); ++a)
- {
- PageItem *currItem = srcDoc->MasterItems.at(a);
+ for (int a = 0; a < m_Doc->MasterItems.count(); ++a)
+ {
+ PageItem *currItem = m_Doc->MasterItems.at(a);
if (currItem->isGroup())
allItems = currItem->getItemList();
else
@@ -628,9 +628,9 @@
}
allItems.clear();
}
- for (int a = 0; a < srcDoc->Items->count(); ++a)
- {
- PageItem *currItem = srcDoc->Items->at(a);
+ for (int a = 0; a < m_Doc->Items->count(); ++a)
+ {
+ PageItem *currItem = m_Doc->Items->at(a);
if (currItem->isGroup())
allItems = currItem->getItemList();
else
@@ -941,7 +941,7 @@
//current page has been selected
if ( insertPagesCombobox->checkstate ( 0 ) == 1 )
{
- int currPage = srcDoc->currentPageNumber() + 1;
+ int currPage = m_Doc->currentPageNumber() + 1;
//prevent double insert, only add current page to pagelist if the page isn't selected yet
if ( insertPagesCombobox->checkstate ( currPage + 1 ) == 0 )
@@ -983,7 +983,7 @@
iafData.linkToExistingFrame = false;
iafData.linkToExistingFramePtr=NULL;
- tmpImage->insertIntoDocument ( srcDoc, iafData );
+ tmpImage->insertIntoDocument ( m_Doc, iafData );
}
@@ -1652,7 +1652,7 @@
void PictureBrowser::changedDocument ( ScribusDoc* doc )
{
- srcDoc = doc;
+ m_Doc = doc;
updateDocumentbrowser();
actionsGoButton->setEnabled ( true );
insertImageButton->setEnabled ( true );
@@ -1662,7 +1662,7 @@
{
documentWidget->clear();
documentItems.clear();
- srcDoc = NULL;
+ m_Doc = NULL;
pImages->clearPreviewImagesList();
updateBrowser ( false, false, false );
actionsGoButton->setEnabled ( false );
@@ -1680,7 +1680,7 @@
QTreeWidgetItem *tmpItem;
- for ( int i = 0 ; i < ( int ) ( srcDoc->Pages->count() ) ; ++i )
+ for ( int i = 0 ; i < ( int ) ( m_Doc->Pages->count() ) ; ++i )
{
tmpItem = new QTreeWidgetItem ( allpages, QStringList ( QString ( "Page %1" ).arg ( i+1 ) ) );
tmpItem->setData ( 0, Qt::UserRole, ( i+1 ) );
Modified: trunk/Scribus/scribus/plugins/picbrowser/picturebrowser.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18326&path=/trunk/Scribus/scribus/plugins/picbrowser/picturebrowser.h
==============================================================================
--- trunk/Scribus/scribus/plugins/picbrowser/picturebrowser.h (original)
+++ trunk/Scribus/scribus/plugins/picbrowser/picturebrowser.h Mon Jun 17 23:03:50 2013
@@ -213,9 +213,10 @@
void updateTagImagesTab();
//current document
- ScribusDoc* srcDoc;
+ ScribusDoc* m_Doc;
// Main window
- ScribusMainWindow* ScMW;
+ ScribusMainWindow* m_ScMW;
+
//the dirmodel for the folderbrowser
QDirModel folderModel;
//model for QListView containing the previewimages
Modified: trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortion.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18326&path=/trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortion.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortion.cpp (original)
+++ trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortion.cpp Mon Jun 17 23:03:50 2013
@@ -112,18 +112,18 @@
bool MeshDistortionPlugin::run(ScribusDoc* doc, QString)
{
- currDoc = doc;
- if (currDoc == 0)
- currDoc = ScCore->primaryMainWindow()->doc;
- if (currDoc->m_Selection->count() > 0)
+ m_doc = doc;
+ if (m_doc == 0)
+ m_doc = ScCore->primaryMainWindow()->doc;
+ if (m_doc->m_Selection->count() > 0)
{
- patternItem = currDoc->m_Selection->itemAt(0);
- MeshDistortionDialog *dia = new MeshDistortionDialog(currDoc->scMW(), currDoc);
+ m_patternItem = m_doc->m_Selection->itemAt(0);
+ MeshDistortionDialog *dia = new MeshDistortionDialog(m_doc->scMW(), m_doc);
if (dia->exec())
{
dia->updateAndExit();
- currDoc->changed();
- currDoc->view()->DrawNew();
+ m_doc->changed();
+ m_doc->view()->DrawNew();
}
delete dia;
}
Modified: trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortion.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18326&path=/trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortion.h
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortion.h (original)
+++ trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortion.h Mon Jun 17 23:03:50 2013
@@ -49,8 +49,10 @@
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
virtual void addToMainWindowMenu(ScribusMainWindow *) {};
- PageItem *patternItem;
- ScribusDoc* currDoc;
+
+ private:
+ PageItem *m_patternItem;
+ ScribusDoc* m_doc;
};
extern "C" PLUGIN_API int meshdistortion_getPluginAPIVersion();
Modified: trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18326&path=/trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.cpp (original)
+++ trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.cpp Mon Jun 17 23:03:50 2013
@@ -112,19 +112,19 @@
bool PathConnectPlugin::run(ScribusDoc* doc, QString)
{
- currDoc = doc;
+ m_doc = doc;
firstUpdate = true;
- if (currDoc == 0)
- currDoc = ScCore->primaryMainWindow()->doc;
- if (currDoc->m_Selection->count() > 1)
- {
- Item1 = currDoc->m_Selection->itemAt(0);
- Item2 = currDoc->m_Selection->itemAt(1);
- originalPath1 = Item1->PoLine.copy();
- originalPath2 = Item2->PoLine.copy();
- originalXPos = Item1->xPos();
- originalYPos = Item1->yPos();
- PathConnectDialog *dia = new PathConnectDialog(currDoc->scMW());
+ if (m_doc == 0)
+ m_doc = ScCore->primaryMainWindow()->doc;
+ if (m_doc->m_Selection->count() > 1)
+ {
+ m_item1 = m_doc->m_Selection->itemAt(0);
+ m_item2 = m_doc->m_Selection->itemAt(1);
+ originalPath1 = m_item1->PoLine.copy();
+ originalPath2 = m_item2->PoLine.copy();
+ originalXPos = m_item1->xPos();
+ originalYPos = m_item1->yPos();
+ PathConnectDialog *dia = new PathConnectDialog(m_doc->scMW());
connect(dia, SIGNAL(updateValues(int, int, int, int)), this, SLOT(updateEffect(int, int, int, int)));
if (dia->exec())
{
@@ -135,28 +135,28 @@
if(UndoManager::undoEnabled())
trans = new UndoTransaction(UndoManager::instance()->beginTransaction(Um::BezierCurve,Um::ILine,Um::ConnectPath,"",Um::ILine));
- Item1->PoLine = computePath(pointOne, pointTwo, mode, originalPath1, originalPath2);
- Item1->ClipEdited = true;
- Item1->FrameType = 3;
- currDoc->AdjustItemSize(Item1);
- Item1->OldB2 = Item1->width();
- Item1->OldH2 = Item1->height();
+ m_item1->PoLine = computePath(pointOne, pointTwo, mode, originalPath1, originalPath2);
+ m_item1->ClipEdited = true;
+ m_item1->FrameType = 3;
+ m_doc->AdjustItemSize(m_item1);
+ m_item1->OldB2 = m_item1->width();
+ m_item1->OldH2 = m_item1->height();
if(UndoManager::undoEnabled())
{
ScItemState<QPair<FPointArray,FPointArray> > *is = new ScItemState<QPair<FPointArray,FPointArray> >(Um::ConnectPath);
is->set("CONNECT_PATH","connect_path");
is->set("OLDX",originalXPos);
is->set("OLDY",originalYPos);
- is->set("NEWX",Item1->xPos());
- is->set("NEWY",Item1->yPos());
- is->setItem(qMakePair(originalPath1,Item1->PoLine));
- UndoManager::instance()->action(Item1,is);
- }
- Item1->updateClip();
- Item1->ContourLine = Item1->PoLine.copy();
- currDoc->m_Selection->removeItem(Item1);
- currDoc->itemSelection_DeleteItem();
- currDoc->changed();
+ is->set("NEWX",m_item1->xPos());
+ is->set("NEWY",m_item1->yPos());
+ is->setItem(qMakePair(originalPath1, m_item1->PoLine));
+ UndoManager::instance()->action(m_item1,is);
+ }
+ m_item1->updateClip();
+ m_item1->ContourLine = m_item1->PoLine.copy();
+ m_doc->m_Selection->removeItem(m_item1);
+ m_doc->itemSelection_DeleteItem();
+ m_doc->changed();
if(trans)
{
trans->commit();
@@ -166,17 +166,17 @@
}
else
{
- Item1->PoLine = originalPath1.copy();
- Item1->ClipEdited = true;
- Item1->FrameType = 3;
- Item1->setXYPos(originalXPos, originalYPos);
- currDoc->AdjustItemSize(Item1);
- Item1->OldB2 = Item1->width();
- Item1->OldH2 = Item1->height();
- Item1->updateClip();
- Item1->ContourLine = Item1->PoLine.copy();
- }
- currDoc->view()->DrawNew();
+ m_item1->PoLine = originalPath1.copy();
+ m_item1->ClipEdited = true;
+ m_item1->FrameType = 3;
+ m_item1->setXYPos(originalXPos, originalYPos);
+ m_doc->AdjustItemSize(m_item1);
+ m_item1->OldB2 = m_item1->width();
+ m_item1->OldH2 = m_item1->height();
+ m_item1->updateClip();
+ m_item1->ContourLine = m_item1->PoLine.copy();
+ }
+ m_doc->view()->DrawNew();
delete dia;
}
return true;
@@ -186,30 +186,30 @@
{
if (effectType == -1)
{
- Item1->PoLine = originalPath1.copy();
- Item1->ClipEdited = true;
- Item1->FrameType = 3;
- Item1->setXYPos(originalXPos, originalYPos);
+ m_item1->PoLine = originalPath1.copy();
+ m_item1->ClipEdited = true;
+ m_item1->FrameType = 3;
+ m_item1->setXYPos(originalXPos, originalYPos);
firstUpdate = true;
}
else
{
- Item1->setXYPos(originalXPos, originalYPos);
- Item1->PoLine = computePath(pointOne, pointTwo, mode, originalPath1, originalPath2);
- Item1->ClipEdited = true;
- Item1->FrameType = 3;
- }
- currDoc->AdjustItemSize(Item1);
- Item1->OldB2 = Item1->width();
- Item1->OldH2 = Item1->height();
- Item1->updateClip();
+ m_item1->setXYPos(originalXPos, originalYPos);
+ m_item1->PoLine = computePath(pointOne, pointTwo, mode, originalPath1, originalPath2);
+ m_item1->ClipEdited = true;
+ m_item1->FrameType = 3;
+ }
+ m_doc->AdjustItemSize(m_item1);
+ m_item1->OldB2 = m_item1->width();
+ m_item1->OldH2 = m_item1->height();
+ m_item1->updateClip();
if (firstUpdate)
- currDoc->view()->DrawNew();
+ m_doc->view()->DrawNew();
else
{
- QRectF oldR(Item1->getBoundingRect());
- QRectF newR(Item2->getBoundingRect());
- currDoc->regionsChanged()->update(newR.united(oldR));
+ QRectF oldR(m_item1->getBoundingRect());
+ QRectF newR(m_item2->getBoundingRect());
+ m_doc->regionsChanged()->update(newR.united(oldR));
}
if (effectType != -1)
firstUpdate = false;
@@ -221,12 +221,12 @@
FPointArray path1 = p1.copy();
FPointArray path2 = p2.copy();
QTransform ma;
- ma.translate(Item2->xPos(), Item2->yPos());
- ma.rotate(Item2->rotation());
+ ma.translate(m_item2->xPos(), m_item2->yPos());
+ ma.rotate(m_item2->rotation());
path2.map(ma);
QTransform ma2;
ma2.translate(originalXPos, originalYPos);
- ma2.rotate(Item1->rotation());
+ ma2.rotate(m_item1->rotation());
ma2 = ma2.inverted();
path2.map(ma2);
FPoint startL1 = path1.point(0);
Modified: trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18326&path=/trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.h
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.h (original)
+++ trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.h Mon Jun 17 23:03:50 2013
@@ -57,13 +57,16 @@
private:
FPointArray computePath(int pointOne, int pointTwo, int mode, FPointArray &p1, FPointArray &p2);
FPointArray reversePath(FPointArray &path);
- PageItem *Item1;
- PageItem *Item2;
+
+ PageItem* m_item1;
+ PageItem* m_item2;
+ ScribusDoc* m_doc;
+
FPointArray originalPath1;
FPointArray originalPath2;
double originalXPos;
double originalYPos;
- ScribusDoc* currDoc;
+
bool firstUpdate;
private slots:
void updateEffect(int effectType, int pointOne, int pointTwo, int mode);
Modified: trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinderdialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18326&path=/trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinderdialog.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinderdialog.cpp (original)
+++ trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinderdialog.cpp Mon Jun 17 23:03:50 2013
@@ -35,7 +35,7 @@
PathFinderDialog::PathFinderDialog(QWidget* parent, ScribusDoc* doc, PageItem *shape1, PageItem *shape2) : QDialog( parent )
{
- currDoc = doc;
+ m_doc = doc;
setupUi(this);
setModal(true);
setWindowIcon(QIcon(loadIcon("AppIcon.png")));
@@ -50,32 +50,32 @@
opSubtraction->setIcon(QIcon(loadIcon("pathsubtraction.png")));
opCombine->setIcon(QIcon(loadIcon("pathunite.png")));
otherColorComboLine->addItem(CommonStrings::tr_NoneColor);
- otherColorComboLine->insertItems(currDoc->PageColors, ColorCombo::fancyPixmaps);
+ otherColorComboLine->insertItems(m_doc->PageColors, ColorCombo::fancyPixmaps);
otherColorComboFill->addItem(CommonStrings::tr_NoneColor);
- otherColorComboFill->insertItems(currDoc->PageColors, ColorCombo::fancyPixmaps);
+ otherColorComboFill->insertItems(m_doc->PageColors, ColorCombo::fancyPixmaps);
setCurrentComboItem(otherColorComboLine, shape1->lineColor());
setCurrentComboItem(otherColorComboFill, shape1->fillColor());
opMode = 0;
QTransform ms;
ms.rotate(shape1->rotation());
- input1 = ms.map(shape1->PoLine.toQPainterPath(true));
+ m_input1 = ms.map(shape1->PoLine.toQPainterPath(true));
if (shape1->fillEvenOdd())
- input1.setFillRule(Qt::OddEvenFill);
+ m_input1.setFillRule(Qt::OddEvenFill);
else
- input1.setFillRule(Qt::WindingFill);
+ m_input1.setFillRule(Qt::WindingFill);
double dx = shape2->xPos() - shape1->xPos();
double dy = shape2->yPos() - shape1->yPos();
QTransform mm;
mm.translate(dx, dy);
mm.rotate(shape2->rotation());
- input2 = mm.map(shape2->PoLine.toQPainterPath(true));
+ m_input2 = mm.map(shape2->PoLine.toQPainterPath(true));
if (shape2->fillEvenOdd())
- input2.setFillRule(Qt::OddEvenFill);
+ m_input2.setFillRule(Qt::OddEvenFill);
else
- input2.setFillRule(Qt::WindingFill);
+ m_input2.setFillRule(Qt::WindingFill);
result = QPainterPath();
- source1 = shape1;
- source2 = shape2;
+ m_source1 = shape1;
+ m_source2 = shape2;
swapped = false;
targetColor = 0;
keepItem1 = false;
@@ -135,12 +135,12 @@
void PathFinderDialog::swapObjects()
{
- QPainterPath tmp = input1;
- input1 = input2;
- input2 = tmp;
- PageItem* item = source1;
- source1 = source2;
- source2 = item;
+ QPainterPath tmp = m_input1;
+ m_input1 = m_input2;
+ m_input2 = tmp;
+ PageItem* item = m_source1;
+ m_source1 = m_source2;
+ m_source2 = item;
swapped = !swapped;
updateAllPreviews();
}
@@ -153,7 +153,7 @@
p.setRenderHint(QPainter::Antialiasing, true);
QBrush b(QColor(205,205,205), loadIcon("testfill.png"));
p.fillRect(0, 0, pm.width(), pm.height(), b);
- QRectF bb = input1.boundingRect().united(input2.boundingRect());
+ QRectF bb = m_input1.boundingRect().united(m_input2.boundingRect());
p.translate(5, 5);
p.scale(scale, scale);
p.translate(-bb.x(), -bb.y());
@@ -172,14 +172,14 @@
p.setRenderHint(QPainter::Antialiasing, true);
QBrush b(QColor(205,205,205), loadIcon("testfill.png"));
p.fillRect(0, 0, pm.width(), pm.height(), b);
- QRectF bb = input1.boundingRect().united(input2.boundingRect());
+ QRectF bb = m_input1.boundingRect().united(m_input2.boundingRect());
p.translate(5, 5);
p.scale(scale, scale);
p.translate(-bb.x(), -bb.y());
p.setPen(Qt::black);
- p.setBrush(getColorFromItem(source1->fillColor(), Qt::blue));
+ p.setBrush(getColorFromItem(m_source1->fillColor(), Qt::blue));
p.drawPath(result);
- p.setBrush(getColorFromItem(source2->fillColor(), Qt::red));
+ p.setBrush(getColorFromItem(m_source2->fillColor(), Qt::red));
p.drawPath(result1);
p.setBrush(color);
p.drawPath(result2);
@@ -189,12 +189,12 @@
void PathFinderDialog::updateAllPreviews()
{
- QRectF bb = input1.boundingRect().united(input2.boundingRect());
+ QRectF bb = m_input1.boundingRect().united(m_input2.boundingRect());
double scaleX = 90.0 / bb.width();
double scaleY = 90.0 / bb.height();
double scale = qMin(scaleX, scaleY);
- updatePreview(sourceShape, input1, getColorFromItem(source1->fillColor(), Qt::blue), scale);
- updatePreview(sourceShape2, input2, getColorFromItem(source2->fillColor(), Qt::red), scale);
+ updatePreview(sourceShape, m_input1, getColorFromItem(m_source1->fillColor(), Qt::blue), scale);
+ updatePreview(sourceShape2, m_input2, getColorFromItem(m_source2->fillColor(), Qt::red), scale);
updateResult();
}
@@ -205,50 +205,50 @@
result2 = QPainterPath();
if (opMode == 0)
{
- result = input1.united(input2);
+ result = m_input1.united(m_input2);
}
else if (opMode == 1)
{
- result = input1.subtracted(input2);
+ result = m_input1.subtracted(m_input2);
}
else if (opMode == 2)
{
- result = input1.intersected(input2);
+ result = m_input1.intersected(m_input2);
}
else if (opMode == 3)
{
- QPainterPath part1 = input1.subtracted(input2);
- QPainterPath part2 = input2.subtracted(input1);
+ QPainterPath part1 = m_input1.subtracted(m_input2);
+ QPainterPath part2 = m_input2.subtracted(m_input1);
result.addPath(part1);
result.addPath(part2);
}
else if (opMode == 4)
{
- QPainterPath part1 = input1.subtracted(input2);
- QPainterPath part2 = input2.subtracted(input1);
- QPainterPath part3 = input1.intersected(input2);
+ QPainterPath part1 = m_input1.subtracted(m_input2);
+ QPainterPath part2 = m_input2.subtracted(m_input1);
+ QPainterPath part3 = m_input1.intersected(m_input2);
result.addPath(part1);
result1.addPath(part2);
result2.addPath(part3);
}
- QRectF bb = input1.boundingRect().united(input2.boundingRect());
+ QRectF bb = m_input1.boundingRect().united(m_input2.boundingRect());
double scaleX = 90.0 / bb.width();
double scaleY = 90.0 / bb.height();
double scale = qMin(scaleX, scaleY);
QColor cc = Qt::red;
if (targetGetsSource1Color->isChecked())
{
- cc = getColorFromItem(source1->fillColor(), Qt::blue);
+ cc = getColorFromItem(m_source1->fillColor(), Qt::blue);
targetColor = 0;
- setCurrentComboItem(otherColorComboLine, source1->lineColor());
- setCurrentComboItem(otherColorComboFill, source1->fillColor());
+ setCurrentComboItem(otherColorComboLine, m_source1->lineColor());
+ setCurrentComboItem(otherColorComboFill, m_source1->fillColor());
}
else if (targetGetsSource2Color->isChecked())
{
targetColor = 1;
- cc = getColorFromItem(source2->fillColor(), Qt::red);
- setCurrentComboItem(otherColorComboLine, source2->lineColor());
- setCurrentComboItem(otherColorComboFill, source2->fillColor());
+ cc = getColorFromItem(m_source2->fillColor(), Qt::red);
+ setCurrentComboItem(otherColorComboLine, m_source2->lineColor());
+ setCurrentComboItem(otherColorComboFill, m_source2->fillColor());
}
else if (targetGetsOtherColor->isChecked())
{
@@ -269,8 +269,8 @@
fill = CommonStrings::None;
if (fill != CommonStrings::None)
{
- ScColor m_color = currDoc->PageColors[fill];
- out = ScColorEngine::getDisplayColor(m_color, currDoc);
+ ScColor color = m_doc->PageColors[fill];
+ out = ScColorEngine::getDisplayColor(color, m_doc);
}
return out;
}
Modified: trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinderdialog.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18326&path=/trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinderdialog.h
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinderdialog.h (original)
+++ trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinderdialog.h Mon Jun 17 23:03:50 2013
@@ -27,21 +27,26 @@
void updatePartPreview(QColor color, double scale);
const QString getOtherFillColor();
const QString getOtherLineColor();
- int opMode;
- bool swapped;
- int targetColor;
+
bool keepItem1;
bool keepItem2;
- QPainterPath input1;
- QPainterPath input2;
+ bool swapped;
+ int opMode;
+ int targetColor;
+
QPainterPath result;
QPainterPath result1;
QPainterPath result2;
private:
QColor getColorFromItem(QString color, QColor in);
- ScribusDoc* currDoc;
- PageItem* source1;
- PageItem* source2;
+
+ ScribusDoc* m_doc;
+ PageItem* m_source1;
+ PageItem* m_source2;
+
+ QPainterPath m_input1;
+ QPainterPath m_input2;
+
private slots:
void checkKeep();
void newOpMode();
Modified: trunk/Scribus/scribus/tocgenerator.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18326&path=/trunk/Scribus/scribus/tocgenerator.cpp
==============================================================================
--- trunk/Scribus/scribus/tocgenerator.cpp (original)
+++ trunk/Scribus/scribus/tocgenerator.cpp Mon Jun 17 23:03:50 2013
@@ -33,31 +33,26 @@
TOCGenerator::TOCGenerator(QObject *parent, ScribusDoc *doc) : QObject(parent)
{
- currDoc=doc;
-}
-
-
-TOCGenerator::~TOCGenerator()
-{
+ m_doc = doc;
}
void TOCGenerator::setDoc(ScribusDoc *doc)
{
- currDoc=doc;
+ m_doc = doc;
}
PageItem* TOCGenerator::findTargetFrame(const QString &targetFrameName)
{
PageItem* targetFrame=NULL;
- if (currDoc!=NULL)
+ if (m_doc != NULL)
{
- for (int d = 0; d < currDoc->DocItems.count(); ++d)
+ for (int d = 0; d < m_doc->DocItems.count(); ++d)
{
- if (currDoc->DocItems.at(d) !=NULL )
+ if (m_doc->DocItems.at(d) != NULL)
{
- if (currDoc->DocItems.at(d)->itemType()==PageItem::TextFrame && currDoc->DocItems.at(d)->itemName()==targetFrameName)
+ if (m_doc->DocItems.at(d)->itemType()==PageItem::TextFrame && m_doc->DocItems.at(d)->itemName()==targetFrameName)
{
- targetFrame=currDoc->DocItems.at(d);
+ targetFrame=m_doc->DocItems.at(d);
break;
}
}
@@ -68,10 +63,10 @@
void TOCGenerator::generateDefault()
{
- if (currDoc==NULL)
+ if (m_doc == NULL)
return;
- Q_ASSERT(!currDoc->masterPageMode());
- for(ToCSetupVector::Iterator tocSetupIt = currDoc->tocSetups().begin(); tocSetupIt != currDoc->tocSetups().end(); ++tocSetupIt )
+ Q_ASSERT(!m_doc->masterPageMode());
+ for(ToCSetupVector::Iterator tocSetupIt = m_doc->tocSetups().begin(); tocSetupIt != m_doc->tocSetups().end(); ++tocSetupIt )
{
PageItem* tocFrame = findTargetFrame(tocSetupIt->frameName);
if (tocFrame == NULL)
@@ -80,16 +75,16 @@
PageItem *currentDocItem;
QMap<QString, QString> tocMap;
- uint *pageCounter = new uint[currDoc->DocPages.count()];
+ uint *pageCounter = new uint[m_doc->DocPages.count()];
if (pageCounter == NULL)
return;
- uint pageNumberWidth = QString("%1").arg(currDoc->DocPages.count()).length();
- for (int i = 0; i < currDoc->DocPages.count(); ++i)
+ uint pageNumberWidth = QString("%1").arg(m_doc->DocPages.count()).length();
+ for (int i = 0; i < m_doc->DocPages.count(); ++i)
pageCounter[i] = 0;
- for (int d = 0; d < currDoc->DocItems.count(); ++d)
+ for (int d = 0; d < m_doc->DocItems.count(); ++d)
{
- currentDocItem = currDoc->DocItems.at(d);
+ currentDocItem = m_doc->DocItems.at(d);
if (currentDocItem == NULL)
continue;
//Item not on a page, continue
@@ -104,8 +99,8 @@
if (objAttrs.count() <= 0)
continue;
- QString pageID = QString("%1").arg(currentDocItem->OwnPage + currDoc->FirstPnum, pageNumberWidth);
- QString sectionID = currDoc->getSectionPageNumberForPageIndex(currentDocItem->OwnPage);
+ QString pageID = QString("%1").arg(currentDocItem->OwnPage + m_doc->FirstPnum, pageNumberWidth);
+ QString sectionID = m_doc->getSectionPageNumberForPageIndex(currentDocItem->OwnPage);
for (int i = 0; i < objAttrs.count(); ++i)
{
Modified: trunk/Scribus/scribus/tocgenerator.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18326&path=/trunk/Scribus/scribus/tocgenerator.h
==============================================================================
--- trunk/Scribus/scribus/tocgenerator.h (original)
+++ trunk/Scribus/scribus/tocgenerator.h Mon Jun 17 23:03:50 2013
@@ -36,7 +36,6 @@
Q_OBJECT
public:
TOCGenerator(QObject *parent = NULL, ScribusDoc *doc = NULL);
- ~TOCGenerator();
void setDoc(ScribusDoc *doc = NULL);
@@ -45,7 +44,7 @@
private:
PageItem* findTargetFrame(const QString &targetFrameName);
- ScribusDoc *currDoc;
+ ScribusDoc *m_doc;
};
#endif
Modified: trunk/Scribus/scribus/ui/hruler.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18326&path=/trunk/Scribus/scribus/ui/hruler.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/hruler.cpp (original)
+++ trunk/Scribus/scribus/ui/hruler.cpp Mon Jun 17 23:03:50 2013
@@ -83,8 +83,8 @@
QPalette palette;
palette.setBrush(QPalette::Window, QColor(240, 240, 240));
setPalette(palette);
- currDoc = doc;
- currView = pa;
+ m_doc = doc;
+ m_view = pa;
offs = 0;
oldMark = 0;
ActCol = 1;
@@ -94,7 +94,7 @@
RulerCode = rc_none;
itemScale = 1.0;
setMouseTracking(true);
- rulerGesture = new RulerGesture(currView, RulerGesture::HORIZONTAL);
+ rulerGesture = new RulerGesture(m_view, RulerGesture::HORIZONTAL);
unitChange();
}
@@ -117,12 +117,12 @@
int Hruler::textPosToLocal(double x) const
{
- return qRound(textPosToCanvas(x) * Scaling)- currView->contentsX();
+ return qRound(textPosToCanvas(x) * Scaling)- m_view->contentsX();
}
double Hruler::localToTextPos(int x) const
{
- return ((x + currView->contentsX()) / Scaling - textBase());
+ return ((x + m_view->contentsX()) / Scaling - textBase());
}
void Hruler::shift(double pos)
@@ -208,20 +208,20 @@
void Hruler::mousePressEvent(QMouseEvent *m)
{
- if (currDoc->isLoading())
+ if (m_doc->isLoading())
return;
Mpressed = true;
MouseX = m->x();
if (textEditMode)
{
- RulerCode = findRulerHandle(m->pos(), currDoc->guidesPrefs().grabRadius);
+ RulerCode = findRulerHandle(m->pos(), m_doc->guidesPrefs().grabRadius);
if ((RulerCode == rc_none) && (ActCol != 0) && (m->button() == Qt::LeftButton))
{
ParagraphStyle::TabRecord tb;
tb.tabPosition = localToTextPos(m->x());
tb.tabType = 0;
- tb.tabFillChar = currDoc->itemToolPrefs().textTabFillChar[0];
+ tb.tabFillChar = m_doc->itemToolPrefs().textTabFillChar[0];
TabValues.prepend(tb);
ActTab = 0;
RulerCode = rc_tab;
@@ -232,18 +232,18 @@
}
else
{
- if (currDoc->guidesPrefs().guidesShown)
+ if (m_doc->guidesPrefs().guidesShown)
{
qApp->setOverrideCursor(QCursor(SPLITHC));
- currView->startGesture(rulerGesture);
- currView->registerMousePress(m->globalPos());
+ m_view->startGesture(rulerGesture);
+ m_view->registerMousePress(m->globalPos());
}
}
}
void Hruler::mouseReleaseEvent(QMouseEvent *m)
{
- if (currDoc->isLoading())
+ if (m_doc->isLoading())
{
Mpressed = false;
return;
@@ -258,11 +258,11 @@
switch (RulerCode)
{
case rc_leftFrameDist:
- currDoc->m_Selection->itemAt(0)->setTextToFrameDistLeft(Extra);
+ m_doc->m_Selection->itemAt(0)->setTextToFrameDistLeft(Extra);
emit DocChanged(false);
break;
case rc_rightFrameDist:
- currDoc->m_Selection->itemAt(0)->setTextToFrameDistRight(RExtra);
+ m_doc->m_Selection->itemAt(0)->setTextToFrameDistRight(RExtra);
emit DocChanged(false);
break;
case rc_indentFirst:
@@ -299,7 +299,7 @@
{
Selection tempSelection(this, false);
tempSelection.addItem(currItem);
- currDoc->itemSelection_ApplyParagraphStyle(paraStyle, &tempSelection);
+ m_doc->itemSelection_ApplyParagraphStyle(paraStyle, &tempSelection);
}
else
{
@@ -316,13 +316,13 @@
paraStyle.setTabValues(TabValues);
Selection tempSelection(this, false);
tempSelection.addItem(currItem);
- currDoc->itemSelection_ApplyParagraphStyle(paraStyle, &tempSelection);
+ m_doc->itemSelection_ApplyParagraphStyle(paraStyle, &tempSelection);
emit DocChanged(false);
}
}
RulerCode = rc_none;
- currView->DrawNew();
- currDoc->m_Selection->itemAt(0)->emitAllToGUI();
+ m_view->DrawNew();
+ m_doc->m_Selection->itemAt(0)->emitAllToGUI();
}
else
{
@@ -345,12 +345,12 @@
void Hruler::leaveEvent(QEvent *m)
{
emit MarkerMoved(0, -1);
- currView->m_canvasMode->setModeCursor();
+ m_view->m_canvasMode->setModeCursor();
}
void Hruler::mouseMoveEvent(QMouseEvent *m)
{
- if (currDoc->isLoading())
+ if (m_doc->isLoading())
return;
if (textEditMode)
{
@@ -367,7 +367,7 @@
ColStart = textPosToLocal((ColWidth+ColGap)*(ActCol-1));
ColEnd = textPosToLocal((ColWidth+ColGap)*(ActCol-1) + ColWidth);
}
- if ((Mpressed) && (m->y() < height()) && (m->y() > 0) && (m->x() > ColStart - currDoc->guidesPrefs().grabRadius) && (m->x() < ColEnd + currDoc->guidesPrefs().grabRadius))
+ if ((Mpressed) && (m->y() < height()) && (m->y() > 0) && (m->x() > ColStart - m_doc->guidesPrefs().grabRadius) && (m->x() < ColEnd + m_doc->guidesPrefs().grabRadius))
{
qApp->changeOverrideCursor(QCursor(Qt::SizeHorCursor));
double toplimit = textWidth() + RExtra - (ColGap * (Cols - 1))-1;
@@ -437,23 +437,23 @@
MouseX = m->x();
/* if (RulerCode != rc_none)
{
- QPoint py = currView->viewport()->mapFromGlobal(m->globalPos());
+ QPoint py = m_view->viewport()->mapFromGlobal(m->globalPos());
QPainter p;
- p.begin(currView->viewport());
+ p.begin(m_view->viewport());
p.setCompositionMode(QPainter::CompositionMode_Xor);
p.setPen(QPen(Qt::white, 1, Qt::DotLine, Qt::FlatCap, Qt::MiterJoin));
- QPoint out = currView->contentsToViewport(QPoint(0, qRound(currDoc->currentPage()->yOffset() * Scaling)));
- p.drawLine(Markp, out.y(), Markp, out.y()+qRound(currDoc->currentPage()->height() * Scaling));
- p.drawLine(py.x(), out.y(), py.x(), out.y()+qRound(currDoc->currentPage()->height() * Scaling));
+ QPoint out = m_view->contentsToViewport(QPoint(0, qRound(m_doc->currentPage()->yOffset() * Scaling)));
+ p.drawLine(Markp, out.y(), Markp, out.y()+qRound(m_doc->currentPage()->height() * Scaling));
+ p.drawLine(py.x(), out.y(), py.x(), out.y()+qRound(m_doc->currentPage()->height() * Scaling));
p.end();
Markp = py.x();
}*/
return;
}
- if ((!Mpressed) && (m->y() < height()) && (m->y() > 0) && (m->x() > ColStart - 2*currDoc->guidesPrefs().grabRadius) && (m->x() < ColEnd + 2*currDoc->guidesPrefs().grabRadius))
+ if ((!Mpressed) && (m->y() < height()) && (m->y() > 0) && (m->x() > ColStart - 2*m_doc->guidesPrefs().grabRadius) && (m->x() < ColEnd + 2*m_doc->guidesPrefs().grabRadius))
{
setCursor(QCursor(loadIcon("tab.png"), 3));
- switch(findRulerHandle(m->pos(), currDoc->guidesPrefs().grabRadius))
+ switch(findRulerHandle(m->pos(), m_doc->guidesPrefs().grabRadius))
{
case rc_leftFrameDist:
setCursor(QCursor(Qt::SplitHCursor));
@@ -499,10 +499,10 @@
void Hruler::paintEvent(QPaintEvent *e)
{
- if (currDoc->isLoading())
+ if (m_doc->isLoading())
return;
QString tx = "";
- double sc = currView->scale();
+ double sc = m_view->scale();
Scaling = sc;
QFont ff = font();
ff.setPointSize(6);
@@ -662,7 +662,7 @@
}
// draw pixmap
p.save();
- p.translate(-currView->contentsX(), 0);
+ p.translate(-m_view->contentsX(), 0);
p.scale(1.0/SCALE, 1.0/(SCALE+1));
p.drawPixmap((where-2)*SCALE, 1, pix);
p.restore();
@@ -670,7 +670,7 @@
p.setBrush(Qt::black);
p.setPen(Qt::black);
p.setFont(font());
- double sc = currView->getScale();
+ double sc = m_view->getScale();
double cc = width() / sc;
double firstMark = ceil(offs / iter) * iter - offs;
while (firstMark < cc)
@@ -681,7 +681,7 @@
#else
// draw slim marker
p.resetTransform();
- p.translate(-currView->contentsX(), 0);
+ p.translate(-m_view->contentsX(), 0);
p.setPen(Qt::red);
p.setBrush(Qt::red);
cr.setPoints(5, whereToDraw, 5, whereToDraw, 16, whereToDraw, 5, whereToDraw+2, 0, whereToDraw-2, 0);
@@ -711,7 +711,7 @@
while (firstMark < cc)
{
p.drawLine(qRound(firstMark * sc), topline + 5, qRound(firstMark * sc), 16);
- switch (currDoc->unitIndex())
+ switch (m_doc->unitIndex())
{
case SC_MM:
tx = QString::number(markC * iter2 / (iter2 / 100) / cor);
@@ -763,7 +763,7 @@
{
int xli = textPosToLocal(xl);
p.drawLine(xli, topline, xli, 16);
- switch (currDoc->unitIndex())
+ switch (m_doc->unitIndex())
{
case SC_IN:
{
@@ -865,7 +865,7 @@
void Hruler::Draw(int where)
{
// erase old marker
- int currentCoor = where - currView->contentsX();
+ int currentCoor = where - m_view->contentsX();
whereToDraw = where;
drawMark = true;
repaint(oldMark-3, 0, 7, 17);
@@ -881,10 +881,10 @@
itemScale = mm.m11();
ItemPos = itPos.x();
ItemEndPos = ItemPos + item->width() * itemScale;
- /*if (currDoc->guidesPrefs().rulerMode)
- {
- ItemPos -= currDoc->currentPage()->xOffset();
- ItemEndPos -= currDoc->currentPage()->xOffset();
+ /*if (m_doc->guidesPrefs().rulerMode)
+ {
+ ItemPos -= m_doc->currentPage()->xOffset();
+ ItemEndPos -= m_doc->currentPage()->xOffset();
}*/
if ((item->lineColor() != CommonStrings::None) || (!item->strokePattern().isEmpty()))
@@ -937,9 +937,9 @@
void Hruler::unitChange()
{
- double sc = currView->scale();
+ double sc = m_view->scale();
cor=1;
- int docUnitIndex=currDoc->unitIndex();
+ int docUnitIndex=m_doc->unitIndex();
switch (docUnitIndex)
{
case SC_PT:
Modified: trunk/Scribus/scribus/ui/hruler.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18326&path=/trunk/Scribus/scribus/ui/hruler.h
==============================================================================
--- trunk/Scribus/scribus/ui/hruler.h (original)
+++ trunk/Scribus/scribus/ui/hruler.h Mon Jun 17 23:03:50 2013
@@ -105,8 +105,8 @@
int RulerCode;
int MouseX;
- ScribusDoc *currDoc;
- ScribusView *currView;
+ ScribusDoc *m_doc;
+ ScribusView *m_view;
public slots: // Public slots
/** \brief draw mark
Modified: trunk/Scribus/scribus/ui/inlinepalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18326&path=/trunk/Scribus/scribus/ui/inlinepalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/inlinepalette.cpp (original)
+++ trunk/Scribus/scribus/ui/inlinepalette.cpp Mon Jun 17 23:03:50 2013
@@ -125,9 +125,9 @@
{
actItem = item->data(Qt::UserRole).toInt();
bool txFrame = false;
- if (!currDoc->m_Selection->isEmpty())
- {
- PageItem* selItem = currDoc->m_Selection->itemAt(0);
+ if (!m_doc->m_Selection->isEmpty())
+ {
+ PageItem* selItem = m_doc->m_Selection->itemAt(0);
if ((selItem->isTextFrame() || selItem->isTable()))
txFrame = true;
}
@@ -137,7 +137,7 @@
QAction* pasteAct = pmenu->addAction( tr("Paste to Item"));
connect(pasteAct, SIGNAL(triggered()), this, SLOT(handlePasteToItem()));
}
- if ((currDoc->appMode != modeEdit) && (currDoc->appMode != modeEditTable))
+ if ((m_doc->appMode != modeEdit) && (m_doc->appMode != modeEditTable))
{
QAction* editAct = pmenu->addAction( tr("Edit Item"));
connect(editAct, SIGNAL(triggered()), this, SLOT(handleEditItem()));
@@ -152,7 +152,7 @@
void InlinePalette::handlePasteToItem()
{
- PageItem* selItem = currDoc->m_Selection->itemAt(0);
+ PageItem* selItem = m_doc->m_Selection->itemAt(0);
PageItem_TextFrame *currItem;
if (selItem->isTable())
currItem = selItem->asTable()->activeCell().textFrame();
@@ -180,7 +180,7 @@
void InlinePalette::handleDeleteItem()
{
- currDoc->removeInlineFrame(actItem);
+ m_doc->removeInlineFrame(actItem);
QListWidgetItem* item = InlineViewWidget->takeItem(InlineViewWidget->currentRow());
delete item;
InlineViewWidget->update();
@@ -218,24 +218,24 @@
void InlinePalette::setDoc(ScribusDoc *newDoc)
{
if (m_scMW == NULL)
- currDoc = NULL;
- else
- currDoc = newDoc;
- if (currDoc == NULL)
+ m_doc = NULL;
+ else
+ m_doc = newDoc;
+ if (m_doc == NULL)
{
InlineViewWidget->clear();
setEnabled(true);
}
else
{
- setEnabled(!currDoc->drawAsPreview);
+ setEnabled(!m_doc->drawAsPreview);
updateItemList();
}
}
void InlinePalette::unsetDoc()
{
- currDoc = NULL;
+ m_doc = NULL;
InlineViewWidget->clear();
setEnabled(true);
}
@@ -250,7 +250,7 @@
{
InlineViewWidget->clear();
InlineViewWidget->setWordWrap(true);
- for (QHash<int, PageItem*>::iterator it = currDoc->FrameItems.begin(); it != currDoc->FrameItems.end(); ++it)
+ for (QHash<int, PageItem*>::iterator it = m_doc->FrameItems.begin(); it != m_doc->FrameItems.end(); ++it)
{
PageItem *currItem = it.value();
QPixmap pm = QPixmap::fromImage(currItem->DrawObj_toImage(48));
Modified: trunk/Scribus/scribus/ui/inlinepalette.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18326&path=/trunk/Scribus/scribus/ui/inlinepalette.h
==============================================================================
--- trunk/Scribus/scribus/ui/inlinepalette.h (original)
+++ trunk/Scribus/scribus/ui/inlinepalette.h Mon Jun 17 23:03:50 2013
@@ -100,7 +100,7 @@
protected:
InlineView *InlineViewWidget;
QVBoxLayout* PaletteLayout;
- ScribusDoc *currDoc;
+ ScribusDoc *m_doc;
ScribusMainWindow *m_scMW;
int actItem;
int currentEditedItem;
Modified: trunk/Scribus/scribus/ui/javadocs.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18326&path=/trunk/Scribus/scribus/ui/javadocs.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/javadocs.cpp (original)
+++ trunk/Scribus/scribus/ui/javadocs.cpp Mon Jun 17 23:03:50 2013
@@ -29,8 +29,8 @@
setModal(true);
setWindowTitle( tr( "Edit JavaScripts" ) );
setWindowIcon(loadIcon("AppIcon.png"));
- Doc = doc;
- View = vie;
+ m_Doc = doc;
+ m_View = vie;
JavaDocsLayout = new QHBoxLayout(this);
JavaDocsLayout->setMargin(10);
JavaDocsLayout->setSpacing(5);
@@ -38,7 +38,7 @@
Scripts = new QListWidget( this );
Scripts->setMinimumSize( QSize( 150, 200 ) );
QMap<QString,QString>::Iterator it;
- for (it = Doc->JavaScripts.begin(); it != Doc->JavaScripts.end(); ++it)
+ for (it = m_Doc->JavaScripts.begin(); it != m_Doc->JavaScripts.end(); ++it)
Scripts->addItem(it.key());
JavaDocsLayout->addWidget( Scripts );
@@ -60,7 +60,7 @@
ExitDia = new QPushButton( tr( "&Close" ), this);
ExitDia->setDefault( true );
Layout1->addWidget( ExitDia );
- if (Doc->JavaScripts.count() == 0)
+ if (m_Doc->JavaScripts.count() == 0)
{
EditScript->setEnabled(false);
DeleteScript->setEnabled(false);
@@ -79,18 +79,18 @@
QString nam;
Query dia(this, "tt", 1, tr("&New Script:"), tr("New Script"));
dia.setEditText( tr("New Script"), false );
- dia.setTestList(Doc->JavaScripts.keys());
+ dia.setTestList(m_Doc->JavaScripts.keys());
if (dia.exec())
{
nam = dia.getEditText();
nam.replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%\\.]"), "_" );
- Editor* dia2 = new Editor(this, "", View);
+ Editor* dia2 = new Editor(this, "", m_View);
dia2->EditTex->setText("function "+nam+"()\n{\n}");
if (dia2->exec())
{
EditScript->setEnabled(true);
DeleteScript->setEnabled(true);
- Doc->JavaScripts[nam] = dia2->EditTex->toPlainText();
+ m_Doc->JavaScripts[nam] = dia2->EditTex->toPlainText();
Scripts->addItem(nam);
emit docChanged(false);
}
@@ -101,10 +101,10 @@
void JavaDocs::slotEdit()
{
QString nam = Scripts->currentItem()->text();
- Editor* dia2 = new Editor(this, Doc->JavaScripts[nam], View);
+ Editor* dia2 = new Editor(this, m_Doc->JavaScripts[nam], m_View);
if (dia2->exec())
{
- Doc->JavaScripts[nam] = dia2->EditTex->toPlainText();
+ m_Doc->JavaScripts[nam] = dia2->EditTex->toPlainText();
emit docChanged(false);
}
delete dia2;
@@ -119,12 +119,12 @@
if (exit == QMessageBox::Yes)
{
QString nam = Scripts->currentItem()->text();
- Doc->JavaScripts.remove(nam);
+ m_Doc->JavaScripts.remove(nam);
Scripts->clear();
QMap<QString,QString>::Iterator it;
- for (it = Doc->JavaScripts.begin(); it != Doc->JavaScripts.end(); ++it)
+ for (it = m_Doc->JavaScripts.begin(); it != m_Doc->JavaScripts.end(); ++it)
Scripts->addItem(it.key());
- if (Doc->JavaScripts.count() == 0)
+ if (m_Doc->JavaScripts.count() == 0)
{
EditScript->setEnabled(false);
DeleteScript->setEnabled(false);
Modified: trunk/Scribus/scribus/ui/javadocs.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18326&path=/trunk/Scribus/scribus/ui/javadocs.h
==============================================================================
--- trunk/Scribus/scribus/ui/javadocs.h (original)
+++ trunk/Scribus/scribus/ui/javadocs.h Mon Jun 17 23:03:50 2013
@@ -30,8 +30,6 @@
QPushButton* AddScript;
QPushButton* DeleteScript;
QPushButton* ExitDia;
- ScribusDoc *Doc;
- ScribusView *View;
private slots:
void slotAdd();
@@ -42,6 +40,9 @@
void docChanged(bool);
protected:
+ ScribusDoc *m_Doc;
+ ScribusView *m_View;
+
QHBoxLayout* JavaDocsLayout;
QVBoxLayout* Layout1;
};
Modified: trunk/Scribus/scribus/ui/masterpagepalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18326&path=/trunk/Scribus/scribus/ui/masterpagepalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/masterpagepalette.cpp (original)
+++ trunk/Scribus/scribus/ui/masterpagepalette.cpp Mon Jun 17 23:03:50 2013
@@ -40,8 +40,8 @@
setModal(false);
undoManager = UndoManager::instance();
setWindowIcon(QIcon(loadIcon ( "AppIcon.png" )));
- currentDoc = pCurrentDoc;
- currentView = pCurrentView;
+ m_doc = pCurrentDoc;
+ m_view = pCurrentView;
masterPagesLayout = new QVBoxLayout(this);
masterPagesLayout->setMargin(5);
masterPagesLayout->setSpacing(5);
@@ -72,11 +72,11 @@
languageChange();
if (masterPageName.isEmpty())
- sMuster = currentDoc->MasterNames.begin().key();
+ m_masterPage = m_doc->MasterNames.begin().key();
else
- sMuster = masterPageName;
- updateMasterPageList(sMuster);
- currentView->showMasterPage(currentDoc->MasterNames[sMuster]);
+ m_masterPage = masterPageName;
+ updateMasterPageList(m_masterPage);
+ m_view->showMasterPage(m_doc->MasterNames[m_masterPage]);
setMinimumSize(sizeHint());
@@ -122,27 +122,27 @@
// allow to delete multiple pages in one step
foreach (QListWidgetItem * delItem, masterPageListBox->selectedItems())
{
- sMuster = delItem->text();
-
- if ((sMuster == CommonStrings::masterPageNormal)
- || (sMuster == CommonStrings::trMasterPageNormal)
- || (sMuster == CommonStrings::trMasterPageNormalLeft)
- || (sMuster == CommonStrings::trMasterPageNormalMiddle)
- || (sMuster == CommonStrings::trMasterPageNormalRight))
+ m_masterPage = delItem->text();
+
+ if ((m_masterPage == CommonStrings::masterPageNormal)
+ || (m_masterPage == CommonStrings::trMasterPageNormal)
+ || (m_masterPage == CommonStrings::trMasterPageNormalLeft)
+ || (m_masterPage == CommonStrings::trMasterPageNormalMiddle)
+ || (m_masterPage == CommonStrings::trMasterPageNormalRight))
continue;
QString extraWarn = "";
if (!forceDelete)
{
- for (int i=0; i < currentDoc->DocPages.count(); ++i )
+ for (int i=0; i < m_doc->DocPages.count(); ++i )
{
- if (currentDoc->DocPages[i]->MPageNam == sMuster)
+ if (m_doc->DocPages[i]->MPageNam == m_masterPage)
extraWarn = tr("This master page is used at least once in the document.");
}
int exit = QMessageBox::warning(this,
CommonStrings::trWarning,
- tr("Do you really want to delete master page \"%1\"?").arg(sMuster)+"\n"+extraWarn,
+ tr("Do you really want to delete master page \"%1\"?").arg(m_masterPage)+"\n"+extraWarn,
QMessageBox::Yes | QMessageBox::YesToAll | QMessageBox::No | QMessageBox::Cancel);
if (exit == QMessageBox::YesToAll)
@@ -153,20 +153,20 @@
break;
}
- if (currentDoc->appMode == modeEditClip)
- currentView->requestMode(submodeEndNodeEdit);
- currentDoc->scMW()->deletePage2(currentDoc->MasterNames[sMuster]);
+ if (m_doc->appMode == modeEditClip)
+ m_view->requestMode(submodeEndNodeEdit);
+ m_doc->scMW()->deletePage2(m_doc->MasterNames[m_masterPage]);
//<<CB TODO Move back into ScribusDoc::deleteMasterPage();
//This must happen after the pages have been reformed (view/doc)
- currentDoc->rebuildMasterNames();
+ m_doc->rebuildMasterNames();
// Fix up any pages that refer to the deleted master page
- currentDoc->replaceMasterPage(sMuster);
+ m_doc->replaceMasterPage(m_masterPage);
}
// set the 1st MP for the other slots
- QMap<QString,int>::Iterator it = currentDoc->MasterNames.begin();
- sMuster = it.key();
- updateMasterPageList(sMuster);
+ QMap<QString,int>::Iterator it = m_doc->MasterNames.begin();
+ m_masterPage = it.key();
+ updateMasterPageList(m_masterPage);
if (activeTransaction)
{
activeTransaction->commit();
@@ -181,17 +181,17 @@
UndoTransaction* activeTransaction = NULL;
if (UndoManager::undoEnabled())
activeTransaction = new UndoTransaction(undoManager->beginTransaction(Um::Group, Um::IGroup, Um::DuplicateMasterPage, "", Um::IGroup));
- QString potentialMasterPageName(sMuster);
- while (currentDoc->MasterNames.contains(potentialMasterPageName))
- potentialMasterPageName = tr("Copy #%1 of %2").arg(copyC++).arg(sMuster);
-
- NewTm *dia = new NewTm(this, tr("&Name:"), tr("New Master Page"), currentDoc, potentialMasterPageName);
+ QString potentialMasterPageName(m_masterPage);
+ while (m_doc->MasterNames.contains(potentialMasterPageName))
+ potentialMasterPageName = tr("Copy #%1 of %2").arg(copyC++).arg(m_masterPage);
+
+ NewTm *dia = new NewTm(this, tr("&Name:"), tr("New Master Page"), m_doc, potentialMasterPageName);
if (dia->exec())
{
- if (currentDoc->appMode == modeEditClip)
- currentView->requestMode(submodeEndNodeEdit);
+ if (m_doc->appMode == modeEditClip)
+ m_view->requestMode(submodeEndNodeEdit);
QString MasterPageName = dia->Answer->text();
- bool MasterPageNameWrong = currentDoc->MasterNames.contains(MasterPageName);
+ bool MasterPageNameWrong = m_doc->MasterNames.contains(MasterPageName);
MasterPageNameWrong |= (MasterPageName == CommonStrings::masterPageNormal);
MasterPageNameWrong |= (MasterPageName == CommonStrings::trMasterPageNormal);
MasterPageNameWrong |= (MasterPageName == CommonStrings::trMasterPageNormalLeft);
@@ -206,7 +206,7 @@
return;
}
MasterPageName = dia->Answer->text();
- bool MasterPageNameWrong = currentDoc->MasterNames.contains(MasterPageName);
+ bool MasterPageNameWrong = m_doc->MasterNames.contains(MasterPageName);
MasterPageNameWrong |= (MasterPageName == CommonStrings::masterPageNormal);
MasterPageNameWrong |= (MasterPageName == CommonStrings::trMasterPageNormal);
MasterPageNameWrong |= (MasterPageName == CommonStrings::trMasterPageNormalLeft);
@@ -215,11 +215,11 @@
MasterPageNameWrong |= MasterPageName.isEmpty();
}
PrefsManager* prefsManager = PrefsManager::instance();
- int inde = currentDoc->MasterNames[sMuster];
- int nr = currentDoc->Pages->count();
- ScPage* from = currentDoc->Pages->at(inde);
- ScPage* destination = currentDoc->addMasterPage(nr, MasterPageName);
- if (currentDoc->pagePositioning() != singlePage)
+ int inde = m_doc->MasterNames[m_masterPage];
+ int nr = m_doc->Pages->count();
+ ScPage* from = m_doc->Pages->at(inde);
+ ScPage* destination = m_doc->addMasterPage(nr, MasterPageName);
+ if (m_doc->pagePositioning() != singlePage)
{
int lp = dia->Links->currentIndex();
if (lp == 0)
@@ -232,7 +232,7 @@
}
destination->initialMargins.Top = from->initialMargins.Top;
destination->initialMargins.Bottom = from->initialMargins.Bottom;
- if (currentDoc->pageSets()[currentDoc->pagePositioning()].Columns == 1)
+ if (m_doc->pageSets()[m_doc->pagePositioning()].Columns == 1)
{
destination->initialMargins.Left = from->initialMargins.Left;
destination->initialMargins.Right = from->initialMargins.Right;
@@ -259,49 +259,49 @@
}
}
//#8321 : incorrect selection of master page on new mp creation/duplictation
- //currentDoc->setCurrentPage(destination);
+ //m_doc->setCurrentPage(destination);
selectMasterPage(MasterPageName);
- uint oldItems = currentDoc->Items->count();
- uint end2 = currentDoc->MasterItems.count();
- int GrMax = currentDoc->GroupCounter;
- currentDoc->m_Selection->clear();
+ uint oldItems = m_doc->Items->count();
+ uint end2 = m_doc->MasterItems.count();
+ int GrMax = m_doc->GroupCounter;
+ m_doc->m_Selection->clear();
if (oldItems>0)
{
ScLayers::iterator it;
- currentDoc->m_Selection->delaySignalsOn();
- for (it = currentDoc->Layers.begin(); it != currentDoc->Layers.end(); ++it)
+ m_doc->m_Selection->delaySignalsOn();
+ for (it = m_doc->Layers.begin(); it != m_doc->Layers.end(); ++it)
{
for (uint ite = 0; ite < oldItems; ++ite)
{
- PageItem *itemToCopy = currentDoc->Items->at(ite);
+ PageItem *itemToCopy = m_doc->Items->at(ite);
if (itemToCopy->OwnPage == inde && (it->ID == itemToCopy->LayerID))
- currentDoc->m_Selection->addItem(itemToCopy, true);
+ m_doc->m_Selection->addItem(itemToCopy, true);
}
- if (currentDoc->m_Selection->count() != 0)
+ if (m_doc->m_Selection->count() != 0)
{
ScriXmlDoc ss;
- QString buffer = ss.WriteElem(currentDoc, currentDoc->m_Selection);
- ss.ReadElemToLayer(buffer, prefsManager->appPrefs.fontPrefs.AvailFonts, currentDoc, destination->xOffset(), destination->yOffset(), false, true, prefsManager->appPrefs.fontPrefs.GFontSub, it->ID);
- currentDoc->m_Selection->clear();
+ QString buffer = ss.WriteElem(m_doc, m_doc->m_Selection);
+ ss.ReadElemToLayer(buffer, prefsManager->appPrefs.fontPrefs.AvailFonts, m_doc, destination->xOffset(), destination->yOffset(), false, true, prefsManager->appPrefs.fontPrefs.GFontSub, it->ID);
+ m_doc->m_Selection->clear();
}
}
- currentDoc->m_Selection->clear();
- currentDoc->m_Selection->delaySignalsOff();
- }
- uint end3 = currentDoc->MasterItems.count();
+ m_doc->m_Selection->clear();
+ m_doc->m_Selection->delaySignalsOff();
+ }
+ uint end3 = m_doc->MasterItems.count();
for (uint a = end2; a < end3; ++a)
{
- PageItem *newItem = currentDoc->MasterItems.at(a);
+ PageItem *newItem = m_doc->MasterItems.at(a);
newItem->OnMasterPage = MasterPageName;
- newItem->OwnPage = currentDoc->MasterNames[MasterPageName];
+ newItem->OwnPage = m_doc->MasterNames[MasterPageName];
}
from->guides.copy(&destination->guides);
- currentDoc->GroupCounter = GrMax + 1;
- currentView->Deselect(true);
+ m_doc->GroupCounter = GrMax + 1;
+ m_view->Deselect(true);
updateMasterPageList(MasterPageName);
- currentDoc->setLoading(false);
- currentView->reformPages();
- currentView->DrawNew();
+ m_doc->setLoading(false);
+ m_view->reformPages();
+ m_view->DrawNew();
}
if (activeTransaction)
{
@@ -318,14 +318,14 @@
UndoTransaction* activeTransaction = NULL;
if (UndoManager::undoEnabled())
activeTransaction = new UndoTransaction(undoManager->beginTransaction(Um::Group, Um::IGroup, Um::NewMasterPage, "", Um::IGroup));
- int nr = currentDoc->Pages->count();
- NewTm *dia = new NewTm(this, tr("Name:"), tr("New MasterPage"), currentDoc, tr("New Master Page %1").arg(nr));
+ int nr = m_doc->Pages->count();
+ NewTm *dia = new NewTm(this, tr("Name:"), tr("New MasterPage"), m_doc, tr("New Master Page %1").arg(nr));
if (dia->exec())
{
- if (currentDoc->appMode == modeEditClip)
- currentView->requestMode(submodeEndNodeEdit);
+ if (m_doc->appMode == modeEditClip)
+ m_view->requestMode(submodeEndNodeEdit);
MasterPageName = dia->Answer->text();
- bool MasterPageNameWrong = currentDoc->MasterNames.contains(MasterPageName);
+ bool MasterPageNameWrong = m_doc->MasterNames.contains(MasterPageName);
MasterPageNameWrong |= (MasterPageName == CommonStrings::masterPageNormal);
MasterPageNameWrong |= (MasterPageName == CommonStrings::trMasterPageNormal);
MasterPageNameWrong |= (MasterPageName == CommonStrings::trMasterPageNormalLeft);
@@ -340,7 +340,7 @@
return;
}
MasterPageName = dia->Answer->text();
- MasterPageNameWrong = currentDoc->MasterNames.contains(MasterPageName);
+ MasterPageNameWrong = m_doc->MasterNames.contains(MasterPageName);
MasterPageNameWrong |= (MasterPageName == CommonStrings::masterPageNormal);
MasterPageNameWrong |= (MasterPageName == CommonStrings::trMasterPageNormal);
MasterPageNameWrong |= (MasterPageName == CommonStrings::trMasterPageNormalLeft);
@@ -348,8 +348,8 @@
MasterPageNameWrong |= (MasterPageName == CommonStrings::trMasterPageNormalRight);
MasterPageNameWrong |= MasterPageName.isEmpty();
}
- currentDoc->setCurrentPage(currentDoc->addMasterPage(nr, MasterPageName));
- if (currentDoc->pagePositioning() != singlePage)
+ m_doc->setCurrentPage(m_doc->addMasterPage(nr, MasterPageName));
+ if (m_doc->pagePositioning() != singlePage)
{
int lp = dia->Links->currentIndex();
if (lp == 0)
@@ -358,13 +358,13 @@
lp = 0;
else
lp++;
- currentDoc->Pages->at(nr)->LeftPg = lp;
+ m_doc->Pages->at(nr)->LeftPg = lp;
}
updateMasterPageList(MasterPageName);
//#8321 : incorrect selection of master page on new mp creation/duplictation
- //currentView->showMasterPage(currentDoc->MasterNames[MasterPageName]);
+ //m_view->showMasterPage(m_doc->MasterNames[MasterPageName]);
selectMasterPage(MasterPageName);
- currentView->reformPages();
+ m_view->reformPages();
}
if (activeTransaction)
{
@@ -384,46 +384,46 @@
MergeDoc *dia = new MergeDoc(this, true);
if (dia->exec())
{
- if (currentDoc->appMode == modeEditClip)
- currentView->requestMode(submodeEndNodeEdit);
+ if (m_doc->appMode == modeEditClip)
+ m_view->requestMode(submodeEndNodeEdit);
qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
- int nr = currentDoc->Pages->count();
- //currentDoc->pageCount = 0;
- //atf = currentDoc->usesAutomaticTextFrames();
- //currentDoc->setUsesAutomaticTextFrames(false);
+ int nr = m_doc->Pages->count();
+ //m_doc->pageCount = 0;
+ //atf = m_doc->usesAutomaticTextFrames();
+ //m_doc->setUsesAutomaticTextFrames(false);
//emit createNew(nr);
QString MasterPageName(dia->getMasterPageNameText());
QString MasterPageName2(MasterPageName);
int copyC = 1;
- while (currentDoc->MasterNames.contains(MasterPageName2))
+ while (m_doc->MasterNames.contains(MasterPageName2))
{
MasterPageName2 = tr("Copy #%1 of ").arg(copyC)+MasterPageName;
copyC++;
}
- currentDoc->setCurrentPage(currentDoc->addMasterPage(nr, MasterPageName2));
+ m_doc->setCurrentPage(m_doc->addMasterPage(nr, MasterPageName2));
qApp->processEvents();
//CB TODO: If we are loading to a new name, we rely on doc->onpage in
//FileLoader::PasteItem as this call doesnt pass in the new destination page
- currentDoc->scMW()->loadPage(dia->getFromDoc(), dia->getMasterPageNameItem(), true, MasterPageName2);
+ m_doc->scMW()->loadPage(dia->getFromDoc(), dia->getMasterPageNameItem(), true, MasterPageName2);
qApp->processEvents();
/*
- MasterPageName = currentDoc->Pages->at(nr)->PageNam;
+ MasterPageName = m_doc->Pages->at(nr)->PageNam;
MasterPageName2 = MasterPageName;
int copyC = 1;
- while (currentDoc->MasterNames.contains(MasterPageName2))
+ while (m_doc->MasterNames.contains(MasterPageName2))
{
MasterPageName2 = tr("Copy #%1 of ").arg(copyC)+MasterPageName;
copyC++;
}
- currentDoc->MasterNames.insert(MasterPageName2, nr);
- currentDoc->Pages->at(nr)->setPageName(MasterPageName2);
- currentDoc->Pages->at(nr)->MPageNam = "";
+ m_doc->MasterNames.insert(MasterPageName2, nr);
+ m_doc->Pages->at(nr)->setPageName(MasterPageName2);
+ m_doc->Pages->at(nr)->MPageNam = "";
*/
updateMasterPageList(MasterPageName2);
- //currentDoc->setUsesAutomaticTextFrames(atf);
- currentView->showMasterPage(currentDoc->MasterNames[MasterPageName2]);
+ //m_doc->setUsesAutomaticTextFrames(atf);
+ m_view->showMasterPage(m_doc->MasterNames[MasterPageName2]);
qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
- //currentDoc->MasterPages = currentDoc->Pages;
+ //m_doc->MasterPages = m_doc->Pages;
}
if (activeTransaction)
{
@@ -436,50 +436,50 @@
void MasterPagesPalette::selectMasterPage(QListWidgetItem *item)
{
- sMuster = item->text();
- deleteButton->setEnabled(currentDoc->MasterNames.count() == 1 ? false : true);
- if (sMuster == CommonStrings::trMasterPageNormal || sMuster == CommonStrings::masterPageNormal)
- {
-// sMuster = CommonStrings::masterPageNormal;
+ m_masterPage = item->text();
+ deleteButton->setEnabled(m_doc->MasterNames.count() == 1 ? false : true);
+ if (m_masterPage == CommonStrings::trMasterPageNormal || m_masterPage == CommonStrings::masterPageNormal)
+ {
+// m_masterPage = CommonStrings::masterPageNormal;
deleteButton->setEnabled(false);
}
else
deleteButton->setEnabled(true);
- if (currentDoc->appMode == modeEditClip)
- currentView->requestMode(submodeEndNodeEdit);
- else if (currentDoc->appMode == modeEdit || currentDoc->appMode == modeEditGradientVectors)
- currentView->requestMode(modeNormal);
- currentView->showMasterPage(currentDoc->MasterNames[sMuster]);
+ if (m_doc->appMode == modeEditClip)
+ m_view->requestMode(submodeEndNodeEdit);
+ else if (m_doc->appMode == modeEdit || m_doc->appMode == modeEditGradientVectors)
+ m_view->requestMode(modeNormal);
+ m_view->showMasterPage(m_doc->MasterNames[m_masterPage]);
}
void MasterPagesPalette::selectMasterPage(QString name)
{
- sMuster = name;
- deleteButton->setEnabled(currentDoc->MasterNames.count() == 1 ? false : true);
- if (sMuster == CommonStrings::trMasterPageNormal)
- {
- sMuster = CommonStrings::masterPageNormal;
+ m_masterPage = name;
+ deleteButton->setEnabled(m_doc->MasterNames.count() == 1 ? false : true);
+ if (m_masterPage == CommonStrings::trMasterPageNormal)
+ {
+ m_masterPage = CommonStrings::masterPageNormal;
deleteButton->setEnabled(false);
}
else
deleteButton->setEnabled(true);
- if (currentDoc->appMode == modeEditClip)
- currentView->requestMode(submodeEndNodeEdit);
- currentView->showMasterPage(currentDoc->MasterNames[sMuster]);
+ if (m_doc->appMode == modeEditClip)
+ m_view->requestMode(submodeEndNodeEdit);
+ m_view->showMasterPage(m_doc->MasterNames[m_masterPage]);
}
void MasterPagesPalette::updateMasterPageList(void)
{
- QString masterPageName = (currentDoc->MasterNames.contains(sMuster)) ? sMuster : CommonStrings::masterPageNormal;
+ QString masterPageName = (m_doc->MasterNames.contains(m_masterPage)) ? m_masterPage : CommonStrings::masterPageNormal;
updateMasterPageList(masterPageName);
}
void MasterPagesPalette::updateMasterPageList(QString MasterPageName)
{
masterPageListBox->clear();
- for (QMap<QString,int>::Iterator it = currentDoc->MasterNames.begin(); it != currentDoc->MasterNames.end(); ++it)
+ for (QMap<QString,int>::Iterator it = m_doc->MasterNames.begin(); it != m_doc->MasterNames.end(); ++it)
masterPageListBox->addItem(it.key() == CommonStrings::masterPageNormal ? CommonStrings::trMasterPageNormal : it.key());
- deleteButton->setEnabled(currentDoc->MasterNames.count() == 1 ? false : true);
+ deleteButton->setEnabled(m_doc->MasterNames.count() == 1 ? false : true);
if (MasterPageName == CommonStrings::masterPageNormal)
{
MasterPageName = CommonStrings::trMasterPageNormal;
@@ -502,7 +502,7 @@
QString newName = QInputDialog::getText( this, tr("Rename Master Page"), tr("New Name:"), QLineEdit::Normal, oldName, &ok);
if (ok && !newName.isEmpty())
{
- if (currentDoc->renameMasterPage( oldName, newName))
+ if (m_doc->renameMasterPage( oldName, newName))
updateMasterPageList(newName);
}
}
Modified: trunk/Scribus/scribus/ui/masterpagepalette.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18326&path=/trunk/Scribus/scribus/ui/masterpagepalette.h
==============================================================================
--- trunk/Scribus/scribus/ui/masterpagepalette.h (original)
+++ trunk/Scribus/scribus/ui/masterpagepalette.h Mon Jun 17 23:03:50 2013
@@ -46,15 +46,16 @@
private:
QListWidget* masterPageListBox;
- QString sMuster;
QToolButton* closeButton;
QToolButton* deleteButton;
QToolButton* duplicateButton;
QToolButton* importButton;
QToolButton* newButton;
- ScribusDoc *currentDoc;
+
+ QString m_masterPage;
+ ScribusDoc *m_doc;
+ ScribusView *m_view;
UndoManager *undoManager;
- ScribusView *currentView;
protected:
QVBoxLayout* masterPagesLayout;
Modified: trunk/Scribus/scribus/ui/pagepalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18326&path=/trunk/Scribus/scribus/ui/pagepalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/pagepalette.cpp (original)
+++ trunk/Scribus/scribus/ui/pagepalette.cpp Mon Jun 17 23:03:50 2013
@@ -177,7 +177,7 @@
{
ScribusDoc* doc = m_view->Doc;
PagePalette_MasterPages* mpWidget = this->masterpageWidget();
- if (mpWidget->currentView != m_view)
+ if (mpWidget->m_view != m_view)
mpWidget->setView(m_view, masterPage);
mpWidget->updateMasterPageList(masterPage);
if (doc->currentPage()->pageName() != masterPage)
Modified: trunk/Scribus/scribus/ui/pagepalette_masterpages.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18326&path=/trunk/Scribus/scribus/ui/pagepalette_masterpages.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/pagepalette_masterpages.cpp (original)
+++ trunk/Scribus/scribus/ui/pagepalette_masterpages.cpp Mon Jun 17 23:03:50 2013
@@ -35,8 +35,8 @@
PagePalette_MasterPages::PagePalette_MasterPages( QWidget* parent, ScribusView *pCurrentView, QString masterPageName) : QWidget(parent)
{
- currentDoc = pCurrentView->Doc;
- currentView = pCurrentView;
+ m_doc = pCurrentView->Doc;
+ m_view = pCurrentView;
setupUi(this);
@@ -50,11 +50,11 @@
languageChange();
if (masterPageName.isEmpty())
- currentPage = currentDoc->MasterNames.begin().key();
+ m_currentPage = m_doc->MasterNames.begin().key();
else
- currentPage = masterPageName;
- updateMasterPageList(currentPage);
- currentView->showMasterPage(currentDoc->MasterNames[currentPage]);
+ m_currentPage = masterPageName;
+ updateMasterPageList(m_currentPage);
+ m_view->showMasterPage(m_doc->MasterNames[m_currentPage]);
setMinimumSize(sizeHint());
@@ -64,12 +64,12 @@
void PagePalette_MasterPages::setView(ScribusView* view, QString masterPageName)
{
-// ScribusView* oldView = currentView;
-// QString oldPage = currentPage;
+// ScribusView* oldView = m_view;
+// QString oldPage = m_currentPage;
disconnectSignals();
- currentView = view;
- currentDoc = currentView ? currentView->Doc : 0;
+ m_view = view;
+ m_doc = m_view ? m_view->Doc : 0;
if (!view)
{
@@ -77,20 +77,20 @@
return;
}
- if (masterPageName.isEmpty() && currentDoc->masterPageMode())
- currentPage = currentDoc->currentPage()->pageName();
+ if (masterPageName.isEmpty() && m_doc->masterPageMode())
+ m_currentPage = m_doc->currentPage()->pageName();
else if (masterPageName.isEmpty())
- currentPage = currentDoc->MasterNames.begin().key();
+ m_currentPage = m_doc->MasterNames.begin().key();
else
- currentPage = masterPageName;
+ m_currentPage = masterPageName;
QString currentPageName;
- if (currentDoc->masterPageMode())
- currentPageName = currentDoc->currentPage()->pageName();
- if (currentDoc->masterPageMode() && currentPage != currentPageName)
- currentView->showMasterPage(currentDoc->MasterNames[currentPage]);
-
- this->setEnabled(currentDoc->masterPageMode());
+ if (m_doc->masterPageMode())
+ currentPageName = m_doc->currentPage()->pageName();
+ if (m_doc->masterPageMode() && m_currentPage != currentPageName)
+ m_view->showMasterPage(m_doc->MasterNames[m_currentPage]);
+
+ this->setEnabled(m_doc->masterPageMode());
connectSignals();
}
@@ -136,27 +136,27 @@
// allow to delete multiple pages in one step
foreach (QListWidgetItem * delItem, masterPageListBox->selectedItems())
{
- currentPage = delItem->text();
-
- if ((currentPage == CommonStrings::masterPageNormal)
- || (currentPage == CommonStrings::trMasterPageNormal)
- || (currentPage == CommonStrings::trMasterPageNormalLeft)
- || (currentPage == CommonStrings::trMasterPageNormalMiddle)
- || (currentPage == CommonStrings::trMasterPageNormalRight))
+ m_currentPage = delItem->text();
+
+ if ((m_currentPage == CommonStrings::masterPageNormal)
+ || (m_currentPage == CommonStrings::trMasterPageNormal)
+ || (m_currentPage == CommonStrings::trMasterPageNormalLeft)
+ || (m_currentPage == CommonStrings::trMasterPageNormalMiddle)
+ || (m_currentPage == CommonStrings::trMasterPageNormalRight))
continue;
QString extraWarn = "";
if (!forceDelete)
{
- for (int i=0; i < currentDoc->DocPages.count(); ++i )
- {
- if (currentDoc->DocPages[i]->MPageNam == currentPage)
+ for (int i=0; i < m_doc->DocPages.count(); ++i )
+ {
+ if (m_doc->DocPages[i]->MPageNam == m_currentPage)
extraWarn = tr("This master page is used at least once in the document.");
}
int exit = QMessageBox::warning(this,
CommonStrings::trWarning,
- tr("Do you really want to delete master page \"%1\"?").arg(currentPage)+"\n"+extraWarn,
+ tr("Do you really want to delete master page \"%1\"?").arg(m_currentPage)+"\n"+extraWarn,
QMessageBox::Yes | QMessageBox::YesToAll | QMessageBox::No | QMessageBox::Cancel);
if (exit == QMessageBox::YesToAll)
@@ -167,36 +167,36 @@
break;
}
- if (currentDoc->appMode == modeEditClip)
- currentView->requestMode(submodeEndNodeEdit);
- currentDoc->scMW()->deletePage2(currentDoc->MasterNames[currentPage]);
+ if (m_doc->appMode == modeEditClip)
+ m_view->requestMode(submodeEndNodeEdit);
+ m_doc->scMW()->deletePage2(m_doc->MasterNames[m_currentPage]);
//<<CB TODO Move back into ScribusDoc::deleteMasterPage();
//This must happen after the pages have been reformed (view/doc)
- currentDoc->rebuildMasterNames();
+ m_doc->rebuildMasterNames();
// Fix up any pages that refer to the deleted master page
- currentDoc->replaceMasterPage(currentPage);
+ m_doc->replaceMasterPage(m_currentPage);
}
// set the 1st MP for the other slots
- QMap<QString,int>::Iterator it = currentDoc->MasterNames.begin();
- currentPage = it.key();
- updateMasterPageList(currentPage);
+ QMap<QString,int>::Iterator it = m_doc->MasterNames.begin();
+ m_currentPage = it.key();
+ updateMasterPageList(m_currentPage);
}
void PagePalette_MasterPages::duplicateMasterPage()
{
int copyC = 1;
- QString potentialMasterPageName(currentPage);
- while (currentDoc->MasterNames.contains(potentialMasterPageName))
- potentialMasterPageName = tr("Copy #%1 of %2").arg(copyC++).arg(currentPage);
-
- NewTm *dia = new NewTm(this, tr("&Name:"), tr("New Master Page"), currentDoc, potentialMasterPageName);
+ QString potentialMasterPageName(m_currentPage);
+ while (m_doc->MasterNames.contains(potentialMasterPageName))
+ potentialMasterPageName = tr("Copy #%1 of %2").arg(copyC++).arg(m_currentPage);
+
+ NewTm *dia = new NewTm(this, tr("&Name:"), tr("New Master Page"), m_doc, potentialMasterPageName);
if (dia->exec())
{
- if (currentDoc->appMode == modeEditClip)
- currentView->requestMode(submodeEndNodeEdit);
+ if (m_doc->appMode == modeEditClip)
+ m_view->requestMode(submodeEndNodeEdit);
QString MasterPageName = dia->Answer->text();
- bool MasterPageNameWrong = currentDoc->MasterNames.contains(MasterPageName);
+ bool MasterPageNameWrong = m_doc->MasterNames.contains(MasterPageName);
MasterPageNameWrong |= (MasterPageName == CommonStrings::masterPageNormal);
MasterPageNameWrong |= (MasterPageName == CommonStrings::trMasterPageNormal);
MasterPageNameWrong |= (MasterPageName == CommonStrings::trMasterPageNormalLeft);
@@ -211,7 +211,7 @@
return;
}
MasterPageName = dia->Answer->text();
- bool MasterPageNameWrong = currentDoc->MasterNames.contains(MasterPageName);
+ bool MasterPageNameWrong = m_doc->MasterNames.contains(MasterPageName);
MasterPageNameWrong |= (MasterPageName == CommonStrings::masterPageNormal);
MasterPageNameWrong |= (MasterPageName == CommonStrings::trMasterPageNormal);
MasterPageNameWrong |= (MasterPageName == CommonStrings::trMasterPageNormalLeft);
@@ -220,11 +220,11 @@
MasterPageNameWrong |= MasterPageName.isEmpty();
}
PrefsManager* prefsManager = PrefsManager::instance();
- int inde = currentDoc->MasterNames[currentPage];
- int nr = currentDoc->Pages->count();
- ScPage* from = currentDoc->Pages->at(inde);
- ScPage* destination = currentDoc->addMasterPage(nr, MasterPageName);
- if (currentDoc->pagePositioning() != singlePage)
+ int inde = m_doc->MasterNames[m_currentPage];
+ int nr = m_doc->Pages->count();
+ ScPage* from = m_doc->Pages->at(inde);
+ ScPage* destination = m_doc->addMasterPage(nr, MasterPageName);
+ if (m_doc->pagePositioning() != singlePage)
{
int lp = dia->Links->currentIndex();
if (lp == 0)
@@ -237,7 +237,7 @@
}
destination->initialMargins.Top = from->initialMargins.Top;
destination->initialMargins.Bottom = from->initialMargins.Bottom;
- if (currentDoc->pageSets()[currentDoc->pagePositioning()].Columns == 1)
+ if (m_doc->pageSets()[m_doc->pagePositioning()].Columns == 1)
{
destination->initialMargins.Left = from->initialMargins.Left;
destination->initialMargins.Right = from->initialMargins.Right;
@@ -264,49 +264,49 @@
}
}
//#8321 : incorrect selection of master page on new mp creation/duplictation
- //currentDoc->setCurrentPage(destination);
+ //m_doc->setCurrentPage(destination);
selectMasterPage(MasterPageName);
- uint oldItems = currentDoc->Items->count();
- uint end2 = currentDoc->MasterItems.count();
- int GrMax = currentDoc->GroupCounter;
- currentDoc->m_Selection->clear();
+ uint oldItems = m_doc->Items->count();
+ uint end2 = m_doc->MasterItems.count();
+ int GrMax = m_doc->GroupCounter;
+ m_doc->m_Selection->clear();
if (oldItems>0)
{
ScLayers::iterator it;
- currentDoc->m_Selection->delaySignalsOn();
- for (it = currentDoc->Layers.begin(); it != currentDoc->Layers.end(); ++it)
+ m_doc->m_Selection->delaySignalsOn();
+ for (it = m_doc->Layers.begin(); it != m_doc->Layers.end(); ++it)
{
for (uint ite = 0; ite < oldItems; ++ite)
{
- PageItem *itemToCopy = currentDoc->Items->at(ite);
+ PageItem *itemToCopy = m_doc->Items->at(ite);
if (itemToCopy->OwnPage == inde && (it->ID == itemToCopy->LayerID))
- currentDoc->m_Selection->addItem(itemToCopy, true);
+ m_doc->m_Selection->addItem(itemToCopy, true);
}
- if (currentDoc->m_Selection->count() != 0)
+ if (m_doc->m_Selection->count() != 0)
{
ScriXmlDoc ss;
- QString buffer = ss.WriteElem(currentDoc, currentDoc->m_Selection);
- ss.ReadElemToLayer(buffer, prefsManager->appPrefs.fontPrefs.AvailFonts, currentDoc, destination->xOffset(), destination->yOffset(), false, true, prefsManager->appPrefs.fontPrefs.GFontSub, it->ID);
- currentDoc->m_Selection->clear();
+ QString buffer = ss.WriteElem(m_doc, m_doc->m_Selection);
+ ss.ReadElemToLayer(buffer, prefsManager->appPrefs.fontPrefs.AvailFonts, m_doc, destination->xOffset(), destination->yOffset(), false, true, prefsManager->appPrefs.fontPrefs.GFontSub, it->ID);
+ m_doc->m_Selection->clear();
}
}
- currentDoc->m_Selection->clear();
- currentDoc->m_Selection->delaySignalsOff();
- }
- uint end3 = currentDoc->MasterItems.count();
+ m_doc->m_Selection->clear();
+ m_doc->m_Selection->delaySignalsOff();
+ }
+ uint end3 = m_doc->MasterItems.count();
for (uint a = end2; a < end3; ++a)
{
- PageItem *newItem = currentDoc->MasterItems.at(a);
+ PageItem *newItem = m_doc->MasterItems.at(a);
newItem->OnMasterPage = MasterPageName;
- newItem->OwnPage = currentDoc->MasterNames[MasterPageName];
+ newItem->OwnPage = m_doc->MasterNames[MasterPageName];
}
from->guides.copy(&destination->guides);
- currentDoc->GroupCounter = GrMax + 1;
- currentView->Deselect(true);
+ m_doc->GroupCounter = GrMax + 1;
+ m_view->Deselect(true);
updateMasterPageList(MasterPageName);
- currentDoc->setLoading(false);
- currentView->reformPages();
- currentView->DrawNew();
+ m_doc->setLoading(false);
+ m_view->reformPages();
+ m_view->DrawNew();
}
delete dia;
}
@@ -314,14 +314,14 @@
void PagePalette_MasterPages::newMasterPage()
{
QString MasterPageName;
- int nr = currentDoc->Pages->count();
- NewTm *dia = new NewTm(this, tr("Name:"), tr("New MasterPage"), currentDoc, tr("New Master Page %1").arg(nr));
+ int nr = m_doc->Pages->count();
+ NewTm *dia = new NewTm(this, tr("Name:"), tr("New MasterPage"), m_doc, tr("New Master Page %1").arg(nr));
if (dia->exec())
{
- if (currentDoc->appMode == modeEditClip)
- currentView->requestMode(submodeEndNodeEdit);
+ if (m_doc->appMode == modeEditClip)
+ m_view->requestMode(submodeEndNodeEdit);
MasterPageName = dia->Answer->text();
- bool MasterPageNameWrong = currentDoc->MasterNames.contains(MasterPageName);
+ bool MasterPageNameWrong = m_doc->MasterNames.contains(MasterPageName);
MasterPageNameWrong |= (MasterPageName == CommonStrings::masterPageNormal);
MasterPageNameWrong |= (MasterPageName == CommonStrings::trMasterPageNormal);
MasterPageNameWrong |= (MasterPageName == CommonStrings::trMasterPageNormalLeft);
@@ -336,7 +336,7 @@
return;
}
MasterPageName = dia->Answer->text();
- MasterPageNameWrong = currentDoc->MasterNames.contains(MasterPageName);
+ MasterPageNameWrong = m_doc->MasterNames.contains(MasterPageName);
MasterPageNameWrong |= (MasterPageName == CommonStrings::masterPageNormal);
MasterPageNameWrong |= (MasterPageName == CommonStrings::trMasterPageNormal);
MasterPageNameWrong |= (MasterPageName == CommonStrings::trMasterPageNormalLeft);
@@ -344,8 +344,8 @@
MasterPageNameWrong |= (MasterPageName == CommonStrings::trMasterPageNormalRight);
MasterPageNameWrong |= MasterPageName.isEmpty();
}
- currentDoc->setCurrentPage(currentDoc->addMasterPage(nr, MasterPageName));
- if (currentDoc->pagePositioning() != singlePage)
+ m_doc->setCurrentPage(m_doc->addMasterPage(nr, MasterPageName));
+ if (m_doc->pagePositioning() != singlePage)
{
int lp = dia->Links->currentIndex();
if (lp == 0)
@@ -354,13 +354,13 @@
lp = 0;
else
lp++;
- currentDoc->Pages->at(nr)->LeftPg = lp;
+ m_doc->Pages->at(nr)->LeftPg = lp;
}
updateMasterPageList(MasterPageName);
//#8321 : incorrect selection of master page on new mp creation/duplictation
- //currentView->showMasterPage(currentDoc->MasterNames[MasterPageName]);
+ //m_view->showMasterPage(m_doc->MasterNames[MasterPageName]);
selectMasterPage(MasterPageName);
- currentView->reformPages();
+ m_view->reformPages();
}
delete dia;
}
@@ -370,28 +370,28 @@
MergeDoc *dia = new MergeDoc(this, true);
if (dia->exec())
{
- if (currentDoc->appMode == modeEditClip)
- currentView->requestMode(submodeEndNodeEdit);
+ if (m_doc->appMode == modeEditClip)
+ m_view->requestMode(submodeEndNodeEdit);
qApp->setOverrideCursor(QCursor(Qt::WaitCursor));
- int nr = currentDoc->Pages->count();
+ int nr = m_doc->Pages->count();
QString MasterPageName(dia->getMasterPageNameText());
QString MasterPageName2(MasterPageName);
int copyC = 1;
- while (currentDoc->MasterNames.contains(MasterPageName2))
+ while (m_doc->MasterNames.contains(MasterPageName2))
{
MasterPageName2 = tr("Copy #%1 of ").arg(copyC)+MasterPageName;
copyC++;
}
- currentDoc->setCurrentPage(currentDoc->addMasterPage(nr, MasterPageName2));
+ m_doc->setCurrentPage(m_doc->addMasterPage(nr, MasterPageName2));
qApp->processEvents();
//CB TODO: If we are loading to a new name, we rely on doc->onpage in
//FileLoader::PasteItem as this call doesnt pass in the new destination page
- currentDoc->scMW()->loadPage(dia->getFromDoc(), dia->getMasterPageNameItem(), true, MasterPageName2);
+ m_doc->scMW()->loadPage(dia->getFromDoc(), dia->getMasterPageNameItem(), true, MasterPageName2);
qApp->processEvents();
updateMasterPageList(MasterPageName2);
- currentView->showMasterPage(currentDoc->MasterNames[MasterPageName2]);
+ m_view->showMasterPage(m_doc->MasterNames[MasterPageName2]);
qApp->restoreOverrideCursor();
}
delete dia;
@@ -399,57 +399,57 @@
void PagePalette_MasterPages::selectMasterPage(QListWidgetItem *item)
{
- currentPage = item->text();
- deleteButton->setEnabled(currentDoc->MasterNames.count() == 1 ? false : true);
- if (currentPage == CommonStrings::trMasterPageNormal || currentPage == CommonStrings::masterPageNormal)
+ m_currentPage = item->text();
+ deleteButton->setEnabled(m_doc->MasterNames.count() == 1 ? false : true);
+ if (m_currentPage == CommonStrings::trMasterPageNormal || m_currentPage == CommonStrings::masterPageNormal)
deleteButton->setEnabled(false);
else
deleteButton->setEnabled(true);
- if (currentDoc->appMode == modeEditClip)
- currentView->requestMode(submodeEndNodeEdit);
- else if (currentDoc->appMode == modeEdit || currentDoc->appMode == modeEditGradientVectors)
- currentView->requestMode(modeNormal);
- currentView->showMasterPage(currentDoc->MasterNames[currentPage]);
+ if (m_doc->appMode == modeEditClip)
+ m_view->requestMode(submodeEndNodeEdit);
+ else if (m_doc->appMode == modeEdit || m_doc->appMode == modeEditGradientVectors)
+ m_view->requestMode(modeNormal);
+ m_view->showMasterPage(m_doc->MasterNames[m_currentPage]);
this->setEnabled(true);
}
void PagePalette_MasterPages::selectMasterPage(QString name)
{
- if (!currentDoc || !currentView)
+ if (!m_doc || !m_view)
return;
- currentPage = name;
- deleteButton->setEnabled(currentDoc->MasterNames.count() == 1 ? false : true);
- if (currentPage == CommonStrings::trMasterPageNormal)
- {
- currentPage = CommonStrings::masterPageNormal;
+ m_currentPage = name;
+ deleteButton->setEnabled(m_doc->MasterNames.count() == 1 ? false : true);
+ if (m_currentPage == CommonStrings::trMasterPageNormal)
+ {
+ m_currentPage = CommonStrings::masterPageNormal;
deleteButton->setEnabled(false);
}
else
deleteButton->setEnabled(true);
- if (currentDoc->appMode == modeEditClip)
- currentView->requestMode(submodeEndNodeEdit);
- currentView->showMasterPage(currentDoc->MasterNames[currentPage]);
+ if (m_doc->appMode == modeEditClip)
+ m_view->requestMode(submodeEndNodeEdit);
+ m_view->showMasterPage(m_doc->MasterNames[m_currentPage]);
this->setEnabled(true);
}
void PagePalette_MasterPages::updateMasterPageList(void)
{
- QString masterPageName = (currentDoc->MasterNames.contains(currentPage)) ? currentPage : CommonStrings::masterPageNormal;
+ QString masterPageName = (m_doc->MasterNames.contains(m_currentPage)) ? m_currentPage : CommonStrings::masterPageNormal;
updateMasterPageList(masterPageName);
}
void PagePalette_MasterPages::updateMasterPageList(QString masterPageName)
{
- if (!currentDoc || !currentView)
+ if (!m_doc || !m_view)
return;
masterPageListBox->clear();
- for (QMap<QString,int>::Iterator it = currentDoc->MasterNames.begin(); it != currentDoc->MasterNames.end(); ++it)
+ for (QMap<QString,int>::Iterator it = m_doc->MasterNames.begin(); it != m_doc->MasterNames.end(); ++it)
masterPageListBox->addItem(it.key() == CommonStrings::masterPageNormal ? CommonStrings::trMasterPageNormal : it.key());
- deleteButton->setEnabled(currentDoc->MasterNames.count() == 1 ? false : true);
+ deleteButton->setEnabled(m_doc->MasterNames.count() == 1 ? false : true);
if (masterPageName == CommonStrings::masterPageNormal)
{
masterPageName = CommonStrings::trMasterPageNormal;
@@ -472,7 +472,7 @@
QString newName = QInputDialog::getText( this, tr("Rename Master Page"), tr("New Name:"), QLineEdit::Normal, oldName, &ok);
if (ok && !newName.isEmpty())
{
- if (currentDoc->renameMasterPage( oldName, newName))
+ if (m_doc->renameMasterPage( oldName, newName))
updateMasterPageList(newName);
}
}
Modified: trunk/Scribus/scribus/ui/pagepalette_masterpages.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18326&path=/trunk/Scribus/scribus/ui/pagepalette_masterpages.h
==============================================================================
--- trunk/Scribus/scribus/ui/pagepalette_masterpages.h (original)
+++ trunk/Scribus/scribus/ui/pagepalette_masterpages.h Mon Jun 17 23:03:50 2013
@@ -42,9 +42,9 @@
void selectMasterPage(QString name);
private:
- QString currentPage;
- ScribusDoc *currentDoc;
- ScribusView *currentView;
+ QString m_currentPage;
+ ScribusDoc *m_doc;
+ ScribusView *m_view;
protected:
Modified: trunk/Scribus/scribus/ui/pdfopts.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18326&path=/trunk/Scribus/scribus/ui/pdfopts.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/pdfopts.cpp (original)
+++ trunk/Scribus/scribus/ui/pdfopts.cpp Mon Jun 17 23:03:50 2013
@@ -46,15 +46,15 @@
ScribusView *currView, PDFOptions & pdfOptions,
const QList<PDFPresentationData> & Eff,
const ProfilesL & PDFXProfiles, const SCFonts &AllFonts,
- double unitRatio, const ProfilesL & printerProfiles)
+ const ProfilesL & printerProfiles)
: QDialog( parent ),
- doc(currView->Doc),
- EffVal(Eff),
- Opts(pdfOptions),
- docUnitRatio(unitRatio),
- cmsDescriptorName(""),
- components(3),
- appPrinterProfiles(printerProfiles)
+ m_doc(currView->Doc),
+ m_presEffects(Eff),
+ m_opts(pdfOptions),
+ m_unitRatio(currView->Doc->unitRatio()),
+ m_cmsDescriptor(""),
+ m_components(3),
+ m_printerProfiles(printerProfiles)
{
setModal(true);
setWindowTitle( tr( "Save as PDF" ) );
@@ -70,8 +70,8 @@
NameLayout->setAlignment( Qt::AlignTop );
fileNameLineEdit = new QLineEdit( Name );
fileNameLineEdit->setMinimumSize( QSize( 268, 22 ) );
- if (!Opts.fileName.isEmpty())
- fileNameLineEdit->setText( QDir::toNativeSeparators(Opts.fileName) );
+ if (!m_opts.fileName.isEmpty())
+ fileNameLineEdit->setText( QDir::toNativeSeparators(m_opts.fileName) );
else
{
QFileInfo fi(docFileName);
@@ -101,10 +101,10 @@
FileC->setMinimumSize( QSize( 88, 24 ) );
NameLayout->addWidget( FileC, 0, 1 );
multiFile = new QCheckBox( tr( "Output one file for eac&h page" ), Name );
- multiFile->setChecked(Opts.doMultiFile);
+ multiFile->setChecked(m_opts.doMultiFile);
NameLayout->addWidget( multiFile, 1, 0 );
openAfterExportCheckBox = new QCheckBox( tr( "Open PDF after Export" ), Name );
- openAfterExportCheckBox->setChecked(Opts.openAfterExport);
+ openAfterExportCheckBox->setChecked(m_opts.openAfterExport);
NameLayout->addWidget( openAfterExportCheckBox, 2, 0 );
PDFExportLayout->addWidget( Name );
@@ -124,7 +124,7 @@
Cancel = new QPushButton( CommonStrings::tr_Cancel, this );
Layout7->addWidget( Cancel );
PDFExportLayout->addLayout( Layout7 );
- if ((Opts.Version == PDFOptions::PDFVersion_X3) && (Options->InfoString->text().isEmpty()))
+ if ((m_opts.Version == PDFOptions::PDFVersion_X3) && (Options->InfoString->text().isEmpty()))
OK->setEnabled(false);
resize(sizeHint());
// setMaximumSize( sizeHint() );
@@ -191,16 +191,16 @@
doIt = overwrite(this, fn);
if (doIt)
{
- EffVal = Options->EffVal;
- EffVal[Options->PgSel].pageViewDuration = Options->PageTime->value();
- EffVal[Options->PgSel].pageEffectDuration = Options->EffectTime->value();
- EffVal[Options->PgSel].effectType = Options->EffectType->currentIndex();
- EffVal[Options->PgSel].Dm = Options->EDirection->currentIndex();
- EffVal[Options->PgSel].M = Options->EDirection_2->currentIndex();
- EffVal[Options->PgSel].Di = Options->EDirection_2_2->currentIndex();
- Opts.LPISettings[Options->SelLPIcolor].Frequency = Options->LPIfreq->value();
- Opts.LPISettings[Options->SelLPIcolor].Angle = Options->LPIangle->value();
- Opts.LPISettings[Options->SelLPIcolor].SpotFunc = Options->LPIfunc->currentIndex();
+ m_presEffects = Options->EffVal;
+ m_presEffects[Options->PgSel].pageViewDuration = Options->PageTime->value();
+ m_presEffects[Options->PgSel].pageEffectDuration = Options->EffectTime->value();
+ m_presEffects[Options->PgSel].effectType = Options->EffectType->currentIndex();
+ m_presEffects[Options->PgSel].Dm = Options->EDirection->currentIndex();
+ m_presEffects[Options->PgSel].M = Options->EDirection_2->currentIndex();
+ m_presEffects[Options->PgSel].Di = Options->EDirection_2_2->currentIndex();
+ m_opts.LPISettings[Options->SelLPIcolor].Frequency = Options->LPIfreq->value();
+ m_opts.LPISettings[Options->SelLPIcolor].Angle = Options->LPIangle->value();
+ m_opts.LPISettings[Options->SelLPIcolor].SpotFunc = Options->LPIfunc->currentIndex();
accept();
}
else
@@ -235,56 +235,56 @@
void PDFExportDialog::updateDocOptions()
{
- Opts.fileName = QDir::fromNativeSeparators(fileNameLineEdit->text());
- Opts.doMultiFile = multiFile->isChecked();
- Opts.openAfterExport = openAfterExportCheckBox->isChecked();
- Opts.Thumbnails = Options->CheckBox1->isChecked();
- Opts.Compress = Options->Compression->isChecked();
- Opts.CompressMethod = (PDFOptions::PDFCompression) Options->CMethod->currentIndex();
- Opts.Quality = Options->CQuality->currentIndex();
- Opts.Resolution = Options->Resolution->value();
- Opts.EmbedList = Options->FontsToEmbed;
- Opts.SubsetList = Options->FontsToOutline;
- Opts.RecalcPic = Options->DSColor->isChecked();
- Opts.PicRes = Options->ValC->value();
- Opts.embedPDF = Options->EmbedPDF->isChecked();
- Opts.Bookmarks = Options->CheckBM->isChecked();
- Opts.Binding = Options->ComboBind->currentIndex();
- Opts.MirrorH = Options->MirrorH->isChecked();
- Opts.MirrorV = Options->MirrorV->isChecked();
- Opts.doClip = Options->ClipMarg->isChecked();
- Opts.RotateDeg = Options->RotateDeg->currentIndex() * 90;
- Opts.pageRangeSelection = Options->AllPages->isChecked() ? 0 : 1;
- Opts.pageRangeString = Options->PageNr->text();
- Opts.PresentMode = Options->CheckBox10->isChecked();
- Opts.PresentVals = EffVal;
- Opts.Articles = Options->Article->isChecked();
- Opts.Encrypt = Options->Encry->isChecked();
- Opts.UseLPI = Options->UseLPI->isChecked();
- Opts.useLayers = Options->useLayers->isChecked();
- Opts.UseSpotColors = !Options->useSpot->isChecked();
- Opts.displayBookmarks = Options->useBookmarks->isChecked();
- Opts.displayFullscreen = Options->useFullScreen->isChecked();
- Opts.displayLayers = Options->useLayers2->isChecked();
- Opts.displayThumbs = Options->useThumbnails->isChecked();
- Opts.hideMenuBar = Options->hideMenuBar->isChecked();
- Opts.hideToolBar = Options->hideToolBar->isChecked();
- Opts.fitWindow = Options->fitWindow->isChecked();
- Opts.useDocBleeds = Options->docBleeds->isChecked();
+ m_opts.fileName = QDir::fromNativeSeparators(fileNameLineEdit->text());
+ m_opts.doMultiFile = multiFile->isChecked();
+ m_opts.openAfterExport = openAfterExportCheckBox->isChecked();
+ m_opts.Thumbnails = Options->CheckBox1->isChecked();
+ m_opts.Compress = Options->Compression->isChecked();
+ m_opts.CompressMethod = (PDFOptions::PDFCompression) Options->CMethod->currentIndex();
+ m_opts.Quality = Options->CQuality->currentIndex();
+ m_opts.Resolution = Options->Resolution->value();
+ m_opts.EmbedList = Options->FontsToEmbed;
+ m_opts.SubsetList = Options->FontsToOutline;
+ m_opts.RecalcPic = Options->DSColor->isChecked();
+ m_opts.PicRes = Options->ValC->value();
+ m_opts.embedPDF = Options->EmbedPDF->isChecked();
+ m_opts.Bookmarks = Options->CheckBM->isChecked();
+ m_opts.Binding = Options->ComboBind->currentIndex();
+ m_opts.MirrorH = Options->MirrorH->isChecked();
+ m_opts.MirrorV = Options->MirrorV->isChecked();
+ m_opts.doClip = Options->ClipMarg->isChecked();
+ m_opts.RotateDeg = Options->RotateDeg->currentIndex() * 90;
+ m_opts.pageRangeSelection = Options->AllPages->isChecked() ? 0 : 1;
+ m_opts.pageRangeString = Options->PageNr->text();
+ m_opts.PresentMode = Options->CheckBox10->isChecked();
+ m_opts.PresentVals = m_presEffects;
+ m_opts.Articles = Options->Article->isChecked();
+ m_opts.Encrypt = Options->Encry->isChecked();
+ m_opts.UseLPI = Options->UseLPI->isChecked();
+ m_opts.useLayers = Options->useLayers->isChecked();
+ m_opts.UseSpotColors = !Options->useSpot->isChecked();
+ m_opts.displayBookmarks = Options->useBookmarks->isChecked();
+ m_opts.displayFullscreen = Options->useFullScreen->isChecked();
+ m_opts.displayLayers = Options->useLayers2->isChecked();
+ m_opts.displayThumbs = Options->useThumbnails->isChecked();
+ m_opts.hideMenuBar = Options->hideMenuBar->isChecked();
+ m_opts.hideToolBar = Options->hideToolBar->isChecked();
+ m_opts.fitWindow = Options->fitWindow->isChecked();
+ m_opts.useDocBleeds = Options->docBleeds->isChecked();
if (!Options->docBleeds->isChecked())
{
- Opts.bleeds.Top = Options->BleedTop->value()/docUnitRatio;
- Opts.bleeds.Left = Options->BleedLeft->value()/docUnitRatio;
- Opts.bleeds.Right = Options->BleedRight->value()/docUnitRatio;
- Opts.bleeds.Bottom = Options->BleedBottom->value()/docUnitRatio;
- }
- Opts.markLength = Options->markLength->value() / docUnitRatio;
- Opts.markOffset = Options->markOffset->value() / docUnitRatio;
- Opts.cropMarks = Options->cropMarks->isChecked();
- Opts.bleedMarks = Options->bleedMarks->isChecked();
- Opts.registrationMarks = Options->registrationMarks->isChecked();
- Opts.colorMarks = Options->colorMarks->isChecked();
- Opts.docInfoMarks = Options->docInfoMarks->isChecked();
+ m_opts.bleeds.Top = Options->BleedTop->value() / m_unitRatio;
+ m_opts.bleeds.Left = Options->BleedLeft->value() / m_unitRatio;
+ m_opts.bleeds.Right = Options->BleedRight->value() / m_unitRatio;
+ m_opts.bleeds.Bottom = Options->BleedBottom->value()/ m_unitRatio;
+ }
+ m_opts.markLength = Options->markLength->value() / m_unitRatio;
+ m_opts.markOffset = Options->markOffset->value() / m_unitRatio;
+ m_opts.cropMarks = Options->cropMarks->isChecked();
+ m_opts.bleedMarks = Options->bleedMarks->isChecked();
+ m_opts.registrationMarks = Options->registrationMarks->isChecked();
+ m_opts.colorMarks = Options->colorMarks->isChecked();
+ m_opts.docInfoMarks = Options->docInfoMarks->isChecked();
int pgl = PDFOptions::SinglePage;
if (Options->singlePage->isChecked())
pgl = PDFOptions::SinglePage;
@@ -294,11 +294,11 @@
pgl = PDFOptions::TwoColumnLeft;
else if (Options->doublePageRight->isChecked())
pgl = PDFOptions::TwoColumnRight;
- Opts.PageLayout = pgl;
+ m_opts.PageLayout = pgl;
if (Options->actionCombo->currentIndex() != 0)
- Opts.openAction = Options->actionCombo->currentText();
+ m_opts.openAction = Options->actionCombo->currentText();
else
- Opts.openAction = "";
+ m_opts.openAction = "";
if (Options->Encry->isChecked())
{
int Perm = -64;
@@ -312,78 +312,78 @@
Perm += 16;
if (Options->AddSec->isChecked())
Perm += 32;
- Opts.Permissions = Perm;
- Opts.PassOwner = Options->PassOwner->text();
- Opts.PassUser = Options->PassUser->text();
+ m_opts.Permissions = Perm;
+ m_opts.PassOwner = Options->PassOwner->text();
+ m_opts.PassUser = Options->PassUser->text();
}
if (Options->PDFVersionCombo->currentIndex() == 0)
- Opts.Version = PDFOptions::PDFVersion_13;
+ m_opts.Version = PDFOptions::PDFVersion_13;
if (Options->PDFVersionCombo->currentIndex() == 1)
- Opts.Version = PDFOptions::PDFVersion_14;
+ m_opts.Version = PDFOptions::PDFVersion_14;
if (Options->PDFVersionCombo->currentIndex() == 2)
- Opts.Version = PDFOptions::PDFVersion_15;
+ m_opts.Version = PDFOptions::PDFVersion_15;
if (Options->PDFVersionCombo->currentIndex() == 3)
- Opts.Version = PDFOptions::PDFVersion_X1a;
+ m_opts.Version = PDFOptions::PDFVersion_X1a;
if (Options->PDFVersionCombo->currentIndex() == 4)
- Opts.Version = PDFOptions::PDFVersion_X3;
+ m_opts.Version = PDFOptions::PDFVersion_X3;
if (Options->PDFVersionCombo->currentIndex() == 5)
- Opts.Version = PDFOptions::PDFVersion_X4;
+ m_opts.Version = PDFOptions::PDFVersion_X4;
if (Options->OutCombo->currentIndex() == 0)
{
- Opts.UseRGB = true;
- Opts.isGrayscale = false;
- Opts.UseProfiles = false;
- Opts.UseProfiles2 = false;
+ m_opts.UseRGB = true;
+ m_opts.isGrayscale = false;
+ m_opts.UseProfiles = false;
+ m_opts.UseProfiles2 = false;
}
else
{
if (Options->OutCombo->currentIndex() == 2)
{
- Opts.isGrayscale = true;
- Opts.UseRGB = false;
- Opts.UseProfiles = false;
- Opts.UseProfiles2 = false;
+ m_opts.isGrayscale = true;
+ m_opts.UseRGB = false;
+ m_opts.UseProfiles = false;
+ m_opts.UseProfiles2 = false;
}
else
{
- Opts.isGrayscale = false;
- Opts.UseRGB = false;
- if (doc->HasCMS)
+ m_opts.isGrayscale = false;
+ m_opts.UseRGB = false;
+ if (m_doc->HasCMS)
{
- Opts.UseProfiles = Options->EmbedProfs->isChecked();
- Opts.UseProfiles2 = Options->EmbedProfs2->isChecked();
- if (Opts.Version != PDFOptions::PDFVersion_X1a)
+ m_opts.UseProfiles = Options->EmbedProfs->isChecked();
+ m_opts.UseProfiles2 = Options->EmbedProfs2->isChecked();
+ if (m_opts.Version != PDFOptions::PDFVersion_X1a)
{
- Opts.Intent = Options->IntendS->currentIndex();
- Opts.Intent2 = Options->IntendI->currentIndex();
- Opts.EmbeddedI = Options->NoEmbedded->isChecked();
- Opts.SolidProf = Options->SolidPr->currentText();
- Opts.ImageProf = Options->ImageP->currentText();
+ m_opts.Intent = Options->IntendS->currentIndex();
+ m_opts.Intent2 = Options->IntendI->currentIndex();
+ m_opts.EmbeddedI = Options->NoEmbedded->isChecked();
+ m_opts.SolidProf = Options->SolidPr->currentText();
+ m_opts.ImageProf = Options->ImageP->currentText();
}
- Opts.PrintProf = Options->PrintProfC->currentText();
- if ((Opts.Version == PDFOptions::PDFVersion_X3) || (Opts.Version == PDFOptions::PDFVersion_X1a) || (Opts.Version == PDFOptions::PDFVersion_X4))
+ m_opts.PrintProf = Options->PrintProfC->currentText();
+ if ((m_opts.Version == PDFOptions::PDFVersion_X3) || (m_opts.Version == PDFOptions::PDFVersion_X1a) || (m_opts.Version == PDFOptions::PDFVersion_X4))
{
- ScColorProfile hIn = doc->colorEngine.openProfileFromFile( appPrinterProfiles[Opts.PrintProf] );
- cmsDescriptorName = hIn.productDescription();
+ ScColorProfile hIn = m_doc->colorEngine.openProfileFromFile( m_printerProfiles[m_opts.PrintProf] );
+ m_cmsDescriptor = hIn.productDescription();
if (hIn.colorSpace() == ColorSpace_Rgb)
- components = 3;
+ m_components = 3;
if (hIn.colorSpace() == ColorSpace_Cmyk)
- components = 4;
+ m_components = 4;
if (hIn.colorSpace() == ColorSpace_Cmy)
- components = 3;
- Opts.Info = Options->InfoString->text();
- Opts.Encrypt = false;
- Opts.MirrorH = false;
- Opts.MirrorV = false;
+ m_components = 3;
+ m_opts.Info = Options->InfoString->text();
+ m_opts.Encrypt = false;
+ m_opts.MirrorH = false;
+ m_opts.MirrorV = false;
//#8306 : PDF/X-3 export ignores rotation setting
- //Opts.RotateDeg = 0;
- Opts.PresentMode = false;
+ //m_opts.RotateDeg = 0;
+ m_opts.PresentMode = false;
}
}
else
{
- Opts.UseProfiles = false;
- Opts.UseProfiles2 = false;
+ m_opts.UseProfiles = false;
+ m_opts.UseProfiles2 = false;
}
}
}
@@ -391,12 +391,12 @@
const QString PDFExportDialog::cmsDescriptor()
{
- return cmsDescriptorName;
+ return m_cmsDescriptor;
}
const int PDFExportDialog::colorSpaceComponents()
{
- return components;
+ return m_components;
}
const QString PDFExportDialog::getPagesString()
Modified: trunk/Scribus/scribus/ui/pdfopts.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18326&path=/trunk/Scribus/scribus/ui/pdfopts.h
==============================================================================
--- trunk/Scribus/scribus/ui/pdfopts.h (original)
+++ trunk/Scribus/scribus/ui/pdfopts.h Mon Jun 17 23:03:50 2013
@@ -47,7 +47,7 @@
ScribusView * currView, PDFOptions & pdfOptions,
const QList<PDFPresentationData> & Eff,
const ProfilesL & PDFXProfiles, const SCFonts & AllFonts,
- double unitRatio, const ProfilesL & printerProfiles);
+ const ProfilesL & printerProfiles);
~PDFExportDialog() {};
void updateDocOptions();
@@ -77,13 +77,13 @@
TabPDFOptions* Options;
// Other members
- ScribusDoc* doc;
- QList<PDFPresentationData> EffVal;
- PDFOptions & Opts;
- double docUnitRatio;
- QString cmsDescriptorName;
- int components;
- const ProfilesL & appPrinterProfiles;
+ ScribusDoc* m_doc;
+ QList<PDFPresentationData> m_presEffects;
+ PDFOptions & m_opts;
+ double m_unitRatio;
+ QString m_cmsDescriptor;
+ int m_components;
+ const ProfilesL & m_printerProfiles;
};
#endif // PDF_OPTS_H
Modified: trunk/Scribus/scribus/ui/smlinestyle.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18326&path=/trunk/Scribus/scribus/ui/smlinestyle.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smlinestyle.cpp (original)
+++ trunk/Scribus/scribus/ui/smlinestyle.cpp Mon Jun 17 23:03:50 2013
@@ -21,23 +21,23 @@
#include "util.h"
-SMLineStyle::SMLineStyle() : StyleItem(), doc_(0), widget_(0), twidget_(0), selectionIsDirty_(false), unitRatio_(1.0)
+SMLineStyle::SMLineStyle() : StyleItem(), m_doc(0), m_widget(0), m_twidget(0), m_selectionIsDirty(false), m_unitRatio(1.0)
{
}
QTabWidget* SMLineStyle::widget()
{
- if (!twidget_)
- {
- twidget_ = new QTabWidget();
- widget_ = new SMLineStyleWidget();
- twidget_->addTab(widget_, tr("Properties"));
+ if (!m_twidget)
+ {
+ m_twidget = new QTabWidget();
+ m_widget = new SMLineStyleWidget();
+ m_twidget->addTab(m_widget, tr("Properties"));
unitChange();
-// connect(widget_->lineStyles, SIGNAL(highlighted(int)), this, SLOT(slotCurrentLineChanged(int)));
- connect(widget_->lineStyles, SIGNAL(currentRowChanged(int)), this, SLOT(slotCurrentLineChanged(int)));
- }
- return twidget_;
+// connect(m_widget->lineStyles, SIGNAL(highlighted(int)), this, SLOT(slotCurrentLineChanged(int)));
+ connect(m_widget->lineStyles, SIGNAL(currentRowChanged(int)), this, SLOT(slotCurrentLineChanged(int)));
+ }
+ return m_twidget;
}
QString SMLineStyle::typeNamePlural()
@@ -52,34 +52,34 @@
void SMLineStyle::setCurrentDoc(ScribusDoc *doc)
{
- doc_ = doc;
- if (doc_)
- {
- tmpLines = doc_->MLineStyles;
- selection_.clear();
- if (widget_)
- {
- if (unitRatio_ != doc_->unitRatio())
+ m_doc = doc;
+ if (m_doc)
+ {
+ m_tmpLines = m_doc->MLineStyles;
+ m_selection.clear();
+ if (m_widget)
+ {
+ if (m_unitRatio != m_doc->unitRatio())
unitChange();
}
}
else
{
- tmpLines.clear();
- selection_.clear();
+ m_tmpLines.clear();
+ m_selection.clear();
}
}
QList<StyleName> SMLineStyle::styles(bool reloadFromDoc)
{
- if (doc_ && reloadFromDoc) {
- tmpLines = doc_->MLineStyles;
+ if (m_doc && reloadFromDoc) {
+ m_tmpLines = m_doc->MLineStyles;
}
QList<StyleName> tmp;
QHash<QString,multiLine>::Iterator it;
- for (it = tmpLines.begin(); it != tmpLines.end(); ++it)
+ for (it = m_tmpLines.begin(); it != m_tmpLines.end(); ++it)
tmp << StyleName(it.key(), QString::null);
return tmp;
@@ -87,17 +87,17 @@
void SMLineStyle::reload()
{
- if (!doc_)
- return;
-
- selection_.clear();
- tmpLines = doc_->MLineStyles;
+ if (!m_doc)
+ return;
+
+ m_selection.clear();
+ m_tmpLines = m_doc->MLineStyles;
}
void SMLineStyle::selected(const QStringList &styleNames)
{
- selection_.clear();
- selectionIsDirty_ = false;
+ m_selection.clear();
+ m_selectionIsDirty = false;
removeConnections();
@@ -112,40 +112,40 @@
void SMLineStyle::setSelection(const QString& styleName)
{
- if (!doc_)
- return;
-
- if (!tmpLines.contains(styleName))
+ if (!m_doc)
+ return;
+
+ if (!m_tmpLines.contains(styleName))
return; // something's wrong here
- selection_.clear();
- selection_[styleName] = &tmpLines[styleName];
- widget_->showStyle(tmpLines[styleName], doc_->PageColors);
- currentLine_ = 0;
+ m_selection.clear();
+ m_selection[styleName] = &m_tmpLines[styleName];
+ m_widget->showStyle(m_tmpLines[styleName], m_doc->PageColors);
+ m_currentLine = 0;
}
void SMLineStyle::setMultiSelection(const QStringList& styles)
{
- selection_.clear();
+ m_selection.clear();
for (int i = 0; i < styles.count(); ++i)
{
- if (!tmpLines.contains(styles[i]))
+ if (!m_tmpLines.contains(styles[i]))
continue;
- selection_[styles[i]] = &tmpLines[styles[i]];
- }
- currentLine_ = 0;
+ m_selection[styles[i]] = &m_tmpLines[styles[i]];
+ }
+ m_currentLine = 0;
// todo do the tricks for clever showing of multiple styles
}
QString SMLineStyle::fromSelection() const
{
QString lsName(QString::null);
- if (!doc_)
+ if (!m_doc)
return lsName;
- for (int i = 0; i < doc_->m_Selection->count(); ++i)
- {
- PageItem *item = doc_->m_Selection->itemAt(i);
+ for (int i = 0; i < m_doc->m_Selection->count(); ++i)
+ {
+ PageItem *item = m_doc->m_Selection->itemAt(i);
QString tmpName = item->customLineStyle();
if (lsName.isNull() && !tmpName.isEmpty() && tmpName != "")
{
@@ -162,45 +162,45 @@
void SMLineStyle::toSelection(const QString &styleName) const
{
- if (!doc_)
- return;
-
- for (int i = 0; i < doc_->m_Selection->count(); ++i)
+ if (!m_doc)
+ return;
+
+ for (int i = 0; i < m_doc->m_Selection->count(); ++i)
{
if (styleName.isNull())
- doc_->m_Selection->itemAt(i)->setCustomLineStyle("");
+ m_doc->m_Selection->itemAt(i)->setCustomLineStyle("");
else
- doc_->m_Selection->itemAt(i)->setCustomLineStyle(styleName);
-
- doc_->m_Selection->itemAt(i)->update();
+ m_doc->m_Selection->itemAt(i)->setCustomLineStyle(styleName);
+
+ m_doc->m_Selection->itemAt(i)->update();
}
}
QString SMLineStyle::newStyle()
{
- if (!doc_)
+ if (!m_doc)
return QString::null;
struct SingleLine sl;
- sl.Color = doc_->itemToolPrefs().lineColor;
- sl.Shade = doc_->itemToolPrefs().lineColorShade;
+ sl.Color = m_doc->itemToolPrefs().lineColor;
+ sl.Shade = m_doc->itemToolPrefs().lineColorShade;
sl.Dash = Qt::SolidLine;//Docu->itemToolPrefs.;
sl.LineEnd = Qt::FlatCap;//Docu->itemToolPrefs.;
sl.LineJoin = Qt::MiterJoin;//Docu->itemToolPrefs.;
- sl.Width = doc_->itemToolPrefs().lineWidth;
+ sl.Width = m_doc->itemToolPrefs().lineWidth;
multiLine ml;
ml.push_back(sl);
QString name = getUniqueName( tr("New Style"));
- tmpLines[name] = ml;
+ m_tmpLines[name] = ml;
return name;
}
QString SMLineStyle::newStyle(const QString &fromStyle)
{
- Q_ASSERT(tmpLines.contains(fromStyle));
-
- multiLine ml(tmpLines[fromStyle]);
+ Q_ASSERT(m_tmpLines.contains(fromStyle));
+
+ multiLine ml(m_tmpLines[fromStyle]);
QString name = getUniqueName( tr("Clone of %1").arg(fromStyle));
- tmpLines[name] = ml;
+ m_tmpLines[name] = ml;
return name;
}
@@ -209,7 +209,7 @@
int id = 0;
QString s = name;
- while (tmpLines.contains(s))
+ while (m_tmpLines.contains(s))
{
++id;
s = tr("%1 (%2)", "This for unique name when creating "
@@ -223,76 +223,76 @@
void SMLineStyle::apply()
{
- if (!doc_)
+ if (!m_doc)
return;
PageItem* ite;
- doc_->MLineStyles = tmpLines;
+ m_doc->MLineStyles = m_tmpLines;
QMap<QString, QString> replacement;
- for (int i = 0; i < deleted_.count(); ++i)
- {
- if (deleted_[i].first == deleted_[i].second)
+ for (int i = 0; i < m_deleted.count(); ++i)
+ {
+ if (m_deleted[i].first == m_deleted[i].second)
continue;
- replacement[deleted_[i].first] = deleted_[i].second;
- }
-
- deleted_.clear();
-
- for (int d = 0; d < doc_->DocItems.count(); ++d)
- {
- ite = doc_->DocItems.at(d);
+ replacement[m_deleted[i].first] = m_deleted[i].second;
+ }
+
+ m_deleted.clear();
+
+ for (int d = 0; d < m_doc->DocItems.count(); ++d)
+ {
+ ite = m_doc->DocItems.at(d);
if (!ite->NamedLStyle.isEmpty())
{
- if (!doc_->MLineStyles.contains(ite->NamedLStyle))
+ if (!m_doc->MLineStyles.contains(ite->NamedLStyle))
ite->NamedLStyle = replacement[ite->NamedLStyle];
}
}
- for (int d1 = 0; d1 < doc_->MasterItems.count(); ++d1)
- {
- ite = doc_->MasterItems.at(d1);
+ for (int d1 = 0; d1 < m_doc->MasterItems.count(); ++d1)
+ {
+ ite = m_doc->MasterItems.at(d1);
if (!ite->NamedLStyle.isEmpty())
{
- if (!doc_->MLineStyles.contains(ite->NamedLStyle))
+ if (!m_doc->MLineStyles.contains(ite->NamedLStyle))
ite->NamedLStyle = replacement[ite->NamedLStyle];
}
}
- for (QHash<int, PageItem*>::iterator it = doc_->FrameItems.begin(); it != doc_->FrameItems.end(); ++it)
+ for (QHash<int, PageItem*>::iterator it = m_doc->FrameItems.begin(); it != m_doc->FrameItems.end(); ++it)
{
ite = it.value();
if (!ite->NamedLStyle.isEmpty())
{
- if (!doc_->MLineStyles.contains(ite->NamedLStyle))
+ if (!m_doc->MLineStyles.contains(ite->NamedLStyle))
ite->NamedLStyle = replacement[ite->NamedLStyle];
}
}
- doc_->changed();
- doc_->scMW()->requestUpdate(reqLineStylesUpdate);
+ m_doc->changed();
+ m_doc->scMW()->requestUpdate(reqLineStylesUpdate);
// Better not call DrawNew() here, as this will cause several unnecessary calls
- // doc_->view()->DrawNew();
- selectionIsDirty_ = false;
+ // m_doc->view()->DrawNew();
+ m_selectionIsDirty = false;
}
bool SMLineStyle::isDefaultStyle(const QString &stylename) const
{
return false;//we have no default line styles yet
-// Q_ASSERT(tmpLines.contains(stylename));
-// return tmpLines[stylename].isDefaultStyle();
+// Q_ASSERT(m_tmpLines.contains(stylename));
+// return m_tmpLines[stylename].isDefaultStyle();
}
void SMLineStyle::setDefaultStyle(bool ids)
{
/* we dont have default line styles yet
- Q_ASSERT(selection_.count() == 1);
- if (selection_.count() != 1)
+ Q_ASSERT(m_selection.count() == 1);
+ if (m_selection.count() != 1)
return;
QMap<QString, multiLine*>::iterator it;
- for (it = selection_.begin(); it != selection_.end(); ++it)
+ for (it = m_selection.begin(); it != m_selection.end(); ++it)
(*it)->setDefaultStyle(ids);
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
*/
@@ -301,25 +301,25 @@
QString SMLineStyle::shortcut(const QString &stylename) const
{
QString s;
- QHash<QString, multiLine>::ConstIterator it = tmpLines.find(stylename);
- if (it != tmpLines.end())
+ QHash<QString, multiLine>::ConstIterator it = m_tmpLines.find(stylename);
+ if (it != m_tmpLines.end())
s = it.value().shortcut;
return s;
}
void SMLineStyle::setShortcut(const QString &shortcut)
{
- Q_ASSERT(selection_.count() == 1);
- if (selection_.count() != 1)
+ Q_ASSERT(m_selection.count() == 1);
+ if (m_selection.count() != 1)
return;
QHash<QString, multiLine*>::iterator it;
- for (it = selection_.begin(); it != selection_.end(); ++it)
+ for (it = m_selection.begin(); it != m_selection.end(); ++it)
(*it)->shortcut = shortcut;
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
@@ -328,42 +328,42 @@
{
for (int i = 0; i < removeList.count(); ++i)
{
- selection_.erase(selection_.find(removeList[i].first));
- tmpLines.erase(tmpLines.find(removeList[i].first));
- deleted_.append(removeList[i]);
+ m_selection.erase(m_selection.find(removeList[i].first));
+ m_tmpLines.erase(m_tmpLines.find(removeList[i].first));
+ m_deleted.append(removeList[i]);
}
}
void SMLineStyle::nameChanged(const QString &newName)
{
- if (selection_.count() != 1)
- {
- qDebug() << QString("SMLineStyle::nameChanged #selection=%1").arg(selection_.count());
- return;
- }
- QString oldName = selection_.begin().key();
- multiLine *tmpLine = selection_.begin().value();
+ if (m_selection.count() != 1)
+ {
+ qDebug() << QString("SMLineStyle::nameChanged #selection=%1").arg(m_selection.count());
+ return;
+ }
+ QString oldName = m_selection.begin().key();
+ multiLine *tmpLine = m_selection.begin().value();
multiLine newLine(*tmpLine);
- selection_.clear();
- tmpLines.remove(oldName);
-
- tmpLines.insert(newName, newLine);
- selection_[newName] = &tmpLines[newName];
+ m_selection.clear();
+ m_tmpLines.remove(oldName);
+
+ m_tmpLines.insert(newName, newLine);
+ m_selection[newName] = &m_tmpLines[newName];
QList<RemoveItem>::iterator it;
- for (it = deleted_.begin(); it != deleted_.end(); ++it)
+ for (it = m_deleted.begin(); it != m_deleted.end(); ++it)
{
if (it->second == oldName)
{
oldName = (*it).first;
- deleted_.erase(it);
+ m_deleted.erase(it);
break;
}
}
if (oldName != newName)
- deleted_.append(RemoveItem(oldName, newName));
+ m_deleted.append(RemoveItem(oldName, newName));
}
void SMLineStyle::changeEvent(QEvent *e)
@@ -381,55 +381,55 @@
void SMLineStyle::unitChange()
{
- double oldRatio = unitRatio_;
- unitRatio_ = doc_->unitRatio();
- if (widget_)
- widget_->unitChange(oldRatio, unitRatio_, doc_->unitIndex());
+ double oldRatio = m_unitRatio;
+ m_unitRatio = m_doc->unitRatio();
+ if (m_widget)
+ m_widget->unitChange(oldRatio, m_unitRatio, m_doc->unitIndex());
}
void SMLineStyle::setupConnections()
{
- connect(widget_->addButton, SIGNAL(clicked()), this, SLOT(slotAddLine()));
- connect(widget_->removeButton, SIGNAL(clicked()), this, SLOT(slotDeleteLine()));
- connect(widget_->endCombo, SIGNAL(activated(int)), this, SLOT(slotSetEnd(int)));
- connect(widget_->joinCombo, SIGNAL(activated(int)), this, SLOT(slotSetJoin(int)));
- connect(widget_->colorCombo, SIGNAL(activated(const QString&)), this, SLOT(slotColor(const QString&)));
- connect(widget_->dashCombo, SIGNAL(activated(int)), this, SLOT(slotLineStyle(int)));
- connect(widget_->shadeBox, SIGNAL(valueChanged(int)), this, SLOT(slotShade(int)));
- connect(widget_->lineWidth, SIGNAL(valueChanged(double)), this, SLOT(slotLineWidth()));
+ connect(m_widget->addButton, SIGNAL(clicked()), this, SLOT(slotAddLine()));
+ connect(m_widget->removeButton, SIGNAL(clicked()), this, SLOT(slotDeleteLine()));
+ connect(m_widget->endCombo, SIGNAL(activated(int)), this, SLOT(slotSetEnd(int)));
+ connect(m_widget->joinCombo, SIGNAL(activated(int)), this, SLOT(slotSetJoin(int)));
+ connect(m_widget->colorCombo, SIGNAL(activated(const QString&)), this, SLOT(slotColor(const QString&)));
+ connect(m_widget->dashCombo, SIGNAL(activated(int)), this, SLOT(slotLineStyle(int)));
+ connect(m_widget->shadeBox, SIGNAL(valueChanged(int)), this, SLOT(slotShade(int)));
+ connect(m_widget->lineWidth, SIGNAL(valueChanged(double)), this, SLOT(slotLineWidth()));
}
void SMLineStyle::removeConnections()
{
- disconnect(widget_->addButton, SIGNAL(clicked()), this, SLOT(slotAddLine()));
- disconnect(widget_->removeButton, SIGNAL(clicked()), this, SLOT(slotDeleteLine()));
- disconnect(widget_->endCombo, SIGNAL(activated(int)), this, SLOT(slotSetEnd(int)));
- disconnect(widget_->joinCombo, SIGNAL(activated(int)), this, SLOT(slotSetJoin(int)));
- disconnect(widget_->colorCombo, SIGNAL(activated(const QString&)), this, SLOT(slotColor(const QString&)));
- disconnect(widget_->dashCombo, SIGNAL(activated(int)), this, SLOT(slotLineStyle(int)));
- disconnect(widget_->shadeBox, SIGNAL(valueChanged(int)), this, SLOT(slotShade(int)));
- disconnect(widget_->lineWidth, SIGNAL(valueChanged(double)), this, SLOT(slotLineWidth()));
+ disconnect(m_widget->addButton, SIGNAL(clicked()), this, SLOT(slotAddLine()));
+ disconnect(m_widget->removeButton, SIGNAL(clicked()), this, SLOT(slotDeleteLine()));
+ disconnect(m_widget->endCombo, SIGNAL(activated(int)), this, SLOT(slotSetEnd(int)));
+ disconnect(m_widget->joinCombo, SIGNAL(activated(int)), this, SLOT(slotSetJoin(int)));
+ disconnect(m_widget->colorCombo, SIGNAL(activated(const QString&)), this, SLOT(slotColor(const QString&)));
+ disconnect(m_widget->dashCombo, SIGNAL(activated(int)), this, SLOT(slotLineStyle(int)));
+ disconnect(m_widget->shadeBox, SIGNAL(valueChanged(int)), this, SLOT(slotShade(int)));
+ disconnect(m_widget->lineWidth, SIGNAL(valueChanged(double)), this, SLOT(slotLineWidth()));
}
void SMLineStyle::slotLineStyle(int i)
{
- Q_ASSERT(currentLine_ >= 0);
- if (currentLine_ < 0)
+ Q_ASSERT(m_currentLine >= 0);
+ if (m_currentLine < 0)
return;
QHash<QString, multiLine*>::iterator it;
- for (it = selection_.begin(); it != selection_.end(); ++it)
+ for (it = m_selection.begin(); it != m_selection.end(); ++it)
{
multiLine *tmp = it.value();
- (*tmp)[currentLine_].Dash = i + 1;
+ (*tmp)[m_currentLine].Dash = i + 1;
}
updateSList();
updatePreview();
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
@@ -451,26 +451,26 @@
}
QHash<QString, multiLine*>::iterator it;
- for (it = selection_.begin(); it != selection_.end(); ++it)
+ for (it = m_selection.begin(); it != m_selection.end(); ++it)
{
multiLine *tmp = it.value();
- (*tmp)[currentLine_].LineEnd = static_cast<int>(c);
+ (*tmp)[m_currentLine].LineEnd = static_cast<int>(c);
}
updateSList();
updatePreview();
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMLineStyle::slotSetJoin(int i)
{
- Q_ASSERT(currentLine_ >= 0);
- if (currentLine_ < 0)
+ Q_ASSERT(m_currentLine >= 0);
+ if (m_currentLine < 0)
return;
Qt::PenJoinStyle c = Qt::MiterJoin;
@@ -488,18 +488,18 @@
}
QHash<QString, multiLine*>::iterator it;
- for (it = selection_.begin(); it != selection_.end(); ++it)
+ for (it = m_selection.begin(); it != m_selection.end(); ++it)
{
multiLine *tmp = it.value();
- (*tmp)[currentLine_].LineJoin = static_cast<int>(c);
+ (*tmp)[m_currentLine].LineJoin = static_cast<int>(c);
}
updateSList();
updatePreview();
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
@@ -507,18 +507,18 @@
void SMLineStyle::slotColor(const QString &s)
{
QHash<QString, multiLine*>::iterator it;
- for (it = selection_.begin(); it != selection_.end(); ++it)
+ for (it = m_selection.begin(); it != m_selection.end(); ++it)
{
multiLine *tmp = it.value();
- (*tmp)[currentLine_].Color = s;
+ (*tmp)[m_currentLine].Color = s;
}
updateSList();
updatePreview();
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
@@ -526,18 +526,18 @@
void SMLineStyle::slotShade(int i)
{
QHash<QString, multiLine*>::iterator it;
- for (it = selection_.begin(); it != selection_.end(); ++it)
+ for (it = m_selection.begin(); it != m_selection.end(); ++it)
{
multiLine *tmp = it.value();
- (*tmp)[currentLine_].Shade = i;
+ (*tmp)[m_currentLine].Shade = i;
}
updateSList();
updatePreview();
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
@@ -545,35 +545,35 @@
void SMLineStyle::slotLineWidth()
{
QHash<QString, multiLine*>::iterator it;
- for (it = selection_.begin(); it != selection_.end(); ++it)
+ for (it = m_selection.begin(); it != m_selection.end(); ++it)
{
multiLine *tmp = it.value();
- (*tmp)[currentLine_].Width = widget_->lineWidth->value();
+ (*tmp)[m_currentLine].Width = m_widget->lineWidth->value();
}
updatePreview();
resort();
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMLineStyle::slotAddLine()
{
- if (!doc_ || selection_.count() != 1)
- return;
-
- multiLine *tmpLine = selection_.begin().value();
+ if (!m_doc || m_selection.count() != 1)
+ return;
+
+ multiLine *tmpLine = m_selection.begin().value();
struct SingleLine sl;
- sl.Color = (*tmpLine)[currentLine_].Color;
- sl.Shade = (*tmpLine)[currentLine_].Shade;
- sl.Dash = (*tmpLine)[currentLine_].Dash;
- sl.LineEnd = (*tmpLine)[currentLine_].LineEnd;
- sl.LineJoin = (*tmpLine)[currentLine_].LineJoin;
- sl.Width = (*tmpLine)[currentLine_].Width;
+ sl.Color = (*tmpLine)[m_currentLine].Color;
+ sl.Shade = (*tmpLine)[m_currentLine].Shade;
+ sl.Dash = (*tmpLine)[m_currentLine].Dash;
+ sl.LineEnd = (*tmpLine)[m_currentLine].LineEnd;
+ sl.LineJoin = (*tmpLine)[m_currentLine].LineJoin;
+ sl.Width = (*tmpLine)[m_currentLine].Width;
int cc = 0;
bool fo = false;
for (multiLine::iterator it2 = (*tmpLine).begin(); it2 != (*tmpLine).end(); ++it2)
@@ -588,14 +588,14 @@
}
if (!fo)
(*tmpLine).push_back(sl);
- currentLine_ = cc;
+ m_currentLine = cc;
rebuildList();
- widget_->showStyle(*tmpLine, doc_->PageColors, cc);
- updatePreview();
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ m_widget->showStyle(*tmpLine, m_doc->PageColors, cc);
+ updatePreview();
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
@@ -603,9 +603,9 @@
void SMLineStyle::rebuildList()
{
QString tmp, tmp2;
- widget_->lineStyles->clear();
+ m_widget->lineStyles->clear();
QPixmap * pm2;
- multiLine *tmpLine = selection_.begin().value();
+ multiLine *tmpLine = m_selection.begin().value();
for (multiLine::iterator it = (*tmpLine).begin(); it != (*tmpLine).end(); ++it)
{
pm2 = getWidePixmap(calcFarbe((*it).Color, (*it).Shade));
@@ -632,17 +632,17 @@
break;
}
tmp2 += " ";
-// widget_->lineStyles->insertItem(*pm2, tmp2);
- widget_->lineStyles->addItem(new QListWidgetItem(*pm2, tmp2, widget_->lineStyles));
+// m_widget->lineStyles->insertItem(*pm2, tmp2);
+ m_widget->lineStyles->addItem(new QListWidgetItem(*pm2, tmp2, m_widget->lineStyles));
}
}
void SMLineStyle::slotDeleteLine()
{
- if (!doc_ || selection_.count() != 1)
- return;
-
- multiLine *tmpLine = selection_.begin().value();
+ if (!m_doc || m_selection.count() != 1)
+ return;
+
+ multiLine *tmpLine = m_selection.begin().value();
if ((*tmpLine).size() == 1)
return;
@@ -650,7 +650,7 @@
int cc = 0;
for (multiLine::iterator it3 = (*tmpLine).begin(); it3 != (*tmpLine).end(); ++it3)
{
- if (cc == currentLine_)
+ if (cc == m_currentLine)
{
(*tmpLine).erase(it3);
break;
@@ -658,35 +658,35 @@
cc++;
}
- currentLine_ = 0;
+ m_currentLine = 0;
rebuildList();
- widget_->showStyle(*tmpLine, doc_->PageColors);
- updatePreview();
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ m_widget->showStyle(*tmpLine, m_doc->PageColors);
+ updatePreview();
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMLineStyle::updateSList()
{
- if (selection_.count() < 1)
- return;
-
- Q_ASSERT(currentLine_ >= 0);
- if (currentLine_ < 0)
+ if (m_selection.count() < 1)
+ return;
+
+ Q_ASSERT(m_currentLine >= 0);
+ if (m_currentLine < 0)
return;
QString tmp, tmp2;
QPixmap * pm;
- multiLine *tmpLine = selection_.begin().value();
+ multiLine *tmpLine = m_selection.begin().value();
- pm = getWidePixmap(calcFarbe((*tmpLine)[currentLine_].Color, (*tmpLine)[currentLine_].Shade));
- tmp2 = " "+tmp.setNum((*tmpLine)[currentLine_].Width)+ tr(" pt ");
- switch (static_cast<Qt::PenStyle>((*tmpLine)[currentLine_].Dash))
+ pm = getWidePixmap(calcFarbe((*tmpLine)[m_currentLine].Color, (*tmpLine)[m_currentLine].Shade));
+ tmp2 = " "+tmp.setNum((*tmpLine)[m_currentLine].Width)+ tr(" pt ");
+ switch (static_cast<Qt::PenStyle>((*tmpLine)[m_currentLine].Dash))
{
case Qt::SolidLine:
tmp2 += tr("Solid Line");
@@ -708,16 +708,16 @@
break;
}
tmp2 += " ";
- if (widget_->lineStyles->count() == 1) // to avoid Bug in Qt-3.1.2
- {
- widget_->lineStyles->clear();
-// widget_->lineStyles->insertItem(*pm, tmp2);
- widget_->lineStyles->addItem(new QListWidgetItem(*pm, tmp2, widget_->lineStyles));
+ if (m_widget->lineStyles->count() == 1) // to avoid Bug in Qt-3.1.2
+ {
+ m_widget->lineStyles->clear();
+// m_widget->lineStyles->insertItem(*pm, tmp2);
+ m_widget->lineStyles->addItem(new QListWidgetItem(*pm, tmp2, m_widget->lineStyles));
}
else
{
-// widget_->lineStyles->changeItem(*pm, tmp2, currentLine_);
- QListWidgetItem *i = widget_->lineStyles->item(currentLine_);
+// m_widget->lineStyles->changeItem(*pm, tmp2, m_currentLine);
+ QListWidgetItem *i = m_widget->lineStyles->item(m_currentLine);
i->setIcon(*pm);
i->setText(tmp2);
}
@@ -725,14 +725,14 @@
void SMLineStyle::updatePreview()
{
- if (selection_.count() < 1)
+ if (m_selection.count() < 1)
return;
QPixmap pm = QPixmap(200, 37);
pm.fill(Qt::white);
QPainter p;
p.begin(&pm);
- multiLine *tmpLine = selection_.begin().value();
+ multiLine *tmpLine = m_selection.begin().value();
for (int it = (*tmpLine).size()-1; it > -1; it--)
{
@@ -753,16 +753,16 @@
p.drawLine(17, 18, 183, 18);
}
p.end();
- widget_->previewLabel->setPixmap(pm);
+ m_widget->previewLabel->setPixmap(pm);
}
QColor SMLineStyle::calcFarbe(const QString &name, int shade)
{
QColor tmpf;
- if (!doc_)
+ if (!m_doc)
return tmpf;
- const ScColor& color = doc_->PageColors[name];
- tmpf = ScColorEngine::getDisplayColor(color, doc_, shade);
+ const ScColor& color = m_doc->PageColors[name];
+ tmpf = ScColorEngine::getDisplayColor(color, m_doc, shade);
return tmpf;
}
@@ -770,28 +770,28 @@
{
if (i < 0)
return;
- currentLine_ = i;
+ m_currentLine = i;
}
void SMLineStyle::resort()
{
- if (!doc_ || selection_.count() != 1)
+ if (!m_doc || m_selection.count() != 1)
return;
int cc = 0;
struct SingleLine sl;
- multiLine *tmpLine = selection_.begin().value();
-
- sl.Color = (*tmpLine)[currentLine_].Color;
- sl.Shade = (*tmpLine)[currentLine_].Shade;
- sl.Dash = (*tmpLine)[currentLine_].Dash;
- sl.LineEnd = (*tmpLine)[currentLine_].LineEnd;
- sl.LineJoin = (*tmpLine)[currentLine_].LineJoin;
- sl.Width = (*tmpLine)[currentLine_].Width;
+ multiLine *tmpLine = m_selection.begin().value();
+
+ sl.Color = (*tmpLine)[m_currentLine].Color;
+ sl.Shade = (*tmpLine)[m_currentLine].Shade;
+ sl.Dash = (*tmpLine)[m_currentLine].Dash;
+ sl.LineEnd = (*tmpLine)[m_currentLine].LineEnd;
+ sl.LineJoin = (*tmpLine)[m_currentLine].LineJoin;
+ sl.Width = (*tmpLine)[m_currentLine].Width;
multiLine::iterator it3;
for (it3 = (*tmpLine).begin(); it3 != (*tmpLine).end(); ++it3)
{
- if (cc == currentLine_)
+ if (cc == m_currentLine)
{
(*tmpLine).erase(it3);
break;
@@ -812,17 +812,17 @@
}
if (!fo)
(*tmpLine).push_back(sl);
- currentLine_ = cc;
+ m_currentLine = cc;
rebuildList();
- widget_->showStyle(*tmpLine, doc_->PageColors, cc);
+ m_widget->showStyle(*tmpLine, m_doc->PageColors, cc);
updatePreview();
}
SMLineStyle::~SMLineStyle()
{
- delete widget_;
- delete twidget_;
- widget_ = 0;
- twidget_ = 0;
-}
-
+ delete m_widget;
+ delete m_twidget;
+ m_widget = 0;
+ m_twidget = 0;
+}
+
Modified: trunk/Scribus/scribus/ui/smlinestyle.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18326&path=/trunk/Scribus/scribus/ui/smlinestyle.h
==============================================================================
--- trunk/Scribus/scribus/ui/smlinestyle.h (original)
+++ trunk/Scribus/scribus/ui/smlinestyle.h Mon Jun 17 23:03:50 2013
@@ -53,15 +53,15 @@
void selectionDirty();
private:
- ScribusDoc *doc_;
- SMLineStyleWidget *widget_;
- QTabWidget *twidget_;
- QHash<QString, multiLine> tmpLines;
- bool selectionIsDirty_;
- double unitRatio_;
- QHash<QString, multiLine*> selection_;
- QList<RemoveItem> deleted_;
- int currentLine_;
+ ScribusDoc *m_doc;
+ SMLineStyleWidget *m_widget;
+ QTabWidget *m_twidget;
+ QHash<QString, multiLine> m_tmpLines;
+ bool m_selectionIsDirty;
+ double m_unitRatio;
+ QHash<QString, multiLine*> m_selection;
+ QList<RemoveItem> m_deleted;
+ int m_currentLine;
void setSelection(const QString& styleName);
void setMultiSelection(const QStringList& styles);
Modified: trunk/Scribus/scribus/ui/smtextstyles.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18326&path=/trunk/Scribus/scribus/ui/smtextstyles.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smtextstyles.cpp (original)
+++ trunk/Scribus/scribus/ui/smtextstyles.cpp Mon Jun 17 23:03:50 2013
@@ -42,16 +42,16 @@
SMParagraphStyle::SMParagraphStyle(StyleSet<CharStyle> *cstyles) : StyleItem(),
-pwidget_(0), doc_(0), selectionIsDirty_(false), unitRatio_(1.0), cstyles_(cstyles)
-{
- Q_ASSERT(cstyles_);
- pwidget_ = new SMPStyleWidget(doc_);
- Q_CHECK_PTR(pwidget_);
+m_pwidget(0), m_doc(0), m_selectionIsDirty(false), m_unitRatio(1.0), m_cstyles(cstyles)
+{
+ Q_ASSERT(m_cstyles);
+ m_pwidget = new SMPStyleWidget(m_doc);
+ Q_CHECK_PTR(m_pwidget);
}
QTabWidget* SMParagraphStyle::widget()
{
- return pwidget_->tabWidget;
+ return m_pwidget->tabWidget;
}
QString SMParagraphStyle::typeNamePlural()
@@ -66,59 +66,59 @@
void SMParagraphStyle::setCurrentDoc(ScribusDoc *doc)
{
- doc_ = doc;
- if (doc_)
- {
- if (pwidget_)
+ m_doc = doc;
+ if (m_doc)
+ {
+ if (m_pwidget)
{
QStringList languageList;
LanguageManager::instance()->fillInstalledHyphStringList(&languageList);
- pwidget_->cpage->fillLangComboFromList(languageList);
- pwidget_->cpage->fillColorCombo(doc_->PageColors);
- pwidget_->cpage->fontFace_->RebuildList(doc_);
- if (unitRatio_ != doc_->unitRatio())
+ m_pwidget->cpage->fillLangComboFromList(languageList);
+ m_pwidget->cpage->fillColorCombo(m_doc->PageColors);
+ m_pwidget->cpage->fontFace_->RebuildList(m_doc);
+ if (m_unitRatio != m_doc->unitRatio())
unitChange();
}
}
else
{
removeConnections();
- selection_.clear();
- tmpStyles_.clear();
- deleted_.clear();
- }
- if (pwidget_)
- pwidget_->setDoc(doc);
+ m_selection.clear();
+ m_tmpStyles.clear();
+ m_deleted.clear();
+ }
+ if (m_pwidget)
+ m_pwidget->setDoc(doc);
}
StyleSet<ParagraphStyle>* SMParagraphStyle::tmpStyles()
{
- return &tmpStyles_;
+ return &m_tmpStyles;
}
QList<StyleName> SMParagraphStyle::styles(bool reloadFromDoc)
{
QList<StyleName> tmpList;
- if (!doc_)
+ if (!m_doc)
return tmpList; // no doc available
if (reloadFromDoc)
{
- deleted_.clear();
+ m_deleted.clear();
reloadTmpStyles();
}
- for (int i = 0; i < tmpStyles_.count(); ++i)
- {
- if (tmpStyles_[i].hasName())
- {
- QString styleName(tmpStyles_[i].displayName());
+ for (int i = 0; i < m_tmpStyles.count(); ++i)
+ {
+ if (m_tmpStyles[i].hasName())
+ {
+ QString styleName(m_tmpStyles[i].displayName());
QString parentName(QString::null);
- if (tmpStyles_[i].hasParent())
+ if (m_tmpStyles[i].hasParent())
{
- const Style* parentStyle = tmpStyles_[i].parentStyle();
+ const Style* parentStyle = m_tmpStyles[i].parentStyle();
if (parentStyle)
parentName = parentStyle->displayName();
}
@@ -138,34 +138,34 @@
void SMParagraphStyle::selected(const QStringList &styleNames)
{
- if (!doc_)
+ if (!m_doc)
return;
- selection_.clear();
- selectionIsDirty_ = false;
+ m_selection.clear();
+ m_selectionIsDirty = false;
removeConnections(); // we don't want to record changes during style setup
- tmpStyles_.invalidate();
+ m_tmpStyles.invalidate();
QList<ParagraphStyle> pstyles; // get saved styles
QList<CharStyle> cstyles;
- for (int i = 0; i < tmpStyles_.count(); ++i)
- pstyles << tmpStyles_[i];
- for (int i = 0; i < cstyles_->count(); ++i)
- cstyles << (*cstyles_)[i];
+ for (int i = 0; i < m_tmpStyles.count(); ++i)
+ pstyles << m_tmpStyles[i];
+ for (int i = 0; i < m_cstyles->count(); ++i)
+ cstyles << (*m_cstyles)[i];
int index;
for (int i = 0; i < styleNames.count(); ++i)
{
- index = tmpStyles_.find(styleNames[i]);
+ index = m_tmpStyles.find(styleNames[i]);
//FIXME: #7133: Use .isDefaultStyle() instead here rather than relying on tr text comparison
if (index<0 && styleNames[i]==CommonStrings::trDefaultParagraphStyle)
- index = tmpStyles_.find(CommonStrings::DefaultParagraphStyle);
+ index = m_tmpStyles.find(CommonStrings::DefaultParagraphStyle);
if (index > -1)
- selection_.append(&tmpStyles_[index]);
- }
-
- pwidget_->show(selection_, pstyles, cstyles, doc_->unitIndex(), PrefsManager::instance()->appPrefs.hyphPrefs.Language);
+ m_selection.append(&m_tmpStyles[index]);
+ }
+
+ m_pwidget->show(m_selection, pstyles, cstyles, m_doc->unitIndex(), PrefsManager::instance()->appPrefs.hyphPrefs.Language);
setupConnections();
}
@@ -173,10 +173,10 @@
QList<CharStyle> SMParagraphStyle::getCharStyles()
{
QList<CharStyle> charStyles;
- if (!doc_)
+ if (!m_doc)
return charStyles; // no doc available
- const StyleSet<CharStyle> &tmp(doc_->charStyles());
+ const StyleSet<CharStyle> &tmp(m_doc->charStyles());
for (int i = 0; i < tmp.count(); ++i)
charStyles.append(tmp[i]);
return charStyles;
@@ -185,13 +185,13 @@
QString SMParagraphStyle::fromSelection() const
{
QString lsName(QString::null);
- if (!doc_)
+ if (!m_doc)
return lsName; // no doc available
- for (int i = 0; i < doc_->m_Selection->count(); ++i)
+ for (int i = 0; i < m_doc->m_Selection->count(); ++i)
{
// wth is going on here
- PageItem *item = doc_->m_Selection->itemAt(i);
+ PageItem *item = m_doc->m_Selection->itemAt(i);
QString tmpName = item->itemText.defaultStyle().parent();
@@ -210,34 +210,34 @@
void SMParagraphStyle::toSelection(const QString &styleName) const
{
- if (!doc_)
+ if (!m_doc)
return; // nowhere to apply or no doc
QString realName = styleName;
- int styleIndex = tmpStyles_.find(styleName);
+ int styleIndex = m_tmpStyles.find(styleName);
if (styleIndex < 0 && (styleName == CommonStrings::trDefaultParagraphStyle))
{
- styleIndex = tmpStyles_.find(CommonStrings::DefaultParagraphStyle);
+ styleIndex = m_tmpStyles.find(CommonStrings::DefaultParagraphStyle);
if (styleIndex >= 0)
realName = CommonStrings::DefaultParagraphStyle;
}
if (styleIndex >= 0)
{
- doc_->itemSelection_SetNamedParagraphStyle(realName);
+ m_doc->itemSelection_SetNamedParagraphStyle(realName);
}
}
QString SMParagraphStyle::newStyle()
{
- if (!doc_)
+ if (!m_doc)
return QString::null;
QString s(getUniqueName( tr("New Style")));
ParagraphStyle p;
p.setDefaultStyle(false);
p.setName(s);
- p.charStyle().setLanguage(doc_->hyphLanguage());
- tmpStyles_.create(p);
+ p.charStyle().setLanguage(m_doc->hyphLanguage());
+ m_tmpStyles.create(p);
return s;
}
@@ -249,17 +249,17 @@
if (fromStyle==CommonStrings::trDefaultParagraphStyle)
copiedStyleName=CommonStrings::DefaultParagraphStyle;
- Q_ASSERT(tmpStyles_.resolve(copiedStyleName));
- if (!tmpStyles_.resolve(copiedStyleName))
+ Q_ASSERT(m_tmpStyles.resolve(copiedStyleName));
+ if (!m_tmpStyles.resolve(copiedStyleName))
return QString::null;
//Copy the style with the original name
QString s(getUniqueName( tr("Clone of %1").arg(fromStyle)));
- ParagraphStyle p(tmpStyles_.get(copiedStyleName));
+ ParagraphStyle p(m_tmpStyles.get(copiedStyleName));
p.setDefaultStyle(false);
p.setName(s);
p.setShortcut(QString::null); // do not clone the sc
- tmpStyles_.create(p);
+ m_tmpStyles.create(p);
return s;
}
@@ -275,9 +275,9 @@
{
start:
++id;
- for (int i = 0; i < tmpStyles_.count(); ++i)
- {
- if (tmpStyles_[i].name() == s)
+ for (int i = 0; i < m_tmpStyles.count(); ++i)
+ {
+ if (m_tmpStyles[i].name() == s)
{
s = tr("%1 (%2)", "This for unique name when creating "
"a new character style. %1 will be the name "
@@ -294,24 +294,24 @@
void SMParagraphStyle::apply()
{
- if (!doc_)
+ if (!m_doc)
return;
QMap<QString, QString> replacement;
- for (int i = 0; i < deleted_.count(); ++i)
- {
- if (deleted_[i].first == deleted_[i].second)
+ for (int i = 0; i < m_deleted.count(); ++i)
+ {
+ if (m_deleted[i].first == m_deleted[i].second)
continue;
- replacement[deleted_[i].first] = deleted_[i].second;
- }
- doc_->redefineStyles(tmpStyles_, false);
- doc_->replaceStyles(replacement);
-
- deleted_.clear(); // deletion done at this point
-
- doc_->scMW()->requestUpdate(reqTextStylesUpdate);
+ replacement[m_deleted[i].first] = m_deleted[i].second;
+ }
+ m_doc->redefineStyles(m_tmpStyles, false);
+ m_doc->replaceStyles(replacement);
+
+ m_deleted.clear(); // deletion done at this point
+
+ m_doc->scMW()->requestUpdate(reqTextStylesUpdate);
// Better not call DrawNew() here, as this will cause several unnecessary calls
- // doc_->view()->DrawNew();
- doc_->changed();
+ // m_doc->view()->DrawNew();
+ m_doc->changed();
}
void SMParagraphStyle::editMode(bool isOn)
@@ -322,17 +322,17 @@
bool SMParagraphStyle::isDefaultStyle(const QString &stylename) const
{
- int index = tmpStyles_.find(stylename);
+ int index = m_tmpStyles.find(stylename);
bool b=false;
if (index > -1)
- b = tmpStyles_[index].isDefaultStyle();
+ b = m_tmpStyles[index].isDefaultStyle();
else
{
if (CommonStrings::trDefaultParagraphStyle==stylename)
{
- index = tmpStyles_.find(CommonStrings::DefaultParagraphStyle);
+ index = m_tmpStyles.find(CommonStrings::DefaultParagraphStyle);
if (index > -1)
- b = tmpStyles_[index].isDefaultStyle();
+ b = m_tmpStyles[index].isDefaultStyle();
}
}
return b;
@@ -340,15 +340,15 @@
void SMParagraphStyle::setDefaultStyle(bool ids)
{
- Q_ASSERT(selection_.count() == 1);
- if (selection_.count() != 1)
+ Q_ASSERT(m_selection.count() == 1);
+ if (m_selection.count() != 1)
return;
- selection_[0]->setDefaultStyle(ids);
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ m_selection[0]->setDefaultStyle(ids);
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
@@ -357,17 +357,17 @@
{
QString s(QString::null);
- int index = tmpStyles_.find(stylename);
+ int index = m_tmpStyles.find(stylename);
if (index > -1)
- s = tmpStyles_[index].shortcut();
+ s = m_tmpStyles[index].shortcut();
else
{
//FIXME: Use isDefaultStyle somehow
if (CommonStrings::trDefaultParagraphStyle==stylename)
{
- index = tmpStyles_.find(CommonStrings::DefaultParagraphStyle);
+ index = m_tmpStyles.find(CommonStrings::DefaultParagraphStyle);
if (index > -1)
- s = tmpStyles_[index].shortcut();
+ s = m_tmpStyles[index].shortcut();
}
}
@@ -376,15 +376,15 @@
void SMParagraphStyle::setShortcut(const QString &shortcut)
{
- Q_ASSERT(selection_.count() == 1);
- if (selection_.count() != 1)
+ Q_ASSERT(m_selection.count() == 1);
+ if (m_selection.count() != 1)
return;
- selection_[0]->setShortcut(shortcut);
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ m_selection[0]->setShortcut(shortcut);
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
@@ -393,384 +393,384 @@
{
for (int i = 0; i < removeList.count(); ++i)
{
- for (int k = 0; k < selection_.count(); ++k)
- {
- if (selection_[k]->name() == removeList[i].first)
+ for (int k = 0; k < m_selection.count(); ++k)
+ {
+ if (m_selection[k]->name() == removeList[i].first)
{
- selection_.removeAt(k);
+ m_selection.removeAt(k);
break;
}
}
- int index = tmpStyles_.find(removeList[i].first);
+ int index = m_tmpStyles.find(removeList[i].first);
if (index > -1)
- tmpStyles_.remove(index);
-
- deleted_.append(removeList[i]);
+ m_tmpStyles.remove(index);
+
+ m_deleted.append(removeList[i]);
}
}
void SMParagraphStyle::nameChanged(const QString &newName)
{
- if (selection_.count() != 1)
+ if (m_selection.count() != 1)
return;
- QString oldName(selection_[0]->name());
- ParagraphStyle p(*selection_[0]);
+ QString oldName(m_selection[0]->name());
+ ParagraphStyle p(*m_selection[0]);
p.setName(newName);
- tmpStyles_.create(p);
- selection_.clear();
- selection_.append(&tmpStyles_[tmpStyles_.find(newName)]);
- for (int j = 0; j < tmpStyles_.count(); ++j)
- {
- int index = tmpStyles_.find(oldName);
+ m_tmpStyles.create(p);
+ m_selection.clear();
+ m_selection.append(&m_tmpStyles[m_tmpStyles.find(newName)]);
+ for (int j = 0; j < m_tmpStyles.count(); ++j)
+ {
+ int index = m_tmpStyles.find(oldName);
if (index > -1)
{
- tmpStyles_.remove(index);
+ m_tmpStyles.remove(index);
break;
}
}
- for (int j = 0; j < tmpStyles_.count(); ++j)
- {
- if (tmpStyles_[j].parent() == oldName)
- tmpStyles_[j].setParent(newName);
+ for (int j = 0; j < m_tmpStyles.count(); ++j)
+ {
+ if (m_tmpStyles[j].parent() == oldName)
+ m_tmpStyles[j].setParent(newName);
}
QList<RemoveItem>::iterator it;
- for (it = deleted_.begin(); it != deleted_.end(); ++it)
+ for (it = m_deleted.begin(); it != m_deleted.end(); ++it)
{
if (it->second == oldName)
{
oldName = (*it).first;
- deleted_.erase(it);
+ m_deleted.erase(it);
break;
}
}
if (oldName != newName)
- deleted_.append(RemoveItem(oldName, newName));
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ m_deleted.append(RemoveItem(oldName, newName));
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::languageChange()
{
- if (pwidget_)
- {
- pwidget_->languageChange();
- pwidget_->cpage->languageChange();
+ if (m_pwidget)
+ {
+ m_pwidget->languageChange();
+ m_pwidget->cpage->languageChange();
}
}
void SMParagraphStyle::unitChange()
{
- double oldRatio = unitRatio_;
- unitRatio_ = doc_->unitRatio();
- pwidget_->unitChange(oldRatio, unitRatio_, doc_->unitIndex());
+ double oldRatio = m_unitRatio;
+ m_unitRatio = m_doc->unitRatio();
+ m_pwidget->unitChange(oldRatio, m_unitRatio, m_doc->unitIndex());
}
void SMParagraphStyle::reloadTmpStyles()
{
- if (!doc_)
+ if (!m_doc)
return;
- selection_.clear();
- tmpStyles_.clear();
- deleted_.clear();
- tmpStyles_.redefine(doc_->paragraphStyles(), true);
- Q_ASSERT(tmpStyles_.count() > 0);
- tmpStyles_[0].charStyle().setContext(cstyles_);
+ m_selection.clear();
+ m_tmpStyles.clear();
+ m_deleted.clear();
+ m_tmpStyles.redefine(m_doc->paragraphStyles(), true);
+ Q_ASSERT(m_tmpStyles.count() > 0);
+ m_tmpStyles[0].charStyle().setContext(m_cstyles);
}
void SMParagraphStyle::setupConnections()
{
- if (!pwidget_)
+ if (!m_pwidget)
return;
// paragraph attributes
- connect(pwidget_->lineSpacingMode_, SIGNAL(activated(int)), this, SLOT(slotLineSpacingMode(int)));
- connect(pwidget_->lineSpacing_, SIGNAL(valueChanged(double)), this, SLOT(slotLineSpacing()));
- connect(pwidget_->spaceAbove_, SIGNAL(valueChanged(double)), this, SLOT(slotSpaceAbove()));
- connect(pwidget_->spaceBelow_, SIGNAL(valueChanged(double)), this, SLOT(slotSpaceBelow()));
- connect(pwidget_->alignement_->TextL, SIGNAL(clicked()), this, SLOT(slotAlignment()));
- connect(pwidget_->alignement_->TextR, SIGNAL(clicked()), this, SLOT(slotAlignment()));
- connect(pwidget_->alignement_->TextC, SIGNAL(clicked()), this, SLOT(slotAlignment()));
- connect(pwidget_->alignement_->TextB, SIGNAL(clicked()), this, SLOT(slotAlignment()));
- connect(pwidget_->alignement_->TextF, SIGNAL(clicked()), this, SLOT(slotAlignment()));
- connect(pwidget_->alignement_->parentButton, SIGNAL(clicked()), this, SLOT(slotAlignment()));
-// connect(pwidget_->optMarginCombo, SIGNAL(activated(int)), this, SLOT(slotOpticalMargin(int)));
- connect(pwidget_->optMarginRadioNone, SIGNAL(clicked()), this, SLOT(slotOpticalMarginSelector()));
- connect(pwidget_->optMarginRadioLeft, SIGNAL(clicked()), this, SLOT(slotOpticalMarginSelector()));
- connect(pwidget_->optMarginRadioRight, SIGNAL(clicked()), this, SLOT(slotOpticalMarginSelector()));
- connect(pwidget_->optMarginRadioBoth, SIGNAL(clicked()), this, SLOT(slotOpticalMarginSelector()));
- connect(pwidget_, SIGNAL(useParentOptMargins()), this, SLOT(slotParentOpticalMargin()));
-
- connect(pwidget_->minSpaceSpin, SIGNAL(valueChanged(double)),this,SLOT(slotMinSpace()));
- connect(pwidget_->minGlyphExtSpin, SIGNAL(valueChanged(double)),this,SLOT(slotMinGlyphExt()));
- connect(pwidget_->maxGlyphExtSpin, SIGNAL(valueChanged(double)),this,SLOT(slotMaxGlyphExt()));
-
- connect(pwidget_, SIGNAL(useParentParaEffects()), this, SLOT(slotParentParaEffects()));
- connect(pwidget_->dropCapsBox, SIGNAL(toggled(bool)), this, SLOT(slotDropCap(bool)));
- connect(pwidget_->dropCapLines_, SIGNAL(valueChanged(int)), this, SLOT(slotDropCapLines(int)));
- connect(pwidget_->parEffectOffset_, SIGNAL(valueChanged(double)), this, SLOT(slotParEffectOffset()));
- connect(pwidget_->parEffectIndentBox, SIGNAL(toggled(bool)), this, SLOT(slotParEffectIndent(bool)));
- connect(pwidget_->parEffectCharStyleCombo, SIGNAL(activated(const QString&)), this, SLOT(slotParEffectCharStyle(const QString&)));
-
- connect(pwidget_->bulletBox, SIGNAL(toggled(bool)), this, SLOT(slotBullet(bool)));
- connect(pwidget_->bulletStrEdit_, SIGNAL(editTextChanged(QString)), this, SLOT(slotBulletStr(QString)));
- connect(pwidget_->numBox, SIGNAL(toggled(bool)), this, SLOT(slotNumeration(bool)));
- connect(pwidget_->numComboBox, SIGNAL(activated(QString)), this, SLOT(slotNumName(QString)));
- connect(pwidget_->numLevelSpin, SIGNAL(valueChanged(int)), this, SLOT(slotNumLevel(int)));
- connect(pwidget_->numFormatCombo, SIGNAL(activated(int)), this, SLOT(slotNumFormat(int)));
- connect(pwidget_->numStartSpin, SIGNAL(valueChanged(int)), this, SLOT(slotNumStart(int)));
- connect(pwidget_->numRestartCombo, SIGNAL(activated(int)), this, SLOT(slotNumRestart(int)));
- connect(pwidget_->numRestartOtherBox, SIGNAL(toggled(bool)), this, SLOT(slotNumOther(bool)));
- connect(pwidget_->numRestartHigherBox, SIGNAL(toggled(bool)), this, SLOT(slotNumHigher(bool)));
- connect(pwidget_->numPrefix, SIGNAL(textChanged(QString)), this, SLOT(slotNumPrefix(QString)));
- connect(pwidget_->numSuffix, SIGNAL(textChanged(QString)), this, SLOT(slotNumSuffix(QString)));
- connect(pwidget_->numNewLineEdit, SIGNAL(editingFinished()), this, SLOT(slotNumNew()));
- connect(pwidget_->numNewLineEdit, SIGNAL(textChanged(QString)), this, SLOT(slotSelectionDirty()));
-
- connect(pwidget_->keepLinesStart, SIGNAL(valueChanged(int)), this, SLOT(handleKeepLinesStart()));
- connect(pwidget_->keepLinesEnd, SIGNAL(valueChanged(int)), this, SLOT(handleKeepLinesEnd()));
- connect(pwidget_->keepTogether, SIGNAL(stateChanged(int)), this, SLOT(handleKeepTogether()));
- connect(pwidget_->keepWithNext, SIGNAL(stateChanged(int)), this, SLOT(handleKeepWithNext()));
-
- connect(pwidget_->tabList_, SIGNAL(tabsChanged()), this, SLOT(slotTabRuler()));
- connect(pwidget_->tabList_, SIGNAL(mouseReleased()), this, SLOT(slotTabRuler()));
- connect(pwidget_->tabList_->left_, SIGNAL(valueChanged(double)), this, SLOT(slotLeftIndent()));
- connect(pwidget_->tabList_->right_, SIGNAL(valueChanged(double)), this, SLOT(slotRightIndent()));
- connect(pwidget_->tabList_->first_, SIGNAL(valueChanged(double)), this, SLOT(slotFirstLine()));
-
- connect(pwidget_->parentCombo, SIGNAL(activated(const QString&)), this, SLOT(slotParentChanged(const QString&)));
+ connect(m_pwidget->lineSpacingMode_, SIGNAL(activated(int)), this, SLOT(slotLineSpacingMode(int)));
+ connect(m_pwidget->lineSpacing_, SIGNAL(valueChanged(double)), this, SLOT(slotLineSpacing()));
+ connect(m_pwidget->spaceAbove_, SIGNAL(valueChanged(double)), this, SLOT(slotSpaceAbove()));
+ connect(m_pwidget->spaceBelow_, SIGNAL(valueChanged(double)), this, SLOT(slotSpaceBelow()));
+ connect(m_pwidget->alignement_->TextL, SIGNAL(clicked()), this, SLOT(slotAlignment()));
+ connect(m_pwidget->alignement_->TextR, SIGNAL(clicked()), this, SLOT(slotAlignment()));
+ connect(m_pwidget->alignement_->TextC, SIGNAL(clicked()), this, SLOT(slotAlignment()));
+ connect(m_pwidget->alignement_->TextB, SIGNAL(clicked()), this, SLOT(slotAlignment()));
+ connect(m_pwidget->alignement_->TextF, SIGNAL(clicked()), this, SLOT(slotAlignment()));
+ connect(m_pwidget->alignement_->parentButton, SIGNAL(clicked()), this, SLOT(slotAlignment()));
+// connect(m_pwidget->optMarginCombo, SIGNAL(activated(int)), this, SLOT(slotOpticalMargin(int)));
+ connect(m_pwidget->optMarginRadioNone, SIGNAL(clicked()), this, SLOT(slotOpticalMarginSelector()));
+ connect(m_pwidget->optMarginRadioLeft, SIGNAL(clicked()), this, SLOT(slotOpticalMarginSelector()));
+ connect(m_pwidget->optMarginRadioRight, SIGNAL(clicked()), this, SLOT(slotOpticalMarginSelector()));
+ connect(m_pwidget->optMarginRadioBoth, SIGNAL(clicked()), this, SLOT(slotOpticalMarginSelector()));
+ connect(m_pwidget, SIGNAL(useParentOptMargins()), this, SLOT(slotParentOpticalMargin()));
+
+ connect(m_pwidget->minSpaceSpin, SIGNAL(valueChanged(double)),this,SLOT(slotMinSpace()));
+ connect(m_pwidget->minGlyphExtSpin, SIGNAL(valueChanged(double)),this,SLOT(slotMinGlyphExt()));
+ connect(m_pwidget->maxGlyphExtSpin, SIGNAL(valueChanged(double)),this,SLOT(slotMaxGlyphExt()));
+
+ connect(m_pwidget, SIGNAL(useParentParaEffects()), this, SLOT(slotParentParaEffects()));
+ connect(m_pwidget->dropCapsBox, SIGNAL(toggled(bool)), this, SLOT(slotDropCap(bool)));
+ connect(m_pwidget->dropCapLines_, SIGNAL(valueChanged(int)), this, SLOT(slotDropCapLines(int)));
+ connect(m_pwidget->parEffectOffset_, SIGNAL(valueChanged(double)), this, SLOT(slotParEffectOffset()));
+ connect(m_pwidget->parEffectIndentBox, SIGNAL(toggled(bool)), this, SLOT(slotParEffectIndent(bool)));
+ connect(m_pwidget->parEffectCharStyleCombo, SIGNAL(activated(const QString&)), this, SLOT(slotParEffectCharStyle(const QString&)));
+
+ connect(m_pwidget->bulletBox, SIGNAL(toggled(bool)), this, SLOT(slotBullet(bool)));
+ connect(m_pwidget->bulletStrEdit_, SIGNAL(editTextChanged(QString)), this, SLOT(slotBulletStr(QString)));
+ connect(m_pwidget->numBox, SIGNAL(toggled(bool)), this, SLOT(slotNumeration(bool)));
+ connect(m_pwidget->numComboBox, SIGNAL(activated(QString)), this, SLOT(slotNumName(QString)));
+ connect(m_pwidget->numLevelSpin, SIGNAL(valueChanged(int)), this, SLOT(slotNumLevel(int)));
+ connect(m_pwidget->numFormatCombo, SIGNAL(activated(int)), this, SLOT(slotNumFormat(int)));
+ connect(m_pwidget->numStartSpin, SIGNAL(valueChanged(int)), this, SLOT(slotNumStart(int)));
+ connect(m_pwidget->numRestartCombo, SIGNAL(activated(int)), this, SLOT(slotNumRestart(int)));
+ connect(m_pwidget->numRestartOtherBox, SIGNAL(toggled(bool)), this, SLOT(slotNumOther(bool)));
+ connect(m_pwidget->numRestartHigherBox, SIGNAL(toggled(bool)), this, SLOT(slotNumHigher(bool)));
+ connect(m_pwidget->numPrefix, SIGNAL(textChanged(QString)), this, SLOT(slotNumPrefix(QString)));
+ connect(m_pwidget->numSuffix, SIGNAL(textChanged(QString)), this, SLOT(slotNumSuffix(QString)));
+ connect(m_pwidget->numNewLineEdit, SIGNAL(editingFinished()), this, SLOT(slotNumNew()));
+ connect(m_pwidget->numNewLineEdit, SIGNAL(textChanged(QString)), this, SLOT(slotSelectionDirty()));
+
+ connect(m_pwidget->keepLinesStart, SIGNAL(valueChanged(int)), this, SLOT(handleKeepLinesStart()));
+ connect(m_pwidget->keepLinesEnd, SIGNAL(valueChanged(int)), this, SLOT(handleKeepLinesEnd()));
+ connect(m_pwidget->keepTogether, SIGNAL(stateChanged(int)), this, SLOT(handleKeepTogether()));
+ connect(m_pwidget->keepWithNext, SIGNAL(stateChanged(int)), this, SLOT(handleKeepWithNext()));
+
+ connect(m_pwidget->tabList_, SIGNAL(tabsChanged()), this, SLOT(slotTabRuler()));
+ connect(m_pwidget->tabList_, SIGNAL(mouseReleased()), this, SLOT(slotTabRuler()));
+ connect(m_pwidget->tabList_->left_, SIGNAL(valueChanged(double)), this, SLOT(slotLeftIndent()));
+ connect(m_pwidget->tabList_->right_, SIGNAL(valueChanged(double)), this, SLOT(slotRightIndent()));
+ connect(m_pwidget->tabList_->first_, SIGNAL(valueChanged(double)), this, SLOT(slotFirstLine()));
+
+ connect(m_pwidget->parentCombo, SIGNAL(activated(const QString&)), this, SLOT(slotParentChanged(const QString&)));
// character attributes
- connect(pwidget_->cpage->fontFace_, SIGNAL(fontSelected(QString)), this, SLOT(slotFont(QString)));
- connect(pwidget_->cpage->effects_, SIGNAL(State(int)), this, SLOT(slotEffects(int)));
- connect(pwidget_->cpage->effects_->ShadowVal->Xoffset, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
- connect(pwidget_->cpage->effects_->ShadowVal->Yoffset, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
- connect(pwidget_->cpage->effects_->OutlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
- connect(pwidget_->cpage->effects_->UnderlineVal->LPos, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
- connect(pwidget_->cpage->effects_->UnderlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
- connect(pwidget_->cpage->effects_->StrikeVal->LPos, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
- connect(pwidget_->cpage->effects_->StrikeVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
- connect(pwidget_->cpage->fillColor_, SIGNAL(activated(const QString&)), this, SLOT(slotFillColor()));
- connect(pwidget_->cpage->fillShade_, SIGNAL(clicked()), this, SLOT(slotFillShade()));
- connect(pwidget_->cpage->strokeColor_, SIGNAL(activated(const QString&)), this, SLOT(slotStrokeColor()));
- connect(pwidget_->cpage->strokeShade_, SIGNAL(clicked()), this, SLOT(slotStrokeShade()));
- connect(pwidget_->cpage->language_, SIGNAL(activated(int)), this, SLOT(slotLanguage()));
- connect(pwidget_->cpage->fontSize_, SIGNAL(valueChanged(double)), this, SLOT(slotFontSize()));
- connect(pwidget_->cpage->fontHScale_, SIGNAL(valueChanged(double)), this, SLOT(slotScaleH()));
- connect(pwidget_->cpage->fontVScale_, SIGNAL(valueChanged(double)), this, SLOT(slotScaleV()));
- connect(pwidget_->cpage->tracking_, SIGNAL(valueChanged(double)), this, SLOT(slotTracking()));
- connect(pwidget_->cpage->widthSpaceSpin, SIGNAL(valueChanged(double)), this, SLOT(slotWordTracking()));
- connect(pwidget_->cpage->baselineOffset_, SIGNAL(valueChanged(double)), this, SLOT(slotBaselineOffset()));
- connect(pwidget_->cpage->fontFace_, SIGNAL(fontSelected(QString)), this, SLOT(slotFont(QString)));
- connect(pwidget_->cpage->parentCombo, SIGNAL(activated(const QString&)), this, SLOT(slotCharParentChanged(const QString&)));
+ connect(m_pwidget->cpage->fontFace_, SIGNAL(fontSelected(QString)), this, SLOT(slotFont(QString)));
+ connect(m_pwidget->cpage->effects_, SIGNAL(State(int)), this, SLOT(slotEffects(int)));
+ connect(m_pwidget->cpage->effects_->ShadowVal->Xoffset, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
+ connect(m_pwidget->cpage->effects_->ShadowVal->Yoffset, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
+ connect(m_pwidget->cpage->effects_->OutlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
+ connect(m_pwidget->cpage->effects_->UnderlineVal->LPos, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
+ connect(m_pwidget->cpage->effects_->UnderlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
+ connect(m_pwidget->cpage->effects_->StrikeVal->LPos, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
+ connect(m_pwidget->cpage->effects_->StrikeVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
+ connect(m_pwidget->cpage->fillColor_, SIGNAL(activated(const QString&)), this, SLOT(slotFillColor()));
+ connect(m_pwidget->cpage->fillShade_, SIGNAL(clicked()), this, SLOT(slotFillShade()));
+ connect(m_pwidget->cpage->strokeColor_, SIGNAL(activated(const QString&)), this, SLOT(slotStrokeColor()));
+ connect(m_pwidget->cpage->strokeShade_, SIGNAL(clicked()), this, SLOT(slotStrokeShade()));
+ connect(m_pwidget->cpage->language_, SIGNAL(activated(int)), this, SLOT(slotLanguage()));
+ connect(m_pwidget->cpage->fontSize_, SIGNAL(valueChanged(double)), this, SLOT(slotFontSize()));
+ connect(m_pwidget->cpage->fontHScale_, SIGNAL(valueChanged(double)), this, SLOT(slotScaleH()));
+ connect(m_pwidget->cpage->fontVScale_, SIGNAL(valueChanged(double)), this, SLOT(slotScaleV()));
+ connect(m_pwidget->cpage->tracking_, SIGNAL(valueChanged(double)), this, SLOT(slotTracking()));
+ connect(m_pwidget->cpage->widthSpaceSpin, SIGNAL(valueChanged(double)), this, SLOT(slotWordTracking()));
+ connect(m_pwidget->cpage->baselineOffset_, SIGNAL(valueChanged(double)), this, SLOT(slotBaselineOffset()));
+ connect(m_pwidget->cpage->fontFace_, SIGNAL(fontSelected(QString)), this, SLOT(slotFont(QString)));
+ connect(m_pwidget->cpage->parentCombo, SIGNAL(activated(const QString&)), this, SLOT(slotCharParentChanged(const QString&)));
}
void SMParagraphStyle::removeConnections()
{
- if (!pwidget_)
+ if (!m_pwidget)
return;
- disconnect(pwidget_->lineSpacingMode_, SIGNAL(activated(int)), this, SLOT(slotLineSpacingMode(int)));
- disconnect(pwidget_->lineSpacing_, SIGNAL(valueChanged(double)), this, SLOT(slotLineSpacing()));
- disconnect(pwidget_->spaceAbove_, SIGNAL(valueChanged(double)), this, SLOT(slotSpaceAbove()));
- disconnect(pwidget_->spaceBelow_, SIGNAL(valueChanged(double)), this, SLOT(slotSpaceBelow()));
- disconnect(pwidget_->alignement_->TextL, SIGNAL(clicked()), this, SLOT(slotAlignment()));
- disconnect(pwidget_->alignement_->TextR, SIGNAL(clicked()), this, SLOT(slotAlignment()));
- disconnect(pwidget_->alignement_->TextC, SIGNAL(clicked()), this, SLOT(slotAlignment()));
- disconnect(pwidget_->alignement_->TextB, SIGNAL(clicked()), this, SLOT(slotAlignment()));
- disconnect(pwidget_->alignement_->TextF, SIGNAL(clicked()), this, SLOT(slotAlignment()));
- disconnect(pwidget_->alignement_->parentButton, SIGNAL(clicked()), this, SLOT(slotAlignment()));
-// disconnect(pwidget_->optMarginCombo, SIGNAL(activated(int)), this, SLOT(slotOpticalMargin(int)));
- disconnect(pwidget_->optMarginRadioNone, SIGNAL(clicked()), this, SLOT(slotOpticalMarginSelector()));
- disconnect(pwidget_->optMarginRadioLeft, SIGNAL(clicked()), this, SLOT(slotOpticalMarginSelector()));
- disconnect(pwidget_->optMarginRadioRight, SIGNAL(clicked()), this, SLOT(slotOpticalMarginSelector()));
- disconnect(pwidget_->optMarginRadioBoth, SIGNAL(clicked()), this, SLOT(slotOpticalMarginSelector()));
-
- disconnect(pwidget_->minSpaceSpin, SIGNAL(valueChanged(double)),this,SLOT(slotMinSpace()));
- disconnect(pwidget_->minGlyphExtSpin, SIGNAL(valueChanged(double)),this,SLOT(slotMinGlyphExt()));
- disconnect(pwidget_->maxGlyphExtSpin, SIGNAL(valueChanged(double)),this,SLOT(slotMaxGlyphExt()));
-
- disconnect(pwidget_, SIGNAL(useParentParaEffects()), this, SLOT(slotParentParaEffects()));
- disconnect(pwidget_->dropCapsBox, SIGNAL(toggled(bool)), this, SLOT(slotDropCap(bool)));
- disconnect(pwidget_->dropCapLines_, SIGNAL(valueChanged(int)), this, SLOT(slotDropCapLines(int)));
- disconnect(pwidget_->parEffectOffset_, SIGNAL(valueChanged(double)), this, SLOT(slotParEffectOffset()));
- disconnect(pwidget_->parEffectIndentBox, SIGNAL(toggled(bool)), this, SLOT(slotParEffectIndent(bool)));
- disconnect(pwidget_->parEffectCharStyleCombo, SIGNAL(activated(const QString&)), this, SLOT(slotParEffectCharStyle(const QString&)));
-
- disconnect(pwidget_->bulletBox, SIGNAL(toggled(bool)), this, SLOT(slotBullet(bool)));
- disconnect(pwidget_->bulletStrEdit_, SIGNAL(editTextChanged(QString)), this, SLOT(slotBulletStr(QString)));
- disconnect(pwidget_->numBox, SIGNAL(toggled(bool)), this, SLOT(slotNumeration(bool)));
- disconnect(pwidget_->numComboBox, SIGNAL(activated(QString)), this, SLOT(slotNumName(QString)));
- disconnect(pwidget_->numFormatCombo, SIGNAL(activated(int)), this, SLOT(slotNumFormat(int)));
- disconnect(pwidget_->numLevelSpin, SIGNAL(valueChanged(int)), this, SLOT(slotNumLevel(int)));
- disconnect(pwidget_->numStartSpin, SIGNAL(valueChanged(int)), this, SLOT(slotNumStart(int)));
- disconnect(pwidget_->numRestartCombo, SIGNAL(activated(int)), this, SLOT(slotNumRestart(int)));
- disconnect(pwidget_->numRestartOtherBox, SIGNAL(toggled(bool)), this, SLOT(slotNumOther(bool)));
- disconnect(pwidget_->numRestartHigherBox, SIGNAL(toggled(bool)), this, SLOT(slotNumHigher(bool)));
- disconnect(pwidget_->numPrefix, SIGNAL(textChanged(QString)), this, SLOT(slotNumPrefix(QString)));
- disconnect(pwidget_->numSuffix, SIGNAL(textChanged(QString)), this, SLOT(slotNumSuffix(QString)));
- disconnect(pwidget_->numNewLineEdit, SIGNAL(editingFinished()), this, SLOT(slotNumNew()));
- disconnect(pwidget_->numNewLineEdit, SIGNAL(textChanged(QString)), this, SLOT(slotSelectionDirty()));
-
- disconnect(pwidget_->parentCombo, SIGNAL(activated(const QString&)), this, SLOT(slotParentChanged(const QString&)));
-
- disconnect(pwidget_->keepLinesStart, SIGNAL(valueChanged(int)), this, SLOT(handleKeepLinesStart()));
- disconnect(pwidget_->keepLinesEnd, SIGNAL(valueChanged(int)), this, SLOT(handleKeepLinesEnd()));
- disconnect(pwidget_->keepTogether, SIGNAL(stateChanged(int)), this, SLOT(handleKeepTogether()));
- disconnect(pwidget_->keepWithNext, SIGNAL(stateChanged(int)), this, SLOT(handleKeepWithNext()));
-
- disconnect(pwidget_->tabList_, SIGNAL(tabsChanged()), this, SLOT(slotTabRuler()));
- disconnect(pwidget_->tabList_->left_, SIGNAL(valueChanged(double)), this, SLOT(slotLeftIndent()));
- disconnect(pwidget_->tabList_->right_, SIGNAL(valueChanged(double)), this, SLOT(slotRightIndent()));
- disconnect(pwidget_->tabList_->first_, SIGNAL(valueChanged(double)), this, SLOT(slotFirstLine()));
-
- disconnect(pwidget_->cpage->fontFace_, SIGNAL(fontSelected(QString)), this, SLOT(slotFont(QString)));
- disconnect(pwidget_->cpage->effects_, SIGNAL(State(int)), this, SLOT(slotEffects(int)));
- disconnect(pwidget_->cpage->effects_->ShadowVal->Xoffset, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
- disconnect(pwidget_->cpage->effects_->ShadowVal->Yoffset, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
- disconnect(pwidget_->cpage->effects_->OutlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
- disconnect(pwidget_->cpage->effects_->UnderlineVal->LPos, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
- disconnect(pwidget_->cpage->effects_->UnderlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
- disconnect(pwidget_->cpage->effects_->StrikeVal->LPos, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
- disconnect(pwidget_->cpage->effects_->StrikeVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
- disconnect(pwidget_->cpage->fillColor_, SIGNAL(activated(const QString&)), this, SLOT(slotFillColor()));
- disconnect(pwidget_->cpage->fillShade_, SIGNAL(clicked()), this, SLOT(slotFillShade()));
- disconnect(pwidget_->cpage->strokeColor_, SIGNAL(activated(const QString&)), this, SLOT(slotStrokeColor()));
- disconnect(pwidget_->cpage->strokeShade_, SIGNAL(clicked()), this, SLOT(slotStrokeShade()));
- disconnect(pwidget_->cpage->language_, SIGNAL(activated(int)), this, SLOT(slotLanguage()));
- disconnect(pwidget_->cpage->fontSize_, SIGNAL(valueChanged(double)), this, SLOT(slotFontSize()));
- disconnect(pwidget_->cpage->fontHScale_, SIGNAL(valueChanged(double)), this, SLOT(slotScaleH()));
- disconnect(pwidget_->cpage->fontVScale_, SIGNAL(valueChanged(double)), this, SLOT(slotScaleV()));
- disconnect(pwidget_->cpage->tracking_, SIGNAL(valueChanged(double)), this, SLOT(slotTracking()));
- disconnect(pwidget_->cpage->widthSpaceSpin, SIGNAL(valueChanged(double)), this, SLOT(slotWordTracking()));
- disconnect(pwidget_->cpage->baselineOffset_, SIGNAL(valueChanged(double)), this, SLOT(slotBaselineOffset()));
- disconnect(pwidget_->cpage->fontFace_, SIGNAL(fontSelected(QString)), this, SLOT(slotFont(QString)));
- disconnect(pwidget_->cpage->parentCombo, SIGNAL(activated(const QString&)), this, SLOT(slotCharParentChanged(const QString&)));
+ disconnect(m_pwidget->lineSpacingMode_, SIGNAL(activated(int)), this, SLOT(slotLineSpacingMode(int)));
+ disconnect(m_pwidget->lineSpacing_, SIGNAL(valueChanged(double)), this, SLOT(slotLineSpacing()));
+ disconnect(m_pwidget->spaceAbove_, SIGNAL(valueChanged(double)), this, SLOT(slotSpaceAbove()));
+ disconnect(m_pwidget->spaceBelow_, SIGNAL(valueChanged(double)), this, SLOT(slotSpaceBelow()));
+ disconnect(m_pwidget->alignement_->TextL, SIGNAL(clicked()), this, SLOT(slotAlignment()));
+ disconnect(m_pwidget->alignement_->TextR, SIGNAL(clicked()), this, SLOT(slotAlignment()));
+ disconnect(m_pwidget->alignement_->TextC, SIGNAL(clicked()), this, SLOT(slotAlignment()));
+ disconnect(m_pwidget->alignement_->TextB, SIGNAL(clicked()), this, SLOT(slotAlignment()));
+ disconnect(m_pwidget->alignement_->TextF, SIGNAL(clicked()), this, SLOT(slotAlignment()));
+ disconnect(m_pwidget->alignement_->parentButton, SIGNAL(clicked()), this, SLOT(slotAlignment()));
+// disconnect(m_pwidget->optMarginCombo, SIGNAL(activated(int)), this, SLOT(slotOpticalMargin(int)));
+ disconnect(m_pwidget->optMarginRadioNone, SIGNAL(clicked()), this, SLOT(slotOpticalMarginSelector()));
+ disconnect(m_pwidget->optMarginRadioLeft, SIGNAL(clicked()), this, SLOT(slotOpticalMarginSelector()));
+ disconnect(m_pwidget->optMarginRadioRight, SIGNAL(clicked()), this, SLOT(slotOpticalMarginSelector()));
+ disconnect(m_pwidget->optMarginRadioBoth, SIGNAL(clicked()), this, SLOT(slotOpticalMarginSelector()));
+
+ disconnect(m_pwidget->minSpaceSpin, SIGNAL(valueChanged(double)),this,SLOT(slotMinSpace()));
+ disconnect(m_pwidget->minGlyphExtSpin, SIGNAL(valueChanged(double)),this,SLOT(slotMinGlyphExt()));
+ disconnect(m_pwidget->maxGlyphExtSpin, SIGNAL(valueChanged(double)),this,SLOT(slotMaxGlyphExt()));
+
+ disconnect(m_pwidget, SIGNAL(useParentParaEffects()), this, SLOT(slotParentParaEffects()));
+ disconnect(m_pwidget->dropCapsBox, SIGNAL(toggled(bool)), this, SLOT(slotDropCap(bool)));
+ disconnect(m_pwidget->dropCapLines_, SIGNAL(valueChanged(int)), this, SLOT(slotDropCapLines(int)));
+ disconnect(m_pwidget->parEffectOffset_, SIGNAL(valueChanged(double)), this, SLOT(slotParEffectOffset()));
+ disconnect(m_pwidget->parEffectIndentBox, SIGNAL(toggled(bool)), this, SLOT(slotParEffectIndent(bool)));
+ disconnect(m_pwidget->parEffectCharStyleCombo, SIGNAL(activated(const QString&)), this, SLOT(slotParEffectCharStyle(const QString&)));
+
+ disconnect(m_pwidget->bulletBox, SIGNAL(toggled(bool)), this, SLOT(slotBullet(bool)));
+ disconnect(m_pwidget->bulletStrEdit_, SIGNAL(editTextChanged(QString)), this, SLOT(slotBulletStr(QString)));
+ disconnect(m_pwidget->numBox, SIGNAL(toggled(bool)), this, SLOT(slotNumeration(bool)));
+ disconnect(m_pwidget->numComboBox, SIGNAL(activated(QString)), this, SLOT(slotNumName(QString)));
+ disconnect(m_pwidget->numFormatCombo, SIGNAL(activated(int)), this, SLOT(slotNumFormat(int)));
+ disconnect(m_pwidget->numLevelSpin, SIGNAL(valueChanged(int)), this, SLOT(slotNumLevel(int)));
+ disconnect(m_pwidget->numStartSpin, SIGNAL(valueChanged(int)), this, SLOT(slotNumStart(int)));
+ disconnect(m_pwidget->numRestartCombo, SIGNAL(activated(int)), this, SLOT(slotNumRestart(int)));
+ disconnect(m_pwidget->numRestartOtherBox, SIGNAL(toggled(bool)), this, SLOT(slotNumOther(bool)));
+ disconnect(m_pwidget->numRestartHigherBox, SIGNAL(toggled(bool)), this, SLOT(slotNumHigher(bool)));
+ disconnect(m_pwidget->numPrefix, SIGNAL(textChanged(QString)), this, SLOT(slotNumPrefix(QString)));
+ disconnect(m_pwidget->numSuffix, SIGNAL(textChanged(QString)), this, SLOT(slotNumSuffix(QString)));
+ disconnect(m_pwidget->numNewLineEdit, SIGNAL(editingFinished()), this, SLOT(slotNumNew()));
+ disconnect(m_pwidget->numNewLineEdit, SIGNAL(textChanged(QString)), this, SLOT(slotSelectionDirty()));
+
+ disconnect(m_pwidget->parentCombo, SIGNAL(activated(const QString&)), this, SLOT(slotParentChanged(const QString&)));
+
+ disconnect(m_pwidget->keepLinesStart, SIGNAL(valueChanged(int)), this, SLOT(handleKeepLinesStart()));
+ disconnect(m_pwidget->keepLinesEnd, SIGNAL(valueChanged(int)), this, SLOT(handleKeepLinesEnd()));
+ disconnect(m_pwidget->keepTogether, SIGNAL(stateChanged(int)), this, SLOT(handleKeepTogether()));
+ disconnect(m_pwidget->keepWithNext, SIGNAL(stateChanged(int)), this, SLOT(handleKeepWithNext()));
+
+ disconnect(m_pwidget->tabList_, SIGNAL(tabsChanged()), this, SLOT(slotTabRuler()));
+ disconnect(m_pwidget->tabList_->left_, SIGNAL(valueChanged(double)), this, SLOT(slotLeftIndent()));
+ disconnect(m_pwidget->tabList_->right_, SIGNAL(valueChanged(double)), this, SLOT(slotRightIndent()));
+ disconnect(m_pwidget->tabList_->first_, SIGNAL(valueChanged(double)), this, SLOT(slotFirstLine()));
+
+ disconnect(m_pwidget->cpage->fontFace_, SIGNAL(fontSelected(QString)), this, SLOT(slotFont(QString)));
+ disconnect(m_pwidget->cpage->effects_, SIGNAL(State(int)), this, SLOT(slotEffects(int)));
+ disconnect(m_pwidget->cpage->effects_->ShadowVal->Xoffset, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
+ disconnect(m_pwidget->cpage->effects_->ShadowVal->Yoffset, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
+ disconnect(m_pwidget->cpage->effects_->OutlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
+ disconnect(m_pwidget->cpage->effects_->UnderlineVal->LPos, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
+ disconnect(m_pwidget->cpage->effects_->UnderlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
+ disconnect(m_pwidget->cpage->effects_->StrikeVal->LPos, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
+ disconnect(m_pwidget->cpage->effects_->StrikeVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(slotEffectProperties()));
+ disconnect(m_pwidget->cpage->fillColor_, SIGNAL(activated(const QString&)), this, SLOT(slotFillColor()));
+ disconnect(m_pwidget->cpage->fillShade_, SIGNAL(clicked()), this, SLOT(slotFillShade()));
+ disconnect(m_pwidget->cpage->strokeColor_, SIGNAL(activated(const QString&)), this, SLOT(slotStrokeColor()));
+ disconnect(m_pwidget->cpage->strokeShade_, SIGNAL(clicked()), this, SLOT(slotStrokeShade()));
+ disconnect(m_pwidget->cpage->language_, SIGNAL(activated(int)), this, SLOT(slotLanguage()));
+ disconnect(m_pwidget->cpage->fontSize_, SIGNAL(valueChanged(double)), this, SLOT(slotFontSize()));
+ disconnect(m_pwidget->cpage->fontHScale_, SIGNAL(valueChanged(double)), this, SLOT(slotScaleH()));
+ disconnect(m_pwidget->cpage->fontVScale_, SIGNAL(valueChanged(double)), this, SLOT(slotScaleV()));
+ disconnect(m_pwidget->cpage->tracking_, SIGNAL(valueChanged(double)), this, SLOT(slotTracking()));
+ disconnect(m_pwidget->cpage->widthSpaceSpin, SIGNAL(valueChanged(double)), this, SLOT(slotWordTracking()));
+ disconnect(m_pwidget->cpage->baselineOffset_, SIGNAL(valueChanged(double)), this, SLOT(slotBaselineOffset()));
+ disconnect(m_pwidget->cpage->fontFace_, SIGNAL(fontSelected(QString)), this, SLOT(slotFont(QString)));
+ disconnect(m_pwidget->cpage->parentCombo, SIGNAL(activated(const QString&)), this, SLOT(slotCharParentChanged(const QString&)));
}
void SMParagraphStyle::slotLineSpacingMode(int mode)
{
ParagraphStyle::LineSpacingMode lsm = static_cast<ParagraphStyle::LineSpacingMode>(mode);
- if (pwidget_->lineSpacingMode_->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->resetLineSpacingMode();
- else
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setLineSpacingMode(lsm);
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ if (m_pwidget->lineSpacingMode_->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->resetLineSpacingMode();
+ else
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setLineSpacingMode(lsm);
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotLineSpacing()
{
- if (pwidget_->lineSpacing_->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->resetLineSpacing();
+ if (m_pwidget->lineSpacing_->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->resetLineSpacing();
else
{
double a, b, value;
int c;
- pwidget_->lineSpacing_->getValues(&a, &b, &c, &value);
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setLineSpacing(value);
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ m_pwidget->lineSpacing_->getValues(&a, &b, &c, &value);
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setLineSpacing(value);
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotSpaceAbove()
{
- if (pwidget_->spaceAbove_->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->resetGapBefore();
+ if (m_pwidget->spaceAbove_->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->resetGapBefore();
else
{
double a, b, value;
int c;
- pwidget_->spaceAbove_->getValues(&a, &b, &c, &value);
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setGapBefore(value);
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ m_pwidget->spaceAbove_->getValues(&a, &b, &c, &value);
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setGapBefore(value);
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotSpaceBelow()
{
- if (pwidget_->spaceBelow_->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->resetGapAfter();
+ if (m_pwidget->spaceBelow_->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->resetGapAfter();
else
{
double a, b, value;
int c;
- pwidget_->spaceBelow_->getValues(&a, &b, &c, &value);
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setGapAfter(value);
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ m_pwidget->spaceBelow_->getValues(&a, &b, &c, &value);
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setGapAfter(value);
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotAlignment()
{
- ParagraphStyle::AlignmentType style = static_cast<ParagraphStyle::AlignmentType>(pwidget_->alignement_->getStyle());
- if (pwidget_->alignement_->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->resetAlignment();
+ ParagraphStyle::AlignmentType style = static_cast<ParagraphStyle::AlignmentType>(m_pwidget->alignement_->getStyle());
+ if (m_pwidget->alignement_->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->resetAlignment();
else
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setAlignment(style);
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setAlignment(style);
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotOpticalMargin(int i)
{
-// ParagraphStyle::OpticalMarginType omt( static_cast<ParagraphStyle::OpticalMarginType>(pwidget_->optMarginCombo->itemData(i).toInt()));
-// if (pwidget_->optMarginCombo->useParentValue())
-// for (int i = 0; i < selection_.count(); ++i)
-// selection_[i]->resetOpticalMargins();
+// ParagraphStyle::OpticalMarginType omt( static_cast<ParagraphStyle::OpticalMarginType>(m_pwidget->optMarginCombo->itemData(i).toInt()));
+// if (m_pwidget->optMarginCombo->useParentValue())
+// for (int i = 0; i < m_selection.count(); ++i)
+// m_selection[i]->resetOpticalMargins();
// else
-// for (int i = 0; i < selection_.count(); ++i)
-// selection_[i]->setOpticalMargins(omt);
+// for (int i = 0; i < m_selection.count(); ++i)
+// m_selection[i]->setOpticalMargins(omt);
//
-// if (!selectionIsDirty_)
+// if (!m_selectionIsDirty)
// {
-// selectionIsDirty_ = true;
+// m_selectionIsDirty = true;
// emit selectionDirty();
// }
}
@@ -778,219 +778,219 @@
void SMParagraphStyle::slotOpticalMarginSelector()
{
int omt(ParagraphStyle::OM_None);
- if (false)//(pwidget_->optMarginCombo->useParentValue())
- {
- }
- else
- {
-// if (pwidget_->optMarginRadioNone->isChecked()) omt = aragraphStyle::OM_None;
- if (pwidget_->optMarginRadioRight->isChecked()) omt = ParagraphStyle::OM_RightHangingPunct;
- else if (pwidget_->optMarginRadioLeft->isChecked()) omt = ParagraphStyle::OM_LeftHangingPunct;
- else if (pwidget_->optMarginRadioBoth->isChecked()) omt = ParagraphStyle::OM_Default;
-
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setOpticalMargins(omt);
- }
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ if (false)//(m_pwidget->optMarginCombo->useParentValue())
+ {
+ }
+ else
+ {
+// if (m_pwidget->optMarginRadioNone->isChecked()) omt = aragraphStyle::OM_None;
+ if (m_pwidget->optMarginRadioRight->isChecked()) omt = ParagraphStyle::OM_RightHangingPunct;
+ else if (m_pwidget->optMarginRadioLeft->isChecked()) omt = ParagraphStyle::OM_LeftHangingPunct;
+ else if (m_pwidget->optMarginRadioBoth->isChecked()) omt = ParagraphStyle::OM_Default;
+
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setOpticalMargins(omt);
+ }
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotParentOpticalMargin()
{
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->resetOpticalMargins();
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->resetOpticalMargins();
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotMinSpace()
{
- if (pwidget_->minSpaceSpin->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->resetMinWordTracking();
+ if (m_pwidget->minSpaceSpin->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->resetMinWordTracking();
else
{
- double ms(pwidget_->minSpaceSpin->getValue(SC_PERCENT));
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setMinWordTracking(ms / 100.0);
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ double ms(m_pwidget->minSpaceSpin->getValue(SC_PERCENT));
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setMinWordTracking(ms / 100.0);
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotMinGlyphExt()
{
- if (pwidget_->minGlyphExtSpin->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->resetMinGlyphExtension();
+ if (m_pwidget->minGlyphExtSpin->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->resetMinGlyphExtension();
else
{
- double mge(pwidget_->minGlyphExtSpin->getValue(SC_PERCENT));
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setMinGlyphExtension(mge / 100.0);
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ double mge(m_pwidget->minGlyphExtSpin->getValue(SC_PERCENT));
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setMinGlyphExtension(mge / 100.0);
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotMaxGlyphExt()
{
- if (pwidget_->maxGlyphExtSpin->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->resetMaxGlyphExtension();
+ if (m_pwidget->maxGlyphExtSpin->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->resetMaxGlyphExtension();
else
{
- double mge(pwidget_->maxGlyphExtSpin->getValue(SC_PERCENT));
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setMaxGlyphExtension(mge / 100.0);
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ double mge(m_pwidget->maxGlyphExtSpin->getValue(SC_PERCENT));
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setMaxGlyphExtension(mge / 100.0);
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotDropCap(bool isOn)
{
- for (int i = 0; i < selection_.count(); ++i)
- {
- selection_[i]->setHasDropCap(isOn);
+ for (int i = 0; i < m_selection.count(); ++i)
+ {
+ m_selection[i]->setHasDropCap(isOn);
if (isOn)
{
- selection_[i]->setHasBullet(false);
- selection_[i]->setHasNum(false);
- }
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ m_selection[i]->setHasBullet(false);
+ m_selection[i]->setHasNum(false);
+ }
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotParentParaEffects()
{
- for (int i = 0; i < selection_.count(); ++i)
- {
- selection_[i]->resetHasDropCap();
- selection_[i]->resetHasBullet();
- selection_[i]->resetHasNum();
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ for (int i = 0; i < m_selection.count(); ++i)
+ {
+ m_selection[i]->resetHasDropCap();
+ m_selection[i]->resetHasBullet();
+ m_selection[i]->resetHasNum();
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotDropCapLines(int lines)
{
- if (pwidget_->dropCapLines_->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->resetDropCapLines();
+ if (m_pwidget->dropCapLines_->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->resetDropCapLines();
else
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setDropCapLines(lines);
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setDropCapLines(lines);
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotParEffectOffset()
{
- if (pwidget_->parEffectOffset_->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->resetParEffectOffset();
+ if (m_pwidget->parEffectOffset_->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->resetParEffectOffset();
else
{
double a, b, value;
int c;
- pwidget_->parEffectOffset_->getValues(&a, &b, &c, &value);
- value = value / unitRatio_;
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setParEffectOffset(value);
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ m_pwidget->parEffectOffset_->getValues(&a, &b, &c, &value);
+ value = value / m_unitRatio;
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setParEffectOffset(value);
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotParEffectIndent(bool isOn)
{
- if (pwidget_->parEffectIndentBox->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->resetParEffectIndent();
+ if (m_pwidget->parEffectIndentBox->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->resetParEffectIndent();
else
{
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setParEffectIndent(isOn);
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setParEffectIndent(isOn);
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotParEffectCharStyle(const QString& name)
{
- if (pwidget_->parEffectCharStyleCombo->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->resetPeCharStyleName();
- else
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setPeCharStyleName(name);
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ if (m_pwidget->parEffectCharStyleCombo->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->resetPeCharStyleName();
+ else
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setPeCharStyleName(name);
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotBullet(bool isOn)
{
- for (int i = 0; i < selection_.count(); ++i)
- {
- selection_[i]->setHasBullet(isOn);
+ for (int i = 0; i < m_selection.count(); ++i)
+ {
+ m_selection[i]->setHasBullet(isOn);
if (isOn)
{
- selection_[i]->setBulletStr(pwidget_->bulletStrEdit_->currentText());
- selection_[i]->setHasDropCap(false);
- selection_[i]->setHasNum(false);
- }
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ m_selection[i]->setBulletStr(m_pwidget->bulletStrEdit_->currentText());
+ m_selection[i]->setHasDropCap(false);
+ m_selection[i]->setHasNum(false);
+ }
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
@@ -1000,34 +1000,34 @@
QString bstr(str);
if (bstr.isEmpty())
{
- bstr = pwidget_->bulletStrEdit_->itemText(0);
- pwidget_->bulletStrEdit_->setEditText(bstr);
- }
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setBulletStr(bstr);
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ bstr = m_pwidget->bulletStrEdit_->itemText(0);
+ m_pwidget->bulletStrEdit_->setEditText(bstr);
+ }
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setBulletStr(bstr);
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotNumeration(bool isOn)
{
- for (int i = 0; i < selection_.count(); ++i)
- {
- selection_[i]->setHasNum(isOn);
+ for (int i = 0; i < m_selection.count(); ++i)
+ {
+ m_selection[i]->setHasNum(isOn);
if (isOn)
{
- selection_[i]->setHasDropCap(false);
- selection_[i]->setHasBullet(false);
- }
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ m_selection[i]->setHasDropCap(false);
+ m_selection[i]->setHasBullet(false);
+ }
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
@@ -1037,175 +1037,175 @@
QString bstr(str);
if (!str.isEmpty())
{
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setNumName(bstr);
- pwidget_->numComboBox->setCurrentItem(pwidget_->numComboBox->findText(selection_[0]->numName()));
- pwidget_->numLevelSpin->setValue(selection_[0]->numLevel()+1);
- NumStruct * numS = doc_->numerations.value(selection_[0]->numName());
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setNumName(bstr);
+ m_pwidget->numComboBox->setCurrentItem(m_pwidget->numComboBox->findText(m_selection[0]->numName()));
+ m_pwidget->numLevelSpin->setValue(m_selection[0]->numLevel()+1);
+ NumStruct * numS = m_doc->numerations.value(m_selection[0]->numName());
if (numS)
- pwidget_->numLevelSpin->setMaximum(numS->m_counters.count()+1);
+ m_pwidget->numLevelSpin->setMaximum(numS->m_counters.count()+1);
else
- pwidget_->numLevelSpin->setMaximum(1);
- doc_->flag_NumUpdateRequest = true;
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ m_pwidget->numLevelSpin->setMaximum(1);
+ m_doc->flag_NumUpdateRequest = true;
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotNumNew()
{
- QString newName = pwidget_->numNewLineEdit->text();
+ QString newName = m_pwidget->numNewLineEdit->text();
if (!newName.isEmpty())
{
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setNumName(newName);
- doc_->flag_NumUpdateRequest = true;
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setNumName(newName);
+ m_doc->flag_NumUpdateRequest = true;
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotSelectionDirty()
{
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotNumFormat(int numFormat)
{
- if (pwidget_->numFormatCombo->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->resetNumFormat();
- else
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setNumFormat(numFormat);
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ if (m_pwidget->numFormatCombo->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->resetNumFormat();
+ else
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setNumFormat(numFormat);
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotNumLevel(int level)
{
- if (pwidget_->numLevelSpin->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->resetNumLevel();
- else
- for (int i = 0; i < selection_.count(); ++i)
- {
- selection_[i]->setNumLevel(level-1);
+ if (m_pwidget->numLevelSpin->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->resetNumLevel();
+ else
+ for (int i = 0; i < m_selection.count(); ++i)
+ {
+ m_selection[i]->setNumLevel(level-1);
}
if (level == 0)
slotNumHigher(false);
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotNumPrefix(const QString &str)
{
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setNumPrefix(str);
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setNumPrefix(str);
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotNumSuffix(const QString &str)
{
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setNumSuffix(str);
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setNumSuffix(str);
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotNumStart(int start)
{
- if (pwidget_->numStartSpin->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->resetNumStart();
- else
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setNumStart(start);
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ if (m_pwidget->numStartSpin->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->resetNumStart();
+ else
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setNumStart(start);
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotNumRestart(int restart)
{
- if (pwidget_->numRestartCombo->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->resetNumRestart();
- else
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setNumRestart(restart);
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ if (m_pwidget->numRestartCombo->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->resetNumRestart();
+ else
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setNumRestart(restart);
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotNumOther(bool isOn)
{
- if (pwidget_->numRestartOtherBox->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->resetNumOther();
+ if (m_pwidget->numRestartOtherBox->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->resetNumOther();
else
{
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setNumOther(isOn);
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setNumOther(isOn);
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotNumHigher(bool isOn)
{
- if (pwidget_->numRestartHigherBox->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->resetNumHigher();
+ if (m_pwidget->numRestartHigherBox->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->resetNumHigher();
else
{
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setNumHigher(isOn);
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setNumHigher(isOn);
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
@@ -1213,190 +1213,190 @@
void SMParagraphStyle::handleKeepLinesStart()
{
- if (pwidget_->keepLinesStart->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->resetKeepLinesStart();
+ if (m_pwidget->keepLinesStart->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->resetKeepLinesStart();
else
{
- int value = pwidget_->keepLinesStart->value();
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setKeepLinesStart (value);
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ int value = m_pwidget->keepLinesStart->value();
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setKeepLinesStart (value);
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::handleKeepLinesEnd()
{
- if (pwidget_->keepLinesEnd->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->resetKeepLinesEnd();
+ if (m_pwidget->keepLinesEnd->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->resetKeepLinesEnd();
else
{
- int value = pwidget_->keepLinesEnd->value();
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setKeepLinesEnd (value);
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ int value = m_pwidget->keepLinesEnd->value();
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setKeepLinesEnd (value);
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::handleKeepTogether()
{
- if (pwidget_->keepTogether->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->resetKeepTogether();
+ if (m_pwidget->keepTogether->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->resetKeepTogether();
else
{
- bool value = pwidget_->keepTogether->isChecked();
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setKeepTogether (value);
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ bool value = m_pwidget->keepTogether->isChecked();
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setKeepTogether (value);
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::handleKeepWithNext()
{
- if (pwidget_->keepWithNext->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->resetKeepWithNext();
+ if (m_pwidget->keepWithNext->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->resetKeepWithNext();
else
{
- bool value = pwidget_->keepWithNext->isChecked();
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setKeepWithNext (value);
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ bool value = m_pwidget->keepWithNext->isChecked();
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setKeepWithNext (value);
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotTabRuler()
{
- if (pwidget_->tabList_->useParentTabs())
- {
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->resetTabValues();
- }
- else
- {
- QList<ParagraphStyle::TabRecord> newTabs = pwidget_->tabList_->getTabVals();
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setTabValues(newTabs);
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ if (m_pwidget->tabList_->useParentTabs())
+ {
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->resetTabValues();
+ }
+ else
+ {
+ QList<ParagraphStyle::TabRecord> newTabs = m_pwidget->tabList_->getTabVals();
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setTabValues(newTabs);
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotLeftIndent()
{
- if (pwidget_->tabList_->useParentLeftIndent())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->resetLeftMargin();
+ if (m_pwidget->tabList_->useParentLeftIndent())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->resetLeftMargin();
else
{
double a, b, value;
int c;
- pwidget_->tabList_->left_->getValues(&a, &b, &c, &value);
- value = value / unitRatio_;
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setLeftMargin(value);
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ m_pwidget->tabList_->left_->getValues(&a, &b, &c, &value);
+ value = value / m_unitRatio;
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setLeftMargin(value);
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotRightIndent()
{
- if (pwidget_->tabList_->useParentRightIndent())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->resetRightMargin();
+ if (m_pwidget->tabList_->useParentRightIndent())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->resetRightMargin();
else
{
double a, b, value;
int c;
- pwidget_->tabList_->right_->getValues(&a, &b, &c, &value);
- value = value / unitRatio_;
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setRightMargin(value);
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ m_pwidget->tabList_->right_->getValues(&a, &b, &c, &value);
+ value = value / m_unitRatio;
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setRightMargin(value);
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotFirstLine()
{
- if (pwidget_->tabList_->useParentFirstLine())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->resetFirstIndent();
+ if (m_pwidget->tabList_->useParentFirstLine())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->resetFirstIndent();
else
{
double a, b, value;
int c;
- pwidget_->tabList_->first_->getValues(&a, &b, &c, &value);
- value = value / unitRatio_;
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setFirstIndent(value);
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ m_pwidget->tabList_->first_->getValues(&a, &b, &c, &value);
+ value = value / m_unitRatio;
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setFirstIndent(value);
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotFontSize()
{
- if (pwidget_->cpage->fontSize_->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->charStyle().resetFontSize();
+ if (m_pwidget->cpage->fontSize_->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->charStyle().resetFontSize();
else
{
double a, b, value;
int c;
- pwidget_->cpage->fontSize_->getValues(&a, &b, &c, &value);
+ m_pwidget->cpage->fontSize_->getValues(&a, &b, &c, &value);
value = value * 10;
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->charStyle().setFontSize(qRound(value));
- }
-
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->charStyle().setFontSize(qRound(value));
+ }
+
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
@@ -1404,18 +1404,18 @@
void SMParagraphStyle::slotEffects(int e)
{
StyleFlag s = ScStyle_None;
- if (pwidget_->cpage->effects_->useParentValue())
- {
- for (int i = 0; i < selection_.count(); ++i)
- {
- selection_[i]->charStyle().resetFeatures();
- selection_[i]->charStyle().resetShadowXOffset();
- selection_[i]->charStyle().resetShadowYOffset();
- selection_[i]->charStyle().resetOutlineWidth();
- selection_[i]->charStyle().resetUnderlineOffset();
- selection_[i]->charStyle().resetUnderlineWidth();
- selection_[i]->charStyle().resetStrikethruOffset();
- selection_[i]->charStyle().resetStrikethruWidth();
+ if (m_pwidget->cpage->effects_->useParentValue())
+ {
+ for (int i = 0; i < m_selection.count(); ++i)
+ {
+ m_selection[i]->charStyle().resetFeatures();
+ m_selection[i]->charStyle().resetShadowXOffset();
+ m_selection[i]->charStyle().resetShadowYOffset();
+ m_selection[i]->charStyle().resetOutlineWidth();
+ m_selection[i]->charStyle().resetUnderlineOffset();
+ m_selection[i]->charStyle().resetUnderlineWidth();
+ m_selection[i]->charStyle().resetStrikethruOffset();
+ m_selection[i]->charStyle().resetStrikethruWidth();
}
}
else
@@ -1424,44 +1424,44 @@
int c;
s = static_cast<StyleFlag>(e);
- pwidget_->cpage->effects_->ShadowVal->Xoffset->getValues(&a, &b, &c, &sxo);
+ m_pwidget->cpage->effects_->ShadowVal->Xoffset->getValues(&a, &b, &c, &sxo);
sxo *= 10;
- pwidget_->cpage->effects_->ShadowVal->Yoffset->getValues(&a, &b, &c, &syo);
+ m_pwidget->cpage->effects_->ShadowVal->Yoffset->getValues(&a, &b, &c, &syo);
syo *= 10;
- pwidget_->cpage->effects_->OutlineVal->LWidth->getValues(&a, &b, &c, &olw);
+ m_pwidget->cpage->effects_->OutlineVal->LWidth->getValues(&a, &b, &c, &olw);
olw *= 10;
- pwidget_->cpage->effects_->UnderlineVal->LPos->getValues(&a, &b, &c, &ulp);
+ m_pwidget->cpage->effects_->UnderlineVal->LPos->getValues(&a, &b, &c, &ulp);
ulp *= 10;
- pwidget_->cpage->effects_->UnderlineVal->LWidth->getValues(&a, &b, &c, &ulw);
+ m_pwidget->cpage->effects_->UnderlineVal->LWidth->getValues(&a, &b, &c, &ulw);
ulw *= 10;
- pwidget_->cpage->effects_->StrikeVal->LPos->getValues(&a, &b, &c, &slp);
+ m_pwidget->cpage->effects_->StrikeVal->LPos->getValues(&a, &b, &c, &slp);
slp *= 10;
- pwidget_->cpage->effects_->StrikeVal->LWidth->getValues(&a, &b, &c, &slw);
+ m_pwidget->cpage->effects_->StrikeVal->LWidth->getValues(&a, &b, &c, &slw);
slw *= 10;
- for (int i = 0; i < selection_.count(); ++i)
+ for (int i = 0; i < m_selection.count(); ++i)
{
QStringList feList = s.featureList();
feList.removeAll(CharStyle::INHERIT);
- selection_[i]->charStyle().setFeatures(feList);
-// selection_[i]->charStyle().setFeatures(s.featureList());
- selection_[i]->charStyle().setShadowXOffset(qRound(sxo));
- selection_[i]->charStyle().setShadowYOffset(qRound(syo));
- selection_[i]->charStyle().setOutlineWidth(qRound(olw));
- selection_[i]->charStyle().setUnderlineOffset(qRound(ulp));
- selection_[i]->charStyle().setUnderlineWidth(qRound(ulw));
- selection_[i]->charStyle().setStrikethruOffset(qRound(slp));
- selection_[i]->charStyle().setStrikethruWidth(qRound(slw));
- }
- }
-
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ m_selection[i]->charStyle().setFeatures(feList);
+// m_selection[i]->charStyle().setFeatures(s.featureList());
+ m_selection[i]->charStyle().setShadowXOffset(qRound(sxo));
+ m_selection[i]->charStyle().setShadowYOffset(qRound(syo));
+ m_selection[i]->charStyle().setOutlineWidth(qRound(olw));
+ m_selection[i]->charStyle().setUnderlineOffset(qRound(ulp));
+ m_selection[i]->charStyle().setUnderlineWidth(qRound(ulw));
+ m_selection[i]->charStyle().setStrikethruOffset(qRound(slp));
+ m_selection[i]->charStyle().setStrikethruWidth(qRound(slw));
+ }
+ }
+
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
@@ -1471,114 +1471,114 @@
double a, b, sxo, syo, olw, ulp, ulw, slp, slw;
int c;
- pwidget_->cpage->effects_->ShadowVal->Xoffset->getValues(&a, &b, &c, &sxo);
+ m_pwidget->cpage->effects_->ShadowVal->Xoffset->getValues(&a, &b, &c, &sxo);
sxo *= 10;
- pwidget_->cpage->effects_->ShadowVal->Yoffset->getValues(&a, &b, &c, &syo);
+ m_pwidget->cpage->effects_->ShadowVal->Yoffset->getValues(&a, &b, &c, &syo);
syo *= 10;
- pwidget_->cpage->effects_->OutlineVal->LWidth->getValues(&a, &b, &c, &olw);
+ m_pwidget->cpage->effects_->OutlineVal->LWidth->getValues(&a, &b, &c, &olw);
olw *= 10;
- pwidget_->cpage->effects_->UnderlineVal->LPos->getValues(&a, &b, &c, &ulp);
+ m_pwidget->cpage->effects_->UnderlineVal->LPos->getValues(&a, &b, &c, &ulp);
ulp *= 10;
- pwidget_->cpage->effects_->UnderlineVal->LWidth->getValues(&a, &b, &c, &ulw);
+ m_pwidget->cpage->effects_->UnderlineVal->LWidth->getValues(&a, &b, &c, &ulw);
ulw *= 10;
- pwidget_->cpage->effects_->StrikeVal->LPos->getValues(&a, &b, &c, &slp);
+ m_pwidget->cpage->effects_->StrikeVal->LPos->getValues(&a, &b, &c, &slp);
slp *= 10;
- pwidget_->cpage->effects_->StrikeVal->LWidth->getValues(&a, &b, &c, &slw);
+ m_pwidget->cpage->effects_->StrikeVal->LWidth->getValues(&a, &b, &c, &slw);
slw *= 10;
- for (int i = 0; i < selection_.count(); ++i)
- {
- selection_[i]->charStyle().setShadowXOffset(qRound(sxo));
- selection_[i]->charStyle().setShadowYOffset(qRound(syo));
- selection_[i]->charStyle().setOutlineWidth(qRound(olw));
- selection_[i]->charStyle().setUnderlineOffset(qRound(ulp));
- selection_[i]->charStyle().setUnderlineWidth(qRound(ulw));
- selection_[i]->charStyle().setStrikethruOffset(qRound(slp));
- selection_[i]->charStyle().setStrikethruWidth(qRound(slw));
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ for (int i = 0; i < m_selection.count(); ++i)
+ {
+ m_selection[i]->charStyle().setShadowXOffset(qRound(sxo));
+ m_selection[i]->charStyle().setShadowYOffset(qRound(syo));
+ m_selection[i]->charStyle().setOutlineWidth(qRound(olw));
+ m_selection[i]->charStyle().setUnderlineOffset(qRound(ulp));
+ m_selection[i]->charStyle().setUnderlineWidth(qRound(ulw));
+ m_selection[i]->charStyle().setStrikethruOffset(qRound(slp));
+ m_selection[i]->charStyle().setStrikethruWidth(qRound(slw));
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotFillColor()
{
- if (pwidget_->cpage->fillColor_->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->charStyle().resetFillColor();
+ if (m_pwidget->cpage->fillColor_->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->charStyle().resetFillColor();
else {
- QString c( pwidget_->cpage->fillColor_->currentText());
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->charStyle().setFillColor(c);
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ QString c( m_pwidget->cpage->fillColor_->currentText());
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->charStyle().setFillColor(c);
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotFillShade()
{
- if (pwidget_->cpage->fillShade_->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->charStyle().resetFillShade();
+ if (m_pwidget->cpage->fillShade_->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->charStyle().resetFillShade();
else {
- int fs = pwidget_->cpage->fillShade_->getValue();
-
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->charStyle().setFillShade(fs);
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ int fs = m_pwidget->cpage->fillShade_->getValue();
+
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->charStyle().setFillShade(fs);
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotStrokeColor()
{
- if (pwidget_->cpage->strokeColor_->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->charStyle().resetStrokeColor();
+ if (m_pwidget->cpage->strokeColor_->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->charStyle().resetStrokeColor();
else {
- QString c(pwidget_->cpage->strokeColor_->currentText());
-
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->charStyle().setStrokeColor(c);
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ QString c(m_pwidget->cpage->strokeColor_->currentText());
+
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->charStyle().setStrokeColor(c);
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotStrokeShade()
{
- if (pwidget_->cpage->strokeShade_->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->charStyle().resetStrokeShade();
+ if (m_pwidget->cpage->strokeShade_->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->charStyle().resetStrokeShade();
else
{
- int ss = pwidget_->cpage->strokeShade_->getValue();
-
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->charStyle().setStrokeShade(ss);
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ int ss = m_pwidget->cpage->strokeShade_->getValue();
+
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->charStyle().setStrokeShade(ss);
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
@@ -1586,154 +1586,154 @@
void SMParagraphStyle::slotLanguage()
{
QMap<QString,QString>::Iterator it;
- QString language = doc_->paragraphStyle("").charStyle().language();
-
- if (pwidget_->cpage->language_->useParentValue())
- {
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->charStyle().resetLanguage();
- }
- else
- {
- QString la=LanguageManager::instance()->getAbbrevFromLang(pwidget_->cpage->language_->currentText(), true, false);
+ QString language = m_doc->paragraphStyle("").charStyle().language();
+
+ if (m_pwidget->cpage->language_->useParentValue())
+ {
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->charStyle().resetLanguage();
+ }
+ else
+ {
+ QString la=LanguageManager::instance()->getAbbrevFromLang(m_pwidget->cpage->language_->currentText(), true, false);
if (!la.isEmpty())
language=la;
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->charStyle().setLanguage(language);
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->charStyle().setLanguage(language);
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotScaleH()
{
- if (pwidget_->cpage->fontHScale_->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->charStyle().resetScaleH();
+ if (m_pwidget->cpage->fontHScale_->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->charStyle().resetScaleH();
else
{
double a, b, value;
int c;
- pwidget_->cpage->fontHScale_->getValues(&a, &b, &c, &value);
+ m_pwidget->cpage->fontHScale_->getValues(&a, &b, &c, &value);
value = value * 10;
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->charStyle().setScaleH(qRound(value));
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->charStyle().setScaleH(qRound(value));
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotScaleV()
{
- if (pwidget_->cpage->fontVScale_->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->charStyle().resetScaleV();
+ if (m_pwidget->cpage->fontVScale_->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->charStyle().resetScaleV();
else
{
double a, b, value;
int c;
- pwidget_->cpage->fontVScale_->getValues(&a, &b, &c, &value);
+ m_pwidget->cpage->fontVScale_->getValues(&a, &b, &c, &value);
value = value * 10;
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->charStyle().setScaleV(qRound(value));
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->charStyle().setScaleV(qRound(value));
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotTracking()
{
- if (pwidget_->cpage->tracking_->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->charStyle().resetTracking();
+ if (m_pwidget->cpage->tracking_->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->charStyle().resetTracking();
else
{
double a, b, value;
int c;
- pwidget_->cpage->tracking_->getValues(&a, &b, &c, &value);
+ m_pwidget->cpage->tracking_->getValues(&a, &b, &c, &value);
value = value * 10;
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->charStyle().setTracking(qRound(value));
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->charStyle().setTracking(qRound(value));
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotWordTracking()
{
- if (pwidget_->cpage->widthSpaceSpin->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->charStyle().resetWordTracking();
+ if (m_pwidget->cpage->widthSpaceSpin->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->charStyle().resetWordTracking();
else
{
double a, b, value;
int c;
- pwidget_->cpage->widthSpaceSpin->getValues(&a, &b, &c, &value);
+ m_pwidget->cpage->widthSpaceSpin->getValues(&a, &b, &c, &value);
value = value / 100.0;
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->charStyle().setWordTracking(value);
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->charStyle().setWordTracking(value);
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotBaselineOffset()
{
- if (pwidget_->cpage->baselineOffset_->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->charStyle().resetBaselineOffset();
+ if (m_pwidget->cpage->baselineOffset_->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->charStyle().resetBaselineOffset();
else
{
double a, b, value;
int c;
- pwidget_->cpage->baselineOffset_->getValues(&a, &b, &c, &value);
+ m_pwidget->cpage->baselineOffset_->getValues(&a, &b, &c, &value);
value = value * 10;
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->charStyle().setBaselineOffset(qRound(value));
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->charStyle().setBaselineOffset(qRound(value));
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMParagraphStyle::slotFont(QString s)
{
- if (pwidget_->cpage->fontFace_->useParentFont())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->charStyle().resetFont();
+ if (m_pwidget->cpage->fontFace_->useParentFont())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->charStyle().resetFont();
else {
ScFace sf = PrefsManager::instance()->appPrefs.fontPrefs.AvailFonts[s];
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->charStyle().setFont(sf);
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->charStyle().setFont(sf);
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
@@ -1743,17 +1743,17 @@
Q_ASSERT(!parent.isNull());
bool loop = false, parentLoop = false;
- const Style* parentStyle = (!parent.isEmpty()) ? tmpStyles_.resolve(parent) : NULL;
+ const Style* parentStyle = (!parent.isEmpty()) ? m_tmpStyles.resolve(parent) : NULL;
QStringList sel;
- for (int i = 0; i < selection_.count(); ++i)
+ for (int i = 0; i < m_selection.count(); ++i)
{
loop = false;
// Check if setting parent won't create a loop
const Style* pStyle = parentStyle;
while (pStyle)
{
- if (pStyle->hasParent() && (pStyle->parent() == selection_[i]->name()))
+ if (pStyle->hasParent() && (pStyle->parent() == m_selection[i]->name()))
{
loop = parentLoop = true;
break;
@@ -1762,11 +1762,11 @@
}
if (!loop)
{
- selection_[i]->erase(); // reset everything to NOVALUE
- selection_[i]->setParent(parent);
- selection_[i]->charStyle().setParent("");
- }
- sel << selection_[i]->name();
+ m_selection[i]->erase(); // reset everything to NOVALUE
+ m_selection[i]->setParent(parent);
+ m_selection[i]->charStyle().setParent("");
+ }
+ sel << m_selection[i]->name();
}
if (parentLoop)
@@ -1774,9 +1774,9 @@
selected(sel);
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
@@ -1787,20 +1787,20 @@
QStringList sel;
- for (int i = 0; i < selection_.count(); ++i)
- {
- selection_[i]->charStyle().erase();
+ for (int i = 0; i < m_selection.count(); ++i)
+ {
+ m_selection[i]->charStyle().erase();
if (parent != QString::null)
- selection_[i]->charStyle().setParent(parent);
-
- sel << selection_[i]->name();
+ m_selection[i]->charStyle().setParent(parent);
+
+ sel << m_selection[i]->name();
}
selected(sel);
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
@@ -1813,19 +1813,19 @@
/******************************************************************************/
/******************************************************************************/
-SMCharacterStyle::SMCharacterStyle() : StyleItem(), widget_(0), page_(0), doc_(0), selectionIsDirty_(false)
-{
- widget_ = new QTabWidget();
- Q_CHECK_PTR(widget_);
- widget_->setContentsMargins(5, 5, 5, 5);//CB the SMCStylePage parent has a 0 value to fit properly onto the pstyle page, so add it here
- page_ = new SMCStyleWidget();
- Q_CHECK_PTR(page_);
- widget_->addTab(page_, tr("Properties"));
+SMCharacterStyle::SMCharacterStyle() : StyleItem(), m_widget(0), m_page(0), m_doc(0), m_selectionIsDirty(false)
+{
+ m_widget = new QTabWidget();
+ Q_CHECK_PTR(m_widget);
+ m_widget->setContentsMargins(5, 5, 5, 5);//CB the SMCStylePage parent has a 0 value to fit properly onto the pstyle page, so add it here
+ m_page = new SMCStyleWidget();
+ Q_CHECK_PTR(m_page);
+ m_widget->addTab(m_page, tr("Properties"));
}
QTabWidget* SMCharacterStyle::widget()
{
- return widget_;
+ return m_widget;
}
QString SMCharacterStyle::typeNamePlural()
@@ -1840,52 +1840,52 @@
void SMCharacterStyle::setCurrentDoc(ScribusDoc *doc)
{
- doc_ = doc;
- if (doc_)
- {
- if (page_)
+ m_doc = doc;
+ if (m_doc)
+ {
+ if (m_page)
{
QStringList languageList;
LanguageManager::instance()->fillInstalledHyphStringList(&languageList);
- page_->fillLangComboFromList(languageList);
- page_->fillColorCombo(doc_->PageColors);
- page_->fontFace_->RebuildList(doc_);
+ m_page->fillLangComboFromList(languageList);
+ m_page->fillColorCombo(m_doc->PageColors);
+ m_page->fontFace_->RebuildList(m_doc);
}
}
else
{
removeConnections();
- selection_.clear();
- tmpStyles_.clear();
+ m_selection.clear();
+ m_tmpStyles.clear();
}
}
StyleSet<CharStyle>* SMCharacterStyle::tmpStyles()
{
- return &tmpStyles_;
+ return &m_tmpStyles;
}
QList<StyleName> SMCharacterStyle::styles(bool reloadFromDoc)
{
QList<StyleName> tmpList;
- if (!doc_)
+ if (!m_doc)
return tmpList; // no doc available
if (reloadFromDoc)
reloadTmpStyles();
- for (int i = 0; i < tmpStyles_.count(); ++i)
- {
- if (tmpStyles_[i].hasName())
- {
- QString styleName(tmpStyles_[i].displayName());
+ for (int i = 0; i < m_tmpStyles.count(); ++i)
+ {
+ if (m_tmpStyles[i].hasName())
+ {
+ QString styleName(m_tmpStyles[i].displayName());
QString parentName(QString::null);
- if (tmpStyles_[i].hasParent())
+ if (m_tmpStyles[i].hasParent())
{
- const Style* parentStyle = tmpStyles_[i].parentStyle();
+ const Style* parentStyle = m_tmpStyles[i].parentStyle();
if (parentStyle)
parentName = parentStyle->displayName();
}
@@ -1904,40 +1904,40 @@
void SMCharacterStyle::selected(const QStringList &styleNames)
{
- selection_.clear();
- selectionIsDirty_ = false;
+ m_selection.clear();
+ m_selectionIsDirty = false;
removeConnections();
QList<CharStyle> cstyles;
- tmpStyles_.invalidate();
-
- for (int i = 0; i < tmpStyles_.count(); ++i)
- cstyles << tmpStyles_[i];
+ m_tmpStyles.invalidate();
+
+ for (int i = 0; i < m_tmpStyles.count(); ++i)
+ cstyles << m_tmpStyles[i];
for (int i = 0; i < styleNames.count(); ++i)
{
- int index = tmpStyles_.find(styleNames[i]);
+ int index = m_tmpStyles.find(styleNames[i]);
//FIXME: #7133: Use .isDefaultStyle() instead here rather than relying on tr text comparison
if (index<0 && styleNames[i]==CommonStrings::trDefaultCharacterStyle)
- index = tmpStyles_.find(CommonStrings::DefaultCharacterStyle);
+ index = m_tmpStyles.find(CommonStrings::DefaultCharacterStyle);
if (index > -1)
- selection_.append(&tmpStyles_[index]);
-
- }
- page_->show(selection_, cstyles, PrefsManager::instance()->appPrefs.hyphPrefs.Language, doc_->unitIndex());
+ m_selection.append(&m_tmpStyles[index]);
+
+ }
+ m_page->show(m_selection, cstyles, PrefsManager::instance()->appPrefs.hyphPrefs.Language, m_doc->unitIndex());
setupConnections();
}
QString SMCharacterStyle::fromSelection() const
{
QString lsName(QString::null);
- if (!doc_)
+ if (!m_doc)
return lsName; // no doc available
- for (int i = 0; i < doc_->m_Selection->count(); ++i)
+ for (int i = 0; i < m_doc->m_Selection->count(); ++i)
{
// wth is going on here
- PageItem *item = doc_->m_Selection->itemAt(i);
+ PageItem *item = m_doc->m_Selection->itemAt(i);
QString tmpName = item->itemText.defaultStyle().charStyle().parent();
@@ -1956,34 +1956,34 @@
void SMCharacterStyle::toSelection(const QString &styleName) const
{
- if (!doc_)
+ if (!m_doc)
return; // nowhere to apply or no doc
QString realName = styleName;
- int styleIndex = tmpStyles_.find(styleName);
+ int styleIndex = m_tmpStyles.find(styleName);
if (styleIndex < 0 && (styleName == CommonStrings::trDefaultCharacterStyle))
{
- styleIndex = tmpStyles_.find(CommonStrings::DefaultCharacterStyle);
+ styleIndex = m_tmpStyles.find(CommonStrings::DefaultCharacterStyle);
if (styleIndex >= 0)
realName = CommonStrings::DefaultCharacterStyle;
}
if (styleIndex >= 0)
{
- doc_->itemSelection_SetNamedCharStyle(realName);
+ m_doc->itemSelection_SetNamedCharStyle(realName);
}
}
QString SMCharacterStyle::newStyle()
{
- Q_ASSERT(doc_ && doc_->paragraphStyles().count() > 0);
+ Q_ASSERT(m_doc && m_doc->paragraphStyles().count() > 0);
QString s = getUniqueName( tr("New Style"));
CharStyle c;
c.setDefaultStyle(false);
c.setName(s);
// #7360 - rather here than in CharStyle constructor as we have a pointer to doc.
- c.setLanguage(doc_->hyphLanguage());
- tmpStyles_.create(c);
+ c.setLanguage(m_doc->hyphLanguage());
+ m_tmpStyles.create(c);
return s;
}
@@ -1995,16 +1995,16 @@
if (fromStyle==CommonStrings::trDefaultCharacterStyle)
copiedStyleName=CommonStrings::DefaultCharacterStyle;
- Q_ASSERT(tmpStyles_.resolve(copiedStyleName));
- if (!tmpStyles_.resolve(copiedStyleName))
+ Q_ASSERT(m_tmpStyles.resolve(copiedStyleName));
+ if (!m_tmpStyles.resolve(copiedStyleName))
return QString::null;
//Copy the style with the original name
QString s(getUniqueName( tr("Clone of %1").arg(fromStyle)));
- CharStyle c(tmpStyles_.get(copiedStyleName));
+ CharStyle c(m_tmpStyles.get(copiedStyleName));
c.setDefaultStyle(false);
c.setName(s);
c.setShortcut(QString::null);
- tmpStyles_.create(c);
+ m_tmpStyles.create(c);
return s;
}
@@ -2019,9 +2019,9 @@
{
start:
++id;
- for (int i = 0; i < tmpStyles_.count(); ++i)
- {
- if (tmpStyles_[i].name() == s)
+ for (int i = 0; i < m_tmpStyles.count(); ++i)
+ {
+ if (m_tmpStyles[i].name() == s)
{
s = tr("%1 (%2)", "This for unique name when creating "
"a new character style. %1 will be the name "
@@ -2038,26 +2038,26 @@
void SMCharacterStyle::apply()
{
- if (!doc_)
+ if (!m_doc)
return;
QMap<QString, QString> replacement;
- for (int i = 0; i < deleted_.count(); ++i)
- {
- if (deleted_[i].first == deleted_[i].second)
+ for (int i = 0; i < m_deleted.count(); ++i)
+ {
+ if (m_deleted[i].first == m_deleted[i].second)
continue;
- replacement[deleted_[i].first] = deleted_[i].second;
- }
-
- doc_->redefineCharStyles(tmpStyles_, false);
- doc_->replaceCharStyles(replacement);
-
- deleted_.clear(); // deletion done at this point
-
- doc_->scMW()->requestUpdate(reqTextStylesUpdate);
+ replacement[m_deleted[i].first] = m_deleted[i].second;
+ }
+
+ m_doc->redefineCharStyles(m_tmpStyles, false);
+ m_doc->replaceCharStyles(replacement);
+
+ m_deleted.clear(); // deletion done at this point
+
+ m_doc->scMW()->requestUpdate(reqTextStylesUpdate);
// Better not call DrawNew() here, as this will cause several unnecessary calls
- // doc_->view()->DrawNew();
- doc_->changed();
+ // m_doc->view()->DrawNew();
+ m_doc->changed();
}
void SMCharacterStyle::editMode(bool isOn)
@@ -2068,17 +2068,17 @@
bool SMCharacterStyle::isDefaultStyle(const QString &stylename) const
{
- int index = tmpStyles_.find(stylename);
+ int index = m_tmpStyles.find(stylename);
bool b=false;
if (index > -1)
- b = tmpStyles_[index].isDefaultStyle();
+ b = m_tmpStyles[index].isDefaultStyle();
else
{
if (CommonStrings::trDefaultCharacterStyle==stylename)
{
- index = tmpStyles_.find(CommonStrings::DefaultCharacterStyle);
+ index = m_tmpStyles.find(CommonStrings::DefaultCharacterStyle);
if (index > -1)
- b = tmpStyles_[index].isDefaultStyle();
+ b = m_tmpStyles[index].isDefaultStyle();
}
}
return b;
@@ -2086,15 +2086,15 @@
void SMCharacterStyle::setDefaultStyle(bool ids)
{
- Q_ASSERT(selection_.count() == 1);
- if (selection_.count() != 1)
+ Q_ASSERT(m_selection.count() == 1);
+ if (m_selection.count() != 1)
return;
- selection_[0]->setDefaultStyle(ids);
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ m_selection[0]->setDefaultStyle(ids);
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
@@ -2102,17 +2102,17 @@
QString SMCharacterStyle::shortcut(const QString &stylename) const
{
QString s(QString::null);
- int index = tmpStyles_.find(stylename);
+ int index = m_tmpStyles.find(stylename);
if (index > -1)
- s = tmpStyles_[index].shortcut();
+ s = m_tmpStyles[index].shortcut();
else
{
//FIXME: Use isDefaultStyle somehow
if (CommonStrings::trDefaultCharacterStyle==stylename)
{
- index = tmpStyles_.find(CommonStrings::DefaultCharacterStyle);
+ index = m_tmpStyles.find(CommonStrings::DefaultCharacterStyle);
if (index > -1)
- s = tmpStyles_[index].shortcut();
+ s = m_tmpStyles[index].shortcut();
}
}
return s;
@@ -2120,15 +2120,15 @@
void SMCharacterStyle::setShortcut(const QString &shortcut)
{
- Q_ASSERT(selection_.count() == 1);
- if (selection_.count() != 1)
+ Q_ASSERT(m_selection.count() == 1);
+ if (m_selection.count() != 1)
return;
- selection_[0]->setShortcut(shortcut);
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ m_selection[0]->setShortcut(shortcut);
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
@@ -2137,76 +2137,76 @@
{
for (int i = 0; i < removeList.count(); ++i)
{
- for (int k = 0; k < selection_.count(); ++k)
- {
- if (selection_[k]->name() == removeList[i].first)
+ for (int k = 0; k < m_selection.count(); ++k)
+ {
+ if (m_selection[k]->name() == removeList[i].first)
{
- selection_.removeAt(k);
+ m_selection.removeAt(k);
break;
}
}
- int index = tmpStyles_.find(removeList[i].first);
+ int index = m_tmpStyles.find(removeList[i].first);
if (index > -1)
- tmpStyles_.remove(index);
- deleted_ << removeList[i];
+ m_tmpStyles.remove(index);
+ m_deleted << removeList[i];
}
}
void SMCharacterStyle::nameChanged(const QString &newName)
{
-// for (int i = 0; i < selection_.count(); ++i)
-// selection_[i]->setName(newName);
-
- QString oldName(selection_[0]->name());
- CharStyle c(*selection_[0]);
+// for (int i = 0; i < m_selection.count(); ++i)
+// m_selection[i]->setName(newName);
+
+ QString oldName(m_selection[0]->name());
+ CharStyle c(*m_selection[0]);
c.setName(newName);
- tmpStyles_.create(c);
- selection_.clear();
- selection_.append(&tmpStyles_[tmpStyles_.find(newName)]);
- for (int j = 0; j < tmpStyles_.count(); ++j)
- {
- int index = tmpStyles_.find(oldName);
+ m_tmpStyles.create(c);
+ m_selection.clear();
+ m_selection.append(&m_tmpStyles[m_tmpStyles.find(newName)]);
+ for (int j = 0; j < m_tmpStyles.count(); ++j)
+ {
+ int index = m_tmpStyles.find(oldName);
if (index > -1)
{
- tmpStyles_.remove(index);
+ m_tmpStyles.remove(index);
break;
}
}
- for (int j = 0; j < tmpStyles_.count(); ++j)
- {
- if (tmpStyles_[j].parent() == oldName)
- tmpStyles_[j].setParent(newName);
+ for (int j = 0; j < m_tmpStyles.count(); ++j)
+ {
+ if (m_tmpStyles[j].parent() == oldName)
+ m_tmpStyles[j].setParent(newName);
}
QList<RemoveItem>::iterator it;
- for (it = deleted_.begin(); it != deleted_.end(); ++it)
+ for (it = m_deleted.begin(); it != m_deleted.end(); ++it)
{
if (it->second == oldName)
{
oldName = (*it).first;
- deleted_.erase(it);
+ m_deleted.erase(it);
break;
}
}
if (oldName != newName)
- deleted_.append(RemoveItem(oldName, newName));
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ m_deleted.append(RemoveItem(oldName, newName));
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMCharacterStyle::languageChange()
{
- if (widget_ && page_)
- {
- widget_->setTabText(widget_->indexOf(page_), tr("Properties"));
- page_->languageChange();
+ if (m_widget && m_page)
+ {
+ m_widget->setTabText(m_widget->indexOf(m_page), tr("Properties"));
+ m_page->languageChange();
}
}
@@ -2217,107 +2217,107 @@
void SMCharacterStyle::reloadTmpStyles()
{
- if (!doc_)
+ if (!m_doc)
return;
- selection_.clear();
- tmpStyles_.clear();
- tmpStyles_.redefine(doc_->charStyles(), true);
+ m_selection.clear();
+ m_tmpStyles.clear();
+ m_tmpStyles.redefine(m_doc->charStyles(), true);
}
void SMCharacterStyle::setupConnections()
{
- if (!page_)
+ if (!m_page)
return;
- connect(page_->fontFace_, SIGNAL(fontSelected(QString)), this, SLOT(slotFont(QString)));
- connect(page_->effects_, SIGNAL(State(int)), this, SLOT(slotEffects(int)));
- connect(page_->effects_->ShadowVal->Xoffset, SIGNAL(valueChanged(double)),
+ connect(m_page->fontFace_, SIGNAL(fontSelected(QString)), this, SLOT(slotFont(QString)));
+ connect(m_page->effects_, SIGNAL(State(int)), this, SLOT(slotEffects(int)));
+ connect(m_page->effects_->ShadowVal->Xoffset, SIGNAL(valueChanged(double)),
this, SLOT(slotEffectProperties()));
- connect(page_->effects_->ShadowVal->Yoffset, SIGNAL(valueChanged(double)),
+ connect(m_page->effects_->ShadowVal->Yoffset, SIGNAL(valueChanged(double)),
this, SLOT(slotEffectProperties()));
- connect(page_->effects_->OutlineVal->LWidth, SIGNAL(valueChanged(double)),
+ connect(m_page->effects_->OutlineVal->LWidth, SIGNAL(valueChanged(double)),
this, SLOT(slotEffectProperties()));
- connect(page_->effects_->UnderlineVal->LPos, SIGNAL(valueChanged(double)),
+ connect(m_page->effects_->UnderlineVal->LPos, SIGNAL(valueChanged(double)),
this, SLOT(slotEffectProperties()));
- connect(page_->effects_->UnderlineVal->LWidth, SIGNAL(valueChanged(double)),
+ connect(m_page->effects_->UnderlineVal->LWidth, SIGNAL(valueChanged(double)),
this, SLOT(slotEffectProperties()));
- connect(page_->effects_->StrikeVal->LPos, SIGNAL(valueChanged(double)),
+ connect(m_page->effects_->StrikeVal->LPos, SIGNAL(valueChanged(double)),
this, SLOT(slotEffectProperties()));
- connect(page_->effects_->StrikeVal->LWidth, SIGNAL(valueChanged(double)),
+ connect(m_page->effects_->StrikeVal->LWidth, SIGNAL(valueChanged(double)),
this, SLOT(slotEffectProperties()));
- connect(page_->fillColor_, SIGNAL(activated(const QString&)), this, SLOT(slotFillColor()));
- connect(page_->fillShade_, SIGNAL(clicked()), this, SLOT(slotFillShade()));
- connect(page_->strokeColor_, SIGNAL(activated(const QString&)), this, SLOT(slotStrokeColor()));
- connect(page_->strokeShade_, SIGNAL(clicked()), this, SLOT(slotStrokeShade()));
- connect(page_->language_, SIGNAL(activated(int)), this, SLOT(slotLanguage()));
- connect(page_->fontSize_, SIGNAL(valueChanged(double)), this, SLOT(slotFontSize()));
- connect(page_->fontHScale_, SIGNAL(valueChanged(double)), this, SLOT(slotScaleH()));
- connect(page_->fontVScale_, SIGNAL(valueChanged(double)), this, SLOT(slotScaleV()));
- connect(page_->tracking_, SIGNAL(valueChanged(double)), this, SLOT(slotTracking()));
- connect(page_->widthSpaceSpin, SIGNAL(valueChanged(double)), this, SLOT(slotWordTracking()));
- connect(page_->baselineOffset_, SIGNAL(valueChanged(double)), this, SLOT(slotBaselineOffset()));
- connect(page_->fontFace_, SIGNAL(fontSelected(QString)), this, SLOT(slotFont(QString)));
- connect(page_->parentCombo, SIGNAL(activated(const QString&)),
+ connect(m_page->fillColor_, SIGNAL(activated(const QString&)), this, SLOT(slotFillColor()));
+ connect(m_page->fillShade_, SIGNAL(clicked()), this, SLOT(slotFillShade()));
+ connect(m_page->strokeColor_, SIGNAL(activated(const QString&)), this, SLOT(slotStrokeColor()));
+ connect(m_page->strokeShade_, SIGNAL(clicked()), this, SLOT(slotStrokeShade()));
+ connect(m_page->language_, SIGNAL(activated(int)), this, SLOT(slotLanguage()));
+ connect(m_page->fontSize_, SIGNAL(valueChanged(double)), this, SLOT(slotFontSize()));
+ connect(m_page->fontHScale_, SIGNAL(valueChanged(double)), this, SLOT(slotScaleH()));
+ connect(m_page->fontVScale_, SIGNAL(valueChanged(double)), this, SLOT(slotScaleV()));
+ connect(m_page->tracking_, SIGNAL(valueChanged(double)), this, SLOT(slotTracking()));
+ connect(m_page->widthSpaceSpin, SIGNAL(valueChanged(double)), this, SLOT(slotWordTracking()));
+ connect(m_page->baselineOffset_, SIGNAL(valueChanged(double)), this, SLOT(slotBaselineOffset()));
+ connect(m_page->fontFace_, SIGNAL(fontSelected(QString)), this, SLOT(slotFont(QString)));
+ connect(m_page->parentCombo, SIGNAL(activated(const QString&)),
this, SLOT(slotParentChanged(const QString&)));
}
void SMCharacterStyle::removeConnections()
{
- if (!page_)
+ if (!m_page)
return;
- disconnect(page_->fontFace_, SIGNAL(fontSelected(QString)), this, SLOT(slotFont(QString)));
- disconnect(page_->effects_, SIGNAL(State(int)), this, SLOT(slotEffects(int)));
- disconnect(page_->effects_->ShadowVal->Xoffset, SIGNAL(valueChanged(double)),
+ disconnect(m_page->fontFace_, SIGNAL(fontSelected(QString)), this, SLOT(slotFont(QString)));
+ disconnect(m_page->effects_, SIGNAL(State(int)), this, SLOT(slotEffects(int)));
+ disconnect(m_page->effects_->ShadowVal->Xoffset, SIGNAL(valueChanged(double)),
this, SLOT(slotEffectProperties()));
- disconnect(page_->effects_->ShadowVal->Yoffset, SIGNAL(valueChanged(double)),
+ disconnect(m_page->effects_->ShadowVal->Yoffset, SIGNAL(valueChanged(double)),
this, SLOT(slotEffectProperties()));
- disconnect(page_->effects_->OutlineVal->LWidth, SIGNAL(valueChanged(double)),
+ disconnect(m_page->effects_->OutlineVal->LWidth, SIGNAL(valueChanged(double)),
this, SLOT(slotEffectProperties()));
- disconnect(page_->effects_->UnderlineVal->LPos, SIGNAL(valueChanged(double)),
+ disconnect(m_page->effects_->UnderlineVal->LPos, SIGNAL(valueChanged(double)),
this, SLOT(slotEffectProperties()));
- disconnect(page_->effects_->UnderlineVal->LWidth, SIGNAL(valueChanged(double)),
+ disconnect(m_page->effects_->UnderlineVal->LWidth, SIGNAL(valueChanged(double)),
this, SLOT(slotEffectProperties()));
- disconnect(page_->effects_->StrikeVal->LPos, SIGNAL(valueChanged(double)),
+ disconnect(m_page->effects_->StrikeVal->LPos, SIGNAL(valueChanged(double)),
this, SLOT(slotEffectProperties()));
- disconnect(page_->effects_->StrikeVal->LWidth, SIGNAL(valueChanged(double)),
+ disconnect(m_page->effects_->StrikeVal->LWidth, SIGNAL(valueChanged(double)),
this, SLOT(slotEffectProperties()));
- disconnect(page_->fillColor_, SIGNAL(activated(const QString&)), this, SLOT(slotFillColor()));
- disconnect(page_->fillShade_, SIGNAL(clicked()), this, SLOT(slotFillShade()));
- disconnect(page_->strokeColor_, SIGNAL(activated(const QString&)), this, SLOT(slotStrokeColor()));
- disconnect(page_->strokeShade_, SIGNAL(clicked()), this, SLOT(slotStrokeShade()));
- disconnect(page_->language_, SIGNAL(activated(int)), this, SLOT(slotLanguage()));
- disconnect(page_->fontSize_, SIGNAL(valueChanged(double)), this, SLOT(slotFontSize()));
- disconnect(page_->fontHScale_, SIGNAL(valueChanged(double)), this, SLOT(slotScaleH()));
- disconnect(page_->fontVScale_, SIGNAL(valueChanged(double)), this, SLOT(slotScaleV()));
- disconnect(page_->tracking_, SIGNAL(valueChanged(double)), this, SLOT(slotTracking()));
- disconnect(page_->widthSpaceSpin, SIGNAL(valueChanged(double)), this, SLOT(slotWordTracking()));
- disconnect(page_->baselineOffset_, SIGNAL(valueChanged(double)), this, SLOT(slotBaselineOffset()));
- disconnect(page_->fontFace_, SIGNAL(fontSelected(QString)), this, SLOT(slotFont(QString)));
- disconnect(page_->parentCombo, SIGNAL(activated(const QString&)),
+ disconnect(m_page->fillColor_, SIGNAL(activated(const QString&)), this, SLOT(slotFillColor()));
+ disconnect(m_page->fillShade_, SIGNAL(clicked()), this, SLOT(slotFillShade()));
+ disconnect(m_page->strokeColor_, SIGNAL(activated(const QString&)), this, SLOT(slotStrokeColor()));
+ disconnect(m_page->strokeShade_, SIGNAL(clicked()), this, SLOT(slotStrokeShade()));
+ disconnect(m_page->language_, SIGNAL(activated(int)), this, SLOT(slotLanguage()));
+ disconnect(m_page->fontSize_, SIGNAL(valueChanged(double)), this, SLOT(slotFontSize()));
+ disconnect(m_page->fontHScale_, SIGNAL(valueChanged(double)), this, SLOT(slotScaleH()));
+ disconnect(m_page->fontVScale_, SIGNAL(valueChanged(double)), this, SLOT(slotScaleV()));
+ disconnect(m_page->tracking_, SIGNAL(valueChanged(double)), this, SLOT(slotTracking()));
+ disconnect(m_page->widthSpaceSpin, SIGNAL(valueChanged(double)), this, SLOT(slotWordTracking()));
+ disconnect(m_page->baselineOffset_, SIGNAL(valueChanged(double)), this, SLOT(slotBaselineOffset()));
+ disconnect(m_page->fontFace_, SIGNAL(fontSelected(QString)), this, SLOT(slotFont(QString)));
+ disconnect(m_page->parentCombo, SIGNAL(activated(const QString&)),
this, SLOT(slotParentChanged(const QString&)));
}
void SMCharacterStyle::slotFontSize()
{
- if (page_->fontSize_->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->resetFontSize();
+ if (m_page->fontSize_->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->resetFontSize();
else
{
double a, b, value;
int c;
- page_->fontSize_->getValues(&a, &b, &c, &value);
+ m_page->fontSize_->getValues(&a, &b, &c, &value);
value = value * 10;
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setFontSize(qRound(value));
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setFontSize(qRound(value));
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
@@ -2325,18 +2325,18 @@
void SMCharacterStyle::slotEffects(int e)
{
StyleFlag s = ScStyle_None;
- if (page_->effects_->useParentValue())
- {
- for (int i = 0; i < selection_.count(); ++i)
- {
- selection_[i]->resetFeatures();
- selection_[i]->resetShadowXOffset();
- selection_[i]->resetShadowYOffset();
- selection_[i]->resetOutlineWidth();
- selection_[i]->resetUnderlineOffset();
- selection_[i]->resetUnderlineWidth();
- selection_[i]->resetStrikethruOffset();
- selection_[i]->resetStrikethruWidth();
+ if (m_page->effects_->useParentValue())
+ {
+ for (int i = 0; i < m_selection.count(); ++i)
+ {
+ m_selection[i]->resetFeatures();
+ m_selection[i]->resetShadowXOffset();
+ m_selection[i]->resetShadowYOffset();
+ m_selection[i]->resetOutlineWidth();
+ m_selection[i]->resetUnderlineOffset();
+ m_selection[i]->resetUnderlineWidth();
+ m_selection[i]->resetStrikethruOffset();
+ m_selection[i]->resetStrikethruWidth();
}
}
else
@@ -2345,44 +2345,44 @@
double a, b, sxo, syo, olw, ulp, ulw, slp, slw;
int c;
- page_->effects_->ShadowVal->Xoffset->getValues(&a, &b, &c, &sxo);
+ m_page->effects_->ShadowVal->Xoffset->getValues(&a, &b, &c, &sxo);
sxo *= 10;
- page_->effects_->ShadowVal->Yoffset->getValues(&a, &b, &c, &syo);
+ m_page->effects_->ShadowVal->Yoffset->getValues(&a, &b, &c, &syo);
syo *= 10;
- page_->effects_->OutlineVal->LWidth->getValues(&a, &b, &c, &olw);
+ m_page->effects_->OutlineVal->LWidth->getValues(&a, &b, &c, &olw);
olw *= 10;
- page_->effects_->UnderlineVal->LPos->getValues(&a, &b, &c, &ulp);
+ m_page->effects_->UnderlineVal->LPos->getValues(&a, &b, &c, &ulp);
ulp *= 10;
- page_->effects_->UnderlineVal->LWidth->getValues(&a, &b, &c, &ulw);
+ m_page->effects_->UnderlineVal->LWidth->getValues(&a, &b, &c, &ulw);
ulw *= 10;
- page_->effects_->StrikeVal->LPos->getValues(&a, &b, &c, &slp);
+ m_page->effects_->StrikeVal->LPos->getValues(&a, &b, &c, &slp);
slp *= 10;
- page_->effects_->StrikeVal->LWidth->getValues(&a, &b, &c, &slw);
+ m_page->effects_->StrikeVal->LWidth->getValues(&a, &b, &c, &slw);
slw *= 10;
- for (int i = 0; i < selection_.count(); ++i)
+ for (int i = 0; i < m_selection.count(); ++i)
{
QStringList feList = s.featureList();
feList.removeAll(CharStyle::INHERIT);
- selection_[i]->setFeatures(feList);
-// selection_[i]->setFeatures(s.featureList());
- selection_[i]->setShadowXOffset(qRound(sxo));
- selection_[i]->setShadowYOffset(qRound(syo));
- selection_[i]->setOutlineWidth(qRound(olw));
- selection_[i]->setUnderlineOffset(qRound(ulp));
- selection_[i]->setUnderlineWidth(qRound(ulw));
- selection_[i]->setStrikethruOffset(qRound(slp));
- selection_[i]->setStrikethruWidth(qRound(slw));
- }
- }
-
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ m_selection[i]->setFeatures(feList);
+// m_selection[i]->setFeatures(s.featureList());
+ m_selection[i]->setShadowXOffset(qRound(sxo));
+ m_selection[i]->setShadowYOffset(qRound(syo));
+ m_selection[i]->setOutlineWidth(qRound(olw));
+ m_selection[i]->setUnderlineOffset(qRound(ulp));
+ m_selection[i]->setUnderlineWidth(qRound(ulw));
+ m_selection[i]->setStrikethruOffset(qRound(slp));
+ m_selection[i]->setStrikethruWidth(qRound(slw));
+ }
+ }
+
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
@@ -2392,114 +2392,114 @@
double a, b, sxo, syo, olw, ulp, ulw, slp, slw;
int c;
- page_->effects_->ShadowVal->Xoffset->getValues(&a, &b, &c, &sxo);
+ m_page->effects_->ShadowVal->Xoffset->getValues(&a, &b, &c, &sxo);
sxo *= 10;
- page_->effects_->ShadowVal->Yoffset->getValues(&a, &b, &c, &syo);
+ m_page->effects_->ShadowVal->Yoffset->getValues(&a, &b, &c, &syo);
syo *= 10;
- page_->effects_->OutlineVal->LWidth->getValues(&a, &b, &c, &olw);
+ m_page->effects_->OutlineVal->LWidth->getValues(&a, &b, &c, &olw);
olw *= 10;
- page_->effects_->UnderlineVal->LPos->getValues(&a, &b, &c, &ulp);
+ m_page->effects_->UnderlineVal->LPos->getValues(&a, &b, &c, &ulp);
ulp *= 10;
- page_->effects_->UnderlineVal->LWidth->getValues(&a, &b, &c, &ulw);
+ m_page->effects_->UnderlineVal->LWidth->getValues(&a, &b, &c, &ulw);
ulw *= 10;
- page_->effects_->StrikeVal->LPos->getValues(&a, &b, &c, &slp);
+ m_page->effects_->StrikeVal->LPos->getValues(&a, &b, &c, &slp);
slp *= 10;
- page_->effects_->StrikeVal->LWidth->getValues(&a, &b, &c, &slw);
+ m_page->effects_->StrikeVal->LWidth->getValues(&a, &b, &c, &slw);
slw *= 10;
- for (int i = 0; i < selection_.count(); ++i)
- {
- selection_[i]->setShadowXOffset(qRound(sxo));
- selection_[i]->setShadowYOffset(qRound(syo));
- selection_[i]->setOutlineWidth(qRound(olw));
- selection_[i]->setUnderlineOffset(qRound(ulp));
- selection_[i]->setUnderlineWidth(qRound(ulw));
- selection_[i]->setStrikethruOffset(qRound(slp));
- selection_[i]->setStrikethruWidth(qRound(slw));
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ for (int i = 0; i < m_selection.count(); ++i)
+ {
+ m_selection[i]->setShadowXOffset(qRound(sxo));
+ m_selection[i]->setShadowYOffset(qRound(syo));
+ m_selection[i]->setOutlineWidth(qRound(olw));
+ m_selection[i]->setUnderlineOffset(qRound(ulp));
+ m_selection[i]->setUnderlineWidth(qRound(ulw));
+ m_selection[i]->setStrikethruOffset(qRound(slp));
+ m_selection[i]->setStrikethruWidth(qRound(slw));
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMCharacterStyle::slotFillColor()
{
- if (page_->fillColor_->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->resetFillColor();
+ if (m_page->fillColor_->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->resetFillColor();
else {
- QString col(page_->fillColor_->currentText());
+ QString col(m_page->fillColor_->currentText());
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setFillColor(col);
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setFillColor(col);
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMCharacterStyle::slotFillShade()
{
- if (page_->fillShade_->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->resetFillShade();
+ if (m_page->fillShade_->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->resetFillShade();
else {
- int fs = page_->fillShade_->getValue();
-
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setFillShade(fs);
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ int fs = m_page->fillShade_->getValue();
+
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setFillShade(fs);
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMCharacterStyle::slotStrokeColor()
{
- if (page_->strokeColor_->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->resetStrokeColor();
+ if (m_page->strokeColor_->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->resetStrokeColor();
else {
- QString c(page_->strokeColor_->currentText());
-
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setStrokeColor(c);
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ QString c(m_page->strokeColor_->currentText());
+
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setStrokeColor(c);
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMCharacterStyle::slotStrokeShade()
{
- if (page_->strokeShade_->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->resetStrokeShade();
+ if (m_page->strokeShade_->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->resetStrokeShade();
else {
- int ss = page_->strokeShade_->getValue();
+ int ss = m_page->strokeShade_->getValue();
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setStrokeShade(ss);
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setStrokeShade(ss);
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
@@ -2507,141 +2507,141 @@
void SMCharacterStyle::slotLanguage()
{
QMap<QString,QString>::Iterator it;
- QString language = doc_->paragraphStyle("").charStyle().language();
-
- if (page_->language_->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->resetLanguage();
- else
- {
- QString tl(LanguageManager::instance()->getAbbrevFromLang(page_->language_->currentText(), true));
+ QString language = m_doc->paragraphStyle("").charStyle().language();
+
+ if (m_page->language_->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->resetLanguage();
+ else
+ {
+ QString tl(LanguageManager::instance()->getAbbrevFromLang(m_page->language_->currentText(), true));
if (!tl.isEmpty())
language=tl;
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setLanguage(language);
- }
-
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setLanguage(language);
+ }
+
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMCharacterStyle::slotScaleH()
{
- if (page_->fontHScale_->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->resetScaleH();
+ if (m_page->fontHScale_->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->resetScaleH();
else
{
double a, b, value;
int c;
- page_->fontHScale_->getValues(&a, &b, &c, &value);
+ m_page->fontHScale_->getValues(&a, &b, &c, &value);
value = value * 10;
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setScaleH(qRound(value));
- }
-
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setScaleH(qRound(value));
+ }
+
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMCharacterStyle::slotScaleV()
{
- if (page_->fontVScale_->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->resetScaleV();
+ if (m_page->fontVScale_->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->resetScaleV();
else
{
double a, b, value;
int c;
- page_->fontVScale_->getValues(&a, &b, &c, &value);
+ m_page->fontVScale_->getValues(&a, &b, &c, &value);
value = value * 10;
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setScaleV(qRound(value));
- }
-
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setScaleV(qRound(value));
+ }
+
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMCharacterStyle::slotTracking()
{
- if (page_->tracking_->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->resetTracking();
+ if (m_page->tracking_->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->resetTracking();
else
{
double a, b, value;
int c;
- page_->tracking_->getValues(&a, &b, &c, &value);
+ m_page->tracking_->getValues(&a, &b, &c, &value);
value = value * 10;
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setTracking(qRound(value));
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setTracking(qRound(value));
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMCharacterStyle::slotWordTracking()
{
- if (page_->widthSpaceSpin->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->resetWordTracking();
+ if (m_page->widthSpaceSpin->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->resetWordTracking();
else
{
double a, b, value;
int c;
- page_->widthSpaceSpin->getValues(&a, &b, &c, &value);
+ m_page->widthSpaceSpin->getValues(&a, &b, &c, &value);
value = value / 100.0;
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setWordTracking(value);
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setWordTracking(value);
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
void SMCharacterStyle::slotBaselineOffset()
{
- if (page_->baselineOffset_->useParentValue())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->resetBaselineOffset();
+ if (m_page->baselineOffset_->useParentValue())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->resetBaselineOffset();
else
{
double a, b, value;
int c;
- page_->baselineOffset_->getValues(&a, &b, &c, &value);
+ m_page->baselineOffset_->getValues(&a, &b, &c, &value);
value = value * 10;
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setBaselineOffset(qRound(value));
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setBaselineOffset(qRound(value));
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
@@ -2649,19 +2649,19 @@
void SMCharacterStyle::slotFont(QString s)
{
ScFace sf;
- if (page_->fontFace_->useParentFont())
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->resetFont();
+ if (m_page->fontFace_->useParentFont())
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->resetFont();
else {
sf = PrefsManager::instance()->appPrefs.fontPrefs.AvailFonts[s];
- for (int i = 0; i < selection_.count(); ++i)
- selection_[i]->setFont(sf);
- }
-
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ for (int i = 0; i < m_selection.count(); ++i)
+ m_selection[i]->setFont(sf);
+ }
+
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
@@ -2671,17 +2671,17 @@
Q_ASSERT(!parent.isNull());
bool loop = false, parentLoop = false;
- const Style* parentStyle = (!parent.isEmpty()) ? tmpStyles_.resolve(parent) : NULL;
+ const Style* parentStyle = (!parent.isEmpty()) ? m_tmpStyles.resolve(parent) : NULL;
QStringList sel;
- for (int i = 0; i < selection_.count(); ++i)
+ for (int i = 0; i < m_selection.count(); ++i)
{
loop = false;
// Check if setting parent won't create a loop
const Style* pStyle = parentStyle;
while (pStyle)
{
- if (pStyle->hasParent() && (pStyle->parent() == selection_[i]->name()))
+ if (pStyle->hasParent() && (pStyle->parent() == m_selection[i]->name()))
{
loop = parentLoop = true;
break;
@@ -2690,10 +2690,10 @@
}
if (!loop)
{
- selection_[i]->erase();
- selection_[i]->setParent(parent);
- }
- sel << selection_[i]->name();
+ m_selection[i]->erase();
+ m_selection[i]->setParent(parent);
+ }
+ sel << m_selection[i]->name();
}
if (parentLoop)
@@ -2701,21 +2701,21 @@
selected(sel);
- if (!selectionIsDirty_)
- {
- selectionIsDirty_ = true;
+ if (!m_selectionIsDirty)
+ {
+ m_selectionIsDirty = true;
emit selectionDirty();
}
}
SMCharacterStyle::~SMCharacterStyle()
{
- delete page_;
- delete widget_;
- page_ = 0;
- widget_ = 0;
-}
-
-
-
-
+ delete m_page;
+ delete m_widget;
+ m_page = 0;
+ m_widget = 0;
+}
+
+
+
+
Modified: trunk/Scribus/scribus/ui/smtextstyles.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18326&path=/trunk/Scribus/scribus/ui/smtextstyles.h
==============================================================================
--- trunk/Scribus/scribus/ui/smtextstyles.h (original)
+++ trunk/Scribus/scribus/ui/smtextstyles.h Mon Jun 17 23:03:50 2013
@@ -52,14 +52,14 @@
void selectionDirty();
private:
- SMPStyleWidget *pwidget_;
- ScribusDoc *doc_;
- bool selectionIsDirty_;
- double unitRatio_;
- StyleSet<ParagraphStyle> tmpStyles_;
- StyleSet<CharStyle> *cstyles_;
- QList<ParagraphStyle*> selection_;
- QList<RemoveItem> deleted_;
+ SMPStyleWidget *m_pwidget;
+ ScribusDoc *m_doc;
+ bool m_selectionIsDirty;
+ double m_unitRatio;
+ StyleSet<ParagraphStyle> m_tmpStyles;
+ StyleSet<CharStyle> *m_cstyles;
+ QList<ParagraphStyle*> m_selection;
+ QList<RemoveItem> m_deleted;
void setupConnections();
void removeConnections();
@@ -162,13 +162,13 @@
void selectionDirty();
private:
- QTabWidget *widget_;
- SMCStyleWidget *page_;
- ScribusDoc *doc_;
- StyleSet<CharStyle> tmpStyles_;
- QList<CharStyle*> selection_;
- QList<RemoveItem> deleted_;
- bool selectionIsDirty_;
+ QTabWidget *m_widget;
+ SMCStyleWidget *m_page;
+ ScribusDoc *m_doc;
+ StyleSet<CharStyle> m_tmpStyles;
+ QList<CharStyle*> m_selection;
+ QList<RemoveItem> m_deleted;
+ bool m_selectionIsDirty;
void reloadTmpStyles();
void setupConnections();
Modified: trunk/Scribus/scribus/ui/stylemanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18326&path=/trunk/Scribus/scribus/ui/stylemanager.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/stylemanager.cpp (original)
+++ trunk/Scribus/scribus/ui/stylemanager.cpp Mon Jun 17 23:03:50 2013
@@ -397,7 +397,7 @@
if (dia2->clashRename())
styName = lstyle->getUniqueName(aStyle);
- lstyle->tmpLines[styName] = sty;
+ lstyle->m_tmpLines[styName] = sty;
//#7315 selected << QPair<QString, QString>(lstyle->typeName(), styName);
for (int i = 0; i < sty.count(); ++i)
Modified: trunk/Scribus/scribus/ui/vruler.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18326&path=/trunk/Scribus/scribus/ui/vruler.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/vruler.cpp (original)
+++ trunk/Scribus/scribus/ui/vruler.cpp Mon Jun 17 23:03:50 2013
@@ -57,25 +57,25 @@
QPalette palette;
palette.setBrush(QPalette::Window, QColor(240, 240, 240));
setPalette(palette);
- currDoc = doc;
- currView = pa;
+ m_doc = doc;
+ m_view = pa;
offs = 0;
oldMark = 0;
Mpressed = false;
drawMark = false;
setMouseTracking(true);
- rulerGesture = new RulerGesture(currView, RulerGesture::VERTICAL);
+ rulerGesture = new RulerGesture(m_view, RulerGesture::VERTICAL);
unitChange();
}
void Vruler::mousePressEvent(QMouseEvent *m)
{
Mpressed = true;
- if (currDoc->guidesPrefs().guidesShown)
+ if (m_doc->guidesPrefs().guidesShown)
{
qApp->setOverrideCursor(QCursor(SPLITVC));
- currView->startGesture(rulerGesture);
- currView->registerMousePress(m->globalPos());
+ m_view->startGesture(rulerGesture);
+ m_view->registerMousePress(m->globalPos());
}
}
@@ -97,11 +97,11 @@
void Vruler::paintEvent(QPaintEvent *e)
{
- if (currDoc->isLoading())
+ if (m_doc->isLoading())
return;
QString tx = "";
double xl, frac;
- double sc = currView->scale();
+ double sc = m_view->scale();
QFont ff = font();
ff.setPointSize(6);
setFont(ff);
@@ -126,7 +126,7 @@
{
p.drawLine(8, qRound(firstMark * sc), 16, qRound(firstMark * sc));
int textY = qRound(firstMark * sc)+10;
- switch (currDoc->unitIndex())
+ switch (m_doc->unitIndex())
{
case SC_MM:
tx = QString::number(markC * iter2 / (iter2 / 100) / cor);
@@ -184,7 +184,7 @@
}
// draw pixmap
p.save();
- p.translate(0, -currView->contentsY());
+ p.translate(0, -m_view->contentsY());
p.scale(1.0/(SCALE+1), 1.0/SCALE);
p.drawPixmap(0, (where-2)*SCALE, pix);
p.restore();
@@ -192,7 +192,7 @@
p.setBrush(Qt::black);
p.setPen(Qt::black);
p.setFont(font());
- double sc = currView->getScale();
+ double sc = m_view->getScale();
double cc = height() / sc;
double firstMark = ceil(offs / iter) * iter - offs;
while (firstMark < cc)
@@ -202,7 +202,7 @@
}
#else
// draw slim marker
- p.translate(0, -currView->contentsY());
+ p.translate(0, -m_view->contentsY());
p.setPen(Qt::red);
p.setBrush(Qt::red);
cr.setPoints(5, 5, whereToDraw, 16, whereToDraw, 5, whereToDraw, 0, whereToDraw+2, 0, whereToDraw-2);
@@ -230,7 +230,7 @@
void Vruler::Draw(int where)
{
// erase old marker
- int currentCoor = where - currView->contentsY();
+ int currentCoor = where - m_view->contentsY();
whereToDraw = where;
drawMark = true;
repaint(0, oldMark-3, 17, 6);
@@ -240,9 +240,9 @@
void Vruler::unitChange()
{
- double sc = currView->scale();
+ double sc = m_view->scale();
cor=1;
- int docUnitIndex=currDoc->unitIndex();
+ int docUnitIndex = m_doc->unitIndex();
switch (docUnitIndex)
{
case SC_PT:
Modified: trunk/Scribus/scribus/ui/vruler.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18326&path=/trunk/Scribus/scribus/ui/vruler.h
==============================================================================
--- trunk/Scribus/scribus/ui/vruler.h (original)
+++ trunk/Scribus/scribus/ui/vruler.h Mon Jun 17 23:03:50 2013
@@ -59,8 +59,8 @@
void drawNumber(QString num, int starty, QPainter *p);
- ScribusDoc *currDoc;
- ScribusView *currView;
+ ScribusDoc *m_doc;
+ ScribusView *m_view;
public slots: // Public slots
/** \brief draw mark
More information about the scribus-commit
mailing list