[Libreoffice-commits] .: 10 commits - oox/inc oox/source
Radek DoulÃk
rodo at kemper.freedesktop.org
Fri Oct 8 06:49:37 PDT 2010
oox/inc/oox/drawingml/shape.hxx | 9
oox/inc/oox/drawingml/textbody.hxx | 2
oox/inc/oox/ppt/pptgraphicshapecontext.hxx | 49 +++
oox/inc/oox/ppt/pptshape.hxx | 5
oox/inc/oox/ppt/slidetransition.hxx | 3
oox/source/drawingml/customshapegeometry.cxx | 2
oox/source/drawingml/customshapeproperties.cxx | 5
oox/source/drawingml/shape.cxx | 66 +---
oox/source/drawingml/shapecontext.cxx | 3
oox/source/drawingml/shapegroupcontext.cxx | 3
oox/source/drawingml/textbody.cxx | 8
oox/source/drawingml/textbodypropertiescontext.cxx | 59 ++-
oox/source/drawingml/textcharacterpropertiescontext.cxx | 2
oox/source/drawingml/transform2dcontext.cxx | 5
oox/source/ppt/makefile.mk | 1
oox/source/ppt/pptgraphicshapecontext.cxx | 239 ++++++++++++++++
oox/source/ppt/pptshape.cxx | 26 +
oox/source/ppt/pptshapecontext.cxx | 6
oox/source/ppt/pptshapegroupcontext.cxx | 6
oox/source/ppt/slidetransition.cxx | 8
oox/source/ppt/slidetransitioncontext.cxx | 7
oox/source/token/properties.txt | 2
22 files changed, 426 insertions(+), 90 deletions(-)
New commits:
commit d7acb2418f55cf71901a8fd6616553c4d30f0ff5
Author: Radek Doulik <rodo at novell.com>
Date: Fri Oct 8 15:02:02 2010 +0200
oox-pptx-import-fix-text-body-properties.diff: fix textbody properties.
n#621744
diff --git a/oox/inc/oox/drawingml/textbody.hxx b/oox/inc/oox/drawingml/textbody.hxx
index 40dc349..c2b28f1 100644
--- a/oox/inc/oox/drawingml/textbody.hxx
+++ b/oox/inc/oox/drawingml/textbody.hxx
@@ -29,6 +29,7 @@
#define OOX_DRAWINGML_TEXTBODY_HXX
#include "oox/helper/containerhelper.hxx"
+#include "oox/drawingml/drawingmltypes.hxx"
#include "oox/drawingml/textbodyproperties.hxx"
#include "oox/drawingml/textliststyle.hxx"
@@ -48,6 +49,7 @@ class TextBody
{
public:
TextBody();
+ TextBody( TextBodyPtr pBody );
~TextBody();
inline const TextParagraphVector& getParagraphs() const { return maParagraphs; }
diff --git a/oox/source/drawingml/textbody.cxx b/oox/source/drawingml/textbody.cxx
index 60518f7..9f19f02 100644
--- a/oox/source/drawingml/textbody.cxx
+++ b/oox/source/drawingml/textbody.cxx
@@ -42,6 +42,14 @@ TextBody::TextBody()
{
}
+TextBody::TextBody( TextBodyPtr pBody )
+{
+ if( pBody.get() ) {
+ maTextProperties = pBody->maTextProperties;
+ maTextListStyle = pBody->maTextListStyle;
+ }
+}
+
TextBody::~TextBody()
{
}
diff --git a/oox/source/ppt/pptshapecontext.cxx b/oox/source/ppt/pptshapecontext.cxx
index f3f8ba8..bd5aff5 100644
--- a/oox/source/ppt/pptshapecontext.cxx
+++ b/oox/source/ppt/pptshapecontext.cxx
@@ -203,7 +203,7 @@ Reference< XFastContextHandler > PPTShapeContext::createFastChildContext( sal_In
case NMSP_PPT|XML_txBody:
{
- oox::drawingml::TextBodyPtr xTextBody( new oox::drawingml::TextBody );
+ oox::drawingml::TextBodyPtr xTextBody( new oox::drawingml::TextBody( mpShapePtr->getTextBody() ) );
xTextBody->getTextProperties().maPropertyMap[ PROP_FontIndependentLineSpacing ] <<= static_cast< sal_Bool >( sal_True );
mpShapePtr->setTextBody( xTextBody );
xRet = new oox::drawingml::TextBodyContext( *this, *xTextBody );
commit ae47c6aa2d320923a99819f78bf3502e5bd5d794
Author: Radek Doulik <rodo at novell.com>
Date: Fri Oct 8 15:00:50 2010 +0200
oox-pptx-import-fix-placeholder-text-style.diff: fix placeholders style.
n#592906, n#479834
diff --git a/oox/source/drawingml/shapecontext.cxx b/oox/source/drawingml/shapecontext.cxx
index 2f6afe0..0000c3a 100644
--- a/oox/source/drawingml/shapecontext.cxx
+++ b/oox/source/drawingml/shapecontext.cxx
@@ -95,7 +95,8 @@ Reference< XFastContextHandler > ShapeContext::createFastChildContext( sal_Int32
}
case XML_ph:
mpShapePtr->setSubType( xAttribs->getOptionalValueToken( XML_type, XML_obj ) );
- mpShapePtr->setSubTypeIndex( xAttribs->getOptionalValue( XML_idx ).toInt32() );
+ if( xAttribs->hasAttribute( XML_idx ) )
+ mpShapePtr->setSubTypeIndex( xAttribs->getOptionalValue( XML_idx ).toInt32() );
break;
// nvSpPr CT_ShapeNonVisual end
diff --git a/oox/source/drawingml/shapegroupcontext.cxx b/oox/source/drawingml/shapegroupcontext.cxx
index 4a0251e..e6e17e2 100644
--- a/oox/source/drawingml/shapegroupcontext.cxx
+++ b/oox/source/drawingml/shapegroupcontext.cxx
@@ -80,7 +80,8 @@ Reference< XFastContextHandler > ShapeGroupContext::createFastChildContext( sal_
}
case XML_ph:
mpGroupShapePtr->setSubType( xAttribs->getOptionalValueToken( XML_type, FastToken::DONTKNOW ) );
- mpGroupShapePtr->setSubTypeIndex( xAttribs->getOptionalValue( XML_idx ).toInt32() );
+ if( xAttribs->hasAttribute( XML_idx ) )
+ mpGroupShapePtr->setSubTypeIndex( xAttribs->getOptionalValue( XML_idx ).toInt32() );
break;
// nvSpPr CT_ShapeNonVisual end
diff --git a/oox/source/drawingml/textbodypropertiescontext.cxx b/oox/source/drawingml/textbodypropertiescontext.cxx
index d05f126..96c45ea 100644
--- a/oox/source/drawingml/textbodypropertiescontext.cxx
+++ b/oox/source/drawingml/textbodypropertiescontext.cxx
@@ -89,23 +89,26 @@ TextBodyPropertiesContext::TextBodyPropertiesContext( ContextHandler& rParent,
}
// ST_TextAnchoringType
- drawing::TextVerticalAdjust eVA( drawing::TextVerticalAdjust_TOP );
- switch( xAttributes->getOptionalValueToken( XML_anchor, XML_t ) )
- {
- case XML_b : eVA = drawing::TextVerticalAdjust_BOTTOM; break;
- case XML_dist :
- case XML_just :
- case XML_ctr : eVA = drawing::TextVerticalAdjust_CENTER; break;
- default:
- case XML_t : eVA = drawing::TextVerticalAdjust_TOP; break;
+ if( xAttributes->hasAttribute( XML_anchor ) ) {
+ drawing::TextVerticalAdjust eVA( drawing::TextVerticalAdjust_TOP );
+ switch( xAttributes->getOptionalValueToken( XML_anchor, XML_t ) )
+ {
+ case XML_b : eVA = drawing::TextVerticalAdjust_BOTTOM; break;
+ case XML_dist :
+ case XML_just :
+ case XML_ctr : eVA = drawing::TextVerticalAdjust_CENTER; break;
+ default:
+ case XML_t : eVA = drawing::TextVerticalAdjust_TOP; break;
+ }
+ mrTextBodyProp.maPropertyMap[ PROP_TextVerticalAdjust ] <<= eVA;
}
- mrTextBodyProp.maPropertyMap[ PROP_TextVerticalAdjust ] <<= eVA;
bool bAnchorCenter = aAttribs.getBool( XML_anchorCtr, false );
- if( bAnchorCenter )
- mrTextBodyProp.maPropertyMap[ PROP_TextHorizontalAdjust ] <<=
- TextHorizontalAdjust_CENTER;
-
+ if( xAttributes->hasAttribute( XML_anchorCtr ) ) {
+ if( bAnchorCenter )
+ mrTextBodyProp.maPropertyMap[ PROP_TextHorizontalAdjust ] <<=
+ TextHorizontalAdjust_CENTER;
+ }
// bool bCompatLineSpacing = aAttribs.getBool( XML_compatLnSpc, false );
// bool bForceAA = aAttribs.getBool( XML_forceAA, false );
// bool bFromWordArt = aAttribs.getBool( XML_fromWordArt, false );
@@ -128,19 +131,21 @@ TextBodyPropertiesContext::TextBodyPropertiesContext( ContextHandler& rParent,
// bool bUpRight = aAttribs.getBool( XML_upright, 0 );
// ST_TextVerticalType
- mrTextBodyProp.moVert = aAttribs.getToken( XML_vert );
- bool bRtl = aAttribs.getBool( XML_rtl, false );
- sal_Int32 tVert = mrTextBodyProp.moVert.get( XML_horz );
- if( tVert == XML_vert || tVert == XML_eaVert || tVert == XML_vert270 || tVert == XML_mongolianVert ) {
- mrTextBodyProp.maPropertyMap[ PROP_TextWritingMode ]
- <<= WritingMode_TB_RL;
- // workaround for TB_LR as using WritingMode2 doesn't work
- if( !bAnchorCenter )
- mrTextBodyProp.maPropertyMap[ PROP_TextHorizontalAdjust ] <<=
- TextHorizontalAdjust_LEFT;
- } else
- mrTextBodyProp.maPropertyMap[ PROP_TextWritingMode ]
- <<= ( bRtl ? WritingMode_RL_TB : WritingMode_LR_TB );
+ if( xAttributes->hasAttribute( XML_vert ) ) {
+ mrTextBodyProp.moVert = aAttribs.getToken( XML_vert );
+ bool bRtl = aAttribs.getBool( XML_rtl, false );
+ sal_Int32 tVert = mrTextBodyProp.moVert.get( XML_horz );
+ if( tVert == XML_vert || tVert == XML_eaVert || tVert == XML_vert270 || tVert == XML_mongolianVert ) {
+ mrTextBodyProp.maPropertyMap[ PROP_TextWritingMode ]
+ <<= WritingMode_TB_RL;
+ // workaround for TB_LR as using WritingMode2 doesn't work
+ if( !bAnchorCenter )
+ mrTextBodyProp.maPropertyMap[ PROP_TextHorizontalAdjust ] <<=
+ TextHorizontalAdjust_LEFT;
+ } else
+ mrTextBodyProp.maPropertyMap[ PROP_TextWritingMode ]
+ <<= ( bRtl ? WritingMode_RL_TB : WritingMode_LR_TB );
+ }
}
// --------------------------------------------------------------------
diff --git a/oox/source/ppt/pptgraphicshapecontext.cxx b/oox/source/ppt/pptgraphicshapecontext.cxx
index e89caf2..6bdf767 100644
--- a/oox/source/ppt/pptgraphicshapecontext.cxx
+++ b/oox/source/ppt/pptgraphicshapecontext.cxx
@@ -132,7 +132,8 @@ Reference< XFastContextHandler > PPTGraphicShapeContext::createFastChildContext(
OUString sIdx( xAttribs->getOptionalValue( XML_idx ) );
sal_Bool bHasIdx = sIdx.getLength() > 0;
sal_Int32 nIdx = sIdx.toInt32();
- mpShapePtr->setSubTypeIndex( nIdx );
+ if( xAttribs->hasAttribute( XML_idx ) )
+ mpShapePtr->setSubTypeIndex( nIdx );
if ( nSubType || bHasIdx )
{
diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx
index d8cd3eb..88f6595 100644
--- a/oox/source/ppt/pptshape.cxx
+++ b/oox/source/ppt/pptshape.cxx
@@ -170,7 +170,11 @@ void PPTShape::addShape(
}
}
-/*
+ OSL_TRACE("shape service: %s", rtl::OUStringToOString(sServiceName, RTL_TEXTENCODING_UTF8 ).getStr());
+
+ if( mnSubType && aMasterTextListStyle && getSubTypeIndex() != -1 )
+ aMasterTextListStyle.reset();
+
// use placeholder index if possible
if( mnSubType && getSubTypeIndex() && rSlidePersist.getMasterPersist().get() ) {
oox::drawingml::ShapePtr pPlaceholder = PPTShape::findPlaceholderByIndex( getSubTypeIndex(), rSlidePersist.getMasterPersist()->getShapes()->getChildren() );
@@ -184,7 +188,7 @@ void PPTShape::addShape(
aMasterTextListStyle = pNewTextListStyle;
}
}
-*/
+
if ( sServiceName.getLength() )
{
// use style from master slide for placeholders only, otherwise use slide's style, which might be the default style from presentation
diff --git a/oox/source/ppt/pptshapecontext.cxx b/oox/source/ppt/pptshapecontext.cxx
index b6e0dc7..f3f8ba8 100644
--- a/oox/source/ppt/pptshapecontext.cxx
+++ b/oox/source/ppt/pptshapecontext.cxx
@@ -116,7 +116,8 @@ Reference< XFastContextHandler > PPTShapeContext::createFastChildContext( sal_In
{
sal_Int32 nSubType( xAttribs->getOptionalValueToken( XML_type, XML_obj ) );
mpShapePtr->setSubType( nSubType );
- mpShapePtr->setSubTypeIndex( xAttribs->getOptionalValue( XML_idx ).toInt32() );
+ if( xAttribs->hasAttribute( XML_idx ) )
+ mpShapePtr->setSubTypeIndex( xAttribs->getOptionalValue( XML_idx ).toInt32() );
if ( nSubType )
{
PPTShape* pPPTShapePtr = dynamic_cast< PPTShape* >( mpShapePtr.get() );
diff --git a/oox/source/ppt/pptshapegroupcontext.cxx b/oox/source/ppt/pptshapegroupcontext.cxx
index 4ed5ee1..ea2319b 100644
--- a/oox/source/ppt/pptshapegroupcontext.cxx
+++ b/oox/source/ppt/pptshapegroupcontext.cxx
@@ -82,7 +82,8 @@ Reference< XFastContextHandler > PPTShapeGroupContext::createFastChildContext( s
}
case NMSP_PPT|XML_ph:
mpGroupShapePtr->setSubType( xAttribs->getOptionalValueToken( XML_type, FastToken::DONTKNOW ) );
- mpGroupShapePtr->setSubTypeIndex( xAttribs->getOptionalValue( XML_idx ).toInt32() );
+ if( xAttribs->hasAttribute( XML_idx ) )
+ mpGroupShapePtr->setSubTypeIndex( xAttribs->getOptionalValue( XML_idx ).toInt32() );
break;
// nvSpPr CT_ShapeNonVisual end
commit 813c1ca219625f0935d9306b9cd64e217f40bce6
Author: Thorsten Behrens <tbehrens at novell.com>
Date: Fri Oct 8 14:59:04 2010 +0200
pptx-gfx-layout-fix.diff: temp fix
to make GraphicShapeContext recognise layout
diff --git a/oox/inc/oox/ppt/pptgraphicshapecontext.hxx b/oox/inc/oox/ppt/pptgraphicshapecontext.hxx
new file mode 100644
index 0000000..37c9f9a
--- /dev/null
+++ b/oox/inc/oox/ppt/pptgraphicshapecontext.hxx
@@ -0,0 +1,49 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: pptshapecontext.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#ifndef OOX_PPT_PPTGRAPHICSHAPECONTEXT_HXX
+#define OOX_PPT_PPTGRAPHICSHAPECONTEXT_HXX
+
+#include "oox/drawingml/graphicshapecontext.hxx"
+
+namespace oox { namespace ppt {
+
+class PPTGraphicShapeContext : public ::oox::drawingml::GraphicShapeContext
+{
+ SlidePersistPtr mpSlidePersistPtr;
+
+public:
+ PPTGraphicShapeContext( ::oox::core::ContextHandler& rParent, const SlidePersistPtr pSlidePersistPtr, oox::drawingml::ShapePtr pMasterShapePtr, oox::drawingml::ShapePtr pShapePtr );
+ 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);
+};
+
+} }
+
+#endif // OOX_PPT_PPTGRAPHICSHAPEGROUPCONTEXT_HXX
diff --git a/oox/source/ppt/makefile.mk b/oox/source/ppt/makefile.mk
index 8d902ed..7ee7e0c 100644
--- a/oox/source/ppt/makefile.mk
+++ b/oox/source/ppt/makefile.mk
@@ -53,6 +53,7 @@ SLOFILES = \
$(SLO)$/headerfootercontext.obj \
$(SLO)$/layoutfragmenthandler.obj\
$(SLO)$/pptfilterhelpers.obj\
+ $(SLO)$/pptgraphicshapecontext.obj \
$(SLO)$/pptimport.obj\
$(SLO)$/pptshape.obj \
$(SLO)$/pptshapecontext.obj \
diff --git a/oox/source/ppt/pptgraphicshapecontext.cxx b/oox/source/ppt/pptgraphicshapecontext.cxx
new file mode 100644
index 0000000..e89caf2
--- /dev/null
+++ b/oox/source/ppt/pptgraphicshapecontext.cxx
@@ -0,0 +1,238 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: pptshapecontext.cxx,v $
+ * $Revision: 1.6 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#include <com/sun/star/xml/sax/FastToken.hpp>
+#include <com/sun/star/drawing/LineStyle.hpp>
+#include <com/sun/star/beans/XMultiPropertySet.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/container/XNamed.hpp>
+
+#include "oox/ppt/pptshape.hxx"
+#include "oox/ppt/pptgraphicshapecontext.hxx"
+#include "oox/ppt/pptshapepropertiescontext.hxx"
+#include "oox/ppt/slidepersist.hxx"
+#include "oox/drawingml/shapestylecontext.hxx"
+#include "oox/core/namespaces.hxx"
+#include "oox/drawingml/fillpropertiesgroupcontext.hxx"
+#include "oox/drawingml/lineproperties.hxx"
+#include "oox/drawingml/drawingmltypes.hxx"
+#include "oox/drawingml/customshapegeometry.hxx"
+#include "oox/drawingml/textbodycontext.hxx"
+#include "tokens.hxx"
+
+using rtl::OUString;
+using namespace oox::core;
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::drawing;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::text;
+using namespace ::com::sun::star::xml::sax;
+
+namespace oox { namespace ppt {
+
+// CT_Shape
+PPTGraphicShapeContext::PPTGraphicShapeContext( ContextHandler& rParent, const SlidePersistPtr pSlidePersistPtr, oox::drawingml::ShapePtr pMasterShapePtr, oox::drawingml::ShapePtr pShapePtr )
+: oox::drawingml::GraphicShapeContext( rParent, pMasterShapePtr, pShapePtr )
+, mpSlidePersistPtr( pSlidePersistPtr )
+{
+}
+
+static oox::drawingml::ShapePtr findPlaceholder( const sal_Int32 nMasterPlaceholder, std::vector< oox::drawingml::ShapePtr >& rShapes )
+{
+ oox::drawingml::ShapePtr aShapePtr;
+ std::vector< oox::drawingml::ShapePtr >::reverse_iterator aRevIter( rShapes.rbegin() );
+ while( aRevIter != rShapes.rend() )
+ {
+ if ( (*aRevIter)->getSubType() == nMasterPlaceholder )
+ {
+ aShapePtr = *aRevIter;
+ break;
+ }
+ std::vector< oox::drawingml::ShapePtr >& rChildren = (*aRevIter)->getChildren();
+ aShapePtr = findPlaceholder( nMasterPlaceholder, rChildren );
+ if ( aShapePtr.get() )
+ break;
+ aRevIter++;
+ }
+ return aShapePtr;
+}
+
+static oox::drawingml::ShapePtr findPlaceholderByIndex( const sal_Int32 nIdx, std::vector< oox::drawingml::ShapePtr >& rShapes )
+{
+ oox::drawingml::ShapePtr aShapePtr;
+ std::vector< oox::drawingml::ShapePtr >::reverse_iterator aRevIter( rShapes.rbegin() );
+ while( aRevIter != rShapes.rend() )
+ {
+ if ( (*aRevIter)->getSubTypeIndex() == nIdx )
+ {
+ aShapePtr = *aRevIter;
+ break;
+ }
+ std::vector< oox::drawingml::ShapePtr >& rChildren = (*aRevIter)->getChildren();
+ aShapePtr = findPlaceholderByIndex( nIdx, rChildren );
+ if ( aShapePtr.get() )
+ break;
+ aRevIter++;
+ }
+ return aShapePtr;
+}
+
+// if nFirstPlaceholder can't be found, it will be searched for nSecondPlaceholder
+static oox::drawingml::ShapePtr findPlaceholder( sal_Int32 nFirstPlaceholder, sal_Int32 nSecondPlaceholder, std::vector< oox::drawingml::ShapePtr >& rShapes )
+{
+ oox::drawingml::ShapePtr pPlaceholder = findPlaceholder( nFirstPlaceholder, rShapes );
+ return !nSecondPlaceholder || pPlaceholder.get() ? pPlaceholder : findPlaceholder( nSecondPlaceholder, rShapes );
+}
+
+Reference< XFastContextHandler > PPTGraphicShapeContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException)
+{
+ Reference< XFastContextHandler > xRet;
+
+ switch( aElementToken )
+ {
+ // nvSpPr CT_ShapeNonVisual begin
+// case NMSP_PPT|XML_drElemPr:
+// break;
+ case NMSP_PPT|XML_cNvPr:
+ mpShapePtr->setId( xAttribs->getOptionalValue( XML_id ) );
+ mpShapePtr->setName( xAttribs->getOptionalValue( XML_name ) );
+ break;
+ case NMSP_PPT|XML_ph:
+ {
+ sal_Int32 nSubType( xAttribs->getOptionalValueToken( XML_type, XML_obj ) );
+ mpShapePtr->setSubType( nSubType );
+ OUString sIdx( xAttribs->getOptionalValue( XML_idx ) );
+ sal_Bool bHasIdx = sIdx.getLength() > 0;
+ sal_Int32 nIdx = sIdx.toInt32();
+ mpShapePtr->setSubTypeIndex( nIdx );
+
+ if ( nSubType || bHasIdx )
+ {
+ PPTShape* pPPTShapePtr = dynamic_cast< PPTShape* >( mpShapePtr.get() );
+ if ( pPPTShapePtr )
+ {
+ oox::ppt::ShapeLocation eShapeLocation = pPPTShapePtr->getShapeLocation();
+ oox::drawingml::ShapePtr pPlaceholder;
+
+ if ( bHasIdx && eShapeLocation == Slide )
+ {
+ // TODO: use id to shape map
+ SlidePersistPtr pMasterPersist( mpSlidePersistPtr->getMasterPersist() );
+ if ( pMasterPersist.get() )
+ pPlaceholder = findPlaceholderByIndex( nIdx, pMasterPersist->getShapes()->getChildren() );
+ }
+ if ( !pPlaceholder.get() && ( ( eShapeLocation == Slide ) || ( eShapeLocation == Layout ) ) )
+ {
+ // inheriting properties from placeholder objects by cloning shape
+
+ sal_Int32 nFirstPlaceholder = 0;
+ sal_Int32 nSecondPlaceholder = 0;
+ switch( nSubType )
+ {
+ case XML_ctrTitle : // slide/layout
+ nFirstPlaceholder = XML_ctrTitle;
+ nSecondPlaceholder = XML_title;
+ break;
+ case XML_subTitle : // slide/layout
+ nFirstPlaceholder = XML_subTitle;
+ nSecondPlaceholder = XML_title;
+ break;
+ case XML_obj : // slide/layout
+ nFirstPlaceholder = XML_body;
+ break;
+ case XML_dt : // slide/layout/master/notes/notesmaster/handoutmaster
+ case XML_sldNum : // slide/layout/master/notes/notesmaster/handoutmaster
+ case XML_ftr : // slide/layout/master/notes/notesmaster/handoutmaster
+ case XML_hdr : // notes/notesmaster/handoutmaster
+ case XML_body : // slide/layout/master/notes/notesmaster
+ case XML_title : // slide/layout/master/
+ case XML_chart : // slide/layout
+ case XML_tbl : // slide/layout
+ case XML_clipArt : // slide/layout
+ case XML_dgm : // slide/layout
+ case XML_media : // slide/layout
+ case XML_sldImg : // notes/notesmaster
+ case XML_pic : // slide/layout
+ nFirstPlaceholder = nSubType;
+ default:
+ break;
+ }
+ if ( nFirstPlaceholder )
+ {
+ if ( eShapeLocation == Layout ) // for layout objects the referenced object can be found within the same shape tree
+ pPlaceholder = findPlaceholder( nFirstPlaceholder, nSecondPlaceholder, mpSlidePersistPtr->getShapes()->getChildren() );
+ else if ( eShapeLocation == Slide ) // normal slide shapes have to search within the corresponding master tree for referenced objects
+ {
+ SlidePersistPtr pMasterPersist( mpSlidePersistPtr->getMasterPersist() );
+ if ( pMasterPersist.get() )
+ pPlaceholder = findPlaceholder( nFirstPlaceholder, nSecondPlaceholder, pMasterPersist->getShapes()->getChildren() );
+ }
+ }
+ }
+ if ( pPlaceholder.get() )
+ {
+ mpShapePtr->applyShapeReference( *pPlaceholder.get() );
+ PPTShape* pPPTShape = dynamic_cast< PPTShape* >( pPlaceholder.get() );
+ if ( pPPTShape )
+ pPPTShape->setReferenced( sal_True );
+ pPPTShapePtr->setPlaceholder( pPlaceholder );
+ }
+ }
+ }
+ break;
+ }
+ // nvSpPr CT_ShapeNonVisual end
+
+ case NMSP_PPT|XML_spPr:
+ xRet = new PPTShapePropertiesContext( *this, *mpShapePtr );
+ break;
+
+ case NMSP_PPT|XML_style:
+ xRet = new oox::drawingml::ShapeStyleContext( *this, *mpShapePtr );
+ break;
+
+ case NMSP_PPT|XML_txBody:
+ {
+ oox::drawingml::TextBodyPtr xTextBody( new oox::drawingml::TextBody );
+ mpShapePtr->setTextBody( xTextBody );
+ xRet = new oox::drawingml::TextBodyContext( *this, *xTextBody );
+ break;
+ }
+ }
+
+ if( !xRet.is() )
+ xRet.set( GraphicShapeContext::createFastChildContext( aElementToken, xAttribs ) );
+
+ return xRet;
+}
+
+
+} }
diff --git a/oox/source/ppt/pptshapegroupcontext.cxx b/oox/source/ppt/pptshapegroupcontext.cxx
index 650faeb..4ed5ee1 100644
--- a/oox/source/ppt/pptshapegroupcontext.cxx
+++ b/oox/source/ppt/pptshapegroupcontext.cxx
@@ -31,6 +31,7 @@
#include "oox/helper/attributelist.hxx"
#include "oox/ppt/pptshape.hxx"
+#include "oox/ppt/pptgraphicshapecontext.hxx"
#include "oox/ppt/pptshapecontext.hxx"
#include "oox/ppt/pptshapegroupcontext.hxx"
#include "oox/drawingml/graphicshapecontext.hxx"
@@ -106,7 +107,7 @@ Reference< XFastContextHandler > PPTShapeGroupContext::createFastChildContext( s
xRet.set( new PPTShapeContext( *this, mpSlidePersistPtr, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.CustomShape" ) ) ) );
break;
case NMSP_PPT|XML_pic: // CT_Picture
- xRet.set( new oox::drawingml::GraphicShapeContext( *this, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.GraphicObjectShape" ) ) ) );
+ xRet.set( new PPTGraphicShapeContext( *this, mpSlidePersistPtr, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.GraphicObjectShape" ) ) ) );
break;
case NMSP_PPT|XML_graphicFrame: // CT_GraphicalObjectFrame
xRet.set( new oox::drawingml::GraphicalObjectFrameContext( *this, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.OLE2Shape" ) ), true ) );
commit fb35fb0a9c284e231c6ea5970f9548ad8921b300
Author: Radek Doulik <rodo at novell.com>
Date: Fri Oct 8 14:49:01 2010 +0200
oox-pptx-import-fix-groups-2: fix group shapes (final part).
n#619678
diff --git a/oox/inc/oox/drawingml/shape.hxx b/oox/inc/oox/drawingml/shape.hxx
index 42a6ce4..9ec5019 100644
--- a/oox/inc/oox/drawingml/shape.hxx
+++ b/oox/inc/oox/drawingml/shape.hxx
@@ -187,6 +187,9 @@ protected:
std::vector< ShapePtr > maChildren; // only used for group shapes
com::sun::star::awt::Size maChSize; // only used for group shapes
com::sun::star::awt::Point maChPosition; // only used for group shapes
+ com::sun::star::awt::Size maAbsoluteSize; // only used for group shapes
+ com::sun::star::awt::Point maAbsolutePosition; // only used for group shapes
+ sal_Bool mbIsChild;
TextBodyPtr mpTextBody;
LinePropertiesPtr mpLinePropertiesPtr;
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 78add96..c0dacb5 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -85,7 +85,8 @@ void CreateShapeCallback::onXShapeCreated( const Reference< XShape >&, const Ref
// ============================================================================
Shape::Shape( const sal_Char* pServiceName )
-: mpLinePropertiesPtr( new LineProperties )
+: mbIsChild( false )
+, mpLinePropertiesPtr( new LineProperties )
, mpFillPropertiesPtr( new FillProperties )
, mpGraphicPropertiesPtr( new GraphicProperties )
, mpCustomShapePropertiesPtr( new CustomShapeProperties )
@@ -193,45 +194,34 @@ void Shape::addChildren(
Shape& rMaster,
const Theme* pTheme,
const Reference< XShapes >& rxShapes,
- const awt::Rectangle& rClientRect,
+ const awt::Rectangle&,
ShapeIdMap* pShapeMap )
{
- // first the global child union needs to be calculated
- sal_Int32 nGlobalLeft = SAL_MAX_INT32;
- sal_Int32 nGlobalRight = SAL_MIN_INT32;
- sal_Int32 nGlobalTop = SAL_MAX_INT32;
- sal_Int32 nGlobalBottom= SAL_MIN_INT32;
+ awt::Point& aPosition( mbIsChild ? maAbsolutePosition : maPosition );
+ awt::Size& aSize( mbIsChild ? maAbsoluteSize : maSize );
+
std::vector< ShapePtr >::iterator aIter( rMaster.maChildren.begin() );
while( aIter != rMaster.maChildren.end() )
{
- sal_Int32 l = (*aIter)->maPosition.X;
- sal_Int32 t = (*aIter)->maPosition.Y;
- sal_Int32 r = l + (*aIter)->maSize.Width;
- sal_Int32 b = t + (*aIter)->maSize.Height;
- if ( nGlobalLeft > l )
- nGlobalLeft = l;
- if ( nGlobalRight < r )
- nGlobalRight = r;
- if ( nGlobalTop > t )
- nGlobalTop = t;
- if ( nGlobalBottom < b )
- nGlobalBottom = b;
- aIter++;
- }
- aIter = rMaster.maChildren.begin();
- while( aIter != rMaster.maChildren.end() )
- {
awt::Rectangle aShapeRect;
awt::Rectangle* pShapeRect = 0;
Shape& rChild = *(*aIter);
- if ( rChild.maSize.Width != maSize.Width || rChild.maSize.Height != maSize.Height || rChild.maPosition.X != maPosition.X || rChild.maPosition.Y != maPosition.Y ) {
- aShapeRect.X = maPosition.X + rChild.maPosition.X - maChPosition.X;
- aShapeRect.Y = maPosition.Y + rChild.maPosition.Y - maChPosition.Y;
- aShapeRect.Width = maSize.Width + rChild.maSize.Width - maChSize.Width;
- aShapeRect.Height = maSize.Height + rChild.maSize.Height - maChSize.Height;
- pShapeRect = &aShapeRect;
- }
+ double sx = ((double)aSize.Width)/maChSize.Width;
+ double sy = ((double)aSize.Height)/maChSize.Height;
+ rChild.maAbsolutePosition.X = aPosition.X + sx*(rChild.maPosition.X - maChPosition.X);
+ rChild.maAbsolutePosition.Y = aPosition.Y + sy*(rChild.maPosition.Y - maChPosition.Y);
+ rChild.maAbsoluteSize.Width = rChild.maSize.Width*sx;
+ rChild.maAbsoluteSize.Height = rChild.maSize.Height*sy;
+ rChild.mbIsChild = true;
+
+ aShapeRect.X = rChild.maAbsolutePosition.X;
+ aShapeRect.Y = rChild.maAbsolutePosition.Y;
+ aShapeRect.Width = rChild.maAbsoluteSize.Width;
+ aShapeRect.Height = rChild.maAbsoluteSize.Height;
+
+ pShapeRect = &aShapeRect;
+
(*aIter++)->addShape( rFilterBase, pTheme, rxShapes, pShapeRect, pShapeMap );
}
}
commit e483bcd7c47967ce351fbe51fb78f077cbd5774d
Author: Radek Doulik <rodo at novell.com>
Date: Fri Oct 8 14:42:23 2010 +0200
oox-pptx-import-fix-customshapes-and-groups.diff: fix group shapes and guides.
n#621739
diff --git a/oox/inc/oox/drawingml/shape.hxx b/oox/inc/oox/drawingml/shape.hxx
index 1c4cb3d..42a6ce4 100644
--- a/oox/inc/oox/drawingml/shape.hxx
+++ b/oox/inc/oox/drawingml/shape.hxx
@@ -116,6 +116,9 @@ public:
table::TablePropertiesPtr getTableProperties();
+ void setChildPosition( com::sun::star::awt::Point nPosition ){ maChPosition = nPosition; }
+ void setChildSize( com::sun::star::awt::Size aSize ){ maChSize = aSize; }
+
void setPosition( com::sun::star::awt::Point nPosition ){ maPosition = nPosition; }
void setSize( com::sun::star::awt::Size aSize ){ maSize = aSize; }
void setRotation( sal_Int32 nRotation ) { mnRotation = nRotation; }
@@ -182,6 +185,9 @@ protected:
ShapeIdMap* pShapeMap );
std::vector< ShapePtr > maChildren; // only used for group shapes
+ com::sun::star::awt::Size maChSize; // only used for group shapes
+ com::sun::star::awt::Point maChPosition; // only used for group shapes
+
TextBodyPtr mpTextBody;
LinePropertiesPtr mpLinePropertiesPtr;
FillPropertiesPtr mpFillPropertiesPtr;
diff --git a/oox/source/drawingml/customshapegeometry.cxx b/oox/source/drawingml/customshapegeometry.cxx
index 9c1293d..3719d7f 100644
--- a/oox/source/drawingml/customshapegeometry.cxx
+++ b/oox/source/drawingml/customshapegeometry.cxx
@@ -403,7 +403,7 @@ static EnhancedCustomShapeParameter GetAdjCoordinate( CustomShapeProperties& rCu
}
if ( ( n >= '0' ) && ( n <= '9' ) )
{ // seems to be a ST_Coordinate
- aRet.Value = Any( rValue.toInt32() );
+ aRet.Value = Any( (sal_Int32)(rValue.toInt32() / 5) );
aRet.Type = EnhancedCustomShapeParameterType::NORMAL;
}
else
diff --git a/oox/source/drawingml/customshapeproperties.cxx b/oox/source/drawingml/customshapeproperties.cxx
index 281fd9f..e41ad41 100644
--- a/oox/source/drawingml/customshapeproperties.cxx
+++ b/oox/source/drawingml/customshapeproperties.cxx
@@ -131,6 +131,11 @@ void CustomShapeProperties::pushToPropSet( const ::oox::core::FilterBase& /* rFi
aAdjustmentVal.State = PropertyState_DIRECT_VALUE;
aAdjustmentSeq[ nAdjustmentIndex ] = aAdjustmentVal;
}
+ } else {
+ EnhancedCustomShapeAdjustmentValue aAdjustmentVal;
+ aAdjustmentVal.Value <<= (*aIter).maFormula.toInt32();
+ aAdjustmentVal.State = PropertyState_DIRECT_VALUE;
+ aAdjustmentSeq[ 0 ] = aAdjustmentVal;
}
aIter++;
}
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 7d49732..78add96 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -223,24 +223,14 @@ void Shape::addChildren(
{
awt::Rectangle aShapeRect;
awt::Rectangle* pShapeRect = 0;
- if ( ( nGlobalLeft != SAL_MAX_INT32 ) && ( nGlobalRight != SAL_MIN_INT32 ) && ( nGlobalTop != SAL_MAX_INT32 ) && ( nGlobalBottom != SAL_MIN_INT32 ) )
- {
- sal_Int32 nGlobalWidth = nGlobalRight - nGlobalLeft;
- sal_Int32 nGlobalHeight = nGlobalBottom - nGlobalTop;
- if ( nGlobalWidth && nGlobalHeight )
- {
- double fWidth = (*aIter)->maSize.Width;
- double fHeight= (*aIter)->maSize.Height;
- double fXScale = (double)rClientRect.Width / (double)nGlobalWidth;
- double fYScale = (double)rClientRect.Height / (double)nGlobalHeight;
- aShapeRect.X = static_cast< sal_Int32 >( ( ( (*aIter)->maPosition.X - nGlobalLeft ) * fXScale ) + rClientRect.X );
- aShapeRect.Y = static_cast< sal_Int32 >( ( ( (*aIter)->maPosition.Y - nGlobalTop ) * fYScale ) + rClientRect.Y );
- fWidth *= fXScale;
- fHeight *= fYScale;
- aShapeRect.Width = static_cast< sal_Int32 >( fWidth );
- aShapeRect.Height = static_cast< sal_Int32 >( fHeight );
- pShapeRect = &aShapeRect;
- }
+ Shape& rChild = *(*aIter);
+
+ if ( rChild.maSize.Width != maSize.Width || rChild.maSize.Height != maSize.Height || rChild.maPosition.X != maPosition.X || rChild.maPosition.Y != maPosition.Y ) {
+ aShapeRect.X = maPosition.X + rChild.maPosition.X - maChPosition.X;
+ aShapeRect.Y = maPosition.Y + rChild.maPosition.Y - maChPosition.Y;
+ aShapeRect.Width = maSize.Width + rChild.maSize.Width - maChSize.Width;
+ aShapeRect.Height = maSize.Height + rChild.maSize.Height - maChSize.Height;
+ pShapeRect = &aShapeRect;
}
(*aIter++)->addShape( rFilterBase, pTheme, rxShapes, pShapeRect, pShapeMap );
}
diff --git a/oox/source/drawingml/transform2dcontext.cxx b/oox/source/drawingml/transform2dcontext.cxx
index 4670b22..803e272 100644
--- a/oox/source/drawingml/transform2dcontext.cxx
+++ b/oox/source/drawingml/transform2dcontext.cxx
@@ -64,11 +64,12 @@ Reference< XFastContextHandler > Transform2DContext::createFastChildContext( sal
case NMSP_DRAWINGML|XML_ext: // horz/vert size
mrShape.setSize( Size( xAttribs->getOptionalValue( XML_cx ).toInt32(), xAttribs->getOptionalValue( XML_cy ).toInt32() ) );
break;
-/* todo: what to do?
case NMSP_DRAWINGML|XML_chOff: // horz/vert translation of children
+ mrShape.setChildPosition( Point( xAttribs->getOptionalValue( XML_x ).toInt32(), xAttribs->getOptionalValue( XML_y ).toInt32() ) );
+ break;
case NMSP_DRAWINGML|XML_chExt: // horz/vert size of children
+ mrShape.setChildSize( Size( xAttribs->getOptionalValue( XML_cx ).toInt32(), xAttribs->getOptionalValue( XML_cy ).toInt32() ) );
break;
-*/
}
return 0;
commit 47f5c5359befa144071ce021dce038f61122d669
Author: Radek Doulik <rodo at novell.com>
Date: Fri Oct 8 14:05:00 2010 +0200
oox-import-fix-ole2-shapes.diff: fix OLE2 import.
n#593611
diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx
index 5b34b94..d8cd3eb 100644
--- a/oox/source/ppt/pptshape.cxx
+++ b/oox/source/ppt/pptshape.cxx
@@ -83,7 +83,8 @@ void PPTShape::addShape(
Reference< lang::XMultiServiceFactory > xServiceFact( rFilterBase.getModel(), UNO_QUERY_THROW );
sal_Bool bClearText = sal_False;
- if ( sServiceName != OUString::createFromAscii( "com.sun.star.drawing.GraphicObjectShape" ) )
+ if ( sServiceName != OUString::createFromAscii( "com.sun.star.drawing.GraphicObjectShape" ) &&
+ sServiceName != OUString::createFromAscii( "com.sun.star.drawing.OLE2Shape" ) )
{
switch( mnSubType )
{
commit d73309d882963c022d2e244ca516bf70b6888e7d
Author: Radek Doulik <rodo at novell.com>
Date: Fri Oct 8 14:02:37 2010 +0200
oox-pptx-fix-transition-auto-advance.diff: import transition auto advance.
n#480243
diff --git a/oox/inc/oox/ppt/slidetransition.hxx b/oox/inc/oox/ppt/slidetransition.hxx
index 2de0464..9dd941c 100644
--- a/oox/inc/oox/ppt/slidetransition.hxx
+++ b/oox/inc/oox/ppt/slidetransition.hxx
@@ -51,6 +51,8 @@ namespace oox { namespace ppt {
{ mnFadeColor = nColor; }
void setMode( sal_Bool bMode )
{ mbMode = bMode; }
+ void setOoxAdvanceTime( sal_Int32 nAdvanceTime )
+ { mnAdvanceTime = nAdvanceTime; }
static sal_Int16 ooxToOdpDirection( ::sal_Int32 nOoxType );
static sal_Int16 ooxToOdpEightDirections( ::sal_Int32 nOoxType );
@@ -68,6 +70,7 @@ namespace oox { namespace ppt {
::sal_Int16 mnAnimationSpeed;
::sal_Int32 mnFadeColor;
::sal_Bool mbMode; /**< http://api.openoffice.org/docs/common/ref/com/sun/star/animations/XTransitionFilter.html Mode property */
+ ::sal_Int32 mnAdvanceTime;
};
} }
diff --git a/oox/source/ppt/slidetransition.cxx b/oox/source/ppt/slidetransition.cxx
index 6c032e8..70cfbde 100644
--- a/oox/source/ppt/slidetransition.cxx
+++ b/oox/source/ppt/slidetransition.cxx
@@ -56,6 +56,7 @@ namespace oox { namespace ppt {
, mnAnimationSpeed( AnimationSpeed_FAST )
, mnFadeColor( 0 )
, mbMode( true )
+ , mnAdvanceTime( -1 )
{
}
@@ -68,6 +69,7 @@ namespace oox { namespace ppt {
, mnAnimationSpeed( AnimationSpeed_FAST )
, mnFadeColor( 0 )
, mbMode( true )
+ , mnAdvanceTime( -1 )
{
const transition *p = transition::find( sFilterName );
if( p )
@@ -88,6 +90,10 @@ namespace oox { namespace ppt {
aProps[ PROP_TransitionDirection ] <<= mbTransitionDirectionNormal;
aProps[ PROP_Speed ] <<= mnAnimationSpeed;
aProps[ PROP_TransitionFadeColor ] <<= mnFadeColor;
+ if( mnAdvanceTime != -1 ) {
+ aProps[ PROP_Duration ] <<= mnAdvanceTime/1000;
+ aProps[ PROP_Change ] <<= static_cast<sal_Int32>(1);
+ }
}
catch( Exception& )
{
@@ -138,8 +144,6 @@ namespace oox { namespace ppt {
}
}
-
-
sal_Int16 SlideTransition::ooxToOdpEightDirections( ::sal_Int32 nOoxType )
{
sal_Int16 nOdpDirection;
diff --git a/oox/source/ppt/slidetransitioncontext.cxx b/oox/source/ppt/slidetransitioncontext.cxx
index 8a408a2..e414ed7 100644
--- a/oox/source/ppt/slidetransitioncontext.cxx
+++ b/oox/source/ppt/slidetransitioncontext.cxx
@@ -67,12 +67,9 @@ SlideTransitionContext::SlideTransitionContext( ContextHandler& rParent, const R
attribs.getBool( XML_advClick, true );
// careful. if missing, no auto advance... 0 looks like a valid value
- // for auto advance
+ // for auto advance
if(attribs.hasAttribute( XML_advTm ))
- {
- // TODO
- xAttribs->getOptionalValue( XML_advTm );
- }
+ maTransition.setOoxAdvanceTime( attribs.getInteger( XML_advTm, -1 ) );
}
SlideTransitionContext::~SlideTransitionContext() throw()
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index 46894b0..2a7960a 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -40,6 +40,7 @@ CellProtection
CellStyle
CenterHorizontally
CenterVertically
+Change
CharCaseMap
CharColor
CharContoured
@@ -115,6 +116,7 @@ DialogLibraries
DisplayLabels
DrillDownOnDoubleClick
Dropdown
+Duration
EchoChar
EnableVisible
Enabled
commit cf872ffffa20be62919c1e0fdb37ae375e686808
Author: Radek Doulik <rodo at novell.com>
Date: Fri Oct 8 13:54:35 2010 +0200
oox-pptx-import-fix-layout.diff: fix list styles applying.
n#480223
diff --git a/oox/inc/oox/ppt/pptshape.hxx b/oox/inc/oox/ppt/pptshape.hxx
index 1bf7b86..1ed289e 100644
--- a/oox/inc/oox/ppt/pptshape.hxx
+++ b/oox/inc/oox/ppt/pptshape.hxx
@@ -61,10 +61,15 @@ public:
ShapeLocation getShapeLocation() const { return meShapeLocation; };
sal_Bool isReferenced() const { return mbReferenced; };
void setReferenced( sal_Bool bReferenced ){ mbReferenced = bReferenced; };
+ void setPlaceholder( oox::drawingml::ShapePtr pPlaceholder ) { mpPlaceholder = pPlaceholder; }
static oox::drawingml::ShapePtr findPlaceholder( const sal_Int32 nMasterPlaceholder, std::vector< oox::drawingml::ShapePtr >& rShapes );
static oox::drawingml::ShapePtr findPlaceholderByIndex( const sal_Int32 nIdx, std::vector< oox::drawingml::ShapePtr >& rShapes );
static oox::drawingml::ShapePtr findPlaceholder( sal_Int32 nFirstPlaceholder, sal_Int32 nSecondPlaceholder, std::vector< oox::drawingml::ShapePtr >& rShapes );
+
+protected:
+
+ oox::drawingml::ShapePtr mpPlaceholder;
};
} }
diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx
index 45aae1e..5b34b94 100644
--- a/oox/source/ppt/pptshape.cxx
+++ b/oox/source/ppt/pptshape.cxx
@@ -189,6 +189,18 @@ void PPTShape::addShape(
// use style from master slide for placeholders only, otherwise use slide's style, which might be the default style from presentation
if ( !aMasterTextListStyle.get() )
aMasterTextListStyle = ( mnSubType && rSlidePersist.getMasterPersist().get() ) ? rSlidePersist.getMasterPersist()->getOtherTextStyle() : rSlidePersist.getOtherTextStyle();
+
+ if( aMasterTextListStyle.get() && getTextBody().get() ) {
+ TextListStylePtr aCombinedTextListStyle (new TextListStyle());
+
+ aCombinedTextListStyle->apply( *aMasterTextListStyle.get() );
+
+ if( mpPlaceholder.get() && mpPlaceholder->getTextBody().get() )
+ aCombinedTextListStyle->apply( mpPlaceholder->getTextBody()->getTextListStyle() );
+ aCombinedTextListStyle->apply( getTextBody()->getTextListStyle() );
+
+ setMasterTextListStyle( aCombinedTextListStyle );
+ } else
setMasterTextListStyle( aMasterTextListStyle );
Reference< XShape > xShape( createAndInsert( rFilterBase, sServiceName, pTheme, rxShapes, pShapeRect, bClearText ) );
diff --git a/oox/source/ppt/pptshapecontext.cxx b/oox/source/ppt/pptshapecontext.cxx
index 890f83a..b6e0dc7 100644
--- a/oox/source/ppt/pptshapecontext.cxx
+++ b/oox/source/ppt/pptshapecontext.cxx
@@ -180,6 +180,7 @@ Reference< XFastContextHandler > PPTShapeContext::createFastChildContext( sal_In
PPTShape* pPPTShape = dynamic_cast< PPTShape* >( pPlaceholder.get() );
if ( pPPTShape )
pPPTShape->setReferenced( sal_True );
+ pPPTShapePtr->setPlaceholder( pPlaceholder );
}
}
}
commit 597d50cb501816edeb13f3b95d6aae1f7842aae8
Author: Radek Doulik <rodo at novell.com>
Date: Fri Oct 8 13:51:09 2010 +0200
oox-import-drawing-font-spacing.diff: import character spacing.
n#479822
diff --git a/oox/source/drawingml/textcharacterpropertiescontext.cxx b/oox/source/drawingml/textcharacterpropertiescontext.cxx
index c74dba5..5586356 100644
--- a/oox/source/drawingml/textcharacterpropertiescontext.cxx
+++ b/oox/source/drawingml/textcharacterpropertiescontext.cxx
@@ -60,6 +60,8 @@ TextCharacterPropertiesContext::TextCharacterPropertiesContext(
mrTextCharacterProperties.moLang = aAttribs.getString( XML_lang );
if ( aAttribs.hasAttribute( XML_sz ) )
mrTextCharacterProperties.moHeight = aAttribs.getInteger( XML_sz );
+ if ( aAttribs.hasAttribute( XML_spc ) )
+ mrTextCharacterProperties.moSpacing = aAttribs.getInteger( XML_spc );
if ( aAttribs.hasAttribute( XML_u ) )
mrTextCharacterProperties.moUnderline = aAttribs.getToken( XML_u );
if ( aAttribs.hasAttribute( XML_strike ) )
commit 66cdef710178e289eef13b13c76ca1c0f44ad27d
Author: Radek Doulik <rodo at novell.com>
Date: Fri Oct 8 13:49:28 2010 +0200
oox-fix-list-style-apply.diff: use slide's list style.
n#485417
diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx
index 857d9b1..45aae1e 100644
--- a/oox/source/ppt/pptshape.cxx
+++ b/oox/source/ppt/pptshape.cxx
@@ -186,8 +186,9 @@ void PPTShape::addShape(
*/
if ( sServiceName.getLength() )
{
+ // use style from master slide for placeholders only, otherwise use slide's style, which might be the default style from presentation
if ( !aMasterTextListStyle.get() )
- aMasterTextListStyle = rSlidePersist.getMasterPersist().get() ? rSlidePersist.getMasterPersist()->getOtherTextStyle() : rSlidePersist.getOtherTextStyle();
+ aMasterTextListStyle = ( mnSubType && rSlidePersist.getMasterPersist().get() ) ? rSlidePersist.getMasterPersist()->getOtherTextStyle() : rSlidePersist.getOtherTextStyle();
setMasterTextListStyle( aMasterTextListStyle );
Reference< XShape > xShape( createAndInsert( rFilterBase, sServiceName, pTheme, rxShapes, pShapeRect, bClearText ) );
More information about the Libreoffice-commits
mailing list