summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
Diffstat (limited to 'svl')
-rw-r--r--svl/source/numbers/zforfind.cxx13
-rw-r--r--svl/source/numbers/zforfind.hxx5
2 files changed, 6 insertions, 12 deletions
diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index 029b2b556d0f..de5aacf69d2b 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -81,7 +81,7 @@ ImpSvNumberInputScan::ImpSvNumberInputScan( SvNumberFormatter* pFormatterP )
eSetType( SvNumFormatType::UNDEFINED )
{
pFormatter = pFormatterP;
- pNullDate.reset( new Date(30,12,1899) );
+ moNullDate.emplace( 30,12,1899 );
nYear2000 = SvNumberFormatter::GetYear2000Default();
Reset();
ChangeIntl();
@@ -2262,7 +2262,7 @@ input for the following reasons:
if ( res && pCal->isValid() )
{
- double fDiff = DateTime(*pNullDate) - pCal->getEpochStart();
+ double fDiff = DateTime(*moNullDate) - pCal->getEpochStart();
fDays = ::rtl::math::approxFloor( pCal->getLocalDateTime() );
fDays -= fDiff;
nTryOrder = nFormatOrder; // break for
@@ -3831,14 +3831,7 @@ void ImpSvNumberInputScan::ChangeNullDate( const sal_uInt16 Day,
const sal_uInt16 Month,
const sal_Int16 Year )
{
- if ( pNullDate )
- {
- *pNullDate = Date(Day, Month, Year);
- }
- else
- {
- pNullDate.reset(new Date(Day, Month, Year));
- }
+ moNullDate = Date(Day, Month, Year);
}
diff --git a/svl/source/numbers/zforfind.hxx b/svl/source/numbers/zforfind.hxx
index 5696b6ca21a3..dea732b93297 100644
--- a/svl/source/numbers/zforfind.hxx
+++ b/svl/source/numbers/zforfind.hxx
@@ -23,9 +23,10 @@
#include <com/sun/star/uno/Sequence.hxx>
#include <rtl/ustring.hxx>
#include <svl/zforlist.hxx>
+#include <tools/date.hxx>
#include <memory>
+#include <optional>
-class Date;
class SvNumberformat;
class SvNumberFormatter;
enum class SvNumFormatType : sal_Int16;
@@ -89,7 +90,7 @@ private:
bool bTextInitialized; //* Whether days and months are initialized
bool bScanGenitiveMonths; //* Whether to scan an input for genitive months
bool bScanPartitiveMonths; //* Whether to scan an input for partitive months
- std::unique_ptr<Date> pNullDate; //* 30Dec1899
+ std::optional<Date> moNullDate; //* 30Dec1899
// Variables for provisional results:
OUString sStrArray[SV_MAX_COUNT_INPUT_STRINGS];//* Array of scanned substrings
bool IsNum[SV_MAX_COUNT_INPUT_STRINGS]; //* Whether a substring is numeric