2010-10-12 15:53:47 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-11-12 17:21:24 +00:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
#include <undlihdl.hxx>
|
2007-06-27 14:45:07 +00:00
|
|
|
#include <xmloff/xmltoken.hxx>
|
|
|
|
#include <xmloff/xmluconv.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <rtl/ustrbuf.hxx>
|
|
|
|
|
|
|
|
#include <com/sun/star/uno/Any.hxx>
|
2000-11-23 10:56:13 +00:00
|
|
|
#include <com/sun/star/awt/FontUnderline.hpp>
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
using namespace ::com::sun::star;
|
2000-11-23 10:56:13 +00:00
|
|
|
using namespace ::com::sun::star::awt;
|
2001-06-15 09:37:08 +00:00
|
|
|
using namespace ::xmloff::token;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2010-12-12 09:24:14 +01:00
|
|
|
SvXMLEnumMapEntry const pXML_UnderlineType_Enum[] =
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2012-07-02 13:58:52 +02:00
|
|
|
{ XML_NONE, awt::FontUnderline::NONE },
|
|
|
|
{ XML_SINGLE, awt::FontUnderline::SINGLE },
|
|
|
|
{ XML_DOUBLE, awt::FontUnderline::DOUBLE },
|
|
|
|
{ XML_SINGLE, awt::FontUnderline::DOTTED },
|
|
|
|
{ XML_SINGLE, awt::FontUnderline::DASH },
|
|
|
|
{ XML_SINGLE, awt::FontUnderline::LONGDASH },
|
|
|
|
{ XML_SINGLE, awt::FontUnderline::DASHDOT },
|
|
|
|
{ XML_SINGLE, awt::FontUnderline::DASHDOTDOT },
|
|
|
|
{ XML_SINGLE, awt::FontUnderline::WAVE },
|
|
|
|
{ XML_SINGLE, awt::FontUnderline::BOLD },
|
|
|
|
{ XML_SINGLE, awt::FontUnderline::BOLDDOTTED },
|
|
|
|
{ XML_SINGLE, awt::FontUnderline::BOLDDASH },
|
|
|
|
{ XML_SINGLE, awt::FontUnderline::BOLDLONGDASH },
|
|
|
|
{ XML_SINGLE, awt::FontUnderline::BOLDDASHDOT },
|
|
|
|
{ XML_SINGLE, awt::FontUnderline::BOLDDASHDOTDOT },
|
|
|
|
{ XML_SINGLE, awt::FontUnderline::BOLDWAVE },
|
|
|
|
{ XML_DOUBLE, awt::FontUnderline::DOUBLEWAVE },
|
|
|
|
{ XML_SINGLE, awt::FontUnderline::SMALLWAVE },
|
2001-06-15 09:37:08 +00:00
|
|
|
{ XML_TOKEN_INVALID, 0 }
|
2000-09-18 16:07:07 +00:00
|
|
|
};
|
|
|
|
|
2010-12-12 09:24:14 +01:00
|
|
|
SvXMLEnumMapEntry const pXML_UnderlineStyle_Enum[] =
|
2004-07-13 07:25:29 +00:00
|
|
|
{
|
2012-07-02 13:58:52 +02:00
|
|
|
{ XML_NONE, awt::FontUnderline::NONE },
|
|
|
|
{ XML_SOLID, awt::FontUnderline::SINGLE },
|
|
|
|
{ XML_SOLID, awt::FontUnderline::DOUBLE },
|
|
|
|
{ XML_DOTTED, awt::FontUnderline::DOTTED },
|
|
|
|
{ XML_DASH, awt::FontUnderline::DASH },
|
|
|
|
{ XML_LONG_DASH, awt::FontUnderline::LONGDASH },
|
|
|
|
{ XML_DOT_DASH, awt::FontUnderline::DASHDOT },
|
|
|
|
{ XML_DOT_DOT_DASH, awt::FontUnderline::DASHDOTDOT },
|
|
|
|
{ XML_WAVE, awt::FontUnderline::WAVE },
|
|
|
|
{ XML_SOLID, awt::FontUnderline::BOLD },
|
|
|
|
{ XML_DOTTED, awt::FontUnderline::BOLDDOTTED },
|
|
|
|
{ XML_DASH, awt::FontUnderline::BOLDDASH },
|
|
|
|
{ XML_LONG_DASH, awt::FontUnderline::BOLDLONGDASH },
|
|
|
|
{ XML_DOT_DASH, awt::FontUnderline::BOLDDASHDOT },
|
|
|
|
{ XML_DOT_DOT_DASH, awt::FontUnderline::BOLDDASHDOTDOT },
|
|
|
|
{ XML_WAVE, awt::FontUnderline::BOLDWAVE },
|
|
|
|
{ XML_WAVE, awt::FontUnderline::DOUBLEWAVE },
|
|
|
|
{ XML_SMALL_WAVE, awt::FontUnderline::SMALLWAVE },
|
2004-07-13 07:25:29 +00:00
|
|
|
{ XML_TOKEN_INVALID, 0 }
|
|
|
|
};
|
|
|
|
|
2010-12-12 09:24:14 +01:00
|
|
|
SvXMLEnumMapEntry const pXML_UnderlineWidth_Enum[] =
|
2004-07-13 07:25:29 +00:00
|
|
|
{
|
2012-07-02 13:58:52 +02:00
|
|
|
{ XML_AUTO, awt::FontUnderline::NONE },
|
|
|
|
{ XML_AUTO, awt::FontUnderline::SINGLE },
|
|
|
|
{ XML_AUTO, awt::FontUnderline::DOUBLE },
|
|
|
|
{ XML_AUTO, awt::FontUnderline::DOTTED },
|
|
|
|
{ XML_AUTO, awt::FontUnderline::DASH },
|
|
|
|
{ XML_AUTO, awt::FontUnderline::LONGDASH },
|
|
|
|
{ XML_AUTO, awt::FontUnderline::DASHDOT },
|
|
|
|
{ XML_AUTO, awt::FontUnderline::DASHDOTDOT },
|
|
|
|
{ XML_AUTO, awt::FontUnderline::WAVE },
|
|
|
|
{ XML_BOLD, awt::FontUnderline::BOLD },
|
|
|
|
{ XML_BOLD, awt::FontUnderline::BOLDDOTTED },
|
|
|
|
{ XML_BOLD, awt::FontUnderline::BOLDDASH },
|
|
|
|
{ XML_BOLD, awt::FontUnderline::BOLDLONGDASH },
|
|
|
|
{ XML_BOLD, awt::FontUnderline::BOLDDASHDOT },
|
|
|
|
{ XML_BOLD, awt::FontUnderline::BOLDDASHDOTDOT },
|
|
|
|
{ XML_BOLD, awt::FontUnderline::BOLDWAVE },
|
|
|
|
{ XML_AUTO, awt::FontUnderline::DOUBLEWAVE },
|
|
|
|
{ XML_THIN, awt::FontUnderline::NONE },
|
|
|
|
{ XML_MEDIUM, awt::FontUnderline::NONE },
|
|
|
|
{ XML_THICK, awt::FontUnderline::BOLD},
|
2004-07-13 07:25:29 +00:00
|
|
|
{ XML_TOKEN_INVALID, 0 }
|
|
|
|
};
|
|
|
|
|
2014-02-25 23:15:32 +01:00
|
|
|
|
2004-07-13 07:25:29 +00:00
|
|
|
// class XMLUnderlineTypePropHdl
|
2014-02-25 23:15:32 +01:00
|
|
|
|
2004-07-13 07:25:29 +00:00
|
|
|
|
|
|
|
XMLUnderlineTypePropHdl::~XMLUnderlineTypePropHdl()
|
|
|
|
{
|
|
|
|
// nothing to do
|
|
|
|
}
|
|
|
|
|
2013-09-16 15:06:48 +02:00
|
|
|
bool XMLUnderlineTypePropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& ) const
|
2004-07-13 07:25:29 +00:00
|
|
|
{
|
|
|
|
sal_uInt16 eNewUnderline;
|
2013-09-16 15:06:48 +02:00
|
|
|
bool bRet = SvXMLUnitConverter::convertEnum(
|
2006-10-12 13:51:43 +00:00
|
|
|
eNewUnderline, rStrImpValue, pXML_UnderlineType_Enum );
|
|
|
|
if( bRet )
|
2004-07-13 07:25:29 +00:00
|
|
|
{
|
|
|
|
// multi property: style and width might be set already.
|
|
|
|
// If the old value is NONE, the new is used unchanged.
|
2006-08-29 10:02:29 +00:00
|
|
|
sal_Int16 eUnderline = sal_Int16();
|
2012-07-02 13:58:52 +02:00
|
|
|
if( (rValue >>= eUnderline) && awt::FontUnderline::NONE!=eUnderline )
|
2004-07-13 07:25:29 +00:00
|
|
|
{
|
|
|
|
switch( eNewUnderline )
|
|
|
|
{
|
2012-07-02 13:58:52 +02:00
|
|
|
case awt::FontUnderline::NONE:
|
|
|
|
case awt::FontUnderline::SINGLE:
|
2004-07-13 07:25:29 +00:00
|
|
|
// keep existing line style
|
|
|
|
eNewUnderline = eUnderline;
|
|
|
|
break;
|
2012-07-02 13:58:52 +02:00
|
|
|
case awt::FontUnderline::DOUBLE:
|
2004-07-13 07:25:29 +00:00
|
|
|
// A double line style has priority over a bold line style,
|
|
|
|
// but not over the line style itself.
|
|
|
|
switch( eUnderline )
|
|
|
|
{
|
2012-07-02 13:58:52 +02:00
|
|
|
case awt::FontUnderline::SINGLE:
|
|
|
|
case awt::FontUnderline::BOLD:
|
2004-07-13 07:25:29 +00:00
|
|
|
break;
|
2012-07-02 13:58:52 +02:00
|
|
|
case awt::FontUnderline::WAVE:
|
|
|
|
case awt::FontUnderline::BOLDWAVE:
|
|
|
|
eNewUnderline = awt::FontUnderline::DOUBLEWAVE;
|
2004-07-13 07:25:29 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
// If a double line style is not supported for the existing
|
|
|
|
// value, keep the new one
|
|
|
|
eNewUnderline = eUnderline;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
OSL_ENSURE( bRet, "unexpected line type value" );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if( eNewUnderline != eUnderline )
|
|
|
|
rValue <<= (sal_Int16)eNewUnderline;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
rValue <<= (sal_Int16)eNewUnderline;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return bRet;
|
|
|
|
}
|
|
|
|
|
2013-09-16 15:06:48 +02:00
|
|
|
bool XMLUnderlineTypePropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& ) const
|
2004-07-13 07:25:29 +00:00
|
|
|
{
|
2013-09-16 15:06:48 +02:00
|
|
|
bool bRet = false;
|
2006-08-29 10:02:29 +00:00
|
|
|
sal_Int16 nValue = sal_Int16();
|
2004-07-13 07:25:29 +00:00
|
|
|
OUStringBuffer aOut;
|
|
|
|
|
|
|
|
if( (rValue >>= nValue) &&
|
2012-07-02 13:58:52 +02:00
|
|
|
(awt::FontUnderline::DOUBLE == nValue ||
|
|
|
|
awt::FontUnderline::DOUBLEWAVE == nValue) )
|
2004-07-13 07:25:29 +00:00
|
|
|
{
|
2006-10-12 13:51:43 +00:00
|
|
|
bRet = SvXMLUnitConverter::convertEnum(
|
|
|
|
aOut, (sal_uInt16)nValue, pXML_UnderlineType_Enum );
|
|
|
|
if( bRet )
|
2004-07-13 07:25:29 +00:00
|
|
|
rStrExpValue = aOut.makeStringAndClear();
|
|
|
|
}
|
|
|
|
|
|
|
|
return bRet;
|
|
|
|
}
|
|
|
|
|
2014-02-25 23:15:32 +01:00
|
|
|
|
2004-07-13 07:25:29 +00:00
|
|
|
// class XMLUnderlineStylePropHdl
|
2014-02-25 23:15:32 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-07-13 07:25:29 +00:00
|
|
|
XMLUnderlineStylePropHdl::~XMLUnderlineStylePropHdl()
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
// nothing to do
|
|
|
|
}
|
|
|
|
|
2013-09-16 15:06:48 +02:00
|
|
|
bool XMLUnderlineStylePropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& ) const
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2004-07-13 07:25:29 +00:00
|
|
|
sal_uInt16 eNewUnderline;
|
2013-09-16 15:06:48 +02:00
|
|
|
bool bRet = SvXMLUnitConverter::convertEnum(
|
2006-10-12 13:51:43 +00:00
|
|
|
eNewUnderline, rStrImpValue, pXML_UnderlineStyle_Enum );
|
|
|
|
if( bRet )
|
2004-07-13 07:25:29 +00:00
|
|
|
{
|
|
|
|
// multi property: style and width might be set already.
|
|
|
|
// If the old value is NONE, the new is used unchanged.
|
2006-08-29 10:02:29 +00:00
|
|
|
sal_Int16 eUnderline = sal_Int16();
|
2012-07-02 13:58:52 +02:00
|
|
|
if( (rValue >>= eUnderline) && awt::FontUnderline::NONE!=eUnderline )
|
2004-07-13 07:25:29 +00:00
|
|
|
{
|
|
|
|
switch( eNewUnderline )
|
|
|
|
{
|
2012-07-02 13:58:52 +02:00
|
|
|
case awt::FontUnderline::NONE:
|
|
|
|
case awt::FontUnderline::SINGLE:
|
2004-07-13 07:25:29 +00:00
|
|
|
// keep double or bold line style
|
|
|
|
eNewUnderline = eUnderline;
|
2012-07-02 13:58:52 +02:00
|
|
|
case awt::FontUnderline::DOTTED:
|
2004-07-13 07:25:29 +00:00
|
|
|
// The line style has priority over a double type.
|
2012-07-02 13:58:52 +02:00
|
|
|
if( awt::FontUnderline::BOLD == eUnderline )
|
|
|
|
eNewUnderline = awt::FontUnderline::BOLDDOTTED;
|
2004-07-13 07:25:29 +00:00
|
|
|
break;
|
2012-07-02 13:58:52 +02:00
|
|
|
case awt::FontUnderline::DASH:
|
|
|
|
if( awt::FontUnderline::BOLD == eUnderline )
|
|
|
|
eNewUnderline = awt::FontUnderline::BOLDDASH;
|
2004-07-13 07:25:29 +00:00
|
|
|
break;
|
2012-07-02 13:58:52 +02:00
|
|
|
case awt::FontUnderline::LONGDASH:
|
|
|
|
if( awt::FontUnderline::BOLD == eUnderline )
|
|
|
|
eNewUnderline = awt::FontUnderline::BOLDLONGDASH;
|
2004-07-13 07:25:29 +00:00
|
|
|
break;
|
2012-07-02 13:58:52 +02:00
|
|
|
case awt::FontUnderline::DASHDOT:
|
|
|
|
if( awt::FontUnderline::BOLD == eUnderline )
|
|
|
|
eNewUnderline = awt::FontUnderline::BOLDDASHDOT;
|
2004-07-13 07:25:29 +00:00
|
|
|
break;
|
2012-07-02 13:58:52 +02:00
|
|
|
case awt::FontUnderline::DASHDOTDOT:
|
|
|
|
if( awt::FontUnderline::BOLD == eUnderline )
|
|
|
|
eNewUnderline = awt::FontUnderline::BOLDDASHDOTDOT;
|
2004-07-13 07:25:29 +00:00
|
|
|
break;
|
2012-07-02 13:58:52 +02:00
|
|
|
case awt::FontUnderline::WAVE:
|
|
|
|
if( awt::FontUnderline::BOLD == eUnderline )
|
|
|
|
eNewUnderline = awt::FontUnderline::BOLDWAVE;
|
2004-07-13 07:25:29 +00:00
|
|
|
break;
|
2012-07-02 13:58:52 +02:00
|
|
|
case awt::FontUnderline::SMALLWAVE:
|
2004-07-13 07:25:29 +00:00
|
|
|
// SMALLWAVE is not used
|
|
|
|
default:
|
|
|
|
OSL_ENSURE( bRet, "unexpected line style value" );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if( eNewUnderline != eUnderline )
|
|
|
|
rValue <<= (sal_Int16)eNewUnderline;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
rValue <<= (sal_Int16)eNewUnderline;
|
|
|
|
}
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
return bRet;
|
|
|
|
}
|
|
|
|
|
2013-09-16 15:06:48 +02:00
|
|
|
bool XMLUnderlineStylePropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& ) const
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2013-09-16 15:06:48 +02:00
|
|
|
bool bRet = false;
|
2006-08-29 10:02:29 +00:00
|
|
|
sal_Int16 nValue = sal_Int16();
|
2000-09-18 16:07:07 +00:00
|
|
|
OUStringBuffer aOut;
|
|
|
|
|
|
|
|
if( rValue >>= nValue )
|
|
|
|
{
|
2006-10-12 13:51:43 +00:00
|
|
|
bRet = SvXMLUnitConverter::convertEnum(
|
|
|
|
aOut, (sal_uInt16)nValue, pXML_UnderlineStyle_Enum );
|
|
|
|
if( bRet )
|
2004-07-13 07:25:29 +00:00
|
|
|
rStrExpValue = aOut.makeStringAndClear();
|
|
|
|
}
|
|
|
|
|
|
|
|
return bRet;
|
|
|
|
}
|
|
|
|
|
2014-02-25 23:15:32 +01:00
|
|
|
|
2004-07-13 07:25:29 +00:00
|
|
|
// class XMLUnderlineWidthPropHdl
|
2014-02-25 23:15:32 +01:00
|
|
|
|
2004-07-13 07:25:29 +00:00
|
|
|
|
|
|
|
XMLUnderlineWidthPropHdl::~XMLUnderlineWidthPropHdl()
|
|
|
|
{
|
|
|
|
// nothing to do
|
|
|
|
}
|
|
|
|
|
2013-09-16 15:06:48 +02:00
|
|
|
bool XMLUnderlineWidthPropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& ) const
|
2004-07-13 07:25:29 +00:00
|
|
|
{
|
|
|
|
sal_uInt16 eNewUnderline;
|
2013-09-16 15:06:48 +02:00
|
|
|
bool bRet = SvXMLUnitConverter::convertEnum(
|
2006-10-12 13:51:43 +00:00
|
|
|
eNewUnderline, rStrImpValue, pXML_UnderlineWidth_Enum );
|
|
|
|
if( bRet )
|
2004-07-13 07:25:29 +00:00
|
|
|
{
|
|
|
|
// multi property: style and width might be set already.
|
|
|
|
// If the old value is NONE, the new is used unchanged.
|
2006-08-29 10:02:29 +00:00
|
|
|
sal_Int16 eUnderline = sal_Int16();
|
2012-07-02 13:58:52 +02:00
|
|
|
if( (rValue >>= eUnderline) && awt::FontUnderline::NONE!=eUnderline )
|
2004-07-13 07:25:29 +00:00
|
|
|
{
|
|
|
|
switch( eNewUnderline )
|
|
|
|
{
|
2012-07-02 13:58:52 +02:00
|
|
|
case awt::FontUnderline::NONE:
|
2004-07-13 07:25:29 +00:00
|
|
|
// keep existing line style
|
|
|
|
eNewUnderline = eUnderline;
|
|
|
|
break;
|
2012-07-02 13:58:52 +02:00
|
|
|
case awt::FontUnderline::BOLD:
|
2004-07-13 07:25:29 +00:00
|
|
|
// A double line style has priority over a bold line style,
|
|
|
|
// but not over the line style itself.
|
|
|
|
switch( eUnderline )
|
|
|
|
{
|
2012-07-02 13:58:52 +02:00
|
|
|
case awt::FontUnderline::SINGLE:
|
2004-07-13 07:25:29 +00:00
|
|
|
break;
|
2012-07-02 13:58:52 +02:00
|
|
|
case awt::FontUnderline::DOTTED:
|
|
|
|
eNewUnderline = awt::FontUnderline::BOLDDOTTED;
|
2004-07-13 07:25:29 +00:00
|
|
|
break;
|
2012-07-02 13:58:52 +02:00
|
|
|
case awt::FontUnderline::DASH:
|
|
|
|
eNewUnderline = awt::FontUnderline::BOLDDASH;
|
2004-07-13 07:25:29 +00:00
|
|
|
break;
|
2012-07-02 13:58:52 +02:00
|
|
|
case awt::FontUnderline::LONGDASH:
|
|
|
|
eNewUnderline = awt::FontUnderline::BOLDLONGDASH;
|
2004-07-13 07:25:29 +00:00
|
|
|
break;
|
2012-07-02 13:58:52 +02:00
|
|
|
case awt::FontUnderline::DASHDOT:
|
|
|
|
eNewUnderline = awt::FontUnderline::BOLDDASHDOT;
|
2004-07-13 07:25:29 +00:00
|
|
|
break;
|
2012-07-02 13:58:52 +02:00
|
|
|
case awt::FontUnderline::DASHDOTDOT:
|
|
|
|
eNewUnderline = awt::FontUnderline::BOLDDASHDOTDOT;
|
2004-07-13 07:25:29 +00:00
|
|
|
break;
|
2012-07-02 13:58:52 +02:00
|
|
|
case awt::FontUnderline::WAVE:
|
|
|
|
eNewUnderline = awt::FontUnderline::BOLDWAVE;
|
2004-07-13 07:25:29 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
// a doube line style overwrites a bold one
|
|
|
|
eNewUnderline = eUnderline;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
OSL_ENSURE( bRet, "unexpected line width value" );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if( eNewUnderline != eUnderline )
|
|
|
|
rValue <<= (sal_Int16)eNewUnderline;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
rValue <<= (sal_Int16)eNewUnderline;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return bRet;
|
|
|
|
}
|
|
|
|
|
2013-09-16 15:06:48 +02:00
|
|
|
bool XMLUnderlineWidthPropHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, const SvXMLUnitConverter& ) const
|
2004-07-13 07:25:29 +00:00
|
|
|
{
|
2013-09-16 15:06:48 +02:00
|
|
|
bool bRet = false;
|
2006-08-29 10:02:29 +00:00
|
|
|
sal_Int16 nValue = sal_Int16();
|
2004-07-13 07:25:29 +00:00
|
|
|
OUStringBuffer aOut;
|
|
|
|
|
2012-07-02 13:58:52 +02:00
|
|
|
if( (rValue >>= nValue) && (awt::FontUnderline::NONE != nValue) )
|
2004-07-13 07:25:29 +00:00
|
|
|
{
|
2006-10-12 13:51:43 +00:00
|
|
|
bRet = SvXMLUnitConverter::convertEnum(
|
|
|
|
aOut, (sal_uInt16)nValue, pXML_UnderlineWidth_Enum );
|
|
|
|
if( bRet )
|
2000-09-18 16:07:07 +00:00
|
|
|
rStrExpValue = aOut.makeStringAndClear();
|
|
|
|
}
|
|
|
|
|
|
|
|
return bRet;
|
|
|
|
}
|
|
|
|
|
2010-10-12 15:53:47 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|