LCOV - code coverage report
Current view: top level - xmloff/source/style - tabsthdl.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 23 27 85.2 %
Date: 2015-06-13 12:38:46 Functions: 3 5 60.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             : 
      20             : #include <tabsthdl.hxx>
      21             : #include <com/sun/star/uno/Sequence.hxx>
      22             : #include <com/sun/star/style/TabStop.hpp>
      23             : 
      24             : using namespace ::com::sun::star;
      25             : 
      26             : 
      27             : // class XMLFontFamilyNamePropHdl
      28             : 
      29             : 
      30       15130 : XMLTabStopPropHdl::~XMLTabStopPropHdl()
      31             : {
      32             :     // Nothing to do
      33       15130 : }
      34             : 
      35          25 : bool XMLTabStopPropHdl::equals( const uno::Any& r1, const uno::Any& r2 ) const
      36             : {
      37          25 :     bool bEqual = false;
      38             : 
      39          25 :     uno::Sequence< style::TabStop> aSeq1;
      40          25 :     if( r1 >>= aSeq1 )
      41             :     {
      42          25 :         uno::Sequence< style::TabStop> aSeq2;
      43          25 :         if( r2 >>= aSeq2 )
      44             :         {
      45          25 :             if( aSeq1.getLength() == aSeq2.getLength() )
      46             :             {
      47          25 :                 bEqual = true;
      48          25 :                 if( aSeq1.getLength() > 0 )
      49             :                 {
      50          25 :                     const style::TabStop* pTabs1 = aSeq1.getConstArray();
      51          25 :                     const style::TabStop* pTabs2 = aSeq2.getConstArray();
      52             : 
      53          25 :                     int i=0;
      54             : 
      55          33 :                     do
      56             :                     {
      57          66 :                         bEqual = ( pTabs1[i].Position == pTabs2[i].Position       &&
      58          66 :                                    pTabs1[i].Alignment == pTabs2[i].Alignment     &&
      59          99 :                                    pTabs1[i].DecimalChar == pTabs2[i].DecimalChar &&
      60          66 :                                    pTabs1[i].FillChar == pTabs2[i].FillChar );
      61          33 :                         i++;
      62             : 
      63          33 :                     } while( bEqual && i < aSeq1.getLength() );
      64             :                 }
      65             :             }
      66          25 :         }
      67             :     }
      68             : 
      69          25 :     return bEqual;
      70             : }
      71             : 
      72           0 : bool XMLTabStopPropHdl::importXML( const OUString&, ::com::sun::star::uno::Any&, const SvXMLUnitConverter& ) const
      73             : {
      74           0 :     return false;
      75             : }
      76             : 
      77           0 : bool XMLTabStopPropHdl::exportXML( OUString&, const ::com::sun::star::uno::Any&, const SvXMLUnitConverter& ) const
      78             : {
      79           0 :     return false;
      80             : }
      81             : 
      82             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11