diff options
Diffstat (limited to 'sc/source/ui')
-rw-r--r-- | sc/source/ui/Accessibility/AccessibleDocument.cxx | 21 | ||||
-rw-r--r-- | sc/source/ui/dataprovider/dataprovider.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh8.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/drawfunc/fuins2.cxx | 10 | ||||
-rw-r--r-- | sc/source/ui/unoobj/TablePivotCharts.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/unoobj/chartuno.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/unoobj/docuno.cxx | 36 | ||||
-rw-r--r-- | sc/source/ui/unoobj/fielduno.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/unoobj/textuno.cxx | 9 | ||||
-rw-r--r-- | sc/source/ui/vba/vbaapplication.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/vba/vbarange.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/vba/vbaworkbook.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/vba/vbaworksheet.cxx | 9 | ||||
-rw-r--r-- | sc/source/ui/view/drawvie4.cxx | 8 |
14 files changed, 51 insertions, 75 deletions
diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx index 856ef70b88c4..e947b655a9cb 100644 --- a/sc/source/ui/Accessibility/AccessibleDocument.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx @@ -615,11 +615,10 @@ bool ScChildrenShapes::IsSelected(sal_Int32 nIndex, uno::Reference< drawing::XShape > xReturnShape; bool bDebugResult(false); uno::Reference<drawing::XShapes> xShapes(mpViewShell->getSelectedXShapes()); - uno::Reference<container::XIndexAccess> xIndexAccess(xShapes, uno::UNO_QUERY); - if (xIndexAccess.is()) + if (xShapes.is()) { - sal_Int32 nCount(xIndexAccess->getCount()); + sal_Int32 nCount(xShapes->getCount()); if (nCount) { uno::Reference< drawing::XShape > xShape; @@ -627,7 +626,7 @@ bool ScChildrenShapes::IsSelected(sal_Int32 nIndex, sal_Int32 i(0); while (!bDebugResult && (i < nCount)) { - xIndexAccess->getByIndex(i) >>= xShape; + xShapes->getByIndex(i) >>= xShape; if (xShape.is() && (xIndexShape.get() == xShape.get())) { bDebugResult = true; @@ -763,14 +762,13 @@ void ScChildrenShapes::SelectAll() void ScChildrenShapes::FillShapes(std::vector < uno::Reference < drawing::XShape > >& rShapes) const { uno::Reference<drawing::XShapes> xShapes(mpViewShell->getSelectedXShapes()); - uno::Reference<container::XIndexAccess> xIndexAccess(xShapes, uno::UNO_QUERY); - if (xIndexAccess.is()) + if (xShapes.is()) { - sal_uInt32 nCount(xIndexAccess->getCount()); + sal_uInt32 nCount(xShapes->getCount()); for (sal_uInt32 i = 0; i < nCount; ++i) { uno::Reference<drawing::XShape> xShape; - xIndexAccess->getByIndex(i) >>= xShape; + xShapes->getByIndex(i) >>= xShape; if (xShape.is()) rShapes.push_back(xShape); } @@ -905,14 +903,13 @@ bool ScChildrenShapes::FindSelectedShapesChanges(const uno::Reference<drawing::X { bool bResult(false); SortedShapes aShapesList; - uno::Reference<container::XIndexAccess> xIndexAcc(xShapes, uno::UNO_QUERY); - if (xIndexAcc.is()) + if (xShapes.is()) { - mnShapesSelected = xIndexAcc->getCount(); + mnShapesSelected = xShapes->getCount(); for (sal_uInt32 i = 0; i < mnShapesSelected; ++i) { uno::Reference< drawing::XShape > xShape; - xIndexAcc->getByIndex(i) >>= xShape; + xShapes->getByIndex(i) >>= xShape; if (xShape.is()) { ScAccessibleShapeData* pShapeData = new ScAccessibleShapeData(); diff --git a/sc/source/ui/dataprovider/dataprovider.cxx b/sc/source/ui/dataprovider/dataprovider.cxx index f87e006618ec..24e6a07b62d8 100644 --- a/sc/source/ui/dataprovider/dataprovider.cxx +++ b/sc/source/ui/dataprovider/dataprovider.cxx @@ -32,7 +32,7 @@ std::unique_ptr<SvStream> DataProvider::FetchStreamFromURL(const OUString& rURL, { try { - uno::Reference< ucb::XSimpleFileAccess3 > xFileAccess( ucb::SimpleFileAccess::create( comphelper::getProcessComponentContext() ), uno::UNO_QUERY ); + uno::Reference< ucb::XSimpleFileAccess3 > xFileAccess = ucb::SimpleFileAccess::create( comphelper::getProcessComponentContext() ); uno::Reference< io::XInputStream > xStream = xFileAccess->openFileRead( rURL ); diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx index 8705b5bc8c3b..33390347f944 100644 --- a/sc/source/ui/docshell/docsh8.cxx +++ b/sc/source/ui/docshell/docsh8.cxx @@ -789,8 +789,7 @@ ErrCode ScDocShell::DBaseExport( const OUString& rFullFileName, rtl_TextEncoding ::utl::DisposableComponent aConnectionHelper(xConnection); // get dBase driver - uno::Reference< sdbc::XDriverAccess> xAccess(xDrvMan,uno::UNO_QUERY); - uno::Reference< sdbcx::XDataDefinitionSupplier > xDDSup( xAccess->getDriverByURL( xConnection->getMetaData()->getURL() ), uno::UNO_QUERY ); + uno::Reference< sdbcx::XDataDefinitionSupplier > xDDSup( xDrvMan->getDriverByURL( xConnection->getMetaData()->getURL() ), uno::UNO_QUERY ); if ( !xDDSup.is() ) return SCERR_EXPORT_CONNECT; diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx index 21a541285cc1..9123a8ecfc6b 100644 --- a/sc/source/ui/drawfunc/fuins2.cxx +++ b/sc/source/ui/drawfunc/fuins2.cxx @@ -117,9 +117,8 @@ void lcl_ChartInit(const uno::Reference <embed::XEmbeddedObject>& xObj, ScViewDa // connect to Calc data (if no range string, leave chart alone, with its own data) uno::Reference< css::chart2::data::XDataReceiver > xReceiver; - uno::Reference< embed::XComponentSupplier > xCompSupp( xObj, uno::UNO_QUERY ); - if( xCompSupp.is()) - xReceiver.set( xCompSupp->getComponent(), uno::UNO_QUERY ); + if( xObj.is()) + xReceiver.set( xObj->getComponent(), uno::UNO_QUERY ); OSL_ASSERT( xReceiver.is()); if( xReceiver.is() ) { @@ -478,9 +477,8 @@ FuInsertChart::FuInsertChart(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawV rViewShell.GetObjectShell()->GetEmbeddedObjectContainer().CreateEmbeddedObject( SvGlobalName( SO3_SCH_CLASSID_60 ).GetByteSequence(), aName ); uno::Reference< css::chart2::data::XDataReceiver > xReceiver; - uno::Reference< embed::XComponentSupplier > xCompSupp( xObj, uno::UNO_QUERY ); - if( xCompSupp.is()) - xReceiver.set( xCompSupp->getComponent(), uno::UNO_QUERY ); + if( xObj.is()) + xReceiver.set( xObj->getComponent(), uno::UNO_QUERY ); uno::Reference<chart2::XChartDocument> xChartDoc(xReceiver, uno::UNO_QUERY); if (xChartDoc.is()) diff --git a/sc/source/ui/unoobj/TablePivotCharts.cxx b/sc/source/ui/unoobj/TablePivotCharts.cxx index e5e8a88f03fa..a15250afdb62 100644 --- a/sc/source/ui/unoobj/TablePivotCharts.cxx +++ b/sc/source/ui/unoobj/TablePivotCharts.cxx @@ -130,10 +130,9 @@ void SAL_CALL TablePivotCharts::addNewByName(OUString const & rName, uno::Reference<chart2::data::XDataProvider> xDataProvider(pPivotTableDataProvider.release()); uno::Reference<chart2::data::XDataReceiver> xReceiver; - uno::Reference<embed::XComponentSupplier> xCompSupp(xObject, uno::UNO_QUERY); - if (xCompSupp.is()) - xReceiver.set(xCompSupp->getComponent(), uno::UNO_QUERY); + if (xObject.is()) + xReceiver.set(xObject->getComponent(), uno::UNO_QUERY); if (xReceiver.is()) { diff --git a/sc/source/ui/unoobj/chartuno.cxx b/sc/source/ui/unoobj/chartuno.cxx index b7464631cee5..405cc31ec55c 100644 --- a/sc/source/ui/unoobj/chartuno.cxx +++ b/sc/source/ui/unoobj/chartuno.cxx @@ -207,9 +207,8 @@ void SAL_CALL ScChartsObj::addNewByName( const OUString& rName, ScChart2DataProvider( &rDoc ); // Chart -> DataReceiver uno::Reference< chart2::data::XDataReceiver > xReceiver; - uno::Reference< embed::XComponentSupplier > xCompSupp( xObj, uno::UNO_QUERY ); - if( xCompSupp.is()) - xReceiver.set( xCompSupp->getComponent(), uno::UNO_QUERY ); + if( xObj.is()) + xReceiver.set( xObj->getComponent(), uno::UNO_QUERY ); if( xReceiver.is()) { OUString sRangeStr; diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 953c977454da..700a099fd4fb 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -1506,30 +1506,26 @@ bool ScModelObj::FillRenderMarkData( const uno::Any& aSelection, else if( xShapes.is() ) { //print a selected ole object - uno::Reference< container::XIndexAccess > xIndexAccess( xShapes, uno::UNO_QUERY ); - if( xIndexAccess.is() ) + // multi selection isn't supported yet + uno::Reference< drawing::XShape > xShape( xShapes->getByIndex(0), uno::UNO_QUERY ); + SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>( xShape ); + if( pShape ) { - // multi selection isn't supported yet - uno::Reference< drawing::XShape > xShape( xIndexAccess->getByIndex(0), uno::UNO_QUERY ); - SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>( xShape ); - if( pShape ) + SdrObject *pSdrObj = pShape->GetSdrObject(); + if( pDocShell ) { - SdrObject *pSdrObj = pShape->GetSdrObject(); - if( pDocShell ) + ScDocument& rDoc = pDocShell->GetDocument(); + if( pSdrObj ) { - ScDocument& rDoc = pDocShell->GetDocument(); - if( pSdrObj ) + tools::Rectangle aObjRect = pSdrObj->GetCurrentBoundRect(); + SCTAB nCurrentTab = ScDocShell::GetCurTab(); + ScRange aRange = rDoc.GetRange( nCurrentTab, aObjRect ); + rMark.SetMarkArea( aRange ); + + if( rMark.IsMarked() && !rMark.IsMultiMarked() ) { - tools::Rectangle aObjRect = pSdrObj->GetCurrentBoundRect(); - SCTAB nCurrentTab = ScDocShell::GetCurTab(); - ScRange aRange = rDoc.GetRange( nCurrentTab, aObjRect ); - rMark.SetMarkArea( aRange ); - - if( rMark.IsMarked() && !rMark.IsMultiMarked() ) - { - rStatus.SetMode( SC_PRINTSEL_RANGE_EXCLUSIVELY_OLE_AND_DRAW_OBJECTS ); - bDone = true; - } + rStatus.SetMode( SC_PRINTSEL_RANGE_EXCLUSIVELY_OLE_AND_DRAW_OBJECTS ); + bDone = true; } } } diff --git a/sc/source/ui/unoobj/fielduno.cxx b/sc/source/ui/unoobj/fielduno.cxx index c3b49d99c734..8ee9d4374ee0 100644 --- a/sc/source/ui/unoobj/fielduno.cxx +++ b/sc/source/ui/unoobj/fielduno.cxx @@ -473,8 +473,7 @@ uno::Reference<text::XTextField> ScHeaderFieldsObj::GetObjectByIndex_Impl(sal_In break; } - uno::Reference<text::XTextRange> xTemp(xText, uno::UNO_QUERY); - xTextRange = xTemp; + xTextRange = xText; sal_Int32 nPar = aTempEngine.GetFieldPar(); sal_Int32 nPos = aTempEngine.GetFieldPos(); diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx index a294d8edade7..3ef1645d2542 100644 --- a/sc/source/ui/unoobj/textuno.cxx +++ b/sc/source/ui/unoobj/textuno.cxx @@ -424,16 +424,13 @@ void SAL_CALL ScHeaderFooterTextObj::insertTextContent( switch ( aTextData.GetPart() ) { case ScHeaderFooterPart::LEFT: - xTextRange = uno::Reference<text::XTextRange>( - aTextData.GetContentObj()->getLeftText(), uno::UNO_QUERY); + xTextRange = aTextData.GetContentObj()->getLeftText(); break; case ScHeaderFooterPart::CENTER: - xTextRange = uno::Reference<text::XTextRange>( - aTextData.GetContentObj()->getCenterText(), uno::UNO_QUERY); + xTextRange = aTextData.GetContentObj()->getCenterText(); break; case ScHeaderFooterPart::RIGHT: - xTextRange = uno::Reference<text::XTextRange>( - aTextData.GetContentObj()->getRightText(), uno::UNO_QUERY); + xTextRange = aTextData.GetContentObj()->getRightText(); break; } diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx index ba821eb5d131..c7a46c3c74c2 100644 --- a/sc/source/ui/vba/vbaapplication.cxx +++ b/sc/source/ui/vba/vbaapplication.cxx @@ -568,11 +568,11 @@ uno::Reference< excel::XWorksheet > SAL_CALL ScVbaApplication::getActiveSheet() { uno::Reference< excel::XWorksheet > result; - uno::Reference< excel::XWorkbook > xWorkbook( getActiveWorkbook(), uno::UNO_QUERY ); + uno::Reference< excel::XWorkbook > xWorkbook = getActiveWorkbook(); if ( xWorkbook.is() ) { - uno::Reference< excel::XWorksheet > xWorksheet( - xWorkbook->getActiveSheet(), uno::UNO_QUERY ); + uno::Reference< excel::XWorksheet > xWorksheet = + xWorkbook->getActiveSheet(); if ( xWorksheet.is() ) { result = xWorksheet; @@ -1376,7 +1376,7 @@ ScVbaApplication::MenuBars( const uno::Any& aIndex ) uno::Any SAL_CALL ScVbaApplication::Rows( const uno::Any& aIndex ) { - uno::Reference< excel::XWorksheet > xWorksheet( getActiveSheet(), uno::UNO_QUERY ); + uno::Reference< excel::XWorksheet > xWorksheet = getActiveSheet(); if ( xWorksheet.is() ) return uno::Any( xWorksheet->Rows( aIndex ) ); return uno::Any(); diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index 1836cbdd5088..a97729b16d12 100644 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -3094,9 +3094,8 @@ ScVbaRange::Replace( const OUString& What, const OUString& Replacement, const un // ignore MatchByte for the moment, it's not supported in // OOo.org afaik - uno::Reference< util::XSearchDescriptor > xSearch( xDescriptor, uno::UNO_QUERY ); - uno::Reference< container::XIndexAccess > xIndexAccess = xReplace->findAll( xSearch ); - xReplace->replaceAll( xSearch ); + uno::Reference< container::XIndexAccess > xIndexAccess = xReplace->findAll( xDescriptor ); + xReplace->replaceAll( xDescriptor ); if ( xIndexAccess.is() && xIndexAccess->getCount() > 0 ) { for ( sal_Int32 i = 0; i < xIndexAccess->getCount(); ++i ) diff --git a/sc/source/ui/vba/vbaworkbook.cxx b/sc/source/ui/vba/vbaworkbook.cxx index 8f33e00c4c37..b6e45af532f5 100644 --- a/sc/source/ui/vba/vbaworkbook.cxx +++ b/sc/source/ui/vba/vbaworkbook.cxx @@ -200,7 +200,7 @@ ScVbaWorkbook::init() { if ( !ColorData.hasElements() ) ResetColors(); - uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_QUERY ); + uno::Reference< frame::XModel > xModel = getModel(); if ( xModel.is() ) excel::getDocShell( xModel )->RegisterAutomationWorkbookObject( this ); } diff --git a/sc/source/ui/vba/vbaworksheet.cxx b/sc/source/ui/vba/vbaworksheet.cxx index 83cddb7c6246..81ed54728e60 100644 --- a/sc/source/ui/vba/vbaworksheet.cxx +++ b/sc/source/ui/vba/vbaworksheet.cxx @@ -203,8 +203,7 @@ ScVbaWorksheet::createSheetCopyInNewDoc(const OUString& aCurrSheetName) { uno::Reference< sheet::XSheetCellCursor > xSheetCellCursor = getSheet()->createCursor( ); uno::Reference<sheet::XUsedAreaCursor> xUsedCursor(xSheetCellCursor,uno::UNO_QUERY_THROW); - uno::Reference< table::XCellRange > xRange1( xSheetCellCursor, uno::UNO_QUERY); - uno::Reference<excel::XRange> xRange = new ScVbaRange( this, mxContext, xRange1); + uno::Reference<excel::XRange> xRange = new ScVbaRange( this, mxContext, xSheetCellCursor); if (xRange.is()) xRange->Select(); excel::implnCopy(mxModel); @@ -431,8 +430,7 @@ ScVbaWorksheet::getUsedRange() uno::Reference<sheet::XUsedAreaCursor> xUsedCursor(xSheetCellCursor,uno::UNO_QUERY_THROW); xUsedCursor->gotoStartOfUsedArea( false ); xUsedCursor->gotoEndOfUsedArea( true ); - uno::Reference< table::XCellRange > xRange( xSheetCellCursor, uno::UNO_QUERY); - return new ScVbaRange(this, mxContext, xRange); + return new ScVbaRange(this, mxContext, xSheetCellCursor); } uno::Reference< excel::XOutline > @@ -541,9 +539,8 @@ ScVbaWorksheet::Move( const uno::Any& Before, const uno::Any& After ) { uno::Reference< sheet::XSheetCellCursor > xSheetCellCursor = getSheet()->createCursor( ); uno::Reference<sheet::XUsedAreaCursor> xUsedCursor(xSheetCellCursor,uno::UNO_QUERY_THROW); - uno::Reference< table::XCellRange > xRange1( xSheetCellCursor, uno::UNO_QUERY); // #FIXME needs worksheet as parent - uno::Reference<excel::XRange> xRange = new ScVbaRange( this, mxContext, xRange1); + uno::Reference<excel::XRange> xRange = new ScVbaRange( this, mxContext, xSheetCellCursor); if (xRange.is()) xRange->Select(); excel::implnCopy(mxModel); diff --git a/sc/source/ui/view/drawvie4.cxx b/sc/source/ui/view/drawvie4.cxx index a516f71bc64e..3a9755e528fb 100644 --- a/sc/source/ui/view/drawvie4.cxx +++ b/sc/source/ui/view/drawvie4.cxx @@ -180,11 +180,7 @@ void getRangeFromOle2Object(const SdrOle2Obj& rObj, std::vector<OUString>& rRang if (!xObj.is()) return; - uno::Reference<embed::XComponentSupplier> xCompSupp(xObj, uno::UNO_QUERY); - if (!xCompSupp.is()) - return; - - uno::Reference<chart2::XChartDocument> xChartDoc(xCompSupp->getComponent(), uno::UNO_QUERY); + uno::Reference<chart2::XChartDocument> xChartDoc(xObj->getComponent(), uno::UNO_QUERY); if (!xChartDoc.is()) return; @@ -457,7 +453,7 @@ void ScDrawView::SetMarkedOriginalSize() if (nIdent == OBJ_OLE2) { // TODO/LEAN: working with visual area can switch object to running state - uno::Reference < embed::XEmbeddedObject > xObj( static_cast<SdrOle2Obj*>(pObj)->GetObjRef(), uno::UNO_QUERY ); + uno::Reference < embed::XEmbeddedObject > xObj = static_cast<SdrOle2Obj*>(pObj)->GetObjRef(); if ( xObj.is() ) // NULL for an invalid object that couldn't be loaded { sal_Int64 nAspect = static_cast<SdrOle2Obj*>(pObj)->GetAspect(); |