[poppler] poppler/ViewerPreferences.cc poppler/ViewerPreferences.h

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Feb 9 14:27:32 UTC 2022


 poppler/ViewerPreferences.cc |   13 +------------
 poppler/ViewerPreferences.h  |   12 ++++++------
 2 files changed, 7 insertions(+), 18 deletions(-)

New commits:
commit f5d3f401be27c2e57a9eb962a9edea35b3ba9574
Author: Albert Astals Cid <aacid at kde.org>
Date:   Wed Feb 9 15:19:07 2022 +0100

    Remove ViewerPreferences::init
    
    By having the initialization directly in the member definition we make
    sure that if ever we introduce a new constructor we will not forget to
    call init()

diff --git a/poppler/ViewerPreferences.cc b/poppler/ViewerPreferences.cc
index 9d8a70e6..b647470c 100644
--- a/poppler/ViewerPreferences.cc
+++ b/poppler/ViewerPreferences.cc
@@ -5,7 +5,7 @@
 // This file is licensed under the GPLv2 or later
 //
 // Copyright 2011 Pino Toscano <pino at kde.org>
-// Copyright 2017, 2020 Albert Astals Cid <aacid at kde.org>
+// Copyright 2017, 2020, 2022 Albert Astals Cid <aacid at kde.org>
 // Copyright 2019 Marek Kasik <mkasik at redhat.com>
 //
 //========================================================================
@@ -19,8 +19,6 @@
 
 ViewerPreferences::ViewerPreferences(Dict *prefDict)
 {
-    init();
-
     hideToolbar = prefDict->lookup("HideToolbar").getBoolWithDefaultValue(false);
 
     hideMenubar = prefDict->lookup("HideMenubar").getBoolWithDefaultValue(false);
@@ -112,12 +110,3 @@ ViewerPreferences::ViewerPreferences(Dict *prefDict)
 }
 
 ViewerPreferences::~ViewerPreferences() { }
-
-void ViewerPreferences::init()
-{
-    nonFullScreenPageMode = nfpmUseNone;
-    direction = directionL2R;
-    printScaling = printScalingAppDefault;
-    duplex = duplexNone;
-    numCopies = 1;
-}
diff --git a/poppler/ViewerPreferences.h b/poppler/ViewerPreferences.h
index b976ea96..24a814ca 100644
--- a/poppler/ViewerPreferences.h
+++ b/poppler/ViewerPreferences.h
@@ -6,7 +6,7 @@
 //
 // Copyright 2011 Pino Toscano <pino at kde.org>
 // Copyright 2019 Marek Kasik <mkasik at redhat.com>
-// Copyright 2021 Albert Astals Cid <aacid at kde.org>
+// Copyright 2021, 2022 Albert Astals Cid <aacid at kde.org>
 //
 //========================================================================
 
@@ -75,12 +75,12 @@ private:
     bool fitWindow;
     bool centerWindow;
     bool displayDocTitle;
-    NonFullScreenPageMode nonFullScreenPageMode;
-    Direction direction;
-    PrintScaling printScaling;
-    Duplex duplex;
+    NonFullScreenPageMode nonFullScreenPageMode = nfpmUseNone;
+    Direction direction = directionL2R;
+    PrintScaling printScaling = printScalingAppDefault;
+    Duplex duplex = duplexNone;
     bool pickTrayByPDFSize;
-    int numCopies;
+    int numCopies = 1;
     std::vector<std::pair<int, int>> printPageRange;
 };
 


More information about the poppler mailing list