1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SC_INC_GLOBAL_HXX
21 #define INCLUDED_SC_INC_GLOBAL_HXX
23 #include "address.hxx"
24 #include <i18nlangtag/lang.h>
25 #include <svx/svdtypes.hxx>
26 #include <tools/stream.hxx>
27 #include <com/sun/star/uno/Reference.hxx>
29 #include <rtl/ustring.hxx>
32 // HACK: <atomic> includes <stdbool.h>, which in some Clang versions does '#define bool bool',
33 // which confuses clang plugins.
43 enum class SvtScriptType
;
44 enum class FormulaError
: sal_uInt16
;
45 enum class SvNumFormatType
: sal_Int16
;
47 #define SC_COLLATOR_IGNORES css::i18n::CollatorOptions::CollatorOptions_IGNORE_CASE
49 // Calc has lots of names...
50 // Clipboard names are in so3/soapp.hxx now
51 // STRING_SCAPP was "scalc3", "scalc4", now just "scalc"
53 #define STRING_SCAPP "scalc"
55 #define STRING_STANDARD "Standard"
57 // Have the dreaded programmatic filter name defined in one place.
58 #define SC_TEXT_CSV_FILTER_NAME "Text - txt - csv (StarCalc)"
62 const sal_Unicode CHAR_NBSP
= 0x00A0;
63 const sal_Unicode CHAR_SHY
= 0x00AD;
64 const sal_Unicode CHAR_ZWSP
= 0x200B;
65 const sal_Unicode CHAR_LRM
= 0x200E;
66 const sal_Unicode CHAR_RLM
= 0x200F;
67 const sal_Unicode CHAR_NBHY
= 0x2011;
68 const sal_Unicode CHAR_ZWNBSP
= 0x2060;
70 #define MINDOUBLE 1.7e-307
71 #define MAXDOUBLE 1.7e307
76 const SCSIZE MAXSUBTOTAL
= 3;
78 #define PIXEL_PER_INCH 96.0
79 #define CM_PER_INCH 2.54
80 #define POINTS_PER_INCH 72.0 /**< PostScript points per inch */
81 #define PIXEL_PER_POINT (PIXEL_PER_INCH / POINTS_PER_INCH)
82 #define TWIPS_PER_POINT 20.0
83 #define TWIPS_PER_INCH (TWIPS_PER_POINT * POINTS_PER_INCH)
84 #define TWIPS_PER_CM (TWIPS_PER_INCH / CM_PER_INCH)
85 #define CM_PER_TWIPS (CM_PER_INCH / TWIPS_PER_INCH)
86 #define TWIPS_PER_PIXEL (TWIPS_PER_INCH / PIXEL_PER_INCH)
87 #define TWIPS_PER_CHAR (TWIPS_PER_INCH / 13.6)
88 #define PIXEL_PER_TWIPS (PIXEL_PER_INCH / TWIPS_PER_INCH)
89 #define HMM_PER_TWIPS (CM_PER_TWIPS * 1000.0)
91 #define STD_COL_WIDTH 1280 /* 2.2577cm, 64.00pt PS */
92 #define STD_EXTRA_WIDTH 113 /* 2mm extra for optimal width,
93 * 0.1986cm with TeX points,
94 * 0.1993cm with PS points. */
96 #define MAX_EXTRA_WIDTH 23811 /* 42cm in TWIPS, 41.8430cm TeX, 41.9999cm PS */
97 #define MAX_EXTRA_HEIGHT 23811
98 #define MAX_COL_WIDTH 56693 /* 1m in TWIPS, 99.6266cm TeX, 100.0001cm PS */
99 #define MAX_ROW_HEIGHT 56693
101 /* standard row height: text + margin - STD_ROWHEIGHT_DIFF */
102 #define STD_ROWHEIGHT_DIFF 23
106 inline long TwipsToHMM( long nTwips
) { return (nTwips
* 127 + 36) / 72; }
107 inline long HMMToTwips( long nHMM
) { return (nHMM
* 72 + 63) / 127; }
108 inline long TwipsToEvenHMM( long nTwips
) { return ( (nTwips
* 127 + 72) / 144 ) * 2; }
111 // standard size as OLE server (cells)
112 #define OLE_STD_CELLS_X 4
113 #define OLE_STD_CELLS_Y 5
116 // repaint flags (for messages)
117 enum class PaintPartFlags
{
126 All
= Grid
| Top
| Left
| Extras
| Objects
| Size
,
129 template<> struct typed_flags
<PaintPartFlags
> : is_typed_flags
<PaintPartFlags
, 0x07f> {};
132 // flags for columns / rows
133 enum class CRFlags
: sal_uInt8
{
134 // Filtered always together with Hidden
135 // Filtered and ManualSize only valid for rows
141 All
= Hidden
| ManualBreak
| Filtered
| ManualSize
144 template<> struct typed_flags
<CRFlags
> : is_typed_flags
<CRFlags
, 0x0f> {};
147 enum class ScBreakType
{
153 template<> struct typed_flags
<ScBreakType
> : is_typed_flags
<ScBreakType
, 0x03> {};
156 enum class InsertDeleteFlags
: sal_uInt16
159 VALUE
= 0x0001, /// Numeric values (and numeric results if InsertDeleteFlags::FORMULA is not set).
160 DATETIME
= 0x0002, /// Dates, times, datetime values.
161 STRING
= 0x0004, /// Strings (and string results if InsertDeleteFlags::FORMULA is not set).
162 NOTE
= 0x0008, /// Cell notes.
163 FORMULA
= 0x0010, /// Formula cells.
164 HARDATTR
= 0x0020, /// Hard cell attributes.
165 STYLES
= 0x0040, /// Cell styles.
166 OBJECTS
= 0x0080, /// Drawing objects.
167 EDITATTR
= 0x0100, /// Rich-text attributes.
168 OUTLINE
= 0x0800, /// Sheet / outlining (grouping) information
169 NOCAPTIONS
= 0x0200, /// Internal use only (undo etc.): do not copy/delete caption objects of cell notes.
170 ADDNOTES
= 0x0400, /// Internal use only (copy from clip): do not delete existing cell contents when pasting notes.
171 SPECIAL_BOOLEAN
= 0x1000,
172 FORGETCAPTIONS
= 0x2000, /// Internal use only (d&d undo): do not delete caption objects of cell notes.
173 ATTRIB
= HARDATTR
| STYLES
,
174 CONTENTS
= VALUE
| DATETIME
| STRING
| NOTE
| FORMULA
| OUTLINE
,
175 ALL
= CONTENTS
| ATTRIB
| OBJECTS
,
176 /// Copy flags for auto/series fill functions: do not touch notes and drawing objects.
177 AUTOFILL
= ALL
& ~(NOTE
| OBJECTS
)
181 template<> struct typed_flags
<InsertDeleteFlags
> : is_typed_flags
<InsertDeleteFlags
, 0x3fff> {};
183 // This doesn't work at the moment, perhaps when we have constexpr we can modify InsertDeleteFlags to make it work.
184 //static_assert((InsertDeleteFlags::ATTRIB & InsertDeleteFlags::CONTENTS) == InsertDeleteFlags::NONE, "these must match");
187 enum class ScPasteFunc
{
188 NONE
, ADD
, SUB
, MUL
, DIV
191 enum class HasAttrFlags
{
199 ShadowRight
= 0x0040,
202 Conditional
= 0x0200,
204 NotOverlapped
= 0x0800,
205 RightOrCenter
= 0x1000, // right or centered logical alignment
208 template<> struct typed_flags
<HasAttrFlags
> : is_typed_flags
<HasAttrFlags
, 0x1fff> {};
212 #define EMPTY_OUSTRING ScGlobal::GetEmptyOUString()
214 // Layer id's for drawing.
215 // These are both id's and positions.
216 constexpr SdrLayerID
SC_LAYER_FRONT (0);
217 constexpr SdrLayerID
SC_LAYER_BACK (1);
218 constexpr SdrLayerID
SC_LAYER_INTERN (2);
219 constexpr SdrLayerID
SC_LAYER_CONTROLS(3);
220 constexpr SdrLayerID
SC_LAYER_HIDDEN (4);
223 enum class ScLinkMode
{
227 enum class ScEnterMode
{
228 NORMAL
, BLOCK
, MATRIX
231 // step = 10pt, max. indention = 100 steps
232 #define SC_INDENT_STEP 200
234 enum class ScScenarioFlags
{ // scenario flags
245 template<> struct typed_flags
<ScScenarioFlags
> : is_typed_flags
<ScScenarioFlags
, 127> {};
248 enum class SubtotalFlags
{
250 IgnoreNestedStAg
= 0x08,
253 IgnoreFiltered
= 0x01
256 template<> struct typed_flags
<SubtotalFlags
> : is_typed_flags
<SubtotalFlags
, 0x0f> {};
259 enum class ScCloneFlags
{
260 /** Default cell clone flags: do not start listening, do not adjust 3D refs to
261 old position, clone note captions of cell notes. */
264 /** If set, cloned formula cells will start to listen to the document. */
265 StartListening
= 0x0001,
267 /** If set, absolute refs will not transformed to external references */
268 NoMakeAbsExternal
= 0x0002,
270 /** If set, global named expressions will be converted to sheet-local named
272 NamesToLocal
= 0x0004
276 template<> struct typed_flags
<ScCloneFlags
> : is_typed_flags
<ScCloneFlags
, 0x0007> {};
288 enum class DelCellCmd
359 SC_SIZE_DIRECT
, // set size or hide if value is 0
360 SC_SIZE_OPTIMAL
, // set optimal size for everything
361 SC_SIZE_SHOW
, // show with original size
362 SC_SIZE_VISOPT
, // set optimal size only if visible
363 SC_SIZE_ORIGINAL
// only set size, don't change visible flag
369 SC_INPUT_TYPE
, // input, while not in inplace mode
370 SC_INPUT_TABLE
, // text cursor in the table
371 SC_INPUT_TOP
// text cursor in the input line
374 enum ScVObjMode
// output modes of objects on a page
380 enum ScAnchorType
// anchor of a character object
382 SCA_CELL
, // anchor to cell, move with cell
383 SCA_CELL_RESIZE
, // anchor to cell, move and resize with cell
384 SCA_PAGE
, // anchor to page, independent of any cells
385 SCA_DONTKNOW
// for multi selection
390 SC_DB_MAKE
, ///< create "untitled" (if necessary)
391 SC_DB_AUTOFILTER
, ///< force use of sheet-local instead of document global anonymous range
392 SC_DB_IMPORT
, ///< create "Importx" (if necessary)
393 SC_DB_OLD
///< don't create
396 /// For ScDBFunc::GetDBData()
397 enum class ScGetDBSelection
399 /** Keep selection as is, expand to used data area if no selection. */
402 /** Shrink selection to actually used data area within the selection. */
405 /** If only one row or portion thereof is selected, shrink row to used data
406 columns and select further rows down until end of data. If an area is
407 selected, shrink rows to actually used columns. Else, no selection,
408 expand to used data area. */
411 /** Behave as if the range corresponding to a ScDBData area was selected,
416 enum ScLkUpdMode
// modes for updating links
424 // enum with values equal to old DBObject enum from sdb
433 enum class ColRowEditAction
453 OUString aDBName
; // alias of data base
456 bool bSql
; // statement or name?
457 sal_uInt8 nType
; // enum DBObject
460 ScImportParam( const ScImportParam
& r
);
463 ScImportParam
& operator= ( const ScImportParam
& r
);
464 bool operator== ( const ScImportParam
& r
) const;
471 class LegacyFuncCollection
;
472 class ScUnoAddInCollection
;
475 class ScFunctionList
;
479 class EditTextObject
;
480 class SfxObjectShell
;
481 class SvNumberFormatter
;
482 class ScUnitConverter
;
484 class LocaleDataWrapper
;
486 class CalendarWrapper
;
487 class CollatorWrapper
;
490 class ScFieldEditEngine
;
492 namespace com
{ namespace sun
{ namespace star
{
497 class XOrdinalSuffix
;
501 class TransliterationWrapper
;
506 static SvxSearchItem
* pSearchItem
;
507 static ScAutoFormat
* pAutoFormat
;
508 static std::atomic
<LegacyFuncCollection
*> pLegacyFuncCollection
;
509 static std::atomic
<ScUnoAddInCollection
*> pAddInCollection
;
510 static ScUserList
* pUserList
;
511 static std::map
<const char*, OUString
>* pRscString
;
512 static OUString
* pStrScDoc
;
513 static OUString
* pEmptyOUString
;
514 static OUString
* pStrClipDocName
;
515 static SvxBrushItem
* pEmptyBrushItem
;
516 static SvxBrushItem
* pButtonBrushItem
;
517 static SvxBrushItem
* pEmbeddedBrushItem
;
519 static ScFunctionList
* pStarCalcFunctionList
;
520 static ScFunctionMgr
* pStarCalcFunctionMgr
;
522 static ScUnitConverter
* pUnitConverter
;
524 static SvNumberFormatter
* pEnglishFormatter
; // for UNO / XML export
526 static css::uno::Reference
< css::i18n::XOrdinalSuffix
> xOrdinalSuffix
;
527 static CalendarWrapper
* pCalendar
;
528 static std::atomic
<CollatorWrapper
*> pCaseCollator
;
529 static std::atomic
<CollatorWrapper
*> pCollator
;
530 static std::atomic
<::utl::TransliterationWrapper
*> pTransliteration
;
531 static std::atomic
<::utl::TransliterationWrapper
*> pCaseTransliteration
;
532 static IntlWrapper
* pScIntlWrapper
;
533 static std::atomic
<css::lang::Locale
*> pLocale
;
535 static ScFieldEditEngine
* pFieldEditEngine
;
537 static void InitPPT();
540 static SvtSysLocale
* pSysLocale
;
541 // for faster access a pointer to the single instance provided by SvtSysLocale
542 SC_DLLPUBLIC
static const CharClass
* pCharClass
;
543 // for faster access a pointer to the single instance provided by SvtSysLocale
544 SC_DLLPUBLIC
static const LocaleDataWrapper
* pLocaleData
;
545 SC_DLLPUBLIC
static const LocaleDataWrapper
* GetpLocaleData();
547 static CalendarWrapper
* GetCalendar();
548 SC_DLLPUBLIC
static CollatorWrapper
* GetCollator();
549 static CollatorWrapper
* GetCaseCollator();
550 static css::lang::Locale
* GetLocale();
552 SC_DLLPUBLIC
static ::utl::TransliterationWrapper
* GetpTransliteration();
553 static ::utl::TransliterationWrapper
* GetCaseTransliteration();
555 SC_DLLPUBLIC
static LanguageType eLnge
;
556 static sal_Unicode cListDelimiter
;
558 static const OUString
& GetClipDocName();
559 static void SetClipDocName( const OUString
& rNew
);
560 SC_DLLPUBLIC
static const SvxSearchItem
& GetSearchItem();
561 SC_DLLPUBLIC
static void SetSearchItem( const SvxSearchItem
& rNew
);
562 SC_DLLPUBLIC
static ScAutoFormat
* GetAutoFormat();
563 SC_DLLPUBLIC
static ScAutoFormat
* GetOrCreateAutoFormat();
564 static void ClearAutoFormat(); //BugId 54209
565 static LegacyFuncCollection
* GetLegacyFuncCollection();
566 SC_DLLPUBLIC
static ScUnoAddInCollection
* GetAddInCollection();
567 SC_DLLPUBLIC
static ScUserList
* GetUserList();
568 static void SetUserList( const ScUserList
* pNewList
);
569 /// Open the specified URL.
570 static void OpenURL(const OUString
& rURL
, const OUString
& rTarget
);
571 SC_DLLPUBLIC
static OUString
GetAbsDocName( const OUString
& rFileName
,
572 const SfxObjectShell
* pShell
);
573 SC_DLLPUBLIC
static OUString
GetDocTabName( const OUString
& rFileName
,
574 const OUString
& rTabName
);
575 SC_DLLPUBLIC
static sal_uInt32
GetStandardFormat( SvNumberFormatter
&, sal_uInt32 nFormat
, SvNumFormatType nType
);
577 SC_DLLPUBLIC
static sal_uInt16
GetStandardRowHeight();
578 SC_DLLPUBLIC
static double nScreenPPTX
;
579 SC_DLLPUBLIC
static double nScreenPPTY
;
581 static tools::SvRef
<ScDocShell
> xDrawClipDocShellRef
;
583 static sal_uInt16 nDefFontHeight
;
584 SC_DLLPUBLIC
static sal_uInt16 nStdRowHeight
;
586 SC_DLLPUBLIC
static long nLastRowHeightExtra
;
587 static long nLastColWidthExtra
;
589 SC_DLLPUBLIC
static void Init(); // during start up
590 static void InitAddIns();
591 static void Clear(); // at the end of the program
593 static void InitTextHeight(const SfxItemPool
* pPool
);
594 static SvxBrushItem
* GetEmptyBrushItem() { return pEmptyBrushItem
; }
595 static SvxBrushItem
* GetButtonBrushItem();
596 SC_DLLPUBLIC
static const OUString
& GetEmptyOUString();
598 static bool HasStarCalcFunctionList();
599 static ScFunctionList
* GetStarCalcFunctionList();
600 static ScFunctionMgr
* GetStarCalcFunctionMgr();
601 static void ResetFunctionList();
603 static OUString
GetErrorString(FormulaError nErrNumber
);
604 static OUString
GetLongErrorString(FormulaError nErrNumber
);
605 static bool EETextObjEqual( const EditTextObject
* pObj1
,
606 const EditTextObject
* pObj2
);
607 static bool CheckWidthInvalidate( bool& bNumFormatChanged
,
608 const SfxItemSet
& rNewAttrs
,
609 const SfxItemSet
& rOldAttrs
);
610 static bool HasAttrChanged( const SfxItemSet
& rNewAttrs
,
611 const SfxItemSet
& rOldAttrs
,
612 const sal_uInt16 nWhich
);
614 static ScUnitConverter
* GetUnitConverter();
616 /// strchr() functionality on unicode, as long as we need it for FormulaToken etc.
617 static const sal_Unicode
* UnicodeStrChr( const sal_Unicode
* pStr
, sal_Unicode c
);
619 static sal_Unicode
ToUpperAlpha( sal_Unicode c
)
620 { return ( c
>= 'a' && c
<= 'z' ) ? ( c
-'a'+'A' ) : c
; }
622 /** Adds the string rToken to rTokenList, using a list separator character.
623 @param rTokenList The string list where the token will be appended to.
624 @param rToken The token string to append to the token list.
625 @param cSep The character to separate the tokens.
626 @param nSepCount Specifies how often cSep is inserted between two tokens.
627 @param bForceSep true = Always insert separator; false = Only, if not at begin or end. */
628 SC_DLLPUBLIC
static OUString
addToken(
629 const OUString
& rTokenList
, const OUString
& rToken
,
630 sal_Unicode cSep
, sal_Int32 nSepCount
= 1,
631 bool bForceSep
= false );
633 /** Returns true, if the first and last character of the string is cQuote. */
634 SC_DLLPUBLIC
static bool IsQuoted( const OUString
& rString
, sal_Unicode cQuote
);
636 /** Inserts the character cQuote at beginning and end of rString.
637 @param bEscapeEmbedded If <TRUE/>, embedded quote characters are
638 escaped by doubling them.
640 SC_DLLPUBLIC
static void AddQuotes( OUString
& rString
, sal_Unicode cQuote
, bool bEscapeEmbedded
= true );
642 /** Erases the character cQuote from rString, if it exists at beginning AND end.
643 @param bUnescapeEmbedded If <TRUE/>, embedded doubled quote characters
644 are unescaped by replacing them with a
647 SC_DLLPUBLIC
static void EraseQuotes( OUString
& rString
, sal_Unicode cQuote
, bool bUnescapeEmbedded
= true );
649 /** Finds an unquoted instance of cChar in rString, starting at
650 offset nStart. Unquoted instances may occur when concatenating two
651 quoted strings with a separator, for example, 's1':'s2'. Embedded
652 quotes have to be escaped by being doubled. Caller must ensure that
653 nStart points into an unquoted range or the opening quote. Specialty:
654 if cChar==cQuote the first cQuote character from nStart on is found.
655 @returns offset if found, else -1
657 SC_DLLPUBLIC
static sal_Int32
FindUnquoted( const OUString
& rString
, sal_Unicode cChar
);
659 /** Finds an unquoted instance of cChar in null-terminated pString. Same
660 semantics as FindUnquoted( const String&, ...)
661 @returns: pointer to cChar if found, else NULL
663 SC_DLLPUBLIC
static const sal_Unicode
* FindUnquoted( const sal_Unicode
* pString
, sal_Unicode cChar
);
665 static rtl_TextEncoding
GetCharsetValue( const OUString
& rCharSet
);
666 static OUString
GetCharsetString( rtl_TextEncoding eVal
);
668 /// a "ReadOnly" formatter for UNO/XML export
669 static SvNumberFormatter
* GetEnglishFormatter();
671 static bool IsSystemRTL(); // depending on system language
672 static LanguageType
GetEditDefaultLanguage(); // for EditEngine::SetDefaultLanguage
673 SC_DLLPUBLIC
static SvtScriptType
GetDefaultScriptType(); // for all WEAK characters
674 /** Map ATTR_((CJK|CTL)_)?FONT_... to proper WhichIDs.
675 If more than one SvtScriptType::... values are or'ed together, prefers
676 first COMPLEX, then ASIAN */
677 SC_DLLPUBLIC
static sal_uInt16
GetScriptedWhichID( SvtScriptType nScriptType
, sal_uInt16 nWhich
);
679 /** Adds a language item to the item set, if the number format item contains
680 a language that differs from its parent's language. */
681 SC_DLLPUBLIC
static void AddLanguage( SfxItemSet
& rSet
, const SvNumberFormatter
& rFormatter
);
683 /** Obtain the ordinal suffix for a number according to the system locale */
684 static OUString
GetOrdinalSuffix( sal_Int32 nNumber
);
686 /** A static instance of ScFieldEditEngine not capable of resolving
687 document specific fields, to be used only by ScEditUtil::GetString(). */
688 static ScFieldEditEngine
& GetStaticFieldEditEngine();
690 /** Replaces the first occurrence of rPlaceholder in rString with
691 rReplacement, or if rPlaceholder is not found appends one space if
692 rString does not end in a space and appends rReplacement.
694 Meant to be used with resource strings ala "Column %1" where a
695 translation may have omitted the %1 placeholder and a simple
696 replacement would end up with nothing replaced so no column indicator
697 in the result string.
699 SC_DLLPUBLIC
static OUString
ReplaceOrAppend( const OUString
& rString
,
700 const OUString
& rPlaceholder
,
701 const OUString
& rReplacement
);
704 /** Convert string content to numeric value.
706 In any case, if rError is set 0.0 is returned.
708 If nStringNoValueError is FormulaError::CellNoValue, that is unconditionally
709 assigned to rError and 0.0 is returned. The caller is expected to
710 handle this situation. Used by the interpreter.
712 Usually FormulaError::NoValue is passed as nStringNoValueError.
714 Otherwise, depending on the string conversion configuration different
715 approaches are taken:
718 For ScCalcConfig::StringConversion::ILLEGAL
719 The error value passed in nStringNoValueError is assigned to rError
723 For ScCalcConfig::StringConversion::ZERO
724 A zero value is returned and no error assigned.
727 For ScCalcConfig::StringConversion::LOCALE
729 If the string is empty or consists only of spaces, if "treat empty
730 string as zero" is set 0.0 is returned, else nStringNoValueError
731 assigned to rError (and 0.0 returned).
733 Else a non-empty string is passed to the number formatter's scanner to
734 be parsed locale dependent. If that does not detect a numeric value
735 nStringNoValueError is assigned to rError (and 0.0 returned).
737 If no number formatter was passed, the conversion falls back to
741 For ScCalcConfig::StringConversion::UNAMBIGUOUS
743 If the string is empty or consists only of spaces, if "treat empty
744 string as zero" is set 0.0 is returned, else nStringNoValueError
745 assigned to rError (and 0.0 returned).
747 If the string is not empty the following conversion rules are applied:
749 Converted are only integer numbers including exponent, and ISO 8601 dates
750 and times in their extended formats with separators. Anything else,
751 especially fractional numeric values with decimal separators or dates other
752 than ISO 8601 would be locale dependent and is a no-no. Leading and
753 trailing blanks are ignored.
755 The following ISO 8601 formats are converted:
760 CCYY-MM-DDThh:mm:ss,s
761 CCYY-MM-DDThh:mm:ss.s
767 The century CC may not be omitted and the two-digit year setting is not
768 taken into account. Instead of the T date and time separator exactly one
771 If a date is given, it must be a valid Gregorian calendar date. In this
772 case the optional time must be in the range 00:00 to 23:59:59.99999...
773 If only time is given, it may have any value for hours, taking elapsed time
774 into account; minutes and seconds are limited to the value 59 as well.
776 If the string can not be converted to a numeric value, the error value
777 passed in nStringNoValueError is assigned to rError.
781 The string to be converted.
784 The calculation configuration.
787 Contains the error on return, if any. If an error was set before
788 and the conversion did not result in an error, still 0.0 is
791 @param nStringNoValueError
792 The error value to be assigned to rError if string could not be
796 The number formatter to use in case of
797 ScCalcConfig::StringConversion::LOCALE. Can but should not be
798 nullptr in which case conversion falls back to
799 ScCalcConfig::StringConversion::UNAMBIGUOUS and if a date is
800 detected the null date is assumed to be the standard 1899-12-30
801 instead of the configured null date.
804 Can be assigned a format type in case a date or time or date+time
805 string was converted, e.g. SvNumFormatType::DATE or
806 SvNumFormatType::TIME or a combination thereof.
809 static double ConvertStringToValue( const OUString
& rStr
, const ScCalcConfig
& rConfig
,
810 FormulaError
& rError
, FormulaError nStringNoValueError
,
811 SvNumberFormatter
* pFormatter
, SvNumFormatType
& rCurFmtType
);
813 /// Calc's threaded group calculation is in progress.
814 static bool bThreadedGroupCalcInProgress
;
817 // maybe move to dbdata.hxx (?):
834 SC_DOES_NOT_BEGIN_WITH
,
847 SUBTOTAL_FUNC_NONE
= 0,
848 SUBTOTAL_FUNC_AVE
= 1,
849 SUBTOTAL_FUNC_CNT
= 2,
850 SUBTOTAL_FUNC_CNT2
= 3,
851 SUBTOTAL_FUNC_MAX
= 4,
852 SUBTOTAL_FUNC_MIN
= 5,
853 SUBTOTAL_FUNC_PROD
= 6,
854 SUBTOTAL_FUNC_STD
= 7,
855 SUBTOTAL_FUNC_STDP
= 8,
856 SUBTOTAL_FUNC_SUM
= 9,
857 SUBTOTAL_FUNC_VAR
= 10,
858 SUBTOTAL_FUNC_VARP
= 11,
859 SUBTOTAL_FUNC_MED
= 12,
860 SUBTOTAL_FUNC_SELECTION_COUNT
= 13
865 AGGREGATE_FUNC_AVE
= 1,
866 AGGREGATE_FUNC_CNT
= 2,
867 AGGREGATE_FUNC_CNT2
= 3,
868 AGGREGATE_FUNC_MAX
= 4,
869 AGGREGATE_FUNC_MIN
= 5,
870 AGGREGATE_FUNC_PROD
= 6,
871 AGGREGATE_FUNC_STD
= 7,
872 AGGREGATE_FUNC_STDP
= 8,
873 AGGREGATE_FUNC_SUM
= 9,
874 AGGREGATE_FUNC_VAR
= 10,
875 AGGREGATE_FUNC_VARP
= 11,
876 AGGREGATE_FUNC_MEDIAN
= 12,
877 AGGREGATE_FUNC_MODSNGL
= 13,
878 AGGREGATE_FUNC_LARGE
= 14,
879 AGGREGATE_FUNC_SMALL
= 15,
880 AGGREGATE_FUNC_PERCINC
= 16,
881 AGGREGATE_FUNC_QRTINC
= 17,
882 AGGREGATE_FUNC_PERCEXC
= 18,
883 AGGREGATE_FUNC_QRTEXC
= 19
888 struct ScConsolidateParam
890 SCCOL nCol
; // cursor position /
891 SCROW nRow
; // or start of destination area respectively
893 ScSubTotalFunc eFunction
;
894 sal_uInt16 nDataAreaCount
; // number of data areas
895 ScArea
** ppDataAreas
; // array of pointers into data areas
898 bool bReferenceData
; // reference source data
900 ScConsolidateParam();
901 ScConsolidateParam( const ScConsolidateParam
& r
);
902 ~ScConsolidateParam();
904 ScConsolidateParam
& operator= ( const ScConsolidateParam
& r
);
905 bool operator== ( const ScConsolidateParam
& r
) const;
906 void Clear (); // = ClearDataAreas()+Members
907 void ClearDataAreas ();
908 void SetAreas ( ScArea
* const* ppAreas
, sal_uInt16 nCount
);
911 extern SfxViewShell
* pScActiveViewShell
;
912 extern sal_uInt16 nScClickMouseModifier
;
913 extern sal_uInt16 nScFillModeMouseModifier
;
917 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */