summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2018-05-09 18:30:15 +0900
committerEike Rathke <erack@redhat.com>2018-06-11 12:35:49 +0200
commit9804cc4eff4c5899abdc5309eeb019eb6ec1bf46 (patch)
tree0f96d2a0fc5616751131fe28b2476b53f253b678 /sc/source/ui
parent3f8fdfced059bdec7f28164eb3c0e99974c6780a (diff)
sc: ScHeaderFieldData always stores a datetime
It does not change only the date part nor the time part separately, thus holding single DateTime is sufficient. Change-Id: Ic619608ce7a961287c299698b9a004cbf7038702 Reviewed-on: https://gerrit.libreoffice.org/54058 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/inc/preview.hxx3
-rw-r--r--sc/source/ui/inc/printfun.hxx2
-rw-r--r--sc/source/ui/view/preview.cxx10
-rw-r--r--sc/source/ui/view/printfun.cxx7
4 files changed, 8 insertions, 14 deletions
diff --git a/sc/source/ui/inc/preview.hxx b/sc/source/ui/inc/preview.hxx
index 54e8d04c4f22..a43002c545ae 100644
--- a/sc/source/ui/inc/preview.hxx
+++ b/sc/source/ui/inc/preview.hxx
@@ -47,8 +47,7 @@ private:
long nTabPage; // Page of sheet
long nTabStart; // First (real) page of the sheet
long nDisplayStart; // same as above, relative to the start of counting
- Date aDate;
- tools::Time aTime;
+ DateTime aDateTime;
long nTotalPages;
Size aPageSize; // for GetOptimalZoom
ScPrintState aState;
diff --git a/sc/source/ui/inc/printfun.hxx b/sc/source/ui/inc/printfun.hxx
index 2df47432c89a..d96fb277b788 100644
--- a/sc/source/ui/inc/printfun.hxx
+++ b/sc/source/ui/inc/printfun.hxx
@@ -303,7 +303,7 @@ public:
void SetOffset( const Point& rOfs );
void SetManualZoom( sal_uInt16 nNewZoom );
- void SetDateTime( const Date& rDate, const tools::Time& rTime );
+ void SetDateTime( const DateTime& );
void SetClearFlag( bool bFlag );
void SetUseStyleColor( bool bFlag );
diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx
index 6f1602da97c7..b709cf1a3d12 100644
--- a/sc/source/ui/view/preview.cxx
+++ b/sc/source/ui/view/preview.cxx
@@ -96,8 +96,7 @@ ScPreview::ScPreview( vcl::Window* pParent, ScDocShell* pDocSh, ScPreviewShell*
nTabPage( 0 ),
nTabStart( 0 ),
nDisplayStart( 0 ),
- aDate( Date::SYSTEM ),
- aTime( tools::Time::SYSTEM ),
+ aDateTime( DateTime::SYSTEM ),
nTotalPages( 0 ),
pLocationData( nullptr ),
pDrawView( nullptr ),
@@ -401,7 +400,7 @@ void ScPreview::DoPrint( ScPreviewLocationData* pFillLocation )
pPrintFunc->SetOffset(aOffset);
pPrintFunc->SetManualZoom(nZoom);
- pPrintFunc->SetDateTime(aDate,aTime);
+ pPrintFunc->SetDateTime(aDateTime);
pPrintFunc->SetClearFlag(true);
pPrintFunc->SetUseStyleColor( pScMod->GetAccessOptions().GetIsForPagePreviews() );
@@ -701,10 +700,7 @@ const ScPreviewLocationData& ScPreview::GetLocationData()
void ScPreview::DataChanged(bool bNewTime)
{
if (bNewTime)
- {
- aDate = Date( Date::SYSTEM );
- aTime = tools::Time( tools::Time::SYSTEM );
- }
+ aDateTime = DateTime( DateTime::SYSTEM );
bValid = false;
InvalidateLocationData( SfxHintId::ScDataChanged );
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index 4ddc1f64f0ce..f96fd9b74d28 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -1075,7 +1075,7 @@ void ScPrintFunc::InitParam( const ScPrintOptions* pOptions )
else
aFieldData.nTotalPages = nTotalPages;
- SetDateTime( Date( Date::SYSTEM ), tools::Time( tools::Time::SYSTEM ) );
+ SetDateTime( DateTime( DateTime::SYSTEM ) );
if( pDocShell->getDocProperties()->getTitle().getLength() != 0 )
aFieldData.aTitle = pDocShell->getDocProperties()->getTitle();
@@ -1111,10 +1111,9 @@ void ScPrintFunc::GetScaleData( Size& rPhysSize, long& rDocHdr, long& rDocFtr )
rDocFtr = aFtr.nHeight;
}
-void ScPrintFunc::SetDateTime( const Date& rDate, const tools::Time& rTime )
+void ScPrintFunc::SetDateTime( const DateTime& rDateTime )
{
- aFieldData.aDate = rDate;
- aFieldData.aTime = rTime;
+ aFieldData.aDateTime = rDateTime;
}
static void lcl_DrawGraphic( const Graphic &rGraphic, vcl::RenderContext *pOut,