summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2017-06-27 23:35:08 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-08-03 12:32:51 +0200
commit0d3a367b5623639e7fdc9ce1ccc277e2597694a0 (patch)
treebd69a33834b9d85fd738c550015461453da5f16f /editeng
parent9a5c39ea56bbac48f30a1a4966caa68697d8b318 (diff)
lok - add support for in place chart editing
This commit add a minimal support for editing chart embedded in a spreadsheet or a text document or a presentation. Graphic object can be moved and resized, text object can be edited. Change-Id: I8e637dabf328a94bd6bb0e309a245302cff421d8 Reviewed-on: https://gerrit.libreoffice.org/40681 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/impedit.cxx26
1 files changed, 24 insertions, 2 deletions
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index e3a5291a5e0e..795447296b20 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -382,6 +382,17 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, vcl::Region* pRegion, Ou
{
std::vector<Rectangle> aRectangles;
pRegion->GetRegionRectangles(aRectangles);
+ if (pOutWin->IsChart())
+ {
+ const vcl::Window* pViewShellWindow = mpViewShell->GetEditWindowForActiveOLEObj();
+ if (pViewShellWindow && pViewShellWindow->IsAncestorOf(*pOutWin))
+ {
+ Point aOffsetPx = pOutWin->GetOffsetPixelFrom(*pViewShellWindow);
+ Point aLogicOffset = pOutWin->PixelToLogic(aOffsetPx);
+ for (Rectangle& rRect : aRectangles)
+ rRect.Move(aLogicOffset.getX(), aLogicOffset.getY());
+ }
+ }
if (!aRectangles.empty())
{
@@ -1024,8 +1035,19 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor )
if (comphelper::LibreOfficeKit::isActive() && mpViewShell)
{
- const Point& rPos = GetCursor()->GetPos();
- Rectangle aRect(rPos.getX(), rPos.getY(), rPos.getX() + GetCursor()->GetWidth(), rPos.getY() + GetCursor()->GetHeight());
+ Point aPos = GetCursor()->GetPos();
+ if (pOutWin->IsChart())
+ {
+ const vcl::Window* pViewShellWindow = mpViewShell->GetEditWindowForActiveOLEObj();
+ if (pViewShellWindow && pViewShellWindow->IsAncestorOf(*pOutWin))
+ {
+ Point aOffsetPx = pOutWin->GetOffsetPixelFrom(*pViewShellWindow);
+ Point aLogicOffset = pOutWin->PixelToLogic(aOffsetPx);
+ aPos.Move(aLogicOffset.getX(), aLogicOffset.getY());
+ }
+ }
+
+ Rectangle aRect(aPos.getX(), aPos.getY(), aPos.getX() + GetCursor()->GetWidth(), aPos.getY() + GetCursor()->GetHeight());
// LOK output is always in twips, convert from mm100 if necessary.
if (pOutWin->GetMapMode().GetMapUnit() == MapUnit::Map100thMM)