Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #include "hintids.hxx"
30 : : #include <vcl/svapp.hxx>
31 : : #include <vcl/wrkwin.hxx>
32 : : #include <svx/svdmodel.hxx>
33 : : #include <svx/svdpage.hxx>
34 : : #include <svx/svdobj.hxx>
35 : : #include <svx/svdotext.hxx>
36 : : #include <editeng/eeitem.hxx>
37 : :
38 : : #ifndef _OUTLINER_HXX //autogen
39 : : #define _EEITEMID_HXX
40 : : #include <editeng/outliner.hxx>
41 : : #endif
42 : : #include <svx/xfillit.hxx>
43 : : #include <editeng/colritem.hxx>
44 : : #include <editeng/brshitem.hxx>
45 : : #include <editeng/lrspitem.hxx>
46 : : #include <editeng/ulspitem.hxx>
47 : : #include <svl/itemiter.hxx>
48 : : #include <svl/whiter.hxx>
49 : : #include <svtools/htmlout.hxx>
50 : : #include <svtools/htmltokn.h>
51 : : #include <svtools/htmlkywd.hxx>
52 : : #include <svx/svdpool.hxx>
53 : :
54 : :
55 : : #include "charatr.hxx"
56 : : #include <frmfmt.hxx>
57 : : #include <fmtanchr.hxx>
58 : : #include <fmtsrnd.hxx>
59 : : #include "ndtxt.hxx"
60 : : #include "doc.hxx"
61 : : #include "dcontact.hxx"
62 : : #include "poolfmt.hxx"
63 : : #include "swcss1.hxx"
64 : : #include "swhtml.hxx"
65 : : #include "wrthtml.hxx"
66 : : #include <rtl/strbuf.hxx>
67 : :
68 : : using namespace ::com::sun::star;
69 : :
70 : :
71 : : const sal_uInt32 HTML_FRMOPTS_MARQUEE =
72 : : HTML_FRMOPT_ALIGN |
73 : : HTML_FRMOPT_SPACE;
74 : :
75 : : const sal_uInt32 HTML_FRMOPTS_MARQUEE_CSS1 =
76 : : HTML_FRMOPT_S_ALIGN |
77 : : HTML_FRMOPT_S_SPACE;
78 : :
79 : : static HTMLOptionEnum aHTMLMarqBehaviorTable[] =
80 : : {
81 : : { OOO_STRING_SVTOOLS_HTML_BEHAV_scroll, SDRTEXTANI_SCROLL },
82 : : { OOO_STRING_SVTOOLS_HTML_BEHAV_alternate, SDRTEXTANI_ALTERNATE },
83 : : { OOO_STRING_SVTOOLS_HTML_BEHAV_slide, SDRTEXTANI_SLIDE },
84 : : { 0, 0 }
85 : : };
86 : :
87 : : static HTMLOptionEnum aHTMLMarqDirectionTable[] =
88 : : {
89 : : { OOO_STRING_SVTOOLS_HTML_AL_left, SDRTEXTANI_LEFT },
90 : : { OOO_STRING_SVTOOLS_HTML_AL_right, SDRTEXTANI_RIGHT },
91 : : { 0, 0 }
92 : : };
93 : :
94 : 0 : void SwHTMLParser::InsertDrawObject( SdrObject* pNewDrawObj,
95 : : const Size& rPixSpace,
96 : : sal_Int16 eVertOri,
97 : : sal_Int16 eHoriOri,
98 : : SfxItemSet& rCSS1ItemSet,
99 : : SvxCSS1PropertyInfo& rCSS1PropInfo,
100 : : sal_Bool bHidden )
101 : : {
102 : : // always on top of text.
103 : : // but in invisible layer. <ConnectToLayout> will move the object
104 : : // to the visible layer.
105 [ # # ][ # # ]: 0 : pNewDrawObj->SetLayer( pDoc->GetInvisibleHeavenId() );
106 : :
107 : 0 : SfxItemSet aFrmSet( pDoc->GetAttrPool(),
108 [ # # ]: 0 : RES_FRMATR_BEGIN, RES_FRMATR_END-1 );
109 [ # # ]: 0 : if( !IsNewDoc() )
110 [ # # ]: 0 : Reader::ResetFrmFmtAttrs( aFrmSet );
111 : :
112 : 0 : sal_uInt16 nLeftSpace = 0, nRightSpace = 0, nUpperSpace = 0, nLowerSpace = 0;
113 [ # # ][ # # ]: 0 : if( (rPixSpace.Width() || rPixSpace.Height()) && Application::GetDefaultDevice() )
[ # # ][ # # ]
[ # # ]
114 : : {
115 : 0 : Size aTwipSpc( rPixSpace.Width(), rPixSpace.Height() );
116 : : aTwipSpc =
117 : : Application::GetDefaultDevice()->PixelToLogic( aTwipSpc,
118 [ # # ][ # # ]: 0 : MapMode(MAP_TWIP) );
[ # # ][ # # ]
119 : 0 : nLeftSpace = nRightSpace = (sal_uInt16)aTwipSpc.Width();
120 : 0 : nUpperSpace = nLowerSpace = (sal_uInt16)aTwipSpc.Height();
121 : : }
122 : :
123 : : // linken/rechten Rand setzen
124 : : const SfxPoolItem *pItem;
125 [ # # ][ # # ]: 0 : if( SFX_ITEM_SET==rCSS1ItemSet.GetItemState( RES_LR_SPACE, sal_True, &pItem ) )
126 : : {
127 : : // Ggf. den Erstzeilen-Einzug noch plaetten
128 : 0 : const SvxLRSpaceItem *pLRItem = (const SvxLRSpaceItem *)pItem;
129 [ # # ]: 0 : SvxLRSpaceItem aLRItem( *pLRItem );
130 [ # # ]: 0 : aLRItem.SetTxtFirstLineOfst( 0 );
131 [ # # ]: 0 : if( rCSS1PropInfo.bLeftMargin )
132 : : {
133 : 0 : nLeftSpace = static_cast< sal_uInt16 >(aLRItem.GetLeft());
134 : 0 : rCSS1PropInfo.bLeftMargin = sal_False;
135 : : }
136 [ # # ]: 0 : if( rCSS1PropInfo.bRightMargin )
137 : : {
138 : 0 : nRightSpace = static_cast< sal_uInt16 >(aLRItem.GetRight());
139 : 0 : rCSS1PropInfo.bRightMargin = sal_False;
140 : : }
141 [ # # ][ # # ]: 0 : rCSS1ItemSet.ClearItem( RES_LR_SPACE );
142 : : }
143 [ # # ][ # # ]: 0 : if( nLeftSpace || nRightSpace )
144 : : {
145 [ # # ]: 0 : SvxLRSpaceItem aLRItem( RES_LR_SPACE );
146 : 0 : aLRItem.SetLeft( nLeftSpace );
147 : 0 : aLRItem.SetRight( nRightSpace );
148 [ # # ][ # # ]: 0 : aFrmSet.Put( aLRItem );
149 : : }
150 : :
151 : : // oberen/unteren Rand setzen
152 [ # # ][ # # ]: 0 : if( SFX_ITEM_SET==rCSS1ItemSet.GetItemState( RES_UL_SPACE, sal_True, &pItem ) )
153 : : {
154 : : // Ggf. den Erstzeilen-Einzug noch plaetten
155 : 0 : const SvxULSpaceItem *pULItem = (const SvxULSpaceItem *)pItem;
156 [ # # ]: 0 : if( rCSS1PropInfo.bTopMargin )
157 : : {
158 : 0 : nUpperSpace = pULItem->GetUpper();
159 : 0 : rCSS1PropInfo.bTopMargin = sal_False;
160 : : }
161 [ # # ]: 0 : if( rCSS1PropInfo.bBottomMargin )
162 : : {
163 : 0 : nLowerSpace = pULItem->GetLower();
164 : 0 : rCSS1PropInfo.bBottomMargin = sal_False;
165 : : }
166 : :
167 [ # # ]: 0 : rCSS1ItemSet.ClearItem( RES_UL_SPACE );
168 : : }
169 [ # # ][ # # ]: 0 : if( nUpperSpace || nLowerSpace )
170 : : {
171 [ # # ]: 0 : SvxULSpaceItem aULItem( RES_UL_SPACE );
172 : 0 : aULItem.SetUpper( nUpperSpace );
173 : 0 : aULItem.SetLower( nLowerSpace );
174 [ # # ][ # # ]: 0 : aFrmSet.Put( aULItem );
175 : : }
176 : :
177 [ # # ]: 0 : SwFmtAnchor aAnchor( FLY_AS_CHAR );
178 [ # # ][ # # ]: 0 : if( SVX_CSS1_POS_ABSOLUTE == rCSS1PropInfo.ePosition &&
[ # # ]
179 : : SVX_CSS1_LTYPE_TWIP == rCSS1PropInfo.eLeftType &&
180 : : SVX_CSS1_LTYPE_TWIP == rCSS1PropInfo.eTopType )
181 : : {
182 : : const SwStartNode *pFlySttNd =
183 [ # # ]: 0 : pPam->GetPoint()->nNode.GetNode().FindFlyStartNode();
184 : :
185 [ # # ]: 0 : if( pFlySttNd )
186 : : {
187 : 0 : aAnchor.SetType( FLY_AT_FLY );
188 [ # # ]: 0 : SwPosition aPos( *pFlySttNd );
189 [ # # ][ # # ]: 0 : aAnchor.SetAnchor( &aPos );
190 : : }
191 : : else
192 : : {
193 : 0 : aAnchor.SetType( FLY_AT_PAGE );
194 : : }
195 : : // #i26791# - direct positioning for <SwDoc::Insert(..)>
196 : : pNewDrawObj->SetRelativePos( Point(rCSS1PropInfo.nLeft + nLeftSpace,
197 [ # # ]: 0 : rCSS1PropInfo.nTop + nUpperSpace) );
198 [ # # ][ # # ]: 0 : aFrmSet.Put( SwFmtSurround(SURROUND_THROUGHT) );
[ # # ]
199 : : }
200 [ # # ][ # # ]: 0 : else if( SVX_ADJUST_LEFT == rCSS1PropInfo.eFloat ||
201 : : text::HoriOrientation::LEFT == eHoriOri )
202 : : {
203 : 0 : aAnchor.SetType( FLY_AT_PARA );
204 : : aFrmSet.Put( SwFmtSurround(bHidden ? SURROUND_THROUGHT
205 [ # # ][ # # ]: 0 : : SURROUND_RIGHT) );
[ # # ][ # # ]
206 : : // #i26791# - direct positioning for <SwDoc::Insert(..)>
207 [ # # ]: 0 : pNewDrawObj->SetRelativePos( Point(nLeftSpace, nUpperSpace) );
208 : : }
209 [ # # ]: 0 : else if( text::VertOrientation::NONE != eVertOri )
210 : : {
211 [ # # ][ # # ]: 0 : aFrmSet.Put( SwFmtVertOrient( 0, eVertOri ) );
[ # # ]
212 : : }
213 : :
214 [ # # ]: 0 : if (FLY_AT_PAGE == aAnchor.GetAnchorId())
215 : : {
216 : 0 : aAnchor.SetPageNum( 1 );
217 : : }
218 [ # # ]: 0 : else if( FLY_AT_FLY != aAnchor.GetAnchorId() )
219 : : {
220 [ # # ]: 0 : aAnchor.SetAnchor( pPam->GetPoint() );
221 : : }
222 [ # # ]: 0 : aFrmSet.Put( aAnchor );
223 : :
224 [ # # ][ # # ]: 0 : pDoc->Insert( *pPam, *pNewDrawObj, &aFrmSet, NULL );
[ # # ]
225 : 0 : }
226 : :
227 : :
228 : 0 : static void PutEEPoolItem( SfxItemSet &rEEItemSet,
229 : : const SfxPoolItem& rSwItem )
230 : : {
231 : :
232 : 0 : sal_uInt16 nEEWhich = 0;
233 : :
234 [ # # # # : 0 : switch( rSwItem.Which() )
# # # # #
# # # # #
# # # #
# ]
235 : : {
236 : 0 : case RES_CHRATR_COLOR: nEEWhich = EE_CHAR_COLOR; break;
237 : 0 : case RES_CHRATR_CROSSEDOUT: nEEWhich = EE_CHAR_STRIKEOUT; break;
238 : 0 : case RES_CHRATR_ESCAPEMENT: nEEWhich = EE_CHAR_ESCAPEMENT; break;
239 : 0 : case RES_CHRATR_FONT: nEEWhich = EE_CHAR_FONTINFO; break;
240 : 0 : case RES_CHRATR_CJK_FONT: nEEWhich = EE_CHAR_FONTINFO_CJK; break;
241 : 0 : case RES_CHRATR_CTL_FONT: nEEWhich = EE_CHAR_FONTINFO_CTL; break;
242 : 0 : case RES_CHRATR_FONTSIZE: nEEWhich = EE_CHAR_FONTHEIGHT; break;
243 : 0 : case RES_CHRATR_CJK_FONTSIZE: nEEWhich = EE_CHAR_FONTHEIGHT_CJK; break;
244 : 0 : case RES_CHRATR_CTL_FONTSIZE: nEEWhich = EE_CHAR_FONTHEIGHT_CTL; break;
245 : 0 : case RES_CHRATR_KERNING: nEEWhich = EE_CHAR_KERNING; break;
246 : 0 : case RES_CHRATR_POSTURE: nEEWhich = EE_CHAR_ITALIC; break;
247 : 0 : case RES_CHRATR_CJK_POSTURE: nEEWhich = EE_CHAR_ITALIC_CJK; break;
248 : 0 : case RES_CHRATR_CTL_POSTURE: nEEWhich = EE_CHAR_ITALIC_CTL; break;
249 : 0 : case RES_CHRATR_UNDERLINE: nEEWhich = EE_CHAR_UNDERLINE; break;
250 : 0 : case RES_CHRATR_WEIGHT: nEEWhich = EE_CHAR_WEIGHT; break;
251 : 0 : case RES_CHRATR_CJK_WEIGHT: nEEWhich = EE_CHAR_WEIGHT_CJK; break;
252 : 0 : case RES_CHRATR_CTL_WEIGHT: nEEWhich = EE_CHAR_WEIGHT_CTL; break;
253 : : case RES_BACKGROUND:
254 : : case RES_CHRATR_BACKGROUND:
255 : : {
256 : 0 : const SvxBrushItem& rBrushItem = (const SvxBrushItem&)rSwItem;
257 [ # # ]: 0 : rEEItemSet.Put( XFillStyleItem(XFILL_SOLID) );
258 : : rEEItemSet.Put( XFillColorItem(aEmptyStr,
259 [ # # ]: 0 : rBrushItem.GetColor()) );
260 : : }
261 : 0 : break;
262 : : }
263 : :
264 [ # # ]: 0 : if( nEEWhich )
265 : : {
266 : 0 : SfxPoolItem *pEEItem = rSwItem.Clone();
267 : 0 : pEEItem->SetWhich( nEEWhich );
268 : 0 : rEEItemSet.Put( *pEEItem );
269 [ # # ]: 0 : delete pEEItem;
270 : : }
271 : 0 : }
272 : :
273 : 0 : void SwHTMLParser::NewMarquee( HTMLTable *pCurTable )
274 : : {
275 : :
276 : : OSL_ENSURE( !pMarquee, "Marquee in Marquee???" );
277 [ # # ]: 0 : aContents.Erase();
278 : :
279 [ # # ][ # # ]: 0 : String aId, aStyle, aClass;
[ # # ]
280 : :
281 : 0 : long nWidth=0, nHeight=0;
282 : 0 : sal_Bool bPrcWidth = sal_False, bDirection = sal_False, bBGColor = sal_False;
283 : 0 : Size aSpace( 0, 0 );
284 : 0 : sal_Int16 eVertOri = text::VertOrientation::TOP;
285 : 0 : sal_Int16 eHoriOri = text::HoriOrientation::NONE;
286 : 0 : SdrTextAniKind eAniKind = SDRTEXTANI_SCROLL;
287 : 0 : SdrTextAniDirection eAniDir = SDRTEXTANI_LEFT;
288 : 0 : sal_uInt16 nCount = 0, nDelay = 60;
289 : 0 : sal_Int16 nAmount = -6;
290 : 0 : Color aBGColor;
291 : :
292 [ # # ]: 0 : const HTMLOptions& rHTMLOptions = GetOptions();
293 [ # # ]: 0 : for (size_t i = 0, n = rHTMLOptions.size(); i < n; ++i)
294 : : {
295 [ # # ]: 0 : const HTMLOption& rOption = rHTMLOptions[i];
296 [ # # # # : 0 : switch( rOption.GetToken() )
# # # # #
# # # # #
# ]
297 : : {
298 : : case HTML_O_ID:
299 [ # # ]: 0 : aId = rOption.GetString();
300 : 0 : break;
301 : : case HTML_O_STYLE:
302 [ # # ]: 0 : aStyle = rOption.GetString();
303 : 0 : break;
304 : : case HTML_O_CLASS:
305 [ # # ]: 0 : aClass = rOption.GetString();
306 : 0 : break;
307 : :
308 : : case HTML_O_BEHAVIOR:
309 : : eAniKind =
310 : : (SdrTextAniKind)rOption.GetEnum( aHTMLMarqBehaviorTable,
311 [ # # ]: 0 : static_cast< sal_uInt16 >(eAniKind) );
312 : 0 : break;
313 : :
314 : : case HTML_O_BGCOLOR:
315 [ # # ]: 0 : rOption.GetColor( aBGColor );
316 : 0 : bBGColor = sal_True;
317 : 0 : break;
318 : :
319 : : case HTML_O_DIRECTION:
320 : : eAniDir =
321 : : (SdrTextAniDirection)rOption.GetEnum( aHTMLMarqDirectionTable,
322 [ # # ]: 0 : static_cast< sal_uInt16 >(eAniDir) );
323 : 0 : bDirection = sal_True;
324 : 0 : break;
325 : :
326 : : case HTML_O_LOOP:
327 [ # # ]: 0 : if( rOption.GetString().
328 [ # # ]: 0 : EqualsIgnoreCaseAscii(OOO_STRING_SVTOOLS_HTML_LOOP_infinite) )
329 : : {
330 : 0 : nCount = 0;
331 : : }
332 : : else
333 : : {
334 [ # # ]: 0 : sal_uInt32 nLoop = rOption.GetSNumber();
335 : 0 : nCount = (sal_uInt16)(nLoop>0 ? nLoop : 0 );
336 : : }
337 : 0 : break;
338 : :
339 : : case HTML_O_SCROLLAMOUNT:
340 [ # # ]: 0 : nAmount = -((sal_Int16)rOption.GetNumber());
341 : 0 : break;
342 : :
343 : : case HTML_O_SCROLLDELAY:
344 [ # # ]: 0 : nDelay = (sal_uInt16)rOption.GetNumber();
345 : 0 : break;
346 : :
347 : : case HTML_O_WIDTH:
348 : : // erstmal nur als Pixelwerte merken!
349 [ # # ]: 0 : nWidth = rOption.GetNumber();
350 [ # # ]: 0 : bPrcWidth = rOption.GetString().Search('%') != STRING_NOTFOUND;
351 [ # # ][ # # ]: 0 : if( bPrcWidth && nWidth>100 )
352 : 0 : nWidth = 100;
353 : 0 : break;
354 : :
355 : : case HTML_O_HEIGHT:
356 : : // erstmal nur als Pixelwerte merken!
357 [ # # ]: 0 : nHeight = rOption.GetNumber();
358 [ # # ][ # # ]: 0 : if( rOption.GetString().Search('%') != STRING_NOTFOUND )
359 : 0 : nHeight = 0;
360 : 0 : break;
361 : :
362 : : case HTML_O_HSPACE:
363 : : // erstmal nur als Pixelwerte merken!
364 [ # # ]: 0 : aSpace.Height() = rOption.GetNumber();
365 : 0 : break;
366 : :
367 : : case HTML_O_VSPACE:
368 : : // erstmal nur als Pixelwerte merken!
369 [ # # ]: 0 : aSpace.Width() = rOption.GetNumber();
370 : 0 : break;
371 : :
372 : : case HTML_O_ALIGN:
373 : : eVertOri =
374 : : rOption.GetEnum( aHTMLImgVAlignTable,
375 [ # # ]: 0 : text::VertOrientation::TOP );
376 : : eHoriOri =
377 : : rOption.GetEnum( aHTMLImgHAlignTable,
378 [ # # ]: 0 : text::HoriOrientation::NONE );
379 : 0 : break;
380 : : }
381 : : }
382 : :
383 : : // Ein DrawTxtobj anlegen
384 : : // #i52858# - method name changed
385 [ # # ]: 0 : SdrModel* pModel = pDoc->GetOrCreateDrawModel();
386 : :
387 [ # # ]: 0 : SdrPage* pPg = pModel->GetPage( 0 );
388 : : pMarquee = SdrObjFactory::MakeNewObject( SdrInventor,
389 [ # # ]: 0 : OBJ_TEXT, pPg, pModel );
390 [ # # ]: 0 : if( !pMarquee )
391 : 0 : return;
392 : :
393 [ # # ]: 0 : pPg->InsertObject( pMarquee );
394 : :
395 [ # # ]: 0 : if( aId.Len() )
396 [ # # ]: 0 : InsertBookmark( aId );
397 : :
398 : : // (Nur) Alternate leueft per Default von links nach rechts
399 [ # # ][ # # ]: 0 : if( SDRTEXTANI_ALTERNATE==eAniKind && !bDirection )
400 : 0 : eAniDir = SDRTEXTANI_RIGHT;
401 : :
402 : : // die fuer das Scrollen benoetigten Attribute umsetzen
403 : : sal_uInt16 aWhichMap[7] = { XATTR_FILL_FIRST, XATTR_FILL_LAST,
404 : : SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST,
405 : : EE_CHAR_START, EE_CHAR_END,
406 : 0 : 0 };
407 [ # # ]: 0 : SfxItemSet aItemSet( pModel->GetItemPool(), aWhichMap );
408 [ # # ][ # # ]: 0 : aItemSet.Put( SdrTextAutoGrowWidthItem( sal_False ) );
[ # # ]
409 [ # # ][ # # ]: 0 : aItemSet.Put( SdrTextAutoGrowHeightItem( sal_True ) );
[ # # ]
410 [ # # ][ # # ]: 0 : aItemSet.Put( SdrTextAniKindItem( eAniKind ) );
[ # # ]
411 [ # # ][ # # ]: 0 : aItemSet.Put( SdrTextAniDirectionItem( eAniDir ) );
[ # # ]
412 [ # # ][ # # ]: 0 : aItemSet.Put( SdrTextAniCountItem( nCount ) );
[ # # ]
413 [ # # ][ # # ]: 0 : aItemSet.Put( SdrTextAniDelayItem( nDelay ) );
[ # # ]
414 [ # # ][ # # ]: 0 : aItemSet.Put( SdrTextAniAmountItem( nAmount ) );
[ # # ]
415 [ # # ]: 0 : if( SDRTEXTANI_ALTERNATE==eAniKind )
416 : : {
417 : : // (Nur) Alternate startet und stoppt per default Inside
418 [ # # ][ # # ]: 0 : aItemSet.Put( SdrTextAniStartInsideItem(sal_True) );
[ # # ]
419 [ # # ][ # # ]: 0 : aItemSet.Put( SdrTextAniStopInsideItem(sal_True) );
[ # # ]
420 [ # # ]: 0 : if( SDRTEXTANI_LEFT==eAniDir )
421 [ # # ][ # # ]: 0 : aItemSet.Put( SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_RIGHT) );
[ # # ]
422 : : }
423 : :
424 : : // die Default-Farbe (aus der Standard-Vorlage) setzen, damit ueberhaupt
425 : : // eine sinnvolle Farbe gesetzt ist.
426 : : const Color& rDfltColor =
427 [ # # ]: 0 : pCSS1Parser->GetTxtCollFromPool( RES_POOLCOLL_STANDARD )
428 [ # # ]: 0 : ->GetColor().GetValue();
429 [ # # ][ # # ]: 0 : aItemSet.Put( SvxColorItem( rDfltColor, EE_CHAR_COLOR ) );
[ # # ]
430 : :
431 : : // Die Attribute der aktuellen Absatzvorlage setzen
432 : : sal_uInt16 nWhichIds[] =
433 : : {
434 : : RES_CHRATR_COLOR, RES_CHRATR_CROSSEDOUT, RES_CHRATR_ESCAPEMENT,
435 : : RES_CHRATR_FONT, RES_CHRATR_FONTSIZE, RES_CHRATR_KERNING,
436 : : RES_CHRATR_POSTURE, RES_CHRATR_UNDERLINE, RES_CHRATR_WEIGHT,
437 : : RES_CHRATR_BACKGROUND,
438 : : RES_CHRATR_CJK_FONT, RES_CHRATR_CJK_FONTSIZE,
439 : : RES_CHRATR_CJK_POSTURE, RES_CHRATR_CJK_WEIGHT,
440 : : RES_CHRATR_CTL_FONT, RES_CHRATR_CTL_FONTSIZE,
441 : : RES_CHRATR_CTL_POSTURE, RES_CHRATR_CTL_WEIGHT,
442 : : 0
443 : 0 : };
444 : : SwTxtNode const*const pTxtNd =
445 : 0 : pPam->GetPoint()->nNode.GetNode().GetTxtNode();
446 [ # # ]: 0 : if( pTxtNd )
447 : : {
448 : 0 : const SfxItemSet& rItemSet = pTxtNd->GetAnyFmtColl().GetAttrSet();
449 : : const SfxPoolItem *pItem;
450 [ # # ]: 0 : for( sal_uInt16 i=0; nWhichIds[i]; i++ )
451 : : {
452 [ # # ][ # # ]: 0 : if( SFX_ITEM_SET == rItemSet.GetItemState( nWhichIds[i], sal_True, &pItem ) )
453 [ # # ]: 0 : PutEEPoolItem( aItemSet, *pItem );
454 : : }
455 : : }
456 : :
457 : : // die Attribute der Umgebung am Draw-Objekt setzen
458 : 0 : _HTMLAttr** pTbl = (_HTMLAttr**)&aAttrTab;
459 [ # # ]: 0 : for( sal_uInt16 nCnt = sizeof( _HTMLAttrTable ) / sizeof( _HTMLAttr* );
460 : : nCnt--; ++pTbl )
461 : : {
462 : 0 : _HTMLAttr *pAttr = *pTbl;
463 [ # # ]: 0 : if( pAttr )
464 [ # # ]: 0 : PutEEPoolItem( aItemSet, pAttr->GetItem() );
465 : : }
466 : :
467 [ # # ]: 0 : if( bBGColor )
468 : : {
469 [ # # ][ # # ]: 0 : aItemSet.Put( XFillStyleItem(XFILL_SOLID) );
[ # # ]
470 [ # # ][ # # ]: 0 : aItemSet.Put( XFillColorItem(aEmptyStr, aBGColor) );
[ # # ]
471 : : }
472 : :
473 : : // Styles parsen (funktioniert hier nur fuer Attribute, die auch
474 : : // am Zeichen-Objekt gesetzt werden koennen)
475 : 0 : SfxItemSet aStyleItemSet( pDoc->GetAttrPool(),
476 [ # # # # ]: 0 : pCSS1Parser->GetWhichMap() );
477 [ # # ]: 0 : SvxCSS1PropertyInfo aPropInfo;
478 [ # # ][ # # ]: 0 : if( HasStyleOptions( aStyle, aId, aClass ) &&
[ # # ]
479 [ # # ]: 0 : ParseStyleOptions( aStyle, aId, aClass, aStyleItemSet, aPropInfo ) )
480 : : {
481 [ # # ]: 0 : SfxItemIter aIter( aStyleItemSet );
482 : :
483 : 0 : const SfxPoolItem *pItem = aIter.FirstItem();
484 [ # # ]: 0 : while( pItem )
485 : : {
486 [ # # ]: 0 : PutEEPoolItem( aItemSet, *pItem );
487 [ # # ]: 0 : pItem = aIter.NextItem();
488 [ # # ]: 0 : }
489 : : }
490 : :
491 : : // jetzt noch die Groesse setzen
492 [ # # ]: 0 : Size aTwipSz( bPrcWidth ? 0 : nWidth, nHeight );
493 [ # # ][ # # ]: 0 : if( (aTwipSz.Width() || aTwipSz.Height()) && Application::GetDefaultDevice() )
[ # # ][ # # ]
[ # # ]
494 : : {
495 : : aTwipSz = Application::GetDefaultDevice()
496 [ # # ][ # # ]: 0 : ->PixelToLogic( aTwipSz, MapMode( MAP_TWIP ) );
[ # # ][ # # ]
497 : : }
498 : :
499 [ # # ]: 0 : if( SVX_CSS1_LTYPE_TWIP== aPropInfo.eWidthType )
500 : : {
501 : 0 : aTwipSz.Width() = aPropInfo.nWidth;
502 : 0 : nWidth = 1; // != 0;
503 : 0 : bPrcWidth = sal_False;
504 : : }
505 [ # # ]: 0 : if( SVX_CSS1_LTYPE_TWIP== aPropInfo.eHeightType )
506 : 0 : aTwipSz.Height() = aPropInfo.nHeight;
507 : :
508 : 0 : bFixMarqueeWidth = sal_False;
509 [ # # ][ # # ]: 0 : if( !nWidth || bPrcWidth )
510 : : {
511 [ # # ]: 0 : if( pTable )
512 : : {
513 [ # # ]: 0 : if( !pCurTable )
514 : : {
515 : : // Die Laufschrift steht in einer Tabelle, aber nicht
516 : : // in einer Zelle. Da jetzt keine vernuenftige Zuordung
517 : : // zu einer Zelle moeglich ist, passen wir hir die
518 : : // Breite dem Inhalt der Laufschrift an.
519 : 0 : bFixMarqueeWidth = sal_True;
520 : : }
521 [ # # ]: 0 : else if( !nWidth )
522 : : {
523 : : // Da wir wissen, in welcher Zelle die Laufschrift ist,
524 : : // koennen wir die Breite auch anpassen. Keine Breitenangabe
525 : : // wird wie 100% behandelt.
526 : 0 : nWidth = 100;
527 : 0 : bPrcWidth = sal_True;
528 : : }
529 : 0 : aTwipSz.Width() = MINLAY;
530 : : }
531 : : else
532 : : {
533 [ # # ]: 0 : long nBrowseWidth = GetCurrentBrowseWidth();
534 : 0 : aTwipSz.Width() = !nWidth ? nBrowseWidth
535 [ # # ]: 0 : : (nWidth*nBrowseWidth) / 100;
536 : : }
537 : : }
538 : :
539 : : // Die Hoehe ist nur eine Mindest-Hoehe
540 [ # # ]: 0 : if( aTwipSz.Height() < MINFLY )
541 : 0 : aTwipSz.Height() = MINFLY;
542 [ # # ][ # # ]: 0 : aItemSet.Put( SdrTextMinFrameHeightItem( aTwipSz.Height() ) );
[ # # ]
543 : :
544 [ # # ]: 0 : pMarquee->SetMergedItemSetAndBroadcast(aItemSet);
545 : :
546 [ # # ]: 0 : if( aTwipSz.Width() < MINFLY )
547 : 0 : aTwipSz.Width() = MINFLY;
548 [ # # ][ # # ]: 0 : pMarquee->SetLogicRect( Rectangle( 0, 0, aTwipSz.Width(), aTwipSz.Height() ) );
549 : :
550 : : // und das Objekt in das Dok einfuegen
551 : : InsertDrawObject( pMarquee, aSpace, eVertOri, eHoriOri, aStyleItemSet,
552 [ # # ]: 0 : aPropInfo );
553 : :
554 : : // Das Zeichen-Objekt der Tabelle bekanntmachen. Ist ein bisserl
555 : : // umstaendlich, weil noch ueber den Parser gegangen wird, obwohl die
556 : : // Tabelle bekannt ist, aber anderenfalls muesste man die Tabelle
557 : : // oeffentlich machen, und das ist auch nicht schoen. Das globale
558 : : // pTable kann uebrigens auch nicht verwendet werden, denn die
559 : : // Laufschrift kann sich auch mal in einer Sub-Tabelle befinden.
560 [ # # ][ # # ]: 0 : if( pCurTable && bPrcWidth)
561 [ # # ][ # # ]: 0 : RegisterDrawObjectToTable( pCurTable, pMarquee, (sal_uInt8)nWidth );
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
562 : : }
563 : :
564 : 0 : void SwHTMLParser::EndMarquee()
565 : : {
566 : : OSL_ENSURE( pMarquee && OBJ_TEXT==pMarquee->GetObjIdentifier(),
567 : : "kein Marquee oder falscher Typ" );
568 : :
569 [ # # ]: 0 : if( bFixMarqueeWidth )
570 : : {
571 : : // Da es keine fixe Hoehe gibt, das Text-Objekt erstmal breiter
572 : : // als den Text machen, damit nicht umgebrochen wird.
573 : 0 : const Rectangle& rOldRect = pMarquee->GetLogicRect();
574 : : pMarquee->SetLogicRect( Rectangle( rOldRect.TopLeft(),
575 [ # # ][ # # ]: 0 : Size( USHRT_MAX, 240 ) ) );
576 : : }
577 : :
578 : : // den gesammelten Text einfuegen
579 : 0 : ((SdrTextObj*)pMarquee)->SetText( aContents );
580 : 0 : pMarquee->SetMergedItemSetAndBroadcast( pMarquee->GetMergedItemSet() );
581 : :
582 [ # # ]: 0 : if( bFixMarqueeWidth )
583 : : {
584 : : // die Groesse dem Text anpassen.
585 : 0 : ((SdrTextObj*)pMarquee)->FitFrameToTextSize();
586 : : }
587 : :
588 : 0 : aContents.Erase();
589 : 0 : pMarquee = 0;
590 : 0 : }
591 : :
592 : 0 : void SwHTMLParser::InsertMarqueeText()
593 : : {
594 : : OSL_ENSURE( pMarquee && OBJ_TEXT==pMarquee->GetObjIdentifier(),
595 : : "kein Marquee oder falscher Typ" );
596 : :
597 : : // das akteulle Textstueck an den Text anhaengen
598 : 0 : aContents += aToken;
599 : 0 : }
600 : :
601 : 0 : void SwHTMLParser::ResizeDrawObject( SdrObject* pObj, SwTwips nWidth )
602 : : {
603 : : OSL_ENSURE( OBJ_TEXT==pObj->GetObjIdentifier(),
604 : : "kein Marquee oder falscher Typ" );
605 : :
606 [ # # ][ # # ]: 0 : if( OBJ_TEXT!=pObj->GetObjIdentifier() )
607 : 0 : return;
608 : :
609 : : // die alte Groesse
610 [ # # ]: 0 : const Rectangle& rOldRect = pObj->GetLogicRect();
611 [ # # ]: 0 : Size aNewSz( nWidth, rOldRect.GetSize().Height() );
612 [ # # ][ # # ]: 0 : pObj->SetLogicRect( Rectangle( rOldRect.TopLeft(), aNewSz ) );
613 : : }
614 : :
615 : :
616 : 0 : const SdrObject *SwHTMLWriter::GetMarqueeTextObj( const SwDrawFrmFmt& rFmt )
617 : : {
618 : 0 : const SdrObject* pObj = rFmt.FindSdrObject();
619 [ # # ][ # # ]: 0 : return (pObj && ::IsMarqueeTextObj( *pObj )) ? pObj : 0;
620 : : }
621 : :
622 : 0 : void SwHTMLWriter::GetEEAttrsFromDrwObj( SfxItemSet& rItemSet,
623 : : const SdrObject *pObj,
624 : : sal_Bool bSetDefaults )
625 : : {
626 : : // die Edit script::Engine-Attribute aus dem Objekt holen
627 [ # # ][ # # ]: 0 : SfxItemSet rObjItemSet = pObj->GetMergedItemSet();
628 : :
629 : : // ueber die Edit script::Engine-Attribute iterieren und die Attribute
630 : : // in SW-Attrs wandeln bzw. default setzen
631 [ # # ]: 0 : SfxWhichIter aIter( rObjItemSet );
632 [ # # ]: 0 : sal_uInt16 nEEWhich = aIter.FirstWhich();
633 [ # # ]: 0 : while( nEEWhich )
634 : : {
635 : : const SfxPoolItem *pEEItem;
636 : : sal_Bool bSet = SFX_ITEM_SET == rObjItemSet.GetItemState( nEEWhich, sal_False,
637 [ # # ]: 0 : &pEEItem );
638 : :
639 [ # # ][ # # ]: 0 : if( bSet || bSetDefaults )
640 : : {
641 : 0 : sal_uInt16 nSwWhich = 0;
642 [ # # # # : 0 : switch( nEEWhich )
# # # # #
# # # # #
# # # # ]
643 : : {
644 : 0 : case EE_CHAR_COLOR: nSwWhich = RES_CHRATR_COLOR; break;
645 : 0 : case EE_CHAR_STRIKEOUT: nSwWhich = RES_CHRATR_CROSSEDOUT; break;
646 : 0 : case EE_CHAR_ESCAPEMENT: nSwWhich = RES_CHRATR_ESCAPEMENT; break;
647 : 0 : case EE_CHAR_FONTINFO: nSwWhich = RES_CHRATR_FONT; break;
648 : 0 : case EE_CHAR_FONTINFO_CJK: nSwWhich = RES_CHRATR_CJK_FONT; break;
649 : 0 : case EE_CHAR_FONTINFO_CTL: nSwWhich = RES_CHRATR_CTL_FONT; break;
650 : 0 : case EE_CHAR_FONTHEIGHT: nSwWhich = RES_CHRATR_FONTSIZE; break;
651 : 0 : case EE_CHAR_FONTHEIGHT_CJK:nSwWhich = RES_CHRATR_CJK_FONTSIZE; break;
652 : 0 : case EE_CHAR_FONTHEIGHT_CTL:nSwWhich = RES_CHRATR_CTL_FONTSIZE; break;
653 : 0 : case EE_CHAR_KERNING: nSwWhich = RES_CHRATR_KERNING; break;
654 : 0 : case EE_CHAR_ITALIC: nSwWhich = RES_CHRATR_POSTURE; break;
655 : 0 : case EE_CHAR_ITALIC_CJK: nSwWhich = RES_CHRATR_CJK_POSTURE; break;
656 : 0 : case EE_CHAR_ITALIC_CTL: nSwWhich = RES_CHRATR_CTL_POSTURE; break;
657 : 0 : case EE_CHAR_UNDERLINE: nSwWhich = RES_CHRATR_UNDERLINE; break;
658 : 0 : case EE_CHAR_WEIGHT: nSwWhich = RES_CHRATR_WEIGHT; break;
659 : 0 : case EE_CHAR_WEIGHT_CJK: nSwWhich = RES_CHRATR_CJK_WEIGHT; break;
660 : 0 : case EE_CHAR_WEIGHT_CTL: nSwWhich = RES_CHRATR_CTL_WEIGHT; break;
661 : : }
662 : :
663 [ # # ]: 0 : if( nSwWhich )
664 : : {
665 : : // wenn das Item nicht gesetzt ist nehmen wir ggf. das
666 : : // Default-Item
667 [ # # ]: 0 : if( !bSet )
668 [ # # ]: 0 : pEEItem = &rObjItemSet.GetPool()->GetDefaultItem(nEEWhich);
669 : :
670 : : // jetzt Clonen wir das Item mit der Which-Id des Writers
671 [ # # ]: 0 : SfxPoolItem *pSwItem = pEEItem->Clone();
672 : 0 : pSwItem->SetWhich( nSwWhich );
673 [ # # ]: 0 : rItemSet.Put( *pSwItem );
674 [ # # ][ # # ]: 0 : delete pSwItem;
675 : : }
676 : : }
677 : :
678 [ # # ]: 0 : nEEWhich = aIter.NextWhich();
679 [ # # ][ # # ]: 0 : }
680 : 0 : }
681 : :
682 : :
683 : 0 : Writer& OutHTML_DrawFrmFmtAsMarquee( Writer& rWrt,
684 : : const SwDrawFrmFmt& rFmt,
685 : : const SdrObject& rSdrObject )
686 : : {
687 : 0 : SwHTMLWriter & rHTMLWrt = (SwHTMLWriter&)rWrt;
688 : :
689 : : OSL_ENSURE( rWrt.pDoc->GetDrawModel(), "Da gibt's ein Draw-Obj ohne ein Draw-Model zu haben?" );
690 : 0 : const SdrTextObj *pTextObj = (const SdrTextObj *)&rSdrObject;
691 : :
692 : : // Gibt es ueberhaupt auszugebenden Text
693 : : const OutlinerParaObject *pOutlinerParaObj =
694 [ # # ]: 0 : pTextObj->GetOutlinerParaObject();
695 [ # # ]: 0 : if( !pOutlinerParaObj )
696 : 0 : return rWrt;
697 : :
698 : 0 : rtl::OStringBuffer sOut;
699 [ # # ][ # # ]: 0 : sOut.append('<').append(OOO_STRING_SVTOOLS_HTML_marquee);
700 : :
701 : : // Die Attribute des Objektd holen
702 [ # # ]: 0 : const SfxItemSet& rItemSet = pTextObj->GetMergedItemSet();
703 : :
704 : : // BEHAVIOUR
705 [ # # ]: 0 : SdrTextAniKind eAniKind = pTextObj->GetTextAniKind();
706 : : OSL_ENSURE( SDRTEXTANI_SCROLL==eAniKind ||
707 : : SDRTEXTANI_ALTERNATE==eAniKind ||
708 : : SDRTEXTANI_SLIDE==eAniKind,
709 : : "Text-Draw-Objekt nicht fuer Marquee geeignet" );
710 : :
711 : 0 : const sal_Char *pStr = 0;
712 [ # # # # ]: 0 : switch( eAniKind )
713 : : {
714 : 0 : case SDRTEXTANI_SCROLL: pStr = OOO_STRING_SVTOOLS_HTML_BEHAV_scroll; break;
715 : 0 : case SDRTEXTANI_SLIDE: pStr = OOO_STRING_SVTOOLS_HTML_BEHAV_slide; break;
716 : 0 : case SDRTEXTANI_ALTERNATE: pStr = OOO_STRING_SVTOOLS_HTML_BEHAV_alternate; break;
717 : : default:
718 : : ;
719 : : }
720 : :
721 [ # # ]: 0 : if( pStr )
722 : : {
723 [ # # ][ # # ]: 0 : sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_behavior).
724 [ # # ][ # # ]: 0 : append('=').append(pStr);
725 : : }
726 : :
727 : : // DIRECTION
728 : 0 : pStr = 0;
729 [ # # ]: 0 : SdrTextAniDirection eAniDir = pTextObj->GetTextAniDirection();
730 [ # # # ]: 0 : switch( eAniDir )
731 : : {
732 : 0 : case SDRTEXTANI_LEFT: pStr = OOO_STRING_SVTOOLS_HTML_AL_left; break;
733 : 0 : case SDRTEXTANI_RIGHT: pStr = OOO_STRING_SVTOOLS_HTML_AL_right; break;
734 : : default:
735 : : ;
736 : : }
737 : :
738 [ # # ]: 0 : if( pStr )
739 : : {
740 [ # # ][ # # ]: 0 : sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_direction).
741 [ # # ][ # # ]: 0 : append('=').append(pStr);
742 : : }
743 : :
744 : : // LOOP
745 : : sal_Int32 nCount =
746 [ # # ]: 0 : ((const SdrTextAniCountItem&)rItemSet.Get( SDRATTR_TEXT_ANICOUNT ))
747 : 0 : .GetValue();
748 [ # # ]: 0 : if( 0==nCount )
749 [ # # ]: 0 : nCount = SDRTEXTANI_SLIDE==eAniKind ? 1 : -1;
750 [ # # ][ # # ]: 0 : sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_loop).append('=').
[ # # ]
751 [ # # ]: 0 : append(nCount);
752 : :
753 : : // SCROLLDELAY
754 : : sal_uInt16 nDelay =
755 [ # # ]: 0 : ((const SdrTextAniDelayItem&)rItemSet.Get( SDRATTR_TEXT_ANIDELAY ))
756 : 0 : .GetValue();
757 [ # # ][ # # ]: 0 : sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_scrolldelay).
758 [ # # ][ # # ]: 0 : append('=').append(static_cast<sal_Int32>(nDelay));
759 : :
760 : : // SCROLLAMOUNT
761 : : sal_Int16 nAmount =
762 [ # # ]: 0 : ((const SdrTextAniAmountItem&)rItemSet.Get( SDRATTR_TEXT_ANIAMOUNT ))
763 : 0 : .GetValue();
764 [ # # ]: 0 : if( nAmount < 0 )
765 : : {
766 : 0 : nAmount = -nAmount;
767 : : }
768 [ # # ][ # # ]: 0 : else if( nAmount && Application::GetDefaultDevice() )
[ # # ][ # # ]
769 : : {
770 : : nAmount = (sal_uInt16)(Application::GetDefaultDevice()
771 : : ->LogicToPixel( Size(nAmount,0),
772 [ # # ][ # # ]: 0 : MapMode(MAP_TWIP) ).Width());
[ # # ][ # # ]
773 : : }
774 [ # # ]: 0 : if( nAmount )
775 : : {
776 [ # # ][ # # ]: 0 : sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_scrollamount).
777 [ # # ][ # # ]: 0 : append('=').append(static_cast<sal_Int32>(nAmount));
778 : : }
779 : :
780 [ # # ][ # # ]: 0 : Size aTwipSz( pTextObj->GetLogicRect().GetSize() );
781 [ # # ][ # # ]: 0 : if( pTextObj->IsAutoGrowWidth() )
782 : 0 : aTwipSz.Width() = 0;
783 : : // Die Hoehe ist bei MS eine Mindesthoehe, also geben wir auch die
784 : : // Mindestheoehe aus, wenn es sie gibt. Da eine Mindesthoehe MINFLY
785 : : // mit hoher Wahrscheinlichkeit vom Import kommt, wird sie nicht mit
786 : : // ausgegeben. Falsch machen kann man da nichst, denn jeder Font ist
787 : : // hoeher.
788 [ # # ][ # # ]: 0 : if( pTextObj->IsAutoGrowHeight() )
789 : : {
790 [ # # ]: 0 : aTwipSz.Height() = pTextObj->GetMinTextFrameHeight();
791 [ # # ]: 0 : if( MINFLY==aTwipSz.Height() )
792 : 0 : aTwipSz.Height() = 0;
793 : : }
794 : :
795 [ # # ][ # # ]: 0 : if( (aTwipSz.Width() || aTwipSz.Height()) &&
[ # # ][ # # ]
796 [ # # ]: 0 : Application::GetDefaultDevice() )
797 : : {
798 : : Size aPixelSz =
799 : : Application::GetDefaultDevice()->LogicToPixel( aTwipSz,
800 [ # # ][ # # ]: 0 : MapMode(MAP_TWIP) );
[ # # ][ # # ]
801 [ # # ][ # # ]: 0 : if( !aPixelSz.Width() && aTwipSz.Width() )
[ # # ]
802 : 0 : aPixelSz.Width() = 1;
803 [ # # ][ # # ]: 0 : if( !aPixelSz.Height() && aTwipSz.Height() )
[ # # ]
804 : 0 : aPixelSz.Height() = 1;
805 : :
806 [ # # ]: 0 : if( aPixelSz.Width() )
807 : : {
808 [ # # ][ # # ]: 0 : sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_width).
809 [ # # ][ # # ]: 0 : append('=').append(static_cast<sal_Int32>(aPixelSz.Width()));
810 : : }
811 : :
812 [ # # ]: 0 : if( aPixelSz.Height() )
813 : : {
814 [ # # ][ # # ]: 0 : sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_height).
815 [ # # ][ # # ]: 0 : append('=').append(static_cast<sal_Int32>(aPixelSz.Height()));
816 : : }
817 : : }
818 : :
819 : : // BGCOLOR
820 : : XFillStyle eFillStyle =
821 [ # # ]: 0 : ((const XFillStyleItem&)rItemSet.Get(XATTR_FILLSTYLE)).GetValue();
822 [ # # ]: 0 : if( XFILL_SOLID==eFillStyle )
823 : : {
824 : : const Color& rFillColor =
825 [ # # ][ # # ]: 0 : ((const XFillColorItem&)rItemSet.Get(XATTR_FILLCOLOR)).GetColorValue();
826 : :
827 [ # # ][ # # ]: 0 : sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_bgcolor).append('=');
[ # # ]
828 [ # # ][ # # ]: 0 : rWrt.Strm() << sOut.makeStringAndClear().getStr();
829 [ # # ][ # # ]: 0 : HTMLOutFuncs::Out_Color( rWrt.Strm(), rFillColor, rHTMLWrt.eDestEnc );
830 : : }
831 : :
832 [ # # ]: 0 : if (sOut.getLength())
833 [ # # ][ # # ]: 0 : rWrt.Strm() << sOut.makeStringAndClear().getStr();
834 : :
835 : : // und nun noch ALIGN, HSPACE und VSPACE
836 : 0 : sal_uInt32 nFrmFlags = HTML_FRMOPTS_MARQUEE;
837 [ # # ]: 0 : if( rHTMLWrt.IsHTMLMode( HTMLMODE_ABS_POS_DRAW ) )
838 : 0 : nFrmFlags |= HTML_FRMOPTS_MARQUEE_CSS1;
839 [ # # ]: 0 : rtl::OString aEndTags = rHTMLWrt.OutFrmFmtOptions( rFmt, aEmptyStr, nFrmFlags );
840 [ # # ]: 0 : if( rHTMLWrt.IsHTMLMode( HTMLMODE_ABS_POS_DRAW ) )
841 [ # # ]: 0 : rHTMLWrt.OutCSS1_FrmFmtOptions( rFmt, nFrmFlags, &rSdrObject );
842 : :
843 : :
844 [ # # ][ # # ]: 0 : rWrt.Strm() << '>';
845 : :
846 : : // Was jetzt kommt ist das Gegenstueck zu SdrTextObjectt::SetText()
847 [ # # ]: 0 : Outliner aOutliner(0, OUTLINERMODE_TEXTOBJECT);
848 [ # # ]: 0 : aOutliner.SetUpdateMode( sal_False );
849 [ # # ]: 0 : aOutliner.SetText( *pOutlinerParaObj );
850 : : String aText( aOutliner.GetText( aOutliner.GetParagraph(0),
851 [ # # ][ # # ]: 0 : aOutliner.GetParagraphCount() ) );
[ # # ]
852 [ # # ]: 0 : HTMLOutFuncs::Out_String( rWrt.Strm(), aText,
853 [ # # ]: 0 : rHTMLWrt.eDestEnc, &rHTMLWrt.aNonConvertableCharacters );
854 : :
855 [ # # ][ # # ]: 0 : HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_marquee, sal_False );
856 : :
857 [ # # ]: 0 : if( !aEndTags.isEmpty() )
858 [ # # ][ # # ]: 0 : rWrt.Strm() << aEndTags.getStr();
859 : :
860 [ # # ][ # # ]: 0 : return rWrt;
861 : : }
862 : :
863 : :
864 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|