LCOV - code coverage report
Current view: top level - xmloff/source/style - tabsthdl.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 23 27 85.2 %
Date: 2014-11-03 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       23184 : XMLTabStopPropHdl::~XMLTabStopPropHdl()
      31             : {
      32             :     // Nothing to do
      33       23184 : }
      34             : 
      35           2 : bool XMLTabStopPropHdl::equals( const uno::Any& r1, const uno::Any& r2 ) const
      36             : {
      37           2 :     bool bEqual = false;
      38             : 
      39           2 :     uno::Sequence< style::TabStop> aSeq1;
      40           2 :     if( r1 >>= aSeq1 )
      41             :     {
      42           2 :         uno::Sequence< style::TabStop> aSeq2;
      43           2 :         if( r2 >>= aSeq2 )
      44             :         {
      45           2 :             if( aSeq1.getLength() == aSeq2.getLength() )
      46             :             {
      47           2 :                 bEqual = true;
      48           2 :                 if( aSeq1.getLength() > 0 )
      49             :                 {
      50           2 :                     const style::TabStop* pTabs1 = aSeq1.getConstArray();
      51           2 :                     const style::TabStop* pTabs2 = aSeq2.getConstArray();
      52             : 
      53           2 :                     int i=0;
      54             : 
      55           2 :                     do
      56             :                     {
      57           4 :                         bEqual = ( pTabs1[i].Position == pTabs2[i].Position       &&
      58           4 :                                    pTabs1[i].Alignment == pTabs2[i].Alignment     &&
      59           6 :                                    pTabs1[i].DecimalChar == pTabs2[i].DecimalChar &&
      60           4 :                                    pTabs1[i].FillChar == pTabs2[i].FillChar );
      61           2 :                         i++;
      62             : 
      63           2 :                     } while( bEqual && i < aSeq1.getLength() );
      64             :                 }
      65             :             }
      66           2 :         }
      67             :     }
      68             : 
      69           2 :     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.10