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" );
70constexpr OUStringLiteral gsParagraphStyles(u"ParagraphStyles");
71constexpr OUStringLiteral gsCharacterStyles(u"CharacterStyles");
72
73void SvXMLStyleContext::SetAttribute( sal_Int32 nElement,
74 const OUString& rValue )
75{
76 switch (nElement)
77 {
79 {
80 if( IsXMLToken( rValue, XML_PARAGRAPH ) )
81 mnFamily = XmlStyleFamily(SfxStyleFamily::Para);
82 else if( IsXMLToken( rValue, XML_TEXT ) )
83 mnFamily = XmlStyleFamily(SfxStyleFamily::Char);
84 break;
85 }
87 maName = rValue;
88 break;
90 maDisplayName = rValue;
91 break;
93 maParentName = rValue;
94 break;
96 maFollow = rValue;
97 break;
99 maLinked = rValue;
100 break;
102 mbHidden = rValue.toBoolean();
103 break;
104 case XML_ELEMENT(LO_EXT, XML_HIDDEN):
105 mbHidden = rValue.toBoolean();
106 break;
107 }
108}
109
110
112 SvXMLImport& rImp,
113 XmlStyleFamily nFam, bool bDefault ) :
114 SvXMLImportContext( rImp ),
115 mbHidden( false ),
116 mnFamily( nFam ),
117 mbValid( true ),
118 mbNew( true ),
119 mbDefaultStyle( bDefault )
120{
121}
122
124{
125}
126
128 sal_Int32 /*nElement*/,
129 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
130{
131 for( auto &it : sax_fastparser::castToFastAttributeList( xAttrList ) )
132 SetAttribute( it.getToken(), it.toString() );
133}
134
136{
137}
138
139void SvXMLStyleContext::CreateAndInsert( bool /*bOverwrite*/ )
140{
141}
142
143void SvXMLStyleContext::CreateAndInsertLate( bool /*bOverwrite*/ )
144{
145}
146
147void SvXMLStyleContext::Finish( bool /*bOverwrite*/ )
148{
149}
150
152{
153 return false;
154}
156namespace {
157
158class SvXMLStyleIndex_Impl
160 OUString sName;
161 XmlStyleFamily nFamily;
162 // we deliberately don't use a reference here, to avoid creating a ref-count-cycle
163 SvXMLStyleContext* mpStyle;
164
165public:
166
167 SvXMLStyleIndex_Impl( XmlStyleFamily nFam, OUString aName ) :
168 sName(std::move( aName )),
169 nFamily( nFam ),
170 mpStyle(nullptr)
171 {
172 }
173
174 SvXMLStyleIndex_Impl( const rtl::Reference<SvXMLStyleContext> &rStl ) :
175 sName( rStl->GetName() ),
176 nFamily( rStl->GetFamily() ),
177 mpStyle ( rStl.get() )
178 {
179 }
180
181 const OUString& GetName() const { return sName; }
182 XmlStyleFamily GetFamily() const { return nFamily; }
183 const SvXMLStyleContext *GetStyle() const { return mpStyle; }
184};
185
186struct SvXMLStyleIndexCmp_Impl
187{
188 bool operator()(const SvXMLStyleIndex_Impl& r1, const SvXMLStyleIndex_Impl& r2) const
189 {
190 sal_Int32 nRet;
191
192 if( r1.GetFamily() < r2.GetFamily() )
193 nRet = -1;
194 else if( r1.GetFamily() > r2.GetFamily() )
195 nRet = 1;
196 else
197 nRet = r1.GetName().compareTo( r2.GetName() );
198
199 return nRet < 0;
200 }
201};
202
203}
204
206{
207 typedef std::set<SvXMLStyleIndex_Impl, SvXMLStyleIndexCmp_Impl> IndicesType;
208
209 std::vector<rtl::Reference<SvXMLStyleContext>> aStyles;
210 mutable std::unique_ptr<IndicesType> pIndices;
212
213#if OSL_DEBUG_LEVEL > 0
214 mutable sal_uInt32 m_nIndexCreated;
215#endif
216
217 void FlushIndex() { pIndices.reset(); }
218
219public:
220 explicit SvXMLStylesContext_Impl( bool bAuto );
221
222 size_t GetStyleCount() const { return aStyles.size(); }
223
225 {
226 return i < aStyles.size() ? aStyles[ i ].get() : nullptr;
227 }
228
229 inline void AddStyle( SvXMLStyleContext *pStyle );
230 void dispose();
231
233 const OUString& rName,
234 bool bCreateIndex ) const;
235 bool IsAutomaticStyle() const { return bAutomaticStyle; }
236};
237
239 bAutomaticStyle( bAuto )
240#if OSL_DEBUG_LEVEL > 0
241 , m_nIndexCreated( 0 )
242#endif
243{}
244
246{
247#if OSL_DEBUG_LEVEL > 0
248// for (auto const & xStyle : aStyles)
249// if (xStyle->GetFamily() == pStyle->GetFamily() && xStyle->GetName() == pStyle->GetName())
250// assert(false && "duplicate style");
251#endif
252 aStyles.emplace_back(pStyle );
253
254 FlushIndex();
255}
256
258{
259 FlushIndex();
260 aStyles.clear();
261}
262
264 const OUString& rName,
265 bool bCreateIndex ) const
266{
267 const SvXMLStyleContext *pStyle = nullptr;
268
269 if( !pIndices && bCreateIndex && !aStyles.empty() )
270 {
271 pIndices = std::make_unique<IndicesType>(aStyles.begin(), aStyles.end());
272 SAL_WARN_IF(pIndices->size() != aStyles.size(), "xmloff.style", "Here is a duplicate Style");
273#if OSL_DEBUG_LEVEL > 0
274 SAL_WARN_IF(0 != m_nIndexCreated, "xmloff.style",
275 "Performance warning: sdbcx::Index created multiple times");
277#endif
278 }
279
280 if( pIndices )
281 {
282 SvXMLStyleIndex_Impl aIndex( nFamily, rName );
283 IndicesType::iterator aFind = pIndices->find(aIndex);
284 if( aFind != pIndices->end() )
285 pStyle = aFind->GetStyle();
286 }
287 else
288 {
289 for( size_t i = 0; !pStyle && i < aStyles.size(); i++ )
290 {
291 const SvXMLStyleContext *pS = aStyles[ i ].get();
292 if( pS->GetFamily() == nFamily &&
293 pS->GetName() == rName )
294 pStyle = pS;
295 }
296 }
297 return pStyle;
298}
299
300
302{
303 return mpImpl->GetStyleCount();
304}
305
307{
308 return mpImpl->GetStyle( i );
309}
310
312{
313 return mpImpl->GetStyle( i );
314}
315
317{
318 return mpImpl->IsAutomaticStyle();
319}
320
322 sal_Int32 nElement,
323 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList)
324{
325 SvXMLStyleContext *pStyle = nullptr;
326
327 if(GetImport().GetDataStylesImport())
328 {
329 pStyle = GetImport().GetDataStylesImport()->CreateChildContext(GetImport(), nElement,
330 xAttrList, *this);
331 if (pStyle)
332 return pStyle;
333 }
334
335 switch (nElement)
336 {
339 {
341 for( auto &aIter : sax_fastparser::castToFastAttributeList( xAttrList ) )
342 {
343 if( aIter.getToken() == XML_ELEMENT(STYLE, XML_FAMILY) )
344 {
345 nFamily = GetFamily( aIter.toString() );
346 break;
347 }
348 }
349 pStyle = XML_ELEMENT(STYLE, XML_STYLE)==nElement
350 ? CreateStyleStyleChildContext( nFamily, nElement, xAttrList )
351 : CreateDefaultStyleStyleChildContext( nFamily, nElement, xAttrList );
352 break;
353 }
356 break;
359 GetImport(), nElement, xAttrList);
360 break;
363 break;
366 {
367 //there is not page family in ODF now, so I specify one for it
368 bool bDefaultStyle = XML_ELEMENT(STYLE, XML_DEFAULT_PAGE_LAYOUT) == nElement;
369 pStyle = new PageStyleContext( GetImport(), *this, bDefaultStyle );
370 }
371 break;
373 pStyle = new SvxXMLListStyleContext( GetImport() );
374 break;
376 pStyle = new SvxXMLListStyleContext( GetImport(), true );
377 break;
378
379 // FillStyles
380
382 {
383 pStyle = new XMLGradientStyleContext( GetImport(), nElement, xAttrList );
384 break;
385 }
387 {
388 pStyle = new XMLHatchStyleContext( GetImport(), nElement, xAttrList );
389 break;
390 }
392 {
393 pStyle = new XMLBitmapStyleContext( GetImport(), nElement, xAttrList );
394 break;
395 }
397 {
398 pStyle = new XMLTransGradientStyleContext( GetImport(), nElement, xAttrList );
399 break;
400 }
402 {
403 pStyle = new XMLMarkerStyleContext( GetImport(), nElement, xAttrList );
404 break;
405 }
407 {
408 pStyle = new XMLDashStyleContext( GetImport(), nElement, xAttrList );
409 break;
410 }
411 }
412
413 if (!pStyle)
414 SAL_WARN("xmloff", "Unknown element " << SvXMLImport::getPrefixAndNameFromToken(nElement));
415
416 return pStyle;
417}
418
420 XmlStyleFamily nFamily, sal_Int32 /*nElement*/,
421 const uno::Reference< xml::sax::XFastAttributeList > & /*xAttrList*/ )
422{
423 SvXMLStyleContext *pStyle = nullptr;
424
425 switch( nFamily )
426 {
430 pStyle = new XMLTextStyleContext( GetImport(), *this, nFamily );
431 break;
432
434 pStyle = new XMLPropStyleContext( GetImport(), *this, nFamily );
435 break;
436#if !ENABLE_WASM_STRIP_CHART
437 // WASM_CHART change
439 pStyle = new XMLChartStyleContext( GetImport(), *this, nFamily );
440 break;
441#endif
445 pStyle = new XMLShapeStyleContext( GetImport(), *this, nFamily );
446 break;
447 default: break;
448 }
449
450 return pStyle;
451}
452
454 XmlStyleFamily /*nFamily*/, sal_Int32 /*nElement*/,
455 const uno::Reference< xml::sax::XFastAttributeList > & )
456{
457 return nullptr;
458}
459
461{
462 return true;
463}
464
466{
468 if( IsXMLToken( rValue, XML_PARAGRAPH ) )
469 {
471 }
472 else if( IsXMLToken( rValue, XML_TEXT ) )
473 {
475 }
476 else if( IsXMLToken( rValue, XML_DATA_STYLE ) )
477 {
479 }
480 else if ( IsXMLToken( rValue, XML_SECTION ) )
481 {
483 }
484 else if( IsXMLToken( rValue, XML_TABLE ) )
485 {
487 }
488 else if( IsXMLToken( rValue, XML_TABLE_COLUMN ) )
490 else if( IsXMLToken( rValue, XML_TABLE_ROW ) )
492 else if( IsXMLToken( rValue, XML_TABLE_CELL ) )
494 else if ( rValue == XML_STYLE_FAMILY_SD_GRAPHICS_NAME )
495 {
497 }
498 else if ( rValue == XML_STYLE_FAMILY_SD_PRESENTATION_NAME )
499 {
501 }
502 else if ( rValue == XML_STYLE_FAMILY_SD_POOL_NAME )
503 {
505 }
506 else if ( rValue == XML_STYLE_FAMILY_SD_DRAWINGPAGE_NAME )
507 {
509 }
510 else if ( rValue == XML_STYLE_FAMILY_SCH_CHART_NAME )
511 {
513 }
514 else if ( IsXMLToken( rValue, XML_RUBY ) )
515 {
517 }
518
519 return nFamily;
520}
521
523 XmlStyleFamily nFamily ) const
524{
526
527 switch( nFamily )
528 {
530 if( !mxParaImpPropMapper.is() )
531 {
532 SvXMLStylesContext * pThis = const_cast<SvXMLStylesContext *>(this);
533 pThis->mxParaImpPropMapper =
534 pThis->GetImport().GetTextImport()
535 ->GetParaImportPropertySetMapper();
536 }
537 xMapper = mxParaImpPropMapper;
538 break;
540 if( !mxTextImpPropMapper.is() )
541 {
542 SvXMLStylesContext * pThis = const_cast<SvXMLStylesContext *>(this);
543 pThis->mxTextImpPropMapper =
544 pThis->GetImport().GetTextImport()
545 ->GetTextImportPropertySetMapper();
546 }
547 xMapper = mxTextImpPropMapper;
548 break;
549
551 // don't cache section mapper, as it's rarely used
552 // *sigh*, cast to non-const, because this is a const method,
553 // but SvXMLImport::GetTextImport() isn't.
554 xMapper = const_cast<SvXMLStylesContext*>(this)->GetImport().GetTextImport()->
555 GetSectionImportPropertySetMapper();
556 break;
557
559 // don't cache section mapper, as it's rarely used
560 // *sigh*, cast to non-const, because this is a const method,
561 // but SvXMLImport::GetTextImport() isn't.
562 xMapper = const_cast<SvXMLStylesContext*>(this)->GetImport().GetTextImport()->
563 GetRubyImportPropertySetMapper();
564 break;
565
569 if(!mxShapeImpPropMapper.is())
570 {
571 rtl::Reference< XMLShapeImportHelper > aImpHelper = const_cast<SvXMLImport&>(GetImport()).GetShapeImport();
572 const_cast<SvXMLStylesContext*>(this)->mxShapeImpPropMapper =
573 aImpHelper->GetPropertySetMapper();
574 }
575 xMapper = mxShapeImpPropMapper;
576 break;
577#if !ENABLE_WASM_STRIP_CHART
578 // WASM_CHART change
580 if( ! mxChartImpPropMapper.is() )
581 {
582 XMLPropertySetMapper *const pPropMapper = new XMLChartPropertySetMapper(nullptr);
584 }
585 xMapper = mxChartImpPropMapper;
586 break;
587#endif
589 if( ! mxPageImpPropMapper.is() )
590 {
591 XMLPropertySetMapper *pPropMapper =
594 new PageMasterImportPropertyMapper( pPropMapper,
595 const_cast<SvXMLStylesContext*>(this)->GetImport() );
596 }
597 xMapper = mxPageImpPropMapper;
598 break;
599 default: break;
600 }
601
602 return xMapper;
603}
604
605Reference < XAutoStyleFamily > SvXMLStylesContext::GetAutoStyles( XmlStyleFamily nFamily ) const
606{
607 Reference < XAutoStyleFamily > xAutoStyles;
609 {
610 bool bPara = XmlStyleFamily::TEXT_PARAGRAPH == nFamily;
611 const Reference<XAutoStyleFamily>& rxAutoStyles = bPara ? mxParaAutoStyles : mxTextAutoStyles;
612 if (!rxAutoStyles)
613 {
614 OUString sName(bPara ? gsParagraphStyles : gsCharacterStyles);
615 Reference< XAutoStylesSupplier > xAutoStylesSupp( GetImport().GetModel(), UNO_QUERY );
616 Reference< XAutoStyles > xAutoStyleFamilies = xAutoStylesSupp->getAutoStyles();
617 if (xAutoStyleFamilies->hasByName(sName))
618 {
619 Any aAny = xAutoStyleFamilies->getByName( sName );
620 aAny >>= const_cast<Reference<XAutoStyleFamily>&>(rxAutoStyles);
621 }
622 }
623 xAutoStyles = rxAutoStyles;
624 }
625 return xAutoStyles;
626}
627
628Reference < XNameContainer > SvXMLStylesContext::GetStylesContainer(
629 XmlStyleFamily nFamily ) const
630{
631 Reference < XNameContainer > xStyles;
633 {
634 bool bPara = XmlStyleFamily::TEXT_PARAGRAPH == nFamily;
635 const Reference<XNameContainer>& rxStyles = bPara ? mxParaStyles : mxTextStyles;
636 if (!rxStyles)
637 {
638 OUString sName(bPara ? gsParagraphStyles : gsCharacterStyles);
639 Reference<XStyleFamiliesSupplier> xFamiliesSupp(GetImport().GetModel(), UNO_QUERY);
640 if (xFamiliesSupp.is())
641 {
642 Reference<XNameAccess> xFamilies = xFamiliesSupp->getStyleFamilies();
643 if (xFamilies->hasByName(sName))
644 {
645 Any aAny = xFamilies->getByName(sName);
646 aAny >>= const_cast<Reference<XNameContainer>&>(rxStyles);
647 }
648 }
649 }
650 xStyles = rxStyles;
651 }
652
653 return xStyles;
654}
655
657{
658 OUString sServiceName;
659 switch( nFamily )
660 {
663 break;
666 break;
667 default: break;
668 }
669
670 return sServiceName;
671}
672
673SvXMLStylesContext::SvXMLStylesContext( SvXMLImport& rImport, bool bAuto ) :
674 SvXMLImportContext( rImport ),
675 mpImpl( new SvXMLStylesContext_Impl( bAuto ) )
676{
677}
678
680{
681}
682
683css::uno::Reference< css::xml::sax::XFastContextHandler > SvXMLStylesContext::createFastChildContext(
684 sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
685{
686 SvXMLStyleContext* pStyle = CreateStyleChildContext( nElement, xAttrList );
687 if (pStyle)
688 {
689 if (!pStyle->IsTransient())
690 mpImpl->AddStyle(pStyle);
691 return pStyle;
692 }
693 else if (nElement == XML_ELEMENT(LO_EXT, XML_THEME))
694 {
695 uno::Reference<drawing::XDrawPageSupplier> const xDrawPageSupplier(GetImport().GetModel(), uno::UNO_QUERY);
696 if (xDrawPageSupplier.is())
697 {
698 uno::Reference<drawing::XDrawPage> xPage = xDrawPageSupplier->getDrawPage();
699 if (xPage.is())
700 return new XMLThemeContext(GetImport(), xAttrList, xPage);
701 }
702 }
703
704 return nullptr;
705}
706
708{
709 mpImpl->AddStyle( &rNew );
710}
711
713{
714 mpImpl->dispose();
715}
716
718{
719 sal_uInt32 nCount = GetStyleCount();
720 sal_uInt32 i;
721 for( i = 0; i < nCount; i++ )
722 {
723 SvXMLStyleContext *pStyle = GetStyle( i );
724 if( !pStyle || ( pStyle->GetFamily() != XmlStyleFamily::TEXT_TEXT &&
727 continue;
728 pStyle->CreateAndInsert( false );
729 }
730}
731
733 bool bFinish )
734{
735 // pass 1: create text, paragraph and frame styles
736 sal_uInt32 nCount = GetStyleCount();
737 sal_uInt32 i;
738
739 for( i = 0; i < nCount; i++ )
740 {
741 SvXMLStyleContext *pStyle = GetStyle( i );
742 if( !pStyle )
743 continue;
744
745 if (pStyle->IsDefaultStyle())
746 {
747 if (bOverwrite) pStyle->SetDefaults();
748 }
749 else if( InsertStyleFamily( pStyle->GetFamily() ) )
750 pStyle->CreateAndInsert( bOverwrite );
751 }
752
753 // pass 2: create list styles (they require char styles)
754 for( i=0; i<nCount; i++ )
755 {
756 SvXMLStyleContext *pStyle = GetStyle( i );
757 if( !pStyle || pStyle->IsDefaultStyle())
758 continue;
759
760 if( InsertStyleFamily( pStyle->GetFamily() ) )
761 pStyle->CreateAndInsertLate( bOverwrite );
762 }
763
764 // pass3: finish creation of styles
765 if( bFinish )
766 FinishStyles( bOverwrite );
767}
768
769void SvXMLStylesContext::FinishStyles( bool bOverwrite )
770{
771 sal_uInt32 nCount = GetStyleCount();
772 for( sal_uInt32 i=0; i<nCount; i++ )
773 {
774 SvXMLStyleContext *pStyle = GetStyle( i );
775 if( !pStyle || !pStyle->IsValid() || pStyle->IsDefaultStyle() )
776 continue;
777
778 if( InsertStyleFamily( pStyle->GetFamily() ) )
779 pStyle->Finish( bOverwrite );
780 }
781}
782
784 XmlStyleFamily nFamily,
785 const OUString& rName,
786 bool bCreateIndex ) const
787{
788 return mpImpl->FindStyleChildContext( nFamily, rName, bCreateIndex );
789}
790
791/* 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:73
OUString maName
Definition: xmlstyle.hxx:42
OUString maFollow
Definition: xmlstyle.hxx:46
virtual void Finish(bool bOverwrite)
Definition: xmlstyle.cxx:147
virtual void CreateAndInsert(bool bOverwrite)
Definition: xmlstyle.cxx:139
virtual void CreateAndInsertLate(bool bOverwrite)
Definition: xmlstyle.cxx:143
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:151
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:127
bool IsDefaultStyle() const
Definition: xmlstyle.hxx:110
virtual void SetDefaults()
Definition: xmlstyle.cxx:135
SvXMLStyleContext(SvXMLImport &rImport, XmlStyleFamily nFamily=XmlStyleFamily::DATA_STYLE, bool bDefaultStyle=false)
Definition: xmlstyle.cxx:111
bool IsValid() const
Definition: xmlstyle.hxx:87
OUString maDisplayName
Definition: xmlstyle.hxx:43
virtual ~SvXMLStyleContext() override
Definition: xmlstyle.cxx:123
std::vector< rtl::Reference< SvXMLStyleContext > > aStyles
Definition: xmlstyle.cxx:209
SvXMLStylesContext_Impl(bool bAuto)
Definition: xmlstyle.cxx:238
bool IsAutomaticStyle() const
Definition: xmlstyle.cxx:235
const SvXMLStyleContext * FindStyleChildContext(XmlStyleFamily nFamily, const OUString &rName, bool bCreateIndex) const
Definition: xmlstyle.cxx:263
SvXMLStyleContext * GetStyle(size_t i)
Definition: xmlstyle.cxx:224
sal_uInt32 m_nIndexCreated
Definition: xmlstyle.cxx:214
std::set< SvXMLStyleIndex_Impl, SvXMLStyleIndexCmp_Impl > IndicesType
Definition: xmlstyle.cxx:207
void AddStyle(SvXMLStyleContext *pStyle)
Definition: xmlstyle.cxx:245
std::unique_ptr< IndicesType > pIndices
Definition: xmlstyle.cxx:210
size_t GetStyleCount() const
Definition: xmlstyle.cxx:222
static XmlStyleFamily GetFamily(std::u16string_view rFamily)
Definition: xmlstyle.cxx:465
sal_uInt32 GetStyleCount() const
Definition: xmlstyle.cxx:301
const SvXMLStyleContext * FindStyleChildContext(XmlStyleFamily nFamily, const OUString &rName, bool bCreateIndex=false) const
Definition: xmlstyle.cxx:783
virtual css::uno::Reference< css::container::XNameContainer > GetStylesContainer(XmlStyleFamily nFamily) const
Definition: xmlstyle.cxx:628
virtual SvXMLStyleContext * CreateDefaultStyleStyleChildContext(XmlStyleFamily nFamily, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
Definition: xmlstyle.cxx:453
std::unique_ptr< SvXMLStylesContext_Impl > mpImpl
Definition: xmlstyle.hxx:125
virtual ~SvXMLStylesContext() override
Definition: xmlstyle.cxx:679
virtual bool InsertStyleFamily(XmlStyleFamily nFamily) const
Definition: xmlstyle.cxx:460
SvXMLStyleContext * GetStyle(sal_uInt32 i)
Definition: xmlstyle.cxx:306
void CopyStylesToDoc(bool bOverwrite, bool bFinish=true)
Definition: xmlstyle.cxx:732
css::uno::Reference< css::container::XNameContainer > mxTextStyles
Definition: xmlstyle.hxx:130
virtual rtl::Reference< SvXMLImportPropertyMapper > GetImportPropertyMapper(XmlStyleFamily nFamily) const
Definition: xmlstyle.cxx:522
virtual SvXMLStyleContext * CreateStyleChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
Definition: xmlstyle.cxx:321
virtual SvXMLStyleContext * CreateStyleStyleChildContext(XmlStyleFamily nFamily, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
Definition: xmlstyle.cxx:419
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:769
bool IsAutomaticStyle() const
Definition: xmlstyle.cxx:316
css::uno::Reference< css::style::XAutoStyleFamily > mxParaAutoStyles
Definition: xmlstyle.hxx:132
virtual OUString GetServiceName(XmlStyleFamily nFamily) const
Definition: xmlstyle.cxx:656
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:683
void CopyAutoStylesToDoc()
Definition: xmlstyle.cxx:717
css::uno::Reference< css::container::XNameContainer > mxParaStyles
Definition: xmlstyle.hxx:128
css::uno::Reference< css::style::XAutoStyleFamily > GetAutoStyles(XmlStyleFamily nFamily) const
Definition: xmlstyle.cxx:605
void AddStyle(SvXMLStyleContext &rNew)
Definition: xmlstyle.cxx:707
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
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 sName
OUString aName
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
if(aStr !=aBuf) UpdateName_Impl(m_xFollowLb.get()
int i
FastAttributeList & castToFastAttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
Handling of tokens in XML:
@ XML_BIBLIOGRAPHY_CONFIGURATION
Definition: xmltoken.hxx:328
@ XML_DEFAULT_PAGE_LAYOUT
Definition: xmltoken.hxx:2305
@ XML_LINENUMBERING_CONFIGURATION
Definition: xmltoken.hxx:1207
@ XML_NOTES_CONFIGURATION
Definition: xmltoken.hxx:2624
bool IsXMLToken(std::u16string_view rString, enum XMLTokenEnum eToken)
compare eToken to the string
Definition: xmltoken.cxx:3597
bool mbValid
TEXT
#define XML_ELEMENT(prefix, name)
Definition: xmlimp.hxx:97
constexpr OUStringLiteral gsParagraphStyles(u"ParagraphStyles")
constexpr OUStringLiteral gsParaStyleServiceName(u"com.sun.star.style.ParagraphStyle")
constexpr OUStringLiteral gsCharacterStyles(u"CharacterStyles")
constexpr OUStringLiteral gsTextStyleServiceName(u"com.sun.star.style.CharacterStyle")