diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-29 08:58:11 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-29 15:12:26 +0100 |
commit | 41eeaace84b45c803fff3ebd5ab981f0ad09393b (patch) | |
tree | 0a0290bcc852507efa8241bd0853ebdd84ec9cbf /sc | |
parent | a2f7678171618d958e3c387718cd389bea63eaeb (diff) |
loplugin:oncevar
Change-Id: Iba892694acb378887a1d15ab59104c55f591f0bd
Reviewed-on: https://gerrit.libreoffice.org/62498
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/Accessibility/AccessibleDocument.cxx | 9 | ||||
-rw-r--r-- | sc/source/ui/dataprovider/datatransformation.cxx | 27 |
2 files changed, 12 insertions, 24 deletions
diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx index fc59f7a4acc8..6996c234858b 100644 --- a/sc/source/ui/Accessibility/AccessibleDocument.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx @@ -419,8 +419,7 @@ void ScChildrenShapes::Notify(SfxBroadcaster&, const SfxHint& rHint) uno::Reference<drawing::XShape> xShape (pObj->getUnoShape(), uno::UNO_QUERY); if (xShape.is()) { - ScShapeDataLess aLess; - std::sort(maZOrderedShapes.begin(), maZOrderedShapes.end(), aLess); // sort, because the z index or layer could be changed + std::sort(maZOrderedShapes.begin(), maZOrderedShapes.end(), ScShapeDataLess()); // sort, because the z index or layer could be changed CheckWhetherAnchorChanged(xShape); } } @@ -958,8 +957,7 @@ bool ScChildrenShapes::FindSelectedShapesChanges(const uno::Reference<drawing::X { pFocusedObj = GetSdrObjectFromXShape(aShapesList[0]->xShape); } - ScShapeDataLess aLess; - std::sort(aShapesList.begin(), aShapesList.end(), aLess); + std::sort(aShapesList.begin(), aShapesList.end(), ScShapeDataLess()); SortedShapes vecSelectedShapeAdd; SortedShapes vecSelectedShapeRemove; bool bHasSelect=false; @@ -1312,8 +1310,7 @@ bool ScChildrenShapes::FindShape(const uno::Reference<drawing::XShape>& xShape, bool bResult(false); ScAccessibleShapeData aShape; aShape.xShape = xShape; - ScShapeDataLess aLess; - rItr = std::lower_bound(maZOrderedShapes.begin(), maZOrderedShapes.end(), &aShape, aLess); + rItr = std::lower_bound(maZOrderedShapes.begin(), maZOrderedShapes.end(), &aShape, ScShapeDataLess()); if ((rItr != maZOrderedShapes.end()) && (*rItr != nullptr) && ((*rItr)->xShape.get() == xShape.get())) bResult = true; // if the shape is found diff --git a/sc/source/ui/dataprovider/datatransformation.cxx b/sc/source/ui/dataprovider/datatransformation.cxx index 16707f51d780..e3b526a588a9 100644 --- a/sc/source/ui/dataprovider/datatransformation.cxx +++ b/sc/source/ui/dataprovider/datatransformation.cxx @@ -235,7 +235,6 @@ void TextTransformation::Transform(ScDocument& rDoc) const break; case TEXT_TRANSFORM_TYPE::CAPITALIZE: { - sal_Unicode separator = sal_Unicode(U' '); for (SCROW nRow = 0; nRow <= nEndRow; ++nRow) { CellType eType; @@ -250,7 +249,7 @@ void TextTransformation::Transform(ScDocument& rDoc) const aStr = aStr.replaceAt(0, 1, ScGlobal::pCharClass->uppercase(OUString(aStr[0]))); for (sal_Int32 i = 1; i < length; i++){ - if (aStr[i-1] == separator) + if (aStr[i-1] == sal_Unicode(U' ')) { aStr = aStr.replaceAt(i, 1, ScGlobal::pCharClass->uppercase(OUString(aStr[i]))); } @@ -736,9 +735,8 @@ void DateTimeTransformation::Transform(ScDocument& rDoc) const case DATETIME_TRANSFORMATION_TYPE::DATE_STRING: { SvNumberFormatter* pFormatter = rDoc.GetFormatTable(); - SvNumFormatType nFormatType = SvNumFormatType::DATE; LanguageType eLanguage = ScGlobal::eLnge; - sal_uInt32 nFormat = pFormatter->GetStandardFormat( nFormatType, eLanguage ); + sal_uInt32 nFormat = pFormatter->GetStandardFormat( SvNumFormatType::DATE, eLanguage ); for (SCROW nRow = 0; nRow <= nEndRow; ++nRow) { CellType eType; @@ -770,9 +768,8 @@ void DateTimeTransformation::Transform(ScDocument& rDoc) const case DATETIME_TRANSFORMATION_TYPE::START_OF_YEAR: { SvNumberFormatter* pFormatter = rDoc.GetFormatTable(); - SvNumFormatType nFormatType = SvNumFormatType::DATE; LanguageType eLanguage = ScGlobal::eLnge; - sal_uInt32 nFormat = pFormatter->GetStandardFormat( nFormatType, eLanguage ); + sal_uInt32 nFormat = pFormatter->GetStandardFormat( SvNumFormatType::DATE, eLanguage ); for (SCROW nRow = 0; nRow <= nEndRow; ++nRow) { CellType eType; @@ -794,9 +791,8 @@ void DateTimeTransformation::Transform(ScDocument& rDoc) const case DATETIME_TRANSFORMATION_TYPE::END_OF_YEAR: { SvNumberFormatter* pFormatter = rDoc.GetFormatTable(); - SvNumFormatType nFormatType = SvNumFormatType::DATE; LanguageType eLanguage = ScGlobal::eLnge; - sal_uInt32 nFormat = pFormatter->GetStandardFormat( nFormatType, eLanguage ); + sal_uInt32 nFormat = pFormatter->GetStandardFormat( SvNumFormatType::DATE, eLanguage ); for (SCROW nRow = 0; nRow <= nEndRow; ++nRow) { @@ -854,9 +850,8 @@ void DateTimeTransformation::Transform(ScDocument& rDoc) const case DATETIME_TRANSFORMATION_TYPE::START_OF_MONTH: { SvNumberFormatter* pFormatter = rDoc.GetFormatTable(); - SvNumFormatType nFormatType = SvNumFormatType::DATE; LanguageType eLanguage = ScGlobal::eLnge; - sal_uInt32 nFormat = pFormatter->GetStandardFormat( nFormatType, eLanguage ); + sal_uInt32 nFormat = pFormatter->GetStandardFormat( SvNumFormatType::DATE, eLanguage ); for (SCROW nRow = 0; nRow <= nEndRow; ++nRow) { CellType eType; @@ -877,9 +872,8 @@ void DateTimeTransformation::Transform(ScDocument& rDoc) const case DATETIME_TRANSFORMATION_TYPE::END_OF_MONTH: { SvNumberFormatter* pFormatter = rDoc.GetFormatTable(); - SvNumFormatType nFormatType = SvNumFormatType::DATE; LanguageType eLanguage = ScGlobal::eLnge; - sal_uInt32 nFormat = pFormatter->GetStandardFormat( nFormatType, eLanguage ); + sal_uInt32 nFormat = pFormatter->GetStandardFormat( SvNumFormatType::DATE, eLanguage ); for (SCROW nRow = 0; nRow <= nEndRow; ++nRow) { CellType eType; @@ -980,9 +974,8 @@ void DateTimeTransformation::Transform(ScDocument& rDoc) const case DATETIME_TRANSFORMATION_TYPE::START_OF_QUARTER: { SvNumberFormatter* pFormatter = rDoc.GetFormatTable(); - SvNumFormatType nFormatType = SvNumFormatType::DATE; LanguageType eLanguage = ScGlobal::eLnge; - sal_uInt32 nFormat = pFormatter->GetStandardFormat( nFormatType, eLanguage ); + sal_uInt32 nFormat = pFormatter->GetStandardFormat( SvNumFormatType::DATE, eLanguage ); for (SCROW nRow = 0; nRow <= nEndRow; ++nRow) { CellType eType; @@ -1036,9 +1029,8 @@ void DateTimeTransformation::Transform(ScDocument& rDoc) const case DATETIME_TRANSFORMATION_TYPE::END_OF_QUARTER: { SvNumberFormatter* pFormatter = rDoc.GetFormatTable(); - SvNumFormatType nFormatType = SvNumFormatType::DATE; LanguageType eLanguage = ScGlobal::eLnge; - sal_uInt32 nFormat = pFormatter->GetStandardFormat( nFormatType, eLanguage ); + sal_uInt32 nFormat = pFormatter->GetStandardFormat( SvNumFormatType::DATE, eLanguage ); for (SCROW nRow = 0; nRow <= nEndRow; ++nRow) { ScAddress aAddress(rCol, nRow, 0); @@ -1095,9 +1087,8 @@ void DateTimeTransformation::Transform(ScDocument& rDoc) const case DATETIME_TRANSFORMATION_TYPE::TIME: { SvNumberFormatter* pFormatter = rDoc.GetFormatTable(); - SvNumFormatType nFormatType = SvNumFormatType::TIME; LanguageType eLanguage = ScGlobal::eLnge; - sal_uInt32 nFormat = pFormatter->GetStandardFormat(nFormatType, eLanguage); + sal_uInt32 nFormat = pFormatter->GetStandardFormat(SvNumFormatType::TIME, eLanguage); for (SCROW nRow = 0; nRow <= nEndRow; ++nRow) { ScAddress aAddress(rCol, nRow, 0); |