diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2023-03-31 22:05:24 +0200 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2023-03-31 23:06:59 +0200 |
commit | d408e940630d131ab886a1d4619671fa0299c03e (patch) | |
tree | 8dc3b3db90f1615e1a495ad599aa58000b8b70fe /writerperfect | |
parent | d893a40c81357a25a4a89a62f6cf6122046068d5 (diff) |
Simplify a bit
Change-Id: I56de67a7860263d40b4352e93927dfdb107eb4bb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149875
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'writerperfect')
-rw-r--r-- | writerperfect/source/writer/WordPerfectImportFilter.cxx | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/writerperfect/source/writer/WordPerfectImportFilter.cxx b/writerperfect/source/writer/WordPerfectImportFilter.cxx index 46e3241ee5eb..518c5556bb13 100644 --- a/writerperfect/source/writer/WordPerfectImportFilter.cxx +++ b/writerperfect/source/writer/WordPerfectImportFilter.cxx @@ -167,18 +167,15 @@ WordPerfectImportFilter::setTargetDocument(const Reference<css::lang::XComponent OUString SAL_CALL WordPerfectImportFilter::detect(css::uno::Sequence<css::beans::PropertyValue>& Descriptor) { - libwpd::WPDConfidence confidence = libwpd::WPD_CONFIDENCE_NONE; - OUString sTypeName; sal_Int32 nLength = Descriptor.getLength(); sal_Int32 location = nLength; - const css::beans::PropertyValue* pValue = Descriptor.getConstArray(); Reference<XInputStream> xInputStream; for (sal_Int32 i = 0; i < nLength; i++) { - if (pValue[i].Name == "TypeName") + if (Descriptor[i].Name == "TypeName") location = i; - else if (pValue[i].Name == "InputStream") - pValue[i].Value >>= xInputStream; + else if (Descriptor[i].Name == "InputStream") + Descriptor[i].Value >>= xInputStream; } if (!xInputStream.is()) @@ -186,13 +183,10 @@ WordPerfectImportFilter::detect(css::uno::Sequence<css::beans::PropertyValue>& D WPXSvInputStream input(xInputStream); - confidence = libwpd::WPDocument::isFileFormatSupported(&input); - + OUString sTypeName; + libwpd::WPDConfidence confidence = libwpd::WPDocument::isFileFormatSupported(&input); if (confidence == libwpd::WPD_CONFIDENCE_EXCELLENT || confidence == libwpd::WPD_CONFIDENCE_SUPPORTED_ENCRYPTION) - sTypeName = "writer_WordPerfect_Document"; - - if (!sTypeName.isEmpty()) { if (location == nLength) { @@ -200,6 +194,7 @@ WordPerfectImportFilter::detect(css::uno::Sequence<css::beans::PropertyValue>& D Descriptor.getArray()[location].Name = "TypeName"; } + sTypeName = "writer_WordPerfect_Document"; Descriptor.getArray()[location].Value <<= sTypeName; } |