diff options
author | Armin Le Grand <Armin.Le.Grand@cib.de> | 2017-09-26 15:41:23 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@cib.de> | 2017-10-20 14:13:21 +0200 |
commit | 4ddd74e2d119eb7b25df75a65fcb214ce08ec672 (patch) | |
tree | fd350169e96105df255e27b793722e0ed47dba41 /sw/source/uibase/frmdlg | |
parent | a42b0985c7619efdc934bb1cf19e5e2c2b6faea2 (diff) |
RotGrfFlyFrame: Minimal working rotation solution
This version allows rotation (in 10th degrees) and perserves
it over save/load cycles. Rotation of multiples of 90 degree
behave close to original except not changing the contained
Graphic and being adaptable to all kinds of graphic. The
rotated Graphic is displayed centered and under preserved
AspectRatio in the available frame space (so no rotation,
180 degree is identical, 90/-90 is identical with 1:1 ratio
of the graphic)
Change-Id: I54b3385f709ee0d34a55324aca919dcd2ce0c009
Diffstat (limited to 'sw/source/uibase/frmdlg')
-rw-r--r-- | sw/source/uibase/frmdlg/frmmgr.cxx | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/sw/source/uibase/frmdlg/frmmgr.cxx b/sw/source/uibase/frmdlg/frmmgr.cxx index fdc883b6a22a..c73238be62ea 100644 --- a/sw/source/uibase/frmdlg/frmmgr.cxx +++ b/sw/source/uibase/frmdlg/frmmgr.cxx @@ -46,10 +46,15 @@ using namespace ::com::sun::star; static sal_uInt16 aFrameMgrRange[] = { - RES_FRMATR_BEGIN, RES_FRMATR_END-1, + RES_FRMATR_BEGIN, RES_FRMATR_END-1, // 87-129 + + // RotGrfFlyFrame: Support here, but seems not to be + // added in range of m_pOwnSh->GetFlyFrameAttr result + // (see below). Tried to find, but could not identify + RES_GRFATR_ROTATION, RES_GRFATR_ROTATION, // 132 // FillAttribute support - XATTR_FILL_FIRST, XATTR_FILL_LAST, + XATTR_FILL_FIRST, XATTR_FILL_LAST, // 1014-1033 SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, FN_SET_FRM_NAME, FN_SET_FRM_NAME, @@ -569,13 +574,17 @@ void SwFlyFrameAttrMgr::SetHeightSizeType( SwFrameSize eType ) m_aSet.Put( aSize ); } -void SwFlyFrameAttrMgr::SetRotation(sal_uInt32 nOld, sal_uInt32 nNew, Size aUnrotatedSize) +void SwFlyFrameAttrMgr::SetRotation(sal_uInt16 nOld, sal_uInt16 nNew, const Size& rUnrotatedSize) { - // RotGrfFlyFrame: Central handling of real change of rotation here. Adaption of pos/size - // may be wanted in the future + // RotGrfFlyFrame: Central handling of real change of rotation here, all adaptions use this. + // Adaption of pos/size may be wanted in the future. Already tried to keep last SIze in + // UnrotatedSize in the SwRotationGrf Item, but this will lead to various problems. Also tried + // to use m_aSet.Put(...) as in other methods (also read methods for Rotation/UnrotatedSize) but + // somehow the needed ID (RES_GRFATR_ROTATION) is *not* in the SfxItemSet of the Frame, so for + // now set directly. Undo/Redo is preserved by AttributeChange if(nOld != nNew) { - m_pOwnSh->SetAttrItem(SwRotationGrf(static_cast<sal_uInt16>(nNew), aUnrotatedSize)); + m_pOwnSh->SetAttrItem(SwRotationGrf(nNew, rUnrotatedSize)); } } |