summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2016-02-29 00:01:01 +0200
committerMaxim Monastirsky <momonasmon@gmail.com>2016-02-29 00:04:23 +0200
commit2b24b6b6c3b18d7d934b3f76cc7a787c498ece4a (patch)
tree2508c3e71d7f4f97a246cf12b5b8e82cd7f62b3c
parentebfa86c8ff962820b47ad0b4a93b0813c0ccaff5 (diff)
Related: tdf#89646 sc: Fix some issues with the new tools
- Fix default object creation (by holding CTRL). - Fix Polygon (45°) tools (inverted SHIFT effect via doConstructOrthogonal). - Toolbar layout similar to Impress/Draw. Change-Id: Ib4e4aec1560599201c00e0726c29021763d773ad
-rw-r--r--sc/source/ui/drawfunc/fuconpol.cxx8
-rw-r--r--sc/source/ui/drawfunc/fupoor.cxx8
-rw-r--r--sc/uiconfig/scalc/toolbar/linesbar.xml11
3 files changed, 18 insertions, 9 deletions
diff --git a/sc/source/ui/drawfunc/fuconpol.cxx b/sc/source/ui/drawfunc/fuconpol.cxx
index 0e0e9bfd0b6f..001f7f39732d 100644
--- a/sc/source/ui/drawfunc/fuconpol.cxx
+++ b/sc/source/ui/drawfunc/fuconpol.cxx
@@ -231,9 +231,13 @@ void FuConstPolygon::Deactivate()
// Create default drawing objects via keyboard
SdrObject* FuConstPolygon::CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle)
{
+ // case SID_DRAW_XPOLYGON:
+ // case SID_DRAW_XPOLYGON_NOFILL:
// case SID_DRAW_POLYGON:
// case SID_DRAW_POLYGON_NOFILL:
+ // case SID_DRAW_BEZIER_FILL:
// case SID_DRAW_BEZIER_NOFILL:
+ // case SID_DRAW_FREELINE:
// case SID_DRAW_FREELINE_NOFILL:
SdrObject* pObj = SdrObjFactory::MakeNewObject(
@@ -248,6 +252,7 @@ SdrObject* FuConstPolygon::CreateDefaultObject(const sal_uInt16 nID, const Recta
switch(nID)
{
+ case SID_DRAW_BEZIER_FILL:
case SID_DRAW_BEZIER_NOFILL:
{
basegfx::B2DPolygon aInnerPoly;
@@ -269,6 +274,7 @@ SdrObject* FuConstPolygon::CreateDefaultObject(const sal_uInt16 nID, const Recta
aPoly.append(aInnerPoly);
break;
}
+ case SID_DRAW_FREELINE:
case SID_DRAW_FREELINE_NOFILL:
{
basegfx::B2DPolygon aInnerPoly;
@@ -288,6 +294,8 @@ SdrObject* FuConstPolygon::CreateDefaultObject(const sal_uInt16 nID, const Recta
aPoly.append(aInnerPoly);
break;
}
+ case SID_DRAW_XPOLYGON:
+ case SID_DRAW_XPOLYGON_NOFILL:
case SID_DRAW_POLYGON:
case SID_DRAW_POLYGON_NOFILL:
{
diff --git a/sc/source/ui/drawfunc/fupoor.cxx b/sc/source/ui/drawfunc/fupoor.cxx
index 2b09d57c0779..6cdc50e0ba07 100644
--- a/sc/source/ui/drawfunc/fupoor.cxx
+++ b/sc/source/ui/drawfunc/fupoor.cxx
@@ -289,18 +289,17 @@ void FuPoor::ImpForceQuadratic(Rectangle& rRect)
bool FuPoor::doConstructOrthogonal() const
{
// Detect whether we're moving an object or resizing.
- bool bIsMoveMode = false;
if (pView->IsDragObj())
{
const SdrHdl* pHdl = pView->GetDragStat().GetHdl();
if (!pHdl || (!pHdl->IsCornerHdl() && !pHdl->IsVertexHdl()))
{
- bIsMoveMode = true;
+ return false;
}
}
// Detect image and resize proportionally, but don't constrain movement by default
- if (!bIsMoveMode && pView->AreObjectsMarked())
+ if (pView->AreObjectsMarked())
{
const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
if (rMarkList.GetMarkCount() == 1)
@@ -311,6 +310,9 @@ bool FuPoor::doConstructOrthogonal() const
}
}
}
+ else if (aSfxRequest.GetSlot() == SID_DRAW_XPOLYGON || aSfxRequest.GetSlot() == SID_DRAW_XPOLYGON_NOFILL)
+ return true;
+
return false;
}
diff --git a/sc/uiconfig/scalc/toolbar/linesbar.xml b/sc/uiconfig/scalc/toolbar/linesbar.xml
index 86fa223659d2..212bb71a1be6 100644
--- a/sc/uiconfig/scalc/toolbar/linesbar.xml
+++ b/sc/uiconfig/scalc/toolbar/linesbar.xml
@@ -18,14 +18,13 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
- <toolbar:toolbaritem xlink:href=".uno:Freeline_Unfilled"/>
- <toolbar:toolbaritem xlink:href=".uno:Bezier_Unfilled"/>
- <toolbar:toolbaritem xlink:href=".uno:Polygon_Unfilled"/>
- <toolbar:toolbaritem xlink:href=".uno:Polygon_Diagonal_Unfilled"/>
- <toolbar:toolbarbreak/>
- <toolbar:toolbaritem xlink:href=".uno:Freeline"/>
<toolbar:toolbaritem xlink:href=".uno:BezierFill"/>
<toolbar:toolbaritem xlink:href=".uno:Polygon"/>
<toolbar:toolbaritem xlink:href=".uno:Polygon_Diagonal"/>
+ <toolbar:toolbaritem xlink:href=".uno:Freeline"/>
<toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:Bezier_Unfilled"/>
+ <toolbar:toolbaritem xlink:href=".uno:Polygon_Unfilled"/>
+ <toolbar:toolbaritem xlink:href=".uno:Polygon_Diagonal_Unfilled"/>
+ <toolbar:toolbaritem xlink:href=".uno:Freeline_Unfilled"/>
</toolbar:toolbar>