reportdesign: Merge the 2 OReportDefinition::WriteThroughComponent

Change-Id: I9d51aaadb841f71df8451aff379a370eb196d708
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187909
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
This commit is contained in:
Michael Weghorn
2025-07-16 07:47:15 +02:00
parent 3d80b47851
commit 4ae7bf9a4f
2 changed files with 3 additions and 28 deletions
-8
View File
@@ -137,14 +137,6 @@ namespace reportdesign
const css::uno::Sequence< css::uno::Any> & rArguments,
const css::uno::Reference< css::embed::XStorage >& _xStorageToSaveTo);
/// write a single output stream
/// (to be called either directly or by WriteThroughComponent(...))
bool WriteThroughComponent(
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);
void notifyEvent(const OUString& _sEventName);
void init();
void fillArgs(utl::MediaDescriptor& _aDescriptor);
@@ -1449,6 +1449,8 @@ bool OReportDefinition::WriteThroughComponent(
const uno::Sequence<uno::Any> & rArguments,
const uno::Reference<embed::XStorage>& _xStorageToSaveTo)
{
OSL_ENSURE( xComponent.is(), "Need component!" );
// open stream
uno::Reference<io::XStream> xStream = _xStorageToSaveTo->openStreamElement(rStreamName,
embed::ElementModes::READWRITE | embed::ElementModes::TRUNCATE);
@@ -1474,25 +1476,6 @@ bool OReportDefinition::WriteThroughComponent(
xStreamProp->setPropertyValue( u"UseCommonStoragePasswordEncryption"_ustr,
uno::Any( true ) );
// set buffer and create outputstream
// write the stuff
bool bRet = WriteThroughComponent(
xOutputStream, xComponent,
rServiceName, rArguments);
// finally, commit stream.
return bRet;
}
bool OReportDefinition::WriteThroughComponent(
const uno::Reference<io::XOutputStream> & xOutputStream,
const uno::Reference<lang::XComponent> & xComponent,
const OUString& rServiceName,
const uno::Sequence<uno::Any> & rArguments)
{
OSL_ENSURE( xOutputStream.is(), "I really need an output stream!" );
OSL_ENSURE( xComponent.is(), "Need component!" );
// get component
uno::Reference< xml::sax::XWriter > xSaxWriter(
xml::sax::Writer::create(m_aProps->m_xContext) );
@@ -1511,7 +1494,7 @@ bool OReportDefinition::WriteThroughComponent(
m_aProps->m_xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
rServiceName, aArgs, m_aProps->m_xContext), uno::UNO_QUERY);
OSL_ENSURE( xExporter.is(),
"can't instantiate export filter component" );
"can't instantiate export filter component" );
if( !xExporter.is() )
return false;