summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2010-04-09 12:43:42 +0200
committerKurt Zenker <kz@openoffice.org>2010-04-09 12:43:42 +0200
commitf2cef90e283052af9ac639025b0a17e83d90eadc (patch)
tree47d97f8102d6cbcdb4d81d8e0fa4903d0a7752dc
parent01cde0ab2833d8cdbca95a77c035ad3789acc31f (diff)
parent9bf492dc0dacbc3468930a7f06253177b6c55976 (diff)
CWS-TOOLING: integrate CWS impress189ooo/OOO320_m15
-rw-r--r--oox/inc/oox/drawingml/shape.hxx13
-rw-r--r--oox/inc/oox/drawingml/textparagraph.hxx6
-rw-r--r--oox/source/drawingml/shape.cxx16
-rw-r--r--oox/source/drawingml/shapecontext.cxx2
-rw-r--r--oox/source/drawingml/shapegroupcontext.cxx2
-rw-r--r--oox/source/drawingml/textbodycontext.cxx2
-rw-r--r--oox/source/drawingml/textbodypropertiescontext.cxx17
-rw-r--r--oox/source/drawingml/textcharacterpropertiescontext.cxx21
-rw-r--r--oox/source/drawingml/textparagraph.cxx18
-rw-r--r--oox/source/ppt/pptshapecontext.cxx28
-rw-r--r--oox/source/ppt/pptshapegroupcontext.cxx2
-rw-r--r--oox/source/ppt/slidepersist.cxx2
-rw-r--r--oox/source/token/properties.txt1
13 files changed, 90 insertions, 40 deletions
diff --git a/oox/inc/oox/drawingml/shape.hxx b/oox/inc/oox/drawingml/shape.hxx
index 126f53dff..12a9e25f4 100644
--- a/oox/inc/oox/drawingml/shape.hxx
+++ b/oox/inc/oox/drawingml/shape.hxx
@@ -124,7 +124,8 @@ public:
void setId( const rtl::OUString& rId ) { msId = rId; }
void setSubType( sal_uInt32 nSubType ) { mnSubType = nSubType; }
sal_Int32 getSubType() const { return mnSubType; }
- void setIndex( sal_uInt32 nIndex ) { mnIndex = nIndex; }
+ void setSubTypeIndex( sal_uInt32 nSubTypeIndex ) { mnSubTypeIndex = nSubTypeIndex; }
+ sal_Int32 getSubTypeIndex() const { return mnSubTypeIndex; }
// setDefaults has to be called if styles are imported (OfficeXML is not storing properties having the default value)
void setDefaults();
@@ -185,11 +186,11 @@ protected:
TextListStylePtr mpMasterTextListStyle;
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mxShape;
- rtl::OUString msServiceName;
- rtl::OUString msName;
- rtl::OUString msId;
- sal_uInt32 mnSubType; // if this type is not zero, then the shape is a placeholder
- sal_uInt32 mnIndex;
+ rtl::OUString msServiceName;
+ rtl::OUString msName;
+ rtl::OUString msId;
+ sal_uInt32 mnSubType; // if this type is not zero, then the shape is a placeholder
+ sal_uInt32 mnSubTypeIndex;
ShapeStyleRefMap maShapeStyleRefs;
diff --git a/oox/inc/oox/drawingml/textparagraph.hxx b/oox/inc/oox/drawingml/textparagraph.hxx
index e98232477..d8c97cbfa 100644
--- a/oox/inc/oox/drawingml/textparagraph.hxx
+++ b/oox/inc/oox/drawingml/textparagraph.hxx
@@ -54,8 +54,8 @@ public:
inline TextParagraphProperties& getProperties() { return maProperties; }
inline const TextParagraphProperties& getProperties() const { return maProperties; }
- inline TextParagraphProperties& getEndProperties() { return maEndProperties; }
- inline const TextParagraphProperties& getEndProperties() const { return maEndProperties; }
+ inline TextCharacterProperties& getEndProperties() { return maEndProperties; }
+ inline const TextCharacterProperties& getEndProperties() const { return maEndProperties; }
//inline void setProperties( TextParagraphPropertiesPtr pProps ) { mpProperties = pProps; }
@@ -69,7 +69,7 @@ public:
private:
TextParagraphProperties maProperties;
- TextParagraphProperties maEndProperties;
+ TextCharacterProperties maEndProperties;
TextRunVector maRuns;
};
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 5655de7b5..e6e373a79 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -90,7 +90,7 @@ Shape::Shape( const sal_Char* pServiceName )
, mpCustomShapePropertiesPtr( new CustomShapeProperties )
, mpMasterTextListStyle( new TextListStyle )
, mnSubType( 0 )
-, mnIndex( 0 )
+, mnSubTypeIndex( -1 )
, mnRotation( 0 )
, mbFlipH( false )
, mbFlipV( false )
@@ -414,13 +414,23 @@ Reference< XShape > Shape::createAndInsert(
aFillProperties.assignUsed( getFillProperties() );
PropertyMap aShapeProperties;
+ PropertyMap::const_iterator aShapePropIter;
+
aShapeProperties.insert( getShapeProperties().begin(), getShapeProperties().end() );
if( mxCreateCallback.get() )
- aShapeProperties.insert( mxCreateCallback->getShapeProperties().begin(), mxCreateCallback->getShapeProperties().end() );
+ {
+ for ( aShapePropIter = mxCreateCallback->getShapeProperties().begin();
+ aShapePropIter != mxCreateCallback->getShapeProperties().end(); aShapePropIter++ )
+ aShapeProperties[ (*aShapePropIter).first ] = (*aShapePropIter).second;
+ }
// add properties from textbody to shape properties
if( mpTextBody.get() )
- aShapeProperties.insert( mpTextBody->getTextProperties().maPropertyMap.begin(), mpTextBody->getTextProperties().maPropertyMap.end() );
+ {
+ for ( aShapePropIter = mpTextBody->getTextProperties().maPropertyMap.begin();
+ aShapePropIter != mpTextBody->getTextProperties().maPropertyMap.end(); aShapePropIter++ )
+ aShapeProperties[ (*aShapePropIter).first ] = (*aShapePropIter).second;
+ }
// applying properties
PropertySet aPropSet( xSet );
diff --git a/oox/source/drawingml/shapecontext.cxx b/oox/source/drawingml/shapecontext.cxx
index 83f1e8670..62db6c090 100644
--- a/oox/source/drawingml/shapecontext.cxx
+++ b/oox/source/drawingml/shapecontext.cxx
@@ -90,7 +90,7 @@ Reference< XFastContextHandler > ShapeContext::createFastChildContext( sal_Int32
break;
case XML_ph:
mpShapePtr->setSubType( xAttribs->getOptionalValueToken( XML_type, XML_obj ) );
- mpShapePtr->setIndex( xAttribs->getOptionalValue( XML_idx ).toInt32() );
+ 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 0e7935609..118941db0 100644
--- a/oox/source/drawingml/shapegroupcontext.cxx
+++ b/oox/source/drawingml/shapegroupcontext.cxx
@@ -75,7 +75,7 @@ Reference< XFastContextHandler > ShapeGroupContext::createFastChildContext( sal_
break;
case XML_ph:
mpGroupShapePtr->setSubType( xAttribs->getOptionalValueToken( XML_type, FastToken::DONTKNOW ) );
- mpGroupShapePtr->setIndex( xAttribs->getOptionalValue( XML_idx ).toInt32() );
+ mpGroupShapePtr->setSubTypeIndex( xAttribs->getOptionalValue( XML_idx ).toInt32() );
break;
// nvSpPr CT_ShapeNonVisual end
diff --git a/oox/source/drawingml/textbodycontext.cxx b/oox/source/drawingml/textbodycontext.cxx
index 4962264a9..390767018 100644
--- a/oox/source/drawingml/textbodycontext.cxx
+++ b/oox/source/drawingml/textbodycontext.cxx
@@ -109,7 +109,7 @@ Reference< XFastContextHandler > TextParagraphContext::createFastChildContext( s
xRet.set( new TextParagraphPropertiesContext( *this, xAttribs, mrParagraph.getProperties() ) );
break;
case NMSP_DRAWINGML|XML_endParaRPr:
- xRet.set( new TextParagraphPropertiesContext( *this, xAttribs, mrParagraph.getEndProperties() ) );
+ xRet.set( new TextCharacterPropertiesContext( *this, xAttribs, mrParagraph.getEndProperties() ) );
break;
}
diff --git a/oox/source/drawingml/textbodypropertiescontext.cxx b/oox/source/drawingml/textbodypropertiescontext.cxx
index ef86f0bf0..d7c1a304b 100644
--- a/oox/source/drawingml/textbodypropertiescontext.cxx
+++ b/oox/source/drawingml/textbodypropertiescontext.cxx
@@ -28,6 +28,8 @@
#include "oox/drawingml/textbodypropertiescontext.hxx"
#include <com/sun/star/text/ControlCharacter.hpp>
+#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
+#include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
#include "oox/drawingml/textbodyproperties.hxx"
#include "oox/drawingml/drawingmltypes.hxx"
#include "oox/helper/attributelist.hxx"
@@ -38,6 +40,7 @@
using ::rtl::OUString;
using namespace ::oox::core;
+using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::text;
using namespace ::com::sun::star::xml::sax;
@@ -56,7 +59,7 @@ TextBodyPropertiesContext::TextBodyPropertiesContext( ContextHandler& rParent,
// ST_TextWrappingType
sal_Int32 nWrappingType = aAttribs.getToken( XML_wrap, XML_square );
- mrTextBodyProp.maPropertyMap[ PROP_TextWordWrap ] <<= (nWrappingType == XML_square);
+ mrTextBodyProp.maPropertyMap[ PROP_TextWordWrap ] <<= static_cast< sal_Bool >( nWrappingType == XML_square );
// ST_Coordinate
OUString sValue;
@@ -78,7 +81,17 @@ TextBodyPropertiesContext::TextBodyPropertiesContext( ContextHandler& rParent,
// ST_TextAnchoringType
-// sal_Int32 nAnchoringType = xAttributes->getOptionalValueToken( XML_anchor, XML_t );
+ 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;
// bool bAnchorCenter = aAttribs.getBool( XML_anchorCtr, false );
diff --git a/oox/source/drawingml/textcharacterpropertiescontext.cxx b/oox/source/drawingml/textcharacterpropertiescontext.cxx
index 86704ab41..460cbba82 100644
--- a/oox/source/drawingml/textcharacterpropertiescontext.cxx
+++ b/oox/source/drawingml/textcharacterpropertiescontext.cxx
@@ -56,13 +56,20 @@ TextCharacterPropertiesContext::TextCharacterPropertiesContext(
, mrTextCharacterProperties( rTextCharacterProperties )
{
AttributeList aAttribs( rXAttributes );
- mrTextCharacterProperties.moLang = aAttribs.getString( XML_lang );
- mrTextCharacterProperties.moHeight = aAttribs.getInteger( XML_sz );
- mrTextCharacterProperties.moUnderline = aAttribs.getToken( XML_u );
- mrTextCharacterProperties.moStrikeout = aAttribs.getToken( XML_strike );
-// mrTextCharacterProperties.moCaseMap = aAttribs.getToken( XML_cap );
- mrTextCharacterProperties.moBold = aAttribs.getBool( XML_b );
- mrTextCharacterProperties.moItalic = aAttribs.getBool( XML_i );
+ if ( aAttribs.hasAttribute( XML_lang ) )
+ mrTextCharacterProperties.moLang = aAttribs.getString( XML_lang );
+ if ( aAttribs.hasAttribute( XML_sz ) )
+ mrTextCharacterProperties.moHeight = aAttribs.getInteger( XML_sz );
+ if ( aAttribs.hasAttribute( XML_u ) )
+ mrTextCharacterProperties.moUnderline = aAttribs.getToken( XML_u );
+ if ( aAttribs.hasAttribute( XML_strike ) )
+ mrTextCharacterProperties.moStrikeout = aAttribs.getToken( XML_strike );
+
+// mrTextCharacterProperties.moCaseMap = aAttribs.getToken( XML_cap );
+ if ( aAttribs.hasAttribute( XML_b ) )
+ mrTextCharacterProperties.moBold = aAttribs.getBool( XML_b );
+ if ( aAttribs.hasAttribute( XML_i ) )
+ mrTextCharacterProperties.moItalic = aAttribs.getBool( XML_i );
// TODO
/* todo: we need to be able to iterate over the XFastAttributes
diff --git a/oox/source/drawingml/textparagraph.cxx b/oox/source/drawingml/textparagraph.cxx
index 1ff785412..a4bef1a50 100644
--- a/oox/source/drawingml/textparagraph.cxx
+++ b/oox/source/drawingml/textparagraph.cxx
@@ -29,6 +29,7 @@
#include "oox/drawingml/drawingmltypes.hxx"
#include <rtl/ustring.hxx>
+#include "oox/helper/propertyset.hxx"
#include <com/sun/star/text/XText.hpp>
#include <com/sun/star/text/XTextCursor.hpp>
#include <com/sun/star/text/ControlCharacter.hpp>
@@ -78,11 +79,21 @@ void TextParagraph::insertAt(
xText->insertControlCharacter( xStart, ControlCharacter::APPEND_PARAGRAPH, sal_False );
xAt->gotoEnd( sal_True );
}
+ if ( maRuns.begin() == maRuns.end() )
+ {
+ PropertySet aPropSet( xStart );
- for( TextRunVector::const_iterator aIt = maRuns.begin(), aEnd = maRuns.end(); aIt != aEnd; ++aIt )
+ TextCharacterProperties aTextCharacterProps( aTextCharacterStyle );
+ aTextCharacterProps.assignUsed( maEndProperties );
+ aTextCharacterProps.pushToPropSet( aPropSet, rFilterBase );
+ }
+ else
{
- (*aIt)->insertAt( rFilterBase, xText, xAt, aTextCharacterStyle );
- nParagraphSize += (*aIt)->getText().getLength();
+ for( TextRunVector::const_iterator aIt = maRuns.begin(), aEnd = maRuns.end(); aIt != aEnd; ++aIt )
+ {
+ (*aIt)->insertAt( rFilterBase, xText, xAt, aTextCharacterStyle );
+ nParagraphSize += (*aIt)->getText().getLength();
+ }
}
xAt->gotoEnd( sal_True );
@@ -94,7 +105,6 @@ void TextParagraph::insertAt(
pTextParagraphStyle->pushToPropSet( rFilterBase, xProps, aioBulletList, NULL, sal_False, fCharacterSize );
fCharacterSize = pTextParagraphStyle->getCharHeightPoints( 18 );
}
-
maProperties.pushToPropSet( rFilterBase, xProps, aioBulletList, &pTextParagraphStyle->getBulletList(), sal_True, fCharacterSize );
// empty paragraphs do not have bullets in ppt
diff --git a/oox/source/ppt/pptshapecontext.cxx b/oox/source/ppt/pptshapecontext.cxx
index 34b28e6fd..a69b5b0f1 100644
--- a/oox/source/ppt/pptshapecontext.cxx
+++ b/oox/source/ppt/pptshapecontext.cxx
@@ -63,7 +63,7 @@ PPTShapeContext::PPTShapeContext( ContextHandler& rParent, const SlidePersistPtr
{
}
-oox::drawingml::ShapePtr findPlaceholder( const sal_Int32 nMasterPlaceholder, std::vector< oox::drawingml::ShapePtr >& rShapes )
+oox::drawingml::ShapePtr findPlaceholder( const sal_Int32 nMasterPlaceholder, sal_Int32 nSubTypeIndex, std::vector< oox::drawingml::ShapePtr >& rShapes )
{
oox::drawingml::ShapePtr aShapePtr;
std::vector< oox::drawingml::ShapePtr >::reverse_iterator aRevIter( rShapes.rbegin() );
@@ -71,11 +71,14 @@ oox::drawingml::ShapePtr findPlaceholder( const sal_Int32 nMasterPlaceholder, st
{
if ( (*aRevIter)->getSubType() == nMasterPlaceholder )
{
- aShapePtr = *aRevIter;
- break;
+ if ( ( nSubTypeIndex == -1 ) || ( nSubTypeIndex == (*aRevIter)->getSubTypeIndex() ) )
+ {
+ aShapePtr = *aRevIter;
+ break;
+ }
}
std::vector< oox::drawingml::ShapePtr >& rChildren = (*aRevIter)->getChildren();
- aShapePtr = findPlaceholder( nMasterPlaceholder, rChildren );
+ aShapePtr = findPlaceholder( nMasterPlaceholder, nSubTypeIndex, rChildren );
if ( aShapePtr.get() )
break;
aRevIter++;
@@ -84,10 +87,11 @@ oox::drawingml::ShapePtr findPlaceholder( const sal_Int32 nMasterPlaceholder, st
}
// if nFirstPlaceholder can't be found, it will be searched for nSecondPlaceholder
-oox::drawingml::ShapePtr findPlaceholder( sal_Int32 nFirstPlaceholder, sal_Int32 nSecondPlaceholder, std::vector< oox::drawingml::ShapePtr >& rShapes )
+oox::drawingml::ShapePtr findPlaceholder( sal_Int32 nFirstPlaceholder, sal_Int32 nSecondPlaceholder,
+ sal_Int32 nSubTypeIndex, std::vector< oox::drawingml::ShapePtr >& rShapes )
{
- oox::drawingml::ShapePtr pPlaceholder = findPlaceholder( nFirstPlaceholder, rShapes );
- return !nSecondPlaceholder || pPlaceholder.get() ? pPlaceholder : findPlaceholder( nSecondPlaceholder, rShapes );
+ oox::drawingml::ShapePtr pPlaceholder = findPlaceholder( nFirstPlaceholder, nSubTypeIndex, rShapes );
+ return !nSecondPlaceholder || pPlaceholder.get() ? pPlaceholder : findPlaceholder( nSecondPlaceholder, nSubTypeIndex, rShapes );
}
Reference< XFastContextHandler > PPTShapeContext::createFastChildContext( sal_Int32 aElementToken, const Reference< XFastAttributeList >& xAttribs ) throw (SAXException, RuntimeException)
@@ -107,7 +111,7 @@ Reference< XFastContextHandler > PPTShapeContext::createFastChildContext( sal_In
{
sal_Int32 nSubType( xAttribs->getOptionalValueToken( XML_type, XML_obj ) );
mpShapePtr->setSubType( nSubType );
- mpShapePtr->setIndex( xAttribs->getOptionalValue( XML_idx ).toInt32() );
+ mpShapePtr->setSubTypeIndex( xAttribs->getOptionalValue( XML_idx ).toInt32() );
if ( nSubType )
{
PPTShape* pPPTShapePtr = dynamic_cast< PPTShape* >( mpShapePtr.get() );
@@ -131,7 +135,8 @@ Reference< XFastContextHandler > PPTShapeContext::createFastChildContext( sal_In
nSecondPlaceholder = XML_title;
break;
case XML_obj : // slide/layout
- nFirstPlaceholder = XML_body;
+ nFirstPlaceholder = XML_obj;
+ nSecondPlaceholder = XML_body;
break;
case XML_dt : // slide/layout/master/notes/notesmaster/handoutmaster
case XML_sldNum : // slide/layout/master/notes/notesmaster/handoutmaster
@@ -154,12 +159,13 @@ Reference< XFastContextHandler > PPTShapeContext::createFastChildContext( sal_In
{
oox::drawingml::ShapePtr pPlaceholder;
if ( eShapeLocation == Layout ) // for layout objects the referenced object can be found within the same shape tree
- pPlaceholder = findPlaceholder( nFirstPlaceholder, nSecondPlaceholder, mpSlidePersistPtr->getShapes()->getChildren() );
+ pPlaceholder = findPlaceholder( nFirstPlaceholder, nSecondPlaceholder, -1, 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() );
+ pPlaceholder = findPlaceholder( nFirstPlaceholder, nSecondPlaceholder,
+ pPPTShapePtr->getSubTypeIndex(), pMasterPersist->getShapes()->getChildren() );
}
if ( pPlaceholder.get() )
{
diff --git a/oox/source/ppt/pptshapegroupcontext.cxx b/oox/source/ppt/pptshapegroupcontext.cxx
index 28267bd22..d104e146a 100644
--- a/oox/source/ppt/pptshapegroupcontext.cxx
+++ b/oox/source/ppt/pptshapegroupcontext.cxx
@@ -76,7 +76,7 @@ Reference< XFastContextHandler > PPTShapeGroupContext::createFastChildContext( s
break;
case NMSP_PPT|XML_ph:
mpGroupShapePtr->setSubType( xAttribs->getOptionalValueToken( XML_type, FastToken::DONTKNOW ) );
- mpGroupShapePtr->setIndex( xAttribs->getOptionalValue( XML_idx ).toInt32() );
+ mpGroupShapePtr->setSubTypeIndex( xAttribs->getOptionalValue( XML_idx ).toInt32() );
break;
// nvSpPr CT_ShapeNonVisual end
diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx
index 89a25d6c4..cc5a8292e 100644
--- a/oox/source/ppt/slidepersist.cxx
+++ b/oox/source/ppt/slidepersist.cxx
@@ -67,9 +67,11 @@ SlidePersist::SlidePersist( XmlFilterBase& rFilter, sal_Bool bMaster, sal_Bool b
{
if ( pDefaultTextStyle )
{
+ /*
maTitleTextStylePtr->apply( *pDefaultTextStyle.get() );
maBodyTextStylePtr->apply( *pDefaultTextStyle.get() );
maNotesTextStylePtr->apply( *pDefaultTextStyle.get() );
+ */
maOtherTextStylePtr->apply( *pDefaultTextStyle.get() );
}
}
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index 0ecd40ee6..4d20b8f1c 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -369,6 +369,7 @@ TextOverlap
TextRightDistance
TextRotation
TextUpperDistance
+TextVerticalAdjust
TextWordWrap
TextWritingMode
Toggle