[Libreoffice-commits] .: Branch 'feature/cmclayouttrans' - vcl/inc vcl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Aug 20 02:00:49 PDT 2012


 vcl/inc/vcl/builder.hxx        |    2 -
 vcl/inc/vcl/window.hxx         |   10 ++++++++-
 vcl/source/control/button.cxx  |   45 +++++++++++++++++++++--------------------
 vcl/source/control/edit.cxx    |    7 +++---
 vcl/source/control/field.cxx   |   14 +++++++-----
 vcl/source/control/fixed.cxx   |   14 +++++++-----
 vcl/source/control/lstbox.cxx  |   14 +++++++-----
 vcl/source/control/spinfld.cxx |    2 -
 vcl/source/window/builder.cxx  |   38 ++++------------------------------
 vcl/source/window/dialog.cxx   |   19 +++++++++++------
 vcl/source/window/tabpage.cxx  |    6 +++--
 vcl/source/window/window.cxx   |   43 +++++++++++++++++++++++++++++----------
 12 files changed, 117 insertions(+), 97 deletions(-)

New commits:
commit 39b28d6d7e121f733054135e834487fdd0920561
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Aug 20 09:59:16 2012 +0100

    Keep binary resource help id on retro-fit
    
    We use our new help id for a full conversion, but for retro-fit
    we retain the old help id
    
    Change-Id: I341e72b4c01ff2350292a0947848aafeea524d45

diff --git a/vcl/inc/vcl/builder.hxx b/vcl/inc/vcl/builder.hxx
index 05c40d4..e43ac1b 100644
--- a/vcl/inc/vcl/builder.hxx
+++ b/vcl/inc/vcl/builder.hxx
@@ -183,7 +183,7 @@ public:
     VclBuilderContainer();
     virtual ~VclBuilderContainer();
     static VclBuilder* overrideResourceWithUIXML(Window *pWindow, const ResId& rResId);
-    static bool replace_buildable(Window *pParent, sal_Int32 nID, Window &rReplacement);
+    static bool replace_buildable(Window *pParent, const ResId& rResId, Window &rReplacement);
 };
 
 
diff --git a/vcl/inc/vcl/window.hxx b/vcl/inc/vcl/window.hxx
index f08ad45..0f9c8a5 100644
--- a/vcl/inc/vcl/window.hxx
+++ b/vcl/inc/vcl/window.hxx
@@ -349,6 +349,13 @@ class Dialog;
 class WindowImpl;
 class VclBuilder;
 
+struct WindowResHeader
+{
+    sal_uLong nObjMask;
+    rtl::OString aHelpId;
+    sal_uLong nRSStyle;
+};
+
 class VCL_DLLPUBLIC Window : public OutputDevice
 {
     friend class Cursor;
@@ -395,8 +402,9 @@ private:
 public:
     SAL_DLLPRIVATE void                ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSystemParentData );
     SAL_DLLPRIVATE WinBits             ImplInitRes( const ResId& rResId );
+    SAL_DLLPRIVATE WindowResHeader     ImplLoadResHeader( const ResId& rResId );
     SAL_DLLPRIVATE void                ImplLoadRes( const ResId& rResId );
-    SAL_DLLPRIVATE void                ImplWindowRes( const ResId& rResId );
+    SAL_DLLPRIVATE void                loadAndSetJustHelpID( const ResId& rResId );
     SAL_DLLPRIVATE void                ImplSetFrameParent( const Window* pParent );
     SAL_DLLPRIVATE void                ImplInsertWindow( Window* pParent );
     SAL_DLLPRIVATE void                ImplRemoveWindow( sal_Bool bRemoveFrameData );
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index b5d09f1..4c14d47 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -1206,12 +1206,13 @@ PushButton::PushButton( Window* pParent, WinBits nStyle ) :
 PushButton::PushButton( Window* pParent, const ResId& rResId ) :
     Button( WINDOW_PUSHBUTTON )
 {
-    if (VclBuilderContainer::replace_buildable(pParent, rResId.GetId(), *this))
+    rResId.SetRT( RSC_PUSHBUTTON );
+    WinBits nStyle = ImplInitRes( rResId );
+
+    if (VclBuilderContainer::replace_buildable(pParent, rResId, *this))
         return;
 
     ImplInitPushButtonData();
-    rResId.SetRT( RSC_PUSHBUTTON );
-    WinBits nStyle = ImplInitRes( rResId );
     ImplInit( pParent, nStyle );
     ImplLoadRes( rResId );
 
@@ -1761,11 +1762,12 @@ OKButton::OKButton( Window* pParent, WinBits nStyle ) :
 OKButton::OKButton( Window* pParent, const ResId& rResId ) :
     PushButton( WINDOW_OKBUTTON )
 {
-    if (VclBuilderContainer::replace_buildable(pParent, rResId.GetId(), *this))
-        return;
-
     rResId.SetRT( RSC_OKBUTTON );
     WinBits nStyle = ImplInitRes( rResId );
+
+    if (VclBuilderContainer::replace_buildable(pParent, rResId, *this))
+        return;
+
     ImplInit( pParent, nStyle );
     ImplLoadRes( rResId );
 
@@ -1784,7 +1786,6 @@ void OKButton::take_properties(Window &rOther)
 
 void OKButton::Click()
 {
-    SAL_WARN_IF(!GetClickHdl(), "vcl", "No handler installed for OKButton");
     // Ist kein Link gesetzt, dann schliesse Parent
     if ( !GetClickHdl() )
     {
@@ -1838,11 +1839,12 @@ CancelButton::CancelButton( Window* pParent, WinBits nStyle ) :
 CancelButton::CancelButton( Window* pParent, const ResId& rResId ) :
     PushButton( WINDOW_CANCELBUTTON )
 {
-    if (VclBuilderContainer::replace_buildable(pParent, rResId.GetId(), *this))
-        return;
-
     rResId.SetRT( RSC_CANCELBUTTON );
     WinBits nStyle = ImplInitRes( rResId );
+
+    if (VclBuilderContainer::replace_buildable(pParent, rResId, *this))
+        return;
+
     ImplInit( pParent, nStyle );
     ImplLoadRes( rResId );
 
@@ -1861,7 +1863,6 @@ void CancelButton::take_properties(Window &rOther)
 
 void CancelButton::Click()
 {
-    SAL_WARN_IF(!GetClickHdl(), "vcl", "No handler installed for CancelButton");
     // Ist kein Link gesetzt, dann schliesse Parent
     if ( !GetClickHdl() )
     {
@@ -1915,11 +1916,12 @@ HelpButton::HelpButton( Window* pParent, WinBits nStyle ) :
 HelpButton::HelpButton( Window* pParent, const ResId& rResId ) :
     PushButton( WINDOW_HELPBUTTON )
 {
-    if (VclBuilderContainer::replace_buildable(pParent, rResId.GetId(), *this))
-        return;
-
     rResId.SetRT( RSC_HELPBUTTON );
     WinBits nStyle = ImplInitRes( rResId );
+
+    if (VclBuilderContainer::replace_buildable(pParent, rResId, *this))
+        return;
+
     ImplInit( pParent, nStyle );
     ImplLoadRes( rResId );
 
@@ -1938,7 +1940,6 @@ void HelpButton::take_properties(Window &rOther)
 
 void HelpButton::Click()
 {
-    SAL_WARN_IF(!GetClickHdl(), "vcl", "No handler installed for HelpButton");
     // Ist kein Link gesetzt, loese Hilfe aus
     if ( !GetClickHdl() )
     {
@@ -2474,12 +2475,13 @@ RadioButton::RadioButton( Window* pParent, WinBits nStyle ) :
 RadioButton::RadioButton( Window* pParent, const ResId& rResId ) :
     Button( WINDOW_RADIOBUTTON )
 {
-    if (VclBuilderContainer::replace_buildable(pParent, rResId.GetId(), *this))
+    rResId.SetRT( RSC_RADIOBUTTON );
+    WinBits nStyle = ImplInitRes( rResId );
+
+    if (VclBuilderContainer::replace_buildable(pParent, rResId, *this))
         return;
 
     ImplInitRadioButtonData();
-    rResId.SetRT( RSC_RADIOBUTTON );
-    WinBits nStyle = ImplInitRes( rResId );
     ImplInit( pParent, nStyle );
     ImplLoadRes( rResId );
 
@@ -3444,12 +3446,13 @@ CheckBox::CheckBox( Window* pParent, WinBits nStyle ) :
 CheckBox::CheckBox( Window* pParent, const ResId& rResId ) :
     Button( WINDOW_CHECKBOX )
 {
-    if (VclBuilderContainer::replace_buildable(pParent, rResId.GetId(), *this))
+    rResId.SetRT( RSC_CHECKBOX );
+    WinBits nStyle = ImplInitRes( rResId );
+
+    if (VclBuilderContainer::replace_buildable(pParent, rResId, *this))
         return;
 
     ImplInitCheckBoxData();
-    rResId.SetRT( RSC_CHECKBOX );
-    WinBits nStyle = ImplInitRes( rResId );
     ImplInit( pParent, nStyle );
     ImplLoadRes( rResId );
 
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index f226f49..2220437 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -204,12 +204,13 @@ Edit::Edit( Window* pParent, WinBits nStyle ) :
 Edit::Edit( Window* pParent, const ResId& rResId ) :
     Control( WINDOW_EDIT )
 {
-    if (VclBuilderContainer::replace_buildable(pParent, rResId.GetId(), *this))
+    rResId.SetRT( RSC_EDIT );
+    WinBits nStyle = ImplInitRes( rResId );
+
+    if (VclBuilderContainer::replace_buildable(pParent, rResId, *this))
         return;
 
     ImplInitEditData();
-    rResId.SetRT( RSC_EDIT );
-    WinBits nStyle = ImplInitRes( rResId );
     ImplInit( pParent, nStyle );
     ImplLoadRes( rResId );
 
diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx
index ade1b4e..e968b5c 100644
--- a/vcl/source/control/field.cxx
+++ b/vcl/source/control/field.cxx
@@ -807,14 +807,15 @@ NumericField::NumericField( Window* pParent, WinBits nWinStyle ) :
 NumericField::NumericField( Window* pParent, const ResId& rResId ) :
     SpinField( WINDOW_NUMERICFIELD )
 {
-    if (VclBuilderContainer::replace_buildable(pParent, rResId.GetId(), *this))
+    rResId.SetRT( RSC_NUMERICFIELD );
+    WinBits nStyle = ImplInitRes( rResId ) ;
+
+    if (VclBuilderContainer::replace_buildable(pParent, rResId, *this))
     {
         SetField( this );
         return;
     }
 
-    rResId.SetRT( RSC_NUMERICFIELD );
-    WinBits nStyle = ImplInitRes( rResId ) ;
     SpinField::ImplInit( pParent, nStyle );
     SetField( this );
     ImplLoadRes( rResId );
@@ -1678,11 +1679,12 @@ MetricField::MetricField( Window* pParent, WinBits nWinStyle ) :
 MetricField::MetricField( Window* pParent, const ResId& rResId ) :
     SpinField( WINDOW_METRICFIELD )
 {
-    if (VclBuilderContainer::replace_buildable(pParent, rResId.GetId(), *this))
-        return;
-
     rResId.SetRT( RSC_METRICFIELD );
     WinBits nStyle = ImplInitRes( rResId ) ;
+
+    if (VclBuilderContainer::replace_buildable(pParent, rResId, *this))
+        return;
+
     SpinField::ImplInit( pParent, nStyle );
     SetField( this );
     ImplLoadRes( rResId );
diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx
index 8f7f472..7857f56 100644
--- a/vcl/source/control/fixed.cxx
+++ b/vcl/source/control/fixed.cxx
@@ -165,11 +165,12 @@ FixedText::FixedText( Window* pParent, WinBits nStyle ) :
 FixedText::FixedText( Window* pParent, const ResId& rResId ) :
     Control( WINDOW_FIXEDTEXT )
 {
-    if (VclBuilderContainer::replace_buildable(pParent, rResId.GetId(), *this))
-        return;
-
     rResId.SetRT( RSC_TEXT );
     WinBits nStyle = ImplInitRes( rResId );
+
+    if (VclBuilderContainer::replace_buildable(pParent, rResId, *this))
+        return;
+
     ImplInit( pParent, nStyle );
     ImplLoadRes( rResId );
 
@@ -592,11 +593,12 @@ FixedLine::FixedLine( Window* pParent, WinBits nStyle ) :
 FixedLine::FixedLine( Window* pParent, const ResId& rResId ) :
     Control( WINDOW_FIXEDLINE )
 {
-    if (VclBuilderContainer::replace_buildable(pParent, rResId.GetId(), *this))
-        return;
-
     rResId.SetRT( RSC_FIXEDLINE );
     WinBits nStyle = ImplInitRes( rResId );
+
+    if (VclBuilderContainer::replace_buildable(pParent, rResId, *this))
+        return;
+
     ImplInit( pParent, nStyle );
     ImplLoadRes( rResId );
 
diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx
index e6e5983..8a24b9f 100644
--- a/vcl/source/control/lstbox.cxx
+++ b/vcl/source/control/lstbox.cxx
@@ -67,12 +67,13 @@ ListBox::ListBox( Window* pParent, WinBits nStyle ) : Control( WINDOW_LISTBOX )
 ListBox::ListBox( Window* pParent, const ResId& rResId ) :
     Control( WINDOW_LISTBOX )
 {
-    if (VclBuilderContainer::replace_buildable(pParent, rResId.GetId(), *this))
+    rResId.SetRT( RSC_LISTBOX );
+    WinBits nStyle = ImplInitRes( rResId );
+
+    if (VclBuilderContainer::replace_buildable(pParent, rResId, *this))
         return;
 
     ImplInitListBoxData();
-    rResId.SetRT( RSC_LISTBOX );
-    WinBits nStyle = ImplInitRes( rResId );
     ImplInit( pParent, nStyle );
 
     ImplLoadRes( rResId );
@@ -1586,11 +1587,12 @@ MultiListBox::MultiListBox( Window* pParent, WinBits nStyle ) :
 MultiListBox::MultiListBox( Window* pParent, const ResId& rResId ) :
     ListBox( WINDOW_MULTILISTBOX )
 {
-    if (VclBuilderContainer::replace_buildable(pParent, rResId.GetId(), *this))
-        return;
-
     rResId.SetRT( RSC_MULTILISTBOX );
     WinBits nStyle = ImplInitRes( rResId );
+
+    if (VclBuilderContainer::replace_buildable(pParent, rResId, *this))
+        return;
+
     ImplInit( pParent, nStyle );
     ImplLoadRes( rResId );
 
diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx
index 9487d2f..ae6b004 100644
--- a/vcl/source/control/spinfld.cxx
+++ b/vcl/source/control/spinfld.cxx
@@ -377,7 +377,7 @@ void SpinField::take_properties(Window &rOther)
     Edit::take_properties(rOther);
 
     SpinField &rOtherField = static_cast<SpinField&>(rOther);
-    assert(mpEdit && rOther.mpEdit);
+    assert(mpEdit && rOtherField.mpEdit);
     mpEdit->take_properties(*rOtherField.mpEdit);
 
     maUpperRect = rOtherField.maUpperRect;
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 218b9fd..cd2b30b 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -481,6 +481,8 @@ Window *VclBuilder::insertObject(Window *pParent, const rtl::OString &rClass, co
         //toplevels default to resizable
         if (pCurrentChild->IsDialog())
             pCurrentChild->SetStyle(pCurrentChild->GetStyle() | WB_SIZEMOVE | WB_3DLOOK);
+        if (pCurrentChild->GetHelpId().isEmpty())
+            pCurrentChild->SetHelpId(m_sHelpRoot + m_sID);
     }
     else
     {
@@ -515,12 +517,12 @@ sal_uInt16 VclBuilder::getPositionWithinParent(Window &rWindow)
     {
         assert(rWindow.mpWindowImpl->mpBorderWindow ==
             rWindow.mpWindowImpl->mpParent);
-        assert(rWindow.mpWindowImpl->mpBorderWindow->mpParent ==
+        assert(rWindow.mpWindowImpl->mpBorderWindow->mpWindowImpl->mpParent ==
             rWindow.mpWindowImpl->mpRealParent);
         return getPositionWithinParent(*rWindow.mpWindowImpl->mpBorderWindow);
     }
 
-    assert(rWindow.GetParent() == rWindow.GetRealParent());
+    assert(rWindow.GetParent() == rWindow.mpWindowImpl->mpRealParent);
 
     sal_uInt16 nPosition = 0;
     Window* pChild = rWindow.GetParent()->mpWindowImpl->mpFirstChild;
@@ -540,7 +542,7 @@ void VclBuilder::reorderWithinParent(Window &rWindow, sal_uInt16 nNewPosition)
     {
         assert(rWindow.mpWindowImpl->mpBorderWindow ==
             rWindow.mpWindowImpl->mpParent);
-        assert(rWindow.mpWindowImpl->mpBorderWindow->mpParent ==
+        assert(rWindow.mpWindowImpl->mpBorderWindow->mpWindowImpl->mpParent ==
             rWindow.mpWindowImpl->mpRealParent);
         reorderWithinParent(*rWindow.mpWindowImpl->mpBorderWindow, nNewPosition);
         return;
@@ -1089,7 +1091,6 @@ VclBuilder::Adjustment *VclBuilder::get_adjustment_by_name(rtl::OString sID)
 
 void VclBuilder::swapGuts(Window &rOrig, Window &rReplacement)
 {
-#if 1
     sal_uInt16 nPosition = getPositionWithinParent(rOrig);
 
     rReplacement.take_properties(rOrig);
@@ -1097,35 +1098,6 @@ void VclBuilder::swapGuts(Window &rOrig, Window &rReplacement)
     reorderWithinParent(rReplacement, nPosition);
 
     assert(nPosition == getPositionWithinParent(rReplacement));
-#else
-    //rReplacement is intended to be not inserted into
-    //anything yet
-    assert(!rReplacement.mpWindowImpl->mpParent);
-
-    rReplacement.ImplInit(rOrig.GetParent(), rOrig.GetStyle(), NULL);
-    assert(rReplacement.GetParent() == rOrig.GetParent());
-
-    rReplacement.ImplRemoveWindow(false);
-
-    Window *pParent = rOrig.mpWindowImpl->mpParent;
-    Window *pOrigsNext = rOrig.mpWindowImpl->mpNext;
-    Window *pOrigsPrev = rOrig.mpWindowImpl->mpPrev;
-    std::swap(rOrig.mpWindowImpl, rReplacement.mpWindowImpl);
-    assert(rReplacement.mpWindowImpl->mpPrev == pOrigsPrev);
-    assert(rReplacement.mpWindowImpl->mpNext == pOrigsNext);
-    if (pOrigsNext)
-        pOrigsNext->mpWindowImpl->mpPrev = &rReplacement;
-    else
-        pParent->mpWindowImpl->mpLastChild = &rReplacement;
-    if (pOrigsPrev)
-        pOrigsPrev->mpWindowImpl->mpNext = &rReplacement;
-    else
-        pParent->mpWindowImpl->mpFirstChild = &rReplacement;
-    assert(!rOrig.mpWindowImpl->mpNext && !rOrig.mpWindowImpl->mpPrev);
-
-    //now put this at the end of the window list
-    rOrig.ImplInsertWindow(pParent);
-#endif
     fprintf(stderr, "swapped %p for %p %p/%p/%p\n", &rReplacement, &rOrig, rReplacement.mpWindowImpl->mpParent, rReplacement.mpWindowImpl->mpRealParent, rReplacement.mpWindowImpl->mpBorderWindow);
 }
 
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index d4d2d43..fe41ae7 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -571,7 +571,9 @@ WinBits Dialog::init(Window *pParent, const ResId& rResId)
 
     m_pUIBuilder = overrideResourceWithUIXML(this, rResId);
 
-    if (!m_pUIBuilder)
+    if (m_pUIBuilder)
+        loadAndSetJustHelpID(rResId);
+    else
     {
         //fallback to using the binary resource file
         ImplLoadRes( rResId );
@@ -1255,7 +1257,7 @@ VclBuilderContainer::~VclBuilderContainer()
     delete m_pUIBuilder;
 }
 
-bool VclBuilderContainer::replace_buildable(Window *pParent, sal_Int32 nID, Window &rReplacement)
+bool VclBuilderContainer::replace_buildable(Window *pParent, const ResId& rResId, Window &rReplacement)
 {
     if (!pParent)
         return false;
@@ -1267,8 +1269,15 @@ bool VclBuilderContainer::replace_buildable(Window *pParent, sal_Int32 nID, Wind
     VclBuilder *pUIBuilder = pBuilderContainer->m_pUIBuilder;
     if (!pUIBuilder)
         return false;
+
+    sal_Int32 nID = rResId.GetId();
+
     bool bFound = pUIBuilder->replace(rtl::OString::valueOf(nID), rReplacement);
-    if (!bFound)
+    if (bFound)
+    {
+        rReplacement.loadAndSetJustHelpID(rResId);
+    }
+    else
     {
         fprintf(stderr, "%d %p not found, hiding\n", nID, &rReplacement);
         //move "missing" elements into the action area (just to have
@@ -1284,9 +1293,7 @@ bool VclBuilderContainer::replace_buildable(Window *pParent, sal_Int32 nID, Wind
         rReplacement.ImplInit(pArbitraryParent, 0, NULL);
         rReplacement.Hide();
     }
-    else
-        fprintf(stderr, "%d found\n", nID);
-    assert(rReplacement.mpWindowImpl);
+
     return true;
 }
 
diff --git a/vcl/source/window/tabpage.cxx b/vcl/source/window/tabpage.cxx
index a778c7f..c9f5fff 100644
--- a/vcl/source/window/tabpage.cxx
+++ b/vcl/source/window/tabpage.cxx
@@ -101,10 +101,12 @@ TabPage::TabPage( Window* pParent, const ResId& rResId ) :
 
     m_pUIBuilder = overrideResourceWithUIXML(this, rResId);
 
-    if (!m_pUIBuilder)
+    if (m_pUIBuilder)
+        loadAndSetJustHelpID(rResId);
+    else
     {
         //fallback to using the binary resource file
-        ImplLoadRes( rResId );
+        ImplLoadRes(rResId);
     }
 
     if ( !(nStyle & WB_HIDE) )
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index a024929..9753af5 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -1249,25 +1249,43 @@ WinBits Window::ImplInitRes( const ResId& rResId )
 
 // -----------------------------------------------------------------------
 
-void Window::ImplLoadRes( const ResId& rResId )
+WindowResHeader Window::ImplLoadResHeader( const ResId& rResId )
 {
-    sal_uLong nObjMask = ReadLongRes();
+    WindowResHeader aHeader;
+
+    aHeader.nObjMask = ReadLongRes();
 
     // we need to calculate auto helpids before the resource gets closed
     // if the resource  only contains flags, it will be closed before we try to read a help id
     // so we always create an auto help id that might be overwritten later
     // HelpId
-    rtl::OString aHelpId = ImplAutoHelpID( rResId.GetResMgr() );
+    aHeader.aHelpId = ImplAutoHelpID( rResId.GetResMgr() );
 
     // ResourceStyle
-    sal_uLong nRSStyle = ReadLongRes();
+    aHeader.nRSStyle = ReadLongRes();
     // WinBits
     ReadLongRes();
 
-    if( nObjMask & WINDOW_HELPID )
-        aHelpId = ReadByteStringRes();
+    if( aHeader.nObjMask & WINDOW_HELPID )
+        aHeader.aHelpId = ReadByteStringRes();
+
+    return aHeader;
+}
+
+void Window::loadAndSetJustHelpID(const ResId& rResId)
+{
+    WindowResHeader aHeader = ImplLoadResHeader(rResId);
+    SetHelpId(aHeader.aHelpId);
+    IncrementRes(GetRemainSizeRes());
+}
+
+void Window::ImplLoadRes( const ResId& rResId )
+{
+    WindowResHeader aHeader = ImplLoadResHeader( rResId );
+
+    SetHelpId( aHeader.aHelpId );
 
-    SetHelpId( aHelpId );
+    sal_uLong nObjMask = aHeader.nObjMask;
 
     sal_Bool  bPos  = sal_False;
     sal_Bool  bSize = sal_False;
@@ -1304,6 +1322,8 @@ void Window::ImplLoadRes( const ResId& rResId )
             aSize.Height() = ImplLogicUnitToPixelY( ReadLongRes(), eSizeMap );
     }
 
+    sal_uLong nRSStyle = aHeader.nRSStyle;
+
     // looks bad due to optimisation
     if ( nRSStyle & RSWND_CLIENTSIZE )
     {
@@ -4190,12 +4210,14 @@ Window::Window( Window* pParent, const ResId& rResId )
     : mpWindowImpl(NULL)
 {
     DBG_CTOR( Window, ImplDbgCheckWindow );
-    if (VclBuilderContainer::replace_buildable(pParent, rResId.GetId(), *this))
-        return;
 
-    ImplInitWindowData( WINDOW_WINDOW );
     rResId.SetRT( RSC_WINDOW );
     WinBits nStyle = ImplInitRes( rResId );
+
+    if (VclBuilderContainer::replace_buildable(pParent, rResId, *this))
+        return;
+
+    ImplInitWindowData( WINDOW_WINDOW );
     ImplInit( pParent, nStyle, NULL );
     ImplLoadRes( rResId );
 
@@ -4946,7 +4968,6 @@ void Window::StateChanged( StateChangedType eType )
             break;
         //stuff that does invalidate the layout
         default:
-            fprintf(stderr, "queue_resize due to %d\n", eType);
             queue_resize();
             break;
     }


More information about the Libreoffice-commits mailing list