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