summaryrefslogtreecommitdiff
path: root/sc/source/filter/xml
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/filter/xml')
-rw-r--r--sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx6
-rw-r--r--sc/source/filter/xml/XMLExportDatabaseRanges.cxx2
-rw-r--r--sc/source/filter/xml/XMLTableShapeImportHelper.cxx2
-rw-r--r--sc/source/filter/xml/xmlexprt.cxx6
-rw-r--r--sc/source/filter/xml/xmlimprt.cxx28
-rw-r--r--sc/source/filter/xml/xmlrowi.cxx2
6 files changed, 20 insertions, 26 deletions
diff --git a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx
index 80bf77187c0a..aabe42f6d4ce 100644
--- a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx
+++ b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx
@@ -26,7 +26,7 @@
#include <svl/zforlist.hxx>
#include <sax/tools/converter.hxx>
-#define SC_CHANGE_ID_PREFIX "ct"
+constexpr OStringLiteral SC_CHANGE_ID_PREFIX = "ct";
ScMyCellInfo::ScMyCellInfo(
const ScCellValue& rCell, const OUString& rFormulaAddress, const OUString& rFormula,
@@ -198,10 +198,10 @@ sal_uInt32 ScXMLChangeTrackingImportHelper::GetIDFromString(std::string_view sID
sal_uInt32 nResult(0);
if (!sID.empty())
{
- if (sID.substr(0, strlen(SC_CHANGE_ID_PREFIX)) == SC_CHANGE_ID_PREFIX)
+ if (sID.substr(0, SC_CHANGE_ID_PREFIX.getLength()) == SC_CHANGE_ID_PREFIX)
{
sal_Int32 nValue;
- ::sax::Converter::convertNumber(nValue, sID.substr(strlen(SC_CHANGE_ID_PREFIX)));
+ ::sax::Converter::convertNumber(nValue, sID.substr(SC_CHANGE_ID_PREFIX.getLength()));
OSL_ENSURE(nValue > 0, "wrong change action ID");
nResult = nValue;
}
diff --git a/sc/source/filter/xml/XMLExportDatabaseRanges.cxx b/sc/source/filter/xml/XMLExportDatabaseRanges.cxx
index db50c1ecd703..437b2704f5a9 100644
--- a/sc/source/filter/xml/XMLExportDatabaseRanges.cxx
+++ b/sc/source/filter/xml/XMLExportDatabaseRanges.cxx
@@ -50,7 +50,7 @@
#include <map>
//! not found in unonames.hxx
-#define SC_USERLIST "UserList"
+constexpr OUStringLiteral SC_USERLIST = u"UserList";
using namespace com::sun::star;
using namespace xmloff::token;
diff --git a/sc/source/filter/xml/XMLTableShapeImportHelper.cxx b/sc/source/filter/xml/XMLTableShapeImportHelper.cxx
index 1bfcd6064c00..e6066acebc85 100644
--- a/sc/source/filter/xml/XMLTableShapeImportHelper.cxx
+++ b/sc/source/filter/xml/XMLTableShapeImportHelper.cxx
@@ -33,7 +33,7 @@
#include <com/sun/star/drawing/XShape.hpp>
#include <com/sun/star/drawing/XShapes.hpp>
-#define SC_LAYERID "LayerID"
+constexpr OUStringLiteral SC_LAYERID = u"LayerID";
using namespace ::com::sun::star;
using namespace xmloff::token;
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index 085d54dd1f07..4b3f155aec27 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -164,7 +164,7 @@ namespace com::sun::star::uno { class XComponentContext; }
//! not found in unonames.hxx
-#define SC_LAYERID "LayerID"
+constexpr OUStringLiteral SC_LAYERID = u"LayerID";
#define SC_VIEWCHANGES_COUNT 13
#define SC_SHOW_CHANGES 0
@@ -339,8 +339,6 @@ sal_Int16 ScXMLExport::GetMeasureUnit()
return SvXMLUnitConverter::GetMeasureUnit(eFieldUnit);
}
-constexpr OUStringLiteral gsLayerID( u"" SC_LAYERID );
-
ScXMLExport::ScXMLExport(
const css::uno::Reference< css::uno::XComponentContext >& rContext,
OUString const & implementationName, SvXMLExportFlags nExportFlag)
@@ -524,7 +522,7 @@ void ScXMLExport::CollectSharedData(SCTAB& nTableCount, sal_Int32& nShapesCount)
continue;
sal_Int16 nLayerID = 0;
- bool bExtracted = xShapeProp->getPropertyValue(gsLayerID) >>= nLayerID;
+ bool bExtracted = xShapeProp->getPropertyValue(SC_LAYERID) >>= nLayerID;
if (!bExtracted)
continue;
diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx
index 99d33d2416db..75ba5e24dcd7 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -102,11 +102,11 @@
#include <memory>
#include <utility>
-#define SC_LOCALE "Locale"
-#define SC_CURRENCYSYMBOL "CurrencySymbol"
-#define SC_REPEAT_ROW "repeat-row"
-#define SC_FILTER "filter"
-#define SC_PRINT_RANGE "print-range"
+constexpr OUStringLiteral SC_LOCALE = u"Locale";
+constexpr OUStringLiteral SC_CURRENCYSYMBOL = u"CurrencySymbol";
+constexpr OUStringLiteral SC_REPEAT_ROW = u"repeat-row";
+constexpr OUStringLiteral SC_FILTER = u"filter";
+constexpr OUStringLiteral SC_PRINT_RANGE = u"print-range";
using namespace com::sun::star;
using namespace ::xmloff::token;
@@ -350,10 +350,6 @@ SvXMLImportContext *ScXMLImport::CreateFastContext( sal_Int32 nElement,
return pContext;
}
-constexpr OUStringLiteral gsNumberFormat(u"" SC_UNONAME_NUMFMT);
-constexpr OUStringLiteral gsLocale(u"" SC_LOCALE);
-constexpr OUStringLiteral gsCellStyle(u"" SC_UNONAME_CELLSTYL);
-
ScXMLImport::ScXMLImport(
const css::uno::Reference< css::uno::XComponentContext >& rContext,
OUString const & implementationName, SvXMLImportFlags nImportFlag,
@@ -822,7 +818,7 @@ sal_Int32 ScXMLImport::SetCurrencySymbol(const sal_Int32 nKey, std::u16string_vi
if (xProperties.is())
{
lang::Locale aLocale;
- if (GetDocument() && (xProperties->getPropertyValue(gsLocale) >>= aLocale))
+ if (GetDocument() && (xProperties->getPropertyValue(SC_LOCALE) >>= aLocale))
{
{
ScXMLImport::MutexGuard aGuard(*this);
@@ -920,7 +916,7 @@ void ScXMLImport::SetType(const uno::Reference <beans::XPropertySet>& rPropertie
return;
if (rNumberFormat == -1)
- rProperties->getPropertyValue( gsNumberFormat ) >>= rNumberFormat;
+ rProperties->getPropertyValue( SC_UNONAME_NUMFMT ) >>= rNumberFormat;
OSL_ENSURE(rNumberFormat != -1, "no NumberFormat");
bool bIsStandard;
// sCurrentCurrency may be the ISO code abbreviation if the currency
@@ -957,18 +953,18 @@ void ScXMLImport::SetType(const uno::Reference <beans::XPropertySet>& rPropertie
if (nCellType != util::NumberFormat::CURRENCY)
{
lang::Locale aLocale;
- if ( xNumberFormatProperties->getPropertyValue(gsLocale) >>= aLocale )
+ if ( xNumberFormatProperties->getPropertyValue(SC_LOCALE) >>= aLocale )
{
if (!xNumberFormatTypes.is())
xNumberFormatTypes.set(uno::Reference <util::XNumberFormatTypes>(xNumberFormats, uno::UNO_QUERY));
- rProperties->setPropertyValue( gsNumberFormat, uno::makeAny(xNumberFormatTypes->getStandardFormat(nCellType, aLocale)) );
+ rProperties->setPropertyValue( SC_UNONAME_NUMFMT, uno::makeAny(xNumberFormatTypes->getStandardFormat(nCellType, aLocale)) );
}
}
else if (!rCurrency.empty() && !sCurrentCurrency.isEmpty())
{
if (sCurrentCurrency != rCurrency)
if (!IsCurrencySymbol(rNumberFormat, sCurrentCurrency, rCurrency))
- rProperties->setPropertyValue( gsNumberFormat, uno::makeAny(SetCurrencySymbol(rNumberFormat, rCurrency)));
+ rProperties->setPropertyValue( SC_UNONAME_NUMFMT, uno::makeAny(SetCurrencySymbol(rNumberFormat, rCurrency)));
}
}
}
@@ -982,7 +978,7 @@ void ScXMLImport::SetType(const uno::Reference <beans::XPropertySet>& rPropertie
{
if ((nCellType == util::NumberFormat::CURRENCY) && !rCurrency.empty() && !sCurrentCurrency.isEmpty() &&
sCurrentCurrency != rCurrency && !IsCurrencySymbol(rNumberFormat, sCurrentCurrency, rCurrency))
- rProperties->setPropertyValue( gsNumberFormat, uno::makeAny(SetCurrencySymbol(rNumberFormat, rCurrency)));
+ rProperties->setPropertyValue( SC_UNONAME_NUMFMT, uno::makeAny(SetCurrencySymbol(rNumberFormat, rCurrency)));
}
}
@@ -1033,7 +1029,7 @@ void ScXMLImport::SetStyleToRanges()
}
else
{
- xProperties->setPropertyValue(gsCellStyle, uno::makeAny(GetStyleDisplayName( XmlStyleFamily::TABLE_CELL, sPrevStyleName )));
+ xProperties->setPropertyValue(SC_UNONAME_CELLSTYL, uno::makeAny(GetStyleDisplayName( XmlStyleFamily::TABLE_CELL, sPrevStyleName )));
sal_Int32 nNumberFormat(GetStyleNumberFormats()->GetStyleNumberFormat(sPrevStyleName));
bool bInsert(nNumberFormat == -1);
SetType(xProperties, nNumberFormat, nPrevCellType, sPrevCurrency);
diff --git a/sc/source/filter/xml/xmlrowi.cxx b/sc/source/filter/xml/xmlrowi.cxx
index ed1719039e95..585eaa4cfe9f 100644
--- a/sc/source/filter/xml/xmlrowi.cxx
+++ b/sc/source/filter/xml/xmlrowi.cxx
@@ -39,7 +39,7 @@
#include <comphelper/servicehelper.hxx>
#include <osl/diagnose.h>
-#define SC_ISFILTERED "IsFiltered"
+constexpr OUStringLiteral SC_ISFILTERED = u"IsFiltered";
using namespace com::sun::star;
using namespace xmloff::token;