LibreOffice Module sc (master) 1
xmlstyli.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 "xmlstyli.hxx"
22#include <xmloff/xmlimppr.hxx>
23#include <xmloff/families.hxx>
24#include <xmloff/xmlnumfi.hxx>
26#include <xmloff/xmltoken.hxx>
27#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
28#include <com/sun/star/table/BorderLine2.hpp>
30#include <xmloff/xmlprcon.hxx>
33#include "XMLConverter.hxx"
35#include <sheetdata.hxx>
36#include "xmlannoi.hxx"
37#include <textuno.hxx>
38#include <cellsuno.hxx>
39#include "xmlstyle.hxx"
40
41#include <docuno.hxx>
42#include <unonames.hxx>
43#include <document.hxx>
44#include <conditio.hxx>
45#include <rangelst.hxx>
46
47#include <xmloff/xmltypes.hxx>
48#include <xmloff/contextid.hxx>
49#include <xmloff/txtprmap.hxx>
50
51#define XML_LINE_LEFT 0
52#define XML_LINE_RIGHT 1
53#define XML_LINE_TOP 2
54#define XML_LINE_BOTTOM 3
55
56#define XML_LINE_TLBR 0
57#define XML_LINE_BLTR 1
58
59using namespace ::com::sun::star;
60using namespace ::com::sun::star::xml::sax;
61using namespace ::com::sun::star::style;
62using namespace ::com::sun::star::beans;
63using namespace ::com::sun::star::container;
64using namespace xmloff::token;
65using namespace ::formula;
66
67using com::sun::star::uno::UNO_QUERY;
70 SvXMLImport& rImportP) :
71 SvXMLImportPropertyMapper( rMapper, rImportP )
72{
73}
74
76{
77}
78
79void ScXMLCellImportPropertyMapper::finished(::std::vector< XMLPropertyState >& rProperties, sal_Int32 nStartIndex, sal_Int32 nEndIndex ) const
80{
81 static const sal_Int16 aPaddingCTF[4] = { CTF_SC_LEFTPADDING, CTF_SC_RIGHTPADDING,
83 static const sal_Int16 aBorderCTF[4] = { CTF_SC_LEFTBORDER, CTF_SC_RIGHTBORDER,
85
86 SvXMLImportPropertyMapper::finished(rProperties, nStartIndex, nEndIndex);
87 XMLPropertyState* pAllPaddingProperty(nullptr);
88 XMLPropertyState* pPadding[4] = { nullptr, nullptr, nullptr, nullptr };
89 XMLPropertyState* pNewPadding[4] = { nullptr, nullptr, nullptr, nullptr };
90 XMLPropertyState* pAllBorderProperty = nullptr;
91 XMLPropertyState* pBorders[4] = { nullptr, nullptr, nullptr, nullptr };
92 XMLPropertyState* pNewBorders[4] = { nullptr, nullptr, nullptr, nullptr };
93 XMLPropertyState* pAllBorderWidthProperty = nullptr;
94 XMLPropertyState* pBorderWidths[4] = { nullptr, nullptr, nullptr, nullptr };
95 XMLPropertyState* pDiagBorders[2] = { nullptr };
96 XMLPropertyState* pOldDiagBorderWidths[2] = { nullptr }; // old attribute names without "s"
97 XMLPropertyState* pDiagBorderWidths[2] = { nullptr };
98
99 for (auto& rProperty : rProperties)
100 {
101 XMLPropertyState*property = &rProperty;
102 if (property->mnIndex != -1)
103 {
104 sal_Int16 nContextID = getPropertySetMapper()->GetEntryContextId(property->mnIndex);
105 switch (nContextID)
106 {
107 case CTF_SC_ALLPADDING : pAllPaddingProperty = property; break;
108 case CTF_SC_LEFTPADDING : pPadding[XML_LINE_LEFT] = property; break;
109 case CTF_SC_RIGHTPADDING : pPadding[XML_LINE_RIGHT] = property; break;
110 case CTF_SC_TOPPADDING : pPadding[XML_LINE_TOP] = property; break;
111 case CTF_SC_BOTTOMPADDING : pPadding[XML_LINE_BOTTOM] = property; break;
112 case CTF_SC_ALLBORDER : pAllBorderProperty = property; break;
113 case CTF_SC_LEFTBORDER : pBorders[XML_LINE_LEFT] = property; break;
114 case CTF_SC_RIGHTBORDER : pBorders[XML_LINE_RIGHT] = property; break;
115 case CTF_SC_TOPBORDER : pBorders[XML_LINE_TOP] = property; break;
116 case CTF_SC_BOTTOMBORDER : pBorders[XML_LINE_BOTTOM] = property; break;
117 case CTF_SC_ALLBORDERWIDTH : pAllBorderWidthProperty = property; break;
118 case CTF_SC_LEFTBORDERWIDTH : pBorderWidths[XML_LINE_LEFT] = property; break;
119 case CTF_SC_RIGHTBORDERWIDTH : pBorderWidths[XML_LINE_RIGHT] = property; break;
120 case CTF_SC_TOPBORDERWIDTH : pBorderWidths[XML_LINE_TOP] = property; break;
121 case CTF_SC_BOTTOMBORDERWIDTH : pBorderWidths[XML_LINE_BOTTOM] = property; break;
122 case CTF_SC_DIAGONALTLBR : pDiagBorders[XML_LINE_TLBR] = property; break;
123 case CTF_SC_DIAGONALBLTR : pDiagBorders[XML_LINE_BLTR] = property; break;
124 case CTF_SC_DIAGONALTLBRWIDTH : pOldDiagBorderWidths[XML_LINE_TLBR] = property; break;
125 case CTF_SC_DIAGONALTLBRWIDTHS : pDiagBorderWidths[XML_LINE_TLBR] = property; break;
126 case CTF_SC_DIAGONALBLTRWIDTH : pOldDiagBorderWidths[XML_LINE_BLTR] = property; break;
127 case CTF_SC_DIAGONALBLTRWIDTHS : pDiagBorderWidths[XML_LINE_BLTR] = property; break;
128 }
129 }
130 }
131 sal_uInt16 i;
132
133 // #i27594#; copy Value, but don't insert
134 if (pAllBorderWidthProperty)
135 pAllBorderWidthProperty->mnIndex = -1;
136 if (pAllBorderProperty)
137 pAllBorderProperty->mnIndex = -1;
138 if (pAllPaddingProperty)
139 pAllPaddingProperty->mnIndex = -1;
140
141 for (i = 0; i < 4; ++i)
142 {
143 if (pAllPaddingProperty && !pPadding[i])
144 pNewPadding[i] = new XMLPropertyState(maPropMapper->FindEntryIndex(aPaddingCTF[i]), pAllPaddingProperty->maValue);
145 if (pAllBorderProperty && !pBorders[i])
146 {
147 pNewBorders[i] = new XMLPropertyState(maPropMapper->FindEntryIndex(aBorderCTF[i]), pAllBorderProperty->maValue);
148 pBorders[i] = pNewBorders[i];
149 }
150 if( !pBorderWidths[i] )
151 pBorderWidths[i] = pAllBorderWidthProperty;
152 else
153 pBorderWidths[i]->mnIndex = -1;
154 if( pBorders[i] )
155 {
156 table::BorderLine2 aBorderLine;
157 pBorders[i]->maValue >>= aBorderLine;
158 if( pBorderWidths[i] )
159 {
160 // Merge style:border-line-width values to fo:border values. Do
161 // not override fo:border line width or line style with an
162 // empty value!
163 table::BorderLine2 aBorderLineWidth;
164 pBorderWidths[i]->maValue >>= aBorderLineWidth;
165 aBorderLine.OuterLineWidth = aBorderLineWidth.OuterLineWidth;
166 aBorderLine.InnerLineWidth = aBorderLineWidth.InnerLineWidth;
167 aBorderLine.LineDistance = aBorderLineWidth.LineDistance;
168 pBorders[i]->maValue <<= aBorderLine;
169 }
170 }
171 }
172 for( i = 0; i < 2; ++i )
173 {
174 if( pDiagBorders[i] && ( pDiagBorderWidths[i] || pOldDiagBorderWidths[i] ) )
175 {
176 table::BorderLine2 aBorderLine;
177 pDiagBorders[i]->maValue >>= aBorderLine;
178 table::BorderLine2 aBorderLineWidth;
179 if (pDiagBorderWidths[i])
180 pDiagBorderWidths[i]->maValue >>= aBorderLineWidth; // prefer new attribute
181 else
182 pOldDiagBorderWidths[i]->maValue >>= aBorderLineWidth;
183 aBorderLine.OuterLineWidth = aBorderLineWidth.OuterLineWidth;
184 aBorderLine.InnerLineWidth = aBorderLineWidth.InnerLineWidth;
185 aBorderLine.LineDistance = aBorderLineWidth.LineDistance;
186 pDiagBorders[i]->maValue <<= aBorderLine;
187 if (pDiagBorderWidths[i])
188 pDiagBorderWidths[i]->mnIndex = -1;
189 if (pOldDiagBorderWidths[i])
190 pOldDiagBorderWidths[i]->mnIndex = -1; // reset mnIndex for old and new attribute if both are present
191 }
192 }
193
194 for (i = 0; i < 4; ++i)
195 {
196 if (pNewPadding[i])
197 {
198 rProperties.push_back(*pNewPadding[i]);
199 delete pNewPadding[i];
200 }
201 if (pNewBorders[i])
202 {
203 rProperties.push_back(*pNewBorders[i]);
204 delete pNewBorders[i];
205 }
206 }
207}
208
211 SvXMLImport& rImportP) :
212 SvXMLImportPropertyMapper( rMapper, rImportP )
213{
214}
215
217{
218}
219
220void ScXMLRowImportPropertyMapper::finished(::std::vector< XMLPropertyState >& rProperties, sal_Int32 nStartIndex, sal_Int32 nEndIndex ) const
221{
222 SvXMLImportPropertyMapper::finished(rProperties, nStartIndex, nEndIndex);
223 XMLPropertyState* pHeight(nullptr);
224 XMLPropertyState* pOptimalHeight(nullptr);
225 XMLPropertyState* pPageBreak(nullptr);
226 for (auto& rProperty : rProperties)
227 {
228 XMLPropertyState* property = &rProperty;
229 if (property->mnIndex != -1)
230 {
231 sal_Int16 nContextID = getPropertySetMapper()->GetEntryContextId(property->mnIndex);
232 switch (nContextID)
233 {
234 case CTF_SC_ROWHEIGHT : pHeight = property; break;
235 case CTF_SC_ROWOPTIMALHEIGHT : pOptimalHeight = property; break;
236 case CTF_SC_ROWBREAKBEFORE : pPageBreak = property; break;
237 }
238 }
239 }
240 if (pPageBreak)
241 {
242 if(!(::cppu::any2bool(pPageBreak->maValue)))
243 pPageBreak->mnIndex = -1;
244 }
245 if (pOptimalHeight)
246 {
247 if (::cppu::any2bool(pOptimalHeight->maValue))
248 {
249 if (pHeight)
250 {
251 // set the stored height, but keep "optimal" flag:
252 // pass the height value as OptimalHeight property (only allowed while loading!)
253 pOptimalHeight->maValue = pHeight->maValue;
254 pHeight->mnIndex = -1;
255 }
256 else
257 pOptimalHeight->mnIndex = -1;
258 }
259 }
260 else if (pHeight)
261 {
262 rProperties.emplace_back(maPropMapper->FindEntryIndex(CTF_SC_ROWOPTIMALHEIGHT), css::uno::Any(false));
263 }
264 // don't access pointers to rProperties elements after push_back!
265}
266
267namespace {
268
269class XMLTableCellPropsContext : public SvXMLPropertySetContext
270{
271 public:
272 XMLTableCellPropsContext(
273 SvXMLImport& rImport, sal_Int32 nElement,
274 const uno::Reference< xml::sax::XFastAttributeList >& xAttrList,
275 sal_uInt32 nFamily,
276 ::std::vector< XMLPropertyState > &rProps,
278
280 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > createFastChildContext(
281 sal_Int32 nElement,
282 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList,
283 ::std::vector< XMLPropertyState > &rProperties,
284 const XMLPropertyState& rProp ) override;
285};
286
287}
288
289XMLTableCellPropsContext::XMLTableCellPropsContext(
290 SvXMLImport& rImport, sal_Int32 nElement,
291 const uno::Reference< xml::sax::XFastAttributeList >& xAttrList,
292 sal_uInt32 nFamily,
293 ::std::vector< XMLPropertyState > &rProps,
295 : SvXMLPropertySetContext( rImport, nElement, xAttrList, nFamily,
296 rProps, rMap )
297{
298}
299
300css::uno::Reference< css::xml::sax::XFastContextHandler > XMLTableCellPropsContext::createFastChildContext(
301 sal_Int32 nElement,
302 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList,
303 ::std::vector< XMLPropertyState > &rProperties,
304 const XMLPropertyState& rProp )
305{
306 // no need for a custom context or indeed a SvXMLTokenMap to grab just the
307 // single attribute ( href ) that we are interested in.
308 // still though, we will check namespaces etc.
309 if (nElement == XML_ELEMENT(STYLE, XML_HYPERLINK) ||
310 nElement == XML_ELEMENT(LO_EXT, XML_HYPERLINK) )
311 {
312 OUString sURL;
313 for (auto &aIter : sax_fastparser::castToFastAttributeList( xAttrList ))
314 {
315 if ( aIter.getToken() == XML_ELEMENT(XLINK, XML_HREF) )
316 sURL = aIter.toString();
317 else
318 XMLOFF_WARN_UNKNOWN("sc", aIter);
319 }
320 if ( !sURL.isEmpty() )
321 {
322 XMLPropertyState aProp( rProp );
323 aProp.maValue <<= sURL;
324 rProperties.push_back( aProp );
325 }
326 }
327 else if (nElement == XML_ELEMENT(LO_EXT, XML_BACKGROUND_COMPLEX_COLOR))
328 {
329 return new XMLComplexColorContext(GetImport(), nElement, xAttrList, rProp, rProperties);
330 }
331 return SvXMLPropertySetContext::createFastChildContext( nElement, xAttrList, rProperties, rProp );
332}
333
334namespace {
335
336class ScXMLMapContext : public SvXMLImportContext
337{
338 OUString msApplyStyle;
339 OUString msCondition;
340 OUString msBaseCell;
341
342 ScXMLImport& GetScImport() { return static_cast<ScXMLImport&>(GetImport()); }
343public:
344
345 ScXMLMapContext(
346 SvXMLImport& rImport, sal_Int32 nElement,
347 const uno::Reference< xml::sax::XFastAttributeList > & xAttrList );
348
349 ScCondFormatEntry* CreateConditionEntry();
350};
351
352}
353
354ScXMLMapContext::ScXMLMapContext(SvXMLImport& rImport, sal_Int32 /*nElement*/,
355 const uno::Reference< xml::sax::XFastAttributeList > & xAttrList )
356 : SvXMLImportContext( rImport )
357{
358 for( auto &aIter : sax_fastparser::castToFastAttributeList( xAttrList ) )
359 {
360 OUString sValue = aIter.toString();
361 switch (aIter.getToken())
362 {
363 case XML_ELEMENT(STYLE, XML_CONDITION):
364 msCondition = sValue;
365 break;
366 case XML_ELEMENT(STYLE, XML_APPLY_STYLE_NAME):
367 msApplyStyle = GetImport().GetStyleDisplayName( XmlStyleFamily::TABLE_CELL, sValue);
368 break;
369 case XML_ELEMENT(STYLE, XML_BASE_CELL_ADDRESS):
370 msBaseCell = sValue;
371 break;
372 default:
373 XMLOFF_WARN_UNKNOWN("sc", aIter);
374 }
375 }
376}
377
378ScCondFormatEntry* ScXMLMapContext::CreateConditionEntry()
379{
380 OUString aCondition, aConditionNmsp;
381 FormulaGrammar::Grammar eGrammar = FormulaGrammar::GRAM_UNSPECIFIED;
382 GetScImport().ExtractFormulaNamespaceGrammar( aCondition, aConditionNmsp, eGrammar, msCondition );
383 bool bHasNmsp = aCondition.getLength() < msCondition.getLength();
384
385 // parse a condition from the attribute string
386 ScXMLConditionParseResult aParseResult;
387 ScXMLConditionHelper::parseCondition( aParseResult, aCondition, 0 );
388
389 if( !bHasNmsp )
390 {
391 // the attribute does not contain a namespace: try to find a namespace of an external grammar
392 FormulaGrammar::Grammar eNewGrammar = FormulaGrammar::GRAM_UNSPECIFIED;
393 GetScImport().ExtractFormulaNamespaceGrammar( aCondition, aConditionNmsp, eNewGrammar, aCondition, true );
394 if( eNewGrammar != FormulaGrammar::GRAM_EXTERNAL )
395 eGrammar = eNewGrammar;
396 }
397
399 ScDocument* pDoc = GetScImport().GetDocument();
400
401 ScCondFormatEntry* pEntry = new ScCondFormatEntry(eMode, aParseResult.maOperand1, aParseResult.maOperand2, *pDoc, ScAddress(), msApplyStyle,
402 OUString(), OUString(), eGrammar, eGrammar);
403
404 pEntry->SetSrcString(msBaseCell);
405 return pEntry;
406}
407
408void XMLTableStyleContext::SetAttribute( sal_Int32 nElement,
409 const OUString& rValue )
410{
411 switch(nElement & TOKEN_MASK)
412 {
414 sDataStyleName = rValue;
415 break;
417 sPageStyle = rValue;
418 break;
419 default:
420 XMLPropStyleContext::SetAttribute( nElement, rValue );
421 }
422}
423
424
426 SvXMLStylesContext& rStyles, XmlStyleFamily nFamily, bool bDefaultStyle ) :
427 XMLPropStyleContext( rImport, rStyles, nFamily, bDefaultStyle ),
428 pStyles(&rStyles),
429 nNumberFormat(-1),
430 nLastSheet(-1),
431 bParentSet(false),
432 mpCondFormat(nullptr),
433 mbDeleteCondFormat(true)
434{
435}
436
438{
440 delete mpCondFormat;
441}
442
443css::uno::Reference< css::xml::sax::XFastContextHandler > XMLTableStyleContext::createFastChildContext(
444 sal_Int32 nElement,
445 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
446{
447 css::uno::Reference< css::xml::sax::XFastContextHandler > xContext;
448
449 if( nElement == XML_ELEMENT(STYLE, XML_MAP) )
450 {
451 if(!mpCondFormat)
452 mpCondFormat = new ScConditionalFormat( 0, GetScImport().GetDocument() );
453 ScXMLMapContext* pMapContext = new ScXMLMapContext(GetImport(), nElement, xAttrList);
454 xContext = pMapContext;
455 mpCondFormat->AddEntry(pMapContext->CreateConditionEntry());
456 }
457 else if ( nElement == XML_ELEMENT(STYLE, XML_TABLE_CELL_PROPERTIES) )
458 {
461 GetFamily() );
462 if( xImpPrMap.is() )
463 xContext = new XMLTableCellPropsContext( GetImport(), nElement,
464 xAttrList,
467 xImpPrMap );
468 }
469
470 if (!xContext)
471 xContext = XMLPropStyleContext::createFastChildContext( nElement, xAttrList );
472 return xContext;
473}
474
475void XMLTableStyleContext::ApplyCondFormat( const uno::Sequence<table::CellRangeAddress>& xCellRanges )
476{
477 if(!mpCondFormat || GetScImport().HasNewCondFormatData())
478 return;
479
480 ScRangeList aRangeList;
481 for(const table::CellRangeAddress& aAddress : xCellRanges)
482 {
483 ScRange aRange( aAddress.StartColumn, aAddress.StartRow, aAddress.Sheet, aAddress.EndColumn, aAddress.EndRow, aAddress.Sheet );
484 aRangeList.Join( aRange );
485 }
486
489 ScConditionalFormatList* pFormatList = pDoc->GetCondFormList(nTab);
490 auto itr = std::find_if(pFormatList->begin(), pFormatList->end(),
491 [this](const std::unique_ptr<ScConditionalFormat>& rxFormat) { return rxFormat->EqualEntries(*mpCondFormat); });
492 if (itr != pFormatList->end())
493 {
494 ScRangeList& rRangeList = (*itr)->GetRangeList();
495 sal_uInt32 nCondId = (*itr)->GetKey();
496 size_t n = aRangeList.size();
497 for(size_t i = 0; i < n; ++i)
498 {
499 const ScRange & rRange = aRangeList[i];
500 rRangeList.Join(rRange);
501 }
502
503 pDoc->AddCondFormatData( aRangeList, nTab, nCondId );
504 return;
505 }
506
508 {
509 sal_uLong nIndex = pDoc->AddCondFormat(std::unique_ptr<ScConditionalFormat>(mpCondFormat), nTab );
511 mpCondFormat->SetRange(aRangeList);
512
513 pDoc->AddCondFormatData( aRangeList, nTab, nIndex );
514 mbDeleteCondFormat = false;
515 }
516
517}
518
520 const uno::Reference< XPropertySet > & rPropSet )
521{
522 if (!IsDefaultStyle())
523 {
524 if (GetFamily() == XmlStyleFamily::TABLE_CELL)
525 {
526 if (!bParentSet)
527 {
528 AddProperty(CTF_SC_CELLSTYLE, uno::Any(GetImport().GetStyleDisplayName( XmlStyleFamily::TABLE_CELL, GetParentName() )));
529 bParentSet = true;
530 }
531 sal_Int32 nNumFmt = GetNumberFormat();
532 if (nNumFmt >= 0)
534 }
535 else if (GetFamily() == XmlStyleFamily::TABLE_TABLE)
536 {
537 if (!sPageStyle.isEmpty())
538 AddProperty(CTF_SC_MASTERPAGENAME, uno::Any(GetImport().GetStyleDisplayName( XmlStyleFamily::MASTER_PAGE, sPageStyle )));
539 }
540 }
542}
543
545{
546 if ((GetFamily() == XmlStyleFamily::TABLE_CELL) && GetImport().GetModel().is())
547 {
548 uno::Reference <lang::XMultiServiceFactory> xMultiServiceFactory(GetImport().GetModel(), uno::UNO_QUERY);
549 if (xMultiServiceFactory.is())
550 {
551 uno::Reference <beans::XPropertySet> xProperties(xMultiServiceFactory->createInstance("com.sun.star.sheet.Defaults"), uno::UNO_QUERY);
552 if (xProperties.is())
553 FillPropertySet(xProperties);
554 }
555 }
556}
557
558void XMLTableStyleContext::AddProperty(const sal_Int16 nContextID, const uno::Any& rValue)
559{
560 XMLPropertyState* property = FindProperty(nContextID);
561 if (property)
562 property->mnIndex = -1; // #i46996# remove old property, so it isn't double
563 sal_Int32 nIndex(static_cast<XMLTableStylesContext *>(pStyles)->GetIndex(nContextID));
564 OSL_ENSURE(nIndex != -1, "Property not found in Map");
565 XMLPropertyState aPropState(nIndex, rValue);
566 GetProperties().push_back(aPropState); // has to be inserted in a sort order later
567}
568
570{
571 XMLPropertyState* pRet = nullptr;
575 OSL_ENSURE( xImpPrMap.is(), "There is the import prop mapper" );
576 if( xImpPrMap.is() )
577 xPrMap = xImpPrMap->getPropertySetMapper();
578 if( xPrMap.is() )
579 {
580 auto aIter = std::find_if(GetProperties().begin(), GetProperties().end(),
581 [&xPrMap, &nContextID](const XMLPropertyState& rProp) {
582 return rProp.mnIndex != -1 && xPrMap->GetEntryContextId(rProp.mnIndex) == nContextID;
583 });
584 if (aIter != GetProperties().end())
585 pRet = &(*aIter);
586 }
587 return pRet;
588}
589
591{
592 if (nNumberFormat < 0 && !sDataStyleName.isEmpty())
593 {
594 const SvXMLNumFormatContext* pStyle = static_cast<const SvXMLNumFormatContext*>(
595 pStyles->FindStyleChildContext(XmlStyleFamily::DATA_STYLE, sDataStyleName, true));
596
597 if (!pStyle)
598 {
599 XMLTableStylesContext* pMyStyles = static_cast<XMLTableStylesContext*>(GetScImport().GetStyles());
600 if (pMyStyles)
601 pStyle = static_cast<const SvXMLNumFormatContext*>(
602 pMyStyles->FindStyleChildContext(XmlStyleFamily::DATA_STYLE, sDataStyleName, true));
603 else
604 {
605 OSL_FAIL("not possible to get style");
606 }
607 }
608 if (pStyle)
609 nNumberFormat = const_cast<SvXMLNumFormatContext*>(pStyle)->GetKey();
610 }
611 return nNumberFormat;
612}
613
615 XmlStyleFamily nFamily, sal_Int32 nElement,
616 const uno::Reference< xml::sax::XFastAttributeList > & xAttrList )
617{
618 SvXMLStyleContext *pStyle;
619 // use own wrapper for text and paragraph, to record style usage
620 if (nFamily == XmlStyleFamily::TEXT_PARAGRAPH || nFamily == XmlStyleFamily::TEXT_TEXT)
621 pStyle = new ScCellTextStyleContext( GetImport(),*this, nFamily );
622 else if (nFamily == XmlStyleFamily::SD_GRAPHICS_ID)
623 pStyle = new ScShapeStyleContext( GetImport(), *this, nFamily );
624 else
626 nFamily, nElement, xAttrList );
627
628 if (!pStyle)
629 {
630 switch( nFamily )
631 {
632 case XmlStyleFamily::TABLE_CELL:
633 case XmlStyleFamily::TABLE_COLUMN:
634 case XmlStyleFamily::TABLE_ROW:
635 case XmlStyleFamily::TABLE_TABLE:
636 pStyle = new XMLTableStyleContext( GetScImport(), *this, nFamily );
637 break;
638 default: break;
639 }
640 }
641
642 return pStyle;
643}
644
646 XmlStyleFamily nFamily, sal_Int32 nElement,
647 const uno::Reference< xml::sax::XFastAttributeList > & xAttrList )
648{
650 xAttrList ));
651 if (!pStyle)
652 {
653 switch( nFamily )
654 {
655 case XmlStyleFamily::TABLE_CELL:
656 pStyle = new XMLTableStyleContext( GetScImport(), *this, nFamily, true);
657 break;
658 case XmlStyleFamily::SD_GRAPHICS_ID:
659 pStyle = new XMLGraphicsDefaultStyle( GetScImport(), *this);
660 break;
661 default: break;
662 }
663 }
664
665 return pStyle;
666}
667
668constexpr OUStringLiteral gsCellStyleServiceName(u"com.sun.star.style.CellStyle");
669constexpr OUStringLiteral gsGraphicStyleServiceName(u"com.sun.star.style.GraphicStyle");
670
672 const bool bTempAutoStyles )
673 : SvXMLStylesContext( rImport )
674 , nNumberFormatIndex(-1)
675 , nConditionalFormatIndex(-1)
676 , nCellStyleIndex(-1)
677 , nMasterPageNameIndex(-1)
678 , bAutoStyles(bTempAutoStyles)
679{
680}
681
683{
684}
685
687{
688 if (bAutoStyles)
689 GetImport().GetTextImport()->SetAutoStyles( this );
690 else
692}
693
696 XmlStyleFamily nFamily ) const
697{
699
700 if (!xMapper.is())
701 {
702 switch( nFamily )
703 {
704 case XmlStyleFamily::TABLE_CELL:
705 {
706 if( !xCellImpPropMapper.is() )
707 {
708 const_cast<XMLTableStylesContext *>(this)->xCellImpPropMapper =
711 }
712 xMapper = xCellImpPropMapper;
713 }
714 break;
715 case XmlStyleFamily::TABLE_COLUMN:
716 {
717 if( !xColumnImpPropMapper.is() )
718 const_cast<XMLTableStylesContext *>(this)->xColumnImpPropMapper =
719 new SvXMLImportPropertyMapper( GetScImport().GetColumnStylesPropertySetMapper(), const_cast<SvXMLImport&>(GetImport()) );
720 xMapper = xColumnImpPropMapper;
721 }
722 break;
723 case XmlStyleFamily::TABLE_ROW:
724 {
725 if( !xRowImpPropMapper.is() )
726 const_cast<XMLTableStylesContext *>(this)->xRowImpPropMapper =
728 xMapper = xRowImpPropMapper;
729 }
730 break;
731 case XmlStyleFamily::TABLE_TABLE:
732 {
733 if( !xTableImpPropMapper.is() )
734 const_cast<XMLTableStylesContext *>(this)->xTableImpPropMapper =
735 new SvXMLImportPropertyMapper( GetScImport().GetTableStylesPropertySetMapper(), const_cast<SvXMLImport&>(GetImport()) );
736 xMapper = xTableImpPropMapper;
737 }
738 break;
739 default: break;
740 }
741 }
742
743 return xMapper;
744}
745
746uno::Reference < XNameContainer >
748{
749 uno::Reference < XNameContainer > xStyles(SvXMLStylesContext::GetStylesContainer(nFamily));
750 if (!xStyles.is())
751 {
752 OUString sName;
753 switch( nFamily )
754 {
755 case XmlStyleFamily::TABLE_TABLE:
756 {
757 if( xTableStyles.is() )
758 xStyles.set(xTableStyles);
759 else
760 sName = "TableStyles";
761 }
762 break;
763 case XmlStyleFamily::TABLE_CELL:
764 {
765 if( xCellStyles.is() )
766 xStyles.set(xCellStyles);
767 else
768 sName = "CellStyles";
769 }
770 break;
771 case XmlStyleFamily::TABLE_COLUMN:
772 {
773 if( xColumnStyles.is() )
774 xStyles.set(xColumnStyles);
775 else
776 sName = "ColumnStyles";
777 }
778 break;
779 case XmlStyleFamily::TABLE_ROW:
780 {
781 if( xRowStyles.is() )
782 xStyles.set(xRowStyles);
783 else
784 sName = "RowStyles";
785 }
786 break;
787 case XmlStyleFamily::SD_GRAPHICS_ID:
788 {
789 if( xGraphicStyles.is() )
790 xStyles.set(xGraphicStyles);
791 else
792 sName = "GraphicStyles";
793 }
794 break;
795 default: break;
796 }
797 if( !xStyles.is() && !sName.isEmpty() && GetScImport().GetModel().is() )
798 {
799 uno::Reference< XStyleFamiliesSupplier > xFamiliesSupp(
800 GetScImport().GetModel(), UNO_QUERY );
801 if (xFamiliesSupp.is())
802 {
803 uno::Reference< XNameAccess > xFamilies(xFamiliesSupp->getStyleFamilies());
804
805 try
806 {
807 xStyles.set(xFamilies->getByName( sName ), uno::UNO_QUERY);
808 }
809 catch ( uno::Exception& )
810 {
811 // #i97680# Named table/column/row styles aren't supported, getByName will throw an exception.
812 // For better interoperability, these styles should then be handled as automatic styles.
813 // For now, NULL is returned (and the style is ignored).
814 }
815 switch( nFamily )
816 {
817 case XmlStyleFamily::TABLE_TABLE:
818 const_cast<XMLTableStylesContext *>(this)->xTableStyles.set(xStyles);
819 break;
820 case XmlStyleFamily::TABLE_CELL:
821 const_cast<XMLTableStylesContext *>(this)->xCellStyles.set(xStyles);
822 break;
823 case XmlStyleFamily::TABLE_COLUMN:
824 const_cast<XMLTableStylesContext *>(this)->xColumnStyles.set(xStyles);
825 break;
826 case XmlStyleFamily::TABLE_ROW:
827 const_cast<XMLTableStylesContext *>(this)->xRowStyles.set(xStyles);
828 break;
829 case XmlStyleFamily::SD_GRAPHICS_ID:
830 const_cast<XMLTableStylesContext *>(this)->xGraphicStyles.set(xStyles);
831 break;
832 default: break;
833 }
834 }
835 }
836 }
837
838 return xStyles;
839}
840
842{
844 if (sServiceName.isEmpty())
845 {
846 switch( nFamily )
847 {
848 case XmlStyleFamily::TABLE_COLUMN:
850 break;
851 case XmlStyleFamily::TABLE_ROW:
853 break;
854 case XmlStyleFamily::TABLE_CELL:
856 break;
857 case XmlStyleFamily::TABLE_TABLE:
859 break;
860 case XmlStyleFamily::SD_GRAPHICS_ID:
862 break;
863 default: break;
864 }
865 }
866 return sServiceName;
867}
868
869sal_Int32 XMLTableStylesContext::GetIndex(const sal_Int16 nContextID)
870{
871 if (nContextID == CTF_SC_CELLSTYLE)
872 {
873 if (nCellStyleIndex == -1)
875 GetImportPropertyMapper(XmlStyleFamily::TABLE_CELL)->getPropertySetMapper()->FindEntryIndex(nContextID);
876 return nCellStyleIndex;
877 }
878 else if (nContextID == CTF_SC_NUMBERFORMAT)
879 {
880 if (nNumberFormatIndex == -1)
882 GetImportPropertyMapper(XmlStyleFamily::TABLE_CELL)->getPropertySetMapper()->FindEntryIndex(nContextID);
883 return nNumberFormatIndex;
884 }
885 else if (nContextID == CTF_SC_IMPORT_MAP)
886 {
887 if (nConditionalFormatIndex == -1)
889 GetImportPropertyMapper(XmlStyleFamily::TABLE_CELL)->getPropertySetMapper()->FindEntryIndex(nContextID);
891 }
892 else if (nContextID == CTF_SC_MASTERPAGENAME)
893 {
894 if (nMasterPageNameIndex == -1)
896 GetImportPropertyMapper(XmlStyleFamily::TABLE_TABLE)->getPropertySetMapper()->FindEntryIndex(nContextID);
898 }
899 else
900 return -1;
901}
902
903
905{
906 return true;
907}
908
910 SvXMLStylesContext( rImport )
911{
912}
913
915{
916}
917
919 sal_Int32 nElement,
920 const uno::Reference< XFastAttributeList > & xAttrList )
921{
922 SvXMLStyleContext *pContext(nullptr);
923
924 if( nElement == XML_ELEMENT(STYLE, XML_MASTER_PAGE) &&
925 InsertStyleFamily( XmlStyleFamily::MASTER_PAGE ) )
926 pContext = new ScMasterPageContext(
927 GetImport(), nElement, xAttrList,
928 !GetImport().GetTextImport()->IsInsertMode() );
929
930 // any other style will be ignored here!
931
932 return pContext;
933}
934
936 XmlStyleFamily /* nFamily */,
937 sal_Int32 /* nElement */,
938 const uno::Reference< XFastAttributeList > & /* xAttrList */ )
939{
940 return nullptr;
941}
942
944{
945 FinishStyles(true);
946}
947
948
950 sal_Int32 nElement,
951 const uno::Reference< XFastAttributeList > & xAttrList,
952 bool bOverwrite ) :
953 XMLTextMasterPageContext( rImport, nElement, xAttrList, bOverwrite ),
954 bContainsRightHeader(false),
955 bContainsRightFooter(false)
956{
957}
958
960{
961}
962
964 sal_Int32 nElement,
965 const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList,
966 const bool bFooter,
967 const bool bLeft,
968 const bool bFirst )
969{
970 if (!bLeft)
971 {
972 if (bFooter)
974 else
976 }
977 if (!xPropSet.is())
978 xPropSet.set(GetStyle(), UNO_QUERY );
980 nElement,
981 xAttrList,
982 xPropSet,
983 bFooter, bLeft, bFirst );
984}
985
986void ScMasterPageContext::ClearContent(const OUString& rContent)
987{
988 if (!xPropSet.is())
989 xPropSet.set(GetStyle(), UNO_QUERY );
990
991 if (xPropSet.is())
992 {
993 uno::Reference < sheet::XHeaderFooterContent > xHeaderFooterContent(xPropSet->getPropertyValue( rContent ), uno::UNO_QUERY);
994 if (xHeaderFooterContent.is())
995 {
996 xHeaderFooterContent->getLeftText()->setString("");
997 xHeaderFooterContent->getCenterText()->setString("");
998 xHeaderFooterContent->getRightText()->setString("");
999 xPropSet->setPropertyValue( rContent, uno::Any(xHeaderFooterContent) );
1000 }
1001 }
1002}
1003
1004void ScMasterPageContext::Finish( bool bOverwrite )
1005{
1011}
1012
1014 SvXMLStylesContext& rStyles, XmlStyleFamily nFamily ) :
1015 XMLTextStyleContext( rImport, rStyles, nFamily, false/*bDefaultStyle*/ ),
1016 nLastSheet(-1)
1017{
1018}
1019
1021{
1022}
1023
1024void ScCellTextStyleContext::FillPropertySet( const uno::Reference<beans::XPropertySet>& xPropSet )
1025{
1027
1028 ScXMLImport& rXMLImport = GetScImport();
1029
1030 ScCellTextCursor* pCellImp = comphelper::getFromUnoTunnel<ScCellTextCursor>( xPropSet );
1031 if (pCellImp)
1032 {
1033 ScAddress aPos = pCellImp->GetCellObj().GetPosition();
1034 if ( aPos.Tab() != nLastSheet )
1035 {
1036 ESelection aSel = pCellImp->GetSelection();
1037
1038 ScSheetSaveData* pSheetData = comphelper::getFromUnoTunnel<ScModelObj>(GetImport().GetModel())->GetSheetSaveData();
1039 pSheetData->AddTextStyle( GetName(), aPos, aSel );
1040
1041 nLastSheet = aPos.Tab();
1042 }
1043 }
1044 else if ( rXMLImport.GetTables().GetCurrentSheet() != nLastSheet )
1045 {
1046 ScDrawTextCursor* pDrawImp = comphelper::getFromUnoTunnel<ScDrawTextCursor>( xPropSet );
1047 if (pDrawImp)
1048 {
1049 XMLTableShapeImportHelper* pTableShapeImport = static_cast<XMLTableShapeImportHelper*>(GetScImport().GetShapeImport().get());
1050 ScXMLAnnotationContext* pAnnotationContext = pTableShapeImport->GetAnnotationContext();
1051 if (pAnnotationContext)
1052 {
1053 pAnnotationContext->AddContentStyle( GetFamily(), GetName(), pDrawImp->GetSelection() );
1054 nLastSheet = rXMLImport.GetTables().GetCurrentSheet();
1055 }
1056 }
1057
1058 // if it's a different shape, BlockSheet is called from XMLTableShapeImportHelper::finishShape
1059 // formatted text in page headers/footers can be ignored
1060 }
1061}
1062
1063void ScShapeStyleContext::Finish(bool bOverwrite)
1064{
1065 // set parent styles
1066 XMLPropStyleContext::Finish(bOverwrite);
1067}
1068
1069/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
constexpr OUStringLiteral sServiceName
SCTAB Tab() const
Definition: address.hxx:283
const ScAddress & GetPosition() const
Definition: cellsuno.hxx:679
uno3: SvxUnoTextCursor is not derived from XUnoTunnel, but should be (?)
Definition: textuno.hxx:209
ScCellObj & GetCellObj() const
Definition: textuno.hxx:221
const ScXMLImport & GetScImport() const
Definition: xmlstyli.hxx:214
ScCellTextStyleContext(SvXMLImport &rImport, SvXMLStylesContext &rStyles, XmlStyleFamily nFamily)
Definition: xmlstyli.cxx:1013
virtual void FillPropertySet(const css::uno::Reference< css::beans::XPropertySet > &rPropSet) override
Definition: xmlstyli.cxx:1024
virtual ~ScCellTextStyleContext() override
Definition: xmlstyli.cxx:1020
static ScConditionMode GetModeFromApi(css::sheet::ConditionOperator nOperator)
Definition: conditio.cxx:1417
void SetSrcString(const OUString &rNew)
Definition: conditio.cxx:467
void SetKey(sal_uInt32 nNew)
Definition: conditio.hxx:592
void SetRange(const ScRangeList &rRanges)
Definition: conditio.cxx:1762
void AddEntry(ScFormatEntry *pNew)
Definition: conditio.cxx:1768
SC_DLLPUBLIC void AddCondFormatData(const ScRangeList &rRange, SCTAB nTab, sal_uInt32 nIndex)
Definition: document.cxx:4790
SC_DLLPUBLIC ScConditionalFormatList * GetCondFormList(SCTAB nTab) const
Definition: documen4.cxx:860
SC_DLLPUBLIC sal_uLong AddCondFormat(std::unique_ptr< ScConditionalFormat > pNew, SCTAB nTab)
Definition: documen4.cxx:708
virtual SvXMLImportContext * CreateHeaderFooterContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, const bool bFooter, const bool bLeft, const bool bFirst) override
Definition: xmlstyli.cxx:963
void ClearContent(const OUString &rContent)
Definition: xmlstyli.cxx:986
ScMasterPageContext(SvXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, bool bOverwrite)
Definition: xmlstyli.cxx:949
virtual ~ScMasterPageContext() override
Definition: xmlstyli.cxx:959
css::uno::Reference< css::beans::XPropertySet > xPropSet
Definition: xmlstyli.hxx:187
virtual void Finish(bool bOverwrite) override
Definition: xmlstyli.cxx:1004
SCTAB GetCurrentSheet() const
Definition: xmlsubti.hxx:84
void Join(const ScRange &, bool bIsInList=false)
Definition: rangelst.cxx:152
size_t size() const
Definition: rangelst.hxx:89
void Finish(bool bOverwrite) override
Definition: xmlstyli.cxx:1063
void AddTextStyle(const OUString &rName, const ScAddress &rCellPos, const ESelection &rSelection)
Definition: sheetdata.cxx:87
void AddContentStyle(XmlStyleFamily nFamily, const OUString &rName, const ESelection &rSelection)
Definition: xmlannoi.cxx:166
ScXMLCellImportPropertyMapper(const rtl::Reference< XMLPropertySetMapper > &rMapper, SvXMLImport &rImport)
Definition: xmlstyli.cxx:68
virtual ~ScXMLCellImportPropertyMapper() override
Definition: xmlstyli.cxx:75
virtual void finished(::std::vector< XMLPropertyState > &rProperties, sal_Int32 nStartIndex, sal_Int32 nEndIndex) const override
This method is called when all attributes have been processed.
Definition: xmlstyli.cxx:79
const rtl::Reference< XMLPropertySetMapper > & GetRowStylesPropertySetMapper() const
Definition: xmlimprt.hxx:218
void InsertStyles()
Definition: xmlimprt.cxx:596
const rtl::Reference< XMLPropertySetMapper > & GetCellStylesPropertySetMapper() const
Definition: xmlimprt.hxx:216
ScDocument * GetDocument()
Definition: xmlimprt.hxx:205
ScMyTables & GetTables()
Definition: xmlimprt.hxx:208
virtual SvXMLStyleContext * CreateStyleChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: xmlstyli.cxx:918
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmlstyli.cxx:943
ScXMLMasterStylesContext(SvXMLImport &rImport)
Definition: xmlstyli.cxx:909
virtual SvXMLStyleContext * CreateStyleStyleChildContext(XmlStyleFamily nFamily, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: xmlstyli.cxx:935
virtual bool InsertStyleFamily(XmlStyleFamily nFamily) const override
Definition: xmlstyli.cxx:904
virtual ~ScXMLMasterStylesContext() override
Definition: xmlstyli.cxx:914
virtual void finished(::std::vector< XMLPropertyState > &rProperties, sal_Int32 nStartIndex, sal_Int32 nEndIndex) const override
This method is called when all attributes have been processed.
Definition: xmlstyli.cxx:220
ScXMLRowImportPropertyMapper(const rtl::Reference< XMLPropertySetMapper > &rMapper, SvXMLImport &rImport)
Definition: xmlstyli.cxx:209
virtual ~ScXMLRowImportPropertyMapper() override
Definition: xmlstyli.cxx:216
SvXMLImport & GetImport()
friend friend class SvXMLImport
const rtl::Reference< XMLPropertySetMapper > & getPropertySetMapper() const
virtual void finished(::std::vector< XMLPropertyState > &rProperties, sal_Int32 nStartIndex, sal_Int32 nEndIndex) const
SvXMLImport & GetImport() const
rtl::Reference< XMLPropertySetMapper > maPropMapper
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
const OUString & GetName() const
XmlStyleFamily GetFamily() const
const OUString & GetParentName() const
bool IsDefaultStyle() const
const SvXMLStyleContext * FindStyleChildContext(XmlStyleFamily nFamily, const OUString &rName, bool bCreateIndex=false) const
virtual css::uno::Reference< css::container::XNameContainer > GetStylesContainer(XmlStyleFamily nFamily) const
virtual SvXMLStyleContext * CreateDefaultStyleStyleChildContext(XmlStyleFamily nFamily, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
virtual rtl::Reference< SvXMLImportPropertyMapper > GetImportPropertyMapper(XmlStyleFamily nFamily) const
virtual SvXMLStyleContext * CreateStyleStyleChildContext(XmlStyleFamily nFamily, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
void FinishStyles(bool bOverwrite)
virtual OUString GetServiceName(XmlStyleFamily nFamily) const
virtual void FillPropertySet(const css::uno::Reference< css::beans::XPropertySet > &rPropSet)
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
const SvXMLStylesContext * GetStyles() const
const ::std::vector< XMLPropertyState > & GetProperties() const
virtual void SetAttribute(sal_Int32 nElement, const OUString &rValue) override
virtual void Finish(bool bOverwrite) override
ScXMLAnnotationContext * GetAnnotationContext() const
OUString sDataStyleName
Definition: xmlstyli.hxx:68
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: xmlstyli.cxx:443
void ApplyCondFormat(const css::uno::Sequence< css::table::CellRangeAddress > &xCellRanges)
Definition: xmlstyli.cxx:475
void AddProperty(sal_Int16 nContextID, const css::uno::Any &aValue)
Definition: xmlstyli.cxx:558
XMLPropertyState * FindProperty(const sal_Int16 nContextID)
Definition: xmlstyli.cxx:569
virtual void SetDefaults() override
Definition: xmlstyli.cxx:544
virtual void FillPropertySet(const css::uno::Reference< css::beans::XPropertySet > &rPropSet) override
Definition: xmlstyli.cxx:519
ScConditionalFormat * mpCondFormat
Definition: xmlstyli.hxx:74
SvXMLStylesContext * pStyles
Definition: xmlstyli.hxx:70
virtual void SetAttribute(sal_Int32 nElement, const OUString &rValue) override
Definition: xmlstyli.cxx:408
const ScXMLImport & GetScImport() const
Definition: xmlstyli.hxx:77
XMLTableStyleContext(ScXMLImport &rImport, SvXMLStylesContext &rStyles, XmlStyleFamily nFamily, bool bDefaultStyle=false)
Definition: xmlstyli.cxx:425
sal_Int32 GetNumberFormat()
Definition: xmlstyli.cxx:590
sal_Int32 nNumberFormat
Definition: xmlstyli.hxx:71
virtual ~XMLTableStyleContext() override
Definition: xmlstyli.cxx:437
sal_Int32 nMasterPageNameIndex
Definition: xmlstyli.hxx:123
css::uno::Reference< css::container::XNameContainer > xRowStyles
Definition: xmlstyli.hxx:117
sal_Int32 nConditionalFormatIndex
Definition: xmlstyli.hxx:121
sal_Int32 nCellStyleIndex
Definition: xmlstyli.hxx:122
sal_Int32 nNumberFormatIndex
Definition: xmlstyli.hxx:120
virtual css::uno::Reference< css::container::XNameContainer > GetStylesContainer(XmlStyleFamily nFamily) const override
Definition: xmlstyli.cxx:747
rtl::Reference< SvXMLImportPropertyMapper > xTableImpPropMapper
Definition: xmlstyli.hxx:129
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmlstyli.cxx:686
rtl::Reference< SvXMLImportPropertyMapper > xRowImpPropMapper
Definition: xmlstyli.hxx:128
virtual ~XMLTableStylesContext() override
Definition: xmlstyli.cxx:682
XMLTableStylesContext(SvXMLImport &rImport, bool bAutoStyles)
Definition: xmlstyli.cxx:671
css::uno::Reference< css::container::XNameContainer > xColumnStyles
Definition: xmlstyli.hxx:116
virtual OUString GetServiceName(XmlStyleFamily nFamily) const override
Definition: xmlstyli.cxx:841
css::uno::Reference< css::container::XNameContainer > xCellStyles
Definition: xmlstyli.hxx:115
virtual SvXMLStyleContext * CreateDefaultStyleStyleChildContext(XmlStyleFamily nFamily, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: xmlstyli.cxx:645
css::uno::Reference< css::container::XNameContainer > xTableStyles
Definition: xmlstyli.hxx:118
virtual rtl::Reference< SvXMLImportPropertyMapper > GetImportPropertyMapper(XmlStyleFamily nFamily) const override
Definition: xmlstyli.cxx:695
virtual SvXMLStyleContext * CreateStyleStyleChildContext(XmlStyleFamily nFamily, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: xmlstyli.cxx:614
sal_Int32 GetIndex(const sal_Int16 nContextID)
Definition: xmlstyli.cxx:869
css::uno::Reference< css::container::XNameContainer > xGraphicStyles
Definition: xmlstyli.hxx:119
const ScXMLImport & GetScImport() const
Definition: xmlstyli.hxx:131
rtl::Reference< SvXMLImportPropertyMapper > xCellImpPropMapper
Definition: xmlstyli.hxx:126
rtl::Reference< SvXMLImportPropertyMapper > xColumnImpPropMapper
Definition: xmlstyli.hxx:127
static SvXMLImportPropertyMapper * CreateParaExtPropMapper(SvXMLImport &)
virtual void Finish(bool bOverwrite) override
const css::uno::Reference< css::style::XStyle > & GetStyle() const
virtual void FillPropertySet(const css::uno::Reference< css::beans::XPropertySet > &rPropSet) override
ScConditionMode
Definition: conditio.hxx:60
XmlStyleFamily
constexpr OUStringLiteral XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_NAME
constexpr OUStringLiteral XML_STYLE_FAMILY_TABLE_ROW_STYLES_NAME
constexpr OUStringLiteral XML_STYLE_FAMILY_TABLE_TABLE_STYLES_NAME
OUString sName
sal_Int32 nIndex
Mode eMode
sal_Int64 n
void parseCondition(ScXMLConditionParseResult &rParseResult, const OUString &rAttribute, sal_Int32 nStartIndex)
Parses the next condition in a 'condition' attribute value of e.g.
int i
enumrange< T >::Iterator begin(enumrange< T >)
end
FastAttributeList & castToFastAttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
XML_TABLE_CELL_PROPERTIES
XML_MASTER_PAGE_NAME
XML_MASTER_PAGE
XML_DATA_STYLE_NAME
XML_MAP
sal_uIntPtr sal_uLong
Result of an attempt to parse a single condition in a 'condition' attribute value of e....
OUString maOperand2
First operand of the token or comparison value.
OUString maOperand1
A comparison operator if existing.
css::sheet::ConditionOperator meOperator
A data validation type if existing.
css::uno::Any maValue
sal_Int32 mnIndex
sal_Int16 SCTAB
Definition: types.hxx:22
constexpr OUStringLiteral SC_UNO_PAGE_RIGHTFTRCON
Definition: unonames.hxx:459
constexpr OUStringLiteral SC_UNO_PAGE_RIGHTHDRCON
Definition: unonames.hxx:458
#define XMLOFF_WARN_UNKNOWN(area, rIter)
#define XML_ELEMENT(prefix, name)
constexpr sal_Int32 TOKEN_MASK
#define CTF_SC_ALLPADDING
Definition: xmlstyle.hxx:60
#define CTF_SC_ROWHEIGHT
Definition: xmlstyle.hxx:89
#define CTF_SC_DIAGONALTLBRWIDTHS
Definition: xmlstyle.hxx:86
#define CTF_SC_LEFTBORDERWIDTH
Definition: xmlstyle.hxx:71
#define CTF_SC_TOPPADDING
Definition: xmlstyle.hxx:64
#define CTF_SC_NUMBERFORMAT
Definition: xmlstyle.hxx:75
#define CTF_SC_ROWOPTIMALHEIGHT
Definition: xmlstyle.hxx:90
#define CTF_SC_TOPBORDERWIDTH
Definition: xmlstyle.hxx:73
#define CTF_SC_DIAGONALBLTRWIDTH
Definition: xmlstyle.hxx:85
#define CTF_SC_ALLBORDERWIDTH
Definition: xmlstyle.hxx:70
#define CTF_SC_DIAGONALTLBRWIDTH
Definition: xmlstyle.hxx:83
#define CTF_SC_BOTTOMPADDING
Definition: xmlstyle.hxx:61
#define CTF_SC_MASTERPAGENAME
Definition: xmlstyle.hxx:94
#define CTF_SC_DIAGONALBLTRWIDTHS
Definition: xmlstyle.hxx:87
#define CTF_SC_RIGHTBORDER
Definition: xmlstyle.hxx:67
#define CTF_SC_IMPORT_MAP
Definition: xmlstyle.hxx:79
#define CTF_SC_BOTTOMBORDERWIDTH
Definition: xmlstyle.hxx:74
#define CTF_SC_CELLSTYLE
Definition: xmlstyle.hxx:80
#define CTF_SC_ALLBORDER
Definition: xmlstyle.hxx:65
#define CTF_SC_RIGHTBORDERWIDTH
Definition: xmlstyle.hxx:72
#define CTF_SC_DIAGONALTLBR
Definition: xmlstyle.hxx:82
#define CTF_SC_DIAGONALBLTR
Definition: xmlstyle.hxx:84
#define CTF_SC_RIGHTPADDING
Definition: xmlstyle.hxx:63
#define CTF_SC_TOPBORDER
Definition: xmlstyle.hxx:68
#define CTF_SC_BOTTOMBORDER
Definition: xmlstyle.hxx:69
#define CTF_SC_ROWBREAKBEFORE
Definition: xmlstyle.hxx:91
#define CTF_SC_LEFTPADDING
Definition: xmlstyle.hxx:62
#define CTF_SC_LEFTBORDER
Definition: xmlstyle.hxx:66
#define XML_LINE_TLBR
Definition: xmlstyli.cxx:56
#define XML_LINE_TOP
Definition: xmlstyli.cxx:53
#define XML_LINE_BOTTOM
Definition: xmlstyli.cxx:54
#define XML_LINE_RIGHT
Definition: xmlstyli.cxx:52
constexpr OUStringLiteral gsCellStyleServiceName(u"com.sun.star.style.CellStyle")
constexpr OUStringLiteral gsGraphicStyleServiceName(u"com.sun.star.style.GraphicStyle")
#define XML_LINE_BLTR
Definition: xmlstyli.cxx:57
#define XML_LINE_LEFT
Definition: xmlstyli.cxx:51
#define XML_TYPE_PROP_TABLE_CELL