From d408e940630d131ab886a1d4619671fa0299c03e Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Fri, 31 Mar 2023 22:05:24 +0200 Subject: Simplify a bit Change-Id: I56de67a7860263d40b4352e93927dfdb107eb4bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149875 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- writerperfect/source/writer/WordPerfectImportFilter.cxx | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'writerperfect') 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& 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; 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& 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& D Descriptor.getArray()[location].Name = "TypeName"; } + sTypeName = "writer_WordPerfect_Document"; Descriptor.getArray()[location].Value <<= sTypeName; } -- cgit