Author: jghali
Date: Fri Jul  5 19:49:15 2019
New Revision: 23070

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23070
Log:
#15715: When changing sections, page numbers on regular pages are not updated 
immediately

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

Modified: trunk/Scribus/scribus/pagestructs.h
URL: 
http://scribus.net/websvn/diff.php?repname=Scribus&rev=23070&path=/trunk/Scribus/scribus/pagestructs.h
==============================================================================
--- trunk/Scribus/scribus/pagestructs.h (original)
+++ trunk/Scribus/scribus/pagestructs.h Fri Jul  5 19:49:15 2019
@@ -53,6 +53,36 @@
        bool active; // Is the section active, ie, if the fromindex is 10, and 
theres 5 pages, this should be inactive.
        QChar pageNumberFillChar; //Prefix to be placed before page number
        int pageNumberWidth; //Minimum width of page number string
+
+       bool operator==(const DocumentSection &other) const
+       {
+               if (number != other.number)
+                       return false;
+               if (name != other.name)
+                       return false;
+               if (fromindex != other.fromindex)
+                       return false;
+               if (toindex != other.toindex)
+                       return false;
+               if (type != other.type)
+                       return false;
+               if (sectionstartindex != other.sectionstartindex)
+                       return false;
+               if (reversed != other.reversed)
+                       return false;
+               if (active != other.active)
+                       return false;
+               if (pageNumberFillChar != other.pageNumberFillChar)
+                       return false;
+               if (pageNumberWidth != other.pageNumberWidth)
+                       return false;
+               return true;
+       }
+
+       inline bool operator!=(const DocumentSection &other) const
+       {
+               return (this->operator==(other) == false);
+       }
 };
 
 typedef QMap<uint, DocumentSection> DocumentSectionMap;

Modified: trunk/Scribus/scribus/prefsstructs.h
URL: 
http://scribus.net/websvn/diff.php?repname=Scribus&rev=23070&path=/trunk/Scribus/scribus/prefsstructs.h
==============================================================================
--- trunk/Scribus/scribus/prefsstructs.h        (original)
+++ trunk/Scribus/scribus/prefsstructs.h        Fri Jul  5 19:49:15 2019
@@ -80,11 +80,11 @@
        int valueStrikeThruPos; //! Strike-through displacement
        int valueStrikeThruWidth; //! Strike-through line width
 
-       inline bool operator==(const TypoPrefs &other)
+       inline bool operator==(const TypoPrefs &other) const
        {
                return (memcmp(this, &other, sizeof(TypoPrefs)) == 0);
        }
-       inline bool operator!=(const TypoPrefs &other)
+       inline bool operator!=(const TypoPrefs &other) const
        {
                return (memcmp(this, &other, sizeof(TypoPrefs)) != 0);
        }

Modified: trunk/Scribus/scribus/scribus.cpp
URL: 
http://scribus.net/websvn/diff.php?repname=Scribus&rev=23070&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp   (original)
+++ trunk/Scribus/scribus/scribus.cpp   Fri Jul  5 19:49:15 2019
@@ -6763,7 +6763,7 @@
 
        slotChangeUnit(doc->unitIndex(), false);
 
-       if 
(oldDocPrefs.itemToolPrefs.imageLowResType!=newDocPrefs.itemToolPrefs.imageLowResType)
+       if (oldDocPrefs.itemToolPrefs.imageLowResType != 
newDocPrefs.itemToolPrefs.imageLowResType)
        {
                setStatusBarInfoText( tr("Updating Images"));
                mainWindowProgressBar->reset();
@@ -6775,10 +6775,7 @@
                mainWindowProgressBar->reset();
                viewToolBar->setDoc(doc);
        }
-       if (oldDocPrefs.typoPrefs != newDocPrefs.typoPrefs)
-       {
-               doc->invalidateAll();
-       }
+
        emit UpdateRequest(reqDocFontListUpdate);
        
scrActions["viewShowMargins"]->setChecked(doc->guidesPrefs().marginsShown);
        scrActions["viewShowBleeds"]->setChecked(doc->guidesPrefs().showBleed);

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: 
http://scribus.net/websvn/diff.php?repname=Scribus&rev=23070&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp        (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp        Fri Jul  5 19:49:15 2019
@@ -16059,13 +16059,14 @@
                        
Items->at(i)->setImageVisible(m_docPrefsData.guidesPrefs.showPic);
        }
 
-       double oldBaseGridValue  = oldPrefsData.guidesPrefs.valueBaselineGrid;
-       double oldBaseGridOffset = oldPrefsData.guidesPrefs.offsetBaselineGrid;
-       if (oldBaseGridValue  != prefsData.guidesPrefs.valueBaselineGrid ||
-               oldBaseGridOffset != prefsData.guidesPrefs.offsetBaselineGrid )
-       {
+       bool   mustInvalidateAll = false;
+       mustInvalidateAll |= (oldPrefsData.guidesPrefs.valueBaselineGrid  != 
prefsData.guidesPrefs.valueBaselineGrid);
+       mustInvalidateAll |= (oldPrefsData.guidesPrefs.offsetBaselineGrid != 
prefsData.guidesPrefs.offsetBaselineGrid);
+       mustInvalidateAll |= (oldPrefsData.typoPrefs != prefsData.typoPrefs);
+       mustInvalidateAll |= (oldPrefsData.docSectionMap != 
prefsData.docSectionMap);
+
+       if (mustInvalidateAll)
                this->invalidateAll();
-       }
 }
 
 void ScribusDoc::applyPrefsPageSizingAndMargins(bool resizePages, bool 
resizeMasterPages, bool resizePageMargins, bool resizeMasterPageMargins)


_______________________________________________
scribus-commit mailing list
[email protected]
http://lists.scribus.net/mailman/listinfo/scribus-commit

Reply via email to