diff options
author | Christian Lippka <cl@openoffice.org> | 2001-11-15 16:14:01 +0000 |
---|---|---|
committer | Christian Lippka <cl@openoffice.org> | 2001-11-15 16:14:01 +0000 |
commit | fa4d50f9248490c07ca77dcc889978e282b4f7d5 (patch) | |
tree | eceea1f04b5d2d3b46f4541e34443587552951a6 /xmloff | |
parent | 2740fc19284cefa8fdfa91c7d88b249e50fe7c0c (diff) |
#94550# added round corners for text boxes
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/draw/shapeexport2.cxx | 14 | ||||
-rw-r--r-- | xmloff/source/draw/ximpshap.cxx | 33 | ||||
-rw-r--r-- | xmloff/source/draw/ximpshap.hxx | 9 |
3 files changed, 50 insertions, 6 deletions
diff --git a/xmloff/source/draw/shapeexport2.cxx b/xmloff/source/draw/shapeexport2.cxx index 7249a506efd8..c4a63efadc61 100644 --- a/xmloff/source/draw/shapeexport2.cxx +++ b/xmloff/source/draw/shapeexport2.cxx @@ -2,9 +2,9 @@ * * $RCSfile: shapeexport2.cxx,v $ * - * $Revision: 1.25 $ + * $Revision: 1.26 $ * - * last change: $Author: mib $ $Date: 2001-09-20 14:20:24 $ + * last change: $Author: cl $ $Date: 2001-11-15 17:14:01 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -622,6 +622,16 @@ void XMLShapeExport::ImpExportTextBoxShape( // Transformation ImpExportNewTrans(xPropSet, nFeatures, pRefPoint); + // evtl. corner radius? + sal_Int32 nCornerRadius(0L); + xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("CornerRadius"))) >>= nCornerRadius; + if(nCornerRadius) + { + OUStringBuffer sStringBuffer; + rExport.GetMM100UnitConverter().convertMeasure(sStringBuffer, nCornerRadius); + rExport.AddAttribute(XML_NAMESPACE_DRAW, XML_CORNER_RADIUS, sStringBuffer.makeStringAndClear()); + } + if(bIsPresShape) bIsEmptyPresObj = ImpExportPresentationAttributes( xPropSet, aStr ); diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index a344479a13bc..f4a7e80f4704 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ximpshap.cxx,v $ * - * $Revision: 1.67 $ + * $Revision: 1.68 $ * - * last change: $Author: cl $ $Date: 2001-11-15 11:18:46 $ + * last change: $Author: cl $ $Date: 2001-11-15 17:14:01 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1388,6 +1388,23 @@ SdXMLTextBoxShapeContext::~SdXMLTextBoxShapeContext() ////////////////////////////////////////////////////////////////////////////// +// this is called from the parent group for each unparsed attribute in the attribute list +void SdXMLTextBoxShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue ) +{ + if( XML_NAMESPACE_DRAW == nPrefix ) + { + if( IsXMLToken( rLocalName, XML_CORNER_RADIUS ) ) + { + GetImport().GetMM100UnitConverter().convertMeasure(mnRadius, rValue); + return; + } + } + + SdXMLShapeContext::processAttribute( nPrefix, rLocalName, rValue ); +} + +////////////////////////////////////////////////////////////////////////////// + void SdXMLTextBoxShapeContext::StartElement(const uno::Reference< xml::sax::XAttributeList>& xAttrList) { // create textbox shape @@ -1468,6 +1485,18 @@ void SdXMLTextBoxShapeContext::StartElement(const uno::Reference< xml::sax::XAtt // set pos, size, shear and rotate SetTransformation(); + if(mnRadius) + { + uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY); + if(xPropSet.is()) + { + uno::Any aAny; + aAny <<= mnRadius; + xPropSet->setPropertyValue( + OUString(RTL_CONSTASCII_USTRINGPARAM("CornerRadius")), aAny); + } + } + SdXMLShapeContext::StartElement(xAttrList); } } diff --git a/xmloff/source/draw/ximpshap.hxx b/xmloff/source/draw/ximpshap.hxx index 9f2a84b5c020..4d8c0f3dc54b 100644 --- a/xmloff/source/draw/ximpshap.hxx +++ b/xmloff/source/draw/ximpshap.hxx @@ -2,9 +2,9 @@ * * $RCSfile: ximpshap.hxx,v $ * - * $Revision: 1.30 $ + * $Revision: 1.31 $ * - * last change: $Author: mib $ $Date: 2001-09-07 06:06:55 $ + * last change: $Author: cl $ $Date: 2001-11-15 17:14:01 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -298,6 +298,8 @@ public: class SdXMLTextBoxShapeContext : public SdXMLShapeContext { + sal_Int32 mnRadius; + public: TYPEINFO(); @@ -307,6 +309,9 @@ public: com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes); virtual ~SdXMLTextBoxShapeContext(); virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList); + + // this is called from the parent group for each unparsed attribute in the attribute list + virtual void processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue ); }; ////////////////////////////////////////////////////////////////////////////// |