1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
21 #include <hintids.hxx>
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>
28 #include <svx/swframevalidation.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>
37 #include <viewopt.hxx>
42 #include <poolfmt.hxx>
43 #include <com/sun/star/text/HoriOrientation.hpp>
44 #include <com/sun/star/text/VertOrientation.hpp>
45 #include <com/sun/star/text/RelOrientation.hpp>
48 using namespace ::com::sun::star
;
50 const WhichRangesContainer
aFrameMgrRange(svl::Items
<
51 RES_FRMATR_BEGIN
, RES_FRMATR_END
-1, // 87-129
53 // RotGrfFlyFrame: Support here, but seems not to be
54 // added in range of m_pOwnSh->GetFlyFrameAttr result
55 // (see below). Tried to find, but could not identify
56 RES_GRFATR_ROTATION
, RES_GRFATR_ROTATION
, // 132
58 // FillAttribute support
59 XATTR_FILL_FIRST
, XATTR_FILL_LAST
, // 1014-1033
61 SID_ATTR_BORDER_INNER
, SID_ATTR_BORDER_INNER
,
62 FN_SET_FRM_NAME
, FN_SET_FRM_NAME
65 // determine frame attributes via Shell
66 SwFlyFrameAttrMgr::SwFlyFrameAttrMgr( bool bNew
, SwWrtShell
* pSh
, Frmmgr_Type nType
, const SvGlobalName
* pName
) :
67 m_aSet( static_cast<SwAttrPool
&>(pSh
->GetAttrPool()), aFrameMgrRange
),
71 m_bIsInVertical( false ),
72 m_bIsInVerticalL2R( false )
79 case Frmmgr_Type::TEXT
: nId
= RES_POOLFRM_FRAME
; break;
80 case Frmmgr_Type::OLE
: nId
= RES_POOLFRM_OLE
; break;
81 case Frmmgr_Type::GRF
: nId
= RES_POOLFRM_GRAPHIC
; break;
83 default: nId
=0; break;
85 m_aSet
.SetParent( &m_pOwnSh
->GetFormatFromPool( nId
)->GetAttrSet());
86 m_aSet
.Put( SwFormatFrameSize( SwFrameSize::Minimum
, DFLT_WIDTH
, DFLT_HEIGHT
));
87 if ( 0 != ::GetHtmlMode(pSh
->GetView().GetDocShell()) )
88 m_aSet
.Put( SwFormatHoriOrient( 0, text::HoriOrientation::LEFT
, text::RelOrientation::PRINT_AREA
) );
90 if (nType
== Frmmgr_Type::GRF
|| nType
== Frmmgr_Type::OLE
)
92 if (!pName
|| *pName
!= SvGlobalName( SO3_SM_CLASSID
))
94 // Default anchor for new graphics and objects is at-char, except for Math objects.
95 SwViewOption
aViewOpt(*pSh
->GetViewOptions());
97 RndStdIds eAnchorType
= aViewOpt
.GetDefaultAnchorType();
99 const SwFormatAnchor rStyleAnchor
100 = m_pOwnSh
->GetFormatFromPool(nId
)->GetAttrSet().GetAnchor();
101 if (rStyleAnchor
.GetAnchorId() != RndStdIds::FLY_AT_PARA
)
103 // The style has a custom anchor type, prefer that over the user profile
105 eAnchorType
= rStyleAnchor
.GetAnchorId();
108 m_aSet
.Put(SwFormatAnchor(eAnchorType
));
112 else if ( nType
== Frmmgr_Type::NONE
)
114 m_pOwnSh
->GetFlyFrameAttr( m_aSet
);
116 m_bIsInVertical
= m_pOwnSh
->IsFrameVertical(true, bRightToLeft
, m_bIsInVerticalL2R
);
118 ::PrepareBoxInfo( m_aSet
, *m_pOwnSh
);
121 SwFlyFrameAttrMgr::SwFlyFrameAttrMgr( bool bNew
, SwWrtShell
* pSh
, SfxItemSet aSet
) :
122 m_aSet(std::move( aSet
)),
126 m_bIsInVertical(false),
127 m_bIsInVerticalL2R(false)
132 m_bIsInVertical
= pSh
->IsFrameVertical(true, bRightToLeft
, m_bIsInVerticalL2R
);
137 void SwFlyFrameAttrMgr::UpdateAttrMgr()
139 if ( !m_bNewFrame
&& m_pOwnSh
->IsFrameSelected() )
140 m_pOwnSh
->GetFlyFrameAttr( m_aSet
);
141 ::PrepareBoxInfo( m_aSet
, *m_pOwnSh
);
144 void SwFlyFrameAttrMgr::UpdateFlyFrame_()
146 if (const SfxStringItem
* pItem
= m_aSet
.GetItemIfSet(FN_SET_FRM_NAME
, false))
147 m_pOwnSh
->SetFlyName(pItem
->GetValue());
149 m_pOwnSh
->SetModified();
153 m_pOwnSh
->SetFlyPos( m_aAbsPos
);
158 // change existing Fly-Frame
159 void SwFlyFrameAttrMgr::UpdateFlyFrame()
161 OSL_ENSURE( m_pOwnSh
->IsFrameSelected(),
162 "no frame selected or no shell, update not possible");
164 if( !m_pOwnSh
->IsFrameSelected() )
167 //JP 6.8.2001: set never an invalid anchor into the core.
168 const SwFormatAnchor
*pGItem
, *pItem
;
169 if( (pItem
= m_aSet
.GetItemIfSet( RES_ANCHOR
, false )) )
171 SfxItemSetFixed
<RES_ANCHOR
, RES_ANCHOR
> aGetSet( *m_aSet
.GetPool() );
172 if( m_pOwnSh
->GetFlyFrameAttr( aGetSet
) && 1 == aGetSet
.Count() &&
173 (pGItem
= aGetSet
.GetItemIfSet( RES_ANCHOR
, false ))
174 && pGItem
->GetAnchorId() == pItem
->GetAnchorId() )
175 m_aSet
.ClearItem( RES_ANCHOR
);
181 m_pOwnSh
->StartAllAction();
182 m_pOwnSh
->SetFlyFrameAttr( m_aSet
);
184 m_pOwnSh
->EndAllAction();
189 void SwFlyFrameAttrMgr::InsertFlyFrame()
191 m_pOwnSh
->StartAllAction();
193 bool bRet
= nullptr != m_pOwnSh
->NewFlyFrame( m_aSet
);
195 // turn on the right mode at the shell, frame got selected automatically.
199 m_pOwnSh
->EnterSelFrameMode();
200 FrameNotify(m_pOwnSh
, FLY_DRAG_START
);
202 m_pOwnSh
->EndAllAction();
205 // Insert frames of type eAnchorType. Position and size are being set explicitly.
206 // Not-allowed values of the enumeration type get corrected.
207 void SwFlyFrameAttrMgr::InsertFlyFrame(RndStdIds eAnchorType
,
211 OSL_ENSURE( eAnchorType
== RndStdIds::FLY_AT_PAGE
||
212 eAnchorType
== RndStdIds::FLY_AT_PARA
||
213 eAnchorType
== RndStdIds::FLY_AT_CHAR
||
214 eAnchorType
== RndStdIds::FLY_AT_FLY
||
215 eAnchorType
== RndStdIds::FLY_AS_CHAR
, "invalid frame type" );
220 SetAnchor( eAnchorType
);
225 void SwFlyFrameAttrMgr::SetAnchor( RndStdIds eId
)
227 sal_uInt16 nPhyPageNum
, nVirtPageNum
;
228 m_pOwnSh
->GetPageNum( nPhyPageNum
, nVirtPageNum
);
230 m_aSet
.Put( SwFormatAnchor( eId
, RndStdIds::FLY_AT_PAGE
== eId
? nPhyPageNum
: 0 ) );
231 if ((RndStdIds::FLY_AT_PAGE
== eId
) || (RndStdIds::FLY_AT_PARA
== eId
) || (RndStdIds::FLY_AT_CHAR
== eId
)
232 || (RndStdIds::FLY_AT_FLY
== eId
))
234 SwFormatVertOrient
aVertOrient( GetVertOrient() );
235 SwFormatHoriOrient
aHoriOrient( GetHoriOrient() );
236 aHoriOrient
.SetRelationOrient( text::RelOrientation::FRAME
);
237 aVertOrient
.SetRelationOrient( text::RelOrientation::FRAME
);
238 m_aSet
.Put( aVertOrient
);
239 m_aSet
.Put( aHoriOrient
);
243 // set the attribute for columns
244 void SwFlyFrameAttrMgr::SetCol( const SwFormatCol
&rCol
)
249 // set absolute position
250 void SwFlyFrameAttrMgr::SetAbsPos( const Point
& rPoint
)
254 SwFormatVertOrient
aVertOrient( GetVertOrient() );
255 SwFormatHoriOrient
aHoriOrient( GetHoriOrient() );
256 aHoriOrient
.SetHoriOrient( text::HoriOrientation::NONE
);
257 aVertOrient
.SetVertOrient( text::VertOrientation::NONE
);
258 m_aSet
.Put( aVertOrient
);
259 m_aSet
.Put( aHoriOrient
);
262 // check metrics for correctness
263 void SwFlyFrameAttrMgr::ValidateMetrics( SvxSwFrameValidation
& rVal
,
264 const SwFormatAnchor
* pToCharContentPos
,
265 bool bOnlyPercentRefValue
)
267 if (!bOnlyPercentRefValue
)
269 rVal
.nMinHeight
= MINFLY
+ CalcTopSpace() + CalcBottomSpace();
270 rVal
.nMinWidth
= MINFLY
+ CalcLeftSpace()+ CalcRightSpace();
275 // OD 18.09.2003 #i18732# - adjustment for allowing vertical position
276 // aligned to page for fly frame anchored to paragraph or to character.
277 const RndStdIds eAnchorType
= rVal
.nAnchorType
;
278 const SwFormatFrameSize
& rSize
= m_aSet
.Get(RES_FRM_SIZE
);
279 m_pOwnSh
->CalcBoundRect( aBoundRect
, eAnchorType
,
283 rVal
.bFollowTextFlow
,
284 rVal
.bMirror
, nullptr, &rVal
.aPercentSize
,
287 if (bOnlyPercentRefValue
)
291 if ( m_bIsInVertical
|| m_bIsInVerticalL2R
)
293 Point
aPos(aBoundRect
.Pos());
294 tools::Long nTmp
= aPos
.X();
295 aPos
.setX( aPos
.Y() );
297 Size
aSize(aBoundRect
.SSize());
298 nTmp
= aSize
.Width();
299 aSize
.setWidth( aSize
.Height() );
300 aSize
.setHeight( nTmp
);
301 aBoundRect
.Chg( aPos
, aSize
);
302 //exchange width/height to enable correct values
304 rVal
.nWidth
= rVal
.nHeight
;
307 if ((eAnchorType
== RndStdIds::FLY_AT_PAGE
) || (eAnchorType
== RndStdIds::FLY_AT_FLY
))
310 rVal
.nMinHPos
= aBoundRect
.Left();
311 rVal
.nMinVPos
= aBoundRect
.Top();
312 SwTwips nH
= rVal
.nHPos
;
313 SwTwips nV
= rVal
.nVPos
;
315 if (rVal
.nHPos
+ rVal
.nWidth
> aBoundRect
.Right())
317 if (rVal
.nHoriOrient
== text::HoriOrientation::NONE
)
319 rVal
.nHPos
-= ((rVal
.nHPos
+ rVal
.nWidth
) - aBoundRect
.Right());
323 rVal
.nWidth
= aBoundRect
.Right() - rVal
.nHPos
;
326 if (rVal
.nHPos
+ rVal
.nWidth
> aBoundRect
.Right())
327 rVal
.nWidth
= aBoundRect
.Right() - rVal
.nHPos
;
329 if (rVal
.nVPos
+ rVal
.nHeight
> aBoundRect
.Bottom())
331 if (rVal
.nVertOrient
== text::VertOrientation::NONE
)
333 rVal
.nVPos
-= ((rVal
.nVPos
+ rVal
.nHeight
) - aBoundRect
.Bottom());
337 rVal
.nHeight
= aBoundRect
.Bottom() - rVal
.nVPos
;
340 if (rVal
.nVPos
+ rVal
.nHeight
> aBoundRect
.Bottom())
341 rVal
.nHeight
= aBoundRect
.Bottom() - rVal
.nVPos
;
343 if ( rVal
.nVertOrient
!= text::VertOrientation::NONE
)
344 nV
= aBoundRect
.Top();
346 if ( rVal
.nHoriOrient
!= text::HoriOrientation::NONE
)
347 nH
= aBoundRect
.Left();
349 rVal
.nMaxHPos
= aBoundRect
.Right() - rVal
.nWidth
;
350 rVal
.nMaxHeight
= aBoundRect
.Bottom() - nV
;
352 rVal
.nMaxVPos
= aBoundRect
.Bottom() - rVal
.nHeight
;
353 rVal
.nMaxWidth
= aBoundRect
.Right() - nH
;
355 // OD 12.11.2003 #i22341# - handle to character anchored objects vertical
356 // aligned at character or top of line in a special case
357 else if ((eAnchorType
== RndStdIds::FLY_AT_PARA
) ||
358 ((eAnchorType
== RndStdIds::FLY_AT_CHAR
) &&
359 (rVal
.nVRelOrient
!= text::RelOrientation::CHAR
) &&
360 (rVal
.nVRelOrient
!= text::RelOrientation::TEXT_LINE
) ) )
362 if (rVal
.nHPos
+ rVal
.nWidth
> aBoundRect
.Right())
364 if (rVal
.nHoriOrient
== text::HoriOrientation::NONE
)
366 rVal
.nHPos
-= ((rVal
.nHPos
+ rVal
.nWidth
) - aBoundRect
.Right());
369 rVal
.nWidth
= aBoundRect
.Right() - rVal
.nHPos
;
372 // OD 29.09.2003 #i17567#, #i18732# - consider following the text flow
373 // and alignment at page areas.
374 const bool bMaxVPosAtBottom
= !rVal
.bFollowTextFlow
||
375 rVal
.nVRelOrient
== text::RelOrientation::PAGE_FRAME
||
376 rVal
.nVRelOrient
== text::RelOrientation::PAGE_PRINT_AREA
;
378 SwTwips nTmpMaxVPos
= ( bMaxVPosAtBottom
379 ? aBoundRect
.Bottom()
380 : aBoundRect
.Height() ) -
382 if ( rVal
.nVPos
> nTmpMaxVPos
)
384 if (rVal
.nVertOrient
== text::VertOrientation::NONE
)
386 rVal
.nVPos
= nTmpMaxVPos
;
390 rVal
.nHeight
= ( bMaxVPosAtBottom
391 ? aBoundRect
.Bottom()
392 : aBoundRect
.Height() ) - rVal
.nVPos
;
397 rVal
.nMinHPos
= aBoundRect
.Left();
398 rVal
.nMaxHPos
= aBoundRect
.Right() - rVal
.nWidth
;
400 rVal
.nMinVPos
= aBoundRect
.Top();
401 // OD 26.09.2003 #i17567#, #i18732# - determine maximum vertical position
402 if ( bMaxVPosAtBottom
)
404 rVal
.nMaxVPos
= aBoundRect
.Bottom() - rVal
.nHeight
;
408 rVal
.nMaxVPos
= aBoundRect
.Height() - rVal
.nHeight
;
411 // maximum width height
412 const SwTwips nH
= ( rVal
.nHoriOrient
!= text::HoriOrientation::NONE
)
415 const SwTwips nV
= ( rVal
.nVertOrient
!= text::VertOrientation::NONE
)
418 rVal
.nMaxHeight
= rVal
.nMaxVPos
+ rVal
.nHeight
- nV
;
419 rVal
.nMaxWidth
= rVal
.nMaxHPos
+ rVal
.nWidth
- nH
;
421 // OD 12.11.2003 #i22341# - special case for to character anchored objects
422 // vertical aligned at character or top of line.
423 // Note: (1) positive vertical values are positions above the top of line
424 // (2) negative vertical values are positions below the top of line
425 else if ( (eAnchorType
== RndStdIds::FLY_AT_CHAR
) &&
426 ( rVal
.nVRelOrient
== text::RelOrientation::CHAR
||
427 rVal
.nVRelOrient
== text::RelOrientation::TEXT_LINE
) )
429 // determine horizontal values
430 rVal
.nMinHPos
= aBoundRect
.Left();
432 rVal
.nMaxHPos
= aBoundRect
.Right() - rVal
.nWidth
;
433 if (rVal
.nHPos
+ rVal
.nWidth
> aBoundRect
.Right())
435 if (rVal
.nHoriOrient
== text::HoriOrientation::NONE
)
437 rVal
.nHPos
-= ((rVal
.nHPos
+ rVal
.nWidth
) - aBoundRect
.Right());
440 rVal
.nWidth
= aBoundRect
.Right() - rVal
.nHPos
;
443 const SwTwips nH
= ( rVal
.nHoriOrient
!= text::HoriOrientation::NONE
)
446 rVal
.nMaxWidth
= rVal
.nMaxHPos
+ rVal
.nWidth
- nH
;
448 // determine vertical values
449 rVal
.nMinVPos
= -( aBoundRect
.Bottom() - rVal
.nHeight
);
450 if ( rVal
.nVPos
< rVal
.nMinVPos
&&
451 rVal
.nVertOrient
== text::VertOrientation::NONE
)
453 rVal
.nVPos
= rVal
.nMinVPos
;
456 rVal
.nMaxVPos
= -aBoundRect
.Top();
457 if ( rVal
.nVPos
> rVal
.nMaxVPos
&&
458 rVal
.nVertOrient
== text::VertOrientation::NONE
)
460 rVal
.nVPos
= rVal
.nMaxVPos
;
463 if ( rVal
.nVertOrient
== text::VertOrientation::NONE
)
465 rVal
.nMaxHeight
= aBoundRect
.Bottom() + rVal
.nVPos
;
469 rVal
.nMaxHeight
= aBoundRect
.Height();
472 else if ( eAnchorType
== RndStdIds::FLY_AS_CHAR
)
477 rVal
.nMaxHeight
= aBoundRect
.Height();
478 rVal
.nMaxWidth
= aBoundRect
.Width();
480 rVal
.nMaxVPos
= aBoundRect
.Height();
481 rVal
.nMinVPos
= -aBoundRect
.Height() + rVal
.nHeight
;
482 if (rVal
.nMaxVPos
< rVal
.nMinVPos
)
484 rVal
.nMinVPos
= rVal
.nMaxVPos
;
485 rVal
.nMaxVPos
= -aBoundRect
.Height();
489 if ( m_bIsInVertical
|| m_bIsInVerticalL2R
)
491 //restore width/height exchange
492 tools::Long nTmp
= rVal
.nWidth
;
493 rVal
.nWidth
= rVal
.nHeight
;
497 if (rVal
.nMaxWidth
< rVal
.nWidth
)
498 rVal
.nWidth
= rVal
.nMaxWidth
;
499 if (rVal
.nMaxHeight
< rVal
.nHeight
)
500 rVal
.nHeight
= rVal
.nMaxHeight
;
503 // correction for border
504 SwTwips
SwFlyFrameAttrMgr::CalcTopSpace()
506 const SvxShadowItem
& rShadow
= GetShadow();
507 const SvxBoxItem
& rBox
= GetBox();
508 return rShadow
.CalcShadowSpace(SvxShadowItemSide::TOP
) + rBox
.CalcLineSpace(SvxBoxItemLine::TOP
);
511 SwTwips
SwFlyFrameAttrMgr::CalcBottomSpace()
513 const SvxShadowItem
& rShadow
= GetShadow();
514 const SvxBoxItem
& rBox
= GetBox();
515 return rShadow
.CalcShadowSpace(SvxShadowItemSide::BOTTOM
) + rBox
.CalcLineSpace(SvxBoxItemLine::BOTTOM
);
518 SwTwips
SwFlyFrameAttrMgr::CalcLeftSpace()
520 const SvxShadowItem
& rShadow
= GetShadow();
521 const SvxBoxItem
& rBox
= GetBox();
522 return rShadow
.CalcShadowSpace(SvxShadowItemSide::LEFT
) + rBox
.CalcLineSpace(SvxBoxItemLine::LEFT
);
525 SwTwips
SwFlyFrameAttrMgr::CalcRightSpace()
527 const SvxShadowItem
& rShadow
= GetShadow();
528 const SvxBoxItem
& rBox
= GetBox();
529 return rShadow
.CalcShadowSpace(SvxShadowItemSide::RIGHT
) + rBox
.CalcLineSpace(SvxBoxItemLine::RIGHT
);
532 // erase attribute from the set
533 void SwFlyFrameAttrMgr::DelAttr( sal_uInt16 nId
)
535 m_aSet
.ClearItem( nId
);
538 void SwFlyFrameAttrMgr::SetLRSpace( tools::Long nLeft
, tools::Long nRight
)
540 OSL_ENSURE( LONG_MAX
!= nLeft
&& LONG_MAX
!= nRight
, "Which border to set?" );
542 SvxLRSpaceItem
aTmp( m_aSet
.Get( RES_LR_SPACE
) );
543 if( LONG_MAX
!= nLeft
)
544 aTmp
.SetLeft( sal_uInt16(nLeft
) );
545 if( LONG_MAX
!= nRight
)
546 aTmp
.SetRight( sal_uInt16(nRight
) );
550 void SwFlyFrameAttrMgr::SetULSpace( tools::Long nTop
, tools::Long nBottom
)
552 OSL_ENSURE(LONG_MAX
!= nTop
&& LONG_MAX
!= nBottom
, "Which border to set?" );
554 SvxULSpaceItem
aTmp( m_aSet
.Get( RES_UL_SPACE
) );
555 if( LONG_MAX
!= nTop
)
556 aTmp
.SetUpper( sal_uInt16(nTop
) );
557 if( LONG_MAX
!= nBottom
)
558 aTmp
.SetLower( sal_uInt16(nBottom
) );
562 void SwFlyFrameAttrMgr::SetPos( const Point
& rPoint
)
564 SwFormatVertOrient
aVertOrient( GetVertOrient() );
565 SwFormatHoriOrient
aHoriOrient( GetHoriOrient() );
567 aHoriOrient
.SetPos ( rPoint
.X() );
568 aHoriOrient
.SetHoriOrient( text::HoriOrientation::NONE
);
570 aVertOrient
.SetPos ( rPoint
.Y() );
571 aVertOrient
.SetVertOrient( text::VertOrientation::NONE
);
573 m_aSet
.Put( aVertOrient
);
574 m_aSet
.Put( aHoriOrient
);
577 void SwFlyFrameAttrMgr::SetHorzOrientation( sal_Int16 eOrient
)
579 SwFormatHoriOrient
aHoriOrient( GetHoriOrient() );
580 aHoriOrient
.SetHoriOrient( eOrient
);
581 m_aSet
.Put( aHoriOrient
);
584 void SwFlyFrameAttrMgr::SetVertOrientation( sal_Int16 eOrient
)
586 SwFormatVertOrient
aVertOrient( GetVertOrient() );
587 aVertOrient
.SetVertOrient( eOrient
);
588 m_aSet
.Put( aVertOrient
);
591 void SwFlyFrameAttrMgr::SetHeightSizeType( SwFrameSize eType
)
593 SwFormatFrameSize
aSize( GetFrameSize() );
594 aSize
.SetHeightSizeType( eType
);
598 void SwFlyFrameAttrMgr::SetRotation(Degree10 nOld
, Degree10 nNew
, const Size
& rUnrotatedSize
)
600 // RotGrfFlyFrame: Central handling of real change of rotation here, all adaptations use this.
601 // Adaptation of pos/size may be wanted in the future. Already tried to keep last Size in
602 // UnrotatedSize in the SwRotationGrf Item, but this will lead to various problems. Also tried
603 // to use m_aSet.Put(...) as in other methods (also tried read methods for Rotation/UnrotatedSize) but
604 // somehow the needed ID (RES_GRFATR_ROTATION) is *not* in the SfxItemSet of the Frame, so for
605 // now set directly. Undo/Redo is preserved by AttributeChange
608 m_pOwnSh
->SetAttrItem(SwRotationGrf(nNew
, rUnrotatedSize
));
612 void SwFlyFrameAttrMgr::SetSize( const Size
& rSize
)
614 SwFormatFrameSize
aSize( GetFrameSize() );
615 aSize
.SetSize(Size(std::max(rSize
.Width(), tools::Long(MINFLY
)), std::max(rSize
.Height(), tools::Long(MINFLY
))));
619 void SwFlyFrameAttrMgr::SetAttrSet(const SfxItemSet
& rSet
)
625 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */