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)
{
Descriptor.realloc(nLength + 1);
Descriptor[location].Name = "TypeName";
Descriptor.getArray()[location].Name = "TypeName";
}
Descriptor[location].Value <<= sTypeName;
Descriptor.getArray()[location].Value <<= sTypeName;
}
return sTypeName;

View File

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

View File

@ -170,19 +170,20 @@ KeynoteImportFilter::detect(css::uno::Sequence<css::beans::PropertyValue>& 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<css::beans::PropertyValue>& 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<css::beans::PropertyValue>& 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;
}

View File

@ -197,10 +197,10 @@ WordPerfectImportFilter::detect(css::uno::Sequence<css::beans::PropertyValue>& 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;