1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 // MARKER(update_precomp.py): autogen include statement, do not remove 25 #include "precompiled_xmloff.hxx" 26 #include <tabsthdl.hxx> 27 #include <com/sun/star/uno/Sequence.hxx> 28 #include <com/sun/star/style/TabStop.hpp> 29 30 using namespace ::com::sun::star; 31 32 /////////////////////////////////////////////////////////////////////////////// 33 // 34 // class XMLFontFamilyNamePropHdl 35 // 36 37 XMLTabStopPropHdl::~XMLTabStopPropHdl() 38 { 39 // Nothing to do 40 } 41 42 bool XMLTabStopPropHdl::equals( const uno::Any& r1, const uno::Any& r2 ) const 43 { 44 sal_Bool bEqual = sal_False; 45 46 uno::Sequence< style::TabStop> aSeq1; 47 if( r1 >>= aSeq1 ) 48 { 49 uno::Sequence< style::TabStop> aSeq2; 50 if( r2 >>= aSeq2 ) 51 { 52 if( aSeq1.getLength() == aSeq2.getLength() ) 53 { 54 bEqual = sal_True; 55 if( aSeq1.getLength() > 0 ) 56 { 57 const style::TabStop* pTabs1 = aSeq1.getConstArray(); 58 const style::TabStop* pTabs2 = aSeq2.getConstArray(); 59 60 int i=0; 61 62 do 63 { 64 bEqual = ( pTabs1[i].Position == pTabs2[i].Position && 65 pTabs1[i].Alignment == pTabs2[i].Alignment && 66 pTabs1[i].DecimalChar == pTabs2[i].DecimalChar && 67 pTabs1[i].FillChar == pTabs2[i].FillChar ); 68 i++; 69 70 } while( bEqual && i < aSeq1.getLength() ); 71 } 72 } 73 } 74 } 75 76 return bEqual; 77 } 78 79 sal_Bool XMLTabStopPropHdl::importXML( const ::rtl::OUString&, ::com::sun::star::uno::Any&, const SvXMLUnitConverter& ) const 80 { 81 return sal_False; 82 } 83 84 sal_Bool XMLTabStopPropHdl::exportXML( ::rtl::OUString&, const ::com::sun::star::uno::Any&, const SvXMLUnitConverter& ) const 85 { 86 return sal_False; 87 } 88 89