Kaydet (Commit) 190196b9 authored tarafından Caolán McNamara's avatar Caolán McNamara

Date/Time no longer loaded from rsc files

Change-Id: Ia9ed86b0d96cac76c2e1639065a4ac594c2966b1
üst 959bcd56
......@@ -23,8 +23,6 @@
#include <com/sun/star/util/Date.hpp>
#include <sal/log.hxx>
class ResId;
enum DayOfWeek { MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY,
SATURDAY, SUNDAY };
......@@ -53,7 +51,6 @@ public:
Date( DateInitEmpty)
{ nDate = 0; }
Date( DateInitSystem );
Date( const ResId & rResId );
Date( sal_uInt32 _nDate ) { Date::nDate = _nDate; }
Date( const Date& rDate )
{ nDate = rDate.nDate; }
......
......@@ -41,9 +41,6 @@
#define RSC_MENU (RSC_NOTYPE + 0x1c)
#define RSC_MENUITEM (RSC_NOTYPE + 0x1d) // only used internally
#define RSC_KEYCODE (RSC_NOTYPE + 0x1f)
#define RSC_TIME (RSC_NOTYPE + 0x20)
#define RSC_DATE (RSC_NOTYPE + 0x21)
//#define RSC_INTERNATIONAL (RSC_NOTYPE + 0x22) // removed (2005-06-17)
#define RSC_IMAGE (RSC_NOTYPE + 0x23)
#define RSC_IMAGELIST (RSC_NOTYPE + 0x24)
......
......@@ -23,8 +23,6 @@
#include <tools/solar.h>
#include <com/sun/star/util/Time.hpp>
class ResId;
/**
@WARNING: This class can serve both as wall clock time and time duration, and
the mixing of these concepts leads to problems such as there being
......@@ -68,7 +66,6 @@ public:
Time( TimeInitEmpty )
{ nTime = 0; }
Time( TimeInitSystem );
Time( const ResId & rResId );
Time( sal_Int64 _nTime ) { Time::nTime = _nTime; }
Time( const tools::Time& rTime );
Time( const ::com::sun::star::util::Time& rTime );
......
......@@ -39,50 +39,6 @@ void Resource::GetRes( const ResId& rResId )
IncrementRes( sizeof( RSHEADER_TYPE ) );
}
namespace tools {
Time::Time( const ResId& rResId )
{
nTime = 0;
rResId.SetRT( RSC_TIME );
ResMgr* pResMgr = NULL;
ResMgr::GetResourceSkipHeader( rResId, &pResMgr );
sal_uIntPtr nObjMask = (sal_uInt16)pResMgr->ReadLong();
if ( 0x01 & nObjMask )
SetHour( (sal_uInt16)pResMgr->ReadShort() );
if ( 0x02 & nObjMask )
SetMin( (sal_uInt16)pResMgr->ReadShort() );
if ( 0x04 & nObjMask )
SetSec( (sal_uInt16)pResMgr->ReadShort() );
if ( 0x08 & nObjMask )
// TODO: when we change the place that writes this binary resource format to match:
// SetNanoSec( pResMgr->ReadLong() );
// In the meantime:
SetNanoSec( pResMgr->ReadShort() * ::tools::Time::nanoPerCenti );
}
} /* namespace tools */
Date::Date( const ResId& rResId ) : nDate(0)
{
rResId.SetRT( RSC_DATE );
ResMgr* pResMgr = NULL;
ResMgr::GetResourceSkipHeader( rResId, &pResMgr );
sal_uIntPtr nObjMask = (sal_uInt16)pResMgr->ReadLong();
if ( 0x01 & nObjMask )
SetYear( (sal_uInt16)pResMgr->ReadShort() );
if ( 0x02 & nObjMask )
SetMonth( (sal_uInt16)pResMgr->ReadShort() );
if ( 0x04 & nObjMask )
SetDay( (sal_uInt16)pResMgr->ReadShort() );
}
OUString ResId::toString() const
{
SetRT( RSC_STRING );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment