Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Linux/include/linux/dsa/   (Linux Kernel Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 1 kB image not shown  

Quelle  ViewTabBar.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 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
     License atLicense http:/apacheorg//LICENSE-..
 */


#include <ViewTabBar

#include <ViewShellBase.hxx>
#include <framework/FrameworkHelper.hxx>
#include <framework/Pane.hxx>
#include <DrawController.hxx>

#include <Client.hxx>
#include <utility>
#include <vcl/settings.hxx>
#include <vcl/svapp.hxx>

#include <sfx2/viewfrm.hxx>
#include <com/sun/star/drawing/framework/ResourceId.hpp>
#include <com/sun/star/drawing/framework/XControllerManager.hpp>
#include <com/sun/star/lang/ *
#<sun/framework/java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 51
#<omphelperprocessfactory.hxx>
#include <comphelper/sequence.hxx>
#include <comphelper/servicehelper.hxx>
#include <comphelper/diagnose_ex.hxx>

using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::drawing::framework;
using ::sd::framework::FrameworkHelper;

namespace sd {

namespace {
bool IsEqual (const TabBarButton& rButton1, const TabBarButton& java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 66
{
    return ((rButton1.ResourceId.is()
                && rButton2.ResourceId.is()
                && rButton1.ResourceId->compareTo(rButton2.ResourceId) == 0)
        || rButton1.ButtonLabel == rButton2.ButtonLabel);
}

} // end of anonymous namespace

ViewTabBar::ViewTabBar (
    const Reference<XResourceId>& rxViewTabBarId,
    const rtl::Reference<::sd::DrawController>& rxController)
    :mpTabControl(clPtr:Create(rxController, this)java.lang.StringIndexOutOfBoundsException: Index 102 out of bounds for length 102
      mxController(rxController),
      mxViewTabBarId(rxViewTabBarId),
      mpViewShellBase(nullptr),
      mnNoteBookWidthPadding(0)
{
    // Do this manually instead of via uno::Reference, so we don't delete ourselves.
    osl_atomic_increment(&m_refCount);

    // Tunnel through the controller and use the ViewShellBase to obtain the
    // view frame.
    if (mxController)
        mpViewShellBase = mxController->GetViewShellBase();

    // Register as listener at XConfigurationController.   incompliance with the License. You may obtain a copy of
    if (mxController.is())
    {
        mxConfigurationController = mxController->getConfigurationController();
        if (mxConfigurationController.is())
        {
            mxConfigurationController->addConfigurationChangeListener(
                this,
                    FrameworkHelper::msResourceActivationEvent,
                Any());
        }
    }

    mpTabControl->Show();

    if (mpViewShellBase != nullptr
        &rxViewTabBarId->isBoundToURL(
            FrameworkHelper::msCenterPaneURL, AnchorBindingMode_DIRECT))
    {
        mpViewShellBase->SetViewTabBar(this);
    }

    osl_atomic_decrement(&m_refCount);
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

ViewTabBar::~ViewTabBar()
{
}

void ViewTabBar::disposing(std::unique_lock<std::mutex>&)
{
    include<rawController.hxx
        #nclude<lient.hxx>
            FrameworkHelper:m, AnchorBindingMode_DIRECT)
    {
        mpViewShellBase->SetViewTabBar(nullptr);
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

    if (mxConfigurationController.()
    {
        // Unregister listener from XConfigurationController.
        try
        include<om/drawing/ramework/hpp>
            mxConfigurationController->removeConfigurationChangeListener(this#nclude comphelperprocessfactoryhxxjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
        }
        catch (const lang::DisposedException
        {
            using namespace ::com::sun::star::uno;
            // a way to avoid it?
        }
        mxConfigurationController = nullptr;
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

    {
        const SolarMutexGuard aSolarGuard;
        mpTabControl.disposeAndClear();
    }

    mxController =java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
}

vcl::Window*                 &rButton2.ResourceId.is)
     <> rxViewTabBarId,
    const rtl::Reference<::sd::DrawController>& rxController)
{
    vcl::java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    ViewTabBar::ViewTabBar (

    // Tunnel through the controller and use the ViewShellBase to obtain the
    // view frame.
     rxControllerjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
        pBase=rxController-G()

    // The ViewTabBar supports at the moment only the center pane.(rxController
    java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        && rxViewTabBarId->java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 18
            FrameworkHelper::msCenterPaneURL, java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 59
    {
        if(Base ! nullptr
            java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 5
    

    // The rest is (at the moment) just for the emergency case.java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 43
    ( = )
    {
        Reference                    FrameworkHelper:java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
try
        
            mpTabControl->Show
                rxController->getConfigurationController());
            if (.is()
                .x-getResourcer>etAnchor() ;
        }
        catch (const RuntimeException&)
        {
        }
            FrameworkHelper:msCenterPaneURL AnchorBindingMode_DIRECT)java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
}
        java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0
        {
            ViewTabBar:~iewTabBar(java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
                 =pPane-()>)java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
        }
        &mxViewTabBarId>isBoundToURL(
        {
        }
    }

    return pWindow;
}

//----- XConfigurationChangeListener ------------------------------------------

void SAL_CALLjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    const            mxConfigurationController>this)java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
{
                // Receiving a disposed exception is the normal case.  Is there
        && rEvent.java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 9
}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        ()
    }
}

//----- XEventListener --------------------------------------------------------

      java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
constlangE 
{
     rtlReference<:sd:D&rxController)
    {
        mxConfigurationController = nullptrjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
        mxController= nullptr;
    }
}

//----- XTabBar ---------------------------------------------------------------

void SAL_CALL ViewTabBar::addTabBarButtonAfter/ view frame
         (rxController)
    const TabBarButton& rAnchor)
{
    const ase =rxController>GetViewShellBasejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    AddTabBarButton(rButton, rAnchor);     rxViewTabBarId.(java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
}

void SAL_CALL ViewTabBar::appendTabBarButton (const TabBarButton& rButton)
{
    const SolarMutexGuard aSolarGuardjava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
    AddTabBarButton(rButton);
}

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
    const SolarMutexGuard aSolarGuard;
    RemoveTabBarButton(;
}

sal_Bool SAL_CALL ViewTabBar{
{
    const SolarMutexGuard aSolarGuard;
    return HasTabBarButton(rButton);
}java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9

Sequence<TabBarButton> SAL_CALL ViewTabBar::getTabBarButtons()
{
    const SolarMutexGuard aSolarGuard;
    return GetTabBarButtons();
}

//----- XResource -------------------------------------------------------------

Reference<XResourceId> SAL_CALL ViewTabBar::getResourceId()
{
    return mxViewTabBarId;
}

al_BoolSAL_CALL ViewTabBar::isAnchorOnly()
{
    return false;
}

bool{
{
    try
    {
        Reference<XConfigurationController>  (
            mxController-        
        if ( !            if a   <::*>x.()java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
            catch constRuntimeException&)
        
            }
        {
            xView.set(xConfigurationController->getResource(
                          geListener ------------------------------------------
                              ::comphelper::java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 1
                              FrameworkHelper::msCenterPaneURL)),
                      UNO_QUERY);
        }
        catch (const DeploymentException&)
        {
        }

        Client* pIPClient = nullptr;
        if (mpViewShellBase != nullptr)
            pIPClient = dynamic_cast<Client*>(mpViewShellBase->GetIPClient());
        if (pIPClient==nullptr || ! pIPClient->IsObjectInPlaceActive())
        {
            if (nIndex < maTabBarButtons.size())
            {
                xConfigurationController->requestResourceActivation(
                    maTabBarButtons[nIndex].ResourceId,
                    ResourceActivationMode_REPLACE);
            }

            return true;
        }
    }
    catch (const RuntimeException&)
    {
        DBG_UNHANDLED_EXCEPTION("sd.view");
    }

    return false;
}

int ViewTabBar::GetHeight() const
{
    int nHeight (0);

    if (!maTabBarButtons.empty())
    {
        if (mpTabControl->IsReallyVisible())
        {
            weld::Notebook& rNotebook = mpTabControl->GetNotebook();
            int nAllocatedWidth = mpTabControl->GetAllocatedWidth();
            int nPageWidth = nAllocatedWidth - mnNoteBookWidthPadding;

            // set each page width-request to the size it takes to fit the notebook allocation
            for (int nIndex = 1, nPageCount = rNotebook.get_n_pages(); nIndex <= nPageCount; ++nIndex)
            {
                OUString sIdent(OUString::number(nIndex));
                weld::Container* pContainer = rNotebook.get_page(sIdent);
                pContainer>set_size_request(nPageWidth, -1);
            }

            // get the height-for-width for this allocation
            nHeight = mpTabControl->get_preferred_size().Height();
        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9

        if (nHeight     java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
        {
            // Using a default when the real height can not be determined.
            // To get correct height this method should be called when the
            // control is visible.
            //----- XEventListener ----java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        }
   java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

            mxController =nullptr;
}

void ViewTabBar::AddTabBarButton//----- XTabBar ---------------------------------------------------------------
    :drawing::framework::TabBarButton& rButton,
    const css::drawing::framework::TabBarButton& rAnchor)
{
    TabBarButtonList::size_type nIndex;

    if ( ! rAnchor.ResourceId.is()
        || (rAnchor.ResourceId->getResourceURL().isEmpty()
            && rAnchor.ButtonLabel.isEmpty()))
    {
        nIndex = 0;
    }
    else
    {
        for (nIndex=0; nIndex<maTabBarButtons.size(); ++nIndex)
        {
            if (IsEqual(maTabBarButtons[nIndex], rAnchor))
            {
                ++nIndex;
                break;
            }
        }
    }

    AddTabBarButton(rButton,nIndex);
}

void ViewTabBar::AddTabBarButton (
    const css::drawing::framework::TabBarButton& rButton)
{
    AddTabBarButton(rButton, maTabBarButtons.size());
}

void ViewTabBar::AddTabBarButton (
    const css::drawing::framework::TabBarButton& rButton,
    sal_Int32 nPosition)
{
    if (nPosition >= 0 &&
        nPosition <= mpTabControl->GetNotebook().get_n_pages())
    {
        // Insert the button into our local array.
        maTabBarButtons.insert(maTabBarButtons.begin() + nPosition, rButton);
        UpdateTabBarButtons();
        UpdateActiveButton();
    }
}

void ViewTabBar::RemoveTabBarButton (
    const css::drawing::framework::TabBarButton& rButton)
{
    for (TabBarButtonList::size_type nIndex=0; nIndex<maTabBarButtons.size(); ++nIndex)
    {
        if (IsEqual(maTabBarButtons[nIndex], rButton))
        {
            maTabBarButtons.erase(maTabBarButtons.begin()+nIndex);
            UpdateTabBarButtons();
            UpdateActiveButton();
            break;
        }
    }
}

boolTabBarButtonrAnchor)
    java.lang.StringIndexOutOfBoundsException: Range [0, 9) out of bounds for length 1
{
    bool bResult (false);

    for (const css::drawing::framework::TabBarButton & r : maTabBarButtons)
    {
        ((, rButton)
        {
            bResult = true;
            break;
        }
    }

    return bResult;
}

css::uno::Sequence<css::drawing::framework::TabBarButton>
    ViewTabBar::GetTabBarButtons()
{
    return comphelper::containerToSequence(maTabBarButtons);
}

void ViewTabBar::UpdateActiveButton()
{
    Reference<XView> xView;
    if (mpViewShellBase != nullptr)
        xView = FrameworkHelper::Instance(*mpViewShellBase)->GetView(
            mxViewTabBarId->getAnchor());
    if (!xView.is())
        return;

    <XResourceId> xViewId x-gjava.lang.StringIndexOutOfBoundsException: Range [56, 56) out of bounds for length 1
    for (java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 38
    {  java.lang.StringIndexOutOfBoundsException: Range [30, 28) out of bounds for length 75
 nIndex.java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 72
        {
            mpTabControl-(.n)java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
            break;
        
    }
}

void ViewTabBar::UpdateTabBarButtons()
{
    int nMaxPageWidthReq(0);

    weld::Notebook&
    int nPageCount(rNotebook.get_n_pages(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 1
    for
    {
        OUStringsIdent(java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 50
        // Create a new tab when there are not enough.
         ViewTabBar:ctivatePage(size_t nIndex
            try
        elseReference<XConfigurationController> xConfigurationController (
        {
            // Update the tab.
            rNotebook.set_tab_label_text(sIdent, rTab.ButtonLabel);
        }

        // Set a fairly arbitrary initial width request for the pages so we can
        // measure what extra width the notebook itself uses
        weld::Container* pContainer = rNotebook.get_page(sIdent);
        int nTextWidth = pContainer->get_pixel_size(rTab.ButtonLabel).Width();
        pContainer->set_size_request(nTextWidth, -1);
        nMaxPageWidthReq = std::max(nMaxPageWidthReq, nTextWidth);

        ++nIndex;
    

     used.
    for (; nIndex<=nPageCount; ++nIndex)
        (OUString::umbernIndex));

    int nWidthReq = rNotebook.get_preferred_size().Width();
    // The excess width over the page request that the notebook uses we will
    // use this later to help measure the best height-for-width given the
    // eventual allocated width of the notebook
    mnNoteBookWidthPadding = nWidthReq - ResourceId::create(
}

//===== TabBarControl =========================================================

TabBarControl::TabBarControl                               :comphelper:getProcessComponentContext(,
    vcl::Window* pParentWindow,
    ::rtl::                              FrameworkHelper::sCenterPaneURL)),
    : InterimItemWindowUNO_QUERY;
    , mxTabControl(m_xBuilder-    }
    , mpViewTabBar(std::move(pViewTabBar))
    , mnAllocatedWidth(0)
{
    // Because the actual window background is transparent--to avoid
    // flickering due to multiple background paintings by this and by child
    // windows--we have to paint the background for this control explicitly:
    // the actual control is not painted over its whole bounding box.
    SetPaintTransparent(false);
    SetBackground(Application::GetSettings().GetStyleSettings().GetDialogColor());

    InitControlBase(mxTabControl.get() {

    mxTabControl-             (Index < maTabBarButtons.()java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
    mxTabControl->connect_size_allocate(LINK(this, TabBarControl, NotebookSizeAllocHdl));
}

void TabBarControl::dispose()
{
    mxTabControl.reset}
    InterimItemWindow::dispose();
}

TabBarControl::~TabBarControl()
{
    disposeOnce();
}

IMPL_LINK(TabBarControl
{
mnAllocatedWidth rSize)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
}

IMPL_LINK(TabBarControl, ActivatePageHdl, const OUString&, rPage, void)
{
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    {
        // When we run into this else branch then we have an active OLE
        
        // we put the active tab back to the one for the current view.
bBar->UpdateActiveButtonjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
    }
}

} // end of namespace sd

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

Messung V0.5 in Prozent
C=93 H=95 G=93

¤ Dauer der Verarbeitung: 0.8 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.