Files
libreoffice/xmloff/source/style/opaquhdl.cxx

86 lines
2.5 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2000-09-18 16:07:07 +00:00
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2000-09-18 16:07:07 +00:00
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
2000-09-18 16:07:07 +00:00
*
* OpenOffice.org - a multi-platform office productivity suite
2000-09-18 16:07:07 +00:00
*
* This file is part of OpenOffice.org.
2000-09-18 16:07:07 +00:00
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
2000-09-18 16:07:07 +00:00
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
2000-09-18 16:07:07 +00:00
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
2000-09-18 16:07:07 +00:00
*
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_xmloff.hxx"
2000-09-18 16:07:07 +00:00
#include "opaquhdl.hxx"
#include <com/sun/star/uno/Any.hxx>
#include <rtl/ustrbuf.hxx>
// --
#include <xmloff/xmltoken.hxx>
#include <xmloff/xmluconv.hxx>
2000-09-18 16:07:07 +00:00
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
2000-09-18 16:07:07 +00:00
using namespace ::com::sun::star::uno;
using namespace ::xmloff::token;
2000-09-18 16:07:07 +00:00
///////////////////////////////////////////////////////////////////////////////
//
// class XMLOpaquePropHdl
//
XMLOpaquePropHdl::~XMLOpaquePropHdl()
{
// nothing to do
}
sal_Bool XMLOpaquePropHdl::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& ) const
2000-09-18 16:07:07 +00:00
{
sal_Bool bRet = sal_True;
sal_Bool bValue = IsXMLToken( rStrImpValue, XML_OPAQUE_FOREGROUND );
2000-09-18 16:07:07 +00:00
rValue <<= sal_Bool(bValue);
bRet = sal_True;
return bRet;
}
sal_Bool XMLOpaquePropHdl::exportXML( OUString& rStrExpValue, const Any& rValue, const SvXMLUnitConverter& ) const
2000-09-18 16:07:07 +00:00
{
sal_Bool bRet = sal_False;
sal_Bool bValue = sal_Bool();
2000-09-18 16:07:07 +00:00
if (rValue >>= bValue)
{
if( bValue )
rStrExpValue = GetXMLToken( XML_OPAQUE_FOREGROUND );
2000-09-18 16:07:07 +00:00
else
rStrExpValue = GetXMLToken( XML_OPAQUE_BACKGROUND );
2000-09-18 16:07:07 +00:00
bRet = sal_True;
}
return bRet;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */