LCOV - code coverage report
Current view: top level - sw/source/ui/vba - vbafind.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 195 0.0 %
Date: 2012-08-25 Functions: 0 36 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 408 0.0 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : #include "vbafind.hxx"
      29                 :            : #include <vbahelper/vbahelper.hxx>
      30                 :            : #include <tools/diagnose_ex.h>
      31                 :            : #include "vbareplacement.hxx"
      32                 :            : #include <ooo/vba/word/WdFindWrap.hpp>
      33                 :            : #include <ooo/vba/word/WdReplace.hpp>
      34                 :            : #include <com/sun/star/text/XTextRangeCompare.hpp>
      35                 :            : #include "wordvbahelper.hxx"
      36                 :            : 
      37                 :            : using namespace ::ooo::vba;
      38                 :            : using namespace ::com::sun::star;
      39                 :            : 
      40                 :          0 : SwVbaFind::SwVbaFind( const uno::Reference< ooo::vba::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const uno::Reference< frame::XModel >& xModel, const uno::Reference< text::XTextRange >& xTextRange ) throw ( uno::RuntimeException ) :
      41                 :          0 :     SwVbaFind_BASE( rParent, rContext ), mxModel( xModel ), mxTextRange( xTextRange ), mbReplace( sal_False ), mnReplaceType( word::WdReplace::wdReplaceOne ), mnWrap( word::WdFindWrap::wdFindStop )
      42                 :            : {
      43         [ #  # ]:          0 :     mxReplaceable.set( mxModel, uno::UNO_QUERY_THROW );
      44 [ #  # ][ #  # ]:          0 :     mxPropertyReplace.set( mxReplaceable->createReplaceDescriptor(), uno::UNO_QUERY_THROW );
                 [ #  # ]
      45 [ #  # ][ #  # ]:          0 :     mxTVC = word::getXTextViewCursor( mxModel );
      46 [ #  # ][ #  # ]:          0 :     mxSelSupp.set( mxModel->getCurrentController(), uno::UNO_QUERY_THROW );
                 [ #  # ]
      47                 :          0 : }
      48                 :            : 
      49                 :          0 : SwVbaFind::~SwVbaFind()
      50                 :            : {
      51         [ #  # ]:          0 : }
      52                 :            : 
      53                 :          0 : sal_Bool SwVbaFind::InRange( const uno::Reference< text::XTextRange >& xCurrentRange ) throw ( uno::RuntimeException )
      54                 :            : {
      55 [ #  # ][ #  # ]:          0 :     uno::Reference< text::XTextRangeCompare > xTRC( mxTextRange->getText(), uno::UNO_QUERY_THROW );
                 [ #  # ]
      56 [ #  # ][ #  # ]:          0 :     if( xTRC->compareRegionStarts( mxTextRange, xCurrentRange ) >= 0 && xTRC->compareRegionEnds( mxTextRange, xCurrentRange ) <= 0 )
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
      57                 :          0 :         return sal_True;
      58                 :          0 :     return sal_False;
      59                 :            : }
      60                 :            : 
      61                 :          0 : sal_Bool SwVbaFind::InEqualRange( const uno::Reference< text::XTextRange >& xCurrentRange ) throw ( uno::RuntimeException )
      62                 :            : {
      63 [ #  # ][ #  # ]:          0 :     uno::Reference< text::XTextRangeCompare > xTRC( mxTextRange->getText(), uno::UNO_QUERY_THROW );
                 [ #  # ]
      64 [ #  # ][ #  # ]:          0 :     if( xTRC->compareRegionStarts( mxTextRange, xCurrentRange ) == 0 && xTRC->compareRegionEnds( mxTextRange, xCurrentRange ) == 0 )
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
      65                 :          0 :         return sal_True;
      66                 :          0 :     return sal_False;
      67                 :            : }
      68                 :            : 
      69                 :          0 : void SwVbaFind::SetReplaceWith( const rtl::OUString& rText ) throw (uno::RuntimeException)
      70                 :            : {
      71                 :          0 :     mxPropertyReplace->setReplaceString( rText );
      72                 :          0 :     mbReplace = sal_True;
      73                 :          0 : }
      74                 :            : 
      75                 :          0 : rtl::OUString SwVbaFind::GetReplaceWith() throw (uno::RuntimeException)
      76                 :            : {
      77                 :          0 :     return mxPropertyReplace->getReplaceString();
      78                 :            : }
      79                 :          0 : void SwVbaFind::SetReplace( sal_Int32 type )
      80                 :            : {
      81                 :          0 :     mnReplaceType = type;
      82                 :          0 :     mbReplace = sal_True;
      83                 :          0 : }
      84                 :          0 : uno::Reference< text::XTextRange > SwVbaFind::FindOneElement() throw ( uno::RuntimeException )
      85                 :            : {
      86                 :          0 :     uno::Reference< text::XTextRange > xFoundOne;
      87 [ #  # ][ #  # ]:          0 :     if( !mxTVC->getString().isEmpty() )
                 [ #  # ]
      88                 :            :     {
      89 [ #  # ][ #  # ]:          0 :         if( getForward() )
      90                 :            :         {
      91 [ #  # ][ #  # ]:          0 :             xFoundOne.set( mxReplaceable->findNext( mxTextRange->getStart(), uno::Reference< util::XSearchDescriptor >( mxPropertyReplace, uno::UNO_QUERY_THROW ) ), uno::UNO_QUERY );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
      92                 :            :         }
      93                 :            :         else
      94                 :            :         {
      95 [ #  # ][ #  # ]:          0 :             xFoundOne.set( mxReplaceable->findNext( mxTextRange->getEnd(), uno::Reference< util::XSearchDescriptor >( mxPropertyReplace, uno::UNO_QUERY_THROW ) ), uno::UNO_QUERY );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
      96                 :            :         }
      97                 :            : 
      98 [ #  # ][ #  # ]:          0 :         if( xFoundOne.is() && InEqualRange( xFoundOne ) )
         [ #  # ][ #  # ]
      99                 :            :         {
     100 [ #  # ][ #  # ]:          0 :             xFoundOne.set( mxReplaceable->findNext( xFoundOne, uno::Reference< util::XSearchDescriptor >( mxPropertyReplace, uno::UNO_QUERY_THROW ) ), uno::UNO_QUERY );
         [ #  # ][ #  # ]
     101                 :            :         }
     102 [ #  # ][ #  # ]:          0 :         else if( xFoundOne.is() && !InRange( xFoundOne ) )
         [ #  # ][ #  # ]
     103                 :            :         {
     104         [ #  # ]:          0 :             xFoundOne = uno::Reference< text::XTextRange >();
     105                 :            :         }
     106                 :            :     }
     107                 :            :     else
     108                 :            :     {
     109 [ #  # ][ #  # ]:          0 :         xFoundOne.set( mxReplaceable->findNext( mxTextRange, uno::Reference< util::XSearchDescriptor >( mxPropertyReplace, uno::UNO_QUERY_THROW ) ), uno::UNO_QUERY );
         [ #  # ][ #  # ]
     110                 :            :     }
     111                 :            : 
     112 [ #  # ][ #  # ]:          0 :     if( !xFoundOne.is() && ( getWrap() == word::WdFindWrap::wdFindContinue || getWrap() == word::WdFindWrap::wdFindAsk ) )
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     113                 :            :     {
     114 [ #  # ][ #  # ]:          0 :         if( getForward() )
     115                 :            :         {
     116 [ #  # ][ #  # ]:          0 :             mxTVC->gotoStart(sal_False);
     117 [ #  # ][ #  # ]:          0 :             xFoundOne.set( mxReplaceable->findNext( mxTextRange->getStart(), uno::Reference< util::XSearchDescriptor >( mxPropertyReplace, uno::UNO_QUERY_THROW ) ), uno::UNO_QUERY );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     118                 :            :         }
     119                 :            :         else
     120                 :            :         {
     121 [ #  # ][ #  # ]:          0 :             mxTVC->gotoEnd( sal_False );
     122 [ #  # ][ #  # ]:          0 :             xFoundOne.set( mxReplaceable->findNext( mxTextRange->getEnd(), uno::Reference< util::XSearchDescriptor >( mxPropertyReplace, uno::UNO_QUERY_THROW ) ), uno::UNO_QUERY );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     123                 :            : 
     124                 :            :         }
     125                 :            :     }
     126                 :          0 :     return xFoundOne;
     127                 :            : }
     128                 :            : 
     129                 :          0 : sal_Bool SwVbaFind::SearchReplace() throw (uno::RuntimeException)
     130                 :            : {
     131                 :          0 :     sal_Bool result = sal_False;
     132                 :            : 
     133                 :            :     // TODO: map wildcards in area to OOo wildcards
     134                 :            : 
     135         [ #  # ]:          0 :     if( mbReplace )
     136                 :            :     {
     137   [ #  #  #  # ]:          0 :         switch( mnReplaceType )
     138                 :            :         {
     139                 :            :             case word::WdReplace::wdReplaceNone:
     140                 :            :             {
     141                 :          0 :                 result = sal_True;
     142                 :          0 :                 break;
     143                 :            :             }
     144                 :            :             case word::WdReplace::wdReplaceOne:
     145                 :            :             {
     146         [ #  # ]:          0 :                 uno::Reference< text::XTextRange > xFindOne = FindOneElement();
     147         [ #  # ]:          0 :                 if( xFindOne.is() )
     148                 :            :                 {
     149 [ #  # ][ #  # ]:          0 :                     xFindOne->setString( GetReplaceWith() );
                 [ #  # ]
     150 [ #  # ][ #  # ]:          0 :                     result = mxSelSupp->select( uno::makeAny( xFindOne ) );
                 [ #  # ]
     151                 :            :                 }
     152                 :          0 :                 break;
     153                 :            :             }
     154                 :            :             case word::WdReplace::wdReplaceAll:
     155                 :            :             {
     156 [ #  # ][ #  # ]:          0 :                 uno::Reference< container::XIndexAccess > xIndexAccess = mxReplaceable->findAll( uno::Reference< util::XSearchDescriptor >( mxPropertyReplace, uno::UNO_QUERY_THROW ) );
                 [ #  # ]
     157 [ #  # ][ #  # ]:          0 :                 if( xIndexAccess->getCount() > 0 )
                 [ #  # ]
     158                 :            :                 {
     159 [ #  # ][ #  # ]:          0 :                     for( sal_Int32 i = 0; i < xIndexAccess->getCount(); i++ )
                 [ #  # ]
     160                 :            :                     {
     161 [ #  # ][ #  # ]:          0 :                         uno::Reference< text::XTextRange > xTextRange( xIndexAccess->getByIndex( i ), uno::UNO_QUERY_THROW );
                 [ #  # ]
     162 [ #  # ][ #  # ]:          0 :                         if( mnWrap == word::WdFindWrap::wdFindContinue || mnWrap == word::WdFindWrap::wdFindAsk || InRange( xTextRange ) )
         [ #  # ][ #  # ]
                 [ #  # ]
     163                 :            :                         {
     164 [ #  # ][ #  # ]:          0 :                             xTextRange->setString( GetReplaceWith() );
                 [ #  # ]
     165                 :          0 :                             result = sal_True;
     166                 :            :                         }
     167                 :          0 :                     }
     168                 :            :                 }
     169                 :          0 :                 break;
     170                 :            :             }
     171                 :            :             default:
     172                 :            :             {
     173                 :          0 :                 result = sal_False;
     174                 :            :             }
     175                 :            :         }
     176                 :            :     }
     177                 :            :     else
     178                 :            :     {
     179         [ #  # ]:          0 :         uno::Reference< text::XTextRange > xFindOne = FindOneElement();
     180         [ #  # ]:          0 :         if( xFindOne.is() )
     181 [ #  # ][ #  # ]:          0 :             result = mxSelSupp->select( uno::makeAny( xFindOne ) );
                 [ #  # ]
     182                 :            :     }
     183                 :            : 
     184                 :          0 :     return result;
     185                 :            : }
     186                 :            : 
     187                 :          0 : ::rtl::OUString SAL_CALL SwVbaFind::getText() throw (uno::RuntimeException)
     188                 :            : {
     189                 :          0 :     return mxPropertyReplace->getSearchString();
     190                 :            : }
     191                 :            : 
     192                 :          0 : void SAL_CALL SwVbaFind::setText( const ::rtl::OUString& _text ) throw (uno::RuntimeException)
     193                 :            : {
     194                 :          0 :     mxPropertyReplace->setSearchString( _text );
     195                 :          0 : }
     196                 :            : 
     197                 :          0 : uno::Any SAL_CALL SwVbaFind::getReplacement() throw (uno::RuntimeException)
     198                 :            : {
     199 [ #  # ][ #  # ]:          0 :     return uno::makeAny( uno::Reference< word::XReplacement >( new SwVbaReplacement( this, mxContext, mxPropertyReplace ) ) );
         [ #  # ][ #  # ]
     200                 :            : }
     201                 :            : 
     202                 :          0 : void SAL_CALL SwVbaFind::setReplacement( const uno::Any& /*_replacement */ ) throw (uno::RuntimeException)
     203                 :            : {
     204 [ #  # ][ #  # ]:          0 :     throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
     205                 :            : }
     206                 :            : 
     207                 :          0 : ::sal_Bool SAL_CALL SwVbaFind::getForward() throw (uno::RuntimeException)
     208                 :            : {
     209                 :          0 :     sal_Bool bBackward = sal_False;
     210 [ #  # ][ #  # ]:          0 :     mxPropertyReplace->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SearchBackwards") ) ) >>= bBackward;
                 [ #  # ]
     211                 :          0 :     return !bBackward;
     212                 :            : }
     213                 :            : 
     214                 :          0 : void SAL_CALL SwVbaFind::setForward( ::sal_Bool _forward ) throw (uno::RuntimeException)
     215                 :            : {
     216                 :          0 :     sal_Bool bBackward = !_forward;
     217 [ #  # ][ #  # ]:          0 :     mxPropertyReplace->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SearchBackwards") ), uno::makeAny( bBackward ) );
         [ #  # ][ #  # ]
     218                 :          0 : }
     219                 :            : 
     220                 :          0 : ::sal_Int32 SAL_CALL SwVbaFind::getWrap() throw (uno::RuntimeException)
     221                 :            : {
     222                 :            :     // seems not supported in Writer
     223                 :          0 :     return mnWrap;
     224                 :            : }
     225                 :            : 
     226                 :          0 : void SAL_CALL SwVbaFind::setWrap( ::sal_Int32 _wrap ) throw (uno::RuntimeException)
     227                 :            : {
     228                 :            :     // seems not supported in Writer
     229                 :          0 :     mnWrap = _wrap;
     230                 :          0 : }
     231                 :            : 
     232                 :          0 : ::sal_Bool SAL_CALL SwVbaFind::getFormat() throw (uno::RuntimeException)
     233                 :            : {
     234                 :          0 :     return mxPropertyReplace->getValueSearch();
     235                 :            : }
     236                 :            : 
     237                 :          0 : void SAL_CALL SwVbaFind::setFormat( ::sal_Bool _format ) throw (uno::RuntimeException)
     238                 :            : {
     239                 :          0 :     mxPropertyReplace->setValueSearch( _format );
     240                 :          0 : }
     241                 :            : 
     242                 :          0 : ::sal_Bool SAL_CALL SwVbaFind::getMatchCase() throw (uno::RuntimeException)
     243                 :            : {
     244                 :          0 :     sal_Bool value = sal_False;
     245 [ #  # ][ #  # ]:          0 :     mxPropertyReplace->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SearchCaseSensitive") ) ) >>= value;
                 [ #  # ]
     246                 :          0 :     return value;
     247                 :            : }
     248                 :            : 
     249                 :          0 : void SAL_CALL SwVbaFind::setMatchCase( ::sal_Bool _matchcase ) throw (uno::RuntimeException)
     250                 :            : {
     251 [ #  # ][ #  # ]:          0 :     mxPropertyReplace->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SearchCaseSensitive") ), uno::makeAny( _matchcase ) );
     252                 :          0 : }
     253                 :            : 
     254                 :          0 : ::sal_Bool SAL_CALL SwVbaFind::getMatchWholeWord() throw (uno::RuntimeException)
     255                 :            : {
     256                 :          0 :     sal_Bool value = sal_False;
     257 [ #  # ][ #  # ]:          0 :     mxPropertyReplace->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SearchWords") ) ) >>= value;
                 [ #  # ]
     258                 :          0 :     return value;
     259                 :            : }
     260                 :            : 
     261                 :          0 : void SAL_CALL SwVbaFind::setMatchWholeWord( ::sal_Bool _matchwholeword ) throw (uno::RuntimeException)
     262                 :            : {
     263 [ #  # ][ #  # ]:          0 :     mxPropertyReplace->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SearchWords") ), uno::makeAny( _matchwholeword ) );
     264                 :          0 : }
     265                 :            : 
     266                 :          0 : ::sal_Bool SAL_CALL SwVbaFind::getMatchWildcards() throw (uno::RuntimeException)
     267                 :            : {
     268                 :          0 :     sal_Bool value = sal_False;
     269 [ #  # ][ #  # ]:          0 :     mxPropertyReplace->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SearchRegularExpression") ) ) >>= value;
                 [ #  # ]
     270                 :          0 :     return value;
     271                 :            : }
     272                 :            : 
     273                 :          0 : void SAL_CALL SwVbaFind::setMatchWildcards( ::sal_Bool _matchwildcards ) throw (uno::RuntimeException)
     274                 :            : {
     275 [ #  # ][ #  # ]:          0 :     mxPropertyReplace->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SearchRegularExpression") ), uno::makeAny( _matchwildcards ) );
     276                 :          0 : }
     277                 :            : 
     278                 :          0 : ::sal_Bool SAL_CALL SwVbaFind::getMatchSoundsLike() throw (uno::RuntimeException)
     279                 :            : {
     280                 :          0 :     sal_Bool value = sal_False;
     281 [ #  # ][ #  # ]:          0 :     mxPropertyReplace->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SearchSimilarity") ) ) >>= value;
                 [ #  # ]
     282                 :          0 :     return value;
     283                 :            : }
     284                 :            : 
     285                 :          0 : void SAL_CALL SwVbaFind::setMatchSoundsLike( ::sal_Bool _matchsoundslike ) throw (uno::RuntimeException)
     286                 :            : {
     287                 :            :     // seems not accurate
     288 [ #  # ][ #  # ]:          0 :     mxPropertyReplace->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SearchSimilarity") ), uno::makeAny( _matchsoundslike ) );
     289                 :          0 : }
     290                 :            : 
     291                 :          0 : ::sal_Bool SAL_CALL SwVbaFind::getMatchAllWordForms() throw (uno::RuntimeException)
     292                 :            : {
     293                 :          0 :     sal_Bool value = sal_False;
     294 [ #  # ][ #  # ]:          0 :     mxPropertyReplace->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SearchSimilarity") ) ) >>= value;
                 [ #  # ]
     295         [ #  # ]:          0 :     if( value )
     296 [ #  # ][ #  # ]:          0 :         mxPropertyReplace->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SearchSimilarityRelax") ) ) >>= value;
                 [ #  # ]
     297                 :          0 :     return value;
     298                 :            : }
     299                 :            : 
     300                 :          0 : void SAL_CALL SwVbaFind::setMatchAllWordForms( ::sal_Bool _matchallwordforms ) throw (uno::RuntimeException)
     301                 :            : {
     302                 :            :     // seems not accurate
     303 [ #  # ][ #  # ]:          0 :     mxPropertyReplace->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SearchSimilarity") ), uno::makeAny( _matchallwordforms ) );
     304 [ #  # ][ #  # ]:          0 :     mxPropertyReplace->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SearchSimilarityRelax") ), uno::makeAny( _matchallwordforms ) );
     305                 :          0 : }
     306                 :            : 
     307                 :          0 : uno::Any SAL_CALL SwVbaFind::getStyle() throw (uno::RuntimeException)
     308                 :            : {
     309 [ #  # ][ #  # ]:          0 :     throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
     310                 :            : }
     311                 :            : 
     312                 :          0 : void SAL_CALL SwVbaFind::setStyle( const uno::Any& /*_style */ ) throw (uno::RuntimeException)
     313                 :            : {
     314 [ #  # ][ #  # ]:          0 :     throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() );
     315                 :            : }
     316                 :            : 
     317                 :            : sal_Bool SAL_CALL
     318                 :          0 : SwVbaFind::Execute( const uno::Any& FindText, const uno::Any& MatchCase, const uno::Any& MatchWholeWord, const uno::Any& MatchWildcards, const uno::Any& MatchSoundsLike, const uno::Any& MatchAllWordForms, const uno::Any& Forward, const uno::Any& Wrap, const uno::Any& Format, const uno::Any& ReplaceWith, const uno::Any& Replace, const uno::Any& /*MatchKashida*/, const uno::Any& /*MatchDiacritics*/, const uno::Any& /*MatchAlefHamza*/, const uno::Any& /*MatchControl*/, const uno::Any& /*MatchPrefix*/, const uno::Any& /*MatchSuffix*/, const uno::Any& /*MatchPhrase*/, const uno::Any& /*IgnoreSpace*/, const uno::Any& /*IgnorePunct*/ ) throw (uno::RuntimeException)
     319                 :            : {
     320                 :          0 :     sal_Bool result = sal_False;
     321         [ #  # ]:          0 :     if( FindText.hasValue() )
     322                 :            :     {
     323                 :          0 :         rtl::OUString sText;
     324                 :          0 :         FindText >>= sText;
     325         [ #  # ]:          0 :         setText( sText );
     326                 :            :     }
     327                 :            : 
     328                 :          0 :     sal_Bool bValue = sal_False;
     329         [ #  # ]:          0 :     if( MatchCase.hasValue() )
     330                 :            :     {
     331                 :          0 :         MatchCase >>= bValue;
     332         [ #  # ]:          0 :         setMatchCase( bValue );
     333                 :            :     }
     334                 :            : 
     335         [ #  # ]:          0 :     if( MatchWholeWord.hasValue() )
     336                 :            :     {
     337                 :          0 :         MatchWholeWord >>= bValue;
     338         [ #  # ]:          0 :         setMatchWholeWord( bValue );
     339                 :            :     }
     340                 :            : 
     341         [ #  # ]:          0 :     if( MatchWildcards.hasValue() )
     342                 :            :     {
     343                 :          0 :         MatchWildcards >>= bValue;
     344         [ #  # ]:          0 :         setMatchWildcards( bValue );
     345                 :            :     }
     346                 :            : 
     347         [ #  # ]:          0 :     if( MatchSoundsLike.hasValue() )
     348                 :            :     {
     349                 :          0 :         MatchSoundsLike >>= bValue;
     350         [ #  # ]:          0 :         setMatchSoundsLike( bValue );
     351                 :            :     }
     352                 :            : 
     353         [ #  # ]:          0 :     if( MatchAllWordForms.hasValue() )
     354                 :            :     {
     355                 :          0 :         MatchAllWordForms >>= bValue;
     356         [ #  # ]:          0 :         setMatchAllWordForms( bValue );
     357                 :            :     }
     358                 :            : 
     359         [ #  # ]:          0 :     if( Forward.hasValue() )
     360                 :            :     {
     361                 :          0 :         Forward >>= bValue;
     362         [ #  # ]:          0 :         setForward( bValue );
     363                 :            :     }
     364                 :            : 
     365         [ #  # ]:          0 :     if( Wrap.hasValue() )
     366                 :            :     {
     367                 :          0 :         sal_Int32 nWrapType = 0;
     368                 :          0 :         Wrap >>= nWrapType;
     369         [ #  # ]:          0 :         setWrap( nWrapType );
     370                 :            :     }
     371                 :            : 
     372         [ #  # ]:          0 :     if( Format.hasValue() )
     373                 :            :     {
     374                 :          0 :         Format >>= bValue;
     375         [ #  # ]:          0 :         setFormat( bValue );
     376                 :            :     }
     377                 :            : 
     378         [ #  # ]:          0 :     if( ReplaceWith.hasValue() )
     379                 :            :     {
     380                 :          0 :         rtl::OUString sValue;
     381                 :          0 :         ReplaceWith >>= sValue;
     382         [ #  # ]:          0 :         SetReplaceWith( sValue );
     383                 :            :     }
     384                 :            : 
     385         [ #  # ]:          0 :     if( Replace.hasValue() )
     386                 :            :     {
     387                 :          0 :         sal_Int32 nValue(0);
     388                 :          0 :         Replace >>= nValue;
     389                 :          0 :         SetReplace( nValue );
     390                 :            :     }
     391                 :            : 
     392         [ #  # ]:          0 :     result = SearchReplace();
     393                 :            : 
     394                 :          0 :     return result;
     395                 :            : }
     396                 :            : 
     397                 :            : void SAL_CALL
     398                 :          0 : SwVbaFind::ClearFormatting(  ) throw (uno::RuntimeException)
     399                 :            : {
     400         [ #  # ]:          0 :     uno::Sequence< beans::PropertyValue >  aSearchAttribs;
     401 [ #  # ][ #  # ]:          0 :     mxPropertyReplace->setSearchAttributes( aSearchAttribs );
                 [ #  # ]
     402                 :          0 : }
     403                 :            : 
     404                 :            : rtl::OUString
     405                 :          0 : SwVbaFind::getServiceImplName()
     406                 :            : {
     407                 :          0 :     return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SwVbaFind"));
     408                 :            : }
     409                 :            : 
     410                 :            : uno::Sequence< rtl::OUString >
     411                 :          0 : SwVbaFind::getServiceNames()
     412                 :            : {
     413 [ #  # ][ #  # ]:          0 :     static uno::Sequence< rtl::OUString > aServiceNames;
         [ #  # ][ #  # ]
     414         [ #  # ]:          0 :     if ( aServiceNames.getLength() == 0 )
     415                 :            :     {
     416                 :          0 :         aServiceNames.realloc( 1 );
     417         [ #  # ]:          0 :         aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.Find" ) );
     418                 :            :     }
     419                 :          0 :     return aServiceNames;
     420                 :            : }
     421                 :            : 
     422                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10