LibreOffice Module xmloff (master)  1
ximpstyl.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 "ximpstyl.hxx"
21 #include <xmloff/maptype.hxx>
24 #include <xmloff/xmlnamespace.hxx>
25 #include <xmloff/xmlprmap.hxx>
26 #include <xmloff/xmltoken.hxx>
27 #include <xmloff/xmluconv.hxx>
28 #include "ximpnote.hxx"
29 #include <xmlsdtypes.hxx>
30 #include <tools/debug.hxx>
31 #include <sal/log.hxx>
32 #include <tools/diagnose_ex.h>
33 #include <com/sun/star/frame/XModel.hpp>
34 #include <com/sun/star/style/XStyle.hpp>
35 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
36 #include <com/sun/star/presentation/XPresentationPage.hpp>
37 #include <com/sun/star/drawing/FillStyle.hpp>
38 #include <com/sun/star/drawing/XDrawPages.hpp>
39 #include <com/sun/star/container/XNamed.hpp>
40 #include <com/sun/star/beans/XPropertySet.hpp>
41 #include <com/sun/star/beans/XPropertyState.hpp>
42 #include <com/sun/star/presentation/XHandoutMasterSupplier.hpp>
43 #include <com/sun/star/util/Color.hpp>
45 #include <xmloff/autolayout.hxx>
46 #include <xmloff/xmlprcon.hxx>
47 #include <xmloff/families.hxx>
48 #include <com/sun/star/container/XNameContainer.hpp>
49 #include <svl/numformat.hxx>
50 #include <svl/zforlist.hxx>
51 #include "layerimp.hxx"
54 #include <unotools/configmgr.hxx>
55 #include <xmloff/xmlerror.hxx>
58 #include <sax/tools/converter.hxx>
59 #include <comphelper/sequence.hxx>
60 
61 using namespace ::com::sun::star;
62 using namespace ::com::sun::star::uno;
63 using namespace ::com::sun::star::xml::sax;
64 using namespace ::xmloff::token;
65 
66 namespace {
67 
68 class SdXMLDrawingPagePropertySetContext : public SvXMLPropertySetContext
69 {
70 public:
71 
72  SdXMLDrawingPagePropertySetContext( SvXMLImport& rImport, sal_Int32 nElement,
73  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList,
74  ::std::vector< XMLPropertyState > &rProps,
76 
78  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > createFastChildContext(
79  sal_Int32 nElement,
80  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList,
81  ::std::vector< XMLPropertyState > &rProperties,
82  const XMLPropertyState& rProp ) override;
83 };
84 
86 class XMLThemeContext : public SvXMLImportContext
87 {
88  uno::Reference<beans::XPropertySet> m_xMasterPage;
90 
91 public:
92  XMLThemeContext(SvXMLImport& rImport,
93  const uno::Reference<xml::sax::XFastAttributeList>& xAttrList,
94  const uno::Reference<beans::XPropertySet>& xMasterPage);
95  ~XMLThemeContext();
96 
97  uno::Reference<xml::sax::XFastContextHandler> SAL_CALL createFastChildContext(
98  sal_Int32 nElement, const uno::Reference<xml::sax::XFastAttributeList>& xAttribs) override;
99 };
100 
102 class XMLColorTableContext : public SvXMLImportContext
103 {
105  std::vector<util::Color> m_aColorScheme;
106 
107 public:
108  XMLColorTableContext(SvXMLImport& rImport,
109  const uno::Reference<xml::sax::XFastAttributeList>& xAttrList,
111  ~XMLColorTableContext();
112 
113  uno::Reference<xml::sax::XFastContextHandler> SAL_CALL createFastChildContext(
114  sal_Int32 nElement, const uno::Reference<xml::sax::XFastAttributeList>& xAttribs) override;
115 };
116 
118 class XMLColorContext : public SvXMLImportContext
119 {
120 public:
121  XMLColorContext(SvXMLImport& rImport,
122  const uno::Reference<xml::sax::XFastAttributeList>& xAttrList,
123  std::vector<util::Color>& rColorScheme);
124 };
125 }
126 
127 SdXMLDrawingPagePropertySetContext::SdXMLDrawingPagePropertySetContext(
128  SvXMLImport& rImport, sal_Int32 nElement,
129  const uno::Reference< xml::sax::XFastAttributeList > & xAttrList,
130  ::std::vector< XMLPropertyState > &rProps,
132  SvXMLPropertySetContext( rImport, nElement, xAttrList,
133  XML_TYPE_PROP_DRAWING_PAGE, rProps, rMap )
134 {
135 }
136 
137 css::uno::Reference< css::xml::sax::XFastContextHandler > SdXMLDrawingPagePropertySetContext::createFastChildContext(
138  sal_Int32 nElement,
139  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList,
140  ::std::vector< XMLPropertyState > &rProperties,
141  const XMLPropertyState& rProp )
142 {
143  switch( mxMapper->getPropertySetMapper()->GetEntryContextId( rProp.mnIndex ) )
144  {
145  case CTF_PAGE_SOUND_URL:
146  {
147  for (auto &aIter : sax_fastparser::castToFastAttributeList(xAttrList))
148  {
149  if( aIter.getToken() == XML_ELEMENT(XLINK, XML_HREF) )
150  {
151  uno::Any aAny( GetImport().GetAbsoluteReference( aIter.toString() ) );
152  XMLPropertyState aPropState( rProp.mnIndex, aAny );
153  rProperties.push_back( aPropState );
154  }
155  else
156  XMLOFF_WARN_UNKNOWN("xmloff", aIter);
157  }
158  break;
159  }
160  }
161 
163  xAttrList,
164  rProperties, rProp );
165 }
166 
167 namespace {
168 
169 
170 class SdXMLDrawingPageStyleContext : public XMLDrawingPageStyleContext
171 {
172 public:
173 
174  SdXMLDrawingPageStyleContext(
175  SvXMLImport& rImport,
176  SvXMLStylesContext& rStyles);
177 
178  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
179  sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
180 
181  virtual void Finish( bool bOverwrite ) override;
182 };
183 
184 const sal_uInt16 MAX_SPECIAL_DRAW_STYLES = 7;
185 ContextID_Index_Pair const g_ContextIDs[MAX_SPECIAL_DRAW_STYLES+1] =
186 {
187  { CTF_DASHNAME, -1, drawing::FillStyle::FillStyle_MAKE_FIXED_SIZE },
188  { CTF_LINESTARTNAME, -1, drawing::FillStyle::FillStyle_MAKE_FIXED_SIZE },
189  { CTF_LINEENDNAME, -1, drawing::FillStyle::FillStyle_MAKE_FIXED_SIZE },
190  { CTF_FILLGRADIENTNAME, -1, drawing::FillStyle::FillStyle_GRADIENT},
191  { CTF_FILLTRANSNAME, -1, drawing::FillStyle::FillStyle_MAKE_FIXED_SIZE },
192  { CTF_FILLHATCHNAME, -1, drawing::FillStyle::FillStyle_HATCH },
193  { CTF_FILLBITMAPNAME, -1, drawing::FillStyle::FillStyle_BITMAP },
194  { -1, -1, drawing::FillStyle::FillStyle_MAKE_FIXED_SIZE }
195 };
196 XmlStyleFamily const g_Families[MAX_SPECIAL_DRAW_STYLES] =
197 {
205 };
206 
207 }
208 
210  SvXMLImport& rImport,
211  SvXMLStylesContext& rStyles,
212  ContextID_Index_Pair const pContextIDs[],
213  XmlStyleFamily const pFamilies[])
215  , m_pFamilies(pFamilies)
216 {
217  size_t size(1); // for the -1 entry
218  for (ContextID_Index_Pair const* pTemp(pContextIDs); pTemp->nContextID != -1; ++size, ++pTemp);
219  m_pContextIDs.reset(new ContextID_Index_Pair[size]);
220  std::memcpy(m_pContextIDs.get(), pContextIDs, size * sizeof(ContextID_Index_Pair));
221 }
222 
223 SdXMLDrawingPageStyleContext::SdXMLDrawingPageStyleContext(
224  SvXMLImport& rImport,
225  SvXMLStylesContext& rStyles)
226  : XMLDrawingPageStyleContext(rImport, rStyles, g_ContextIDs, g_Families)
227 {
228 }
229 
230 css::uno::Reference< css::xml::sax::XFastContextHandler > SdXMLDrawingPageStyleContext::createFastChildContext(
231  sal_Int32 nElement,
232  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
233 {
234  if( nElement == XML_ELEMENT(STYLE, XML_DRAWING_PAGE_PROPERTIES) )
235  {
237  GetStyles()->GetImportPropertyMapper( GetFamily() );
238  if( xImpPrMap.is() )
239  return new SdXMLDrawingPagePropertySetContext( GetImport(), nElement,
240  xAttrList,
241  GetProperties(),
242  xImpPrMap );
243  }
244 
245  return XMLPropStyleContext::createFastChildContext( nElement, xAttrList );
246 }
247 
248 void SdXMLDrawingPageStyleContext::Finish( bool bOverwrite )
249 {
250  XMLPropStyleContext::Finish( bOverwrite );
251 
252  ::std::vector< XMLPropertyState > &rProperties = GetProperties();
253 
254  const rtl::Reference< XMLPropertySetMapper >& rImpPrMap = GetStyles()->GetImportPropertyMapper( GetFamily() )->getPropertySetMapper();
255 
256  for(auto& property : rProperties)
257  {
258  if( property.mnIndex == -1 )
259  continue;
260 
261  sal_Int16 nContextID = rImpPrMap->GetEntryContextId(property.mnIndex);
262  switch( nContextID )
263  {
265  {
266  OUString sStyleName;
267  property.maValue >>= sStyleName;
268 
269  sal_Int32 nStyle = 0;
270 
271  const SdXMLNumberFormatImportContext* pSdNumStyle =
272  dynamic_cast< const SdXMLNumberFormatImportContext*> (
273  GetStyles()->FindStyleChildContext( XmlStyleFamily::DATA_STYLE, sStyleName, true ) );
274 
275  if( pSdNumStyle )
276  nStyle = pSdNumStyle->GetDrawKey();
277 
278  property.maValue <<= nStyle;
279  }
280  break;
281  }
282  }
283 
284 }
285 
286 
287 // #i35918#
289  const Reference< beans::XPropertySet > & rPropSet )
290 {
293  SAL_WARN_IF( !xImpPrMap.is(), "xmloff", "There is the import prop mapper" );
294  if( xImpPrMap.is() )
295  xImpPrMap->FillPropertySet(GetProperties(), rPropSet, m_pContextIDs.get());
296 
298  for (size_t i=0; m_pContextIDs[i].nContextID != -1; ++i)
299  {
300  sal_Int32 nIndex = m_pContextIDs[i].nIndex;
301  if( nIndex != -1 )
302  {
303  struct XMLPropertyState& rState = GetProperties()[nIndex];
304  OUString sStyleName;
305  rState.maValue >>= sStyleName;
306 
307  if (::xmloff::IsIgnoreFillStyleNamedItem(rPropSet, m_pContextIDs[i].nExpectedFillStyle))
308  {
309  SAL_INFO("xmloff.style", "XMLDrawingPageStyleContext: dropping fill named item: " << sStyleName);
310  break; // ignore it, it's not used
311  }
312 
313  sStyleName = GetImport().GetStyleDisplayName( m_pFamilies[i],
314  sStyleName );
315  // get property set mapper
317  xImpPrMap->getPropertySetMapper();
318 
319  // set property
320  const OUString& rPropertyName =
321  rPropMapper->GetEntryAPIName(rState.mnIndex);
322  if( !xInfo.is() )
323  xInfo = rPropSet->getPropertySetInfo();
324  if ( xInfo->hasPropertyByName( rPropertyName ) )
325  {
326  rPropSet->setPropertyValue( rPropertyName, Any( sStyleName ) );
327  }
328  }
329  }
330 }
331 
332 
334  SdXMLImport& rImport,
335  sal_Int32 /*nElement*/,
336  const uno::Reference< xml::sax::XFastAttributeList>& xAttrList)
338  mnBorderBottom( 0 ),
339  mnBorderLeft( 0 ),
340  mnBorderRight( 0 ),
341  mnBorderTop( 0 ),
342  mnWidth( 0 ),
343  mnHeight( 0 ),
344  meOrientation(GetSdImport().IsDraw() ? view::PaperOrientation_PORTRAIT : view::PaperOrientation_LANDSCAPE)
345 {
346  // set family to something special at SvXMLStyleContext
347  // for differences in search-methods
348 
349  for (auto &aIter : sax_fastparser::castToFastAttributeList( xAttrList ))
350  {
351  switch(aIter.getToken())
352  {
353  case XML_ELEMENT(FO, XML_MARGIN_TOP):
354  case XML_ELEMENT(FO_COMPAT, XML_MARGIN_TOP):
355  {
357  mnBorderTop, aIter.toView());
358  break;
359  }
360  case XML_ELEMENT(FO, XML_MARGIN_BOTTOM):
361  case XML_ELEMENT(FO_COMPAT, XML_MARGIN_BOTTOM):
362  {
364  mnBorderBottom, aIter.toView());
365  break;
366  }
367  case XML_ELEMENT(FO, XML_MARGIN_LEFT):
368  case XML_ELEMENT(FO_COMPAT, XML_MARGIN_LEFT):
369  {
371  mnBorderLeft, aIter.toView());
372  break;
373  }
374  case XML_ELEMENT(FO, XML_MARGIN_RIGHT):
375  case XML_ELEMENT(FO_COMPAT, XML_MARGIN_RIGHT):
376  {
378  mnBorderRight, aIter.toView());
379  break;
380  }
381  case XML_ELEMENT(FO, XML_PAGE_WIDTH):
382  case XML_ELEMENT(FO_COMPAT, XML_PAGE_WIDTH):
383  {
385  mnWidth, aIter.toView());
386  break;
387  }
388  case XML_ELEMENT(FO, XML_PAGE_HEIGHT):
389  case XML_ELEMENT(FO_COMPAT, XML_PAGE_HEIGHT):
390  {
392  mnHeight, aIter.toView());
393  break;
394  }
396  {
397  if( IsXMLToken( aIter, XML_PORTRAIT ) )
398  meOrientation = view::PaperOrientation_PORTRAIT;
399  else
400  meOrientation = view::PaperOrientation_LANDSCAPE;
401  break;
402  }
403  default:
404  XMLOFF_WARN_UNKNOWN("xmloff", aIter);
405  }
406  }
407 }
408 
410 {
411 }
412 
413 
415  SdXMLImport& rImport,
416  sal_Int32 /*nElement*/,
417  const uno::Reference< xml::sax::XFastAttributeList>& /*xAttrList*/)
419 {
420  // set family to something special at SvXMLStyleContext
421  // for differences in search-methods
422 
423 }
424 
425 css::uno::Reference< css::xml::sax::XFastContextHandler > SdXMLPageMasterContext::createFastChildContext(
426  sal_Int32 nElement,
427  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
428 {
430  {
431  DBG_ASSERT(!mxPageMasterStyle.is(), "PageMasterStyle is set, there seem to be two of them (!)");
432  mxPageMasterStyle.set(new SdXMLPageMasterStyleContext(GetSdImport(), nElement, xAttrList));
433  return mxPageMasterStyle;
434  }
435  else
436  XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElement);
437 
438  return nullptr;
439 }
440 
442  SdXMLImport& rImport,
443  sal_Int32 /*nElement*/,
444  const uno::Reference< xml::sax::XFastAttributeList >& /*xAttrList*/)
446  mnTypeId( AUTOLAYOUT_NONE )
447 {
448  // set family to something special at SvXMLStyleContext
449  // for differences in search-methods
450 }
451 
452 css::uno::Reference< css::xml::sax::XFastContextHandler > SdXMLPresentationPageLayoutContext::createFastChildContext(
453  sal_Int32 nElement,
454  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
455 {
456  SvXMLImportContextRef xContext;
457 
458  if(nElement == XML_ELEMENT(PRESENTATION, XML_PLACEHOLDER))
459  {
461  new SdXMLPresentationPlaceholderContext(GetSdImport(), nElement, xAttrList)};
462  // presentation:placeholder inside style:presentation-page-layout context
463  xContext = xLclContext.get();
464 
465  // remember SdXMLPresentationPlaceholderContext for later evaluation
466  maList.push_back(xLclContext);
467  }
468  else
469  XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElement);
470 
471  return xContext;
472 }
473 
475 {
476  // build presentation page layout type here
477  // calc mnTpeId due to content of maList
478  // at the moment only use number of types used there
479  if( maList.empty() )
480  return;
481 
482  SdXMLPresentationPlaceholderContext* pObj0 = maList[ 0 ].get();
483  if( pObj0->GetName() == "handout" )
484  {
485  switch( maList.size() )
486  {
487  case 1:
489  break;
490  case 2:
492  break;
493  case 3:
495  break;
496  case 4:
498  break;
499  case 9:
501  break;
502  default:
504  }
505  }
506  else
507  {
508  switch( maList.size() )
509  {
510  case 1:
511  {
512  if( pObj0->GetName() == "title" )
513  {
515  }
516  else
517  {
519  }
520  break;
521  }
522  case 2:
523  {
524  SdXMLPresentationPlaceholderContext* pObj1 = maList[ 1 ].get();
525 
526  if( pObj1->GetName() == "subtitle" )
527  {
529  }
530  else if( pObj1->GetName() == "outline" )
531  {
533  }
534  else if( pObj1->GetName() == "chart" )
535  {
537  }
538  else if( pObj1->GetName() == "table" )
539  {
541  }
542  else if( pObj1->GetName() == "object" )
543  {
545  }
546  else if( pObj1->GetName() == "vertical_outline" )
547  {
548  if( pObj0->GetName() == "vertical_title" )
549  {
551  }
552  else
553  {
555  }
556  }
557  else
558  {
560  }
561  break;
562  }
563  case 3:
564  {
565  SdXMLPresentationPlaceholderContext* pObj1 = maList[ 1 ].get();
566  SdXMLPresentationPlaceholderContext* pObj2 = maList[ 2 ].get();
567 
568  if( pObj1->GetName() == "outline" )
569  {
570  if( pObj2->GetName() == "outline" )
571  {
573  }
574  else if( pObj2->GetName() == "chart" )
575  {
577  }
578  else if( pObj2->GetName() == "graphic" )
579  {
581  }
582  else
583  {
584  if(pObj1->GetX() < pObj2->GetX())
585  {
586  mnTypeId = AUTOLAYOUT_TEXTOBJ; // outline left, object right
587  }
588  else
589  {
590  mnTypeId = AUTOLAYOUT_TEXTOVEROBJ; // outline top, object right
591  }
592  }
593  }
594  else if( pObj1->GetName() == "chart" )
595  {
597  }
598  else if( pObj1->GetName() == "graphic" )
599  {
600  if( pObj2->GetName() == "vertical_outline" )
601  {
603  }
604  else
605  {
607  }
608  }
609  else if( pObj1->GetName() == "vertical_outline" )
610  {
612  }
613  else
614  {
615  if(pObj1->GetX() < pObj2->GetX())
616  {
617  mnTypeId = AUTOLAYOUT_OBJTEXT; // left, right
618  }
619  else
620  {
622  }
623  }
624  break;
625  }
626  case 4:
627  {
628  SdXMLPresentationPlaceholderContext* pObj1 = maList[ 1 ].get();
629  SdXMLPresentationPlaceholderContext* pObj2 = maList[ 2 ].get();
630 
631  if( pObj1->GetName() == "object" )
632  {
633  if(pObj1->GetX() < pObj2->GetX())
634  {
636  }
637  else
638  {
640  }
641  }
642  else
643  {
645  }
646  break;
647  }
648  case 5:
649  {
650  SdXMLPresentationPlaceholderContext* pObj1 = maList[ 1 ].get();
651 
652  if( pObj1->GetName() == "object" )
653  {
655  }
656  else
657  {
659  }
660  break;
661 
662  }
663  case 7:
664  {
665  mnTypeId = AUTOLAYOUT_TITLE_6CONTENT; // tdf#141978: Apply 6content layout
666  break;
667  }
668  default:
669  {
671  break;
672  }
673  }
674  }
675 
676  // release remembered contexts, they are no longer needed
677  maList.clear();
678 }
679 
681  SdXMLImport& rImport,
682  sal_Int32 /*nElement*/,
683  const uno::Reference< xml::sax::XFastAttributeList>& xAttrList)
684 : SvXMLImportContext( rImport ),
685  mnX(0)
686 {
687  for (auto &aIter : sax_fastparser::castToFastAttributeList( xAttrList ))
688  {
689  switch(aIter.getToken())
690  {
691  case XML_ELEMENT(PRESENTATION, XML_OBJECT):
692  {
693  msName = aIter.toString();
694  break;
695  }
696  case XML_ELEMENT(SVG, XML_X):
697  case XML_ELEMENT(SVG_COMPAT, XML_X):
698  {
700  mnX, aIter.toView());
701  break;
702  }
703  case XML_ELEMENT(SVG, XML_Y):
704  case XML_ELEMENT(SVG_COMPAT, XML_Y):
705  {
706  break;
707  }
708  case XML_ELEMENT(SVG, XML_WIDTH):
709  case XML_ELEMENT(SVG_COMPAT, XML_WIDTH):
710  {
711  break;
712  }
713  case XML_ELEMENT(SVG, XML_HEIGHT):
714  case XML_ELEMENT(SVG_COMPAT, XML_HEIGHT):
715  {
716  break;
717  }
718  default:
719  XMLOFF_WARN_UNKNOWN("xmloff", aIter);
720  }
721  }
722 }
723 
725 {
726 }
727 
728 
730  SdXMLImport& rImport,
731  sal_Int32 nElement,
732  const uno::Reference< xml::sax::XFastAttributeList>& xAttrList,
733  uno::Reference< drawing::XShapes > const & rShapes)
734 : SdXMLGenericPageContext( rImport, xAttrList, rShapes )
735 {
736  const bool bHandoutMaster = (nElement & TOKEN_MASK) == XML_HANDOUT_MASTER;
737  OUString sStyleName, sPageMasterName;
738 
739  for (auto &aIter : sax_fastparser::castToFastAttributeList( xAttrList ))
740  {
741  const OUString sValue = aIter.toString();
742  switch(aIter.getToken())
743  {
744  case XML_ELEMENT(STYLE, XML_NAME):
745  {
746  msName = sValue;
747  break;
748  }
750  {
751  msDisplayName = sValue;
752  break;
753  }
755  {
756  sPageMasterName = sValue;
757  break;
758  }
760  {
761  sStyleName = sValue;
762  break;
763  }
765  {
766  maPageLayoutName = sValue;
767  break;
768  }
769  case XML_ELEMENT(PRESENTATION, XML_USE_HEADER_NAME):
770  {
771  maUseHeaderDeclName = sValue;
772  break;
773  }
774  case XML_ELEMENT(PRESENTATION, XML_USE_FOOTER_NAME):
775  {
776  maUseFooterDeclName = sValue;
777  break;
778  }
779  case XML_ELEMENT(PRESENTATION, XML_USE_DATE_TIME_NAME):
780  {
781  maUseDateTimeDeclName = sValue;
782  break;
783  }
784  default:
785  XMLOFF_WARN_UNKNOWN("xmloff", aIter);
786  }
787  }
788 
789  if( msDisplayName.isEmpty() )
791  else if( msDisplayName != msName )
793 
794  GetImport().GetShapeImport()->startPage( GetLocalShapesContext() );
795 
796  // set page name?
797  if(!bHandoutMaster && !msDisplayName.isEmpty() && GetLocalShapesContext().is())
798  {
799  uno::Reference < container::XNamed > xNamed(GetLocalShapesContext(), uno::UNO_QUERY);
800  if(xNamed.is())
801  xNamed->setName(msDisplayName);
802  }
803 
804  // set page-master?
805  if(!sPageMasterName.isEmpty())
806  {
807  SetPageMaster( sPageMasterName );
808  }
809 
810  SetStyle( sStyleName );
811 
812  SetLayout();
813 
814  DeleteAllShapes();
815 }
816 
818 {
819 }
820 
822 {
823  // set styles on master-page
824  if(!msName.isEmpty() && GetSdImport().GetShapeImport()->GetStylesContext())
825  {
826  SvXMLImportContext* pContext = GetSdImport().GetShapeImport()->GetStylesContext();
827  if (SdXMLStylesContext* pSdContext = dynamic_cast<SdXMLStylesContext*>(pContext))
828  pSdContext->SetMasterPageStyles(*this);
829  }
830 
833 }
834 
835 css::uno::Reference< css::xml::sax::XFastContextHandler > SdXMLMasterPageContext::createFastChildContext(
836  sal_Int32 nElement,
837  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
838 {
839  switch (nElement)
840  {
841  // some special objects inside style:masterpage context
842  case XML_ELEMENT(STYLE, XML_STYLE):
843  {
844  if(GetSdImport().GetShapeImport()->GetStylesContext())
845  {
846  // style:style inside master-page context -> presentation style
848  GetSdImport(),
849  *GetSdImport().GetShapeImport()->GetStylesContext(),
851 
852  // add this style to the outer StylesContext class for later processing
853  GetSdImport().GetShapeImport()->GetStylesContext()->AddStyle(*pNew);
854  return pNew;
855  }
856  break;
857  }
858  case XML_ELEMENT(PRESENTATION, XML_NOTES):
859  {
860  if( GetSdImport().IsImpress() )
861  {
862  // get notes page
863  uno::Reference< presentation::XPresentationPage > xPresPage(GetLocalShapesContext(), uno::UNO_QUERY);
864  if(xPresPage.is())
865  {
866  uno::Reference< drawing::XDrawPage > xNotesDrawPage = xPresPage->getNotesPage();
867  if(xNotesDrawPage.is())
868  {
869  // presentation:notes inside master-page context
870  return new SdXMLNotesContext( GetSdImport(), xAttrList, xNotesDrawPage);
871  }
872  }
873  }
874  break;
875  }
876  case XML_ELEMENT(LO_EXT, XML_THEME):
877  {
878  if (GetSdImport().IsImpress())
879  {
880  uno::Reference<beans::XPropertySet> xMasterPage(GetLocalShapesContext(),
881  uno::UNO_QUERY);
882  return new XMLThemeContext(GetSdImport(), xAttrList, xMasterPage);
883  }
884  break;
885  }
886  }
887  return SdXMLGenericPageContext::createFastChildContext(nElement, xAttrList);
888 }
889 
891  SdXMLImport& rImport,
892  bool bIsAutoStyle)
893 : SvXMLStylesContext(rImport),
894  mbIsAutoStyle(bIsAutoStyle)
895 {
897  mpNumFormatter = std::make_unique<SvNumberFormatter>( xContext, LANGUAGE_SYSTEM );
898  mpNumFmtHelper = std::make_unique<SvXMLNumFmtHelper>( mpNumFormatter.get(), xContext );
899 }
900 
902  sal_Int32 nElement,
903  const uno::Reference< xml::sax::XFastAttributeList >& xAttrList)
904 {
905  switch (nElement)
906  {
908  {
909  auto pContext = GetImport().GetShapeImport()->GetShapeTableImport()->CreateTableTemplateContext(nElement, xAttrList );
910  if (pContext)
911  return pContext;
912  break;
913  }
915  // style:page-master inside office:styles context
916  return new SdXMLPageMasterContext(GetSdImport(), nElement, xAttrList);
918  // style:presentation-page-layout inside office:styles context
919  return new SdXMLPresentationPageLayoutContext(GetSdImport(), nElement, xAttrList);
921  // number:date-style or number:time-style
922  return new SdXMLNumberFormatImportContext( GetSdImport(), nElement, mpNumFmtHelper->getData(), SvXMLStylesTokens::DATE_STYLE, xAttrList, *this );
924  // number:date-style or number:time-style
925  return new SdXMLNumberFormatImportContext( GetSdImport(), nElement, mpNumFmtHelper->getData(), SvXMLStylesTokens::TIME_STYLE, xAttrList, *this );
927  return new SvXMLNumFormatContext( GetSdImport(), nElement,
928  mpNumFmtHelper->getData(), SvXMLStylesTokens::NUMBER_STYLE, xAttrList, *this );
930  return new SvXMLNumFormatContext( GetSdImport(), nElement,
931  mpNumFmtHelper->getData(), SvXMLStylesTokens::CURRENCY_STYLE, xAttrList, *this );
933  return new SvXMLNumFormatContext( GetSdImport(), nElement,
934  mpNumFmtHelper->getData(), SvXMLStylesTokens::PERCENTAGE_STYLE, xAttrList, *this );
936  return new SvXMLNumFormatContext( GetSdImport(), nElement,
937  mpNumFmtHelper->getData(), SvXMLStylesTokens::BOOLEAN_STYLE, xAttrList, *this );
939  return new SvXMLNumFormatContext( GetSdImport(), nElement,
940  mpNumFmtHelper->getData(), SvXMLStylesTokens::TEXT_STYLE, xAttrList, *this );
941  case XML_ELEMENT(PRESENTATION, XML_HEADER_DECL):
942  case XML_ELEMENT(PRESENTATION, XML_FOOTER_DECL):
943  case XML_ELEMENT(PRESENTATION, XML_DATE_TIME_DECL):
944  return new SdXMLHeaderFooterDeclContext( GetImport(), xAttrList );
945  case XML_ELEMENT(STYLE, XML_STYLE):
946  break; // ignore
947  default:
948  XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElement);
949  }
950 
951  // call base class
952  return SvXMLStylesContext::CreateStyleChildContext(nElement, xAttrList);
953 }
954 
956  XmlStyleFamily nFamily,
957  sal_Int32 nElement,
958  const uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList)
959 {
960  switch( nFamily )
961  {
963  return new SdXMLDrawingPageStyleContext(GetSdImport(), *this );
967  return new XMLShapeStyleContext( GetSdImport(), *this, nFamily );
968  default: break;
969  }
970 
971  // call base class
972  return SvXMLStylesContext::CreateStyleStyleChildContext(nFamily, nElement, xAttrList);
973 }
974 
976  XmlStyleFamily nFamily,
977  sal_Int32 nElement,
978  const Reference< XFastAttributeList > & xAttrList )
979 {
980  switch( nFamily )
981  {
983  return new XMLGraphicsDefaultStyle(GetSdImport(), *this );
984  default: break;
985  }
986 
987  // call base class
988  return SvXMLStylesContext::CreateDefaultStyleStyleChildContext(nFamily, nElement, xAttrList);
989 }
990 
992  XmlStyleFamily nFamily) const
993 {
995 
996  switch( nFamily )
997  {
999  {
1000  if(!xPresImpPropMapper.is())
1001  {
1002  rtl::Reference< XMLShapeImportHelper > aImpHelper = const_cast<SvXMLImport&>(GetImport()).GetShapeImport();
1003  const_cast<SdXMLStylesContext*>(this)->xPresImpPropMapper =
1004  aImpHelper->GetPresPagePropsMapper();
1005  }
1006  xMapper = xPresImpPropMapper;
1007  break;
1008  }
1009 
1013  {
1014  const rtl::Reference< XMLTableImport >& xTableImport( const_cast< SvXMLImport& >( GetImport() ).GetShapeImport()->GetShapeTableImport() );
1015 
1016  switch( nFamily )
1017  {
1018  case XmlStyleFamily::TABLE_COLUMN: xMapper = xTableImport->GetColumnImportPropertySetMapper().get(); break;
1019  case XmlStyleFamily::TABLE_ROW: xMapper = xTableImport->GetRowImportPropertySetMapper().get(); break;
1020  case XmlStyleFamily::TABLE_CELL: xMapper = xTableImport->GetCellImportPropertySetMapper().get(); break;
1021  default: break;
1022  }
1023  break;
1024  }
1025  default: break;
1026  }
1027 
1028  // call base class
1029  if( !xMapper.is() )
1031  return xMapper;
1032 }
1033 
1034 // Process all style and object info
1035 
1037 {
1038  if(mbIsAutoStyle)
1039  {
1040  // AutoStyles for text import
1041  GetImport().GetTextImport()->SetAutoStyles( this );
1042 
1043  // AutoStyles for chart
1044  GetImport().GetChartImport()->SetAutoStylesContext( this );
1045 
1046  // AutoStyles for forms
1047  GetImport().GetFormImport()->setAutoStyleContext( this );
1048 
1049  // associate AutoStyles with styles in preparation to setting Styles on shapes
1050  for(sal_uInt32 a(0); a < GetStyleCount(); a++)
1051  {
1052  const SvXMLStyleContext* pStyle = GetStyle(a);
1053  if (const XMLShapeStyleContext* pDocStyle = dynamic_cast<const XMLShapeStyleContext*>(pStyle))
1054  {
1055  SvXMLStylesContext* pStylesContext = GetSdImport().GetShapeImport()->GetStylesContext();
1056  if (pStylesContext)
1057  {
1058  pStyle = pStylesContext->FindStyleChildContext(pStyle->GetFamily(), pStyle->GetParentName());
1059 
1060  if (const XMLShapeStyleContext* pParentStyle = dynamic_cast<const XMLShapeStyleContext*>(pStyle))
1061  {
1062  if(pParentStyle->GetStyle().is())
1063  {
1064  const_cast<XMLShapeStyleContext*>(pDocStyle)->SetStyle(pParentStyle->GetStyle());
1065  }
1066  }
1067  }
1068  }
1069  }
1070 
1071  FinishStyles( false );
1072  }
1073  else
1074  {
1075  // Process styles list
1077  ImpSetCellStyles();
1078  GetImport().GetShapeImport()->GetShapeTableImport()->finishStyles();
1079 
1080  // put style infos in the info set for other components ( content import f.e. )
1081  uno::Reference< beans::XPropertySet > xInfoSet( GetImport().getImportInfo() );
1082  if( xInfoSet.is() )
1083  {
1084  uno::Reference< beans::XPropertySetInfo > xInfoSetInfo( xInfoSet->getPropertySetInfo() );
1085 
1086  if( xInfoSetInfo->hasPropertyByName("PageLayouts") )
1087  xInfoSet->setPropertyValue("PageLayouts", uno::Any( getPageLayouts() ) );
1088  }
1089 
1090  }
1091 }
1092 
1093 // set master-page styles (all with family="presentation" and a special
1094 // prefix) on given master-page.
1095 
1097 {
1098  const uno::Reference<container::XNameAccess>& rStyleFamilies =
1100 
1101  if (!rStyleFamilies.is())
1102  return;
1103 
1104  if (!rStyleFamilies->hasByName(rMaster.GetDisplayName()))
1105  return;
1106 
1107  try
1108  {
1109  uno::Reference< container::XNameAccess > xMasterPageStyles( rStyleFamilies->getByName(rMaster.GetDisplayName()), UNO_QUERY_THROW );
1110  OUString sPrefix(rMaster.GetDisplayName() + "-");
1112  }
1113  catch (const uno::Exception&)
1114  {
1115  TOOLS_WARN_EXCEPTION("xmloff.draw", "");
1116  }
1117 }
1118 
1119 // Process styles list:
1120 // set graphic styles (all with family="graphics"). Remember xStyle at list element.
1121 
1123 {
1124  if(GetSdImport().GetLocalDocStyleFamilies().is()) try
1125  {
1126  uno::Reference< container::XNameAccess > xGraphicPageStyles( GetSdImport().GetLocalDocStyleFamilies()->getByName("graphics"), uno::UNO_QUERY_THROW );
1127 
1128  ImpSetGraphicStyles(xGraphicPageStyles, XmlStyleFamily::SD_GRAPHICS_ID, OUString());
1129  }
1130  catch( uno::Exception& )
1131  {
1132  TOOLS_WARN_EXCEPTION("xmloff.draw", "");
1133  }
1134 }
1135 
1137 {
1138  if(GetSdImport().GetLocalDocStyleFamilies().is()) try
1139  {
1140  uno::Reference< container::XNameAccess > xGraphicPageStyles( GetSdImport().GetLocalDocStyleFamilies()->getByName("cell"), uno::UNO_QUERY_THROW );
1141 
1142  ImpSetGraphicStyles(xGraphicPageStyles, XmlStyleFamily::TABLE_CELL, OUString());
1143  }
1144  catch( uno::Exception& )
1145  {
1146  TOOLS_WARN_EXCEPTION("xmloff.draw", "");
1147  }
1148 }
1149 
1150 //Resolves: fdo#34987 if the style's auto height before and after is the same
1151 //then don't reset it back to the underlying default of true for the small
1152 //period before it's going to be reset to false again. Doing this avoids the
1153 //master page shapes from resizing themselves due to autoheight becoming
1154 //enabled before having autoheight turned off again and getting stuck on that
1155 //autosized height
1156 static bool canSkipReset(std::u16string_view rName, const XMLPropStyleContext* pPropStyle,
1157  const uno::Reference< beans::XPropertySet > &rPropSet, const rtl::Reference < XMLPropertySetMapper >& rPrMap)
1158 {
1159  bool bCanSkipReset = false;
1160  if (pPropStyle && rName == u"TextAutoGrowHeight")
1161  {
1162  bool bOldStyleTextAutoGrowHeight(false);
1163  rPropSet->getPropertyValue("TextAutoGrowHeight") >>= bOldStyleTextAutoGrowHeight;
1164 
1165  sal_Int32 nIndexStyle = rPrMap->GetEntryIndex(XML_NAMESPACE_DRAW, u"auto-grow-height", 0);
1166  if (nIndexStyle != -1)
1167  {
1168  const ::std::vector< XMLPropertyState > &rProperties = pPropStyle->GetProperties();
1169  auto property = std::find_if(rProperties.cbegin(), rProperties.cend(),
1170  [nIndexStyle](const XMLPropertyState& rProp) { return rProp.mnIndex == nIndexStyle; });
1171  if (property != rProperties.cend())
1172  {
1173  bool bNewStyleTextAutoGrowHeight(false);
1174  property->maValue >>= bNewStyleTextAutoGrowHeight;
1175  bCanSkipReset = (bNewStyleTextAutoGrowHeight == bOldStyleTextAutoGrowHeight);
1176  }
1177  }
1178  }
1179  return bCanSkipReset;
1180 }
1181 
1182 // help function used by ImpSetGraphicStyles() and ImpSetMasterPageStyles()
1183 
1184 void SdXMLStylesContext::ImpSetGraphicStyles( uno::Reference< container::XNameAccess > const & xPageStyles, XmlStyleFamily nFamily, const OUString& rPrefix) const
1185 {
1186  sal_Int32 nPrefLen(rPrefix.getLength());
1187 
1188  sal_uInt32 a;
1189 
1190  // set defaults
1191  for( a = 0; a < GetStyleCount(); a++)
1192  {
1193  const SvXMLStyleContext* pStyle = GetStyle(a);
1194 
1195  if(nFamily == pStyle->GetFamily() && pStyle->IsDefaultStyle())
1196  {
1197  const_cast<SvXMLStyleContext*>(pStyle)->SetDefaults();
1198  }
1199  }
1200 
1201  // create all styles and set properties
1202  for( a = 0; a < GetStyleCount(); a++)
1203  {
1204  try
1205  {
1206  const SvXMLStyleContext* pStyle = GetStyle(a);
1207  if(nFamily == pStyle->GetFamily() && !pStyle->IsDefaultStyle())
1208  {
1209  OUString aStyleName(pStyle->GetDisplayName());
1210 
1211  if( nPrefLen )
1212  {
1213  sal_Int32 nStylePrefLen = aStyleName.lastIndexOf( '-' ) + 1;
1214  if( (nPrefLen != nStylePrefLen) || !aStyleName.startsWith(rPrefix) )
1215  continue;
1216 
1217  aStyleName = aStyleName.copy( nPrefLen );
1218  }
1219 
1220  XMLPropStyleContext* pPropStyle = dynamic_cast< XMLPropStyleContext* >(const_cast< SvXMLStyleContext* >( pStyle ) );
1221 
1222  uno::Reference< style::XStyle > xStyle;
1223  if(xPageStyles->hasByName(aStyleName))
1224  {
1225  xPageStyles->getByName(aStyleName) >>= xStyle;
1226 
1227  // set properties of existing styles to default
1228  uno::Reference< beans::XPropertySet > xPropSet( xStyle, uno::UNO_QUERY );
1229  uno::Reference< beans::XPropertySetInfo > xPropSetInfo;
1230  if( xPropSet.is() )
1231  xPropSetInfo = xPropSet->getPropertySetInfo();
1232 
1233  uno::Reference< beans::XPropertyState > xPropState( xStyle, uno::UNO_QUERY );
1234 
1235  if( xPropState.is() )
1236  {
1239  SAL_WARN_IF( !xImpPrMap.is(), "xmloff", "There is the import prop mapper" );
1240  if( xImpPrMap.is() )
1241  xPrMap = xImpPrMap->getPropertySetMapper();
1242  if( xPrMap.is() )
1243  {
1244  const sal_Int32 nCount = xPrMap->GetEntryCount();
1245  for( sal_Int32 i = 0; i < nCount; i++ )
1246  {
1247  const OUString& rName = xPrMap->GetEntryAPIName( i );
1248  if( xPropSetInfo->hasPropertyByName( rName ) && beans::PropertyState_DIRECT_VALUE == xPropState->getPropertyState( rName ) )
1249  {
1250  bool bCanSkipReset = canSkipReset(rName, pPropStyle, xPropSet, xPrMap);
1251  if (bCanSkipReset)
1252  continue;
1253  xPropState->setPropertyToDefault( rName );
1254  }
1255  }
1256  }
1257  }
1258  }
1259  else
1260  {
1261  // graphics style does not exist, create and add it
1262  uno::Reference< lang::XSingleServiceFactory > xServiceFact(xPageStyles, uno::UNO_QUERY);
1263  if(xServiceFact.is())
1264  {
1265  uno::Reference< style::XStyle > xNewStyle( xServiceFact->createInstance(), uno::UNO_QUERY);
1266 
1267  if(xNewStyle.is())
1268  {
1269  // remember style
1270  xStyle = xNewStyle;
1271 
1272  // add new style to graphics style pool
1273  uno::Reference< container::XNameContainer > xInsertContainer(xPageStyles, uno::UNO_QUERY);
1274  if(xInsertContainer.is())
1275  xInsertContainer->insertByName(aStyleName, uno::Any( xStyle ) );
1276  }
1277  }
1278  }
1279 
1280  if(xStyle.is())
1281  {
1282  // set properties at style
1283  uno::Reference< beans::XPropertySet > xPropSet(xStyle, uno::UNO_QUERY);
1284  if(xPropSet.is() && pPropStyle)
1285  {
1286  pPropStyle->FillPropertySet(xPropSet);
1287  pPropStyle->SetStyle(xStyle);
1288  }
1289  }
1290  }
1291  }
1292  catch(const Exception& e)
1293  {
1294  const_cast<SdXMLImport*>(&GetSdImport())->SetError( XMLERROR_FLAG_WARNING | XMLERROR_API, {}, e.Message, nullptr );
1295  }
1296  }
1297 
1298  // now set parents for all styles (when necessary)
1299  for(a = 0; a < GetStyleCount(); a++)
1300  {
1301  const SvXMLStyleContext* pStyle = GetStyle(a);
1302 
1303  if(pStyle && !pStyle->GetDisplayName().isEmpty() && (nFamily == pStyle->GetFamily())) try
1304  {
1305  OUString aStyleName(pStyle->GetDisplayName());
1306  if( nPrefLen )
1307  {
1308  sal_Int32 nStylePrefLen = aStyleName.lastIndexOf( '-' ) + 1;
1309  if( (nPrefLen != nStylePrefLen) || !aStyleName.startsWith( rPrefix ) )
1310  continue;
1311 
1312  aStyleName = aStyleName.copy( nPrefLen );
1313  }
1314 
1315  uno::Reference< style::XStyle > xStyle( xPageStyles->getByName(aStyleName), UNO_QUERY );
1316  if(xStyle.is())
1317  {
1318  // set parent style name
1319  OUString sParentStyleDisplayName( GetImport().GetStyleDisplayName( pStyle->GetFamily(), pStyle->GetParentName() ) );
1320  if( nPrefLen )
1321  {
1322  sal_Int32 nStylePrefLen = sParentStyleDisplayName.lastIndexOf( '-' ) + 1;
1323  if( (nPrefLen != nStylePrefLen) || !sParentStyleDisplayName.startsWith( rPrefix ) )
1324  continue;
1325 
1326  sParentStyleDisplayName = sParentStyleDisplayName.copy( nPrefLen );
1327  }
1328  xStyle->setParentStyle( sParentStyleDisplayName );
1329  }
1330  }
1331  catch( const Exception& e )
1332  {
1333  const_cast<SdXMLImport*>(&GetSdImport())->SetError( XMLERROR_FLAG_WARNING | XMLERROR_API, {}, e.Message, nullptr );
1334  }
1335  }
1336 }
1337 
1338 // helper function to create the uno component that hold the mappings from
1339 // xml auto layout name to internal autolayout id
1340 
1341 uno::Reference< container::XNameAccess > SdXMLStylesContext::getPageLayouts() const
1342 {
1343  uno::Reference< container::XNameContainer > xLayouts( comphelper::NameContainer_createInstance( ::cppu::UnoType<sal_Int32>::get()) );
1344 
1345  for(sal_uInt32 a(0); a < GetStyleCount(); a++)
1346  {
1347  const SvXMLStyleContext* pStyle = GetStyle(a);
1348  if (const SdXMLPresentationPageLayoutContext* pContext = dynamic_cast<const SdXMLPresentationPageLayoutContext*>(pStyle))
1349  {
1350  xLayouts->insertByName(pStyle->GetName(), uno::Any(static_cast<sal_Int32>(pContext->GetTypeId())));
1351  }
1352  }
1353 
1354  return xLayouts;
1355 }
1356 
1357 
1359  SdXMLImport& rImport)
1360 : SvXMLImportContext( rImport )
1361 {
1362 }
1363 
1364 css::uno::Reference< css::xml::sax::XFastContextHandler > SdXMLMasterStylesContext::createFastChildContext(
1365  sal_Int32 nElement,
1366  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
1367 {
1368  if( nElement == XML_ELEMENT(DRAW, XML_LAYER_SET) )
1369  {
1370  return new SdXMLLayerSetContext( GetImport() );
1371  }
1372  else if( nElement == XML_ELEMENT(STYLE, XML_MASTER_PAGE) )
1373  {
1374  // style:masterpage inside office:styles context
1375  uno::Reference< drawing::XDrawPage > xNewMasterPage;
1376  uno::Reference< drawing::XDrawPages > xMasterPages(GetSdImport().GetLocalMasterPages(), uno::UNO_QUERY);
1377 
1378  if( xMasterPages.is() )
1379  {
1380  sal_Int32 nNewMasterPageCount = GetSdImport().GetNewMasterPageCount();
1381  sal_Int32 nMasterPageCount = xMasterPages->getCount();
1382  if (nNewMasterPageCount + 1 > nMasterPageCount)
1383  {
1384  // arbitrary limit to master pages when fuzzing to avoid deadend timeouts
1385  if (nMasterPageCount >= 64 && utl::ConfigManager::IsFuzzing())
1386  return nullptr;
1387 
1388  // new page, create and insert
1389  xNewMasterPage = xMasterPages->insertNewByIndex(nMasterPageCount);
1390  }
1391  else
1392  {
1393  // existing page, use it
1394  xMasterPages->getByIndex(nNewMasterPageCount) >>= xNewMasterPage;
1395  }
1396 
1397  // increment global import page counter
1399 
1400  if(xNewMasterPage.is())
1401  {
1402  if(GetSdImport().GetShapeImport()->GetStylesContext())
1403  {
1404  const rtl::Reference<SdXMLMasterPageContext> xLclContext{
1406  nElement, xAttrList, xNewMasterPage)};
1407  maMasterPageList.push_back(xLclContext);
1408  return xLclContext;
1409  }
1410  }
1411  }
1412  }
1413  else if( nElement == XML_ELEMENT(STYLE, XML_HANDOUT_MASTER) )
1414  {
1415  uno::Reference< presentation::XHandoutMasterSupplier > xHandoutSupp( GetSdImport().GetModel(), uno::UNO_QUERY );
1416  if( xHandoutSupp.is() )
1417  {
1418  uno::Reference< drawing::XShapes > xHandoutPage = xHandoutSupp->getHandoutMasterPage();
1419  if(xHandoutPage.is() && GetSdImport().GetShapeImport()->GetStylesContext())
1420  {
1421  return new SdXMLMasterPageContext(GetSdImport(),
1422  nElement, xAttrList, xHandoutPage);
1423  }
1424  }
1425  }
1426  else
1427  XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElement);
1428  return nullptr;
1429 }
1430 
1432  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList)
1433  : SvXMLStyleContext( rImport )
1434  , mbFixed(false)
1435 {
1436  for (auto &aIter : sax_fastparser::castToFastAttributeList( xAttrList ))
1437  {
1438  if( aIter.getToken() == XML_ELEMENT(PRESENTATION, XML_NAME) )
1439  {
1440  maStrName = aIter.toString();
1441  }
1442  else if( aIter.getToken() == XML_ELEMENT(PRESENTATION, XML_SOURCE) )
1443  {
1444  mbFixed = IsXMLToken( aIter, XML_FIXED );
1445  }
1446  else if( aIter.getToken() == XML_ELEMENT(STYLE, XML_DATA_STYLE_NAME) )
1447  {
1448  maStrDateTimeFormat = aIter.toString();
1449  }
1450  else
1451  {
1452  XMLOFF_WARN_UNKNOWN("xmloff", aIter);
1453  }
1454  }
1455 }
1456 
1458 {
1459  return true;
1460 }
1461 
1463 {
1464  SdXMLImport& rImport = dynamic_cast<SdXMLImport&>(GetImport());
1465  auto nElement = nToken & TOKEN_MASK;
1466  if( nElement == XML_HEADER_DECL )
1467  {
1468  rImport.AddHeaderDecl( maStrName, maStrText );
1469  }
1470  else if( nElement == XML_FOOTER_DECL )
1471  {
1472  rImport.AddFooterDecl( maStrName, maStrText );
1473  }
1474  else if( nElement == XML_DATE_TIME_DECL )
1475  {
1477  }
1478  else
1479  {
1480  XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nToken);
1481  }
1482 }
1483 
1484 void SdXMLHeaderFooterDeclContext::characters( const OUString& rChars )
1485 {
1486  maStrText += rChars;
1487 }
1488 
1489 XMLThemeContext::XMLThemeContext(SvXMLImport& rImport,
1490  const uno::Reference<xml::sax::XFastAttributeList>& xAttrList,
1491  const uno::Reference<beans::XPropertySet>& xMasterPage)
1492  : SvXMLImportContext(rImport)
1493  , m_xMasterPage(xMasterPage)
1494 {
1495  for (const auto& rAttribute : sax_fastparser::castToFastAttributeList(xAttrList))
1496  {
1497  switch (rAttribute.getToken())
1498  {
1499  case XML_ELEMENT(LO_EXT, XML_NAME):
1500  {
1501  m_aTheme["Name"] <<= rAttribute.toString();
1502  break;
1503  }
1504  }
1505  }
1506 }
1507 
1508 XMLThemeContext::~XMLThemeContext()
1509 {
1510  uno::Any aTheme(m_aTheme.getAsConstPropertyValueList());
1511  m_xMasterPage->setPropertyValue("Theme", aTheme);
1512 }
1513 
1514 uno::Reference<xml::sax::XFastContextHandler> SAL_CALL XMLThemeContext::createFastChildContext(
1515  sal_Int32 nElement, const uno::Reference<xml::sax::XFastAttributeList>& xAttribs)
1516 {
1517  if (nElement == XML_ELEMENT(LO_EXT, XML_COLOR_TABLE))
1518  {
1519  return new XMLColorTableContext(GetImport(), xAttribs, m_aTheme);
1520  }
1521 
1522  return nullptr;
1523 }
1524 
1525 XMLColorTableContext::XMLColorTableContext(
1526  SvXMLImport& rImport, const uno::Reference<xml::sax::XFastAttributeList>& xAttrList,
1528  : SvXMLImportContext(rImport)
1529  , m_rTheme(rTheme)
1530 {
1531  for (const auto& rAttribute : sax_fastparser::castToFastAttributeList(xAttrList))
1532  {
1533  switch (rAttribute.getToken())
1534  {
1535  case XML_ELEMENT(LO_EXT, XML_NAME):
1536  {
1537  m_rTheme["ColorSchemeName"] <<= rAttribute.toString();
1538  break;
1539  }
1540  }
1541  }
1542 }
1543 
1544 XMLColorTableContext::~XMLColorTableContext()
1545 {
1546  m_rTheme["ColorScheme"] <<= comphelper::containerToSequence(m_aColorScheme);
1547 }
1548 
1549 uno::Reference<xml::sax::XFastContextHandler> SAL_CALL XMLColorTableContext::createFastChildContext(
1550  sal_Int32 nElement, const uno::Reference<xml::sax::XFastAttributeList>& xAttribs)
1551 {
1552  if (nElement == XML_ELEMENT(LO_EXT, XML_COLOR))
1553  {
1554  return new XMLColorContext(GetImport(), xAttribs, m_aColorScheme);
1555  }
1556 
1557  return nullptr;
1558 }
1559 
1560 XMLColorContext::XMLColorContext(SvXMLImport& rImport,
1561  const uno::Reference<xml::sax::XFastAttributeList>& xAttrList,
1562  std::vector<util::Color>& rColorScheme)
1563  : SvXMLImportContext(rImport)
1564 {
1565  for (const auto& rAttribute : sax_fastparser::castToFastAttributeList(xAttrList))
1566  {
1567  switch (rAttribute.getToken())
1568  {
1569  case XML_ELEMENT(LO_EXT, XML_COLOR):
1570  {
1571  util::Color nColor;
1572  sax::Converter::convertColor(nColor, rAttribute.toView());
1573  rColorScheme.push_back(nColor);
1574  break;
1575  }
1576  }
1577  }
1578 }
1579 
1580 namespace xmloff {
1581 
1583  css::uno::Reference<css::beans::XPropertySet> const& xProps,
1584  drawing::FillStyle const nExpectedFillStyle)
1585 {
1586  assert(xProps.is());
1587  if (nExpectedFillStyle == drawing::FillStyle::FillStyle_MAKE_FIXED_SIZE)
1588  {
1589  return false;
1590  }
1591 
1592  // note: the caller must have called FillPropertySet() previously
1593  drawing::FillStyle fillStyle{drawing::FillStyle_NONE};
1594  xProps->getPropertyValue("FillStyle") >>= fillStyle;
1595  return fillStyle != nExpectedFillStyle;
1596 }
1597 
1598 } // namespace xmloff
1599 
1600 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_Int16 nContextID
Definition: xmlimppr.hxx:59
double mnHeight
void SetLayout()
sets the presentation layout at this page.
Definition: ximppage.cxx:406
virtual SvXMLStyleContext * CreateStyleChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
Definition: xmlstyle.cxx:316
XmlStyleFamily GetFamily() const
Definition: xmlstyle.hxx:85
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
Definition: prstylei.cxx:175
std::vector< rtl::Reference< SdXMLMasterPageContext > > maMasterPageList
Definition: ximpstyl.hxx:215
Title, 2 Content and Content.
Definition: autolayout.hxx:42
Title, 4 Content.
Definition: autolayout.hxx:45
bool convertMeasureToCore(sal_Int32 &rValue, std::u16string_view rString, sal_Int32 nMin=SAL_MIN_INT32, sal_Int32 nMax=SAL_MAX_INT32) const
convert string to measure with meCoreMeasureUnit, using optional min and max values ...
Definition: xmluconv.cxx:186
sal_Int32 nIndex
void AddFooterDecl(const OUString &rName, const OUString &rText)
Definition: sdxmlimp.cxx:601
COMPHELPER_DLLPUBLIC css::uno::Reference< css::container::XNameContainer > NameContainer_createInstance(const css::uno::Type &aType)
const css::uno::Reference< css::container::XNameAccess > & GetLocalDocStyleFamilies() const
rtl::Reference< ::xmloff::OFormLayerXMLImport > const & GetFormImport()
Definition: xmlimp.hxx:625
int SetError()
void SetPageMaster(OUString const &rsPageMasterName)
sets the properties from a page master style with the given name on this contexts page ...
Definition: ximppage.cxx:468
rtl::Reference< SdXMLPageMasterStyleContext > mxPageMasterStyle
Definition: ximpstyl.hxx:72
OUString maUseHeaderDeclName
Definition: ximppage.hxx:37
enum SAL_DLLPUBLIC_RTTI FillStyle
Definition: xmlimppr.hxx:42
Title, Content.
Definition: autolayout.hxx:28
#define CTF_LINEENDNAME
Definition: xmlsdtypes.hxx:136
sal_Int32 GetNewMasterPageCount() const
SvXMLImport & GetImport()
Definition: xmlictxt.hxx:60
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
endFastElement is called before a context will be destructed, but after an elements context has been ...
Definition: ximpstyl.cxx:474
const SdXMLImport & GetSdImport() const
Definition: ximppage.hxx:51
SvXMLStyleContext * GetStyle(sal_uInt32 i)
Definition: xmlstyle.cxx:301
sal_Int32 mnIndex
Definition: maptype.hxx:141
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
endFastElement is called before a context will be destructed, but after an elements context has been ...
Definition: ximppage.cxx:273
bool IsDefaultStyle() const
Definition: xmlstyle.hxx:110
bool IsXMLToken(std::u16string_view rString, enum XMLTokenEnum eToken)
compare eToken to the string
Definition: xmltoken.cxx:3567
FastAttributeList & castToFastAttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
#define CTF_FILLGRADIENTNAME
Definition: xmlsdtypes.hxx:137
OUString maUseFooterDeclName
Definition: ximppage.hxx:38
#define CTF_FILLTRANSNAME
Definition: xmlsdtypes.hxx:140
rtl::Reference< XMLTextImportHelper > const & GetTextImport()
Definition: xmlimp.hxx:601
rtl::Reference< SchXMLImportHelper > const & GetChartImport()
Definition: xmlimp.hxx:617
#define XMLERROR_API
Definition: xmlerror.hxx:71
XmlStyleFamily
Definition: families.hxx:49
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
Definition: xmlprcon.cxx:55
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
Definition: ximpstyl.cxx:835
Title, Content and 2 Content.
Definition: autolayout.hxx:39
#define CTF_FILLBITMAPNAME
Definition: xmlsdtypes.hxx:139
XmlStyleFamily const *const m_pFamilies
DRAW
rtl::Reference< SvXMLImportPropertyMapper > xPresImpPropMapper
Definition: ximpstyl.hxx:167
const OUString & GetName() const
Definition: ximpstyl.hxx:133
const SdXMLImport & GetSdImport() const
Definition: ximpstyl.hxx:48
static bool IsFuzzing()
int nCount
#define XMLOFF_WARN_UNKNOWN(area, rIter)
Definition: xmlictxt.hxx:114
const SdXMLImport & GetSdImport() const
Definition: ximpstyl.hxx:74
bool IsIgnoreFillStyleNamedItem(css::uno::Reference< css::beans::XPropertySet > const &xProps, drawing::FillStyle const nExpectedFillStyle)
Definition: ximpstyl.cxx:1582
Title, 2 Content over Content.
Definition: autolayout.hxx:43
SdXMLPageMasterStyleContext(SdXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
Definition: ximpstyl.cxx:333
std::unique_ptr< ContextID_Index_Pair[]> m_pContextIDs
constexpr sal_uInt16 XML_NAMESPACE_DRAW
#define XMLERROR_FLAG_WARNING
Definition: xmlerror.hxx:35
Title and 2 Content.
Definition: autolayout.hxx:30
const OUString & GetDisplayName() const
Definition: ximpstyl.hxx:112
const SdXMLImport & GetSdImport() const
Definition: ximpstyl.hxx:172
#define CTF_PAGE_SOUND_URL
Definition: xmlsdtypes.hxx:127
OUString sPrefix
std::unique_ptr< SvNumberFormatter > mpNumFormatter
Definition: ximpstyl.hxx:170
virtual rtl::Reference< SvXMLImportPropertyMapper > GetImportPropertyMapper(XmlStyleFamily nFamily) const
Definition: xmlstyle.cxx:517
void SetMasterPageStyles(SdXMLMasterPageContext const &rMaster) const
Definition: ximpstyl.cxx:1096
#define TOOLS_WARN_EXCEPTION(area, stream)
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
Definition: ximpstyl.cxx:1364
#define DBG_ASSERT(sCon, aError)
const OUString & GetDisplayName() const
Definition: xmlstyle.hxx:79
virtual void SAL_CALL endFastElement(sal_Int32) override
endFastElement is called before a context will be destructed, but after an elements context has been ...
Definition: ximpstyl.cxx:1462
int i
void DeleteAllShapes()
deletes all shapes on this drawing page
Definition: ximppage.cxx:450
virtual void FillPropertySet(const css::uno::Reference< css::beans::XPropertySet > &rPropSet)
Definition: prstylei.cxx:222
uno_Any a
#define LANGUAGE_SYSTEM
Title, Content over Content.
Definition: autolayout.hxx:41
virtual SvXMLStyleContext * CreateDefaultStyleStyleChildContext(XmlStyleFamily nFamily, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
Definition: xmlstyle.cxx:448
::std::vector< XMLPropertyState > & GetProperties()
Definition: prstylei.hxx:79
exports com.sun.star. view
void SetStyle(const css::uno::Reference< css::style::XStyle > &xStl)
Definition: prstylei.hxx:107
std::vector< rtl::Reference< SdXMLPresentationPlaceholderContext > > maList
Definition: ximpstyl.hxx:142
virtual SvXMLStyleContext * CreateStyleStyleChildContext(XmlStyleFamily nFamily, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: ximpstyl.cxx:955
OUString maUseDateTimeDeclName
Definition: ximppage.hxx:39
NUMBER
Vertical Title, Vertical Content over Vertical Content.
Definition: autolayout.hxx:55
SdXMLMasterStylesContext(SdXMLImport &rImport)
Definition: ximpstyl.cxx:1358
float u
static bool convertColor(sal_Int32 &rColor, std::u16string_view rValue)
void IncrementNewMasterPageCount()
size
void AddDateTimeDecl(const OUString &rName, const OUString &rText, bool bFixed, const OUString &rDateTimeFormat)
Definition: sdxmlimp.cxx:607
virtual ~SdXMLMasterPageContext() override
Definition: ximpstyl.cxx:817
void ImpSetCellStyles() const
Definition: ximpstyl.cxx:1136
void AddHeaderDecl(const OUString &rName, const OUString &rText)
Definition: sdxmlimp.cxx:595
virtual SvXMLStyleContext * CreateDefaultStyleStyleChildContext(XmlStyleFamily nFamily, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: ximpstyl.cxx:975
const SdXMLImport & GetSdImport() const
Definition: ximpstyl.hxx:123
#define CTF_FILLHATCHNAME
Definition: xmlsdtypes.hxx:138
virtual ~SdXMLPresentationPlaceholderContext() override
Definition: ximpstyl.cxx:724
virtual rtl::Reference< SvXMLImportPropertyMapper > GetImportPropertyMapper(XmlStyleFamily nFamily) const override
Definition: ximpstyl.cxx:991
Blank Slide.
Definition: autolayout.hxx:47
const SdXMLImport & GetSdImport() const
Definition: ximpstyl.hxx:145
#define CTF_LINESTARTNAME
Definition: xmlsdtypes.hxx:135
SdXMLHeaderFooterDeclContext(SvXMLImport &rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
Definition: ximpstyl.cxx:1431
This class deliberately does not support XWeak, to improve performance when loading large documents...
Definition: xmlictxt.hxx:45
virtual void Finish(bool bOverwrite) override
Definition: prstylei.cxx:448
XMLDrawingPageStyleContext(SvXMLImport &rImport, SvXMLStylesContext &rStyles, ContextID_Index_Pair const pContextIDs[], XmlStyleFamily const pFamilies[])
Definition: ximpstyl.cxx:209
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
Definition: ximpstyl.cxx:425
Title Slide.
Definition: autolayout.hxx:27
css::uno::Any maValue
Definition: maptype.hxx:142
const OUString & GetParentName() const
Definition: xmlstyle.hxx:81
css::uno::Reference< css::uno::XComponentContext > const & GetComponentContext() const
Definition: xmlimp.cxx:1794
SdXMLPageMasterContext(SdXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
Definition: ximpstyl.cxx:414
OUString GetStyleDisplayName(XmlStyleFamily nFamily, const OUString &rName) const
Definition: xmlimp.cxx:1420
#define SAL_WARN_IF(condition, area, stream)
const OUString & GetName() const
Definition: xmlstyle.hxx:78
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
virtual SvXMLStyleContext * CreateStyleChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: ximpstyl.cxx:901
css::view::PaperOrientation meOrientation
Definition: ximpstyl.hxx:46
Handling of tokens in XML:
Title, 2 Vertical Content.
Definition: autolayout.hxx:57
#define SAL_INFO(area, stream)
#define CTF_DASHNAME
Definition: xmlsdtypes.hxx:134
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
double mnWidth
const css::uno::Reference< css::drawing::XShapes > & GetLocalShapesContext() const
Definition: ximppage.hxx:71
#define XML_ELEMENT(prefix, name)
Definition: xmlimp.hxx:97
css::uno::Reference< css::container::XNameAccess > getPageLayouts() const
Definition: ximpstyl.cxx:1341
virtual SvXMLStyleContext * CreateStyleStyleChildContext(XmlStyleFamily nFamily, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
Definition: xmlstyle.cxx:414
Smart struct to transport an Any with an index to the appropriate property-name.
Definition: maptype.hxx:139
const SvXMLUnitConverter & GetMM100UnitConverter() const
Definition: xmlimp.hxx:400
SdXMLPresentationPlaceholderContext(SdXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
Definition: ximpstyl.cxx:680
Title, 6 Content.
Definition: autolayout.hxx:61
TABLE
#define CTF_DATE_TIME_FORMAT
Definition: xmlsdtypes.hxx:191
SvXMLStylesContext * GetStyles()
Definition: prstylei.hxx:78
#define XML_TYPE_PROP_DRAWING_PAGE
Definition: xmltypes.hxx:95
const SvXMLStyleContext * FindStyleChildContext(XmlStyleFamily nFamily, const OUString &rName, bool bCreateIndex=false) const
Definition: xmlstyle.cxx:798
void AddStyleDisplayName(XmlStyleFamily nFamily, const OUString &rName, const OUString &rDisplayName)
Definition: xmlimp.cxx:1389
This struct is used as an optional parameter to the static _FillPropertySet() methods.
Definition: xmlimppr.hxx:57
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
Definition: ximppage.cxx:244
constexpr sal_Int32 TOKEN_MASK
Definition: xmlimp.hxx:94
#define XMLOFF_WARN_UNKNOWN_ELEMENT(area, token)
Definition: xmlictxt.hxx:120
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
Definition: ximpstyl.cxx:452
SdXMLStylesContext(SdXMLImport &rImport, bool bIsAutoStyle)
Definition: ximpstyl.cxx:890
Title, Vertical Content.
Definition: autolayout.hxx:56
SdXMLPresentationPageLayoutContext(SdXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
Definition: ximpstyl.cxx:441
virtual void FillPropertySet(css::uno::Reference< css::beans::XPropertySet > const &rPropSet) override
Definition: ximpstyl.cxx:288
sal_uInt32 GetStyleCount() const
Definition: xmlstyle.cxx:296
void SetStyle(OUString const &rStyleName)
sets the page style on this page
Definition: ximppage.cxx:349
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
endFastElement is called before a context will be destructed, but after an elements context has been ...
Definition: ximpstyl.cxx:821
const SdXMLImport & GetSdImport() const
Definition: ximpstyl.hxx:217
virtual void SAL_CALL characters(const OUString &rChars) override
This method is called for all characters that are contained in the current element.
Definition: ximpstyl.cxx:1484
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
endFastElement is called before a context will be destructed, but after an elements context has been ...
Definition: ximpstyl.cxx:1036
Centered Text.
Definition: autolayout.hxx:59
void FinishStyles(bool bOverwrite)
Definition: xmlstyle.cxx:784
std::unique_ptr< SvXMLNumFmtHelper > mpNumFmtHelper
Definition: ximpstyl.hxx:169
Vertical Title, Vertical Content over Vertical Content.
Definition: autolayout.hxx:54
void ImpSetGraphicStyles() const
Definition: ximpstyl.cxx:1122
virtual bool IsTransient() const override
if this method returns true, its parent styles context should not add it to its container.
Definition: ximpstyl.cxx:1457
rtl::Reference< XMLShapeImportHelper > const & GetShapeImport()
Definition: xmlimp.hxx:609
virtual ~SdXMLPageMasterStyleContext() override
Definition: ximpstyl.cxx:409
SdXMLMasterPageContext(SdXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, css::uno::Reference< css::drawing::XShapes > const &rShapes)
Definition: ximpstyl.cxx:729
bool m_bDetectedRangeSegmentation false
static bool canSkipReset(std::u16string_view rName, const XMLPropStyleContext *pPropStyle, const uno::Reference< beans::XPropertySet > &rPropSet, const rtl::Reference< XMLPropertySetMapper > &rPrMap)
Definition: ximpstyl.cxx:1156