LCOV - code coverage report
Current view: top level - dbaccess/source/ui/misc - stringlistitem.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 3 19 15.8 %
Date: 2012-08-25 Functions: 1 9 11.1 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 1 24 4.2 %

           Branch data     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                 :            : 
      20                 :            : 
      21                 :            : #include "stringlistitem.hxx"
      22                 :            : 
      23                 :            : //.........................................................................
      24                 :            : namespace dbaui
      25                 :            : {
      26                 :            : //.........................................................................
      27                 :            : 
      28                 :            : using namespace ::com::sun::star::uno;
      29                 :            : 
      30                 :            : //=========================================================================
      31                 :            : //= OStringListItem
      32                 :            : //=========================================================================
      33 [ #  # ][ #  # ]:          0 : TYPEINIT1(OStringListItem, SfxPoolItem);
      34                 :            : //-------------------------------------------------------------------------
      35                 :          4 : OStringListItem::OStringListItem(sal_Int16 _nWhich, const Sequence< ::rtl::OUString >& _rList)
      36                 :            :     :SfxPoolItem(_nWhich)
      37         [ +  - ]:          4 :     ,m_aList(_rList)
      38                 :            : {
      39                 :          4 : }
      40                 :            : 
      41                 :            : //-------------------------------------------------------------------------
      42                 :          0 : OStringListItem::OStringListItem(const OStringListItem& _rSource)
      43                 :            :     :SfxPoolItem(_rSource)
      44         [ #  # ]:          0 :     ,m_aList(_rSource.m_aList)
      45                 :            : {
      46                 :          0 : }
      47                 :            : 
      48                 :            : //-------------------------------------------------------------------------
      49                 :          0 : int OStringListItem::operator==(const SfxPoolItem& _rItem) const
      50                 :            : {
      51 [ #  # ][ #  # ]:          0 :     const OStringListItem* pCompare = PTR_CAST(OStringListItem, &_rItem);
      52 [ #  # ][ #  # ]:          0 :     if ((!pCompare) || (pCompare->m_aList.getLength() != m_aList.getLength()))
                 [ #  # ]
      53                 :          0 :         return 0;
      54                 :            : 
      55                 :            :     // compare all strings individually
      56                 :          0 :     const ::rtl::OUString* pMyStrings = m_aList.getConstArray();
      57                 :          0 :     const ::rtl::OUString* pCompareStrings = pCompare->m_aList.getConstArray();
      58                 :            : 
      59         [ #  # ]:          0 :     for (sal_Int32 i=0; i<m_aList.getLength(); ++i, ++pMyStrings, ++pCompareStrings)
      60         [ #  # ]:          0 :         if (!pMyStrings->equals(*pCompareStrings))
      61                 :          0 :             return 0;
      62                 :            : 
      63                 :          0 :     return 1;
      64                 :            : }
      65                 :            : 
      66                 :            : //-------------------------------------------------------------------------
      67                 :          0 : SfxPoolItem* OStringListItem::Clone(SfxItemPool* /* _pPool */) const
      68                 :            : {
      69         [ #  # ]:          0 :     return new OStringListItem(*this);
      70                 :            : }
      71                 :            : 
      72                 :            : //.........................................................................
      73                 :            : }   // namespace dbaui
      74                 :            : //.........................................................................
      75                 :            : 
      76                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10