LibreOffice Module sc (master) 1
xmlcelli.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 <limits>
21#include <memory>
22#include "xmlcelli.hxx"
23#include "xmlimprt.hxx"
24#include "xmlannoi.hxx"
25#include <global.hxx>
26#include <cellvalue.hxx>
27#include <document.hxx>
28#include <docuno.hxx>
29#include <postit.hxx>
30#include <sheetdata.hxx>
31#include <cellform.hxx>
32#include <validat.hxx>
33#include <patattr.hxx>
34#include <scitems.hxx>
35#include <docpool.hxx>
36
41
42#include <arealink.hxx>
43#include <sfx2/linkmgr.hxx>
44#include <scerrors.hxx>
45#include <editutil.hxx>
46#include <formulacell.hxx>
47#include "editattributemap.hxx"
48#include <tokenarray.hxx>
49#include <scmatrix.hxx>
50#include <stringutil.hxx>
51#include <documentimport.hxx>
52#include <externalrefmgr.hxx>
53
54#include <xmloff/maptype.hxx>
55#include <xmloff/xmltoken.hxx>
56#include <xmloff/xmlprmap.hxx>
57#include <xmloff/xmluconv.hxx>
58#include <xmloff/families.hxx>
60#include <xmloff/prstylei.hxx>
61#include <xmloff/xmlimppr.hxx>
62#include <svl/numformat.hxx>
63#include <svl/zforlist.hxx>
64#include <svx/svdocapt.hxx>
65#include <editeng/eeitem.hxx>
66#include <editeng/outlobj.hxx>
67#include <editeng/wghtitem.hxx>
68#include <editeng/colritem.hxx>
69#include <editeng/fhgtitem.hxx>
70#include <editeng/postitem.hxx>
71#include <editeng/flditem.hxx>
72#include <editeng/fontitem.hxx>
73#include <editeng/udlnitem.hxx>
74#include <editeng/wrlmitem.hxx>
79#include <editeng/shdditem.hxx>
80#include <editeng/kernitem.hxx>
84#include <editeng/langitem.hxx>
87#include <sax/fastattribs.hxx>
88
89#include <com/sun/star/util/NumberFormat.hpp>
90
91#include <com/sun/star/sheet/ValidationType.hpp>
92#include <com/sun/star/sheet/ValidationAlertStyle.hpp>
93
94#include <rtl/ustrbuf.hxx>
95#include <osl/diagnose.h>
96#include <sal/log.hxx>
97#include <i18nlangtag/lang.h>
98
100#include <comphelper/lok.hxx>
101
102using namespace com::sun::star;
103using namespace xmloff::token;
104
106 maItemSet(rEditEngine.GetEmptyItemSet()) {}
107
108ScXMLTableRowCellContext::Field::Field(std::unique_ptr<SvxFieldData> pData) : mpData(std::move(pData)) {}
109
111{
112}
113
116 const bool bTempIsCovered,
117 const sal_Int32 nTempRepeatedRows ) :
118 ScXMLImportContext( rImport ),
119 mpEditEngine(GetScImport().GetEditEngine()),
121 fValue(std::numeric_limits<double>::quiet_NaN()),
122 nMergedRows(1),
123 nMatrixRows(0),
124 nRepeatedRows(nTempRepeatedRows),
125 nMergedCols(1),
126 nMatrixCols(0),
127 nColsRepeated(1),
128 rXMLImport(rImport),
129 eGrammar( formula::FormulaGrammar::GRAM_STORAGE_DEFAULT),
130 nCellType(util::NumberFormat::TEXT),
131 bIsMerged(false),
132 bIsMatrix(false),
133 bIsCovered(bTempIsCovered),
134 bIsEmpty(true),
135 mbNewValueType(false),
136 mbErrorValue(false),
137 bSolarMutexLocked(false),
138 bFormulaTextResult(false),
139 mbPossibleErrorCell(false),
141 mbEditEngineHasText(false),
142 mbHasFormatRuns(false),
143 mbHasStyle(false),
145{
146 rXMLImport.GetTables().AddColumn(bTempIsCovered);
147
148 std::optional<OUString> xStyleName;
149 std::optional<OUString> xCurrencySymbol;
150 if ( rAttrList.is() )
151 {
152 for (auto &it : *rAttrList)
153 {
154 switch ( it.getToken() )
155 {
157 xStyleName = it.toString();
158 mbHasStyle = true;
159 break;
161 OSL_ENSURE(!maContentValidationName, "here should be only one Validation Name");
162 if (!it.isEmpty())
163 maContentValidationName = it.toString();
164 break;
166 bIsMerged = true;
167 nMergedRows = static_cast<SCROW>(it.toInt32());
168 break;
170 bIsMerged = true;
171 nMergedCols = static_cast<SCCOL>(it.toInt32());
172 break;
174 bIsMatrix = true;
175 nMatrixCols = static_cast<SCCOL>(it.toInt32());
176 break;
178 bIsMatrix = true;
179 nMatrixRows = static_cast<SCROW>(it.toInt32());
180 break;
182 nColsRepeated = static_cast<SCCOL>(
183 std::min<sal_Int32>( rImport.GetDocument()->GetSheetLimits().GetMaxColCount(),
184 std::max( it.toInt32(), static_cast<sal_Int32>(1) ) ));
185 break;
187 nCellType = ScXMLImport::GetCellType(it.toCString(), it.getLength());
188 bIsEmpty = false;
189 break;
190 case XML_ELEMENT( CALC_EXT, XML_VALUE_TYPE ):
191 if(it.isString( "error" ) )
192 mbErrorValue = true;
193 else
194 nCellType = ScXMLImport::GetCellType(it.toCString(), it.getLength());
195 bIsEmpty = false;
196 mbNewValueType = true;
197 break;
199 {
200 if (!it.isEmpty())
201 {
202 fValue = it.toDouble();
203 bIsEmpty = false;
204
205 //if office:value="0", let's get the text:p in case this is
206 //a special case in HasSpecialCaseFormulaText(). If it
207 //turns out not to be a special case, we'll use the 0 value.
208 if(fValue == 0.0)
209 bFormulaTextResult = true;
210 }
211 }
212 break;
214 {
215 if (!it.isEmpty() && rXMLImport.SetNullDateOnUnitConverter())
216 {
217 rXMLImport.GetMM100UnitConverter().convertDateTime(fValue, it.toView());
218 bIsEmpty = false;
219 }
220 }
221 break;
223 {
224 if (!it.isEmpty())
225 {
227 bIsEmpty = false;
228 }
229 }
230 break;
232 {
233 if (!it.isEmpty())
234 {
235 OSL_ENSURE(!maStringValue, "here should be only one string value");
236 maStringValue = it.toString();
237 bIsEmpty = false;
238 }
239 }
240 break;
242 {
243 if (!it.isEmpty())
244 {
245 if ( IsXMLToken( it, XML_TRUE ) )
246 fValue = 1.0;
247 else if ( IsXMLToken( it, XML_FALSE ) )
248 fValue = 0.0;
249 else
250 fValue = it.toDouble();
251 bIsEmpty = false;
252 }
253 }
254 break;
256 {
257 if (!it.isEmpty())
258 {
259 OSL_ENSURE(!maFormula, "here should be only one formula");
260 OUString aFormula, aFormulaNmsp;
261 rXMLImport.ExtractFormulaNamespaceGrammar( aFormula, aFormulaNmsp, eGrammar, it.toString() );
262 maFormula = FormulaWithNamespace(aFormula, aFormulaNmsp);
263 }
264 }
265 break;
267 xCurrencySymbol = it.toString();
268 break;
269 default:
270 ;
271 }
272 }
273 }
274
275 if (maFormula)
276 {
277 if (nCellType == util::NumberFormat::TEXT)
278 bFormulaTextResult = true;
279 if(nCellType == util::NumberFormat::DATETIME)
280 nCellType = util::NumberFormat::UNDEFINED;
281 //if bIsEmpty is true at this point, then there is no office value.
282 //we must get the text:p (even if it is empty) in case this a special
283 //case in HasSpecialCaseFormulaText().
284 if(bIsEmpty)
285 bFormulaTextResult = true;
286 }
287 rXMLImport.GetStylesImportHelper()->SetAttributes(std::move(xStyleName), std::move(xCurrencySymbol), nCellType);
288}
289
291{
292}
293
295{
297 {
299 bSolarMutexLocked = true;
300 }
301}
302
303namespace {
304
305bool cellExists( const ScDocument& rDoc, const ScAddress& rCellPos )
306{
307 return( rCellPos.Col() >= 0 && rCellPos.Row() >= 0 &&
308 rCellPos.Col() <= rDoc.MaxCol() && rCellPos.Row() <= rDoc.MaxRow() );
309}
310
311}
312
313void ScXMLTableRowCellContext::PushParagraphSpan(std::u16string_view rSpan, const OUString& rStyleName)
314{
315 sal_Int32 nBegin = maParagraph.getLength();
316 sal_Int32 nEnd = nBegin + rSpan.size();
317 maParagraph.append(rSpan);
318
319 PushFormat(nBegin, nEnd, rStyleName);
320}
321
322void ScXMLTableRowCellContext::PushParagraphField(std::unique_ptr<SvxFieldData> pData, const OUString& rStyleName)
323{
324 mbHasFormatRuns = true;
325 maFields.push_back(std::make_unique<Field>(std::move(pData)));
326 Field& rField = *maFields.back();
327
328 sal_Int32 nPos = maParagraph.getLength();
329 maParagraph.append('\1'); // Placeholder text for inserted field item.
332 rField.maSelection.nStartPos = nPos;
333 rField.maSelection.nEndPos = nPos+1;
334
335 PushFormat(nPos, nPos+1, rStyleName);
336}
337
338void ScXMLTableRowCellContext::PushFormat(sal_Int32 nBegin, sal_Int32 nEnd, const OUString& rStyleName)
339{
340 if (rStyleName.isEmpty())
341 return;
342
343 // Get the style information from xmloff.
344 rtl::Reference<XMLPropertySetMapper> xMapper = GetImport().GetTextImport()->GetTextImportPropertySetMapper()->getPropertySetMapper();
345 if (!xMapper.is())
346 // We can't do anything without the mapper.
347 return;
348
349 sal_Int32 nEntryCount = xMapper->GetEntryCount();
350
351 SvXMLStylesContext* pAutoStyles = GetImport().GetAutoStyles();
352 if (!pAutoStyles)
353 return;
354
355 // Style name for text span corresponds with the name of an automatic style.
356 const XMLPropStyleContext* pStyle = dynamic_cast<const XMLPropStyleContext*>(
357 pAutoStyles->FindStyleChildContext(XmlStyleFamily::TEXT_TEXT, rStyleName));
358
359 if (!pStyle)
360 // No style by that name found.
361 return;
362
363 const std::vector<XMLPropertyState>& rProps = pStyle->GetProperties();
364 if (rProps.empty())
365 return;
366
367 const ScXMLEditAttributeMap& rEditAttrMap = GetScImport().GetEditAttributeMap();
368
369 mbHasFormatRuns = true;
370 maFormats.push_back(std::make_unique<ParaFormat>(*mpEditEngine));
371 ParaFormat& rFmt = *maFormats.back();
373 rFmt.maSelection.nStartPos = nBegin;
374 rFmt.maSelection.nEndPos = nEnd;
375
376 // Store the used text styles for export.
377 ScSheetSaveData* pSheetData = comphelper::getFromUnoTunnel<ScModelObj>(rXMLImport.GetModel())->GetSheetSaveData();
379 pSheetData->AddTextStyle(rStyleName, aCellPos, rFmt.maSelection);
380
381 std::unique_ptr<SfxPoolItem> pPoolItem;
382 sal_uInt16 nLastItemID = EE_CHAR_END + 1;
383
384 for (const auto& rProp : rProps)
385 {
386 if (rProp.mnIndex == -1 || rProp.mnIndex >= nEntryCount)
387 continue;
388
389 const OUString& rName = xMapper->GetEntryAPIName(rProp.mnIndex);
390 const ScXMLEditAttributeMap::Entry* pEntry = rEditAttrMap.getEntryByAPIName(rName);
391 if (!pEntry)
392 continue;
393
394 if (nLastItemID != pEntry->mnItemID && pPoolItem)
395 {
396 // Flush the last item when the item ID changes.
397 rFmt.maItemSet.Put(std::move(pPoolItem));
398 }
399
400 switch (pEntry->mnItemID)
401 {
402 case EE_CHAR_FONTINFO:
405 {
406 // Font properties need to be consolidated into a single item.
407 if (!pPoolItem)
408 pPoolItem.reset(new SvxFontItem(pEntry->mnItemID));
409
410 pPoolItem->PutValue(rProp.maValue, pEntry->mnFlag);
411 }
412 break;
413 case EE_CHAR_WEIGHT:
416 {
417 if (!pPoolItem)
418 pPoolItem.reset(new SvxWeightItem(WEIGHT_NORMAL, pEntry->mnItemID));
419
420 pPoolItem->PutValue(rProp.maValue, pEntry->mnFlag);
421 }
422 break;
426 {
427 if (!pPoolItem)
428 pPoolItem.reset(new SvxFontHeightItem(240, 100, pEntry->mnItemID));
429
430 pPoolItem->PutValue(rProp.maValue, pEntry->mnFlag);
431 }
432 break;
433 case EE_CHAR_ITALIC:
436 {
437 if (!pPoolItem)
438 pPoolItem.reset(new SvxPostureItem(ITALIC_NONE, pEntry->mnItemID));
439
440 pPoolItem->PutValue(rProp.maValue, pEntry->mnFlag);
441 }
442 break;
444 {
445 if (!pPoolItem)
446 pPoolItem.reset(new SvxUnderlineItem(LINESTYLE_NONE, pEntry->mnItemID));
447
448 pPoolItem->PutValue(rProp.maValue, pEntry->mnFlag);
449 }
450 break;
451 case EE_CHAR_OVERLINE:
452 {
453 if (!pPoolItem)
454 pPoolItem.reset(new SvxOverlineItem(LINESTYLE_NONE, pEntry->mnItemID));
455
456 pPoolItem->PutValue(rProp.maValue, pEntry->mnFlag);
457 }
458 break;
459 case EE_CHAR_COLOR:
460 {
461 if (!pPoolItem)
462 pPoolItem.reset(new SvxColorItem(pEntry->mnItemID));
463
464 pPoolItem->PutValue(rProp.maValue, pEntry->mnFlag);
465 }
466 break;
467 case EE_CHAR_WLM:
468 {
469 if (!pPoolItem)
470 pPoolItem.reset(new SvxWordLineModeItem(false, pEntry->mnItemID));
471
472 pPoolItem->PutValue(rProp.maValue, pEntry->mnFlag);
473 }
474 break;
476 {
477 if (!pPoolItem)
478 pPoolItem.reset(new SvxCrossedOutItem(STRIKEOUT_NONE, pEntry->mnItemID));
479
480 pPoolItem->PutValue(rProp.maValue, pEntry->mnFlag);
481 }
482 break;
483 case EE_CHAR_RELIEF:
484 {
485 if (!pPoolItem)
486 pPoolItem.reset(new SvxCharReliefItem(FontRelief::NONE, pEntry->mnItemID));
487
488 pPoolItem->PutValue(rProp.maValue, pEntry->mnFlag);
489 }
490 break;
491 case EE_CHAR_OUTLINE:
492 {
493 if (!pPoolItem)
494 pPoolItem.reset(new SvxContourItem(false, pEntry->mnItemID));
495
496 pPoolItem->PutValue(rProp.maValue, pEntry->mnFlag);
497 }
498 break;
499 case EE_CHAR_SHADOW:
500 {
501 if (!pPoolItem)
502 pPoolItem.reset(new SvxShadowedItem(false, pEntry->mnItemID));
503
504 pPoolItem->PutValue(rProp.maValue, pEntry->mnFlag);
505 }
506 break;
507 case EE_CHAR_KERNING:
508 {
509 if (!pPoolItem)
510 pPoolItem.reset(new SvxKerningItem(0, pEntry->mnItemID));
511
512 pPoolItem->PutValue(rProp.maValue, pEntry->mnFlag);
513 }
514 break;
516 {
517 if (!pPoolItem)
518 pPoolItem.reset(new SvxAutoKernItem(false, pEntry->mnItemID));
519
520 pPoolItem->PutValue(rProp.maValue, pEntry->mnFlag);
521 }
522 break;
524 {
525 if (!pPoolItem)
526 pPoolItem.reset(new SvxCharScaleWidthItem(100, TypedWhichId<SvxCharScaleWidthItem>(pEntry->mnItemID)));
527
528 pPoolItem->PutValue(rProp.maValue, pEntry->mnFlag);
529 }
530 break;
532 {
533 if (!pPoolItem)
534 pPoolItem.reset(new SvxEscapementItem(pEntry->mnItemID));
535
536 pPoolItem->PutValue(rProp.maValue, pEntry->mnFlag);
537 }
538 break;
540 {
541 if (!pPoolItem)
542 pPoolItem.reset(new SvxEmphasisMarkItem(FontEmphasisMark::NONE, TypedWhichId<SvxEmphasisMarkItem>(pEntry->mnItemID)));
543
544 pPoolItem->PutValue(rProp.maValue, pEntry->mnFlag);
545 }
546 break;
547 case EE_CHAR_LANGUAGE:
550 {
551 if (!pPoolItem)
552 pPoolItem.reset(new SvxLanguageItem(LANGUAGE_DONTKNOW, pEntry->mnItemID));
553
554 pPoolItem->PutValue(rProp.maValue, pEntry->mnFlag);
555 }
556 break;
557 default:
558 ;
559 }
560
561 nLastItemID = pEntry->mnItemID;
562 }
563
564 if (pPoolItem)
565 rFmt.maItemSet.Put(std::move(pPoolItem));
566}
567
569{
570 if (!maFirstParagraph)
571 return mpEditEngine->GetText(0);
572
573 return *maFirstParagraph;
574}
575
577{
578 PushParagraphField(std::make_unique<SvxDateField>(), rStyleName);
579}
580
582{
584 PushParagraphField(std::make_unique<SvxTableField>(nTab), rStyleName);
585}
586
588{
589 PushParagraphField(std::make_unique<SvxFileField>(), rStyleName);
590}
591
593 const OUString& rURL, const OUString& rRep, const OUString& rStyleName, const OUString& rTargetFrame)
594{
595 OUString aAbsURL = GetScImport().GetAbsoluteReference(rURL);
596 std::unique_ptr<SvxURLField> pURLField(new SvxURLField(aAbsURL, rRep, SvxURLFormat::Repr));
597 pURLField->SetTargetFrame(rTargetFrame);
598 PushParagraphField(std::move(pURLField), rStyleName);
599}
600
602{
603 // EditEngine always has at least one paragraph even when its content is empty.
604
606 {
608 {
609 // Flush the cached first paragraph first.
612 maFirstParagraph.reset();
613 }
615 }
617 {
619 mpEditEngine->SetTextCurrentDefaults(maParagraph.makeStringAndClear());
620 mbEditEngineHasText = true;
621 }
622 else if (mnCurParagraph == 0)
623 {
624 maFirstParagraph = maParagraph.makeStringAndClear();
625 mbEditEngineHasText = true;
626 }
627
629}
630
631uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLTableRowCellContext::createFastChildContext(
632 sal_Int32 nElement, const uno::Reference< xml::sax::XFastAttributeList >& xAttrList )
633{
634 SvXMLImportContext *pContext = nullptr;
637
638 bool bTextP(false);
639 switch (nElement)
640 {
641 case XML_ELEMENT( TEXT, XML_P ):
642 {
643 bIsEmpty = false;
644 bTextP = true;
645
646 pContext = new ScXMLCellTextParaContext(rXMLImport, *this);
647 }
648 break;
650 {
651 SAL_WARN("sc", "ScXMLTableRowCellContext::createFastChildContext: subtables are not supported");
652 }
653 break;
655 {
656 bIsEmpty = false;
657 if (!pDetectiveObjVec)
659 pContext = new ScXMLDetectiveContext(
661 }
662 break;
664 {
665 bIsEmpty = false;
666 if (!pCellRangeSource)
668 pContext = new ScXMLCellRangeSourceContext(
669 rXMLImport, pAttribList, pCellRangeSource.get() );
670 }
671 break;
673 {
674 bIsEmpty = false;
675 OSL_ENSURE(
677 "ScXMLTableRowCellContext::CreateChildContext - multiple annotations in one cell");
679 pContext = new ScXMLAnnotationContext( rXMLImport, nElement,
680 xAttrList, *mxAnnotationData);
681 }
682 break;
683 }
684
685 if (!pContext && !bTextP)
686 {
688 uno::Reference<drawing::XShapes> xShapes (rXMLImport.GetTables().GetCurrentXShapes());
689 if (xShapes.is())
690 {
692 if (aCellPos.Col() > pDoc->MaxCol())
693 aCellPos.SetCol(pDoc->MaxCol());
694 if (aCellPos.Row() > pDoc->MaxRow())
695 aCellPos.SetRow(pDoc->MaxRow());
696 XMLTableShapeImportHelper* pTableShapeImport =
697 static_cast< XMLTableShapeImportHelper* >( rXMLImport.GetShapeImport().get() );
698 pTableShapeImport->SetOnTable(false);
699 pTableShapeImport->SetCell(aCellPos);
701 rXMLImport, nElement, xAttrList, xShapes);
702 if (pContext)
703 {
704 bIsEmpty = false;
706 }
707 }
708 }
709
710 return pContext;
711}
712
713void ScXMLTableRowCellContext::DoMerge( const ScAddress& rScAddress, const SCCOL nCols, const SCROW nRows )
714{
715 SCCOL mergeToCol = rScAddress.Col() + nCols;
716 SCROW mergeToRow = rScAddress.Row() + nRows;
718 bool bInBounds = rScAddress.Col() <= pDoc->MaxCol() && rScAddress.Row() <= pDoc->MaxRow() &&
719 mergeToCol <= pDoc->MaxCol() && mergeToRow <= pDoc->MaxRow();
720 if( bInBounds )
721 {
722 pDoc->DoMerge( rScAddress.Col(), rScAddress.Row(),
723 mergeToCol, mergeToRow, rScAddress.Tab() );
724 }
725}
726
727namespace {
728
729ScValidationMode validationTypeToMode( const sheet::ValidationType eVType )
730{
732 switch( eVType )
733 {
734 case sheet::ValidationType_WHOLE: eMode = SC_VALID_WHOLE; break;
735 case sheet::ValidationType_DECIMAL: eMode = SC_VALID_DECIMAL; break;
736 case sheet::ValidationType_DATE: eMode = SC_VALID_DATE; break;
737 case sheet::ValidationType_TIME: eMode = SC_VALID_TIME; break;
738 case sheet::ValidationType_TEXT_LEN: eMode = SC_VALID_TEXTLEN; break;
739 case sheet::ValidationType_LIST: eMode = SC_VALID_LIST; break;
740 case sheet::ValidationType_CUSTOM: eMode = SC_VALID_CUSTOM; break;
741 default: eMode = SC_VALID_ANY; break;
742 }
743 return eMode;
744}
745
746ScValidErrorStyle validAlertToValidError( const sheet::ValidationAlertStyle eVAlertStyle )
747{
748 ScValidErrorStyle eVErrStyle;
749 switch( eVAlertStyle )
750 {
751 case sheet::ValidationAlertStyle_STOP: eVErrStyle = SC_VALERR_STOP; break;
752 case sheet::ValidationAlertStyle_WARNING: eVErrStyle = SC_VALERR_WARNING; break;
753 case sheet::ValidationAlertStyle_MACRO: eVErrStyle = SC_VALERR_MACRO; break;
754 default: eVErrStyle = SC_VALERR_INFO; break;
755 //should INFO be the default? seems to be the most unobtrusive choice.
756 }
757 return eVErrStyle;
758}
759
760}
761
763{
765 return;
766
768 ScMyImportValidation aValidation;
769 aValidation.eGrammar1 = aValidation.eGrammar2 = pDoc->GetStorageGrammar();
771 return;
772
773 ScValidationData aScValidationData(
774 validationTypeToMode(aValidation.aValidationType),
776 aValidation.sFormula1, aValidation.sFormula2, *pDoc, ScAddress(),
777 aValidation.sFormulaNmsp1, aValidation.sFormulaNmsp2,
778 aValidation.eGrammar1, aValidation.eGrammar2
779 );
780
781 aScValidationData.SetIgnoreBlank( aValidation.bIgnoreBlanks );
782 aScValidationData.SetListType( aValidation.nShowList );
783
784 // set strings for error / input even if disabled (and disable afterwards)
785 aScValidationData.SetInput( aValidation.sInputTitle, aValidation.sInputMessage );
786 if( !aValidation.bShowInputMessage )
787 aScValidationData.ResetInput();
788 aScValidationData.SetError( aValidation.sErrorTitle, aValidation.sErrorMessage, validAlertToValidError(aValidation.aAlertStyle) );
789 if( !aValidation.bShowErrorMessage )
790 aScValidationData.ResetError();
791
792 if( !aValidation.sBaseCellAddress.isEmpty() )
793 aScValidationData.SetSrcString( aValidation.sBaseCellAddress );
794
795 sal_uInt32 nIndex = pDoc->AddValidationEntry( aScValidationData );
796
797 ScPatternAttr aPattern( pDoc->GetPool() );
799 if( rScRange.aStart == rScRange.aEnd ) //for a single cell
800 {
801 pDoc->ApplyPattern( rScRange.aStart.Col(), rScRange.aStart.Row(),
802 rScRange.aStart.Tab(), aPattern );
803 }
804 else //for repeating cells
805 {
806 pDoc->ApplyPatternAreaTab( rScRange.aStart.Col(), rScRange.aStart.Row(),
807 rScRange.aEnd.Col(), rScRange.aEnd.Row(),
808 rScRange.aStart.Tab(), aPattern );
809 }
810
811 // is the below still needed?
812 // For now, any sheet with validity is blocked from stream-copying.
813 // Later, the validation names could be stored along with the style names.
814 ScSheetSaveData* pSheetData = comphelper::getFromUnoTunnel<ScModelObj>(GetImport().GetModel())->GetSheetSaveData();
815 pSheetData->BlockSheet( GetScImport().GetTables().GetCurrentSheet() );
816}
817
819{
820 SetContentValidation( ScRange(rCellPos, rCellPos) );
821}
822
824{
826 if (!pDoc || !mxAnnotationData)
827 return;
828
830
831 ScPostIt* pNote = nullptr;
832
833 uno::Reference< drawing::XShapes > xShapes = rXMLImport.GetTables().GetCurrentXShapes();
834 sal_Int32 nOldShapeCount = xShapes.is() ? xShapes->getCount() : 0;
835
836 OSL_ENSURE( !mxAnnotationData->mxShape.is() || mxAnnotationData->mxShapes.is(),
837 "ScXMLTableRowCellContext::SetAnnotation - shape without drawing page" );
838 if( mxAnnotationData->mxShape.is() && mxAnnotationData->mxShapes.is() )
839 {
840 OSL_ENSURE( mxAnnotationData->mxShapes.get() == xShapes.get(), "ScXMLTableRowCellContext::SetAnnotation - different drawing pages" );
841
842 /* Don't attempt to get the style from the SdrObject,
843 as it might be a default assigned one. */
844 auto pStyle = rXMLImport.GetShapeImport()->GetAutoStylesContext()->FindStyleChildContext(
845 XmlStyleFamily::SD_GRAPHICS_ID, mxAnnotationData->maStyleName);
846 OUString aStyleName = pStyle ? pStyle->GetParentName() : mxAnnotationData->maStyleName;
847 assert(!rXMLImport.GetShapeImport()->GetAutoStylesContext()->FindStyleChildContext(
848 XmlStyleFamily::SD_GRAPHICS_ID, aStyleName));
849 aStyleName = rXMLImport.GetStyleDisplayName(XmlStyleFamily::SD_GRAPHICS_ID, aStyleName);
850
852 OSL_ENSURE( pObject, "ScXMLTableRowCellContext::SetAnnotation - cannot get SdrObject from shape" );
853
854 /* Try to reuse the drawing object already created (but only if the
855 note is visible, and the object is a caption object). */
857 {
858 if( SdrCaptionObj* pCaption = dynamic_cast< SdrCaptionObj* >( pObject ) )
859 {
860 OSL_ENSURE( !pCaption->GetLogicRect().IsEmpty(), "ScXMLTableRowCellContext::SetAnnotation - invalid caption rectangle" );
861 // create the cell note with the caption object
862 pNote = ScNoteUtil::CreateNoteFromCaption( *pDoc, rPos, pCaption, !aStyleName.isEmpty() );
863 // forget pointer to object (do not create note again below)
864 pObject = nullptr;
865 }
866 }
867
868 // drawing object has not been used to create a note -> use shape data
869 if( pObject )
870 {
871 // rescue settings from drawing object before the shape is removed
872 SfxItemSet aItemSet( pObject->GetMergedItemSet() );
874 if (auto p = pObject->GetOutlinerParaObject())
875 pOutlinerObj = *p;
876 tools::Rectangle aCaptionRect;
877 if( mxAnnotationData->mbUseShapePos )
878 aCaptionRect = pObject->GetLogicRect();
879 // remove the shape from the drawing page, this invalidates pObject
880 mxAnnotationData->mxShapes->remove( mxAnnotationData->mxShape );
881 pObject = nullptr;
882 // update current number of existing objects
883 if( xShapes.is() )
884 nOldShapeCount = xShapes->getCount();
885
886 // an outliner object is required (empty note captions not allowed)
887 if (pOutlinerObj)
888 {
889 // create cell note with all data from drawing object
891 {
892 pNote = ScNoteUtil::CreateNoteFromObjectData( *pDoc, rPos,
893 std::move(aItemSet), aStyleName, *pOutlinerObj,
894 aCaptionRect, mxAnnotationData->mbShown );
895 }
896 else
897 {
898 pNote = ScNoteUtil::CreateNoteFromObjectData( *pDoc, rPos,
899 std::move(aItemSet), aStyleName, *pOutlinerObj,
900 aCaptionRect, false );
901 }
902
903 }
904 }
905 }
906 else if( !mxAnnotationData->maSimpleText.isEmpty() )
907 {
908 // create note from simple text
909 pNote = ScNoteUtil::CreateNoteFromString( *pDoc, rPos,
910 mxAnnotationData->maSimpleText, mxAnnotationData->mbShown, false );
911 }
912
913 // set author and date
914 if( pNote )
915 {
916 double fDate;
917 if (rXMLImport.GetMM100UnitConverter().convertDateTime(fDate, mxAnnotationData->maCreateDate))
918 {
919 SvNumberFormatter* pNumForm = pDoc->GetFormatTable();
920 sal_uInt32 nfIndex = pNumForm->GetFormatIndex( NF_DATE_SYS_DDMMYYYY, LANGUAGE_SYSTEM );
921 OUString aDate;
922 const Color* pColor = nullptr;
923 pNumForm->GetOutputString( fDate, nfIndex, aDate, &pColor );
924 pNote->SetDate( aDate );
925 }
926 pNote->SetAuthor( mxAnnotationData->maAuthor );
927 }
928
929 // register a shape that has been newly created in the ScNoteUtil functions
930 if( xShapes.is() && (nOldShapeCount < xShapes->getCount()) )
931 {
932 uno::Reference< drawing::XShape > xShape;
933 rXMLImport.GetShapeImport()->shapeWithZIndexAdded( xShape, xShapes->getCount() );
934 }
935
936 // store the style names for stream copying
937 ScSheetSaveData* pSheetData = comphelper::getFromUnoTunnel<ScModelObj>(rXMLImport.GetModel())->GetSheetSaveData();
938 pSheetData->HandleNoteStyles( mxAnnotationData->maStyleName, mxAnnotationData->maTextStyle, rPos );
939
940 for (const auto& rContentStyle : mxAnnotationData->maContentStyles)
941 {
942 pSheetData->AddNoteContentStyle( rContentStyle.mnFamily, rContentStyle.maName, rPos, rContentStyle.maSelection );
943 }
944}
945
946// core implementation
948{
950 if( !pDoc || !cellExists(*pDoc, rPosition) || !pDetectiveObjVec || pDetectiveObjVec->empty() )
951 return;
952
954 ScDetectiveFunc aDetFunc( *pDoc, rPosition.Tab() );
955 uno::Reference<container::XIndexAccess> xShapesIndex = rXMLImport.GetTables().GetCurrentXShapes(); // make draw page
956 for(const auto& rDetectiveObj : *pDetectiveObjVec)
957 {
958 aDetFunc.InsertObject( rDetectiveObj.eObjType, rPosition, rDetectiveObj.aSourceRange, rDetectiveObj.bHasError );
959 if (xShapesIndex.is())
960 {
961 sal_Int32 nShapes = xShapesIndex->getCount();
962 uno::Reference < drawing::XShape > xShape;
963 rXMLImport.GetShapeImport()->shapeWithZIndexAdded(xShape, nShapes);
964 }
965 }
966}
967
968// core implementation
970{
972 if( !pDoc || !cellExists(*pDoc, rPosition) || !pCellRangeSource || pCellRangeSource->sSourceStr.isEmpty() ||
973 pCellRangeSource->sFilterName.isEmpty() || pCellRangeSource->sURL.isEmpty() )
974 return;
975
977 ScRange aDestRange( rPosition.Col(), rPosition.Row(), rPosition.Tab(),
978 rPosition.Col() + static_cast<SCCOL>(pCellRangeSource->nColumns - 1),
979 rPosition.Row() + static_cast<SCROW>(pCellRangeSource->nRows - 1), rPosition.Tab() );
980 OUString sFilterName( pCellRangeSource->sFilterName );
981 OUString sSourceStr( pCellRangeSource->sSourceStr );
983 sFilterName, pCellRangeSource->sFilterOptions, sSourceStr, aDestRange, pCellRangeSource->nRefresh );
984 sfx2::LinkManager* pLinkManager = pDoc->GetLinkManager();
985 pLinkManager->InsertFileLink( *pLink, sfx2::SvBaseLinkObjectType::ClientFile, pCellRangeSource->sURL, &sFilterName, &sSourceStr );
986}
987
989{
990 if(!pFCell)
991 return;
992
993 bool bMayForceNumberformat = true;
994
995 if(mbErrorValue)
996 {
997 // don't do anything here
998 // we need to recalc anyway
999 }
1000 else if( bFormulaTextResult && maStringValue )
1001 {
1002 if( !IsPossibleErrorString() )
1003 {
1006 pFCell->ResetDirty();
1007 // A General format doesn't force any other format for a string
1008 // result, don't attempt to recalculate this later.
1009 bMayForceNumberformat = false;
1010 }
1011 }
1012 else if (std::isfinite(fValue))
1013 {
1014 pFCell->SetHybridDouble(fValue);
1015 if (mbPossibleEmptyDisplay && fValue == 0.0)
1016 {
1017 // Needs to be recalculated to propagate, otherwise would be
1018 // propagated as empty string. So don't ResetDirty().
1020 }
1021 else
1022 pFCell->ResetDirty();
1023 }
1024
1025 if (bMayForceNumberformat)
1026 // Re-calculate to get number format only when style is not set.
1028}
1029
1031 const SCCOL nCurrentCol, const ::std::optional< OUString >& pOUText )
1032{
1034 bool bDoIncrement = true;
1035 //matrix reference cells that contain text formula results;
1036 //cell was already put in document, just need to set text here.
1037 if( pDoc && rXMLImport.GetTables().IsPartOfMatrix(rCurrentPos) )
1038 {
1039 ScRefCellValue aCell(*pDoc, rCurrentPos);
1040 bDoIncrement = aCell.getType() == CELLTYPE_FORMULA;
1041 if ( bDoIncrement )
1042 {
1043 ScFormulaCell* pFCell = aCell.getFormula();
1044 OUString aCellString;
1045 if (maStringValue)
1046 aCellString = *maStringValue;
1047 else if (mbEditEngineHasText)
1048 aCellString = GetFirstParagraph();
1049 else if ( nCurrentCol > 0 && pOUText && !pOUText->isEmpty() )
1050 aCellString = *pOUText;
1051 else
1052 bDoIncrement = false;
1053
1054 if(mbErrorValue)
1055 bDoIncrement = false;
1056
1057 if(!aCellString.isEmpty())
1058 {
1059 if (bDoIncrement && !IsPossibleErrorString() && pFCell)
1060 {
1061 pFCell->SetHybridString(pDoc->GetSharedStringPool().intern(aCellString));
1062 pFCell->ResetDirty();
1063 }
1064 else
1065 {
1066 ScAddress aTopLeftMatrixCell;
1067 if (pFCell && pFCell->GetMatrixOrigin(*pDoc, aTopLeftMatrixCell))
1068 {
1069 ScFormulaCell* pMatrixCell = pDoc->GetFormulaCell(aTopLeftMatrixCell);
1070 if (pMatrixCell)
1071 pMatrixCell->SetDirty();
1072 }
1073 else
1074 SAL_WARN("sc", "matrix cell without matrix");
1075 }
1076 }
1077 }
1078 }
1079 else //regular text cells
1080 {
1082 if (maStringValue)
1083 {
1084 rDoc.setStringCell(rCurrentPos, *maStringValue);
1085 bDoIncrement = true;
1086 }
1087 else if (mbEditEngineHasText)
1088 {
1089 if (maFirstParagraph)
1090 {
1091 // This is a normal text without format runs.
1092 rDoc.setStringCell(rCurrentPos, *maFirstParagraph);
1093 }
1094 else
1095 {
1096 // This text either has format runs, has field(s), or consists of multiple lines.
1097 for (const auto& rxFormat : maFormats)
1098 mpEditEngine->QuickSetAttribs(rxFormat->maItemSet, rxFormat->maSelection);
1099
1100 for (const auto& rxField : maFields)
1101 mpEditEngine->QuickInsertField(SvxFieldItem(*rxField->mpData, EE_FEATURE_FIELD), rxField->maSelection);
1102
1103 // This edit engine uses the SfxItemPool instance returned
1104 // from pDoc->GetEditPool() to create the text object, which
1105 // is a prerequisite for using this constructor of ScEditCell.
1106 rDoc.setEditCell(rCurrentPos, mpEditEngine->CreateTextObject());
1107 }
1108 bDoIncrement = true;
1109 }
1110 else if ( nCurrentCol > 0 && pOUText && !pOUText->isEmpty() )
1111 {
1112 rDoc.setStringCell(rCurrentPos, *pOUText);
1113 bDoIncrement = true;
1114 }
1115 else
1116 bDoIncrement = false;
1117 }
1118
1119 // #i56027# This is about setting simple text, not edit cells,
1120 // so ProgressBarIncrement must be called with bEditCell = FALSE.
1121 // Formatted text that is put into the cell by the child context
1122 // is handled in AddCellsToTable() (bIsEmpty is true then).
1123 if (bDoIncrement)
1125}
1126
1128{
1129 //matrix reference cells that contain value formula results;
1130 //cell was already put in document, just need to set value here.
1131 if( rXMLImport.GetTables().IsPartOfMatrix(rCurrentPos) )
1132 {
1133 ScRefCellValue aCell(*rXMLImport.GetDocument(), rCurrentPos);
1134 if (aCell.getType() == CELLTYPE_FORMULA)
1135 {
1136 ScFormulaCell* pFCell = aCell.getFormula();
1137 SetFormulaCell(pFCell);
1138 if (pFCell)
1139 pFCell->SetNeedNumberFormat( true );
1140 }
1141 }
1142 else //regular value cell
1143 {
1144 // fdo#62250 absent values are not NaN, set to 0.0
1145 // PutValueCell() is called only for a known cell value type,
1146 // bIsEmpty==false in all these cases, no sense to check it here.
1147 if (!std::isfinite( fValue))
1148 fValue = 0.0;
1149
1150 // #i62435# Initialize the value cell's script type if the default
1151 // style's number format is latin-only. If the cell uses a different
1152 // format, the script type will be reset when the style is applied.
1153
1154 rXMLImport.GetDoc().setNumericCell(rCurrentPos, fValue);
1155 }
1157}
1158
1159namespace {
1160
1161bool isEmptyOrNote( const ScDocument* pDoc, const ScAddress& rCurrentPos )
1162{
1163 CellType eType = pDoc->GetCellType(rCurrentPos);
1164 return (eType == CELLTYPE_NONE);
1165}
1166
1167}
1168
1170 const ::std::optional< OUString >& pOUText, ScAddress& rCurrentPos )
1171{
1173 ScMyTables& rTables = rXMLImport.GetTables();
1174 bool bWasEmpty = bIsEmpty;
1175 for (SCCOL i = 0; i < nColsRepeated; ++i)
1176 {
1177 rCurrentPos.SetCol( rCellPos.Col() + i );
1178
1179 // it makes no sense to import data after the last supported column
1180 // fdo#58539 & gnome#627150
1181 if(rCurrentPos.Col() > pDoc->MaxCol())
1182 {
1184 break;
1185 }
1186
1187 if (i > 0)
1188 rTables.AddColumn(false);
1189 if (!bIsEmpty)
1190 {
1191 for (SCROW j = 0; j < nRepeatedRows; ++j)
1192 {
1193 rCurrentPos.SetRow( rCellPos.Row() + j );
1194
1195 // it makes no sense to import data after last supported row
1196 // fdo#58539 & gnome#627150
1197 if(rCurrentPos.Row() > pDoc->MaxRow())
1198 {
1200 break;
1201 }
1202
1203 if( (rCurrentPos.Col() == 0) && (j > 0) )
1204 {
1205 rTables.AddRow();
1206 rTables.AddColumn(false);
1207 }
1208 if( cellExists(*pDoc, rCurrentPos) )
1209 {
1210 if( !bIsCovered || isEmptyOrNote(pDoc, rCurrentPos) )
1211 {
1212 switch (nCellType)
1213 {
1214 case util::NumberFormat::TEXT:
1215 {
1216 PutTextCell( rCurrentPos, i, pOUText );
1217 }
1218 break;
1219 case util::NumberFormat::NUMBER:
1221 case util::NumberFormat::CURRENCY:
1222 case util::NumberFormat::TIME:
1223 case util::NumberFormat::DATETIME:
1224 case util::NumberFormat::LOGICAL:
1225 {
1226 PutValueCell( rCurrentPos );
1227 }
1228 break;
1229 default:
1230 {
1231 OSL_FAIL("no cell type given");
1232 }
1233 break;
1234 }
1235 }
1236
1237 SetAnnotation( rCurrentPos );
1238 SetDetectiveObj( rCurrentPos );
1239 SetCellRangeSource( rCurrentPos );
1240 }
1241 else
1242 {
1243 if (!bWasEmpty || mxAnnotationData)
1244 {
1245 if (rCurrentPos.Row() > pDoc->MaxRow())
1247 else
1249 }
1250 }
1251 }
1252 }
1253 else
1254 {
1255 if ((i == 0) && (rCellPos.Col() == 0))
1256 {
1257 for (sal_Int32 j = 1; j < nRepeatedRows; ++j)
1258 {
1259 rTables.AddRow();
1260 rTables.AddColumn(false);
1261 }
1262 }
1263 }
1264 }
1265}
1266
1268{
1269 return ( (nColsRepeated > 1) || (nRepeatedRows > 1) );
1270}
1271
1272namespace {
1273
1274// from ScCellObj::GetOutputString_Imp(). all of it may not be necessary.
1275OUString getOutputString( ScDocument* pDoc, const ScAddress& aCellPos )
1276{
1277 if (!pDoc)
1278 return OUString();
1279
1280 ScRefCellValue aCell(*pDoc, aCellPos);
1281 switch (aCell.getType())
1282 {
1283 case CELLTYPE_NONE:
1284 return OUString();
1285 case CELLTYPE_EDIT:
1286 {
1287 // GetString on EditCell replaces linebreaks with spaces;
1288 // however here we need line breaks
1289 const EditTextObject* pData = aCell.getEditText();
1290 EditEngine& rEngine = pDoc->GetEditEngine();
1291 rEngine.SetText(*pData);
1292 return rEngine.GetText();
1293 // also don't format EditCells per NumberFormatter
1294 }
1295 break;
1296 default:
1297 {
1298 // like in GetString for document (column)
1299 const Color* pColor;
1300 sal_uInt32 nNumFmt = pDoc->GetNumberFormat(aCellPos);
1301 return ScCellFormat::GetString(aCell, nNumFmt, &pColor, *pDoc->GetFormatTable(), *pDoc);
1302 }
1303 }
1304}
1305
1306}
1307
1309{
1310 ::std::optional< OUString > pOUText;
1311
1313 if( nCellType == util::NumberFormat::TEXT )
1314 {
1315 if( !bIsEmpty && !maStringValue && !mbEditEngineHasText && cellExists(*pDoc, rCellPos) && CellsAreRepeated() )
1316 pOUText = getOutputString(pDoc, rCellPos);
1317
1318 if (!mbEditEngineHasText && !pOUText && !maStringValue)
1319 bIsEmpty = true;
1320 }
1321
1322 ScAddress aCurrentPos( rCellPos );
1323 if( mxAnnotationData || pDetectiveObjVec || pCellRangeSource ) // has special content
1324 bIsEmpty = false;
1325
1326 AddTextAndValueCell( rCellPos, pOUText, aCurrentPos );
1327
1328 if( CellsAreRepeated() )
1329 {
1330 SCCOL nStartCol( std::min(rCellPos.Col(), pDoc->MaxCol()) );
1331 SCROW nStartRow( std::min(rCellPos.Row(), pDoc->MaxRow()) );
1332 SCCOL nEndCol( std::min<SCCOL>(rCellPos.Col() + nColsRepeated - 1, pDoc->MaxCol()) );
1333 SCROW nEndRow( std::min(rCellPos.Row() + nRepeatedRows - 1, pDoc->MaxRow()) );
1334 ScRange aScRange( nStartCol, nStartRow, rCellPos.Tab(), nEndCol, nEndRow, rCellPos.Tab() );
1335 SetContentValidation( aScRange );
1337 }
1338 else if( cellExists(*pDoc, rCellPos) )
1339 {
1341 SetContentValidation( rCellPos );
1342 }
1343}
1344
1346{
1348 ScDocumentImport& rDocImport = rXMLImport.GetDoc();
1349
1350 const OUString & aText = maFormula->first;
1351
1352 ScExternalRefManager::ApiGuard aExtRefGuard(*pDoc);
1353
1354 if ( aText.isEmpty() )
1355 return;
1356
1357 // temporary formula string as string tokens
1358 std::unique_ptr<ScTokenArray> pCode(new ScTokenArray(*pDoc));
1359
1360 // Check the special case of a single error constant without leading
1361 // '=' and create an error formula cell without tokens.
1363 if (nError != FormulaError::NONE)
1364 {
1365 pCode->SetCodeError(nError);
1366 }
1367 else
1368 {
1369 // 5.2 and earlier wrote broken "Err:xxx" as formula to designate
1370 // an error formula cell.
1371 if (aText.startsWithIgnoreAsciiCase("Err:") && aText.getLength() <= 9 &&
1372 ((nError =
1373 GetScImport().GetFormulaErrorConstant( OUString::Concat("#ERR") + aText.subView(4) + "!")) != FormulaError::NONE))
1374 {
1375 pCode->SetCodeError(nError);
1376 }
1377 else
1378 {
1379 OUString aFormulaNmsp = maFormula->second;
1381 aFormulaNmsp.clear();
1382 pCode->AssignXMLString( aText, aFormulaNmsp );
1383 rDocImport.getDoc().IncXMLImportedFormulaCount( aText.getLength() );
1384 }
1385 }
1386
1387 ScFormulaCell* pNewCell = new ScFormulaCell(*pDoc, rCellPos, std::move(pCode), eGrammar, ScMatrixMode::NONE);
1388 SetFormulaCell(pNewCell);
1389 rDocImport.setFormulaCell(rCellPos, pNewCell);
1390}
1391
1393{
1395 if( cellExists(*pDoc, rCellPos) )
1396 {
1397 SetContentValidation( rCellPos );
1398 SAL_WARN_IF((nColsRepeated != 1) || (nRepeatedRows != 1), "sc", "repeated cells with formula not possible now");
1400
1401 //add matrix
1402 if(bIsMatrix)
1403 {
1404 if (nMatrixCols > 0 && nMatrixRows > 0)
1405 {
1406 //matrix cells are put in the document, but we must set the
1407 //value/text of each matrix cell later
1409 rCellPos.Col(), rCellPos.Row(),
1410 std::min<SCCOL>(rCellPos.Col() + nMatrixCols - 1, pDoc->MaxCol()),
1411 std::min<SCROW>(rCellPos.Row() + nMatrixRows - 1, pDoc->MaxRow()),
1412 maFormula->first, maFormula->second, eGrammar);
1413
1414 // Set the value/text of the top-left matrix position in its
1415 // cached result. For import, we only need to set the correct
1416 // matrix geometry and the value type of the top-left element.
1417 ScFormulaCell* pFCell = pDoc->GetFormulaCell(rCellPos);
1418 if (pFCell)
1419 {
1422 {
1423 if (!IsPossibleErrorString())
1424 {
1425 pFCell->SetResultMatrix(
1428 pFCell->ResetDirty();
1429 }
1430 }
1431 else if (std::isfinite(fValue))
1432 {
1433 pFCell->SetResultMatrix(
1435 pFCell->ResetDirty();
1436 }
1437 }
1438 }
1439 }
1440 else
1441 PutFormulaCell( rCellPos );
1442
1443 SetAnnotation( rCellPos );
1444 SetDetectiveObj( rCellPos );
1445 SetCellRangeSource( rCellPos );
1447 }
1448 else
1449 {
1450 if (rCellPos.Row() > pDoc->MaxRow())
1452 else
1454 }
1455}
1456
1457//There are cases where a formula cell is exported with an office:value of 0 or
1458//no office:value at all, but the formula cell will have a text:p value which
1459//contains the intended formula result.
1460//These cases include when a formula result:
1461// - is blank
1462// - has a constant error value beginning with "#" (such as "#VALUE!" or "#N/A")
1463// - has an "Err:[###]" (where "[###]" is an error number)
1464// Libreoffice 4.1+ with ODF1.2 extended write however calcext:value-type="error" in that case
1466{
1468 return;
1469
1470 const OUString aStr = GetFirstParagraph();
1471
1472 if (mbNewValueType)
1473 {
1474 if (aStr.isEmpty())
1476 return;
1477 }
1478
1479 if (aStr.isEmpty())
1480 {
1481 mbPossibleErrorCell = true;
1483 }
1484 else if (aStr.startsWith("Err:"))
1485 mbPossibleErrorCell = true;
1486 else if (aStr.startsWith("#"))
1488}
1489
1491{
1492 if(mbNewValueType)
1493 return mbErrorValue;
1494
1496 GetScImport().GetFormulaErrorConstant(*maStringValue) != FormulaError::NONE);
1497}
1498
1499void SAL_CALL ScXMLTableRowCellContext::endFastElement(sal_Int32 /*nElement*/)
1500{
1503 {
1505 }
1506
1508 if( aCellPos.Col() > 0 && nRepeatedRows > 1 )
1509 aCellPos.SetRow( aCellPos.Row() - (nRepeatedRows - 1) );
1510 if( bIsMerged )
1511 DoMerge( aCellPos, nMergedCols - 1, nMergedRows - 1 );
1512
1513 if (maFormula)
1514 AddFormulaCell(aCellPos);
1515 else
1516 AddNonFormulaCell(aCellPos);
1517
1518 //if LockSolarMutex got used, we presumably need to ensure an UnlockSolarMutex
1520 {
1522 bSolarMutexLocked = false;
1523 }
1524
1525 bIsMerged = false;
1526 nMergedCols = 1;
1527 nMergedRows = 1;
1528 nColsRepeated = 1;
1529}
1530
1531/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
::std::vector< ScMyImpDetectiveObj > ScMyImpDetectiveObjVec
OUString GetText(LineEnd eEnd=LINEEND_LF) const
void Clear()
std::unique_ptr< EditTextObject > CreateTextObject()
void SetText(const OUString &rStr)
sal_Int32 GetParagraphCount() const
void QuickInsertField(const SvxFieldItem &rFld, const ESelection &rSel)
void InsertParagraph(sal_Int32 nPara, const EditTextObject &rTxtObj, const bool bAppend=false)
void QuickSetAttribs(const SfxItemSet &rSet, const ESelection &rSel)
SCTAB Tab() const
Definition: address.hxx:283
void SetCol(SCCOL nColP)
Definition: address.hxx:291
SCROW Row() const
Definition: address.hxx:274
void SetRow(SCROW nRowP)
Definition: address.hxx:287
SCCOL Col() const
Definition: address.hxx:279
static OUString GetString(const ScRefCellValue &rCell, sal_uInt32 nFormat, const Color **ppColor, SvNumberFormatter &rFormatter, const ScDocument &rDoc, bool bNullVals=true, bool bFormula=false, bool bUseStarFormat=false)
Definition: cellform.cxx:31
void SetIgnoreBlank(bool bSet)
Definition: conditio.cxx:422
static ScConditionMode GetModeFromApi(css::sheet::ConditionOperator nOperator)
Definition: conditio.cxx:1417
void SetSrcString(const OUString &rNew)
Definition: conditio.cxx:467
void InsertObject(ScDetectiveObjType eType, const ScAddress &rPosition, const ScRange &rSource, bool bRedLine)
Definition: detfunc.cxx:1578
Accessor class to ScDocument.
void setEditCell(const ScAddress &rPos, std::unique_ptr< EditTextObject > pEditText)
void setStringCell(const ScAddress &rPos, const OUString &rStr)
void setFormulaCell(const ScAddress &rPos, const OUString &rFormula, formula::FormulaGrammar::Grammar eGrammar, const double *pResult=nullptr)
ScDocument & getDoc()
void setNumericCell(const ScAddress &rPos, double fVal)
ScSheetLimits & GetSheetLimits() const
Definition: document.hxx:898
SC_DLLPUBLIC sal_uInt32 GetNumberFormat(SCCOL nCol, SCROW nRow, SCTAB nTab) const
Definition: document.cxx:3640
SC_DLLPUBLIC SCCOL MaxCol() const
Definition: document.hxx:892
SC_DLLPUBLIC ScDocumentPool * GetPool()
Definition: document.cxx:6050
SC_DLLPUBLIC void ApplyPatternAreaTab(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, const ScPatternAttr &rAttr)
Definition: document.cxx:4770
SC_DLLPUBLIC SCROW MaxRow() const
Definition: document.hxx:893
SC_DLLPUBLIC ScFieldEditEngine & GetEditEngine()
Definition: documen2.cxx:483
SC_DLLPUBLIC void DoMerge(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, bool bDeleteCaptions=true)
Definition: documen3.cxx:2063
formula::FormulaGrammar::Grammar GetStorageGrammar() const
Definition: document.hxx:2543
SC_DLLPUBLIC void ApplyPattern(SCCOL nCol, SCROW nRow, SCTAB nTab, const ScPatternAttr &rAttr)
Definition: document.cxx:4747
SfxObjectShell * GetDocumentShell() const
Definition: document.hxx:1083
SC_DLLPUBLIC svl::SharedStringPool & GetSharedStringPool()
Definition: documen2.cxx:601
SC_DLLPUBLIC sal_uLong AddValidationEntry(const ScValidationData &rNew)
Definition: documen4.cxx:719
SC_DLLPUBLIC SvNumberFormatter * GetFormatTable() const
Definition: documen2.cxx:467
SC_DLLPUBLIC const ScFormulaCell * GetFormulaCell(const ScAddress &rPos) const
Definition: document.cxx:3714
SC_DLLPUBLIC CellType GetCellType(SCCOL nCol, SCROW nRow, SCTAB nTab) const
Definition: document.cxx:3736
SC_DLLPUBLIC sfx2::LinkManager * GetLinkManager()
Definition: documen2.cxx:231
void IncXMLImportedFormulaCount(sal_uInt64 nVal)
Definition: document.hxx:2460
void SetTextCurrentDefaults(const EditTextObject &rTextObject)
SetText and apply defaults already set.
Definition: editutil.cxx:619
Use this guard when performing something from the API that might query values from external reference...
void SetNeedNumberFormat(bool bVal)
void SetResultMatrix(SCCOL nCols, SCROW nRows, const ScConstMatrixRef &pMat, const formula::FormulaToken *pUL)
bool GetMatrixOrigin(const ScDocument &rDoc, ScAddress &rPos) const
void SetDirty(bool bDirtyFlag=true)
void SetHybridEmptyDisplayedAsString()
For import only: set an empty cell result to be displayed as empty string.
void SetHybridString(const svl::SharedString &r)
For import only: set a string result.
void SetHybridDouble(double n)
For import only: set a double result.
Matrix data type that can store values of mixed types.
Definition: scmatrix.hxx:101
void SetAttributes(std::optional< OUString > pStyleName, std::optional< OUString > pCurrency, const sal_Int16 nCellType)
void AddCell(const ScAddress &rAddress)
void AddColumn(bool bIsCovered)
Definition: xmlsubti.cxx:173
const ScAddress & GetCurrentCellPos() const
Definition: xmlsubti.hxx:80
void AddRow()
Definition: xmlsubti.cxx:162
css::uno::Reference< css::drawing::XShapes > const & GetCurrentXShapes()
Definition: xmlsubti.cxx:230
bool IsPartOfMatrix(const ScAddress &rScAddress) const
Definition: xmlsubti.cxx:279
void AddMatrixRange(const SCCOL nStartColumn, const SCROW nStartRow, const SCCOL nEndColumn, const SCROW nEndRow, const OUString &rFormula, const OUString &rFormulaNmsp, const formula::FormulaGrammar::Grammar)
Definition: xmlsubti.cxx:258
static ScPostIt * CreateNoteFromCaption(ScDocument &rDoc, const ScAddress &rPos, SdrCaptionObj *pCaption, bool bHasStyle)
Creates a cell note using the passed caption drawing object.
Definition: postit.cxx:905
static ScPostIt * CreateNoteFromString(ScDocument &rDoc, const ScAddress &rPos, const OUString &rNoteText, bool bShown, bool bAlwaysCreateCaption, sal_uInt32 nPostItId=0)
Creates a cell note based on the passed string and inserts it into the document.
Definition: postit.cxx:965
static ScPostIt * CreateNoteFromObjectData(ScDocument &rDoc, const ScAddress &rPos, SfxItemSet &&oItemSet, const OUString &rStyleName, const OutlinerParaObject &rOutlinerObj, const tools::Rectangle &rCaptionRect, bool bShown)
Creates a cell note based on the passed caption object data.
Definition: postit.cxx:932
SfxItemSet & GetItemSet()
Definition: patattr.hxx:192
Additional class containing cell annotation data.
Definition: postit.hxx:58
void SetAuthor(const OUString &rAuthor)
Sets a new author date for this note.
Definition: postit.cxx:499
void SetDate(const OUString &rDate)
Sets a new creation date for this note.
Definition: postit.cxx:494
ScAddress aEnd
Definition: address.hxx:498
ScAddress aStart
Definition: address.hxx:497
void BlockSheet(SCTAB nTab)
Definition: sheetdata.cxx:92
void AddTextStyle(const OUString &rName, const ScAddress &rCellPos, const ESelection &rSelection)
Definition: sheetdata.cxx:87
void AddNoteContentStyle(XmlStyleFamily nFamily, const OUString &rName, const ScAddress &rCellPos, const ESelection &rSelection)
Definition: sheetdata.cxx:79
void HandleNoteStyles(const OUString &rStyleName, const OUString &rTextName, const ScAddress &rCellPos)
Definition: sheetdata.cxx:61
static bool SC_DLLPUBLIC isMultiline(std::u16string_view rStr)
Definition: stringutil.cxx:425
void SetListType(sal_Int16 nListType)
Definition: validat.hxx:121
void SetInput(const OUString &rTitle, const OUString &rMsg)
Definition: validat.cxx:161
void ResetInput()
Definition: validat.cxx:151
void SetError(const OUString &rTitle, const OUString &rMsg, ScValidErrorStyle eStyle)
Definition: validat.cxx:168
void ResetError()
Definition: validat.cxx:156
This context handles <text:p> element inside <table:table-cell>.
Provide mapping from ODF text formatting styles to EditEngine's, for rich-text cell content import.
const Entry * getEntryByAPIName(const OUString &rAPIName) const
This class exists only to provide GetScImport() to its derived classes.
ScXMLImport & GetScImport()
void ProgressBarIncrement()
Definition: xmlimprt.cxx:1570
ScMyStylesImportHelper * GetStylesImportHelper()
Definition: xmlimprt.hxx:250
ScDocumentImport & GetDoc()
Definition: xmlimprt.cxx:506
bool SetNullDateOnUnitConverter()
Definition: xmlimprt.cxx:1089
void LockSolarMutex()
Definition: xmlimprt.cxx:1519
FormulaError GetFormulaErrorConstant(const OUString &rStr) const
Definition: xmlimprt.cxx:1639
const ScXMLEditAttributeMap & GetEditAttributeMap() const
Definition: xmlimprt.cxx:1661
ScDocument * GetDocument()
Definition: xmlimprt.hxx:205
void UnlockSolarMutex()
Definition: xmlimprt.cxx:1537
bool GetValidation(const OUString &sName, ScMyImportValidation &aValidation)
Definition: xmlimprt.cxx:557
ScMyTables & GetTables()
Definition: xmlimprt.hxx:208
void SetRangeOverflowType(ErrCode nType)
Definition: xmlimprt.cxx:1560
void ExtractFormulaNamespaceGrammar(OUString &rFormula, OUString &rFormulaNmsp, ::formula::FormulaGrammar::Grammar &reGrammar, const OUString &rAttrValue, bool bRestrictToExternalNmsp=false) const
Extracts the formula string, the formula grammar namespace URL, and a grammar enum value from the pas...
Definition: xmlimprt.cxx:1580
static sal_Int16 GetCellType(const char *rStrValue, const sal_Int32 nStrLength)
Definition: xmlimprt.cxx:511
void SetCellRangeSource(const ScAddress &rPosition)
Definition: xmlcelli.cxx:969
virtual ~ScXMLTableRowCellContext() override
Definition: xmlcelli.cxx:290
std::pair< OUString, OUString > FormulaWithNamespace
Definition: xmlcelli.hxx:61
void PushFormat(sal_Int32 nBegin, sal_Int32 nEnd, const OUString &rStyleName)
Definition: xmlcelli.cxx:338
void PushParagraphFieldDocTitle(const OUString &rStyleName)
Definition: xmlcelli.cxx:587
void PushParagraphFieldSheetName(const OUString &rStyleName)
Definition: xmlcelli.cxx:581
void PutFormulaCell(const ScAddress &rScCurrentPos)
Definition: xmlcelli.cxx:1345
ScEditEngineDefaulter * mpEditEngine
unformatted first paragraph, for better performance.
Definition: xmlcelli.hxx:68
std::unique_ptr< ScMyImpDetectiveObjVec > pDetectiveObjVec
Definition: xmlcelli.hxx:76
void AddNonFormulaCell(const ScAddress &rScCellPos)
Definition: xmlcelli.cxx:1308
OUStringBuffer maParagraph
Definition: xmlcelli.hxx:69
void SetFormulaCell(ScFormulaCell *pFCell) const
Definition: xmlcelli.cxx:988
void PutValueCell(const ScAddress &rScCurrentPos)
Definition: xmlcelli.cxx:1127
ScXMLTableRowCellContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, const bool bIsCovered, const sal_Int32 nRepeatedRows)
Definition: xmlcelli.cxx:114
OUString GetFirstParagraph() const
Definition: xmlcelli.cxx:568
void AddTextAndValueCell(const ScAddress &rScCellPos, const ::std::optional< OUString > &pOUText, ScAddress &rScCurrentPos)
Definition: xmlcelli.cxx:1169
void SetAnnotation(const ScAddress &rPosition)
Definition: xmlcelli.cxx:823
std::optional< OUString > maFirstParagraph
Definition: xmlcelli.hxx:66
formula::FormulaGrammar::Grammar eGrammar
Definition: xmlcelli.hxx:82
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmlcelli.cxx:1499
std::optional< FormulaWithNamespace > maFormula
Definition: xmlcelli.hxx:63
bool IsPossibleErrorString() const
Definition: xmlcelli.cxx:1490
void PushParagraphSpan(std::u16string_view rSpan, const OUString &rStyleName)
Definition: xmlcelli.cxx:313
std::unique_ptr< ScXMLAnnotationData > mxAnnotationData
Definition: xmlcelli.hxx:75
bool CellsAreRepeated() const
Definition: xmlcelli.cxx:1267
void PutTextCell(const ScAddress &rScCurrentPos, const SCCOL nCurrentCol, const ::std::optional< OUString > &pOUText)
Definition: xmlcelli.cxx:1030
void DoMerge(const ScAddress &rScCellPos, const SCCOL nCols, const SCROW nRows)
Definition: xmlcelli.cxx:713
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: xmlcelli.cxx:631
ScXMLImport & rXMLImport
Definition: xmlcelli.hxx:81
std::optional< OUString > maContentValidationName
office:string-value attribute
Definition: xmlcelli.hxx:65
void AddFormulaCell(const ScAddress &rScCellPos)
Definition: xmlcelli.cxx:1392
std::optional< OUString > maStringValue
table:formula attribute
Definition: xmlcelli.hxx:64
void SetContentValidation(const ScRange &rScRange)
Definition: xmlcelli.cxx:762
void PushParagraphField(std::unique_ptr< SvxFieldData > pData, const OUString &rStyleName)
Definition: xmlcelli.cxx:322
void PushParagraphFieldDate(const OUString &rStyleName)
Definition: xmlcelli.cxx:576
void PushParagraphFieldURL(const OUString &rURL, const OUString &rRep, const OUString &rStyleName, const OUString &rTargetFrame)
Definition: xmlcelli.cxx:592
std::unique_ptr< ScMyImpCellRangeSource > pCellRangeSource
Definition: xmlcelli.hxx:77
std::vector< std::unique_ptr< ParaFormat > > maFormats
Definition: xmlcelli.hxx:72
void SetDetectiveObj(const ScAddress &rPosition)
Definition: xmlcelli.cxx:947
static SdrObject * getSdrObjectFromXShape(const css::uno::Reference< css::uno::XInterface > &xInt)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void GetOutputString(const double &fOutNumber, sal_uInt32 nFIndex, OUString &sOutString, const Color **ppColor, bool bUseStarFormat=false)
sal_uInt32 GetFormatIndex(NfIndexTableOffset, LanguageType eLnge=LANGUAGE_DONTKNOW)
SvXMLImport & GetImport()
const SvXMLStyleContext * FindStyleChildContext(XmlStyleFamily nFamily, const OUString &rName, bool bCreateIndex=false) const
const ::std::vector< XMLPropertyState > & GetProperties() const
static SvXMLShapeContext * CreateGroupChildContext(SvXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, css::uno::Reference< css::drawing::XShapes > const &rShapes, bool bTemporaryShape=false)
void SetOnTable(const bool bTempOnTable)
void SetCell(const ScAddress &rAddress)
static void convertDuration(OUStringBuffer &rBuffer, const double fTime)
void InsertFileLink(sfx2::SvBaseLink &, SvBaseLinkObjectType nFileType, std::u16string_view rFileNm, const OUString *pFilterNm=nullptr, const OUString *pRange=nullptr)
SharedString intern(const OUString &rStr)
constexpr TypedWhichId< SvxContourItem > EE_CHAR_OUTLINE(EE_CHAR_START+8)
constexpr TypedWhichId< SvxKerningItem > EE_CHAR_KERNING(EE_CHAR_START+12)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO_CJK(EE_CHAR_START+17)
constexpr TypedWhichId< SvxFieldItem > EE_FEATURE_FIELD(EE_FEATURE_NOTCONV+1)
constexpr TypedWhichId< SvxUnderlineItem > EE_CHAR_UNDERLINE(EE_CHAR_START+5)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT(EE_CHAR_START+2)
constexpr TypedWhichId< SvxAutoKernItem > EE_CHAR_PAIRKERNING(EE_CHAR_START+11)
constexpr TypedWhichId< SvxShadowedItem > EE_CHAR_SHADOW(EE_CHAR_START+9)
constexpr TypedWhichId< SvxOverlineItem > EE_CHAR_OVERLINE(EE_CHAR_START+29)
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE_CTL(EE_CHAR_START+16)
constexpr TypedWhichId< SvxWeightItem > EE_CHAR_WEIGHT(EE_CHAR_START+4)
constexpr TypedWhichId< SvxColorItem > EE_CHAR_COLOR(EE_CHAR_START+0)
constexpr TypedWhichId< SvxWeightItem > EE_CHAR_WEIGHT_CTL(EE_CHAR_START+22)
constexpr TypedWhichId< SvxCrossedOutItem > EE_CHAR_STRIKEOUT(EE_CHAR_START+6)
constexpr TypedWhichId< SvxPostureItem > EE_CHAR_ITALIC(EE_CHAR_START+7)
constexpr TypedWhichId< SvxEmphasisMarkItem > EE_CHAR_EMPHASISMARK(EE_CHAR_START+25)
constexpr TypedWhichId< SvxEscapementItem > EE_CHAR_ESCAPEMENT(EE_CHAR_START+10)
constexpr sal_uInt16 EE_CHAR_END(EE_CHAR_START+32)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CTL(EE_CHAR_START+20)
constexpr TypedWhichId< SvxWeightItem > EE_CHAR_WEIGHT_CJK(EE_CHAR_START+21)
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE_CJK(EE_CHAR_START+15)
constexpr TypedWhichId< SvxPostureItem > EE_CHAR_ITALIC_CJK(EE_CHAR_START+23)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO_CTL(EE_CHAR_START+18)
constexpr TypedWhichId< SvxPostureItem > EE_CHAR_ITALIC_CTL(EE_CHAR_START+24)
constexpr TypedWhichId< SvxCharScaleWidthItem > EE_CHAR_FONTWIDTH(EE_CHAR_START+3)
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE(EE_CHAR_START+14)
constexpr TypedWhichId< SvxWordLineModeItem > EE_CHAR_WLM(EE_CHAR_START+13)
constexpr TypedWhichId< SvxCharReliefItem > EE_CHAR_RELIEF(EE_CHAR_START+26)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CJK(EE_CHAR_START+19)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO(EE_CHAR_START+1)
EmbeddedObjectRef * pObject
FormulaError
DocumentType eType
LINESTYLE_NONE
STRIKEOUT_NONE
ITALIC_NONE
WEIGHT_NORMAL
CellType
Definition: global.hxx:272
@ CELLTYPE_EDIT
Definition: global.hxx:277
@ CELLTYPE_FORMULA
Definition: global.hxx:276
@ CELLTYPE_NONE
Definition: global.hxx:273
sal_Int32 nIndex
Mode eMode
void * p
#define LANGUAGE_SYSTEM
#define LANGUAGE_DONTKNOW
sal_uInt16 nPos
SvBaseLink * pLink
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
aStr
std::unique_ptr< sal_Int32[]> pData
TABLE
int i
FastAttributeList & castToFastAttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
XML_BOOLEAN_VALUE
XML_CURRENCY
XML_DATE_VALUE
XML_CONTENT_VALIDATION_NAME
XML_TRUE
XML_NUMBER_MATRIX_COLUMNS_SPANNED
XML_SUB_TABLE
XML_TIME_VALUE
XML_DETECTIVE
XML_FORMULA
XML_VALUE
XML_FALSE
XML_STRING_VALUE
XML_STYLE_NAME
XML_P
XML_CELL_RANGE_SOURCE
XML_NUMBER_COLUMNS_SPANNED
XML_NUMBER_ROWS_SPANNED
XML_VALUE_TYPE
XML_NUMBER_COLUMNS_REPEATED
XML_ANNOTATION
XML_NUMBER_MATRIX_ROWS_SPANNED
bool IsXMLToken(std::u16string_view rString, enum XMLTokenEnum eToken)
#define SCWARN_IMPORT_ROW_OVERFLOW
Definition: scerrors.hxx:62
#define SCWARN_IMPORT_COLUMN_OVERFLOW
Definition: scerrors.hxx:63
constexpr TypedWhichId< SfxUInt32Item > ATTR_VALIDDATA(153)
sal_Int32 nStartPara
sal_Int32 nEndPos
sal_Int32 nStartPos
sal_Int32 nEndPara
OUString sFormulaNmsp2
Definition: xmlimprt.hxx:97
formula::FormulaGrammar::Grammar eGrammar2
Definition: xmlimprt.hxx:103
css::sheet::ValidationType aValidationType
Definition: xmlimprt.hxx:100
OUString sErrorMessage
Definition: xmlimprt.hxx:93
css::sheet::ConditionOperator aOperator
Definition: xmlimprt.hxx:101
OUString sInputMessage
Definition: xmlimprt.hxx:91
css::sheet::ValidationAlertStyle aAlertStyle
Definition: xmlimprt.hxx:99
OUString sBaseCellAddress
Definition: xmlimprt.hxx:98
OUString sFormulaNmsp1
Definition: xmlimprt.hxx:96
OUString sInputTitle
Definition: xmlimprt.hxx:90
formula::FormulaGrammar::Grammar eGrammar1
Definition: xmlimprt.hxx:102
OUString sErrorTitle
Definition: xmlimprt.hxx:92
This is very similar to ScCellValue, except that it references the original value instead of copying ...
Definition: cellvalue.hxx:108
ScFormulaCell * getFormula() const
Definition: cellvalue.hxx:137
CellType getType() const
Definition: cellvalue.hxx:133
SCCOL GetMaxColCount() const
Definition: sheetlimits.hxx:68
Field(const Field &)=delete
ParaFormat(const ScEditEngineDefaulter &rEditEngine)
Definition: xmlcelli.cxx:105
SfxItemSet maItemSet
TEXT
sal_Int16 SCTAB
Definition: types.hxx:22
sal_Int16 SCCOL
Definition: types.hxx:21
::boost::intrusive_ptr< ScMatrix > ScMatrixRef
Definition: types.hxx:25
sal_Int32 SCROW
Definition: types.hxx:17
ScValidationMode
Definition: validat.hxx:41
@ SC_VALID_TEXTLEN
Definition: validat.hxx:47
@ SC_VALID_TIME
Definition: validat.hxx:46
@ SC_VALID_CUSTOM
Definition: validat.hxx:49
@ SC_VALID_ANY
Definition: validat.hxx:42
@ SC_VALID_DECIMAL
Definition: validat.hxx:44
@ SC_VALID_WHOLE
Definition: validat.hxx:43
@ SC_VALID_DATE
Definition: validat.hxx:45
@ SC_VALID_LIST
Definition: validat.hxx:48
ScValidErrorStyle
Definition: validat.hxx:53
@ SC_VALERR_MACRO
Definition: validat.hxx:57
@ SC_VALERR_STOP
Definition: validat.hxx:54
@ SC_VALERR_WARNING
Definition: validat.hxx:55
@ SC_VALERR_INFO
Definition: validat.hxx:56
constexpr OUStringLiteral PERCENT(u"Percent")
#define XML_ELEMENT(prefix, name)
NF_DATE_SYS_DDMMYYYY