diff options
author | Armin Le Grand <Armin.Le.Grand@cib.de> | 2017-09-22 15:28:33 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@cib.de> | 2017-10-20 14:13:20 +0200 |
commit | a42b0985c7619efdc934bb1cf19e5e2c2b6faea2 (patch) | |
tree | b91427e905792292220b01aba45fc80d66d19349 /sw/source/ui/frmdlg | |
parent | 2e001b40ad0d19c8db528bb4df739e289163779d (diff) |
RotGrfFlyFrame: Initial adaptions
To allow free rotation of Graphic FlyFrames in Writer,
several adaptions are necessary. This change takes care
of all needed changes to internally support a freely
definable rotation angle for that case. Save/Load round
trip is working, the graphic does no longer get modified
and added in 90-degree-changed state to the object, the
original will be preserved. Support for needed slot in
core/ui is implemented. Rotation can be applied from
Menus/Toolbars in the known 90/180 degree steps. Added
a slot/Button/command to reset rotation in these cases.
Added support in Sidebar to rotate using the rotation
wheel and/or numeric field. These fields and support added
to Image TabPage, too, fully functional.
Missing now is a solution for displaying the rotated
Graphic. For now, it just gets rotated, but this will not
be the final state of this change.
Change-Id: I6f3b85ebb5be2b4ad3311c536d54f27a37a494e7
RotGrfFlyFrame: Linux build adaptions
Change-Id: I365287ecd6525b1972e8436d61332f7121d88649
Diffstat (limited to 'sw/source/ui/frmdlg')
-rw-r--r-- | sw/source/ui/frmdlg/frmpage.cxx | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index e36595431cee..f1abe60c19fe 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -2388,6 +2388,12 @@ SwGrfExtPage::SwGrfExtPage(vcl::Window *pParent, const SfxItemSet &rSet) get(m_pBmpWin, "preview"); m_pBmpWin->SetBitmapEx(get<FixedImage>("fallback")->GetImage().GetBitmapEx()); + // RotGrfFlyFrame: Need Angle and RotateControls now + get(m_pFlAngle, "FL_ANGLE"); + get(m_pNfAngle, "NF_ANGLE"); + get(m_pCtlAngle, "CTL_ANGLE"); + m_pCtlAngle->SetLinkedField( m_pNfAngle, 2 ); + SetExchangeSupport(); m_pMirrorHorzBox->SetClickHdl( LINK(this, SwGrfExtPage, MirrorHdl)); m_pMirrorVertBox->SetClickHdl( LINK(this, SwGrfExtPage, MirrorHdl)); @@ -2411,6 +2417,12 @@ void SwGrfExtPage::dispose() m_pBmpWin.clear(); m_pConnectED.clear(); m_pBrowseBT.clear(); + + // RotGrfFlyFrame: Support RotationAngle + m_pFlAngle.clear(); + m_pNfAngle.clear(); + m_pCtlAngle.clear(); + SfxTabPage::dispose(); } @@ -2432,6 +2444,17 @@ void SwGrfExtPage::Reset(const SfxItemSet *rSet) m_pConnectED->SetReadOnly(false); } + // RotGrfFlyFrame: Get RotationAngle and set at control + if(SfxItemState::SET == rSet->GetItemState( SID_ATTR_TRANSFORM_ANGLE, false, &pItem)) + { + m_pCtlAngle->SetRotation(static_cast<const SfxInt32Item*>(pItem)->GetValue()); + } + else + { + m_pCtlAngle->SetRotation(0); + } + m_pCtlAngle->SaveValue(); + ActivatePage(*rSet); } @@ -2559,6 +2582,14 @@ bool SwGrfExtPage::FillItemSet( SfxItemSet *rSet ) rSet->Put( SvxBrushItem( aGrfName, aFilterName, GPOS_LT, SID_ATTR_GRAF_GRAPHIC )); } + + // RotGrfFlyFrame: Safe rotation if modified + if(m_pCtlAngle->IsValueModified()) + { + rSet->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_ANGLE), m_pCtlAngle->GetRotation())); + bModified = true; + } + return bModified; } |