View | Details | Raw Unified | Return to issue 119467
Collapse All | Expand All

(-)filter/inc/filter/msfilter/escherex.hxx (-1 / +1 lines)
Lines 1215-1221 Link Here
1215
		sal_Bool	CreateGraphicProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
1215
		sal_Bool	CreateGraphicProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
1216
						const String& rSource, const sal_Bool bCreateFillBitmap, const sal_Bool bCreateCroppingAttributes = sal_False,
1216
						const String& rSource, const sal_Bool bCreateFillBitmap, const sal_Bool bCreateCroppingAttributes = sal_False,
1217
							const sal_Bool bFillBitmapModeAllowed = sal_True );
1217
							const sal_Bool bFillBitmapModeAllowed = sal_True );
1218
1218
		sal_Bool   CreateBlipPropertiesforOLEControl( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet, const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape);
1219
		sal_Bool	CreatePolygonProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
1219
		sal_Bool	CreatePolygonProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet,
1220
						sal_uInt32 nFlags, sal_Bool bBezier, ::com::sun::star::awt::Rectangle& rGeoRect, Polygon* pPolygon = NULL );
1220
						sal_uInt32 nFlags, sal_Bool bBezier, ::com::sun::star::awt::Rectangle& rGeoRect, Polygon* pPolygon = NULL );
1221
1221
(-)filter/inc/filter/msfilter/msocximex.hxx (-2 / +3 lines)
Lines 172-178 Link Here
172
{
172
{
173
public:
173
public:
174
	OCX_FontData() : nFontNameLen(0), fBold(0), fItalic(0), fUnderline(0),
174
	OCX_FontData() : nFontNameLen(0), fBold(0), fItalic(0), fUnderline(0),
175
		fStrike(0), nFontSize(12), nJustification(1), pFontName(0),
175
		fStrike(0), nFontSize(12), nJustification(1), nDefaultAlign(0), pFontName(0),
176
        bHasAlign(sal_False), bHasFont(sal_True) {}
176
        bHasAlign(sal_False), bHasFont(sal_True) {}
177
	~OCX_FontData()  {
177
	~OCX_FontData()  {
178
		if (pFontName)
178
		if (pFontName)
Lines 206-212 Link Here
206
	sal_uInt16 nLanguageID;
206
	sal_uInt16 nLanguageID;
207
	sal_uInt8   nJustification;
207
	sal_uInt8   nJustification;
208
    sal_uInt16  nFontWeight;
208
    sal_uInt16  nFontWeight;
209
209
	sal_Int16 nDefaultAlign;
210
	char *pFontName;
210
	char *pFontName;
211
	void SetHasAlign(sal_Bool bIn) {bHasAlign=bIn;}
211
	void SetHasAlign(sal_Bool bIn) {bHasAlign=bIn;}
212
	void SetHasFont(sal_Bool bIn) {bHasFont=bIn;}
212
	void SetHasFont(sal_Bool bIn) {bHasFont=bIn;}
Lines 1115-1120 Link Here
1115
	        msDialogType = rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlButtonModel");
1115
	        msDialogType = rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlButtonModel");
1116
	        mnForeColor = 0x80000012L;
1116
	        mnForeColor = 0x80000012L;
1117
                mnBackColor = 0x8000000FL;
1117
                mnBackColor = 0x8000000FL;
1118
                aFontData.SetHasAlign(sal_True);
1118
	}
1119
	}
1119
1120
1120
	~OCX_CommandButton() {
1121
	~OCX_CommandButton() {
(-)filter/source/msfilter/escherex.cxx (+32 lines)
Lines 24-29 Link Here
24
// MARKER(update_precomp.py): autogen include statement, do not remove
24
// MARKER(update_precomp.py): autogen include statement, do not remove
25
#include "precompiled_filter.hxx"
25
#include "precompiled_filter.hxx"
26
#include "eschesdo.hxx"
26
#include "eschesdo.hxx"
27
#include <svx/svdxcgv.hxx>
27
#include <svx/xflftrit.hxx>
28
#include <svx/xflftrit.hxx>
28
#include <filter/msfilter/escherex.hxx>
29
#include <filter/msfilter/escherex.hxx>
29
#include <svx/unoapi.hxx>
30
#include <svx/unoapi.hxx>
Lines 3616-3622 Link Here
3616
}
3617
}
3617
3618
3618
// ---------------------------------------------------------------------------------------------
3619
// ---------------------------------------------------------------------------------------------
3620
//Implement for form control export
3621
sal_Bool   EscherPropertyContainer::CreateBlipPropertiesforOLEControl(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSet, const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape)
3622
{
3623
	SdrObject* pShape = GetSdrObjectFromXShape( rXShape );
3624
	if ( pShape )
3625
	{
3626
		SdrModel* pMod = pShape->GetModel();
3627
		Graphic aGraphic(SdrExchangeView::GetObjGraphic( pMod, pShape));
3628
		
3629
        GraphicObject   aGraphicObject = aGraphic;
3630
        ByteString  aUniqueId = aGraphicObject.GetUniqueID();
3631
		if ( aUniqueId.Len() )
3632
		{
3633
			if ( pGraphicProvider && pPicOutStrm && pShapeBoundRect )
3634
			{
3635
				Rectangle aRect( Point( 0, 0 ), pShapeBoundRect->GetSize() );
3636
				
3637
				sal_uInt32 nBlibId = pGraphicProvider->GetBlibID( *pPicOutStrm, aUniqueId, aRect, NULL );
3638
				if ( nBlibId )
3639
				{					
3640
					AddOpt( ESCHER_Prop_pib, nBlibId, sal_True );
3641
					ImplCreateGraphicAttributes( rXPropSet, nBlibId, sal_False );
3642
					return sal_True;
3643
				}
3644
			}
3645
		}
3646
	}
3619
3647
3648
	return sal_False;
3649
3650
}
3651
3620
EscherPersistTable::EscherPersistTable()
3652
EscherPersistTable::EscherPersistTable()
3621
{
3653
{
3622
}
3654
}
(-)filter/source/msfilter/msocximex.cxx (-12 / +50 lines)
Lines 1370-1379 Link Here
1370
	aTmp <<= ImportColor(mnForeColor);
1370
	aTmp <<= ImportColor(mnForeColor);
1371
	rPropSet->setPropertyValue( WW8_ASCII2STR("TextColor"), aTmp);
1371
	rPropSet->setPropertyValue( WW8_ASCII2STR("TextColor"), aTmp);
1372
1372
1373
    // fake transparent push button by setting window background color
1373
	//fBackStyle is a flag. 1 means with background color. 0 means default.
1374
    if( !fBackStyle )
1374
	if( fBackStyle )
1375
        mnBackColor = 0x80000005;
1375
		aTmp <<= ImportColor(mnBackColor);
1376
	aTmp <<= ImportColor(mnBackColor);
1376
	else
1377
		aTmp = uno::Any();
1377
	rPropSet->setPropertyValue( WW8_ASCII2STR("BackgroundColor"), aTmp);
1378
	rPropSet->setPropertyValue( WW8_ASCII2STR("BackgroundColor"), aTmp);
1378
1379
1379
	sal_Bool bTemp;
1380
	sal_Bool bTemp;
Lines 1432-1449 Link Here
1432
	    aTmp >>= mnForeColor;
1433
	    aTmp >>= mnForeColor;
1433
	*rContents << ExportColor(mnForeColor);
1434
	*rContents << ExportColor(mnForeColor);
1434
1435
1436
	//fBackStyle is a flag. 1 means with background color. 0 means default.
1435
	aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("BackgroundColor"));
1437
	aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("BackgroundColor"));
1436
    if (aTmp.hasValue())
1438
    if (aTmp.hasValue())
1437
	    aTmp >>= mnBackColor;
1439
	    aTmp >>= mnBackColor;
1440
	else
1441
		fBackStyle = 0;
1438
	*rContents << ExportColor(mnBackColor);
1442
	*rContents << ExportColor(mnBackColor);
1439
1443
1440
	aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("Enabled"));
1444
	aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("Enabled"));
1441
	fEnabled = any2bool(aTmp);
1445
	fEnabled = any2bool(aTmp);
1442
	sal_uInt8 nTemp=0;//fEnabled;
1446
	sal_uInt8 nTemp=0;//fEnabled;
1443
	if (fEnabled)
1447
	if (fEnabled)
1444
		nTemp |= 0x02;
1448
		nTemp |= 0x02;//has enabled prop
1445
    if (fBackStyle)
1449
    if (fBackStyle)
1446
        nTemp |= 0x08;
1450
        nTemp |= 0x08;//has background color
1447
	*rContents << nTemp;
1451
	*rContents << nTemp;
1448
	*rContents << sal_uInt8(0x00);
1452
	*rContents << sal_uInt8(0x00);
1449
1453
Lines 1468-1474 Link Here
1468
    mbTakeFocus = any2bool( rPropSet->getPropertyValue( WW8_ASCII2STR( "FocusOnClick" ) ) );
1472
    mbTakeFocus = any2bool( rPropSet->getPropertyValue( WW8_ASCII2STR( "FocusOnClick" ) ) );
1469
1473
1470
    nFixedAreaLen = static_cast<sal_uInt16>(rContents->Tell()-nOldPos-4);
1474
    nFixedAreaLen = static_cast<sal_uInt16>(rContents->Tell()-nOldPos-4);
1471
1475
	aFontData.nDefaultAlign = 1;
1472
	bRet = aFontData.Export(rContents,rPropSet);
1476
	bRet = aFontData.Export(rContents,rPropSet);
1473
1477
1474
    rContents->Seek(nOldPos);
1478
    rContents->Seek(nOldPos);
Lines 5078-5090 Link Here
5078
	if (bHasFont)
5082
	if (bHasFont)
5079
	{
5083
	{
5080
		aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("FontWeight"));
5084
		aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("FontWeight"));
5081
		float nBold = 0;
5085
		//Export font related props
5082
		aTmp >>= nBold;
5086
		if ( aTmp.hasValue() ) 
5087
		{
5088
			float nBold = 0.0;
5089
			aTmp >>= nBold;
5090
			if ( nBold >= 150 )
5091
				fBold = 1;
5092
		}
5083
5093
5084
		if (nBold >= 150)
5094
		aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("FontSlant"));
5095
		if ( aTmp.hasValue() )
5085
		{
5096
		{
5097
			short eItalic = 0 ;
5098
			aTmp >>= eItalic ;
5099
			if ( eItalic == awt::FontSlant_ITALIC )
5100
				fItalic = 1;
5101
		}
5102
5103
		aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("FontUnderline"));
5104
		if ( aTmp.hasValue() )
5105
		{
5106
			short eUnderline = 0 ;
5107
			aTmp >>= eUnderline;
5108
			if ( eUnderline == awt::FontUnderline::SINGLE )
5109
				fUnderline = 1;
5110
		}
5111
	
5112
		aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("FontStrikeout"));
5113
		if ( aTmp.hasValue() )
5114
		{
5115
			short eLtStrikeout = 0;
5116
			aTmp >>= eLtStrikeout;
5117
			if ( eLtStrikeout == awt::FontStrikeout::SINGLE )
5118
				fStrike = 1;
5119
		}	
5120
		
5121
		sal_uInt8 nTmp= 1 * fBold  +  2* fItalic  + 4* fUnderline +  8 * fStrike; 
5122
		if ( nTmp > 0 )
5123
		{
5086
			nFlags |= 0x02;
5124
			nFlags |= 0x02;
5087
			sal_uInt8 nTmp=0x01;
5088
			*rContent << nTmp;
5125
			*rContent << nTmp;
5089
			nTmp=0x00;
5126
			nTmp=0x00;
5090
			*rContent << nTmp;
5127
			*rContent << nTmp;
Lines 5114-5120 Link Here
5114
5151
5115
			aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("Align"));
5152
			aTmp = rPropSet->getPropertyValue(WW8_ASCII2STR("Align"));
5116
			nFlags |= 0x40;
5153
			nFlags |= 0x40;
5117
			sal_Int16 nAlign(0);
5154
			sal_Int16 nAlign = nDefaultAlign;
5118
            if (aTmp.hasValue())
5155
            if (aTmp.hasValue())
5119
			    aTmp >>= nAlign;
5156
			    aTmp >>= nAlign;
5120
			nJustification = ExportAlign(nAlign);
5157
			nJustification = ExportAlign(nAlign);
Lines 5588-5593 Link Here
5588
        0x00, 0x00, 0x00, 0x45, 0x6D, 0x62, 0x65, 0x64,
5625
        0x00, 0x00, 0x00, 0x45, 0x6D, 0x62, 0x65, 0x64,
5589
        0x64, 0x65, 0x64, 0x20, 0x4F, 0x62, 0x6A, 0x65,
5626
        0x64, 0x65, 0x64, 0x20, 0x4F, 0x62, 0x6A, 0x65,
5590
        0x63, 0x74, 0x00, 0x13, 0x00, 0x00, 0x00, 0x46,
5627
        0x63, 0x74, 0x00, 0x13, 0x00, 0x00, 0x00, 0x46,
5628
        0x6F, 0x72, 0x6D, 0x73, 0x2E, 0x53, 0x70, 0x69,//Add those to avoid MS crash when open
5591
        0x6E, 0x42, 0x75, 0x74, 0x74, 0x6F, 0x6E, 0x2E,
5629
        0x6E, 0x42, 0x75, 0x74, 0x74, 0x6F, 0x6E, 0x2E,
5592
        0x31, 0x00, 0xF4, 0x39, 0xB2, 0x71, 0x00, 0x00,
5630
        0x31, 0x00, 0xF4, 0x39, 0xB2, 0x71, 0x00, 0x00,
5593
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5631
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
(-)sd/source/filter/eppt/eppt.cxx (-1 / +2 lines)
Lines 1826-1832 Link Here
1826
                if ( pPtr->xControlModel.is() )
1826
                if ( pPtr->xControlModel.is() )
1827
                {
1827
                {
1828
                    String aName;
1828
                    String aName;
1829
                    ::com::sun::star::awt::Size aSize;
1829
                    //Initialize the graphic size which will be used on export
1830
                    ::com::sun::star::awt::Size  aSize( pPtr->xShape->getSize() );
1830
                    SvStorageRef xDest( new SvStorage( new SvMemoryStream(), sal_True ) );
1831
                    SvStorageRef xDest( new SvStorage( new SvMemoryStream(), sal_True ) );
1831
                    sal_Bool bOk = SvxMSConvertOCXControls::WriteOCXStream( xDest, pPtr->xControlModel, aSize, aName );
1832
                    sal_Bool bOk = SvxMSConvertOCXControls::WriteOCXStream( xDest, pPtr->xControlModel, aSize, aName );
1832
                    if ( bOk )
1833
                    if ( bOk )
(-)sd/source/filter/eppt/epptso.cxx (+4 lines)
Lines 4543-4548 Link Here
4543
                            << nPageId;
4543
                            << nPageId;
4544
                PPTExOleObjEntry* pEntry = new PPTExOleObjEntry( OCX_CONTROL, mpExEmbed->Tell() );
4544
                PPTExOleObjEntry* pEntry = new PPTExOleObjEntry( OCX_CONTROL, mpExEmbed->Tell() );
4545
                pEntry->xControlModel = aXControlModel;
4545
                pEntry->xControlModel = aXControlModel;
4546
                pEntry->xShape = mXShape;
4546
                maExOleObj.Insert( pEntry );
4547
                maExOleObj.Insert( pEntry );
4547
4548
4548
                mnExEmbed++;
4549
                mnExEmbed++;
Lines 4616-4621 Link Here
4616
                ImplCreateShape( ESCHER_ShpInst_HostControl, nSpFlags, aSolverContainer );
4617
                ImplCreateShape( ESCHER_ShpInst_HostControl, nSpFlags, aSolverContainer );
4617
                if ( aPropOpt.CreateGraphicProperties( mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "MetaFile" ) ), sal_False  ) )
4618
                if ( aPropOpt.CreateGraphicProperties( mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "MetaFile" ) ), sal_False  ) )
4618
                    aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x800080 );
4619
                    aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x800080 );
4620
                //export form control graphic
4621
                else if ( aPropOpt.CreateBlipPropertiesforOLEControl(mXPropSet,mXShape))
4622
                    aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x800080 );
4619
                aPropOpt.AddOpt( ESCHER_Prop_pictureId, mnExEmbed );
4623
                aPropOpt.AddOpt( ESCHER_Prop_pictureId, mnExEmbed );
4620
                aPropOpt.AddOpt( ESCHER_Prop_pictureActive, 0x10000 );
4624
                aPropOpt.AddOpt( ESCHER_Prop_pictureActive, 0x10000 );
4621
4625

Return to issue 119467