LibreOffice Module sd (master) 1
sdxmlwrp.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <officecfg/Office/Common.hxx>
21#include <vcl/errinf.hxx>
22#include <sal/log.hxx>
23#include <com/sun/star/container/XChild.hpp>
24#include <com/sun/star/beans/XPropertySetInfo.hpp>
25#include <com/sun/star/embed/ElementModes.hpp>
26#include <com/sun/star/xml/sax/SAXParseException.hpp>
29#include <o3tl/string_view.hxx>
30#include <editeng/outlobj.hxx>
31#include <sfx2/docfile.hxx>
32#include <sfx2/docfilt.hxx>
33#include <sfx2/sfxsids.hrc>
34#include <drawdoc.hxx>
35#include <sdpage.hxx>
36#include <Outliner.hxx>
38#include <svx/dialmgr.hxx>
39#include <svx/strings.hrc>
40#include <svx/xmlgrhlp.hxx>
41
42#include <DrawDocShell.hxx>
43
44#include <sdxmlwrp.hxx>
45#include <svx/xmleohlp.hxx>
46#include <com/sun/star/xml/sax/Parser.hpp>
47#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
48#include <com/sun/star/xml/sax/XFastParser.hpp>
49#include <com/sun/star/document/XFilter.hpp>
50#include <com/sun/star/document/XImporter.hpp>
51#include <com/sun/star/document/XExporter.hpp>
52#include <com/sun/star/lang/XInitialization.hpp>
53#include <com/sun/star/lang/XServiceInfo.hpp>
54#include <com/sun/star/lang/XMultiServiceFactory.hpp>
55#include <com/sun/star/beans/PropertyAttribute.hpp>
56#include <com/sun/star/packages/WrongPasswordException.hpp>
57#include <com/sun/star/packages/zip/ZipIOException.hpp>
58
59#include <com/sun/star/xml/sax/InputSource.hpp>
60#include <com/sun/star/xml/sax/Writer.hpp>
63#include <editeng/eeitem.hxx>
64
65// include necessary for XML progress bar at load time
66#include <svl/itemset.hxx>
67#include <svl/stritem.hxx>
68#include <svtools/sfxecode.hxx>
69
70#include <sddll.hxx>
71#include <sderror.hxx>
72#include <sdresid.hxx>
73#include "sdtransform.hxx"
74#include <strings.hrc>
75
76#include <sfx2/frame.hxx>
77#include <tools/debug.hxx>
79
80using namespace com::sun::star;
81using namespace com::sun::star::uno;
82using namespace com::sun::star::lang;
83using namespace com::sun::star::document;
84using namespace comphelper;
85
86#define SD_XML_READERROR ErrCode(1234)
87
88char const sXML_export_impress_meta_oasis_service[] = "com.sun.star.comp.Impress.XMLOasisMetaExporter";
89char const sXML_export_impress_styles_oasis_service[] = "com.sun.star.comp.Impress.XMLOasisStylesExporter";
90char const sXML_export_impress_content_oasis_service[] = "com.sun.star.comp.Impress.XMLOasisContentExporter";
91char const sXML_export_impress_settings_oasis_service[] = "com.sun.star.comp.Impress.XMLOasisSettingsExporter";
92
93char const sXML_export_draw_meta_oasis_service[] = "com.sun.star.comp.Draw.XMLOasisMetaExporter";
94char const sXML_export_draw_styles_oasis_service[] = "com.sun.star.comp.Draw.XMLOasisStylesExporter";
95char const sXML_export_draw_content_oasis_service[] = "com.sun.star.comp.Draw.XMLOasisContentExporter";
96char const sXML_export_draw_settings_oasis_service[] = "com.sun.star.comp.Draw.XMLOasisSettingsExporter";
97
98char const sXML_import_impress_meta_oasis_service[] = "com.sun.star.comp.Impress.XMLOasisMetaImporter";
99char const sXML_import_impress_styles_oasis_service[] = "com.sun.star.comp.Impress.XMLOasisStylesImporter";
100char const sXML_import_impress_content_oasis_service[] = "com.sun.star.comp.Impress.XMLOasisContentImporter";
101char const sXML_import_impress_settings_oasis_service[] = "com.sun.star.comp.Impress.XMLOasisSettingsImporter";
102
103char const sXML_import_draw_meta_oasis_service[] = "com.sun.star.comp.Draw.XMLOasisMetaImporter";
104char const sXML_import_draw_styles_oasis_service[] = "com.sun.star.comp.Draw.XMLOasisStylesImporter";
105char const sXML_import_draw_content_oasis_service[] = "com.sun.star.comp.Draw.XMLOasisContentImporter";
106char const sXML_import_draw_settings_oasis_service[] = "com.sun.star.comp.Draw.XMLOasisSettingsImporter";
107
108// OOo
109char const sXML_import_impress_meta_ooo_service[] = "com.sun.star.comp.Impress.XMLMetaImporter";
110char const sXML_import_impress_styles_ooo_service[] = "com.sun.star.comp.Impress.XMLStylesImporter";
111char const sXML_import_impress_content_ooo_service[] = "com.sun.star.comp.Impress.XMLContentImporter";
112char const sXML_import_impress_settings_ooo_service[] = "com.sun.star.comp.Impress.XMLSettingsImporter";
113
114char const sXML_import_draw_meta_ooo_service[] = "com.sun.star.comp.Draw.XMLMetaImporter";
115char const sXML_import_draw_styles_ooo_service[] = "com.sun.star.comp.Draw.XMLStylesImporter";
116char const sXML_import_draw_content_ooo_service[] = "com.sun.star.comp.Draw.XMLContentImporter";
117char const sXML_import_draw_settings_ooo_service[] = "com.sun.star.comp.Draw.XMLSettingsImporter";
118
119namespace {
120
121struct XML_SERVICEMAP
122{
123 const char* mpService;
124 const char* mpStream;
125};
126
127struct XML_SERVICES
128{
129 const char* mpMeta;
130 const char* mpStyles;
131 const char* mpContent;
132 const char* mpSettings;
133};
134
135}
136
137static XML_SERVICES const * getServices( bool bImport, bool bDraw, sal_uLong nStoreVer )
138{
139 // Expect that export always sets nStoreVer to SOFFICE_FILEFORMAT_8.
140 assert(bImport || nStoreVer != SOFFICE_FILEFORMAT_60);
141
142 static XML_SERVICES const gServices[] =
143 {
148
151 };
152
153 return &gServices[ (bImport ? 0 : 2) + ((nStoreVer == SOFFICE_FILEFORMAT_60) ? 4 : 0) + (bDraw ? 1 : 0 ) ];
154}
155
156
157SdXMLFilter::SdXMLFilter( SfxMedium& rMedium, ::sd::DrawDocShell& rDocShell, SdXMLFilterMode eFilterMode, sal_uLong nStoreVer ) :
158 SdFilter( rMedium, rDocShell ), meFilterMode( eFilterMode ), mnStoreVer( nStoreVer )
159{
160}
161
163{
164}
165
166namespace
167{
168
169ErrCode ReadThroughComponent(
170 const Reference<io::XInputStream>& xInputStream,
171 const Reference<XComponent>& xModelComponent,
172 const OUString& rStreamName,
173 Reference<uno::XComponentContext> const & rxContext,
174 const char* pFilterName,
175 const Sequence<Any>& rFilterArguments,
176 const OUString& rName,
177 bool bMustBeSuccessful,
178 bool bEncrypted )
179{
180 DBG_ASSERT(xInputStream.is(), "input stream missing");
181 DBG_ASSERT(xModelComponent.is(), "document missing");
182 DBG_ASSERT(rxContext.is(), "factory missing");
183 DBG_ASSERT(nullptr != pFilterName,"I need a service name for the component!");
184
185 SAL_INFO( "sd.filter", "ReadThroughComponent" );
186
187 // prepare ParserInputSource
188 xml::sax::InputSource aParserInput;
189 aParserInput.sSystemId = rName;
190 aParserInput.aInputStream = xInputStream;
191
192 // get filter
193 OUString aFilterName(OUString::createFromAscii(pFilterName));
194 // the underlying SvXMLImport implements XFastParser, XImporter, XFastDocumentHandler
196 rxContext->getServiceManager()->createInstanceWithArgumentsAndContext(aFilterName, rFilterArguments, rxContext),
197 UNO_QUERY );
198 SAL_WARN_IF(!xFilter.is(), "sd.filter", "Can't instantiate filter component: " << aFilterName);
199 if( !xFilter.is() )
200 return SD_XML_READERROR;
201 Reference< xml::sax::XFastParser > xFastParser(xFilter, UNO_QUERY);
203 if (!xFastParser)
204 xDocumentHandler.set(xFilter, UNO_QUERY);
205 if (!xFastParser && !xDocumentHandler)
206 {
207 SAL_WARN("sd", "service does not implement XFastParser or XDocumentHandler");
208 assert(false);
209 return SD_XML_READERROR;
210 }
211 SAL_INFO( "sd.filter", "" << pFilterName << " created" );
212
213 // connect model and filter
214 Reference < XImporter > xImporter( xFilter, UNO_QUERY );
215 xImporter->setTargetDocument( xModelComponent );
216
217 // finally, parser the stream
218 SAL_INFO( "sd.filter", "parsing stream" );
219 try
220 {
221 if (xFastParser)
222 xFastParser->parseStream( aParserInput );
223 else
224 {
225 Reference< xml::sax::XParser > xParser = xml::sax::Parser::create(rxContext);
226 // connect parser and filter
227 xParser->setDocumentHandler( xDocumentHandler );
228 xParser->parseStream( aParserInput );
229 }
230 }
231 catch (const xml::sax::SAXParseException& r)
232 {
233 css::uno::Any ex( cppu::getCaughtException() );
234 // sax parser sends wrapped exceptions,
235 // try to find the original one
236 xml::sax::SAXException aSaxEx = *static_cast<xml::sax::SAXException const *>(&r);
237 bool bTryChild = true;
238
239 while( bTryChild )
240 {
241 xml::sax::SAXException aTmp;
242 if ( aSaxEx.WrappedException >>= aTmp )
243 aSaxEx = aTmp;
244 else
245 bTryChild = false;
246 }
247
248 packages::zip::ZipIOException aBrokenPackage;
249 if ( aSaxEx.WrappedException >>= aBrokenPackage )
251
252 if( bEncrypted )
254
255 SAL_WARN( "sd.filter", "SAX parse exception caught while importing: " << exceptionToString(ex));
256
257 OUString sErr = OUString::number( r.LineNumber ) +
258 "," + OUString::number( r.ColumnNumber );
259
260 if (!rStreamName.isEmpty())
261 {
262 return *new TwoStringErrorInfo(
263 (bMustBeSuccessful ? ERR_FORMAT_FILE_ROWCOL
265 rStreamName, sErr,
266 DialogMask::ButtonsOk | DialogMask::MessageError );
267 }
268 else
269 {
270 DBG_ASSERT( bMustBeSuccessful, "Warnings are not supported" );
271 return *new StringErrorInfo( ERR_FORMAT_ROWCOL, sErr,
272 DialogMask::ButtonsOk | DialogMask::MessageError );
273 }
274 }
275 catch (const xml::sax::SAXException& r)
276 {
277 css::uno::Any ex( cppu::getCaughtException() );
278 packages::zip::ZipIOException aBrokenPackage;
279 if ( r.WrappedException >>= aBrokenPackage )
281
282 if( bEncrypted )
284
285 SAL_WARN( "sd.filter", "SAX exception caught while importing: " << exceptionToString(ex));
286 return SD_XML_READERROR;
287 }
288 catch (const packages::zip::ZipIOException&)
289 {
290 TOOLS_WARN_EXCEPTION( "sd.filter", "Zip exception caught while importing");
292 }
293 catch (const io::IOException&)
294 {
295 TOOLS_WARN_EXCEPTION( "sd.filter", "IO exception caught while importing");
296 return SD_XML_READERROR;
297 }
298 catch (const uno::Exception&)
299 {
300 TOOLS_WARN_EXCEPTION( "sd.filter", "uno exception caught while importing");
301 return SD_XML_READERROR;
302 }
303
304 // success!
305 return ERRCODE_NONE;
306}
307
308ErrCode ReadThroughComponent(
309 const uno::Reference < embed::XStorage >& xStorage,
310 const Reference<XComponent>& xModelComponent,
311 const char* pStreamName,
312 Reference<uno::XComponentContext> const & rxContext,
313 const char* pFilterName,
314 const Sequence<Any>& rFilterArguments,
315 const OUString& rName,
316 bool bMustBeSuccessful )
317{
318 DBG_ASSERT(xStorage.is(), "Need storage!");
319 DBG_ASSERT(nullptr != pStreamName, "Please, please, give me a name!");
320
321 // open stream (and set parser input)
322 OUString sStreamName = OUString::createFromAscii(pStreamName);
323 bool bContainsStream = false;
324 try
325 {
326 bContainsStream = xStorage->isStreamElement(sStreamName);
327 }
328 catch (const container::NoSuchElementException&)
329 {
330 }
331
332 if (!bContainsStream )
333 {
334 // stream name not found! return immediately with OK signal
335 return ERRCODE_NONE;
336 }
337
338 // set Base URL
339 uno::Reference< beans::XPropertySet > xInfoSet;
340 if( rFilterArguments.hasElements() )
341 rFilterArguments.getConstArray()[0] >>= xInfoSet;
342 DBG_ASSERT( xInfoSet.is(), "missing property set" );
343 if( xInfoSet.is() )
344 {
345 xInfoSet->setPropertyValue( "StreamName", Any( sStreamName ) );
346 }
347
348 try
349 {
350 // get input stream
352 xStorage->openStreamElement( sStreamName, embed::ElementModes::READ );
353 Reference <beans::XPropertySet > xProps( xStream, uno::UNO_QUERY );
354 if ( !xStream.is() || ! xProps.is() )
355 return SD_XML_READERROR;
356
357 Any aAny = xProps->getPropertyValue( "Encrypted" );
358
359 bool bEncrypted = false;
360 aAny >>= bEncrypted;
361
362 Reference <io::XInputStream> xInputStream = xStream->getInputStream();
363
364 // read from the stream
365 return ReadThroughComponent(
366 xInputStream, xModelComponent, sStreamName, rxContext,
367 pFilterName, rFilterArguments,
368 rName, bMustBeSuccessful, bEncrypted );
369 }
370 catch (const packages::WrongPasswordException&)
371 {
373 }
374 catch (const packages::zip::ZipIOException&)
375 {
377 }
378 catch (const uno::Exception&)
379 {}
380
381 return SD_XML_READERROR;
382}
383
384}
385
386//PresObjKind::Outlines in master pages are the preview of the outline styles
387//numbering format. Since fdo#78151 toggling bullets on and off changes
388//the style they are a preview of, previously toggling bullets on and off
389//would only affect the preview paragraph itself without an effect on the
390//style. i.e. previews of numbering which don't match the real numbering
391//they are supposed to be a preview of.
392//
393//But there exist documents which were saved previous to that modification
394//so here we detect such cases and fix them up to ensure the previews
395//numbering level matches that of the outline level it previews
397{
398 for (sal_uInt16 i = 0; i < pDoc->GetMasterSdPageCount(PageKind::Standard); ++i)
399 {
400 SdPage *pMasterPage = pDoc->GetMasterSdPage(i, PageKind::Standard);
401 SdrObject* pMasterOutline = pMasterPage->GetPresObj(PresObjKind::Outline);
402 if (!pMasterOutline)
403 continue;
404 OutlinerParaObject* pOutlParaObj = pMasterOutline->GetOutlinerParaObject();
405 if (!pOutlParaObj)
406 continue;
407 SdOutliner* pOutliner = pDoc->GetInternalOutliner();
408 pOutliner->Clear();
409 pOutliner->SetText(*pOutlParaObj);
410 bool bInconsistent = false;
411 const sal_Int32 nParaCount = pOutliner->GetParagraphCount();
412 for (sal_Int32 j = 0; j < nParaCount; ++j)
413 {
414 //Make sure the depth of the paragraph matches that of the outline style it previews
415 const sal_Int16 nExpectedDepth = j;
416 if (nExpectedDepth != pOutliner->GetDepth(j))
417 {
418 Paragraph* p = pOutliner->GetParagraph(j);
419 pOutliner->SetDepth(p, nExpectedDepth);
420 bInconsistent = true;
421 }
422
423 //If the preview has hard-coded bullets/numbering then they must
424 //be stripped to reveal the true underlying styles attributes
425 SfxItemSet aAttrs(pOutliner->GetParaAttribs(j));
426 if (aAttrs.GetItemState(EE_PARA_NUMBULLET) == SfxItemState::SET)
427 {
429 pOutliner->SetParaAttribs(j, aAttrs);
430 bInconsistent = true;
431 }
432
433 }
434 if (bInconsistent)
435 {
436 SAL_WARN("sd.filter", "Fixing inconsistent outline numbering placeholder preview");
437 pMasterOutline->SetOutlinerParaObject(pOutliner->CreateParaObject(0, nParaCount));
438 }
439 pOutliner->Clear();
440 }
441}
442
444{
445 ErrCode nRet = ERRCODE_NONE;
446
447 // Get service factory
450
452 bool const bWasUndo(pDoc->IsUndoEnabled());
453 pDoc->EnableUndo(false);
455 pDoc->CreateFirstPages();
456 pDoc->StopWorkStartupDelay();
457
458 mxModel->lockControllers();
459
461 static PropertyMapEntry const aImportInfoMap[] =
462 {
463 // necessary properties for XML progress bar at load time
464 { OUString("ProgressRange"), 0, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0},
465 { OUString("ProgressMax"), 0, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0},
466 { OUString("ProgressCurrent"), 0, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0},
467 { OUString("Preview"), 0, cppu::UnoType<sal_Bool>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0},
468 { OUString("PageLayouts"), 0, cppu::UnoType<container::XNameAccess>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0},
469 { OUString("PrivateData"), 0, cppu::UnoType<XInterface>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0 },
470 { OUString("BaseURI"), 0, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0 },
471 { OUString("StreamRelPath"), 0, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0 },
472 { OUString("StreamName"), 0, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0 },
473 { OUString("BuildId"), 0, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0 },
474 { OUString("OrganizerMode"), 0, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0 },
475 { OUString("SourceStorage"), 0, cppu::UnoType<embed::XStorage>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0 },
476 };
477
478 uno::Reference< beans::XPropertySet > xInfoSet( GenericPropertySet_CreateInstance( new PropertySetInfo( aImportInfoMap ) ) );
479 xInfoSet->setPropertyValue( "Preview" , uno::Any( mrDocShell.GetDoc()->IsStarDrawPreviewMode() ) );
480
481 // ---- get BuildId from parent container if available
482
483 uno::Reference< container::XChild > xChild( mxModel, uno::UNO_QUERY );
484 if( xChild.is() )
485 {
486 uno::Reference< beans::XPropertySet > xParentSet( xChild->getParent(), uno::UNO_QUERY );
487 if( xParentSet.is() )
488 {
489 uno::Reference< beans::XPropertySetInfo > xPropSetInfo( xParentSet->getPropertySetInfo() );
490 OUString sPropName( "BuildId" );
491 if( xPropSetInfo.is() && xPropSetInfo->hasPropertyByName(sPropName) )
492 {
493 xInfoSet->setPropertyValue( sPropName, xParentSet->getPropertyValue(sPropName) );
494 }
495 }
496 }
497
498 uno::Reference<document::XGraphicStorageHandler> xGraphicStorageHandler;
502
504
505 // try to get an XStatusIndicator from the Medium
506 {
507 const SfxUnoAnyItem* pItem = mrMedium.GetItemSet().GetItem(SID_PROGRESS_STATUSBAR_CONTROL);
508 if (pItem)
509 {
510 pItem->GetValue() >>= mxStatusIndicator;
511 }
512
513 if(mxStatusIndicator.is())
514 {
515 sal_Int32 nProgressRange(1000000);
516 OUString aMsg(SvxResId(RID_SVXSTR_DOC_LOAD));
517 mxStatusIndicator->start(aMsg, nProgressRange);
518
519 // set ProgressRange
520 uno::Any aProgRange;
521 aProgRange <<= nProgressRange;
522 xInfoSet->setPropertyValue( "ProgressRange" , aProgRange);
523
524 // set ProgressCurrent
525 uno::Any aProgCurrent;
526 aProgCurrent <<= sal_Int32(0);
527 xInfoSet->setPropertyValue( "ProgressCurrent" , aProgCurrent);
528 }
529 }
530
531 // get the input stream (storage or stream)
532
533 uno::Reference < embed::XStorage > xStorage = mrMedium.GetStorage();
534
535 xInfoSet->setPropertyValue( "SourceStorage", Any( xStorage ) );
536
537 if( !xStorage.is() )
538 nRet = SD_XML_READERROR;
539
540 if( ERRCODE_NONE == nRet )
541 {
542 xGraphicHelper = SvXMLGraphicHelper::Create( xStorage,
543 SvXMLGraphicHelperMode::Read );
544 xGraphicStorageHandler = xGraphicHelper.get();
545 xObjectHelper = SvXMLEmbeddedObjectHelper::Create(
546 xStorage, *pDoc->GetPersist(),
547 SvXMLEmbeddedObjectHelperMode::Read );
548 xObjectResolver = xObjectHelper.get();
549 }
550
551 // Set base URI
552 OUString const baseURI(mrMedium.GetBaseURL());
553 // needed for relative URLs, but in clipboard copy/paste there may be none
554 SAL_INFO_IF(baseURI.isEmpty(), "sd.filter", "SdXMLFilter: no base URL");
555 xInfoSet->setPropertyValue("BaseURI", Any(baseURI));
556
557 if( ERRCODE_NONE == nRet && SfxObjectCreateMode::EMBEDDED == mrDocShell.GetCreateMode() )
558 {
559 OUString aName;
560 const SfxStringItem* pDocHierarchItem =
561 mrMedium.GetItemSet().GetItem(SID_DOC_HIERARCHICALNAME);
562 if ( pDocHierarchItem )
563 aName = pDocHierarchItem->GetValue();
564 else
565 aName = "dummyObjectName" ;
566
567 if( !aName.isEmpty() )
568 xInfoSet->setPropertyValue( "StreamRelPath", Any( aName ) );
569 }
570
572 xInfoSet->setPropertyValue("OrganizerMode", uno::Any(true));
573
574 if( ERRCODE_NONE == nRet )
575 {
576
577 // prepare filter arguments
578 Sequence<Any> aFilterArgs( 4 );
579 Any *pArgs = aFilterArgs.getArray();
580 *pArgs++ <<= xInfoSet;
581 *pArgs++ <<= xGraphicStorageHandler;
582 *pArgs++ <<= xObjectResolver;
583 *pArgs++ <<= mxStatusIndicator;
584
585 Sequence<Any> aEmptyArgs( 2 );
586 pArgs = aEmptyArgs.getArray();
587 *pArgs++ <<= xInfoSet;
588 *pArgs++ <<= mxStatusIndicator;
589
590 const OUString aName( mrMedium.GetName() );
591
592 XML_SERVICES const * pServices = getServices( true, IsDraw(), mnStoreVer );
593
594 ErrCode nWarn = ERRCODE_NONE;
595 ErrCode nWarn2 = ERRCODE_NONE;
596 // read storage streams
597 // #i103539#: always read meta.xml for generator
598 nWarn = ReadThroughComponent(
599 xStorage, xModelComp, "meta.xml", rxContext,
600 pServices->mpMeta,
601 aEmptyArgs, aName, false );
602
604 {
605 nWarn2 = ReadThroughComponent(
606 xStorage, xModelComp, "settings.xml", rxContext,
607 pServices->mpSettings,
608 aFilterArgs, aName, false );
609 }
610
611 nRet = ReadThroughComponent(
612 xStorage, xModelComp, "styles.xml", rxContext,
613 pServices->mpStyles,
614 aFilterArgs, aName, true );
615
616 if( !nRet && (meFilterMode != SdXMLFilterMode::Organizer) )
617 nRet = ReadThroughComponent(
618 xStorage, xModelComp, "content.xml", rxContext,
619 pServices->mpContent,
620 aFilterArgs, aName, true );
621
622 if( !nRet )
623 {
624 if( nWarn )
625 nRet = nWarn;
626 else if( nWarn2 )
627 nRet = nWarn2;
628 }
629 }
630
631 if( xGraphicHelper )
632 xGraphicHelper->dispose();
633 xGraphicHelper.clear();
634 xGraphicStorageHandler = nullptr;
635 if( xObjectHelper.is() )
636 xObjectHelper->dispose();
637 xObjectHelper.clear();
638 xObjectResolver = nullptr;
639
640 if( mxStatusIndicator.is() )
641 mxStatusIndicator->end();
642
643 if( mxModel.is() )
644 mxModel->unlockControllers();
645
646 if( nRet == ERRCODE_NONE )
647 pDoc->UpdateAllLinks();
648
649 if( nRet.anyOf( ERRCODE_NONE, SD_XML_READERROR ) )
650 ;
651 else if( nRet == ERRCODE_IO_BROKENPACKAGE && xStorage.is() )
653 else
654 {
655 // TODO/LATER: this is completely wrong! Filter code should never call ErrorHandler directly!
657 if( nRet.IsWarning() )
658 nRet = ERRCODE_NONE;
659 }
660
661 // clear unused named items from item pool
662
663 ::svx::DropUnusedNamedItems(mxModel);
664
665 // set BuildId on XModel for later OLE object loading
666 if( xInfoSet.is() )
667 {
668 uno::Reference< beans::XPropertySet > xModelSet( mxModel, uno::UNO_QUERY );
669 if( xModelSet.is() )
670 {
671 uno::Reference< beans::XPropertySetInfo > xModelSetInfo( xModelSet->getPropertySetInfo() );
672 static constexpr OUStringLiteral sPropName( u"BuildId" );
673
674 OUString sBuildId;
675 xInfoSet->getPropertyValue(sPropName) >>= sBuildId;
676
677 if( xModelSetInfo.is() && xModelSetInfo->hasPropertyByName(sPropName) )
678 {
679 xModelSet->setPropertyValue( sPropName, Any( sBuildId ) );
680 }
681
682 bool bTransform = false;
683
684 if( nRet == ERRCODE_NONE )
685 {
686 if( !sBuildId.isEmpty() )
687 {
688 sal_Int32 nIndex = sBuildId.indexOf('$');
689 if (sBuildId.indexOf(';') == -1 && nIndex != -1)
690 {
691 sal_Int32 nUPD = o3tl::toInt32(sBuildId.subView( 0, nIndex ));
692
693 if( nUPD == 300 )
694 {
695 sal_Int32 nBuildId = o3tl::toInt32(sBuildId.subView( nIndex+1 ));
696 if( (nBuildId > 0) && (nBuildId < 9316) )
697 bTransform = true; // treat OOo 3.0 beta1 as OOo 2.x
698 }
699 else if( (nUPD == 680) || ( nUPD >= 640 && nUPD <= 645 ) )
700 bTransform = true;
701 }
702 }
703 else
704 {
705 // check for binary formats
706 std::shared_ptr<const SfxFilter> pFilter = mrMedium.GetFilter();
707 if( pFilter )
708 {
709 OUString typeName(pFilter->GetRealTypeName());
710 if( typeName.startsWith( "impress_StarImpress" ) ||
711 typeName.startsWith( "draw_StarDraw" ) )
712 {
713 bTransform = true;
714 }
715 }
716 }
717 }
718
719 if( bTransform )
721 }
722 }
723
725
726 pDoc->EnableUndo(bWasUndo);
728 return nRet == ERRCODE_NONE;
729}
730
732{
735 bool bDocRet = false;
736
737 if( !mxModel.is() )
738 {
739 SAL_WARN( "sd.filter","Got NO Model in XMLExport");
740 return false;
741 }
742
743 bool bLocked = mxModel->hasControllersLocked();
744
745 try
746 {
747 mxModel->lockControllers();
748
749 uno::Reference< lang::XServiceInfo > xServiceInfo( mxModel, uno::UNO_QUERY );
750
751 if( !xServiceInfo.is() || !xServiceInfo->supportsService( "com.sun.star.drawing.GenericDrawingDocument" ) )
752 {
753 SAL_WARN( "sd.filter", "Model is no DrawingDocument in XMLExport" );
754 return false;
755 }
756
757 uno::Reference<uno::XComponentContext> xContext( ::comphelper::getProcessComponentContext() );
758
759 uno::Reference< xml::sax::XWriter > xWriter = xml::sax::Writer::create( xContext );
760
762 static PropertyMapEntry const aExportInfoMap[] =
763 {
764 { OUString("ProgressRange"), 0, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0},
765 { OUString("ProgressMax"), 0, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0},
766 { OUString("ProgressCurrent"), 0, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0},
767 { OUString("UsePrettyPrinting"),0, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0},
768 { OUString("PageLayoutNames"), 0, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0},
769 { OUString("BaseURI"), 0, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0 },
770 { OUString("StreamRelPath"), 0, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0 },
771 { OUString("StreamName"), 0, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0 },
772 { OUString("StyleNames"), 0, cppu::UnoType<Sequence<OUString>>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0 },
773 { OUString("StyleFamilies"), 0, cppu::UnoType<Sequence<sal_Int32>>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0 },
774 { OUString("TargetStorage"), 0, cppu::UnoType<embed::XStorage>::get(), css::beans::PropertyAttribute::MAYBEVOID, 0 },
775 };
776
777 uno::Reference< beans::XPropertySet > xInfoSet( GenericPropertySet_CreateInstance( new PropertySetInfo( aExportInfoMap ) ) );
778
779 bool bUsePrettyPrinting = officecfg::Office::Common::Save::Document::PrettyPrinting::get();
780 xInfoSet->setPropertyValue( "UsePrettyPrinting", Any( bUsePrettyPrinting ) );
781
782 const uno::Reference < embed::XStorage >& xStorage = mrMedium.GetOutputStorage();
783
784 // Set base URI
785 OUString sPropName( "BaseURI" );
786 xInfoSet->setPropertyValue( sPropName, Any( mrMedium.GetBaseURL( true ) ) );
787
788 xInfoSet->setPropertyValue( "TargetStorage", Any( xStorage ) );
789
790 if( SfxObjectCreateMode::EMBEDDED == mrDocShell.GetCreateMode() )
791 {
792 OUString aName;
793 const SfxStringItem* pDocHierarchItem =
794 mrMedium.GetItemSet().GetItem(SID_DOC_HIERARCHICALNAME);
795 if ( pDocHierarchItem )
796 aName = pDocHierarchItem->GetValue();
797
798 if( !aName.isEmpty() )
799 {
800 sPropName = "StreamRelPath";
801 xInfoSet->setPropertyValue( sPropName, Any( aName ) );
802 }
803 }
804
805 // initialize descriptor
806 uno::Sequence< beans::PropertyValue > aDescriptor( 1 );
807 beans::PropertyValue* pProps = aDescriptor.getArray();
808
809 pProps[0].Name = "FileName";
810 pProps[0].Value <<= mrMedium.GetName();
811
812 {
813 uno::Reference< document::XEmbeddedObjectResolver > xObjectResolver;
814 uno::Reference<document::XGraphicStorageHandler> xGraphicStorageHandler;
815
816 // create helper for graphic and ole export if we have a storage
817 if( xStorage.is() )
818 {
819 xObjectHelper = SvXMLEmbeddedObjectHelper::Create( xStorage, *mrDocShell.GetDoc()->GetPersist(), SvXMLEmbeddedObjectHelperMode::Write );
820 xObjectResolver = xObjectHelper.get();
821
822 xGraphicHelper = SvXMLGraphicHelper::Create( xStorage, SvXMLGraphicHelperMode::Write );
823 xGraphicStorageHandler = xGraphicHelper.get();
824 }
825
827 if(mxStatusIndicator.is())
828 {
829 sal_Int32 nProgressRange(1000000);
830 OUString aMsg(SdResId(STR_SAVE_DOC));
831 mxStatusIndicator->start(aMsg, nProgressRange);
832
833 // set ProgressRange
834 uno::Any aProgRange;
835 aProgRange <<= nProgressRange;
836 xInfoSet->setPropertyValue( "ProgressRange" , aProgRange);
837
838 // set ProgressCurrent
839 uno::Any aProgCurrent;
840 aProgCurrent <<= sal_Int32(0);
841 xInfoSet->setPropertyValue( "ProgressCurrent" , aProgCurrent);
842 }
843
844 XML_SERVICES const * pServiceNames = getServices( false, IsDraw(), mnStoreVer );
845
846 XML_SERVICEMAP aServices[5]; sal_uInt16 i = 0;
847 aServices[i ].mpService = pServiceNames->mpStyles;
848 aServices[i++].mpStream = "styles.xml";
849
850 aServices[i ].mpService = pServiceNames->mpContent;
851 aServices[i++].mpStream = "content.xml";
852
853 aServices[i ].mpService = pServiceNames->mpSettings;
854 aServices[i++].mpStream = "settings.xml";
855
856 if( mrDocShell.GetCreateMode() != SfxObjectCreateMode::EMBEDDED )
857 {
858 aServices[i ].mpService = pServiceNames->mpMeta;
859 aServices[i++].mpStream = "meta.xml";
860 };
861
862 aServices[i].mpService = nullptr;
863 aServices[i].mpStream = nullptr;
864
865 XML_SERVICEMAP* pServices = aServices;
866
867 // doc export
868 do
869 {
870 SAL_INFO( "sd.filter", "exporting substream " << pServices->mpStream );
871
872 uno::Reference<io::XOutputStream> xDocOut;
873 if( xStorage.is() )
874 {
875 const OUString sDocName( OUString::createFromAscii( pServices->mpStream ) );
876 uno::Reference<io::XStream> xStream =
877 xStorage->openStreamElement( sDocName,
878 embed::ElementModes::READWRITE | embed::ElementModes::TRUNCATE );
879
880 DBG_ASSERT(xStream.is(), "Can't create output stream in package!");
881 if( !xStream.is() )
882 return false;
883
884 xDocOut = xStream->getOutputStream();
885 Reference <beans::XPropertySet > xProps( xStream, uno::UNO_QUERY );
886 if( !xDocOut.is() || !xProps.is() )
887 return false;
888
889 xProps->setPropertyValue( "MediaType", Any(OUString( "text/xml")));
890
891 // encrypt all streams
892 xProps->setPropertyValue( "UseCommonStoragePasswordEncryption",
893 uno::Any( true ) );
894
895 xInfoSet->setPropertyValue( "StreamName", Any( sDocName ) );
896 }
897
898 xWriter->setOutputStream( xDocOut );
899
900 uno::Sequence< uno::Any > aArgs( 2 + ( mxStatusIndicator.is() ? 1 : 0 ) + ( xGraphicStorageHandler.is() ? 1 : 0 ) + ( xObjectResolver.is() ? 1 : 0 ) );
901 uno::Any* pArgs = aArgs.getArray();
902 *pArgs++ <<= xInfoSet;
903 if (xGraphicStorageHandler.is())
904 *pArgs++ <<= xGraphicStorageHandler;
905 if (xObjectResolver.is())
906 *pArgs++ <<= xObjectResolver;
907 if (mxStatusIndicator.is())
908 *pArgs++ <<= mxStatusIndicator;
909
910 *pArgs <<= xWriter;
911
912 uno::Reference< document::XFilter > xFilter( xContext->getServiceManager()->createInstanceWithArgumentsAndContext( OUString::createFromAscii( pServices->mpService ), aArgs, xContext ), uno::UNO_QUERY );
913 if( xFilter.is() )
914 {
915 uno::Reference< document::XExporter > xExporter( xFilter, uno::UNO_QUERY );
916 if( xExporter.is() )
917 {
918 xExporter->setSourceDocument( mxModel );
919 // outputstream will be closed by SAX parser
920 bDocRet = xFilter->filter( aDescriptor );
921 }
922 }
923
924 pServices++;
925 }
926 while( bDocRet && pServices->mpService );
927
928 if(mxStatusIndicator.is())
929 mxStatusIndicator->end();
930 }
931 }
932 catch (const uno::Exception &)
933 {
934 TOOLS_WARN_EXCEPTION( "sd.filter", "uno Exception caught while exporting");
935 bDocRet = false;
936 }
937 if ( !bLocked )
938 mxModel->unlockControllers();
939
940 if( xGraphicHelper )
941 xGraphicHelper->dispose();
942 xGraphicHelper.clear();
943
944 if( xObjectHelper )
945 xObjectHelper->dispose();
946 xObjectHelper.clear();
947
948 return bDocRet;
949}
950
951extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportFODP(SvStream &rStream)
952{
953 SdDLL::Init();
954
955 sd::DrawDocShellRef xDocSh(new sd::DrawDocShell(SfxObjectCreateMode::EMBEDDED, false, DocumentType::Impress));
956 xDocSh->DoInitNew();
957 uno::Reference<frame::XModel> xModel(xDocSh->GetModel());
958
959 uno::Reference<lang::XMultiServiceFactory> xMultiServiceFactory(comphelper::getProcessServiceFactory());
960 uno::Reference<io::XInputStream> xStream(new ::utl::OSeekableInputStreamWrapper(rStream));
961 uno::Reference<uno::XInterface> xInterface(xMultiServiceFactory->createInstance("com.sun.star.comp.Writer.XmlFilterAdaptor"), uno::UNO_SET_THROW);
962
963 css::uno::Sequence<OUString> aUserData
964 {
965 "com.sun.star.comp.filter.OdfFlatXml",
966 "",
967 "com.sun.star.comp.Impress.XMLOasisImporter",
968 "com.sun.star.comp.Impress.XMLOasisExporter",
969 "",
970 "",
971 "true"
972 };
973 uno::Sequence<beans::PropertyValue> aAdaptorArgs(comphelper::InitPropertySequence(
974 {
975 { "UserData", uno::Any(aUserData) },
976 }));
977 css::uno::Sequence<uno::Any> aOuterArgs{ uno::Any(aAdaptorArgs) };
978
979 uno::Reference<lang::XInitialization> xInit(xInterface, uno::UNO_QUERY_THROW);
980 xInit->initialize(aOuterArgs);
981
982 uno::Reference<document::XImporter> xImporter(xInterface, uno::UNO_QUERY_THROW);
983 uno::Sequence<beans::PropertyValue> aArgs(comphelper::InitPropertySequence(
984 {
985 { "InputStream", uno::Any(xStream) },
986 { "URL", uno::Any(OUString("private:stream")) },
987 }));
988 xImporter->setTargetDocument(xModel);
989
990 uno::Reference<document::XFilter> xFilter(xInterface, uno::UNO_QUERY_THROW);
991 //SetLoading hack because the document properties will be re-initted
992 //by the xml filter and during the init, while it's considered uninitialized,
993 //setting a property will inform the document it's modified, which attempts
994 //to update the properties, which throws cause the properties are uninitialized
995 xDocSh->SetLoading(SfxLoadedFlags::NONE);
996 bool ret = xFilter->filter(aArgs);
997 xDocSh->SetLoading(SfxLoadedFlags::ALL);
998
999 xDocSh->DoClose();
1000
1001 return ret;
1002}
1003
1004extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportPPTX(SvStream &rStream)
1005{
1006 SdDLL::Init();
1007
1008 sd::DrawDocShellRef xDocSh(new sd::DrawDocShell(SfxObjectCreateMode::EMBEDDED, false, DocumentType::Impress));
1009 xDocSh->DoInitNew();
1010 uno::Reference<frame::XModel> xModel(xDocSh->GetModel());
1011
1012 uno::Reference<lang::XMultiServiceFactory> xMultiServiceFactory(comphelper::getProcessServiceFactory());
1013 uno::Reference<io::XInputStream> xStream(new utl::OSeekableInputStreamWrapper(rStream));
1014
1015 uno::Reference<document::XFilter> xFilter(xMultiServiceFactory->createInstance("com.sun.star.comp.oox.ppt.PowerPointImport"), uno::UNO_QUERY_THROW);
1016
1017 uno::Reference<document::XImporter> xImporter(xFilter, uno::UNO_QUERY_THROW);
1018 uno::Sequence<beans::PropertyValue> aArgs(comphelper::InitPropertySequence(
1019 {
1020 { "InputStream", uno::Any(xStream) },
1021 { "InputMode", uno::Any(true) },
1022 }));
1023 xImporter->setTargetDocument(xModel);
1024
1025 //SetLoading hack because the document properties will be re-initted
1026 //by the xml filter and during the init, while it's considered uninitialized,
1027 //setting a property will inform the document it's modified, which attempts
1028 //to update the properties, which throws cause the properties are uninitialized
1029 xDocSh->SetLoading(SfxLoadedFlags::NONE);
1030 bool ret = false;
1031 try
1032 {
1033 ret = xFilter->filter(aArgs);
1034 }
1035 catch (...)
1036 {
1037 }
1038 xDocSh->SetLoading(SfxLoadedFlags::ALL);
1039
1040 xDocSh->DoClose();
1041
1042 return ret;
1043}
1044
1045
1046/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Reference< XInputStream > xStream
const OUString & GetValue() const
bool IsWarning() const
bool anyOf(Args... args) const
static DialogMask HandleError(ErrCode nId, weld::Window *pParent=nullptr, DialogMask nMask=DialogMask::MAX)
static void Init()
Definition: sddll.cxx:218
void CreateFirstPages(SdDrawDocument const *pRefDocument=nullptr)
if the document does not contain at least one handout, one slide and one notes page with at least one...
Definition: drawdoc2.cxx:493
sal_uInt16 GetMasterSdPageCount(PageKind ePgKind) const
Definition: drawdoc2.cxx:222
SdOutliner * GetInternalOutliner(bool bCreateOutliner=true)
Definition: drawdoc.cxx:930
void StopWorkStartupDelay()
Definition: drawdoc2.cxx:932
SAL_DLLPRIVATE void UpdateAllLinks()
updates all links, only links in this document should by resolved
Definition: drawdoc.cxx:813
SdPage * GetMasterSdPage(sal_uInt16 nPgNum, PageKind ePgKind)
Definition: drawdoc2.cxx:217
SAL_DLLPRIVATE void NewOrLoadCompleted(DocCreationMode eMode)
Definition: drawdoc.cxx:687
SfxMedium & mrMedium
Definition: sdfilter.hxx:52
::sd::DrawDocShell & mrDocShell
Definition: sdfilter.hxx:53
css::uno::Reference< css::task::XStatusIndicator > mxStatusIndicator
Definition: sdfilter.hxx:50
css::uno::Reference< css::frame::XModel > mxModel
Definition: sdfilter.hxx:49
void CreateStatusIndicator()
Definition: sdfilter.cxx:53
bool IsDraw() const
Definition: sdfilter.hxx:45
The main purpose of this class is searching and replacing as well as spelling of impress documents.
Definition: Outliner.hxx:123
SdrObject * GetPresObj(PresObjKind eObjKind, int nIndex=1, bool bFuzzySearch=false)
returns the nIndex'th object from the given PresObjKind, index starts with 1
Definition: sdpage.cxx:203
virtual ~SdXMLFilter() override
Definition: sdxmlwrp.cxx:162
bool Export() override
Definition: sdxmlwrp.cxx:731
SdXMLFilter(SfxMedium &rMedium, ::sd::DrawDocShell &rDocShell, SdXMLFilterMode eFilterMode=SdXMLFilterMode::Normal, sal_uLong nStoreVer=SOFFICE_FILEFORMAT_8)
Definition: sdxmlwrp.cxx:157
bool Import(ErrCode &nError)
Definition: sdxmlwrp.cxx:443
SdXMLFilterMode meFilterMode
Definition: sdxmlwrp.hxx:48
sal_uLong mnStoreVer
Definition: sdxmlwrp.hxx:49
::comphelper::IEmbeddedHelper * GetPersist() const
bool IsStarDrawPreviewMode() const
void EnableUndo(bool bEnable)
bool IsUndoEnabled() const
void SetOutlinerParaObject(std::optional< OutlinerParaObject > pTextObject)
virtual OutlinerParaObject * GetOutlinerParaObject() const
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
const std::shared_ptr< const SfxFilter > & GetFilter() const
OUString GetBaseURL(bool bForSaving=false)
SfxItemSet & GetItemSet() const
const OUString & GetName() const
css::uno::Reference< css::embed::XStorage > GetStorage(bool bCreateTempFile=true)
css::uno::Reference< css::embed::XStorage > GetOutputStorage()
SfxObjectCreateMode GetCreateMode() const
const css::uno::Any & GetValue() const
static rtl::Reference< SvXMLEmbeddedObjectHelper > Create(const css::uno::Reference< css::embed::XStorage > &, ::comphelper::IEmbeddedHelper &rDocPersist, SvXMLEmbeddedObjectHelperMode eCreateMode)
static rtl::Reference< SvXMLGraphicHelper > Create(const css::uno::Reference< css::embed::XStorage > &rXMLStorage, SvXMLGraphicHelperMode eCreateMode)
css::uno::Type const & get()
void ClearUndoBuffer()
Definition: docshell.cxx:455
SdDrawDocument * GetDoc()
#define DBG_ASSERT(sCon, aError)
OString exceptionToString(const css::uno::Any &caught)
#define TOOLS_WARN_EXCEPTION(area, stream)
SVXCORE_DLLPUBLIC OUString SvxResId(TranslateId aId)
float u
constexpr TypedWhichId< SvxNumBulletItem > EE_PARA_NUMBULLET(EE_PARA_START+5)
#define ERRCODE_IO_BROKENPACKAGE
#define ERRCODE_NONE
#define SOFFICE_FILEFORMAT_60
sal_Int32 nIndex
OUString aName
void * p
#define SAL_INFO_IF(condition, area, stream)
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
COMPHELPER_DLLPUBLIC css::uno::Reference< css::beans::XPropertySet > GenericPropertySet_CreateInstance(PropertySetInfo *pInfo)
Reference< XMultiServiceFactory > getProcessServiceFactory()
Reference< XComponentContext > getProcessComponentContext()
css::uno::Sequence< css::beans::PropertyValue > InitPropertySequence(::std::initializer_list< ::std::pair< OUString, css::uno::Any > > vInit)
Any SAL_CALL getCaughtException()
int i
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
OUString typeName
#define ERR_FORMAT_FILE_ROWCOL
Definition: sderror.hxx:26
#define ERR_FORMAT_ROWCOL
Definition: sderror.hxx:25
#define WARN_FORMAT_FILE_ROWCOL
Definition: sderror.hxx:29
OUString SdResId(TranslateId aId)
Definition: sdmod.cxx:83
void TransformOOo2xDocument(SdDrawDocument *pDocument)
transforms the given model from OOo 2.x to OOo 3.x.
Definition: sdtransform.cxx:75
SAL_DLLPUBLIC_EXPORT bool TestImportFODP(SvStream &rStream)
Definition: sdxmlwrp.cxx:951
char const sXML_export_draw_content_oasis_service[]
Definition: sdxmlwrp.cxx:95
SAL_DLLPUBLIC_EXPORT bool TestImportPPTX(SvStream &rStream)
Definition: sdxmlwrp.cxx:1004
char const sXML_import_draw_styles_ooo_service[]
Definition: sdxmlwrp.cxx:115
char const sXML_import_draw_settings_oasis_service[]
Definition: sdxmlwrp.cxx:106
char const sXML_export_draw_settings_oasis_service[]
Definition: sdxmlwrp.cxx:96
char const sXML_import_impress_styles_oasis_service[]
Definition: sdxmlwrp.cxx:99
char const sXML_export_impress_content_oasis_service[]
Definition: sdxmlwrp.cxx:90
char const sXML_import_draw_meta_oasis_service[]
Definition: sdxmlwrp.cxx:103
static XML_SERVICES const * getServices(bool bImport, bool bDraw, sal_uLong nStoreVer)
Definition: sdxmlwrp.cxx:137
char const sXML_import_impress_meta_oasis_service[]
Definition: sdxmlwrp.cxx:98
char const sXML_import_draw_content_ooo_service[]
Definition: sdxmlwrp.cxx:116
char const sXML_import_draw_meta_ooo_service[]
Definition: sdxmlwrp.cxx:114
char const sXML_export_impress_settings_oasis_service[]
Definition: sdxmlwrp.cxx:91
char const sXML_import_draw_styles_oasis_service[]
Definition: sdxmlwrp.cxx:104
char const sXML_import_impress_settings_ooo_service[]
Definition: sdxmlwrp.cxx:112
#define SD_XML_READERROR
Definition: sdxmlwrp.cxx:86
char const sXML_export_impress_styles_oasis_service[]
Definition: sdxmlwrp.cxx:89
char const sXML_import_impress_meta_ooo_service[]
Definition: sdxmlwrp.cxx:109
char const sXML_import_impress_settings_oasis_service[]
Definition: sdxmlwrp.cxx:101
char const sXML_import_impress_content_oasis_service[]
Definition: sdxmlwrp.cxx:100
static void fixupOutlinePlaceholderNumberingDepths(SdDrawDocument *pDoc)
Definition: sdxmlwrp.cxx:396
char const sXML_import_draw_content_oasis_service[]
Definition: sdxmlwrp.cxx:105
char const sXML_export_draw_styles_oasis_service[]
Definition: sdxmlwrp.cxx:94
char const sXML_import_impress_content_ooo_service[]
Definition: sdxmlwrp.cxx:111
char const sXML_import_draw_settings_ooo_service[]
Definition: sdxmlwrp.cxx:117
char const sXML_import_impress_styles_ooo_service[]
Definition: sdxmlwrp.cxx:110
char const sXML_export_impress_meta_oasis_service[]
Definition: sdxmlwrp.cxx:88
char const sXML_export_draw_meta_oasis_service[]
Definition: sdxmlwrp.cxx:93
SdXMLFilterMode
Definition: sdxmlwrp.hxx:29
@ Organizer
only for import, only the styles are loaded
#define ERRCODE_SFX_WRONGPASSWORD
sal_uIntPtr sal_uLong
Reference< XModel > xModel