xref: /trunk/main/xmloff/source/style/opaquhdl.cxx (revision 63bba73c)
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 "opaquhdl.hxx"
27 #include <com/sun/star/uno/Any.hxx>
28 #include <rtl/ustrbuf.hxx>
29 
30 // --
31 #include <xmloff/xmltoken.hxx>
32 #include <xmloff/xmluconv.hxx>
33 
34 using ::rtl::OUString;
35 using ::rtl::OUStringBuffer;
36 
37 using namespace ::com::sun::star::uno;
38 using namespace ::xmloff::token;
39 
40 
41 ///////////////////////////////////////////////////////////////////////////////
42 //
43 // class XMLOpaquePropHdl
44 //
45 
~XMLOpaquePropHdl()46 XMLOpaquePropHdl::~XMLOpaquePropHdl()
47 {
48 	// nothing to do
49 }
50 
importXML(const OUString & rStrImpValue,Any & rValue,const SvXMLUnitConverter &) const51 sal_Bool XMLOpaquePropHdl::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& ) const
52 {
53 	sal_Bool bRet = sal_True;
54 
55 	sal_Bool bValue = IsXMLToken( rStrImpValue, XML_OPAQUE_FOREGROUND );
56 	rValue <<= sal_Bool(bValue);
57 	bRet = sal_True;
58 
59 	return bRet;
60 }
61 
exportXML(OUString & rStrExpValue,const Any & rValue,const SvXMLUnitConverter &) const62 sal_Bool XMLOpaquePropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, const SvXMLUnitConverter& ) const
63 {
64 	sal_Bool bRet = sal_False;
65 	sal_Bool bValue = sal_Bool();
66 
67 	if (rValue >>= bValue)
68 	{
69 		if( bValue )
70 			rStrExpValue = GetXMLToken( XML_OPAQUE_FOREGROUND );
71 		else
72 			rStrExpValue = GetXMLToken( XML_OPAQUE_BACKGROUND );
73 
74 		bRet = sal_True;
75 	}
76 
77 	return bRet;
78 }
79