From af4df7ac089134df888ada3cd36b27a0b62babab Mon Sep 17 00:00:00 2001 From: Jack Leigh Date: Wed, 3 Oct 2012 16:35:47 +0100 Subject: fdo#48257 collect function prototypes from basic/ into single header file Change-Id: I1666e64b2b611054e1a713a76575e2f06781f80a --- basic/source/inc/date.hxx | 37 +++++++++++++++++++++++++++++++++++++ basic/source/runtime/methods.cxx | 8 +------- basic/source/runtime/methods1.cxx | 13 +------------ basic/source/sbx/sbxscan.cxx | 8 +------- 4 files changed, 40 insertions(+), 26 deletions(-) create mode 100644 basic/source/inc/date.hxx (limited to 'basic') diff --git a/basic/source/inc/date.hxx b/basic/source/inc/date.hxx new file mode 100644 index 000000000000..cd38c896d1df --- /dev/null +++ b/basic/source/inc/date.hxx @@ -0,0 +1,37 @@ +/* -*- 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 . + */ + +#ifndef _SBDATE_HXX +#define _SBDATE_HXX + +bool implDateSerial( sal_Int16 nYear, sal_Int16 nMonth, sal_Int16 nDay, double& rdRet ); + +sal_Int16 implGetWeekDay( double aDate, bool bFirstDayParam = false, sal_Int16 nFirstDay = 0 ); + +sal_Int16 implGetDateYear( double aDate ); +sal_Int16 implGetDateMonth( double aDate ); +sal_Int16 implGetDateDay( double aDate ); + +sal_Int16 implGetHour( double dDate ); +sal_Int16 implGetMinute( double dDate ); +sal_Int16 implGetSecond( double dDate ); + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index a90cc0e72817..054de265eb46 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -63,6 +63,7 @@ using namespace com::sun::star; #include +#include "date.hxx" #include "stdobj.hxx" #include #include "rtlproto.hxx" @@ -103,9 +104,6 @@ SbxVariable* getDefaultProp( SbxVariable* pRef ); #ifndef DISABLE_SCRIPTING -// forward decl. -bool implDateSerial( sal_Int16 nYear, sal_Int16 nMonth, sal_Int16 nDay, double& rdRet ); - // from source/classes/sbxmod.cxx uno::Reference< frame::XModel > getDocumentModel( StarBASIC* ); @@ -1701,8 +1699,6 @@ sal_Int16 implGetDateMonth( double aDate ) return nRet; } -sal_Int16 implGetDateYear( double aDate ); - // Function to convert date to ISO 8601 date format RTLFUNC(CDateToIso) { @@ -1956,8 +1952,6 @@ RTLFUNC(Hour) } } -sal_Int16 implGetMinute( double dDate ); - RTLFUNC(Minute) { (void)pBasic; diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx index 3e1d94900f76..4692ca49d47d 100644 --- a/basic/source/runtime/methods1.cxx +++ b/basic/source/runtime/methods1.cxx @@ -32,6 +32,7 @@ #include #include +#include "date.hxx" #include "sbintern.hxx" #include "runtime.hxx" #include "stdobj.hxx" @@ -57,7 +58,6 @@ using namespace com::sun::star::i18n; void unoToSbxValue( SbxVariable* pVar, const Any& aValue ); Any sbxToUnoValue( SbxVariable* pVar, const Type& rType, com::sun::star::beans::Property* pUnoProperty = NULL ); -sal_Int16 implGetWeekDay( double aDate, bool bFirstDayParam = false, sal_Int16 nFirstDay = 0 ); static Reference< XCalendar3 > getLocaleCalendar( void ) { @@ -1906,17 +1906,6 @@ IntervalInfo* getIntervalInfo( const String& rStringCode ) return pInfo; } -// From methods.cxx -bool implDateSerial( sal_Int16 nYear, sal_Int16 nMonth, sal_Int16 nDay, double& rdRet ); -sal_Int16 implGetDateDay( double aDate ); -sal_Int16 implGetDateMonth( double aDate ); -sal_Int16 implGetDateYear( double aDate ); - -sal_Int16 implGetHour( double dDate ); -sal_Int16 implGetMinute( double dDate ); -sal_Int16 implGetSecond( double dDate ); - - inline void implGetDayMonthYear( sal_Int16& rnYear, sal_Int16& rnMonth, sal_Int16& rnDay, double dDate ) { rnDay = implGetDateDay( dDate ); diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx index bc235236d785..7ea06b5e4fb5 100644 --- a/basic/source/sbx/sbxscan.cxx +++ b/basic/source/sbx/sbxscan.cxx @@ -39,6 +39,7 @@ #include #include "basrid.hxx" +#include "date.hxx" #include "runtime.hxx" #include @@ -689,13 +690,6 @@ VbaFormatInfo* getFormatInfo( const String& rFmt ) #define VBAFORMAT_LOWERCASE "<" #define VBAFORMAT_UPPERCASE ">" -// From methods1.cxx -sal_Int16 implGetWeekDay( double aDate, bool bFirstDayParam = false, sal_Int16 nFirstDay = 0 ); -// from methods.cxx -sal_Int16 implGetMinute( double dDate ); -sal_Int16 implGetDateYear( double aDate ); -bool implDateSerial( sal_Int16 nYear, sal_Int16 nMonth, sal_Int16 nDay, double& rdRet ); - void SbxValue::Format( XubString& rRes, const XubString* pFmt ) const { short nComma = 0; -- cgit