LibreOffice Module xmloff (master) 1
txtstyli.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
24#include <xmloff/families.hxx>
25#include <xmloff/txtprmap.hxx>
26#include <xmloff/txtstyli.hxx>
27#include <xmloff/xmlimp.hxx>
28#include <xmloff/xmltoken.hxx>
29#include <xmloff/xmluconv.hxx>
30#include <xmloff/maptype.hxx>
31#include <xmloff/xmlimppr.hxx>
32#include <xmloff/xmlement.hxx>
33
34#include <com/sun/star/beans/XPropertySet.hpp>
35#include <com/sun/star/container/XNameContainer.hpp>
36#include <com/sun/star/document/XEventsSupplier.hpp>
37#include <com/sun/star/drawing/FillStyle.hpp>
38#include <com/sun/star/frame/XModel.hpp>
39#include <com/sun/star/lang/XMultiServiceFactory.hpp>
40#include <com/sun/star/style/ParagraphStyleCategory.hpp>
41#include <com/sun/star/style/XStyle.hpp>
42
43#include <o3tl/any.hxx>
44
46
47#include <tools/debug.hxx>
49#include <sal/log.hxx>
50
51#include <vector>
52
53#include <xmlsdtypes.hxx>
54#include <xmloff/xmlerror.hxx>
55
56
57using namespace ::com::sun::star;
58using namespace ::com::sun::star::uno;
59using namespace ::com::sun::star::xml::sax;
60using namespace ::com::sun::star::style;
61using namespace ::com::sun::star::beans;
62using namespace ::com::sun::star::lang;
63using namespace ::com::sun::star::container;
64using namespace ::xmloff::token;
65
67{
68 { XML_TEXT, ParagraphStyleCategory::TEXT },
69 { XML_CHAPTER, ParagraphStyleCategory::CHAPTER },
70 { XML_LIST, ParagraphStyleCategory::LIST },
71 { XML_INDEX, ParagraphStyleCategory::INDEX },
72 { XML_EXTRA, ParagraphStyleCategory::EXTRA },
73 { XML_HTML, ParagraphStyleCategory::HTML },
75};
76
77void XMLTextStyleContext::SetAttribute( sal_Int32 nElement,
78 const OUString& rValue )
79{
80 switch (nElement)
81 {
83 {
84 if( IsXMLToken( rValue, XML_TRUE ) )
85 m_isAutoUpdate = true;
86 break;
87 }
89 {
90 m_sListStyleName = rValue;
91 // Inherited paragraph style lost information about unset numbering (#i69523#)
92 m_bListStyleSet = true;
93 break;
94 }
96 {
97 m_sMasterPageName = rValue;
99 break;
100 }
102 m_sDataStyleName = rValue;
103 break;
105 m_sCategoryVal = rValue;
106 break;
108 {
109 sal_Int32 nTmp;
110 if (::sax::Converter::convertNumber( nTmp, rValue ) &&
111 0 <= nTmp && nTmp <= 10 )
112 {
113 m_nOutlineLevel = static_cast<sal_Int8>(nTmp);
114 }
115 break;
116 }
118 {
119 sal_Int32 nTmp;
120 // The spec is positiveInteger (1-based), but the implementation is 0-based.
121 if (sax::Converter::convertNumber(nTmp, rValue) && nTmp > 0 && nTmp <= 10)
122 {
123 m_aListLevel.emplace(--nTmp);
124 }
125 break;
126 }
127 default:
128 XMLPropStyleContext::SetAttribute( nElement, rValue );
129 }
130}
131
133 SvXMLStylesContext& rStyles, XmlStyleFamily nFamily,
134 bool bDefaultStyle )
135: XMLPropStyleContext( rImport, rStyles, nFamily, bDefaultStyle )
136, m_nOutlineLevel( -1 )
137, m_isAutoUpdate( false )
138, m_bHasMasterPageName( false )
139, m_bHasCombinedCharactersLetter( false )
140// Inherited paragraph style lost information about unset numbering (#i69523#)
141, m_bListStyleSet( false )
142{
143}
144
146{}
147
148css::uno::Reference< css::xml::sax::XFastContextHandler > XMLTextStyleContext::createFastChildContext(
149 sal_Int32 nElement,
150 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
151{
153 {
154 sal_Int32 nLocalName = nElement & TOKEN_MASK;
155 sal_uInt32 nFamily = 0;
156 if( nLocalName == XML_TEXT_PROPERTIES )
157 nFamily = XML_TYPE_PROP_TEXT;
158 else if( nLocalName == XML_PARAGRAPH_PROPERTIES )
159 nFamily = XML_TYPE_PROP_PARAGRAPH;
160 else if( nLocalName == XML_SECTION_PROPERTIES )
161 nFamily = XML_TYPE_PROP_SECTION;
162 else if( IsDefaultStyle() && nLocalName == XML_TABLE_PROPERTIES )
163 nFamily = XML_TYPE_PROP_TABLE;
164 else if( IsDefaultStyle() && nLocalName == XML_TABLE_ROW_PROPERTIES )
165 nFamily = XML_TYPE_PROP_TABLE_ROW;
166 if( nFamily )
167 {
170 if( xImpPrMap.is() )
171 return new XMLTextPropertySetContext( GetImport(), nElement, xAttrList,
172 nFamily,
174 xImpPrMap,
176 }
177 }
178 else if ( nElement == XML_ELEMENT(OFFICE, XML_EVENT_LISTENERS) )
179 {
180 // create and remember events import context
181 // (for delayed processing of events)
183 return m_xEventContext;
184 }
185
186 return XMLPropStyleContext::createFastChildContext( nElement, xAttrList );
187}
188
190{
192 Reference < XStyle > xStyle = GetStyle();
193 if( !xStyle.is() || !(bOverwrite || IsNew()) )
194 return;
195
196 Reference < XPropertySet > xPropSet( xStyle, UNO_QUERY );
197 Reference< XPropertySetInfo > xPropSetInfo =
198 xPropSet->getPropertySetInfo();
199
200 static constexpr OUStringLiteral sIsAutoUpdate(u"IsAutoUpdate");
201 if( xPropSetInfo->hasPropertyByName( sIsAutoUpdate ) )
202 {
203 xPropSet->setPropertyValue( sIsAutoUpdate, Any(m_isAutoUpdate) );
204 }
205
206 sal_uInt16 nCategory = ParagraphStyleCategory::TEXT;
208 !m_sCategoryVal.isEmpty() && xStyle->isUserDefined() &&
209 xPropSetInfo->hasPropertyByName("Category") &&
211 {
212 xPropSet->setPropertyValue("Category", Any(static_cast<sal_Int16>(nCategory)));
213 }
214
215 // tell the style about it's events (if applicable)
216 if (m_xEventContext.is())
217 {
218 // pass events into event supplier
219 Reference<document::XEventsSupplier> xEventsSupplier(xStyle,UNO_QUERY);
220 m_xEventContext->SetEvents(xEventsSupplier);
221 m_xEventContext.clear();
222 }
223
224 // XML import: reconstruction of assignment of paragraph style to outline levels (#i69629#)
225 if (m_nOutlineLevel > 0)
226 {
227 GetImport().GetTextImport()->AddOutlineStyleCandidate(m_nOutlineLevel,
228 GetDisplayName() );
229 }
230}
231
233{
237 {
238 Reference < XMultiServiceFactory > xFactory ( GetImport().GetModel(), UNO_QUERY);
239 if (xFactory.is())
240 {
241 Reference < XInterface > xInt = xFactory->createInstance( "com.sun.star.text.Defaults" );
242 Reference < XPropertySet > xProperties ( xInt, UNO_QUERY );
243 if ( xProperties.is() )
244 FillPropertySet ( xProperties );
245 }
246 }
247}
248
249void XMLTextStyleContext::Finish( bool bOverwrite )
250{
251 XMLPropStyleContext::Finish( bOverwrite );
252
253 Reference < XStyle > xStyle = GetStyle();
254 // Consider set empty list style (#i69523#)
255 if ( !( m_bListStyleSet ||
256 m_nOutlineLevel >= 0 ||
257 !m_sDropCapTextStyleName.isEmpty() ||
259 !xStyle.is() ||
260 !( bOverwrite || IsNew() ) )
261 return;
262
263 Reference < XPropertySet > xPropSet( xStyle, UNO_QUERY );
264 Reference< XPropertySetInfo > xPropSetInfo =
265 xPropSet->getPropertySetInfo();
266
267 static constexpr OUStringLiteral sOutlineLevel(u"OutlineLevel");
268 if( xPropSetInfo->hasPropertyByName( sOutlineLevel ))
269 {
270 if (m_nOutlineLevel >= 0)
271 {
272 xPropSet->setPropertyValue( sOutlineLevel, Any(m_nOutlineLevel) );
273 }
274 }
275
276 // Consider set empty list style (#i69523#)
277 static constexpr OUStringLiteral sNumberingStyleName(u"NumberingStyleName");
278 if (m_bListStyleSet &&
279 xPropSetInfo->hasPropertyByName( sNumberingStyleName ) )
280 {
281 /* Only for text document from version prior OOo 2.1 resp. SO 8 PU5:
282 - Do not apply list style, if paragraph style has a default outline
283 level > 0 and thus, will be assigned to the corresponding list
284 level of the outline style. (#i70223#)
285 */
286 bool bApplyListStyle( true );
287 if (m_nOutlineLevel > 0)
288 {
289 if ( GetImport().IsTextDocInOOoFileFormat() )
290 {
291 bApplyListStyle = false;
292 }
293 else
294 {
295 sal_Int32 nUPD( 0 );
296 sal_Int32 nBuild( 0 );
297 // Check explicitly on certain versions (#i86058#)
298 if ( GetImport().getBuildIds( nUPD, nBuild ) &&
299 ( ( nUPD == 641 ) || ( nUPD == 645 ) || // prior OOo 2.0
300 ( nUPD == 680 && nBuild <= 9073 ) ) ) // OOo 2.0 - OOo 2.0.4
301 {
302 bApplyListStyle = false;
303 }
304 }
305 }
306
307 if ( bApplyListStyle )
308 {
309 if (m_sListStyleName.isEmpty())
310 {
311 xPropSet->setPropertyValue(sNumberingStyleName, Any(m_sListStyleName)); /* empty string */
312 }
313 else
314 {
315 // change list style name to display name
316 OUString sDisplayListStyleName(
317 GetImport().GetStyleDisplayName(XmlStyleFamily::TEXT_LIST,
319 // The families container must exist
320 const Reference < XNameContainer >& rNumStyles =
321 GetImport().GetTextImport()->GetNumberingStyles();
322 // if( rNumStyles.is() && rNumStyles->hasByName( sDisplayListStyleName ) &&
323 // xPropSetInfo->hasPropertyByName( sNumberingStyleName ) )
324 if ( rNumStyles.is() &&
325 rNumStyles->hasByName( sDisplayListStyleName ) )
326 {
327 xPropSet->setPropertyValue( sNumberingStyleName, Any(sDisplayListStyleName) );
328 }
329 }
330
331 if (m_aListLevel.has_value())
332 {
333 xPropSet->setPropertyValue("NumberingLevel", uno::Any(*m_aListLevel));
334 }
335 }
336 }
337
338 if (!m_sDropCapTextStyleName.isEmpty())
339 {
340 // change list style name to display name
341 OUString sDisplayDropCapTextStyleName(
342 GetImport().GetStyleDisplayName( XmlStyleFamily::TEXT_TEXT,
344 // The families container must exist
345 const Reference < XNameContainer >& rTextStyles =
346 GetImport().GetTextImport()->GetTextStyles();
347 if( rTextStyles.is() &&
348 rTextStyles->hasByName( sDisplayDropCapTextStyleName ) &&
349 xPropSetInfo->hasPropertyByName("DropCapCharStyleName"))
350 {
351 xPropSet->setPropertyValue("DropCapCharStyleName", Any(sDisplayDropCapTextStyleName));
352 }
353 }
354
356 return;
357
358 OUString sDisplayName(
359 GetImport().GetStyleDisplayName(
361 // The families container must exist
362 const Reference < XNameContainer >& rPageStyles =
363 GetImport().GetTextImport()->GetPageStyles();
364
365 static constexpr OUStringLiteral sPageDescName(u"PageDescName");
366 if( ( sDisplayName.isEmpty() ||
367 (rPageStyles.is() &&
368 rPageStyles->hasByName( sDisplayName )) ) &&
369 xPropSetInfo->hasPropertyByName( sPageDescName ) )
370 {
371 xPropSet->setPropertyValue( sPageDescName, Any(sDisplayName) );
372 }
373}
374
376 const Reference<XPropertySet > & rPropSet )
377{
378 // imitate the FillPropertySet of the super class, so we get a chance to
379 // catch the combined characters attribute
380
381 // imitate XMLPropStyleContext::FillPropertySet(...)
382 SvXMLStylesContext* pSvXMLStylesContext = GetStyles();
384 DBG_ASSERT(xImpPrMap.is(),"Where is the import prop mapper?");
385
386 if(!xImpPrMap.is())
387 return;
388
389 // imitate SvXMLImportPropertyMapper::FillPropertySet(...)
390 // The reason for this is that we have no other way to
391 // efficiently intercept the value of combined characters. To
392 // get that value, we could iterate through the map once more,
393 // but instead we chose to insert the code into this
394 // iteration. I haven't been able to come up with a much more
395 // intelligent solution.
396 struct ContextID_Index_Pair aContextIDs[] =
397 {
398 { CTF_COMBINED_CHARACTERS_FIELD, -1, drawing::FillStyle::FillStyle_MAKE_FIXED_SIZE },
399 { CTF_KEEP_TOGETHER, -1, drawing::FillStyle::FillStyle_MAKE_FIXED_SIZE },
400 { CTF_BORDER_MODEL, -1, drawing::FillStyle::FillStyle_MAKE_FIXED_SIZE },
401 { CTF_TEXT_DISPLAY, -1, drawing::FillStyle::FillStyle_MAKE_FIXED_SIZE },
402 { CTF_FONTFAMILYNAME, -1, drawing::FillStyle::FillStyle_MAKE_FIXED_SIZE },
403 { CTF_FONTFAMILYNAME_CJK, -1, drawing::FillStyle::FillStyle_MAKE_FIXED_SIZE },
404 { CTF_FONTFAMILYNAME_CTL, -1, drawing::FillStyle::FillStyle_MAKE_FIXED_SIZE },
405
406 //UUU need special handling for DrawingLayer FillStyle names
407 { CTF_FILLGRADIENTNAME, -1, drawing::FillStyle::FillStyle_GRADIENT },
408 { CTF_FILLTRANSNAME, -1, drawing::FillStyle::FillStyle_MAKE_FIXED_SIZE },
409 { CTF_FILLHATCHNAME, -1, drawing::FillStyle::FillStyle_HATCH },
410 { CTF_FILLBITMAPNAME, -1, drawing::FillStyle::FillStyle_BITMAP },
411
412 { -1, -1, drawing::FillStyle::FillStyle_MAKE_FIXED_SIZE }
413 };
414
415 // the style families associated with the same index modulo 4
416 static const XmlStyleFamily aFamilies[] =
417 {
422 };
423
424 // get property set info
425 Reference< XPropertySetInfo > xInfo;
427 bool bAutomatic = false;
428
429 if(pSvXMLStylesContext->IsAutomaticStyle() &&
431 {
432 bAutomatic = true;
433
434 if( GetAutoName().hasValue() )
435 {
436 OUString sAutoProp = ( GetFamily() == XmlStyleFamily::TEXT_TEXT ) ?
437 OUString( "CharAutoStyleName" ):
438 OUString( "ParaAutoStyleName" );
439
440 try
441 {
442 if(!xInfo.is())
443 {
444 xInfo = rPropSet->getPropertySetInfo();
445 }
446
447 if ( xInfo->hasPropertyByName( sAutoProp ) )
448 {
449 rPropSet->setPropertyValue( sAutoProp, GetAutoName() );
450 }
451 else
452 {
453 bAutomatic = false;
454 }
455 }
456 catch( const RuntimeException& ) { throw; }
457 catch( const Exception& )
458 {
459 DBG_UNHANDLED_EXCEPTION("xmloff.text");
460 bAutomatic = false;
461 }
462 }
463 }
464
465 if( bAutomatic )
466 {
467 xImpPrMap->CheckSpecialContext( GetProperties(), rPropSet, aContextIDs );
468 }
469 else
470 {
471 xImpPrMap->FillPropertySet( GetProperties(), rPropSet, aContextIDs );
472 }
473
474 sal_Int32 nIndex = aContextIDs[0].nIndex;
475
476 // have we found a combined characters
477 if ( nIndex != -1 )
478 {
479 Any& rAny = GetProperties()[nIndex].maValue;
480 bool bVal = *o3tl::doAccess<bool>(rAny);
482 }
483
484 // keep-together: the application default is different from
485 // the file format default. Hence, if we always set this
486 // value; if we didn't find one, we'll set to false, the file
487 // format default.
488 // border-model: same
490 {
491 OUString sIsSplitAllowed("IsSplitAllowed");
492 SAL_WARN_IF( !rPropSet->getPropertySetInfo()->hasPropertyByName( sIsSplitAllowed ), "xmloff", "property missing?" );
493 rPropSet->setPropertyValue(
494 sIsSplitAllowed,
495 (aContextIDs[1].nIndex == -1) ? Any( false ) : GetProperties()[aContextIDs[1].nIndex].maValue );
496 }
497
499 {
500 OUString sCollapsingBorders("CollapsingBorders");
501 SAL_WARN_IF( !rPropSet->getPropertySetInfo()->hasPropertyByName( sCollapsingBorders ), "xmloff", "property missing?" );
502 rPropSet->setPropertyValue(
503 sCollapsingBorders,
504 (aContextIDs[2].nIndex == -1)
505 ? Any( false )
506 : GetProperties()[aContextIDs[2].nIndex].maValue );
507 }
508
509
510 // iterate over aContextIDs entries, start with 3, prev ones are already used above
511 for(sal_uInt16 i(3); aContextIDs[i].nContextID != -1; i++)
512 {
513 nIndex = aContextIDs[i].nIndex;
514
515 if ( nIndex != -1 )
516 {
517 // Found!
518 struct XMLPropertyState& rState = GetProperties()[nIndex];
519
520 switch(aContextIDs[i].nContextID)
521 {
526 {
527 // DrawingLayer FillStyle name needs to be mapped to DisplayName
528 OUString sStyleName;
529 rState.maValue >>= sStyleName;
530
531 // translate the used name from ODF intern to the name used in the Model
532 sStyleName = GetImport().GetStyleDisplayName(aFamilies[i - 7], sStyleName);
533
534 if(bAutomatic)
535 {
536 // in this case the rPropSet got not really filled since above the call to
537 // CheckSpecialContext was used and not FillPropertySet, thus the below call to
538 // setPropertyValue can fail/will not be useful (e.g. when the rPropSet
539 // is a SwXTextCursor).
540 // This happens for AutoStyles which are already filled in XMLPropStyleContext::CreateAndInsert,
541 // thus the whole mechanism based on _ContextID_Index_Pair will not work
542 // in that case. Thus the slots which need to be converted already get
543 // converted there (it's called first) and not here (see
544 // translateNameBasedDrawingLayerFillStyleDefinitionsToStyleDisplayNames)
545 // For convenience, still Write back the corrected value to the XMLPropertyState entry
546 rState.maValue <<= sStyleName;
547 break;
548 }
549
550 if (::xmloff::IsIgnoreFillStyleNamedItem(rPropSet, aContextIDs[i].nExpectedFillStyle))
551 {
552 SAL_INFO("xmloff.style", "XMLTextStyleContext: dropping fill named item: " << sStyleName);
553 break; // ignore it, it's not used
554 }
555
556 // Still needed if it's not an AutomaticStyle (!)
557 try
558 {
559 if(!rPropMapper.is())
560 {
561 rPropMapper = xImpPrMap->getPropertySetMapper();
562 }
563
564 // set property
565 const OUString& rPropertyName = rPropMapper->GetEntryAPIName(rState.mnIndex);
566
567 if(!xInfo.is())
568 {
569 xInfo = rPropSet->getPropertySetInfo();
570 }
571
572 if(xInfo->hasPropertyByName(rPropertyName))
573 {
574 rPropSet->setPropertyValue(rPropertyName,Any(sStyleName));
575 }
576 }
577 catch(css::lang::IllegalArgumentException& e)
578 {
579 Sequence<OUString> aSeq { sStyleName };
580 GetImport().SetError(XMLERROR_STYLE_PROP_VALUE | XMLERROR_FLAG_WARNING, aSeq, e.Message, nullptr);
581 }
582 break;
583 }
584 default:
585 {
586 // check for StarBats and StarMath fonts
587 Any rAny = rState.maValue;
588 sal_Int32 nMapperIndex = rState.mnIndex;
589
590 // Now check for font name in rState and set corrected value,
591 // if necessary.
592 OUString sFontName;
593 rAny >>= sFontName;
594
595 if ( !sFontName.isEmpty() )
596 {
597 if ( sFontName.equalsIgnoreAsciiCase( "StarBats" ) ||
598 sFontName.equalsIgnoreAsciiCase( "StarMath" ) )
599 {
600 // construct new value
601 sFontName = "StarSymbol";
602 Any aAny(rAny);
603 aAny <<= sFontName;
604
605 if(!rPropMapper.is())
606 {
607 rPropMapper = xImpPrMap->getPropertySetMapper();
608 }
609
610 // set property
611 OUString rPropertyName(rPropMapper->GetEntryAPIName(nMapperIndex));
612
613 if(!xInfo.is())
614 {
615 xInfo = rPropSet->getPropertySetInfo();
616 }
617
618 if(xInfo->hasPropertyByName(rPropertyName))
619 {
620 rPropSet->setPropertyValue(rPropertyName,aAny);
621 }
622 }
623 // else: "normal" style name -> no correction is necessary
624 }
625 // else: no style name found -> illegal value -> ignore
626 }
627 }
628 }
629 }
630
631}
632
633/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SvXMLImport & GetImport()
Definition: xmlictxt.hxx:60
const css::uno::Any & GetAutoName() const
Definition: xmlstyle.hxx:80
XmlStyleFamily GetFamily() const
Definition: xmlstyle.hxx:85
bool IsNew() const
Definition: xmlstyle.hxx:90
bool IsDefaultStyle() const
Definition: xmlstyle.hxx:110
const OUString & GetDisplayName() const
Definition: xmlstyle.hxx:79
virtual rtl::Reference< SvXMLImportPropertyMapper > GetImportPropertyMapper(XmlStyleFamily nFamily) const
Definition: xmlstyle.cxx:522
bool IsAutomaticStyle() const
Definition: xmlstyle.cxx:316
static bool convertEnum(EnumT &rEnum, std::u16string_view rValue, const SvXMLEnumMapEntry< EnumT > *pMap)
convert string to enum using given enum map, if the enum is not found in the map, this method will re...
Definition: xmluconv.hxx:145
Import <script:events> element.
const css::uno::Reference< css::style::XStyle > & GetStyle() const
Definition: prstylei.hxx:106
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< XMLPropertyState > & GetProperties()
Definition: prstylei.hxx:79
virtual void CreateAndInsert(bool bOverwrite) override
Definition: prstylei.cxx:257
SvXMLStylesContext * GetStyles()
Definition: prstylei.hxx:78
virtual void SetAttribute(sal_Int32 nElement, const OUString &rValue) override
Definition: prstylei.cxx:57
virtual void Finish(bool bOverwrite) override
Definition: prstylei.cxx:446
bool m_bHasCombinedCharactersLetter
Definition: txtstyli.hxx:44
virtual void Finish(bool bOverwrite) override
Definition: txtstyli.cxx:249
virtual void SetAttribute(sal_Int32 nElement, const OUString &rValue) override
Definition: txtstyli.cxx:77
virtual void CreateAndInsert(bool bOverwrite) override
Definition: txtstyli.cxx:189
sal_Int8 m_nOutlineLevel
Definition: txtstyli.hxx:39
virtual void FillPropertySet(const css::uno::Reference< css::beans::XPropertySet > &rPropSet) override
Definition: txtstyli.cxx:375
std::optional< sal_Int16 > m_aListLevel
Reads <style:style style:list-level="...">.
Definition: txtstyli.hxx:52
rtl::Reference< XMLEventsImportContext > m_xEventContext
Definition: txtstyli.hxx:49
OUString m_sCategoryVal
Definition: txtstyli.hxx:34
XMLTextStyleContext(SvXMLImport &rImport, SvXMLStylesContext &rStyles, XmlStyleFamily nFamily, bool bDefaultStyle=false)
Definition: txtstyli.cxx:132
OUString m_sMasterPageName
Definition: txtstyli.hxx:36
OUString m_sDropCapTextStyleName
Definition: txtstyli.hxx:35
virtual void SetDefaults() override
Definition: txtstyli.cxx:232
OUString m_sDataStyleName
Definition: txtstyli.hxx:37
~XMLTextStyleContext() override
Definition: txtstyli.cxx:145
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: txtstyli.cxx:148
OUString m_sListStyleName
Definition: txtstyli.hxx:33
static bool convertNumber(sal_Int32 &rValue, std::u16string_view aString, sal_Int32 nMin=SAL_MIN_INT32, sal_Int32 nMax=SAL_MAX_INT32)
#define DBG_ASSERT(sCon, aError)
#define DBG_UNHANDLED_EXCEPTION(...)
float u
double maValue
Reference< XSingleServiceFactory > xFactory
XmlStyleFamily
Definition: families.hxx:50
OUString sDisplayName
sal_Int32 nIndex
Sequence< sal_Int8 > aSeq
#define SAL_WARN_IF(condition, area, stream)
#define SAL_INFO(area, stream)
@ Exception
int i
Handling of tokens in XML:
@ XML_DEFAULT_OUTLINE_LEVEL
Definition: xmltoken.hxx:2791
@ XML_SECTION_PROPERTIES
Definition: xmltoken.hxx:2636
@ XML_PARAGRAPH_PROPERTIES
Definition: xmltoken.hxx:2634
@ XML_TABLE_ROW_PROPERTIES
Definition: xmltoken.hxx:2639
bool IsXMLToken(std::u16string_view rString, enum XMLTokenEnum eToken)
compare eToken to the string
Definition: xmltoken.cxx:3597
bool IsIgnoreFillStyleNamedItem(css::uno::Reference< css::beans::XPropertySet > const &xProps, drawing::FillStyle const nExpectedFillStyle)
Definition: ximpstyl.cxx:1451
This struct is used as an optional parameter to the static _FillPropertySet() methods.
Definition: xmlimppr.hxx:58
sal_Int16 nContextID
Definition: xmlimppr.hxx:59
Smart struct to transport an Any with an index to the appropriate property-name.
Definition: maptype.hxx:140
css::uno::Any maValue
Definition: maptype.hxx:142
sal_Int32 mnIndex
Definition: maptype.hxx:141
#define CTF_FONTFAMILYNAME
Definition: txtprmap.hxx:58
#define CTF_COMBINED_CHARACTERS_FIELD
Definition: txtprmap.hxx:134
#define CTF_FONTFAMILYNAME_CJK
Definition: txtprmap.hxx:95
#define CTF_BORDER_MODEL
Definition: txtprmap.hxx:151
#define CTF_FONTFAMILYNAME_CTL
Definition: txtprmap.hxx:104
#define CTF_TEXT_DISPLAY
Definition: txtprmap.hxx:170
#define CTF_KEEP_TOGETHER
Definition: txtprmap.hxx:145
const SvXMLEnumMapEntry< sal_uInt16 > aCategoryMap[]
Definition: txtstyli.cxx:66
signed char sal_Int8
#define XMLERROR_STYLE_PROP_VALUE
Definition: xmlerror.hxx:68
#define XMLERROR_FLAG_WARNING
Definition: xmlerror.hxx:35
#define XML_ELEMENT(prefix, name)
Definition: xmlimp.hxx:97
constexpr bool IsTokenInNamespace(sal_Int32 nToken, sal_uInt16 nNamespacePrefix)
Definition: xmlimp.hxx:104
constexpr sal_Int32 TOKEN_MASK
Definition: xmlimp.hxx:94
constexpr sal_uInt16 XML_NAMESPACE_STYLE
#define CTF_FILLBITMAPNAME
Definition: xmlsdtypes.hxx:140
#define CTF_FILLGRADIENTNAME
Definition: xmlsdtypes.hxx:138
#define CTF_FILLTRANSNAME
Definition: xmlsdtypes.hxx:141
#define CTF_FILLHATCHNAME
Definition: xmlsdtypes.hxx:139
#define XML_TYPE_PROP_SECTION
Definition: xmltypes.hxx:101
#define XML_TYPE_PROP_PARAGRAPH
Definition: xmltypes.hxx:99
#define XML_TYPE_PROP_TEXT
Definition: xmltypes.hxx:98
#define XML_TYPE_PROP_TABLE
Definition: xmltypes.hxx:102
#define XML_TYPE_PROP_TABLE_ROW
Definition: xmltypes.hxx:104