Hello Francesco, hello all,
> On 22 February 2018 at 12:20 Francesco Pretto <cez...@gmail.com> wrote:
> 
> 
> ---
>   src/doc/PdfAnnotation.cpp | 8 ++++++++
>   src/doc/PdfAnnotation.h   | 7 ++++++-
>   2 files changed, 14 insertions(+), 1 deletion(-)
> 

the patch looks good except for some coding style issues, and
unfortunately the patch got so munged (in my webmail??) that
I had to first massage it to get it to apply cleanly. I've
build-tested it in a Debian unstable sbuild chroot (I've
looked at the recent PdfRect changes too, they don't conflict).

Thanks for the patch, the changed one, which I committed to
svn r1918: https://sourceforge.net/p/podofo/code/1918/ is
attached (please only submit patches as attachments).

Best regards, mabri

P.S. It's bedtime for me now, so I'll review the other
patches tomorrow, please wait for that in making rc2.
---
src/doc/PdfAnnotation.cpp | 7 +++++++
src/doc/PdfAnnotation.h | 7 ++++++-
2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/doc/PdfAnnotation.cpp b/src/doc/PdfAnnotation.cpp
index 941435b..a02f05d 100644
--- a/src/doc/PdfAnnotation.cpp
+++ b/src/doc/PdfAnnotation.cpp
@@ -119,6 +119,13 @@ PdfRect PdfAnnotation::GetRect() const
         return PdfRect( this->GetObject()->GetDictionary().GetKey( PdfName::KeyRect )->GetArray() );
 
    return PdfRect();
+}
+
+void PdfAnnotation::SetRect(const PdfRect & rRect)
+{
+    PdfVariant rect;
+    rRect.ToVariant( rect );
+    this->GetObject()->GetDictionary().AddKey( PdfName::KeyRect, rect );
 }
 
 void SetAppearanceStreamForObject( PdfObject* pForObject, PdfXObject* pObject, EPdfAnnotationAppearance eAppearance, const PdfName & state )
diff --git a/src/doc/PdfAnnotation.h b/src/doc/PdfAnnotation.h
index 7aa1c6f..b774af7 100644
--- a/src/doc/PdfAnnotation.h
+++ b/src/doc/PdfAnnotation.h
@@ -158,11 +158,16 @@ class PODOFO_DOC_API PdfAnnotation : public PdfElement {
      */
     bool HasAppearanceStream() const;
 
-    /** Get the rectangle of this annotation
+    /** Get the rectangle of this annotation.
      *  \returns a rectangle
      */
     PdfRect GetRect() const;
 
+    /** Set the rectangle of this annotation.
+     * \param rRect rectangle to set
+     */
+    void SetRect( const PdfRect & rRect );
+ 
     /** Set the flags of this annotation.
      *  \param uiFlags is an unsigned 32bit integer with different 
      *                 EPdfAnnotationFlags OR'ed together.
-- 
2.16.1.windows.1
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to