1*24acc546SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*24acc546SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*24acc546SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*24acc546SAndrew Rist * distributed with this work for additional information 6*24acc546SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*24acc546SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*24acc546SAndrew Rist * "License"); you may not use this file except in compliance 9*24acc546SAndrew Rist * with the License. You may obtain a copy of the License at 10*24acc546SAndrew Rist * 11*24acc546SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*24acc546SAndrew Rist * 13*24acc546SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*24acc546SAndrew Rist * software distributed under the License is distributed on an 15*24acc546SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*24acc546SAndrew Rist * KIND, either express or implied. See the License for the 17*24acc546SAndrew Rist * specific language governing permissions and limitations 18*24acc546SAndrew Rist * under the License. 19*24acc546SAndrew Rist * 20*24acc546SAndrew Rist *************************************************************/ 21*24acc546SAndrew Rist 22*24acc546SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove 25cdf0e10cSrcweir #include "precompiled_forms.hxx" 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include "sal/config.h" 28cdf0e10cSrcweir 29cdf0e10cSrcweir #include "findpos.hxx" 30cdf0e10cSrcweir 31cdf0e10cSrcweir #include "com/sun/star/uno/Sequence.hxx" 32cdf0e10cSrcweir #include "comphelper/types.hxx" 33cdf0e10cSrcweir #include "rtl/ustring.hxx" 34cdf0e10cSrcweir #include "sal/types.h" 35cdf0e10cSrcweir 36cdf0e10cSrcweir #include <algorithm> 37cdf0e10cSrcweir 38cdf0e10cSrcweir namespace detail { 39cdf0e10cSrcweir 40cdf0e10cSrcweir sal_Int32 findPos( 41cdf0e10cSrcweir const ::rtl::OUString& aStr, 42cdf0e10cSrcweir const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rList) 43cdf0e10cSrcweir { 44cdf0e10cSrcweir const ::rtl::OUString* pStrList = rList.getConstArray(); 45cdf0e10cSrcweir const ::rtl::OUString* pResult = ::std::lower_bound( 46cdf0e10cSrcweir pStrList, pStrList + rList.getLength(), aStr ); 47cdf0e10cSrcweir if ( ( pResult != pStrList + rList.getLength() ) && ( *pResult == aStr ) ) 48cdf0e10cSrcweir return ( pResult - pStrList ); 49cdf0e10cSrcweir 50cdf0e10cSrcweir return -1; 51cdf0e10cSrcweir } 52cdf0e10cSrcweir 53cdf0e10cSrcweir } 54