1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <com/sun/star/embed/XStorage.hpp>
#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/task/XStatusIndicator.hpp>
#include <com/sun/star/xml/sax/Writer.hpp>
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
#include <com/sun/star/document/XExporter.hpp>
#include <com/sun/star/document/XFilter.hpp>
#include <com/sun/star/frame/XModule.hpp>
#include <officecfg/Office/Common.hxx>
#include <comphelper/fileformat.h>
#include <comphelper/processfactory.hxx>
#include <comphelper/genericpropertyset.hxx>
#include <comphelper/propertysetinfo.hxx>
#include <vcl/errinf.hxx>
#include <osl/diagnose.h>
#include <sal/log.hxx>
#include <svx/xmlgrhlp.hxx>
#include <svx/xmleohlp.hxx>
#include <svl/stritem.hxx>
#include <sfx2/frame.hxx>
#include <sfx2/docfile.hxx>
#include <sfx2/sfxsids.hrc>
#include <pam.hxx>
#include <doc.hxx>
#include <docfunc.hxx>
#include <IDocumentRedlineAccess.hxx>
#include <IDocumentMarkAccess.hxx>
#include <IDocumentStatistics.hxx>
#include <IDocumentLayoutAccess.hxx>
#include <rootfrm.hxx>
#include <docstat.hxx>
#include <docsh.hxx>
#include <xmloff/shapeexport.hxx>
#include <unotools/ucbstreamhelper.hxx>
#include <swerror.h>
#include "wrtxml.hxx"
#include "zorder.hxx"
#include <strings.hrc>
#include <comphelper/documentconstants.hxx>
#include <com/sun/star/rdf/XDocumentMetadataAccess.hpp>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::document;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::lang;
SwXMLWriter::SwXMLWriter( const OUString& rBaseURL )
{
SetBaseURL( rBaseURL );
}
SwXMLWriter::~SwXMLWriter()
{
}
ErrCode SwXMLWriter::Write_(const SfxItemSet* pMediumItemSet)
{
uno::Reference<task::XStatusIndicator> xStatusIndicator;
OUString aDocHierarchicalName;
bool bNoEmbDS(false);
if (pMediumItemSet)
{
const SfxUnoAnyItem* pStatusBarItem =
pMediumItemSet->GetItem(SID_PROGRESS_STATUSBAR_CONTROL);
if (pStatusBarItem)
pStatusBarItem->GetValue() >>= xStatusIndicator;
const SfxStringItem* pDocHierarchItem =
pMediumItemSet->GetItem(SID_DOC_HIERARCHICALNAME);
if (pDocHierarchItem)
aDocHierarchicalName = pDocHierarchItem->GetValue();
const SfxBoolItem* pNoEmbDS = pMediumItemSet->GetItem(SID_NO_EMBEDDED_DS);
if (pNoEmbDS)
bNoEmbDS = pNoEmbDS->GetValue();
}
// Get service factory
uno::Reference< uno::XComponentContext > xContext =
comphelper::getProcessComponentContext();
// Get data sink ...
uno::Reference<document::XGraphicStorageHandler> xGraphicStorageHandler;
rtl::Reference<SvXMLGraphicHelper> xGraphicHelper ;
uno::Reference< document::XEmbeddedObjectResolver > xObjectResolver;
rtl::Reference<SvXMLEmbeddedObjectHelper> xObjectHelper;
OSL_ENSURE( m_xStg.is(), "Where is my storage?" );
xGraphicHelper = SvXMLGraphicHelper::Create( m_xStg,
SvXMLGraphicHelperMode::Write );
xGraphicStorageHandler = xGraphicHelper.get();
SfxObjectShell *pPersist = m_pDoc->GetPersist();
if( pPersist )
{
xObjectHelper = SvXMLEmbeddedObjectHelper::Create(
m_xStg, *pPersist,
SvXMLEmbeddedObjectHelperMode::Write );
xObjectResolver = xObjectHelper.get();
}
// create and prepare the XPropertySet that gets passed through
// the components, and the XStatusIndicator that shows progress to
// the user.
// create XPropertySet with three properties for status indicator
static comphelper::PropertyMapEntry const aInfoMap[] =
{
{ OUString("ProgressRange"), 0,
::cppu::UnoType<sal_Int32>::get(),
beans::PropertyAttribute::MAYBEVOID, 0},
{ OUString("ProgressMax"), 0,
::cppu::UnoType<sal_Int32>::get(),
beans::PropertyAttribute::MAYBEVOID, 0},
{ OUString("ProgressCurrent"), 0,
::cppu::UnoType<sal_Int32>::get(),
beans::PropertyAttribute::MAYBEVOID, 0},
{ OUString("WrittenNumberStyles"), 0,
cppu::UnoType<uno::Sequence<sal_Int32>>::get(),
beans::PropertyAttribute::MAYBEVOID, 0},
{ OUString("UsePrettyPrinting"), 0,
cppu::UnoType<bool>::get(),
beans::PropertyAttribute::MAYBEVOID, 0},
{ OUString("ShowChanges"), 0,
cppu::UnoType<bool>::get(),
beans::PropertyAttribute::MAYBEVOID, 0 },
{ OUString("RedlineProtectionKey"), 0,
cppu::UnoType<Sequence<sal_Int8>>::get(),
beans::PropertyAttribute::MAYBEVOID, 0 },
{ OUString("BaseURI"), 0,
::cppu::UnoType<OUString>::get(),
beans::PropertyAttribute::MAYBEVOID, 0 },
{ OUString("StreamRelPath"), 0,
::cppu::UnoType<OUString>::get(),
beans::PropertyAttribute::MAYBEVOID, 0 },
{ OUString("StreamName"), 0,
::cppu::UnoType<OUString>::get(),
beans::PropertyAttribute::MAYBEVOID, 0 },
{ OUString("AutoTextMode"), 0,
cppu::UnoType<bool>::get(),
beans::PropertyAttribute::MAYBEVOID, 0 },
{ OUString("StyleNames"), 0,
cppu::UnoType<Sequence<OUString>>::get(),
beans::PropertyAttribute::MAYBEVOID, 0 },
{ OUString("StyleFamilies"), 0,
cppu::UnoType<Sequence<sal_Int32>>::get(),
beans::PropertyAttribute::MAYBEVOID, 0 },
// #i69627#
{ OUString("OutlineStyleAsNormalListStyle"), 0,
cppu::UnoType<bool>::get(),
beans::PropertyAttribute::MAYBEVOID, 0 },
{ OUString("TargetStorage"),0, cppu::UnoType<embed::XStorage>::get(),
css::beans::PropertyAttribute::MAYBEVOID, 0 },
// tdf#144532
{ OUString("NoEmbDataSet"), 0,
cppu::UnoType<bool>::get(),
beans::PropertyAttribute::MAYBEVOID, 0 },
};
uno::Reference< beans::XPropertySet > xInfoSet(
comphelper::GenericPropertySet_CreateInstance(
new comphelper::PropertySetInfo( aInfoMap ) ) );
xInfoSet->setPropertyValue( "TargetStorage", Any( m_xStg ) );
xInfoSet->setPropertyValue("NoEmbDataSet", Any(bNoEmbDS));
if (m_bShowProgress)
{
// set progress range and start status indicator
sal_Int32 nProgressRange(1000000);
if (xStatusIndicator.is())
{
xStatusIndicator->start(SwResId( STR_STATSTR_SWGWRITE),
nProgressRange);
}
xInfoSet->setPropertyValue("ProgressRange", Any(nProgressRange));
xInfoSet->setPropertyValue("ProgressMax", Any(static_cast < sal_Int32 >( -1 )));
}
xInfoSet->setPropertyValue( "UsePrettyPrinting", Any(officecfg::Office::Common::Save::Document::PrettyPrinting::get()) );
uno::Reference<lang::XComponent> const xModelComp(m_pDoc->GetDocShell()->GetModel());
uno::Reference<drawing::XDrawPageSupplier> const xDPS(xModelComp, uno::UNO_QUERY);
assert(xDPS.is());
xmloff::FixZOrder(xDPS->getDrawPage(), sw::GetZOrderLayer(m_pDoc->getIDocumentDrawModelAccess()));
// save show redline mode ...
RedlineFlags const nOrigRedlineFlags = m_pDoc->getIDocumentRedlineAccess().GetRedlineFlags();
RedlineFlags nRedlineFlags(nOrigRedlineFlags);
bool isShowChanges;
// TODO: ideally this would be stored per-view...
SwRootFrame const*const pLayout(m_pDoc->getIDocumentLayoutAccess().GetCurrentLayout());
isShowChanges = pLayout == nullptr || !pLayout->IsHideRedlines();
xInfoSet->setPropertyValue("ShowChanges", Any(isShowChanges));
// ... and hide redlines for export
nRedlineFlags &= ~RedlineFlags::ShowMask;
nRedlineFlags |= RedlineFlags::ShowInsert;
m_pDoc->getIDocumentRedlineAccess().SetRedlineFlags( nRedlineFlags );
// Set base URI
xInfoSet->setPropertyValue( "BaseURI", Any( GetBaseURL() ) );
if( SfxObjectCreateMode::EMBEDDED == m_pDoc->GetDocShell()->GetCreateMode() )
{
const OUString aName( !aDocHierarchicalName.isEmpty()
? aDocHierarchicalName
: OUString( "dummyObjectName" ) );
xInfoSet->setPropertyValue( "StreamRelPath", Any( aName ) );
}
if( m_bBlock )
{
xInfoSet->setPropertyValue( "AutoTextMode", Any(true) );
}
// #i69627#
const bool bOASIS = ( SotStorage::GetVersion( m_xStg ) > SOFFICE_FILEFORMAT_60 );
if ( bOASIS &&
docfunc::HasOutlineStyleToBeWrittenAsNormalListStyle( *m_pDoc ) )
{
xInfoSet->setPropertyValue( "OutlineStyleAsNormalListStyle", Any( true ) );
}
// filter arguments
// - graphics + object resolver for styles + content
// - status indicator
// - info property set
// - else empty
sal_Int32 nArgs = 1;
if( xStatusIndicator.is() )
nArgs++;
Sequence < Any > aEmptyArgs( nArgs );
Any *pArgs = aEmptyArgs.getArray();
*pArgs++ <<= xInfoSet;
if( xStatusIndicator.is() )
*pArgs++ <<= xStatusIndicator;
if( xGraphicStorageHandler.is() )
nArgs++;
if( xObjectResolver.is() )
nArgs++;
Sequence < Any > aFilterArgs( nArgs );
pArgs = aFilterArgs.getArray();
*pArgs++ <<= xInfoSet;
if( xGraphicStorageHandler.is() )
*pArgs++ <<= xGraphicStorageHandler;
if( xObjectResolver.is() )
*pArgs++ <<= xObjectResolver;
if( xStatusIndicator.is() )
*pArgs++ <<= xStatusIndicator;
PutNumFormatFontsInAttrPool();
PutEditEngFontsInAttrPool();
// properties
Sequence < PropertyValue > aProps( m_pOrigFileName ? 1 : 0 );
if( m_pOrigFileName )
{
PropertyValue *pProps = aProps.getArray();
pProps->Name = "FileName";
pProps->Value <<= *m_pOrigFileName;
}
// export sub streams for package, else full stream into a file
bool bWarn = false;
// RDF metadata: export if ODF >= 1.2
// N.B.: embedded documents have their own manifest.rdf!
if ( bOASIS )
{
const uno::Reference<beans::XPropertySet> xPropSet(m_xStg,
uno::UNO_QUERY_THROW);
try
{
OUString Version;
// ODF >= 1.2
if ((xPropSet->getPropertyValue("Version") >>= Version)
&& Version != ODFVER_010_TEXT
&& Version != ODFVER_011_TEXT)
{
const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(
xModelComp, uno::UNO_QUERY_THROW);
xDMA->storeMetadataToStorage(m_xStg);
}
}
catch (beans::UnknownPropertyException &)
{ /* ignore */ }
catch (uno::Exception &)
{
bWarn = true;
}
}
bool bStoreMeta = ( SfxObjectCreateMode::EMBEDDED != m_pDoc->GetDocShell()->GetCreateMode() );
if ( !bStoreMeta )
{
try
{
Reference< frame::XModule > xModule( xModelComp, UNO_QUERY );
if ( xModule.is() )
{
const OUString aModuleID = xModule->getIdentifier();
bStoreMeta = !aModuleID.isEmpty() &&
( aModuleID == "com.sun.star.sdb.FormDesign" ||
aModuleID == "com.sun.star.sdb.TextReportDesign" );
}
}
catch( uno::Exception& )
{}
}
OUString sWarnFile;
if( !m_bOrganizerMode && !m_bBlock && bStoreMeta )
{
if( !WriteThroughComponent(
xModelComp, "meta.xml", xContext,
(bOASIS ? "com.sun.star.comp.Writer.XMLOasisMetaExporter"
: "com.sun.star.comp.Writer.XMLMetaExporter"),
aEmptyArgs, aProps ) )
{
bWarn = true;
sWarnFile = "meta.xml";
}
}
if( !m_bBlock )
{
if( !WriteThroughComponent(
xModelComp, "settings.xml", xContext,
(bOASIS ? "com.sun.star.comp.Writer.XMLOasisSettingsExporter"
: "com.sun.star.comp.Writer.XMLSettingsExporter"),
aEmptyArgs, aProps ) )
{
if( !bWarn )
{
bWarn = true;
sWarnFile = "settings.xml";
}
}
}
bool bErr = false;
OUString sErrFile;
if( !WriteThroughComponent(
xModelComp, "styles.xml", xContext,
(bOASIS ? "com.sun.star.comp.Writer.XMLOasisStylesExporter"
: "com.sun.star.comp.Writer.XMLStylesExporter"),
aFilterArgs, aProps ) )
{
bErr = true;
sErrFile = "styles.xml";
}
if( !m_bOrganizerMode && !bErr )
{
if( !WriteThroughComponent(
xModelComp, "content.xml", xContext,
(bOASIS ? "com.sun.star.comp.Writer.XMLOasisContentExporter"
: "com.sun.star.comp.Writer.XMLContentExporter"),
aFilterArgs, aProps ) )
{
bErr = true;
sErrFile = "content.xml";
}
}
if( m_pDoc->getIDocumentLayoutAccess().GetCurrentViewShell() && m_pDoc->getIDocumentStatistics().GetDocStat().nPage > 1 &&
!(m_bOrganizerMode || m_bBlock || bErr ||
// sw_redlinehide: disable layout cache for now
m_pDoc->getIDocumentLayoutAccess().GetCurrentLayout()->HasMergedParas()))
{
try
{
uno::Reference < io::XStream > xStm = m_xStg->openStreamElement( "layout-cache", embed::ElementModes::READWRITE | embed::ElementModes::TRUNCATE );
std::unique_ptr<SvStream> pStream = utl::UcbStreamHelper::CreateStream( xStm );
if( !pStream->GetError() )
{
uno::Reference < beans::XPropertySet > xSet( xStm, UNO_QUERY );
uno::Any aAny2;
aAny2 <<= OUString("application/binary");
xSet->setPropertyValue("MediaType", aAny2 );
m_pDoc->WriteLayoutCache( *pStream );
}
}
catch ( uno::Exception& )
{
}
}
if( xGraphicHelper )
xGraphicHelper->dispose();
xGraphicHelper.clear();
xGraphicStorageHandler = nullptr;
if( xObjectHelper )
xObjectHelper->dispose();
xObjectHelper.clear();
xObjectResolver = nullptr;
// restore redline mode
nRedlineFlags = m_pDoc->getIDocumentRedlineAccess().GetRedlineFlags();
nRedlineFlags &= ~RedlineFlags::ShowMask;
nRedlineFlags |= RedlineFlags::ShowInsert;
nRedlineFlags |= nOrigRedlineFlags & RedlineFlags::ShowMask;
m_pDoc->getIDocumentRedlineAccess().SetRedlineFlags( nRedlineFlags );
// tdf#115815 restore annotation ranges collapsed by hide redlines
m_pDoc->getIDocumentMarkAccess()->restoreAnnotationMarks();
if (xStatusIndicator.is())
{
xStatusIndicator->end();
}
if( bErr )
{
if( !sErrFile.isEmpty() )
return *new StringErrorInfo( ERR_WRITE_ERROR_FILE, sErrFile,
DialogMask::ButtonsOk | DialogMask::MessageError );
return ERR_SWG_WRITE_ERROR;
}
else if( bWarn )
{
if( !sWarnFile.isEmpty() )
return *new StringErrorInfo( WARN_WRITE_ERROR_FILE, sWarnFile,
DialogMask::ButtonsOk | DialogMask::MessageError );
return WARN_SWG_FEATURES_LOST;
}
return ERRCODE_NONE;
}
ErrCode SwXMLWriter::WriteStorage()
{
return Write_(nullptr);
}
ErrCode SwXMLWriter::WriteMedium( SfxMedium& aTargetMedium )
{
return Write_(aTargetMedium.GetItemSet());
}
ErrCode SwXMLWriter::Write( SwPaM& rPaM, SfxMedium& rMed,
const OUString* pFileName )
{
return IsStgWriter()
? static_cast<StgWriter *>(this)->Write( rPaM, rMed.GetOutputStorage(), pFileName, &rMed )
: static_cast<Writer *>(this)->Write( rPaM, *rMed.GetOutStream(), pFileName );
}
bool SwXMLWriter::WriteThroughComponent(
const uno::Reference<XComponent> & xComponent,
const char* pStreamName,
const uno::Reference<uno::XComponentContext> & rxContext,
const char* pServiceName,
const Sequence<Any> & rArguments,
const Sequence<beans::PropertyValue> & rMediaDesc )
{
OSL_ENSURE( m_xStg.is(), "Need storage!" );
OSL_ENSURE( nullptr != pStreamName, "Need stream name!" );
OSL_ENSURE( nullptr != pServiceName, "Need service name!" );
SAL_INFO( "sw.filter", "SwXMLWriter::WriteThroughComponent : stream " << pStreamName );
// open stream
bool bRet = false;
try
{
const OUString sStreamName = OUString::createFromAscii( pStreamName );
uno::Reference<io::XStream> xStream =
m_xStg->openStreamElement( sStreamName,
embed::ElementModes::READWRITE | embed::ElementModes::TRUNCATE );
uno::Reference <beans::XPropertySet > xSet( xStream, uno::UNO_QUERY );
if( !xSet.is() )
return false;
xSet->setPropertyValue("MediaType", Any(OUString("text/xml")) );
// even plain stream should be encrypted in encrypted documents
xSet->setPropertyValue( "UseCommonStoragePasswordEncryption", Any(true) );
// set buffer and create outputstream
uno::Reference< io::XOutputStream > xOutputStream = xStream->getOutputStream();
// set Base URL
uno::Reference< beans::XPropertySet > xInfoSet;
if( rArguments.hasElements() )
rArguments.getConstArray()[0] >>= xInfoSet;
OSL_ENSURE( xInfoSet.is(), "missing property set" );
if( xInfoSet.is() )
{
xInfoSet->setPropertyValue( "StreamName", Any( sStreamName ) );
}
// write the stuff
bRet = WriteThroughComponent(
xOutputStream, xComponent, rxContext,
pServiceName, rArguments, rMediaDesc );
}
catch ( uno::Exception& )
{
}
return bRet;
}
bool SwXMLWriter::WriteThroughComponent(
const uno::Reference<io::XOutputStream> & xOutputStream,
const uno::Reference<XComponent> & xComponent,
const uno::Reference<XComponentContext> & rxContext,
const char* pServiceName,
const Sequence<Any> & rArguments,
const Sequence<PropertyValue> & rMediaDesc )
{
OSL_ENSURE( xOutputStream.is(), "I really need an output stream!" );
OSL_ENSURE( xComponent.is(), "Need component!" );
OSL_ENSURE( nullptr != pServiceName, "Need component name!" );
// get component
uno::Reference< xml::sax::XWriter > xSaxWriter = xml::sax::Writer::create(rxContext);
SAL_INFO( "sw.filter", "SAX-Writer created" );
// connect XML writer to output stream
xSaxWriter->setOutputStream( xOutputStream );
// prepare arguments (prepend doc handler to given arguments)
Sequence<Any> aArgs( 1 + rArguments.getLength() );
auto pArgs = aArgs.getArray();
*pArgs <<= xSaxWriter;
std::copy(rArguments.begin(), rArguments.end(), std::next(pArgs));
// get filter component
uno::Reference< document::XExporter > xExporter(
rxContext->getServiceManager()->createInstanceWithArgumentsAndContext(
OUString::createFromAscii(pServiceName), aArgs, rxContext), UNO_QUERY);
OSL_ENSURE( xExporter.is(),
"can't instantiate export filter component" );
if( !xExporter.is() )
return false;
SAL_INFO( "sw.filter", pServiceName << " instantiated." );
// connect model and filter
xExporter->setSourceDocument( xComponent );
// filter!
SAL_INFO( "sw.filter", "call filter()" );
uno::Reference<XFilter> xFilter( xExporter, UNO_QUERY );
return xFilter->filter( rMediaDesc );
}
void GetXMLWriter(
[[maybe_unused]] std::u16string_view /*rName*/, const OUString& rBaseURL, WriterRef& xRet )
{
xRet = new SwXMLWriter( rBaseURL );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|