diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-10-30 17:10:28 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-10-31 08:43:18 +0100 |
commit | 0b413caadfbe68b278ca5ba33b6d204687586ea9 (patch) | |
tree | 5eef1cc6046e0081b15b5643f83b92711fb761ef /sax | |
parent | e64baee9194f2bd3b7ad5e67fcab1102433fec9b (diff) |
loplugin:constantparam in sal,sax
Change-Id: I7ca2fd05d1cf61f9038c529a853e72fedb1c9ed0
Reviewed-on: https://gerrit.libreoffice.org/44087
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sax')
-rw-r--r-- | sax/qa/cppunit/test_converter.cxx | 12 | ||||
-rw-r--r-- | sax/source/tools/converter.cxx | 13 |
2 files changed, 10 insertions, 15 deletions
diff --git a/sax/qa/cppunit/test_converter.cxx b/sax/qa/cppunit/test_converter.cxx index 02471ebff740..7fd28345c0a6 100644 --- a/sax/qa/cppunit/test_converter.cxx +++ b/sax/qa/cppunit/test_converter.cxx @@ -159,7 +159,7 @@ void doTest(util::DateTime const & rdt, char const*const pis, OUString is(OUString::createFromAscii(pis)); util::DateTime odt; SAL_INFO("sax.cppunit","about to convert '" << is << "'"); - bool bSuccess( Converter::parseDateTime(odt, nullptr, is) ); + bool bSuccess( Converter::parseDateTime(odt, is) ); SAL_INFO("sax.cppunit","Y:" << odt.Year << " M:" << odt.Month << " D:" << odt.Day << " H:" << odt.Hours << " M:" << odt.Minutes << " S:" << odt.Seconds << " nS:" << odt.NanoSeconds << " UTC: " << (bool)odt.IsUTC); CPPUNIT_ASSERT(bSuccess); CPPUNIT_ASSERT(eqDateTime(rdt, odt)); @@ -173,8 +173,7 @@ void doTest(util::DateTime const & rdt, char const*const pis, void doTestDateTimeF(char const*const pis) { util::DateTime odt; - bool bSuccess = Converter::parseDateTime(odt, nullptr, - OUString::createFromAscii(pis)); + bool bSuccess = Converter::parseDateTime(odt, OUString::createFromAscii(pis)); SAL_INFO("sax.cppunit","Y:" << odt.Year << " M:" << odt.Month << " D:" << odt.Day << " H:" << odt.Hours << "H M:" << odt.Minutes << " S:" << odt.Seconds << " nS:" << odt.NanoSeconds); CPPUNIT_ASSERT(!bSuccess); } @@ -254,12 +253,12 @@ void doTestTime(util::DateTime const & rdt, char const*const pis, OUString is(OUString::createFromAscii(pis)); util::DateTime odt; SAL_INFO("sax.cppunit","about to convert '" << is << "'"); - bool bSuccess( Converter::parseTimeOrDateTime(odt, nullptr, is) ); + bool bSuccess( Converter::parseTimeOrDateTime(odt, is) ); SAL_INFO("sax.cppunit","Y:" << odt.Year << " M:" << odt.Month << " D:" << odt.Day << " H:" << odt.Hours << " M:" << odt.Minutes << " S:" << odt.Seconds << " nS:" << odt.NanoSeconds << " UTC: " << (bool)odt.IsUTC); CPPUNIT_ASSERT(bSuccess); CPPUNIT_ASSERT(eqDateTime(rdt, odt)); OUStringBuffer buf; - Converter::convertTimeOrDateTime(buf, odt, nullptr); + Converter::convertTimeOrDateTime(buf, odt); SAL_INFO("sax.cppunit","" << buf.toString()); CPPUNIT_ASSERT_EQUAL(OUString::createFromAscii(pos), buf.makeStringAndClear()); @@ -268,8 +267,7 @@ void doTestTime(util::DateTime const & rdt, char const*const pis, void doTestTimeF(char const*const pis) { util::DateTime odt; - bool bSuccess = Converter::parseTimeOrDateTime(odt, nullptr, - OUString::createFromAscii(pis)); + bool bSuccess = Converter::parseTimeOrDateTime(odt, OUString::createFromAscii(pis)); SAL_INFO("sax.cppunit","Y:" << odt.Year << " M:" << odt.Month << " D:" << odt.Day << " H:" << odt.Hours << "H M:" << odt.Minutes << " S:" << odt.Seconds << " nS:" << odt.NanoSeconds); CPPUNIT_ASSERT_MESSAGE(pis, !bSuccess); } diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx index d2a84cd8ea7d..121ae8a2ffa4 100644 --- a/sax/source/tools/converter.cxx +++ b/sax/source/tools/converter.cxx @@ -1334,19 +1334,18 @@ static void convertTimeZone( /** convert util::DateTime to ISO "time" or "dateTime" string */ void Converter::convertTimeOrDateTime( OUStringBuffer& i_rBuffer, - const css::util::DateTime& i_rDateTime, - sal_Int16 const* pTimeZoneOffset) + const css::util::DateTime& i_rDateTime) { if (i_rDateTime.Year == 0 || i_rDateTime.Month < 1 || i_rDateTime.Month > 12 || i_rDateTime.Day < 1 || i_rDateTime.Day > 31) { convertTime(i_rBuffer, i_rDateTime); - convertTimeZone(i_rBuffer, i_rDateTime, pTimeZoneOffset); + convertTimeZone(i_rBuffer, i_rDateTime, nullptr); } else { - convertDateTime(i_rBuffer, i_rDateTime, pTimeZoneOffset, true); + convertDateTime(i_rBuffer, i_rDateTime, nullptr, true); } } @@ -1397,11 +1396,10 @@ void Converter::convertDateTime( /** convert ISO "date" or "dateTime" string to util::DateTime */ bool Converter::parseDateTime( util::DateTime& rDateTime, - boost::optional<sal_Int16> *const pTimeZoneOffset, const OUString& rString ) { bool isDateTime; - return parseDateOrDateTime(nullptr, rDateTime, isDateTime, pTimeZoneOffset, + return parseDateOrDateTime(nullptr, rDateTime, isDateTime, nullptr, rString); } @@ -1851,12 +1849,11 @@ static bool lcl_parseDateTime( /** convert ISO "time" or "dateTime" string to util::DateTime */ bool Converter::parseTimeOrDateTime( util::DateTime & rDateTime, - boost::optional<sal_Int16> * pTimeZoneOffset, const OUString & rString) { bool dummy; return lcl_parseDateTime( - nullptr, rDateTime, dummy, pTimeZoneOffset, rString, true); + nullptr, rDateTime, dummy, nullptr, rString, true); } /** convert ISO "date" or "dateTime" string to util::DateTime or util::Date */ |