[Libreoffice-commits] core.git: sw/qa sw/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Mon Apr 6 13:35:34 UTC 2020
sw/qa/core/macros-test.cxx | 3 +--
sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 2 +-
sw/qa/extras/ooxmlexport/ooxmlexport12.cxx | 2 --
sw/qa/extras/ooxmlexport/ooxmlexport2.cxx | 7 ++-----
sw/qa/extras/rtfexport/rtfexport2.cxx | 2 +-
sw/qa/extras/rtfimport/rtfimport.cxx | 2 +-
sw/qa/extras/uiwriter/uiwriter.cxx | 2 --
sw/qa/extras/ww8export/ww8export.cxx | 1 -
sw/source/core/doc/tblrwcl.cxx | 2 --
sw/source/core/undo/untbl.cxx | 2 --
sw/source/filter/basflt/shellio.cxx | 2 --
sw/source/filter/docx/swdocxreader.cxx | 1 -
sw/source/filter/html/htmlform.cxx | 2 --
sw/source/filter/ww8/docxattributeoutput.cxx | 1 -
sw/source/filter/ww8/docxsdrexport.cxx | 1 -
sw/source/filter/ww8/ww8graf.cxx | 2 --
sw/source/filter/ww8/ww8par.cxx | 1 -
sw/source/ui/misc/glossary.cxx | 2 --
sw/source/uibase/dbui/dbmgr.cxx | 1 -
sw/source/uibase/ribbar/workctrl.cxx | 2 --
sw/source/uibase/uiview/srcview.cxx | 1 -
21 files changed, 6 insertions(+), 35 deletions(-)
New commits:
commit 23ebb037ef1b557113738e2fbdf1c0e9328371a9
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Apr 6 11:08:57 2020 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Apr 6 15:34:50 2020 +0200
loplugin:unusedvariableplus in sw
Change-Id: I0ec780ebe3b347a19a5aa809fe05723a2906cb49
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91738
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/sw/qa/core/macros-test.cxx b/sw/qa/core/macros-test.cxx
index d5b9889f1726..8bfcb884a2ac 100644
--- a/sw/qa/core/macros-test.cxx
+++ b/sw/qa/core/macros-test.cxx
@@ -263,10 +263,9 @@ void SwMacrosTest::testControlShapeGrouping()
CPPUNIT_ASSERT(xDPGrouper.is());
uno::Reference<drawing::XShapeGroup> xGroup(xDPGrouper->group(xShapes));
CPPUNIT_ASSERT(xGroup.is());
- uno::Reference<container::XIndexAccess> xGroupIC(xGroup, UNO_QUERY);
- CPPUNIT_ASSERT(xGroup.is());
#if 0
+ uno::Reference<container::XIndexAccess> xGroupIC(xGroup, UNO_QUERY);
CPPUNIT_ASSERT(xDateShape->getControl().is());
CPPUNIT_ASSERT_EQUAL(xDateShape->getControl(), xDateControlModel);
CPPUNIT_ASSERT(xTimeShape->getControl().is());
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 50f1b33fff47..67b6b5b22000 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -166,7 +166,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo80997, "fdo80997.docx")
{
// The problem was that the DOCX exporter not able to export text behind textbox, if textbox has a wrap property.
uno::Reference< text::XTextRange > xParagraph = getParagraph( 1 );
- uno::Reference< text::XTextRange > xText = getRun( xParagraph, 1, " text");
+ getRun( xParagraph, 1, " text");
}
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo80902, "fdo80902.docx")
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
index a317e9e977c5..a8588a0ddf68 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
@@ -807,7 +807,6 @@ DECLARE_OOXMLEXPORT_TEST(testTdf120224_textControlCrossRef, "tdf120224_textContr
uno::Reference<text::XBookmarksSupplier> xBookmarksSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XIndexAccess> xBookmarksByIdx(xBookmarksSupplier->getBookmarks(),
uno::UNO_QUERY);
- uno::Reference<container::XNameAccess> xBookmarksByName = xBookmarksSupplier->getBookmarks();
// TextFields should not be turned into real bookmarks.
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), xBookmarksByIdx->getCount());
@@ -830,7 +829,6 @@ DECLARE_OOXMLEXPORT_TEST(testTdf117504_numberingIndent, "tdf117504_numberingInde
DECLARE_OOXMLEXPORT_TEST(testWatermark, "watermark.docx")
{
uno::Reference<drawing::XShape> xShape = getShape(1);
- uno::Reference<beans::XPropertySet> xPropertySet(xShape, uno::UNO_QUERY);
sal_Int32 nHeight = xShape->getSize().Height;
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
index e473e0c66826..ffedbd31c42f 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
@@ -108,7 +108,6 @@ DECLARE_OOXMLEXPORT_TEST(defaultTabStopNotInStyles, "empty.odt")
// The default tab stop was mistakenly exported to a style.
// xray ThisComponent.StyleFamilies(1)(0).ParaTabStop
uno::Reference< container::XNameAccess > paragraphStyles = getStyles( "ParagraphStyles" );
- uno::Reference< beans::XPropertySet > properties( paragraphStyles->getByName( "Standard" ), uno::UNO_QUERY );
uno::Sequence< style::TabStop > stops = getProperty< uno::Sequence< style::TabStop > >(
paragraphStyles->getByName( "Standard" ), "ParaTabStops" );
// There actually be one tab stop, but it will be the default.
@@ -560,8 +559,6 @@ DECLARE_OOXMLEXPORT_TEST(testMathLiteral, "math-literal.docx")
DECLARE_OOXMLEXPORT_TEST(testFdo48557, "fdo48557.odt")
{
// Inner margins of the textframe wasn't exported.
- uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY);
- uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY);
uno::Reference<beans::XPropertySet> xFrame(getShape(1), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(sal_Int32(150), getProperty<sal_Int32>(xFrame, "TextLeftDistance"));
CPPUNIT_ASSERT_EQUAL(sal_Int32(150), getProperty<sal_Int32>(xFrame, "TextRightDistance"));
@@ -736,7 +733,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo64238_a, "fdo64238_a.docx")
sal_Int32 numOfRuns = 0;
while (xRunEnum->hasMoreElements())
{
- uno::Reference<text::XTextRange> xRun(xRunEnum->nextElement(), uno::UNO_QUERY);
+ xRunEnum->nextElement();
numOfRuns++;
}
CPPUNIT_ASSERT_EQUAL(sal_Int32(2), numOfRuns);
@@ -756,7 +753,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo64238_b, "fdo64238_b.docx")
sal_Int32 numOfRuns = 0;
while (xRunEnum->hasMoreElements())
{
- uno::Reference<text::XTextRange> xRun(xRunEnum->nextElement(), uno::UNO_QUERY);
+ xRunEnum->nextElement();
numOfRuns++;
}
CPPUNIT_ASSERT_EQUAL(sal_Int32(5), numOfRuns);
diff --git a/sw/qa/extras/rtfexport/rtfexport2.cxx b/sw/qa/extras/rtfexport/rtfexport2.cxx
index 243bf2511585..932b0ae550b4 100644
--- a/sw/qa/extras/rtfexport/rtfexport2.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport2.cxx
@@ -469,7 +469,7 @@ DECLARE_RTFEXPORT_TEST(testFdo76633, "fdo76633.rtf")
CPPUNIT_ASSERT(xShape->supportsService("com.sun.star.text.TextGraphicObject"));
try
{
- uno::Reference<drawing::XShape> xShape2 = getShape(2);
+ getShape(2);
CPPUNIT_FAIL("exception expected");
}
catch (lang::IndexOutOfBoundsException const&)
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 4e9b5e0a7002..f9d4e3cbdb6e 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -1170,7 +1170,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo49893_3)
// No artifacts (black lines in left top corner) as shape #3 are expected
try
{
- uno::Reference<drawing::XShape> xShape2 = getShape(3);
+ getShape(3);
CPPUNIT_FAIL("exception expected: no shape #3 in document");
}
catch (lang::IndexOutOfBoundsException const&)
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index dc14133f6e08..6f7abeaa1bfe 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -5010,7 +5010,6 @@ void SwUiWriterTest::testRemoveBookmarkTextAndAddNew()
{
// Get helper objects
uno::Reference<text::XBookmarksSupplier> xBookmarksSupplier(mxComponent, uno::UNO_QUERY);
- uno::Reference<css::lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY);
// Create cursor from bookmark
uno::Reference<text::XTextContent> xTextContent(xBookmarksSupplier->getBookmarks()->getByName("testBookmark"), uno::UNO_QUERY);
@@ -5077,7 +5076,6 @@ void SwUiWriterTest::testRemoveBookmarkTextAndAddNewAfterReload()
{
// Get helper objects
uno::Reference<text::XBookmarksSupplier> xBookmarksSupplier(mxComponent, uno::UNO_QUERY);
- uno::Reference<css::lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY);
// Create cursor from bookmark
uno::Reference<text::XTextContent> xTextContent(xBookmarksSupplier->getBookmarks()->getByName("test"), uno::UNO_QUERY);
diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx
index bd83678eccae..7b2321ffdbd3 100644
--- a/sw/qa/extras/ww8export/ww8export.cxx
+++ b/sw/qa/extras/ww8export/ww8export.cxx
@@ -703,7 +703,6 @@ DECLARE_WW8EXPORT_TEST(testN325936, "n325936.doc")
* xray ThisComponent.DrawPage(0).BackColorTransparency
*/
- uno::Reference<beans::XPropertySet> xPropertySet(getShape(1), uno::UNO_QUERY);
sal_Int32 nValue = getProperty< sal_Int32 >(getShape(1), "BackColorTransparency");
CPPUNIT_ASSERT_EQUAL(sal_Int32(100), nValue);
}
diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index e314e0fc7f59..97150a2309f8 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -2582,7 +2582,6 @@ bool SwTable::SetColWidth( SwTableBox& rCurrentBox, TableChgWidthHeightType eTyp
const SvxLRSpaceItem& rLR = GetFrameFormat()->GetLRSpace();
std::unique_ptr<FndBox_> xFndBox; // for insertion/deletion
- SwTableSortBoxes aTmpLst; // for Undo
bool bBigger,
bRet = false,
bLeft = TableChgWidthHeightType::ColLeft == extractPosition( eType ) ||
@@ -3025,7 +3024,6 @@ bool SwTable::SetRowHeight( SwTableBox& rCurrentBox, TableChgWidthHeightType eTy
pBaseLine = pBaseLine->GetUpper()->GetUpper();
std::unique_ptr<FndBox_> xFndBox; // for insertion/deletion
- SwTableSortBoxes aTmpLst; // for Undo
bool bBigger,
bRet = false,
bTop = TableChgWidthHeightType::CellTop == extractPosition( eType );
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index 4a3cb9c06fae..1cbf5c1bdad3 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -748,7 +748,6 @@ void SwUndoTextToTable::UndoImpl(::sw::UndoRedoContext & rContext)
}
}
- SwNodeIndex aEndIdx( *pTNd->EndOfSectionNode() );
rDoc.TableToText( pTNd, 0x0b == m_cSeparator ? 0x09 : m_cSeparator );
// join again at start?
@@ -1864,7 +1863,6 @@ void SwUndoTableMerge::UndoImpl(::sw::UndoRedoContext & rContext)
aMsgHint.m_eFlags = TBL_BOXPTR;
rDoc.getIDocumentFieldsAccess().UpdateTableFields( &aMsgHint );
- FndBox_ aTmpBox( nullptr, nullptr );
// ? TL_CHART2: notification or locking of controller required ?
// 1. restore deleted boxes:
diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx
index bfde92363222..d467a21d8a1c 100644
--- a/sw/source/filter/basflt/shellio.cxx
+++ b/sw/source/filter/basflt/shellio.cxx
@@ -148,8 +148,6 @@ ErrCode SwReader::Read( const Reader& rOptions )
}
mxDoc->GetIDocumentUndoRedo().DoUndo(false);
- SwNodeIndex aSplitIdx( mxDoc->GetNodes() );
-
RedlineFlags eOld = mxDoc->getIDocumentRedlineAccess().GetRedlineFlags();
RedlineFlags ePostReadRedlineFlags( RedlineFlags::Ignore );
diff --git a/sw/source/filter/docx/swdocxreader.cxx b/sw/source/filter/docx/swdocxreader.cxx
index 09dea9ba57be..84c0f18f7c0c 100644
--- a/sw/source/filter/docx/swdocxreader.cxx
+++ b/sw/source/filter/docx/swdocxreader.cxx
@@ -50,7 +50,6 @@ ErrCode SwDOCXReader::Read(SwDoc& rDoc, const OUString& /* rBaseURL */, SwPaM& r
return ERR_SWG_READ_ERROR;
// We want to work in an empty paragraph.
- auto pSttNdIdx = std::make_shared<SwNodeIndex>(rDoc.GetNodes());
const SwPosition* pPos = rPam.GetPoint();
rDoc.getIDocumentContentOperations().SplitNode(*pPos, false);
rDoc.SetTextFormatColl(rPam, rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool(RES_POOLCOLL_STANDARD, false));
diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx
index 67b3a2ffb8eb..dd0c0a81f83f 100644
--- a/sw/source/filter/html/htmlform.cxx
+++ b/sw/source/filter/html/htmlform.cxx
@@ -533,7 +533,6 @@ void SwHTMLImageWatcher::init( sal_Int32 Width, sal_Int32 Height )
// unregister and delete self
clear();
- uno::Reference< awt::XImageConsumer > xTmp = static_cast<awt::XImageConsumer*>(this);
xThis = nullptr;
}
@@ -562,7 +561,6 @@ void SwHTMLImageWatcher::complete( sal_Int32 Status,
{
// unregister and delete self
clear();
- uno::Reference< awt::XImageConsumer > xTmp = static_cast<awt::XImageConsumer*>(this);
xThis = nullptr;
}
}
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 25fa1285d9b8..8505571f545d 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -301,7 +301,6 @@ static bool lcl_isOnelinerSdt(const OUString& rName)
// write a floating table directly to docx without the surrounding frame
void DocxAttributeOutput::WriteFloatingTable(ww8::Frame const* pParentFrame)
{
- sax_fastparser::FSHelperPtr pFS = GetSerializer();
const SwFrameFormat& rFrameFormat = pParentFrame->GetFrameFormat();
m_aFloatingTablesOfParagraph.insert(&rFrameFormat);
const SwNodeIndex* pNodeIndex = rFrameFormat.GetContent().GetContentIdx();
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx
index 55b0a4169ac2..72ba3f0a6bc9 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -1119,7 +1119,6 @@ void DocxSdrExport::writeOnlyTextOfFrame(ww8::Frame const* pParentFrame)
{
const SwFrameFormat& rFrameFormat = pParentFrame->GetFrameFormat();
const SwNodeIndex* pNodeIndex = rFrameFormat.GetContent().GetContentIdx();
- sax_fastparser::FSHelperPtr pFS = m_pImpl->getSerializer();
sal_uLong nStt = pNodeIndex ? pNodeIndex->GetIndex() + 1 : 0;
sal_uLong nEnd = pNodeIndex ? pNodeIndex->GetNode().EndOfSectionIndex() : 0;
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index 8bd5b6f42b78..0090dbba9b02 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -3023,8 +3023,6 @@ SwFlyFrameFormat* SwWW8ImplReader::ConvertDrawTextToFly(SdrObject* &rpObject,
MoveInsideFly(pRetFrameFormat);
- SwNodeIndex aStart(m_pPaM->GetPoint()->nNode);
-
m_xWWZOrder->InsideEscher(pF->nSpId);
// read in the text
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 9f930a949dde..6183cac5fb94 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -5037,7 +5037,6 @@ ErrCode SwWW8ImplReader::CoreLoad(WW8Glossary const *pGloss)
size_t nPageDescOffset = m_rDoc.GetPageDescCnt();
SwNodeIndex aSttNdIdx( m_rDoc.GetNodes() );
- SwRelNumRuleSpaces aRelNumRule(m_rDoc, m_bNewDoc);
RedlineFlags eMode = RedlineFlags::ShowInsert | RedlineFlags::ShowDelete;
diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index aaeaa0b89e9e..916ade14f4b2 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -211,8 +211,6 @@ SwGlossaryDlg::SwGlossaryDlg(SfxViewFrame const * pViewFrame,
m_xShortNameEdit->connect_insert_text(LINK(this, SwGlossaryDlg, TextFilterHdl));
- SvtLinguConfig aLocalLinguConfig;
-
m_xEditBtn->connect_toggled(LINK(this, SwGlossaryDlg, EnableHdl));
m_xEditBtn->connect_selected(LINK(this, SwGlossaryDlg, MenuHdl));
m_xPathBtn->connect_clicked(LINK(this, SwGlossaryDlg, PathHdl));
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index a51cb6366753..19ae175bc319 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -480,7 +480,6 @@ bool SwDBManager::Merge( const SwMergeDescriptor& rMergeDesc )
// calls from the calculator may have added a connection with an invalid commandtype
//"real" data base connections added here have to re-use the already available
//DSData and set the correct CommandType
- SwDBData aTempData(aData);
aData.nCommandType = -1;
pTemp = FindDSData(aData, false);
if(pTemp)
diff --git a/sw/source/uibase/ribbar/workctrl.cxx b/sw/source/uibase/ribbar/workctrl.cxx
index 16ee3c8e00a5..81bfd2274a15 100644
--- a/sw/source/uibase/ribbar/workctrl.cxx
+++ b/sw/source/uibase/ribbar/workctrl.cxx
@@ -911,8 +911,6 @@ uno::Reference< awt::XWindow > SAL_CALL NavElementToolBoxControl::createItemWind
}
}
- uno::Reference< util::XURLTransformer > xURLTransformer = getURLTransformer();
-
return xItemWindow;
}
diff --git a/sw/source/uibase/uiview/srcview.cxx b/sw/source/uibase/uiview/srcview.cxx
index 2a3716f00017..6b8f4d253f8b 100644
--- a/sw/source/uibase/uiview/srcview.cxx
+++ b/sw/source/uibase/uiview/srcview.cxx
@@ -807,7 +807,6 @@ void SwSrcView::Load(SwDocShell* pDocShell)
utl::TempFile aTempFile;
aTempFile.EnableKillingFile();
const OUString sFileURL( aTempFile.GetURL() );
- SvtSaveOptions aOpt;
{
SfxMedium aMedium( sFileURL,StreamMode::READWRITE );
More information about the Libreoffice-commits
mailing list