diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-10-26 20:56:36 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-10-27 06:37:01 +0000 |
commit | 729c2cd35133eeef78ff0fed063094088809b211 (patch) | |
tree | 8711c69facfe5882b5324f3e1be633df546d6450 /filter/source | |
parent | 7507bffd471c5e3c8d31f2ce350208aa3992e4a7 (diff) |
filter: use comphelper::containerToSequence() in ImpPDFTabDialog
Change-Id: I9c6523d96e06901751d392bd76e7aa8717784697
Reviewed-on: https://gerrit.libreoffice.org/30307
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'filter/source')
-rw-r--r-- | filter/source/pdf/impdialog.cxx | 78 |
1 files changed, 17 insertions, 61 deletions
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx index 65657b1bd5b5..52bae8de8f12 100644 --- a/filter/source/pdf/impdialog.cxx +++ b/filter/source/pdf/impdialog.cxx @@ -28,6 +28,8 @@ #include "sfx2/passwd.hxx" #include "svtools/miscopt.hxx" +#include "comphelper/propertyvalue.hxx" +#include "comphelper/sequence.hxx" #include "comphelper/storagehelper.hxx" #include "com/sun/star/text/XTextRange.hpp" @@ -449,72 +451,26 @@ Sequence< PropertyValue > ImpPDFTabDialog::GetFilterData() maConfigItem.WriteBool( "EnableCopyingOfContent", mbCanCopyOrExtract ); maConfigItem.WriteBool( "EnableTextAccessForAccessibilityTools", mbCanExtractForAccessibility ); - Sequence< PropertyValue > aRet( maConfigItem.GetFilterData() ); - - // FIXME: OMG, this is horrible coding style... - int nElementAdded = 12; - - aRet.realloc( aRet.getLength() + nElementAdded ); - - sal_uInt32 const nLength(aRet.getLength()); - aRet[ nLength - nElementAdded ].Name = "Watermark"; - aRet[ nLength - nElementAdded ].Value <<= maWatermarkText; - nElementAdded--; - - aRet[ nLength - nElementAdded ].Name = "EncryptFile"; - aRet[ nLength - nElementAdded ].Value <<= mbEncrypt; - nElementAdded--; - - aRet[ nLength - nElementAdded ].Name = "PreparedPasswords"; - aRet[ nLength - nElementAdded ].Value <<= mxPreparedPasswords; - nElementAdded--; - - aRet[ nLength - nElementAdded ].Name = "RestrictPermissions"; - aRet[ nLength - nElementAdded ].Value <<= mbRestrictPermissions; - nElementAdded--; - - aRet[ nLength - nElementAdded ].Name = "PreparedPermissionPassword"; - aRet[ nLength - nElementAdded ].Value <<= maPreparedOwnerPassword; - nElementAdded--; + std::vector<beans::PropertyValue> aRet; + aRet.push_back(comphelper::makePropertyValue("Watermark", maWatermarkText)); + aRet.push_back(comphelper::makePropertyValue("EncryptFile", mbEncrypt)); + aRet.push_back(comphelper::makePropertyValue("PreparedPasswords", mxPreparedPasswords)); + aRet.push_back(comphelper::makePropertyValue("RestrictPermissions", mbRestrictPermissions)); + aRet.push_back(comphelper::makePropertyValue("PreparedPermissionPassword", maPreparedOwnerPassword)); if( mbIsRangeChecked ) - { - aRet[ nLength - nElementAdded ].Name = "PageRange"; - aRet[ nLength - nElementAdded ].Value <<= msPageRange; - nElementAdded--; - } + aRet.push_back(comphelper::makePropertyValue("PageRange", msPageRange)); else if( mbSelectionIsChecked ) - { - aRet[ nLength - nElementAdded ].Name = "Selection"; - aRet[ nLength - nElementAdded ].Value = maSelection; - nElementAdded--; - } - - aRet[ nLength - nElementAdded ].Name = "SignatureLocation"; - aRet[ nLength - nElementAdded ].Value <<= msSignLocation; - nElementAdded--; - - aRet[ nLength - nElementAdded ].Name = "SignatureReason"; - aRet[ nLength - nElementAdded ].Value <<= msSignReason; - nElementAdded--; - - aRet[ nLength - nElementAdded ].Name = "SignatureContactInfo"; - aRet[ nLength - nElementAdded ].Value <<= msSignContact; - nElementAdded--; - - aRet[ nLength - nElementAdded ].Name = "SignaturePassword"; - aRet[ nLength - nElementAdded ].Value <<= msSignPassword; - nElementAdded--; - - aRet[ nLength - nElementAdded ].Name = "SignatureCertificate"; - aRet[ nLength - nElementAdded ].Value <<= maSignCertificate; - nElementAdded--; + aRet.push_back(comphelper::makePropertyValue("Selection", maSelection)); - aRet[ nLength - nElementAdded ].Name = "SignatureTSA"; - aRet[ nLength - nElementAdded ].Value <<= msSignTSA; - nElementAdded--; + aRet.push_back(comphelper::makePropertyValue("SignatureLocation", msSignLocation)); + aRet.push_back(comphelper::makePropertyValue("SignatureReason", msSignReason)); + aRet.push_back(comphelper::makePropertyValue("SignatureContactInfo", msSignContact)); + aRet.push_back(comphelper::makePropertyValue("SignaturePassword", msSignPassword)); + aRet.push_back(comphelper::makePropertyValue("SignatureCertificate", maSignCertificate)); + aRet.push_back(comphelper::makePropertyValue("SignatureTSA", msSignTSA)); - return aRet; + return comphelper::concatSequences(maConfigItem.GetFilterData(), comphelper::containerToSequence(aRet)); } |