Kaydet (Commit) f1d1c9a6 authored tarafından Muthu Subramanian's avatar Muthu Subramanian

n#821567: Fix TextFrame background import for sw.

TextFrame in sw unfortunately doesn't seem to
support nametable!
üst ad737e7f
......@@ -48,6 +48,8 @@ public:
/** Returns true, if the object with the passed name exists in the container. */
bool hasObject( const OUString& rObjName ) const;
::com::sun::star::uno::Any getObject( const OUString& rObjName ) const;
/** Inserts the passed object into the container, returns its final name. */
OUString insertObject(
const OUString& rObjName,
......@@ -104,6 +106,8 @@ public:
an internal constant name with a new unused index appended. */
OUString insertFillBitmapUrl( const OUString& rGraphicUrl );
OUString getFillBitmapUrl( const OUString& rGraphicName );
private:
ObjectContainer maMarkerContainer; ///< Contains all named line markers (line end polygons).
ObjectContainer maDashContainer; ///< Contains all named line dsahes.
......
......@@ -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))
{
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment