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 {
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(const OUString& rSpan, const OUString& rStyleName)
314{
315 sal_Int32 nBegin = maParagraph.getLength();
316 sal_Int32 nEnd = nBegin + rSpan.getLength();
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, 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, 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" );
842 OSL_ENSURE( pObject, "ScXMLTableRowCellContext::SetAnnotation - cannot get SdrObject from shape" );
843
844 /* Try to reuse the drawing object already created (but only if the
845 note is visible, and the object is a caption object). */
847 {
848 if( SdrCaptionObj* pCaption = dynamic_cast< SdrCaptionObj* >( pObject ) )
849 {
850 OSL_ENSURE( !pCaption->GetLogicRect().IsEmpty(), "ScXMLTableRowCellContext::SetAnnotation - invalid caption rectangle" );
851 // create the cell note with the caption object
852 pNote = ScNoteUtil::CreateNoteFromCaption( *pDoc, rPos, pCaption );
853 // forget pointer to object (do not create note again below)
854 pObject = nullptr;
855 }
856 }
857
858 // drawing object has not been used to create a note -> use shape data
859 if( pObject )
860 {
861 // rescue settings from drawing object before the shape is removed
862 SfxItemSet aItemSet( pObject->GetMergedItemSet() );
864 if (auto p = pObject->GetOutlinerParaObject())
865 pOutlinerObj = *p;
866 tools::Rectangle aCaptionRect;
867 if( mxAnnotationData->mbUseShapePos )
868 aCaptionRect = pObject->GetLogicRect();
869 // remove the shape from the drawing page, this invalidates pObject
870 mxAnnotationData->mxShapes->remove( mxAnnotationData->mxShape );
871 pObject = nullptr;
872 // update current number of existing objects
873 if( xShapes.is() )
874 nOldShapeCount = xShapes->getCount();
875
876 // an outliner object is required (empty note captions not allowed)
877 if (pOutlinerObj)
878 {
879 // create cell note with all data from drawing object
881 {
882 pNote = ScNoteUtil::CreateNoteFromObjectData( *pDoc, rPos,
883 std::move(aItemSet), *pOutlinerObj,
884 aCaptionRect, mxAnnotationData->mbShown );
885 }
886 else
887 {
888 pNote = ScNoteUtil::CreateNoteFromObjectData( *pDoc, rPos,
889 std::move(aItemSet), *pOutlinerObj,
890 aCaptionRect, false );
891 }
892
893 }
894 }
895 }
896 else if( !mxAnnotationData->maSimpleText.isEmpty() )
897 {
898 // create note from simple text
899 pNote = ScNoteUtil::CreateNoteFromString( *pDoc, rPos,
900 mxAnnotationData->maSimpleText, mxAnnotationData->mbShown, false );
901 }
902
903 // set author and date
904 if( pNote )
905 {
906 double fDate;
908 {
909 SvNumberFormatter* pNumForm = pDoc->GetFormatTable();
910 sal_uInt32 nfIndex = pNumForm->GetFormatIndex( NF_DATE_SYS_DDMMYYYY, LANGUAGE_SYSTEM );
911 OUString aDate;
912 const Color* pColor = nullptr;
913 pNumForm->GetOutputString( fDate, nfIndex, aDate, &pColor );
914 pNote->SetDate( aDate );
915 }
916 pNote->SetAuthor( mxAnnotationData->maAuthor );
917 }
918
919 // register a shape that has been newly created in the ScNoteUtil functions
920 if( xShapes.is() && (nOldShapeCount < xShapes->getCount()) )
921 {
922 uno::Reference< drawing::XShape > xShape;
923 rXMLImport.GetShapeImport()->shapeWithZIndexAdded( xShape, xShapes->getCount() );
924 }
925
926 // store the style names for stream copying
927 ScSheetSaveData* pSheetData = comphelper::getFromUnoTunnel<ScModelObj>(rXMLImport.GetModel())->GetSheetSaveData();
928 pSheetData->HandleNoteStyles( mxAnnotationData->maStyleName, mxAnnotationData->maTextStyle, rPos );
929
930 for (const auto& rContentStyle : mxAnnotationData->maContentStyles)
931 {
932 pSheetData->AddNoteContentStyle( rContentStyle.mnFamily, rContentStyle.maName, rPos, rContentStyle.maSelection );
933 }
934}
935
936// core implementation
938{
940 if( !pDoc || !cellExists(*pDoc, rPosition) || !pDetectiveObjVec || pDetectiveObjVec->empty() )
941 return;
942
944 ScDetectiveFunc aDetFunc( *pDoc, rPosition.Tab() );
945 uno::Reference<container::XIndexAccess> xShapesIndex = rXMLImport.GetTables().GetCurrentXShapes(); // make draw page
946 for(const auto& rDetectiveObj : *pDetectiveObjVec)
947 {
948 aDetFunc.InsertObject( rDetectiveObj.eObjType, rPosition, rDetectiveObj.aSourceRange, rDetectiveObj.bHasError );
949 if (xShapesIndex.is())
950 {
951 sal_Int32 nShapes = xShapesIndex->getCount();
952 uno::Reference < drawing::XShape > xShape;
953 rXMLImport.GetShapeImport()->shapeWithZIndexAdded(xShape, nShapes);
954 }
955 }
956}
957
958// core implementation
960{
962 if( !pDoc || !cellExists(*pDoc, rPosition) || !pCellRangeSource || pCellRangeSource->sSourceStr.isEmpty() ||
963 pCellRangeSource->sFilterName.isEmpty() || pCellRangeSource->sURL.isEmpty() )
964 return;
965
967 ScRange aDestRange( rPosition.Col(), rPosition.Row(), rPosition.Tab(),
968 rPosition.Col() + static_cast<SCCOL>(pCellRangeSource->nColumns - 1),
969 rPosition.Row() + static_cast<SCROW>(pCellRangeSource->nRows - 1), rPosition.Tab() );
970 OUString sFilterName( pCellRangeSource->sFilterName );
971 OUString sSourceStr( pCellRangeSource->sSourceStr );
973 sFilterName, pCellRangeSource->sFilterOptions, sSourceStr, aDestRange, pCellRangeSource->nRefresh );
974 sfx2::LinkManager* pLinkManager = pDoc->GetLinkManager();
975 pLinkManager->InsertFileLink( *pLink, sfx2::SvBaseLinkObjectType::ClientFile, pCellRangeSource->sURL, &sFilterName, &sSourceStr );
976}
977
979{
980 if(!pFCell)
981 return;
982
983 bool bMayForceNumberformat = true;
984
985 if(mbErrorValue)
986 {
987 // don't do anything here
988 // we need to recalc anyway
989 }
991 {
992 if( !IsPossibleErrorString() )
993 {
996 pFCell->ResetDirty();
997 // A General format doesn't force any other format for a string
998 // result, don't attempt to recalculate this later.
999 bMayForceNumberformat = false;
1000 }
1001 }
1002 else if (std::isfinite(fValue))
1003 {
1004 pFCell->SetHybridDouble(fValue);
1005 if (mbPossibleEmptyDisplay && fValue == 0.0)
1006 {
1007 // Needs to be recalculated to propagate, otherwise would be
1008 // propagated as empty string. So don't ResetDirty().
1010 }
1011 else
1012 pFCell->ResetDirty();
1013 }
1014
1015 if (bMayForceNumberformat)
1016 // Re-calculate to get number format only when style is not set.
1018}
1019
1021 const SCCOL nCurrentCol, const ::std::optional< OUString >& pOUText )
1022{
1024 bool bDoIncrement = true;
1025 //matrix reference cells that contain text formula results;
1026 //cell was already put in document, just need to set text here.
1027 if( pDoc && rXMLImport.GetTables().IsPartOfMatrix(rCurrentPos) )
1028 {
1029 ScRefCellValue aCell(*pDoc, rCurrentPos);
1030 bDoIncrement = aCell.getType() == CELLTYPE_FORMULA;
1031 if ( bDoIncrement )
1032 {
1033 ScFormulaCell* pFCell = aCell.getFormula();
1034 OUString aCellString;
1035 if (maStringValue)
1036 aCellString = *maStringValue;
1037 else if (mbEditEngineHasText)
1038 aCellString = GetFirstParagraph();
1039 else if ( nCurrentCol > 0 && pOUText && !pOUText->isEmpty() )
1040 aCellString = *pOUText;
1041 else
1042 bDoIncrement = false;
1043
1044 if(mbErrorValue)
1045 bDoIncrement = false;
1046
1047 if(!aCellString.isEmpty())
1048 {
1049 if (bDoIncrement && !IsPossibleErrorString() && pFCell)
1050 {
1051 pFCell->SetHybridString(pDoc->GetSharedStringPool().intern(aCellString));
1052 pFCell->ResetDirty();
1053 }
1054 else
1055 {
1056 ScAddress aTopLeftMatrixCell;
1057 if (pFCell && pFCell->GetMatrixOrigin(*pDoc, aTopLeftMatrixCell))
1058 {
1059 ScFormulaCell* pMatrixCell = pDoc->GetFormulaCell(aTopLeftMatrixCell);
1060 if (pMatrixCell)
1061 pMatrixCell->SetDirty();
1062 }
1063 else
1064 SAL_WARN("sc", "matrix cell without matrix");
1065 }
1066 }
1067 }
1068 }
1069 else //regular text cells
1070 {
1072 if (maStringValue)
1073 {
1074 rDoc.setStringCell(rCurrentPos, *maStringValue);
1075 bDoIncrement = true;
1076 }
1077 else if (mbEditEngineHasText)
1078 {
1079 if (maFirstParagraph)
1080 {
1081 // This is a normal text without format runs.
1082 rDoc.setStringCell(rCurrentPos, *maFirstParagraph);
1083 }
1084 else
1085 {
1086 // This text either has format runs, has field(s), or consists of multiple lines.
1087 for (const auto& rxFormat : maFormats)
1088 mpEditEngine->QuickSetAttribs(rxFormat->maItemSet, rxFormat->maSelection);
1089
1090 for (const auto& rxField : maFields)
1091 mpEditEngine->QuickInsertField(SvxFieldItem(*rxField->mpData, EE_FEATURE_FIELD), rxField->maSelection);
1092
1093 // This edit engine uses the SfxItemPool instance returned
1094 // from pDoc->GetEditPool() to create the text object, which
1095 // is a prerequisite for using this constructor of ScEditCell.
1096 rDoc.setEditCell(rCurrentPos, mpEditEngine->CreateTextObject());
1097 }
1098 bDoIncrement = true;
1099 }
1100 else if ( nCurrentCol > 0 && pOUText && !pOUText->isEmpty() )
1101 {
1102 rDoc.setStringCell(rCurrentPos, *pOUText);
1103 bDoIncrement = true;
1104 }
1105 else
1106 bDoIncrement = false;
1107 }
1108
1109 // #i56027# This is about setting simple text, not edit cells,
1110 // so ProgressBarIncrement must be called with bEditCell = FALSE.
1111 // Formatted text that is put into the cell by the child context
1112 // is handled in AddCellsToTable() (bIsEmpty is true then).
1113 if (bDoIncrement)
1115}
1116
1118{
1119 //matrix reference cells that contain value formula results;
1120 //cell was already put in document, just need to set value here.
1121 if( rXMLImport.GetTables().IsPartOfMatrix(rCurrentPos) )
1122 {
1123 ScRefCellValue aCell(*rXMLImport.GetDocument(), rCurrentPos);
1124 if (aCell.getType() == CELLTYPE_FORMULA)
1125 {
1126 ScFormulaCell* pFCell = aCell.getFormula();
1127 SetFormulaCell(pFCell);
1128 if (pFCell)
1129 pFCell->SetNeedNumberFormat( true );
1130 }
1131 }
1132 else //regular value cell
1133 {
1134 // fdo#62250 absent values are not NaN, set to 0.0
1135 // PutValueCell() is called only for a known cell value type,
1136 // bIsEmpty==false in all these cases, no sense to check it here.
1137 if (!std::isfinite( fValue))
1138 fValue = 0.0;
1139
1140 // #i62435# Initialize the value cell's script type if the default
1141 // style's number format is latin-only. If the cell uses a different
1142 // format, the script type will be reset when the style is applied.
1143
1144 rXMLImport.GetDoc().setNumericCell(rCurrentPos, fValue);
1145 }
1147}
1148
1149namespace {
1150
1151bool isEmptyOrNote( const ScDocument* pDoc, const ScAddress& rCurrentPos )
1152{
1153 CellType eType = pDoc->GetCellType(rCurrentPos);
1154 return (eType == CELLTYPE_NONE);
1155}
1156
1157}
1158
1160 const ::std::optional< OUString >& pOUText, ScAddress& rCurrentPos )
1161{
1163 ScMyTables& rTables = rXMLImport.GetTables();
1164 bool bWasEmpty = bIsEmpty;
1165 for (SCCOL i = 0; i < nColsRepeated; ++i)
1166 {
1167 rCurrentPos.SetCol( rCellPos.Col() + i );
1168
1169 // it makes no sense to import data after the last supported column
1170 // fdo#58539 & gnome#627150
1171 if(rCurrentPos.Col() > pDoc->MaxCol())
1172 {
1174 break;
1175 }
1176
1177 if (i > 0)
1178 rTables.AddColumn(false);
1179 if (!bIsEmpty)
1180 {
1181 for (SCROW j = 0; j < nRepeatedRows; ++j)
1182 {
1183 rCurrentPos.SetRow( rCellPos.Row() + j );
1184
1185 // it makes no sense to import data after last supported row
1186 // fdo#58539 & gnome#627150
1187 if(rCurrentPos.Row() > pDoc->MaxRow())
1188 {
1190 break;
1191 }
1192
1193 if( (rCurrentPos.Col() == 0) && (j > 0) )
1194 {
1195 rTables.AddRow();
1196 rTables.AddColumn(false);
1197 }
1198 if( cellExists(*pDoc, rCurrentPos) )
1199 {
1200 if( !bIsCovered || isEmptyOrNote(pDoc, rCurrentPos) )
1201 {
1202 switch (nCellType)
1203 {
1204 case util::NumberFormat::TEXT:
1205 {
1206 PutTextCell( rCurrentPos, i, pOUText );
1207 }
1208 break;
1209 case util::NumberFormat::NUMBER:
1211 case util::NumberFormat::CURRENCY:
1212 case util::NumberFormat::TIME:
1213 case util::NumberFormat::DATETIME:
1214 case util::NumberFormat::LOGICAL:
1215 {
1216 PutValueCell( rCurrentPos );
1217 }
1218 break;
1219 default:
1220 {
1221 OSL_FAIL("no cell type given");
1222 }
1223 break;
1224 }
1225 }
1226
1227 SetAnnotation( rCurrentPos );
1228 SetDetectiveObj( rCurrentPos );
1229 SetCellRangeSource( rCurrentPos );
1230 }
1231 else
1232 {
1233 if (!bWasEmpty || mxAnnotationData)
1234 {
1235 if (rCurrentPos.Row() > pDoc->MaxRow())
1237 else
1239 }
1240 }
1241 }
1242 }
1243 else
1244 {
1245 if ((i == 0) && (rCellPos.Col() == 0))
1246 {
1247 for (sal_Int32 j = 1; j < nRepeatedRows; ++j)
1248 {
1249 rTables.AddRow();
1250 rTables.AddColumn(false);
1251 }
1252 }
1253 }
1254 }
1255}
1256
1258{
1259 return ( (nColsRepeated > 1) || (nRepeatedRows > 1) );
1260}
1261
1262namespace {
1263
1264// from ScCellObj::GetOutputString_Imp(). all of it may not be necessary.
1265OUString getOutputString( ScDocument* pDoc, const ScAddress& aCellPos )
1266{
1267 if (!pDoc)
1268 return OUString();
1269
1270 ScRefCellValue aCell(*pDoc, aCellPos);
1271 switch (aCell.getType())
1272 {
1273 case CELLTYPE_NONE:
1274 return OUString();
1275 case CELLTYPE_EDIT:
1276 {
1277 // GetString on EditCell replaces linebreaks with spaces;
1278 // however here we need line breaks
1279 const EditTextObject* pData = aCell.getEditText();
1280 EditEngine& rEngine = pDoc->GetEditEngine();
1281 rEngine.SetText(*pData);
1282 return rEngine.GetText();
1283 // also don't format EditCells per NumberFormatter
1284 }
1285 break;
1286 default:
1287 {
1288 // like in GetString for document (column)
1289 const Color* pColor;
1290 sal_uInt32 nNumFmt = pDoc->GetNumberFormat(aCellPos);
1291 return ScCellFormat::GetString(aCell, nNumFmt, &pColor, *pDoc->GetFormatTable(), *pDoc);
1292 }
1293 }
1294}
1295
1296}
1297
1299{
1300 ::std::optional< OUString > pOUText;
1301
1303 if( nCellType == util::NumberFormat::TEXT )
1304 {
1305 if( !bIsEmpty && !maStringValue && !mbEditEngineHasText && cellExists(*pDoc, rCellPos) && CellsAreRepeated() )
1306 pOUText = getOutputString(pDoc, rCellPos);
1307
1308 if (!mbEditEngineHasText && !pOUText && !maStringValue)
1309 bIsEmpty = true;
1310 }
1311
1312 ScAddress aCurrentPos( rCellPos );
1313 if( mxAnnotationData || pDetectiveObjVec || pCellRangeSource ) // has special content
1314 bIsEmpty = false;
1315
1316 AddTextAndValueCell( rCellPos, pOUText, aCurrentPos );
1317
1318 if( CellsAreRepeated() )
1319 {
1320 SCCOL nStartCol( std::min(rCellPos.Col(), pDoc->MaxCol()) );
1321 SCROW nStartRow( std::min(rCellPos.Row(), pDoc->MaxRow()) );
1322 SCCOL nEndCol( std::min<SCCOL>(rCellPos.Col() + nColsRepeated - 1, pDoc->MaxCol()) );
1323 SCROW nEndRow( std::min(rCellPos.Row() + nRepeatedRows - 1, pDoc->MaxRow()) );
1324 ScRange aScRange( nStartCol, nStartRow, rCellPos.Tab(), nEndCol, nEndRow, rCellPos.Tab() );
1325 SetContentValidation( aScRange );
1327 }
1328 else if( cellExists(*pDoc, rCellPos) )
1329 {
1331 SetContentValidation( rCellPos );
1332 }
1333}
1334
1336{
1338 ScDocumentImport& rDocImport = rXMLImport.GetDoc();
1339
1340 OUString aText = maFormula->first;
1341
1342 ScExternalRefManager::ApiGuard aExtRefGuard(*pDoc);
1343
1344 if ( aText.isEmpty() )
1345 return;
1346
1347 // temporary formula string as string tokens
1348 std::unique_ptr<ScTokenArray> pCode(new ScTokenArray(*pDoc));
1349
1350 // Check the special case of a single error constant without leading
1351 // '=' and create an error formula cell without tokens.
1353 if (nError != FormulaError::NONE)
1354 {
1355 pCode->SetCodeError(nError);
1356 }
1357 else
1358 {
1359 // 5.2 and earlier wrote broken "Err:xxx" as formula to designate
1360 // an error formula cell.
1361 if (aText.startsWithIgnoreAsciiCase("Err:") && aText.getLength() <= 9 &&
1362 ((nError =
1363 GetScImport().GetFormulaErrorConstant( OUString::Concat("#ERR") + aText.subView(4) + "!")) != FormulaError::NONE))
1364 {
1365 pCode->SetCodeError(nError);
1366 }
1367 else
1368 {
1369 OUString aFormulaNmsp = maFormula->second;
1371 aFormulaNmsp.clear();
1372 pCode->AssignXMLString( aText, aFormulaNmsp );
1373 rDocImport.getDoc().IncXMLImportedFormulaCount( aText.getLength() );
1374 }
1375 }
1376
1377 ScFormulaCell* pNewCell = new ScFormulaCell(*pDoc, rCellPos, std::move(pCode), eGrammar, ScMatrixMode::NONE);
1378 SetFormulaCell(pNewCell);
1379 rDocImport.setFormulaCell(rCellPos, pNewCell);
1380}
1381
1383{
1385 if( cellExists(*pDoc, rCellPos) )
1386 {
1387 SetContentValidation( rCellPos );
1388 SAL_WARN_IF((nColsRepeated != 1) || (nRepeatedRows != 1), "sc", "repeated cells with formula not possible now");
1390
1391 //add matrix
1392 if(bIsMatrix)
1393 {
1394 if (nMatrixCols > 0 && nMatrixRows > 0)
1395 {
1396 //matrix cells are put in the document, but we must set the
1397 //value/text of each matrix cell later
1399 rCellPos.Col(), rCellPos.Row(),
1400 std::min<SCCOL>(rCellPos.Col() + nMatrixCols - 1, pDoc->MaxCol()),
1401 std::min<SCROW>(rCellPos.Row() + nMatrixRows - 1, pDoc->MaxRow()),
1402 maFormula->first, maFormula->second, eGrammar);
1403
1404 // Set the value/text of the top-left matrix position in its
1405 // cached result. For import, we only need to set the correct
1406 // matrix geometry and the value type of the top-left element.
1407 ScFormulaCell* pFCell = pDoc->GetFormulaCell(rCellPos);
1408 if (pFCell)
1409 {
1412 {
1413 if (!IsPossibleErrorString())
1414 {
1415 pFCell->SetResultMatrix(
1418 pFCell->ResetDirty();
1419 }
1420 }
1421 else if (std::isfinite(fValue))
1422 {
1423 pFCell->SetResultMatrix(
1425 pFCell->ResetDirty();
1426 }
1427 }
1428 }
1429 }
1430 else
1431 PutFormulaCell( rCellPos );
1432
1433 SetAnnotation( rCellPos );
1434 SetDetectiveObj( rCellPos );
1435 SetCellRangeSource( rCellPos );
1437 }
1438 else
1439 {
1440 if (rCellPos.Row() > pDoc->MaxRow())
1442 else
1444 }
1445}
1446
1447//There are cases where a formula cell is exported with an office:value of 0 or
1448//no office:value at all, but the formula cell will have a text:p value which
1449//contains the intended formula result.
1450//These cases include when a formula result:
1451// - is blank
1452// - has a constant error value beginning with "#" (such as "#VALUE!" or "#N/A")
1453// - has an "Err:[###]" (where "[###]" is an error number)
1454// Libreoffice 4.1+ with ODF1.2 extended write however calcext:value-type="error" in that case
1456{
1458 return;
1459
1460 const OUString aStr = GetFirstParagraph();
1461
1462 if (mbNewValueType)
1463 {
1464 if (aStr.isEmpty())
1466 return;
1467 }
1468
1469 if (aStr.isEmpty())
1470 {
1471 mbPossibleErrorCell = true;
1473 }
1474 else if (aStr.startsWith("Err:"))
1475 mbPossibleErrorCell = true;
1476 else if (aStr.startsWith("#"))
1478}
1479
1481{
1483 return false;
1484 else if(mbNewValueType && mbErrorValue)
1485 return true;
1487 GetScImport().GetFormulaErrorConstant(*maStringValue) != FormulaError::NONE);
1488}
1489
1490void SAL_CALL ScXMLTableRowCellContext::endFastElement(sal_Int32 /*nElement*/)
1491{
1494 {
1496 }
1497
1499 if( aCellPos.Col() > 0 && nRepeatedRows > 1 )
1500 aCellPos.SetRow( aCellPos.Row() - (nRepeatedRows - 1) );
1501 if( bIsMerged )
1502 DoMerge( aCellPos, nMergedCols - 1, nMergedRows - 1 );
1503
1504 if (maFormula)
1505 AddFormulaCell(aCellPos);
1506 else
1507 AddNonFormulaCell(aCellPos);
1508
1509 //if LockSolarMutex got used, we presumably need to ensure an UnlockSolarMutex
1511 {
1513 bSolarMutexLocked = false;
1514 }
1515
1516 bIsMerged = false;
1517 nMergedCols = 1;
1518 nMergedRows = 1;
1519 nColsRepeated = 1;
1520}
1521
1522/* 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:418
static ScConditionMode GetModeFromApi(css::sheet::ConditionOperator nOperator)
Definition: conditio.cxx:1404
void SetSrcString(const OUString &rNew)
Definition: conditio.cxx:463
void InsertObject(ScDetectiveObjType eType, const ScAddress &rPosition, const ScRange &rSource, bool bRedLine)
Definition: detfunc.cxx:1678
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:897
SC_DLLPUBLIC sal_uInt32 GetNumberFormat(SCCOL nCol, SCROW nRow, SCTAB nTab) const
Definition: document.cxx:3685
SC_DLLPUBLIC SCCOL MaxCol() const
Definition: document.hxx:891
SC_DLLPUBLIC ScDocumentPool * GetPool()
Definition: document.cxx:6169
SC_DLLPUBLIC void ApplyPatternAreaTab(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, const ScPatternAttr &rAttr)
Definition: document.cxx:4863
SC_DLLPUBLIC SCROW MaxRow() const
Definition: document.hxx:892
SC_DLLPUBLIC ScFieldEditEngine & GetEditEngine()
Definition: documen2.cxx:477
SC_DLLPUBLIC void DoMerge(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, bool bDeleteCaptions=true)
Definition: documen3.cxx:2079
formula::FormulaGrammar::Grammar GetStorageGrammar() const
Definition: document.hxx:2534
SC_DLLPUBLIC void ApplyPattern(SCCOL nCol, SCROW nRow, SCTAB nTab, const ScPatternAttr &rAttr)
Definition: document.cxx:4840
SfxObjectShell * GetDocumentShell() const
Definition: document.hxx:1081
SC_DLLPUBLIC svl::SharedStringPool & GetSharedStringPool()
Definition: documen2.cxx:586
SC_DLLPUBLIC sal_uLong AddValidationEntry(const ScValidationData &rNew)
Definition: documen4.cxx:726
SC_DLLPUBLIC SvNumberFormatter * GetFormatTable() const
Definition: documen2.cxx:461
SC_DLLPUBLIC const ScFormulaCell * GetFormulaCell(const ScAddress &rPos) const
Definition: document.cxx:3765
SC_DLLPUBLIC CellType GetCellType(SCCOL nCol, SCROW nRow, SCTAB nTab) const
Definition: document.cxx:3789
SC_DLLPUBLIC sfx2::LinkManager * GetLinkManager()
Definition: documen2.cxx:231
void IncXMLImportedFormulaCount(sal_uInt64 nVal)
Definition: document.hxx:2453
void SetTextCurrentDefaults(const EditTextObject &rTextObject)
SetText and apply defaults already set.
Definition: editutil.cxx:616
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 * CreateNoteFromObjectData(ScDocument &rDoc, const ScAddress &rPos, SfxItemSet &&oItemSet, const OutlinerParaObject &rOutlinerObj, const tools::Rectangle &rCaptionRect, bool bShown)
Creates a cell note based on the passed caption object data.
Definition: postit.cxx:893
static ScPostIt * CreateNoteFromCaption(ScDocument &rDoc, const ScAddress &rPos, SdrCaptionObj *pCaption)
Creates a cell note using the passed caption drawing object.
Definition: postit.cxx:877
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:925
SfxItemSet & GetItemSet()
Definition: patattr.hxx:155
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:525
void SetDate(const OUString &rDate)
Sets a new creation date for this note.
Definition: postit.cxx:520
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:422
void SetListType(sal_Int16 nListType)
Definition: validat.hxx:117
void SetInput(const OUString &rTitle, const OUString &rMsg)
Definition: validat.cxx:160
void ResetInput()
Definition: validat.cxx:150
void SetError(const OUString &rTitle, const OUString &rMsg, ScValidErrorStyle eStyle)
Definition: validat.cxx:167
void ResetError()
Definition: validat.cxx:155
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:1571
ScMyStylesImportHelper * GetStylesImportHelper()
Definition: xmlimprt.hxx:250
ScDocumentImport & GetDoc()
Definition: xmlimprt.cxx:506
bool SetNullDateOnUnitConverter()
Definition: xmlimprt.cxx:1089
void LockSolarMutex()
Definition: xmlimprt.cxx:1520
FormulaError GetFormulaErrorConstant(const OUString &rStr) const
Definition: xmlimprt.cxx:1640
const ScXMLEditAttributeMap & GetEditAttributeMap() const
Definition: xmlimprt.cxx:1662
ScDocument * GetDocument()
Definition: xmlimprt.hxx:205
void UnlockSolarMutex()
Definition: xmlimprt.cxx:1538
bool GetValidation(const OUString &sName, ScMyImportValidation &aValidation)
Definition: xmlimprt.cxx:557
ScMyTables & GetTables()
Definition: xmlimprt.hxx:208
void SetRangeOverflowType(ErrCode nType)
Definition: xmlimprt.cxx:1561
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:1581
static sal_Int16 GetCellType(const char *rStrValue, const sal_Int32 nStrLength)
Definition: xmlimprt.cxx:511
void SetCellRangeSource(const ScAddress &rPosition)
Definition: xmlcelli.cxx:959
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:1335
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:1298
OUStringBuffer maParagraph
Definition: xmlcelli.hxx:69
void SetFormulaCell(ScFormulaCell *pFCell) const
Definition: xmlcelli.cxx:978
void PutValueCell(const ScAddress &rScCurrentPos)
Definition: xmlcelli.cxx:1117
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:1159
void SetAnnotation(const ScAddress &rPosition)
Definition: xmlcelli.cxx:823
void PushParagraphSpan(const OUString &rSpan, const OUString &rStyleName)
Definition: xmlcelli.cxx:313
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:1490
std::optional< FormulaWithNamespace > maFormula
Definition: xmlcelli.hxx:63
bool IsPossibleErrorString() const
Definition: xmlcelli.cxx:1480
std::unique_ptr< ScXMLAnnotationData > mxAnnotationData
Definition: xmlcelli.hxx:75
bool CellsAreRepeated() const
Definition: xmlcelli.cxx:1257
void PutTextCell(const ScAddress &rScCurrentPos, const SCCOL nCurrentCol, const ::std::optional< OUString > &pOUText)
Definition: xmlcelli.cxx:1020
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:1382
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:937
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()
OUString GetAbsoluteReference(const OUString &rValue) const
rtl::Reference< XMLShapeImportHelper > const & GetShapeImport()
const SvXMLUnitConverter & GetMM100UnitConverter() const
const css::uno::Reference< css::frame::XModel > & GetModel() const
SvXMLStylesContext * GetAutoStyles()
rtl::Reference< XMLTextImportHelper > const & GetTextImport()
const SvXMLStyleContext * FindStyleChildContext(XmlStyleFamily nFamily, const OUString &rName, bool bCreateIndex=false) const
void convertDateTime(OUStringBuffer &rBuffer, const double &fDateTime, bool const bAddTimeIf0AM=false)
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:271
@ CELLTYPE_EDIT
Definition: global.hxx:276
@ CELLTYPE_FORMULA
Definition: global.hxx:275
@ CELLTYPE_NONE
Definition: global.hxx:272
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:39
@ SC_VALID_TEXTLEN
Definition: validat.hxx:45
@ SC_VALID_TIME
Definition: validat.hxx:44
@ SC_VALID_CUSTOM
Definition: validat.hxx:47
@ SC_VALID_ANY
Definition: validat.hxx:40
@ SC_VALID_DECIMAL
Definition: validat.hxx:42
@ SC_VALID_WHOLE
Definition: validat.hxx:41
@ SC_VALID_DATE
Definition: validat.hxx:43
@ SC_VALID_LIST
Definition: validat.hxx:46
ScValidErrorStyle
Definition: validat.hxx:51
@ SC_VALERR_MACRO
Definition: validat.hxx:55
@ SC_VALERR_STOP
Definition: validat.hxx:52
@ SC_VALERR_WARNING
Definition: validat.hxx:53
@ SC_VALERR_INFO
Definition: validat.hxx:54
constexpr OUStringLiteral PERCENT(u"Percent")
#define XML_ELEMENT(prefix, name)
NF_DATE_SYS_DDMMYYYY