LCOV - code coverage report
Current view: top level - svx/source/accessibility - AccessibleSvxFindReplaceDialog.cxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 40 0.0 %
Date: 2014-04-14 Functions: 0 8 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : #include <svx/AccessibleSvxFindReplaceDialog.hxx>
      20             : #include <svx/srchdlg.hxx>
      21             : #include <toolkit/awt/vclxwindow.hxx>
      22             : #include <unotools/accessiblerelationsethelper.hxx>
      23             : #include <com/sun/star/accessibility/AccessibleRelationType.hpp>
      24             : #include <com/sun/star/accessibility/XAccessibleGetAccFlowTo.hpp>
      25             : 
      26             : using namespace ::com::sun::star;
      27             : using namespace ::com::sun::star::uno;
      28             : 
      29           0 : VCLXAccessibleSvxFindReplaceDialog::VCLXAccessibleSvxFindReplaceDialog(VCLXWindow* pVCLXindow)
      30           0 :     :VCLXAccessibleComponent( pVCLXindow )
      31             : {
      32             : 
      33           0 : }
      34             : 
      35           0 : VCLXAccessibleSvxFindReplaceDialog::~VCLXAccessibleSvxFindReplaceDialog()
      36             : {
      37           0 : }
      38             : 
      39           0 : void VCLXAccessibleSvxFindReplaceDialog::FillAccessibleRelationSet( utl::AccessibleRelationSetHelper& rRelationSet )
      40             : {
      41           0 :     VCLXAccessibleComponent::FillAccessibleRelationSet( rRelationSet );
      42           0 :     Window* pDlg = GetWindow();
      43           0 :     if ( pDlg )
      44             :     {
      45           0 :         SvxSearchDialog* pSrchDlg = static_cast<SvxSearchDialog*>( pDlg );
      46           0 :         Window* pDocWin = pSrchDlg->GetDocWin();
      47           0 :         if ( !pDocWin )
      48             :         {
      49           0 :             return;
      50             :         }
      51           0 :         Reference < css::accessibility::XAccessible > xDocAcc = pDocWin->GetAccessible();
      52           0 :         if ( !xDocAcc.is() )
      53             :         {
      54           0 :             return;
      55             :         }
      56           0 :         Reference< css::accessibility::XAccessibleGetAccFlowTo > xGetAccFlowTo( xDocAcc, UNO_QUERY );
      57           0 :         if ( !xGetAccFlowTo.is() )
      58             :         {
      59           0 :             return;
      60             :         }
      61           0 :         Any aAny;
      62           0 :         aAny <<= ( pSrchDlg->GetSrchFlag() );
      63             : 
      64           0 :         const sal_Int32 FORFINDREPLACEFLOWTO = 2;
      65           0 :         uno::Sequence<uno::Any> aAnySeq = xGetAccFlowTo->getAccFlowTo( aAny,  FORFINDREPLACEFLOWTO );
      66             : 
      67           0 :         sal_Int32 nLen = aAnySeq.getLength();
      68           0 :         if ( nLen )
      69             :         {
      70           0 :             uno::Sequence< uno::Reference< uno::XInterface > > aSequence( nLen );
      71           0 :             for ( sal_Int32 i = 0; i < nLen; i++ )
      72             :             {
      73           0 :                 uno::Reference < css::accessibility::XAccessible > xAcc;
      74           0 :                 aAnySeq[i] >>= xAcc;
      75           0 :                 aSequence[i] = xAcc;
      76           0 :             }
      77           0 :             rRelationSet.AddRelation( css::accessibility::AccessibleRelation( css::accessibility::AccessibleRelationType::CONTENT_FLOWS_TO, aSequence ) );
      78           0 :         }
      79             :     }
      80             : }
      81             : 
      82             : // XServiceInfo
      83             : 
      84             : 
      85           0 : OUString VCLXAccessibleSvxFindReplaceDialog::getImplementationName() throw (RuntimeException, std::exception)
      86             : {
      87           0 :     return OUString( "VCLXAccessibleSvxFindReplaceDialog" );
      88             : }
      89             : 
      90             : 
      91             : 
      92           0 : Sequence< OUString > VCLXAccessibleSvxFindReplaceDialog::getSupportedServiceNames() throw (RuntimeException, std::exception)
      93             : {
      94           0 :     Sequence< OUString > aNames(1);
      95           0 :     aNames[0] = OUString( "VCLXAccessibleSvxFindReplaceDialog" );
      96           0 :     return aNames;
      97           0 : }
      98             : 
      99             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10