reportdesign: Don't pass around empty Sequence

`aProps`, used for the `rMediaDesc` param is an empty Sequence
in all cases, so drop the param and create the empty Sequence
where it's needed instead of passing it around.

Change-Id: I3c66a11ae5d1902faed39906f696d8bf5ab06eef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186038
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This commit is contained in:
Michael Weghorn
2025-05-30 15:20:47 +02:00
parent a76c597187
commit de2cf78b78
2 changed files with 9 additions and 16 deletions
+1 -4
View File
@@ -135,8 +135,6 @@ namespace reportdesign
const OUString& rServiceName, /// service name of the component
/// the argument (XInitialization)
const css::uno::Sequence< css::uno::Any> & rArguments,
/// output descriptor
const css::uno::Sequence< css::beans::PropertyValue> & rMediaDesc,
const css::uno::Reference< css::embed::XStorage >& _xStorageToSaveTo);
/// write a single output stream
@@ -145,8 +143,7 @@ namespace reportdesign
const css::uno::Reference< css::io::XOutputStream> & xOutputStream,
const css::uno::Reference< css::lang::XComponent> & xComponent,
const OUString& rServiceName,
const css::uno::Sequence< css::uno::Any> & rArguments,
const css::uno::Sequence< css::beans::PropertyValue> & rMediaDesc);
const css::uno::Sequence< css::uno::Any> & rArguments);
void notifyEvent(const OUString& _sEventName);
void init();
@@ -1293,9 +1293,6 @@ void SAL_CALL OReportDefinition::storeToStorage( const uno::Reference< embed::XS
bool AutoSaveEvent = false;
aDescriptor[utl::MediaDescriptor::PROP_AUTOSAVEEVENT] >>= AutoSaveEvent;
// properties
uno::Sequence < beans::PropertyValue > aProps;
// export sub streams for package, else full stream into a file
uno::Reference< beans::XPropertySet> xProp(_xStorageToSaveTo,uno::UNO_QUERY);
if ( xProp.is() )
@@ -1347,19 +1344,19 @@ void SAL_CALL OReportDefinition::storeToStorage( const uno::Reference< embed::XS
// write to content.xml (keeping logic of commit 94ccba3eebc83b58e74e18f0e028c6a995ce6aa6)
xInfoSet->setPropertyValue(u"StreamName"_ustr, uno::Any(u"settings.xml"_ustr));
WriteThroughComponent(xCom, u"settings.xml"_ustr, u"com.sun.star.comp.report.XMLSettingsExporter"_ustr,
aDelegatorArguments, aProps, _xStorageToSaveTo);
aDelegatorArguments, _xStorageToSaveTo);
xInfoSet->setPropertyValue(u"StreamName"_ustr, uno::Any(u"meta.xml"_ustr));
WriteThroughComponent(xCom, u"meta.xml"_ustr, u"com.sun.star.comp.report.XMLMetaExporter"_ustr,
aDelegatorArguments, aProps, _xStorageToSaveTo);
aDelegatorArguments, _xStorageToSaveTo);
xInfoSet->setPropertyValue(u"StreamName"_ustr, uno::Any(u"styles.xml"_ustr));
WriteThroughComponent(xCom, u"styles.xml"_ustr, u"com.sun.star.comp.report.XMLStylesExporter"_ustr,
aDelegatorArguments, aProps, _xStorageToSaveTo);
aDelegatorArguments, _xStorageToSaveTo);
xInfoSet->setPropertyValue(u"StreamName"_ustr, uno::Any(u"content.xml"_ustr));
bool bOk = WriteThroughComponent(xCom, u"content.xml"_ustr, u"com.sun.star.comp.report.ExportFilter"_ustr,
aDelegatorArguments, aProps, _xStorageToSaveTo);
aDelegatorArguments, _xStorageToSaveTo);
uno::Any aImage;
uno::Reference< embed::XVisualObject > xCurrentController(getCurrentController(),uno::UNO_QUERY);
@@ -1451,7 +1448,6 @@ bool OReportDefinition::WriteThroughComponent(
const OUString& rStreamName,
const OUString& rServiceName,
const uno::Sequence<uno::Any> & rArguments,
const uno::Sequence<beans::PropertyValue> & rMediaDesc,
const uno::Reference<embed::XStorage>& _xStorageToSaveTo)
{
// open stream
@@ -1484,7 +1480,7 @@ bool OReportDefinition::WriteThroughComponent(
// write the stuff
bool bRet = WriteThroughComponent(
xOutputStream, xComponent,
rServiceName, rArguments, rMediaDesc);
rServiceName, rArguments);
// finally, commit stream.
return bRet;
}
@@ -1493,8 +1489,7 @@ bool OReportDefinition::WriteThroughComponent(
const uno::Reference<io::XOutputStream> & xOutputStream,
const uno::Reference<lang::XComponent> & xComponent,
const OUString& rServiceName,
const uno::Sequence<uno::Any> & rArguments,
const uno::Sequence<beans::PropertyValue> & rMediaDesc)
const uno::Sequence<uno::Any> & rArguments)
{
OSL_ENSURE( xOutputStream.is(), "I really need an output stream!" );
OSL_ENSURE( xComponent.is(), "Need component!" );
@@ -1525,8 +1520,9 @@ bool OReportDefinition::WriteThroughComponent(
xExporter->setSourceDocument( xComponent );
// filter!
uno::Sequence<beans::PropertyValue> aMediaDesc;
uno::Reference<document::XFilter> xFilter( xExporter, uno::UNO_QUERY );
return xFilter->filter( rMediaDesc );
return xFilter->filter(aMediaDesc);
}
// XLoadable