summaryrefslogtreecommitdiff
path: root/starmath/inc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-05-06 16:28:12 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-05-07 09:47:09 +0200
commit148ad7cf92b216351fce464528af8db0111157f4 (patch)
tree7a3328b8227d743c22f72a8ee0f207610d2c23c4 /starmath/inc
parent8d45e67fe97773666cb5e2db04822476872fa84f (diff)
remove an intermediate layer of widgets
Change-Id: I4fe23f87d997057a2cb061110c8e325c8322b95e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115187 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'starmath/inc')
-rw-r--r--starmath/inc/edit.hxx30
-rw-r--r--starmath/inc/view.hxx16
2 files changed, 25 insertions, 21 deletions
diff --git a/starmath/inc/edit.hxx b/starmath/inc/edit.hxx
index 773355cfff14..0bed0b169a2f 100644
--- a/starmath/inc/edit.hxx
+++ b/starmath/inc/edit.hxx
@@ -20,7 +20,6 @@
#pragma once
#include <svx/weldeditview.hxx>
-#include <vcl/InterimItemWindow.hxx>
#include <vcl/idle.hxx>
#include <vcl/transfer.hxx>
@@ -72,6 +71,7 @@ public:
virtual bool Command(const CommandEvent& rCEvt) override;
virtual void GetFocus() override;
virtual void LoseFocus() override;
+ virtual void StyleUpdated() override;
void SetText(const OUString& rText);
void InsertText(const OUString& rText);
@@ -83,34 +83,38 @@ public:
void StartCursorMove();
};
-class SmEditWindow final : public InterimItemWindow
+class SmEditWindow final
{
SmCmdBoxWindow& rCmdBox;
std::unique_ptr<weld::ScrolledWindow> mxScrolledWindow;
std::unique_ptr<SmEditTextWindow> mxTextControl;
std::unique_ptr<weld::CustomWeld> mxTextControlWin;
- virtual void ApplySettings(vcl::RenderContext&) override;
- virtual void DataChanged(const DataChangedEvent&) override;
-
DECL_LINK(ScrollHdl, weld::ScrolledWindow&, void);
- void CreateEditView();
+ void CreateEditView(weld::Builder& rBuilder);
public:
- explicit SmEditWindow(SmCmdBoxWindow& rMyCmdBoxWin);
- virtual ~SmEditWindow() override;
- virtual void dispose() override;
+ SmEditWindow(SmCmdBoxWindow& rMyCmdBoxWin, weld::Builder& rBuilder);
+ ~SmEditWindow();
+
+ weld::Window* GetFrameWeld() const;
SmDocShell* GetDoc();
SmViewShell* GetView();
EditView* GetEditView() const;
EditEngine* GetEditEngine();
+ SmCmdBoxWindow& GetCmdBox() const { return rCmdBox; }
+
+ void SetText(const OUString& rText);
+ OUString GetText() const;
+ void Flush();
+ void GrabFocus();
- // Window
- virtual void SetText(const OUString& rText) override;
- virtual OUString GetText() const override;
- virtual void Command(const CommandEvent& rCEvt) override;
+ css::uno::Reference<css::datatransfer::clipboard::XClipboard> GetClipboard() const
+ {
+ return mxTextControl->GetClipboard();
+ }
ESelection GetSelection() const;
void SetSelection(const ESelection& rSel);
diff --git a/starmath/inc/view.hxx b/starmath/inc/view.hxx
index 94733e251cf5..320a3b065863 100644
--- a/starmath/inc/view.hxx
+++ b/starmath/inc/view.hxx
@@ -27,6 +27,7 @@
#include <sfx2/ctrlitem.hxx>
#include <sfx2/shell.hxx>
#include <sfx2/viewfrm.hxx>
+#include <vcl/InterimItemWindow.hxx>
#include <vcl/timer.hxx>
#include "document.hxx"
#include "edit.hxx"
@@ -182,7 +183,7 @@ public:
class SmCmdBoxWindow : public SfxDockingWindow
{
- VclPtr<SmEditWindow> aEdit;
+ std::unique_ptr<SmEditWindow> m_xEdit;
SmEditController aController;
bool bExiting;
@@ -192,12 +193,6 @@ class SmCmdBoxWindow : public SfxDockingWindow
protected:
- // Window
- virtual void GetFocus() override;
- virtual void Resize() override;
- virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
- virtual void StateChanged( StateChangedType nStateChange ) override;
-
virtual Size CalcDockingSize(SfxChildAlignment eAlign) override;
virtual SfxChildAlignment CheckAlignment(SfxChildAlignment eActual,
SfxChildAlignment eWish) override;
@@ -212,11 +207,16 @@ public:
virtual ~SmCmdBoxWindow () override;
virtual void dispose() override;
+ // Window
+ virtual void GetFocus() override;
+ virtual void StateChanged( StateChangedType nStateChange ) override;
+ virtual void Command(const CommandEvent& rCEvt) override;
+
void AdjustPosition();
SmEditWindow& GetEditWindow()
{
- return *aEdit;
+ return *m_xEdit;
}
SmViewShell* GetView();
};