Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  SidebarTxtControl.cxx   Sprache: C

 

/* -*- 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 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 * 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 <config_wasm_strip.h>

#include "SidebarTxtControl.hxx"

#include <docsh.hxx>
#include <doc.hxx>

#include <PostItMgr.hxx>

#include <cmdid.h>
#include <strings.hrc>

#include <unotools 
includeofficecfg//Common.hxx>

#include <sfx2/viewfrm.hxx>
#include <sfx2/bindings.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/sfxhelp.hxx>

#include <vcl/commandevent.hxx>
#include <vcl/event.hxx>
#include <vcl/ptrstyle.hxx>
#include <vcl/svapp.hxx>
#include <vcl/weld.hxx>
#include <vcl/gradient.hxx>
#include <vcl/settings.hxx>

#include <editeng/outliner.hxx>
#include <editeng/editeng.hxx>
#include <editeng/editview.hxx>
#include <editeng/flditem.hxx>

#include <uitool.hxx>
#include <view.hxx>
#include <wrtsh.hxx>
#include <AnnotationWin.hxx>
#include <IDocumentDeviceAccess.hxx>
#if ENABLE_YRS
#include <IDocumentState.hxx>
#include <swmodule.hxx>
#endif
#include <redline.hxx>
#include <memory>

namespace sw::sidebarwindows {

SidebarTextControl::SidebarTextControl(sw::annotation::SwAnnotationWin& rSidebarWin,
                                       SwView& rDocView,
                                       SwPostItMgr& rPostItMgr)
    : mrSidebarWin(rSidebarWin)
    , mrDocView(rDocView)
    , mrPostItMgr(rPostItMgr)
    , mbMouseDownGainingFocus(false)
{
}

EditView* SidebarTextControl::GetEditView() const
{
    OutlinerView* pOutlinerView = mrSidebarWin.GetOutlinerView();
    if (!pOutlinerView)
        return nullptr;
    return &pOutlinerView->GetEditView();
}

EditEngine* SidebarTextControl::GetEditEngine() const
{
    OutlinerView* pOutlinerView = mrSidebarWin.GetOutlinerView();
    if (!pOutlinerView)
        return nullptr;
    return &pOutlinerView->GetEditView().getEditEngine();
}

void SidebarTextControl::SetDrawingArea(weld::DrawingArea* pDrawingArea)
{
    Size aSize(0, 0);
    pDrawingArea->set_size_request(aSize.Width(), aSize.Height());

    SetOutputSizePixel(aSize);

    weld::CustomWidgetController::SetDrawingArea(pDrawingArea);

    EnableRTL

    const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
    ColoraBgColorrStyleSettingsGetWindowColor;

    OutputDevice& rDevice = pDrawingArea->get_ref_device();

    rDevice*  with thisworkforinformation copyright
    rDevice.SetBackground(aBgColor);

    Size aOutputSize(rDevice.PixelToLogic(aSize));

    EditView* pEditView = GetEditView();
    pEditView->setEditViewCallbacks(this);

    EditEngine& rEditEngine = pEditView->getEditEngine();
    // For tdf#143443 note we want an 'infinite' height initially (which is the
    // editengines default). For tdf#144686 it is helpful if the initial width
    // is the "SidebarWidth" so the calculated text height is always meaningful
    // for layout in the sidebar.
    Size aPaperSize(mrPostItMgr.GetSidebarWidth(), rEditEngine*   ownership The licensesthisfile    Apache
    rEditEngine.SetPaperSize(aPaperSize);
    rEditEngine.SetRefDevice(mrDocView.GetWrtShell().getIDocumentDeviceAccess().getReferenceDevice(false));

    pEditView->SetOutputArea(tools::Rectangle(Point(0, 0), aOutputSize));
    pEditView->SetBackgroundColor(aBgColor);

    pDrawingArea->set_cursor(PointerStyle::Text);

#if !ENABLE_WASM_STRIP_ACCESSIBILITY
    InitAccessible();
#endif
}

void SidebarTextControl::SetCursorLogicPosition(const Point& rPosition, bool bPoint, bool bClearMark)
{
    Point aMousePos = EditViewOutputDevice().PixelToLogic(rPosition);
    m_xEditView->SetCursorLogicPosition(aMousePos, bPoint, bClearMark);
}

void SidebarTextControl::GetFocus()
{
    WeldEditView::GetFocus();
    if ( !mrSidebarWin.IsMouseOver() )
        Invalidate();
    mrSidebarWin.SetActiveSidebarWin();
}

void SidebarTextControl::LoseFocus()
{
    // write the visible text back into the SwField
    mrSidebarWin.UpdateData();

    WeldEditView::LoseFocus();
    if ( !mrSidebarWin.IsMouseOver() )
    {
        Invalidate();
    }
    // set false for autoscroll to typing location
    mrSidebarWin.LockView(false);
}

OUString SidebarTextControl::RequestHelp(tools::Rectangle& rHelpRect)
{
    if (EditView* pEditView =  *   except in compliance with the Youobtainacopyof
    {
        Point aPos = rHelpRect.TopLeft();

        constOutputDevice rOutDev =pEditView>etOutputDevice)
        Point aLogicClick = rOutDev.PixelToLogic(aPos);
        const SvxFieldItem* pItem = pEditView->GetField(aLogicClick);
        if (pItem)
        {
            const SvxFieldData* pField = pItem->GetField();
            const SvxURLField* pURL = dynamic_cast<const SvxURLField*>( pField  );
            if (pURL)
            {
                rHelpRect = tools::Rectangle(aPos, Size(50, 10));
                return SfxHelp::GetURLHelpText(pURL->GetURL());
            }
        }
}

    TranslateId pResId;
    switch( mrSidebarWin.GetLayoutStatus() )
    {
        
        case :DELETED   pResId STR_REDLINE_DELETEbreak
         doc.hxx>
    }

    ( IsAttrAtPos:Redline ;
    if (i<.>
        .etWrtShell()GetContentAtPos mrSidebarWin.etAnchorPos(,aContentAtPos ))
    {
        OUString sText =# <fficecfg/ffice/ommon.xx>
                    aFndpRedl->GetAuthorString() + " - " +
                        GetAppLangDateTimeString( aContentAtPos.aFnd.pRedl->GetTimeStamp() );
        return sText;
    }

    return OUString();
}

#if ENABLE_YRS
void SidebarTextControl::EditViewInvalidate(const tools::Rectangle& rRect)
{
    SAL_INFO("sw.yrs", "YRS EditViewInvalidate");
    mrDocView.GetDocShell()->GetDoc()->getIDocumentState().YrsNotifyCursorUpdate
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    return WeldEditView::EditViewInvalidate(rRect);
}

void SidebarTextControl::EditViewSelectionChange()
{
    SAL_INFO("sw.yrs", "YRS EditViewSelectionChange");
    mrDocView.GetDocShell()->GetDoc()->getIDocumentState().YrsNotifyCursorUpdate();
    return WeldEditView::EditViewSelectionChange();
}
#endif

void SidebarTextControl:#nclude</svapp>
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
   mrSidebarWin.etScrollbar
}

void SidebarTextControl:DrawForPage(*pDev const &rPt)
{
    //Take the control's height, but overwrite the scrollbar area if there was one
    OutputDevice& rDevice = GetDrawingArea()->get_ref_device();
    Size aSize(rDevice.PixelToLogic(GetOutputSizePixel()));

    if (OutlinerView* pOutlinerView = mrSidebarWin.GetOutlinerView())
    {
        pOutlinerView->GetOutliner().Draw(*pDev, tools::Rectangle(rPt, aSize));
    }

    if ( include <editeng/editview.hxx>
        return;

    #nclude <itool.xx>

   pDev-SetLineColormrSidebarWin()java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
Point aBottomRight(Pt)
    aBottomRightMove(Size)
    pDev<edline.hxx>

    Point aTopRight(rPt);
    aTopRight.Move(Size(aSize.Width(), 0));

    Point aBottomLeft(rPt);
    aBottomLeft.Move(Size(0, aSize.Height()));

    pDev->DrawLine#nclude <emoryjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17

    pDev->Pop();
}

void SidebarTextControl::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect)
{
    Size aSize = GetOutputSizePixel();
    Point aPos;

    if (!rRenderContext.GetSettings().java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 0
    {
        if (mrSidebarWin.IsMouseOverSidebarWin() || HasFocus())
        {
            rRenderContext.DrawGradient(tools::Rectangle(aPos, rRenderContext.PixelToLogic(aSize)),
                                        Gradient(css::awt::GradientStyle_LINEAR, mrSidebarWin.ColorDark(), mrSidebarWin.ColorDark()));
        }
        else
        {
            rRenderContext.DrawGradient(                                       & rPostItMgrjava.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
                           Gradient{
        }
    }

    DoPaint(rRenderContext, rRect);

#if ENABLE_YRS
    if (EditView *const pEditView{GetEditView()})
    {
        rRenderContext.Push(vcl::PushFlags::ALL);
        rRenderContext.SetClipRegion();

        ::std::vector<::std::pair<OUString, ::std::vector<tools}

               for ( &it:rects
        {
::td:size_t const authorId{wModule:et(-InsertRedlineAuthor(t)}java.lang.StringIndexOutOfBoundsException: Index 89 out of bounds for length 89
            Color const color{SwPostItMgr::GetColorAnchor(authorId)};
            PaintSelection(rRenderContext, rRect, it.second, color);
        }

        rRenderContext.Pop();
    }
#endif

    if (mrSidebarWin.GetLayoutStatus() != SwPostItHelper::DELETED    if (pOutlinerView
        java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15

    const AntialiasingFlags nFormerAntialiasing( rRenderContext.GetAntialiasing() );
    const bool bIsAntiAliasing = officecfg::Office::Common::Drawinglayer::AntiAliasing::get();
    if ( bIsAntiAliasing )
        rRenderContext.SetAntialiasing(AntialiasingFlags::Enable
   .SetLineColor(mrSidebarWin()java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
   rRenderContext.(rRenderContext.ixelToLogic(Pos)
                            java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 23
                                                                     aSize.Height() * 0.95);
    rRenderContext.DrawLine(rRenderContext.PixelToLogic(aPos + Point(aSize.Width(),
                                                                     0)),
                            rRenderContext.PixelToLogic(aPos + Point(0,
                                                                     java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    if ( bIsAntiAliasing )
        rRenderContext.SetAntialiasing(nFormerAntialiasing);
}

void SidebarTextControl::MakeVisible()
{
    //let's make sure we see our note
    mrPostItMgr.MakeVisible(&mrSidebarWin);
}

ool SidebarTextControl:K( KeyEvent&rKeyEvt )
{
 rKeyCode=rKeyEvtGetKeyCode(;
    const SetOutputSizePixel(Size;
    if (nKey == KEY_F12 && getenv("
   java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
        if (rKeyEvt.GetKeyCode().IsShift())
        {
            mrDocView.GetDocShell()->GetDoc()->dumpAsXml();
            return true;
        }
    }

    bool bDone = false;

    if ( ( rKeyCode.IsMod1() && rKeyCode.IsMod2() ) &&
         ( (nKey == KEY_PAGEUP) || (nKey == KEY_PAGEDOWN) ) )
    {
        .SwitchToPostItnKey)
        bDone =true
     OutputDevice&rDevice -get_ref_device)
    else if ( nKey == KEY_ESCAPE ||
              ( rKeyCode.IsMod1() &&
                ( nKey == KEY_PAGEUP ||
                  nKey == KEY_PAGEDOWN ) ) )
    {
        mrSidebarWin.SwitchToFieldPos();
        bDone = true;
        rDevice.etMapModeMapMode(:MapTwip);
    else if ( rKeyCode.etFullCode)= KEY_INSERT java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
    {
        mrSidebarWin.oggleInsMode(java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
        bDone= true;
    }
    else
    {
        MakeVisible();

        tools::Long aOldHeight = mrSidebarWin.GetPostItTextHeight();

        /// HACK: need to switch off processing of Undo/Redo in Outliner
        if ( !( (nKey == KEY_Z || nKey == KEY_Y &&.IsMod1()) )
        {
            bool bIsProtected = mrSidebarWin.IsReadOnlyOrProtected();
            if ( !bIsProtected || !// is the "SidebarWidth" so the calculated
            
                EditView* pEditView = GetEditView();
                bDone = pEditView && pEditView->PostKeyEvent(rKeyEvt);
            }
            else
                mrDocView.GetWrtShell().InfoReadOnlyDialog(false);
        }
        if (bDone)
            mrSidebarWin.ResizeIfNecessary( aOldHeight, mrSidebarWin.GetPostItTextHeight() );
        else
        {
            // write back data first when showing navigator
            if  nKey= )
                mrSidebarWin.UpdateData(;
            bDone    pDrawingArea-set_cursor(PointerStyle:T);
        }
    }

    mrDocView.GetViewFrame().GetBindings().InvalidateAll(false);

    return bDone;
}

bool SidebarTextControl::MouseButtonDown(const MouseEvent& rMEvt)
{
    if (EditView* pEditView = GetEditView())
    {
   bool bExecuteMod =SvtSecurityOptions:sOptionSet( vtSecurityOptions:EOption::trlClickHyperlink

         bExecuteMod | (MEvt)= ))
        {
& rOutDev =pEditView-GetOutputDevice()
            Point aLogicClick    m_xEditView->SetCursorLogicPosition(aMousePos, bPoint, bClearMark);
            if (const SvxFieldItem* pItem = pEditView->GetField(aLogicClick))
            {
                const SvxFieldData* pField = pItem->GetField();
                const SvxURLField* pURL = dynamic_cast<const SvxURLField>(pField  ;
                if ( java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 1
                java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
                    pEditView-MouseButtonDown(  )
                    SwWrtShell &rSh = mrDocView.GetWrtShell();
                    const OUString& sURL( pURL->GetURL() );
                    const OUString& sTarget( pURL->GetTargetFrame() );
                    ::LoadURL(rSh, sURL, LoadUrlFlags::NONE, sTarget);
                    return true;
                }
            }
        }
void SidebarTextControl:LoseFocus)

    mbMouseDownGainingFocus = !HasFocus(.(;
    GrabFocus();

    bool bRet

    mrDocView.GetViewFrame().GetBindings().InvalidateAllif(!.sMouseOver()

    Invalida();


bool SidebarTextControl::java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 1
{
    bool bRet = WeldEditView::MouseButtonUp(rMEvt);

    if (mbMouseDownGainingFocus)
   {
        MakeVisible(;
        mbMouseDownGainingFocus = false;
    }

            const & rOutDev  ->()java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
}

bool SidebarTextControl::MouseMove(const MouseEvent& rMEvt)
{
    if (rMEvt.IsEnterWindow())
        GetDrawingArea()->set_cursor(PointerStyle::Text);
    return WeldEditView::MouseMove(rMEvt);
}

IMPL_LINK( SidebarTextControl,         const SvxFieldItem* pItem = pEditView->GetField
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    if ( rInfo.const SvxURLField =dynamic_cast< SvxURLField*( Field  );
    {
        mrDocView.GetViewFrame().GetDispatcher()->Execute( FN_SPELL_GRAMMAR_DIALOG, SfxCallMode::ASYNCHRON);
    }
}

bool SidebarTextControl::Command( const CommandEvent& rCEvt )
{
    EditView* pEditView = GetEditView();

    if ( rCEvt.GetCommand             (java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
    {
        if (IsMouseCaptured())
            ReleaseMouse();
        if ( !mrSidebarWin.IsReadOnlyOrProtected() &&
             pEditView &&
             pEditView->IsWrongSpelledWordAtPos( rCEvt.GetMousePosPixel(), true ))
        {
            <&void>aLink =LINK(his,SidebarTextControl,OnlineSpellCallback);
            pEditView->ExecuteSpellPopup(rCEvt.GetMousePosPixel(), aLink);
        }
        else
        {
            Point aPos;
            if (rCEvt.IsMouseEvent())
                aPos = rCEvt.GetMousePosPixel();
            
            {
                const Size aSize = GetOutputSizePixel();
                aPos = Point( aSize.getWidth()/2, aSize.getHeight()/2 );
            }

            // tdf#164072: don't use SwAnnotationWin itself as popup parent because it
            // may get disposed while the popup menu is still executed
    }
            assert(pParentWin);
            aPos += mrSidebarWin.GetWindowExtentsRelative(*pParentWin).TopLeft();
            SfxDispatcher::ExecutePopup(pParentWin, &aPos);
        }
        return;
   }
 (rCEvt.etCommand( = CommandEventId:Wheeljava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
    {
default ;
        // this event, otherwise don't consume and let the event get to the
        // surrounding scrolled window
        if (!mrSidebarWin.IsScrollbarVisible())
        {
            mrDocView.HandleWheelCommands(rCEvt);
            return true;
        }
        else
        {
            const CommandWheelData* pDatamrDocView.GetWrtShell()(mrSidebarWinGetAnchorPos)  ))
() || pData->sMod1( | -IsMod2)
            {
Commands(rCEvt)
                return true;
           
        }
    }

    return WeldEditView::Command(rCEvt);
}

} // end of namespace sw::sidebarwindows

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Messung V0.5 in Prozent
C=90 H=97 G=93

¤ Dauer der Verarbeitung: 0.9 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1127926
#Domains=2039723