From a361231b1363d072d737e9b1d411b71aa9550d84 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 10 May 2019 10:13:12 +0200 Subject: fix wrong SET/QUERY flags passed to uno::Reference By creating deleted methods for the wrong calls. Avoids the compiler needing to construct a temporary Change-Id: I3b8c648d6bb22d22827bf74f21ea5a2a17fc0f6a Reviewed-on: https://gerrit.libreoffice.org/72103 Tested-by: Jenkins Reviewed-by: Noel Grandin --- svx/source/form/fmshimp.cxx | 2 +- svx/source/form/fmvwimp.cxx | 4 ++-- svx/source/form/formcontroller.cxx | 2 +- svx/source/table/cellcursor.cxx | 4 ++-- svx/source/table/svdotable.cxx | 6 +++--- svx/source/table/tablecontroller.cxx | 2 +- svx/source/table/tablelayouter.cxx | 6 +++--- svx/source/table/tablertfimporter.cxx | 4 ++-- svx/source/tbxctrls/tbcontrl.cxx | 2 +- svx/source/tbxctrls/tbunosearchcontrollers.cxx | 4 ++-- svx/source/unogallery/unogaltheme.cxx | 2 +- svx/source/xml/xmlxtimp.cxx | 4 ++-- 12 files changed, 21 insertions(+), 21 deletions(-) (limited to 'svx') diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index 2c64c1442e57..3fa7d45a4338 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -2860,7 +2860,7 @@ Reference< XControl> FmXFormShell::impl_getControl_Lock(const ReferenceGetFormView() : nullptr; ENSURE_OR_THROW( pSdrView, "no current view" ); - xControl.set( i_rKnownFormObj.GetUnoControl( *pSdrView, *pContainerWindow ), UNO_QUERY_THROW ); + xControl.set( i_rKnownFormObj.GetUnoControl( *pSdrView, *pContainerWindow ), UNO_SET_THROW ); } } catch( const Exception& ) diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx index 99ae528c5282..0de437d335b8 100644 --- a/svx/source/form/fmvwimp.cxx +++ b/svx/source/form/fmvwimp.cxx @@ -197,7 +197,7 @@ void FormViewPageWindowAdapter::dispose() { try { - Reference< XFormController > xController( *i, UNO_QUERY_THROW ); + Reference< XFormController > xController( *i, UNO_SET_THROW ); // detaching the events Reference< XChild > xControllerModel( xController->getModel(), UNO_QUERY ); @@ -868,7 +868,7 @@ namespace continue; Reference< XChild > xModel( pFormObject->GetUnoControlModel(), UNO_QUERY_THROW ); - Reference< XInterface > xModelParent( xModel->getParent(), UNO_QUERY_THROW ); + Reference< XInterface > xModelParent( xModel->getParent(), UNO_SET_THROW ); if ( xNormalizedForm.get() != xModelParent.get() ) continue; diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx index d94ab3f765f1..db5fc8ca8b14 100644 --- a/svx/source/form/formcontroller.cxx +++ b/svx/source/form/formcontroller.cxx @@ -3498,7 +3498,7 @@ vcl::Window* FormController::getDialogParentWindow() try { Reference< XControl > xContainerControl( getContainer(), UNO_QUERY_THROW ); - Reference< XWindowPeer > xContainerPeer( xContainerControl->getPeer(), UNO_QUERY_THROW ); + Reference< XWindowPeer > xContainerPeer( xContainerControl->getPeer(), UNO_SET_THROW ); pParentWindow = VCLUnoHelper::GetWindow( xContainerPeer ).get(); } catch( const Exception& ) diff --git a/svx/source/table/cellcursor.cxx b/svx/source/table/cellcursor.cxx index bbf8f8810a70..bd77a885957c 100644 --- a/svx/source/table/cellcursor.cxx +++ b/svx/source/table/cellcursor.cxx @@ -284,7 +284,7 @@ void CellCursor::split_column( sal_Int32 nCol, sal_Int32 nColumns, std::vector< if( nNewCols > 0 ) { const OUString sWidth("Width"); - Reference< XTableColumns > xCols( mxTable->getColumns(), UNO_QUERY_THROW ); + Reference< XTableColumns > xCols( mxTable->getColumns(), UNO_SET_THROW ); Reference< XPropertySet > xRefColumn( xCols->getByIndex( nCol ), UNO_QUERY_THROW ); sal_Int32 nWidth = 0; xRefColumn->getPropertyValue( sWidth ) >>= nWidth; @@ -398,7 +398,7 @@ void CellCursor::split_row( sal_Int32 nRow, sal_Int32 nRows, std::vector< sal_In if( nNewRows > 0 ) { const OUString sHeight("Height"); - Reference< XTableRows > xRows( mxTable->getRows(), UNO_QUERY_THROW ); + Reference< XTableRows > xRows( mxTable->getRows(), UNO_SET_THROW ); Reference< XPropertySet > xRefRow( xRows->getByIndex( nRow ), UNO_QUERY_THROW ); sal_Int32 nHeight = 0; xRefRow->getPropertyValue( sHeight ) >>= nHeight; diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx index 4717e1b796cd..42f97ef7eb4d 100644 --- a/svx/source/table/svdotable.cxx +++ b/svx/source/table/svdotable.cxx @@ -317,7 +317,7 @@ void SdrTableObjImpl::CropTableModelToSelection(const CellPos& rStart, const Cel } // copy row heights - Reference< XTableRows > xNewRows(mxTable->getRows(), UNO_QUERY_THROW ); + Reference< XTableRows > xNewRows(mxTable->getRows(), css::uno::UNO_SET_THROW ); const OUString sHeight( "Height" ); for( sal_Int32 nRow = 0; nRow < nRows; ++nRow ) { @@ -326,7 +326,7 @@ void SdrTableObjImpl::CropTableModelToSelection(const CellPos& rStart, const Cel } // copy column widths - Reference< XTableColumns > xNewColumns( mxTable->getColumns(), UNO_QUERY_THROW ); + Reference< XTableColumns > xNewColumns( mxTable->getColumns(), css::uno::UNO_SET_THROW ); const OUString sWidth( "Width" ); for( sal_Int32 nCol = 0; nCol < nColumns; ++nCol ) { @@ -429,7 +429,7 @@ SdrTableObjImpl& SdrTableObjImpl::operator=( const SdrTableObjImpl& rSource ) // search in traget SdrModel for that TableStyle const OUString sStyleName( Reference< XNamed >( rSource.mxTableStyle, UNO_QUERY_THROW )->getName() ); Reference< XStyleFamiliesSupplier > xSFS(rTargetSdrModel.getUnoModel(), UNO_QUERY_THROW ); - Reference< XNameAccess > xFamilyNameAccess( xSFS->getStyleFamilies(), UNO_QUERY_THROW ); + Reference< XNameAccess > xFamilyNameAccess( xSFS->getStyleFamilies(), css::uno::UNO_SET_THROW ); const OUString sFamilyName( "table" ); Reference< XNameAccess > xTableFamilyAccess( xFamilyNameAccess->getByName( sFamilyName ), UNO_QUERY_THROW ); diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx index 18e87bd48c24..be279e41a8e9 100644 --- a/svx/source/table/tablecontroller.cxx +++ b/svx/source/table/tablecontroller.cxx @@ -1068,7 +1068,7 @@ void SvxTableController::SetTableStyle( const SfxItemSet* pArgs ) if( pArg && mxTable.is() ) try { Reference< XStyleFamiliesSupplier > xSFS( rModel.getUnoModel(), UNO_QUERY_THROW ); - Reference< XNameAccess > xFamilyNameAccess( xSFS->getStyleFamilies(), UNO_QUERY_THROW ); + Reference< XNameAccess > xFamilyNameAccess( xSFS->getStyleFamilies(), UNO_SET_THROW ); const OUString sFamilyName( "table" ); Reference< XNameAccess > xTableFamilyAccess( xFamilyNameAccess->getByName( sFamilyName ), UNO_QUERY_THROW ); diff --git a/svx/source/table/tablelayouter.cxx b/svx/source/table/tablelayouter.cxx index e1a89ddce186..31f11e2e083a 100644 --- a/svx/source/table/tablelayouter.cxx +++ b/svx/source/table/tablelayouter.cxx @@ -561,7 +561,7 @@ void TableLayouter::LayoutTableWidth( tools::Rectangle& rArea, bool bFit ) if( sal::static_int_cast< sal_Int32 >( maColumns.size() ) != nColCount ) maColumns.resize( nColCount ); - Reference< XTableColumns > xCols( mxTable->getColumns(), UNO_QUERY_THROW ); + Reference< XTableColumns > xCols( mxTable->getColumns(), UNO_SET_THROW ); // first calculate current width and initial minimum width per column, // merged cells will be counted later @@ -1090,7 +1090,7 @@ void TableLayouter::DistributeColumns( ::tools::Rectangle& rArea, if( mxTable.is() ) try { const sal_Int32 nColCount = getColumnCount(); - Reference< XTableColumns > xCols( mxTable->getColumns(), UNO_QUERY_THROW ); + Reference< XTableColumns > xCols( mxTable->getColumns(), UNO_SET_THROW ); const Size aSize(0xffffff, 0xffffff); //special case - optimize a single column @@ -1184,7 +1184,7 @@ void TableLayouter::DistributeRows( ::tools::Rectangle& rArea, if( mxTable.is() ) try { const sal_Int32 nRowCount = mxTable->getRowCount(); - Reference< XTableRows > xRows( mxTable->getRows(), UNO_QUERY_THROW ); + Reference< XTableRows > xRows( mxTable->getRows(), UNO_SET_THROW ); sal_Int32 nMinHeight = 0; //special case - minimize a single row diff --git a/svx/source/table/tablertfimporter.cxx b/svx/source/table/tablertfimporter.cxx index 29fe40b58620..43b7f44b2e78 100644 --- a/svx/source/table/tablertfimporter.cxx +++ b/svx/source/table/tablertfimporter.cxx @@ -265,7 +265,7 @@ void SdrTableRTFParser::FillTable() try { sal_Int32 nColCount = mxTable->getColumnCount(); - Reference< XTableColumns > xCols( mxTable->getColumns(), UNO_QUERY_THROW ); + Reference< XTableColumns > xCols( mxTable->getColumns(), UNO_SET_THROW ); sal_Int32 nColMax = maColumnEdges.size(); if( nColCount < nColMax ) { @@ -287,7 +287,7 @@ void SdrTableRTFParser::FillTable() const sal_Int32 nRowCount = mxTable->getRowCount(); if( nRowCount < mnRowCnt ) { - Reference< XTableRows > xRows( mxTable->getRows(), UNO_QUERY_THROW ); + Reference< XTableRows > xRows( mxTable->getRows(), UNO_SET_THROW ); xRows->insertByIndex( nRowCount, mnRowCnt - nRowCount ); } diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 42a82abf4472..eb8faa271962 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -3681,7 +3681,7 @@ void SvxCurrencyToolBoxControl::execute( sal_Int16 nSelectModifier ) try { uno::Reference< util::XNumberFormatsSupplier > xRef( m_xFrame->getController()->getModel(), uno::UNO_QUERY ); - uno::Reference< util::XNumberFormats > rxNumberFormats( xRef->getNumberFormats(), uno::UNO_QUERY_THROW ); + uno::Reference< util::XNumberFormats > rxNumberFormats( xRef->getNumberFormats(), uno::UNO_SET_THROW ); css::lang::Locale aLocale = LanguageTag::convertToLocale( m_eLanguage ); nFormatKey = rxNumberFormats->queryKey( m_aFormatString, aLocale, false ); if ( nFormatKey == NUMBERFORMAT_ENTRY_NOT_FOUND ) diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx index a8457ef07700..0b3b80b5449d 100644 --- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx +++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx @@ -198,8 +198,8 @@ void FindTextFieldControl::SetTextToSelected_Impl() try { - css::uno::Reference xController(m_xFrame->getController(), css::uno::UNO_QUERY_THROW); - css::uno::Reference xModel(xController->getModel(), css::uno::UNO_QUERY_THROW); + css::uno::Reference xController(m_xFrame->getController(), css::uno::UNO_SET_THROW); + css::uno::Reference xModel(xController->getModel(), css::uno::UNO_SET_THROW); css::uno::Reference xIndexAccess(xModel->getCurrentSelection(), css::uno::UNO_QUERY_THROW); if (xIndexAccess->getCount() > 0) { diff --git a/svx/source/unogallery/unogaltheme.cxx b/svx/source/unogallery/unogaltheme.cxx index 7d81cfc3e309..32f111d6a200 100644 --- a/svx/source/unogallery/unogaltheme.cxx +++ b/svx/source/unogallery/unogaltheme.cxx @@ -248,7 +248,7 @@ void SAL_CALL GalleryTheme::update( ) try { uno::Reference< drawing::XDrawPagesSupplier > xDrawPagesSupplier( Drawing, uno::UNO_QUERY_THROW ); - uno::Reference< drawing::XDrawPages > xDrawPages( xDrawPagesSupplier->getDrawPages(), uno::UNO_QUERY_THROW ); + uno::Reference< drawing::XDrawPages > xDrawPages( xDrawPagesSupplier->getDrawPages(), uno::UNO_SET_THROW ); uno::Reference< drawing::XDrawPage > xPage( xDrawPages->getByIndex( 0 ), uno::UNO_QUERY_THROW ); SvxDrawPage* pUnoPage = xPage.is() ? SvxDrawPage::getImplementation( xPage ) : nullptr; SdrModel* pOrigModel = pUnoPage ? &pUnoPage->GetSdrPage()->getSdrModelFromSdrPage() : nullptr; diff --git a/svx/source/xml/xmlxtimp.cxx b/svx/source/xml/xmlxtimp.cxx index 5f2f1dcc4f1a..c9b5ecf6481a 100644 --- a/svx/source/xml/xmlxtimp.cxx +++ b/svx/source/xml/xmlxtimp.cxx @@ -324,7 +324,7 @@ static void openStorageStream( xml::sax::InputSource *pParserInput, rtl::Reference& rxGraphicHelper, const uno::Reference < embed::XStorage >& xStorage ) { - uno::Reference < io::XStream > xIStm( xStorage->openStreamElement( "Content.xml", embed::ElementModes::READ ), uno::UNO_QUERY_THROW ); + uno::Reference < io::XStream > xIStm( xStorage->openStreamElement( "Content.xml", embed::ElementModes::READ ), uno::UNO_SET_THROW ); pParserInput->aInputStream = xIStm->getInputStream(); rxGraphicHelper = SvXMLGraphicHelper::Create( xStorage, SvXMLGraphicHelperMode::Read ); } @@ -356,7 +356,7 @@ bool SvxXMLXTableImport::load( const OUString &rPath, const OUString &rReferer, if( aMedium.IsStorage() ) { - uno::Reference < embed::XStorage > xMediumStorage( aMedium.GetStorage( false ), uno::UNO_QUERY_THROW ); + uno::Reference < embed::XStorage > xMediumStorage( aMedium.GetStorage( false ), uno::UNO_SET_THROW ); openStorageStream( &aParserInput, xGraphicHelper, xMediumStorage ); } else -- cgit