[Libreoffice-commits] core.git: extensions/inc extensions/source extensions/uiconfig extensions/UIConfig_sbibliography.mk include/vcl vcl/source

Caolán McNamara caolanm at redhat.com
Tue Mar 8 16:24:12 UTC 2016


 extensions/UIConfig_sbibliography.mk            |    1 
 extensions/inc/bibliography.hrc                 |    6 
 extensions/source/bibliography/bibbeam.cxx      |    5 
 extensions/source/bibliography/datman.cxx       |    5 
 extensions/source/bibliography/toolbar.cxx      |   70 ++++++-----
 extensions/source/bibliography/toolbar.hrc      |   31 -----
 extensions/source/bibliography/toolbar.hxx      |   14 ++
 extensions/source/bibliography/toolbar.src      |   86 --------------
 extensions/uiconfig/sbibliography/ui/toolbar.ui |  145 ++++++++++++++++++++++++
 include/vcl/dockwin.hxx                         |    6 
 include/vcl/toolbox.hxx                         |    7 -
 vcl/source/window/toolbox.cxx                   |   25 ++++
 12 files changed, 238 insertions(+), 163 deletions(-)

New commits:
commit 68b5875647dd3f39f9e01eec75383a5b9b3ef3a6
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Mar 7 17:26:18 2016 +0000

    convert custom bibliography toolbar to .ui format
    
    Change-Id: I70eb0e2ff96879d1168b241852a0079f540b0319

diff --git a/extensions/UIConfig_sbibliography.mk b/extensions/UIConfig_sbibliography.mk
index 58ec842..0a25c8f 100644
--- a/extensions/UIConfig_sbibliography.mk
+++ b/extensions/UIConfig_sbibliography.mk
@@ -17,6 +17,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/sbibliography,\
 	extensions/uiconfig/sbibliography/ui/choosedatasourcedialog \
 	extensions/uiconfig/sbibliography/ui/generalpage \
 	extensions/uiconfig/sbibliography/ui/mappingdialog \
+	extensions/uiconfig/sbibliography/ui/toolbar \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/extensions/inc/bibliography.hrc b/extensions/inc/bibliography.hrc
index ca646c3..e80bb21 100644
--- a/extensions/inc/bibliography.hrc
+++ b/extensions/inc/bibliography.hrc
@@ -20,11 +20,6 @@
 #ifndef EXTENSIONS_BIBLIOGRAPHY_HRC
 #define EXTENSIONS_BIBLIOGRAPHY_HRC
 
-#define HID_BIB_CHANGESOURCE                            "EXTENSIONS_HID_BIB_CHANGESOURCE"
-#define HID_BIB_MAPPINGDLG                              "EXTENSIONS_HID_BIB_MAPPINGDLG"
-#define HID_BIB_TBX_TABLE                               "EXTENSIONS_HID_BIB_TBX_TABLE"
-#define HID_BIB_TBX_SEARCH                              "EXTENSIONS_HID_BIB_TBX_SEARCH"
-#define HID_BIB_TBX_AUTOFILTER                          "EXTENSIONS_HID_BIB_TBX_AUTOFILTER"
 #define HID_BIB_IDENTIFIER_POS                          "EXTENSIONS_HID_BIB_IDENTIFIER_POS"
 #define HID_BIB_AUTHORITYTYPE_POS                       "EXTENSIONS_HID_BIB_AUTHORITYTYPE_POS"
 #define HID_BIB_AUTHOR_POS                              "EXTENSIONS_HID_BIB_AUTHOR_POS"
@@ -56,7 +51,6 @@
 #define HID_BIB_CUSTOM3_POS                             "EXTENSIONS_HID_BIB_CUSTOM3_POS"
 #define HID_BIB_CUSTOM4_POS                             "EXTENSIONS_HID_BIB_CUSTOM4_POS"
 #define HID_BIB_CUSTOM5_POS                             "EXTENSIONS_HID_BIB_CUSTOM5_POS"
-#define HID_BIB_DB_TBX                                  "EXTENSIONS_HID_BIB_DB_TBX"
 #define HID_BIB_CONTROL_PARENT                          "EXTENSIONS_HID_BIB_CONTROL_PARENT"
 #define UID_BIB_FRAME_WINDOW                            "EXTENSIONS_UID_BIB_FRAME_WINDOW"
 #define HID_BIB_DB_GRIDCTRL                             "EXTENSIONS_HID_BIB_DB_GRIDCTRL"
diff --git a/extensions/source/bibliography/bibbeam.cxx b/extensions/source/bibliography/bibbeam.cxx
index d54b24e..de5a3d5 100644
--- a/extensions/source/bibliography/bibbeam.cxx
+++ b/extensions/source/bibliography/bibbeam.cxx
@@ -30,7 +30,6 @@
 #include <tools/debug.hxx>
 #include "bibbeam.hxx"
 #include "bibview.hxx"
-#include "toolbar.hrc"
 #include "bibresid.hxx"
 #include "datman.hxx"
 #include "bibtools.hxx"
@@ -222,7 +221,7 @@ namespace bib
     void BibBeamer::createToolBar()
     {
         pToolBar= VclPtr<BibToolBar>::Create(this, LINK( this, BibBeamer, RecalcLayout_Impl ));
-        ::Size aSize=pToolBar->GetSizePixel();
+        ::Size aSize=pToolBar->get_preferred_size();
         InsertItem(ID_TOOLBAR, pToolBar, aSize.Height(), 0, 0, SplitWindowItemFlags::Fixed );
         if ( m_xController.is() )
             pToolBar->SetXController( m_xController );
@@ -270,7 +269,7 @@ namespace bib
 
     IMPL_LINK_NOARG_TYPED( BibBeamer, RecalcLayout_Impl, void*, void )
     {
-        long nHeight = pToolBar->GetSizePixel().Height();
+        long nHeight = pToolBar->get_preferred_size().Height();
         SetItemSize( ID_TOOLBAR, nHeight );
     }
 
diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx
index b9de5b2..d0218c0 100644
--- a/extensions/source/bibliography/datman.cxx
+++ b/extensions/source/bibliography/datman.cxx
@@ -64,7 +64,6 @@
 #include "bibview.hxx"
 #include "bibprop.hrc"
 #include "toolbar.hxx"
-#include "toolbar.hrc"
 #include "bibconfig.hxx"
 #include "bibbeam.hxx"
 #include "general.hxx"
@@ -1562,8 +1561,8 @@ OUString BibDataManager::CreateDBChangeDialog(vcl::Window* pParent)
 
 void BibDataManager::DispatchDBChangeDialog()
 {
-    if(pToolbar)
-        pToolbar->SendDispatch(TBC_BT_CHANGESOURCE, Sequence< PropertyValue >());
+    if (pToolbar)
+        pToolbar->SendDispatch(pToolbar->GetChangeSourceId(), Sequence< PropertyValue >());
 }
 
 const OUString& BibDataManager::GetIdentifierMapping()
diff --git a/extensions/source/bibliography/toolbar.cxx b/extensions/source/bibliography/toolbar.cxx
index 521ef5a..e2eb753 100644
--- a/extensions/source/bibliography/toolbar.cxx
+++ b/extensions/source/bibliography/toolbar.cxx
@@ -32,8 +32,8 @@
 #include <vcl/mnemonic.hxx>
 #include "bibbeam.hxx"
 #include "bibview.hxx"
-#include "toolbar.hrc"
 #include "bibresid.hxx"
+#include "bib.hrc"
 
 #include "bibtools.hxx"
 #include <osl/mutex.hxx>
@@ -176,9 +176,9 @@ void BibTBEditListener::statusChanged(const frame::FeatureStateEvent& rEvt)throw
     }
 }
 
-BibToolBar::BibToolBar(vcl::Window* pParent, Link<void*,void> aLink, WinBits nStyle):
-    ToolBox(pParent,BibResId(RID_BIB_TOOLBAR)),
-    aImgLst(BibResId(  RID_TOOLBAR_IMGLIST     )),
+BibToolBar::BibToolBar(vcl::Window* pParent, Link<void*,void> aLink)
+    : ToolBox(pParent, "toolbar", "modules/sbibliography/ui/toolbar.ui")
+    , aImgLst(BibResId(  RID_TOOLBAR_IMGLIST     )),
     aBigImgLst(BibResId( RID_TOOLBAR_BIGIMGLIST )),
     aFtSource(VclPtr<FixedText>::Create(this,WB_VCENTER)),
     aLBSource(VclPtr<ListBox>::Create(this,WB_DROPDOWN)),
@@ -194,8 +194,6 @@ BibToolBar::BibToolBar(vcl::Window* pParent, Link<void*,void> aLink, WinBits nSt
     nSymbolsSize = aSvtMiscOptions.GetCurrentSymbolsSize();
     nOutStyle  = aSvtMiscOptions.GetToolboxStyle();
 
-    ApplyImageList();
-    SetStyle(GetStyle()|nStyle);
     SetOutStyle(TOOLBOX_STYLE_FLAT);
     Size a2Size(GetOutputSizePixel());
     a2Size.Width()=100;
@@ -215,20 +213,32 @@ BibToolBar::BibToolBar(vcl::Window* pParent, Link<void*,void> aLink, WinBits nSt
     aEdQuery->SetSizePixel(aLBSource->GetSizePixel());
     aEdQuery->Show();
 
-    OUString aStr=GetItemText(TBC_FT_SOURCE);
+    nTBC_FT_SOURCE = GetItemId("TBC_FT_SOURCE");
+    nTBC_LB_SOURCE = GetItemId(".uno:Bib/source");
+    nTBC_FT_QUERY = GetItemId("TBC_FT_QUERY");
+    nTBC_ED_QUERY = GetItemId(".uno:Bib/query");
+    nTBC_BT_AUTOFILTER = GetItemId(".uno:Bib/autoFilter");
+    nTBC_BT_COL_ASSIGN = GetItemId("TBC_BT_COL_ASSIGN");
+    nTBC_BT_CHANGESOURCE = GetItemId(".uno:Bib/sdbsource");
+    nTBC_BT_FILTERCRIT = GetItemId(".uno:Bib/standardFilter");
+    nTBC_BT_REMOVEFILTER = GetItemId(".uno:Bib/removeFilter");
+
+    OUString aStr = GetItemText(nTBC_FT_SOURCE);
     aFtSource->SetText(aStr);
     aFtSource->SetSizePixel(aFtSource->get_preferred_size());
     aFtSource->SetBackground(Wallpaper( COL_TRANSPARENT ));
 
-    aStr=GetItemText(TBC_FT_QUERY);
+    aStr=GetItemText(nTBC_FT_QUERY);
     aFtQuery->SetText(aStr);
     aFtQuery->SetSizePixel(aFtQuery->get_preferred_size());
     aFtQuery->SetBackground(Wallpaper( COL_TRANSPARENT ));
 
-    SetItemWindow(TBC_FT_SOURCE, aFtSource.get());
-    SetItemWindow(TBC_LB_SOURCE, aLBSource.get());
-    SetItemWindow(TBC_FT_QUERY , aFtQuery.get());
-    SetItemWindow(TBC_ED_QUERY , aEdQuery.get());
+    SetItemWindow(nTBC_FT_SOURCE, aFtSource.get());
+    SetItemWindow(nTBC_LB_SOURCE, aLBSource.get());
+    SetItemWindow(nTBC_FT_QUERY , aFtQuery.get());
+    SetItemWindow(nTBC_ED_QUERY , aEdQuery.get());
+
+    ApplyImageList();
 
     ::bib::AddToTaskPaneList( this );
 }
@@ -261,13 +271,13 @@ void BibToolBar::InitListener()
         util::URL aQueryURL;
         aQueryURL.Complete = ".uno:Bib/MenuFilter";
         xTrans->parseStrict( aQueryURL);
-        BibToolBarListener* pQuery=new BibTBQueryMenuListener(this,aQueryURL.Complete,TBC_BT_AUTOFILTER);
+        BibToolBarListener* pQuery=new BibTBQueryMenuListener(this, aQueryURL.Complete, nTBC_BT_AUTOFILTER);
         xDisp->addStatusListener(uno::Reference< frame::XStatusListener > (pQuery),aQueryURL);
 
         for(sal_uInt16 nPos=0;nPos<nCount;nPos++)
         {
             sal_uInt16 nId=GetItemId(nPos);
-            if(!nId || nId==TBC_FT_SOURCE || nId==TBC_FT_QUERY)
+            if(!nId || nId== nTBC_FT_SOURCE || nId == nTBC_FT_QUERY)
                 continue;
 
             util::URL aURL;
@@ -278,11 +288,11 @@ void BibToolBar::InitListener()
             xTrans->parseStrict( aURL );
 
             css::uno::Reference< css::frame::XStatusListener> xListener;
-            if(nId==TBC_LB_SOURCE)
+            if (nId == nTBC_LB_SOURCE)
             {
                 xListener=new BibTBListBoxListener(this,aURL.Complete,nId);
             }
-            else if(nId==TBC_ED_QUERY)
+            else if (nId == nTBC_ED_QUERY)
             {
                 xListener=new BibTBEditListener(this,aURL.Complete,nId);
             }
@@ -308,7 +318,7 @@ void BibToolBar::Select()
 {
     sal_uInt16  nId=GetCurItemId();
 
-    if(nId!=TBC_BT_AUTOFILTER)
+    if (nId != nTBC_BT_AUTOFILTER)
     {
         SendDispatch(nId,Sequence<PropertyValue>() );
     }
@@ -354,15 +364,15 @@ void BibToolBar::SendDispatch(sal_uInt16 nId, const Sequence< PropertyValue >& r
 
 void BibToolBar::Click()
 {
-    sal_uInt16  nId=GetCurItemId();
+    sal_uInt16 nId = GetCurItemId();
 
-    if(nId == TBC_BT_COL_ASSIGN )
+    if (nId == nTBC_BT_COL_ASSIGN )
     {
         if(pDatMan)
             pDatMan->CreateMappingDialog(GetParent());
         CheckItem( nId, false );
     }
-    else if(nId == TBC_BT_CHANGESOURCE)
+    else if (nId == nTBC_BT_CHANGESOURCE)
     {
         if(pDatMan)
         {
@@ -449,7 +459,7 @@ bool BibToolBar::PreNotify( NotifyEvent& rNEvt )
             pPropertyVal[0].Value <<= aSelection;
             pPropertyVal[1].Name="QueryField";
             pPropertyVal[1].Value <<= aQueryField;
-            SendDispatch(TBC_BT_AUTOFILTER,aPropVal);
+            SendDispatch(nTBC_BT_AUTOFILTER, aPropVal);
             return bResult;
         }
 
@@ -473,18 +483,18 @@ IMPL_LINK_NOARG_TYPED( BibToolBar, SendSelHdl, Idle*, void )
     OUString aEntry( MnemonicGenerator::EraseAllMnemonicChars( aLBSource->GetSelectEntry() ) );
     OUString aSelection = aEntry;
     pPropertyVal[0].Value <<= aSelection;
-    SendDispatch(TBC_LB_SOURCE,aPropVal);
+    SendDispatch(nTBC_LB_SOURCE, aPropVal);
 }
 
 IMPL_LINK_NOARG_TYPED( BibToolBar, MenuHdl, ToolBox*, void)
 {
     sal_uInt16  nId=GetCurItemId();
-    if(nId==TBC_BT_AUTOFILTER)
+    if (nId == nTBC_BT_AUTOFILTER)
     {
         EndSelection();     // vor SetDropMode (SetDropMode ruft SetItemImage)
 
-        SetItemDown(TBC_BT_AUTOFILTER,true);
-        nId = aPopupMenu.Execute(this, GetItemRect(TBC_BT_AUTOFILTER));
+        SetItemDown(nTBC_BT_AUTOFILTER, true);
+        nId = aPopupMenu.Execute(this, GetItemRect(nTBC_BT_AUTOFILTER));
 
 
         if(nId>0)
@@ -500,13 +510,13 @@ IMPL_LINK_NOARG_TYPED( BibToolBar, MenuHdl, ToolBox*, void)
             pPropertyVal[0].Value <<= aSelection;
             pPropertyVal[1].Name="QueryField";
             pPropertyVal[1].Value <<= aQueryField;
-            SendDispatch(TBC_BT_AUTOFILTER,aPropVal);
+            SendDispatch(nTBC_BT_AUTOFILTER, aPropVal);
         }
 
         Point aPoint;
         MouseEvent aLeave( aPoint, 0, MouseEventModifiers::LEAVEWINDOW | MouseEventModifiers::SYNTHETIC );
         MouseMove( aLeave );
-        SetItemDown(TBC_BT_AUTOFILTER,false);
+        SetItemDown(nTBC_BT_AUTOFILTER, false);
 
 
     }
@@ -577,9 +587,9 @@ void BibToolBar::ApplyImageList()
                        ( aImgLst ) :
                        ( aBigImgLst );
 
-    SetItemImage(TBC_BT_AUTOFILTER  , rList.GetImage(SID_FM_AUTOFILTER));
-    SetItemImage(TBC_BT_FILTERCRIT  , rList.GetImage(SID_FM_FILTERCRIT));
-    SetItemImage(TBC_BT_REMOVEFILTER, rList.GetImage(SID_FM_REMOVE_FILTER_SORT ));
+    SetItemImage(nTBC_BT_AUTOFILTER  , rList.GetImage(SID_FM_AUTOFILTER));
+    SetItemImage(nTBC_BT_FILTERCRIT  , rList.GetImage(SID_FM_FILTERCRIT));
+    SetItemImage(nTBC_BT_REMOVEFILTER, rList.GetImage(SID_FM_REMOVE_FILTER_SORT ));
     AdjustToolBox();
 }
 
diff --git a/extensions/source/bibliography/toolbar.hrc b/extensions/source/bibliography/toolbar.hrc
deleted file mode 100644
index c4169f1..0000000
--- a/extensions/source/bibliography/toolbar.hrc
+++ /dev/null
@@ -1,31 +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 .
- */
-#include "bib.hrc"
-
-#define TBC_FT_SOURCE       1
-#define TBC_LB_SOURCE       2
-#define TBC_FT_QUERY        3
-#define TBC_ED_QUERY        4
-#define TBC_BT_AUTOFILTER   5
-#define TBC_BT_FILTERCRIT   6
-#define TBC_BT_REMOVEFILTER 7
-#define TBC_BT_COL_ASSIGN   15
-#define TBC_BT_CHANGESOURCE 16
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/extensions/source/bibliography/toolbar.hxx b/extensions/source/bibliography/toolbar.hxx
index c051912..1b7187a 100644
--- a/extensions/source/bibliography/toolbar.hxx
+++ b/extensions/source/bibliography/toolbar.hxx
@@ -124,6 +124,16 @@ class BibToolBar:   public ToolBox
         sal_Int16               nSymbolsSize;
         sal_Int16               nOutStyle;
 
+        sal_uInt16              nTBC_FT_SOURCE;
+        sal_uInt16              nTBC_LB_SOURCE;
+        sal_uInt16              nTBC_FT_QUERY;
+        sal_uInt16              nTBC_ED_QUERY;
+        sal_uInt16              nTBC_BT_AUTOFILTER;
+        sal_uInt16              nTBC_BT_COL_ASSIGN;
+        sal_uInt16              nTBC_BT_CHANGESOURCE;
+        sal_uInt16              nTBC_BT_FILTERCRIT;
+        sal_uInt16              nTBC_BT_REMOVEFILTER;
+
         BibDataManager*         pDatMan;
         DECL_LINK_TYPED( SelHdl, ListBox&, void );
         DECL_LINK_TYPED( SendSelHdl, Idle*, void );
@@ -145,10 +155,12 @@ class BibToolBar:   public ToolBox
 
     public:
 
-        BibToolBar(vcl::Window* pParent, Link<void*,void> aLink, WinBits nStyle = WB_3DLOOK );
+        BibToolBar(vcl::Window* pParent, Link<void*,void> aLink);
         virtual ~BibToolBar();
         virtual void dispose() override;
 
+        sal_uInt16  GetChangeSourceId() const { return nTBC_BT_CHANGESOURCE; }
+
         void    SetXController(const css::uno::Reference< css::frame::XController > &);
 
         void    ClearSourceList();
diff --git a/extensions/source/bibliography/toolbar.src b/extensions/source/bibliography/toolbar.src
index 1c02b36..275c53e 100644
--- a/extensions/source/bibliography/toolbar.src
+++ b/extensions/source/bibliography/toolbar.src
@@ -18,95 +18,11 @@
  */
 #include <svx/svxids.hrc>
 #include "bibliography.hrc"
-#include "toolbar.hrc"
 #include "svx/svxcommands.h"
+#include "bib.hrc"
 
 #define MASKCOLOR   MaskColor = Color { Red = 0xFFFF; Green = 0x0000; Blue = 0xFFFF; };
 
-ToolBox RID_BIB_TOOLBAR
-{
-    HelpId = HID_BIB_DB_TBX;
-    Sizeable = TRUE ;
-    HideWhenDeactivate = TRUE ;
-    LineSpacing = TRUE ;
-    Border = TRUE ;
-    SVLook = TRUE ;
-    Pos = MAP_APPFONT ( 0 , 0 ) ;
-    Size = MAP_APPFONT ( 200 , 16 ) ;
-    ButtonType = BUTTON_SYMBOL ;
-    ItemList =
-    {
-        ToolBoxItem
-        {
-            Identifier = TBC_FT_SOURCE;
-            Text [ en-US ] = "Table";
-        };
-        ToolBoxItem
-        {
-            Identifier = TBC_LB_SOURCE;
-            HelpID = HID_BIB_TBX_TABLE;
-            Command = ".uno:Bib/source" ;
-        };
-        ToolBoxItem
-        {
-            Type = TOOLBOXITEM_SEPARATOR ;
-        };
-
-        ToolBoxItem
-        {
-            Identifier = TBC_FT_QUERY;
-            Text [ en-US ] = "Search Key";
-        };
-        ToolBoxItem
-        {
-            Identifier = TBC_ED_QUERY;
-            HelpID = HID_BIB_TBX_SEARCH;
-            Command = ".uno:Bib/query" ;
-        };
-        ToolBoxItem
-        {
-            Type = TOOLBOXITEM_SEPARATOR ;
-        };
-
-        ToolBoxItem
-        {
-            Identifier = TBC_BT_AUTOFILTER ;
-            HelpID = HID_BIB_TBX_AUTOFILTER;
-            DropDown = TRUE ;
-            Command = ".uno:Bib/autoFilter" ;
-            Text [ en-US ] = "AutoFilter";
-        };
-
-        ToolBoxItem
-        {
-            Identifier = TBC_BT_FILTERCRIT ;
-            Command = ".uno:Bib/standardFilter" ;
-            Text [ en-US ] = "Standard Filter";
-        };
-
-        ToolBoxItem
-        {
-            Identifier = TBC_BT_REMOVEFILTER ;
-            Command = ".uno:Bib/removeFilter" ;
-            Text [ en-US ] = "Reset Filter";
-        };
-        ToolBoxItem
-        {
-            Identifier = TBC_BT_COL_ASSIGN ;
-            HelpId = HID_BIB_MAPPINGDLG;
-            Text [ en-US ] = "Column Arrangement";
-        };
-        ToolBoxItem
-        {
-            Identifier = TBC_BT_CHANGESOURCE ;
-            HelpId = HID_BIB_CHANGESOURCE;
-            Command = ".uno:Bib/sdbsource" ;
-            Checkable=TRUE;
-            Text [ en-US ] = "Data Source";
-        };
-    };
-    Scroll = TRUE ;
-};
 #define BIB_IMAGES \
     IdList =                                \
     {                                       \
diff --git a/extensions/uiconfig/sbibliography/ui/toolbar.ui b/extensions/uiconfig/sbibliography/ui/toolbar.ui
new file mode 100644
index 0000000..bdcc2bf
--- /dev/null
+++ b/extensions/uiconfig/sbibliography/ui/toolbar.ui
@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.19.0 -->
+<interface>
+  <requires lib="gtk+" version="3.4"/>
+  <object class="GtkToolbar" id="toolbar">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="show_arrow">False</property>
+    <child>
+      <object class="GtkToolButton" id="TBC_FT_SOURCE">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="action_name">TBC_FT_SOURCE</property>
+        <property name="label" translatable="yes">Table</property>
+        <property name="use_underline">True</property>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="homogeneous">True</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkToolButton" id="TBC_LB_SOURCE">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="action_name">.uno:Bib/source</property>
+        <property name="use_underline">True</property>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="homogeneous">True</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkSeparatorToolItem" id="toolbutton1">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="homogeneous">True</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkToolButton" id="TBC_FT_QUERY">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="action_name">TBC_FT_QUERY</property>
+        <property name="label" translatable="yes">Search Key</property>
+        <property name="use_underline">True</property>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="homogeneous">True</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkToolButton" id="TBC_ED_QUERY">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="action_name">.uno:Bib/query</property>
+        <property name="use_underline">True</property>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="homogeneous">True</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkSeparatorToolItem" id="toolbutton2">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="homogeneous">True</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkMenuToolButton" id="TBC_BT_AUTOFILTER">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="action_name">.uno:Bib/autoFilter</property>
+        <property name="label" translatable="yes">AutoFilter</property>
+        <property name="use_underline">True</property>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="homogeneous">True</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkToolButton" id="TBC_BT_FILTERCRIT">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="action_name">.uno:Bib/standardFilter</property>
+        <property name="label" translatable="yes">Standard Filter</property>
+        <property name="use_underline">True</property>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="homogeneous">True</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkToolButton" id="TBC_BT_REMOVEFILTER">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="action_name">.uno:Bib/removeFilter</property>
+        <property name="label" translatable="yes">Reset Filter</property>
+        <property name="use_underline">True</property>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="homogeneous">True</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkToolButton" id="TBC_BT_COL_ASSIGN">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="action_name">TBC_BT_COL_ASSIGN</property>
+        <property name="label" translatable="yes">Column Arrangement</property>
+        <property name="use_underline">True</property>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="homogeneous">True</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkToolButton" id="TBC_BT_CHANGESOURCE">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="action_name">.uno:Bib/sdbsource</property>
+        <property name="label" translatable="yes">Data Source</property>
+        <property name="use_underline">True</property>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="homogeneous">True</property>
+      </packing>
+    </child>
+  </object>
+</interface>
diff --git a/include/vcl/dockwin.hxx b/include/vcl/dockwin.hxx
index 23a5220..e126c3e 100644
--- a/include/vcl/dockwin.hxx
+++ b/include/vcl/dockwin.hxx
@@ -247,11 +247,13 @@ private:
                     mbRollUp:1,
                     mbDockBtn:1,
                     mbHideBtn:1,
-                    mbIsDefferedInit:1,
                     mbIsCalculatingInitialLayoutSize:1,
                     mbInitialLayoutDone:1;
 
+protected:
+    bool mbIsDefferedInit;
     VclPtr<vcl::Window>  mpDialogParent;
+private:
 
     SAL_DLLPRIVATE void    ImplInitDockingWindowData();
     SAL_DLLPRIVATE void setPosSizeOnContainee(Size aSize, Window &rBox);
@@ -279,7 +281,7 @@ public:
     SAL_DLLPRIVATE bool    ImplStartDocking( const Point& rPos );
     SAL_DLLPRIVATE bool    isDeferredInit() const { return mbIsDefferedInit; }
     SAL_DLLPRIVATE bool    hasPendingLayout() const { return maLayoutIdle.IsActive(); }
-    void                   doDeferredInit(WinBits nBits);
+    virtual        void    doDeferredInit(WinBits nBits);
 protected:
                     DockingWindow( WindowType nType );
     DockingWindow(vcl::Window* pParent, const ResId& rResId);
diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx
index f81673c..da057b8 100644
--- a/include/vcl/toolbox.hxx
+++ b/include/vcl/toolbox.hxx
@@ -247,8 +247,10 @@ protected:
     }
 
 public:
-                        ToolBox( vcl::Window* pParent, WinBits nStyle = 0 );
-                        ToolBox( vcl::Window* pParent, const ResId& rResId );
+    ToolBox( vcl::Window* pParent, WinBits nStyle = 0 );
+    ToolBox( vcl::Window* pParent, const ResId& rResId );
+    ToolBox(vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription,
+        const css::uno::Reference<css::frame::XFrame> &rFrame = css::uno::Reference<css::frame::XFrame>());
     virtual             ~ToolBox();
     virtual void        dispose() override;
 
@@ -283,6 +285,7 @@ public:
     virtual void        EndDocking( const Rectangle& rRect, bool bFloatMode ) override;
     virtual void        Resizing( Size& rSize ) override;
     virtual Size        GetOptimalSize() const override;
+    virtual void        doDeferredInit(WinBits nBits) override;
 
     void                InsertItem( const ResId& rResId );
     /// Insert a command (like '.uno:Save').
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 3037a58..075e44e 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -1593,6 +1593,14 @@ void ToolBox::ImplLoadRes( const ResId& rResId )
     }
 }
 
+void ToolBox::doDeferredInit(WinBits nBits)
+{
+    VclPtr<vcl::Window> pParent = mpDialogParent;
+    mpDialogParent = nullptr;
+    ImplInit(pParent, nBits);
+    mbIsDefferedInit = false;
+}
+
 ToolBox::ToolBox( vcl::Window* pParent, WinBits nStyle ) :
     DockingWindow( WINDOW_TOOLBOX )
 {
@@ -1620,6 +1628,23 @@ ToolBox::ToolBox( vcl::Window* pParent, const ResId& rResId ) :
         Show();
 }
 
+ToolBox::ToolBox(vcl::Window* pParent, const OString& rID,
+    const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame> &rFrame)
+    : DockingWindow(WINDOW_TOOLBOX)
+{
+    loadUI(pParent, rID, rUIXMLDescription, rFrame);
+
+    // calculate size of floating windows and switch if the
+    // toolbox is initially in floating mode
+    if ( ImplIsFloatingMode() )
+        mbHorz = true;
+    else
+        Resize();
+
+    if (!(GetStyle() & WB_HIDE))
+        Show();
+}
+
 ToolBox::~ToolBox()
 {
     disposeOnce();


More information about the Libreoffice-commits mailing list