diff options
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/view.hxx | 2 | ||||
-rw-r--r-- | sw/inc/viewopt.hxx | 8 | ||||
-rw-r--r-- | sw/sdi/_viewsh.sdi | 6 | ||||
-rw-r--r-- | sw/source/uibase/config/usrpref.cxx | 5 | ||||
-rw-r--r-- | sw/source/uibase/docvw/edtwin.cxx | 6 | ||||
-rw-r--r-- | sw/source/uibase/shells/drawsh.cxx | 10 | ||||
-rw-r--r-- | sw/source/uibase/shells/drwbassh.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/uiview/view0.cxx | 8 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewdraw.cxx | 14 | ||||
-rw-r--r-- | sw/uiconfig/sglobal/toolbar/drawbar.xml | 1 | ||||
-rw-r--r-- | sw/uiconfig/swform/toolbar/drawbar.xml | 1 | ||||
-rw-r--r-- | sw/uiconfig/swreport/toolbar/drawbar.xml | 1 | ||||
-rw-r--r-- | sw/uiconfig/swriter/toolbar/drawbar.xml | 1 | ||||
-rw-r--r-- | sw/uiconfig/swxform/toolbar/drawbar.xml | 1 |
14 files changed, 53 insertions, 13 deletions
diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx index ccfeb48b1a4e..a70668a09048 100644 --- a/sw/inc/view.hxx +++ b/sw/inc/view.hxx @@ -556,6 +556,8 @@ public: void SetSelDrawSlot(); void FlipDrawSelMode() { m_bDrawSelMode = !m_bDrawSelMode; } void NoRotate(); // turn off rotate mode + void ToggleRotate(); // switch between move and rotate mode + bool EnterDrawTextMode(const Point& aDocPos); /// Same as EnterDrawTextMode(), but takes an SdrObject instead of guessing it by document position. bool EnterShapeDrawTextMode(SdrObject* pObject); diff --git a/sw/inc/viewopt.hxx b/sw/inc/viewopt.hxx index d5163b26b2c5..fecb5e204f32 100644 --- a/sw/inc/viewopt.hxx +++ b/sw/inc/viewopt.hxx @@ -78,6 +78,7 @@ struct ViewOptFlags1 bool bSectionBoundaries : 1; // section boundaries bool bTableBoundaries : 1; // table boundaries bool bShowBoundaries : 1; // show all boundaries + bool bClickChangeRotation : 1; // change with single click into rotate mode ViewOptFlags1() : bUseHeaderFooterMenu(false) @@ -117,6 +118,7 @@ struct ViewOptFlags1 , bSectionBoundaries(true) , bTableBoundaries(true) , bShowBoundaries(true) + , bClickChangeRotation(false) {} bool operator==(const ViewOptFlags1& rOther) const @@ -157,7 +159,8 @@ struct ViewOptFlags1 && bTextBoundariesFull == rOther.bTextBoundariesFull && bSectionBoundaries == rOther.bSectionBoundaries && bTableBoundaries == rOther.bTableBoundaries - && bShowBoundaries == rOther.bShowBoundaries; + && bShowBoundaries == rOther.bShowBoundaries + && bClickChangeRotation == rOther.bClickChangeRotation; } void dumpAsXml(xmlTextWriterPtr pWriter) const; @@ -692,6 +695,9 @@ public: bool IsShowBoundaries() const { return m_nCoreOptions.bShowBoundaries; } void SetShowBoundaries( bool b ) { m_nCoreOptions.bShowBoundaries = b; } + bool IsClickChangeRotation() const { return m_nCoreOptions.bClickChangeRotation; } + void SetClickChangeRotation( bool b ) { m_nCoreOptions.bClickChangeRotation = b; } + #ifdef DBG_UTIL // Correspond to statements in ui/config/cfgvw.src. bool IsTest1() const { return m_bTest1; } diff --git a/sw/sdi/_viewsh.sdi b/sw/sdi/_viewsh.sdi index 71b2c08e0396..30116542a3e8 100644 --- a/sw/sdi/_viewsh.sdi +++ b/sw/sdi/_viewsh.sdi @@ -1041,6 +1041,12 @@ interface BaseTextEditView MenuConfig , AccelConfig , ToolBoxConfig ; ] + SID_CLICK_CHANGE_ROTATION + [ + ExecMethod = ExecViewOptions ; + StateMethod = StateViewOptions ; + ] + SID_MOVE_SHAPE_HANDLE [ ExecMethod = Execute ; diff --git a/sw/source/uibase/config/usrpref.cxx b/sw/source/uibase/config/usrpref.cxx index 2904cd62abed..f6dbae1f63b2 100644 --- a/sw/source/uibase/config/usrpref.cxx +++ b/sw/source/uibase/config/usrpref.cxx @@ -129,7 +129,8 @@ Sequence<OUString> SwContentViewConfig::GetPropertyNames() const "Display/TextBoundariesFull", // 30 "Display/SectionBoundaries", // 31 "Display/TableBoundaries", // 32 - "Display/ShowBoundaries" // 33 + "Display/ShowBoundaries", // 33 + "Draw/ClickChangeRotation" // 34 }; #if defined(__GNUC__) && !defined(__clang__) // clang 8.0.0 says strcmp isn't constexpr @@ -213,6 +214,7 @@ void SwContentViewConfig::ImplCommit() case 31: bVal = m_rParent.IsSectionBoundaries(); break; // "Display/SectionBoundaries" case 32: bVal = m_rParent.IsTableBoundaries(); break; // "Display/TableBoundaries" case 33: bVal = m_rParent.IsShowBoundaries(); break; // "Display/ShowBoundaries" + case 34: bVal = m_rParent.IsClickChangeRotation(); break; // "Draw/ClickChangeRotation" } if ((nProp != g_UpdateLinkIndex) && (nProp != g_DefaultAnchor) && (nProp != g_ZoomType) && (nProp != g_ZoomValue)) @@ -295,6 +297,7 @@ void SwContentViewConfig::Load() case 31: m_rParent.SetSectionBoundaries(bSet); break; //"Display/SectionBoundaries" case 32: m_rParent.SetTableBoundaries(bSet); break; //"Display/TableBoundaries" case 33: m_rParent.SetShowBoundaries(bSet); break; //"Display/ShowBoundaries" + case 34: m_rParent.SetClickChangeRotation(bSet); break; // "Draw/ClickChangeRotation" } } } diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index 047ebd3f5555..85e7cce4fce3 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -112,6 +112,7 @@ #include <breakit.hxx> #include <checkit.hxx> #include <pagefrm.hxx> +#include <usrpref.hxx> #include <helpids.h> #include <cmdid.h> @@ -4791,6 +4792,11 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) { pSdrView->UnmarkAllObj(); pSdrView->MarkObj(pObj, pPV); + if (rMEvt.IsLeft() && rMEvt.GetClicks() == 1 && + SwModule::get()->GetUsrPref( + dynamic_cast<const SwWebView*>(&m_rView) != nullptr)-> + IsClickChangeRotation()) + m_rView.ToggleRotate(); } else { diff --git a/sw/source/uibase/shells/drawsh.cxx b/sw/source/uibase/shells/drawsh.cxx index fa9e71964a5a..b06e0602c389 100644 --- a/sw/source/uibase/shells/drawsh.cxx +++ b/sw/source/uibase/shells/drawsh.cxx @@ -188,15 +188,7 @@ void SwDrawShell::Execute(SfxRequest &rReq) switch (nSlotId) { case SID_OBJECT_ROTATE: - if (rSh.GetSelectedObjCount() && pSdrView->IsRotateAllowed()) - { - if (GetView().IsDrawRotate()) - rSh.SetDragMode(SdrDragMode::Move); - else - rSh.SetDragMode(SdrDragMode::Rotate); - - GetView().FlipDrawRotate(); - } + GetView().ToggleRotate(); break; case SID_MOVE_SHAPE_HANDLE: { diff --git a/sw/source/uibase/shells/drwbassh.cxx b/sw/source/uibase/shells/drwbassh.cxx index e41f76d1b4a7..3abb36d94093 100644 --- a/sw/source/uibase/shells/drwbassh.cxx +++ b/sw/source/uibase/shells/drwbassh.cxx @@ -1010,8 +1010,6 @@ void SwDrawBaseShell::GetState(SfxItemSet& rSet) } } break; - - } nWhich = aIter.NextWhich(); } diff --git a/sw/source/uibase/uiview/view0.cxx b/sw/source/uibase/uiview/view0.cxx index dab7f898fe51..a3ed716038da 100644 --- a/sw/source/uibase/uiview/view0.cxx +++ b/sw/source/uibase/uiview/view0.cxx @@ -371,6 +371,9 @@ void SwView::StateViewOptions(SfxItemSet &rSet) case FN_BOOKVIEW: aBool.SetValue( pOpt->IsViewLayoutBookMode()); break; + case SID_CLICK_CHANGE_ROTATION: + aBool.SetValue( pOpt->IsClickChangeRotation()); + break; } if( nWhich ) @@ -734,6 +737,11 @@ void SwView::ExecViewOptions(SfxRequest &rReq) pOpt->SetViewLayoutColumns( 2 ); pOpt->SetViewLayoutBookMode( true ); break; + case SID_CLICK_CHANGE_ROTATION: + if( STATE_TOGGLE == eState ) + bFlag = !pOpt->IsClickChangeRotation(); + pOpt->SetClickChangeRotation(bFlag); + break; default: OSL_FAIL("wrong request method"); diff --git a/sw/source/uibase/uiview/viewdraw.cxx b/sw/source/uibase/uiview/viewdraw.cxx index 0a82e404f331..99c68eb0c132 100644 --- a/sw/source/uibase/uiview/viewdraw.cxx +++ b/sw/source/uibase/uiview/viewdraw.cxx @@ -448,6 +448,20 @@ void SwView::NoRotate() } } +void SwView::ToggleRotate() +{ + if (m_pWrtShell->GetSelectedObjCount() && + m_pWrtShell->GetDrawView()->IsRotateAllowed()) + { + if (IsDrawRotate()) + m_pWrtShell->SetDragMode(SdrDragMode::Move); + else + m_pWrtShell->SetDragMode(SdrDragMode::Rotate); + + FlipDrawRotate(); + } +} + // Enable DrawTextEditMode static bool lcl_isTextBox(SdrObject const * pObject) diff --git a/sw/uiconfig/sglobal/toolbar/drawbar.xml b/sw/uiconfig/sglobal/toolbar/drawbar.xml index 1af47ad7b084..a45497fbf9c0 100644 --- a/sw/uiconfig/sglobal/toolbar/drawbar.xml +++ b/sw/uiconfig/sglobal/toolbar/drawbar.xml @@ -60,4 +60,5 @@ <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:ToggleObjectBezierMode"/> <toolbar:toolbaritem xlink:href=".uno:ExtrusionToggle"/> + <toolbar:toolbaritem xlink:href=".uno:ClickChangeRotation"/> </toolbar:toolbar> diff --git a/sw/uiconfig/swform/toolbar/drawbar.xml b/sw/uiconfig/swform/toolbar/drawbar.xml index 1af47ad7b084..a45497fbf9c0 100644 --- a/sw/uiconfig/swform/toolbar/drawbar.xml +++ b/sw/uiconfig/swform/toolbar/drawbar.xml @@ -60,4 +60,5 @@ <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:ToggleObjectBezierMode"/> <toolbar:toolbaritem xlink:href=".uno:ExtrusionToggle"/> + <toolbar:toolbaritem xlink:href=".uno:ClickChangeRotation"/> </toolbar:toolbar> diff --git a/sw/uiconfig/swreport/toolbar/drawbar.xml b/sw/uiconfig/swreport/toolbar/drawbar.xml index a6656f7d1e22..422d435480bb 100644 --- a/sw/uiconfig/swreport/toolbar/drawbar.xml +++ b/sw/uiconfig/swreport/toolbar/drawbar.xml @@ -48,4 +48,5 @@ <toolbar:toolbaritem xlink:href=".uno:InsertGraphic"/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:ExtrusionToggle"/> + <toolbar:toolbaritem xlink:href=".uno:ClickChangeRotation"/> </toolbar:toolbar> diff --git a/sw/uiconfig/swriter/toolbar/drawbar.xml b/sw/uiconfig/swriter/toolbar/drawbar.xml index a350f6ef4f51..a4893395f224 100644 --- a/sw/uiconfig/swriter/toolbar/drawbar.xml +++ b/sw/uiconfig/swriter/toolbar/drawbar.xml @@ -62,4 +62,5 @@ <toolbar:toolbaritem xlink:href=".uno:ExtrusionToggle"/> <toolbar:toolbaritem xlink:href=".uno:GridVisible" toolbar:visible="false"/> <toolbar:toolbaritem xlink:href=".uno:GridUse" toolbar:visible="false"/> + <toolbar:toolbaritem xlink:href=".uno:ClickChangeRotation"/> </toolbar:toolbar> diff --git a/sw/uiconfig/swxform/toolbar/drawbar.xml b/sw/uiconfig/swxform/toolbar/drawbar.xml index 1af47ad7b084..a45497fbf9c0 100644 --- a/sw/uiconfig/swxform/toolbar/drawbar.xml +++ b/sw/uiconfig/swxform/toolbar/drawbar.xml @@ -60,4 +60,5 @@ <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:ToggleObjectBezierMode"/> <toolbar:toolbaritem xlink:href=".uno:ExtrusionToggle"/> + <toolbar:toolbaritem xlink:href=".uno:ClickChangeRotation"/> </toolbar:toolbar> |