From 34d0dd41e1e7bb69d6c4f817b39da26bcd33831f Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Fri, 29 Oct 2021 10:27:18 +0300 Subject: Prepare for removal of non-const operator[] from Sequence in writerperfect Change-Id: Ifaa868e8e68be474c1e8b961b325ce2a7382650e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124414 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- writerperfect/source/impress/KeynoteImportFilter.cxx | 17 +++++++++-------- writerperfect/source/writer/WordPerfectImportFilter.cxx | 4 ++-- 2 files changed, 11 insertions(+), 10 deletions(-) (limited to 'writerperfect/source') diff --git a/writerperfect/source/impress/KeynoteImportFilter.cxx b/writerperfect/source/impress/KeynoteImportFilter.cxx index 900555be6e0b..ccd93e3d2aaa 100644 --- a/writerperfect/source/impress/KeynoteImportFilter.cxx +++ b/writerperfect/source/impress/KeynoteImportFilter.cxx @@ -170,19 +170,20 @@ KeynoteImportFilter::detect(css::uno::Sequence& Descr if (nNewLength > nLength) Descriptor.realloc(nNewLength); + auto pDescriptor = Descriptor.getArray(); if (nTypeNameLocation == -1) { assert(nLength < nNewLength); nTypeNameLocation = nLength++; - Descriptor[nTypeNameLocation].Name = "TypeName"; + pDescriptor[nTypeNameLocation].Name = "TypeName"; } if (bIsPackage && (nComponentDataLocation == -1)) { assert(nLength < nNewLength); nComponentDataLocation = nLength++; - Descriptor[nComponentDataLocation].Name = "ComponentData"; + pDescriptor[nComponentDataLocation].Name = "ComponentData"; } if (bIsPackage) @@ -194,8 +195,8 @@ KeynoteImportFilter::detect(css::uno::Sequence& Descr beans::NamedValue aValue; aValue.Name = "IsPackage"; aValue.Value <<= true; - lComponentDataNV[nCDSize] = aValue; - Descriptor[nComponentDataLocation].Value <<= lComponentDataNV; + lComponentDataNV.getArray()[nCDSize] = aValue; + pDescriptor[nComponentDataLocation].Value <<= lComponentDataNV; } else { @@ -206,16 +207,16 @@ KeynoteImportFilter::detect(css::uno::Sequence& Descr aProp.Value <<= true; aProp.Handle = -1; aProp.State = beans::PropertyState_DIRECT_VALUE; - lComponentDataPV[nCDSize] = aProp; - Descriptor[nComponentDataLocation].Value <<= lComponentDataPV; + lComponentDataPV.getArray()[nCDSize] = aProp; + pDescriptor[nComponentDataLocation].Value <<= lComponentDataPV; } } if (bUCBContentChanged) - Descriptor[nUCBContentLocation].Value <<= xContent; + pDescriptor[nUCBContentLocation].Value <<= xContent; const OUString sTypeName("impress_AppleKeynote"); - Descriptor[nTypeNameLocation].Value <<= sTypeName; + pDescriptor[nTypeNameLocation].Value <<= sTypeName; return sTypeName; } diff --git a/writerperfect/source/writer/WordPerfectImportFilter.cxx b/writerperfect/source/writer/WordPerfectImportFilter.cxx index 8779fb618d19..46e3241ee5eb 100644 --- a/writerperfect/source/writer/WordPerfectImportFilter.cxx +++ b/writerperfect/source/writer/WordPerfectImportFilter.cxx @@ -197,10 +197,10 @@ WordPerfectImportFilter::detect(css::uno::Sequence& D if (location == nLength) { Descriptor.realloc(nLength + 1); - Descriptor[location].Name = "TypeName"; + Descriptor.getArray()[location].Name = "TypeName"; } - Descriptor[location].Value <<= sTypeName; + Descriptor.getArray()[location].Value <<= sTypeName; } return sTypeName; -- cgit