diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2020-06-19 14:04:30 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2020-06-21 23:09:50 +0200 |
commit | 387a35fae2a539706f605f052322c1a384b07ce1 (patch) | |
tree | 9d452b690ba243bf2608019e3da3c4b22673bd7a /vcl | |
parent | 037463d2617e5d7bbaea6b99f6b8ffd265cb38af (diff) |
pdf: clean-up PDFWriterImpl::createNote
Change-Id: Ie2d50b92d448864e9e20098060b0e42f747f1638
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96761
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 47a697785564..04fcb70a152f 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -9649,21 +9649,22 @@ void PDFWriterImpl::intersectClipRegion( const basegfx::B2DPolyPolygon& rRegion void PDFWriterImpl::createNote( const tools::Rectangle& rRect, const PDFNote& rNote, sal_Int32 nPageNr ) { - if( nPageNr < 0 ) + if (nPageNr < 0) nPageNr = m_nCurrentPage; - if( nPageNr < 0 || nPageNr >= static_cast<sal_Int32>(m_aPages.size()) ) + if (nPageNr < 0 || nPageNr >= sal_Int32(m_aPages.size())) return; - m_aNotes.emplace_back( ); - m_aNotes.back().m_nObject = createObject(); - m_aNotes.back().m_aContents = rNote; - m_aNotes.back().m_aRect = rRect; + m_aNotes.emplace_back(); + auto & rNoteEntry = m_aNotes.back(); + rNoteEntry.m_nObject = createObject(); + rNoteEntry.m_aContents = rNote; + rNoteEntry.m_aRect = rRect; // convert to default user space now, since the mapmode may change - m_aPages[nPageNr].convertRect( m_aNotes.back().m_aRect ); + m_aPages[nPageNr].convertRect(rNoteEntry.m_aRect); // insert note to page's annotation list - m_aPages[ nPageNr ].m_aAnnotations.push_back( m_aNotes.back().m_nObject ); + m_aPages[nPageNr].m_aAnnotations.push_back(rNoteEntry.m_nObject); } sal_Int32 PDFWriterImpl::createLink( const tools::Rectangle& rRect, sal_Int32 nPageNr ) |