LibreOffice Module xmloff (master)  1
sdxmlimp.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 <osl/thread.h>
21 #include <sal/log.hxx>
23 #include <comphelper/sequence.hxx>
24 
25 #include <xmloff/xmlscripti.hxx>
26 #include "sdxmlimp_impl.hxx"
27 #include "ximpbody.hxx"
28 
29 #include <xmloff/xmlmetai.hxx>
30 #include "ximpstyl.hxx"
31 #include <xmloff/xmlnamespace.hxx>
32 #include <xmloff/xmltoken.hxx>
34 #include <com/sun/star/awt/Rectangle.hpp>
35 #include <com/sun/star/form/XFormsSupplier.hpp>
36 #include <com/sun/star/frame/XModel.hpp>
37 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
38 #include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
39 #include <com/sun/star/drawing/XMasterPagesSupplier.hpp>
40 #include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
41 #include <xmloff/settingsstore.hxx>
43 
45 
46 #include <com/sun/star/document/XDocumentProperties.hpp>
47 #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
48 
49 using namespace ::com::sun::star;
50 using namespace ::xmloff::token;
51 
52 namespace {
53 
54 class SdXMLBodyContext_Impl : public SvXMLImportContext
55 {
56  SdXMLImport& GetSdImport() { return static_cast<SdXMLImport&>(GetImport()); }
57 
58 public:
59 
60  SdXMLBodyContext_Impl( SdXMLImport& rImport );
61 
62  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
63  sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
64 };
65 
66 }
67 
68 SdXMLBodyContext_Impl::SdXMLBodyContext_Impl( SdXMLImport& rImport ) :
69  SvXMLImportContext( rImport )
70 {
71 }
72 
73 css::uno::Reference< css::xml::sax::XFastContextHandler > SdXMLBodyContext_Impl::createFastChildContext(
74  sal_Int32 /*nElement*/,
75  const uno::Reference< xml::sax::XFastAttributeList > & /*xAttrList*/ )
76 {
77  return new SdXMLBodyContext(GetSdImport());
78 }
79 
80 namespace {
81 
82 // NB: virtually inherit so we can multiply inherit properly
83 // in SdXMLFlatDocContext_Impl
84 class SdXMLDocContext_Impl : public virtual SvXMLImportContext
85 {
86 protected:
87  SdXMLImport& GetSdImport() { return static_cast<SdXMLImport&>(GetImport()); }
88 
89 public:
90  SdXMLDocContext_Impl( SdXMLImport& rImport );
91 
92  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
93  sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
94 };
95 
96 }
97 
98 SdXMLDocContext_Impl::SdXMLDocContext_Impl(
99  SdXMLImport& rImport )
100 : SvXMLImportContext(rImport)
101 {
102 }
103 
104 uno::Reference< xml::sax::XFastContextHandler > SAL_CALL SdXMLDocContext_Impl::createFastChildContext(
105  sal_Int32 nElement, const uno::Reference< xml::sax::XFastAttributeList >& /*xAttrList*/ )
106 {
107  switch (nElement)
108  {
109  case XML_ELEMENT(OFFICE, XML_SCRIPTS):
110  {
111  if( GetImport().getImportFlags() & SvXMLImportFlags::SCRIPTS )
112  {
113  // office:script inside office:document
114  return new XMLScriptContext( GetSdImport(), GetSdImport().GetModel() );
115  }
116  break;
117  }
118  case XML_ELEMENT(OFFICE, XML_MASTER_STYLES):
119  {
120  if( GetImport().getImportFlags() & SvXMLImportFlags::MASTERSTYLES )
121  {
122  // office:master-styles inside office:document
123  return GetSdImport().CreateMasterStylesContext();
124  }
125  break;
126  }
127  case XML_ELEMENT(OFFICE, XML_BODY):
128  {
129  if( GetImport().getImportFlags() & SvXMLImportFlags::CONTENT )
130  {
131  // office:body inside office:document
132  return new SdXMLBodyContext_Impl(GetSdImport());
133  }
134  break;
135  }
136  case XML_ELEMENT(OFFICE, XML_SETTINGS):
137  {
138  if( GetImport().getImportFlags() & SvXMLImportFlags::SETTINGS )
139  {
140  return new XMLDocumentSettingsContext(GetImport());
141  }
142  break;
143  }
144  case XML_ELEMENT(OFFICE, XML_STYLES):
145  {
146  if( GetImport().getImportFlags() & SvXMLImportFlags::STYLES )
147  {
148  // office:styles inside office:document
149  return GetSdImport().CreateStylesContext();
150  }
151  break;
152  }
153  case XML_ELEMENT(OFFICE, XML_AUTOMATIC_STYLES):
154  {
155  if( GetImport().getImportFlags() & SvXMLImportFlags::AUTOSTYLES )
156  {
157  // office:automatic-styles inside office:document
158  return GetSdImport().CreateAutoStylesContext();
159  }
160  break;
161  }
162  case XML_ELEMENT(OFFICE, XML_FONT_FACE_DECLS):
163  {
164  return GetSdImport().CreateFontDeclsContext();
165  break;
166  }
167  case XML_ELEMENT(OFFICE, XML_META):
168  {
169  SAL_INFO("xmloff.draw", "XML_ELEMENT(OFFICE, XML_META): should not have come here, maybe document is invalid?");
170  break;
171  }
172  }
173  return nullptr;
174 }
175 
176 namespace {
177 
178 // context for flat file xml format
179 class SdXMLFlatDocContext_Impl
180  : public SdXMLDocContext_Impl, public SvXMLMetaDocumentContext
181 {
182 public:
183  SdXMLFlatDocContext_Impl( SdXMLImport& i_rImport,
184  const uno::Reference<document::XDocumentProperties>& i_xDocProps );
185 
186  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
187  sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
188 };
189 
190 }
191 
192 SdXMLFlatDocContext_Impl::SdXMLFlatDocContext_Impl( SdXMLImport& i_rImport,
193  const uno::Reference<document::XDocumentProperties>& i_xDocProps) :
194  SvXMLImportContext(i_rImport),
195  SdXMLDocContext_Impl(i_rImport),
196  SvXMLMetaDocumentContext(i_rImport, i_xDocProps)
197 {
198 }
199 
200 uno::Reference< xml::sax::XFastContextHandler > SAL_CALL SdXMLFlatDocContext_Impl::createFastChildContext(
201  sal_Int32 nElement, const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
202 {
203  // behave like meta base class iff we encounter office:meta
204  if ( nElement == XML_ELEMENT( OFFICE, XML_META ) ) {
206  nElement, xAttrList );
207  } else {
208  return SdXMLDocContext_Impl::createFastChildContext(
209  nElement, xAttrList );
210  }
211 }
212 
213 extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
215  uno::XComponentContext* pCtx, uno::Sequence<uno::Any> const& /*rSeq*/)
216 {
217  return cppu::acquire(
218  new SdXMLImport(pCtx, "XMLImpressImportOasis", false, SvXMLImportFlags::ALL));
219 }
220 
221 extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
223  uno::Sequence<uno::Any> const& /*rSeq*/)
224 {
225  return cppu::acquire(new SdXMLImport(pCtx, "XMLDrawImportOasis", true, SvXMLImportFlags::ALL));
226 }
227 
228 extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
230  uno::Sequence<uno::Any> const& /*rSeq*/)
231 {
232  return cppu::acquire(new SdXMLImport(pCtx, "XMLDrawStylesImportOasis", true,
235 }
236 
237 extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
239  uno::XComponentContext* pCtx, uno::Sequence<uno::Any> const& /*rSeq*/)
240 {
241  return cppu::acquire(new SdXMLImport(pCtx, "XMLDrawContentImportOasis", true,
245 }
246 
247 extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
249  uno::XComponentContext* pCtx, uno::Sequence<uno::Any> const& /*rSeq*/)
250 {
251  return cppu::acquire(
252  new SdXMLImport(pCtx, "XMLDrawMetaImportOasis", true, SvXMLImportFlags::META));
253 }
254 
255 extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
257  uno::XComponentContext* pCtx, uno::Sequence<uno::Any> const& /*rSeq*/)
258 {
259  return cppu::acquire(
260  new SdXMLImport(pCtx, "XMLDrawSettingsImportOasis", true, SvXMLImportFlags::SETTINGS));
261 }
262 
263 extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
265  uno::XComponentContext* pCtx, uno::Sequence<uno::Any> const& /*rSeq*/)
266 {
267  return cppu::acquire(new SdXMLImport(pCtx, "XMLImpressStylesImportOasis", false,
270 }
271 
272 extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
274  uno::XComponentContext* pCtx, uno::Sequence<uno::Any> const& /*rSeq*/)
275 {
276  return cppu::acquire(new SdXMLImport(pCtx, "XMLImpressContentImportOasis", false,
280 }
281 
282 extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
284  uno::XComponentContext* pCtx, uno::Sequence<uno::Any> const& /*rSeq*/)
285 {
286  return cppu::acquire(
287  new SdXMLImport(pCtx, "XMLImpressMetaImportOasis", false, SvXMLImportFlags::META));
288 }
289 
290 extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
292  uno::XComponentContext* pCtx, uno::Sequence<uno::Any> const& /*rSeq*/)
293 {
294  return cppu::acquire(
295  new SdXMLImport(pCtx, "XMLImpressSettingsImportOasis", false, SvXMLImportFlags::SETTINGS));
296 }
297 
299  const css::uno::Reference< css::uno::XComponentContext >& xContext,
300  OUString const & implementationName,
301  bool bIsDraw, SvXMLImportFlags nImportFlags )
302 : SvXMLImport( xContext, implementationName, nImportFlags ),
303  mnNewPageCount(0),
304  mnNewMasterPageCount(0),
305  mbIsDraw(bIsDraw),
306  mbLoadDoc(true),
307  mbPreview(false)
308 {
309  // add namespaces
314 
317  GetXMLToken(XML_N_SMIL_COMPAT),
319 }
320 
321 // XImporter
322 void SAL_CALL SdXMLImport::setTargetDocument( const uno::Reference< lang::XComponent >& xDoc )
323 {
325 
326  uno::Reference< lang::XServiceInfo > xDocServices( GetModel(), uno::UNO_QUERY );
327  if( !xDocServices.is() )
328  throw lang::IllegalArgumentException();
329 
330  mbIsDraw = !xDocServices->supportsService("com.sun.star.presentation.PresentationDocument");
331 
332  // prepare access to styles
333  uno::Reference< style::XStyleFamiliesSupplier > xFamSup( GetModel(), uno::UNO_QUERY );
334  if(xFamSup.is())
335  mxDocStyleFamilies = xFamSup->getStyleFamilies();
336 
337  // prepare access to master pages
338  uno::Reference < drawing::XMasterPagesSupplier > xMasterPagesSupplier(GetModel(), uno::UNO_QUERY);
339  if(xMasterPagesSupplier.is())
340  mxDocMasterPages = xMasterPagesSupplier->getMasterPages();
341 
342  // prepare access to draw pages
343  uno::Reference <drawing::XDrawPagesSupplier> xDrawPagesSupplier(GetModel(), uno::UNO_QUERY);
344  if(!xDrawPagesSupplier.is())
345  throw lang::IllegalArgumentException();
346 
347  mxDocDrawPages = xDrawPagesSupplier->getDrawPages();
348  if(!mxDocDrawPages.is())
349  throw lang::IllegalArgumentException();
350 
351  if( mxDocDrawPages.is() && mxDocDrawPages->getCount() > 0 )
352  {
353  uno::Reference< form::XFormsSupplier > xFormsSupp;
354  mxDocDrawPages->getByIndex(0) >>= xFormsSupp;
355  mbIsFormsSupported = xFormsSupp.is();
356  }
357 
358  // #88546# enable progress bar increments, SdXMLImport is only used for
359  // draw/impress import
360  GetShapeImport()->enableHandleProgressBar();
361 
362  uno::Reference< lang::XMultiServiceFactory > xFac( GetModel(), uno::UNO_QUERY );
363  if( xFac.is() )
364  {
365  uno::Sequence< OUString > sSNS( xFac->getAvailableServiceNames() );
366  if (comphelper::findValue(sSNS, "com.sun.star.drawing.TableShape") != -1)
368  }
369 }
370 
371 // XInitialization
372 void SAL_CALL SdXMLImport::initialize( const uno::Sequence< uno::Any >& aArguments )
373 {
374  SvXMLImport::initialize( aArguments );
375 
376  uno::Reference< beans::XPropertySet > xInfoSet( getImportInfo() );
377  if( !xInfoSet.is() )
378  return;
379 
380  uno::Reference< beans::XPropertySetInfo > xInfoSetInfo( xInfoSet->getPropertySetInfo() );
381 
382  if( xInfoSetInfo->hasPropertyByName( gsPageLayouts ) )
383  xInfoSet->getPropertyValue( gsPageLayouts ) >>= mxPageLayouts;
384 
385  if( xInfoSetInfo->hasPropertyByName( gsPreview ) )
386  xInfoSet->getPropertyValue( gsPreview ) >>= mbPreview;
387 
388  OUString const sOrganizerMode(
389  "OrganizerMode");
390  if (xInfoSetInfo->hasPropertyByName(sOrganizerMode))
391  {
392  bool bStyleOnly(false);
393  if (xInfoSet->getPropertyValue(sOrganizerMode) >>= bStyleOnly)
394  {
395  mbLoadDoc = !bStyleOnly;
396  }
397  }
398 }
399 
401  const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
402 {
403  SvXMLImportContext* pContext = nullptr;
404 
405  switch (nElement)
406  {
410  pContext = new SdXMLDocContext_Impl(*this);
411  break;
413  pContext = CreateMetaContext(nElement, xAttrList);
414  break;
416  {
417  uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
418  GetModel(), uno::UNO_QUERY_THROW);
419  // flat OpenDocument file format
420  pContext = new SdXMLFlatDocContext_Impl( *this, xDPS->getDocumentProperties());
421  }
422  break;
423  }
424  return pContext;
425 }
426 
428  const uno::Reference<xml::sax::XFastAttributeList>&)
429 {
430  SvXMLImportContext* pContext = nullptr;
431 
433  {
434  uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
435  GetModel(), uno::UNO_QUERY_THROW);
436  uno::Reference<document::XDocumentProperties> const xDocProps(
437  !mbLoadDoc ? nullptr : xDPS->getDocumentProperties());
438  pContext = new SvXMLMetaDocumentContext(*this, xDocProps);
439  }
440 
441  return pContext;
442 }
443 
445 {
446  if(GetShapeImport()->GetStylesContext())
447  return GetShapeImport()->GetStylesContext();
448 
449  GetShapeImport()->SetStylesContext(new SdXMLStylesContext(
450  *this, false));
451 
452  return GetShapeImport()->GetStylesContext();
453 }
454 
456 {
457  if(GetShapeImport()->GetAutoStylesContext())
458  return GetShapeImport()->GetAutoStylesContext();
459 
460  GetShapeImport()->SetAutoStylesContext(new SdXMLStylesContext(
461  *this, true));
462 
463  return GetShapeImport()->GetAutoStylesContext();
464 }
465 
467 {
468  if (!mxMasterStylesContext.is())
470  return mxMasterStylesContext.get();
471 }
472 
474 {
475  XMLFontStylesContext *pFSContext =
476  new XMLFontStylesContext( *this, osl_getThreadTextEncoding() );
477  SetFontDecls( pFSContext );
478  return pFSContext;
479 }
480 
481 void SdXMLImport::SetViewSettings(const css::uno::Sequence<css::beans::PropertyValue>& aViewProps)
482 {
483  uno::Reference< beans::XPropertySet > xPropSet( GetModel(), uno::UNO_QUERY );
484  if( !xPropSet.is() )
485  return;
486 
487  awt::Rectangle aVisArea( 0,0, 28000, 21000 );
488 
489  for( const auto& rViewProp : aViewProps )
490  {
491  const OUString& rName = rViewProp.Name;
492  const uno::Any rValue = rViewProp.Value;
493 
494  if ( rName == "VisibleAreaTop" )
495  {
496  rValue >>= aVisArea.Y;
497  }
498  else if ( rName == "VisibleAreaLeft" )
499  {
500  rValue >>= aVisArea.X;
501  }
502  else if ( rName == "VisibleAreaWidth" )
503  {
504  rValue >>= aVisArea.Width;
505  }
506  else if ( rName == "VisibleAreaHeight" )
507  {
508  rValue >>= aVisArea.Height;
509  }
510  }
511 
512  try
513  {
514  xPropSet->setPropertyValue("VisibleArea", uno::makeAny( aVisArea ) );
515  }
516  catch(const css::uno::Exception&)
517  {
518 /* #i79978# since old documents may contain invalid view settings, this is nothing to worry the user about.
519  uno::Sequence<OUString> aSeq(0);
520  SetError( XMLERROR_FLAG_WARNING | XMLERROR_API, aSeq, e.Message, NULL );
521 */
522  }
523 }
524 
525 void SdXMLImport::SetConfigurationSettings(const css::uno::Sequence<css::beans::PropertyValue>& aConfigProps)
526 {
527  uno::Reference< lang::XMultiServiceFactory > xFac( GetModel(), uno::UNO_QUERY );
528  if( !xFac.is() )
529  return;
530 
531  uno::Reference< beans::XPropertySet > xProps( xFac->createInstance("com.sun.star.document.Settings"), uno::UNO_QUERY );
532  if( !xProps.is() )
533  return;
534 
535  uno::Reference< beans::XPropertySetInfo > xInfo( xProps->getPropertySetInfo() );
536  if( !xInfo.is() )
537  return;
538 
539  const uno::Sequence<beans::PropertyValue>* pValues = &aConfigProps;
540 
542  pFilter = dynamic_cast<DocumentSettingsSerializer *>(xProps.get());
543  uno::Sequence<beans::PropertyValue> aFiltered;
544  if( pFilter )
545  {
546  aFiltered = pFilter->filterStreamsFromStorage( GetDocumentBase(), GetSourceStorage(), aConfigProps );
547  pValues = &aFiltered;
548  }
549 
550  for( const auto& rValue : *pValues )
551  {
552  try
553  {
554  const OUString& rProperty = rValue.Name;
555  if( xInfo->hasPropertyByName( rProperty ) )
556  xProps->setPropertyValue( rProperty, rValue.Value );
557  }
558  catch(const uno::Exception&)
559  {
560  SAL_INFO("xmloff.draw", "#SdXMLImport::SetConfigurationSettings: Exception!" );
561  }
562  }
563 }
564 
565 // #80365# override this method to read and use the hint value from the
566 // written meta information. If no info is found, guess 10 draw objects
567 //void SdXMLImport::SetStatisticAttributes(const uno::Reference<xml::sax::XAttributeList>& xAttrList)
569  const uno::Sequence<beans::NamedValue> & i_rStats)
570 {
571  static const char* s_stats[] =
572  { "ObjectCount", nullptr };
573 
574  SvXMLImport::SetStatistics(i_rStats);
575 
576  sal_uInt32 nCount(10);
577  for (const auto& rStat : i_rStats) {
578  for (const char** pStat = s_stats; *pStat != nullptr; ++pStat) {
579  if (rStat.Name.equalsAscii(*pStat)) {
580  sal_Int32 val = 0;
581  if (rStat.Value >>= val) {
582  nCount = val;
583  } else {
584  SAL_WARN("xmloff.draw", "SdXMLImport::SetStatistics: invalid entry");
585  }
586  }
587  }
588  }
589 
590  if(nCount)
591  {
594  }
595 }
596 
597 void SdXMLImport::AddHeaderDecl( const OUString& rName, const OUString& rText )
598 {
599  if( !rName.isEmpty() && !rText.isEmpty() )
600  maHeaderDeclsMap[rName] = rText;
601 }
602 
603 void SdXMLImport::AddFooterDecl( const OUString& rName, const OUString& rText )
604 {
605  if( !rName.isEmpty() && !rText.isEmpty() )
606  maFooterDeclsMap[rName] = rText;
607 }
608 
609 void SdXMLImport::AddDateTimeDecl( const OUString& rName, const OUString& rText, bool bFixed, const OUString& rDateTimeFormat )
610 {
611  if( !rName.isEmpty() && (!rText.isEmpty() || !bFixed) )
612  {
614  aDecl.maStrText = rText;
615  aDecl.mbFixed = bFixed;
616  aDecl.maStrDateTimeFormat = rDateTimeFormat;
617  maDateTimeDeclsMap[rName] = aDecl;
618  }
619 }
620 
621 OUString SdXMLImport::GetHeaderDecl( const OUString& rName ) const
622 {
623  OUString aRet;
624  HeaderFooterDeclMap::const_iterator aIter( maHeaderDeclsMap.find( rName ) );
625  if( aIter != maHeaderDeclsMap.end() )
626  aRet = (*aIter).second;
627 
628  return aRet;
629 }
630 
631 OUString SdXMLImport::GetFooterDecl( const OUString& rName ) const
632 {
633  OUString aRet;
634  HeaderFooterDeclMap::const_iterator aIter( maFooterDeclsMap.find( rName ) );
635  if( aIter != maFooterDeclsMap.end() )
636  aRet = (*aIter).second;
637 
638  return aRet;
639 }
640 
641 OUString SdXMLImport::GetDateTimeDecl( const OUString& rName, bool& rbFixed, OUString& rDateTimeFormat )
642 {
644 
645  DateTimeDeclMap::const_iterator aIter( maDateTimeDeclsMap.find( rName ) );
646  if( aIter != maDateTimeDeclsMap.end() )
647  aDecl = (*aIter).second;
648 
649  rbFixed = aDecl.mbFixed;
650  rDateTimeFormat = aDecl.maStrDateTimeFormat;
651  return aDecl.maStrText;
652 }
653 
655 {
656  uno::Reference< lang::XMultiServiceFactory > xFac( GetModel(), uno::UNO_QUERY );
657  if( xFac.is() )
658  {
659  uno::Reference< beans::XPropertySet > xProps( xFac->createInstance("com.sun.star.document.Settings"), uno::UNO_QUERY );
660  if( xProps.is() )
661  xProps->setPropertyValue("EmbedFonts", uno::makeAny( true ) );
662  }
663 }
664 
665 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool mbIsFormsSupported
Definition: xmlimp.hxx:252
void AddFooterDecl(const OUString &rName, const OUString &rText)
Definition: sdxmlimp.cxx:603
static constexpr OUStringLiteral gsPreview
virtual SvXMLImportContext * CreateFastContext(sal_Int32 nElement, const ::css::uno::Reference< ::css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: sdxmlimp.cxx:400
SAL_DLLPUBLIC_EXPORT uno::XInterface * com_sun_star_comp_Impress_XMLOasisContentImporter_get_implementation(uno::XComponentContext *pCtx, uno::Sequence< uno::Any > const &)
Definition: sdxmlimp.cxx:273
sal_Int32 findValue(const css::uno::Sequence< T1 > &_rList, const T2 &_rValue)
SvXMLImport & GetImport()
Definition: xmlictxt.hxx:56
css::uno::Reference< css::container::XIndexAccess > mxDocMasterPages
virtual void SetViewSettings(const css::uno::Sequence< css::beans::PropertyValue > &aViewProps) override
Definition: sdxmlimp.cxx:481
SvXMLNamespaceMap & GetNamespaceMap()
Definition: xmlimp.hxx:393
virtual void SAL_CALL setTargetDocument(const css::uno::Reference< css::lang::XComponent > &xDoc) override
Definition: sdxmlimp.cxx:322
css::uno::Reference< css::embed::XStorage > const & GetSourceStorage() const
Definition: xmlimp.cxx:1327
OUString GetDocumentBase() const
Definition: xmlimp.cxx:1780
void SetFontDecls(XMLFontStylesContext *pFontDecls)
Definition: xmlimp.cxx:1510
css::uno::Any const & rValue
Definition: ImageStyle.hxx:38
SvXMLImportFlags
Definition: xmlimp.hxx:110
OUString GetHeaderDecl(const OUString &rName) const
Definition: sdxmlimp.cxx:621
css::uno::Reference< css::container::XNameAccess > mxPageLayouts
int nCount
virtual void NotifyContainsEmbeddedFont() override
Definition: sdxmlimp.cxx:654
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &aArguments) override
Definition: xmlimp.cxx:932
virtual css::uno::Sequence< css::beans::PropertyValue > filterStreamsFromStorage(OUString const &referer, const css::uno::Reference< css::embed::XStorage > &xStorage, const css::uno::Sequence< css::beans::PropertyValue > &aConfigProps)=0
SAL_DLLPUBLIC_EXPORT uno::XInterface * com_sun_star_comp_Impress_XMLOasisStylesImporter_get_implementation(uno::XComponentContext *pCtx, uno::Sequence< uno::Any > const &)
Definition: sdxmlimp.cxx:264
SAL_DLLPUBLIC_EXPORT uno::XInterface * com_sun_star_comp_Draw_XMLOasisContentImporter_get_implementation(uno::XComponentContext *pCtx, uno::Sequence< uno::Any > const &)
Definition: sdxmlimp.cxx:238
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: xmlmetai.cxx:223
HeaderFooterDeclMap maFooterDeclsMap
SvXMLImportContext * CreateMetaContext(const sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
Definition: sdxmlimp.cxx:427
bool mbIsTableShapeSupported
Definition: xmlimp.hxx:253
SAL_DLLPUBLIC_EXPORT uno::XInterface * com_sun_star_comp_Draw_XMLOasisImporter_get_implementation(uno::XComponentContext *pCtx, uno::Sequence< uno::Any > const &)
Definition: sdxmlimp.cxx:222
SAL_DLLPUBLIC_EXPORT uno::XInterface * com_sun_star_comp_Draw_XMLOasisMetaImporter_get_implementation(uno::XComponentContext *pCtx, uno::Sequence< uno::Any > const &)
Definition: sdxmlimp.cxx:248
SvXMLStylesContext * CreateAutoStylesContext()
Definition: sdxmlimp.cxx:455
SvXMLImportContext * CreateFontDeclsContext()
Definition: sdxmlimp.cxx:473
HeaderFooterDeclMap maHeaderDeclsMap
SAL_DLLPUBLIC_EXPORT uno::XInterface * com_sun_star_comp_Draw_XMLOasisSettingsImporter_get_implementation(uno::XComponentContext *pCtx, uno::Sequence< uno::Any > const &)
Definition: sdxmlimp.cxx:256
rtl::Reference< SdXMLMasterStylesContext > mxMasterStylesContext
ProgressBarHelper * GetProgressBarHelper()
Definition: xmlimp.cxx:1419
void AddDateTimeDecl(const OUString &rName, const OUString &rText, bool bFixed, const OUString &rDateTimeFormat)
Definition: sdxmlimp.cxx:609
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &aArguments) override
Definition: sdxmlimp.cxx:372
void AddHeaderDecl(const OUString &rName, const OUString &rText)
Definition: sdxmlimp.cxx:597
SvXMLImportContext * CreateMasterStylesContext()
Definition: sdxmlimp.cxx:466
This class deliberately does not support XWeak, to improve performance when loading large documents...
Definition: xmlictxt.hxx:45
virtual void SetConfigurationSettings(const css::uno::Sequence< css::beans::PropertyValue > &aConfigProps) override
Definition: sdxmlimp.cxx:525
SvXMLStylesContext * CreateStylesContext()
Definition: sdxmlimp.cxx:444
css::uno::Reference< css::container::XNameAccess > mxDocStyleFamilies
constexpr sal_uInt16 XML_NAMESPACE_PRESENTATION
SAL_DLLPUBLIC_EXPORT uno::XInterface * com_sun_star_comp_Impress_XMLOasisSettingsImporter_get_implementation(uno::XComponentContext *pCtx, uno::Sequence< uno::Any > const &)
Definition: sdxmlimp.cxx:291
const PropertyValue * pValues
OUString GetFooterDecl(const OUString &rName) const
Definition: sdxmlimp.cxx:631
SvXMLImportFlags getImportFlags() const
Definition: xmlimp.hxx:451
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
return the OUString representation for eToken
Definition: xmltoken.cxx:3406
constexpr sal_uInt16 XML_NAMESPACE_SMIL
OUString GetDateTimeDecl(const OUString &rName, bool &rbFixed, OUString &rDateTimeFormat)
Definition: sdxmlimp.cxx:641
Handling of tokens in XML:
static constexpr OUStringLiteral gsPageLayouts
#define SAL_INFO(area, stream)
virtual css::uno::Reference< XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
Definition: xmlictxt.cxx:59
virtual void SetStatistics(const css::uno::Sequence< css::beans::NamedValue > &i_rStats)
Definition: xmlimp.cxx:882
#define XML_ELEMENT(prefix, name)
Definition: xmlimp.hxx:96
sal_uInt16 Add(const OUString &rPrefix, const OUString &rName, sal_uInt16 nKey=XML_NAMESPACE_UNKNOWN)
const css::uno::Reference< css::frame::XModel > & GetModel() const
Definition: xmlimp.hxx:399
void SetValue(sal_Int32 nValue)
css::uno::Reference< css::container::XIndexAccess > mxDocDrawPages
const struct statistic s_stats[]
SAL_DLLPUBLIC_EXPORT uno::XInterface * com_sun_star_comp_Impress_XMLOasisImporter_get_implementation(uno::XComponentContext *pCtx, uno::Sequence< uno::Any > const &)
Definition: sdxmlimp.cxx:214
const css::uno::Reference< css::beans::XPropertySet > & getImportInfo() const
Definition: xmlimp.hxx:381
void SetReference(sal_Int32 nVal)
handles the top-level office:document-meta element of meta.xml documents
Definition: xmlmetai.hxx:35
virtual void SetStatistics(const css::uno::Sequence< css::beans::NamedValue > &i_rStats) override
Definition: sdxmlimp.cxx:568
#define SAL_WARN(area, stream)
SAL_DLLPUBLIC_EXPORT uno::XInterface * com_sun_star_comp_Impress_XMLOasisMetaImporter_get_implementation(uno::XComponentContext *pCtx, uno::Sequence< uno::Any > const &)
Definition: sdxmlimp.cxx:283
virtual void SAL_CALL setTargetDocument(const css::uno::Reference< css::lang::XComponent > &xDoc) override
Definition: xmlimp.cxx:889
SAL_DLLPUBLIC_EXPORT uno::XInterface * com_sun_star_comp_Draw_XMLOasisStylesImporter_get_implementation(uno::XComponentContext *pCtx, uno::Sequence< uno::Any > const &)
Definition: sdxmlimp.cxx:229
SdXMLImport(const css::uno::Reference< css::uno::XComponentContext > &xContext, OUString const &implementationName, bool bIsDraw, SvXMLImportFlags nImportFlags)
Definition: sdxmlimp.cxx:298
DateTimeDeclMap maDateTimeDeclsMap
rtl::Reference< XMLShapeImportHelper > const & GetShapeImport()
Definition: xmlimp.hxx:603