LibreOffice Module sc (master) 1
stringutil.hxx
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#pragma once
21
22#include <rtl/ustring.hxx>
23#include "scdllapi.h"
24#include <i18nlangtag/lang.h>
25#include "types.hxx"
26
28enum class SvNumFormatType : sal_Int16;
29
35{
40 {
46
52
58
62 Never
63 };
64
71
78
84
92
94
101
103
108 void setTextInput();
109
114 void setNumericInput();
115};
116
118{
120
122
123 OUString maText;
124 double mfValue;
126};
127
129{
130public:
131
147 static bool parseSimpleNumber(
148 const OUString& rStr, sal_Unicode dsep, sal_Unicode gsep, sal_Unicode dsepa, double& rVal);
149
150 static bool parseSimpleNumber(
151 const char* p, size_t n, char dsep, char gsep, double& rVal);
152
153 static OUString SC_DLLPUBLIC GetQuotedToken(const OUString &rIn, sal_Int32 nToken, const OUString& rQuotedPairs,
154 sal_Unicode cTok, sal_Int32& rIndex );
155
156 static bool SC_DLLPUBLIC isMultiline( std::u16string_view rStr );
157
159 SvNumberFormatter& rFormatter, const OUString& rStr, LanguageType eLang );
160};
161
162/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static bool parseSimpleNumber(const OUString &rStr, sal_Unicode dsep, sal_Unicode gsep, sal_Unicode dsepa, double &rVal)
Check if a given string is a simple decimal number (e.g.
Definition: stringutil.cxx:52
static OUString SC_DLLPUBLIC GetQuotedToken(const OUString &rIn, sal_Int32 nToken, const OUString &rQuotedPairs, sal_Unicode cTok, sal_Int32 &rIndex)
Definition: stringutil.cxx:347
static ScInputStringType parseInputString(SvNumberFormatter &rFormatter, const OUString &rStr, LanguageType eLang)
Definition: stringutil.cxx:427
static bool SC_DLLPUBLIC isMultiline(std::u16string_view rStr)
Definition: stringutil.cxx:422
void * p
sal_Int64 n
StartListeningType
Definition: types.hxx:124
DefTokenId nToken
Definition: qproform.cxx:397
#define SC_DLLPUBLIC
Definition: scdllapi.h:27
SvNumFormatType mnFormatType
Definition: stringutil.hxx:125
StringType meType
Definition: stringutil.hxx:121
Store parameters used in the ScDocument::SetString() method.
Definition: stringutil.hxx:35
bool mbHandleApostrophe
When true, treat input with a leading apostrophe as an escape character for all content,...
Definition: stringutil.hxx:91
bool mbCheckLinkFormula
When true and the string results in a compiled formula, check the formula tokens for presence of func...
Definition: stringutil.hxx:100
bool mbDetectNumberFormat
When true, we try to detect special number format (dates etc) from the input string,...
Definition: stringutil.hxx:77
SvNumberFormatter * mpNumFormatter
Stores the pointer to the number formatter instance to be used during number format detection.
Definition: stringutil.hxx:70
TextFormatPolicy
Enum settings that take effect if mbDetectNumberFormat=false or if true a number was not detected.
Definition: stringutil.hxx:40
@ Always
Set Text number format if the input string can be parsed as a number or formula text.
Definition: stringutil.hxx:45
@ Keep
Keep an existing number format, do not set Text number format and do not set another number format.
Definition: stringutil.hxx:57
@ SpecialNumberOnly
Set Text number format only when the input string is considered a special number but we only want to ...
Definition: stringutil.hxx:51
TextFormatPolicy meSetTextNumFormat
Determine when to set the 'Text' number format to the cell where the input string is being set.
Definition: stringutil.hxx:83
sc::StartListeningType meStartListening
Definition: stringutil.hxx:93
sal_uInt16 sal_Unicode
#define SAL_WARN_UNUSED
SvNumFormatType