xref: /trunk/main/xmloff/source/style/tabsthdl.cxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_xmloff.hxx"
30 #include <tabsthdl.hxx>
31 #include <com/sun/star/uno/Sequence.hxx>
32 #include <com/sun/star/style/TabStop.hpp>
33 
34 using namespace ::com::sun::star;
35 
36 ///////////////////////////////////////////////////////////////////////////////
37 //
38 // class XMLFontFamilyNamePropHdl
39 //
40 
41 XMLTabStopPropHdl::~XMLTabStopPropHdl()
42 {
43 	// Nothing to do
44 }
45 
46 bool XMLTabStopPropHdl::equals( const uno::Any& r1, const uno::Any& r2 ) const
47 {
48 	sal_Bool bEqual = sal_False;
49 
50 	uno::Sequence< style::TabStop> aSeq1;
51 	if( r1 >>= aSeq1 )
52 	{
53 		uno::Sequence< style::TabStop> aSeq2;
54 		if( r2 >>= aSeq2 )
55 		{
56 			if( aSeq1.getLength() == aSeq2.getLength() )
57 			{
58 				bEqual = sal_True;
59 				if( aSeq1.getLength() > 0 )
60 				{
61 					const style::TabStop* pTabs1 = aSeq1.getConstArray();
62 					const style::TabStop* pTabs2 = aSeq2.getConstArray();
63 
64 					int i=0;
65 
66 					do
67 					{
68 						bEqual = ( pTabs1[i].Position == pTabs2[i].Position       &&
69 								   pTabs1[i].Alignment == pTabs2[i].Alignment     &&
70 								   pTabs1[i].DecimalChar == pTabs2[i].DecimalChar &&
71 								   pTabs1[i].FillChar == pTabs2[i].FillChar );
72 						i++;
73 
74 					} while( bEqual && i < aSeq1.getLength() );
75 				}
76 			}
77 		}
78 	}
79 
80 	return bEqual;
81 }
82 
83 sal_Bool XMLTabStopPropHdl::importXML( const ::rtl::OUString&, ::com::sun::star::uno::Any&, const SvXMLUnitConverter& ) const
84 {
85 	return sal_False;
86 }
87 
88 sal_Bool XMLTabStopPropHdl::exportXML( ::rtl::OUString&, const ::com::sun::star::uno::Any&, const SvXMLUnitConverter& ) const
89 {
90 	return sal_False;
91 }
92 
93