update dev300-m58
[ooovba.git] / applied_patches / 0505-sw-import-html-controls.diff
blob9d11d066664c438e0f34027e79e5b38555839d55
1 diff --git svx/inc/svx/msocximex.hxx svx/inc/svx/msocximex.hxx
2 index 733304d..4024578 100644
3 --- svx/inc/svx/msocximex.hxx
4 +++ svx/inc/svx/msocximex.hxx
5 @@ -1382,4 +1382,38 @@ public:
6 const com::sun::star::awt::Size& rSize );
7 };
10 +class HTML_TextBox : public OCX_ModernControl
12 +public:
13 + HTML_TextBox() : OCX_ModernControl(rtl::OUString::createFromAscii("TextBox")) {
14 + msFormType = rtl::OUString::createFromAscii("com.sun.star.form.component.TextField");
15 + msDialogType = rtl::OUString::createFromAscii("com.sun.star.awt.UnoControlEditModel");
16 + mnBackColor = 0x80000005L;
17 + mnForeColor = 0x80000008L;
18 + nBorderColor = 0x80000006L;
19 + aFontData.SetHasAlign(TRUE);
20 + }
22 + using OCX_ModernControl::Import; // to not hide the other two import methods
23 + virtual sal_Bool Import(com::sun::star::uno::Reference<
24 + com::sun::star::beans::XPropertySet> &rPropSet);
25 + /*
26 + sal_Bool Export(SotStorageRef &rObj,
27 + const com::sun::star::uno::Reference<
28 + com::sun::star::beans::XPropertySet> &rPropSet,
29 + const com::sun::star::awt::Size& rSize);
30 + sal_Bool WriteContents(SotStorageStreamRef &rObj,
31 + const com::sun::star::uno::Reference<
32 + com::sun::star::beans::XPropertySet> &rPropSet,
33 + const com::sun::star::awt::Size& rSize);
34 + */
35 + static OCX_Control *Create() { return new HTML_TextBox;}
37 + virtual sal_Bool Read(SotStorageStream *pS);
38 + virtual sal_Bool ReadFontData(SotStorageStream *pS);
39 +};
43 #endif
44 diff --git svx/source/msfilter/msocximex.cxx svx/source/msfilter/msocximex.cxx
45 index 07662ca..e37785c 100644
46 --- svx/source/msfilter/msocximex.cxx
47 +++ svx/source/msfilter/msocximex.cxx
48 @@ -4594,8 +4594,9 @@ OCX_map aOCXTab[] =
49 form::FormComponentType::SCROLLBAR,"ScrollBar"},
50 {&OCX_GroupBox::Create,"",
51 form::FormComponentType::GROUPBOX,""},
52 - {&OCX_ProgressBar::Create,"",
53 - form::FormComponentType::CONTROL,""}
54 + {&OCX_ProgressBar::Create,"", form::FormComponentType::CONTROL,""},
55 + {&HTML_TextBox::Create,"5512D11A-5CC6-11CF-8d67-00aa00bdce1d", form::FormComponentType::TEXTFIELD,"TextBox"},
56 + {&HTML_TextBox::Create,"5512D124-5CC6-11CF-8d67-00aa00bdce1d", form::FormComponentType::TEXTFIELD,"TextBox"}
59 const int NO_OCX = sizeof( aOCXTab ) / sizeof( *aOCXTab );
60 @@ -6105,4 +6106,103 @@ sal_Bool OCX_ProgressBar::Import(uno::Reference< beans::XPropertySet > &rPropSet
62 // ============================================================================
67 +sal_Bool HTML_TextBox::Import(com::sun::star::uno::Reference<
68 + com::sun::star::beans::XPropertySet> &rPropSet)
70 + uno::Any aTmp(&sName,getCppuType((OUString *)0));
71 + rPropSet->setPropertyValue( WW8_ASCII2STR("Name"), aTmp );
73 + aTmp = bool2any( fEnabled != 0 );
74 + rPropSet->setPropertyValue( WW8_ASCII2STR("Enabled"), aTmp);
76 + aTmp = bool2any( fLocked != 0 );
77 + rPropSet->setPropertyValue( WW8_ASCII2STR("ReadOnly"), aTmp);
79 + aTmp = bool2any( fHideSelection != 0 );
80 + rPropSet->setPropertyValue( WW8_ASCII2STR( "HideInactiveSelection" ), aTmp);
82 + aTmp <<= ImportColor(mnForeColor);
83 + rPropSet->setPropertyValue( WW8_ASCII2STR("TextColor"), aTmp);
85 + aTmp <<= ImportColor(mnBackColor);
86 + rPropSet->setPropertyValue( WW8_ASCII2STR("BackgroundColor"), aTmp);
88 + aTmp <<= ImportBorder(nSpecialEffect,nBorderStyle);
89 + rPropSet->setPropertyValue( WW8_ASCII2STR("Border"), aTmp);
91 + aTmp <<= ImportColor( nBorderColor );
92 + rPropSet->setPropertyValue( WW8_ASCII2STR("BorderColor"), aTmp);
94 + aTmp = bool2any( fMultiLine != 0 );
95 + rPropSet->setPropertyValue( WW8_ASCII2STR("MultiLine"), aTmp);
97 + sal_uInt16 nTmp = static_cast<sal_uInt16>(nMaxLength);
98 + aTmp <<= nTmp;
99 + rPropSet->setPropertyValue( WW8_ASCII2STR("MaxTextLen"), aTmp);
102 + sal_Bool bTemp1,bTemp2;
103 + uno::Any aBarsH,aBarsV;
104 + switch(nScrollBars)
106 + case 1:
107 + bTemp1 = sal_True;
108 + bTemp2 = sal_False;
109 + break;
110 + case 2:
111 + bTemp1 = sal_False;
112 + bTemp2 = sal_True;
113 + break;
114 + case 3:
115 + bTemp1 = sal_True;
116 + bTemp2 = sal_True;
117 + break;
118 + case 0:
119 + default:
120 + bTemp1 = sal_False;
121 + bTemp2 = sal_False;
122 + break;
125 + aBarsH = bool2any(bTemp1);
126 + aBarsV = bool2any(bTemp2);
127 + rPropSet->setPropertyValue( WW8_ASCII2STR("HScroll"), aBarsH);
128 + rPropSet->setPropertyValue( WW8_ASCII2STR("VScroll"), aBarsV);
130 + nTmp = nPasswordChar;
131 + aTmp <<= nTmp;
132 + rPropSet->setPropertyValue( WW8_ASCII2STR("EchoChar"), aTmp);
134 + if (pValue)
136 + aTmp <<= lclCreateOUString( pValue, nValueLen );
137 + // DefaultText seems to no longer be in UnoEditControlModel
138 + if ( bSetInDialog )
140 + rPropSet->setPropertyValue( WW8_ASCII2STR("Text"), aTmp);
142 + else
144 + rPropSet->setPropertyValue( WW8_ASCII2STR("DefaultText"), aTmp);
148 + // aFontData.Import(rPropSet);
149 + return sal_True;
152 +sal_Bool HTML_TextBox::Read(SotStorageStream *pS)
154 + return sal_True;
157 +sal_Bool HTML_TextBox::ReadFontData(SotStorageStream *pS)
159 + return sal_True;
163 /* vi:set tabstop=4 shiftwidth=4 expandtab: */
164 diff --git sw/source/filter/ww8/ww8par.hxx sw/source/filter/ww8/ww8par.hxx
165 index d8a789d..89ab0d6 100644
166 --- sw/source/filter/ww8/ww8par.hxx
167 +++ sw/source/filter/ww8/ww8par.hxx
168 @@ -1579,6 +1579,8 @@ public: // eigentlich private, geht aber leider nur public
169 eF_ResT Read_F_OCX(WW8FieldDesc*, String&);
170 eF_ResT Read_F_Hyperlink(WW8FieldDesc*, String& rStr);
171 eF_ResT Read_F_Shape(WW8FieldDesc* pF, String& rStr);
172 + eF_ResT Read_F_HTMLControl( WW8FieldDesc* pF, String& rStr);
175 void DeleteFormImpl();
177 diff --git sw/source/filter/ww8/ww8par3.cxx sw/source/filter/ww8/ww8par3.cxx
178 index 7ce8b98..e22f257 100644
179 --- sw/source/filter/ww8/ww8par3.cxx
180 +++ sw/source/filter/ww8/ww8par3.cxx
181 @@ -313,6 +313,14 @@ eF_ResT SwWW8ImplReader::Read_F_FormListBox( WW8FieldDesc* pF, String& rStr)
185 +eF_ResT SwWW8ImplReader::Read_F_HTMLControl( WW8FieldDesc* pF, String& rStr)
187 + if( bObj && nPicLocFc )
188 + nObjLocFc = nPicLocFc;
189 + bEmbeddObj = true;
190 + return FLD_TEXT;
193 void SwWW8ImplReader::DeleteFormImpl()
195 delete pFormImpl, pFormImpl = 0;
196 diff --git sw/source/filter/ww8/ww8par5.cxx sw/source/filter/ww8/ww8par5.cxx
197 index 331dcb4..968e1b1 100644
198 --- sw/source/filter/ww8/ww8par5.cxx
199 +++ sw/source/filter/ww8/ww8par5.cxx
200 @@ -917,7 +917,7 @@ long SwWW8ImplReader::Read_Field(WW8PLCFManResult* pRes)
201 &SwWW8ImplReader::Read_F_Hyperlink, // 88
202 0, // 89
203 0, // 90
204 - 0, // 91
205 + &SwWW8ImplReader::Read_F_HTMLControl, // 91
206 0, // 92
207 0, // 93
208 0, // 94