r23129 by craig - Code cleanup, mostly ScPage
scribus-commit
scribus-commit at lists.scribus.net
Thu Aug 15 13:07:57 UTC 2019
Author: craig
Date: Thu Aug 15 13:07:57 2019
New Revision: 23129
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23129
Log:
Code cleanup, mostly ScPage
Modified:
trunk/Scribus/scribus/canvas.cpp
trunk/Scribus/scribus/documentchecker.cpp
trunk/Scribus/scribus/guidemanagercore.cpp
trunk/Scribus/scribus/guidemanagercore.h
trunk/Scribus/scribus/pageitem_textframe.cpp
trunk/Scribus/scribus/pdflib_core.cpp
trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.cpp
trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp
trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
trunk/Scribus/scribus/plugins/import/emf/importemf.cpp
trunk/Scribus/scribus/plugins/import/idml/importidml.cpp
trunk/Scribus/scribus/plugins/import/odg/importodg.cpp
trunk/Scribus/scribus/plugins/import/pages/importpages.cpp
trunk/Scribus/scribus/plugins/import/pct/importpct.cpp
trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp
trunk/Scribus/scribus/plugins/import/revenge/rawpainter.cpp
trunk/Scribus/scribus/plugins/import/svm/importsvm.cpp
trunk/Scribus/scribus/plugins/import/viva/importviva.cpp
trunk/Scribus/scribus/plugins/import/xar/importxar.cpp
trunk/Scribus/scribus/plugins/import/xps/importxps.cpp
trunk/Scribus/scribus/plugins/scriptplugin/cmddoc.cpp
trunk/Scribus/scribus/pslib.cpp
trunk/Scribus/scribus/scpage.cpp
trunk/Scribus/scribus/scpage.h
trunk/Scribus/scribus/scpageoutput.cpp
trunk/Scribus/scribus/scribus.cpp
trunk/Scribus/scribus/scribusdoc.cpp
trunk/Scribus/scribus/scribusstructs.h
trunk/Scribus/scribus/ui/customfdialog.cpp
trunk/Scribus/scribus/ui/newfile.cpp
trunk/Scribus/scribus/ui/pagepalette_masterpages.cpp
trunk/Scribus/scribus/ui/pagepalette_pages.cpp
trunk/Scribus/scribus/ui/pagepropertiesdialog.cpp
Modified: trunk/Scribus/scribus/canvas.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23129&path=/trunk/Scribus/scribus/canvas.cpp
==============================================================================
--- trunk/Scribus/scribus/canvas.cpp (original)
+++ trunk/Scribus/scribus/canvas.cpp Thu Aug 15 13:07:57 2019
@@ -407,7 +407,7 @@
// look for masterpage items first
if (allowMasterItems && !m_doc->masterPageMode() && m_doc->currentPage()->FromMaster.count() != 0)
{
- ScPage* Mp = m_doc->MasterPages.at(m_doc->MasterNames[m_doc->currentPage()->MPageNam]);
+ ScPage* Mp = m_doc->MasterPages.at(m_doc->MasterNames[m_doc->currentPage()->masterPageName()]);
// if itemAbove is given, we expect to find it among the masterpage items of this page
int currNr = itemAbove? m_doc->currentPage()->FromMaster.indexOf(itemAbove)-1 : m_doc->currentPage()->FromMaster.count()-1;
if (currNr < 0)
@@ -1334,7 +1334,7 @@
return;
if (!layer.isViewable)
return;
- if (page->MPageNam.isEmpty())
+ if (page->masterPageNameEmpty())
return;
if (page->FromMaster.count() <= 0)
return;
@@ -1344,7 +1344,7 @@
qRound(clip.width() / m_viewMode.scale + 0.5), qRound(clip.height() / m_viewMode.scale + 0.5));
PageItem *currItem;
- ScPage* Mp = m_doc->MasterPages.at(m_doc->MasterNames[page->MPageNam]);
+ ScPage* Mp = m_doc->MasterPages.at(m_doc->MasterNames[page->masterPageName()]);
int layerCount = m_doc->layerCount();
if ((layerCount > 1) && ((layer.blendMode != 0) || (layer.transparency != 1.0)) && (!layer.outlineMode))
painter->beginLayer(layer.transparency, layer.blendMode);
Modified: trunk/Scribus/scribus/documentchecker.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23129&path=/trunk/Scribus/scribus/documentchecker.cpp
==============================================================================
--- trunk/Scribus/scribus/documentchecker.cpp (original)
+++ trunk/Scribus/scribus/documentchecker.cpp Thu Aug 15 13:07:57 2019
@@ -117,7 +117,7 @@
bool error = false;
int masterPageNumber = -1, masterPageLocation = -1;
PageLocation pageLoc = currDoc->locationOfPage(i);
- masterPageNumber = currDoc->MasterNames.value(currDoc->DocPages[i]->MPageNam, -1);
+ masterPageNumber = currDoc->MasterNames.value(currDoc->DocPages[i]->masterPageName(), -1);
if (masterPageNumber >= 0)
masterPageLocation = currDoc->MasterPages[masterPageNumber]->LeftPg;
if (currDoc->pagePositioning() == singlePage)
Modified: trunk/Scribus/scribus/guidemanagercore.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23129&path=/trunk/Scribus/scribus/guidemanagercore.cpp
==============================================================================
--- trunk/Scribus/scribus/guidemanagercore.cpp (original)
+++ trunk/Scribus/scribus/guidemanagercore.cpp Thu Aug 15 13:07:57 2019
@@ -23,40 +23,13 @@
#include "ui/guidemanager.h"
GuideManagerCore::GuideManagerCore():
- gx(0), gy(0), gw(0), gh(0),
+ m_undoManager(UndoManager::instance())
+{
+}
+
+GuideManagerCore::GuideManagerCore(ScPage *parentPage):
m_undoManager(UndoManager::instance()),
- m_page(nullptr),
- m_horizontalAutoGap(0.0),
- m_verticalAutoGap(0.0),
- m_horizontalAutoCount(0),
- m_verticalAutoCount(0),
- m_horizontalAutoRefer(0),
- m_verticalAutoRefer(0)
-{
- m_verticalStdG.clear();
- m_verticalAutoG.clear();
- m_horizontalStdG.clear();
- m_horizontalAutoG.clear();
-}
-
-GuideManagerCore::GuideManagerCore(ScPage *parentPage):
- gx(0), gy(0), gw(0), gh(0),
- m_undoManager(UndoManager::instance()),
- m_page(parentPage),
- m_horizontalAutoGap(0.0),
- m_verticalAutoGap(0.0),
- m_horizontalAutoCount(0),
- m_verticalAutoCount(0),
- m_horizontalAutoRefer(0),
- m_verticalAutoRefer(0)
-{
- m_verticalStdG.clear();
- m_verticalAutoG.clear();
- m_horizontalStdG.clear();
- m_horizontalAutoG.clear();
-}
-
-GuideManagerCore::~GuideManagerCore()
+ m_page(parentPage)
{
}
@@ -337,7 +310,7 @@
switch (type)
{
case Standard:
- if (m_undoManager->undoEnabled())
+ if (UndoManager::undoEnabled())
{
for (int i = 0; i < m_horizontalStdG.count(); ++i)
{
@@ -349,7 +322,7 @@
m_horizontalStdG.clear();
break;
case Auto:
- if (m_undoManager->undoEnabled())
+ if (UndoManager::undoEnabled())
{
SimpleState * ss = new SimpleState(Um::DelHAGuide, nullptr, Um::IGuides);
ss->set("REMOVE_HA_GAP", m_horizontalAutoGap);
@@ -371,7 +344,7 @@
switch (type)
{
case Standard:
- if (m_undoManager->undoEnabled())
+ if (UndoManager::undoEnabled())
{
for (int i = 0; i < m_verticalStdG.count(); ++i)
{
@@ -383,7 +356,7 @@
m_verticalStdG.clear();
break;
case Auto:
- if (m_undoManager->undoEnabled())
+ if (UndoManager::undoEnabled())
{
SimpleState * ss = new SimpleState(Um::DelVAGuide, nullptr, Um::IGuides);
ss->set("REMOVE_VA_GAP", m_verticalAutoGap);
Modified: trunk/Scribus/scribus/guidemanagercore.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23129&path=/trunk/Scribus/scribus/guidemanagercore.h
==============================================================================
--- trunk/Scribus/scribus/guidemanagercore.h (original)
+++ trunk/Scribus/scribus/guidemanagercore.h Thu Aug 15 13:07:57 2019
@@ -38,7 +38,7 @@
public:
GuideManagerCore();
GuideManagerCore(ScPage* parentPage);
- ~GuideManagerCore();
+ ~GuideManagerCore() = default;
typedef enum {Standard, Auto} GuideType;
@@ -105,23 +105,26 @@
/*! \brief Selection/group coordinates
It's used to simulate the original selection "freezed in time"
for parent page */
- double gx, gy, gw, gh;
+ double gx {0.0};
+ double gy {0.0};
+ double gw {0.0};
+ double gh {0.0};
private:
UndoManager * const m_undoManager;
- ScPage* m_page;
+ ScPage* m_page {nullptr};
Guides m_horizontalStdG;
Guides m_verticalStdG;
Guides m_horizontalAutoG;
Guides m_verticalAutoG;
- double m_horizontalAutoGap;
- double m_verticalAutoGap;
- int m_horizontalAutoCount;
- int m_verticalAutoCount;
- int m_horizontalAutoRefer;
- int m_verticalAutoRefer;
+ double m_horizontalAutoGap {0.0};
+ double m_verticalAutoGap {0.0};
+ int m_horizontalAutoCount {0};
+ int m_verticalAutoCount {0};
+ int m_horizontalAutoRefer {0};
+ int m_verticalAutoRefer {0};
double closestHorAbove(double y);// const;
double closestHorBelow(double y);// const;
Modified: trunk/Scribus/scribus/pageitem_textframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23129&path=/trunk/Scribus/scribus/pageitem_textframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_textframe.cpp (original)
+++ trunk/Scribus/scribus/pageitem_textframe.cpp Thu Aug 15 13:07:57 2019
@@ -5059,7 +5059,7 @@
actionList << "toolsEditWithStoryEditor";
actionList << "insertSampleText";
actionList << "itemPDFIsAnnotation";
- if (doc()->currentPage()->pageName().isEmpty())
+ if (doc()->currentPage()->pageNameEmpty())
actionList << "itemPDFIsBookmark";
if (isAnnotation())
{
Modified: trunk/Scribus/scribus/pdflib_core.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23129&path=/trunk/Scribus/scribus/pdflib_core.cpp
==============================================================================
--- trunk/Scribus/scribus/pdflib_core.cpp (original)
+++ trunk/Scribus/scribus/pdflib_core.cpp Thu Aug 15 13:07:57 2019
@@ -623,7 +623,7 @@
QMap<int, int> pageNsMpa;
for (uint a = 0; a < pageNs.size(); ++a)
{
- pageNsMpa.insert(doc.MasterNames[doc.DocPages.at(pageNs[a]-1)->MPageNam], 0);
+ pageNsMpa.insert(doc.MasterNames[doc.DocPages.at(pageNs[a]-1)->masterPageName()], 0);
}
if (usingGUI)
{
@@ -2690,7 +2690,7 @@
continue;
if (ite->ChangedMasterItem)
continue;
- if ((!pag->pageName().isEmpty()) && (ite->OwnPage != static_cast<int>(pag->pageNr())) && (ite->OwnPage != -1))
+ if ((!pag->pageNameEmpty()) && (ite->OwnPage != static_cast<int>(pag->pageNr())) && (ite->OwnPage != -1))
continue;
PutPage("q\n");
if ((ite->doOverprint) && (!Options.UseRGB))
@@ -2705,7 +2705,7 @@
/* Bookmarks on Master Pages do not make any sense */
// if ((ite->isBookmark) && (Options.Bookmarks))
// PDF_Bookmark(ite, pag->height() - (ite->yPos() - pag->yOffset()));
- if (!ite->printEnabled() || ((ite->itemType() == PageItem::TextFrame) && (!pag->pageName().isEmpty())))
+ if (!ite->printEnabled() || ((ite->itemType() == PageItem::TextFrame) && (!pag->pageNameEmpty())))
{
PutPage("Q\n");
continue;
@@ -3829,9 +3829,9 @@
PutPage(FToStr(-bleedLeft) +B+ FToStr(-bleedBottom) +B+
FToStr(bbWidth) +B+ FToStr(bbHeight) + " re W n\n");
}
- if ( (Options.MirrorH) && (!pag->MPageNam.isEmpty()) )
+ if ( (Options.MirrorH) && (!pag->masterPageNameEmpty()) )
PutPage("-1 0 0 1 "+FToStr(ActPageP->width())+" 0 cm\n");
- if ( (Options.MirrorV) && (!pag->MPageNam.isEmpty()) )
+ if ( (Options.MirrorV) && (!pag->masterPageNameEmpty()) )
PutPage("1 0 0 -1 0 "+FToStr(ActPageP->height())+" cm\n");
if (clip)
{
@@ -3841,7 +3841,7 @@
// PutPage("0 0 "+FToStr(ActPageP->width())+" "+FToStr(ActPageP->height())+" re W n\n");
}
//CB *2 because the Pitems count loop runs twice.. y.. dunno.
- if (usingGUI && pag->pageName().isEmpty())
+ if (usingGUI && pag->pageNameEmpty())
progressDialog->setProgress("ECPI", 0, doc.DocItems.count()*2);
for (int lam = 0; lam < doc.Layers.count() && !abortExport; ++lam)
{
@@ -3862,11 +3862,11 @@
QByteArray content, output;
// QList<PageItem*> PItems;
- if (pag->MPageNam.isEmpty())
+ if (pag->masterPageNameEmpty())
return true;
if (doc.MasterItems.count() <= 0)
return true;
- const ScPage* mPage = doc.MasterPages.at(doc.MasterNames[doc.DocPages.at(PNr)->MPageNam]);
+ const ScPage* mPage = doc.MasterPages.at(doc.MasterNames[doc.DocPages.at(PNr)->masterPageName()]);
int mPageIndex = doc.MasterPages.indexOf((ScPage* const) mPage) + 1;
if (!Options.MirrorH)
@@ -3882,7 +3882,7 @@
qApp->processEvents();
if ((ite->m_layerID != layer.ID) || (!ite->printEnabled()))
continue;
- if ((!pag->pageName().isEmpty()) && (ite->OwnPage != static_cast<int>(pag->pageNr())) && (ite->OwnPage != -1))
+ if ((!pag->pageNameEmpty()) && (ite->OwnPage != static_cast<int>(pag->pageNr())) && (ite->OwnPage != -1))
continue;
QByteArray name = QByteArray("/master_page_obj_%1_%2")
.replace("%1", Pdf::toPdf(mPageIndex))
@@ -3968,7 +3968,7 @@
QList<PageItem*> PItems;
int pc_exportpagesitems = usingGUI ? progressDialog->progress("ECPI") : 0;
- PItems = (pag->pageName().isEmpty()) ? doc.DocItems : doc.MasterItems;
+ PItems = (pag->pageNameEmpty()) ? doc.DocItems : doc.MasterItems;
if ((layer.isPrintable) || (((Options.Version == PDFOptions::PDFVersion_15) || (Options.Version == PDFOptions::PDFVersion_X4)) && (Options.useLayers)))
{
QByteArray inh;
@@ -4404,7 +4404,7 @@
output = tmp;
return true;
}
- if ((!pag->pageName().isEmpty()) && (ite->OwnPage != static_cast<int>(pag->pageNr())) && (ite->OwnPage != -1))
+ if ((!pag->pageNameEmpty()) && (ite->OwnPage != static_cast<int>(pag->pageNr())) && (ite->OwnPage != -1))
{
output = tmp;
return true;
@@ -4427,7 +4427,7 @@
PDF_Bookmark(ite, pag->height() - (ite->yPos() - pag->yOffset()));
if (!pattern)
{
- if (!ite->printEnabled() || ((ite->itemType() == PageItem::TextFrame) && (!pag->pageName().isEmpty())))
+ if (!ite->printEnabled() || ((ite->itemType() == PageItem::TextFrame) && (!pag->pageNameEmpty())))
{
// qDebug() << "Q exit";
tmp += "Q\n";
Modified: trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23129&path=/trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.cpp Thu Aug 15 13:07:57 2019
@@ -257,7 +257,7 @@
m_Doc->Layers.levelToLayer(ll, la);
if (ll.isPrintable)
{
- page = m_Doc->MasterPages.at(m_Doc->MasterNames[m_Doc->currentPage()->MPageNam]);
+ page = m_Doc->MasterPages.at(m_Doc->MasterNames[m_Doc->currentPage()->masterPageName()]);
ProcessPageLayer(page, ll);
page = m_Doc->currentPage();
ProcessPageLayer(page, ll);
@@ -297,7 +297,7 @@
PageItem *Item;
QList<PageItem*> Items;
ScPage* SavedAct = m_Doc->currentPage();
- if (page->pageName().isEmpty())
+ if (page->pageNameEmpty())
Items = m_Doc->DocItems;
else
Items = m_Doc->MasterItems;
@@ -330,7 +330,7 @@
double h2 = Item->BoundingH;
if (!( qMax( x, x2 ) <= qMin( x+w, x2+w2 ) && qMax( y, y2 ) <= qMin( y+h, y2+h2 )))
continue;
- if ((!page->pageName().isEmpty()) && (Item->OwnPage != static_cast<int>(page->pageNr())) && (Item->OwnPage != -1))
+ if ((!page->pageNameEmpty()) && (Item->OwnPage != static_cast<int>(page->pageNr())) && (Item->OwnPage != -1))
continue;
ProcessItemOnPage(Item->xPos()-page->xOffset(), Item->yPos()-page->yOffset(), Item, &layerGroup);
}
Modified: trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23129&path=/trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp Thu Aug 15 13:07:57 2019
@@ -352,7 +352,7 @@
m_Doc->Layers.levelToLayer(ll, i);
if (ll.isPrintable)
{
- ScPage *mpage = m_Doc->MasterPages.at(m_Doc->MasterNames[Page->MPageNam]);
+ ScPage *mpage = m_Doc->MasterPages.at(m_Doc->MasterNames[Page->masterPageName()]);
writePageLayer(doc_root, rel_root, mpage, ll);
writePageLayer(doc_root, rel_root, Page, ll);
}
@@ -364,7 +364,7 @@
PageItem *Item;
QList<PageItem*> Items;
ScPage* SavedAct = m_Doc->currentPage();
- if (page->pageName().isEmpty())
+ if (page->pageNameEmpty())
Items = m_Doc->DocItems;
else
Items = m_Doc->MasterItems;
@@ -393,7 +393,7 @@
double h2 = Item->BoundingH;
if (!( qMax( x, x2 ) <= qMin( x+w, x2+w2 ) && qMax( y, y2 ) <= qMin( y+h, y2+h2 )))
continue;
- if ((!page->pageName().isEmpty()) && (Item->OwnPage != static_cast<int>(page->pageNr())) && (Item->OwnPage != -1))
+ if ((!page->pageNameEmpty()) && (Item->OwnPage != static_cast<int>(page->pageNr())) && (Item->OwnPage != -1))
continue;
writeItemOnPage(Item->xPos() - page->xOffset(), Item->yPos() - page->yOffset(), Item, layerGroup, rel_root);
}
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23129&path=/trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp Thu Aug 15 13:07:57 2019
@@ -963,7 +963,7 @@
//as it may not exist yet. They are applied in scribus.cpp for now.
m_Doc->setMasterPageMode(false);
m_Doc->setCurrentPage(m_Doc->addPage(a));
- m_Doc->currentPage()->MPageNam=Mus;
+ m_Doc->currentPage()->setMasterPageName(Mus);
}
else
{
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23129&path=/trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp Thu Aug 15 13:07:57 2019
@@ -1842,9 +1842,9 @@
newPage->LeftPg = attrs.valueAsInt("LEFT", 0);
QString mpName = attrs.valueAsString("MNAM", "Normal");
- newPage->MPageNam = m_Doc->masterPageMode() ? QString("") : mpName;
+ newPage->setMasterPageName(m_Doc->masterPageMode() ? QString() : mpName);
if (attrs.hasAttribute("Size"))
- newPage->m_pageSize = attrs.valueAsString("Size");
+ newPage->setSize(attrs.valueAsString("Size"));
if (attrs.hasAttribute("Orientation"))
newPage->setOrientation(attrs.valueAsInt("Orientation"));
newPage->setXOffset(attrs.valueAsDouble("PAGEXPOS"));
@@ -3296,7 +3296,7 @@
newPage->setPageName(attrs.valueAsString("NAM",""));
}
if (attrs.hasAttribute("Size"))
- newPage->m_pageSize = attrs.valueAsString("Size");
+ newPage->setSize(attrs.valueAsString("Size"));
if (attrs.hasAttribute("Orientation"))
newPage->setOrientation(attrs.valueAsInt("Orientation"));
if (attrs.hasAttribute("PAGEWIDTH"))
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23129&path=/trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp Thu Aug 15 13:07:57 2019
@@ -811,11 +811,11 @@
QString Mus = "";
Mus = pg.attribute("MNAM","Normal");
if (!m_Doc->masterPageMode())
- Apage->MPageNam = Mus;
- else
- Apage->MPageNam = "";
+ Apage->setMasterPageName(Mus);
+ else
+ Apage->clearMasterPageName();
if (pg.hasAttribute("Size"))
- Apage->m_pageSize = pg.attribute("Size");
+ Apage->setSize(pg.attribute("Size"));
if (pg.hasAttribute("Orientation"))
Apage->setOrientation(pg.attribute("Orientation").toInt());
Apage->setXOffset( ScCLocale::toDoubleC(pg.attribute("PAGEXPOS")) );
@@ -2209,7 +2209,7 @@
Apage->setPageName(pg.attribute("NAM",""));
}
if (pg.hasAttribute("Size"))
- Apage->m_pageSize = pg.attribute("Size");
+ Apage->setSize(pg.attribute("Size"));
if (pg.hasAttribute("Orientation"))
Apage->setOrientation(pg.attribute("Orientation").toInt());
if (pg.hasAttribute("PAGEWIDTH"))
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23129&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp Thu Aug 15 13:07:57 2019
@@ -3644,9 +3644,9 @@
newPage->LeftPg = attrs.valueAsInt("LEFT", 0);
QString mpName = attrs.valueAsString("MNAM", "Normal");
- newPage->MPageNam = m_Doc->masterPageMode() ? QString("") : mpName;
+ newPage->setMasterPageName(m_Doc->masterPageMode() ? QString() : mpName);
if (attrs.hasAttribute("Size"))
- newPage->m_pageSize = attrs.valueAsString("Size");
+ newPage->setSize(attrs.valueAsString("Size"));
if (attrs.hasAttribute("Orientation"))
newPage->setOrientation(attrs.valueAsInt("Orientation"));
newPage->setXOffset(attrs.valueAsDouble("PAGEXPOS"));
@@ -3663,9 +3663,9 @@
QString pageSize(attrs.valueAsString("Size"));
PageSize ps(pageSize);
if (!compareDouble(ps.width(), newPage->width()) || !compareDouble(ps.height(), newPage->height()))
- newPage->m_pageSize = CommonStrings::customPageSize;
+ newPage->setSize(CommonStrings::customPageSize);
else
- newPage->m_pageSize = pageSize;
+ newPage->setSize(pageSize);
}
@@ -6169,7 +6169,7 @@
ss->set("LEFT_OLD", newPage->LeftPg);
ss->set("NAME_OLD", newPage->pageName());
ss->set("ORIENTATION_OLD", newPage->orientation());
- ss->set("SIZE_OLD", newPage->m_pageSize);
+ ss->set("SIZE_OLD", newPage->size());
ss->set("WIDTH_OLD", newPage->width());
ss->set("HEIGHT_OLD", newPage->height());
ss->set("INIT_HEIGHT_OLD", newPage->initialHeight());
@@ -6198,7 +6198,7 @@
newPage->setPageName(attrs.valueAsString("NAM",""));
}
if (attrs.hasAttribute("Size"))
- newPage->m_pageSize = attrs.valueAsString("Size");
+ newPage->setSize(attrs.valueAsString("Size"));
if (attrs.hasAttribute("Orientation"))
newPage->setOrientation(attrs.valueAsInt("Orientation"));
if (attrs.hasAttribute("PAGEWIDTH"))
@@ -6242,7 +6242,7 @@
ss->set("LEFT", newPage->LeftPg);
ss->set("NAME", newPage->pageName());
ss->set("ORIENTATION", newPage->orientation());
- ss->set("SIZE", newPage->m_pageSize);
+ ss->set("SIZE", newPage->size());
ss->set("WIDTH", newPage->width());
ss->set("HEIGHT", newPage->height());
ss->set("INIT_HEIGHT", newPage->initialHeight());
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23129&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp Thu Aug 15 13:07:57 2019
@@ -1557,8 +1557,8 @@
docu.writeAttribute("BORDERBOTTOM",page->initialMargins.bottom());
docu.writeAttribute("NUM",page->pageNr());
docu.writeAttribute("NAM",page->pageName());
- docu.writeAttribute("MNAM",page->MPageNam);
- docu.writeAttribute("Size", page->m_pageSize);
+ docu.writeAttribute("MNAM",page->masterPageName());
+ docu.writeAttribute("Size", page->size());
docu.writeAttribute("Orientation", page->orientation());
docu.writeAttribute("LEFT", page->LeftPg);
docu.writeAttribute("PRESET", page->marginPreset);
Modified: trunk/Scribus/scribus/plugins/import/emf/importemf.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23129&path=/trunk/Scribus/scribus/plugins/import/emf/importemf.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/emf/importemf.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/emf/importemf.cpp Thu Aug 15 13:07:57 2019
@@ -521,7 +521,7 @@
m_Doc->setPageHeight(gh);
m_Doc->setPageWidth(gw);
m_Doc->setPageSize("Custom");
- m_Doc->currentPage()->m_pageSize = "Custom";
+ m_Doc->currentPage()->setSize("Custom");
m_Doc->reformPages(true);
}
if (Elements.count() > 1)
@@ -624,8 +624,8 @@
m_Doc->currentPage()->setInitialHeight(docHeight);
m_Doc->currentPage()->setWidth(docWidth);
m_Doc->currentPage()->setHeight(docHeight);
- m_Doc->currentPage()->MPageNam = CommonStrings::trMasterPageNormal;
- m_Doc->currentPage()->m_pageSize = "Custom";
+ m_Doc->currentPage()->setMasterPageNameNormal();
+ m_Doc->currentPage()->setSize("Custom");
m_Doc->reformPages(true);
baseX = m_Doc->currentPage()->xOffset();
baseY = m_Doc->currentPage()->yOffset();
@@ -698,7 +698,7 @@
m_Doc->setPageHeight(gh);
m_Doc->setPageWidth(gw);
m_Doc->setPageSize("Custom");
- m_Doc->currentPage()->m_pageSize = "Custom";
+ m_Doc->currentPage()->setSize("Custom");
m_Doc->reformPages(true);
}
}
Modified: trunk/Scribus/scribus/plugins/import/idml/importidml.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23129&path=/trunk/Scribus/scribus/plugins/import/idml/importidml.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/idml/importidml.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/idml/importidml.cpp Thu Aug 15 13:07:57 2019
@@ -1492,7 +1492,7 @@
m_Doc->setPage(docWidth, docHeight, topMargin, leftMargin, rightMargin, bottomMargin, pgCols, pgGap, false, facingPages);
m_Doc->setPageSize("Custom");
m_Doc->bleeds()->set(bleedTop, bleedLeft, bleedBottom, bleedRight);
- m_Doc->currentPage()->m_pageSize = "Custom";
+ m_Doc->currentPage()->setSize("Custom");
m_Doc->currentPage()->setInitialHeight(docHeight);
m_Doc->currentPage()->setInitialWidth(docWidth);
m_Doc->currentPage()->setHeight(docHeight);
@@ -1546,8 +1546,8 @@
if ((importerFlags & LoadSavePlugin::lfCreateDoc) && (!firstPage))
{
m_Doc->addPage(pagecount);
- m_Doc->currentPage()->MPageNam = CommonStrings::trMasterPageNormal;
- m_Doc->currentPage()->m_pageSize = "Custom";
+ m_Doc->currentPage()->setMasterPageNameNormal();
+ m_Doc->currentPage()->setSize("Custom");
m_Doc->currentPage()->setInitialHeight(docHeight);
m_Doc->currentPage()->setInitialWidth(docWidth);
m_Doc->currentPage()->setHeight(docHeight);
@@ -1625,7 +1625,7 @@
ScPage *addedPage = m_Doc->addMasterPage(mpagecount, pageNam + "_" + spe.attribute("Self"));
m_Doc->setCurrentPage(addedPage);
pages.append(spe.attribute("Self"));
- addedPage->MPageNam = "";
+ addedPage->clearMasterPageName();
m_Doc->view()->addPage(mpagecount, true);
baseX = addedPage->xOffset();
baseY = addedPage->yOffset() + addedPage->height() / 2.0;
Modified: trunk/Scribus/scribus/plugins/import/odg/importodg.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23129&path=/trunk/Scribus/scribus/plugins/import/odg/importodg.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/odg/importodg.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/odg/importodg.cpp Thu Aug 15 13:07:57 2019
@@ -455,14 +455,14 @@
ScPage *oldCur = m_Doc->currentPage();
ScPage *addedPage = m_Doc->addMasterPage(mpagecount, spf.attribute("style:name"));
m_Doc->setCurrentPage(addedPage);
- addedPage->MPageNam = "";
+ addedPage->clearMasterPageName();
m_Doc->view()->addPage(mpagecount, true);
baseX = addedPage->xOffset();
baseY = addedPage->yOffset();
mpagecount++;
ObjStyle tmpOStyle;
resovleStyle(tmpOStyle, spf.attribute("style:name"));
- m_Doc->currentPage()->m_pageSize = "Custom";
+ m_Doc->currentPage()->setSize("Custom");
m_Doc->currentPage()->setInitialHeight(tmpOStyle.page_height);
m_Doc->currentPage()->setInitialWidth(tmpOStyle.page_width);
m_Doc->currentPage()->setHeight(tmpOStyle.page_height);
@@ -581,14 +581,14 @@
ScPage *oldCur = m_Doc->currentPage();
ScPage *addedPage = m_Doc->addMasterPage(mpagecount, spf.attribute("style:name"));
m_Doc->setCurrentPage(addedPage);
- addedPage->MPageNam = "";
+ addedPage->clearMasterPageName();
m_Doc->view()->addPage(mpagecount, true);
baseX = addedPage->xOffset();
baseY = addedPage->yOffset();
mpagecount++;
ObjStyle tmpOStyle;
resovleStyle(tmpOStyle, spf.attribute("style:name"));
- m_Doc->currentPage()->m_pageSize = "Custom";
+ m_Doc->currentPage()->setSize("Custom");
m_Doc->currentPage()->setInitialHeight(tmpOStyle.page_height);
m_Doc->currentPage()->setInitialWidth(tmpOStyle.page_width);
m_Doc->currentPage()->setHeight(tmpOStyle.page_height);
@@ -673,7 +673,7 @@
{
m_Doc->setPage(docWidth, docHeight, topMargin, leftMargin, rightMargin, bottomMargin, m_Doc->PageSp, m_Doc->PageSpa, false, false);
m_Doc->setPageSize("Custom");
- m_Doc->currentPage()->m_pageSize = "Custom";
+ m_Doc->currentPage()->setSize("Custom");
m_Doc->currentPage()->setInitialHeight(docHeight);
m_Doc->currentPage()->setInitialWidth(docWidth);
m_Doc->currentPage()->setHeight(docHeight);
@@ -687,7 +687,7 @@
else
{
m_Doc->addPage(pagecount);
- m_Doc->currentPage()->m_pageSize = "Custom";
+ m_Doc->currentPage()->setSize("Custom");
m_Doc->currentPage()->setInitialHeight(docHeight);
m_Doc->currentPage()->setInitialWidth(docWidth);
m_Doc->currentPage()->setHeight(docHeight);
@@ -696,7 +696,7 @@
m_Doc->currentPage()->initialMargins.setBottom(bottomMargin);
m_Doc->currentPage()->initialMargins.setLeft(leftMargin);
m_Doc->currentPage()->initialMargins.setRight(rightMargin);
- m_Doc->currentPage()->MPageNam = CommonStrings::trMasterPageNormal;
+ m_Doc->currentPage()->setMasterPageNameNormal();
m_Doc->view()->addPage(pagecount, true);
pagecount++;
}
Modified: trunk/Scribus/scribus/plugins/import/pages/importpages.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23129&path=/trunk/Scribus/scribus/plugins/import/pages/importpages.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pages/importpages.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/pages/importpages.cpp Thu Aug 15 13:07:57 2019
@@ -891,7 +891,7 @@
{
m_Doc->setPage(docWidth, docHeight, topMargin, leftMargin, rightMargin, bottomMargin, pgCols, pgGap, false, false);
m_Doc->setPageSize(papersize);
- m_Doc->currentPage()->m_pageSize = papersize;
+ m_Doc->currentPage()->setSize(papersize);
m_Doc->currentPage()->setInitialHeight(docHeight);
m_Doc->currentPage()->setInitialWidth(docWidth);
m_Doc->currentPage()->setHeight(docHeight);
@@ -920,7 +920,7 @@
ScPage *oldCur = m_Doc->currentPage();
ScPage *addedPage = m_Doc->addMasterPage(mpagecount, pageNam);
m_Doc->setCurrentPage(addedPage);
- addedPage->MPageNam = "";
+ addedPage->clearMasterPageName();
m_Doc->view()->addPage(mpagecount, true);
baseX = addedPage->xOffset();
baseY = addedPage->yOffset();
@@ -970,7 +970,7 @@
bottomMargin = m_Doc->marginsVal().bottom();
m_Doc->setPage(docWidth, docHeight, topMargin, leftMargin, rightMargin, bottomMargin, m_Doc->PageSp, m_Doc->PageSpa, false, false);
m_Doc->setPageSize("Custom");
- m_Doc->currentPage()->m_pageSize = "Custom";
+ m_Doc->currentPage()->setSize("Custom");
m_Doc->currentPage()->setInitialHeight(docHeight);
m_Doc->currentPage()->setInitialWidth(docWidth);
m_Doc->currentPage()->setHeight(docHeight);
@@ -984,7 +984,7 @@
else
{
m_Doc->addPage(pagecount);
- m_Doc->currentPage()->m_pageSize = "Custom";
+ m_Doc->currentPage()->setSize("Custom");
m_Doc->currentPage()->setInitialHeight(docHeight);
m_Doc->currentPage()->setInitialWidth(docWidth);
m_Doc->currentPage()->setHeight(docHeight);
@@ -993,7 +993,7 @@
m_Doc->currentPage()->initialMargins.setBottom(bottomMargin);
m_Doc->currentPage()->initialMargins.setLeft(leftMargin);
m_Doc->currentPage()->initialMargins.setRight(rightMargin);
- m_Doc->currentPage()->MPageNam = CommonStrings::trMasterPageNormal;
+ m_Doc->currentPage()->setMasterPageNameNormal();
m_Doc->view()->addPage(pagecount, true);
pagecount++;
}
Modified: trunk/Scribus/scribus/plugins/import/pct/importpct.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23129&path=/trunk/Scribus/scribus/plugins/import/pct/importpct.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pct/importpct.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/pct/importpct.cpp Thu Aug 15 13:07:57 2019
@@ -183,8 +183,8 @@
m_Doc->currentPage()->setInitialHeight(docHeight);
m_Doc->currentPage()->setWidth(docWidth);
m_Doc->currentPage()->setHeight(docHeight);
- m_Doc->currentPage()->MPageNam = CommonStrings::trMasterPageNormal;
- m_Doc->currentPage()->m_pageSize = "Custom";
+ m_Doc->currentPage()->setMasterPageNameNormal();
+ m_Doc->currentPage()->setSize("Custom");
m_Doc->reformPages(true);
baseX = m_Doc->currentPage()->xOffset();
baseY = m_Doc->currentPage()->yOffset();
Modified: trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23129&path=/trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp Thu Aug 15 13:07:57 2019
@@ -730,8 +730,8 @@
m_Doc->currentPage()->setWidth(pdfDoc->getPageMediaWidth(pp));
}
}
- m_Doc->currentPage()->MPageNam = CommonStrings::trMasterPageNormal;
- m_Doc->currentPage()->m_pageSize = "Custom";
+ m_Doc->currentPage()->setMasterPageNameNormal();
+ m_Doc->currentPage()->setSize("Custom");
m_Doc->reformPages(true);
if (hasOcg)
{
Modified: trunk/Scribus/scribus/plugins/import/revenge/rawpainter.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23129&path=/trunk/Scribus/scribus/plugins/import/revenge/rawpainter.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/revenge/rawpainter.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/revenge/rawpainter.cpp Thu Aug 15 13:07:57 2019
@@ -513,8 +513,8 @@
m_Doc->currentPage()->setInitialHeight(docHeight);
m_Doc->currentPage()->setWidth(docWidth);
m_Doc->currentPage()->setHeight(docHeight);
- m_Doc->currentPage()->MPageNam = CommonStrings::trMasterPageNormal;
- m_Doc->currentPage()->m_pageSize = "Custom";
+ m_Doc->currentPage()->setMasterPageNameNormal();
+ m_Doc->currentPage()->setSize("Custom");
m_Doc->reformPages(true);
baseX = m_Doc->currentPage()->xOffset();
baseY = m_Doc->currentPage()->yOffset();
Modified: trunk/Scribus/scribus/plugins/import/svm/importsvm.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23129&path=/trunk/Scribus/scribus/plugins/import/svm/importsvm.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/svm/importsvm.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/svm/importsvm.cpp Thu Aug 15 13:07:57 2019
@@ -348,7 +348,7 @@
m_Doc->setPageHeight(gh);
m_Doc->setPageWidth(gw);
m_Doc->setPageSize("Custom");
- m_Doc->currentPage()->m_pageSize = "Custom";
+ m_Doc->currentPage()->setSize("Custom");
m_Doc->reformPages(true);
}
if (Elements.count() > 1)
@@ -451,8 +451,8 @@
m_Doc->currentPage()->setInitialHeight(docHeight);
m_Doc->currentPage()->setWidth(docWidth);
m_Doc->currentPage()->setHeight(docHeight);
- m_Doc->currentPage()->MPageNam = CommonStrings::trMasterPageNormal;
- m_Doc->currentPage()->m_pageSize = "Custom";
+ m_Doc->currentPage()->setMasterPageNameNormal();
+ m_Doc->currentPage()->setSize("Custom");
m_Doc->reformPages(true);
baseX = m_Doc->currentPage()->xOffset();
baseY = m_Doc->currentPage()->yOffset();
Modified: trunk/Scribus/scribus/plugins/import/viva/importviva.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23129&path=/trunk/Scribus/scribus/plugins/import/viva/importviva.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/viva/importviva.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/viva/importviva.cpp Thu Aug 15 13:07:57 2019
@@ -488,7 +488,7 @@
}
m_Doc->setPage(docWidth, docHeight, topMargin, leftMargin, rightMargin, bottomMargin, pgCols, pgGap, false, facingPages);
m_Doc->setPageSize(papersize);
- m_Doc->currentPage()->m_pageSize = papersize;
+ m_Doc->currentPage()->setSize(papersize);
m_Doc->currentPage()->setInitialHeight(docHeight);
m_Doc->currentPage()->setInitialWidth(docWidth);
m_Doc->currentPage()->setHeight(docHeight);
@@ -737,7 +737,7 @@
mspreadTypes.insert(pageNam, 0);
ScPage *addedPage = m_Doc->addMasterPage(mpagecount, pageNam);
m_Doc->setCurrentPage(addedPage);
- addedPage->MPageNam = "";
+ addedPage->clearMasterPageName();
m_Doc->view()->addPage(mpagecount, true);
baseX = addedPage->xOffset();
baseY = addedPage->yOffset();
@@ -773,7 +773,7 @@
if ((importerFlags & LoadSavePlugin::lfCreateDoc) && (!firstPage))
{
m_Doc->addPage(pagecount);
- m_Doc->currentPage()->m_pageSize = papersize;
+ m_Doc->currentPage()->setSize(papersize);
m_Doc->currentPage()->setInitialHeight(docHeight);
m_Doc->currentPage()->setInitialWidth(docWidth);
m_Doc->currentPage()->setHeight(docHeight);
@@ -782,7 +782,7 @@
m_Doc->currentPage()->initialMargins.setBottom(bottomMargin);
m_Doc->currentPage()->initialMargins.setLeft(leftMargin);
m_Doc->currentPage()->initialMargins.setRight(rightMargin);
- m_Doc->currentPage()->MPageNam = CommonStrings::trMasterPageNormal;
+ m_Doc->currentPage()->setMasterPageNameNormal();
m_Doc->view()->addPage(pagecount, true);
pagecount++;
}
Modified: trunk/Scribus/scribus/plugins/import/xar/importxar.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23129&path=/trunk/Scribus/scribus/plugins/import/xar/importxar.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/xar/importxar.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/xar/importxar.cpp Thu Aug 15 13:07:57 2019
@@ -3350,7 +3350,7 @@
{
m_Doc->setPage(docWidth, docHeight, 0, 0, 0, 0, 1, 0, false, false);
m_Doc->setPageSize("Custom");
- m_Doc->currentPage()->m_pageSize = "Custom";
+ m_Doc->currentPage()->setSize("Custom");
m_Doc->currentPage()->setInitialHeight(docHeight);
m_Doc->currentPage()->setInitialWidth(docWidth);
m_Doc->currentPage()->setHeight(docHeight);
@@ -3370,13 +3370,13 @@
if (importerFlags & LoadSavePlugin::lfCreateDoc)
{
m_Doc->addPage(pagecount);
- m_Doc->currentPage()->m_pageSize = "Custom";
+ m_Doc->currentPage()->setSize("Custom");
m_Doc->currentPage()->setInitialHeight(docHeight);
m_Doc->currentPage()->setInitialWidth(docWidth);
m_Doc->currentPage()->setHeight(docHeight);
m_Doc->currentPage()->setWidth(docWidth);
m_Doc->currentPage()->initialMargins.set(0, 0, 0, 0);
- m_Doc->currentPage()->MPageNam = CommonStrings::trMasterPageNormal;
+ m_Doc->currentPage()->setMasterPageNameNormal();
m_Doc->view()->addPage(pagecount, true);
pagecount++;
// baseX = m_Doc->currentPage()->xOffset();
Modified: trunk/Scribus/scribus/plugins/import/xps/importxps.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23129&path=/trunk/Scribus/scribus/plugins/import/xps/importxps.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/xps/importxps.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/xps/importxps.cpp Thu Aug 15 13:07:57 2019
@@ -594,7 +594,7 @@
double pgGap = m_Doc->PageSpa;
m_Doc->setPage(docWidth, docHeight, topMargin, leftMargin, rightMargin, bottomMargin, pgCols, pgGap, false, false);
m_Doc->setPageSize("Custom");
- m_Doc->currentPage()->m_pageSize = "Custom";
+ m_Doc->currentPage()->setSize("Custom");
m_Doc->currentPage()->setInitialHeight(docHeight);
m_Doc->currentPage()->setInitialWidth(docWidth);
m_Doc->currentPage()->setHeight(docHeight);
@@ -608,7 +608,7 @@
else
{
m_Doc->addPage(pagecount);
- m_Doc->currentPage()->m_pageSize = "Custom";
+ m_Doc->currentPage()->setSize("Custom");
m_Doc->currentPage()->setInitialHeight(docHeight);
m_Doc->currentPage()->setInitialWidth(docWidth);
m_Doc->currentPage()->setHeight(docHeight);
@@ -617,7 +617,7 @@
m_Doc->currentPage()->initialMargins.setBottom(bottomMargin);
m_Doc->currentPage()->initialMargins.setLeft(leftMargin);
m_Doc->currentPage()->initialMargins.setRight(rightMargin);
- m_Doc->currentPage()->MPageNam = CommonStrings::trMasterPageNormal;
+ m_Doc->currentPage()->setMasterPageNameNormal();
m_Doc->view()->addPage(pagecount, true);
pagecount++;
}
Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmddoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23129&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmddoc.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmddoc.cpp (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmddoc.cpp Thu Aug 15 13:07:57 2019
@@ -411,7 +411,7 @@
PyErr_SetString(PyExc_IndexError, QObject::tr("Page number out of range: '%1'.","python error").arg(e+1).toLocal8Bit().constData());
return nullptr;
}
- return PyString_FromString(currentDoc->DocPages.at(e)->MPageNam.toUtf8());
+ return PyString_FromString(currentDoc->DocPages.at(e)->masterPageName().toUtf8());
}
PyObject* scribus_applymasterpage(PyObject* /* self */, PyObject* args)
Modified: trunk/Scribus/scribus/pslib.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23129&path=/trunk/Scribus/scribus/pslib.cpp
==============================================================================
--- trunk/Scribus/scribus/pslib.cpp (original)
+++ trunk/Scribus/scribus/pslib.cpp Thu Aug 15 13:07:57 2019
@@ -1750,7 +1750,7 @@
Doc->Layers.levelToLayer(ll, lam);
if (!ll.isPrintable)
continue;
- if (!page->MPageNam.isEmpty() && !abortExport && !errorOccured)
+ if (!page->masterPageNameEmpty() && !abortExport && !errorOccured)
{
errorOccured |= !ProcessMasterPageLayer(Doc, page, ll, a, sep, farb);
}
@@ -1859,7 +1859,7 @@
{
bool imageOk = false;
PS_translate(0, -item->BBoxH*item->imageYScale());
- if ((optimization == OptimizeSize) && (((!page->pageName().isEmpty()) && !sep && farb) || useTemplate))
+ if ((optimization == OptimizeSize) && (((!page->pageNameEmpty()) && !sep && farb) || useTemplate))
imageOk = PS_image(item, item->imageXOffset(), -item->imageYOffset(), item->Pfile, item->imageXScale(), item->imageYScale(), item->IProfile, item->UseEmbedded, item->itemName());
else
imageOk = PS_image(item, item->imageXOffset(), -item->imageYOffset(), item->Pfile, item->imageXScale(), item->imageYScale(), item->IProfile, item->UseEmbedded);
@@ -2588,7 +2588,7 @@
ScLayer ll;
ll.isPrintable = false;
ll.ID = 0;
- PItems = (page->pageName().isEmpty()) ? Doc->DocItems : Doc->MasterItems;
+ PItems = (page->pageNameEmpty()) ? Doc->DocItems : Doc->MasterItems;
for (int la = 0; la < Doc->Layers.count(); ++la)
{
Doc->Layers.levelToLayer(ll, Lnr);
@@ -2601,13 +2601,13 @@
ScQApp->processEvents();
if (item->m_layerID != ll.ID)
continue;
- if ((!page->pageName().isEmpty()) && (item->asTextFrame()))
+ if ((!page->pageNameEmpty()) && (item->asTextFrame()))
continue;
- if ((!page->pageName().isEmpty()) && (item->asPathText()))
+ if ((!page->pageNameEmpty()) && (item->asPathText()))
continue;
- if ((!page->pageName().isEmpty()) && (item->asTable()))
+ if ((!page->pageNameEmpty()) && (item->asTable()))
continue;
- if ((!page->pageName().isEmpty()) && (item->asImageFrame()) && ((sep) || (!farb)))
+ if ((!page->pageNameEmpty()) && (item->asImageFrame()) && ((sep) || (!farb)))
continue;
//if ((!Art) && (view->SelItem.count() != 0) && (!item->Select))
if ((!psExport) && (!item->isSelected()) && (Doc->m_Selection->count() != 0))
@@ -2627,7 +2627,7 @@
continue;
if (item->ChangedMasterItem)
continue;
- if ((!page->pageName().isEmpty()) && (item->OwnPage != static_cast<int>(page->pageNr())) && (item->OwnPage != -1))
+ if ((!page->pageNameEmpty()) && (item->OwnPage != static_cast<int>(page->pageNr())) && (item->OwnPage != -1))
continue;
ProcessItem(Doc, page, item, PNr, sep, farb, false);
}
@@ -2641,7 +2641,7 @@
bool success = true;
double h, s, v, k;
QVector<double> dum;
- ScPage* mPage = Doc->MasterPages.at(Doc->MasterNames[page->MPageNam]);
+ ScPage* mPage = Doc->MasterPages.at(Doc->MasterNames[page->masterPageName()]);
if (layer.isPrintable)
{
for (int am = 0; am < page->FromMaster.count() && !abortExport; ++am)
@@ -2653,7 +2653,7 @@
continue;
if (!(ite->asTextFrame()) && !(ite->asImageFrame()) && !(ite->asPathText()) && !(ite->asTable()))
{
- int mpIndex = Doc->MasterNames[page->MPageNam];
+ int mpIndex = Doc->MasterNames[page->masterPageName()];
PS_UseTemplate(QString("mp_obj_%1_%2").arg(mpIndex).arg(qHash(ite)));
}
else if (ite->asImageFrame())
@@ -3018,7 +3018,7 @@
return true;
QList<PageItem*> items;
- items = (page->pageName().isEmpty()) ? Doc->DocItems : Doc->MasterItems;
+ items = (page->pageNameEmpty()) ? Doc->DocItems : Doc->MasterItems;
for (int i = 0; i < items.count() && !abortExport; ++i)
{
@@ -3027,13 +3027,13 @@
ScQApp->processEvents();
if (item->m_layerID != layer.ID)
continue;
- if ((!page->pageName().isEmpty()) && (item->asTextFrame()))
+ if ((!page->pageNameEmpty()) && (item->asTextFrame()))
continue;
- if ((!page->pageName().isEmpty()) && (item->asPathText()))
+ if ((!page->pageNameEmpty()) && (item->asPathText()))
continue;
- if ((!page->pageName().isEmpty()) && (item->asTable()))
+ if ((!page->pageNameEmpty()) && (item->asTable()))
continue;
- if ((!page->pageName().isEmpty()) && (item->asImageFrame()) && ((sep) || (!farb)))
+ if ((!page->pageNameEmpty()) && (item->asImageFrame()) && ((sep) || (!farb)))
continue;
//if ((!Art) && (view->SelItem.count() != 0) && (!item->Select))
if ((!psExport) && (!item->isSelected()) && (Doc->m_Selection->count() != 0))
@@ -3053,7 +3053,7 @@
continue;
if (item->ChangedMasterItem)
continue;
- if ((!page->pageName().isEmpty()) && (item->OwnPage != static_cast<int>(page->pageNr())) && (item->OwnPage != -1))
+ if ((!page->pageNameEmpty()) && (item->OwnPage != static_cast<int>(page->pageNr())) && (item->OwnPage != -1))
continue;
success &= ProcessItem(Doc, page, item, PNr, sep, farb, false);
if (!success)
Modified: trunk/Scribus/scribus/scpage.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23129&path=/trunk/Scribus/scribus/scpage.cpp
==============================================================================
--- trunk/Scribus/scribus/scpage.cpp (original)
+++ trunk/Scribus/scribus/scpage.cpp Thu Aug 15 13:07:57 2019
@@ -41,26 +41,15 @@
SingleObservable<ScPage>(nullptr),
Margins(40,40,40,40),
initialMargins(40,40,40,40),
- LeftPg(0),
- MPageNam(""),
undoManager(UndoManager::instance()),
m_xOffset(x),
m_yOffset(y),
m_width(b),
m_height(h),
m_initialWidth(b),
- m_initialHeight(h),
- m_PageName(""),
- m_Doc(nullptr)
+ m_initialHeight(h)
{
guides.setPage(this);
- marginPreset = 0;
- PresentVals.pageEffectDuration = 1;
- PresentVals.pageViewDuration = 1;
- PresentVals.effectType = 0;
- PresentVals.Dm = 0;
- PresentVals.M = 0;
- PresentVals.Di = 0;
}
ScPage::~ScPage()
@@ -86,137 +75,160 @@
void ScPage::setPageNr(int pageNr)
{
m_pageNr = pageNr;
- if (m_PageName.isEmpty())
+ if (m_pageName.isEmpty())
setUName(QString(QObject::tr("Page") + " %1").arg(m_Doc->FirstPnum + m_pageNr));
else
- setUName(m_PageName);
+ setUName(m_pageName);
}
void ScPage::setPageName(const QString& newName)
{
- m_PageName = newName;
+ m_pageName = newName;
if (!newName.isEmpty())
setUName(QObject::tr("Master Page ") + newName);
}
+void ScPage::resetPageName()
+{
+ m_pageName.clear();
+}
+
+void ScPage::setMasterPageName(const QString& newName)
+{
+ m_masterPageName = newName;
+}
+
+void ScPage::setMasterPageNameNormal()
+{
+ m_masterPageName = CommonStrings::trMasterPageNormal;
+}
+
+void ScPage::clearMasterPageName()
+{
+ m_masterPageName.clear();
+}
+
+void ScPage::setSize(const QString& newSize)
+{
+ m_pageSize = newSize;
+}
+
void ScPage::restore(UndoState* state, bool isUndo)
{
- SimpleState* ss = dynamic_cast<SimpleState*>(state);
- if (ss)
- {
-// int stateCode = ss->transactionCode;
- if (ss->contains("ADD_V"))
- {
- double position = ss->getDouble("ADD_V");
- if (isUndo)
- guides.deleteVertical(position, GuideManagerCore::Standard);//removeXGuide(position);
- else
- guides.addVertical(position, GuideManagerCore::Standard);//addXGuide(position);
- m_Doc->scMW()->guidePalette->setupGui();
- }
- else if (ss->contains("ADD_H"))
- {
- double position = ss->getDouble("ADD_H");
- if (isUndo)
- guides.deleteHorizontal(position, GuideManagerCore::Standard);//removeYGuide(position);
- else
- guides.addHorizontal(position, GuideManagerCore::Standard);//addYGuide(position);
- m_Doc->scMW()->guidePalette->setupGui();
- }
- else if (ss->contains("REMOVE_V"))
- {
- double position = ss->getDouble("REMOVE_V");
- if (isUndo)
- guides.addVertical(position, GuideManagerCore::Standard);//addXGuide(position);
- else
- guides.deleteVertical(position, GuideManagerCore::Standard);//removeXGuide(position);
- m_Doc->scMW()->guidePalette->setupGui();
- }
- else if (ss->contains("REMOVE_H"))
- {
- double position = ss->getDouble("REMOVE_H");
- if (isUndo)
- guides.addHorizontal(position, GuideManagerCore::Standard);//addYGuide(position);
- else
- guides.deleteHorizontal(position, GuideManagerCore::Standard);//removeYGuide(position);
- m_Doc->scMW()->guidePalette->setupGui();
- }
- else if (ss->contains("MOVE_H_FROM"))
- {
- double from = ss->getDouble("MOVE_H_FROM");
- double to = ss->getDouble("MOVE_H_TO");
- if (isUndo)
- {
- guides.deleteHorizontal(to, GuideManagerCore::Standard);//removeYGuide(position);
- guides.addHorizontal(from, GuideManagerCore::Standard);//addYGuide(position);
- }
- else
- {
- guides.deleteHorizontal(from, GuideManagerCore::Standard);//removeYGuide(position);
- guides.addHorizontal(to, GuideManagerCore::Standard);//addYGuide(position);
- }
- m_Doc->scMW()->guidePalette->setupGui();
- }
- else if (ss->contains("MOVE_V_FROM"))
- {
- double from = ss->getDouble("MOVE_V_FROM");
- double to = ss->getDouble("MOVE_V_TO");
- if (isUndo)
- {
- guides.deleteVertical(to, GuideManagerCore::Standard);//removeXGuide(position);
- guides.addVertical(from, GuideManagerCore::Standard);//removeXGuide(position);
- }
- else
- {
- guides.deleteVertical(from, GuideManagerCore::Standard);//removeXGuide(position);
- guides.addVertical(to, GuideManagerCore::Standard);//removeXGuide(position);
- }
- m_Doc->scMW()->guidePalette->setupGui();
- }
- // automatic guides
- else if (ss->contains("REMOVE_HA_GAP"))
- {
- if (isUndo)
- {
- guides.setHorizontalAutoCount(ss->getInt("REMOVE_HA_COUNT"));
- guides.setHorizontalAutoGap(ss->getDouble("REMOVE_HA_GAP"));
- guides.setHorizontalAutoRefer(ss->getInt("REMOVE_HA_REFER"));
- }
- else
- {
- guides.setHorizontalAutoCount(0);
- guides.setHorizontalAutoGap(0.0);
- guides.setHorizontalAutoRefer(0);
- }
- m_Doc->scMW()->guidePalette->setupGui();
- }
- else if (ss->contains("REMOVE_VA_GAP"))
- {
- if (isUndo)
- {
- guides.setVerticalAutoCount(ss->getInt("REMOVE_VA_COUNT"));
- guides.setVerticalAutoGap(ss->getDouble("REMOVE_VA_GAP"));
- guides.setVerticalAutoRefer(ss->getInt("REMOVE_VA_REFER"));
- }
- else
- {
- guides.setVerticalAutoCount(0);
- guides.setVerticalAutoGap(0.0);
- guides.setVerticalAutoRefer(0);
- }
- m_Doc->scMW()->guidePalette->setupGui();
- }
- else if (ss->contains("CREATE_ITEM"))
- restorePageItemCreation(dynamic_cast<ScItemState<PageItem*>*>(ss), isUndo);
- else if (ss->contains("DELETE_ITEM"))
- restorePageItemDeletion(dynamic_cast<ScItemState< QList<PageItem*> >*>(ss), isUndo);
- else if (ss->contains("CONVERT_ITEM"))
- restorePageItemConversion(dynamic_cast<ScItemState<QPair<PageItem*, PageItem*> >*>(ss), isUndo);
- else if (ss->contains("CONVERT_ITEM_TO_SYMBOL"))
- restorePageItemConversionToSymbol(dynamic_cast<ScItemState<QPair<PageItem*, PageItem*> >*>(ss), isUndo);
- else if (ss->contains("PAGE_ATTRS"))
- restorePageAttributes(ss, isUndo);
- }
+ auto* ss = dynamic_cast<SimpleState*>(state);
+ if (!ss)
+ return;
+ if (ss->contains("ADD_V"))
+ {
+ double position = ss->getDouble("ADD_V");
+ if (isUndo)
+ guides.deleteVertical(position, GuideManagerCore::Standard);//removeXGuide(position);
+ else
+ guides.addVertical(position, GuideManagerCore::Standard);//addXGuide(position);
+ m_Doc->scMW()->guidePalette->setupGui();
+ }
+ else if (ss->contains("ADD_H"))
+ {
+ double position = ss->getDouble("ADD_H");
+ if (isUndo)
+ guides.deleteHorizontal(position, GuideManagerCore::Standard);//removeYGuide(position);
+ else
+ guides.addHorizontal(position, GuideManagerCore::Standard);//addYGuide(position);
+ m_Doc->scMW()->guidePalette->setupGui();
+ }
+ else if (ss->contains("REMOVE_V"))
+ {
+ double position = ss->getDouble("REMOVE_V");
+ if (isUndo)
+ guides.addVertical(position, GuideManagerCore::Standard);//addXGuide(position);
+ else
+ guides.deleteVertical(position, GuideManagerCore::Standard);//removeXGuide(position);
+ m_Doc->scMW()->guidePalette->setupGui();
+ }
+ else if (ss->contains("REMOVE_H"))
+ {
+ double position = ss->getDouble("REMOVE_H");
+ if (isUndo)
+ guides.addHorizontal(position, GuideManagerCore::Standard);//addYGuide(position);
+ else
+ guides.deleteHorizontal(position, GuideManagerCore::Standard);//removeYGuide(position);
+ m_Doc->scMW()->guidePalette->setupGui();
+ }
+ else if (ss->contains("MOVE_H_FROM"))
+ {
+ double from = ss->getDouble("MOVE_H_FROM");
+ double to = ss->getDouble("MOVE_H_TO");
+ if (isUndo)
+ {
+ guides.deleteHorizontal(to, GuideManagerCore::Standard);//removeYGuide(position);
+ guides.addHorizontal(from, GuideManagerCore::Standard);//addYGuide(position);
+ }
+ else
+ {
+ guides.deleteHorizontal(from, GuideManagerCore::Standard);//removeYGuide(position);
+ guides.addHorizontal(to, GuideManagerCore::Standard);//addYGuide(position);
+ }
+ m_Doc->scMW()->guidePalette->setupGui();
+ }
+ else if (ss->contains("MOVE_V_FROM"))
+ {
+ double from = ss->getDouble("MOVE_V_FROM");
+ double to = ss->getDouble("MOVE_V_TO");
+ if (isUndo)
+ {
+ guides.deleteVertical(to, GuideManagerCore::Standard);//removeXGuide(position);
+ guides.addVertical(from, GuideManagerCore::Standard);//removeXGuide(position);
+ }
+ else
+ {
+ guides.deleteVertical(from, GuideManagerCore::Standard);//removeXGuide(position);
+ guides.addVertical(to, GuideManagerCore::Standard);//removeXGuide(position);
+ }
+ m_Doc->scMW()->guidePalette->setupGui();
+ }
+ // automatic guides
+ else if (ss->contains("REMOVE_HA_GAP"))
+ {
+ if (isUndo)
+ {
+ guides.setHorizontalAutoCount(ss->getInt("REMOVE_HA_COUNT"));
+ guides.setHorizontalAutoGap(ss->getDouble("REMOVE_HA_GAP"));
+ guides.setHorizontalAutoRefer(ss->getInt("REMOVE_HA_REFER"));
+ }
+ else
+ {
+ guides.setHorizontalAutoCount(0);
+ guides.setHorizontalAutoGap(0.0);
+ guides.setHorizontalAutoRefer(0);
+ }
+ m_Doc->scMW()->guidePalette->setupGui();
+ }
+ else if (ss->contains("REMOVE_VA_GAP"))
+ {
+ if (isUndo)
+ {
+ guides.setVerticalAutoCount(ss->getInt("REMOVE_VA_COUNT"));
+ guides.setVerticalAutoGap(ss->getDouble("REMOVE_VA_GAP"));
+ guides.setVerticalAutoRefer(ss->getInt("REMOVE_VA_REFER"));
+ }
+ else
+ {
+ guides.setVerticalAutoCount(0);
+ guides.setVerticalAutoGap(0.0);
+ guides.setVerticalAutoRefer(0);
+ }
+ m_Doc->scMW()->guidePalette->setupGui();
+ }
+ else if (ss->contains("CREATE_ITEM"))
+ restorePageItemCreation(dynamic_cast<ScItemState<PageItem*>*>(ss), isUndo);
+ else if (ss->contains("DELETE_ITEM"))
+ restorePageItemDeletion(dynamic_cast<ScItemState< QList<PageItem*> >*>(ss), isUndo);
+ else if (ss->contains("CONVERT_ITEM"))
+ restorePageItemConversion(dynamic_cast<ScItemState<QPair<PageItem*, PageItem*> >*>(ss), isUndo);
+ else if (ss->contains("CONVERT_ITEM_TO_SYMBOL"))
+ restorePageItemConversionToSymbol(dynamic_cast<ScItemState<QPair<PageItem*, PageItem*> >*>(ss), isUndo);
+ else if (ss->contains("PAGE_ATTRS"))
+ restorePageAttributes(ss, isUndo);
}
void ScPage::restorePageAttributes(SimpleState *state, bool isUndo)
@@ -356,6 +368,7 @@
{
if (!state)
return;
+
int stateCode = state->transactionCode;
QList<PageItem*> itemList = state->getItem();
int id = state->getInt("ITEMID");
Modified: trunk/Scribus/scribus/scpage.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23129&path=/trunk/Scribus/scribus/scpage.h
==============================================================================
--- trunk/Scribus/scribus/scpage.h (original)
+++ trunk/Scribus/scribus/scpage.h Thu Aug 15 13:07:57 2019
@@ -28,6 +28,7 @@
#include <QList>
#include <QPair>
+#include <QString>
#include "scribusapi.h"
#include "undostate.h"
@@ -35,7 +36,6 @@
#include "guidemanagercore.h"
class PageItem;
-class QString;
class UndoManager;
class UndoState;
class ScribusDoc;
@@ -72,13 +72,8 @@
MarginStruct Margins;
MarginStruct initialMargins;
- /** Nummer der Seite */
- int LeftPg;
- //! Name of the master page that this page uses
- QString MPageNam;
-
- QString m_pageSize;
- int marginPreset;
+ int LeftPg {0};
+ int marginPreset {0};
ScribusDoc* doc() const { return m_Doc; }
void setDocument(ScribusDoc* doc);
int pageNr() const { return m_pageNr; }
@@ -86,8 +81,17 @@
const QString& pageSectionNumber() const { return m_pageSectionNumber; }
void setPageSectionNumber(const QString&);
//! Return the page's name
- const QString& pageName() const {return m_PageName;}
+ const QString& pageName() const {return m_pageName;}
+ bool pageNameEmpty() const {return m_pageName.isEmpty();}
void setPageName(const QString& newName);
+ void resetPageName();
+ const QString& masterPageName() const {return m_masterPageName;}
+ bool masterPageNameEmpty() const {return m_masterPageName.isEmpty();}
+ void setMasterPageName(const QString& newName);
+ void setMasterPageNameNormal();
+ void clearMasterPageName();
+ const QString& size() const {return m_pageSize;}
+ void setSize(const QString& newSize);
void restore(UndoState* state, bool isUndo);
/*! \brief As a bit of a dirty hack, we declare this mutable so it can be altered
@@ -101,25 +105,27 @@
PDFPresentationData PresentVals;
protected:
- UndoManager * const undoManager;
+ UndoManager* const undoManager;
void restorePageItemCreation(ScItemState<PageItem*> *state, bool isUndo);
void restorePageItemDeletion(ScItemState< QList<PageItem*> > *state, bool isUndo);
void restorePageAttributes(SimpleState *state, bool isUndo);
void restorePageItemConversion(ScItemState<QPair<PageItem*, PageItem*> >*state, bool isUndo);
void restorePageItemConversionToSymbol(ScItemState<QPair<PageItem*, PageItem*> >*state, bool isUndo);
- double m_xOffset;
- double m_yOffset;
- double m_width;
- double m_height;
- double m_initialWidth;
- double m_initialHeight;
- int m_pageNr;
- int m_orientation;
+ double m_xOffset {0.0};
+ double m_yOffset {0.0};
+ double m_width {0.0};
+ double m_height {0.0};
+ double m_initialWidth {0.0};
+ double m_initialHeight {0.0};
+ int m_pageNr {0};
+ int m_orientation {0};
//! Name of this page, currently only allowed to be used by a master page
- QString m_PageName;
- ScribusDoc* m_Doc;
+ QString m_pageName;
+ QString m_masterPageName;
+ QString m_pageSize;
QString m_pageSectionNumber;
+ ScribusDoc* m_Doc {nullptr};
};
Q_DECLARE_METATYPE(ScPage*);
Modified: trunk/Scribus/scribus/scpageoutput.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23129&path=/trunk/Scribus/scribus/scpageoutput.cpp
==============================================================================
--- trunk/Scribus/scribus/scpageoutput.cpp (original)
+++ trunk/Scribus/scribus/scpageoutput.cpp Thu Aug 15 13:07:57 2019
@@ -110,17 +110,17 @@
void ScPageOutput::drawMasterItems(ScPainterExBase *painter, ScPage *page, ScLayer& layer, QRect clip)
{
PageItem* currItem;
- if (page->MPageNam.isEmpty())
+ if (page->masterPageNameEmpty())
return;
if (page->FromMaster.count() <= 0)
return;
if (!layer.isViewable || !layer.isPrintable)
return;
- ScPage* Mp = m_doc->MasterPages.at(m_doc->MasterNames[page->MPageNam]);
+ ScPage* Mp = m_doc->MasterPages.at(m_doc->MasterNames[page->masterPageName()]);
uint pageFromMasterCount = page->FromMaster.count();
- for (uint a = 0; a < pageFromMasterCount; ++a)
- {
- currItem = page->FromMaster.at(a);
+ for (int i = 0; i < pageFromMasterCount; ++i)
+ {
+ currItem = page->FromMaster.at(i);
if (currItem->m_layerID != layer.ID)
continue;
if ((currItem->OwnPage != -1) && (currItem->OwnPage != static_cast<int>(Mp->pageNr())))
Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23129&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Thu Aug 15 13:07:57 2019
@@ -3740,7 +3740,7 @@
{
ScPage *docPage = doc->Pages->at(0);
ScPage *addedPage = doc->addMasterPage(0, CommonStrings::masterPageNormal);
- addedPage->m_pageSize = docPage->m_pageSize;
+ addedPage->setSize(docPage->size());
addedPage->setInitialHeight(docPage->height());
addedPage->setInitialWidth(docPage->width());
addedPage->setHeight(docPage->height());
@@ -3802,7 +3802,7 @@
doc->setLoading(true);
for (int p = 0; p < doc->DocPages.count(); ++p)
{
- Apply_MasterPage(doc->DocPages.at(p)->MPageNam, p, false);
+ Apply_MasterPage(doc->DocPages.at(p)->masterPageName(), p, false);
}
view->reformPages(false);
doc->setLoading(false);
@@ -5448,7 +5448,7 @@
doc->currentPage()->setInitialHeight(height);
doc->currentPage()->setInitialWidth(width);
doc->currentPage()->setOrientation(orient);
- doc->currentPage()->m_pageSize = siz;
+ doc->currentPage()->setSize(siz);
}
//CB If we want to add this master page setting into the slotnewpage call, the pagenumber must be +1 I think
//Apply_MasterPage(base[(doc->currentPage()->pageNr()+doc->pageSets[doc->currentPageLayout].FirstPage) % doc->pageSets[doc->currentPageLayout].Columns],
@@ -5469,9 +5469,7 @@
m_undoManager->setUndoEnabled(true);
if (activeTransaction)
- {
activeTransaction.commit();
- }
}
void ScribusMainWindow::slotNewMasterPage(int w, const QString& name)
@@ -6218,7 +6216,7 @@
ss->set("DELETE_PAGE");
ss->set("PAGENR", a + 1);
ss->set("PAGENAME", doc->Pages->at(a)->pageName());
- ss->set("MASTERPAGE", doc->Pages->at(a)->MPageNam);
+ ss->set("MASTERPAGE", doc->Pages->at(a)->masterPageName());
ss->set("MASTER_PAGE_MODE", doc->masterPageMode());
// replace the deleted page in the undostack by a dummy object that will
// replaced with the "undone" page if user choose to undo the action
@@ -6228,7 +6226,7 @@
ss->set("DUMMY_ID", id);
m_undoManager->action(this, ss);
}
- bool isMasterPage = !(doc->Pages->at(a)->pageName().isEmpty());
+ bool isMasterPage = !(doc->Pages->at(a)->pageNameEmpty());
if (doc->masterPageMode())
doc->deleteMasterPage(a);
else
@@ -6307,7 +6305,7 @@
return;
if (doc->appMode == modeEditClip)
view->requestMode(submodeEndNodeEdit);
- QString currPageMasterPageName(doc->currentPage()->MPageNam);
+ QString currPageMasterPageName(doc->currentPage()->masterPageName());
QScopedPointer<PagePropertiesDialog> dia(new PagePropertiesDialog(this, doc));
if (!dia->exec())
return;
@@ -7657,7 +7655,7 @@
m_pagePalVisible = pagePalette->isVisible();
QString mpName;
if (temp.isEmpty())
- mpName = doc->currentPage()->MPageNam;
+ mpName = doc->currentPage()->masterPageName();
else
mpName = temp;
view->Deselect(true);
@@ -7710,7 +7708,7 @@
appModeHelper->setMasterPageEditMode(false, doc);
int pageCount=doc->DocPages.count();
for (int i=0; i<pageCount; ++i)
- Apply_MasterPage(doc->DocPages.at(i)->MPageNam, i, false);
+ Apply_MasterPage(doc->DocPages.at(i)->masterPageName(), i, false);
pagePalette->endMasterPageMode();
if (pagePalette->isFloating())
@@ -7738,11 +7736,11 @@
Q_ASSERT(!doc->masterPageMode());
QScopedPointer<ApplyMasterPageDialog> dia(new ApplyMasterPageDialog(this));
- dia->setup(doc, doc->currentPage()->MPageNam);
+ dia->setup(doc, doc->currentPage()->masterPageName());
if (!dia->exec())
return;
- QString masterPageName = dia->getMasterPageName();
+ QString masterPageName(dia->getMasterPageName());
int pageSelection = dia->getPageSelection(); //0=current, 1=even, 2=odd, 3=all
if (pageSelection == 0) //current page only
Apply_MasterPage(masterPageName, doc->currentPage()->pageNr(), false);
Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23129&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Thu Aug 15 13:07:57 2019
@@ -2454,7 +2454,7 @@
addedPage->Margins.setBottom(m_docPrefsData.docSetupPrefs.margins.bottom());
addedPage->initialMargins = m_docPrefsData.docSetupPrefs.margins;
addedPage->setPageNr(pageIndex);
- addedPage->m_pageSize = m_docPrefsData.docSetupPrefs.pageSize;
+ addedPage->setSize(m_docPrefsData.docSetupPrefs.pageSize);
addedPage->setOrientation(m_docPrefsData.docSetupPrefs.pageOrientation);
addedPage->marginPreset = m_docPrefsData.docSetupPrefs.marginPreset;
DocPages.insert(pageIndex, addedPage);
@@ -2476,10 +2476,10 @@
addedPage->setDocument(this);
addedPage->Margins = m_docPrefsData.docSetupPrefs.margins;
addedPage->initialMargins = m_docPrefsData.docSetupPrefs.margins;
- addedPage->m_pageSize = m_docPrefsData.docSetupPrefs.pageSize;
+ addedPage->setSize(m_docPrefsData.docSetupPrefs.pageSize);
addedPage->setOrientation(m_docPrefsData.docSetupPrefs.pageOrientation);
addedPage->marginPreset = m_docPrefsData.docSetupPrefs.marginPreset;
- addedPage->MPageNam = "";
+ addedPage->clearMasterPageName();
int pgN = pageNumber;
if (pageNumber > MasterPages.count())
pgN = MasterPages.count();
@@ -2519,8 +2519,8 @@
for (int i=0; i < DocPages.count(); ++i )
{
docPage=DocPages[i];
- if (docPage->MPageNam == oldPageName)
- docPage->MPageNam = newPageName;
+ if (docPage->masterPageName() == oldPageName)
+ docPage->setMasterPageName(newPageName);
}
//Update any items that were linking to our old name
int masterItemsCount=MasterItems.count();
@@ -2579,35 +2579,35 @@
while (dpIt.hasNext())
{
docPage = dpIt.next();
- if (docPage->MPageNam == oldMasterPage)
+ if (docPage->masterPageName() == oldMasterPage)
{
PageLocation pageLoc = locationOfPage(pageIndex);
if (pageLoc == LeftPage)
{
- if (MasterNames.contains( CommonStrings::trMasterPageNormalLeft))
- docPage->MPageNam = CommonStrings::trMasterPageNormalLeft;
- else if (MasterNames.contains( CommonStrings::trMasterPageNormal))
- docPage->MPageNam = CommonStrings::trMasterPageNormal;
+ if (MasterNames.contains(CommonStrings::trMasterPageNormalLeft))
+ docPage->setMasterPageName(CommonStrings::trMasterPageNormalLeft);
+ else if (MasterNames.contains(CommonStrings::trMasterPageNormal))
+ docPage->setMasterPageNameNormal();
else
- docPage->MPageNam = it.key();
+ docPage->setMasterPageName(it.key());
}
else if (pageLoc == RightPage)
{
- if (MasterNames.contains( CommonStrings::trMasterPageNormalRight))
- docPage->MPageNam = CommonStrings::trMasterPageNormalRight;
- else if (MasterNames.contains( CommonStrings::trMasterPageNormal))
- docPage->MPageNam = CommonStrings::trMasterPageNormal;
+ if (MasterNames.contains(CommonStrings::trMasterPageNormalRight))
+ docPage->setMasterPageName(CommonStrings::trMasterPageNormalRight);
+ else if (MasterNames.contains(CommonStrings::trMasterPageNormal))
+ docPage->setMasterPageNameNormal();
else
- docPage->MPageNam = it.key();
+ docPage->setMasterPageName(it.key());
}
else
{
- if (MasterNames.contains( CommonStrings::trMasterPageNormalMiddle))
- docPage->MPageNam = CommonStrings::trMasterPageNormalMiddle;
- else if (MasterNames.contains( CommonStrings::trMasterPageNormal))
- docPage->MPageNam = CommonStrings::trMasterPageNormal;
+ if (MasterNames.contains(CommonStrings::trMasterPageNormalMiddle))
+ docPage->setMasterPageName(CommonStrings::trMasterPageNormalMiddle);
+ else if (MasterNames.contains(CommonStrings::trMasterPageNormal))
+ docPage->setMasterPageNameNormal();
else
- docPage->MPageNam = it.key();
+ docPage->setMasterPageName(it.key());
}
}
pageIndex++;
@@ -4622,17 +4622,17 @@
if (UndoManager::undoEnabled())
{
- if (DocPages.at(pageNumber)->MPageNam != pageName)
- {
- SimpleState *ss = new SimpleState(Um::ApplyMasterPage, QString(Um::FromTo).arg(DocPages.at(pageNumber)->MPageNam, pageName));
+ if (DocPages.at(pageNumber)->masterPageName() != pageName)
+ {
+ SimpleState *ss = new SimpleState(Um::ApplyMasterPage, QString(Um::FromTo).arg(DocPages.at(pageNumber)->masterPageName(), pageName));
ss->set("PAGE_NUMBER", pageNumber);
- ss->set("OLD_MASTERPAGE", DocPages.at(pageNumber)->MPageNam);
+ ss->set("OLD_MASTERPAGE", DocPages.at(pageNumber)->masterPageName());
ss->set("NEW_MASTERPAGE", pageName);
m_undoManager->action(this, ss);
}
}
ScPage* Ap = DocPages.at(pageNumber);
- Ap->MPageNam = pageName;
+ Ap->setMasterPageName(pageName);
const int MpNr = MasterNames[pageName];
ScPage* Mp = MasterPages.at(MpNr);
PageItem *currItem;
@@ -4701,7 +4701,7 @@
Ap->setHeight(Mp->height());
Ap->setWidth(Mp->width());
Ap->setOrientation(Mp->orientation());
- Ap->m_pageSize = Mp->m_pageSize;
+ Ap->setSize(Mp->size());
}
//TODO make a return false if not possible to apply the master page
if (!isLoading())
@@ -4806,7 +4806,7 @@
ss->set("OLD_PAGE_HEIGHT", m_currentPage->height());
ss->set("OLD_PAGE_WIDTH", m_currentPage->width());
ss->set("OLD_PAGE_ORIENTATION", m_currentPage->orientation());
- ss->set("OLD_PAGE_SIZE", m_currentPage->m_pageSize);
+ ss->set("OLD_PAGE_SIZE", m_currentPage->size());
ss->set("OLD_PAGE_TYPE", m_currentPage->LeftPg);
ss->set("OLD_PAGE_MARGINPRESET", m_currentPage->marginPreset);
ss->set("OLD_PAGE_MOVEOBJECTS", moveObjects);
@@ -4835,7 +4835,7 @@
m_currentPage->setHeight(height);
m_currentPage->setWidth(width);
m_currentPage->setOrientation(orientation);
- m_currentPage->m_pageSize = pageSize;
+ m_currentPage->setSize(pageSize);
m_currentPage->LeftPg = pageType;
m_currentPage->marginPreset = marginPreset;
reformPages(moveObjects);
@@ -5116,13 +5116,13 @@
//Copy the items from our current document page's applied *master* page
if (copyFromAppliedMaster)
{
- if (!sourcePage->MPageNam.isEmpty() && MasterNames.contains(sourcePage->MPageNam))
+ if (!sourcePage->masterPageNameEmpty() && MasterNames.contains(sourcePage->masterPageName()))
{
ScPage* pageMaster = nullptr;
for (int i=0; i < MasterPages.count(); ++i )
{
pageMaster=MasterPages[i];
- if (pageMaster->pageName() == sourcePage->MPageNam)
+ if (pageMaster->pageName() == sourcePage->masterPageName())
break;
}
if (Layers.count()!= 0 && pageMaster!=nullptr)
@@ -5189,7 +5189,7 @@
PageItem *newItem = MasterItems.at(a);
newItem->setMasterPage(MasterNames[masterPageName], masterPageName);
}
- targetPage->MPageNam.clear();
+ targetPage->clearMasterPageName();
setLoading(false);
GroupCounter = GrMax + 1;
//Reset the current page..
@@ -6240,7 +6240,7 @@
else
{
PageLocation pageLocation = MiddlePage;
- if (page->pageName().isEmpty()) // Standard page
+ if (page->pageNameEmpty()) // Standard page
pageLocation = locationOfPage(page->pageNr());
else if (page->LeftPg == 1) // Left Master page
pageLocation = LeftPage;
@@ -6531,8 +6531,8 @@
addedPage->Margins.set(0, 0, 0, 0);
addedPage->initialMargins.set(0, 0, 0, 0);
addedPage->setPageNr(0);
- addedPage->MPageNam = "";
- addedPage->setPageName("");
+ addedPage->clearMasterPageName();
+ addedPage->setPageName(QString());
TempPages.clear();
TempPages.append(addedPage);
Pages = &TempPages;
@@ -6674,8 +6674,8 @@
addedPage->Margins.set(0, 0, 0, 0);
addedPage->initialMargins.set(0, 0, 0, 0);
addedPage->setPageNr(0);
- addedPage->MPageNam = "";
- addedPage->setPageName("");
+ addedPage->clearMasterPageName();
+ addedPage->resetPageName();
TempPages.clear();
TempPages.append(addedPage);
Pages = &TempPages;
@@ -7126,11 +7126,11 @@
lastDest = destination;
DocPages.insert(destLocation, destination);
setLocationBasedPageLRMargins(destLocation);
- applyMasterPage(from->MPageNam, destLocation);
+ applyMasterPage(from->masterPageName(), destLocation);
destination->setInitialHeight(from->height());
destination->setInitialWidth(from->width());
destination->setOrientation(from->orientation());
- destination->m_pageSize = from->m_pageSize;
+ destination->setSize(from->size());
//CB: Can possibly partially use the code from applyMasterPage here instead of runnin all of this again..
//TODO make a function to do this margin stuff and use elsewhere too
destination->initialMargins.setTop(from->initialMargins.top());
@@ -16065,7 +16065,7 @@
pp->setInitialHeight(pageHeight());
pp->setHeight(pageHeight());
pp->setWidth(pageWidth());
- pp->m_pageSize = pageSize();
+ pp->setSize(pageSize());
pp->setOrientation(pageOrientation());
}
if (resizePageMargins)
@@ -16079,7 +16079,7 @@
//CB #6796: find the master page (*mp) for the current page (*pp)
//check if *pp's margins are the same as the *mp's current margins
//apply new margins if same
- const int masterPageNumber = MasterNames[pp->MPageNam];
+ const int masterPageNumber = MasterNames[pp->masterPageName()];
const ScPage* mp = MasterPages.at(masterPageNumber);
if (pp->initialMargins.left() == mp->initialMargins.left() &&
pp->initialMargins.top() == mp->initialMargins.top() &&
@@ -16100,7 +16100,7 @@
pp->setInitialHeight(pageHeight());
pp->setHeight(pageHeight());
pp->setWidth(pageWidth());
- pp->m_pageSize = pageSize();
+ pp->setSize(pageSize());
pp->setOrientation(pageOrientation());
}
if (resizeMasterPageMargins)
Modified: trunk/Scribus/scribus/scribusstructs.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23129&path=/trunk/Scribus/scribus/scribusstructs.h
==============================================================================
--- trunk/Scribus/scribus/scribusstructs.h (original)
+++ trunk/Scribus/scribus/scribusstructs.h Thu Aug 15 13:07:57 2019
@@ -59,17 +59,17 @@
struct DocPagesSetup
{
- DocPagesSetup() : pageArrangement(0), firstPageLocation(0), firstPageNumber(0), orientation(0), autoTextFrames(false), columnDistance(0), columnCount(1) {}
+ DocPagesSetup() = default;
DocPagesSetup(int pa, int fpl, int fpn, int o, bool atf, double cd, double cc) :
pageArrangement(pa), firstPageLocation(fpl), firstPageNumber(fpn), orientation(o), autoTextFrames(atf),
columnDistance(cd), columnCount(cc) {}
- int pageArrangement;
- int firstPageLocation;
- int firstPageNumber;
- int orientation;
- bool autoTextFrames;
- double columnDistance;
- double columnCount;
+ int pageArrangement {0};
+ int firstPageLocation {0};
+ int firstPageNumber {0};
+ int orientation {0};
+ bool autoTextFrames {false};
+ double columnDistance {0.0};
+ double columnCount {1.0};
};
struct PageSet
@@ -155,19 +155,13 @@
struct PDFPresentationData
{
- PDFPresentationData()
- {
- pageEffectDuration = 1;
- pageViewDuration = 1;
- effectType = 0;
- Dm = M = Di = 0;
- }
- int pageEffectDuration;
- int pageViewDuration;
- int effectType;
- int Dm;
- int M;
- int Di;
+ PDFPresentationData() = default;
+ int pageEffectDuration {1};
+ int pageViewDuration {1};
+ int effectType {0};
+ int Dm {0};
+ int M {0};
+ int Di {0};
};
struct LPIData
@@ -293,7 +287,8 @@
/**
* Flags for ScribusView PageToPixmap()
*/
-enum PageToPixmapFlag {
+enum PageToPixmapFlag
+{
Pixmap_NoFlags = 0,
Pixmap_DrawFrame = 1 << 0,
Pixmap_DrawBackground = 1 << 1,
@@ -335,7 +330,8 @@
};
// this is a quick hack to combine runs until I've thought of something better -- AV
-class LastStyles {
+class LastStyles
+{
public:
CharStyle Style;
int StyleStart;
@@ -348,12 +344,10 @@
class AttributeValue
{
public:
- AttributeValue() : valid(false)
- {
- }
+ AttributeValue() = default;
AttributeValue(const QString& val)
{
- if (val.isEmpty() || (val == ""))
+ if (val.isEmpty())
{
valid = false;
value.clear();
@@ -364,7 +358,7 @@
value = val;
}
}
- bool valid;
+ bool valid {false};
QString value;
};
Modified: trunk/Scribus/scribus/ui/customfdialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23129&path=/trunk/Scribus/scribus/ui/customfdialog.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/customfdialog.cpp (original)
+++ trunk/Scribus/scribus/ui/customfdialog.cpp Thu Aug 15 13:07:57 2019
@@ -68,8 +68,8 @@
fmts.clear();
QString tmp[] = {"eps", "epsi", "gif", "png", "jpg", "jpeg", "xpm", "tif", "tiff", "bmp", "pbm", "pgm", "ppm", "xbm", "xpm", "psd", "pat"};
size_t array = sizeof(tmp) / sizeof(*tmp);
- for (uint a = 0; a < array; ++a)
- fmts.append(tmp[a]);
+ for (int i = 0; i < array; ++i)
+ fmts.append(tmp[i]);
IconManager& im=IconManager::instance();
imagepm = im.loadIcon("16/image-x-generic.png");
pspm = im.loadIcon("postscript.png");
@@ -131,7 +131,7 @@
void FDialogPreview::genPreview(const QString& name)
{
QPixmap pm;
- QString Buffer = "";
+ QString Buffer;
updatePix();
if (name.isEmpty())
return;
@@ -171,8 +171,8 @@
}
int xres = im.imgInfo.xres;
int yres = im.imgInfo.yres;
- QString tmp = "";
- QString tmp2 = "";
+ QString tmp;
+ QString tmp2;
QImage im2 = im.scaled(w - 5, h - 44, Qt::KeepAspectRatio, Qt::SmoothTransformation);
QPainter p;
QBrush b(QColor(205,205,205), IconManager::instance().loadPixmap("testfill.png"));
Modified: trunk/Scribus/scribus/ui/newfile.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23129&path=/trunk/Scribus/scribus/ui/newfile.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/newfile.cpp (original)
+++ trunk/Scribus/scribus/ui/newfile.cpp Thu Aug 15 13:07:57 2019
@@ -408,9 +408,9 @@
recentDocLayout->setSpacing(5);
recentDocListBox = new QListWidget(recentDocFrame);
recentDocLayout->addWidget(recentDocListBox);
- uint max = qMin(prefsManager.appPrefs.uiPrefs.recentDocCount, recentDocList.count());
- for (uint m = 0; m < max; ++m)
- recentDocListBox->addItem( QDir::toNativeSeparators(recentDocList[m]) );
+ int max = qMin(prefsManager.appPrefs.uiPrefs.recentDocCount, recentDocList.count());
+ for (int i = 0; i < max; ++i)
+ recentDocListBox->addItem(QDir::toNativeSeparators(recentDocList[i]));
if (max>0)
recentDocListBox->setCurrentRow(0);
}
Modified: trunk/Scribus/scribus/ui/pagepalette_masterpages.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23129&path=/trunk/Scribus/scribus/ui/pagepalette_masterpages.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/pagepalette_masterpages.cpp (original)
+++ trunk/Scribus/scribus/ui/pagepalette_masterpages.cpp Thu Aug 15 13:07:57 2019
@@ -164,7 +164,7 @@
{
for (int i=0; i < m_doc->DocPages.count(); ++i )
{
- if (m_doc->DocPages[i]->MPageNam == m_currentPage)
+ if (m_doc->DocPages[i]->masterPageName() == m_currentPage)
extraWarn = tr("This master page is used at least once in the document.");
}
int exit = ScMessageBox::warning(this,
Modified: trunk/Scribus/scribus/ui/pagepalette_pages.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23129&path=/trunk/Scribus/scribus/ui/pagepalette_pages.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/pagepalette_pages.cpp (original)
+++ trunk/Scribus/scribus/ui/pagepalette_pages.cpp Thu Aug 15 13:07:57 2019
@@ -90,7 +90,7 @@
QString extraWarn = "";
for (int i=0; i < currView->Doc->DocPages.count(); ++i )
{
- if (currView->Doc->DocPages[i]->MPageNam == tmp)
+ if (currView->Doc->DocPages[i]->masterPageName() == tmp)
extraWarn = tr("This master page is used at least once in the document.");
}
int exit = ScMessageBox::warning(this,
@@ -271,7 +271,7 @@
pageList.clear();
for (int a = 0; a < currView->Doc->DocPages.count(); ++a)
{
- str = currView->Doc->DocPages.at(a)->MPageNam;
+ str = currView->Doc->DocPages.at(a)->masterPageName();
SeItem *it = new SeItem(str, a, createIcon(a, str, pix));
pageList.append(it);
pageView->setItem(rowcounter*rowmult+rowadd, counter*colmult+coladd, (QTableWidgetItem *)it);
Modified: trunk/Scribus/scribus/ui/pagepropertiesdialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23129&path=/trunk/Scribus/scribus/ui/pagepropertiesdialog.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/pagepropertiesdialog.cpp (original)
+++ trunk/Scribus/scribus/ui/pagepropertiesdialog.cpp Thu Aug 15 13:07:57 2019
@@ -45,7 +45,7 @@
TextLabel1 = new QLabel( tr( "&Size:" ), dsGroupBox7 );
dsGroupBox7Layout->addWidget( TextLabel1, 0, 0, 1, 2 );
- PageSize ps(doc->currentPage()->m_pageSize);
+ PageSize ps(doc->currentPage()->size());
prefsPageSizeName=ps.name();
sizeQComboBox = new QComboBox(dsGroupBox7);
QStringList insertList(ps.activeSizeTRList());
@@ -129,7 +129,7 @@
{
masterPageLabel->setText( tr( "Master Page:" ) );
masterPageComboBox = new QComboBox( groupMaster );
- QString Nam = doc->currentPage()->MPageNam;
+ QString Nam = doc->currentPage()->masterPageName();
QString na = Nam == CommonStrings::masterPageNormal ? CommonStrings::trMasterPageNormal : Nam, in;
int cc = 0;
for (QMap<QString,int>::Iterator it = doc->MasterNames.begin(); it != doc->MasterNames.end(); ++it)
More information about the scribus-commit
mailing list