diff options
Diffstat (limited to 'sw/source')
-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 |
6 files changed, 33 insertions, 12 deletions
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) |