Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Oliver Sander
poppler
Commits
d1bb49c3
Commit
d1bb49c3
authored
Aug 21, 2020
by
Albert Astals Cid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qt6: Make flags method actually return flags and not int
parent
150e6efa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
15 deletions
+18
-15
qt6/src/poppler-annotation-private.h
qt6/src/poppler-annotation-private.h
+2
-2
qt6/src/poppler-annotation.cc
qt6/src/poppler-annotation.cc
+11
-9
qt6/src/poppler-annotation.h
qt6/src/poppler-annotation.h
+5
-4
No files found.
qt6/src/poppler-annotation-private.h
View file @
d1bb49c3
...
...
@@ -2,7 +2,7 @@
* Copyright (C) 2007, Pino Toscano <pino@kde.org>
* Copyright (C) 2012, Tobias Koenig <tokoe@kdab.com>
* Copyright (C) 2012, 2013 Fabio D'Urso <fabiodurso@hotmail.it>
* Copyright (C) 2012, 2014, 2018
, 2019
, Albert Astals Cid <aacid@kde.org>
* Copyright (C) 2012, 2014, 2018
-2020
, Albert Astals Cid <aacid@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
...
...
@@ -60,7 +60,7 @@ public:
QDateTime
creationDate
;
// before or equal to modifyDate
/* properties: look/interaction related */
int
flags
;
Annotation
::
Flags
flags
;
QRectF
boundary
;
/* style and popup */
...
...
qt6/src/poppler-annotation.cc
View file @
d1bb49c3
/* poppler-annotation.cc: qt interface to poppler
* Copyright (C) 2006, 2009, 2012-2015, 2018
, 2019
Albert Astals Cid <aacid@kde.org>
* Copyright (C) 2006, 2009, 2012-2015, 2018
-2020
Albert Astals Cid <aacid@kde.org>
* Copyright (C) 2006, 2008, 2010 Pino Toscano <pino@kde.org>
* Copyright (C) 2012, Guillermo A. Amaral B. <gamaral@kde.org>
* Copyright (C) 2012-2014 Fabio D'Urso <fabiodurso@hotmail.it>
...
...
@@ -61,7 +61,7 @@
namespace
Poppler
{
// BEGIN Annotation implementation
AnnotationPrivate
::
AnnotationPrivate
()
:
flags
(
0
),
revisionScope
(
Annotation
::
Root
),
revisionType
(
Annotation
::
None
),
pdfAnnot
(
nullptr
),
pdfPage
(
nullptr
),
parentDoc
(
nullptr
)
{
}
AnnotationPrivate
::
AnnotationPrivate
()
:
revisionScope
(
Annotation
::
Root
),
revisionType
(
Annotation
::
None
),
pdfAnnot
(
nullptr
),
pdfPage
(
nullptr
),
parentDoc
(
nullptr
)
{
}
void
AnnotationPrivate
::
addRevision
(
Annotation
*
ann
,
Annotation
::
RevScope
scope
,
Annotation
::
RevType
type
)
{
...
...
@@ -1077,9 +1077,9 @@ void Annotation::setCreationDate(const QDateTime &date)
#endif
}
static
int
fromPdfFlags
(
int
flags
)
static
Annotation
::
Flags
fromPdfFlags
(
int
flags
)
{
int
qtflags
=
0
;
Annotation
::
Flags
qtflags
;
if
(
flags
&
Annot
::
flagHidden
)
qtflags
|=
Annotation
::
Hidden
;
...
...
@@ -1089,8 +1089,10 @@ static int fromPdfFlags(int flags)
qtflags
|=
Annotation
::
FixedRotation
;
if
(
!
(
flags
&
Annot
::
flagPrint
))
qtflags
|=
Annotation
::
DenyPrint
;
if
(
flags
&
Annot
::
flagReadOnly
)
qtflags
|=
(
Annotation
::
DenyWrite
|
Annotation
::
DenyDelete
);
if
(
flags
&
Annot
::
flagReadOnly
)
{
qtflags
|=
Annotation
::
DenyWrite
;
qtflags
|=
Annotation
::
DenyDelete
;
}
if
(
flags
&
Annot
::
flagLocked
)
qtflags
|=
Annotation
::
DenyDelete
;
if
(
flags
&
Annot
::
flagToggleNoView
)
...
...
@@ -1099,7 +1101,7 @@ static int fromPdfFlags(int flags)
return
qtflags
;
}
static
int
toPdfFlags
(
int
qtflags
)
static
int
toPdfFlags
(
Annotation
::
Flags
qtflags
)
{
int
flags
=
0
;
...
...
@@ -1121,7 +1123,7 @@ static int toPdfFlags(int qtflags)
return
flags
;
}
int
Annotation
::
flags
()
const
Annotation
::
Flags
Annotation
::
flags
()
const
{
Q_D
(
const
Annotation
);
...
...
@@ -1131,7 +1133,7 @@ int Annotation::flags() const
return
fromPdfFlags
(
d
->
pdfAnnot
->
getFlags
());
}
void
Annotation
::
setFlags
(
int
flags
)
void
Annotation
::
setFlags
(
Annotation
::
Flags
flags
)
{
Q_D
(
Annotation
);
...
...
qt6/src/poppler-annotation.h
View file @
d1bb49c3
...
...
@@ -175,7 +175,7 @@ public:
*
* They can be OR'd together (e.g. Annotation::FixedRotation | Annotation::DenyPrint).
*
* \sa flags(), setFlags(
int
)
* \sa flags(), setFlags()
*/
// NOTE: Only flags that are known to work are documented
enum
Flag
...
...
@@ -189,6 +189,7 @@ public:
ToggleHidingOnMouse
=
64
,
External
=
128
};
Q_DECLARE_FLAGS
(
Flags
,
Flag
)
enum
LineStyle
{
...
...
@@ -253,15 +254,15 @@ public:
/**
* Returns this annotation's flags
*
* \sa Flag, setFlags(
int
)
* \sa Flag, setFlags()
*/
int
flags
()
const
;
Flags
flags
()
const
;
/**
* Sets this annotation's flags
*
* \sa Flag, flags(), \ref annotFixedRotation
*/
void
setFlags
(
int
flags
);
void
setFlags
(
Flags
flags
);
/**
* Returns this annotation's boundary rectangle in normalized coordinates
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment