diff --git a/0001-implement-dialog-control-over-enhanced-shape-control.patch b/0001-implement-dialog-control-over-enhanced-shape-control.patch new file mode 100644 index 0000000..9548fa2 --- /dev/null +++ b/0001-implement-dialog-control-over-enhanced-shape-control.patch @@ -0,0 +1,665 @@ +From 428800fa88f343e8b3273cbbabb34cc2414f8b81 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Tue, 13 Oct 2015 13:16:31 +0100 +Subject: [PATCH] implement dialog control over enhanced shape control points + +use case is a desire to enable viewing and setting rounded rectangle radiuses +to an exact known value + +(cherry picked from commit b859d84e471fdb70b61607d2d919a7907d074bd0) + +Change-Id: I7e6a4db0699076950adf5869a61825159766c46a +--- + cui/source/inc/transfrm.hxx | 6 + + cui/source/tabpages/transfrm.cxx | 129 ++++++++++++- + cui/uiconfig/ui/slantcornertabpage.ui | 335 +++++++++++++++++++++++++++++----- + include/svx/EnhancedCustomShape2d.hxx | 1 + + 4 files changed, 421 insertions(+), 50 deletions(-) + +diff --git a/cui/source/inc/transfrm.hxx b/cui/source/inc/transfrm.hxx +index f4f6925..6aa3935 100644 +--- a/cui/source/inc/transfrm.hxx ++++ b/cui/source/inc/transfrm.hxx +@@ -233,6 +233,12 @@ private: + VclFrame* m_pFlAngle; + MetricField* m_pMtrAngle; + ++ VclFrame* m_aControlGroups[2]; ++ VclContainer* m_aControlGroupX[2]; ++ MetricField* m_aControlX[2]; ++ VclContainer* m_aControlGroupY[2]; ++ MetricField* m_aControlY[2]; ++ + const SfxItemSet& rOutAttrs; + + const SdrView* pView; +diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx +index e1193c1..4716ed6 100644 +--- a/cui/source/tabpages/transfrm.cxx ++++ b/cui/source/tabpages/transfrm.cxx +@@ -18,6 +18,8 @@ + */ + + #include ++#include ++#include + #include + #include + #include +@@ -443,6 +445,15 @@ SvxSlantTabPage::SvxSlantTabPage(vcl::Window* pParent, const SfxItemSet& rInAttr + get(m_pFlAngle, "FL_SLANT"); + get(m_pMtrAngle, "MTR_FLD_ANGLE"); + ++ for (int i = 0; i < 2; ++i) ++ { ++ get(m_aControlGroups[i], "controlgroups" + OString::number(i+1)); ++ get(m_aControlGroupX[i], "controlgroupx" + OString::number(i+1)); ++ get(m_aControlX[i], "controlx" + OString::number(i+1)); ++ get(m_aControlGroupY[i], "controlgroupy" + OString::number(i+1)); ++ get(m_aControlY[i], "controly" + OString::number(i+1)); ++ } ++ + // this page needs ExchangeSupport + SetExchangeSupport(); + +@@ -505,10 +516,56 @@ bool SvxSlantTabPage::FillItemSet(SfxItemSet* rAttrs) + rAttrs->Put( SfxBoolItem( SID_ATTR_TRANSFORM_SHEAR_VERTICAL, false ) ); + } + +- return( bModified ); +-} ++ bool bControlPointsChanged = false; ++ for (int i = 0; i < 2; ++i) ++ { ++ bControlPointsChanged |= (m_aControlX[i]->IsValueChangedFromSaved() || ++ m_aControlY[i]->IsValueChangedFromSaved()); ++ } + ++ if (!bControlPointsChanged) ++ return bModified; + ++ SdrObject* pObj = pView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj(); ++ SdrModel* pModel = pObj->GetModel(); ++ SdrUndoAction* pUndo = pModel->IsUndoEnabled() ? ++ pModel->GetSdrUndoFactory().CreateUndoAttrObject(*pObj) : ++ nullptr; ++ ++ if (pUndo) ++ pModel->BegUndo(pUndo->GetComment()); ++ ++ EnhancedCustomShape2d aShape(pObj); ++ Rectangle aLogicRect = aShape.GetLogicRect(); ++ ++ for (int i = 0; i < 2; ++i) ++ { ++ if (m_aControlX[i]->IsValueChangedFromSaved() || m_aControlY[i]->IsValueChangedFromSaved()) ++ { ++ Point aNewPosition(GetCoreValue(*m_aControlX[i], ePoolUnit), ++ GetCoreValue(*m_aControlY[i], ePoolUnit)); ++ aNewPosition.Move(aLogicRect.Left(), aLogicRect.Top()); ++ ++ css::awt::Point aPosition; ++ aPosition.X = aNewPosition.X(); ++ aPosition.Y = aNewPosition.Y(); ++ ++ aShape.SetHandleControllerPosition(i, aPosition); ++ } ++ } ++ ++ pObj->SetChanged(); ++ pObj->BroadcastObjectChange(); ++ bModified = true; ++ ++ if (pUndo) ++ { ++ pModel->AddUndo(pUndo); ++ pModel->EndUndo(); ++ } ++ ++ return bModified; ++} + + void SvxSlantTabPage::Reset(const SfxItemSet* rAttrs) + { +@@ -560,9 +617,70 @@ void SvxSlantTabPage::Reset(const SfxItemSet* rAttrs) + } + + m_pMtrAngle->SaveValue(); +-} +- + ++ const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); ++ if (rMarkList.GetMarkCount() == 1) ++ { ++ SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); ++ SdrObjKind eKind = (SdrObjKind) pObj->GetObjIdentifier(); ++ if (eKind == OBJ_CUSTOMSHAPE) ++ { ++ EnhancedCustomShape2d aShape(pObj); ++ Point aInitialPosition; ++ for (int i = 0; i < 2; ++i) ++ { ++ if (!aShape.GetHandlePosition(i, aInitialPosition)) ++ break; ++ m_aControlGroups[i]->Enable(); ++ css::awt::Point aPosition; ++ ++ aPosition.X = SAL_MAX_INT32; ++ aPosition.Y = SAL_MAX_INT32; ++ aShape.SetHandleControllerPosition(i, aPosition); ++ Point aMaxPosition; ++ aShape.GetHandlePosition(i, aMaxPosition); ++ ++ aPosition.X = SAL_MIN_INT32; ++ aPosition.Y = SAL_MIN_INT32; ++ aShape.SetHandleControllerPosition(i, aPosition); ++ Point aMinPosition; ++ aShape.GetHandlePosition(i, aMinPosition); ++ ++ Rectangle aLogicRect = aShape.GetLogicRect(); ++ aMaxPosition.Move(-aLogicRect.Left(), -aLogicRect.Top()); ++ aMinPosition.Move(-aLogicRect.Left(), -aLogicRect.Top()); ++ ++ aPosition.X = aInitialPosition.X(); ++ aPosition.Y = aInitialPosition.Y(); ++ aInitialPosition.Move(-aLogicRect.Left(), -aLogicRect.Top()); ++ aShape.SetHandleControllerPosition(i, aPosition); ++ ++ SetMetricValue(*m_aControlX[i], aInitialPosition.X(), ePoolUnit); ++ SetMetricValue(*m_aControlY[i], aInitialPosition.Y(), ePoolUnit); ++ ++ if (aMaxPosition.X() == aMinPosition.X()) ++ m_aControlGroupX[i]->Disable(); ++ else ++ { ++ m_aControlX[i]->SetMin(aMinPosition.X(), FUNIT_MM); ++ m_aControlX[i]->SetMax(aMaxPosition.X(), FUNIT_MM); ++ } ++ if (aMaxPosition.Y() == aMinPosition.Y()) ++ m_aControlGroupY[i]->Disable(); ++ else ++ { ++ m_aControlY[i]->SetMin(aMinPosition.Y(), FUNIT_MM); ++ m_aControlY[i]->SetMax(aMaxPosition.Y(), FUNIT_MM); ++ } ++ } ++ } ++ } ++ for (int i = 0; i < 2; ++i) ++ { ++ m_aControlX[i]->SaveValue(); ++ m_aControlY[i]->SaveValue(); ++ } ++} + + SfxTabPage* SvxSlantTabPage::Create( vcl::Window* pWindow, const SfxItemSet* rOutAttrs ) + { +@@ -576,8 +694,6 @@ const sal_uInt16* SvxSlantTabPage::GetRanges() + return( pSlantRanges ); + } + +- +- + void SvxSlantTabPage::ActivatePage( const SfxItemSet& rSet ) + { + SfxRectangleItem* pRectItem = NULL; +@@ -626,7 +742,6 @@ SvxPositionSizeTabPage::SvxPositionSizeTabPage(vcl::Window* pParent, const SfxIt + , mfOldWidth(0.0) + , mfOldHeight(0.0) + { +- + get(m_pFlPosition, "FL_POSITION"); + get(m_pMtrPosX, "MTR_FLD_POS_X"); + get(m_pMtrPosY, "MTR_FLD_POS_Y"); +diff --git a/cui/uiconfig/ui/slantcornertabpage.ui b/cui/uiconfig/ui/slantcornertabpage.ui +index 37b7b0e..05262d7 100644 +--- a/cui/uiconfig/ui/slantcornertabpage.ui ++++ b/cui/uiconfig/ui/slantcornertabpage.ui +@@ -2,23 +2,131 @@ + + + +- +- 500 +- 10 +- 10 +- +- +- -89 +- 89 +- 1 +- 10 +- +- ++ + True + False +- 6 +- vertical +- 12 ++ 24 ++ 12 ++ ++ ++ True ++ False ++ False ++ 0 ++ none ++ ++ ++ True ++ False ++ 6 ++ 12 ++ ++ ++ True ++ False ++ 12 ++ 6 ++ ++ ++ True ++ False ++ 12 ++ ++ ++ True ++ False ++ _X: ++ True ++ controlx1:0.00cm ++ 0 ++ ++ ++ False ++ True ++ 0 ++ ++ ++ ++ ++ True ++ True ++ ++ 0.00 ++ 2 ++ ++ ++ False ++ True ++ 1 ++ ++ ++ ++ ++ 0 ++ 0 ++ ++ ++ ++ ++ True ++ False ++ 12 ++ ++ ++ True ++ False ++ _Y: ++ True ++ controly1:0.00cm ++ 0 ++ ++ ++ False ++ True ++ 0 ++ ++ ++ ++ ++ True ++ True ++ ++ 0.00 ++ 2 ++ ++ ++ False ++ True ++ 1 ++ ++ ++ ++ ++ 0 ++ 1 ++ ++ ++ ++ ++ ++ ++ ++ ++ True ++ False ++ Control Point 1 ++ 0 ++ ++ ++ ++ ++ ++ ++ ++ 0 ++ 1 ++ ++ + + + True +@@ -32,37 +140,36 @@ + 6 + 12 + +- ++ + True + False +- 12 ++ 12 + + + True + False +- 0 + _Radius: + True + MTR_FLD_RADIUS:0.00cm ++ 0 + + +- False +- True +- 0 ++ 0 ++ 0 + + + + + True +- False ++ True + ++ 0.00 + adjustmentRADIUS + 2 + + +- False +- True +- 1 ++ 1 ++ 0 + + + +@@ -73,8 +180,8 @@ + + True + False +- 0 + Corner Radius ++ 0 + + + +@@ -82,9 +189,8 @@ + + + +- False +- True +- 0 ++ 0 ++ 0 + + + +@@ -100,37 +206,36 @@ + 6 + 12 + +- ++ + True + False +- 12 ++ 12 + + + True + False +- 0 + _Angle: + True + MTR_FLD_ANGLE:0.00degrees ++ 0 + + +- False +- True +- 0 ++ 0 ++ 0 + + + + + True +- False ++ True + ++ 0.00 + adjustmentSLANT + 2 + + +- False +- True +- 1 ++ 1 ++ 0 + + + +@@ -141,8 +246,128 @@ + + True + False +- 0 + Slant ++ 0 ++ ++ ++ ++ ++ ++ ++ ++ 1 ++ 0 ++ ++ ++ ++ ++ True ++ False ++ False ++ 0 ++ none ++ ++ ++ True ++ False ++ 6 ++ 12 ++ ++ ++ True ++ False ++ 12 ++ 6 ++ ++ ++ True ++ False ++ 12 ++ ++ ++ True ++ False ++ _X: ++ True ++ controlx2:0.00cm ++ 0 ++ ++ ++ False ++ True ++ 0 ++ ++ ++ ++ ++ True ++ True ++ ++ 0.00 ++ 2 ++ ++ ++ False ++ True ++ 1 ++ ++ ++ ++ ++ 0 ++ 0 ++ ++ ++ ++ ++ True ++ False ++ 12 ++ ++ ++ True ++ False ++ _Y: ++ True ++ controly2:0.00cm ++ 0 ++ ++ ++ False ++ True ++ 0 ++ ++ ++ ++ ++ True ++ True ++ ++ 0.00 ++ 2 ++ ++ ++ False ++ True ++ 1 ++ ++ ++ ++ ++ 0 ++ 1 ++ ++ ++ ++ ++ ++ ++ ++ ++ True ++ False ++ Control Point 2 ++ 0 + + + +@@ -150,12 +375,36 @@ + + + +- False +- True +- 1 ++ 1 ++ 1 + + + ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ 500 ++ 10 ++ 10 ++ ++ ++ -89 ++ 89 ++ 1 ++ 10 ++ + + + +diff --git a/include/svx/EnhancedCustomShape2d.hxx b/include/svx/EnhancedCustomShape2d.hxx +index 8ab32cf..58bf76d 100644 +--- a/include/svx/EnhancedCustomShape2d.hxx ++++ b/include/svx/EnhancedCustomShape2d.hxx +@@ -188,6 +188,7 @@ class SVX_DLLPUBLIC EnhancedCustomShape2d : public SfxItemSet + SdrObject* CreateObject( bool bLineGeometryNeededOnly ); + void ApplyGluePoints( SdrObject* pObj ); + Rectangle GetTextRect() const; ++ Rectangle GetLogicRect() const { return aLogicRect; } + + sal_uInt32 GetHdlCount() const; + bool GetHandlePosition( const sal_uInt32 nIndex, Point& rReturnPosition ) const; +-- +2.4.3 + diff --git a/libreoffice.spec b/libreoffice.spec index 0cc9312..e6c0cdb 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -53,7 +53,7 @@ Summary: Free Software Productivity Suite Name: libreoffice Epoch: 1 Version: %{libo_version}.2 -Release: 8%{?libo_prerelease}%{?dist} +Release: 9%{?libo_prerelease}%{?dist} License: (MPLv1.1 or LGPLv3+) and LGPLv3 and LGPLv2+ and BSD and (MPLv1.1 or GPLv2 or LGPLv2 or Netscape) and Public Domain and ASL 2.0 and Artistic and MPLv2.0 and CC0 Group: Applications/Productivity URL: http://www.libreoffice.org/ @@ -375,6 +375,7 @@ Patch56: 0001-Revert-Fix-single-node-CopyRange.patch Patch57: 0001-Related-rhbz-1259746-Buffer-file-content-read-from-G.patch Patch58: 0001-implement-save-slide-background-for-impress.patch Patch59: 0001-Related-tdf-72880-presumably-using-startcenter-as-ge.patch +Patch60: 0001-implement-dialog-control-over-enhanced-shape-control.patch %define instdir %{_libdir} %define baseinstdir %{instdir}/libreoffice @@ -2434,6 +2435,9 @@ update-desktop-database %{_datadir}/applications &> /dev/null || : %endif %changelog +* Tue Oct 13 2015 Caolán McNamara - 1:4.4.5.2-9 +- implement dialog control over enhanced shape control points + * Thu Oct 08 2015 Caolán McNamara - 1:4.4.5.2-8 - Resolves: rhbz#1269593 Declare support for vnd.libreoffice.cmis:// URLs