/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
double ImpGetDate( const SbxValues* p )
{ switch( +p->eType )
{ case SbxEMPTY: return 0; case SbxCHAR: return p->nChar; case SbxBYTE: return p->nByte; case SbxINTEGER: case SbxBOOL: return p->nInteger; case SbxERROR: case SbxUSHORT: return p->nUShort; case SbxLONG: return p->nLong; case SbxULONG: return p->nULong; case SbxSINGLE: return p->nSingle; case SbxDATE: case SbxDOUBLE: return p->nDouble; case SbxCURRENCY: return CurTo<double>(p->nInt64); case SbxSALINT64: returnstatic_cast<double>(p->nInt64); case SbxSALUINT64: returnstatic_cast<double>(p->uInt64); case SbxDECIMAL: case SbxBYREF | SbxDECIMAL: if (p->pDecimal) if (double d; p->pDecimal->getDouble(d)) return d; return 0; case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: #if HAVE_FEATURE_SCRIPTING if (p->pOUString)
{
LanguageType eLangType = Application::GetSettings().GetLanguageTag().getLanguageType();
std::shared_ptr<SvNumberFormatter> pFormatter; if (GetSbData()->pInst)
{
pFormatter = GetSbData()->pInst->GetNumberFormatter();
} else
{
sal_uInt32 nDummy;
pFormatter = SbiInstance::PrepareNumberFormatter( nDummy, nDummy, nDummy );
}
// Default templates of the formatter have only two-digit // date. Therefore register an own format.
// HACK, because the number formatter in PutandConvertEntry replace the wildcard // for month, day, year not according to the configuration. // Problem: Print Year(Date) under Engl. OS // quod vide basic/source/runtime/runtime.cxx
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.