<commit_before>/*************************************************************************
 *
 *  $RCSfile: outlnvsh.cxx,v $
 *
 *  $Revision: 1.36 $
 *
 *  last change: $Author: thb $ $Date: 2002-04-26 10:44:53 $
 *
 *  The Contents of this file are made available subject to the terms of
 *  either of the following licenses
 *
 *         - GNU Lesser General Public License Version 2.1
 *         - Sun Industry Standards Source License Version 1.1
 *
 *  Sun Microsystems Inc., October, 2000
 *
 *  GNU Lesser General Public License Version 2.1
 *  =============================================
 *  Copyright 2000 by Sun Microsystems, Inc.
 *  901 San Antonio Road, Palo Alto, CA 94303, USA
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License version 2.1, as published by the Free Software Foundation.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 *  MA  02111-1307  USA
 *
 *
 *  Sun Industry Standards Source License Version 1.1
 *  =================================================
 *  The contents of this file are subject to the Sun Industry Standards
 *  Source License Version 1.1 (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.openoffice.org/license.html.
 *
 *  Software provided under this License is provided on an "AS IS" basis,
 *  WITHOUT WARRANTY OF ANY KIND, EITHER EPRESSED OR IMPLIED, INCLUDING,
 *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
 *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
 *  See the License for the specific provisions governing your rights and
 *  obligations concerning the Software.
 *
 *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
 *
 *  Copyright: 2000 by Sun Microsystems, Inc.
 *
 *  All Rights Reserved.
 *
 *  Contributor(s): _______________________________________
 *
 *
 ************************************************************************/
#include "app.hrc"
#define ITEMID_HYPERLINK    SID_HYPERLINK_SETLINK
#ifndef _SVX_DLG_HYPERLINK_HXX //autogen
#include <offmgr/hyprlink.hxx>
#endif
#ifndef _SVX_TAB_HYPERLINK_HXX
#include <svx/hyperdlg.hxx>
#endif

#ifndef _SOT_EXCHANGE_HXX //autogen
#include <sot/exchange.hxx>
#endif
#ifndef _SVX_RULE_HXX //autogen
#include <svx/ruler.hxx>
#endif
#ifndef _SVX_ZOOMITEM_HXX //autogen
#include <svx/zoomitem.hxx>
#endif
#ifndef _EEITEM_HXX //autogen
#include <svx/eeitem.hxx>
#endif
#define ITEMID_FIELD    EE_FEATURE_FIELD
#ifndef _SVX_FLDITEM_HXX //autogen
#include <svx/flditem.hxx>
#endif
#ifndef _SFX_SHELL_HXX //autogen
#include <sfx2/shell.hxx>
#endif
#ifndef _SFX_TEMPLDLG_HXX //autogen
#include <sfx2/templdlg.hxx>
#endif
#ifndef _VIEWFAC_HXX //autogen
#include <sfx2/viewfac.hxx>
#endif
#ifndef _SFXREQUEST_HXX //autogen
#include <sfx2/request.hxx>
#endif
#ifndef _SVX_HLNKITEM_HXX //autogen
#include <svx/hlnkitem.hxx>
#endif
#ifndef _SVDOTEXT_HXX //autogen
#include <svx/svdotext.hxx>
#endif
#ifndef _SFXDISPATCH_HXX //autogen
#include <sfx2/dispatch.hxx>
#endif
#ifndef _SV_SCRBAR_HXX //autogen
#include <vcl/scrbar.hxx>
#endif
#ifndef _SFX_WHITER_HXX //autogen
#include <svtools/whiter.hxx>
#endif
#ifndef _EDITSTAT_HXX //autogen
#include <svx/editstat.hxx>
#endif
#ifndef _SFXITEMPOOL_HXX //autogen
#include <svtools/itempool.hxx>
#endif
#ifndef _SFX_TPLPITEM_HXX //autogen
#include <sfx2/tplpitem.hxx>
#endif
#ifndef _SVDORECT_HXX //autogen
#include <svx/svdorect.hxx>
#endif
#ifndef _SOT_FORMATS_HXX //autogen
#include <sot/formats.hxx>
#endif
#ifndef _SFX_TOPFRM_HXX //autogen wg. SfxTopViewFrame
#include <sfx2/topfrm.hxx>
#endif
#ifndef _COM_SUN_STAR_LINGUISTIC2_XTHESAURUS_HPP_
#include <com/sun/star/linguistic2/XThesaurus.hpp>
#endif
#ifndef _COM_SUN_STAR_I18N_TRANSLITERATIONMODULES_HDL_
#include <com/sun/star/i18n/TransliterationModules.hdl>
#endif
#ifndef _UNO_LINGU_HXX
#include <svx/unolingu.hxx>
#endif
#ifndef _COMPHELPER_PROCESSFACTORY_HXX_
#include <comphelper/processfactory.hxx>
#endif
#ifndef _OUTLOBJ_HXX
#include <svx/outlobj.hxx>
#endif
#ifndef _SVTOOLS_CJKOPTIONS_HXX
#include <svtools/cjkoptions.hxx>
#endif
#ifndef _CLIPLISTENER_HXX
#include <svtools/cliplistener.hxx>
#endif

#ifndef _SD_OPTSITEM_HXX
#include "optsitem.hxx"
#endif

#include "strings.hrc"
#include "glob.hrc"
#include "res_bmp.hrc"

#include "sdoutl.hxx"
#include "sdwindow.hxx"
#include "drtxtob.hxx"
#include "drawdoc.hxx"
#include "outlnvsh.hxx"
#include "sdresid.hxx"
#include "sdpage.hxx"
#include "fuoltext.hxx"
#include "frmview.hxx"
#include "zoomlist.hxx"
#include "stlsheet.hxx"
#include "preview.hxx"
#include "prevchld.hxx"
#include "fuslshow.hxx"
#include "SdUnoOutlineView.hxx"

#ifndef _SD_ACCESSIBILITY_ACCESSIBLE_OUTLINE_VIEW_HXX
#include "AccessibleOutlineView.hxx"
#endif

using namespace ::rtl;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::linguistic2;

#define MIN_ZOOM           10       // Minimaler Zoomfaktor
#define MAX_ZOOM         1000       // Maximaler Zoomfaktor

/************************************************************************/


/*************************************************************************
|*
|* SFX-Slotmap und Standardinterface deklarieren
|*
\************************************************************************/

SFX_DECL_TYPE(13);

#define SdOutlineViewShell
#include "sdslots.hxx"

SFX_IMPL_INTERFACE(SdOutlineViewShell, SfxViewShell, SdResId(STR_OUTLINEVIEWSHELL))
{
    SFX_POPUPMENU_REGISTRATION( SdResId(RID_OUTLINE_POPUP) );
    SFX_OBJECTBAR_REGISTRATION( SFX_OBJECTBAR_TOOLS | SFX_VISIBILITY_STANDARD |
                                SFX_VISIBILITY_FULLSCREEN | SFX_VISIBILITY_SERVER,
                                SdResId(RID_OUTLINE_TOOLBOX) );
    SFX_CHILDWINDOW_REGISTRATION( SfxTemplateDialogWrapper::GetChildWindowId() );
    SFX_CHILDWINDOW_REGISTRATION( SvxHyperlinkDlgWrapper::GetChildWindowId() );
    SFX_CHILDWINDOW_REGISTRATION( SdPreviewChildWindow::GetChildWindowId() );
    SFX_CHILDWINDOW_REGISTRATION( SvxHlinkDlgWrapper::GetChildWindowId() );
}

SFX_IMPL_VIEWFACTORY(SdOutlineViewShell, SdResId(STR_SPECIALVIEW) )
{
    SFX_VIEW_REGISTRATION(SdDrawDocShell);
}

TYPEINIT1( SdOutlineViewShell, SdViewShell );


/*************************************************************************
|*
|* gemeinsamer Initialiserungsanteil der beiden Konstruktoren
|*
\************************************************************************/

void SdOutlineViewShell::Construct(SdDrawDocShell* pDocSh)
{
    BOOL bModified = pDoc->IsChanged();

    Size aViewSize(Size(29700, 21000));
    Point aWinPos (0, 0);
    Point aViewOrigin(0, 0);
    aOutlineBtn.Check(TRUE);
    pWindow->SetMinZoomAutoCalc(FALSE);
    pWindow->SetMinZoom( MIN_ZOOM );
    pWindow->SetMaxZoom( MAX_ZOOM );
    InitWindows(aViewOrigin, aViewSize, aWinPos);
    pOlView = new SdOutlineView(pDocSh, pWindow, this);
    pView = pOlView;             // Pointer der Basisklasse SdViewShell

    SetPool( &pDoc->GetPool() );

    SetZoom(69);

    // create uno view
    pController = new SdUnoOutlineView(pView, this);

    uno::Reference< awt::XWindow > aTmpRef;
    GetViewFrame()->GetFrame()->GetFrameInterface()->setComponent( aTmpRef, pController );


    // Shells fuer Object Bars erzeugen
    SfxShell* pObjBarShell = new SdDrawTextObjectBar( this, pDoc->GetPool(), pOlView );
    aShellTable.Insert( RID_DRAW_TEXT_TOOLBOX, pObjBarShell );

    // ObjectBar einschalten
    SwitchObjectBar(RID_DRAW_TEXT_TOOLBOX);

    // Einstellungen der FrameView uebernehmen
    ReadFrameViewData(pFrameView);

    Outliner* pOutl = pOlView->GetOutliner();
    pOutl->SetUpdateMode(TRUE);

    if (!bModified)
    {
        pOutl->ClearModifyFlag();
    }

    pLastPage = GetActualPage();

    String aName( RTL_CONSTASCII_USTRINGPARAM( "OutlineViewShell" ));
    SetName (aName);

    SetHelpId( SD_IF_SDOUTLINEVIEWSHELL );
    pWindow->SetHelpId( SD_IF_SDOUTLINEVIEWSHELL );
    pWindow->SetUniqueId( SD_IF_SDOUTLINEVIEWSHELL );
}

/*************************************************************************
|*
|* Standard-Konstruktor, Fenster duerfen nicht automatisch zentrieren
|*
\************************************************************************/

SdOutlineViewShell::SdOutlineViewShell(SfxViewFrame* pFrame, SfxViewShell* pOldShell) :
    SdViewShell(pFrame, &pFrame->GetWindow(), FALSE),
    pOlView(NULL),
    pLastPage( NULL ),
    pClipEvtLstnr(NULL),
    bPastePossible(FALSE),
    pController(NULL)
{
    if (pOldShell)
    {
        pFrameView = ( (SdViewShell*) pOldShell)->GetFrameView();
    }
    else
    {
        pFrameView = new FrameView(pDoc);
    }

    pFrameView->Connect();

    Construct(pDocSh);

    // Editierfunktion starten
    SfxRequest aReq( SID_EDIT_OUTLINER, 0, pDoc->GetItemPool() );
    FuPermanent( aReq );
}


/*************************************************************************
|*
|* Copy-Konstruktor
|*
\************************************************************************/

SdOutlineViewShell::SdOutlineViewShell(SfxViewFrame* pFrame,
                                 const SdOutlineViewShell& rShell) :
    SdViewShell(pFrame, rShell),
    pOlView(NULL),
    pLastPage( NULL ),
    pClipEvtLstnr(NULL),
    bPastePossible(FALSE),
    pController(NULL)
{
    pFrameView = new FrameView(pDoc);
    pFrameView->Connect();

    Construct(pDocSh);
}

/*************************************************************************
|*
|* Destruktor
|*
\************************************************************************/

SdOutlineViewShell::~SdOutlineViewShell()
{
    if (pFuActual)
    {
        if (pFuOld == pFuActual)
            pFuOld = NULL;

        pFuActual->Deactivate();
        delete pFuActual;
        pFuActual = NULL;
    }

    if (pFuOld)
    {
        delete pFuOld;
        pFuOld = NULL;
    }

    RemoveSubShell();

    // Umschaltung der ObjectBarShells unterdruecken, sonst versucht die
    // sterbende Funktion eventuell die ObjectBars zu wechseln. Die
    // entsprechende Shell ist aber schon vom SFX vom Dispatcher-Stack
    // genommen worden.
    bObjectBarSwitchEnabled = FALSE;

    delete pOlView;

    pFrameView->Disconnect();

    if ( pClipEvtLstnr )
    {
        pClipEvtLstnr->AddRemoveListener( GetActiveWindow(), FALSE );
        pClipEvtLstnr->release();
    }
}

/*************************************************************************
|*
|* Paint-Methode: das Ereignis wird vom Fenster pWindow an
|* die Viewshell und die aktuelle Funktion weitergeleitet
|*
\************************************************************************/

void SdOutlineViewShell::Paint(const Rectangle& rRect, SdWindow* pWin)
{
    if (pOlView)
    {
        pOlView->Paint(rRect, pWin);
    }

    if (pFuActual)
    {
        pFuActual->Paint(rRect, pWin);
    }
}

/*************************************************************************
|*
|* Ersatz fuer AdjustPosSizePixel ab Sfx 248a
|*
\************************************************************************/

void SdOutlineViewShell::InnerResizePixel(const Point &rPos, const Size &rSize)
{
    SdViewShell::InnerResizePixel(rPos, rSize);
}

/*************************************************************************
|*
|* Ersatz fuer AdjustPosSizePixel ab Sfx 248a
|*
\************************************************************************/

void SdOutlineViewShell::OuterResizePixel(const Point &rPos, const Size &rSize)
{
    SdViewShell::OuterResizePixel(rPos, rSize);
}

/*************************************************************************
|*
|* View-Groesse (und Position bei OLE) aendern
|*
\************************************************************************/

void SdOutlineViewShell::AdjustPosSizePixel(const Point &rNewPos,
                                            const Size &rNewSize)
{
    SdViewShell::AdjustPosSizePixel(rNewPos, rNewSize);

    long nSizeX = rNewSize.Width() - aScrBarWH.Width();
    long nSizeY = rNewSize.Height() - aScrBarWH.Height();

    for (short nX = 0; nX < MAX_HSPLIT_CNT; nX++)
    {
        for (short nY = 0; nY < MAX_VSPLIT_CNT; nY++)
        {
            SdWindow* pWindow = pWinArray[nX][nY];

            if (pWindow)
            {
                pWindow->SetMinZoomAutoCalc(FALSE);

                // pWindow->SetPosSizePixel(rNewPos, Size(nSizeX, nSizeY));

                // OutputArea der OutlinerView aendern
                OutlinerView* pOutlinerView = pOlView->GetViewByWindow(pWindow);

                Rectangle aWin(Point(0,0), pWindow->GetOutputSizePixel());
                aWin = pWindow->PixelToLogic(aWin);
                pOutlinerView->SetOutputArea(aWin);

                Rectangle aVis = pOutlinerView->GetVisArea();

                Rectangle aText = Rectangle(Point(0,0),
                                            Size(pOlView->GetPaperWidth(),
                                                 pOlView->GetOutliner()->GetTextHeight()));
                aText.Bottom() += aWin.GetHeight();<commit_msg>#100398# Moved most functionality from AdjustPosSizePixel to new ArrangeGUIElements method.<commit_after>/*************************************************************************
 *
 *  $RCSfile: outlnvsh.cxx,v $
 *
 *  $Revision: 1.37 $
 *
 *  last change: $Author: af $ $Date: 2002-07-25 09:35:07 $
 *
 *  The Contents of this file are made available subject to the terms of
 *  either of the following licenses
 *
 *         - GNU Lesser General Public License Version 2.1
 *         - Sun Industry Standards Source License Version 1.1
 *
 *  Sun Microsystems Inc., October, 2000
 *
 *  GNU Lesser General Public License Version 2.1
 *  =============================================
 *  Copyright 2000 by Sun Microsystems, Inc.
 *  901 San Antonio Road, Palo Alto, CA 94303, USA
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License version 2.1, as published by the Free Software Foundation.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 *  MA  02111-1307  USA
 *
 *
 *  Sun Industry Standards Source License Version 1.1
 *  =================================================
 *  The contents of this file are subject to the Sun Industry Standards
 *  Source License Version 1.1 (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.openoffice.org/license.html.
 *
 *  Software provided under this License is provided on an "AS IS" basis,
 *  WITHOUT WARRANTY OF ANY KIND, EITHER EPRESSED OR IMPLIED, INCLUDING,
 *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
 *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
 *  See the License for the specific provisions governing your rights and
 *  obligations concerning the Software.
 *
 *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
 *
 *  Copyright: 2000 by Sun Microsystems, Inc.
 *
 *  All Rights Reserved.
 *
 *  Contributor(s): _______________________________________
 *
 *
 ************************************************************************/
#include "app.hrc"
#define ITEMID_HYPERLINK    SID_HYPERLINK_SETLINK
#ifndef _SVX_DLG_HYPERLINK_HXX //autogen
#include <offmgr/hyprlink.hxx>
#endif
#ifndef _SVX_TAB_HYPERLINK_HXX
#include <svx/hyperdlg.hxx>
#endif

#ifndef _SOT_EXCHANGE_HXX //autogen
#include <sot/exchange.hxx>
#endif
#ifndef _SVX_RULE_HXX //autogen
#include <svx/ruler.hxx>
#endif
#ifndef _SVX_ZOOMITEM_HXX //autogen
#include <svx/zoomitem.hxx>
#endif
#ifndef _EEITEM_HXX //autogen
#include <svx/eeitem.hxx>
#endif
#define ITEMID_FIELD    EE_FEATURE_FIELD
#ifndef _SVX_FLDITEM_HXX //autogen
#include <svx/flditem.hxx>
#endif
#ifndef _SFX_SHELL_HXX //autogen
#include <sfx2/shell.hxx>
#endif
#ifndef _SFX_TEMPLDLG_HXX //autogen
#include <sfx2/templdlg.hxx>
#endif
#ifndef _VIEWFAC_HXX //autogen
#include <sfx2/viewfac.hxx>
#endif
#ifndef _SFXREQUEST_HXX //autogen
#include <sfx2/request.hxx>
#endif
#ifndef _SVX_HLNKITEM_HXX //autogen
#include <svx/hlnkitem.hxx>
#endif
#ifndef _SVDOTEXT_HXX //autogen
#include <svx/svdotext.hxx>
#endif
#ifndef _SFXDISPATCH_HXX //autogen
#include <sfx2/dispatch.hxx>
#endif
#ifndef _SV_SCRBAR_HXX //autogen
#include <vcl/scrbar.hxx>
#endif
#ifndef _SFX_WHITER_HXX //autogen
#include <svtools/whiter.hxx>
#endif
#ifndef _EDITSTAT_HXX //autogen
#include <svx/editstat.hxx>
#endif
#ifndef _SFXITEMPOOL_HXX //autogen
#include <svtools/itempool.hxx>
#endif
#ifndef _SFX_TPLPITEM_HXX //autogen
#include <sfx2/tplpitem.hxx>
#endif
#ifndef _SVDORECT_HXX //autogen
#include <svx/svdorect.hxx>
#endif
#ifndef _SOT_FORMATS_HXX //autogen
#include <sot/formats.hxx>
#endif
#ifndef _SFX_TOPFRM_HXX //autogen wg. SfxTopViewFrame
#include <sfx2/topfrm.hxx>
#endif
#ifndef _COM_SUN_STAR_LINGUISTIC2_XTHESAURUS_HPP_
#include <com/sun/star/linguistic2/XThesaurus.hpp>
#endif
#ifndef _COM_SUN_STAR_I18N_TRANSLITERATIONMODULES_HDL_
#include <com/sun/star/i18n/TransliterationModules.hdl>
#endif
#ifndef _UNO_LINGU_HXX
#include <svx/unolingu.hxx>
#endif
#ifndef _COMPHELPER_PROCESSFACTORY_HXX_
#include <comphelper/processfactory.hxx>
#endif
#ifndef _OUTLOBJ_HXX
#include <svx/outlobj.hxx>
#endif
#ifndef _SVTOOLS_CJKOPTIONS_HXX
#include <svtools/cjkoptions.hxx>
#endif
#ifndef _CLIPLISTENER_HXX
#include <svtools/cliplistener.hxx>
#endif

#ifndef _SD_OPTSITEM_HXX
#include "optsitem.hxx"
#endif

#include "strings.hrc"
#include "glob.hrc"
#include "res_bmp.hrc"

#include "sdoutl.hxx"
#include "sdwindow.hxx"
#include "drtxtob.hxx"
#include "drawdoc.hxx"
#include "outlnvsh.hxx"
#include "sdresid.hxx"
#include "sdpage.hxx"
#include "fuoltext.hxx"
#include "frmview.hxx"
#include "zoomlist.hxx"
#include "stlsheet.hxx"
#include "preview.hxx"
#include "prevchld.hxx"
#include "fuslshow.hxx"
#include "SdUnoOutlineView.hxx"

#ifndef _SD_ACCESSIBILITY_ACCESSIBLE_OUTLINE_VIEW_HXX
#include "AccessibleOutlineView.hxx"
#endif

using namespace ::rtl;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::linguistic2;

#define MIN_ZOOM           10       // Minimaler Zoomfaktor
#define MAX_ZOOM         1000       // Maximaler Zoomfaktor

/************************************************************************/


/*************************************************************************
|*
|* SFX-Slotmap und Standardinterface deklarieren
|*
\************************************************************************/

SFX_DECL_TYPE(13);

#define SdOutlineViewShell
#include "sdslots.hxx"

SFX_IMPL_INTERFACE(SdOutlineViewShell, SfxViewShell, SdResId(STR_OUTLINEVIEWSHELL))
{
    SFX_POPUPMENU_REGISTRATION( SdResId(RID_OUTLINE_POPUP) );
    SFX_OBJECTBAR_REGISTRATION( SFX_OBJECTBAR_TOOLS | SFX_VISIBILITY_STANDARD |
                                SFX_VISIBILITY_FULLSCREEN | SFX_VISIBILITY_SERVER,
                                SdResId(RID_OUTLINE_TOOLBOX) );
    SFX_CHILDWINDOW_REGISTRATION( SfxTemplateDialogWrapper::GetChildWindowId() );
    SFX_CHILDWINDOW_REGISTRATION( SvxHyperlinkDlgWrapper::GetChildWindowId() );
    SFX_CHILDWINDOW_REGISTRATION( SdPreviewChildWindow::GetChildWindowId() );
    SFX_CHILDWINDOW_REGISTRATION( SvxHlinkDlgWrapper::GetChildWindowId() );
}

SFX_IMPL_VIEWFACTORY(SdOutlineViewShell, SdResId(STR_SPECIALVIEW) )
{
    SFX_VIEW_REGISTRATION(SdDrawDocShell);
}

TYPEINIT1( SdOutlineViewShell, SdViewShell );


/*************************************************************************
|*
|* gemeinsamer Initialiserungsanteil der beiden Konstruktoren
|*
\************************************************************************/

void SdOutlineViewShell::Construct(SdDrawDocShell* pDocSh)
{
    BOOL bModified = pDoc->IsChanged();

    Size aViewSize(Size(29700, 21000));
    Point aWinPos (0, 0);
    Point aViewOrigin(0, 0);
    aOutlineBtn.Check(TRUE);
    pWindow->SetMinZoomAutoCalc(FALSE);
    pWindow->SetMinZoom( MIN_ZOOM );
    pWindow->SetMaxZoom( MAX_ZOOM );
    InitWindows(aViewOrigin, aViewSize, aWinPos);
    pOlView = new SdOutlineView(pDocSh, pWindow, this);
    pView = pOlView;             // Pointer der Basisklasse SdViewShell

    SetPool( &pDoc->GetPool() );

    SetZoom(69);

    // create uno view
    pController = new SdUnoOutlineView(pView, this);

    uno::Reference< awt::XWindow > aTmpRef;
    GetViewFrame()->GetFrame()->GetFrameInterface()->setComponent( aTmpRef, pController );


    // Shells fuer Object Bars erzeugen
    SfxShell* pObjBarShell = new SdDrawTextObjectBar( this, pDoc->GetPool(), pOlView );
    aShellTable.Insert( RID_DRAW_TEXT_TOOLBOX, pObjBarShell );

    // ObjectBar einschalten
    SwitchObjectBar(RID_DRAW_TEXT_TOOLBOX);

    // Einstellungen der FrameView uebernehmen
    ReadFrameViewData(pFrameView);

    Outliner* pOutl = pOlView->GetOutliner();
    pOutl->SetUpdateMode(TRUE);

    if (!bModified)
    {
        pOutl->ClearModifyFlag();
    }

    pLastPage = GetActualPage();

    String aName( RTL_CONSTASCII_USTRINGPARAM( "OutlineViewShell" ));
    SetName (aName);

    SetHelpId( SD_IF_SDOUTLINEVIEWSHELL );
    pWindow->SetHelpId( SD_IF_SDOUTLINEVIEWSHELL );
    pWindow->SetUniqueId( SD_IF_SDOUTLINEVIEWSHELL );
}

/*************************************************************************
|*
|* Standard-Konstruktor, Fenster duerfen nicht automatisch zentrieren
|*
\************************************************************************/

SdOutlineViewShell::SdOutlineViewShell(SfxViewFrame* pFrame, SfxViewShell* pOldShell) :
    SdViewShell(pFrame, &pFrame->GetWindow(), FALSE),
    pOlView(NULL),
    pLastPage( NULL ),
    pClipEvtLstnr(NULL),
    bPastePossible(FALSE),
    pController(NULL)
{
    if (pOldShell)
    {
        pFrameView = ( (SdViewShell*) pOldShell)->GetFrameView();
    }
    else
    {
        pFrameView = new FrameView(pDoc);
    }

    pFrameView->Connect();

    Construct(pDocSh);

    // Editierfunktion starten
    SfxRequest aReq( SID_EDIT_OUTLINER, 0, pDoc->GetItemPool() );
    FuPermanent( aReq );
}


/*************************************************************************
|*
|* Copy-Konstruktor
|*
\************************************************************************/

SdOutlineViewShell::SdOutlineViewShell(SfxViewFrame* pFrame,
                                 const SdOutlineViewShell& rShell) :
    SdViewShell(pFrame, rShell),
    pOlView(NULL),
    pLastPage( NULL ),
    pClipEvtLstnr(NULL),
    bPastePossible(FALSE),
    pController(NULL)
{
    pFrameView = new FrameView(pDoc);
    pFrameView->Connect();

    Construct(pDocSh);
}

/*************************************************************************
|*
|* Destruktor
|*
\************************************************************************/

SdOutlineViewShell::~SdOutlineViewShell()
{
    if (pFuActual)
    {
        if (pFuOld == pFuActual)
            pFuOld = NULL;

        pFuActual->Deactivate();
        delete pFuActual;
        pFuActual = NULL;
    }

    if (pFuOld)
    {
        delete pFuOld;
        pFuOld = NULL;
    }

    RemoveSubShell();

    // Umschaltung der ObjectBarShells unterdruecken, sonst versucht die
    // sterbende Funktion eventuell die ObjectBars zu wechseln. Die
    // entsprechende Shell ist aber schon vom SFX vom Dispatcher-Stack
    // genommen worden.
    bObjectBarSwitchEnabled = FALSE;

    delete pOlView;

    pFrameView->Disconnect();

    if ( pClipEvtLstnr )
    {
        pClipEvtLstnr->AddRemoveListener( GetActiveWindow(), FALSE );
        pClipEvtLstnr->release();
    }
}

/*************************************************************************
|*
|* Paint-Methode: das Ereignis wird vom Fenster pWindow an
|* die Viewshell und die aktuelle Funktion weitergeleitet
|*
\************************************************************************/

void SdOutlineViewShell::Paint(const Rectangle& rRect, SdWindow* pWin)
{
    if (pOlView)
    {
        pOlView->Paint(rRect, pWin);
    }

    if (pFuActual)
    {
        pFuActual->Paint(rRect, pWin);
    }
}

/*************************************************************************
|*
|* Ersatz fuer AdjustPosSizePixel ab Sfx 248a
|*
\************************************************************************/

void SdOutlineViewShell::InnerResizePixel(const Point &rPos, const Size &rSize)
{
    SdViewShell::InnerResizePixel(rPos, rSize);
}

/*************************************************************************
|*
|* Ersatz fuer AdjustPosSizePixel ab Sfx 248a
|*
\************************************************************************/

void SdOutlineViewShell::OuterResizePixel(const Point &rPos, const Size &rSize)
{
    SdViewShell::OuterResizePixel(rPos, rSize);
}


/** This call is simply delegated to the base class.
*/
void SdOutlineViewShell::AdjustPosSizePixel(const Point &rNewPos,
                                            const Size &rNewSize)
{
    SdViewShell::AdjustPosSizePixel (rNewPos, rNewSize);
}


void SdOutlineViewShell::ArrangeGUIElements ()
{
    // Retrieve the current size (thickness) of the scroll bars.  That is
    // the width of the vertical and the height of the horizontal scroll
    // bar.
    int nScrollBarSize = GetViewFrame()->GetWindow().GetSettings().GetStyleSettings().GetScrollBarSize();
    aScrBarWH = Size (nScrollBarSize, nScrollBarSize);

    SdViewShell::ArrangeGUIElements ();

    long nSizeX = aViewSize.Width() - aScrBarWH.Width();
    long nSizeY = aViewSize.Height() - aScrBarWH.Height();

    for (short nX = 0; nX < MAX_HSPLIT_CNT; nX++)
    {
        for (short nY = 0; nY < MAX_VSPLIT_CNT; nY++)
        {
            SdWindow* pWindow = pWinArray[nX][nY];

            if (pWindow)
            {
                pWindow->SetMinZoomAutoCalc(FALSE);

                // pWindow->SetPosSizePixel(rNewPos, Size(nSizeX, nSizeY));

                // OutputArea der OutlinerView aendern
                OutlinerView* pOutlinerView = pOlView->GetViewByWindow(pWindow);

                Rectangle aWin(Point(0,0), pWindow->GetOutputSizePixel());
                aWin = pWindow->PixelToLogic(aWin);
                pOutlinerView->SetOutputArea(aWin);

                Rectangle aVis = pOutlinerView->GetVisArea();

                Rectangle aText = Rectangle(Point(0,0),
                                            Size(pOlView->GetPaperWidth(),
                                                 pOlView->GetOutliner()->GetTextHeight()));
                aText.Bottom() += aWin.GetHeight();
{'fraction_non_alphanumeric': 0.206411514556755, 'fraction_numerical': 0.008577763239196016, 'mean_word_length': 4.175696012039127, 'pattern_counts': {'":': 0, '<': 67, '<?xml version=': 0, '>': 134, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '902464', 'n_tokens_mistral': 9432, 'n_tokens_neox': 8876, 'n_words': 1896}