diff options
author | Eike Rathke <erack@redhat.com> | 2012-11-22 19:48:13 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2012-11-22 19:50:20 +0100 |
commit | 1b329fd5ccc0ff270d776dfd03571da3f4d6f34d (patch) | |
tree | 160192cce8a16201503843650491f05b9b15a844 /sfx2 | |
parent | PPTStyleTextPropReader::Init: -Werror=sign-compare (diff) | |
download | core-1b329fd5ccc0ff270d776dfd03571da3f4d6f34d.tar.gz core-1b329fd5ccc0ff270d776dfd03571da3f4d6f34d.zip |
get rid of unnecessary LocaleDataWrapper temporary instances
Change-Id: I17d9a502565d445b0eab9ef6e9123661850292b7
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/appserv.cxx | 1 | ||||
-rw-r--r-- | sfx2/source/dialog/dinfdlg.cxx | 22 | ||||
-rw-r--r-- | sfx2/source/dialog/versdlg.cxx | 11 | ||||
-rw-r--r-- | sfx2/source/inc/versdlg.hxx | 1 |
4 files changed, 15 insertions, 20 deletions
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 7363fc48eefa..3e0a29776bf3 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -712,7 +712,6 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) void SfxApplication::MiscState_Impl(SfxItemSet &rSet) { - LocaleDataWrapper aLocaleWrapper( Application::GetSettings().GetLanguageTag().getLocale() ); const sal_uInt16 *pRanges = rSet.GetRanges(); DBG_ASSERT(pRanges && *pRanges, "Set without range"); while ( *pRanges ) diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index fcc09827b3a3..416e677627ce 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -724,13 +724,13 @@ namespace { String GetDateTimeString( sal_Int32 _nDate, sal_Int32 _nTime ) { - LocaleDataWrapper aWrapper( Application::GetSettings().GetLanguageTag().getLocale() ); + const LocaleDataWrapper& rWrapper( Application::GetSettings().GetLocaleDataWrapper() ); Date aDate( _nDate ); Time aTime( _nTime ); - String aStr( aWrapper.getDate( aDate ) ); + String aStr( rWrapper.getDate( aDate ) ); aStr.AppendAscii( ", " ); - aStr += aWrapper.getTime( aTime ); + aStr += rWrapper.getTime( aTime ); return aStr; } @@ -878,17 +878,17 @@ IMPL_LINK_NOARG(SfxDocumentPage, DeleteHdl) String aName; if ( bEnableUseUserData && aUseUserDataCB.IsChecked() ) aName = SvtUserOptions().GetFullName(); - LocaleDataWrapper aLocaleWrapper( Application::GetSettings().GetLanguageTag().getLocale() ); + const LocaleDataWrapper& rLocaleWrapper( Application::GetSettings().GetLocaleDataWrapper() ); DateTime now( DateTime::SYSTEM ); util::DateTime uDT( now.Get100Sec(), now.GetSec(), now.GetMin(), now.GetHour(), now.GetDay(), now.GetMonth(), now.GetYear() ); - aCreateValFt.SetText( ConvertDateTime_Impl( aName, uDT, aLocaleWrapper ) ); + aCreateValFt.SetText( ConvertDateTime_Impl( aName, uDT, rLocaleWrapper ) ); OUString aEmpty; aChangeValFt.SetText( aEmpty ); aPrintValFt.SetText( aEmpty ); const Time aTime( 0 ); - aTimeLogValFt.SetText( aLocaleWrapper.getDuration( aTime ) ); + aTimeLogValFt.SetText( rLocaleWrapper.getDuration( aTime ) ); aDocNoValFt.SetText(rtl::OUString('1')); bHandleDelete = sal_True; return 0; @@ -1148,22 +1148,22 @@ void SfxDocumentPage::Reset( const SfxItemSet& rSet ) // handle access data sal_Bool m_bUseUserData = pInfoItem->IsUseUserData(); - LocaleDataWrapper aLocaleWrapper( Application::GetSettings().GetLanguageTag().getLocale() ); + const LocaleDataWrapper& rLocaleWrapper( Application::GetSettings().GetLocaleDataWrapper() ); aCreateValFt.SetText( ConvertDateTime_Impl( pInfoItem->getAuthor(), - pInfoItem->getCreationDate(), aLocaleWrapper ) ); + pInfoItem->getCreationDate(), rLocaleWrapper ) ); util::DateTime aTime( pInfoItem->getModificationDate() ); if ( aTime.Month > 0 ) aChangeValFt.SetText( ConvertDateTime_Impl( - pInfoItem->getModifiedBy(), aTime, aLocaleWrapper ) ); + pInfoItem->getModifiedBy(), aTime, rLocaleWrapper ) ); aTime = pInfoItem->getPrintDate(); if ( aTime.Month > 0 ) aPrintValFt.SetText( ConvertDateTime_Impl( pInfoItem->getPrintedBy(), - aTime, aLocaleWrapper ) ); + aTime, rLocaleWrapper ) ); const long nTime = pInfoItem->getEditingDuration(); if ( m_bUseUserData ) { const Time aT( nTime/3600, (nTime%3600)/60, nTime%60 ); - aTimeLogValFt.SetText( aLocaleWrapper.getDuration( aT ) ); + aTimeLogValFt.SetText( rLocaleWrapper.getDuration( aT ) ); aDocNoValFt.SetText( String::CreateFromInt32( pInfoItem->getEditingCycles() ) ); } diff --git a/sfx2/source/dialog/versdlg.cxx b/sfx2/source/dialog/versdlg.cxx index 6d992cfc134f..784b5701798c 100644 --- a/sfx2/source/dialog/versdlg.cxx +++ b/sfx2/source/dialog/versdlg.cxx @@ -191,7 +191,6 @@ SfxVersionDialog::SfxVersionDialog ( SfxViewFrame* pVwFrame, sal_Bool bIsSaveVer , aHelpButton( this, SfxResId( PB_HELP ) ) , pViewFrame( pVwFrame ) , mpTable( NULL ) - , mpLocaleWrapper( NULL ) , mbIsSaveVersionOnClose( bIsSaveVersionOnClose ) { FreeResource(); @@ -257,7 +256,7 @@ void SfxVersionDialog::Init_Impl() for ( size_t n = 0; n < mpTable->size(); ++n ) { SfxVersionInfo *pInfo = mpTable->at( n ); - String aEntry = ConvertDateTime_Impl( pInfo->aCreationDate, *mpLocaleWrapper ); + String aEntry = ConvertDateTime_Impl( pInfo->aCreationDate, Application::GetSettings().GetLocaleDataWrapper() ); aEntry += '\t'; aEntry += pInfo->aAuthor; aEntry += '\t'; @@ -284,7 +283,6 @@ void SfxVersionDialog::Init_Impl() SfxVersionDialog::~SfxVersionDialog () { delete mpTable; - delete mpLocaleWrapper; } void SfxVersionDialog::Open_Impl() @@ -317,8 +315,7 @@ void SfxVersionDialog::RecalcDateColumn() { // recalculate the datetime column width DateTime aNow( DateTime::SYSTEM ); - mpLocaleWrapper = new LocaleDataWrapper( Application::GetSettings().GetLanguageTag().getLocale() ); - String sDateTime = ConvertDateTime_Impl( aNow, *mpLocaleWrapper ); + String sDateTime = ConvertDateTime_Impl( aNow, Application::GetSettings().GetLocaleDataWrapper() ); long nWidth = aVersionBox.GetTextWidth( sDateTime ); nWidth += 15; // a little offset long nTab = aVersionBox.GetTab(1); @@ -451,8 +448,8 @@ SfxViewVersionDialog_Impl::SfxViewVersionDialog_Impl ( Window *pParent, SfxVersi { FreeResource(); - LocaleDataWrapper aLocaleWrapper( Application::GetSettings().GetLanguageTag().getLocale() ); - aDateTimeText.SetText( aDateTimeText.GetText().Append(ConvertDateTime_Impl( pInfo->aCreationDate, aLocaleWrapper )) ); + const LocaleDataWrapper& rLocaleWrapper( Application::GetSettings().GetLocaleDataWrapper() ); + aDateTimeText.SetText( aDateTimeText.GetText().Append(ConvertDateTime_Impl( pInfo->aCreationDate, rLocaleWrapper )) ); aSavedByText.SetText( aSavedByText.GetText().Append(pInfo->aAuthor) ); aEdit.SetText( rInfo.aComment ); diff --git a/sfx2/source/inc/versdlg.hxx b/sfx2/source/inc/versdlg.hxx index 7514c3679b4d..a81e8eab6207 100644 --- a/sfx2/source/inc/versdlg.hxx +++ b/sfx2/source/inc/versdlg.hxx @@ -57,7 +57,6 @@ class SfxVersionDialog : public SfxModalDialog HelpButton aHelpButton; SfxViewFrame* pViewFrame; SfxVersionTableDtor* mpTable; - LocaleDataWrapper* mpLocaleWrapper; sal_Bool mbIsSaveVersionOnClose; DECL_LINK(DClickHdl_Impl, void *); |