summaryrefslogtreecommitdiffstats
path: root/editeng
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-09-02 14:37:37 +0100
committerMiklos Vajna <vmiklos@collabora.com>2019-09-17 14:43:34 +0200
commitc10fcfa4353801f64f203d11180c11a21b28f75e (patch)
treefe1bd809aa99caf78c5427d26b4950cb856ba7a8 /editeng
parentsw: Mark uno property ParaChapterNumberingLevel as MAYBEVOID (diff)
downloadcore-c10fcfa4353801f64f203d11180c11a21b28f75e.tar.gz
core-c10fcfa4353801f64f203d11180c11a21b28f75e.zip
Resolves: tdf#126935 a11y for hosted EditEngine
move it to svx so we can reuse the a11y code in svx for EditEngines hosted in shapes to provide a11y for EditEngines hosted in a native widget Change-Id: I4068c413cdb8ddb0d0ef899774fbe9f65e1bdc60 Reviewed-on: https://gerrit.libreoffice.org/78545 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/Library_editeng.mk1
-rw-r--r--editeng/source/misc/weldeditview.cxx163
2 files changed, 0 insertions, 164 deletions
diff --git a/editeng/Library_editeng.mk b/editeng/Library_editeng.mk
index fc47842b650f..9354071b3a70 100644
--- a/editeng/Library_editeng.mk
+++ b/editeng/Library_editeng.mk
@@ -98,7 +98,6 @@ $(eval $(call gb_Library_add_exception_objects,editeng,\
editeng/source/misc/swafopt \
editeng/source/misc/txtrange \
editeng/source/misc/unolingu \
- editeng/source/misc/weldeditview \
editeng/source/outliner/outleeng \
editeng/source/outliner/outlin2 \
editeng/source/outliner/outliner \
diff --git a/editeng/source/misc/weldeditview.cxx b/editeng/source/misc/weldeditview.cxx
deleted file mode 100644
index 38c253d5e6d3..000000000000
--- a/editeng/source/misc/weldeditview.cxx
+++ /dev/null
@@ -1,163 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- */
-
-#include <editeng/weldeditview.hxx>
-#include <vcl/cursor.hxx>
-#include <vcl/event.hxx>
-#include <vcl/ptrstyle.hxx>
-#include <vcl/settings.hxx>
-#include <vcl/svapp.hxx>
-
-WeldEditView::WeldEditView() {}
-
-void WeldEditView::makeEditEngine()
-{
- m_xEditEngine.reset(new EditEngine(EditEngine::CreatePool()));
-}
-
-void WeldEditView::SetDrawingArea(weld::DrawingArea* pDrawingArea)
-{
- Size aSize(pDrawingArea->get_size_request());
- if (aSize.Width() == -1)
- aSize.setWidth(500);
- if (aSize.Height() == -1)
- aSize.setHeight(100);
- pDrawingArea->set_size_request(aSize.Width(), aSize.Height());
-
- SetOutputSizePixel(aSize);
-
- weld::CustomWidgetController::SetDrawingArea(pDrawingArea);
-
- EnableRTL(false);
-
- const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
- Color aBgColor = rStyleSettings.GetWindowColor();
-
- OutputDevice& rDevice = pDrawingArea->get_ref_device();
-
- rDevice.SetMapMode(MapMode(MapUnit::MapTwip));
- rDevice.SetBackground(aBgColor);
-
- Size aOutputSize(rDevice.PixelToLogic(aSize));
- aSize = aOutputSize;
- aSize.setHeight(aSize.Height());
-
- makeEditEngine();
- m_xEditEngine->SetPaperSize(aSize);
- m_xEditEngine->SetRefDevice(&rDevice);
-
- m_xEditEngine->SetControlWord(m_xEditEngine->GetControlWord() | EEControlBits::MARKFIELDS);
-
- m_xEditView.reset(new EditView(m_xEditEngine.get(), nullptr));
- m_xEditView->setEditViewCallbacks(this);
- m_xEditView->SetOutputArea(tools::Rectangle(Point(0, 0), aOutputSize));
-
- m_xEditView->SetBackgroundColor(aBgColor);
- m_xEditEngine->InsertView(m_xEditView.get());
-
- pDrawingArea->set_cursor(PointerStyle::Text);
-}
-
-WeldEditView::~WeldEditView() {}
-
-void WeldEditView::Resize()
-{
- OutputDevice& rDevice = GetDrawingArea()->get_ref_device();
- Size aOutputSize(rDevice.PixelToLogic(GetOutputSizePixel()));
- Size aSize(aOutputSize);
- m_xEditEngine->SetPaperSize(aSize);
- m_xEditView->SetOutputArea(tools::Rectangle(Point(0, 0), aOutputSize));
- weld::CustomWidgetController::Resize();
-}
-
-void WeldEditView::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect)
-{
- //note: ScEditWindow::Paint is similar
-
- rRenderContext.Push(PushFlags::ALL);
- rRenderContext.SetClipRegion();
-
- const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
- Color aBgColor = rStyleSettings.GetWindowColor();
-
- m_xEditView->SetBackgroundColor(aBgColor);
-
- rRenderContext.SetBackground(aBgColor);
-
- tools::Rectangle aLogicRect(rRenderContext.PixelToLogic(rRect));
- m_xEditView->Paint(aLogicRect, &rRenderContext);
-
- if (HasFocus())
- {
- m_xEditView->ShowCursor();
- vcl::Cursor* pCursor = m_xEditView->GetCursor();
- pCursor->DrawToDevice(rRenderContext);
- }
-
- std::vector<tools::Rectangle> aLogicRects;
-
- // get logic selection
- m_xEditView->GetSelectionRectangles(aLogicRects);
-
- rRenderContext.SetLineColor();
- rRenderContext.SetFillColor(COL_BLACK);
- rRenderContext.SetRasterOp(RasterOp::Invert);
-
- for (const auto& rSelectionRect : aLogicRects)
- rRenderContext.DrawRect(rSelectionRect);
-
- rRenderContext.Pop();
-}
-
-bool WeldEditView::MouseMove(const MouseEvent& rMEvt) { return m_xEditView->MouseMove(rMEvt); }
-
-bool WeldEditView::MouseButtonDown(const MouseEvent& rMEvt)
-{
- if (!HasFocus())
- GrabFocus();
-
- return m_xEditView->MouseButtonDown(rMEvt);
-}
-
-bool WeldEditView::MouseButtonUp(const MouseEvent& rMEvt)
-{
- return m_xEditView->MouseButtonUp(rMEvt);
-}
-
-bool WeldEditView::KeyInput(const KeyEvent& rKEvt)
-{
- sal_uInt16 nKey = rKEvt.GetKeyCode().GetCode();
-
- if (nKey == KEY_TAB)
- {
- return false;
- }
- else if (!m_xEditView->PostKeyEvent(rKEvt))
- {
- return false;
- }
-
- return true;
-}
-
-void WeldEditView::GetFocus()
-{
- m_xEditView->ShowCursor();
-
- weld::CustomWidgetController::GetFocus();
-}
-
-void WeldEditView::LoseFocus()
-{
- weld::CustomWidgetController::LoseFocus();
- Invalidate(); // redraw without cursor
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */