diff options
author | Noel Grandin <noel@peralex.com> | 2014-05-12 12:47:52 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-05-13 12:00:27 +0200 |
commit | 2f5e8b9767d42e5efb823bb28ef5778d8731f079 (patch) | |
tree | 54e4d28d551303eedd18669a3760eed70f6a8716 /sw | |
parent | ffa2229a8ebf3b42f6327589814063fc39db7118 (diff) |
remove dead code SwAccessibleField
which seems to be dead since the IA2 integration
Change-Id: I3a6c70f27ef0cb2ac23776ad00394a73a99bb7e8
Diffstat (limited to 'sw')
-rw-r--r-- | sw/Library_sw.mk | 1 | ||||
-rw-r--r-- | sw/source/core/access/accfield.cxx | 315 | ||||
-rw-r--r-- | sw/source/core/access/accfield.hxx | 175 |
3 files changed, 0 insertions, 491 deletions
diff --git a/sw/Library_sw.mk b/sw/Library_sw.mk index 839197bf9cd8..ec4e021bb1ee 100644 --- a/sw/Library_sw.mk +++ b/sw/Library_sw.mk @@ -92,7 +92,6 @@ $(eval $(call gb_Library_add_exception_objects,sw,\ sw/source/core/access/accdoc \ sw/source/core/access/accembedded \ sw/source/core/access/accfootnote \ - sw/source/core/access/accfield \ sw/source/core/access/accframe \ sw/source/core/access/accframebase\ sw/source/core/access/accfrmobj \ diff --git a/sw/source/core/access/accfield.cxx b/sw/source/core/access/accfield.cxx deleted file mode 100644 index cea3369a0879..000000000000 --- a/sw/source/core/access/accfield.cxx +++ /dev/null @@ -1,315 +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 <comphelper/accessiblekeybindinghelper.hxx> -#include <swurl.hxx> -#include <vcl/svapp.hxx> -#include <vcl/settings.hxx> -#include <ndtxt.hxx> -#include <txtinet.hxx> - -#include <accpara.hxx> -#include <accfield.hxx> - -#include <comphelper/processfactory.hxx> - -#include <com/sun/star/frame/XDesktop.hpp> -#include <com/sun/star/frame/XComponentLoader.hpp> -#include <com/sun/star/document/XLinkTargetSupplier.hpp> -#include <comphelper/accessibleeventnotifier.hxx> - -//Add end - -using namespace ::com::sun::star; -using namespace ::com::sun::star::beans; -using namespace ::com::sun::star::lang; -using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::accessibility; - -SwAccessibleField::SwAccessibleField( SwField *pSwFld,SwAccessibleParagraph *p,sal_Int16 nRole) : - m_xPara( p ),m_pSwField(pSwFld),m_nRole(nRole) -{ - m_nClientId=0; -} - -uno::Reference< XAccessibleContext > SAL_CALL - SwAccessibleField::getAccessibleContext( void ) - throw (::com::sun::star::uno::RuntimeException, std::exception) -{ - uno::Reference < XAccessibleContext > xRet( this ); - return xRet; -} - -sal_Int32 SAL_CALL SwAccessibleField::getAccessibleChildCount( void ) - throw (::com::sun::star::uno::RuntimeException, std::exception) -{ - SolarMutexGuard aGuard; - return 0; -} - -uno::Reference< XAccessible> SAL_CALL - SwAccessibleField::getAccessibleChild( sal_Int32 ) - throw (::com::sun::star::uno::RuntimeException, - ::com::sun::star::lang::IndexOutOfBoundsException, std::exception) -{ - SolarMutexGuard aGuard; - return uno::Reference< XAccessible >(); -} - -uno::Reference< XAccessible> SAL_CALL SwAccessibleField::getAccessibleParent (void) - throw (::com::sun::star::uno::RuntimeException, std::exception) -{ - SolarMutexGuard aGuard; - - uno::Reference< XAccessible > xParent(static_cast<XAccessible*>(m_xPara.get()),UNO_QUERY); - return xParent; -} - -sal_Int32 SAL_CALL SwAccessibleField::getAccessibleIndexInParent (void) - throw (::com::sun::star::uno::RuntimeException, std::exception) -{ - SolarMutexGuard aGuard; - return 0; -} - -sal_Int16 SAL_CALL SwAccessibleField::getAccessibleRole (void) - throw (::com::sun::star::uno::RuntimeException, std::exception) -{ - SolarMutexGuard g; - return m_nRole; -} - -OUString SAL_CALL SwAccessibleField::getAccessibleDescription (void) - throw (::com::sun::star::uno::RuntimeException, std::exception) -{ - OSL_ENSURE( !this, "description needs to be overloaded" ); - return OUString(); -} - -OUString SAL_CALL SwAccessibleField::getAccessibleName (void) - throw (::com::sun::star::uno::RuntimeException, std::exception) -{ - return OUString(); -} - -uno::Reference< XAccessibleRelationSet> SAL_CALL - SwAccessibleField::getAccessibleRelationSet (void) - throw (::com::sun::star::uno::RuntimeException, std::exception) -{ - return NULL; -} - -uno::Reference<XAccessibleStateSet> SAL_CALL - SwAccessibleField::getAccessibleStateSet (void) - throw (::com::sun::star::uno::RuntimeException, std::exception) -{ - SolarMutexGuard aGuard; - return uno::Reference<XAccessibleStateSet>(); -} - -com::sun::star::lang::Locale SAL_CALL SwAccessibleField::getLocale (void) - throw (::com::sun::star::accessibility::IllegalAccessibleComponentStateException, ::com::sun::star::uno::RuntimeException, std::exception) -{ - SolarMutexGuard aGuard; - - com::sun::star::lang::Locale aLoc( Application::GetSettings().GetLanguageTag().getLocale() ); - return aLoc; -} - -static bool lcl_PointInRectangle(const awt::Point & aPoint, - const awt::Rectangle & aRect) -{ - long nDiffX = aPoint.X - aRect.X; - long nDiffY = aPoint.Y - aRect.Y; - - return - nDiffX >= 0 && nDiffX < aRect.Width && nDiffY >= 0 && - nDiffY < aRect.Height; - -} - -sal_Bool SAL_CALL SwAccessibleField::containsPoint( - const ::com::sun::star::awt::Point& aPoint ) - throw (RuntimeException, std::exception) -{ - awt::Rectangle aPixBounds = getBoundsImpl(sal_True); - aPixBounds.X = 0; - aPixBounds.Y = 0; - - return lcl_PointInRectangle(aPoint, aPixBounds); -} - -uno::Reference< XAccessible > SAL_CALL SwAccessibleField::getAccessibleAtPoint( - const awt::Point& aPoint ) - throw (RuntimeException, std::exception) -{ - SolarMutexGuard aGuard; - - uno::Reference< XAccessible > xAcc; - awt::Rectangle rc = getBounds(); - if(aPoint.X >= rc.X && aPoint.X <= rc.X + rc.Width && - aPoint.Y >= rc.Y && aPoint.Y <= rc.Y + rc.Height ) - { - xAcc =this; - } - return xAcc; -} - -/** - Get bounding box. - - There are two modes. - - - relative - - Return bounding box relative to parent if parent is no root - frame. Otherwise return the absolute bounding box. - - - absolute - - Return the absolute bounding box. - - @param bRelative - true: Use relative mode. - false: Use absolute mode. -*/ -awt::Rectangle SAL_CALL SwAccessibleField::getBoundsImpl( sal_Bool ) - throw (RuntimeException) -{ - SolarMutexGuard aGuard; - return awt::Rectangle(); -} - -awt::Rectangle SAL_CALL SwAccessibleField::getBounds() - throw (RuntimeException, std::exception) -{ - return getBoundsImpl(sal_True); -} - -awt::Point SAL_CALL SwAccessibleField::getLocation() - throw (RuntimeException, std::exception) -{ - awt::Rectangle aRect = getBoundsImpl(sal_True); - awt::Point aPoint(aRect.X, aRect.Y); - - return aPoint; -} - -awt::Point SAL_CALL SwAccessibleField::getLocationOnScreen() - throw (RuntimeException, std::exception) -{ - awt::Rectangle aRect = getBoundsImpl(sal_False); - //Point aPixPos = m_xPara->getLocationOnScreen(); - return awt::Point( aRect.X,aRect.Y);//aPixPos.X() + aRect.nLeft , aPixPos.Y() + + aRect.nRight ); -} - -awt::Size SAL_CALL SwAccessibleField::getSize() - throw (RuntimeException, std::exception) -{ - awt::Rectangle aRect = getBoundsImpl(sal_False); - awt::Size aSize( aRect.Width, aRect.Height ); - - return aSize; -} - -void SAL_CALL SwAccessibleField::grabFocus() - throw (RuntimeException, std::exception) -{ - SolarMutexGuard aGuard; - return; -} - -sal_Int32 SAL_CALL SwAccessibleField::getForeground() - throw (::com::sun::star::uno::RuntimeException, std::exception) -{ - return 0; -} - -sal_Int32 SAL_CALL SwAccessibleField::getBackground() - throw (::com::sun::star::uno::RuntimeException, std::exception) -{ - return 0xffffff; -} -::com::sun::star::uno::Any SAL_CALL SwAccessibleField::queryInterface( - const ::com::sun::star::uno::Type& rType ) - throw (::com::sun::star::uno::RuntimeException, std::exception) -{ - Any aRet; - if ( rType == ::getCppuType((uno::Reference<XAccessibleContext> *)0) ) - { - Reference<XAccessibleContext> aAccContext = (XAccessibleContext *) this; // resolve ambiguity - aRet <<= aAccContext; - } - else if ( rType == ::getCppuType((Reference<XAccessibleComponent> *)0) ) - { - Reference<XAccessibleComponent> aAccEditComponent = this; - aRet <<= aAccEditComponent; - } - if (rType == ::getCppuType((Reference<XAccessibleEventBroadcaster> *)0)) - { - Reference<XAccessibleEventBroadcaster> aAccBroadcaster= this; - aRet <<= aAccBroadcaster; - } - return aRet; -} - -void SAL_CALL SwAccessibleField::acquire( ) throw () -{ -} -void SAL_CALL SwAccessibleField::release( ) throw () -{ -} - -void SAL_CALL SwAccessibleField::addEventListener( - const Reference< XAccessibleEventListener >& xListener ) - throw (::com::sun::star::uno::RuntimeException) -{ - //DBG_MSG( "accessible event listener added" ) - - if (xListener.is()) - { - SolarMutexGuard aGuard; - if (!m_nClientId) - m_nClientId = comphelper::AccessibleEventNotifier::registerClient( ); - comphelper::AccessibleEventNotifier::addEventListener( m_nClientId, xListener ); - } -} - -void SAL_CALL SwAccessibleField::removeEventListener( - const Reference< XAccessibleEventListener >& xListener ) - throw (::com::sun::star::uno::RuntimeException) -{ - //DBG_MSG( "accessible event listener removed" ) - - if (xListener.is()) - { - SolarMutexGuard aGuard; - sal_Int32 nListenerCount = comphelper::AccessibleEventNotifier::removeEventListener( m_nClientId, xListener ); - if ( !nListenerCount ) - { - // no listeners anymore - // -> revoke ourself. This may lead to the notifier thread dying (if we were the last client), - // and at least to us not firing any events anymore, in case somebody calls - // NotifyAccessibleEvent, again - comphelper::AccessibleEventNotifier::revokeClient( m_nClientId ); - m_nClientId = 0; - } - } -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/access/accfield.hxx b/sw/source/core/access/accfield.hxx deleted file mode 100644 index e50c4c98cabe..000000000000 --- a/sw/source/core/access/accfield.hxx +++ /dev/null @@ -1,175 +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 . - */ -#ifndef INCLUDED_SW_SOURCE_CORE_ACCESS_ACCFIELD_HXX -#define INCLUDED_SW_SOURCE_CORE_ACCESS_ACCFIELD_HXX - -#include <com/sun/star/accessibility/XAccessible.hpp> -#include <com/sun/star/accessibility/XAccessibleContext.hpp> -#include <com/sun/star/accessibility/XAccessibleComponent.hpp> -#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp> -#include <com/sun/star/accessibility/IllegalAccessibleComponentStateException.hpp> -#include <com/sun/star/lang/DisposedException.hpp> -#include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/lang/IndexOutOfBoundsException.hpp> -#include <com/sun/star/accessibility/XAccessibleHyperlink.hpp> -#include <com/sun/star/accessibility/XAccessibleValue.hpp> -#include <com/sun/star/uno/RuntimeException.hpp> -#include <cppuhelper/implbase4.hxx> -#include <fmtinfmt.hxx> - -class SwAccessibleParagraph; -class SwField; -class SwAccessibleField : - public ::cppu::WeakImplHelper4< - ::com::sun::star::accessibility::XAccessible, - ::com::sun::star::accessibility::XAccessibleContext, - ::com::sun::star::accessibility::XAccessibleComponent, - ::com::sun::star::accessibility::XAccessibleEventBroadcaster - > -{ - friend class SwAccessibleParagraph; - friend class SwAccessibleHyperTextData; - -protected: - ::rtl::Reference< SwAccessibleParagraph > m_xPara; - SwField *m_pSwField; - - sal_uInt32 m_nClientId; // client id in the AccessibleEventNotifier queue - sal_Int16 m_nRole; // immutable outside constructor -public: - SwAccessibleField( SwField *pSwFld,SwAccessibleParagraph *p,sal_Int16); - - virtual void SAL_CALL addEventListener( - const ::com::sun::star::uno::Reference< - ::com::sun::star::accessibility::XAccessibleEventListener >& xListener ) - throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeEventListener( - const ::com::sun::star::uno::Reference< - ::com::sun::star::accessibility::XAccessibleEventListener >& xListener ) - throw (::com::sun::star::uno::RuntimeException); - - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( - const ::com::sun::star::uno::Type& aType ) - throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - - virtual void SAL_CALL acquire( ) throw () SAL_OVERRIDE ; - virtual void SAL_CALL release( ) throw () SAL_OVERRIDE ; - -public: - // XAccessible - - /// Return the XAccessibleContext. - virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext> SAL_CALL - getAccessibleContext (void) throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - - // XAccessibleContext - - /// Return the number of currently visible children. - virtual sal_Int32 SAL_CALL getAccessibleChildCount (void) - throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - - /// Return the specified child or NULL if index is invalid. - virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL - getAccessibleChild (sal_Int32 nIndex) - throw (::com::sun::star::uno::RuntimeException, - ::com::sun::star::lang::IndexOutOfBoundsException, std::exception) SAL_OVERRIDE; - - /// Return a reference to the parent. - virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL - getAccessibleParent (void) - throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - - /// Return this objects index among the parents children. - virtual sal_Int32 SAL_CALL - getAccessibleIndexInParent (void) - throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - - /// Return this object's role. - virtual sal_Int16 SAL_CALL - getAccessibleRole (void) - throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - - /// Return this object's description. - virtual OUString SAL_CALL - getAccessibleDescription (void) - throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - - /// Return the object's current name. - virtual OUString SAL_CALL - getAccessibleName (void) - throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - - /// Return NULL to indicate that an empty relation set. - virtual ::com::sun::star::uno::Reference< - ::com::sun::star::accessibility::XAccessibleRelationSet> SAL_CALL - getAccessibleRelationSet (void) - throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - - /// Return the set of current states. - virtual ::com::sun::star::uno::Reference< - ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL - getAccessibleStateSet (void) - throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - - /** Return the parents locale or throw exception if this object has no - parent yet/anymore. - */ - virtual ::com::sun::star::lang::Locale SAL_CALL - getLocale (void) - throw (::com::sun::star::accessibility::IllegalAccessibleComponentStateException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - - // XAccessibleComponent - virtual sal_Bool SAL_CALL containsPoint( - const ::com::sun::star::awt::Point& aPoint ) - throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - - virtual ::com::sun::star::uno::Reference< - ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( - const ::com::sun::star::awt::Point& aPoint ) - throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - - virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds() - throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - - virtual ::com::sun::star::awt::Point SAL_CALL getLocation() - throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - - virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen() - throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - - virtual ::com::sun::star::awt::Size SAL_CALL getSize() - throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - - virtual void SAL_CALL grabFocus() - throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - - virtual sal_Int32 SAL_CALL getForeground() - throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - virtual sal_Int32 SAL_CALL getBackground() - throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; - - virtual ::com::sun::star::awt::Rectangle SAL_CALL - getBoundsImpl(sal_Bool bRelative) - throw (::com::sun::star::uno::RuntimeException) ; - -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |