summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2016-11-14 10:39:55 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-11-14 09:48:46 +0000
commitfdf56e4b50b396884f67b841b82bca2ae8def848 (patch)
tree7b13a4c6370cb97ab04a327a6839302e010cac88 /sfx2
parent2cee32bd4f90cc70a44755f9a8e4a6e9c6c6f2d9 (diff)
loplugin:unusedmethods
Checked a couple of them: StandardCheckVisisbilityRedirector is unused since commit b1f8cf37828d5f37527e54774aa4935610aa6325 Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Wed Nov 2 10:57:21 2016 +0200 loplugin:singlevalfields SfxQueryStatus is unused since commit 64a708cba9b954afe3331f63c58218eb53b3d0ce Author: Caolán McNamara <caolanm@redhat.com> Date: Sat Nov 5 20:28:27 2016 +0000 Revert "Reverts a commit series that cripple windows ci." Change-Id: If1c9fe26c3ebc573d8c53c8f060b05c27f2711e5 Reviewed-on: https://gerrit.libreoffice.org/30840 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/Library_sfx.mk1
-rw-r--r--sfx2/source/control/querystatus.cxx222
-rw-r--r--sfx2/source/view/frame.cxx13
-rw-r--r--sfx2/source/view/viewfrm.cxx16
4 files changed, 0 insertions, 252 deletions
diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk
index e3daa773a50d..647078f5f500 100644
--- a/sfx2/Library_sfx.mk
+++ b/sfx2/Library_sfx.mk
@@ -144,7 +144,6 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\
sfx2/source/control/msg \
sfx2/source/control/msgpool \
sfx2/source/control/objface \
- sfx2/source/control/querystatus \
sfx2/source/control/recentdocsview \
sfx2/source/control/recentdocsviewitem \
sfx2/source/control/request \
diff --git a/sfx2/source/control/querystatus.cxx b/sfx2/source/control/querystatus.cxx
deleted file mode 100644
index e53d812c3a11..000000000000
--- a/sfx2/source/control/querystatus.cxx
+++ /dev/null
@@ -1,222 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include <sal/config.h>
-
-#include <sfx2/querystatus.hxx>
-#include <svl/poolitem.hxx>
-#include <svl/eitem.hxx>
-#include <svl/stritem.hxx>
-#include <svl/intitem.hxx>
-#include <svl/itemset.hxx>
-#include "itemdel.hxx"
-#include <svl/visitem.hxx>
-#include <cppuhelper/implbase.hxx>
-#include <comphelper/processfactory.hxx>
-#include <osl/mutex.hxx>
-#include <vcl/svapp.hxx>
-#include <com/sun/star/util/URLTransformer.hpp>
-#include <com/sun/star/util/XURLTransformer.hpp>
-#include <com/sun/star/frame/status/ItemStatus.hpp>
-#include <com/sun/star/frame/status/ItemState.hpp>
-#include <com/sun/star/frame/status/Visibility.hpp>
-
-using namespace ::cppu;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::frame;
-using namespace ::com::sun::star::frame::status;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::util;
-
-class SfxQueryStatus_Impl:
- public cppu::WeakImplHelper<css::frame::XStatusListener>
-{
- public:
-
- SfxQueryStatus_Impl( const css::uno::Reference< css::frame::XDispatchProvider >& rDispatchProvider, sal_uInt16 nSlotId, const OUString& aCommand );
- virtual ~SfxQueryStatus_Impl() override;
- SfxQueryStatus_Impl(const SfxQueryStatus_Impl&) = delete;
- SfxQueryStatus_Impl& operator=(const SfxQueryStatus_Impl&) = delete;
-
- // Query method
- SfxItemState QueryState( SfxPoolItem*& pPoolItem );
-
- // XEventListener
- virtual void SAL_CALL disposing(const css::lang::EventObject& Source) throw( css::uno::RuntimeException, std::exception ) override;
-
- // XStatusListener
- virtual void SAL_CALL statusChanged(const css::frame::FeatureStateEvent& Event) throw( css::uno::RuntimeException, std::exception ) override;
-
- private:
- bool m_bQueryInProgress;
- SfxItemState m_eState;
- SfxPoolItem* m_pItem;
- sal_uInt16 m_nSlotID;
- osl::Condition m_aCondition;
- css::util::URL m_aCommand;
- css::uno::Reference< css::frame::XDispatch > m_xDispatch;
-};
-
-SfxQueryStatus_Impl::SfxQueryStatus_Impl( const Reference< XDispatchProvider >& rDispatchProvider, sal_uInt16 nSlotId, const OUString& rCommand ) :
- m_bQueryInProgress( false ),
- m_eState( SfxItemState::DISABLED ),
- m_pItem( nullptr ),
- m_nSlotID( nSlotId )
-{
- m_aCommand.Complete = rCommand;
- Reference< XURLTransformer > xTrans( URLTransformer::create( ::comphelper::getProcessComponentContext() ) );
- xTrans->parseStrict( m_aCommand );
- if ( rDispatchProvider.is() )
- m_xDispatch = rDispatchProvider->queryDispatch( m_aCommand, OUString(), 0 );
- m_aCondition.reset();
-}
-
-SfxQueryStatus_Impl::~SfxQueryStatus_Impl()
-{
-}
-
-void SAL_CALL SfxQueryStatus_Impl::disposing( const EventObject& )
-throw( RuntimeException, std::exception )
-{
- SolarMutexGuard aGuard;
- m_xDispatch.clear();
-}
-
-void SAL_CALL SfxQueryStatus_Impl::statusChanged( const FeatureStateEvent& rEvent)
-throw( RuntimeException, std::exception )
-{
- SolarMutexGuard aGuard;
-
- m_pItem = nullptr;
- m_eState = SfxItemState::DISABLED;
-
- if ( rEvent.IsEnabled )
- {
- m_eState = SfxItemState::DEFAULT;
- css::uno::Type aType = rEvent.State.getValueType();
-
- if ( aType == cppu::UnoType<bool>::get() )
- {
- bool bTemp = false;
- rEvent.State >>= bTemp ;
- m_pItem = new SfxBoolItem( m_nSlotID, bTemp );
- }
- else if ( aType == ::cppu::UnoType< ::cppu::UnoUnsignedShortType >::get() )
- {
- sal_uInt16 nTemp = 0;
- rEvent.State >>= nTemp ;
- m_pItem = new SfxUInt16Item( m_nSlotID, nTemp );
- }
- else if ( aType == cppu::UnoType<sal_uInt32>::get() )
- {
- sal_uInt32 nTemp = 0;
- rEvent.State >>= nTemp ;
- m_pItem = new SfxUInt32Item( m_nSlotID, nTemp );
- }
- else if ( aType == cppu::UnoType<OUString>::get() )
- {
- OUString sTemp ;
- rEvent.State >>= sTemp ;
- m_pItem = new SfxStringItem( m_nSlotID, sTemp );
- }
- else if ( aType == cppu::UnoType< css::frame::status::ItemStatus>::get() )
- {
- ItemStatus aItemStatus;
- rEvent.State >>= aItemStatus;
- m_eState = (SfxItemState) aItemStatus.State;
- m_pItem = new SfxVoidItem( m_nSlotID );
- }
- else if ( aType == cppu::UnoType< css::frame::status::Visibility>::get() )
- {
- Visibility aVisibilityStatus;
- rEvent.State >>= aVisibilityStatus;
- m_pItem = new SfxVisibilityItem( m_nSlotID, aVisibilityStatus.bVisible );
- }
- else
- {
- m_eState = SfxItemState::UNKNOWN;
- m_pItem = new SfxVoidItem( m_nSlotID );
- }
- }
-
- if ( m_pItem )
- DeleteItemOnIdle( m_pItem );
-
- try
- {
- m_aCondition.set();
- m_xDispatch->removeStatusListener( Reference< XStatusListener >( static_cast< cppu::OWeakObject* >( this ), UNO_QUERY ),
- m_aCommand );
- }
- catch ( Exception& )
- {
- }
-}
-
-// Query method
-SfxItemState SfxQueryStatus_Impl::QueryState( SfxPoolItem*& rpPoolItem )
-{
- SolarMutexGuard aGuard;
- if ( !m_bQueryInProgress )
- {
- m_pItem = nullptr;
- m_eState = SfxItemState::DISABLED;
-
- if ( m_xDispatch.is() )
- {
- try
- {
- m_aCondition.reset();
- m_bQueryInProgress = true;
- m_xDispatch->addStatusListener( Reference< XStatusListener >( static_cast< cppu::OWeakObject* >( this ), UNO_QUERY ),
- m_aCommand );
- }
- catch ( Exception& )
- {
- m_aCondition.set();
- }
- }
- else
- m_aCondition.set();
- }
-
- m_aCondition.wait();
-
- m_bQueryInProgress = false;
- rpPoolItem = m_pItem;
- return m_eState;
-}
-
-
-SfxQueryStatus::SfxQueryStatus( const Reference< XDispatchProvider >& rDispatchProvider, sal_uInt16 nSlotId, const OUString& rCommand )
- : m_pImpl(new SfxQueryStatus_Impl( rDispatchProvider, nSlotId, rCommand ))
-{
-}
-
-SfxQueryStatus::~SfxQueryStatus()
-{
-}
-
-SfxItemState SfxQueryStatus::QueryState( SfxPoolItem*& rpPoolItem )
-{
- SolarMutexGuard aGuard;
- return m_pImpl->QueryState( rpPoolItem );
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx
index 9e80816a2633..e9cf6eb1d55d 100644
--- a/sfx2/source/view/frame.cxx
+++ b/sfx2/source/view/frame.cxx
@@ -239,14 +239,6 @@ SfxFrame* SfxFrame::GetChildFrame( sal_uInt16 nPos ) const
return nullptr;
}
-void SfxFrame::RemoveChildFrame_Impl( SfxFrame* pFrame )
-{
- DBG_ASSERT( pChildArr, "Unknown Frame!");
- SfxFrameArr_Impl::iterator it = std::find( pChildArr->begin(), pChildArr->end(), pFrame );
- if ( it != pChildArr->end() )
- pChildArr->erase( it );
-};
-
bool SfxFrame::IsClosing_Impl() const
{
return pImpl->bClosing;
@@ -299,11 +291,6 @@ SfxViewFrame* SfxFrame::GetCurrentViewFrame() const
return pImpl->pCurrentViewFrame;
}
-SfxDispatcher* SfxFrame::GetDispatcher_Impl() const
-{
- return pImpl->pCurrentViewFrame->GetDispatcher();
-}
-
bool SfxFrame::IsAutoLoadLocked_Impl() const
{
// Its own Document is locked?
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 9240a3a6f1dc..18022ecafb1e 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -1643,22 +1643,6 @@ const Size& SfxViewFrame::GetMargin_Impl() const
return m_pImpl->aMargin;
}
-void SfxViewFrame::SetActiveChildFrame_Impl( SfxViewFrame *pViewFrame )
-{
- if ( pViewFrame != m_pImpl->pActiveChild )
- {
- m_pImpl->pActiveChild = pViewFrame;
-
- Reference< XFramesSupplier > xFrame( GetFrame().GetFrameInterface(), UNO_QUERY );
- Reference< XFrame > xActive;
- if ( pViewFrame )
- xActive = pViewFrame->GetFrame().GetFrameInterface();
-
- if ( xFrame.is() ) // xFrame can be NULL
- xFrame->setActiveFrame( xActive );
- }
-}
-
SfxViewFrame* SfxViewFrame::GetActiveChildFrame_Impl() const
{
SfxViewFrame *pViewFrame = m_pImpl->pActiveChild;