summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authormerttumer <mert.tumer@collabora.com>2021-05-24 10:52:13 +0300
committerMert Tumer <mert.tumer@collabora.com>2021-06-04 10:39:44 +0200
commit6c879cd2dc4517c8ee9dbff0f228f95702e7f88b (patch)
tree34c35d4fdcb86e9b260c282cb173cdb85b27164e /svx
parent13f981e262b04f40c377d0e4fff717b57855d8a3 (diff)
Extended MoveShapeHandle command for Anchors as well
Change-Id: I0e2811802f17831097a86103571b505a7557717a Signed-off-by: merttumer <mert.tumer@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116040 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116299 Tested-by: Jenkins
Diffstat (limited to 'svx')
-rw-r--r--svx/source/svdraw/svdmrkv.cxx21
1 files changed, 16 insertions, 5 deletions
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index eef111ce4103..5f368c04a4a3 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -982,6 +982,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const S
{
boost::property_tree::ptree responseJSON;
boost::property_tree::ptree others;
+ boost::property_tree::ptree anchor;
boost::property_tree::ptree rectangle;
boost::property_tree::ptree poly;
boost::property_tree::ptree custom;
@@ -1016,6 +1017,14 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const S
{
selectedNode = &custom;
}
+ else if (kind == static_cast<sal_Int32>(SdrHdlKind::Anchor) || kind == static_cast<sal_Int32>(SdrHdlKind::Anchor_TR))
+ {
+ if (getSdrModelFromSdrView().IsWriter())
+ selectedNode = &anchor;
+ else
+ // put it to others as we dont render them except in writer
+ selectedNode = &others;
+ }
else
{
selectedNode = &others;
@@ -1034,6 +1043,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const S
nodes.add_child("rectangle", rectangle);
nodes.add_child("poly", poly);
nodes.add_child("custom", custom);
+ nodes.add_child("anchor", anchor);
nodes.add_child("others", others);
responseJSON.add_child("kinds", nodes);
std::stringstream aStream;
@@ -1391,11 +1401,6 @@ void SdrMarkView::SetMarkHandles(SfxViewShell* pOtherShell)
}
}
- // moved it here to access all the handles for callback.
- if (bTiledRendering && pViewShell)
- {
- SetMarkHandlesForLOKit(aRect, pOtherShell);
- }
// rotation point/axis of reflection
if(!bLimitedRotation)
{
@@ -1408,6 +1413,12 @@ void SdrMarkView::SetMarkHandles(SfxViewShell* pOtherShell)
// add custom handles (used by other apps, e.g. AnchorPos)
AddCustomHdl();
+ // moved it here to access all the handles for callback.
+ if (bTiledRendering && pViewShell)
+ {
+ SetMarkHandlesForLOKit(aRect, pOtherShell);
+ }
+
// try to restore focus handle index from remembered values
if(!bSaveOldFocus)
return;