Simplify Sequences initializations (writerfilter/writerperfect/x*)
Change-Id: I1bd31fe6cf0f8aaf4f2cfe1d3d49e61a0633f361 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117057 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
This commit is contained in:
parent
92889bc98f
commit
57796f2724
@ -777,8 +777,7 @@ void SettingsTable::ApplyProperties(uno::Reference<text::XTextDocument> const& x
|
|||||||
{
|
{
|
||||||
// use dummy protection key to forbid disabling of Record changes without a notice
|
// use dummy protection key to forbid disabling of Record changes without a notice
|
||||||
// (extending the recent GrabBag support) TODO support password verification...
|
// (extending the recent GrabBag support) TODO support password verification...
|
||||||
css::uno::Sequence<sal_Int8> aDummyKey(1);
|
css::uno::Sequence<sal_Int8> aDummyKey { 1 };
|
||||||
aDummyKey[0] = 1;
|
|
||||||
xDocProps->setPropertyValue("RedlineProtectionKey", uno::makeAny( aDummyKey ));
|
xDocProps->setPropertyValue("RedlineProtectionKey", uno::makeAny( aDummyKey ));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -776,14 +776,11 @@ bool WPXSvInputStreamImpl::isZip()
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Sequence<Any> aArgs(1);
|
|
||||||
aArgs[0] <<= mxStream;
|
|
||||||
|
|
||||||
const Reference<XComponentContext> xContext(comphelper::getProcessComponentContext(),
|
const Reference<XComponentContext> xContext(comphelper::getProcessComponentContext(),
|
||||||
UNO_SET_THROW);
|
UNO_SET_THROW);
|
||||||
const Reference<packages::zip::XZipFileAccess2> xZip(
|
const Reference<packages::zip::XZipFileAccess2> xZip(
|
||||||
xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
|
xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
|
||||||
"com.sun.star.packages.zip.ZipFileAccess", aArgs, xContext),
|
"com.sun.star.packages.zip.ZipFileAccess", { Any(mxStream) }, xContext),
|
||||||
UNO_QUERY_THROW);
|
UNO_QUERY_THROW);
|
||||||
mpZipStorage.reset(new ZipStorageImpl(xZip));
|
mpZipStorage.reset(new ZipStorageImpl(xZip));
|
||||||
}
|
}
|
||||||
|
@ -392,16 +392,11 @@ private:
|
|||||||
uno::Reference< beans::XPropertySetInfo > SAL_CALL
|
uno::Reference< beans::XPropertySetInfo > SAL_CALL
|
||||||
ResultSetBase::getPropertySetInfo()
|
ResultSetBase::getPropertySetInfo()
|
||||||
{
|
{
|
||||||
uno::Sequence< beans::Property > seq(2);
|
uno::Sequence< beans::Property > seq
|
||||||
seq[0].Name = "RowCount";
|
{
|
||||||
seq[0].Handle = -1;
|
{ "RowCount", -1, cppu::UnoType<sal_Int32>::get(), beans::PropertyAttribute::READONLY },
|
||||||
seq[0].Type = cppu::UnoType<sal_Int32>::get();
|
{ "IsRowCountFinal", -1, cppu::UnoType<sal_Bool>::get(), beans::PropertyAttribute::READONLY }
|
||||||
seq[0].Attributes = beans::PropertyAttribute::READONLY;
|
};
|
||||||
|
|
||||||
seq[1].Name = "IsRowCountFinal";
|
|
||||||
seq[1].Handle = -1;
|
|
||||||
seq[1].Type = cppu::UnoType<sal_Bool>::get();
|
|
||||||
seq[1].Attributes = beans::PropertyAttribute::READONLY;
|
|
||||||
|
|
||||||
//t
|
//t
|
||||||
return uno::Reference< beans::XPropertySetInfo > ( new XPropertySetInfoImpl( seq ) );
|
return uno::Reference< beans::XPropertySetInfo > ( new XPropertySetInfoImpl( seq ) );
|
||||||
|
@ -170,9 +170,7 @@ uno::Reference< beans::XPropertySet > SchXMLSeriesHelper::createOldAPISeriesProp
|
|||||||
Reference< lang::XInitialization > xInit( xRet, uno::UNO_QUERY );
|
Reference< lang::XInitialization > xInit( xRet, uno::UNO_QUERY );
|
||||||
if(xInit.is())
|
if(xInit.is())
|
||||||
{
|
{
|
||||||
Sequence< uno::Any > aArguments(1);
|
xInit->initialize( { uno::Any(xSeries) });
|
||||||
aArguments[0] <<= xSeries;
|
|
||||||
xInit->initialize(aArguments);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -204,10 +202,7 @@ uno::Reference< beans::XPropertySet > SchXMLSeriesHelper::createOldAPIDataPointP
|
|||||||
Reference< lang::XInitialization > xInit( xRet, uno::UNO_QUERY );
|
Reference< lang::XInitialization > xInit( xRet, uno::UNO_QUERY );
|
||||||
if(xInit.is())
|
if(xInit.is())
|
||||||
{
|
{
|
||||||
Sequence< uno::Any > aArguments(2);
|
xInit->initialize({ uno::Any(xSeries), uno::Any(nPointIndex) });
|
||||||
aArguments[0] <<= xSeries;
|
|
||||||
aArguments[1] <<= nPointIndex;
|
|
||||||
xInit->initialize(aArguments);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -176,11 +176,8 @@ void DomBuilderContext::HandleAttributes(
|
|||||||
case XML_NAMESPACE_UNKNOWN:
|
case XML_NAMESPACE_UNKNOWN:
|
||||||
// unknown namespace: illegal input. Raise Warning.
|
// unknown namespace: illegal input. Raise Warning.
|
||||||
{
|
{
|
||||||
Sequence<OUString> aSeq(2);
|
|
||||||
aSeq[0] = rLocalName;
|
|
||||||
aSeq[1] = aValue;
|
|
||||||
GetImport().SetError(
|
GetImport().SetError(
|
||||||
XMLERROR_FLAG_WARNING | XMLERROR_NAMESPACE_TROUBLE, aSeq );
|
XMLERROR_FLAG_WARNING | XMLERROR_NAMESPACE_TROUBLE, { rLocalName, aValue } );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -202,11 +199,8 @@ void DomBuilderContext::HandleAttributes(
|
|||||||
if (!rUnknownAttrib.NamespaceURL.isEmpty())
|
if (!rUnknownAttrib.NamespaceURL.isEmpty())
|
||||||
{
|
{
|
||||||
// unknown namespace: illegal input. Raise Warning.
|
// unknown namespace: illegal input. Raise Warning.
|
||||||
Sequence<OUString> aSeq(2);
|
|
||||||
aSeq[0] = rUnknownAttrib.Name;
|
|
||||||
aSeq[1] = rUnknownAttrib.Value;
|
|
||||||
GetImport().SetError(
|
GetImport().SetError(
|
||||||
XMLERROR_FLAG_WARNING | XMLERROR_NAMESPACE_TROUBLE, aSeq );
|
XMLERROR_FLAG_WARNING | XMLERROR_NAMESPACE_TROUBLE, { rUnknownAttrib.Name, rUnknownAttrib.Value } );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2255,9 +2255,8 @@ void SvXMLExport::IgnorableWhitespace()
|
|||||||
}
|
}
|
||||||
catch (const SAXException& e)
|
catch (const SAXException& e)
|
||||||
{
|
{
|
||||||
Sequence<OUString> aPars(0);
|
|
||||||
SetError( XMLERROR_SAX|XMLERROR_FLAG_ERROR|XMLERROR_FLAG_SEVERE,
|
SetError( XMLERROR_SAX|XMLERROR_FLAG_ERROR|XMLERROR_FLAG_SEVERE,
|
||||||
aPars, e.Message, nullptr );
|
{}, e.Message, nullptr );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -501,8 +501,7 @@ XMLImageMapContext::XMLImageMapContext(
|
|||||||
}
|
}
|
||||||
catch(const css::uno::Exception& e)
|
catch(const css::uno::Exception& e)
|
||||||
{
|
{
|
||||||
uno::Sequence<OUString> aSeq(0);
|
rImport.SetError( XMLERROR_FLAG_WARNING | XMLERROR_API, {}, e.Message, nullptr );
|
||||||
rImport.SetError( XMLERROR_FLAG_WARNING | XMLERROR_API, aSeq, e.Message, nullptr );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -515,8 +515,7 @@ void SdXMLImport::SetViewSettings(const css::uno::Sequence<css::beans::PropertyV
|
|||||||
catch(const css::uno::Exception&)
|
catch(const css::uno::Exception&)
|
||||||
{
|
{
|
||||||
/* #i79978# since old documents may contain invalid view settings, this is nothing to worry the user about.
|
/* #i79978# since old documents may contain invalid view settings, this is nothing to worry the user about.
|
||||||
uno::Sequence<OUString> aSeq(0);
|
SetError( XMLERROR_FLAG_WARNING | XMLERROR_API, {}, e.Message, NULL );
|
||||||
SetError( XMLERROR_FLAG_WARNING | XMLERROR_API, aSeq, e.Message, NULL );
|
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -490,9 +490,7 @@ void SdXMLShapeContext::AddShape(OUString const & serviceName)
|
|||||||
|| serviceName == "com.sun.star.drawing.MediaShape"
|
|| serviceName == "com.sun.star.drawing.MediaShape"
|
||||||
|| serviceName == "com.sun.star.presentation.MediaShape")
|
|| serviceName == "com.sun.star.presentation.MediaShape")
|
||||||
{
|
{
|
||||||
css::uno::Sequence<css::uno::Any> args(1);
|
xShape.set( xServiceFact->createInstanceWithArguments(serviceName, { css::uno::Any(GetImport().GetDocumentBase()) }),
|
||||||
args[0] <<= GetImport().GetDocumentBase();
|
|
||||||
xShape.set( xServiceFact->createInstanceWithArguments(serviceName, args),
|
|
||||||
css::uno::UNO_QUERY);
|
css::uno::UNO_QUERY);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1227,8 +1227,7 @@ void SdXMLStylesContext::ImpSetGraphicStyles( uno::Reference< container::XNameAc
|
|||||||
}
|
}
|
||||||
catch(const Exception& e)
|
catch(const Exception& e)
|
||||||
{
|
{
|
||||||
uno::Sequence<OUString> aSeq(0);
|
const_cast<SdXMLImport*>(&GetSdImport())->SetError( XMLERROR_FLAG_WARNING | XMLERROR_API, {}, e.Message, nullptr );
|
||||||
const_cast<SdXMLImport*>(&GetSdImport())->SetError( XMLERROR_FLAG_WARNING | XMLERROR_API, aSeq, e.Message, nullptr );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1267,8 +1266,7 @@ void SdXMLStylesContext::ImpSetGraphicStyles( uno::Reference< container::XNameAc
|
|||||||
}
|
}
|
||||||
catch( const Exception& e )
|
catch( const Exception& e )
|
||||||
{
|
{
|
||||||
uno::Sequence<OUString> aSeq(0);
|
const_cast<SdXMLImport*>(&GetSdImport())->SetError( XMLERROR_FLAG_WARNING | XMLERROR_API, {}, e.Message, nullptr );
|
||||||
const_cast<SdXMLImport*>(&GetSdImport())->SetError( XMLERROR_FLAG_WARNING | XMLERROR_API, aSeq, e.Message, nullptr );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -129,12 +129,10 @@ lcl_initDocumentProperties(SvXMLImport & rImport,
|
|||||||
uno::Reference<xml::dom::XSAXDocumentBuilder2> const& xDocBuilder,
|
uno::Reference<xml::dom::XSAXDocumentBuilder2> const& xDocBuilder,
|
||||||
uno::Reference<document::XDocumentProperties> const& xDocProps)
|
uno::Reference<document::XDocumentProperties> const& xDocProps)
|
||||||
{
|
{
|
||||||
uno::Sequence< uno::Any > aSeq(1);
|
|
||||||
aSeq[0] <<= xDocBuilder->getDocument();
|
|
||||||
uno::Reference< lang::XInitialization > const xInit(xDocProps,
|
uno::Reference< lang::XInitialization > const xInit(xDocProps,
|
||||||
uno::UNO_QUERY_THROW);
|
uno::UNO_QUERY_THROW);
|
||||||
try {
|
try {
|
||||||
xInit->initialize(aSeq);
|
xInit->initialize({ uno::Any(xDocBuilder->getDocument()) });
|
||||||
rImport.SetStatistics(xDocProps->getDocumentStatistics());
|
rImport.SetStatistics(xDocProps->getDocumentStatistics());
|
||||||
// convert all URLs from relative to absolute
|
// convert all URLs from relative to absolute
|
||||||
xDocProps->setTemplateURL(rImport.GetAbsoluteReference(
|
xDocProps->setTemplateURL(rImport.GetAbsoluteReference(
|
||||||
|
@ -140,13 +140,8 @@ SvXMLImportContext* XMLEventImportHelper::CreateContext(
|
|||||||
{
|
{
|
||||||
pContext = new SvXMLImportContext(rImport);
|
pContext = new SvXMLImportContext(rImport);
|
||||||
|
|
||||||
Sequence<OUString> aMsgParams(2);
|
|
||||||
|
|
||||||
aMsgParams[0] = rXmlEventName;
|
|
||||||
aMsgParams[1] = rLanguage;
|
|
||||||
|
|
||||||
rImport.SetError(XMLERROR_FLAG_ERROR | XMLERROR_ILLEGAL_EVENT,
|
rImport.SetError(XMLERROR_FLAG_ERROR | XMLERROR_ILLEGAL_EVENT,
|
||||||
aMsgParams);
|
{ rXmlEventName, rLanguage });
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -480,15 +480,11 @@ void XMLPropStyleContext::Finish( bool bOverwrite )
|
|||||||
// We can't set the parent style. For a proper
|
// We can't set the parent style. For a proper
|
||||||
// Error-Message, we should pass in the name of the
|
// Error-Message, we should pass in the name of the
|
||||||
// style, as well as the desired parent style.
|
// style, as well as the desired parent style.
|
||||||
Sequence<OUString> aSequence(2);
|
|
||||||
|
|
||||||
// getName() throws no non-Runtime exception:
|
// getName() throws no non-Runtime exception:
|
||||||
aSequence[0] = mxStyle->getName();
|
|
||||||
aSequence[1] = sParent;
|
|
||||||
|
|
||||||
GetImport().SetError(
|
GetImport().SetError(
|
||||||
XMLERROR_FLAG_ERROR | XMLERROR_PARENT_STYLE_NOT_ALLOWED,
|
XMLERROR_FLAG_ERROR | XMLERROR_PARENT_STYLE_NOT_ALLOWED,
|
||||||
aSequence, e.Message, nullptr );
|
{ mxStyle->getName(), sParent }, e.Message, nullptr );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -446,10 +446,12 @@ bool XMLColorPropHdl::importXML( const OUString& rStrImpValue, Any& rValue, cons
|
|||||||
|
|
||||||
sal_Int32 nIndex = 0;
|
sal_Int32 nIndex = 0;
|
||||||
|
|
||||||
Sequence< double > aHSL(3);
|
Sequence< double > aHSL
|
||||||
aHSL[0] = aTmp.getToken( 0, ',', nIndex ).toDouble();
|
{
|
||||||
aHSL[1] = aTmp.getToken( 0, ',', nIndex ).toDouble() / 100.0;
|
aTmp.getToken( 0, ',', nIndex ).toDouble(),
|
||||||
aHSL[2] = aTmp.getToken( 0, ',', nIndex ).toDouble() / 100.0;
|
aTmp.getToken( 0, ',', nIndex ).toDouble() / 100.0,
|
||||||
|
aTmp.getToken( 0, ',', nIndex ).toDouble() / 100.0
|
||||||
|
};
|
||||||
rValue <<= aHSL;
|
rValue <<= aHSL;
|
||||||
bRet = true;
|
bRet = true;
|
||||||
}
|
}
|
||||||
|
@ -93,20 +93,8 @@ void XMLSectionSourceDDEImportContext::startFastElement(sal_Int32 /*nElement*/,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// use multi property set to force single update of connection #83654#
|
// use multi property set to force single update of connection #83654#
|
||||||
Sequence<OUString> aNames(4);
|
Sequence<OUString> aNames { "DDECommandFile", "DDECommandType", "DDECommandElement", "IsAutomaticUpdate" };
|
||||||
Sequence<Any> aValues(4);
|
Sequence<Any> aValues { Any(sApplication), Any(sTopic), Any(sItem), Any(bAutomaticUpdate) };
|
||||||
|
|
||||||
aValues[0] <<= sApplication;
|
|
||||||
aNames[0] = "DDECommandFile";
|
|
||||||
|
|
||||||
aValues[1] <<= sTopic;
|
|
||||||
aNames[1] = "DDECommandType";
|
|
||||||
|
|
||||||
aValues[2] <<= sItem;
|
|
||||||
aNames[2] = "DDECommandElement";
|
|
||||||
|
|
||||||
aValues[3] <<= bAutomaticUpdate;
|
|
||||||
aNames[3] = "IsAutomaticUpdate";
|
|
||||||
|
|
||||||
Reference<XMultiPropertySet> rMultiPropSet(rSectionPropertySet,
|
Reference<XMultiPropertySet> rMultiPropSet(rSectionPropertySet,
|
||||||
UNO_QUERY);
|
UNO_QUERY);
|
||||||
|
@ -924,10 +924,7 @@ bool ImportContext::importDataAwareProperty(
|
|||||||
aArg1.Name = "BoundCell";
|
aArg1.Name = "BoundCell";
|
||||||
aArg1.Value <<= aAddress;
|
aArg1.Value <<= aAddress;
|
||||||
|
|
||||||
uno::Sequence< uno::Any > aArgs(1);
|
uno::Reference< form::binding::XValueBinding > xBinding( xFac->createInstanceWithArguments( "com.sun.star.table.CellValueBinding" , { uno::Any(aArg1) }), uno::UNO_QUERY );
|
||||||
aArgs[ 0 ] <<= aArg1;
|
|
||||||
|
|
||||||
uno::Reference< form::binding::XValueBinding > xBinding( xFac->createInstanceWithArguments( "com.sun.star.table.CellValueBinding" , aArgs ), uno::UNO_QUERY );
|
|
||||||
xBindable->setValueBinding( xBinding );
|
xBindable->setValueBinding( xBinding );
|
||||||
bRes = true;
|
bRes = true;
|
||||||
}
|
}
|
||||||
@ -946,10 +943,7 @@ bool ImportContext::importDataAwareProperty(
|
|||||||
aArg1.Name = "CellRange";
|
aArg1.Name = "CellRange";
|
||||||
aArg1.Value <<= aAddress;
|
aArg1.Value <<= aAddress;
|
||||||
|
|
||||||
uno::Sequence< uno::Any > aArgs(1);
|
uno::Reference< form::binding::XListEntrySource > xSource( xFac->createInstanceWithArguments( "com.sun.star.table.CellRangeListSource" , { uno::Any(aArg1) } ), uno::UNO_QUERY );
|
||||||
aArgs[ 0 ] <<= aArg1;
|
|
||||||
|
|
||||||
uno::Reference< form::binding::XListEntrySource > xSource( xFac->createInstanceWithArguments( "com.sun.star.table.CellRangeListSource" , aArgs ), uno::UNO_QUERY );
|
|
||||||
xListEntrySink->setListEntrySource( xSource );
|
xListEntrySink->setListEntrySource( xSource );
|
||||||
bRes = true;
|
bRes = true;
|
||||||
}
|
}
|
||||||
|
@ -480,7 +480,7 @@ DocumentDigitalSignatures::ImplVerifySignatures(
|
|||||||
SAL_WARN_IF(!bInit, "xmlsecurity.comp", "Error initializing security context!");
|
SAL_WARN_IF(!bInit, "xmlsecurity.comp", "Error initializing security context!");
|
||||||
|
|
||||||
if (!bInit)
|
if (!bInit)
|
||||||
return uno::Sequence<security::DocumentSignatureInformation>(0);
|
return {};
|
||||||
|
|
||||||
if (!rxStorage.is())
|
if (!rxStorage.is())
|
||||||
{
|
{
|
||||||
@ -507,7 +507,7 @@ DocumentDigitalSignatures::ImplVerifySignatures(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!xInputStream.is() && aStreamHelper.nStorageFormat != embed::StorageFormats::OFOPXML)
|
if (!xInputStream.is() && aStreamHelper.nStorageFormat != embed::StorageFormats::OFOPXML)
|
||||||
return Sequence< css::security::DocumentSignatureInformation >(0);
|
return {};
|
||||||
|
|
||||||
|
|
||||||
XMLSignatureHelper& rSignatureHelper = aSignatureManager.getSignatureHelper();
|
XMLSignatureHelper& rSignatureHelper = aSignatureManager.getSignatureHelper();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user