diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-10-04 10:36:23 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-10-04 12:19:10 +0000 |
commit | ac9373e65ed7908a19edc6f5c758af9b8232820b (patch) | |
tree | e1a0c8c6752b328b484e9a6a6e9c77213682b6cd /sd/source | |
parent | vcl: read image from JPEG one scanline at a time (diff) | |
download | core-ac9373e65ed7908a19edc6f5c758af9b8232820b.tar.gz core-ac9373e65ed7908a19edc6f5c758af9b8232820b.zip |
merge sd::FuOutline with sd::FuOutlineText
Change-Id: Ie8191ac91175ba51f89809aaa53bc1ffacf42df0
Reviewed-on: https://gerrit.libreoffice.org/29520
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/ui/func/fuoltext.cxx | 42 | ||||
-rw-r--r-- | sd/source/ui/func/fuoutl.cxx | 63 | ||||
-rw-r--r-- | sd/source/ui/inc/fuoltext.hxx | 13 | ||||
-rw-r--r-- | sd/source/ui/inc/fuoutl.hxx | 61 |
4 files changed, 35 insertions, 144 deletions
diff --git a/sd/source/ui/func/fuoltext.cxx b/sd/source/ui/func/fuoltext.cxx index 9ae6b610861c..88507becb2a8 100644 --- a/sd/source/ui/func/fuoltext.cxx +++ b/sd/source/ui/func/fuoltext.cxx @@ -84,10 +84,32 @@ static sal_uInt16 SidArray[] = { FuOutlineText::FuOutlineText(ViewShell* pViewShell, ::sd::Window* pWindow, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq) - : FuOutline(pViewShell, pWindow, pView, pDoc, rReq) + : FuPoor(pViewShell, pWindow, pView, pDoc, rReq), + pOutlineViewShell (static_cast<OutlineViewShell*>(pViewShell)), + pOutlineView (static_cast<OutlineView*>(pView)) { } +/** + * forward to OutlinerView + */ +bool FuOutlineText::Command(const CommandEvent& rCEvt) +{ + bool bResult = false; + + OutlinerView* pOlView = + static_cast<OutlineView*>(mpView)->GetViewByWindow(mpWindow); + DBG_ASSERT (pOlView, "no OutlineView found"); + + if (pOlView) + { + pOlView->Command(rCEvt); // unfortunately, we do not get a return value + bResult = true; + } + return bResult; +} + + rtl::Reference<FuPoor> FuOutlineText::Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq ) { rtl::Reference<FuPoor> xFunc( new FuOutlineText( pViewSh, pWin, pView, pDoc, rReq ) ); @@ -108,7 +130,7 @@ bool FuOutlineText::MouseButtonDown(const MouseEvent& rMEvt) } else { - bReturn = FuOutline::MouseButtonDown(rMEvt); + bReturn = FuPoor::MouseButtonDown(rMEvt); } return bReturn; @@ -120,7 +142,7 @@ bool FuOutlineText::MouseMove(const MouseEvent& rMEvt) if (!bReturn) { - bReturn = FuOutline::MouseMove(rMEvt); + bReturn = FuPoor::MouseMove(rMEvt); } return bReturn; @@ -171,7 +193,7 @@ bool FuOutlineText::MouseButtonUp(const MouseEvent& rMEvt) } if( !bReturn ) - bReturn = FuOutline::MouseButtonUp(rMEvt); + bReturn = FuPoor::MouseButtonUp(rMEvt); return bReturn; } @@ -201,7 +223,7 @@ bool FuOutlineText::KeyInput(const KeyEvent& rKEvt) } else { - bReturn = FuOutline::KeyInput(rKEvt); + bReturn = FuPoor::KeyInput(rKEvt); } } @@ -238,16 +260,6 @@ void FuOutlineText::UpdateForKeyPress (const KeyEvent& rEvent) pOutlineViewShell->UpdatePreview (pOutlineViewShell->GetActualPage()); } -void FuOutlineText::Activate() -{ - FuOutline::Activate(); -} - -void FuOutlineText::Deactivate() -{ - FuOutline::Deactivate(); -} - /** * Cut object to clipboard */ diff --git a/sd/source/ui/func/fuoutl.cxx b/sd/source/ui/func/fuoutl.cxx deleted file mode 100644 index 61b3b3daee01..000000000000 --- a/sd/source/ui/func/fuoutl.cxx +++ /dev/null @@ -1,63 +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/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include "fuoutl.hxx" - -#include <editeng/outliner.hxx> -#include "OutlineView.hxx" -#include "OutlineViewShell.hxx" -#include "Window.hxx" - -namespace sd { - - -FuOutline::FuOutline ( - ViewShell* pViewShell, - ::sd::Window* pWindow, - ::sd::View* pView, - SdDrawDocument* pDoc, - SfxRequest& rReq) - : FuPoor(pViewShell, pWindow, pView, pDoc, rReq), - pOutlineViewShell (static_cast<OutlineViewShell*>(pViewShell)), - pOutlineView (static_cast<OutlineView*>(pView)) -{ -} - -/** - * forward to OutlinerView - */ -bool FuOutline::Command(const CommandEvent& rCEvt) -{ - bool bResult = false; - - OutlinerView* pOlView = - static_cast<OutlineView*>(mpView)->GetViewByWindow(mpWindow); - DBG_ASSERT (pOlView, "no OutlineView found"); - - if (pOlView) - { - pOlView->Command(rCEvt); // unfortunately, we do not get a return value - bResult = true; - } - return bResult; -} - -} // end of namespace sd - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/inc/fuoltext.hxx b/sd/source/ui/inc/fuoltext.hxx index 4be5a1c14fe3..3c9d6de44cf7 100644 --- a/sd/source/ui/inc/fuoltext.hxx +++ b/sd/source/ui/inc/fuoltext.hxx @@ -20,7 +20,7 @@ #ifndef INCLUDED_SD_SOURCE_UI_INC_FUOLTEXT_HXX #define INCLUDED_SD_SOURCE_UI_INC_FUOLTEXT_HXX -#include "fuoutl.hxx" +#include "fupoor.hxx" class SdDrawDocument; class SfxRequest; @@ -31,17 +31,21 @@ namespace sd { class View; class ViewShell; +class OutlineView; +class OutlineViewShell; /** * text functions in outline mode */ class FuOutlineText - : public FuOutline + : public FuPoor { public: static rtl::Reference<FuPoor> Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq ); + virtual bool Command(const CommandEvent& rCEvt) override; + virtual bool KeyInput(const KeyEvent& rKEvt) override; virtual bool MouseMove(const MouseEvent& rMEvt) override; virtual bool MouseButtonUp(const MouseEvent& rMEvt) override; @@ -52,9 +56,6 @@ public: virtual void DoPaste() override; virtual void DoPasteUnformatted() override; - virtual void Activate() override; // Function aktivieren - virtual void Deactivate() override; // Function deaktivieren - /** Call this method when the text in the outliner (may) has changed. It will invalidate some slots of the view frame and update the preview in the slide sorter. @@ -69,6 +70,8 @@ protected: SdDrawDocument* pDoc, SfxRequest& rReq); + OutlineViewShell* pOutlineViewShell; + OutlineView* pOutlineView; }; } // end of namespace sd diff --git a/sd/source/ui/inc/fuoutl.hxx b/sd/source/ui/inc/fuoutl.hxx deleted file mode 100644 index d4cae3b4c0e1..000000000000 --- a/sd/source/ui/inc/fuoutl.hxx +++ /dev/null @@ -1,61 +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/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SD_SOURCE_UI_INC_FUOUTL_HXX -#define INCLUDED_SD_SOURCE_UI_INC_FUOUTL_HXX - -#include "fupoor.hxx" - -class SdDrawDocument; -class SfxRequest; - -namespace sd { - -class OutlineView; -class OutlineViewShell; -class View; -class ViewShell; - -/** - * Base class of functions of outline mode - */ -class FuOutline - : public FuPoor -{ -public: - - virtual bool Command(const CommandEvent& rCEvt) override; - -protected: - FuOutline ( - ViewShell* pViewShell, - ::sd::Window* pWindow, - ::sd::View* pView, - SdDrawDocument* pDoc, - SfxRequest& rReq); - - OutlineViewShell* pOutlineViewShell; - OutlineView* pOutlineView; -}; - -} // end of namespace sd - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |