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 <mike.kaganski@collabora.com>
This commit is contained in:
Mike Kaganski
2021-10-29 10:27:18 +03:00
parent 2b9bd1031c
commit 34d0dd41e1
4 changed files with 23 additions and 21 deletions

View File

@@ -139,10 +139,10 @@ public:
if (location == nLength) if (location == nLength)
{ {
Descriptor.realloc(nLength + 1); Descriptor.realloc(nLength + 1);
Descriptor[location].Name = "TypeName"; Descriptor.getArray()[location].Name = "TypeName";
} }
Descriptor[location].Value <<= sTypeName; Descriptor.getArray()[location].Value <<= sTypeName;
} }
return sTypeName; return sTypeName;

View File

@@ -123,21 +123,22 @@ bool WpftLoader::impl_load()
xImporter->setTargetDocument(m_xDoc); xImporter->setTargetDocument(m_xDoc);
uno::Sequence<beans::PropertyValue> aDescriptor(3); uno::Sequence<beans::PropertyValue> aDescriptor(3);
aDescriptor[0].Name = "URL"; auto pDescriptor = aDescriptor.getArray();
aDescriptor[0].Value <<= m_aURL; pDescriptor[0].Name = "URL";
pDescriptor[0].Value <<= m_aURL;
if (m_xInputStream.is()) if (m_xInputStream.is())
{ {
aDescriptor[1].Name = "InputStream"; pDescriptor[1].Name = "InputStream";
aDescriptor[1].Value <<= m_xInputStream; pDescriptor[1].Value <<= m_xInputStream;
} }
else else
{ {
ucbhelper::Content aContent(m_aURL, uno::Reference<ucb::XCommandEnvironment>(), ucbhelper::Content aContent(m_aURL, uno::Reference<ucb::XCommandEnvironment>(),
m_xContext); m_xContext);
aDescriptor[1].Name = "InputStream"; pDescriptor[1].Name = "InputStream";
aDescriptor[1].Value <<= aContent.openStream(); pDescriptor[1].Value <<= aContent.openStream();
aDescriptor[2].Name = "UCBContent"; pDescriptor[2].Name = "UCBContent";
aDescriptor[2].Value <<= aContent.get(); pDescriptor[2].Value <<= aContent.get();
} }
const uno::Reference<document::XExtendedFilterDetection> xDetector(m_xFilter, const uno::Reference<document::XExtendedFilterDetection> xDetector(m_xFilter,
@@ -194,7 +195,7 @@ void WpftLoader::impl_detectFilterName(uno::Sequence<beans::PropertyValue>& rDes
{ {
const sal_Int32 nDescriptorLen = rDescriptor.getLength(); const sal_Int32 nDescriptorLen = rDescriptor.getLength();
rDescriptor.realloc(nDescriptorLen + 1); rDescriptor.realloc(nDescriptorLen + 1);
auto& el = rDescriptor[nDescriptorLen]; auto& el = rDescriptor.getArray()[nDescriptorLen];
el.Name = "FilterName"; el.Name = "FilterName";
el.Value <<= aFilterName; el.Value <<= aFilterName;
return; return;

View File

@@ -170,19 +170,20 @@ KeynoteImportFilter::detect(css::uno::Sequence<css::beans::PropertyValue>& Descr
if (nNewLength > nLength) if (nNewLength > nLength)
Descriptor.realloc(nNewLength); Descriptor.realloc(nNewLength);
auto pDescriptor = Descriptor.getArray();
if (nTypeNameLocation == -1) if (nTypeNameLocation == -1)
{ {
assert(nLength < nNewLength); assert(nLength < nNewLength);
nTypeNameLocation = nLength++; nTypeNameLocation = nLength++;
Descriptor[nTypeNameLocation].Name = "TypeName"; pDescriptor[nTypeNameLocation].Name = "TypeName";
} }
if (bIsPackage && (nComponentDataLocation == -1)) if (bIsPackage && (nComponentDataLocation == -1))
{ {
assert(nLength < nNewLength); assert(nLength < nNewLength);
nComponentDataLocation = nLength++; nComponentDataLocation = nLength++;
Descriptor[nComponentDataLocation].Name = "ComponentData"; pDescriptor[nComponentDataLocation].Name = "ComponentData";
} }
if (bIsPackage) if (bIsPackage)
@@ -194,8 +195,8 @@ KeynoteImportFilter::detect(css::uno::Sequence<css::beans::PropertyValue>& Descr
beans::NamedValue aValue; beans::NamedValue aValue;
aValue.Name = "IsPackage"; aValue.Name = "IsPackage";
aValue.Value <<= true; aValue.Value <<= true;
lComponentDataNV[nCDSize] = aValue; lComponentDataNV.getArray()[nCDSize] = aValue;
Descriptor[nComponentDataLocation].Value <<= lComponentDataNV; pDescriptor[nComponentDataLocation].Value <<= lComponentDataNV;
} }
else else
{ {
@@ -206,16 +207,16 @@ KeynoteImportFilter::detect(css::uno::Sequence<css::beans::PropertyValue>& Descr
aProp.Value <<= true; aProp.Value <<= true;
aProp.Handle = -1; aProp.Handle = -1;
aProp.State = beans::PropertyState_DIRECT_VALUE; aProp.State = beans::PropertyState_DIRECT_VALUE;
lComponentDataPV[nCDSize] = aProp; lComponentDataPV.getArray()[nCDSize] = aProp;
Descriptor[nComponentDataLocation].Value <<= lComponentDataPV; pDescriptor[nComponentDataLocation].Value <<= lComponentDataPV;
} }
} }
if (bUCBContentChanged) if (bUCBContentChanged)
Descriptor[nUCBContentLocation].Value <<= xContent; pDescriptor[nUCBContentLocation].Value <<= xContent;
const OUString sTypeName("impress_AppleKeynote"); const OUString sTypeName("impress_AppleKeynote");
Descriptor[nTypeNameLocation].Value <<= sTypeName; pDescriptor[nTypeNameLocation].Value <<= sTypeName;
return sTypeName; return sTypeName;
} }

View File

@@ -197,10 +197,10 @@ WordPerfectImportFilter::detect(css::uno::Sequence<css::beans::PropertyValue>& D
if (location == nLength) if (location == nLength)
{ {
Descriptor.realloc(nLength + 1); Descriptor.realloc(nLength + 1);
Descriptor[location].Name = "TypeName"; Descriptor.getArray()[location].Name = "TypeName";
} }
Descriptor[location].Value <<= sTypeName; Descriptor.getArray()[location].Value <<= sTypeName;
} }
return sTypeName; return sTypeName;