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
23 #include <com/sun/star/uno/Any.h>
26 class SvNumberFormatter
;
30 class ScRangeToSequence
33 static bool FillLongArray( css::uno::Any
& rAny
,
34 ScDocument
* pDoc
, const ScRange
& rRange
);
35 static bool FillLongArray( css::uno::Any
& rAny
,
36 const ScMatrix
* pMatrix
);
37 static bool FillDoubleArray( css::uno::Any
& rAny
,
38 ScDocument
* pDoc
, const ScRange
& rRange
);
39 static bool FillDoubleArray( css::uno::Any
& rAny
,
40 const ScMatrix
* pMatrix
);
41 static bool FillStringArray( css::uno::Any
& rAny
,
42 ScDocument
* pDoc
, const ScRange
& rRange
);
43 static bool FillStringArray( css::uno::Any
& rAny
,
44 const ScMatrix
* pMatrix
, SvNumberFormatter
* pFormatter
);
45 static bool FillMixedArray( css::uno::Any
& rAny
,
46 ScDocument
* pDoc
, const ScRange
& rRange
,
47 bool bAllowNV
= false );
50 Additionally to the differentiation between string and double allow
51 differentiation between other types such as boolean. Needed for
52 implementation of XFormulaParser. If <FALSE/>, boolean values are
53 treated as ordinary double values 1 (true) and 0 (false).
55 static bool FillMixedArray( css::uno::Any
& rAny
,
56 const ScMatrix
* pMatrix
, bool bDataTypes
= false );
59 class ScApiTypeConversion
63 /** Convert an uno::Any to double if possible, including integer types.
65 Out: the double value on successful conversion.
67 Out: the uno::TypeClass of rAny.
68 @returns <TRUE/> if successfully converted.
70 static bool ConvertAnyToDouble(
72 css::uno::TypeClass
& o_eClass
,
73 const css::uno::Any
& rAny
);
77 class ScSequenceToMatrix
81 /** Convert a sequence of mixed elements to ScMatrix.
83 Precondition: rAny.getValueType().equals( cppu::UnoType< uno::Sequence< uno::Sequence< uno::Any > > >::get() )
85 @returns a new'd ScMatrix as ScMatrixRef, NULL if rAny couldn't be read
86 as type Sequence<Sequence<Any>>
88 static ScMatrixRef
CreateMixedMatrix( const css::uno::Any
& rAny
);
92 class ScByteSequenceToString
95 // rAny must contain Sequence<sal_Int8>,
96 // may or may not contain 0-bytes at the end
97 static bool GetString( OUString
& rString
, const css::uno::Any
& rAny
,
98 sal_uInt16 nEncoding
);
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */