summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorNoel <noelgrandin@gmail.com>2020-11-25 08:14:07 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-11-30 12:32:14 +0100
commit8332d6d8200e8ca1f22dd98d9373efd5a431d09c (patch)
treedd45d452202998297b8562743ea6345462304d04 /writerfilter
parentd05a4cfbdcece491f7385dbeaa7eca03f2fdc1d5 (diff)
loplugin:stringviewparam include comparisons with string literals
Change-Id: I8ba1214500dddaf413c506a4b82f43d63cda804b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106559 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/ConversionHelper.cxx8
-rw-r--r--writerfilter/source/dmapper/ConversionHelper.hxx2
-rw-r--r--writerfilter/source/dmapper/NumberingManager.cxx10
-rw-r--r--writerfilter/source/rtftok/rtfsdrimport.cxx16
-rw-r--r--writerfilter/source/rtftok/rtfsdrimport.hxx6
5 files changed, 21 insertions, 21 deletions
diff --git a/writerfilter/source/dmapper/ConversionHelper.cxx b/writerfilter/source/dmapper/ConversionHelper.cxx
index 26e975bb1342..809e85c90372 100644
--- a/writerfilter/source/dmapper/ConversionHelper.cxx
+++ b/writerfilter/source/dmapper/ConversionHelper.cxx
@@ -619,19 +619,19 @@ sal_Int16 ConvertNumberingType(sal_Int32 nFmt)
return nRet;
}
-sal_Int16 ConvertCustomNumberFormat(const OUString& rFormat)
+sal_Int16 ConvertCustomNumberFormat(std::u16string_view rFormat)
{
sal_Int16 nRet = -1;
- if (rFormat == "001, 002, 003, ...")
+ if (rFormat == u"001, 002, 003, ...")
{
nRet = style::NumberingType::ARABIC_ZERO3;
}
- else if (rFormat == "0001, 0002, 0003, ...")
+ else if (rFormat == u"0001, 0002, 0003, ...")
{
nRet = style::NumberingType::ARABIC_ZERO4;
}
- else if (rFormat == "00001, 00002, 00003, ...")
+ else if (rFormat == u"00001, 00002, 00003, ...")
{
nRet = style::NumberingType::ARABIC_ZERO5;
}
diff --git a/writerfilter/source/dmapper/ConversionHelper.hxx b/writerfilter/source/dmapper/ConversionHelper.hxx
index 9f970f668b80..ad0cd615fbec 100644
--- a/writerfilter/source/dmapper/ConversionHelper.hxx
+++ b/writerfilter/source/dmapper/ConversionHelper.hxx
@@ -50,7 +50,7 @@ namespace writerfilter::dmapper::ConversionHelper{
sal_Int16 convertTableJustification( sal_Int32 nIntValue );
css::text::RubyAdjust convertRubyAlign( sal_Int32 nIntValue );
sal_Int16 ConvertNumberingType(sal_Int32 nFmt);
- sal_Int16 ConvertCustomNumberFormat(const OUString& rFormat);
+ sal_Int16 ConvertCustomNumberFormat(std::u16string_view rFormat);
css::util::DateTime ConvertDateStringToDateTime(const OUString& rDateTime);
} // namespace writerfilter::dmapper::ConversionHelper
diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx
index f6e8e454a6a6..ec86b041e216 100644
--- a/writerfilter/source/dmapper/NumberingManager.cxx
+++ b/writerfilter/source/dmapper/NumberingManager.cxx
@@ -160,15 +160,15 @@ uno::Sequence<beans::PropertyValue> ListLevel::GetProperties(bool bDefaults)
return aLevelProps;
}
-static bool IgnoreForCharStyle(const OUString& aStr, const bool bIsSymbol)
+static bool IgnoreForCharStyle(std::u16string_view aStr, const bool bIsSymbol)
{
//Names found in PropertyIds.cxx, Lines 56-396
- return (aStr=="Adjust" || aStr=="IndentAt" || aStr=="FirstLineIndent"
- || aStr=="FirstLineOffset" || aStr=="LeftMargin"
- || aStr=="CharInteropGrabBag" || aStr=="ParaInteropGrabBag" ||
+ return (aStr==u"Adjust" || aStr==u"IndentAt" || aStr==u"FirstLineIndent"
+ || aStr==u"FirstLineOffset" || aStr==u"LeftMargin"
+ || aStr==u"CharInteropGrabBag" || aStr==u"ParaInteropGrabBag" ||
// We need font names when they are different for the bullet and for the text.
// But leave symbols alone, we only want to keep the font style for letters and numbers.
- (bIsSymbol && aStr=="CharFontName")
+ (bIsSymbol && aStr==u"CharFontName")
);
}
uno::Sequence< beans::PropertyValue > ListLevel::GetCharStyleProperties( )
diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx
index 01af8259ff91..be403b01f4e9 100644
--- a/writerfilter/source/rtftok/rtfsdrimport.cxx
+++ b/writerfilter/source/rtftok/rtfsdrimport.cxx
@@ -190,7 +190,7 @@ void RTFSdrImport::resolveFLine(uno::Reference<beans::XPropertySet> const& xProp
}
void RTFSdrImport::applyProperty(uno::Reference<drawing::XShape> const& xShape,
- const OUString& aKey, const OUString& aValue) const
+ std::u16string_view aKey, const OUString& aValue) const
{
uno::Reference<beans::XPropertySet> xPropertySet(xShape, uno::UNO_QUERY);
sal_Int16 nHoriOrient = 0;
@@ -198,7 +198,7 @@ void RTFSdrImport::applyProperty(uno::Reference<drawing::XShape> const& xShape,
boost::logic::tribool obFitShapeToText(boost::logic::indeterminate);
bool bFilled = true;
- if (aKey == "posh")
+ if (aKey == u"posh")
{
switch (aValue.toInt32())
{
@@ -221,7 +221,7 @@ void RTFSdrImport::applyProperty(uno::Reference<drawing::XShape> const& xShape,
break;
}
}
- else if (aKey == "posv")
+ else if (aKey == u"posv")
{
switch (aValue.toInt32())
{
@@ -238,11 +238,11 @@ void RTFSdrImport::applyProperty(uno::Reference<drawing::XShape> const& xShape,
break;
}
}
- else if (aKey == "fFitShapeToText")
+ else if (aKey == u"fFitShapeToText")
obFitShapeToText = aValue.toInt32() == 1;
- else if (aKey == "fFilled")
+ else if (aKey == u"fFilled")
bFilled = aValue.toInt32() == 1;
- else if (aKey == "rotation")
+ else if (aKey == u"rotation")
{
// See DffPropertyReader::Fix16ToAngle(): in RTF, positive rotation angles are clockwise, we have them as counter-clockwise.
// Additionally, RTF type is 0..360*2^16, our is 0..360*100.
@@ -1133,12 +1133,12 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shap
void RTFSdrImport::close() { m_rImport.Mapper().endShape(); }
-void RTFSdrImport::append(const OUString& aKey, const OUString& aValue)
+void RTFSdrImport::append(std::u16string_view aKey, const OUString& aValue)
{
applyProperty(m_xShape, aKey, aValue);
}
-void RTFSdrImport::appendGroupProperty(const OUString& aKey, const OUString& aValue)
+void RTFSdrImport::appendGroupProperty(std::u16string_view aKey, const OUString& aValue)
{
if (m_aParents.empty())
return;
diff --git a/writerfilter/source/rtftok/rtfsdrimport.hxx b/writerfilter/source/rtftok/rtfsdrimport.hxx
index f8d29b68701b..073244b913b1 100644
--- a/writerfilter/source/rtftok/rtfsdrimport.hxx
+++ b/writerfilter/source/rtftok/rtfsdrimport.hxx
@@ -54,9 +54,9 @@ public:
};
void resolve(RTFShape& rShape, bool bClose, ShapeOrPict shapeOrPict);
void close();
- void append(const OUString& aKey, const OUString& aValue);
+ void append(std::u16string_view aKey, const OUString& aValue);
/// Append property on the current parent.
- void appendGroupProperty(const OUString& aKey, const OUString& aValue);
+ void appendGroupProperty(std::u16string_view aKey, const OUString& aValue);
void resolveDhgt(css::uno::Reference<css::beans::XPropertySet> const& xPropertySet,
sal_Int32 nZOrder, bool bOldStyle);
/// Set line color and line width on the shape, using the relevant API depending on if the shape is a text frame or not.
@@ -83,7 +83,7 @@ private:
void createShape(const OUString& rService, css::uno::Reference<css::drawing::XShape>& xShape,
css::uno::Reference<css::beans::XPropertySet>& xPropertySet);
void applyProperty(css::uno::Reference<css::drawing::XShape> const& xShape,
- const OUString& aKey, const OUString& aValue) const;
+ std::u16string_view aKey, const OUString& aValue) const;
int initShape(css::uno::Reference<css::drawing::XShape>& o_xShape,
css::uno::Reference<css::beans::XPropertySet>& o_xPropSet, bool& o_rIsCustomShape,
RTFShape const& rShape, bool bClose, ShapeOrPict shapeOrPict);