summaryrefslogtreecommitdiff
path: root/sc/source/ui/view
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/view
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/view')
-rw-r--r--sc/source/ui/view/preview.cxx10
-rw-r--r--sc/source/ui/view/printfun.cxx7
2 files changed, 6 insertions, 11 deletions
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,