sc/qa/extras/scpdfexport.cxx                                 |    8 +-
 sc/qa/unit/copy_paste_test.cxx                               |   40 +++++------
 sc/source/core/data/attrib.cxx                               |    2 
 sc/source/core/tool/addinlis.cxx                             |    4 -
 sc/source/filter/xcl97/xcl97rec.cxx                          |    2 
 sc/source/filter/xml/XMLTrackedChangesContext.cxx            |    2 
 sc/source/filter/xml/xmlwrap.cxx                             |    2 
 sc/source/ui/Accessibility/AccessibleCsvControl.cxx          |    4 -
 sc/source/ui/Accessibility/AccessibleDocument.cxx            |   12 +--
 sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx |    4 -
 sc/source/ui/Accessibility/AccessiblePageHeader.cxx          |    4 -
 sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx         |   14 +--
 sc/source/ui/app/inputwin.cxx                                |    4 -
 sc/source/ui/dbgui/csvgrid.cxx                               |    4 -
 sc/source/ui/dbgui/csvruler.cxx                              |    4 -
 sc/source/ui/drawfunc/fuins2.cxx                             |    2 
 sc/source/ui/navipi/content.cxx                              |    8 +-
 sc/source/ui/unoobj/PivotTableDataProvider.cxx               |    8 +-
 sc/source/ui/unoobj/PivotTableDataSequence.cxx               |    4 -
 sc/source/ui/unoobj/TablePivotCharts.cxx                     |    2 
 sc/source/ui/unoobj/cellsuno.cxx                             |    2 
 sc/source/ui/unoobj/chart2uno.cxx                            |    4 -
 sc/source/ui/unoobj/textuno.cxx                              |    4 -
 sc/source/ui/unoobj/warnpassword.cxx                         |    2 
 sc/source/ui/vba/vbahyperlinks.cxx                           |    4 -
 sc/source/ui/vba/vbarange.cxx                                |    2 
 sc/source/ui/vba/vbasheetobjects.cxx                         |    6 -
 sc/source/ui/vba/vbaworksheet.cxx                            |    2 
 28 files changed, 78 insertions(+), 82 deletions(-)

New commits:
commit 1c02784889a5b4104878e2c767dff723b2173275
Author:     Noel <noel.gran...@collabora.co.uk>
AuthorDate: Fri Feb 12 15:35:03 2021 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon Feb 15 08:39:02 2021 +0100

    loplugin:referencecasting in sc
    
    Change-Id: I908c0d5a2a3360bb9c9c9edf925a485411515ea2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110816
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sc/qa/extras/scpdfexport.cxx b/sc/qa/extras/scpdfexport.cxx
index 58a93df8268e..cfdb4a966aed 100644
--- a/sc/qa/extras/scpdfexport.cxx
+++ b/sc/qa/extras/scpdfexport.cxx
@@ -100,13 +100,13 @@ void ScPDFExportTest::setUp()
         CPPUNIT_ASSERT(xController.is());
 
         // introduce model/view/controller to each other
-        xController->attachModel(xModel2.get());
-        xModel2->connectController(xController.get());
+        xController->attachModel(xModel2);
+        xModel2->connectController(xController);
 
-        xTargetFrame->setComponent(xController->getComponentWindow(), 
xController.get());
+        xTargetFrame->setComponent(xController->getComponentWindow(), 
xController);
         xController->attachFrame(xTargetFrame);
 
-        xModel2->setCurrentController(xController.get());
+        xModel2->setCurrentController(xController);
     }
 }
 
diff --git a/sc/qa/unit/copy_paste_test.cxx b/sc/qa/unit/copy_paste_test.cxx
index cd1110404eda..ba5d0a226489 100644
--- a/sc/qa/unit/copy_paste_test.cxx
+++ b/sc/qa/unit/copy_paste_test.cxx
@@ -101,11 +101,11 @@ void ScCopyPasteTest::testCopyPasteXLS()
     CPPUNIT_ASSERT( xController.is() );
 
     // introduce model/view/controller to each other
-    xController->attachModel( xModel2.get() );
-    xModel2->connectController( xController.get() );
-    xTargetFrame->setComponent( xController->getComponentWindow(), 
xController.get() );
+    xController->attachModel( xModel2 );
+    xModel2->connectController( xController );
+    xTargetFrame->setComponent( xController->getComponentWindow(), xController 
);
     xController->attachFrame( xTargetFrame );
-    xModel2->setCurrentController( xController.get() );
+    xModel2->setCurrentController( xController );
 
     ScDocument& rDoc = xDocSh->GetDocument();
 
@@ -224,11 +224,11 @@ void ScCopyPasteTest::testTdf84411()
     CPPUNIT_ASSERT( xController.is() );
 
     // introduce model/view/controller to each other
-    xController->attachModel( xModel2.get() );
-    xModel2->connectController( xController.get() );
-    xTargetFrame->setComponent( xController->getComponentWindow(), 
xController.get() );
+    xController->attachModel( xModel2 );
+    xModel2->connectController( xController );
+    xTargetFrame->setComponent( xController->getComponentWindow(), xController 
);
     xController->attachFrame( xTargetFrame );
-    xModel2->setCurrentController( xController.get() );
+    xModel2->setCurrentController( xController );
 
     ScDocument& rDoc = xDocSh->GetDocument();
 
@@ -293,11 +293,11 @@ void ScCopyPasteTest::testTdf124565()
     CPPUNIT_ASSERT( xController.is() );
 
     // introduce model/view/controller to each other
-    xController->attachModel( xModel2.get() );
-    xModel2->connectController( xController.get() );
-    xTargetFrame->setComponent( xController->getComponentWindow(), 
xController.get() );
+    xController->attachModel( xModel2 );
+    xModel2->connectController( xController );
+    xTargetFrame->setComponent( xController->getComponentWindow(), xController 
);
     xController->attachFrame( xTargetFrame );
-    xModel2->setCurrentController( xController.get() );
+    xModel2->setCurrentController( xController );
 
     ScDocument& rDoc = xDocSh->GetDocument();
     ScTabViewShell* pViewShell = xDocSh->GetBestViewShell(false);
@@ -364,11 +364,11 @@ void ScCopyPasteTest::testTdf126421()
     CPPUNIT_ASSERT(xController.is());
 
     // introduce model/view/controller to each other
-    xController->attachModel(xModel2.get());
-    xModel2->connectController(xController.get());
-    xTargetFrame->setComponent(xController->getComponentWindow(), 
xController.get());
+    xController->attachModel(xModel2);
+    xModel2->connectController(xController);
+    xTargetFrame->setComponent(xController->getComponentWindow(), xController);
     xController->attachFrame(xTargetFrame);
-    xModel2->setCurrentController(xController.get());
+    xModel2->setCurrentController(xController);
 
     ScDocument& rDoc = xDocSh->GetDocument();
 
@@ -484,11 +484,11 @@ ScDocShellRef 
ScCopyPasteTest::loadDocAndSetupModelViewController(std::u16string
     CPPUNIT_ASSERT(xController.is());
 
     // introduce model/view/controller to each other
-    xController->attachModel(xModel2.get());
-    xModel2->connectController(xController.get());
-    xTargetFrame->setComponent(xController->getComponentWindow(), 
xController.get());
+    xController->attachModel(xModel2);
+    xModel2->connectController(xController);
+    xTargetFrame->setComponent(xController->getComponentWindow(), xController);
     xController->attachFrame(xTargetFrame);
-    xModel2->setCurrentController(xController.get());
+    xModel2->setCurrentController(xController);
 
     return xDocSh;
 }
diff --git a/sc/source/core/data/attrib.cxx b/sc/source/core/data/attrib.cxx
index 1ae01ef1c26f..105c95c6a7ae 100644
--- a/sc/source/core/data/attrib.cxx
+++ b/sc/source/core/data/attrib.cxx
@@ -395,7 +395,7 @@ bool ScPageHFItem::QueryValue( uno::Any& rVal, sal_uInt8 /* 
nMemberId */ ) const
         new ScHeaderFooterContentObj();
     xContent->Init(pLeftArea.get(), pCenterArea.get(), pRightArea.get());
 
-    uno::Reference<sheet::XHeaderFooterContent> xCont(xContent.get());
+    uno::Reference<sheet::XHeaderFooterContent> xCont(xContent);
 
     rVal <<= xCont;
     return true;
diff --git a/sc/source/core/tool/addinlis.cxx b/sc/source/core/tool/addinlis.cxx
index 7a9f5d49fd64..56d178eb66b7 100644
--- a/sc/source/core/tool/addinlis.cxx
+++ b/sc/source/core/tool/addinlis.cxx
@@ -41,7 +41,7 @@ ScAddInListener* ScAddInListener::CreateListener(
     aAllListeners.push_back( xNew );
 
     if ( xVR.is() )
-        xVR->addResultListener( xNew.get() ); // after at least 1 ref exists!
+        xVR->addResultListener( xNew ); // after at least 1 ref exists!
 
     return xNew.get();
 }
@@ -87,7 +87,7 @@ void ScAddInListener::RemoveDocument( ScDocument* pDocumentP )
             if ( p->empty() )
             {
                 if ( (*iter)->xVolRes.is() )
-                    (*iter)->xVolRes->removeResultListener( iter->get() );
+                    (*iter)->xVolRes->removeResultListener( *iter );
 
                 iter = aAllListeners.erase( iter );
                 continue;
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx 
b/sc/source/filter/xcl97/xcl97rec.cxx
index 55eff899c3bb..485bdc38b784 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -1092,7 +1092,7 @@ void XclObjAny::WriteFromTo( XclExpXmlStream& rStrm, 
const Reference< XShape >&
     awt::Size   aSize       = rShape->getSize();
 
     // There are a few cases where we must adjust these values
-    SdrObject* pObj = SdrObject::getSdrObjectFromXShape(rShape.get());
+    SdrObject* pObj = SdrObject::getSdrObjectFromXShape(rShape);
     if (pObj)
     {
         Degree100 nRotation = pObj->GetRotateAngle();
diff --git a/sc/source/filter/xml/XMLTrackedChangesContext.cxx 
b/sc/source/filter/xml/XMLTrackedChangesContext.cxx
index 3f8870ea32c2..3490303bc670 100644
--- a/sc/source/filter/xml/XMLTrackedChangesContext.cxx
+++ b/sc/source/filter/xml/XMLTrackedChangesContext.cxx
@@ -829,7 +829,7 @@ void ScXMLChangeCellContext::CreateTextPContext(bool 
bIsNewParagraph)
 
     mpEditTextObj = new ScEditEngineTextObj();
     
mpEditTextObj->GetEditEngine()->SetEditTextObjectPool(GetScImport().GetDocument()->GetEditPool());
-    uno::Reference <text::XText> xText(mpEditTextObj.get());
+    uno::Reference <text::XText> xText(mpEditTextObj);
     if (xText.is())
     {
         uno::Reference<text::XTextCursor> 
xTextCursor(xText->createTextCursor());
diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx
index 5442788aa1f5..446ce19e34d8 100644
--- a/sc/source/filter/xml/xmlwrap.cxx
+++ b/sc/source/filter/xml/xmlwrap.cxx
@@ -868,7 +868,7 @@ bool ScXMLImportWrapper::Export(bool bStylesOnly)
 
         auto xObjectHelper = SvXMLEmbeddedObjectHelper::Create(
             xStorage, *pObjSh, SvXMLEmbeddedObjectHelperMode::Write);
-        uno::Reference<document::XEmbeddedObjectResolver> 
xObjectResolver(xObjectHelper.get());
+        uno::Reference<document::XEmbeddedObjectResolver> 
xObjectResolver(xObjectHelper);
 
         // styles export
 
diff --git a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx 
b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx
index 5842675f5a34..fc3157cf57a0 100644
--- a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx
+++ b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx
@@ -830,12 +830,12 @@ Reference<XAccessible> 
ScAccessibleCsvGrid::getAccessibleCell(sal_Int32 nRow, sa
     if (aI != maAccessibleChildren.end() && 
!(maAccessibleChildren.key_comp()(nIndex, aI->first)))
     {
         // key already exists
-        return Reference<XAccessible>(aI->second.get());
+        return aI->second;
     }
     // key does not exist
     rtl::Reference<ScAccessibleCsvCell> xNew = implCreateCellObj(nRow, 
nColumn);
     maAccessibleChildren.insert(aI, XAccessibleSet::value_type(nIndex, xNew));
-    return Reference<XAccessible>(xNew.get());
+    return xNew;
 }
 
 Reference< XAccessible > SAL_CALL ScAccessibleCsvGrid::getAccessibleChild( 
sal_Int32 nIndex )
diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx 
b/sc/source/ui/Accessibility/AccessibleDocument.cxx
index 5ea1219d2616..ef0dd31d337a 100644
--- a/sc/source/ui/Accessibility/AccessibleDocument.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx
@@ -454,7 +454,7 @@ bool ScChildrenShapes::ReplaceChild 
(::accessibility::AccessibleShape* pCurrentC
             AccessibleEventObject aEvent;
             aEvent.EventId = AccessibleEventId::CHILD;
             aEvent.Source = uno::Reference< XAccessibleContext 
>(mpAccessibleDocument);
-            aEvent.NewValue <<= 
uno::Reference<XAccessible>(pReplacement.get());
+            aEvent.NewValue <<= uno::Reference<XAccessible>(pReplacement);
 
             mpAccessibleDocument->CommitChange(aEvent); // child is new - event
             bResult = true;
@@ -490,7 +490,7 @@ ScChildrenShapes::GetAccessibleCaption (const 
css::uno::Reference < css::drawing
     if (it == maShapesMap.end())
         return nullptr;
     ScAccessibleShapeData* pShape = it->second;
-    css::uno::Reference< css::accessibility::XAccessible > xNewChild( 
pShape->pAccShape.get() );
+    css::uno::Reference< css::accessibility::XAccessible > xNewChild( 
pShape->pAccShape );
     if(xNewChild)
         return xNewChild;
     return nullptr;
@@ -537,7 +537,7 @@ uno::Reference< XAccessible > ScChildrenShapes::Get(const 
ScAccessibleShapeData*
             pData->pAccShape->SetRelationSet(GetRelationSet(pData));
         }
     }
-    return pData->pAccShape.get();
+    return pData->pAccShape;
  }
 
 uno::Reference< XAccessible > ScChildrenShapes::Get(sal_Int32 nIndex) const
@@ -1096,7 +1096,7 @@ bool ScChildrenShapes::FindSelectedShapesChanges(const 
uno::Reference<drawing::X
                 aEvent.EventId = AccessibleEventId::SELECTION_CHANGED;
             }
             aEvent.Source = uno::Reference< XAccessible 
>(mpAccessibleDocument);
-            uno::Reference< XAccessible > xChild( rpShape->pAccShape.get());
+            uno::Reference< XAccessible > xChild( rpShape->pAccShape );
             aEvent.NewValue <<= xChild;
             mpAccessibleDocument->CommitChange(aEvent);
         }
@@ -1106,7 +1106,7 @@ bool ScChildrenShapes::FindSelectedShapesChanges(const 
uno::Reference<drawing::X
         AccessibleEventObject aEvent;
         aEvent.EventId =  AccessibleEventId::SELECTION_CHANGED_REMOVE;
         aEvent.Source = uno::Reference< XAccessible >(mpAccessibleDocument);
-        uno::Reference< XAccessible > xChild( rpShape->pAccShape.get());
+        uno::Reference< XAccessible > xChild( rpShape->pAccShape );
         aEvent.NewValue <<= xChild;
         mpAccessibleDocument->CommitChange(aEvent);
     }
@@ -2100,7 +2100,7 @@ uno::Reference < XAccessible >
         mpAccessibleSpreadsheet->Init();
         mbCompleteSheetSelected = IsTableSelected();
     }
-    return mpAccessibleSpreadsheet.get();
+    return mpAccessibleSpreadsheet;
 }
 
 void ScAccessibleDocument::FreeAccessibleSpreadsheet()
diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx 
b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
index 0c974bd5a1c4..44c36c2a5d77 100644
--- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
@@ -1201,7 +1201,7 @@ void ScAccessibleDocumentPagePreview::Notify( 
SfxBroadcaster& rBC, const SfxHint
             if (mpTable.is()) // if there is no table there is nothing to 
notify, because no one recognizes the change
             {
                 {
-                    uno::Reference<XAccessible> xAcc = mpTable.get();
+                    uno::Reference<XAccessible> xAcc = mpTable;
                     AccessibleEventObject aEvent;
                     aEvent.EventId = AccessibleEventId::CHILD;
                     aEvent.Source = uno::Reference< XAccessibleContext >(this);
@@ -1234,7 +1234,7 @@ void ScAccessibleDocumentPagePreview::Notify( 
SfxBroadcaster& rBC, const SfxHint
                 mpTable->Init();
 
                 {
-                    uno::Reference<XAccessible> xAcc = mpTable.get();
+                    uno::Reference<XAccessible> xAcc = mpTable;
                     AccessibleEventObject aEvent;
                     aEvent.EventId = AccessibleEventId::CHILD;
                     aEvent.Source = uno::Reference< XAccessibleContext >(this);
diff --git a/sc/source/ui/Accessibility/AccessiblePageHeader.cxx 
b/sc/source/ui/Accessibility/AccessiblePageHeader.cxx
index c836849a8be7..41d189325f3a 100644
--- a/sc/source/ui/Accessibility/AccessiblePageHeader.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePageHeader.cxx
@@ -111,7 +111,7 @@ void ScAccessiblePageHeader::Notify( SfxBroadcaster& rBC, 
const SfxHint& rHint )
                     AccessibleEventObject aEvent;
                     aEvent.EventId = AccessibleEventId::CHILD;
                     aEvent.Source = uno::Reference< XAccessibleContext >(this);
-                    aEvent.OldValue <<= 
uno::Reference<XAccessible>(aOldAreas[i].get());
+                    aEvent.OldValue <<= 
uno::Reference<XAccessible>(aOldAreas[i]);
 
                     CommitChange(aEvent); // child gone - event
                     aOldAreas[i]->dispose();
@@ -121,7 +121,7 @@ void ScAccessiblePageHeader::Notify( SfxBroadcaster& rBC, 
const SfxHint& rHint )
                     AccessibleEventObject aEvent;
                     aEvent.EventId = AccessibleEventId::CHILD;
                     aEvent.Source = uno::Reference< XAccessibleContext >(this);
-                    aEvent.NewValue <<= 
uno::Reference<XAccessible>(maAreas[i].get());
+                    aEvent.NewValue <<= 
uno::Reference<XAccessible>(maAreas[i]);
 
                     CommitChange(aEvent); // new child - event
                 }
diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx 
b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
index c2017c1f5f5f..23de41a4bec4 100644
--- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
+++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
@@ -341,7 +341,7 @@ void ScAccessibleSpreadsheet::LostFocus()
     AccessibleEventObject aEvent;
     aEvent.EventId = AccessibleEventId::ACTIVE_DESCENDANT_CHANGED;
     aEvent.Source = uno::Reference< XAccessibleContext >(this);
-    aEvent.OldValue <<= uno::Reference<XAccessible>(mpAccCell.get());
+    aEvent.OldValue <<= uno::Reference<XAccessible>(mpAccCell);
 
     CommitChange(aEvent);
 
@@ -457,7 +457,7 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, 
const SfxHint& rHint
                 AccessibleEventObject aEvent;
                 aEvent.EventId = AccessibleEventId::ACTIVE_DESCENDANT_CHANGED;
                 aEvent.Source = uno::Reference< XAccessibleContext >(this);
-                aEvent.NewValue <<= 
uno::Reference<XAccessible>(mpAccCell.get());
+                aEvent.NewValue <<= uno::Reference<XAccessible>(mpAccCell);
 
                 CommitChange(aEvent);
             }
@@ -737,10 +737,10 @@ void ScAccessibleSpreadsheet::CommitFocusCell(const 
ScAddress &aNewCell)
     AccessibleEventObject aEvent;
     aEvent.EventId = AccessibleEventId::ACTIVE_DESCENDANT_CHANGED;
     aEvent.Source = uno::Reference< XAccessible >(this);
-    aEvent.OldValue <<= uno::Reference<XAccessible>(mpAccCell.get());
+    aEvent.OldValue <<= uno::Reference<XAccessible>(mpAccCell);
     mpAccCell.clear();
     mpAccCell = GetAccessibleCellAt(aNewCell.Row(), aNewCell.Col());
-    aEvent.NewValue <<= uno::Reference<XAccessible>(mpAccCell.get());
+    aEvent.NewValue <<= uno::Reference<XAccessible>(mpAccCell);
     maActiveCell = aNewCell;
     ScDocument* pScDoc= GetDocument(mpViewShell);
     if (pScDoc)
@@ -924,7 +924,7 @@ uno::Reference< XAccessible > SAL_CALL 
ScAccessibleSpreadsheet::getAccessibleCel
         throw lang::IndexOutOfBoundsException();
     }
     rtl::Reference<ScAccessibleCell> pAccessibleCell = 
GetAccessibleCellAt(nRow, nColumn);
-    return pAccessibleCell.get();
+    return pAccessibleCell;
 }
 
 sal_Bool SAL_CALL ScAccessibleSpreadsheet::isAccessibleSelected( sal_Int32 
nRow, sal_Int32 nColumn )
@@ -1491,9 +1491,9 @@ void ScAccessibleSpreadsheet::NotifyRefMode()
         AccessibleEventObject aEvent;
         aEvent.Source = uno::Reference< XAccessible >(this);
         aEvent.EventId = AccessibleEventId::ACTIVE_DESCENDANT_CHANGED;
-        aEvent.OldValue <<= 
uno::Reference<XAccessible>(m_pAccFormulaCell.get());
+        aEvent.OldValue <<= uno::Reference<XAccessible>(m_pAccFormulaCell);
         m_pAccFormulaCell = GetAccessibleCellAt(aFormulaAddr.Row(), 
aFormulaAddr.Col());
-        uno::Reference< XAccessible > xNew = m_pAccFormulaCell.get();
+        uno::Reference< XAccessible > xNew = m_pAccFormulaCell;
         aEvent.NewValue <<= xNew;
         CommitChange(aEvent);
         if (nRefStartX == nRefEndX && nRefStartY == nRefEndY)
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 7b770be225f7..cd9961bc364b 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -1598,7 +1598,7 @@ bool ScTextWnd::MouseButtonDown( const MouseEvent& rMEvt )
     }
     else
     {
-        rtl::Reference<TransferDataContainer> xTransferable(m_xHelper.get());
+        rtl::Reference<TransferDataContainer> xTransferable(m_xHelper);
         GetDrawingArea()->enable_drag_source(xTransferable, DND_ACTION_COPY);
     }
     return WeldEditView::MouseButtonDown(rMEvt);
@@ -2034,7 +2034,7 @@ void ScTextWnd::SetDrawingArea(weld::DrawingArea* 
pDrawingArea)
     // we don't transfer the happenstance formatting in
     // the input line
     m_xHelper.set(new svt::OStringTransferable(OUString()));
-    rtl::Reference<TransferDataContainer> xHelper(m_xHelper.get());
+    rtl::Reference<TransferDataContainer> xHelper(m_xHelper);
     SetDragDataTransferrable(xHelper, DND_ACTION_COPY);
 
     OutputDevice& rDevice = pDrawingArea->get_ref_device();
diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx
index 13b8f671c3e8..d289ec0f69d4 100644
--- a/sc/source/ui/dbgui/csvgrid.cxx
+++ b/sc/source/ui/dbgui/csvgrid.cxx
@@ -1412,8 +1412,8 @@ tools::Rectangle ScCsvGrid::GetFocusRect()
 css::uno::Reference<css::accessibility::XAccessible> 
ScCsvGrid::CreateAccessible()
 {
     rtl::Reference<ScAccessibleCsvGrid> xRef(new ScAccessibleCsvGrid(*this));
-    mxAccessible.set(xRef.get());
-    return css::uno::Reference<css::accessibility::XAccessible>(xRef.get());
+    mxAccessible = xRef;
+    return xRef;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/csvruler.cxx b/sc/source/ui/dbgui/csvruler.cxx
index 95e042290185..3b8a1a808399 100644
--- a/sc/source/ui/dbgui/csvruler.cxx
+++ b/sc/source/ui/dbgui/csvruler.cxx
@@ -658,8 +658,8 @@ void ScCsvRuler::ImplSetMousePointer( sal_Int32 nPos )
 css::uno::Reference<css::accessibility::XAccessible> 
ScCsvRuler::CreateAccessible()
 {
     rtl::Reference<ScAccessibleCsvRuler> xRef(new ScAccessibleCsvRuler(*this));
-    mxAccessible.set(xRef.get());
-    return css::uno::Reference<css::accessibility::XAccessible>(xRef.get());
+    mxAccessible = xRef;
+    return xRef;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index 1502539ddae1..680e91765af5 100644
--- a/sc/source/ui/drawfunc/fuins2.cxx
+++ b/sc/source/ui/drawfunc/fuins2.cxx
@@ -131,7 +131,7 @@ void lcl_ChartInit(const uno::Reference 
<embed::XEmbeddedObject>& xObj, ScViewDa
     {
         rtl::Reference<sc::PivotTableDataProvider> pPivotTableDataProvider(new 
sc::PivotTableDataProvider(rScDoc));
         pPivotTableDataProvider->setPivotTableName(aRangeString);
-        xDataProvider.set(pPivotTableDataProvider.get());
+        xDataProvider = pPivotTableDataProvider;
     }
     else
     {
diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index 27308f4bc9eb..823ea306ae87 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -142,7 +142,7 @@ 
ScContentTree::ScContentTree(std::unique_ptr<weld::TreeView> xTreeView, ScNaviga
     m_xTreeView->connect_popup_menu(LINK(this, ScContentTree, CommandHdl));
     m_xTreeView->connect_query_tooltip(LINK(this, ScContentTree, 
QueryTooltipHdl));
 
-    rtl::Reference<TransferDataContainer> xHelper(m_xTransferObj.get());
+    rtl::Reference<TransferDataContainer> xHelper(m_xTransferObj);
     m_xTreeView->enable_drag_source(xHelper, DND_ACTION_COPY | 
DND_ACTION_LINK);
 
     m_xTreeView->connect_drag_begin(LINK(this, ScContentTree, DragBeginHdl));
@@ -1175,7 +1175,7 @@ static bool lcl_DoDragObject( ScDocShell* pSrcShell, 
std::u16string_view rName,
 
             SC_MOD()->SetDragObject( nullptr, pTransferObj.get() );
 
-            rtl::Reference<TransferDataContainer> xHelper(pTransferObj.get());
+            rtl::Reference<TransferDataContainer> xHelper(pTransferObj);
             rTreeView.enable_drag_source(xHelper, DND_ACTION_COPY | 
DND_ACTION_LINK);
 
             bDisallow = false;
@@ -1215,7 +1215,7 @@ static bool lcl_DoDragCells( ScDocShell* pSrcShell, const 
ScRange& rRange, ScDra
 
         SC_MOD()->SetDragObject( pTransferObj.get(), nullptr );      // for 
internal D&D
 
-        rtl::Reference<TransferDataContainer> xHelper(pTransferObj.get());
+        rtl::Reference<TransferDataContainer> xHelper(pTransferObj);
         rTreeView.enable_drag_source(xHelper, DND_ACTION_COPY | 
DND_ACTION_LINK);
 
         bDisallow = false;
@@ -1369,7 +1369,7 @@ IMPL_LINK(ScContentTree, DragBeginHdl, bool&, 
rUnsetDragIcon, bool)
             if (!aLinkURL.isEmpty())
                 m_xTransferObj->SetLinkURL(aLinkURL, aLinkText);
 
-            rtl::Reference<TransferDataContainer> 
xHelper(m_xTransferObj.get());
+            rtl::Reference<TransferDataContainer> xHelper(m_xTransferObj);
             m_xTreeView->enable_drag_source(xHelper, DND_ACTION_COPY | 
DND_ACTION_LINK);
 
             bDisallow = false;
diff --git a/sc/source/ui/unoobj/PivotTableDataProvider.cxx 
b/sc/source/ui/unoobj/PivotTableDataProvider.cxx
index 1e244f07c37a..03e53c640718 100644
--- a/sc/source/ui/unoobj/PivotTableDataProvider.cxx
+++ b/sc/source/ui/unoobj/PivotTableDataProvider.cxx
@@ -256,7 +256,7 @@ PivotTableDataProvider::createCategoriesDataSource(bool 
bOrientationIsColumn)
         rtl::Reference<PivotTableDataSequence> pSequence(new 
PivotTableDataSequence(m_pDocument,
                                                    
lcl_identifierForCategories(), rCategories));
         pSequence->setRole("categories");
-        
xResult->setValues(uno::Reference<chart2::data::XDataSequence>(pSequence.get()));
+        
xResult->setValues(uno::Reference<chart2::data::XDataSequence>(pSequence));
 
         aLabeledSequences.push_back(xResult);
     }
@@ -586,7 +586,7 @@ PivotTableDataProvider::assignValuesToDataSequence(size_t 
nIndex)
     std::vector<ValueAndFormat> const & rRowOfData = m_aDataRowVector[nIndex];
     rtl::Reference<PivotTableDataSequence> pSequence(new 
PivotTableDataSequence(m_pDocument, sDataID, rRowOfData));
     pSequence->setRole("values-y");
-    xDataSequence.set(pSequence.get());
+    xDataSequence = pSequence;
     return xDataSequence;
 }
 
@@ -625,7 +625,7 @@ PivotTableDataProvider::assignLabelsToDataSequence(size_t 
nIndex)
     rtl::Reference<PivotTableDataSequence> pSequence(new 
PivotTableDataSequence(m_pDocument,
                                                sLabelID, aLabelVector));
     pSequence->setRole("values-y");
-    xDataSequence.set(pSequence.get());
+    xDataSequence = pSequence;
     return xDataSequence;
 }
 
@@ -642,7 +642,7 @@ css::uno::Reference<css::chart2::data::XDataSequence>
     rtl::Reference<PivotTableDataSequence> pSequence(new 
PivotTableDataSequence(m_pDocument,
                                                lcl_identifierForCategories(), 
rCategories));
     pSequence->setRole("categories");
-    
xDataSequence.set(uno::Reference<chart2::data::XDataSequence>(pSequence.get()));
+    xDataSequence = pSequence;
 
     return xDataSequence;
 }
diff --git a/sc/source/ui/unoobj/PivotTableDataSequence.cxx 
b/sc/source/ui/unoobj/PivotTableDataSequence.cxx
index 1ac8d9339a47..565a67cb2d3c 100644
--- a/sc/source/ui/unoobj/PivotTableDataSequence.cxx
+++ b/sc/source/ui/unoobj/PivotTableDataSequence.cxx
@@ -168,9 +168,7 @@ uno::Reference<util::XCloneable> SAL_CALL 
PivotTableDataSequence::createClone()
     rtl::Reference<PivotTableDataSequence> pClone(new 
PivotTableDataSequence(m_pDocument, m_aID, m_aData));
     pClone->setRole(m_aRole);
 
-    uno::Reference<util::XCloneable> xClone(pClone.get());
-
-    return xClone;
+    return pClone;
 }
 
 // XModifyBroadcaster ========================================================
diff --git a/sc/source/ui/unoobj/TablePivotCharts.cxx 
b/sc/source/ui/unoobj/TablePivotCharts.cxx
index 78d1918b3aba..291084b99500 100644
--- a/sc/source/ui/unoobj/TablePivotCharts.cxx
+++ b/sc/source/ui/unoobj/TablePivotCharts.cxx
@@ -128,7 +128,7 @@ void SAL_CALL TablePivotCharts::addNewByName(OUString const 
& rName,
     rtl::Reference<sc::PivotTableDataProvider> pPivotTableDataProvider(new 
sc::PivotTableDataProvider(rDoc));
     pPivotTableDataProvider->setPivotTableName(rDataPilotName);
 
-    uno::Reference<chart2::data::XDataProvider> 
xDataProvider(pPivotTableDataProvider.get());
+    uno::Reference<chart2::data::XDataProvider> 
xDataProvider(pPivotTableDataProvider);
 
     uno::Reference<chart2::data::XDataReceiver> xReceiver;
 
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index e9eba14c9061..94b3dea9b100 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -5524,7 +5524,7 @@ uno::Reference<sheet::XSheetFilterDescriptor> SAL_CALL 
ScCellRangeObj::createFil
     }
 
     pNew->SetParam( aParam );
-    return pNew.get();
+    return pNew;
 }
 
 // XSubTotalSource
diff --git a/sc/source/ui/unoobj/chart2uno.cxx 
b/sc/source/ui/unoobj/chart2uno.cxx
index 7f1bf63bd548..0f385b6729b4 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -3159,9 +3159,7 @@ uno::Reference< util::XCloneable > SAL_CALL 
ScChart2DataSequence::createClone()
 
     rtl::Reference<ScChart2DataSequence> p(new 
ScChart2DataSequence(m_pDocument, std::move(aTokensNew), 
m_bIncludeHiddenCells));
     p->CopyData(*this);
-    uno::Reference< util::XCloneable > xClone(p.get());
-
-    return xClone;
+    return p;
 }
 
 // XModifyBroadcaster ========================================================
diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx
index 1bd893adf668..17168e04461a 100644
--- a/sc/source/ui/unoobj/textuno.cxx
+++ b/sc/source/ui/unoobj/textuno.cxx
@@ -558,7 +558,7 @@ ScCellTextCursor::~ScCellTextCursor() throw()
 
 uno::Reference<text::XText> SAL_CALL ScCellTextCursor::getText()
 {
-    return mxTextObj.get();
+    return mxTextObj;
 }
 
 uno::Reference<text::XTextRange> SAL_CALL ScCellTextCursor::getStart()
@@ -611,7 +611,7 @@ ScHeaderFooterTextCursor::~ScHeaderFooterTextCursor() 
throw() {};
 uno::Reference<text::XText> SAL_CALL ScHeaderFooterTextCursor::getText()
 {
     SolarMutexGuard aGuard;
-    return rTextObj.get();
+    return rTextObj;
 }
 
 uno::Reference<text::XTextRange> SAL_CALL ScHeaderFooterTextCursor::getStart()
diff --git a/sc/source/ui/unoobj/warnpassword.cxx 
b/sc/source/ui/unoobj/warnpassword.cxx
index 4346d8b86fde..b8ccbffa2e9c 100644
--- a/sc/source/ui/unoobj/warnpassword.cxx
+++ b/sc/source/ui/unoobj/warnpassword.cxx
@@ -49,7 +49,7 @@ bool ScWarnPassword::WarningOnPassword( SfxMedium& rMedium )
                         aException,
                         ContinuationFlags::Approve | 
ContinuationFlags::Disapprove );
 
-        xHandler->handle( xRequest.get() );
+        xHandler->handle( xRequest );
 
         const ContinuationFlags nResp = xRequest->getResponse();
 
diff --git a/sc/source/ui/vba/vbahyperlinks.cxx 
b/sc/source/ui/vba/vbahyperlinks.cxx
index a1d7307f1a1d..b7d2f9da1e94 100644
--- a/sc/source/ui/vba/vbahyperlinks.cxx
+++ b/sc/source/ui/vba/vbahyperlinks.cxx
@@ -196,7 +196,7 @@ ScVbaHlinkContainerMember::~ScVbaHlinkContainerMember()
 ScVbaHyperlinks::ScVbaHyperlinks( const uno::Reference< XHelperInterface >& 
rxParent,
         const uno::Reference< uno::XComponentContext >& rxContext ) :
     detail::ScVbaHlinkContainerMember( new detail::ScVbaHlinkContainer ),
-    ScVbaHyperlinks_BASE( rxParent, rxContext, uno::Reference< 
container::XIndexAccess >( mxContainer.get() ) )
+    ScVbaHyperlinks_BASE( rxParent, rxContext, uno::Reference< 
container::XIndexAccess >( mxContainer ) )
 {
 }
 
@@ -204,7 +204,7 @@ ScVbaHyperlinks::ScVbaHyperlinks( const uno::Reference< 
XHelperInterface >& rxPa
         const uno::Reference< uno::XComponentContext >& rxContext,
         const ScVbaHyperlinksRef& rxSheetHlinks, const ScRangeList& rScRanges 
) :
     detail::ScVbaHlinkContainerMember( new detail::ScVbaHlinkContainer( 
rxSheetHlinks->mxContainer, rScRanges ) ),
-    ScVbaHyperlinks_BASE( rxParent, rxContext, uno::Reference< 
container::XIndexAccess >( mxContainer.get() ) ),
+    ScVbaHyperlinks_BASE( rxParent, rxContext, uno::Reference< 
container::XIndexAccess >( mxContainer ) ),
     mxSheetHlinks( rxSheetHlinks )
 {
 }
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index e78088facd52..10cbc01b9a11 100644
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -4757,7 +4757,7 @@ ScVbaRange::Hyperlinks( const uno::Any& aIndex )
     ScVbaHyperlinksRef xHlinks( new ScVbaHyperlinks( getParent(), mxContext, 
xScSheetHlinks, getScRangeList() ) );
     if( aIndex.hasValue() )
         return xHlinks->Item( aIndex, uno::Any() );
-    return uno::Any( uno::Reference< excel::XHyperlinks >( xHlinks.get() ) );
+    return uno::Any( uno::Reference< excel::XHyperlinks >( xHlinks ) );
 }
 
 css::uno::Reference< excel::XValidation > SAL_CALL
diff --git a/sc/source/ui/vba/vbasheetobjects.cxx 
b/sc/source/ui/vba/vbasheetobjects.cxx
index e0082be6b5a6..a325343437a6 100644
--- a/sc/source/ui/vba/vbasheetobjects.cxx
+++ b/sc/source/ui/vba/vbasheetobjects.cxx
@@ -283,7 +283,7 @@ private:
 }
 
 ScVbaObjectEnumeration::ScVbaObjectEnumeration( const ScVbaObjectContainerRef& 
rxContainer ) :
-    SimpleEnumerationBase( rxContainer.get() ),
+    SimpleEnumerationBase( rxContainer ),
     mxContainer( rxContainer )
 {
 }
@@ -294,7 +294,7 @@ uno::Any ScVbaObjectEnumeration::createCollectionObject( 
const uno::Any& rSource
 }
 
 ScVbaSheetObjectsBase::ScVbaSheetObjectsBase( const ScVbaObjectContainerRef& 
rxContainer ) :
-    ScVbaSheetObjects_BASE( rxContainer->getParent(), 
rxContainer->getContext(), rxContainer.get() ),
+    ScVbaSheetObjects_BASE( rxContainer->getParent(), 
rxContainer->getContext(), rxContainer ),
     mxContainer( rxContainer )
 {
     mxContainer->collectShapes();
@@ -362,7 +362,7 @@ uno::Any SAL_CALL ScVbaGraphicObjectsBase::Add( const 
uno::Any& rLeft, const uno
     // create and return the VBA object
     ::rtl::Reference< ScVbaSheetObjectBase > xVbaObject = 
mxContainer->createVbaObject( xShape );
     xVbaObject->setDefaultProperties( nIndex );
-    return uno::Any( uno::Reference< excel::XSheetObject >( xVbaObject.get() ) 
);
+    return uno::Any( uno::Reference< excel::XSheetObject >( xVbaObject ) );
 }
 
 // Drawing controls
diff --git a/sc/source/ui/vba/vbaworksheet.cxx 
b/sc/source/ui/vba/vbaworksheet.cxx
index ff626f86d591..6aea747b665a 100644
--- a/sc/source/ui/vba/vbaworksheet.cxx
+++ b/sc/source/ui/vba/vbaworksheet.cxx
@@ -801,7 +801,7 @@ ScVbaWorksheet::getButtons( const uno::Any &rIndex, bool 
bOptionButtons )
         rxButtons->collectShapes();
     if( rIndex.hasValue() )
         return rxButtons->Item( rIndex, uno::Any() );
-    return uno::Any( uno::Reference< XCollection >( rxButtons.get() ) );
+    return uno::Any( uno::Reference< XCollection >( rxButtons ) );
 }
 
 uno::Any SAL_CALL
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to