LibreOffice Module xmloff (master) 1
xmlstyle.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 <config_wasm_strip.h>
21
22#include <sal/config.h>
23
24#include <com/sun/star/frame/XModel.hpp>
25#include <com/sun/star/xml/sax/XAttributeList.hpp>
26#include <com/sun/star/container/XNameContainer.hpp>
27#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
28#include <com/sun/star/style/XAutoStylesSupplier.hpp>
29#include <com/sun/star/style/XAutoStyleFamily.hpp>
30#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
32#include <sal/log.hxx>
33#include <svl/style.hxx>
34#include <utility>
37#include <xmloff/xmltoken.hxx>
38
39#include <xmloff/families.hxx>
40#include <xmloff/xmlimp.hxx>
41#include <xmloff/xmlnumi.hxx>
42#include <xmloff/xmlimppr.hxx>
43#include <xmloff/xmlstyle.hxx>
44#include <xmloff/txtstyli.hxx>
45#include <xmloff/xmlnumfi.hxx>
48#include <XMLThemeContext.hxx>
50#include "FillStyleContext.hxx"
56
57#include <memory>
58#include <set>
59#include <string_view>
60#include <vector>
61
62using namespace ::com::sun::star;
63using namespace ::com::sun::star::uno;
64using namespace ::com::sun::star::container;
65using namespace ::com::sun::star::style;
66using namespace ::xmloff::token;
67
68constexpr OUStringLiteral gsParaStyleServiceName( u"com.sun.star.style.ParagraphStyle" );
69constexpr OUStringLiteral gsTextStyleServiceName( u"com.sun.star.style.CharacterStyle" );
70
71void SvXMLStyleContext::SetAttribute( sal_Int32 nElement,
72 const OUString& rValue )
73{
74 switch (nElement)
75 {
77 {
78 if( IsXMLToken( rValue, XML_PARAGRAPH ) )
79 mnFamily = XmlStyleFamily(SfxStyleFamily::Para);
80 else if( IsXMLToken( rValue, XML_TEXT ) )
81 mnFamily = XmlStyleFamily(SfxStyleFamily::Char);
82 break;
83 }
85 maName = rValue;
86 break;
88 maDisplayName = rValue;
89 break;
91 maParentName = rValue;
92 break;
94 maFollow = rValue;
95 break;
97 maLinked = rValue;
98 break;
100 mbHidden = rValue.toBoolean();
101 break;
102 case XML_ELEMENT(LO_EXT, XML_HIDDEN):
103 mbHidden = rValue.toBoolean();
104 break;
105 }
106}
107
108
110 SvXMLImport& rImp,
111 XmlStyleFamily nFam, bool bDefault ) :
112 SvXMLImportContext( rImp ),
113 mbHidden( false ),
114 mnFamily( nFam ),
115 mbValid( true ),
116 mbNew( true ),
117 mbDefaultStyle( bDefault )
118{
119}
120
122{
123}
124
126 sal_Int32 /*nElement*/,
127 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
128{
129 for( auto &it : sax_fastparser::castToFastAttributeList( xAttrList ) )
130 SetAttribute( it.getToken(), it.toString() );
131}
132
134{
135}
136
137void SvXMLStyleContext::CreateAndInsert( bool /*bOverwrite*/ )
138{
139}
140
141void SvXMLStyleContext::CreateAndInsertLate( bool /*bOverwrite*/ )
142{
143}
144
145void SvXMLStyleContext::Finish( bool /*bOverwrite*/ )
146{
147}
148
150{
151 return false;
152}
153
154namespace {
156class SvXMLStyleIndex_Impl
157{
158 OUString sName;
160 // we deliberately don't use a reference here, to avoid creating a ref-count-cycle
161 SvXMLStyleContext* mpStyle;
162
163public:
164
165 SvXMLStyleIndex_Impl( XmlStyleFamily nFam, OUString aName ) :
166 sName(std::move( aName )),
167 nFamily( nFam ),
168 mpStyle(nullptr)
169 {
170 }
171
172 SvXMLStyleIndex_Impl( const rtl::Reference<SvXMLStyleContext> &rStl ) :
173 sName( rStl->GetName() ),
174 nFamily( rStl->GetFamily() ),
175 mpStyle ( rStl.get() )
176 {
177 }
178
179 const OUString& GetName() const { return sName; }
180 XmlStyleFamily GetFamily() const { return nFamily; }
181 const SvXMLStyleContext *GetStyle() const { return mpStyle; }
182};
183
184struct SvXMLStyleIndexCmp_Impl
185{
186 bool operator()(const SvXMLStyleIndex_Impl& r1, const SvXMLStyleIndex_Impl& r2) const
187 {
188 sal_Int32 nRet;
189
190 if( r1.GetFamily() < r2.GetFamily() )
191 nRet = -1;
192 else if( r1.GetFamily() > r2.GetFamily() )
193 nRet = 1;
194 else
195 nRet = r1.GetName().compareTo( r2.GetName() );
196
197 return nRet < 0;
198 }
199};
200
201}
202
204{
205 typedef std::set<SvXMLStyleIndex_Impl, SvXMLStyleIndexCmp_Impl> IndicesType;
206
207 std::vector<rtl::Reference<SvXMLStyleContext>> aStyles;
208 mutable std::unique_ptr<IndicesType> pIndices;
210
211#if OSL_DEBUG_LEVEL > 0
212 mutable sal_uInt32 m_nIndexCreated;
213#endif
214
215 void FlushIndex() { pIndices.reset(); }
216
217public:
218 explicit SvXMLStylesContext_Impl( bool bAuto );
219
220 size_t GetStyleCount() const { return aStyles.size(); }
221
223 {
224 return i < aStyles.size() ? aStyles[ i ].get() : nullptr;
225 }
226
227 inline void AddStyle( SvXMLStyleContext *pStyle );
228 void dispose();
229
231 const OUString& rName,
232 bool bCreateIndex ) const;
233 bool IsAutomaticStyle() const { return bAutomaticStyle; }
234};
235
237 bAutomaticStyle( bAuto )
238#if OSL_DEBUG_LEVEL > 0
239 , m_nIndexCreated( 0 )
240#endif
241{}
242
244{
245#if OSL_DEBUG_LEVEL > 0
246// for (auto const & xStyle : aStyles)
247// if (xStyle->GetFamily() == pStyle->GetFamily() && xStyle->GetName() == pStyle->GetName())
248// assert(false && "duplicate style");
249#endif
250 aStyles.emplace_back(pStyle );
251
252 FlushIndex();
253}
254
256{
257 FlushIndex();
258 aStyles.clear();
259}
260
262 const OUString& rName,
263 bool bCreateIndex ) const
264{
265 const SvXMLStyleContext *pStyle = nullptr;
266
267 if( !pIndices && bCreateIndex && !aStyles.empty() )
268 {
269 pIndices = std::make_unique<IndicesType>(aStyles.begin(), aStyles.end());
270 SAL_WARN_IF(pIndices->size() != aStyles.size(), "xmloff.style", "Here is a duplicate Style");
271#if OSL_DEBUG_LEVEL > 0
272 SAL_WARN_IF(0 != m_nIndexCreated, "xmloff.style",
273 "Performance warning: sdbcx::Index created multiple times");
275#endif
276 }
277
278 if( pIndices )
279 {
280 SvXMLStyleIndex_Impl aIndex( nFamily, rName );
281 IndicesType::iterator aFind = pIndices->find(aIndex);
282 if( aFind != pIndices->end() )
283 pStyle = aFind->GetStyle();
284 }
285 else
286 {
287 for( size_t i = 0; !pStyle && i < aStyles.size(); i++ )
288 {
289 const SvXMLStyleContext *pS = aStyles[ i ].get();
290 if( pS->GetFamily() == nFamily &&
291 pS->GetName() == rName )
292 pStyle = pS;
293 }
294 }
295 return pStyle;
296}
297
298
300{
301 return mpImpl->GetStyleCount();
302}
303
305{
306 return mpImpl->GetStyle( i );
307}
308
310{
311 return mpImpl->GetStyle( i );
312}
313
315{
316 return mpImpl->IsAutomaticStyle();
317}
318
320 sal_Int32 nElement,
321 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList)
322{
323 SvXMLStyleContext *pStyle = nullptr;
324
325 if(GetImport().GetDataStylesImport())
326 {
327 pStyle = GetImport().GetDataStylesImport()->CreateChildContext(GetImport(), nElement,
328 xAttrList, *this);
329 if (pStyle)
330 return pStyle;
331 }
332
333 switch (nElement)
334 {
337 {
339 for( auto &aIter : sax_fastparser::castToFastAttributeList( xAttrList ) )
340 {
341 if( aIter.getToken() == XML_ELEMENT(STYLE, XML_FAMILY) )
342 {
343 nFamily = GetFamily( aIter.toString() );
344 break;
345 }
346 }
347 pStyle = XML_ELEMENT(STYLE, XML_STYLE)==nElement
348 ? CreateStyleStyleChildContext( nFamily, nElement, xAttrList )
349 : CreateDefaultStyleStyleChildContext( nFamily, nElement, xAttrList );
350 break;
351 }
354 break;
357 GetImport(), nElement, xAttrList);
358 break;
361 break;
364 {
365 //there is not page family in ODF now, so I specify one for it
366 bool bDefaultStyle = XML_ELEMENT(STYLE, XML_DEFAULT_PAGE_LAYOUT) == nElement;
367 pStyle = new PageStyleContext( GetImport(), *this, bDefaultStyle );
368 }
369 break;
371 pStyle = new SvxXMLListStyleContext( GetImport() );
372 break;
374 pStyle = new SvxXMLListStyleContext( GetImport(), true );
375 break;
376
377 // FillStyles
378
380 {
381 pStyle = new XMLGradientStyleContext( GetImport(), nElement, xAttrList );
382 break;
383 }
385 {
386 pStyle = new XMLHatchStyleContext( GetImport(), nElement, xAttrList );
387 break;
388 }
390 {
391 pStyle = new XMLBitmapStyleContext( GetImport(), nElement, xAttrList );
392 break;
393 }
395 {
396 pStyle = new XMLTransGradientStyleContext( GetImport(), nElement, xAttrList );
397 break;
398 }
400 {
401 pStyle = new XMLMarkerStyleContext( GetImport(), nElement, xAttrList );
402 break;
403 }
405 {
406 pStyle = new XMLDashStyleContext( GetImport(), nElement, xAttrList );
407 break;
408 }
409 }
410
411 if (!pStyle)
412 SAL_WARN("xmloff", "Unknown element " << SvXMLImport::getPrefixAndNameFromToken(nElement));
413
414 return pStyle;
415}
416
418 XmlStyleFamily nFamily, sal_Int32 /*nElement*/,
419 const uno::Reference< xml::sax::XFastAttributeList > & /*xAttrList*/ )
420{
421 SvXMLStyleContext *pStyle = nullptr;
422
423 switch( nFamily )
424 {
428 pStyle = new XMLTextStyleContext( GetImport(), *this, nFamily );
429 break;
430
432 pStyle = new XMLPropStyleContext( GetImport(), *this, nFamily );
433 break;
434#if !ENABLE_WASM_STRIP_CHART
435 // WASM_CHART change
437 pStyle = new XMLChartStyleContext( GetImport(), *this, nFamily );
438 break;
439#endif
443 pStyle = new XMLShapeStyleContext( GetImport(), *this, nFamily );
444 break;
445 default: break;
446 }
447
448 return pStyle;
449}
450
452 XmlStyleFamily /*nFamily*/, sal_Int32 /*nElement*/,
453 const uno::Reference< xml::sax::XFastAttributeList > & )
454{
455 return nullptr;
456}
457
459{
460 return true;
461}
462
464{
466 if( IsXMLToken( rValue, XML_PARAGRAPH ) )
467 {
469 }
470 else if( IsXMLToken( rValue, XML_TEXT ) )
471 {
473 }
474 else if( IsXMLToken( rValue, XML_DATA_STYLE ) )
475 {
477 }
478 else if ( IsXMLToken( rValue, XML_SECTION ) )
479 {
481 }
482 else if( IsXMLToken( rValue, XML_TABLE ) )
483 {
485 }
486 else if( IsXMLToken( rValue, XML_TABLE_COLUMN ) )
488 else if( IsXMLToken( rValue, XML_TABLE_ROW ) )
490 else if( IsXMLToken( rValue, XML_TABLE_CELL ) )
492 else if ( rValue == XML_STYLE_FAMILY_SD_GRAPHICS_NAME )
493 {
495 }
496 else if ( rValue == XML_STYLE_FAMILY_SD_PRESENTATION_NAME )
497 {
499 }
500 else if ( rValue == XML_STYLE_FAMILY_SD_POOL_NAME )
501 {
503 }
504 else if ( rValue == XML_STYLE_FAMILY_SD_DRAWINGPAGE_NAME )
505 {
507 }
508 else if ( rValue == XML_STYLE_FAMILY_SCH_CHART_NAME )
509 {
511 }
512 else if ( IsXMLToken( rValue, XML_RUBY ) )
513 {
515 }
516
517 return nFamily;
518}
519
521 XmlStyleFamily nFamily ) const
522{
524
525 switch( nFamily )
526 {
528 if( !mxParaImpPropMapper.is() )
529 {
530 SvXMLStylesContext * pThis = const_cast<SvXMLStylesContext *>(this);
531 pThis->mxParaImpPropMapper =
532 pThis->GetImport().GetTextImport()
533 ->GetParaImportPropertySetMapper();
534 }
535 xMapper = mxParaImpPropMapper;
536 break;
538 if( !mxTextImpPropMapper.is() )
539 {
540 SvXMLStylesContext * pThis = const_cast<SvXMLStylesContext *>(this);
541 pThis->mxTextImpPropMapper =
542 pThis->GetImport().GetTextImport()
543 ->GetTextImportPropertySetMapper();
544 }
545 xMapper = mxTextImpPropMapper;
546 break;
547
549 // don't cache section mapper, as it's rarely used
550 // *sigh*, cast to non-const, because this is a const method,
551 // but SvXMLImport::GetTextImport() isn't.
552 xMapper = const_cast<SvXMLStylesContext*>(this)->GetImport().GetTextImport()->
553 GetSectionImportPropertySetMapper();
554 break;
555
557 // don't cache section mapper, as it's rarely used
558 // *sigh*, cast to non-const, because this is a const method,
559 // but SvXMLImport::GetTextImport() isn't.
560 xMapper = const_cast<SvXMLStylesContext*>(this)->GetImport().GetTextImport()->
561 GetRubyImportPropertySetMapper();
562 break;
563
567 if(!mxShapeImpPropMapper.is())
568 {
569 rtl::Reference< XMLShapeImportHelper > aImpHelper = const_cast<SvXMLImport&>(GetImport()).GetShapeImport();
570 const_cast<SvXMLStylesContext*>(this)->mxShapeImpPropMapper =
571 aImpHelper->GetPropertySetMapper();
572 }
573 xMapper = mxShapeImpPropMapper;
574 break;
575#if !ENABLE_WASM_STRIP_CHART
576 // WASM_CHART change
578 if( ! mxChartImpPropMapper.is() )
579 {
580 XMLPropertySetMapper *const pPropMapper = new XMLChartPropertySetMapper(nullptr);
582 }
583 xMapper = mxChartImpPropMapper;
584 break;
585#endif
587 if( ! mxPageImpPropMapper.is() )
588 {
589 XMLPropertySetMapper *pPropMapper =
592 new PageMasterImportPropertyMapper( pPropMapper,
593 const_cast<SvXMLStylesContext*>(this)->GetImport() );
594 }
595 xMapper = mxPageImpPropMapper;
596 break;
597 default: break;
598 }
599
600 return xMapper;
601}
602
603Reference < XAutoStyleFamily > SvXMLStylesContext::GetAutoStyles( XmlStyleFamily nFamily ) const
604{
605 Reference < XAutoStyleFamily > xAutoStyles;
607 {
608 bool bPara = XmlStyleFamily::TEXT_PARAGRAPH == nFamily;
609 if( !bPara && mxTextAutoStyles.is() )
610 xAutoStyles = mxTextAutoStyles;
611 else if( bPara && mxParaAutoStyles.is() )
612 xAutoStyles = mxParaAutoStyles;
613 else
614 {
615 OUString sName(bPara ? std::u16string_view( u"ParagraphStyles" ): std::u16string_view( u"CharacterStyles" ));
616 Reference< XAutoStylesSupplier > xAutoStylesSupp( GetImport().GetModel(), UNO_QUERY );
617 Reference< XAutoStyles > xAutoStyleFamilies = xAutoStylesSupp->getAutoStyles();
618 if (xAutoStyleFamilies->hasByName(sName))
619 {
620 Any aAny = xAutoStyleFamilies->getByName( sName );
621 aAny >>= xAutoStyles;
622 if( bPara )
623 const_cast<SvXMLStylesContext *>(this)->mxParaAutoStyles = xAutoStyles;
624 else
625 const_cast<SvXMLStylesContext *>(this)->mxTextAutoStyles = xAutoStyles;
626 }
627 }
628 }
629 return xAutoStyles;
630}
631
632Reference < XNameContainer > SvXMLStylesContext::GetStylesContainer(
633 XmlStyleFamily nFamily ) const
634{
635 Reference < XNameContainer > xStyles;
636 OUString sName;
637 switch( nFamily )
638 {
640 if( mxParaStyles.is() )
641 xStyles = mxParaStyles;
642 else
643 sName = "ParagraphStyles";
644 break;
645
647 if( mxTextStyles.is() )
648 xStyles = mxTextStyles;
649 else
650 sName = "CharacterStyles";
651 break;
652 default: break;
653 }
654 if( !xStyles.is() && !sName.isEmpty() )
655 {
656 Reference< XStyleFamiliesSupplier > xFamiliesSupp(
657 GetImport().GetModel(), UNO_QUERY );
658 if ( xFamiliesSupp.is() )
659 {
660 Reference< XNameAccess > xFamilies = xFamiliesSupp->getStyleFamilies();
661 if (xFamilies->hasByName(sName))
662 {
663 xStyles.set(xFamilies->getByName( sName ),uno::UNO_QUERY);
664
665 switch( nFamily )
666 {
668 const_cast<SvXMLStylesContext *>(this)->mxParaStyles = xStyles;
669 break;
670
672 const_cast<SvXMLStylesContext *>(this)->mxTextStyles = xStyles;
673 break;
674 default: break;
675 }
676 }
677 }
678 }
679
680 return xStyles;
681}
682
684{
685 OUString sServiceName;
686 switch( nFamily )
687 {
690 break;
693 break;
694 default: break;
695 }
696
697 return sServiceName;
698}
699
700SvXMLStylesContext::SvXMLStylesContext( SvXMLImport& rImport, bool bAuto ) :
701 SvXMLImportContext( rImport ),
702 mpImpl( new SvXMLStylesContext_Impl( bAuto ) )
703{
704}
705
707{
708}
709
710css::uno::Reference< css::xml::sax::XFastContextHandler > SvXMLStylesContext::createFastChildContext(
711 sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
712{
713 SvXMLStyleContext* pStyle = CreateStyleChildContext( nElement, xAttrList );
714 if (pStyle)
715 {
716 if (!pStyle->IsTransient())
717 mpImpl->AddStyle(pStyle);
718 return pStyle;
719 }
720 else if (nElement == XML_ELEMENT(LO_EXT, XML_THEME))
721 {
722 uno::Reference<drawing::XDrawPageSupplier> const xDrawPageSupplier(GetImport().GetModel(), uno::UNO_QUERY);
723 if (xDrawPageSupplier.is())
724 {
725 uno::Reference<drawing::XDrawPage> xPage = xDrawPageSupplier->getDrawPage();
726 if (xPage.is())
727 return new XMLThemeContext(GetImport(), xAttrList, xPage);
728 }
729 }
730
731 return nullptr;
732}
733
735{
736 mpImpl->AddStyle( &rNew );
737}
738
740{
741 mpImpl->dispose();
742}
743
745{
746 sal_uInt32 nCount = GetStyleCount();
747 sal_uInt32 i;
748 for( i = 0; i < nCount; i++ )
749 {
750 SvXMLStyleContext *pStyle = GetStyle( i );
751 if( !pStyle || ( pStyle->GetFamily() != XmlStyleFamily::TEXT_TEXT &&
754 continue;
755 pStyle->CreateAndInsert( false );
756 }
757}
758
760 bool bFinish )
761{
762 // pass 1: create text, paragraph and frame styles
763 sal_uInt32 nCount = GetStyleCount();
764 sal_uInt32 i;
765
766 for( i = 0; i < nCount; i++ )
767 {
768 SvXMLStyleContext *pStyle = GetStyle( i );
769 if( !pStyle )
770 continue;
771
772 if (pStyle->IsDefaultStyle())
773 {
774 if (bOverwrite) pStyle->SetDefaults();
775 }
776 else if( InsertStyleFamily( pStyle->GetFamily() ) )
777 pStyle->CreateAndInsert( bOverwrite );
778 }
779
780 // pass 2: create list styles (they require char styles)
781 for( i=0; i<nCount; i++ )
782 {
783 SvXMLStyleContext *pStyle = GetStyle( i );
784 if( !pStyle || pStyle->IsDefaultStyle())
785 continue;
786
787 if( InsertStyleFamily( pStyle->GetFamily() ) )
788 pStyle->CreateAndInsertLate( bOverwrite );
789 }
790
791 // pass3: finish creation of styles
792 if( bFinish )
793 FinishStyles( bOverwrite );
794}
795
796void SvXMLStylesContext::FinishStyles( bool bOverwrite )
797{
798 sal_uInt32 nCount = GetStyleCount();
799 for( sal_uInt32 i=0; i<nCount; i++ )
800 {
801 SvXMLStyleContext *pStyle = GetStyle( i );
802 if( !pStyle || !pStyle->IsValid() || pStyle->IsDefaultStyle() )
803 continue;
804
805 if( InsertStyleFamily( pStyle->GetFamily() ) )
806 pStyle->Finish( bOverwrite );
807 }
808}
809
811 XmlStyleFamily nFamily,
812 const OUString& rName,
813 bool bCreateIndex ) const
814{
815 return mpImpl->FindStyleChildContext( nFamily, rName, bCreateIndex );
816}
817
818/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const char * pS
constexpr OUStringLiteral sServiceName
This class deliberately does not support XWeak, to improve performance when loading large documents.
Definition: xmlictxt.hxx:48
SvXMLImport & GetImport()
Definition: xmlictxt.hxx:60
friend class SvXMLImport
Definition: xmlictxt.hxx:49
OUString maParentName
Definition: xmlstyle.hxx:45
virtual void SetAttribute(sal_Int32 nElement, const OUString &rValue)
Definition: xmlstyle.cxx:71
OUString maName
Definition: xmlstyle.hxx:42
OUString maFollow
Definition: xmlstyle.hxx:46
virtual void Finish(bool bOverwrite)
Definition: xmlstyle.cxx:145
virtual void CreateAndInsert(bool bOverwrite)
Definition: xmlstyle.cxx:137
virtual void CreateAndInsertLate(bool bOverwrite)
Definition: xmlstyle.cxx:141
XmlStyleFamily mnFamily
Definition: xmlstyle.hxx:50
XmlStyleFamily GetFamily() const
Definition: xmlstyle.hxx:85
virtual bool IsTransient() const
if this method returns true, its parent styles context should not add it to its container.
Definition: xmlstyle.cxx:149
OUString maLinked
Definition: xmlstyle.hxx:47
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &) override
Definition: xmlstyle.cxx:125
bool IsDefaultStyle() const
Definition: xmlstyle.hxx:110
virtual void SetDefaults()
Definition: xmlstyle.cxx:133
SvXMLStyleContext(SvXMLImport &rImport, XmlStyleFamily nFamily=XmlStyleFamily::DATA_STYLE, bool bDefaultStyle=false)
Definition: xmlstyle.cxx:109
bool IsValid() const
Definition: xmlstyle.hxx:87
OUString maDisplayName
Definition: xmlstyle.hxx:43
virtual ~SvXMLStyleContext() override
Definition: xmlstyle.cxx:121
std::vector< rtl::Reference< SvXMLStyleContext > > aStyles
Definition: xmlstyle.cxx:207
SvXMLStylesContext_Impl(bool bAuto)
Definition: xmlstyle.cxx:236
bool IsAutomaticStyle() const
Definition: xmlstyle.cxx:233
const SvXMLStyleContext * FindStyleChildContext(XmlStyleFamily nFamily, const OUString &rName, bool bCreateIndex) const
Definition: xmlstyle.cxx:261
SvXMLStyleContext * GetStyle(size_t i)
Definition: xmlstyle.cxx:222
sal_uInt32 m_nIndexCreated
Definition: xmlstyle.cxx:212
std::set< SvXMLStyleIndex_Impl, SvXMLStyleIndexCmp_Impl > IndicesType
Definition: xmlstyle.cxx:205
void AddStyle(SvXMLStyleContext *pStyle)
Definition: xmlstyle.cxx:243
std::unique_ptr< IndicesType > pIndices
Definition: xmlstyle.cxx:208
size_t GetStyleCount() const
Definition: xmlstyle.cxx:220
static XmlStyleFamily GetFamily(std::u16string_view rFamily)
Definition: xmlstyle.cxx:463
sal_uInt32 GetStyleCount() const
Definition: xmlstyle.cxx:299
const SvXMLStyleContext * FindStyleChildContext(XmlStyleFamily nFamily, const OUString &rName, bool bCreateIndex=false) const
Definition: xmlstyle.cxx:810
virtual css::uno::Reference< css::container::XNameContainer > GetStylesContainer(XmlStyleFamily nFamily) const
Definition: xmlstyle.cxx:632
virtual SvXMLStyleContext * CreateDefaultStyleStyleChildContext(XmlStyleFamily nFamily, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
Definition: xmlstyle.cxx:451
std::unique_ptr< SvXMLStylesContext_Impl > mpImpl
Definition: xmlstyle.hxx:125
virtual ~SvXMLStylesContext() override
Definition: xmlstyle.cxx:706
virtual bool InsertStyleFamily(XmlStyleFamily nFamily) const
Definition: xmlstyle.cxx:458
SvXMLStyleContext * GetStyle(sal_uInt32 i)
Definition: xmlstyle.cxx:304
void CopyStylesToDoc(bool bOverwrite, bool bFinish=true)
Definition: xmlstyle.cxx:759
css::uno::Reference< css::container::XNameContainer > mxTextStyles
Definition: xmlstyle.hxx:130
virtual rtl::Reference< SvXMLImportPropertyMapper > GetImportPropertyMapper(XmlStyleFamily nFamily) const
Definition: xmlstyle.cxx:520
virtual SvXMLStyleContext * CreateStyleChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
Definition: xmlstyle.cxx:319
virtual SvXMLStyleContext * CreateStyleStyleChildContext(XmlStyleFamily nFamily, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
Definition: xmlstyle.cxx:417
rtl::Reference< SvXMLImportPropertyMapper > mxPageImpPropMapper
Definition: xmlstyle.hxx:140
rtl::Reference< SvXMLImportPropertyMapper > mxParaImpPropMapper
Definition: xmlstyle.hxx:136
rtl::Reference< SvXMLImportPropertyMapper > mxChartImpPropMapper
Definition: xmlstyle.hxx:139
void FinishStyles(bool bOverwrite)
Definition: xmlstyle.cxx:796
bool IsAutomaticStyle() const
Definition: xmlstyle.cxx:314
css::uno::Reference< css::style::XAutoStyleFamily > mxParaAutoStyles
Definition: xmlstyle.hxx:132
virtual OUString GetServiceName(XmlStyleFamily nFamily) const
Definition: xmlstyle.cxx:683
rtl::Reference< SvXMLImportPropertyMapper > mxShapeImpPropMapper
Definition: xmlstyle.hxx:138
SvXMLStylesContext(SvXMLStylesContext const &)=delete
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: xmlstyle.cxx:710
void CopyAutoStylesToDoc()
Definition: xmlstyle.cxx:744
css::uno::Reference< css::container::XNameContainer > mxParaStyles
Definition: xmlstyle.hxx:128
css::uno::Reference< css::style::XAutoStyleFamily > GetAutoStyles(XmlStyleFamily nFamily) const
Definition: xmlstyle.cxx:603
void AddStyle(SvXMLStyleContext &rNew)
Definition: xmlstyle.cxx:734
css::uno::Reference< css::style::XAutoStyleFamily > mxTextAutoStyles
Definition: xmlstyle.hxx:134
rtl::Reference< SvXMLImportPropertyMapper > mxTextImpPropMapper
Definition: xmlstyle.hxx:137
import footnote and endnote configuration elements
import <text:linenumbering-configuration> elements
Imports the theme.
int nCount
virtual OUString GetName() const override
float u
std::deque< AttacherIndex_Impl > aIndex
XmlStyleFamily
Definition: families.hxx:50
#define XML_STYLE_FAMILY_SD_POOL_NAME
Definition: families.hxx:42
constexpr OUStringLiteral XML_STYLE_FAMILY_SD_GRAPHICS_NAME
Definition: families.hxx:38
constexpr OUStringLiteral XML_STYLE_FAMILY_SD_DRAWINGPAGE_NAME
Definition: families.hxx:43
constexpr OUStringLiteral XML_STYLE_FAMILY_SCH_CHART_NAME
Definition: families.hxx:45
constexpr OUStringLiteral XML_STYLE_FAMILY_SD_PRESENTATION_NAME
Definition: families.hxx:40
DRAW
OUString aName
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
if(aStr !=aBuf) UpdateName_Impl(m_xFollowLb.get()
const char * sName
int i
FastAttributeList & castToFastAttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
Handling of tokens in XML:
@ XML_BIBLIOGRAPHY_CONFIGURATION
Definition: xmltoken.hxx:326
@ XML_DEFAULT_PAGE_LAYOUT
Definition: xmltoken.hxx:2300
@ XML_LINENUMBERING_CONFIGURATION
Definition: xmltoken.hxx:1204
@ XML_NOTES_CONFIGURATION
Definition: xmltoken.hxx:2618
bool IsXMLToken(std::u16string_view rString, enum XMLTokenEnum eToken)
compare eToken to the string
Definition: xmltoken.cxx:3581
bool mbValid
TEXT
#define XML_ELEMENT(prefix, name)
Definition: xmlimp.hxx:97
constexpr OUStringLiteral gsParaStyleServiceName(u"com.sun.star.style.ParagraphStyle")
constexpr OUStringLiteral gsTextStyleServiceName(u"com.sun.star.style.CharacterStyle")