From c6ea20161c7e8004021ad3b6976a2b35ac8b9b31 Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Mon, 30 Dec 2019 17:57:54 +0100 Subject: pdf: move PDFWidget out of PDFWriterImpl class MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I0fce968ec566cb663352ecb57279110f0ae9f3e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86021 Reviewed-by: Tomaž Vajngerl Tested-by: Tomaž Vajngerl --- vcl/source/gdi/pdfwriter_impl.cxx | 4 +- vcl/source/gdi/pdfwriter_impl.hxx | 92 +++++++++++++++++++-------------------- 2 files changed, 48 insertions(+), 48 deletions(-) (limited to 'vcl') diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 3f1a3aaadb7f..372d5e2c15d7 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -5421,9 +5421,9 @@ struct AnnotSortContainer struct AnnotSorterLess { - std::vector< PDFWriterImpl::PDFWidget >& m_rWidgets; + std::vector& m_rWidgets; - explicit AnnotSorterLess( std::vector< PDFWriterImpl::PDFWidget >& rWidgets ) : m_rWidgets( rWidgets ) {} + explicit AnnotSorterLess( std::vector& rWidgets ) : m_rWidgets( rWidgets ) {} bool operator()( const AnnotationSortEntry& rLeft, const AnnotationSortEntry& rRight ) { diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx index c2145aa8c2de..9c4a527aa5ab 100644 --- a/vcl/source/gdi/pdfwriter_impl.hxx +++ b/vcl/source/gdi/pdfwriter_impl.hxx @@ -410,6 +410,52 @@ struct PDFScreen : public PDFAnnotation } }; +struct PDFWidget : public PDFAnnotation +{ + typedef std::unordered_map PDFAppearanceStreams; + + PDFWriter::WidgetType m_eType; + OString m_aName; + OUString m_aDescription; + OUString m_aText; + DrawTextFlags m_nTextStyle; + OUString m_aValue; + OString m_aDAString; + OString m_aDRDict; + OString m_aMKDict; + OString m_aMKDictCAString; // i12626, added to be able to encrypt the /CA text string + // since the object number is not known at the moment + // of filling m_aMKDict, the string will be encrypted when emitted. + // the /CA string MUST BE the last added to m_aMKDict + // see code for details + sal_Int32 m_nFlags; + sal_Int32 m_nParent; // if not 0, parent's object number + std::vector m_aKids; // widget children, contains object numbers + std::vector m_aKidsIndex; // widget children, contains index to m_aWidgets + OUString m_aOnValue; + sal_Int32 m_nTabOrder; // lowest number gets first in tab order + sal_Int32 m_nRadioGroup; + sal_Int32 m_nMaxLen; + bool m_bSubmit; + bool m_bSubmitGet; + sal_Int32 m_nDest; + std::vector m_aListEntries; + std::vector m_aSelectedEntries; + std::unordered_map m_aAppearances; + PDFWidget() + : m_eType( PDFWriter::PushButton ), + m_nTextStyle( DrawTextFlags::NONE ), + m_nFlags( 0 ), + m_nParent( 0 ), + m_nTabOrder( 0 ), + m_nRadioGroup( -1 ), + m_nMaxLen( 0 ), + m_bSubmit( false ), + m_bSubmitGet( false ), + m_nDest( -1 ) + {} +}; + } class PDFWriterImpl : public VirtualDevice @@ -419,52 +465,6 @@ class PDFWriterImpl : public VirtualDevice public: friend struct vcl::pdf::PDFPage; - struct PDFWidget : public PDFAnnotation - { - typedef std::unordered_map PDFAppearanceStreams; - - PDFWriter::WidgetType m_eType; - OString m_aName; - OUString m_aDescription; - OUString m_aText; - DrawTextFlags m_nTextStyle; - OUString m_aValue; - OString m_aDAString; - OString m_aDRDict; - OString m_aMKDict; - OString m_aMKDictCAString; // i12626, added to be able to encrypt the /CA text string - // since the object number is not known at the moment - // of filling m_aMKDict, the string will be encrypted when emitted. - // the /CA string MUST BE the last added to m_aMKDict - // see code for details - sal_Int32 m_nFlags; - sal_Int32 m_nParent; // if not 0, parent's object number - std::vector m_aKids; // widget children, contains object numbers - std::vector m_aKidsIndex; // widget children, contains index to m_aWidgets - OUString m_aOnValue; - sal_Int32 m_nTabOrder; // lowest number gets first in tab order - sal_Int32 m_nRadioGroup; - sal_Int32 m_nMaxLen; - bool m_bSubmit; - bool m_bSubmitGet; - sal_Int32 m_nDest; - std::vector m_aListEntries; - std::vector m_aSelectedEntries; - std::unordered_map m_aAppearances; - PDFWidget() - : m_eType( PDFWriter::PushButton ), - m_nTextStyle( DrawTextFlags::NONE ), - m_nFlags( 0 ), - m_nParent( 0 ), - m_nTabOrder( 0 ), - m_nRadioGroup( -1 ), - m_nMaxLen( 0 ), - m_bSubmit( false ), - m_bSubmitGet( false ), - m_nDest( -1 ) - {} - }; - struct PDFStructureAttribute { PDFWriter::StructAttributeValue eValue; -- cgit v1.2.3