diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-10-27 23:18:23 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-10-28 08:03:52 +0100 |
commit | 40fa3a61ac7dbe2ba73b5ee71bb85cc3bb4a27af (patch) | |
tree | 26f9d288b5434f5e23980053dab9d5a57749b60e /sw | |
parent | c4967928475f2be20ac2d79e3fa84ac435a7e560 (diff) |
Extend loplugin:elidestringvar to OString
(In VisitVarDecl, filtering out AbstractConditionalOperator avoids an unhelpful
> ~/lo/core/vcl/source/pdf/XmpMetadata.cxx:63:32: error: replace single use of literal 'rtl::OString' variable with a literal [loplugin:elidestringvar]
> aXmlWriter.content(sPdfConformance);
> ^~~~~~~~~~~~~~~
> ~/lo/core/vcl/source/pdf/XmpMetadata.cxx:52:21: note: literal 'rtl::OString' variable defined here [loplugin:elidestringvar]
> OString sPdfConformance = (mnPDF_A == 1) ? "A" : "B";
> ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
)
Change-Id: I7d0410f04827d79b4b526752917c37d33cad2671
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104911
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport14.cxx | 8 | ||||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter.cxx | 10 | ||||
-rw-r--r-- | sw/source/filter/html/wrthtml.cxx | 4 |
3 files changed, 9 insertions, 13 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx index ba955f016cce..d38b5cfcd605 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx @@ -810,9 +810,11 @@ CPPUNIT_TEST_FIXTURE(SwModelTestBase, testSemiTransparentText) mbExported = true; xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); CPPUNIT_ASSERT(pXmlDoc); - OString aXPath - = "/w:document/w:body/w:p/w:r/w:rPr/w14:textFill/w14:solidFill/w14:srgbClr/w14:alpha"; - double fValue = getXPath(pXmlDoc, aXPath, "val").toDouble(); + double fValue = getXPath( + pXmlDoc, + "/w:document/w:body/w:p/w:r/w:rPr/w14:textFill/w14:solidFill/w14:srgbClr/w14:alpha", + "val") + .toDouble(); sal_Int16 nActual = basegfx::fround(fValue / oox::drawingml::PER_PERCENT); // Without the accompanying fix in place, this test would have failed, as the w14:textFill diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 26a2f8a21056..884d896ccf62 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -7463,13 +7463,9 @@ void SwUiWriterTest::testInconsistentBookmark() { const OString aPath("/office:document-content/office:body/office:text/text:p"); - const OString aTagBookmarkStart("bookmark-start"); - const OString aTagControl("control"); - const OString aTagBookmarkEnd("bookmark-end"); - - const int pos1 = getXPathPosition(pXmlDoc, aPath, aTagBookmarkStart); - const int pos2 = getXPathPosition(pXmlDoc, aPath, aTagControl); - const int pos3 = getXPathPosition(pXmlDoc, aPath, aTagBookmarkEnd); + const int pos1 = getXPathPosition(pXmlDoc, aPath, "bookmark-start"); + const int pos2 = getXPathPosition(pXmlDoc, aPath, "control"); + const int pos3 = getXPathPosition(pXmlDoc, aPath, "bookmark-end"); CPPUNIT_ASSERT_GREATER(pos1, pos2); CPPUNIT_ASSERT_GREATER(pos2, pos3); diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx index c72b7ee4d14f..2071271e580c 100644 --- a/sw/source/filter/html/wrthtml.cxx +++ b/sw/source/filter/html/wrthtml.cxx @@ -1273,9 +1273,7 @@ void SwHTMLWriter::OutBackground( const SvxBrushItem *pBrushItem, bool bGraphic /// only checking, if transparency is not set. if( rBackColor != COL_TRANSPARENT ) { - OString sOut = - " " OOO_STRING_SVTOOLS_HTML_O_bgcolor "="; - Strm().WriteOString( sOut ); + Strm().WriteOString( " " OOO_STRING_SVTOOLS_HTML_O_bgcolor "=" ); HTMLOutFuncs::Out_Color( Strm(), rBackColor); } |