[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Fri Jul 30 18:36:22 UTC 2021


 include/vcl/ctrl.hxx                  |    6 +-
 include/vcl/toolkit/controllayout.hxx |    2 
 vcl/inc/controldata.hxx               |   38 --------------
 vcl/inc/pch/precompiled_vcl.hxx       |    1 
 vcl/source/control/button.cxx         |    8 +-
 vcl/source/control/combobox.cxx       |    4 -
 vcl/source/control/ctrl.cxx           |   91 ++++++++++++++++------------------
 vcl/source/control/edit.cxx           |    4 -
 vcl/source/control/fixed.cxx          |   12 ++--
 vcl/source/control/imp_listbox.cxx    |   10 +--
 vcl/source/control/listbox.cxx        |    4 -
 vcl/source/control/spinfld.cxx        |    4 -
 vcl/source/control/tabctrl.cxx        |   11 +---
 vcl/source/toolkit/group.cxx          |    9 +--
 14 files changed, 80 insertions(+), 124 deletions(-)

New commits:
commit 942dcd6d8684ffdbc9bc67030c502e9db1965eb5
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Thu Jul 29 19:54:05 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Jul 30 20:35:46 2021 +0200

    flatten vcl::ImplControlData
    
    the struct is already visible in the headers, so it's not a pimpl
    pattern, and it's only two pointers, so no point in allocating
    separately.
    
    The tdf#91081 bug comment I removed is no longer relevant,
    this general class of problem was solved with the introduction
    of VclPtr.
    
    Change-Id: Ie5d896baf0167273f8936930dd65891919c5bf7e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119679
    Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/vcl/ctrl.hxx b/include/vcl/ctrl.hxx
index 90fd8b7684b8..cde59c6f9e0f 100644
--- a/include/vcl/ctrl.hxx
+++ b/include/vcl/ctrl.hxx
@@ -26,14 +26,14 @@
 #include <memory>
 
 // forward
-namespace vcl { struct ImplControlData; }
 class StyleSettings;
-
+namespace vcl { struct ControlLayoutData; }
 
 class VCL_DLLPUBLIC Control : public vcl::Window
 {
 protected:
-    std::unique_ptr<vcl::ImplControlData> mpControlData;
+    mutable std::unique_ptr<vcl::ControlLayoutData>  mpLayoutData;
+    VclPtr<OutputDevice>        mpReferenceDevice;
 
 private:
     bool                    mbHasControlFocus;
diff --git a/include/vcl/toolkit/controllayout.hxx b/include/vcl/toolkit/controllayout.hxx
index d47514460fe9..44b721c17dab 100644
--- a/include/vcl/toolkit/controllayout.hxx
+++ b/include/vcl/toolkit/controllayout.hxx
@@ -29,6 +29,8 @@
 #include <vcl/ctrl.hxx>
 #include <vcl/dllapi.h>
 
+class Control;
+
 namespace vcl
 {
 
diff --git a/vcl/inc/controldata.hxx b/vcl/inc/controldata.hxx
deleted file mode 100644
index ed6e3a368967..000000000000
--- a/vcl/inc/controldata.hxx
+++ /dev/null
@@ -1,38 +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_VCL_INC_CONTROLDATA_HXX
-#define INCLUDED_VCL_INC_CONTROLDATA_HXX
-
-#include <memory>
-#include <vcl/toolkit/controllayout.hxx>
-
-namespace vcl
-{
-    struct ImplControlData
-    {
-        mutable std::unique_ptr<ControlLayoutData>  mpLayoutData;
-        VclPtr<OutputDevice>        mpReferenceDevice;
-    };
-
-} // namespace vcl
-
-#endif // INCLUDED_VCL_INC_CONTROLDATA_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/pch/precompiled_vcl.hxx b/vcl/inc/pch/precompiled_vcl.hxx
index ea6ad604224d..a7ef0ce02759 100644
--- a/vcl/inc/pch/precompiled_vcl.hxx
+++ b/vcl/inc/pch/precompiled_vcl.hxx
@@ -254,7 +254,6 @@
 #include <PhysicalFontFace.hxx>
 #include <brdwin.hxx>
 #include <configsettings.hxx>
-#include <controldata.hxx>
 #include <fontattributes.hxx>
 #include <impglyphitem.hxx>
 #include <outdev.h>
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index ac867a292533..68b368b56c0e 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -27,6 +27,7 @@
 #include <vcl/event.hxx>
 #include <vcl/svapp.hxx>
 #include <vcl/settings.hxx>
+#include <vcl/toolkit/controllayout.hxx>
 #include <vcl/toolkit/dialog.hxx>
 #include <vcl/toolkit/fixed.hxx>
 #include <vcl/toolkit/button.hxx>
@@ -39,7 +40,6 @@
 #include <bitmaps.hlst>
 #include <svdata.hxx>
 #include <window.h>
-#include <controldata.hxx>
 #include <vclstatuslistener.hxx>
 #include <osl/diagnose.h>
 
@@ -1340,7 +1340,7 @@ void PushButton::KeyUp( const KeyEvent& rKEvt )
 
 void PushButton::FillLayoutData() const
 {
-    mpControlData->mpLayoutData.reset( new vcl::ControlLayoutData );
+    mpLayoutData.reset( new vcl::ControlLayoutData );
     const_cast<PushButton*>(this)->Invalidate();
 }
 
@@ -2435,7 +2435,7 @@ void RadioButton::KeyUp( const KeyEvent& rKEvt )
 
 void RadioButton::FillLayoutData() const
 {
-    mpControlData->mpLayoutData.reset( new vcl::ControlLayoutData );
+    mpLayoutData.reset( new vcl::ControlLayoutData );
     const_cast<RadioButton*>(this)->Invalidate();
 }
 
@@ -3249,7 +3249,7 @@ void CheckBox::KeyUp( const KeyEvent& rKEvt )
 
 void CheckBox::FillLayoutData() const
 {
-    mpControlData->mpLayoutData.reset( new vcl::ControlLayoutData );
+    mpLayoutData.reset( new vcl::ControlLayoutData );
     const_cast<CheckBox*>(this)->Invalidate();
 }
 
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index cc4ca5465a63..85b418a14f86 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -22,6 +22,7 @@
 #include <set>
 
 #include <comphelper/string.hxx>
+#include <vcl/toolkit/controllayout.hxx>
 #include <vcl/toolkit/lstbox.hxx>
 #include <vcl/builder.hxx>
 #include <vcl/commandevent.hxx>
@@ -32,7 +33,6 @@
 #include <sal/log.hxx>
 
 #include <listbox.hxx>
-#include <controldata.hxx>
 #include <comphelper/lok.hxx>
 #include <tools/json_writer.hxx>
 
@@ -607,7 +607,7 @@ bool ComboBox::IsDropDownBox() const { return m_pImpl->m_pFloatWin != nullptr; }
 
 void ComboBox::FillLayoutData() const
 {
-    mpControlData->mpLayoutData.reset( new vcl::ControlLayoutData );
+    mpLayoutData.reset( new vcl::ControlLayoutData );
     AppendLayoutData( *m_pImpl->m_pSubEdit );
     m_pImpl->m_pSubEdit->SetLayoutDataParent( this );
     ImplListBoxWindow* rMainWindow = GetMainWindow();
diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx
index c7dba808975a..28af923cb168 100644
--- a/vcl/source/control/ctrl.cxx
+++ b/vcl/source/control/ctrl.cxx
@@ -23,11 +23,11 @@
 #include <vcl/decoview.hxx>
 #include <vcl/settings.hxx>
 #include <vcl/uitest/logger.hxx>
+#include <vcl/toolkit/controllayout.hxx>
 #include <sal/log.hxx>
 
 #include <textlayout.hxx>
 #include <svdata.hxx>
-#include <controldata.hxx>
 
 using namespace vcl;
 
@@ -35,7 +35,6 @@ void Control::ImplInitControlData()
 {
     mbHasControlFocus       = false;
     mbShowAccelerator       = false;
-    mpControlData.reset(new ImplControlData);
 }
 
 Control::Control( WindowType nType ) :
@@ -58,7 +57,8 @@ Control::~Control()
 
 void Control::dispose()
 {
-    mpControlData.reset();
+    mpLayoutData.reset();
+    mpReferenceDevice.clear();
     Window::dispose();
 }
 
@@ -83,13 +83,13 @@ void Control::FillLayoutData() const
 
 void Control::CreateLayoutData() const
 {
-    SAL_WARN_IF( mpControlData->mpLayoutData, "vcl", "Control::CreateLayoutData: should be called with non-existent layout data only!" );
-    mpControlData->mpLayoutData.reset( new vcl::ControlLayoutData );
+    SAL_WARN_IF( mpLayoutData, "vcl", "Control::CreateLayoutData: should be called with non-existent layout data only!" );
+    mpLayoutData.reset( new vcl::ControlLayoutData );
 }
 
 bool Control::HasLayoutData() const
 {
-    return mpControlData && mpControlData->mpLayoutData != nullptr;
+    return mpLayoutData != nullptr;
 }
 
 void Control::SetText( const OUString& rStr )
@@ -111,7 +111,7 @@ tools::Rectangle Control::GetCharacterBounds( tools::Long nIndex ) const
 {
     if( !HasLayoutData() )
         FillLayoutData();
-    return mpControlData->mpLayoutData ? mpControlData->mpLayoutData->GetCharacterBounds( nIndex ) : tools::Rectangle();
+    return mpLayoutData ? mpLayoutData->GetCharacterBounds( nIndex ) : tools::Rectangle();
 }
 
 tools::Long ControlLayoutData::GetIndexForPoint( const Point& rPoint ) const
@@ -135,7 +135,7 @@ tools::Long Control::GetIndexForPoint( const Point& rPoint ) const
 {
     if( ! HasLayoutData() )
         FillLayoutData();
-    return mpControlData->mpLayoutData ? mpControlData->mpLayoutData->GetIndexForPoint( rPoint ) : -1;
+    return mpLayoutData ? mpLayoutData->GetIndexForPoint( rPoint ) : -1;
 }
 
 tools::Long ControlLayoutData::GetLineCount() const
@@ -173,7 +173,7 @@ Pair Control::GetLineStartEnd( tools::Long nLine ) const
 {
     if( !HasLayoutData() )
         FillLayoutData();
-    return mpControlData->mpLayoutData ? mpControlData->mpLayoutData->GetLineStartEnd( nLine ) : Pair( -1, -1 );
+    return mpLayoutData ? mpLayoutData->GetLineStartEnd( nLine ) : Pair( -1, -1 );
 }
 
 tools::Long ControlLayoutData::ToRelativeLineIndex( tools::Long nIndex ) const
@@ -212,47 +212,43 @@ tools::Long Control::ToRelativeLineIndex( tools::Long nIndex ) const
 {
     if( !HasLayoutData() )
         FillLayoutData();
-    return mpControlData->mpLayoutData ? mpControlData->mpLayoutData->ToRelativeLineIndex( nIndex ) : -1;
+    return mpLayoutData ? mpLayoutData->ToRelativeLineIndex( nIndex ) : -1;
 }
 
 OUString Control::GetDisplayText() const
 {
     if( !HasLayoutData() )
         FillLayoutData();
-    return mpControlData->mpLayoutData ? mpControlData->mpLayoutData->m_aDisplayText : GetText();
+    return mpLayoutData ? mpLayoutData->m_aDisplayText : GetText();
 }
 
 bool Control::EventNotify( NotifyEvent& rNEvt )
 {
-    // tdf#91081 if control is not valid, skip the emission - chaining to the parent
-    if (mpControlData)
+    if ( rNEvt.GetType() == MouseNotifyEvent::GETFOCUS )
     {
-        if ( rNEvt.GetType() == MouseNotifyEvent::GETFOCUS )
+        if ( !mbHasControlFocus )
         {
-            if ( !mbHasControlFocus )
+            mbHasControlFocus = true;
+            CompatStateChanged( StateChangedType::ControlFocus );
+            if ( ImplCallEventListenersAndHandler( VclEventId::ControlGetFocus, {} ) )
+                // been destroyed within the handler
+                return true;
+        }
+    }
+    else
+    {
+        if ( rNEvt.GetType() == MouseNotifyEvent::LOSEFOCUS )
+        {
+            vcl::Window* pFocusWin = Application::GetFocusWindow();
+            if ( !pFocusWin || !ImplIsWindowOrChild( pFocusWin ) )
             {
-                mbHasControlFocus = true;
+                mbHasControlFocus = false;
                 CompatStateChanged( StateChangedType::ControlFocus );
-                if ( ImplCallEventListenersAndHandler( VclEventId::ControlGetFocus, {} ) )
+                if ( ImplCallEventListenersAndHandler( VclEventId::ControlLoseFocus, [this] () { maLoseFocusHdl.Call(*this); } ) )
                     // been destroyed within the handler
                     return true;
             }
         }
-        else
-        {
-            if ( rNEvt.GetType() == MouseNotifyEvent::LOSEFOCUS )
-            {
-                vcl::Window* pFocusWin = Application::GetFocusWindow();
-                if ( !pFocusWin || !ImplIsWindowOrChild( pFocusWin ) )
-                {
-                    mbHasControlFocus = false;
-                    CompatStateChanged( StateChangedType::ControlFocus );
-                    if ( ImplCallEventListenersAndHandler( VclEventId::ControlLoseFocus, [this] () { maLoseFocusHdl.Call(*this); } ) )
-                        // been destroyed within the handler
-                        return true;
-                }
-            }
-        }
     }
     return Window::EventNotify( rNEvt );
 }
@@ -274,23 +270,23 @@ void Control::AppendLayoutData( const Control& rSubControl ) const
 {
     if( !rSubControl.HasLayoutData() )
         rSubControl.FillLayoutData();
-    if( !rSubControl.HasLayoutData() || rSubControl.mpControlData->mpLayoutData->m_aDisplayText.isEmpty() )
+    if( !rSubControl.HasLayoutData() || rSubControl.mpLayoutData->m_aDisplayText.isEmpty() )
         return;
 
-    tools::Long nCurrentIndex = mpControlData->mpLayoutData->m_aDisplayText.getLength();
-    mpControlData->mpLayoutData->m_aDisplayText += rSubControl.mpControlData->mpLayoutData->m_aDisplayText;
-    int nLines = rSubControl.mpControlData->mpLayoutData->m_aLineIndices.size();
+    tools::Long nCurrentIndex = mpLayoutData->m_aDisplayText.getLength();
+    mpLayoutData->m_aDisplayText += rSubControl.mpLayoutData->m_aDisplayText;
+    int nLines = rSubControl.mpLayoutData->m_aLineIndices.size();
     int n;
-    mpControlData->mpLayoutData->m_aLineIndices.push_back( nCurrentIndex );
+    mpLayoutData->m_aLineIndices.push_back( nCurrentIndex );
     for( n = 1; n < nLines; n++ )
-        mpControlData->mpLayoutData->m_aLineIndices.push_back( rSubControl.mpControlData->mpLayoutData->m_aLineIndices[n] + nCurrentIndex );
-    int nRectangles = rSubControl.mpControlData->mpLayoutData->m_aUnicodeBoundRects.size();
+        mpLayoutData->m_aLineIndices.push_back( rSubControl.mpLayoutData->m_aLineIndices[n] + nCurrentIndex );
+    int nRectangles = rSubControl.mpLayoutData->m_aUnicodeBoundRects.size();
     tools::Rectangle aRel = rSubControl.GetWindowExtentsRelative(this);
     for( n = 0; n < nRectangles; n++ )
     {
-        tools::Rectangle aRect = rSubControl.mpControlData->mpLayoutData->m_aUnicodeBoundRects[n];
+        tools::Rectangle aRect = rSubControl.mpLayoutData->m_aUnicodeBoundRects[n];
         aRect.Move( aRel.Left(), aRel.Top() );
-        mpControlData->mpLayoutData->m_aUnicodeBoundRects.push_back( aRect );
+        mpLayoutData->m_aUnicodeBoundRects.push_back( aRect );
     }
 }
 
@@ -324,13 +320,12 @@ bool Control::ImplCallEventListenersAndHandler( VclEventId nEvent, std::function
 void Control::SetLayoutDataParent( const Control* pParent ) const
 {
     if( HasLayoutData() )
-        mpControlData->mpLayoutData->m_pParent = pParent;
+        mpLayoutData->m_pParent = pParent;
 }
 
 void Control::ImplClearLayoutData() const
 {
-    if (mpControlData)
-        mpControlData->mpLayoutData.reset();
+    mpLayoutData.reset();
 }
 
 void Control::ImplDrawFrame( OutputDevice* pDev, tools::Rectangle& rRect )
@@ -379,10 +374,10 @@ Size Control::GetOptimalSize() const
 
 void Control::SetReferenceDevice( OutputDevice* _referenceDevice )
 {
-    if ( mpControlData->mpReferenceDevice == _referenceDevice )
+    if ( mpReferenceDevice == _referenceDevice )
         return;
 
-    mpControlData->mpReferenceDevice = _referenceDevice;
+    mpReferenceDevice = _referenceDevice;
     Invalidate();
 }
 
@@ -397,12 +392,12 @@ OutputDevice* Control::GetReferenceDevice() const
     // inside Control::SetReferenceDevice and Control::GetReferenceDevice().
     // Control::GetReferenceDevice() will now reset mpReferenceDevice if it is already
     // disposed. This way all usages will do a kind of 'test-and-get' call.
-    if(nullptr != mpControlData->mpReferenceDevice && mpControlData->mpReferenceDevice->isDisposed())
+    if(nullptr != mpReferenceDevice && mpReferenceDevice->isDisposed())
     {
         const_cast<Control*>(this)->SetReferenceDevice(nullptr);
     }
 
-    return mpControlData->mpReferenceDevice;
+    return mpReferenceDevice;
 }
 
 const vcl::Font& Control::GetCanonicalFont( const StyleSettings& _rStyle ) const
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 395c52587de8..4b6adef6bce7 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -21,6 +21,7 @@
 #include <vcl/event.hxx>
 #include <vcl/cursor.hxx>
 #include <vcl/menu.hxx>
+#include <vcl/toolkit/controllayout.hxx>
 #include <vcl/toolkit/edit.hxx>
 #include <vcl/weld.hxx>
 #include <vcl/specialchars.hxx>
@@ -33,7 +34,6 @@
 #include <window.h>
 #include <svdata.hxx>
 #include <strings.hrc>
-#include <controldata.hxx>
 
 #include <com/sun/star/i18n/BreakIterator.hpp>
 #include <com/sun/star/i18n/CharacterIteratorMode.hpp>
@@ -1716,7 +1716,7 @@ void Edit::KeyInput( const KeyEvent& rKEvt )
 
 void Edit::FillLayoutData() const
 {
-    mpControlData->mpLayoutData.reset( new vcl::ControlLayoutData );
+    mpLayoutData.reset( new vcl::ControlLayoutData );
     const_cast<Edit*>(this)->Invalidate();
 }
 
diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx
index 6ed615dd6259..467ac69d350a 100644
--- a/vcl/source/control/fixed.cxx
+++ b/vcl/source/control/fixed.cxx
@@ -19,12 +19,12 @@
 
 #include <vcl/decoview.hxx>
 #include <vcl/event.hxx>
+#include <vcl/toolkit/controllayout.hxx>
 #include <vcl/toolkit/fixed.hxx>
 #include <vcl/settings.hxx>
 
 #include <comphelper/string.hxx>
 #include <sal/log.hxx>
-#include <controldata.hxx>
 #include <tools/json_writer.hxx>
 
 #define FIXEDLINE_TEXT_BORDER    4
@@ -153,12 +153,12 @@ void FixedText::ImplDraw(OutputDevice* pDev, DrawFlags nDrawFlags,
         nTextStyle |= DrawTextFlags::Mono;
 
     if( bFillLayout )
-        mpControlData->mpLayoutData->m_aDisplayText.clear();
+        mpLayoutData->m_aDisplayText.clear();
 
     const tools::Rectangle aRect(aPos, rSize);
     DrawControlText(*pDev, aRect, aText, nTextStyle,
-        bFillLayout ? &mpControlData->mpLayoutData->m_aUnicodeBoundRects : nullptr,
-        bFillLayout ? &mpControlData->mpLayoutData->m_aDisplayText : nullptr);
+        bFillLayout ? &mpLayoutData->m_aUnicodeBoundRects : nullptr,
+        bFillLayout ? &mpLayoutData->m_aDisplayText : nullptr);
 }
 
 void FixedText::ApplySettings(vcl::RenderContext& rRenderContext)
@@ -348,7 +348,7 @@ Size FixedText::GetOptimalSize() const
 
 void FixedText::FillLayoutData() const
 {
-    mpControlData->mpLayoutData.reset( new vcl::ControlLayoutData );
+    mpLayoutData.reset( new vcl::ControlLayoutData );
     ImplDraw(const_cast<FixedText*>(this)->GetOutDev(), DrawFlags::NONE, Point(), GetOutputSizePixel(), true);
     //const_cast<FixedText*>(this)->Invalidate();
 }
@@ -553,7 +553,7 @@ FixedLine::FixedLine( vcl::Window* pParent, WinBits nStyle ) :
 
 void FixedLine::FillLayoutData() const
 {
-    mpControlData->mpLayoutData.reset( new vcl::ControlLayoutData );
+    mpLayoutData.reset( new vcl::ControlLayoutData );
     const_cast<FixedLine*>(this)->Invalidate();
 }
 
diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx
index 322578909b17..f3b06bf75543 100644
--- a/vcl/source/control/imp_listbox.cxx
+++ b/vcl/source/control/imp_listbox.cxx
@@ -23,12 +23,12 @@
 #include <vcl/settings.hxx>
 #include <vcl/event.hxx>
 #include <vcl/scrbar.hxx>
+#include <vcl/toolkit/controllayout.hxx>
 #include <vcl/toolkit/lstbox.hxx>
 #include <vcl/i18nhelp.hxx>
 #include <vcl/naturalsort.hxx>
 
 #include <listbox.hxx>
-#include <controldata.hxx>
 #include <svdata.hxx>
 #include <window.h>
 
@@ -1746,7 +1746,7 @@ void ImplListBoxWindow::DrawEntry(vcl::RenderContext& rRenderContext, sal_Int32
 
 void ImplListBoxWindow::FillLayoutData() const
 {
-    mpControlData->mpLayoutData.reset( new vcl::ControlLayoutData );
+    mpLayoutData.reset( new vcl::ControlLayoutData );
     const_cast<ImplListBoxWindow*>(this)->Invalidate(tools::Rectangle(Point(0, 0), GetOutDev()->GetOutputSize()));
 }
 
@@ -2497,7 +2497,7 @@ void ImplWin::MouseButtonDown( const MouseEvent& )
 
 void ImplWin::FillLayoutData() const
 {
-    mpControlData->mpLayoutData.reset( new vcl::ControlLayoutData );
+    mpLayoutData.reset( new vcl::ControlLayoutData );
     ImplWin* pThis = const_cast<ImplWin*>(this);
     pThis->ImplDraw(*pThis->GetOutDev(), true);
 }
@@ -2715,8 +2715,8 @@ void ImplWin::DrawEntry(vcl::RenderContext& rRenderContext, bool bLayout)
             aTextRect.AdjustLeft(maImage.GetSizePixel().Width() + IMG_TXT_DISTANCE );
         }
 
-        std::vector< tools::Rectangle >* pVector = bLayout ? &mpControlData->mpLayoutData->m_aUnicodeBoundRects : nullptr;
-        OUString* pDisplayText = bLayout ? &mpControlData->mpLayoutData->m_aDisplayText : nullptr;
+        std::vector< tools::Rectangle >* pVector = bLayout ? &mpLayoutData->m_aUnicodeBoundRects : nullptr;
+        OUString* pDisplayText = bLayout ? &mpLayoutData->m_aDisplayText : nullptr;
         rRenderContext.DrawText( aTextRect, maString, nTextStyle, pVector, pDisplayText );
     }
 
diff --git a/vcl/source/control/listbox.cxx b/vcl/source/control/listbox.cxx
index 444d7e899727..58987498ab81 100644
--- a/vcl/source/control/listbox.cxx
+++ b/vcl/source/control/listbox.cxx
@@ -20,13 +20,13 @@
 #include <vcl/builder.hxx>
 #include <vcl/commandevent.hxx>
 #include <vcl/event.hxx>
+#include <vcl/toolkit/controllayout.hxx>
 #include <vcl/toolkit/lstbox.hxx>
 #include <vcl/settings.hxx>
 #include <vcl/uitest/uiobject.hxx>
 #include <sal/log.hxx>
 
 #include <svdata.hxx>
-#include <controldata.hxx>
 #include <listbox.hxx>
 #include <dndeventdispatcher.hxx>
 #include <comphelper/lok.hxx>
@@ -627,7 +627,7 @@ void ListBox::Resize()
 
 void ListBox::FillLayoutData() const
 {
-    mpControlData->mpLayoutData.reset( new vcl::ControlLayoutData );
+    mpLayoutData.reset( new vcl::ControlLayoutData );
     const ImplListBoxWindow* rMainWin = mpImplLB->GetMainWindow();
     if( mpFloatWin )
     {
diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx
index faeed4062e32..af8ecbc94edf 100644
--- a/vcl/source/control/spinfld.cxx
+++ b/vcl/source/control/spinfld.cxx
@@ -20,12 +20,12 @@
 #include <vcl/commandevent.hxx>
 #include <vcl/event.hxx>
 #include <vcl/decoview.hxx>
+#include <vcl/toolkit/controllayout.hxx>
 #include <vcl/toolkit/spinfld.hxx>
 #include <vcl/settings.hxx>
 #include <vcl/uitest/uiobject.hxx>
 #include <sal/log.hxx>
 
-#include <controldata.hxx>
 #include <spin.hxx>
 #include <svdata.hxx>
 
@@ -571,7 +571,7 @@ void SpinField::FillLayoutData() const
 {
     if (mbSpin)
     {
-        mpControlData->mpLayoutData.reset( new vcl::ControlLayoutData );
+        mpLayoutData.reset( new vcl::ControlLayoutData );
         AppendLayoutData(*GetSubEdit());
         GetSubEdit()->SetLayoutDataParent(this);
     }
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index 14e2510d33d0..09c1281d63db 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -36,7 +36,6 @@
 #include <bitmaps.hlst>
 #include <tools/json_writer.hxx>
 
-#include <controldata.hxx>
 #include <svdata.hxx>
 #include <window.h>
 
@@ -2022,9 +2021,9 @@ tools::Rectangle TabControl::GetCharacterBounds( sal_uInt16 nPageId, tools::Long
         std::unordered_map< int, int >::const_iterator it = mpTabCtrlData->maLayoutPageIdToLine.find( static_cast<int>(nPageId) );
         if( it != mpTabCtrlData->maLayoutPageIdToLine.end() )
         {
-            Pair aPair = mpControlData->mpLayoutData->GetLineStartEnd( it->second );
+            Pair aPair = mpLayoutData->GetLineStartEnd( it->second );
             if( (aPair.B() - aPair.A()) >= nIndex )
-                aRet = mpControlData->mpLayoutData->GetCharacterBounds( aPair.A() + nIndex );
+                aRet = mpLayoutData->GetCharacterBounds( aPair.A() + nIndex );
         }
     }
 
@@ -2040,15 +2039,15 @@ tools::Long TabControl::GetIndexForPoint( const Point& rPoint, sal_uInt16& rPage
 
     if( HasLayoutData() )
     {
-        int nIndex = mpControlData->mpLayoutData->GetIndexForPoint( rPoint );
+        int nIndex = mpLayoutData->GetIndexForPoint( rPoint );
         if( nIndex != -1 )
         {
             // what line (->pageid) is this index in ?
-            int nLines = mpControlData->mpLayoutData->GetLineCount();
+            int nLines = mpLayoutData->GetLineCount();
             int nLine = -1;
             while( ++nLine < nLines )
             {
-                Pair aPair = mpControlData->mpLayoutData->GetLineStartEnd( nLine );
+                Pair aPair = mpLayoutData->GetLineStartEnd( nLine );
                 if( aPair.A() <= nIndex && aPair.B() >= nIndex )
                 {
                     nRet = nIndex - aPair.A();
diff --git a/vcl/source/toolkit/group.cxx b/vcl/source/toolkit/group.cxx
index 040befebbdfb..eba98f708702 100644
--- a/vcl/source/toolkit/group.cxx
+++ b/vcl/source/toolkit/group.cxx
@@ -18,11 +18,10 @@
  */
 
 #include <vcl/event.hxx>
+#include <vcl/toolkit/controllayout.hxx>
 #include <vcl/toolkit/group.hxx>
 #include <vcl/settings.hxx>
 
-#include <controldata.hxx>
-
 #define GROUP_BORDER            12
 #define GROUP_TEXT_BORDER       2
 
@@ -162,14 +161,14 @@ void GroupBox::ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags,
         }
     }
 
-    std::vector< tools::Rectangle >* pVector = bLayout ? &mpControlData->mpLayoutData->m_aUnicodeBoundRects : nullptr;
-    OUString* pDisplayText = bLayout ? &mpControlData->mpLayoutData->m_aDisplayText : nullptr;
+    std::vector< tools::Rectangle >* pVector = bLayout ? &mpLayoutData->m_aUnicodeBoundRects : nullptr;
+    OUString* pDisplayText = bLayout ? &mpLayoutData->m_aDisplayText : nullptr;
     DrawControlText( *pDev, aRect, aText, nTextStyle, pVector, pDisplayText );
 }
 
 void GroupBox::FillLayoutData() const
 {
-    mpControlData->mpLayoutData.reset( new vcl::ControlLayoutData );
+    mpLayoutData.reset( new vcl::ControlLayoutData );
     const_cast<GroupBox*>(this)->ImplDraw( const_cast<GroupBox*>(this)->GetOutDev(), DrawFlags::NONE, Point(), GetOutputSizePixel(), true );
 }
 


More information about the Libreoffice-commits mailing list