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( com::sun::star::uno::Any
& rAny
,
34 ScDocument
* pDoc
, const ScRange
& rRange
);
35 static bool FillLongArray( com::sun::star::uno::Any
& rAny
,
36 const ScMatrix
* pMatrix
);
37 static bool FillDoubleArray( com::sun::star::uno::Any
& rAny
,
38 ScDocument
* pDoc
, const ScRange
& rRange
);
39 static bool FillDoubleArray( com::sun::star::uno::Any
& rAny
,
40 const ScMatrix
* pMatrix
);
41 static bool FillStringArray( com::sun::star::uno::Any
& rAny
,
42 ScDocument
* pDoc
, const ScRange
& rRange
);
43 static bool FillStringArray( com::sun::star::uno::Any
& rAny
,
44 const ScMatrix
* pMatrix
, SvNumberFormatter
* pFormatter
);
45 static bool FillMixedArray( com::sun::star::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 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( com::sun::star::uno::Any
& rAny
,
56 const ScMatrix
* pMatrix
, bool bDataTypes
= false );
60 class ScApiTypeConversion
64 /** Convert an uno::Any to double if possible, including integer types.
66 Out: the double value on successful conversion.
68 Out: the uno::TypeClass of rAny.
69 @returns <TRUE/> if successfully converted.
71 static bool ConvertAnyToDouble(
73 com::sun::star::uno::TypeClass
& o_eClass
,
74 const com::sun::star::uno::Any
& rAny
);
79 class ScSequenceToMatrix
83 /** Convert a sequence of mixed elements to ScMatrix.
85 Precondition: rAny.getValueType().equals( getCppuType( (uno::Sequence< uno::Sequence< uno::Any > > *)0))
87 @returns a new'd ScMatrix as ScMatrixRef, NULL if rAny couldn't be read
88 as type Sequence<Sequence<Any>>
90 static ScMatrixRef
CreateMixedMatrix( const com::sun::star::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 com::sun::star::uno::Any
& rAny
,
101 sal_uInt16 nEncoding
);
106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */