LibreOffice Module sw (master)  1
frmmgr.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 <cmdid.h>
21 #include <hintids.hxx>
22 
23 #include <svl/stritem.hxx>
24 #include <editeng/boxitem.hxx>
25 #include <editeng/lrspitem.hxx>
26 #include <editeng/ulspitem.hxx>
27 #include <editeng/shaditem.hxx>
29 #include <svx/xdef.hxx>
30 #include <tools/globname.hxx>
31 #include <comphelper/classids.hxx>
32 #include <fmtclds.hxx>
33 #include <wrtsh.hxx>
34 #include <view.hxx>
35 #include <viewopt.hxx>
36 #include <uitool.hxx>
37 #include <frmmgr.hxx>
38 #include <format.hxx>
39 #include <mdiexp.hxx>
40 #include <poolfmt.hxx>
41 #include <com/sun/star/text/HoriOrientation.hpp>
42 #include <com/sun/star/text/VertOrientation.hpp>
43 #include <com/sun/star/text/RelOrientation.hpp>
44 #include <grfatr.hxx>
45 
46 using namespace ::com::sun::star;
47 
48 static sal_uInt16 aFrameMgrRange[] = {
49  RES_FRMATR_BEGIN, RES_FRMATR_END-1, // 87-129
50 
51  // RotGrfFlyFrame: Support here, but seems not to be
52  // added in range of m_pOwnSh->GetFlyFrameAttr result
53  // (see below). Tried to find, but could not identify
55 
56  // FillAttribute support
57  XATTR_FILL_FIRST, XATTR_FILL_LAST, // 1014-1033
58 
59  SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
61  0};
62 
63 // determine frame attributes via Shell
65  m_aSet( static_cast<SwAttrPool&>(pSh->GetAttrPool()), aFrameMgrRange ),
66  m_pOwnSh( pSh ),
67  m_bAbsPos( false ),
68  m_bNewFrame( bNew ),
69  m_bIsInVertical( false ),
70  m_bIsInVerticalL2R( false )
71 {
72  if ( m_bNewFrame )
73  {
74  sal_uInt16 nId;
75  switch ( nType )
76  {
77  case Frmmgr_Type::TEXT: nId = RES_POOLFRM_FRAME; break;
78  case Frmmgr_Type::OLE: nId = RES_POOLFRM_OLE; break;
79  case Frmmgr_Type::GRF: nId = RES_POOLFRM_GRAPHIC; break;
80  // set defaults:
81  default: nId=0; break;
82  }
85  if ( 0 != ::GetHtmlMode(pSh->GetView().GetDocShell()) )
86  m_aSet.Put( SwFormatHoriOrient( 0, text::HoriOrientation::LEFT, text::RelOrientation::PRINT_AREA ) );
87 
88  if (nType == Frmmgr_Type::GRF || nType == Frmmgr_Type::OLE)
89  {
90  if (!pName || *pName != SvGlobalName( SO3_SM_CLASSID ))
91  {
92  // Default anchor for new graphics and objects is at-char, except for Math objects.
93  m_aSet.Put(SwFormatAnchor(RndStdIds::FLY_AT_CHAR));
94  }
95  }
96  }
97  else if ( nType == Frmmgr_Type::NONE )
98  {
100  bool bRightToLeft;
102  }
104 }
105 
107  m_aSet( rSet ),
108  m_pOwnSh( pSh ),
109  m_bAbsPos( false ),
110  m_bNewFrame( bNew ),
111  m_bIsInVertical(false),
112  m_bIsInVerticalL2R(false)
113 {
114  if(!bNew)
115  {
116  bool bRightToLeft;
117  m_bIsInVertical = pSh->IsFrameVertical(true, bRightToLeft, m_bIsInVerticalL2R);
118  }
119 }
120 
121 // Initialise
123 {
124  if ( !m_bNewFrame && m_pOwnSh->IsFrameSelected() )
127 }
128 
130 {
131  const SfxPoolItem* pItem = nullptr;
132 
133  if (m_aSet.GetItemState(FN_SET_FRM_NAME, false, &pItem) == SfxItemState::SET)
134  m_pOwnSh->SetFlyName(static_cast<const SfxStringItem *>(pItem)->GetValue());
135 
137 
138  if ( m_bAbsPos )
139  {
141  m_bAbsPos = false;
142  }
143 }
144 
145 // change existing Fly-Frame
147 {
148  OSL_ENSURE( m_pOwnSh->IsFrameSelected(),
149  "no frame selected or no shell, update not possible");
150 
151  if( !m_pOwnSh->IsFrameSelected() )
152  return;
153 
154  //JP 6.8.2001: set never an invalid anchor into the core.
155  const SfxPoolItem *pGItem, *pItem;
156  if( SfxItemState::SET == m_aSet.GetItemState( RES_ANCHOR, false, &pItem ))
157  {
159  if( m_pOwnSh->GetFlyFrameAttr( aGetSet ) && 1 == aGetSet.Count() &&
160  SfxItemState::SET == aGetSet.GetItemState( RES_ANCHOR, false, &pGItem )
161  && static_cast<const SwFormatAnchor*>(pGItem)->GetAnchorId() ==
162  static_cast<const SwFormatAnchor*>(pItem)->GetAnchorId() )
164  }
165 
166  // return wg. BASIC
167  if( m_aSet.Count() )
168  {
171  UpdateFlyFrame_();
173  }
174 }
175 
176 // insert frame
178 {
180 
181  bool bRet = nullptr != m_pOwnSh->NewFlyFrame( m_aSet );
182 
183  // turn on the right mode at the shell, frame got selected automatically.
184  if ( bRet )
185  {
186  UpdateFlyFrame_();
189  }
191 }
192 
193 // Insert frames of type eAnchorType. Position and size are being set explicitly.
194 // Not-allowed values of the enumeration type get corrected.
196  const Point &rPos,
197  const Size &rSize )
198 {
199  OSL_ENSURE( eAnchorType == RndStdIds::FLY_AT_PAGE ||
200  eAnchorType == RndStdIds::FLY_AT_PARA ||
201  eAnchorType == RndStdIds::FLY_AT_CHAR ||
202  eAnchorType == RndStdIds::FLY_AT_FLY ||
203  eAnchorType == RndStdIds::FLY_AS_CHAR, "invalid frame type" );
204 
205  SetPos( rPos );
206 
207  SetSize( rSize );
208  SetAnchor( eAnchorType );
209  InsertFlyFrame();
210 }
211 
212 // set anchor
214 {
215  sal_uInt16 nPhyPageNum, nVirtPageNum;
216  m_pOwnSh->GetPageNum( nPhyPageNum, nVirtPageNum );
217 
218  m_aSet.Put( SwFormatAnchor( eId, nPhyPageNum ) );
219  if ((RndStdIds::FLY_AT_PAGE == eId) || (RndStdIds::FLY_AT_PARA == eId) || (RndStdIds::FLY_AT_CHAR == eId)
220  || (RndStdIds::FLY_AT_FLY == eId))
221  {
222  SwFormatVertOrient aVertOrient( GetVertOrient() );
223  SwFormatHoriOrient aHoriOrient( GetHoriOrient() );
224  aHoriOrient.SetRelationOrient( text::RelOrientation::FRAME );
225  aVertOrient.SetRelationOrient( text::RelOrientation::FRAME );
226  m_aSet.Put( aVertOrient );
227  m_aSet.Put( aHoriOrient );
228  }
229 }
230 
231 // set the attribute for columns
233 {
234  m_aSet.Put( rCol );
235 }
236 
237 // set absolute position
238 void SwFlyFrameAttrMgr::SetAbsPos( const Point& rPoint )
239 {
240  m_bAbsPos = true;
241  m_aAbsPos = rPoint;
242  SwFormatVertOrient aVertOrient( GetVertOrient() );
243  SwFormatHoriOrient aHoriOrient( GetHoriOrient() );
246  m_aSet.Put( aVertOrient );
247  m_aSet.Put( aHoriOrient );
248 }
249 
250 // check metrics for correctness
252  const SwPosition* pToCharContentPos,
253  bool bOnlyPercentRefValue )
254 {
255  if (!bOnlyPercentRefValue)
256  {
259  }
260 
261  SwRect aBoundRect;
262 
263  // OD 18.09.2003 #i18732# - adjustment for allowing vertical position
264  // aligned to page for fly frame anchored to paragraph or to character.
265  const RndStdIds eAnchorType = rVal.nAnchorType;
266  const SwFormatFrameSize& rSize = m_aSet.Get(RES_FRM_SIZE);
267  m_pOwnSh->CalcBoundRect( aBoundRect, eAnchorType,
268  rVal.nHRelOrient,
269  rVal.nVRelOrient,
270  pToCharContentPos,
271  rVal.bFollowTextFlow,
272  rVal.bMirror, nullptr, &rVal.aPercentSize,
273  &rSize);
274 
275  if (bOnlyPercentRefValue)
276  return;
277 
278  // #mongolianlayout#
280  {
281  Point aPos(aBoundRect.Pos());
282  long nTmp = aPos.X();
283  aPos.setX( aPos.Y() );
284  aPos.setY( nTmp );
285  Size aSize(aBoundRect.SSize());
286  nTmp = aSize.Width();
287  aSize.setWidth( aSize.Height() );
288  aSize.setHeight( nTmp );
289  aBoundRect.Chg( aPos, aSize );
290  //exchange width/height to enable correct values
291  nTmp = rVal.nWidth;
292  rVal.nWidth = rVal.nHeight;
293  rVal.nHeight = nTmp;
294  }
295  if ((eAnchorType == RndStdIds::FLY_AT_PAGE) || (eAnchorType == RndStdIds::FLY_AT_FLY))
296  {
297  // MinimalPosition
298  rVal.nMinHPos = aBoundRect.Left();
299  rVal.nMinVPos = aBoundRect.Top();
300  SwTwips nH = rVal.nHPos;
301  SwTwips nV = rVal.nVPos;
302 
303  if (rVal.nHPos + rVal.nWidth > aBoundRect.Right())
304  {
306  {
307  rVal.nHPos -= ((rVal.nHPos + rVal.nWidth) - aBoundRect.Right());
308  nH = rVal.nHPos;
309  }
310  else
311  rVal.nWidth = aBoundRect.Right() - rVal.nHPos;
312  }
313 
314  if (rVal.nHPos + rVal.nWidth > aBoundRect.Right())
315  rVal.nWidth = aBoundRect.Right() - rVal.nHPos;
316 
317  if (rVal.nVPos + rVal.nHeight > aBoundRect.Bottom())
318  {
320  {
321  rVal.nVPos -= ((rVal.nVPos + rVal.nHeight) - aBoundRect.Bottom());
322  nV = rVal.nVPos;
323  }
324  else
325  rVal.nHeight = aBoundRect.Bottom() - rVal.nVPos;
326  }
327 
328  if (rVal.nVPos + rVal.nHeight > aBoundRect.Bottom())
329  rVal.nHeight = aBoundRect.Bottom() - rVal.nVPos;
330 
332  nV = aBoundRect.Top();
333 
335  nH = aBoundRect.Left();
336 
337  rVal.nMaxHPos = aBoundRect.Right() - rVal.nWidth;
338  rVal.nMaxHeight = aBoundRect.Bottom() - nV;
339 
340  rVal.nMaxVPos = aBoundRect.Bottom() - rVal.nHeight;
341  rVal.nMaxWidth = aBoundRect.Right() - nH;
342  }
343  // OD 12.11.2003 #i22341# - handle to character anchored objects vertical
344  // aligned at character or top of line in a special case
345  else if ((eAnchorType == RndStdIds::FLY_AT_PARA) ||
346  ((eAnchorType == RndStdIds::FLY_AT_CHAR) &&
347  (rVal.nVRelOrient != text::RelOrientation::CHAR) &&
348  (rVal.nVRelOrient != text::RelOrientation::TEXT_LINE) ) )
349  {
350  if (rVal.nHPos + rVal.nWidth > aBoundRect.Right())
351  {
353  {
354  rVal.nHPos -= ((rVal.nHPos + rVal.nWidth) - aBoundRect.Right());
355  }
356  else
357  rVal.nWidth = aBoundRect.Right() - rVal.nHPos;
358  }
359 
360  // OD 29.09.2003 #i17567#, #i18732# - consider following the text flow
361  // and alignment at page areas.
362  const bool bMaxVPosAtBottom = !rVal.bFollowTextFlow ||
363  rVal.nVRelOrient == text::RelOrientation::PAGE_FRAME ||
364  rVal.nVRelOrient == text::RelOrientation::PAGE_PRINT_AREA;
365  {
366  SwTwips nTmpMaxVPos = ( bMaxVPosAtBottom
367  ? aBoundRect.Bottom()
368  : aBoundRect.Height() ) -
369  rVal.nHeight;
370  if ( rVal.nVPos > nTmpMaxVPos )
371  {
373  {
374  rVal.nVPos = nTmpMaxVPos;
375  }
376  else
377  {
378  rVal.nHeight = ( bMaxVPosAtBottom
379  ? aBoundRect.Bottom()
380  : aBoundRect.Height() ) - rVal.nVPos;
381  }
382  }
383  }
384 
385  rVal.nMinHPos = aBoundRect.Left();
386  rVal.nMaxHPos = aBoundRect.Right() - rVal.nWidth;
387 
388  rVal.nMinVPos = aBoundRect.Top();
389  // OD 26.09.2003 #i17567#, #i18732# - determine maximum vertical position
390  if ( bMaxVPosAtBottom )
391  {
392  rVal.nMaxVPos = aBoundRect.Bottom() - rVal.nHeight;
393  }
394  else
395  {
396  rVal.nMaxVPos = aBoundRect.Height() - rVal.nHeight;
397  }
398 
399  // maximum width height
400  const SwTwips nH = ( rVal.nHoriOrient != text::HoriOrientation::NONE )
401  ? aBoundRect.Left()
402  : rVal.nHPos;
403  const SwTwips nV = ( rVal.nVertOrient != text::VertOrientation::NONE )
404  ? aBoundRect.Top()
405  : rVal.nVPos;
406  rVal.nMaxHeight = rVal.nMaxVPos + rVal.nHeight - nV;
407  rVal.nMaxWidth = rVal.nMaxHPos + rVal.nWidth - nH;
408  }
409  // OD 12.11.2003 #i22341# - special case for to character anchored objects
410  // vertical aligned at character or top of line.
411  // Note: (1) positive vertical values are positions above the top of line
412  // (2) negative vertical values are positions below the top of line
413  else if ( (eAnchorType == RndStdIds::FLY_AT_CHAR) &&
414  ( rVal.nVRelOrient == text::RelOrientation::CHAR ||
415  rVal.nVRelOrient == text::RelOrientation::TEXT_LINE ) )
416  {
417  // determine horizontal values
418  rVal.nMinHPos = aBoundRect.Left();
419 
420  rVal.nMaxHPos = aBoundRect.Right() - rVal.nWidth;
421  if (rVal.nHPos + rVal.nWidth > aBoundRect.Right())
422  {
424  {
425  rVal.nHPos -= ((rVal.nHPos + rVal.nWidth) - aBoundRect.Right());
426  }
427  else
428  rVal.nWidth = aBoundRect.Right() - rVal.nHPos;
429  }
430 
431  const SwTwips nH = ( rVal.nHoriOrient != text::HoriOrientation::NONE )
432  ? aBoundRect.Left()
433  : rVal.nHPos;
434  rVal.nMaxWidth = rVal.nMaxHPos + rVal.nWidth - nH;
435 
436  // determine vertical values
437  rVal.nMinVPos = -( aBoundRect.Bottom() - rVal.nHeight );
438  if ( rVal.nVPos < rVal.nMinVPos &&
440  {
441  rVal.nVPos = rVal.nMinVPos;
442  }
443 
444  rVal.nMaxVPos = -aBoundRect.Top();
445  if ( rVal.nVPos > rVal.nMaxVPos &&
447  {
448  rVal.nVPos = rVal.nMaxVPos;
449  }
450 
452  {
453  rVal.nMaxHeight = aBoundRect.Bottom() + rVal.nVPos;
454  }
455  else
456  {
457  rVal.nMaxHeight = aBoundRect.Height();
458  }
459  }
460  else if ( eAnchorType == RndStdIds::FLY_AS_CHAR )
461  {
462  rVal.nMinHPos = 0;
463  rVal.nMaxHPos = 0;
464 
465  rVal.nMaxHeight = aBoundRect.Height();
466  rVal.nMaxWidth = aBoundRect.Width();
467 
468  rVal.nMaxVPos = aBoundRect.Height();
469  rVal.nMinVPos = -aBoundRect.Height() + rVal.nHeight;
470  if (rVal.nMaxVPos < rVal.nMinVPos)
471  {
472  rVal.nMinVPos = rVal.nMaxVPos;
473  rVal.nMaxVPos = -aBoundRect.Height();
474  }
475  }
476  // #mongolianlayout#
478  {
479  //restore width/height exchange
480  long nTmp = rVal.nWidth;
481  rVal.nWidth = rVal.nHeight;
482  rVal.nHeight = nTmp;
483  }
484 
485  if (rVal.nMaxWidth < rVal.nWidth)
486  rVal.nWidth = rVal.nMaxWidth;
487  if (rVal.nMaxHeight < rVal.nHeight)
488  rVal.nHeight = rVal.nMaxHeight;
489 }
490 
491 // correction for border
493 {
494  const SvxShadowItem& rShadow = GetShadow();
495  const SvxBoxItem& rBox = GetBox();
496  return rShadow.CalcShadowSpace(SvxShadowItemSide::TOP ) + rBox.CalcLineSpace(SvxBoxItemLine::TOP);
497 }
498 
500 {
501  const SvxShadowItem& rShadow = GetShadow();
502  const SvxBoxItem& rBox = GetBox();
503  return rShadow.CalcShadowSpace(SvxShadowItemSide::BOTTOM) + rBox.CalcLineSpace(SvxBoxItemLine::BOTTOM);
504 }
505 
507 {
508  const SvxShadowItem& rShadow = GetShadow();
509  const SvxBoxItem& rBox = GetBox();
510  return rShadow.CalcShadowSpace(SvxShadowItemSide::LEFT) + rBox.CalcLineSpace(SvxBoxItemLine::LEFT);
511 }
512 
514 {
515  const SvxShadowItem& rShadow = GetShadow();
516  const SvxBoxItem& rBox = GetBox();
517  return rShadow.CalcShadowSpace(SvxShadowItemSide::RIGHT) + rBox.CalcLineSpace(SvxBoxItemLine::RIGHT);
518 }
519 
520 // erase attribute from the set
521 void SwFlyFrameAttrMgr::DelAttr( sal_uInt16 nId )
522 {
523  m_aSet.ClearItem( nId );
524 }
525 
526 void SwFlyFrameAttrMgr::SetLRSpace( long nLeft, long nRight )
527 {
528  OSL_ENSURE( LONG_MAX != nLeft && LONG_MAX != nRight, "Which border to set?" );
529 
531  if( LONG_MAX != nLeft )
532  aTmp.SetLeft( sal_uInt16(nLeft) );
533  if( LONG_MAX != nRight )
534  aTmp.SetRight( sal_uInt16(nRight) );
535  m_aSet.Put( aTmp );
536 }
537 
538 void SwFlyFrameAttrMgr::SetULSpace( long nTop, long nBottom )
539 {
540  OSL_ENSURE(LONG_MAX != nTop && LONG_MAX != nBottom, "Which border to set?" );
541 
543  if( LONG_MAX != nTop )
544  aTmp.SetUpper( sal_uInt16(nTop) );
545  if( LONG_MAX != nBottom )
546  aTmp.SetLower( sal_uInt16(nBottom) );
547  m_aSet.Put( aTmp );
548 }
549 
550 void SwFlyFrameAttrMgr::SetPos( const Point& rPoint )
551 {
552  SwFormatVertOrient aVertOrient( GetVertOrient() );
553  SwFormatHoriOrient aHoriOrient( GetHoriOrient() );
554 
555  aHoriOrient.SetPos ( rPoint.X() );
557 
558  aVertOrient.SetPos ( rPoint.Y() );
560 
561  m_aSet.Put( aVertOrient );
562  m_aSet.Put( aHoriOrient );
563 }
564 
565 void SwFlyFrameAttrMgr::SetHorzOrientation( sal_Int16 eOrient )
566 {
567  SwFormatHoriOrient aHoriOrient( GetHoriOrient() );
568  aHoriOrient.SetHoriOrient( eOrient );
569  m_aSet.Put( aHoriOrient );
570 }
571 
572 void SwFlyFrameAttrMgr::SetVertOrientation( sal_Int16 eOrient )
573 {
574  SwFormatVertOrient aVertOrient( GetVertOrient() );
575  aVertOrient.SetVertOrient( eOrient );
576  m_aSet.Put( aVertOrient );
577 }
578 
580 {
581  SwFormatFrameSize aSize( GetFrameSize() );
582  aSize.SetHeightSizeType( eType );
583  m_aSet.Put( aSize );
584 }
585 
586 void SwFlyFrameAttrMgr::SetRotation(sal_uInt16 nOld, sal_uInt16 nNew, const Size& rUnrotatedSize)
587 {
588  // RotGrfFlyFrame: Central handling of real change of rotation here, all adaptations use this.
589  // Adaptation of pos/size may be wanted in the future. Already tried to keep last Size in
590  // UnrotatedSize in the SwRotationGrf Item, but this will lead to various problems. Also tried
591  // to use m_aSet.Put(...) as in other methods (also tried read methods for Rotation/UnrotatedSize) but
592  // somehow the needed ID (RES_GRFATR_ROTATION) is *not* in the SfxItemSet of the Frame, so for
593  // now set directly. Undo/Redo is preserved by AttributeChange
594  if(nOld != nNew)
595  {
596  m_pOwnSh->SetAttrItem(SwRotationGrf(nNew, rUnrotatedSize));
597  }
598 }
599 
600 void SwFlyFrameAttrMgr::SetSize( const Size& rSize )
601 {
602  SwFormatFrameSize aSize( GetFrameSize() );
603  aSize.SetSize(Size(std::max(rSize.Width(), long(MINFLY)), std::max(rSize.Height(), long(MINFLY))));
604  m_aSet.Put( aSize );
605 }
606 
608 {
609  m_aSet.ClearItem();
610  m_aSet.Put( rSet );
611 }
612 
613 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
long Width() const
void SetFlyName(const OUString &rName)
Set name at selected FlyFrame.
Definition: fefly1.cxx:1449
void FrameNotify(SwViewShell *pVwSh, FlyMode eMode)
Definition: edtwin3.cxx:79
const SwFormatFrameSize & GetFrameSize() const
Definition: frmmgr.hxx:151
SAL_DLLPRIVATE SwTwips CalcTopSpace()
Definition: frmmgr.cxx:492
Marks a position in the document model.
Definition: pam.hxx:35
void SetPos(const Point &rLPoint)
Definition: frmmgr.cxx:550
void UpdateAttrMgr()
Definition: frmmgr.cxx:122
long Height() const
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
bool m_bIsInVerticalL2R
Definition: frmmgr.hxx:60
#define MINFLY
Definition: swtypes.hxx:65
constexpr TypedWhichId< SwRotationGrf > RES_GRFATR_ROTATION(133)
void Height(long nNew)
Definition: swrect.hxx:191
sal_Int16 nId
void GetPageNum(sal_uInt16 &rnPhyNum, sal_uInt16 &rnVirtNum, bool bAtCursorPos=true, const bool bCalcFrame=true)
Definition: crsrsh.cxx:1207
void SetCol(const SwFormatCol &rCol)
Definition: frmmgr.cxx:232
long SwTwips
Definition: swtypes.hxx:49
void Pos(const Point &rNew)
Definition: swrect.hxx:169
void SetULSpace(long nTop, long nBottom)
Definition: frmmgr.cxx:538
SwWrtShell * m_pOwnSh
Definition: frmmgr.hxx:54
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
void SetModified()
Definition: edws.cxx:70
#define SO3_SM_CLASSID
void DelAttr(sal_uInt16 nId)
Definition: frmmgr.cxx:521
void EndAllAction()
Definition: edws.cxx:97
Value in Var-direction gives minimum (can be exceeded but not be less).
Used by the UI to modify the document model.
Definition: wrtsh.hxx:90
const SwTwips DFLT_HEIGHT
Definition: frmmgr.hxx:39
void SetLeft(const long nL, const sal_uInt16 nProp=100)
const SwView & GetView() const
Definition: wrtsh.hxx:428
void Top(const long nTop)
Definition: swrect.hxx:204
void SetHoriOrient(sal_Int16 eNew)
Definition: fmtornt.hxx:89
void SetVertOrientation(sal_Int16 eOrient)
Definition: frmmgr.cxx:572
void Right(const long nRight)
Definition: swrect.hxx:200
void SetFlyPos(const Point &rAbsPos)
Definition: fefly1.cxx:371
void InsertFlyFrame()
Definition: frmmgr.cxx:177
bool GetFlyFrameAttr(SfxItemSet &rSet) const
Definition: fefly1.cxx:1038
void SetHeightSizeType(SwFrameSize eType)
Definition: frmmgr.cxx:579
sal_uInt16 char * pName
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
void SetAbsPos(const Point &rLPoint)
Definition: frmmgr.cxx:238
SfxItemSet m_aSet
Definition: frmmgr.hxx:52
void SetVertOrient(sal_Int16 eNew)
Definition: fmtornt.hxx:56
sal_uInt16 CalcShadowSpace(SvxShadowItemSide nShadow) const
void SetAttrItem(const SfxPoolItem &, SetAttrMode nFlags=SetAttrMode::DEFAULT, const bool bParagraphSetting=false)
Definition: edatmisc.cxx:112
void SetPos(SwTwips nNew)
Definition: fmtornt.hxx:60
sal_uInt16 Count() const
FlyAnchors.
Definition: fmtanchr.hxx:34
bool SetFlyFrameAttr(SfxItemSet &rSet)
Definition: fefly1.cxx:1081
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)
Definition: viewopt.cxx:337
void SetAttrSet(const SfxItemSet &rSet)
Definition: frmmgr.cxx:607
constexpr sal_uInt16 XATTR_FILL_FIRST(XATTRSET_LINE+1)
void SetRelationOrient(sal_Int16 eNew)
Definition: fmtornt.hxx:90
SAL_DLLPRIVATE SwTwips CalcBottomSpace()
Definition: frmmgr.cxx:499
void SetAnchor(RndStdIds eId)
Definition: frmmgr.cxx:213
SwFrameSize
Definition: fmtfsize.hxx:35
Frmmgr_Type
Definition: frmmgr.hxx:41
void SSize(const Size &rNew)
Definition: swrect.hxx:178
SwFlyFrameAttrMgr(bool bNew, SwWrtShell *pSh, Frmmgr_Type nType, const SvGlobalName *pName)
Definition: frmmgr.cxx:64
SfxItemPool * GetPool() const
const long LONG_MAX
SwDocShell * GetDocShell()
Definition: view.cxx:1108
void CalcBoundRect(SwRect &_orRect, const RndStdIds _nAnchorId, const sal_Int16 _eHoriRelOrient=css::text::RelOrientation::FRAME, const sal_Int16 _eVertRelOrient=css::text::RelOrientation::FRAME, const SwPosition *_pToCharContentPos=nullptr, const bool _bFollowTextFlow=false, bool _bMirror=false, Point *_opRef=nullptr, Size *_opPercent=nullptr, const SwFormatFrameSize *pFormatFrameSize=nullptr) const
i#17567 - adjustments to allow negative vertical positions for fly frames anchored to paragraph or to...
Definition: fews.cxx:690
void SetParent(const SfxItemSet *pNew)
constexpr sal_uInt16 RES_FRMATR_END(131)
void Left(const long nLeft)
Definition: swrect.hxx:195
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void Bottom(const long nBottom)
Definition: swrect.hxx:209
const SwFrameFormat * NewFlyFrame(const SfxItemSet &rSet, bool bAnchValid=false, SwFrameFormat *pParent=nullptr)
Definition: fefly1.cxx:646
SAL_DLLPRIVATE SwTwips CalcRightSpace()
Definition: frmmgr.cxx:513
bool IsFrameVertical(const bool bEnvironment, bool &bRightToLeft, bool &bVertL2R) const
Determines whether a frame or its environment is vertically formatted and right-to-left.
Definition: fews.cxx:1270
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void SetHorzOrientation(sal_Int16 eOrient)
Definition: frmmgr.cxx:565
void Width(long nNew)
Definition: swrect.hxx:187
#define FN_SET_FRM_NAME
Definition: cmdid.h:849
SwFormat * GetFormatFromPool(sal_uInt16 nId)
return the requested automatic format - base-class !
Definition: edfmt.cxx:129
void SetSize(const Size &rSize)
void SetSize(const Size &rLSize)
Definition: frmmgr.cxx:600
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
void SetRelationOrient(sal_Int16 eNew)
Definition: fmtornt.hxx:57
const SwFormatVertOrient & GetVertOrient() const
Definition: frmmgr.hxx:143
sal_uInt16 CalcLineSpace(SvxBoxItemLine nLine, bool bEvenIfNoLine=false) const
void SetPos(SwTwips nNew)
Definition: fmtornt.hxx:93
SW_DLLPUBLIC void PrepareBoxInfo(SfxItemSet &rSet, const SwWrtShell &rSh)
Definition: uitool.cxx:79
bool m_bIsInVertical
Definition: frmmgr.hxx:58
void SetRotation(sal_uInt16 nOld, sal_uInt16 nNew, const Size &rUnrotatedSize)
Definition: frmmgr.cxx:586
RndStdIds
void SetLRSpace(long nLeft, long nRight)
Definition: frmmgr.cxx:526
constexpr sal_uInt16 XATTR_FILL_LAST(XATTR_FILLBACKGROUND)
const SvxShadowItem & GetShadow() const
Definition: frmmgr.hxx:155
void EnterSelFrameMode(const Point *pStartDrag=nullptr)
Definition: select.cxx:701
if(!pCandidateA->getEnd().equal(pCandidateB->getStart()))
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:116
std::vector< bool, std::allocator< bool > > m_aSet
const SwTwips DFLT_WIDTH
Definition: frmmgr.hxx:38
void StartAllAction()
For all views of this document.
Definition: edws.cxx:86
void SetUpper(const sal_uInt16 nU, const sal_uInt16 nProp=100)
void Chg(const Point &rNP, const Size &rNS)
Definition: swrect.hxx:164
void SetHeightSizeType(SwFrameSize eSize)
Definition: fmtfsize.hxx:81
constexpr sal_uInt16 RES_FRMATR_BEGIN(RES_PARATR_LIST_END)
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(92)
bool IsFrameSelected() const
Definition: feshview.cxx:1158
void ValidateMetrics(SvxSwFrameValidation &rVal, const SwPosition *pToCharContentPos, bool bOnlyPercentRefValue=false)
Definition: frmmgr.cxx:251
SAL_DLLPRIVATE void UpdateFlyFrame_()
Definition: frmmgr.cxx:129
SAL_DLLPRIVATE SwTwips CalcLeftSpace()
Definition: frmmgr.cxx:506
const SwFormatHoriOrient & GetHoriOrient() const
Definition: frmmgr.hxx:147
constexpr TypedWhichId< SwFormatAnchor > RES_ANCHOR(104)
const SvxBoxItem & GetBox() const
Definition: frmmgr.hxx:159
void UpdateFlyFrame()
Definition: frmmgr.cxx:146
static sal_uInt16 aFrameMgrRange[]
Definition: frmmgr.cxx:48