diff options
author | Thomas Lange <tl@openoffice.org> | 2001-08-31 13:11:58 +0000 |
---|---|---|
committer | Thomas Lange <tl@openoffice.org> | 2001-08-31 13:11:58 +0000 |
commit | d325e7d2882bf1df4b4309672e90bf589aedf36b (patch) | |
tree | f49baa970c19975fd8a83a198da03a3991b027a6 | |
parent | 61b1371c425fd0f16e284ff06628deb4689f28c2 (diff) |
#91122# access to EditEngine (available from the docucument) and SmViewShell from within SmEditWindow changed
-rw-r--r-- | starmath/inc/edit.hxx | 8 | ||||
-rw-r--r-- | starmath/inc/view.hxx | 6 | ||||
-rw-r--r-- | starmath/source/edit.cxx | 27 | ||||
-rw-r--r-- | starmath/source/view.cxx | 19 |
4 files changed, 36 insertions, 24 deletions
diff --git a/starmath/inc/edit.hxx b/starmath/inc/edit.hxx index 1ab6bb78746b..4e5ff51f8291 100644 --- a/starmath/inc/edit.hxx +++ b/starmath/inc/edit.hxx @@ -2,9 +2,9 @@ * * $RCSfile: edit.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: jp $ $Date: 2001-07-05 10:52:21 $ + * last change: $Author: tl $ $Date: 2001-08-31 14:11:58 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -83,6 +83,7 @@ class ScrollBar; class ScrollBarBox; class DataChangedEvent; class Menu; +class SmCmdBoxWindow; /**************************************************************************/ @@ -93,6 +94,7 @@ class Menu; class SmEditWindow : public Window, public DropTargetHelper { + SmCmdBoxWindow &rCmdBox; EditView *pEditView; ScrollBar *pHScrollBar, *pVScrollBar; @@ -133,7 +135,7 @@ class SmEditWindow : public Window, public DropTargetHelper SfxItemPool * GetEditEngineItemPool(); public: - SmEditWindow( Window *pParent ); + SmEditWindow( SmCmdBoxWindow &rMyCmdBoxWin ); ~SmEditWindow(); // Window diff --git a/starmath/inc/view.hxx b/starmath/inc/view.hxx index 1d2e53488e8b..248b43d51738 100644 --- a/starmath/inc/view.hxx +++ b/starmath/inc/view.hxx @@ -2,9 +2,9 @@ * * $RCSfile: view.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: tl $ $Date: 2001-06-01 10:33:41 $ + * last change: $Author: tl $ $Date: 2001-08-31 14:11:58 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -195,6 +195,7 @@ public: void AdjustPosition(); SmEditWindow *GetEditWindow() { return (&aEdit); } + SmViewShell *GetView(); void ShowWindows (); @@ -210,7 +211,6 @@ public: virtual void StateChanged( StateChangedType nStateChange ); void Grab (); - }; /**************************************************************************/ diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx index 72c19b7d5de9..0271f9b9e712 100644 --- a/starmath/source/edit.cxx +++ b/starmath/source/edit.cxx @@ -2,9 +2,9 @@ * * $RCSfile: edit.cxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: tl $ $Date: 2001-08-29 10:57:10 $ + * last change: $Author: tl $ $Date: 2001-08-31 14:11:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -146,9 +146,10 @@ void SmGetLeftSelectionPart(const ESelection aSel, //////////////////////////////////////// -SmEditWindow::SmEditWindow( Window* pParent ) : - Window (pParent), - DropTargetHelper( this ), +SmEditWindow::SmEditWindow( SmCmdBoxWindow &rMyCmdBoxWin ) : + Window (&rMyCmdBoxWin), + DropTargetHelper ( this ), + rCmdBox (rMyCmdBoxWin), pEditView (0), pHScrollBar (0), pVScrollBar (0), @@ -190,7 +191,7 @@ SmEditWindow::~SmEditWindow() SmDocShell * SmEditWindow::GetDoc() { - SmViewShell *pView = SmGetActiveView(); + SmViewShell *pView = rCmdBox.GetView(); return pView ? pView->GetDoc() : 0; } @@ -223,9 +224,8 @@ void SmEditWindow::DataChanged( const DataChangedEvent& ) SetPointFont( GetSettings().GetStyleSettings().GetAppFont() ); - SmDocShell *pDoc = GetDoc(); - EditEngine *pEditEngine = pDoc ? &pDoc->GetEditEngine() : 0; - SfxItemPool *pEditEngineItemPool = pDoc ? &pDoc->GetEditEngineItemPool() : 0; + EditEngine *pEditEngine = GetEditEngine(); + SfxItemPool *pEditEngineItemPool = GetEditEngineItemPool(); if (pEditEngine && pEditEngineItemPool) { @@ -271,7 +271,7 @@ IMPL_LINK(SmEditWindow, CursorMoveTimerHdl, Timer *, pTimer) ESelection aNewSelection (GetSelection()); if (!aNewSelection.IsEqual(aOldSelection)) - { SmViewShell *pView = SmGetActiveView(); + { SmViewShell *pView = rCmdBox.GetView(); if (pView) { @@ -359,7 +359,7 @@ void SmEditWindow::Command(const CommandEvent& rCEvt) IMPL_LINK_INLINE_START( SmEditWindow, MenuSelectHdl, Menu *, pMenu ) { - SmViewShell *pViewSh = SmGetActiveView(); + SmViewShell *pViewSh = rCmdBox.GetView(); if (pViewSh) pViewSh->GetViewFrame()->GetDispatcher()->Execute( SID_INSERTCOMMAND, SFX_CALLMODE_STANDARD, @@ -389,8 +389,7 @@ void SmEditWindow::KeyInput(const KeyEvent& rKEvt) } else { - SmViewShell *pView = SmGetActiveView(); - SmDocShell *pDocShell = pView ? pView->GetDoc() : 0; + SmDocShell *pDocShell = GetDoc(); if (pDocShell) pDocShell->SetModified( TRUE ); @@ -860,7 +859,7 @@ void SmEditWindow::Flush() if (pEditEngine && pEditEngine->IsModified()) { pEditEngine->ClearModifyFlag(); - SmViewShell *pViewSh = SmGetActiveView(); + SmViewShell *pViewSh = rCmdBox.GetView(); if (pViewSh) pViewSh->GetViewFrame()->GetDispatcher()->Execute( SID_TEXT, SFX_CALLMODE_STANDARD, diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index 85226bb022c4..c155e307d19f 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -2,9 +2,9 @@ * * $RCSfile: view.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: tl $ $Date: 2001-07-17 07:37:28 $ + * last change: $Author: tl $ $Date: 2001-08-31 14:11:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -501,8 +501,8 @@ void SmEditController::StateChanged(USHORT nSID, SfxItemState eState, const SfxP SmCmdBoxWindow::SmCmdBoxWindow(SfxBindings *pBindings, SfxChildWindow *pChildWindow, Window *pParent) : SfxDockingWindow(pBindings, pChildWindow, pParent, SmResId(RID_CMDBOXWINDOW)), - aEdit(this), - aController(aEdit, SID_TEXT, *pBindings) + aEdit (*this), + aController (aEdit, SID_TEXT, *pBindings) { Hide (); aGrabTimer.SetTimeout (1000); @@ -517,6 +517,17 @@ SmCmdBoxWindow::~SmCmdBoxWindow () } +SmViewShell * SmCmdBoxWindow::GetView() +{ + SfxViewShell *pView = GetBindings().GetDispatcher()->GetFrame()->GetViewShell(); +#ifdef DEBUG + SfxViewShell *pActiveView = SmGetActiveView(); + DBG_ASSERT( !pActiveView || pActiveView == pView , "view mismatch" ); +#endif + return PTR_CAST(SmViewShell, pView); +} + + void SmCmdBoxWindow::Resize() { Rectangle aRect = Rectangle(Point(0, 0), GetOutputSizePixel()); |