summaryrefslogtreecommitdiff
path: root/sfx2/source
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 /sfx2/source
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 'sfx2/source')
-rw-r--r--sfx2/source/dialog/dialoghelper.cxx2
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx18
-rw-r--r--sfx2/source/dialog/versdlg.cxx4
-rw-r--r--sfx2/source/doc/SfxDocumentMetaData.cxx4
-rw-r--r--sfx2/source/doc/docfile.cxx2
-rw-r--r--sfx2/source/doc/objcont.cxx12
-rw-r--r--sfx2/source/doc/oleprops.cxx4
7 files changed, 23 insertions, 23 deletions
diff --git a/sfx2/source/dialog/dialoghelper.cxx b/sfx2/source/dialog/dialoghelper.cxx
index 8221d3af3866..4c4242390c38 100644
--- a/sfx2/source/dialog/dialoghelper.cxx
+++ b/sfx2/source/dialog/dialoghelper.cxx
@@ -81,7 +81,7 @@ Size SFX2_DLLPUBLIC getPreviewOptionsSize(const vcl::Window *pReference)
OUString SFX2_DLLPUBLIC getWidestTime(const LocaleDataWrapper& rWrapper)
{
Date aDate(22, 12, 2000);
- Time aTime(22, 59, 59);
+ tools::Time aTime(22, 59, 59);
DateTime aDateTime(aDate, aTime);
return formatTime(aDateTime, rWrapper);
}
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index c1d220eb7a4b..ccbf9139908a 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -176,7 +176,7 @@ OUString ConvertDateTime_Impl( const OUString& rName,
const util::DateTime& uDT, const LocaleDataWrapper& rWrapper )
{
Date aD(uDT.Day, uDT.Month, uDT.Year);
- Time aT(uDT.Hours, uDT.Minutes, uDT.Seconds, uDT.NanoSeconds);
+ tools::Time aT(uDT.Hours, uDT.Minutes, uDT.Seconds, uDT.NanoSeconds);
const OUString pDelim ( ", " );
OUString aStr( rWrapper.getDate( aD ) );
aStr += pDelim;
@@ -719,7 +719,7 @@ namespace
const LocaleDataWrapper& rWrapper( Application::GetSettings().GetLocaleDataWrapper() );
Date aDate( _nDate );
- Time aTime( _nTime );
+ tools::Time aTime( _nTime );
OUString aStr( rWrapper.getDate( aDate ) );
aStr += ", ";
aStr += rWrapper.getTime( aTime );
@@ -809,7 +809,7 @@ IMPL_LINK_NOARG(SfxDocumentPage, DeleteHdl)
OUString aEmpty;
m_pChangeValFt->SetText( aEmpty );
m_pPrintValFt->SetText( aEmpty );
- const Time aTime( 0 );
+ const tools::Time aTime( 0 );
m_pTimeLogValFt->SetText( rLocaleWrapper.getDuration( aTime ) );
m_pDocNoValFt->SetText(OUString('1'));
bHandleDelete = true;
@@ -1093,7 +1093,7 @@ void SfxDocumentPage::Reset( const SfxItemSet* rSet )
const long nTime = m_pInfoItem->getEditingDuration();
if ( m_bUseUserData )
{
- const Time aT( nTime/3600, (nTime%3600)/60, nTime%60 );
+ const tools::Time aT( nTime/3600, (nTime%3600)/60, nTime%60 );
m_pTimeLogValFt->SetText( rLocaleWrapper.getDuration( aT ) );
m_pDocNoValFt->SetText( OUString::number(
m_pInfoItem->getEditingCycles() ) );
@@ -1804,7 +1804,7 @@ void CustomPropertiesWindow::AddLine( const OUString& sName, Any& rAny )
else if ( rAny >>= aTmpDateTime )
{
pNewLine->m_aDateField.SetDate( Date( aTmpDateTime.Day, aTmpDateTime.Month, aTmpDateTime.Year ) );
- pNewLine->m_aTimeField.SetTime( Time( aTmpDateTime.Hours, aTmpDateTime.Minutes, aTmpDateTime.Seconds, aTmpDateTime.NanoSeconds ) );
+ pNewLine->m_aTimeField.SetTime( tools::Time( aTmpDateTime.Hours, aTmpDateTime.Minutes, aTmpDateTime.Seconds, aTmpDateTime.NanoSeconds ) );
pNewLine->m_aTimeField.m_isUTC = aTmpDateTime.IsUTC;
nType = CUSTOM_TYPE_DATETIME;
}
@@ -1819,7 +1819,7 @@ void CustomPropertiesWindow::AddLine( const OUString& sName, Any& rAny )
{
util::DateTime const& rDT(aTmpDateTimeTZ.DateTimeInTZ);
pNewLine->m_aDateField.SetDate( Date( rDT.Day, rDT.Month, rDT.Year ) );
- pNewLine->m_aTimeField.SetTime( Time( rDT.Hours, rDT.Minutes,
+ pNewLine->m_aTimeField.SetTime( tools::Time( rDT.Hours, rDT.Minutes,
rDT.Seconds, rDT.NanoSeconds ) );
pNewLine->m_aTimeField.m_isUTC = rDT.IsUTC;
pNewLine->m_aDateField.m_TZ = aTmpDateTimeTZ.Timezone;
@@ -1939,7 +1939,7 @@ Sequence< beans::PropertyValue > CustomPropertiesWindow::GetCustomProperties() c
else if ( CUSTOM_TYPE_DATETIME == nType )
{
Date aTmpDate = pLine->m_aDateField.GetDate();
- Time aTmpTime = pLine->m_aTimeField.GetTime();
+ tools::Time aTmpTime = pLine->m_aTimeField.GetTime();
util::DateTime const aDateTime(aTmpTime.GetNanoSec(),
aTmpTime.GetSec(), aTmpTime.GetMin(), aTmpTime.GetHour(),
aTmpDate.GetDay(), aTmpDate.GetMonth(), aTmpDate.GetYear(),
@@ -2211,7 +2211,7 @@ CmisDateTime::CmisDateTime( vcl::Window* pParent, const util::DateTime& aDateTim
m_aDateField->Show( true );
m_aTimeField->Show( true );
m_aDateField->SetDate( Date( aDateTime.Day, aDateTime.Month, aDateTime.Year ) );
- m_aTimeField->SetTime( Time( aDateTime.Hours, aDateTime.Minutes,
+ m_aTimeField->SetTime( tools::Time( aDateTime.Hours, aDateTime.Minutes,
aDateTime.Seconds, aDateTime.NanoSeconds ) );
}
@@ -2495,7 +2495,7 @@ Sequence< document::CmisProperty > CmisPropertiesWindow::GetCmisProperties() con
it != pLine->m_aDateTimes.end(); ++it, ++k)
{
Date aTmpDate = (*it)->m_aDateField->GetDate();
- Time aTmpTime = (*it)->m_aTimeField->GetTime();
+ tools::Time aTmpTime = (*it)->m_aTimeField->GetTime();
util::DateTime aDateTime( aTmpTime.GetNanoSec(), aTmpTime.GetSec(),
aTmpTime.GetMin(), aTmpTime.GetHour(),
aTmpDate.GetDay(), aTmpDate.GetMonth(),
diff --git a/sfx2/source/dialog/versdlg.cxx b/sfx2/source/dialog/versdlg.cxx
index 16788ee79baf..970a5c5f683c 100644
--- a/sfx2/source/dialog/versdlg.cxx
+++ b/sfx2/source/dialog/versdlg.cxx
@@ -95,7 +95,7 @@ SfxVersionTableDtor::SfxVersionTableDtor( const uno::Sequence < util::RevisionTa
pInfo->aAuthor = rInfo[n].Author;
Date aDate ( rInfo[n].TimeStamp.Day, rInfo[n].TimeStamp.Month, rInfo[n].TimeStamp.Year );
- Time aTime ( rInfo[n].TimeStamp.Hours, rInfo[n].TimeStamp.Minutes, rInfo[n].TimeStamp.Seconds, rInfo[n].TimeStamp.NanoSeconds );
+ tools::Time aTime ( rInfo[n].TimeStamp.Hours, rInfo[n].TimeStamp.Minutes, rInfo[n].TimeStamp.Seconds, rInfo[n].TimeStamp.NanoSeconds );
pInfo->aCreationDate = DateTime( aDate, aTime );
aTableList.push_back( pInfo );
@@ -112,7 +112,7 @@ SfxVersionTableDtor::SfxVersionTableDtor( const uno::Sequence < document::CmisVe
pInfo->aAuthor = rInfo[n].Author;
Date aDate ( rInfo[n].TimeStamp.Day, rInfo[n].TimeStamp.Month, rInfo[n].TimeStamp.Year );
- Time aTime ( rInfo[n].TimeStamp.Hours, rInfo[n].TimeStamp.Minutes, rInfo[n].TimeStamp.Seconds, rInfo[n].TimeStamp.NanoSeconds );
+ tools::Time aTime ( rInfo[n].TimeStamp.Hours, rInfo[n].TimeStamp.Minutes, rInfo[n].TimeStamp.Seconds, rInfo[n].TimeStamp.NanoSeconds );
pInfo->aCreationDate = DateTime( aDate, aTime );
aTableList.push_back( pInfo );
diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx
index 0eb060b5e307..6f08db6a1b1c 100644
--- a/sfx2/source/doc/SfxDocumentMetaData.cxx
+++ b/sfx2/source/doc/SfxDocumentMetaData.cxx
@@ -967,7 +967,7 @@ propsToStrings(css::uno::Reference<css::beans::XPropertySet> const & i_xPropSet)
OUString("date")));
} else if (type == ::cppu::UnoType<css::util::Time>::get()) {
// #i97029#: replaced by Duration
- // Time is supported for backward compatibility with OOo 3.x, x<=2
+ // tools::Time is supported for backward compatibility with OOo 3.x, x<=2
css::util::Time ut;
any >>= ut;
css::util::Duration ud;
@@ -2274,7 +2274,7 @@ void SfxDocumentMetaData::createUserDefined()
types[ 9] = ::cppu::UnoType<sal_Int16>::get();
types[10] = ::cppu::UnoType<sal_Int32>::get();
types[11] = ::cppu::UnoType<sal_Int64>::get();
- // Time is supported for backward compatibility with OOo 3.x, x<=2
+ // tools::Time is supported for backward compatibility with OOo 3.x, x<=2
types[12] = ::cppu::UnoType<css::util::Time>::get();
// #i94175#: ODF allows empty user-defined property names!
m_xUserDefined.set(
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index a844e2134a82..e48a5cff78f6 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -272,7 +272,7 @@ SfxMedium_Impl::SfxMedium_Impl( SfxMedium* pAntiImplP ) :
m_pInStream(NULL),
m_pOutStream(NULL),
pOrigFilter( 0 ),
- aExpireTime( Date( Date::SYSTEM ) + 10, Time( Time::SYSTEM ) ),
+ aExpireTime( Date( Date::SYSTEM ) + 10, tools::Time( tools::Time::SYSTEM ) ),
pTempFile( NULL ),
nLastStorageError( 0 ),
m_nSignatureState( SIGNATURESTATE_NOSIGNATURES )
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx
index 330f6b9e1384..de320ed56cf4 100644
--- a/sfx2/source/doc/objcont.cxx
+++ b/sfx2/source/doc/objcont.cxx
@@ -216,10 +216,10 @@ void SfxObjectShell::UpdateDocInfoForSave()
static void
-lcl_add(util::Duration & rDur, Time const& rTime)
+lcl_add(util::Duration & rDur, tools::Time const& rTime)
{
// here we don't care about overflow: rDur is converted back to seconds
- // anyway, and Time cannot store more than ~4000 hours
+ // anyway, and tools::Time cannot store more than ~4000 hours
rDur.Hours += rTime.GetHour();
rDur.Minutes += rTime.GetMin();
rDur.Seconds += rTime.GetSec();
@@ -236,9 +236,9 @@ void SfxObjectShell::UpdateTime_Impl(
// Initialize some local member! Its necessary for wollow operations!
DateTime aNow( DateTime::SYSTEM ); // Date and time at current moment
- Time n24Time (24,0,0,0) ; // Time-value for 24 hours - see follow calculation
+ tools::Time n24Time (24,0,0,0) ; // Time-value for 24 hours - see follow calculation
sal_uIntPtr nDays = 0 ; // Count of days between now and last editing
- Time nAddTime (0) ; // Value to add on aOldTime
+ tools::Time nAddTime (0) ; // Value to add on aOldTime
// Safe impossible cases!
// User has changed time to the past between last editing and now ... its not possible!!!
@@ -254,7 +254,7 @@ void SfxObjectShell::UpdateTime_Impl(
if (nDays==0)
{
// If no day between now and last editing - calculate time directly.
- nAddTime = (const Time&)aNow - (const Time&)pImp->nTime ;
+ nAddTime = (const tools::Time&)aNow - (const tools::Time&)pImp->nTime ;
}
else if (nDays<=31)
{
@@ -265,7 +265,7 @@ void SfxObjectShell::UpdateTime_Impl(
// nAddTime = (24h - nTime) + (nDays * 24h) + aNow
--nDays;
nAddTime = nDays*n24Time.GetTime() ;
- nAddTime += n24Time-(const Time&)pImp->nTime ;
+ nAddTime += n24Time-(const tools::Time&)pImp->nTime ;
nAddTime += aNow ;
}
diff --git a/sfx2/source/doc/oleprops.cxx b/sfx2/source/doc/oleprops.cxx
index 717dd8bb6f8a..9516e31871cb 100644
--- a/sfx2/source/doc/oleprops.cxx
+++ b/sfx2/source/doc/oleprops.cxx
@@ -39,7 +39,7 @@ using ::com::sun::star::uno::makeAny;
using namespace ::com::sun::star;
-#define TIMESTAMP_INVALID_DATETIME ( DateTime ( Date ( 1, 1, 1601 ), Time ( 0, 0, 0 ) ) ) /// Invalid value for date and time to create invalid instance of TimeStamp.
+#define TIMESTAMP_INVALID_DATETIME ( DateTime ( Date ( 1, 1, 1601 ), tools::Time ( 0, 0, 0 ) ) ) /// Invalid value for date and time to create invalid instance of TimeStamp.
/// Invalid value for date and time to create invalid instance of TimeStamp.
#define TIMESTAMP_INVALID_UTILDATETIME (util::DateTime(0, 0, 0, 0, 1, 1, 1601, false))
/// Invalid value for date to create invalid instance of TimeStamp.
@@ -592,7 +592,7 @@ void SfxOleFileTimeProperty::ImplSave( SvStream& rStrm )
static_cast< sal_uInt16 >( maDateTime.Day ),
static_cast< sal_uInt16 >( maDateTime.Month ),
static_cast< sal_uInt16 >( maDateTime.Year ) ),
- Time(
+ tools::Time(
static_cast< sal_uIntPtr >( maDateTime.Hours ),
static_cast< sal_uIntPtr >( maDateTime.Minutes ),
static_cast< sal_uIntPtr >( maDateTime.Seconds ),