summaryrefslogtreecommitdiff
path: root/forms
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-09-28 15:49:26 +0200
committerNoel Grandin <noelgrandin@gmail.com>2014-10-01 07:34:23 +0000
commitfc04f76336fdf8c96e35382cdeb497e2f939705c (patch)
tree70c9bbd054a34a9bca9d22bb7afbb9c4349beff0 /forms
parenteb4811590c85895ce531674596bdd6afb3397725 (diff)
fdo#82577: Handle Time
Put the TOOLS Time class in the tools namespace. Avoids clash with the X11 Time typedef. Change-Id: Iac57d5aef35e81ace1ee0d5e6d76cb278f8ad866 Reviewed-on: https://gerrit.libreoffice.org/11684 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'forms')
-rw-r--r--forms/source/component/DatabaseForm.cxx4
-rw-r--r--forms/source/component/EditBase.cxx4
-rw-r--r--forms/source/xforms/datatypes.cxx10
-rw-r--r--forms/source/xforms/xpathlib/xpathlib.cxx6
4 files changed, 12 insertions, 12 deletions
diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx
index 676fb1897863..26430aa926e2 100644
--- a/forms/source/component/DatabaseForm.cxx
+++ b/forms/source/component/DatabaseForm.cxx
@@ -790,7 +790,7 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const Referenc
} break;
case FormComponentType::TIMEFIELD:
{
- // <name>=<value> // Value is a Time with the format HH:MM:SS
+ // <name>=<value> // Value is a tools::Time with the format HH:MM:SS
// no value (NULL) means empty value
if( hasProperty(PROPERTY_TIME, xComponentSet) )
{
@@ -799,7 +799,7 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const Referenc
sal_Int32 nInt32Val = 0;
if (aVal >>= nInt32Val)
{
- ::Time aTime(nInt32Val);
+ ::tools::Time aTime(nInt32Val);
OUStringBuffer aBuffer;
appendDigits( aTime.GetHour(), 2, aBuffer );
aBuffer.append( '-' );
diff --git a/forms/source/component/EditBase.cxx b/forms/source/component/EditBase.cxx
index 6b8ca643fdae..e5858535411e 100644
--- a/forms/source/component/EditBase.cxx
+++ b/forms/source/component/EditBase.cxx
@@ -127,7 +127,7 @@ void OEditBaseModel::write(const Reference<XObjectOutputStream>& _rxOutStream) t
{
util::Time aTime;
OSL_VERIFY(m_aDefault >>= aTime);
- _rxOutStream->writeHyper(::Time(aTime).GetTime());
+ _rxOutStream->writeHyper(::tools::Time(aTime).GetTime());
}
else if ((nAnyMask & DEFAULT_DATE) == DEFAULT_DATE)
{
@@ -193,7 +193,7 @@ void OEditBaseModel::read(const Reference<XObjectInputStream>& _rxInStream) thro
}
else if ((nAnyMask & DEFAULT_TIME) == DEFAULT_TIME)
{
- m_aDefault <<= ::Time(_rxInStream->readHyper()).GetUNOTime();
+ m_aDefault <<= ::tools::Time(_rxInStream->readHyper()).GetUNOTime();
}
else if ((nAnyMask & DEFAULT_DATE) == DEFAULT_DATE)
{
diff --git a/forms/source/xforms/datatypes.cxx b/forms/source/xforms/datatypes.cxx
index 6c8d643ecd13..84d9eb9dabf7 100644
--- a/forms/source/xforms/datatypes.cxx
+++ b/forms/source/xforms/datatypes.cxx
@@ -804,11 +804,11 @@ namespace xforms
{
Any aTypedValue = Convert::get().toAny( value, getCppuType() );
- Time aValue;
+ css::util::Time aValue;
if ( !( aTypedValue >>= aValue ) )
return false;
- ::Time aToolsTime( aValue.Hours, aValue.Minutes, aValue.Seconds, aValue.NanoSeconds );
+ ::tools::Time aToolsTime( aValue.Hours, aValue.Minutes, aValue.Seconds, aValue.NanoSeconds );
// no loss/rounding; IEEE 754 double-precision floating-point
// has a mantissa of 53 bits; we need at the very most 50 bits:
// format of aToolsTime.GetTime() is (in decimal) hhmmssnnnnnnnnn
@@ -830,9 +830,9 @@ namespace xforms
void OTimeType::normalizeValue( const Any& _rValue, double& _rDoubleValue ) const
{
- Time aValue;
+ css::util::Time aValue;
OSL_VERIFY( _rValue >>= aValue );
- ::Time aToolsTime( aValue.Hours, aValue.Minutes, aValue.Seconds, aValue.NanoSeconds );
+ ::tools::Time aToolsTime( aValue.Hours, aValue.Minutes, aValue.Seconds, aValue.NanoSeconds );
_rDoubleValue = aToolsTime.GetTime();
}
@@ -855,7 +855,7 @@ namespace xforms
{
::DateTime aToolsValue(
::Date( _rValue.Day, _rValue.Month, _rValue.Year ),
- ::Time( _rValue.Hours, _rValue.Minutes, _rValue.Seconds, _rValue.NanoSeconds )
+ ::tools::Time( _rValue.Hours, _rValue.Minutes, _rValue.Seconds, _rValue.NanoSeconds )
);
double fValue = 0;
diff --git a/forms/source/xforms/xpathlib/xpathlib.cxx b/forms/source/xforms/xpathlib/xpathlib.cxx
index b20c2ab79597..776a264f9a88 100644
--- a/forms/source/xforms/xpathlib/xpathlib.cxx
+++ b/forms/source/xforms/xpathlib/xpathlib.cxx
@@ -233,7 +233,7 @@ void xforms_propertyFunction(xmlXPathParserContextPtr ctxt, int nargs)
xmlXPathReturnEmptyString(ctxt);
}
-// Date and Time Functions
+// Date and tools::Time Functions
static OString makeDateTimeString (const DateTime& aDateTime, bool bUTC = true)
{
@@ -277,7 +277,7 @@ void xforms_nowFunction(xmlXPathParserContextPtr ctxt, int /*nargs*/)
3.2.7.2 Canonical representation
The canonical representation for dateTime is defined by prohibiting certain options
from the Lexical representation (par.3.2.7.1). Specifically, either the time zone must
- be omitted or, if present, the time zone must be Coordinated Universal Time (UTC)
+ be omitted or, if present, the time zone must be Coordinated Universal tools::Time (UTC)
indicated by a "Z".
*/
DateTime aDateTime( DateTime::SYSTEM );
@@ -317,7 +317,7 @@ static bool parseDateTime(const OUString& aString, DateTime& aDateTime)
sal_Int32 nSecond = aTimeString.getToken(0, ':', nIndex).toInt32();
Date tmpDate((sal_uInt16)nDay, (sal_uInt16)nMonth, (sal_uInt16)nYear);
- Time tmpTime(nHour, nMinute, nSecond);
+ tools::Time tmpTime(nHour, nMinute, nSecond);
DateTime tmpDateTime(tmpDate, tmpTime);
if (aString.indexOf(aUTCString) < 0)
tmpDateTime.ConvertToUTC();