LibreOffice Module sw (master)  1
htmldrawreader.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <hintids.hxx>
21 #include <vcl/svapp.hxx>
22 #include <vcl/wrkwin.hxx>
23 #include <svx/svdmodel.hxx>
24 #include <svx/svdpage.hxx>
25 #include <svx/svdobj.hxx>
26 #include <svx/svdotext.hxx>
27 #include <svx/sdtagitm.hxx>
28 #include <svx/sdtacitm.hxx>
29 #include <svx/sdtayitm.hxx>
30 #include <svx/sdtaaitm.hxx>
31 #include <svx/sdtaiitm.hxx>
32 #include <svx/sdtmfitm.hxx>
33 #include <editeng/eeitem.hxx>
34 #include <editeng/outliner.hxx>
35 #include <svx/xfillit0.hxx>
36 #include <svx/xflclit.hxx>
37 #include <editeng/colritem.hxx>
38 #include <editeng/brushitem.hxx>
39 #include <editeng/lrspitem.hxx>
40 #include <editeng/ulspitem.hxx>
41 #include <svl/itemiter.hxx>
42 #include <svl/whiter.hxx>
43 #include <svtools/htmlout.hxx>
44 #include <svtools/htmltokn.h>
45 #include <svtools/htmlkywd.hxx>
46 #include <svx/svdpool.hxx>
47 
48 #include <charatr.hxx>
49 #include <drawdoc.hxx>
50 #include <frmfmt.hxx>
51 #include <fmtanchr.hxx>
52 #include <fmtornt.hxx>
53 #include <fmtsrnd.hxx>
54 #include <ndtxt.hxx>
55 #include <doc.hxx>
57 #include <dcontact.hxx>
58 #include <poolfmt.hxx>
59 #include "swcss1.hxx"
60 #include "swhtml.hxx"
61 #include <shellio.hxx>
62 #include <rtl/strbuf.hxx>
63 
64 using namespace css;
65 
67 {
68  { OOO_STRING_SVTOOLS_HTML_BEHAV_scroll, SdrTextAniKind::Scroll },
69  { OOO_STRING_SVTOOLS_HTML_BEHAV_alternate, SdrTextAniKind::Alternate },
70  { OOO_STRING_SVTOOLS_HTML_BEHAV_slide, SdrTextAniKind::Slide },
71  { nullptr, SdrTextAniKind(0) }
72 };
73 
75 {
76  { OOO_STRING_SVTOOLS_HTML_AL_left, SdrTextAniDirection::Left },
77  { OOO_STRING_SVTOOLS_HTML_AL_right, SdrTextAniDirection::Right },
78  { nullptr, SdrTextAniDirection(0) }
79 };
80 
82  const Size& rPixSpace,
83  sal_Int16 eVertOri,
84  sal_Int16 eHoriOri,
85  SfxItemSet& rCSS1ItemSet,
86  SvxCSS1PropertyInfo& rCSS1PropInfo )
87 {
88  // always on top of text.
89  // but in invisible layer. <ConnectToLayout> will move the object
90  // to the visible layer.
91  pNewDrawObj->SetLayer( m_xDoc->getIDocumentDrawModelAccess().GetInvisibleHeavenId() );
92 
93  SfxItemSet aFrameSet( m_xDoc->GetAttrPool(),
95  if( !IsNewDoc() )
96  Reader::ResetFrameFormatAttrs( aFrameSet );
97 
98  sal_uInt16 nLeftSpace = 0, nRightSpace = 0, nUpperSpace = 0, nLowerSpace = 0;
99  if( (rPixSpace.Width() || rPixSpace.Height()) && Application::GetDefaultDevice() )
100  {
101  Size aTwipSpc( rPixSpace.Width(), rPixSpace.Height() );
102  aTwipSpc =
104  MapMode(MapUnit::MapTwip) );
105  nLeftSpace = nRightSpace = static_cast<sal_uInt16>(aTwipSpc.Width());
106  nUpperSpace = nLowerSpace = static_cast<sal_uInt16>(aTwipSpc.Height());
107  }
108 
109  // set left/right border
110  const SfxPoolItem *pItem;
111  if( SfxItemState::SET==rCSS1ItemSet.GetItemState( RES_LR_SPACE, true, &pItem ) )
112  {
113  // maybe flatten the first line indentation
114  const SvxLRSpaceItem *pLRItem = static_cast<const SvxLRSpaceItem *>(pItem);
115  SvxLRSpaceItem aLRItem( *pLRItem );
116  aLRItem.SetTextFirstLineOfst( 0 );
117  if( rCSS1PropInfo.m_bLeftMargin )
118  {
119  nLeftSpace = static_cast< sal_uInt16 >(aLRItem.GetLeft());
120  rCSS1PropInfo.m_bLeftMargin = false;
121  }
122  if( rCSS1PropInfo.m_bRightMargin )
123  {
124  nRightSpace = static_cast< sal_uInt16 >(aLRItem.GetRight());
125  rCSS1PropInfo.m_bRightMargin = false;
126  }
127  rCSS1ItemSet.ClearItem( RES_LR_SPACE );
128  }
129  if( nLeftSpace || nRightSpace )
130  {
131  SvxLRSpaceItem aLRItem( RES_LR_SPACE );
132  aLRItem.SetLeft( nLeftSpace );
133  aLRItem.SetRight( nRightSpace );
134  aFrameSet.Put( aLRItem );
135  }
136 
137  // set top/bottom border
138  if( SfxItemState::SET==rCSS1ItemSet.GetItemState( RES_UL_SPACE, true, &pItem ) )
139  {
140  // maybe flatten the first line indentation
141  const SvxULSpaceItem *pULItem = static_cast<const SvxULSpaceItem *>(pItem);
142  if( rCSS1PropInfo.m_bTopMargin )
143  {
144  nUpperSpace = pULItem->GetUpper();
145  rCSS1PropInfo.m_bTopMargin = false;
146  }
147  if( rCSS1PropInfo.m_bBottomMargin )
148  {
149  nLowerSpace = pULItem->GetLower();
150  rCSS1PropInfo.m_bBottomMargin = false;
151  }
152 
153  rCSS1ItemSet.ClearItem( RES_UL_SPACE );
154  }
155  if( nUpperSpace || nLowerSpace )
156  {
157  SvxULSpaceItem aULItem( RES_UL_SPACE );
158  aULItem.SetUpper( nUpperSpace );
159  aULItem.SetLower( nLowerSpace );
160  aFrameSet.Put( aULItem );
161  }
162 
163  SwFormatAnchor aAnchor( RndStdIds::FLY_AS_CHAR );
164  if( SVX_CSS1_POS_ABSOLUTE == rCSS1PropInfo.m_ePosition &&
165  SVX_CSS1_LTYPE_TWIP == rCSS1PropInfo.m_eLeftType &&
166  SVX_CSS1_LTYPE_TWIP == rCSS1PropInfo.m_eTopType )
167  {
168  const SwStartNode *pFlySttNd =
169  m_pPam->GetPoint()->nNode.GetNode().FindFlyStartNode();
170 
171  if( pFlySttNd )
172  {
173  aAnchor.SetType( RndStdIds::FLY_AT_FLY );
174  SwPosition aPos( *pFlySttNd );
175  aAnchor.SetAnchor( &aPos );
176  }
177  else
178  {
179  aAnchor.SetType( RndStdIds::FLY_AT_PAGE );
180  }
181  // #i26791# - direct positioning for <SwDoc::Insert(..)>
182  pNewDrawObj->SetRelativePos( Point(rCSS1PropInfo.m_nLeft + nLeftSpace,
183  rCSS1PropInfo.m_nTop + nUpperSpace) );
184  aFrameSet.Put( SwFormatSurround(css::text::WrapTextMode_THROUGH) );
185  }
186  else if( SvxAdjust::Left == rCSS1PropInfo.m_eFloat ||
187  text::HoriOrientation::LEFT == eHoriOri )
188  {
189  aAnchor.SetType( RndStdIds::FLY_AT_PARA );
190  aFrameSet.Put( SwFormatSurround(css::text::WrapTextMode_RIGHT) );
191  // #i26791# - direct positioning for <SwDoc::Insert(..)>
192  pNewDrawObj->SetRelativePos( Point(nLeftSpace, nUpperSpace) );
193  }
194  else if( text::VertOrientation::NONE != eVertOri )
195  {
196  aFrameSet.Put( SwFormatVertOrient( 0, eVertOri ) );
197  }
198 
199  if (RndStdIds::FLY_AT_PAGE == aAnchor.GetAnchorId())
200  {
201  aAnchor.SetPageNum( 1 );
202  }
203  else if( RndStdIds::FLY_AT_FLY != aAnchor.GetAnchorId() )
204  {
205  aAnchor.SetAnchor( m_pPam->GetPoint() );
206  }
207  aFrameSet.Put( aAnchor );
208 
209  m_xDoc->getIDocumentContentOperations().InsertDrawObj( *m_pPam, *pNewDrawObj, aFrameSet );
210 }
211 
212 static void PutEEPoolItem( SfxItemSet &rEEItemSet,
213  const SfxPoolItem& rSwItem )
214 {
215 
216  sal_uInt16 nEEWhich = 0;
217 
218  switch( rSwItem.Which() )
219  {
220  case RES_CHRATR_COLOR: nEEWhich = EE_CHAR_COLOR; break;
221  case RES_CHRATR_CROSSEDOUT: nEEWhich = EE_CHAR_STRIKEOUT; break;
222  case RES_CHRATR_ESCAPEMENT: nEEWhich = EE_CHAR_ESCAPEMENT; break;
223  case RES_CHRATR_FONT: nEEWhich = EE_CHAR_FONTINFO; break;
224  case RES_CHRATR_CJK_FONT: nEEWhich = EE_CHAR_FONTINFO_CJK; break;
225  case RES_CHRATR_CTL_FONT: nEEWhich = EE_CHAR_FONTINFO_CTL; break;
226  case RES_CHRATR_FONTSIZE: nEEWhich = EE_CHAR_FONTHEIGHT; break;
227  case RES_CHRATR_CJK_FONTSIZE: nEEWhich = EE_CHAR_FONTHEIGHT_CJK; break;
228  case RES_CHRATR_CTL_FONTSIZE: nEEWhich = EE_CHAR_FONTHEIGHT_CTL; break;
229  case RES_CHRATR_KERNING: nEEWhich = EE_CHAR_KERNING; break;
230  case RES_CHRATR_POSTURE: nEEWhich = EE_CHAR_ITALIC; break;
231  case RES_CHRATR_CJK_POSTURE: nEEWhich = EE_CHAR_ITALIC_CJK; break;
232  case RES_CHRATR_CTL_POSTURE: nEEWhich = EE_CHAR_ITALIC_CTL; break;
233  case RES_CHRATR_UNDERLINE: nEEWhich = EE_CHAR_UNDERLINE; break;
234  case RES_CHRATR_WEIGHT: nEEWhich = EE_CHAR_WEIGHT; break;
235  case RES_CHRATR_CJK_WEIGHT: nEEWhich = EE_CHAR_WEIGHT_CJK; break;
236  case RES_CHRATR_CTL_WEIGHT: nEEWhich = EE_CHAR_WEIGHT_CTL; break;
237  case RES_BACKGROUND:
239  {
240  const SvxBrushItem& rBrushItem = static_cast<const SvxBrushItem&>(rSwItem);
241  rEEItemSet.Put( XFillStyleItem(drawing::FillStyle_SOLID) );
242  rEEItemSet.Put(XFillColorItem(OUString(),
243  rBrushItem.GetColor()) );
244  }
245  break;
246  }
247 
248  if( nEEWhich )
249  rEEItemSet.Put( rSwItem.CloneSetWhich(nEEWhich) );
250 }
251 
253 {
254 
255  OSL_ENSURE( !m_pMarquee, "Marquee in Marquee???" );
256  m_aContents.clear();
257 
258  OUString aId, aStyle, aClass;
259 
260  long nWidth=0, nHeight=0;
261  bool bPrcWidth = false, bDirection = false, bBGColor = false;
262  Size aSpace( 0, 0 );
263  sal_Int16 eVertOri = text::VertOrientation::TOP;
264  sal_Int16 eHoriOri = text::HoriOrientation::NONE;
265  SdrTextAniKind eAniKind = SdrTextAniKind::Scroll;
266  SdrTextAniDirection eAniDir = SdrTextAniDirection::Left;
267  sal_uInt16 nCount = 0, nDelay = 60;
268  sal_Int16 nAmount = -6;
269  Color aBGColor;
270 
271  const HTMLOptions& rHTMLOptions = GetOptions();
272  for (const auto & rOption : rHTMLOptions)
273  {
274  switch( rOption.GetToken() )
275  {
276  case HtmlOptionId::ID:
277  aId = rOption.GetString();
278  break;
279  case HtmlOptionId::STYLE:
280  aStyle = rOption.GetString();
281  break;
282  case HtmlOptionId::CLASS:
283  aClass = rOption.GetString();
284  break;
285 
286  case HtmlOptionId::BEHAVIOR:
287  eAniKind = rOption.GetEnum( aHTMLMarqBehaviorTable, eAniKind );
288  break;
289 
290  case HtmlOptionId::BGCOLOR:
291  rOption.GetColor( aBGColor );
292  bBGColor = true;
293  break;
294 
295  case HtmlOptionId::DIRECTION:
296  eAniDir = rOption.GetEnum( aHTMLMarqDirectionTable, eAniDir );
297  bDirection = true;
298  break;
299 
300  case HtmlOptionId::LOOP:
301  if (rOption.GetString().
302  equalsIgnoreAsciiCase(OOO_STRING_SVTOOLS_HTML_LOOP_infinite))
303  {
304  nCount = 0;
305  }
306  else
307  {
308  const sal_Int32 nLoop = rOption.GetSNumber();
309  nCount = std::max<sal_Int32>(nLoop, 0);
310  }
311  break;
312 
313  case HtmlOptionId::SCROLLAMOUNT:
314  nAmount = - static_cast<sal_Int16>(rOption.GetNumber());
315  break;
316 
317  case HtmlOptionId::SCROLLDELAY:
318  nDelay = static_cast<sal_uInt16>(rOption.GetNumber());
319  break;
320 
321  case HtmlOptionId::WIDTH:
322  // first only save as pixel value!
323  nWidth = rOption.GetNumber();
324  bPrcWidth = rOption.GetString().indexOf('%') != -1;
325  if( bPrcWidth && nWidth>100 )
326  nWidth = 100;
327  break;
328 
329  case HtmlOptionId::HEIGHT:
330  // first only save as pixel value!
331  nHeight = rOption.GetNumber();
332  if( rOption.GetString().indexOf('%') != -1 )
333  nHeight = 0;
334  break;
335 
336  case HtmlOptionId::HSPACE:
337  // first only save as pixel value!
338  aSpace.setHeight( rOption.GetNumber() );
339  break;
340 
341  case HtmlOptionId::VSPACE:
342  // first only save as pixel value!
343  aSpace.setWidth( rOption.GetNumber() );
344  break;
345 
346  case HtmlOptionId::ALIGN:
347  eVertOri =
348  rOption.GetEnum( aHTMLImgVAlignTable,
350  eHoriOri =
351  rOption.GetEnum( aHTMLImgHAlignTable );
352  break;
353  default: break;
354  }
355  }
356 
357  // create a DrawTextobj
358  // #i52858# - method name changed
359  SwDrawModel* pModel = m_xDoc->getIDocumentDrawModelAccess().GetOrCreateDrawModel();
360  SdrPage* pPg = pModel->GetPage( 0 );
361  m_pMarquee = SdrObjFactory::MakeNewObject(
362  *pModel,
363  SdrInventor::Default,
364  OBJ_TEXT);
365 
366  if( !m_pMarquee )
367  return;
368 
369  pPg->InsertObject( m_pMarquee );
370 
371  if( !aId.isEmpty() )
372  InsertBookmark( aId );
373 
374  // (only) Alternate runs from left to right as default
375  if( SdrTextAniKind::Alternate==eAniKind && !bDirection )
376  eAniDir = SdrTextAniDirection::Right;
377 
378  // re set the attributes needed for scrolling
379  sal_uInt16 const aWhichMap[] { XATTR_FILL_FIRST, XATTR_FILL_LAST,
382  0 };
383  SfxItemSet aItemSet( pModel->GetItemPool(), aWhichMap );
384  aItemSet.Put( makeSdrTextAutoGrowWidthItem( false ) );
385  aItemSet.Put( makeSdrTextAutoGrowHeightItem( true ) );
386  aItemSet.Put( SdrTextAniKindItem( eAniKind ) );
387  aItemSet.Put( SdrTextAniDirectionItem( eAniDir ) );
388  aItemSet.Put( SdrTextAniCountItem( nCount ) );
389  aItemSet.Put( SdrTextAniDelayItem( nDelay ) );
390  aItemSet.Put( SdrTextAniAmountItem( nAmount ) );
391  if( SdrTextAniKind::Alternate==eAniKind )
392  {
393  // (only) Alternate starts and ends Inside as default
394  aItemSet.Put( SdrTextAniStartInsideItem(true) );
395  aItemSet.Put( SdrTextAniStopInsideItem(true) );
396  if( SdrTextAniDirection::Left==eAniDir )
398  }
399 
400  // set the default colour (from the default template), so that a meaningful
401  // colour is set at all
402  const Color& rDfltColor =
403  m_pCSS1Parser->GetTextCollFromPool( RES_POOLCOLL_STANDARD )
404  ->GetColor().GetValue();
405  aItemSet.Put( SvxColorItem( rDfltColor, EE_CHAR_COLOR ) );
406 
407  // set the attributes of the current paragraph style
408  sal_uInt16 nWhichIds[] =
409  {
418  0
419  };
420  SwTextNode const*const pTextNd =
421  m_pPam->GetPoint()->nNode.GetNode().GetTextNode();
422  if( pTextNd )
423  {
424  const SfxItemSet& rItemSet = pTextNd->GetAnyFormatColl().GetAttrSet();
425  const SfxPoolItem *pItem;
426  for( int i=0; nWhichIds[i]; ++i )
427  {
428  if( SfxItemState::SET == rItemSet.GetItemState( nWhichIds[i], true, &pItem ) )
429  PutEEPoolItem( aItemSet, *pItem );
430  }
431  }
432 
433  // set attribute of environment at the Draw object
434  HTMLAttr** pHTMLAttributes = reinterpret_cast<HTMLAttr**>(m_xAttrTab.get());
435  for (auto nCnt = sizeof(HTMLAttrTable) / sizeof(HTMLAttr*); nCnt--; ++pHTMLAttributes)
436  {
437  HTMLAttr *pAttr = *pHTMLAttributes;
438  if( pAttr )
439  PutEEPoolItem( aItemSet, pAttr->GetItem() );
440  }
441 
442  if( bBGColor )
443  {
444  aItemSet.Put( XFillStyleItem(drawing::FillStyle_SOLID) );
445  aItemSet.Put(XFillColorItem(OUString(), aBGColor));
446  }
447 
448  // parse styles (is here only possible for attributes, which also
449  // can be set at character object)
450  SfxItemSet aStyleItemSet( m_xDoc->GetAttrPool(),
451  m_pCSS1Parser->GetWhichMap() );
452  SvxCSS1PropertyInfo aPropInfo;
453  if( HasStyleOptions( aStyle, aId, aClass ) &&
454  ParseStyleOptions( aStyle, aId, aClass, aStyleItemSet, aPropInfo ) )
455  {
456  SfxItemIter aIter( aStyleItemSet );
457 
458  const SfxPoolItem *pItem = aIter.FirstItem();
459  while( pItem )
460  {
461  PutEEPoolItem( aItemSet, *pItem );
462  pItem = aIter.NextItem();
463  }
464  }
465 
466  // now set the size
467  Size aTwipSz( bPrcWidth ? 0 : nWidth, nHeight );
468  if( (aTwipSz.Width() || aTwipSz.Height()) && Application::GetDefaultDevice() )
469  {
471  ->PixelToLogic( aTwipSz, MapMode( MapUnit::MapTwip ) );
472  }
473 
474  if( SVX_CSS1_LTYPE_TWIP== aPropInfo.m_eWidthType )
475  {
476  aTwipSz.setWidth( aPropInfo.m_nWidth );
477  nWidth = 1; // != 0;
478  bPrcWidth = false;
479  }
480  if( SVX_CSS1_LTYPE_TWIP== aPropInfo.m_eHeightType )
481  aTwipSz.setHeight( aPropInfo.m_nHeight );
482 
483  m_bFixMarqueeWidth = false;
484  if( !nWidth || bPrcWidth )
485  {
486  if( m_xTable )
487  {
488  if( !pCurTable )
489  {
490  // The marquee is in a table, but not in a cell. Since now no
491  // reasonable mapping to a cell is possible, we adjust here the
492  // width to the content of the marquee.
493  m_bFixMarqueeWidth = true;
494  }
495  else if( !nWidth )
496  {
497  // Because we know in which cell the marquee is, we also can
498  // adjust the width. No width specification is treated as
499  // 100 percent.
500  nWidth = 100;
501  bPrcWidth = true;
502  }
503  aTwipSz.setWidth( MINLAY );
504  }
505  else
506  {
507  long nBrowseWidth = GetCurrentBrowseWidth();
508  aTwipSz.setWidth( !nWidth ? nBrowseWidth
509  : (nWidth*nBrowseWidth) / 100 );
510  }
511  }
512 
513  // The height is only minimum height
514  if( aTwipSz.Height() < MINFLY )
515  aTwipSz.setHeight( MINFLY );
516  aItemSet.Put( makeSdrTextMinFrameHeightItem( aTwipSz.Height() ) );
517 
518  m_pMarquee->SetMergedItemSetAndBroadcast(aItemSet);
519 
520  if( aTwipSz.Width() < MINFLY )
521  aTwipSz.setWidth( MINFLY );
522  m_pMarquee->SetLogicRect( tools::Rectangle( 0, 0, aTwipSz.Width(), aTwipSz.Height() ) );
523 
524  // and insert the object into the document
525  InsertDrawObject( m_pMarquee, aSpace, eVertOri, eHoriOri, aStyleItemSet,
526  aPropInfo );
527 
528  // Register the drawing object at the table. Is a little bit complicated,
529  // because it is done via the parser, although the table is known, but
530  // otherwise the table would have to be public and that also isn't pretty.
531  // The global pTable also can't be used, because the marquee can also be
532  // in a sub-table.
533  if( pCurTable && bPrcWidth)
534  RegisterDrawObjectToTable( pCurTable, m_pMarquee, static_cast<sal_uInt8>(nWidth) );
535 }
536 
538 {
539  OSL_ENSURE( m_pMarquee && OBJ_TEXT==m_pMarquee->GetObjIdentifier(),
540  "no marquee or wrong type" );
541 
542  if( m_bFixMarqueeWidth )
543  {
544  // Because there is no fixed height make the text object wider then
545  // the text, so that there is no line break.
546  const tools::Rectangle& rOldRect = m_pMarquee->GetLogicRect();
547  m_pMarquee->SetLogicRect( tools::Rectangle( rOldRect.TopLeft(),
548  Size( USHRT_MAX, 240 ) ) );
549  }
550 
551  // insert the collected text
552  static_cast<SdrTextObj*>(m_pMarquee)->SetText( m_aContents );
553  m_pMarquee->SetMergedItemSetAndBroadcast( m_pMarquee->GetMergedItemSet() );
554 
555  if( m_bFixMarqueeWidth )
556  {
557  // adjust the size to the text
558  static_cast<SdrTextObj*>(m_pMarquee)->FitFrameToTextSize();
559  }
560 
561  m_aContents.clear();
562  m_pMarquee = nullptr;
563 }
564 
566 {
567  OSL_ENSURE( m_pMarquee && OBJ_TEXT==m_pMarquee->GetObjIdentifier(),
568  "no marquee or wrong type" );
569 
570  // append the current text part to the text
571  m_aContents += aToken;
572 }
573 
575 {
576  OSL_ENSURE( OBJ_TEXT==pObj->GetObjIdentifier(),
577  "no marquee or wrong type" );
578 
579  if( OBJ_TEXT!=pObj->GetObjIdentifier() )
580  return;
581 
582  // the old size
583  const tools::Rectangle& rOldRect = pObj->GetLogicRect();
584  Size aNewSz( nWidth, rOldRect.GetSize().Height() );
585  pObj->SetLogicRect( tools::Rectangle( rOldRect.TopLeft(), aNewSz ) );
586 }
587 
588 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define OOO_STRING_SVTOOLS_HTML_LOOP_infinite
long GetLeft() const
Point TopLeft() const
long Width() const
Starts a section of nodes in the document model.
Definition: node.hxx:303
#define EE_CHAR_ESCAPEMENT
#define RES_CHRATR_WEIGHT
Definition: hintids.hxx:83
#define EE_CHAR_FONTINFO
SvxCSS1LengthType m_eLeftType
Definition: svxcss1.hxx:137
SvxCSS1LengthType m_eTopType
Definition: svxcss1.hxx:137
#define OOO_STRING_SVTOOLS_HTML_BEHAV_alternate
Marks a position in the document model.
Definition: pam.hxx:35
sal_uInt16 GetLower() const
#define EE_CHAR_ITALIC_CTL
#define RES_CHRATR_FONTSIZE
Definition: hintids.hxx:76
#define EE_CHAR_ITALIC_CJK
long Height() const
#define RES_CHRATR_CJK_POSTURE
Definition: hintids.hxx:93
OBJ_TEXT
#define EE_CHAR_KERNING
#define MINFLY
Definition: swtypes.hxx:65
#define MINLAY
Definition: swtypes.hxx:66
#define RES_FRMATR_END
Definition: hintids.hxx:236
#define EE_CHAR_WEIGHT_CTL
#define RES_CHRATR_CJK_WEIGHT
Definition: hintids.hxx:94
#define RES_CHRATR_FONT
Definition: hintids.hxx:75
long SwTwips
Definition: swtypes.hxx:49
#define EE_CHAR_FONTHEIGHT_CJK
#define SDRATTR_MISC_LAST
#define RES_CHRATR_CJK_FONT
Definition: hintids.hxx:90
#define RES_CHRATR_CJK_FONTSIZE
Definition: hintids.hxx:91
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
void SetPageNum(sal_uInt16 nNew)
Definition: fmtanchr.hxx:72
static HTMLOptionEnum< SdrTextAniDirection > const aHTMLMarqDirectionTable[]
const SfxPoolItem * FirstItem()
SdrOnOffItem makeSdrTextAutoGrowHeightItem(bool bAuto)
SdrTextAniKind
static OutputDevice * GetDefaultDevice()
static void ResetFrameFormatAttrs(SfxItemSet &rFrameSet)
Definition: shellio.cxx:625
void SetLeft(const long nL, const sal_uInt16 nProp=100)
#define XATTR_FILL_LAST
#define EE_CHAR_WEIGHT_CJK
#define RES_CHRATR_CTL_FONTSIZE
Definition: hintids.hxx:96
static void ResizeDrawObject(SdrObject *pObj, SwTwips nWidth)
#define XATTR_FILL_FIRST
#define RES_UL_SPACE
Definition: hintids.hxx:197
SfxPoolItem & GetItem()
Definition: swhtml.hxx:170
#define EE_CHAR_ITALIC
static SdrObject * MakeNewObject(SdrModel &rSdrModel, SdrInventor nInventor, sal_uInt16 nObjIdentifier, const tools::Rectangle *pSnapRect=nullptr)
SdrOnOffItem makeSdrTextAutoGrowWidthItem(bool bAuto)
void InsertDrawObject(SdrObject *pNewDrawObj, const Size &rSpace, sal_Int16 eVertOri, sal_Int16 eHoriOri, SfxItemSet &rCSS1ItemSet, SvxCSS1PropertyInfo &rCSS1PropInfo)
void SetLower(const sal_uInt16 nL, const sal_uInt16 nProp=100)
SwFormatColl & GetAnyFormatColl() const
Definition: node.hxx:716
#define RES_BACKGROUND
Definition: hintids.hxx:210
const Color & GetColor() const
#define RES_CHRATR_COLOR
Definition: hintids.hxx:71
virtual void SetLayer(SdrLayerID nLayer)
void SetRight(const long nR, const sal_uInt16 nProp=100)
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
#define RES_CHRATR_BACKGROUND
Definition: hintids.hxx:89
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
#define RES_CHRATR_CTL_FONT
Definition: hintids.hxx:95
void NewMarquee(HTMLTable *pCurTable=nullptr)
virtual sal_uInt16 GetObjIdentifier() const
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:65
SdrMetricItem makeSdrTextMinFrameHeightItem(long mnHeight)
#define EE_CHAR_UNDERLINE
int i
static void PutEEPoolItem(SfxItemSet &rEEItemSet, const SfxPoolItem &rSwItem)
FlyAnchors.
Definition: fmtanchr.hxx:34
const SfxPoolItem * NextItem()
#define SDRATTR_MISC_FIRST
const SdrPage * GetPage(sal_uInt16 nPgNum) const
void SetMergedItemSetAndBroadcast(const SfxItemSet &rSet, bool bClearAllItems=false)
#define OOO_STRING_SVTOOLS_HTML_AL_left
#define EE_CHAR_COLOR
#define RES_CHRATR_UNDERLINE
Definition: hintids.hxx:82
SvxCSS1Position m_ePosition
Definition: svxcss1.hxx:121
#define EE_CHAR_FONTHEIGHT
#define RES_CHRATR_ESCAPEMENT
Definition: hintids.hxx:74
virtual void SetLogicRect(const tools::Rectangle &rRect)
virtual void SetRelativePos(const Point &rPnt)
SvxAdjust m_eFloat
Definition: svxcss1.hxx:119
void InsertMarqueeText()
std::unique_ptr< SfxPoolItem > CloneSetWhich(sal_uInt16 nNewWhich) const
Size GetSize() const
HTMLOptionEnum< sal_Int16 > const aHTMLImgVAlignTable[]
Definition: htmlgrin.cxx:86
#define RES_CHRATR_KERNING
Definition: hintids.hxx:77
#define RES_LR_SPACE
Definition: hintids.hxx:196
Point PixelToLogic(const Point &rDevicePt) const
SDRTEXTHORZADJUST_RIGHT
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
#define EE_CHAR_START
#define EE_CHAR_FONTINFO_CJK
void SetTextFirstLineOfst(const short nF, const sal_uInt16 nProp=100)
#define OOO_STRING_SVTOOLS_HTML_AL_right
#define OOO_STRING_SVTOOLS_HTML_BEHAV_slide
#define RES_CHRATR_POSTURE
Definition: hintids.hxx:79
#define EE_CHAR_WEIGHT
#define RES_CHRATR_CTL_WEIGHT
Definition: hintids.hxx:99
#define RES_CHRATR_CTL_POSTURE
Definition: hintids.hxx:98
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:261
::std::vector< HTMLOption > HTMLOptions
#define EE_CHAR_FONTHEIGHT_CTL
#define OOO_STRING_SVTOOLS_HTML_BEHAV_scroll
SdrTextAniDirection
long GetRight() const
void SetType(RndStdIds nRndId)
Definition: fmtanchr.hxx:71
const SwStartNode * FindFlyStartNode() const
Definition: node.hxx:198
#define RES_CHRATR_CROSSEDOUT
Definition: hintids.hxx:73
const SfxItemPool & GetItemPool() const
HTMLOptionEnum< sal_Int16 > const aHTMLImgHAlignTable[]
Definition: htmlgrin.cxx:79
virtual const tools::Rectangle & GetLogicRect() const
#define EE_CHAR_FONTINFO_CTL
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:116
void SetUpper(const sal_uInt16 nU, const sal_uInt16 nProp=100)
#define EE_CHAR_STRIKEOUT
void setWidth(long nWidth)
#define RES_FRMATR_BEGIN
Definition: hintids.hxx:192
sal_uInt16 Which() const
static HTMLOptionEnum< SdrTextAniKind > const aHTMLMarqBehaviorTable[]
#define EE_CHAR_END
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:843
sal_uInt16 GetUpper() const
void SetAnchor(const SwPosition *pPos)
Definition: atrfrm.cxx:1486
void setHeight(long nHeight)