namespace com::sun::star::beans { class XPropertySet; } namespace com::sun::star::uno { class XComponentContext; } namespace com::sun::star::util { class XNumberFormatter2; }
namespace sca::analysis {
class ScaAnyConverter;
inlinebool IsLeapYear( sal_uInt16 nYear );
#ifdef DISABLE_DYNLOADING
// Avoid clash with the functions with same name in // scaddins/source/datefunc/datefunc.cxx. I am not sure if each pair // have identical semantics, but if yes, one copy should be enough, // but what would be a suitable library where such functions could go? // Or can the analysis library depend on the date library or the other // way around?
struct FuncDataBase
{ constchar* pIntName;
TranslateId pUINameID; // resource ID to UI name const TranslateId* pDescrID; // resource ID to description, parameter names and ~ description bool bDouble; // name already exist in Calc bool bWithOpt; // first parameter is internal constchar** pCompListID; // list of valid names
sal_uInt16 nNumOfParams; // number of named / described parameters
FDCategory eCat; // function category constchar* pSuffix; // if bDouble, append a suffix other than "_ADD" for UI
};
class FuncData final
{ private:
OUString aIntName;
TranslateId pUINameID; const TranslateId* pDescrID; // leads also to parameter descriptions! bool bDouble; // flag for names that already exist in Calc bool bWithOpt; // has internal parameter on first position
sal_uInt16 nParam; // num of parameters
std::vector<OUString> aCompList; // list of all valid names
FDCategory eCat; // function category
OUString aSuffix; // if bDouble and not empty, append a suffix other than "_ADD" for UI
sal_Int16 GetMatchingLevel( const OUString& rRef ) const; // 0.0 = no equality // 1.0 = matches exact // rest = matches without an assumed prefix of one character // rest gives power for 10 represented by the prefix (e.g. 3 for k or -9 for n
class ConvertDataLinear final : public ConvertData
{ double fOffs; public: inline ConvertDataLinear(
std::u16string_view sUnitName, double fConvertConstant, double fConvertOffset,
ConvertDataClass eClass, bool bPrefSupport = false );
virtual ~ConvertDataLinear() override;
virtualdouble Convert( double fVal, const ConvertData& rTo,
sal_Int16 nMatchLevelFrom, sal_Int16 nMatchLevelTo ) const override; // for cases where f(x) = a + bx applies (e.g. Temperatures)
// converts fVal from this unit to rFrom unit // throws exception if not from same class // this implementation is for proportional cases only double ConvertToBase( double fVal, sal_Int16 nMatchLevel ) const; double ConvertFromBase( double fVal, sal_Int16 nMatchLevel ) const;
};
class ConvertDataList
{ private:
std::vector<std::unique_ptr<ConvertData>> maVector; public:
ConvertDataList();
~ConvertDataList();
/// Helper class for date calculation for various financial functions class ScaDate
{ private:
sal_uInt16 nOrigDay; /// is the day of the original date.
sal_uInt16 nDay; /// is the calculated day depending on the current month/year.
sal_uInt16 nMonth; /// is the current month (one-based).
sal_uInt16 nYear; /// is the current year. bool bLastDayMode : 1; /// if true, recalculate nDay after every calculation. bool bLastDay : 1; /// is true, if original date was the last day in month. bool b30Days : 1; /// is true, if every month has 30 days in calculations. bool bUSMode : 1; /// is true, if the US method of 30-day-calculations is used.
/// Calculates nDay from nOrigDay and current date. void setDay();
/// @return count of days in current month inline sal_uInt16 getDaysInMonth() const; /// @return count of days in given month inline sal_uInt16 getDaysInMonth( sal_uInt16 _nMon ) const;
/// @ return count of days in the given month range
sal_Int32 getDaysInMonthRange( sal_uInt16 nFrom, sal_uInt16 nTo ) const; /// @ return count of days in the given year range
sal_Int32 getDaysInYearRange( sal_uInt16 nFrom, sal_uInt16 nTo ) const;
/// Adds/subtracts the given count of years, does not adjust day. /// /// @throws css::lang::IllegalArgumentException void doAddYears( sal_Int32 nYearCount );
/// @return the current month.
sal_uInt16 getMonth() const { return nMonth; }; /// @return the current year.
sal_uInt16 getYear() const { return nYear; };
/// adds/subtracts the given count of months, adjusts day /// /// @throws css::lang::IllegalArgumentException void addMonths( sal_Int32 nMonthCount );
/// sets the given year, adjusts day inlinevoid setYear( sal_uInt16 nNewYear ); /// adds/subtracts the given count of years, adjusts day /// /// @throws css::lang::IllegalArgumentException inlinevoid addYears( sal_Int32 nYearCount );
/// @return the internal number of the current date
sal_Int32 getDate( sal_Int32 nNullDate ) const; /// @return the number of days between the two dates /// /// @throws css::lang::IllegalArgumentException static sal_Int32 getDiff( const ScaDate& rFrom, const ScaDate& rTo );
/// Helper class for Any->double conversion, using the current locale class ScaAnyConverter
{ private:
css::uno::Reference< css::util::XNumberFormatter2 > xFormatter;
sal_Int32 nDefaultFormat; bool bHasValidFormat;
/** Converts a string to double using the number formatter. If the formatter is not valid,::rtl::math::stringToDouble()withenglishseparatorswillbeused. @throwscss::lang::IllegalArgumentException onstringsnotrepresentinganydoublevalue.
@return the converted double value. */ double convertToDouble( const OUString& rString ) const;
/// Initializing with the current locale /// /// @throws css::uno::RuntimeException void init( const css::uno::Reference< css::beans::XPropertySet >& xPropSet );
/** Converts an Any to double (without initialization). TheAnycanbeemptyorcontainadoubleorstring. @throwscss::lang::IllegalArgumentException onotherAnytypesoroninvalidstrings. @returntrueiftheAnycontainsadoubleoranon-emptyvalidstring,
false if the Any is empty or the string is empty */ bool getDouble( double& rfResult, const css::uno::Any& rAny ) const;
/** Converts an Any to double (with initialization). TheAnycanbeemptyorcontainadoubleorstring. @throwscss::lang::IllegalArgumentException onotherAnytypesoroninvalidstrings. @returntrueiftheAnycontainsadoubleoranon-emptyvalidstring,
false if the Any is empty or the string is empty */ bool getDouble( double& rfResult, const css::uno::Reference< css::beans::XPropertySet >& xPropSet, const css::uno::Any& rAny );
/** Converts an Any to double (with initialization). TheAnycanbeemptyorcontainadoubleorstring. @throwscss::lang::IllegalArgumentException onotherAnytypesoroninvalidstrings.
@return the value of the double or string or fDefault if the Any or string is empty */ double getDouble( const css::uno::Reference< css::beans::XPropertySet >& xPropSet, const css::uno::Any& rAny, double fDefault );
/** Converts an Any to sal_Int32 (with initialization). TheAnycanbeemptyorcontainadoubleorstring. @throwscss::lang::IllegalArgumentException onotherAnytypesoroninvalidvaluesorstrings. @returntrueiftheAnycontainsadoubleoranon-emptyvalidstring,
false if the Any is empty or the string is empty */ bool getInt32(
sal_Int32& rnResult, const css::uno::Reference< css::beans::XPropertySet >& xPropSet, const css::uno::Any& rAny );
/** Converts an Any to sal_Int32 (with initialization). TheAnycanbeemptyorcontainadoubleorstring. @throwscss::lang::IllegalArgumentException onotherAnytypesoroninvalidvaluesorstrings.
@return the truncated value of the double or string or nDefault if the Any or string is empty */
sal_Int32 getInt32( const css::uno::Reference< css::beans::XPropertySet >& xPropSet, const css::uno::Any& rAny,
sal_Int32 nDefault );
};
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.21Angebot
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-09-28)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.