summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-05-06 17:00:40 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-05-06 17:11:44 +0200
commitf0d6137c4e61bea3bed2b201a83a8e7a66065114 (patch)
tree21fb7e92907d18a8f4543166bdd572a461a1bd45
parentd3832fc60d42fedf2ba9a49b8d353a3d1265a38f (diff)
oox: prepare for importing a TextBox property on shapes
Writer's SwXShape doesn't have that property yet, though. Change-Id: I997eb188574fab93d35595972fdc2eaebabc015b
-rw-r--r--include/oox/drawingml/shape.hxx2
-rw-r--r--oox/source/drawingml/shape.cxx12
-rw-r--r--oox/source/shape/WpsContext.cxx1
-rw-r--r--oox/source/token/properties.txt1
4 files changed, 16 insertions, 0 deletions
diff --git a/include/oox/drawingml/shape.hxx b/include/oox/drawingml/shape.hxx
index 926f223ecd08..fcb499940019 100644
--- a/include/oox/drawingml/shape.hxx
+++ b/include/oox/drawingml/shape.hxx
@@ -180,6 +180,7 @@ public:
bool getLockedCanvas();
void setWps(bool bWps);
bool getWps();
+ void setTextBox(bool bTextBox);
const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> &
getDiagramDoms() { return maDiagramDoms; }
void setDiagramDoms(const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& rDiagramDoms) { maDiagramDoms = rDiagramDoms; }
@@ -293,6 +294,7 @@ private:
// to propagate it when applying reference shape
bool mbLockedCanvas; ///< Is this shape part of a locked canvas?
bool mbWps; ///< Is this a wps shape?
+ bool mbTextBox; ///< This shape has a textbox.
LinkedTxbxAttr maLinkedTxbxAttr;
bool mbHasLinkedTxbx; // this text box has linked text box ?
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 72a7920d26e4..a83fe4911698 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -105,6 +105,7 @@ Shape::Shape( const sal_Char* pServiceName, bool bDefaultHeight )
, mbHiddenMasterShape( false )
, mbLockedCanvas( false )
, mbWps( false )
+, mbTextBox( false )
, mbHasLinkedTxbx( false )
, maDiagramDoms( 0 )
{
@@ -143,6 +144,7 @@ Shape::Shape( const ShapePtr& pSourceShape )
, mbHiddenMasterShape( pSourceShape->mbHiddenMasterShape )
, mbLockedCanvas( pSourceShape->mbLockedCanvas )
, mbWps( pSourceShape->mbWps )
+, mbTextBox( pSourceShape->mbTextBox )
, maLinkedTxbxAttr()
, mbHasLinkedTxbx(false)
, maDiagramDoms( pSourceShape->maDiagramDoms )
@@ -283,6 +285,11 @@ bool Shape::getWps()
return mbWps;
}
+void Shape::setTextBox(bool bTextBox)
+{
+ mbTextBox = bTextBox;
+}
+
void Shape::applyShapeReference( const Shape& rReferencedShape, bool bUseText )
{
SAL_INFO("oox", OSL_THIS_FUNC << "apply shape reference: " << rReferencedShape.msId << " to shape id: " << msId);
@@ -815,6 +822,11 @@ Reference< XShape > Shape::createAndInsert(
aShapeProps.setProperty(PROP_ShadowFormat, uno::makeAny(aFormat));
}
}
+ else if (mbTextBox)
+ {
+ //No such property yet
+ //aShapeProps.setProperty(PROP_TextBox, uno::makeAny(true));
+ }
PropertySet( xSet ).setProperties( aShapeProps );
if (mbLockedCanvas)
diff --git a/oox/source/shape/WpsContext.cxx b/oox/source/shape/WpsContext.cxx
index fa1730471727..ed2b1de4de2d 100644
--- a/oox/source/shape/WpsContext.cxx
+++ b/oox/source/shape/WpsContext.cxx
@@ -117,6 +117,7 @@ oox::core::ContextHandlerRef WpsContext::onCreateContext(sal_Int32 nElementToken
{
mpShape->getCustomShapeProperties()->setShapeTypeOverride(true);
mpShape->setServiceName("com.sun.star.text.TextFrame");
+ mpShape->setTextBox(true);
//in case if the textbox is linked, save the attributes
//for further processing.
if (rAttribs.hasAttribute(XML_id))
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index e6b824e648e1..0ad6d7a1a4c1 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -496,6 +496,7 @@ Tag
TargetFrame
Text
TextAutoGrowHeight
+TextBox
TextBreak
TextColor
TextFitToSize