Kaydet (Commit) 0ecc381c authored tarafından Andre Fischer's avatar Andre Fischer

#i119537# Fixed extrusion of custom shapes to XLS.

Patch by: Jianyuan Li
review by: Andre Fischer
üst f58ffc9e
......@@ -4810,6 +4810,14 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
mpTracer->RemoveAttribute( aObjData.nSpFlags & SP_FGROUP
? rtl::OUString::createFromAscii( "GroupShape" )
: rtl::OUString::createFromAscii( "Shape" ) );
//Import alt text as description
if ( pRet && SeekToContent( DFF_Prop_wzDescription, rSt ) )
{
String aAltText;
MSDFFReadZString( rSt, aAltText, GetPropertyValue( DFF_Prop_wzDescription ), sal_True );
pRet->SetDescription( aAltText );
}
return pRet;
}
......
......@@ -554,6 +554,13 @@ XclExpTbxControlObj::XclExpTbxControlObj( XclExpObjectManager& rObjMgr, Referenc
if( aCtrlProp.GetProperty( aCtrlName, CREATE_OUSTRING( "Name" ) ) && (aCtrlName.getLength() > 0) )
aPropOpt.AddOpt( ESCHER_Prop_wzName, aCtrlName );
//Export description as alt text
if( SdrObject* pSdrObj = SdrObject::getSdrObjectFromXShape( xShape ) )
{
String aAltTxt( pSdrObj->GetDescription(), 0, MSPROP_DESCRIPTION_MAX_LEN );
aPropOpt.AddOpt( ESCHER_Prop_wzDescription, aAltTxt );
}
// write DFF property set to stream
aPropOpt.Commit( mrEscherEx.GetStream() );
......
......@@ -109,6 +109,7 @@
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
using ::com::sun::star::uno::makeAny;
using ::com::sun::star::uno::Any;
using ::com::sun::star::uno::Exception;
using ::com::sun::star::uno::Reference;
......@@ -1965,6 +1966,20 @@ void XclImpTbxObjBase::ConvertLabel( ScfPropertySet& rPropSet ) const
aLabel.Insert( '~', nPos );
}
rPropSet.SetStringProperty( CREATE_OUSTRING( "Label" ), aLabel );
//Excel Alt text <==> Aoo description
//For TBX control, if user does not operate alt text, alt text will be set label text as default value in Excel.
//In this case, DFF_Prop_wzDescription will not be set in excel file.
//So In the end of SvxMSDffManager::ImportShape, description will not be set. But actually in excel,
//the alt text is the label value. So here set description as label text first which is called before ImportShape.
Reference< ::com::sun::star::beans::XPropertySet > xPropset( mxShape, UNO_QUERY );
try{
if(xPropset.is())
xPropset->setPropertyValue( CREATE_OUSTRING( "Description" ), makeAny(::rtl::OUString(aLabel)) );
}catch( ... )
{
OSL_TRACE( " Can't set a default text for TBX Control ");
}
}
ConvertFont( rPropSet );
}
......
......@@ -497,6 +497,8 @@ protected:
/** Derived classes will set additional properties for the current form control. */
virtual void DoProcessControl( ScfPropertySet& rPropSet ) const;
mutable ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
mxShape; /// The UNO wrapper of the control shape.
private:
/** Reads a list of cell ranges from a formula at the current stream position. */
......@@ -506,8 +508,6 @@ private:
private:
const XclImpRoot& mrRoot; /// Not derived from XclImpRoot to allow multiple inheritance.
mutable ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
mxShape; /// The UNO wrapper of the control shape.
ScfRef< ScAddress > mxCellLink; /// Linked cell in the Calc document.
ScfRef< ScRange > mxSrcRange; /// Source data range in the Calc document.
XclCtrlBindMode meBindMode; /// Value binding mode.
......
......@@ -1220,4 +1220,7 @@ sal_uInt8 m_bTag;
void *m_pvBits; // raster bits of the blip.
#endif
//ALT_TXT_MSINTEROP
#define MSPROP_DESCRIPTION_MAX_LEN 4096
#endif
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