LibreOffice Module sc (master)  1
dputil.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 
10 #pragma once
11 
12 #include <sal/config.h>
13 
14 #include <string_view>
15 
16 #include <rtl/ustring.hxx>
17 #include "scdllapi.h"
18 #include "global.hxx"
19 
20 class SvNumberFormatter;
21 struct ScDPNumGroupInfo;
22 enum class ScGeneralFunction;
23 
24 class ScDPUtil
25 {
26 public:
27  static bool isDuplicateDimension(std::u16string_view rName);
28 
29  SC_DLLPUBLIC static OUString getSourceDimensionName(std::u16string_view rName);
30 
35  sal_uInt8 static getDuplicateIndex(const OUString& rName);
36 
37  SC_DLLPUBLIC static OUString createDuplicateDimensionName(const OUString& rOriginal, size_t nDupCount);
38 
39  SC_DLLPUBLIC static OUString getDateGroupName(
40  sal_Int32 nDatePart, sal_Int32 nValue, SvNumberFormatter* pFormatter,
41  double fStart, double fEnd);
42 
43  static double getNumGroupStartValue(double fValue, const ScDPNumGroupInfo& rInfo);
44 
45  static OUString getNumGroupName(
46  double fValue, const ScDPNumGroupInfo& rInfo, sal_Unicode cDecSep,
47  SvNumberFormatter* pFormatter);
48 
49  static sal_Int32 getDatePartValue(
50  double fValue, const ScDPNumGroupInfo* pInfo, sal_Int32 nDatePart,
51  const SvNumberFormatter* pFormatter);
52 
53  SC_DLLPUBLIC static OUString getDisplayedMeasureName(const OUString& rName, ScSubTotalFunc eFunc);
54 
56 };
57 
58 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static SC_DLLPUBLIC OUString createDuplicateDimensionName(const OUString &rOriginal, size_t nDupCount)
Definition: dputil.cxx:92
static OUString getNumGroupName(double fValue, const ScDPNumGroupInfo &rInfo, sal_Unicode cDecSep, SvNumberFormatter *pFormatter)
Definition: dputil.cxx:260
static bool isDuplicateDimension(std::u16string_view rName)
Definition: dputil.cxx:61
sal_uInt16 sal_Unicode
static SC_DLLPUBLIC OUString getDateGroupName(sal_Int32 nDatePart, sal_Int32 nValue, SvNumberFormatter *pFormatter, double fStart, double fEnd)
Definition: dputil.cxx:104
static double getNumGroupStartValue(double fValue, const ScDPNumGroupInfo &rInfo)
Definition: dputil.cxx:153
static SC_DLLPUBLIC OUString getSourceDimensionName(std::u16string_view rName)
Definition: dputil.cxx:66
static sal_uInt8 getDuplicateIndex(const OUString &rName)
Get a duplicate index in case the dimension is a duplicate.
Definition: dputil.cxx:71
unsigned char sal_uInt8
ScGeneralFunction
the css::sheet::GeneralFunction enum is extended by constants in GeneralFunction2, which causes some type-safety issues.
static sal_Int32 getDatePartValue(double fValue, const ScDPNumGroupInfo *pInfo, sal_Int32 nDatePart, const SvNumberFormatter *pFormatter)
Definition: dputil.cxx:287
static SC_DLLPUBLIC OUString getDisplayedMeasureName(const OUString &rName, ScSubTotalFunc eFunc)
Definition: dputil.cxx:384
ScSubTotalFunc
Definition: global.hxx:834
#define SC_DLLPUBLIC
Definition: scdllapi.h:27
static SC_DLLPUBLIC ScSubTotalFunc toSubTotalFunc(ScGeneralFunction eGenFunc)
Definition: dputil.cxx:395
sal_Int16 nValue