[poppler] poppler/PageLabelInfo.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Oct 24 21:19:06 UTC 2021


 poppler/PageLabelInfo.cc |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 7341d579cdd58ef28f67af76dc8f9a2c4592bef2
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sun Oct 24 23:13:27 2021 +0200

    PageLabelInfo::labelToIndex: work on some special no style intervals
    
    If the interval is length 1 we can assume the index is the base of the
    interval
    
    Fixes bug #1161

diff --git a/poppler/PageLabelInfo.cc b/poppler/PageLabelInfo.cc
index be4f8fbe..31cd3a6b 100644
--- a/poppler/PageLabelInfo.cc
+++ b/poppler/PageLabelInfo.cc
@@ -3,7 +3,7 @@
 // This file is under the GPLv2 or later license
 //
 // Copyright (C) 2005-2006 Kristian Høgsberg <krh at redhat.com>
-// Copyright (C) 2005, 2009, 2013, 2017, 2018, 2020 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2005, 2009, 2013, 2017, 2018, 2020, 2021 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2011 Simon Kellner <kellner at kit.edu>
 // Copyright (C) 2012 Fabio D'Urso <fabiodurso at hotmail.it>
 // Copyright (C) 2018 Adam Reichold <adam.reichold at t-online.de>
@@ -151,6 +151,12 @@ bool PageLabelInfo::labelToIndex(GooString *label, int *index) const
             }
             break;
         case Interval::None:
+            if (interval.length == 1) {
+                *index = interval.base;
+                return true;
+            } else {
+                error(errSyntaxError, -1, "asking to convert label to page index in an unknown scenario, report a bug");
+            }
             break;
         }
     }


More information about the poppler mailing list