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