summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMuthu Subramanian <sumuthu@collabora.com>2014-03-06 21:21:43 +0530
committerMuthu Subramanian <sumuthu@collabora.com>2014-03-06 21:24:19 +0530
commitf1d1c9a6529d575ba3f65872e5ae9e7ac381c6b7 (patch)
treeabb2a2b7130c30c1dba8b600ac8065eb21b6c929 /oox
parentad737e7ff4bf12d8b66ceb2001aebf54ff5badba (diff)
n#821567: Fix TextFrame background import for sw.
TextFrame in sw unfortunately doesn't seem to support nametable!
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/shape.cxx7
-rw-r--r--oox/source/helper/modelobjecthelper.cxx15
2 files changed, 22 insertions, 0 deletions
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 883d76f9227c..7d3b0dc980c3 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -35,6 +35,7 @@
#include "oox/core/xmlfilterbase.hxx"
#include "oox/helper/graphichelper.hxx"
#include "oox/helper/propertyset.hxx"
+#include "oox/helper/modelobjecthelper.hxx"
#include <tools/gen.hxx>
#include <tools/mapunit.hxx>
@@ -691,6 +692,12 @@ Reference< XShape > Shape::createAndInsert(
aShapeProps.setProperty(PROP_BackGraphicURL, aShapeProps.getProperty(PROP_FillBitmapURL));
aShapeProps.erase(PROP_FillBitmapURL);
}
+ if (aShapeProps.hasProperty(PROP_FillBitmapName))
+ {
+ uno::Any aAny = aShapeProps[PROP_FillBitmapName];
+ aShapeProps.setProperty(PROP_BackGraphicURL, rFilterBase.getModelObjectHelper().getFillBitmapUrl( aAny.get<OUString>() ));
+ // aShapeProps.erase(PROP_FillBitmapName); // Maybe, leave the name as well
+ }
// And no LineColor property; individual borders can have colors
if (aShapeProps.hasProperty(PROP_LineColor))
{
diff --git a/oox/source/helper/modelobjecthelper.cxx b/oox/source/helper/modelobjecthelper.cxx
index 5a966fe82d67..1ec45af58d55 100644
--- a/oox/source/helper/modelobjecthelper.cxx
+++ b/oox/source/helper/modelobjecthelper.cxx
@@ -56,6 +56,13 @@ bool ObjectContainer::hasObject( const OUString& rObjName ) const
return mxContainer.is() && mxContainer->hasByName( rObjName );
}
+Any ObjectContainer::getObject( const OUString& rObjName ) const
+{
+ if( hasObject( rObjName ) )
+ return mxContainer->getByName( rObjName );
+ return Any();
+}
+
OUString ObjectContainer::insertObject( const OUString& rObjName, const Any& rObj, bool bInsertByUnusedName )
{
createContainer();
@@ -132,6 +139,14 @@ OUString ModelObjectHelper::insertFillBitmapUrl( const OUString& rGraphicUrl )
return OUString();
}
+OUString ModelObjectHelper::getFillBitmapUrl( const OUString &rGraphicName )
+{
+ Any aAny = maBitmapUrlContainer.getObject( rGraphicName );
+ if( aAny.hasValue() )
+ return aAny.get<OUString>();
+ return OUString();
+}
+
} // namespace oox