summaryrefslogtreecommitdiff
path: root/oox/source
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2008-06-20 05:55:29 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2008-06-20 05:55:29 +0000
commita36d56382b3be7fc9d8137b1d65b1391258b2cc1 (patch)
tree640e5ede7e0b7262fed620d44c2b7b96d87123c7 /oox/source
parent5b10a75f67a9bbe476aea179ee4952ad145fdd69 (diff)
INTEGRATION: CWS ooxtablefilter (1.3.2); FILE MERGED
2008/06/10 09:52:49 sj 1.3.2.2: RESYNC: (1.3-1.4); FILE MERGED 2008/03/28 20:21:27 sj 1.3.2.1: added table import
Diffstat (limited to 'oox/source')
-rw-r--r--oox/source/drawingml/shapestylecontext.cxx61
1 files changed, 6 insertions, 55 deletions
diff --git a/oox/source/drawingml/shapestylecontext.cxx b/oox/source/drawingml/shapestylecontext.cxx
index 104a2d269059..8d239795a3fe 100644
--- a/oox/source/drawingml/shapestylecontext.cxx
+++ b/oox/source/drawingml/shapestylecontext.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: shapestylecontext.cxx,v $
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
* This file is part of OpenOffice.org.
*
@@ -33,6 +33,7 @@
#include "oox/helper/attributelist.hxx"
#include "oox/core/namespaces.hxx"
#include "oox/drawingml/colorchoicecontext.hxx"
+#include "oox/drawingml/stylematrixreferencecontext.hxx"
#include "tokens.hxx"
using ::rtl::OUString;
@@ -42,56 +43,6 @@ using namespace ::com::sun::star::xml::sax;
namespace oox { namespace drawingml {
-// -------------------------
-// CT_StyleMatrixReference
-// -------------------------
-class StyleMatrixReferenceContext : public ContextHandler
-{
-public:
- StyleMatrixReferenceContext( ContextHandler& rParent, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs,
- const ShapeStyle eShapeStyle, Shape& rShape );
- ~StyleMatrixReferenceContext();
-
- virtual void SAL_CALL endFastElement( ::sal_Int32 Element ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
-
-protected:
- Shape& mrShape;
- ShapeStyle meShapeStyle;
- ColorPtr maColor;
-};
-
-StyleMatrixReferenceContext::StyleMatrixReferenceContext( ContextHandler& rParent,
- const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rxAttribs,
- const ShapeStyle eShapeStyle, Shape& rShape )
-: ContextHandler( rParent )
-, mrShape( rShape )
-, meShapeStyle( eShapeStyle )
-, maColor( new Color() )
-{
- mrShape.getShapeStylesIndex()[ meShapeStyle ] = rxAttribs->getOptionalValue( XML_idx );
-}
-
-StyleMatrixReferenceContext::~StyleMatrixReferenceContext()
-{
-
-}
-
-// --------------------------------------------------------------------
-
-void StyleMatrixReferenceContext::endFastElement( sal_Int32 ) throw (SAXException, RuntimeException)
-{
- mrShape.getShapeStylesColor()[ meShapeStyle ] = maColor;
-}
-
-// --------------------------------------------------------------------
-
-Reference< XFastContextHandler > StyleMatrixReferenceContext::createFastChildContext( sal_Int32 /* aElementToken */, const Reference< XFastAttributeList >& /* rxAttributes */ ) throw (SAXException, RuntimeException)
-{
- return new colorChoiceContext( *this, *maColor );
-}
-
// ---------------
// CT_ShapeStyle
// ---------------
@@ -120,16 +71,16 @@ Reference< XFastContextHandler > ShapeStyleContext::createFastChildContext( sal_
switch( aElementToken )
{
case NMSP_DRAWINGML|XML_lnRef : // CT_StyleMatrixReference
- xRet.set( new StyleMatrixReferenceContext( *this, rxAttributes, SHAPESTYLE_ln, mrShape ) );
+ xRet.set( new StyleMatrixReferenceContext( *this, rxAttributes, mrShape.getShapeStylesIndex()[ SHAPESTYLE_ln ], *mrShape.getShapeStylesColor()[ SHAPESTYLE_ln ].get() ) );
break;
case NMSP_DRAWINGML|XML_fillRef : // CT_StyleMatrixReference
- xRet.set( new StyleMatrixReferenceContext( *this, rxAttributes, SHAPESTYLE_fill, mrShape ) );
+ xRet.set( new StyleMatrixReferenceContext( *this, rxAttributes, mrShape.getShapeStylesIndex()[ SHAPESTYLE_fill ], *mrShape.getShapeStylesColor()[ SHAPESTYLE_fill ].get() ) );
break;
case NMSP_DRAWINGML|XML_effectRef : // CT_StyleMatrixReference
- xRet.set( new StyleMatrixReferenceContext( *this, rxAttributes, SHAPESTYLE_effect, mrShape ) );
+ xRet.set( new StyleMatrixReferenceContext( *this, rxAttributes, mrShape.getShapeStylesIndex()[ SHAPESTYLE_effect ], *mrShape.getShapeStylesColor()[ SHAPESTYLE_effect ].get() ) );
break;
case NMSP_DRAWINGML|XML_fontRef : // CT_FontReference
- xRet.set( new StyleMatrixReferenceContext( *this, rxAttributes, SHAPESTYLE_font, mrShape ) );
+ xRet.set( new StyleMatrixReferenceContext( *this, rxAttributes, mrShape.getShapeStylesIndex()[ SHAPESTYLE_font ], *mrShape.getShapeStylesColor()[ SHAPESTYLE_font ].get() ) );
break;
}
if ( !xRet.is() )