diff options
author | Michael Brauer <mib@openoffice.org> | 2000-10-30 11:47:14 +0000 |
---|---|---|
committer | Michael Brauer <mib@openoffice.org> | 2000-10-30 11:47:14 +0000 |
commit | 9ab05af86c2babeec833cba521b0515d34169bc0 (patch) | |
tree | 3e3a8409732b46c0f9195621204c0bc9f8389d4e /xmloff/source/text/XMLTextColumnsExport.cxx | |
parent | 8f7d7e81818e1a71d1059248a53ce40296a8c78f (diff) |
#79763#: column separator line
Diffstat (limited to 'xmloff/source/text/XMLTextColumnsExport.cxx')
-rw-r--r-- | xmloff/source/text/XMLTextColumnsExport.cxx | 76 |
1 files changed, 73 insertions, 3 deletions
diff --git a/xmloff/source/text/XMLTextColumnsExport.cxx b/xmloff/source/text/XMLTextColumnsExport.cxx index 3eab434158dc..2b398b6403fe 100644 --- a/xmloff/source/text/XMLTextColumnsExport.cxx +++ b/xmloff/source/text/XMLTextColumnsExport.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLTextColumnsExport.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: mib $ $Date: 2000-09-21 14:07:40 $ + * last change: $Author: mib $ $Date: 2000-10-30 12:47:14 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -74,6 +74,13 @@ #ifndef _COM_SUN_STAR_TEXT_TEXTCOLUMN_HPP_ #include <com/sun/star/text/TextColumn.hpp> #endif +#ifndef _COM_SUN_STAR_STYLE_VERTICALALIGNMENT_HPP_ +#include <com/sun/star/style/VerticalAlignment.hpp> +#endif +#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ +#include <com/sun/star/beans/XPropertySet.hpp> +#endif + #ifndef _XMLOFF_XMLKYWD_HXX #include "xmlkywd.hxx" @@ -95,11 +102,17 @@ using namespace ::com::sun::star::style; using namespace ::com::sun::star::text; using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::beans; using namespace ::rtl; XMLTextColumnsExport::XMLTextColumnsExport( SvXMLExport& rExp ) : - rExport( rExp ) + rExport( rExp ), + sSeparatorLineIsOn(RTL_CONSTASCII_USTRINGPARAM("SeparatorLineIsOn")), + sSeparatorLineWidth(RTL_CONSTASCII_USTRINGPARAM("SeparatorLineWidth")), + sSeparatorLineColor(RTL_CONSTASCII_USTRINGPARAM("SeparatorLineColor")), + sSeparatorLineRelativeHeight(RTL_CONSTASCII_USTRINGPARAM("SeparatorLineRelativeHeight")), + sSeparatorLineVerticalAlignment(RTL_CONSTASCII_USTRINGPARAM("SeparatorLineVerticalAlignment")) { } @@ -119,6 +132,63 @@ void XMLTextColumnsExport::exportXML( const Any& rAny ) SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE, sXML_columns, sal_True, sal_True ); + Reference < XPropertySet > xPropSet( xColumns, UNO_QUERY ); + if( xPropSet.is() ) + { + Any aAny = xPropSet->getPropertyValue( sSeparatorLineIsOn ); + if( *(sal_Bool *)aAny.getValue() ) + { + // style:width + aAny = xPropSet->getPropertyValue( sSeparatorLineWidth ); + sal_Int32 nWidth; + aAny >>= nWidth; + GetExport().GetMM100UnitConverter().convertMeasure( sValue, + nWidth ); + GetExport().AddAttribute( XML_NAMESPACE_STYLE, sXML_width, + sValue.makeStringAndClear() ); + + // style:color + aAny = xPropSet->getPropertyValue( sSeparatorLineColor ); + sal_Int32 nColor; + aAny >>= nColor; + GetExport().GetMM100UnitConverter().convertColor( sValue, + nColor ); + GetExport().AddAttribute( XML_NAMESPACE_STYLE, sXML_color, + sValue.makeStringAndClear() ); + + // style:height + aAny = xPropSet->getPropertyValue( sSeparatorLineRelativeHeight ); + sal_Int8 nHeight; + aAny >>= nHeight; + GetExport().GetMM100UnitConverter().convertPercent( sValue, + nHeight ); + GetExport().AddAttribute( XML_NAMESPACE_STYLE, sXML_height, + sValue.makeStringAndClear() ); + + // style:vertical-align + aAny = xPropSet->getPropertyValue( sSeparatorLineVerticalAlignment ); + VerticalAlignment eVertAlign; + aAny >>= eVertAlign; + + sal_Char *pStr = 0; + switch( eVertAlign ) + { +// case VerticalAlignment_TOP: pStr = sXML_top; + case VerticalAlignment_MIDDLE: pStr = sXML_middle; break; + case VerticalAlignment_BOTTOM: pStr = sXML_bottom; break; + } + + if( pStr ) + GetExport().AddAttributeASCII( XML_NAMESPACE_STYLE, + sXML_vertical_align, pStr ); + + // style:column-sep + SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE, + sXML_column_sep, + sal_True, sal_True ); + } + } + while( nCount-- ) { // style:rel-width |