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