summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-04-20 09:14:08 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-04-20 10:38:02 +0200
commit8e4453c2117b6c3bb15be6b949a0a8a43df66647 (patch)
tree73cf2208d992c5406777be3edc4efe5fc28963ce /sc
parent2ddf33f78fbc4ce0f49752e4adb9357c1fb69833 (diff)
use more FastAttributeIter::toView
Change-Id: I8a8ad5456fea349a45fca0aa468313cb04aa02f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133198 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/xml/SparklineGroupsImportContext.cxx45
-rw-r--r--sc/source/filter/xml/XMLCalculationSettingsContext.cxx4
-rw-r--r--sc/source/filter/xml/XMLCellRangeSourceContext.cxx6
-rw-r--r--sc/source/filter/xml/XMLDetectiveContext.cxx2
-rw-r--r--sc/source/filter/xml/XMLTableSourceContext.cxx2
-rw-r--r--sc/source/filter/xml/XMLTrackedChangesContext.cxx4
-rw-r--r--sc/source/filter/xml/xmlcelli.cxx4
-rw-r--r--sc/source/filter/xml/xmldpimp.cxx4
-rw-r--r--sc/source/filter/xml/xmldrani.cxx2
-rw-r--r--sc/source/filter/xml/xmlexternaltabi.cxx4
-rw-r--r--sc/source/filter/xml/xmlsceni.cxx2
11 files changed, 39 insertions, 40 deletions
diff --git a/sc/source/filter/xml/SparklineGroupsImportContext.cxx b/sc/source/filter/xml/SparklineGroupsImportContext.cxx
index 5720ca8f3382..b1164e3ef993 100644
--- a/sc/source/filter/xml/SparklineGroupsImportContext.cxx
+++ b/sc/source/filter/xml/SparklineGroupsImportContext.cxx
@@ -32,29 +32,29 @@ SparklineGroupsImportContext::SparklineGroupsImportContext(ScXMLImport& rImport)
namespace
{
-sc::SparklineType parseSparklineType(std::u16string_view aString)
+sc::SparklineType parseSparklineType(std::string_view aString)
{
- if (aString == u"column")
+ if (aString == "column")
return sc::SparklineType::Column;
- else if (aString == u"stacked")
+ else if (aString == "stacked")
return sc::SparklineType::Stacked;
return sc::SparklineType::Line;
}
-sc::DisplayEmptyCellsAs parseDisplayEmptyCellsAs(std::u16string_view aString)
+sc::DisplayEmptyCellsAs parseDisplayEmptyCellsAs(std::string_view aString)
{
- if (aString == u"span")
+ if (aString == "span")
return sc::DisplayEmptyCellsAs::Span;
- else if (aString == u"gap")
+ else if (aString == "gap")
return sc::DisplayEmptyCellsAs::Gap;
return sc::DisplayEmptyCellsAs::Zero;
}
-sc::AxisType parseAxisType(std::u16string_view aString)
+sc::AxisType parseAxisType(std::string_view aString)
{
- if (aString == u"group")
+ if (aString == "group")
return sc::AxisType::Group;
- else if (aString == u"custom")
+ else if (aString == "custom")
return sc::AxisType::Custom;
return sc::AxisType::Individual;
}
@@ -70,8 +70,7 @@ void SparklineGroupsImportContext::fillSparklineGroupID(
{
case XML_ELEMENT(CALC_EXT, XML_ID):
{
- OString aString = OUStringToOString(rIter.toString(), RTL_TEXTENCODING_ASCII_US);
- tools::Guid aGuid(aString);
+ tools::Guid aGuid(rIter.toView());
m_pCurrentSparklineGroup->setID(aGuid);
break;
}
@@ -90,7 +89,7 @@ void SparklineGroupsImportContext::fillSparklineGroupAttributes(
{
case XML_ELEMENT(CALC_EXT, XML_TYPE):
{
- rAttributes.setType(parseSparklineType(rIter.toString()));
+ rAttributes.setType(parseSparklineType(rIter.toView()));
break;
}
case XML_ELEMENT(CALC_EXT, XML_LINE_WIDTH):
@@ -111,7 +110,7 @@ void SparklineGroupsImportContext::fillSparklineGroupAttributes(
}
case XML_ELEMENT(CALC_EXT, XML_DISPLAY_EMPTY_CELLS_AS):
{
- auto eDisplayEmptyCellsAs = parseDisplayEmptyCellsAs(rIter.toString());
+ auto eDisplayEmptyCellsAs = parseDisplayEmptyCellsAs(rIter.toView());
rAttributes.setDisplayEmptyCellsAs(eDisplayEmptyCellsAs);
break;
}
@@ -157,12 +156,12 @@ void SparklineGroupsImportContext::fillSparklineGroupAttributes(
}
case XML_ELEMENT(CALC_EXT, XML_MIN_AXIS_TYPE):
{
- rAttributes.setMinAxisType(parseAxisType(rIter.toString()));
+ rAttributes.setMinAxisType(parseAxisType(rIter.toView()));
break;
}
case XML_ELEMENT(CALC_EXT, XML_MAX_AXIS_TYPE):
{
- rAttributes.setMaxAxisType(parseAxisType(rIter.toString()));
+ rAttributes.setMaxAxisType(parseAxisType(rIter.toView()));
break;
}
case XML_ELEMENT(CALC_EXT, XML_RIGHT_TO_LEFT):
@@ -183,56 +182,56 @@ void SparklineGroupsImportContext::fillSparklineGroupAttributes(
case XML_ELEMENT(CALC_EXT, XML_COLOR_SERIES):
{
Color aColor;
- sax::Converter::convertColor(aColor, rIter.toString());
+ sax::Converter::convertColor(aColor, rIter.toView());
rAttributes.setColorSeries(aColor);
break;
}
case XML_ELEMENT(CALC_EXT, XML_COLOR_NEGATIVE):
{
Color aColor;
- sax::Converter::convertColor(aColor, rIter.toString());
+ sax::Converter::convertColor(aColor, rIter.toView());
rAttributes.setColorNegative(aColor);
break;
}
case XML_ELEMENT(CALC_EXT, XML_COLOR_AXIS):
{
Color aColor;
- sax::Converter::convertColor(aColor, rIter.toString());
+ sax::Converter::convertColor(aColor, rIter.toView());
rAttributes.setColorAxis(aColor);
break;
}
case XML_ELEMENT(CALC_EXT, XML_COLOR_MARKERS):
{
Color aColor;
- sax::Converter::convertColor(aColor, rIter.toString());
+ sax::Converter::convertColor(aColor, rIter.toView());
rAttributes.setColorMarkers(aColor);
break;
}
case XML_ELEMENT(CALC_EXT, XML_COLOR_FIRST):
{
Color aColor;
- sax::Converter::convertColor(aColor, rIter.toString());
+ sax::Converter::convertColor(aColor, rIter.toView());
rAttributes.setColorFirst(aColor);
break;
}
case XML_ELEMENT(CALC_EXT, XML_COLOR_LAST):
{
Color aColor;
- sax::Converter::convertColor(aColor, rIter.toString());
+ sax::Converter::convertColor(aColor, rIter.toView());
rAttributes.setColorLast(aColor);
break;
}
case XML_ELEMENT(CALC_EXT, XML_COLOR_HIGH):
{
Color aColor;
- sax::Converter::convertColor(aColor, rIter.toString());
+ sax::Converter::convertColor(aColor, rIter.toView());
rAttributes.setColorHigh(aColor);
break;
}
case XML_ELEMENT(CALC_EXT, XML_COLOR_LOW):
{
Color aColor;
- sax::Converter::convertColor(aColor, rIter.toString());
+ sax::Converter::convertColor(aColor, rIter.toView());
rAttributes.setColorLow(aColor);
break;
}
diff --git a/sc/source/filter/xml/XMLCalculationSettingsContext.cxx b/sc/source/filter/xml/XMLCalculationSettingsContext.cxx
index 7867b740cc27..e02400bcd480 100644
--- a/sc/source/filter/xml/XMLCalculationSettingsContext.cxx
+++ b/sc/source/filter/xml/XMLCalculationSettingsContext.cxx
@@ -73,7 +73,7 @@ ScXMLCalculationSettingsContext::ScXMLCalculationSettingsContext( ScXMLImport& r
break;
case XML_ELEMENT( TABLE, XML_NULL_YEAR ):
sal_Int32 nTemp;
- ::sax::Converter::convertNumber( nTemp, aIter.toString() );
+ ::sax::Converter::convertNumber( nTemp, aIter.toView() );
nYear2000 = static_cast<sal_uInt16>(nTemp);
break;
case XML_ELEMENT( TABLE, XML_USE_REGULAR_EXPRESSIONS ):
@@ -150,7 +150,7 @@ ScXMLNullDateContext::ScXMLNullDateContext( ScXMLImport& rImport,
if (aIter != rAttrList->end())
{
util::DateTime aDateTime;
- ::sax::Converter::parseDateTime(aDateTime, aIter.toString());
+ ::sax::Converter::parseDateTime(aDateTime, aIter.toView());
util::Date aDate;
aDate.Day = aDateTime.Day;
aDate.Month = aDateTime.Month;
diff --git a/sc/source/filter/xml/XMLCellRangeSourceContext.cxx b/sc/source/filter/xml/XMLCellRangeSourceContext.cxx
index 6453f81a5ddf..72bdc7b90677 100644
--- a/sc/source/filter/xml/XMLCellRangeSourceContext.cxx
+++ b/sc/source/filter/xml/XMLCellRangeSourceContext.cxx
@@ -63,7 +63,7 @@ ScXMLCellRangeSourceContext::ScXMLCellRangeSourceContext(
case XML_ELEMENT( TABLE, XML_LAST_COLUMN_SPANNED ):
{
sal_Int32 nValue;
- if (::sax::Converter::convertNumber( nValue, aIter.toString(), 1 ))
+ if (::sax::Converter::convertNumber( nValue, aIter.toView(), 1 ))
pCellRangeSource->nColumns = nValue;
else
pCellRangeSource->nColumns = 1;
@@ -72,7 +72,7 @@ ScXMLCellRangeSourceContext::ScXMLCellRangeSourceContext(
case XML_ELEMENT( TABLE, XML_LAST_ROW_SPANNED ):
{
sal_Int32 nValue;
- if (::sax::Converter::convertNumber( nValue, aIter.toString(), 1 ))
+ if (::sax::Converter::convertNumber( nValue, aIter.toView(), 1 ))
pCellRangeSource->nRows = nValue;
else
pCellRangeSource->nRows = 1;
@@ -81,7 +81,7 @@ ScXMLCellRangeSourceContext::ScXMLCellRangeSourceContext(
case XML_ELEMENT( TABLE, XML_REFRESH_DELAY ):
{
double fTime;
- if (::sax::Converter::convertDuration( fTime, aIter.toString() ))
+ if (::sax::Converter::convertDuration( fTime, aIter.toView() ))
pCellRangeSource->nRefresh = std::max( static_cast<sal_Int32>(fTime * 86400.0), sal_Int32(0) );
}
break;
diff --git a/sc/source/filter/xml/XMLDetectiveContext.cxx b/sc/source/filter/xml/XMLDetectiveContext.cxx
index 9c6c7cbbec7b..b6e3af33ad9d 100644
--- a/sc/source/filter/xml/XMLDetectiveContext.cxx
+++ b/sc/source/filter/xml/XMLDetectiveContext.cxx
@@ -167,7 +167,7 @@ ScXMLDetectiveOperationContext::ScXMLDetectiveOperationContext(
case XML_ELEMENT( TABLE, XML_INDEX ):
{
sal_Int32 nValue;
- if (::sax::Converter::convertNumber( nValue, aIter.toString(), 0 ))
+ if (::sax::Converter::convertNumber( nValue, aIter.toView(), 0 ))
aDetectiveOp.nIndex = nValue;
}
break;
diff --git a/sc/source/filter/xml/XMLTableSourceContext.cxx b/sc/source/filter/xml/XMLTableSourceContext.cxx
index bd09d266ad48..535f532dcaa3 100644
--- a/sc/source/filter/xml/XMLTableSourceContext.cxx
+++ b/sc/source/filter/xml/XMLTableSourceContext.cxx
@@ -62,7 +62,7 @@ ScXMLTableSourceContext::ScXMLTableSourceContext( ScXMLImport& rImport,
break;
case XML_ELEMENT( TABLE, XML_REFRESH_DELAY ):
double fTime;
- if (::sax::Converter::convertDuration( fTime, aIter.toString() ))
+ if (::sax::Converter::convertDuration( fTime, aIter.toView() ))
nRefresh = std::max( static_cast<sal_Int32>(fTime * 86400.0), sal_Int32(0) );
break;
}
diff --git a/sc/source/filter/xml/XMLTrackedChangesContext.cxx b/sc/source/filter/xml/XMLTrackedChangesContext.cxx
index 5ce9452ae0cb..9bc4a132da6b 100644
--- a/sc/source/filter/xml/XMLTrackedChangesContext.cxx
+++ b/sc/source/filter/xml/XMLTrackedChangesContext.cxx
@@ -776,12 +776,12 @@ ScXMLChangeCellContext::ScXMLChangeCellContext( ScXMLImport& rImport,
case XML_ELEMENT( OFFICE, XML_DATE_VALUE ):
bEmpty = false;
if (GetScImport().GetMM100UnitConverter().setNullDate(GetScImport().GetModel()))
- GetScImport().GetMM100UnitConverter().convertDateTime(rDateTimeValue, aIter.toString());
+ GetScImport().GetMM100UnitConverter().convertDateTime(rDateTimeValue, aIter.toView());
fValue = rDateTimeValue;
break;
case XML_ELEMENT( OFFICE, XML_TIME_VALUE ):
bEmpty = false;
- ::sax::Converter::convertDuration(rDateTimeValue, aIter.toString());
+ ::sax::Converter::convertDuration(rDateTimeValue, aIter.toView());
fValue = rDateTimeValue;
}
}
diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx
index 266a520e384a..8e2a7711ac3b 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -213,7 +213,7 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport,
{
if (!it.isEmpty() && rXMLImport.SetNullDateOnUnitConverter())
{
- rXMLImport.GetMM100UnitConverter().convertDateTime(fValue, it.toString());
+ rXMLImport.GetMM100UnitConverter().convertDateTime(fValue, it.toView());
bIsEmpty = false;
}
}
@@ -222,7 +222,7 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport,
{
if (!it.isEmpty())
{
- ::sax::Converter::convertDuration(fValue, it.toString());
+ ::sax::Converter::convertDuration(fValue, it.toView());
bIsEmpty = false;
}
}
diff --git a/sc/source/filter/xml/xmldpimp.cxx b/sc/source/filter/xml/xmldpimp.cxx
index 99cbc69167b8..307d55f7f30e 100644
--- a/sc/source/filter/xml/xmldpimp.cxx
+++ b/sc/source/filter/xml/xmldpimp.cxx
@@ -1383,7 +1383,7 @@ ScXMLDataPilotGroupsContext::ScXMLDataPilotGroupsContext( ScXMLImport& rImport,
bAutoStart = true;
else
{
- GetScImport().GetMM100UnitConverter().convertDateTime(fStart, aIter.toString());
+ GetScImport().GetMM100UnitConverter().convertDateTime(fStart, aIter.toView());
bAutoStart = false;
}
}
@@ -1395,7 +1395,7 @@ ScXMLDataPilotGroupsContext::ScXMLDataPilotGroupsContext( ScXMLImport& rImport,
bAutoEnd = true;
else
{
- GetScImport().GetMM100UnitConverter().convertDateTime(fEnd, aIter.toString());
+ GetScImport().GetMM100UnitConverter().convertDateTime(fEnd, aIter.toView());
bAutoEnd = false;
}
}
diff --git a/sc/source/filter/xml/xmldrani.cxx b/sc/source/filter/xml/xmldrani.cxx
index a44168aebe7b..ee728b1550a4 100644
--- a/sc/source/filter/xml/xmldrani.cxx
+++ b/sc/source/filter/xml/xmldrani.cxx
@@ -167,7 +167,7 @@ ScXMLDatabaseRangeContext::ScXMLDatabaseRangeContext( ScXMLImport& rImport,
case XML_ELEMENT( TABLE, XML_REFRESH_DELAY ):
{
double fTime;
- if (::sax::Converter::convertDuration( fTime, aIter.toString() ))
+ if (::sax::Converter::convertDuration( fTime, aIter.toView() ))
nRefresh = std::max( static_cast<sal_Int32>(fTime * 86400.0), sal_Int32(0) );
}
break;
diff --git a/sc/source/filter/xml/xmlexternaltabi.cxx b/sc/source/filter/xml/xmlexternaltabi.cxx
index a09d294f17ca..91bb218bb330 100644
--- a/sc/source/filter/xml/xmlexternaltabi.cxx
+++ b/sc/source/filter/xml/xmlexternaltabi.cxx
@@ -265,7 +265,7 @@ ScXMLExternalRefCellContext::ScXMLExternalRefCellContext(
{
if ( !it.isEmpty() && mrScImport.SetNullDateOnUnitConverter() )
{
- mrScImport.GetMM100UnitConverter().convertDateTime( mfCellValue, it.toString() );
+ mrScImport.GetMM100UnitConverter().convertDateTime( mfCellValue, it.toView() );
mbIsNumeric = true;
mbIsEmpty = false;
}
@@ -275,7 +275,7 @@ ScXMLExternalRefCellContext::ScXMLExternalRefCellContext(
{
if ( !it.isEmpty() )
{
- ::sax::Converter::convertDuration( mfCellValue, it.toString() );
+ ::sax::Converter::convertDuration( mfCellValue, it.toView() );
mbIsNumeric = true;
mbIsEmpty = false;
}
diff --git a/sc/source/filter/xml/xmlsceni.cxx b/sc/source/filter/xml/xmlsceni.cxx
index 353cd9012ae2..7a1c1848ba87 100644
--- a/sc/source/filter/xml/xmlsceni.cxx
+++ b/sc/source/filter/xml/xmlsceni.cxx
@@ -56,7 +56,7 @@ ScXMLTableScenarioContext::ScXMLTableScenarioContext(
bDisplayBorder = IsXMLToken(aIter, XML_TRUE);
break;
case XML_ELEMENT( TABLE, XML_BORDER_COLOR ):
- ::sax::Converter::convertColor(aBorderColor, aIter.toString());
+ ::sax::Converter::convertColor(aBorderColor, aIter.toView());
break;
case XML_ELEMENT( TABLE, XML_COPY_BACK ):
bCopyBack = IsXMLToken(aIter, XML_TRUE);