sc/qa/extras/scdatapilotfieldobj.cxx | 3 +-- test/source/sheet/xdatabaserange.cxx | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)
New commits: commit f1ac4376ffaee143ad24931744637aa0a4717016 Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Tue May 23 12:56:33 2023 +0200 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Tue May 23 14:35:03 2023 +0200 Don't even bother to introduce unused variables With <https://gerrit.libreoffice.org/c/core/+/152157> "More conservative SAL_WARN_UNUSED to avoid -Werror,-Wunused-private-field", these two cases would have started to cause "unused variable declaration [loplugin:casttovoid]" (because the call to isWarnUnusedType in compilerplugins/clang/casttovoid.cxx would no longer return true). Just avoid that by not introducing the variables in the first place. Change-Id: I3d2b085082555d1765fbd32045b5157deb0af67e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152158 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/sc/qa/extras/scdatapilotfieldobj.cxx b/sc/qa/extras/scdatapilotfieldobj.cxx index df10c2292761..f7ead7940576 100644 --- a/sc/qa/extras/scdatapilotfieldobj.cxx +++ b/sc/qa/extras/scdatapilotfieldobj.cxx @@ -96,8 +96,7 @@ uno::Reference<uno::XInterface> ScDataPilotFieldObj::init() uno::Reference<sheet::XDataPilotTablesSupplier> xDPTS(xSheet, uno::UNO_QUERY_THROW); uno::Reference<sheet::XDataPilotTables> xDPT(xDPTS->getDataPilotTables(), uno::UNO_SET_THROW); - uno::Sequence<OUString> aElementNames = xDPT->getElementNames(); - (void)aElementNames; + (void)xDPT->getElementNames(); uno::Reference<sheet::XDataPilotDescriptor> xDPDsc(xDPT->getByName("DataPilot1"), uno::UNO_QUERY_THROW); diff --git a/test/source/sheet/xdatabaserange.cxx b/test/source/sheet/xdatabaserange.cxx index f1133ac00f5d..9f0828a30513 100644 --- a/test/source/sheet/xdatabaserange.cxx +++ b/test/source/sheet/xdatabaserange.cxx @@ -125,8 +125,7 @@ void XDatabaseRange::testGetFilterDescriptor() void XDatabaseRange::testGetImportDescriptor() { uno::Reference<sheet::XDatabaseRange> xDBRange(init("ImportDescriptor"), UNO_QUERY_THROW); - uno::Sequence<beans::PropertyValue> xImportDescr = xDBRange->getImportDescriptor(); - (void)xImportDescr; + (void)xDBRange->getImportDescriptor(); } void XDatabaseRange::testRefresh()