summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-05-02 10:36:43 +0200
committerNoel Grandin <noelgrandin@gmail.com>2013-05-22 10:44:29 +0000
commit6a043e9c0acff20e1618ca8ec15c21d5d0fd0d37 (patch)
tree2746468845d6f1159e3759ee2cf7a620fca15b6e /sfx2
parent697a007c61b9cabceb9767fad87cd5822b300452 (diff)
Use the new type-checking Reference constructor to reduce code noise
Also create a Clang compiler plugin to detect such cases. Change-Id: I61ad1a1d6b1c017eeb51f226d2dde0e9bb7f1752 Reviewed-on: https://gerrit.libreoffice.org/4001 Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/newhelp.cxx12
-rw-r--r--sfx2/source/dialog/taskpane.cxx2
-rw-r--r--sfx2/source/view/frame2.cxx2
-rw-r--r--sfx2/source/view/viewfrm.cxx3
4 files changed, 8 insertions, 11 deletions
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index cf1ba0403df6..def791316986 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -2332,11 +2332,10 @@ IMPL_LINK_NOARG(SfxHelpTextWindow_Impl, SelectHdl)
{
// create descriptor, set string and find all words
Reference < XSearchDescriptor > xSrchDesc = xSearchable->createSearchDescriptor();
- Reference < XPropertySet > xPropSet( xSrchDesc, UNO_QUERY );
- xPropSet->setPropertyValue( "SearchRegularExpression",
+ xSrchDesc->setPropertyValue( "SearchRegularExpression",
makeAny( sal_Bool( sal_True ) ) );
if ( bIsFullWordSearch )
- xPropSet->setPropertyValue( "SearchWords",
+ xSrchDesc->setPropertyValue( "SearchWords",
makeAny( sal_Bool( sal_True ) ) );
String sSearchString = sfx2::PrepareSearchString( aSearchText, GetBreakIterator(), false );
@@ -2394,10 +2393,9 @@ IMPL_LINK( SfxHelpTextWindow_Impl, FindHdl, sfx2::SearchDialog*, pDlg )
{
// create descriptor, set string and find all words
Reference < XSearchDescriptor > xSrchDesc = xSearchable->createSearchDescriptor();
- Reference < XPropertySet > xPropSet( xSrchDesc, UNO_QUERY );
- xPropSet->setPropertyValue( "SearchWords", makeAny( sal_Bool( pDlg->IsOnlyWholeWords() != false ) ) );
- xPropSet->setPropertyValue( "SearchCaseSensitive", makeAny( sal_Bool( pDlg->IsMarchCase() != false ) ) );
- xPropSet->setPropertyValue( "SearchBackwards", makeAny( sal_Bool( pDlg->IsSearchBackwards() != false ) ) );
+ xSrchDesc->setPropertyValue( "SearchWords", makeAny( sal_Bool( pDlg->IsOnlyWholeWords() != false ) ) );
+ xSrchDesc->setPropertyValue( "SearchCaseSensitive", makeAny( sal_Bool( pDlg->IsMarchCase() != false ) ) );
+ xSrchDesc->setPropertyValue( "SearchBackwards", makeAny( sal_Bool( pDlg->IsSearchBackwards() != false ) ) );
xSrchDesc->setSearchString( sSearchText );
Reference< XInterface > xSelection;
Reference< XTextRange > xCursor = getCursor();
diff --git a/sfx2/source/dialog/taskpane.cxx b/sfx2/source/dialog/taskpane.cxx
index c7aa092801e5..894dc547759e 100644
--- a/sfx2/source/dialog/taskpane.cxx
+++ b/sfx2/source/dialog/taskpane.cxx
@@ -274,7 +274,7 @@ namespace sfx2
}
CustomPanelUIElement( const Reference< XUIElement >& i_rUIElement )
- :m_xUIElement( i_rUIElement, UNO_SET_THROW )
+ :m_xUIElement( i_rUIElement )
,m_xToolPanel( i_rUIElement->getRealInterface(), UNO_QUERY_THROW )
,m_xPanelWindow( m_xToolPanel->getWindow(), UNO_SET_THROW )
{
diff --git a/sfx2/source/view/frame2.cxx b/sfx2/source/view/frame2.cxx
index c3a2a50cdd4d..f35000f9cb08 100644
--- a/sfx2/source/view/frame2.cxx
+++ b/sfx2/source/view/frame2.cxx
@@ -250,7 +250,7 @@ SfxFrame* SfxFrame::Create( SfxObjectShell& rDoc, Window& rWindow, sal_uInt16 nV
Reference< awt::XWindow2 > xWin( VCLUnoHelper::GetInterface ( &rWindow ), uno::UNO_QUERY_THROW );
xFrame->initialize( xWin.get() );
- xDesktop->getFrames()->append( Reference<XFrame>(xFrame, uno::UNO_QUERY_THROW) );
+ xDesktop->getFrames()->append( xFrame );
if ( xWin->isActive() )
xFrame->activate();
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index e857318c0e8b..95f35531d6f4 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -1888,8 +1888,7 @@ SfxViewFrame* SfxViewFrame::LoadViewIntoFrame_Impl_NoThrow( const SfxObjectShell
try
{
// if there is a backing component, use it
- Reference< XFramesSupplier > xTaskSupplier( xDesktop , css::uno::UNO_QUERY_THROW );
- ::framework::FrameListAnalyzer aAnalyzer( xTaskSupplier, Reference< XFrame >(), ::framework::FrameListAnalyzer::E_BACKINGCOMPONENT );
+ ::framework::FrameListAnalyzer aAnalyzer( xDesktop, Reference< XFrame >(), ::framework::FrameListAnalyzer::E_BACKINGCOMPONENT );
if ( aAnalyzer.m_xBackingComponent.is() )
xFrame = aAnalyzer.m_xBackingComponent;