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_RANGESEQ_HXX
21 #define INCLUDED_SC_INC_RANGESEQ_HXX
24 #include <com/sun/star/uno/TypeClass.hpp>
26 namespace com::sun::star::uno
{ class Any
; }
28 class SvNumberFormatter
;
33 class ScRangeToSequence
36 static bool FillLongArray( css::uno::Any
& rAny
,
37 ScDocument
& rDoc
, const ScRange
& rRange
);
38 static bool FillLongArray( css::uno::Any
& rAny
,
39 const ScMatrix
* pMatrix
);
40 static bool FillDoubleArray( css::uno::Any
& rAny
,
41 ScDocument
& rDoc
, const ScRange
& rRange
);
42 static bool FillDoubleArray( css::uno::Any
& rAny
,
43 const ScMatrix
* pMatrix
);
44 static bool FillStringArray( css::uno::Any
& rAny
,
45 ScDocument
& rDoc
, const ScRange
& rRange
);
46 static bool FillStringArray( css::uno::Any
& rAny
,
47 const ScMatrix
* pMatrix
, SvNumberFormatter
* pFormatter
);
48 static bool FillMixedArray( css::uno::Any
& rAny
,
49 ScDocument
& rDoc
, const ScRange
& rRange
,
50 bool bAllowNV
= false );
53 Additionally to the differentiation between string and double allow
54 differentiation between other types such as boolean. Needed for
55 implementation of XFormulaParser. If <FALSE/>, boolean values are
56 treated as ordinary double values 1 (true) and 0 (false).
58 static bool FillMixedArray( css::uno::Any
& rAny
,
59 const ScMatrix
* pMatrix
, bool bDataTypes
= false );
62 class ScApiTypeConversion
66 /** Convert a uno::Any to double if possible, including integer types.
68 Out: the double value on successful conversion.
70 Out: the uno::TypeClass of rAny.
71 @returns <TRUE/> if successfully converted.
73 static bool ConvertAnyToDouble(
75 css::uno::TypeClass
& o_eClass
,
76 const css::uno::Any
& rAny
);
80 class ScSequenceToMatrix
84 /** Convert a sequence of mixed elements to ScMatrix.
86 Precondition: rAny.getValueType().equals( cppu::UnoType< uno::Sequence< uno::Sequence< uno::Any > > >::get() )
88 @returns a new'd ScMatrix as ScMatrixRef, NULL if rAny couldn't be read
89 as type Sequence<Sequence<Any>>
91 static ScMatrixRef
CreateMixedMatrix( const css::uno::Any
& rAny
);
95 class ScByteSequenceToString
98 // rAny must contain Sequence<sal_Int8>,
99 // may or may not contain 0-bytes at the end
100 static bool GetString( OUString
& rString
, const css::uno::Any
& rAny
,
101 sal_uInt16 nEncoding
);
106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */