summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-01-28 09:23:03 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-01-28 09:18:31 +0100
commitb5bde198a8e5054277787d3c6b5feddb4c5b93fd (patch)
treeb69fcda448584b2488c6e85f99a2fb14d53e73c6
parent72302338f9eb5e965dd84dca9990841151e2f79c (diff)
remove some unused local vars
found by my new loplugin:unusedvariableplus Change-Id: Ic3f55f492d43a53d8850a97d44059ff127fd69a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87573 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--cui/source/dialogs/SignatureLineDialog.cxx2
-rw-r--r--cui/source/dialogs/cuicharmap.cxx2
-rw-r--r--framework/source/layoutmanager/toolbarlayoutmanager.cxx2
-rw-r--r--oox/source/ppt/slidefragmenthandler.cxx1
-rw-r--r--package/source/zipapi/ZipFile.cxx2
-rw-r--r--reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx1
-rw-r--r--sc/qa/unit/ucalc_condformat.cxx4
-rw-r--r--sc/qa/unit/ucalc_formula.cxx2
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocument.cxx1
-rw-r--r--sc/source/ui/view/drawvie4.cxx4
-rw-r--r--sc/source/ui/view/viewfun3.cxx6
-rw-r--r--sccomp/qa/unit/SwarmSolverTest.cxx10
-rw-r--r--scripting/source/dlgprov/dlgevtatt.cxx1
-rw-r--r--sfx2/source/control/charwin.cxx2
-rw-r--r--starmath/source/mathmlimport.cxx1
-rw-r--r--sw/qa/extras/odfimport/odfimport.cxx5
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport10.cxx5
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport14.cxx1
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport2.cxx2
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport8.cxx1
-rw-r--r--sw/qa/extras/uiwriter/uiwriter2.cxx2
-rw-r--r--sw/qa/extras/ww8export/ww8export.cxx2
-rw-r--r--sw/source/core/edit/edfcol.cxx1
-rw-r--r--sw/source/uibase/uiview/viewstat.cxx2
-rw-r--r--xmlsecurity/source/component/documentdigitalsignatures.cxx4
25 files changed, 6 insertions, 60 deletions
diff --git a/cui/source/dialogs/SignatureLineDialog.cxx b/cui/source/dialogs/SignatureLineDialog.cxx
index 16f3b22ddd4a..45a11c9fc111 100644
--- a/cui/source/dialogs/SignatureLineDialog.cxx
+++ b/cui/source/dialogs/SignatureLineDialog.cxx
@@ -172,8 +172,6 @@ void SignatureLineDialog::Apply()
// Default anchoring
xShapeProps->setPropertyValue("AnchorType", Any(TextContentAnchorType_AT_PARAGRAPH));
- const Reference<XServiceInfo> xServiceInfo(m_xModel, UNO_QUERY);
-
// Writer
const Reference<XTextDocument> xTextDocument(m_xModel, UNO_QUERY);
if (xTextDocument.is())
diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx
index 62dd835bb0e1..22450f6722e6 100644
--- a/cui/source/dialogs/cuicharmap.cxx
+++ b/cui/source/dialogs/cuicharmap.cxx
@@ -607,8 +607,6 @@ void SvxCharacterMap::insertCharToDoc(const OUString& sGlyph)
return;
if (m_xFrame.is()) {
- uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
-
uno::Sequence<beans::PropertyValue> aArgs(2);
aArgs[0].Name = "Symbols";
aArgs[0].Value <<= sGlyph;
diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
index c7feaeacb70b..1bc783916b60 100644
--- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx
+++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
@@ -348,8 +348,6 @@ void ToolbarLayoutManager::reset()
{
{
SolarMutexGuard aWriteLock;
- uno::Reference< ui::XUIConfigurationManager > xModuleCfgMgr(m_xModuleCfgMgr);
- uno::Reference< ui::XUIConfigurationManager > xDocCfgMgr(m_xDocCfgMgr);
m_xModuleCfgMgr.clear();
m_xDocCfgMgr.clear();
m_ePreviewDetection = PREVIEWFRAME_UNKNOWN;
diff --git a/oox/source/ppt/slidefragmenthandler.cxx b/oox/source/ppt/slidefragmenthandler.cxx
index c3ab59d4e9ae..e2f80adc1942 100644
--- a/oox/source/ppt/slidefragmenthandler.cxx
+++ b/oox/source/ppt/slidefragmenthandler.cxx
@@ -110,7 +110,6 @@ SlideFragmentHandler::~SlideFragmentHandler()
}
if( !bNotesFragmentPathFound && !mpSlidePersistPtr->getMasterPersist() )
{
- TextListStylePtr pTextListStyle = std::make_shared<TextListStyle>();
SlidePersistPtr pMasterPersistPtr = std::make_shared<SlidePersist>( rFilter, true, true, mpSlidePersistPtr->getPage(),
std::make_shared<PPTShape>( Master, "com.sun.star.drawing.GroupShape" ), mpSlidePersistPtr->getNotesTextStyle() );
pMasterPersistPtr->setPath( aNotesFragmentPath );
diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx
index 7de1da7f2963..d8c1de39315c 100644
--- a/package/source/zipapi/ZipFile.cxx
+++ b/package/source/zipapi/ZipFile.cxx
@@ -1102,8 +1102,6 @@ void ZipFile::recover()
for( auto& rEntry : aEntries )
{
- ZipEntry aTmp = rEntry.second;
-
// this is a broken package, accept this block not only for DEFLATED streams
if( rEntry.second.nFlag & 8 )
{
diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
index d71379715fb2..c3559667869c 100644
--- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
+++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
@@ -254,7 +254,6 @@ void SAL_CALL ImportDocumentHandler::startElement(const OUString & _sName, const
{
bool bHasCategories = true;
const sal_Int16 nLength = (_xAttrList.is()) ? _xAttrList->getLength() : 0;
- ::std::unique_ptr<SvXMLTokenMap> pMasterElemTokenMap( OXMLHelper::GetSubDocumentElemTokenMap());
for(sal_Int16 i = 0; i < nLength; ++i)
{
OUString sLocalName;
diff --git a/sc/qa/unit/ucalc_condformat.cxx b/sc/qa/unit/ucalc_condformat.cxx
index 31dddda3de55..ed1b0fcc00b8 100644
--- a/sc/qa/unit/ucalc_condformat.cxx
+++ b/sc/qa/unit/ucalc_condformat.cxx
@@ -1222,11 +1222,7 @@ void Test::testCondFormatListenToOwnRange()
pList->InsertNew(std::move(pFormat));
bool bFirstCallbackCalled = false;
- bool bSecondCallbackCalled = false;
- bool bThirdCallbackCalled = false;
std::function<void()> aFirstCallback = [&]() {bFirstCallbackCalled = true;};
- std::function<void()> aSecondCallback = [&]() {bSecondCallbackCalled = true;};
- std::function<void()> aThirdCallback = [&]() {bThirdCallbackCalled = true;};
pData->m_Entries[0]->SetType(COLORSCALE_PERCENT);
pData->m_Entries[0]->SetRepaintCallback(aFirstCallback);
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index 6219a65d35c7..dbd8bd951bab 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -178,8 +178,6 @@ void Test::testFormulaCreateStringFromTokens()
};
(void) aTests;
- std::unique_ptr<ScTokenArray> pArray;
-
sc::TokenStringContext aCxt(m_pDoc, formula::FormulaGrammar::GRAM_ENGLISH);
// Artificially add external reference data after the context object is
diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx
index 22bdd25ea433..f5a0ecd3d6b9 100644
--- a/sc/source/ui/Accessibility/AccessibleDocument.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx
@@ -159,7 +159,6 @@ struct ScShapeDataLess
static bool LessThanSheet(const ScAccessibleShapeData* pData)
{
bool bResult(false);
- uno::Reference< beans::XPropertySet> xProps(pData->xShape, uno::UNO_QUERY);
if (pData->mxLayerID)
{
if (SdrLayerID(*pData->mxLayerID) == SC_LAYER_BACK)
diff --git a/sc/source/ui/view/drawvie4.cxx b/sc/source/ui/view/drawvie4.cxx
index 25c64c2e5ef3..aca511f7fd51 100644
--- a/sc/source/ui/view/drawvie4.cxx
+++ b/sc/source/ui/view/drawvie4.cxx
@@ -61,7 +61,6 @@ void ScDrawView::BeginDrag( vcl::Window* pWindow, const Point& rStartPos )
BrkAction();
tools::Rectangle aMarkedRect = GetAllMarkedRect();
- vcl::Region aRegion( aMarkedRect );
aDragStartDiff = rStartPos - aMarkedRect.TopLeft();
@@ -362,8 +361,7 @@ void ScDrawView::DoCopy()
aObjDesc.maDisplayName = pDocSh->GetMedium()->GetURLObject().GetURLNoPass();
// maSize is set in ScDrawTransferObj ctor
- ScDrawTransferObj* pTransferObj = new ScDrawTransferObj( std::move(pModel), pDocSh, aObjDesc );
- uno::Reference<css::datatransfer::XTransferable2> xTransferObj = pTransferObj;
+ rtl::Reference<ScDrawTransferObj> pTransferObj(new ScDrawTransferObj( std::move(pModel), pDocSh, aObjDesc ));
if ( ScGlobal::xDrawClipDocShellRef.is() )
{
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index 72bd69f209f2..26c672cb64f3 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -290,8 +290,7 @@ bool ScViewFunc::CopyToClipSingleRange( ScDocument* pClipDoc, const ScRangeList&
aObjDesc.maDisplayName = pDocSh->GetMedium()->GetURLObject().GetURLNoPass();
// maSize is set in ScTransferObj ctor
- ScTransferObj* pTransferObj = new ScTransferObj( ScDocumentUniquePtr(pClipDoc), aObjDesc );
- uno::Reference<css::datatransfer::XTransferable2> xTransferObj = pTransferObj;
+ rtl::Reference<ScTransferObj> pTransferObj(new ScTransferObj( ScDocumentUniquePtr(pClipDoc), aObjDesc ));
if ( ScGlobal::xDrawClipDocShellRef.is() )
{
SfxObjectShellRef aPersistRef( ScGlobal::xDrawClipDocShellRef.get() );
@@ -407,8 +406,7 @@ bool ScViewFunc::CopyToClipMultiRange( const ScDocument* pInputClipDoc, const Sc
aObjDesc.maDisplayName = pDocSh->GetMedium()->GetURLObject().GetURLNoPass();
// maSize is set in ScTransferObj ctor
- ScTransferObj* pTransferObj = new ScTransferObj( std::move(pDocClip), aObjDesc );
- uno::Reference<css::datatransfer::XTransferable2> xTransferObj = pTransferObj;
+ rtl::Reference<ScTransferObj> pTransferObj(new ScTransferObj( std::move(pDocClip), aObjDesc ));
if ( ScGlobal::xDrawClipDocShellRef.is() )
{
SfxObjectShellRef aPersistRef( ScGlobal::xDrawClipDocShellRef.get() );
diff --git a/sccomp/qa/unit/SwarmSolverTest.cxx b/sccomp/qa/unit/SwarmSolverTest.cxx
index 90422e520197..a92eb0b65d49 100644
--- a/sccomp/qa/unit/SwarmSolverTest.cxx
+++ b/sccomp/qa/unit/SwarmSolverTest.cxx
@@ -66,8 +66,6 @@ void SwarmSolverTest::testUnconstrained()
uno::Reference<container::XIndexAccess> xIndex(xDocument->getSheets(), uno::UNO_QUERY_THROW);
uno::Reference<sheet::XSpreadsheet> xSheet(xIndex->getByIndex(0), uno::UNO_QUERY_THROW);
- uno::Reference<table::XCell> xCell;
-
uno::Reference<sheet::XSolver> xSolver;
const OUString sSolverName("com.sun.star.comp.Calc.SwarmSolver");
@@ -118,8 +116,6 @@ void SwarmSolverTest::testVariableBounded()
uno::Reference<container::XIndexAccess> xIndex(xDocument->getSheets(), uno::UNO_QUERY_THROW);
uno::Reference<sheet::XSpreadsheet> xSheet(xIndex->getByIndex(0), uno::UNO_QUERY_THROW);
- uno::Reference<table::XCell> xCell;
-
uno::Reference<sheet::XSolver> xSolver;
const OUString sSolverName("com.sun.star.comp.Calc.SwarmSolver");
@@ -172,8 +168,6 @@ void SwarmSolverTest::testVariableConstrained()
uno::Reference<container::XIndexAccess> xIndex(xDocument->getSheets(), uno::UNO_QUERY_THROW);
uno::Reference<sheet::XSpreadsheet> xSheet(xIndex->getByIndex(0), uno::UNO_QUERY_THROW);
- uno::Reference<table::XCell> xCell;
-
uno::Reference<sheet::XSolver> xSolver;
const OUString sSolverName("com.sun.star.comp.Calc.SwarmSolver");
@@ -230,8 +224,6 @@ void SwarmSolverTest::testTwoVariables()
uno::Reference<container::XIndexAccess> xIndex(xDocument->getSheets(), uno::UNO_QUERY_THROW);
uno::Reference<sheet::XSpreadsheet> xSheet(xIndex->getByIndex(0), uno::UNO_QUERY_THROW);
- uno::Reference<table::XCell> xCell;
-
uno::Reference<sheet::XSolver> xSolver;
const OUString sSolverName("com.sun.star.comp.Calc.SwarmSolver");
@@ -295,8 +287,6 @@ void SwarmSolverTest::testMultipleVariables()
uno::Reference<container::XIndexAccess> xIndex(xDocument->getSheets(), uno::UNO_QUERY_THROW);
uno::Reference<sheet::XSpreadsheet> xSheet(xIndex->getByIndex(0), uno::UNO_QUERY_THROW);
- uno::Reference<table::XCell> xCell;
-
uno::Reference<sheet::XSolver> xSolver;
const OUString sSolverName("com.sun.star.comp.Calc.SwarmSolver");
diff --git a/scripting/source/dlgprov/dlgevtatt.cxx b/scripting/source/dlgprov/dlgevtatt.cxx
index bf7fe601d299..c47465610503 100644
--- a/scripting/source/dlgprov/dlgevtatt.cxx
+++ b/scripting/source/dlgprov/dlgevtatt.cxx
@@ -220,7 +220,6 @@ namespace dlgprov
Reference< container::XNameContainer > xEventCont = xEventsSupplier->getEvents();
Reference< XControlModel > xControlModel = xControl->getModel();
- Reference< XPropertySet > xProps( xControlModel, uno::UNO_QUERY );
if ( xEventCont.is() )
{
const Sequence< OUString > aNames = xEventCont->getElementNames();
diff --git a/sfx2/source/control/charwin.cxx b/sfx2/source/control/charwin.cxx
index c054880ed2c7..ac9ea6fb2f71 100644
--- a/sfx2/source/control/charwin.cxx
+++ b/sfx2/source/control/charwin.cxx
@@ -105,8 +105,6 @@ void SvxCharView::InsertCharToDoc()
if (GetText().isEmpty())
return;
- uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
-
uno::Sequence<beans::PropertyValue> aArgs(2);
aArgs[0].Name = "Symbols";
aArgs[0].Value <<= GetText();
diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx
index bcfaae1f7bd6..55d9eeda2503 100644
--- a/starmath/source/mathmlimport.cxx
+++ b/starmath/source/mathmlimport.cxx
@@ -2738,7 +2738,6 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportMML(SvStream &rStream)
uno::Reference<beans::XPropertySet> xInfoSet;
uno::Reference<uno::XComponentContext> xContext(comphelper::getProcessComponentContext());
- uno::Reference<lang::XMultiServiceFactory> xMultiServiceFactory(comphelper::getProcessServiceFactory());
uno::Reference<io::XInputStream> xStream(new utl::OSeekableInputStreamWrapper(rStream));
//SetLoading hack because the document properties will be re-initted
diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx
index 08495526e572..7e4e4a252ae7 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -615,9 +615,8 @@ DECLARE_ODFIMPORT_TEST(testFdo37606Copy, "fdo37606.odt")
pWrtShell->SelAll(); // Selects the whole document.
// Ctrl-C
- SwTransferable* pTransferable = new SwTransferable(*pWrtShell);
- uno::Reference<datatransfer::XTransferable> xTransferable(pTransferable);
- pTransferable->Copy();
+ rtl::Reference<SwTransferable> xTransferable(new SwTransferable(*pWrtShell));
+ xTransferable->Copy();
pWrtShell->SttEndDoc(false); // Go to the end of the doc.
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
index 52484bffa02f..ab98e5324a5d 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
@@ -102,8 +102,6 @@ protected:
DECLARE_OOXMLEXPORT_TEST(testSmartart, "smartart.docx")
{
- uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
- uno::Reference<beans::XPropertySet> xTextDocumentPropertySet(xTextDocument, uno::UNO_QUERY);
uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XIndexAccess> xDraws = xDrawPageSupplier->getDrawPage();
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDraws->getCount()); // One groupshape in the doc
@@ -601,12 +599,10 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf116194, "tdf116194.docx")
DECLARE_OOXMLEXPORT_TEST(testMsoBrightnessContrast, "msobrightnesscontrast.docx")
{
- uno::Reference<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY);
uno::Reference<drawing::XShape> image = getShape(1);
uno::Reference<beans::XPropertySet> imageProperties(image, uno::UNO_QUERY);
uno::Reference<graphic::XGraphic> graphic;
imageProperties->getPropertyValue( "Graphic" ) >>= graphic;
- uno::Reference<awt::XBitmap> bitmap(graphic, uno::UNO_QUERY);
Graphic aVclGraphic(graphic);
BitmapEx aBitmap(aVclGraphic.GetBitmapEx());
CPPUNIT_ASSERT_EQUAL(58L, aBitmap.GetSizePixel().Width());
@@ -1180,7 +1176,6 @@ DECLARE_OOXMLEXPORT_TEST( testTableCellMargin, "table-cell-margin.docx" )
sal_Int32 const cellLeftMarginFromOffice[] = { 250, 100, 0, 0 };
uno::Reference< text::XTextTablesSupplier > xTablesSupplier( mxComponent, uno::UNO_QUERY );
- uno::Reference< frame::XModel > xModel( mxComponent, uno::UNO_QUERY );
uno::Reference< container::XIndexAccess > xTables( xTablesSupplier->getTextTables(), uno::UNO_QUERY );
for ( int i = 0; i < 4; i++ )
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index 1b4bf79fdc2d..398ba1fabbd2 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -154,7 +154,6 @@ DECLARE_OOXMLIMPORT_TEST(testTdf125038, "tdf125038.docx")
DECLARE_OOXMLIMPORT_TEST(testTdf124986, "tdf124986.docx")
{
// Load a document with SET fields, where the SET fields contain leading/trailing quotation marks and spaces.
- uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields());
uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration());
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
index b34b125a4fe7..f72306fdea1b 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
@@ -355,7 +355,6 @@ struct SingleLineBorders {
DECLARE_OOXMLEXPORT_TEST(testTableBorders, "table-borders.docx")
{
uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
- uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount());
uno::Reference<text::XTextTable> xTextTable (xTables->getByIndex(0), uno::UNO_QUERY);
@@ -648,7 +647,6 @@ DECLARE_OOXMLEXPORT_TEST(testWatermark, "watermark.docx")
// 1st problem: last character was missing
CPPUNIT_ASSERT_EQUAL(OUString("SAMPLE"), xShape->getString());
- uno::Reference<beans::XPropertySet> xPropertySet(xShape, uno::UNO_QUERY);
uno::Sequence<beans::PropertyValue> aProps = getProperty< uno::Sequence<beans::PropertyValue> >(xShape, "CustomShapeGeometry");
bool bFound = false;
for (int i = 0; i < aProps.getLength(); ++i)
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
index 0a575a103491..d4b32ab32466 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
@@ -354,7 +354,6 @@ numbering = numberingstyle.getByIndex(0)
xray numbering(11) - should be 4, arabic
note that the indexes may get off as the implementation evolves, C++ code searches in loops
*/
- uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
uno::Reference< text::XTextRange > paragraph(getParagraph( 1, "Text1." ));
OUString numberingStyleName = getProperty< OUString >( paragraph, "NumberingStyleName" );
uno::Reference<text::XNumberingRulesSupplier> xNumberingRulesSupplier(mxComponent, uno::UNO_QUERY);
diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx
index f4dbb0683174..190b82f51cd0 100644
--- a/sw/qa/extras/uiwriter/uiwriter2.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter2.cxx
@@ -672,7 +672,6 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf64242_optimizeTable)
SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
- uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(),
uno::UNO_QUERY);
uno::Reference<text::XTextTable> xTextTable(xTables->getByIndex(0), uno::UNO_QUERY);
@@ -714,7 +713,6 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf126784_distributeSelectedColumns)
SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
- uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(),
uno::UNO_QUERY);
uno::Reference<text::XTextTable> xTextTable(xTables->getByIndex(0), uno::UNO_QUERY);
diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx
index 61506b8f3702..ad43b3d26714 100644
--- a/sw/qa/extras/ww8export/ww8export.cxx
+++ b/sw/qa/extras/ww8export/ww8export.cxx
@@ -222,7 +222,6 @@ Two pairs of horizontal rules (one absolute width, one relative width)
have the same width (full page width, half page width).
xray ThisComponent.DrawPage.getByIndex(0).BoundRect
*/
- uno::Reference<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY);
uno::Reference<drawing::XShape> rule1 = getShape(1), rule2 = getShape(2), rule3 = getShape(3), rule4 = getShape(4);
uno::Reference<beans::XPropertySet> ruleProperties1(rule1, uno::UNO_QUERY);
uno::Reference<beans::XPropertySet> ruleProperties2(rule2, uno::UNO_QUERY);
@@ -492,7 +491,6 @@ DECLARE_WW8EXPORT_TEST(testBorderColours, "bordercolours.doc")
DECLARE_WW8EXPORT_TEST(testMsoBrightnessContrast, "msobrightnesscontrast.doc")
{
- uno::Reference<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY);
uno::Reference<drawing::XShape> image = getShape(1);
uno::Reference<beans::XPropertySet> imageProperties(image, uno::UNO_QUERY);
uno::Reference<graphic::XGraphic> graphic;
diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx
index 92c9d031348f..f6804b0db3c4 100644
--- a/sw/source/core/edit/edfcol.cxx
+++ b/sw/source/core/edit/edfcol.cxx
@@ -1385,7 +1385,6 @@ SfxWatermarkItem SwEditShell::GetWatermark() const
for (const OUString& rPageStyleName : aUsedPageStyles)
{
uno::Reference<beans::XPropertySet> xPageStyle(xStyleFamily->getByName(rPageStyleName), uno::UNO_QUERY);
- uno::Reference<lang::XMultiServiceFactory> xMultiServiceFactory(xModel, uno::UNO_QUERY);
bool bHeaderIsOn = false;
xPageStyle->getPropertyValue(UNO_NAME_HEADER_IS_ON) >>= bHeaderIsOn;
diff --git a/sw/source/uibase/uiview/viewstat.cxx b/sw/source/uibase/uiview/viewstat.cxx
index 76742a9ad35c..ca90d62f1528 100644
--- a/sw/source/uibase/uiview/viewstat.cxx
+++ b/sw/source/uibase/uiview/viewstat.cxx
@@ -280,8 +280,6 @@ void SwView::GetState(SfxItemSet &rSet)
break;
case FN_REDLINE_SHOW:
{
- uno::Reference<uno::XComponentContext> const xContext(
- comphelper::getProcessComponentContext());
rSet.Put(SfxBoolItem(nWhich, !m_pWrtShell->GetLayout()->IsHideRedlines()));
}
break;
diff --git a/xmlsecurity/source/component/documentdigitalsignatures.cxx b/xmlsecurity/source/component/documentdigitalsignatures.cxx
index 9f4bcb7a85f2..777158a40157 100644
--- a/xmlsecurity/source/component/documentdigitalsignatures.cxx
+++ b/xmlsecurity/source/component/documentdigitalsignatures.cxx
@@ -820,9 +820,7 @@ bool DocumentDigitalSignatures::signWithCertificateImpl(
aSignatureManager.getSignatureHelper().SetStorage(xStorage, m_sODFVersion);
aSignatureManager.setSignatureStream(xStream);
- Reference<XXMLSecurityContext> xSecurityContext;
- Reference<XServiceInfo> xServiceInfo(xCertificate, UNO_QUERY);
- xSecurityContext = aSignatureManager.getSecurityContext();
+ Reference<XXMLSecurityContext> xSecurityContext = aSignatureManager.getSecurityContext();
sal_Int32 nSecurityId;