summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-10-12 10:19:11 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-10-12 11:38:00 +0100
commit4cc4df51d962a9631da282d18e59aada35788a72 (patch)
tree74beec2853ce383da0afa8c89c22cd5292d97f14
parent2811e4215abb998ebea65512d8dcd86697e3301e (diff)
no toolboxes are loaded from .src anymore
Change-Id: Ia2eabf157845b9b6b00b745332a558ffdd1e0ec7
-rw-r--r--include/tools/rcid.h2
-rw-r--r--include/vcl/toolbox.hxx5
-rw-r--r--rsc/inc/rscdb.hxx2
-rw-r--r--rsc/source/parser/rscicpx.cxx180
-rw-r--r--rsc/source/parser/rscinit.cxx6
-rw-r--r--vcl/source/window/toolbox.cxx54
-rw-r--r--vcl/source/window/toolbox2.cxx73
7 files changed, 1 insertions, 321 deletions
diff --git a/include/tools/rcid.h b/include/tools/rcid.h
index 356c7b24473c..a96d3ccfa96c 100644
--- a/include/tools/rcid.h
+++ b/include/tools/rcid.h
@@ -59,8 +59,6 @@
#define RSC_FIXEDIMAGE (RSC_NOTYPE + 0x5a)
-#define RSC_TOOLBOXITEM (RSC_NOTYPE + 0x70)
-#define RSC_TOOLBOX (RSC_NOTYPE + 0x71)
#define RSC_DOCKINGWINDOW (RSC_NOTYPE + 0x72)
#define RSC_STRINGARRAY (RSC_NOTYPE + 0x79)
diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx
index cdc368d9f340..5024e08d79a5 100644
--- a/include/vcl/toolbox.hxx
+++ b/include/vcl/toolbox.hxx
@@ -173,7 +173,6 @@ private:
SAL_DLLPRIVATE void ImplInit( vcl::Window* pParent, WinBits nStyle );
using DockingWindow::ImplInitSettings;
SAL_DLLPRIVATE void ImplInitSettings( bool bFont, bool bForeground, bool bBackground );
- SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
SAL_DLLPRIVATE ImplToolItem* ImplGetItem( sal_uInt16 nId ) const;
SAL_DLLPRIVATE bool ImplCalcItem();
SAL_DLLPRIVATE sal_uInt16 ImplCalcBreaks( long nWidth, long* pMaxLineWidth, bool bCalcHorz );
@@ -257,8 +256,7 @@ 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 OString& rID, const OUString& rUIXMLDescription,
const css::uno::Reference<css::frame::XFrame> &rFrame = css::uno::Reference<css::frame::XFrame>());
virtual ~ToolBox() override;
@@ -294,7 +292,6 @@ public:
virtual Size GetOptimalSize() const override;
virtual void doDeferredInit(WinBits nBits) override;
- void InsertItem( const ResId& rResId );
/// Insert a command (like '.uno:Save').
virtual void InsertItem( const OUString& rCommand,
const css::uno::Reference<css::frame::XFrame>& rFrame,
diff --git a/rsc/inc/rscdb.hxx b/rsc/inc/rscdb.hxx
index 30117dca03fb..2500f2db5004 100644
--- a/rsc/inc/rscdb.hxx
+++ b/rsc/inc/rscdb.hxx
@@ -193,8 +193,6 @@ class RscTypCont
RscTop * InitClassDockingWindow( RscTop * pSuper,
RscEnum * pMapUnit );
- RscTop * InitClassToolBoxItem(RscTop * pSuper);
- RscTop * InitClassToolBox( RscTop * pSuper, RscTop * pClassToolBoxItem );
RscTop * InitClassSfxStyleFamilyItem( RscTop * pSuper,
RscTop * pClassBitmap,
RscTop * pClassImage,
diff --git a/rsc/source/parser/rscicpx.cxx b/rsc/source/parser/rscicpx.cxx
index beba5ad2daef..1908e0d9698f 100644
--- a/rsc/source/parser/rscicpx.cxx
+++ b/rsc/source/parser/rscicpx.cxx
@@ -701,186 +701,6 @@ RscTop * RscTypCont::InitClassDockingWindow( RscTop * pSuper,
return pClassDockWindow;
}
-RscTop * RscTypCont::InitClassToolBoxItem(RscTop * pSuper)
-{
- Atom nId;
- RscTop * pClassToolBoxItem;
-
- // initialize class
- nId = pHS->getID( "ToolBoxItem" );
- pClassToolBoxItem = new RscClass( nId, RSC_TOOLBOXITEM, pSuper );
- aNmTb.Put( nId, CLASSNAME, pClassToolBoxItem );
-
- // initialize variables
- nId = aNmTb.Put( "Identifier", VARNAME );
- pClassToolBoxItem->SetVariable( nId, &aIdNoZeroUShort, nullptr, 0,
- (sal_uInt32)RscToolboxItemFlags::Id );
- {
- RscEnum * pEnum;
-
- aBaseLst.push_back( pEnum = new RscEnum( pHS->getID( "EnumToolBoxItemType" ), RSC_NOTYPE ) );
- SETCONST( pEnum, "TOOLBOXITEM_BUTTON", ToolBoxItemType::BUTTON );
- SETCONST( pEnum, "TOOLBOXITEM_SPACE", ToolBoxItemType::SPACE );
- SETCONST( pEnum, "TOOLBOXITEM_SEPARATOR", ToolBoxItemType::SEPARATOR );
- SETCONST( pEnum, "TOOLBOXITEM_BREAK", ToolBoxItemType::BREAK );
-
- // add variable
- nId = aNmTb.Put( "Type", VARNAME );
- pClassToolBoxItem->SetVariable( nId, pEnum, nullptr, 0,
- (sal_uInt32)RscToolboxItemFlags::Type );
- }
- {
- RscFlag * pFlag;
- RscClient * pClient;
- Atom l_nVarId, l_nAutoCheckId, l_nRadioCheckId, l_nCheckableId, l_nLeftId, l_nAutoSizeId, l_nDropDownId;
-
- aBaseLst.push_back( pFlag = new RscFlag( pHS->getID( "FlagToolBoxState" ), RSC_NOTYPE ) );
-
- // set constants in table
- l_nCheckableId = pHS->getID( "ToolBoxItemBits::CHECKABLE" );
- SETCONST( pFlag, l_nCheckableId, ToolBoxItemBits::CHECKABLE );
- l_nAutoCheckId = pHS->getID( "ToolBoxItemBits::AUTOCHECK" );
- SETCONST( pFlag, l_nAutoCheckId, ToolBoxItemBits::AUTOCHECK );
- l_nRadioCheckId = pHS->getID( "ToolBoxItemBits::RADIOCHECK" );
- SETCONST( pFlag, l_nRadioCheckId, ToolBoxItemBits::RADIOCHECK );
- l_nLeftId = pHS->getID( "ToolBoxItemBits::LEFT" );
- SETCONST( pFlag, l_nLeftId, ToolBoxItemBits::LEFT );
- l_nAutoSizeId = pHS->getID( "ToolBoxItemBits::AUTOSIZE" );
- SETCONST( pFlag, l_nAutoSizeId, ToolBoxItemBits::AUTOSIZE );
- l_nDropDownId = pHS->getID( "ToolBoxItemBits::DROPDOWN" );
- SETCONST( pFlag, l_nDropDownId, ToolBoxItemBits::DROPDOWN );
-
- // add variable
- l_nVarId = aNmTb.Put( "_ToolBoxItemFlags", VARNAME );
- pClassToolBoxItem->SetVariable( l_nVarId, pFlag, nullptr,
- VAR_HIDDEN | VAR_NOENUM,
- (sal_uInt32)RscToolboxItemFlags::Status );
-
- // add client variables
- aBaseLst.push_back(
- pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, l_nCheckableId )
- );
- nId = aNmTb.Put( "Checkable", VARNAME );
- pClassToolBoxItem->SetVariable( nId, pClient, nullptr, VAR_NODATAINST, 0, l_nVarId );
-
- aBaseLst.push_back(
- pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, l_nAutoCheckId )
- );
- nId = aNmTb.Put( "AutoCheck", VARNAME );
- pClassToolBoxItem->SetVariable( nId, pClient, nullptr, VAR_NODATAINST, 0, l_nVarId );
-
- aBaseLst.push_back(
- pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, l_nRadioCheckId )
- );
- nId = aNmTb.Put( "RadioCheck", VARNAME );
- pClassToolBoxItem->SetVariable( nId, pClient, nullptr, VAR_NODATAINST, 0, l_nVarId );
-
- aBaseLst.push_back(
- pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, l_nLeftId )
- );
- nId = aNmTb.Put( "Left", VARNAME );
- pClassToolBoxItem->SetVariable( nId, pClient, nullptr, VAR_NODATAINST, 0, l_nVarId );
-
- aBaseLst.push_back(
- pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, l_nAutoSizeId )
- );
- nId = aNmTb.Put( "AutoSize", VARNAME );
- pClassToolBoxItem->SetVariable( nId, pClient, nullptr, VAR_NODATAINST, 0, l_nVarId );
-
- aBaseLst.push_back(
- pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, pFlag, l_nDropDownId )
- );
- nId = aNmTb.Put( "DropDown", VARNAME );
- pClassToolBoxItem->SetVariable( nId, pClient, nullptr, VAR_NODATAINST, 0, l_nVarId );
- }
- nId = aNmTb.Put( "HelpID", VARNAME );
- pClassToolBoxItem->SetVariable( nId, &aStringLiteral, nullptr, 0,
- (sal_uInt32)RscToolboxItemFlags::HelpId );
- nId = aNmTb.Put( "Text", VARNAME );
- pClassToolBoxItem->SetVariable( nId, &aLangString, nullptr, 0,
- (sal_uInt32)RscToolboxItemFlags::Text );
- nId = aNmTb.Put( "Disable", VARNAME );
- pClassToolBoxItem->SetVariable( nId, &aBool, nullptr, 0,
- (sal_uInt32)RscToolboxItemFlags::Disable );
-
- nId = aNmTb.Put( "Hide", VARNAME );
- pClassToolBoxItem->SetVariable( nId, &aBool, nullptr, 0,
- (sal_uInt32)RscToolboxItemFlags::Hide );
- nId = aNmTb.Put( "Command", VARNAME );
- pClassToolBoxItem->SetVariable( nId, &aString, nullptr, 0,
- (sal_uInt32)RscToolboxItemFlags::Command );
-
- return pClassToolBoxItem;
-}
-
-RscTop * RscTypCont::InitClassToolBox( RscTop * pSuper,
- RscTop * pClassToolBoxItem )
-{
- Atom nId;
- RscTop * pClassToolBox;
-
- // initialize class
- nId = pHS->getID( "ToolBox" );
- pClassToolBox = new RscClass( nId, RSC_TOOLBOX, pSuper );
- pClassToolBox->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType );
- aNmTb.Put( nId, CLASSNAME, pClassToolBox );
-
- // initialize variables
- {
- RscEnum * pEnum;
-
- aBaseLst.push_back( pEnum = new RscEnum( pHS->getID( "EnumButtonType" ), RSC_NOTYPE ) );
- SETCONST( pEnum, "BUTTON_SYMBOL", ButtonType::SYMBOLONLY );
- SETCONST( pEnum, "BUTTON_TEXT", ButtonType::TEXT );
- SETCONST( pEnum, "BUTTON_SYMBOLTEXT", ButtonType::SYMBOLTEXT );
-
- // add variable
- nId = aNmTb.Put( "ButtonType", VARNAME );
- pClassToolBox->SetVariable( nId, pEnum, nullptr, 0,
- (sal_uInt32)RscToolboxFlags::ButtonType );
- }
- {
- RscEnum * pEnum;
-
- aBaseLst.push_back( pEnum = new RscEnum( pHS->getID( "EnumToolBoxAlign" ), RSC_NOTYPE ) );
- SETCONST( pEnum, "BOXALIGN_TOP", WindowAlign::Top );
- SETCONST( pEnum, "BOXALIGN_LEFT", WindowAlign::Left );
- SETCONST( pEnum, "BOXALIGN_RIGHT", WindowAlign::Right );
- SETCONST( pEnum, "BOXALIGN_BOTTOM", WindowAlign::Bottom );
-
- // add variable
- nId = aNmTb.Put( "Align", VARNAME );
- pClassToolBox->SetVariable( nId, pEnum, nullptr, 0,
- (sal_uInt32)RscToolboxFlags::Align );
- }
- nId = aNmTb.Put( "LineCount", VARNAME );
- pClassToolBox->SetVariable( nId, &aIdNoZeroUShort, nullptr, 0,
- (sal_uInt32)RscToolboxFlags::LineCount );
- {
- RscLangArray* pLA;
- RscCont * pCont;
-
- aBaseLst.push_back( pCont = new RscCont( pHS->getID( "ContToolBoxItem" ), RSC_NOTYPE ) );
- pCont->SetTypeClass( pClassToolBoxItem );
- aBaseLst.push_back(
- pLA = new RscLangArray( pHS->getID( "LangContToolBoxItem" )
- , RSC_NOTYPE
- , pCont
- , &aLangType
- )
- );
- nId = aNmTb.Put( "ItemList", VARNAME );
- pClassToolBox->SetVariable( nId, pLA, nullptr, 0,
- (sal_uInt32)RscToolboxFlags::ItemList );
- }
- INS_WINBIT(pClassToolBox,Scroll)
- INS_WINBIT(pClassToolBox,LineSpacing)
- INS_WINBIT(pClassToolBox,RectStyle)
- INS_WINBIT(pClassToolBox,Tabstop)
-
- return pClassToolBox;
-}
-
RscTop * RscTypCont::InitClassSfxStyleFamilyItem( RscTop * pSuper,
RscTop * pClassBitmap,
RscTop * pClassImage,
diff --git a/rsc/source/parser/rscinit.cxx b/rsc/source/parser/rscinit.cxx
index 5761dd5a27d4..14730fdd00f8 100644
--- a/rsc/source/parser/rscinit.cxx
+++ b/rsc/source/parser/rscinit.cxx
@@ -348,12 +348,6 @@ void RscTypCont::Init()
RscTop* pClassDockingWindow = InitClassDockingWindow( pClassWindow, pMapUnit );
pRoot->Insert( pClassDockingWindow );
- RscTop* pClassToolBoxItem = InitClassToolBoxItem(pClassMgr);
- pRoot->Insert( pClassToolBoxItem );
-
- RscTop* pClassToolBox = InitClassToolBox( pClassDockingWindow, pClassToolBoxItem );
- pRoot->Insert( pClassToolBox );
-
RscTop* pClassSfxStyleFamilyItem = InitClassSfxStyleFamilyItem( pClassMgr,
pClassBitmap,
pClassImage,
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index d55926e2db70..0ac14181e319 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -1537,38 +1537,6 @@ void ToolBox::ImplInitSettings(bool bFont, bool bForeground, bool bBackground)
}
}
-void ToolBox::ImplLoadRes( const ResId& rResId )
-{
- ResMgr* pMgr = rResId.GetResMgr();
- if( ! pMgr )
- return;
-
- DockingWindow::ImplLoadRes( rResId );
-
- RscToolboxFlags nObjMask = (RscToolboxFlags)ReadLongRes();
-
- if ( nObjMask & RscToolboxFlags::ButtonType )
- SetButtonType( (ButtonType)ReadLongRes() );
-
- if ( nObjMask & RscToolboxFlags::Align )
- SetAlign( (WindowAlign)ReadLongRes() );
-
- if ( nObjMask & RscToolboxFlags::LineCount )
- SetLineCount( sal::static_int_cast<sal_uInt16>(ReadLongRes()) );
-
- if ( nObjMask & RscToolboxFlags::ItemList )
- {
- sal_uLong nEle = ReadLongRes();
-
- // insert item
- for ( sal_uLong i = 0; i < nEle; i++ )
- {
- InsertItem( ResId( static_cast<RSHEADER_TYPE *>(GetClassRes()), *pMgr ) );
- IncrementRes( GetObjSizeRes( static_cast<RSHEADER_TYPE *>(GetClassRes()) ) );
- }
- }
-}
-
void ToolBox::doDeferredInit(WinBits nBits)
{
VclPtr<vcl::Window> pParent = mpDialogParent;
@@ -1584,28 +1552,6 @@ ToolBox::ToolBox( vcl::Window* pParent, WinBits nStyle ) :
ImplInit( pParent, nStyle );
}
-ToolBox::ToolBox( vcl::Window* pParent, const ResId& rResId ) :
- DockingWindow( WINDOW_TOOLBOX )
-{
- SAL_INFO( "vcl.window", "vcl: ToolBox::ToolBox( vcl::Window* pParent, const ResId& rResId )" );
- ImplInitToolBoxData();
-
- rResId.SetRT( RSC_TOOLBOX );
- WinBits nStyle = ImplInitRes( rResId );
- ImplInit( pParent, nStyle );
- ImplLoadRes( rResId );
-
- // calculate size of floating windows and switch if the
- // toolbox is initially in floating mode
- if ( ImplIsFloatingMode() )
- mbHorz = true;
- else
- Resize();
-
- if ( !(nStyle & WB_HIDE) )
- Show();
-}
-
ToolBox::ToolBox(vcl::Window* pParent, const OString& rID,
const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame> &rFrame)
: DockingWindow(WINDOW_TOOLBOX)
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index 12239a5b6891..af98244747df 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -374,79 +374,6 @@ void ToolBox::Select()
pWrapper->GetFloatingWindow()->EndPopupMode();
}
-void ToolBox::InsertItem( const ResId& rResId )
-{
- RscToolboxItemFlags nObjMask;
-
- // create item
- ImplToolItem aItem;
-
- GetRes( rResId.SetRT( RSC_TOOLBOXITEM ) );
- nObjMask = (RscToolboxItemFlags)ReadLongRes();
-
- if ( nObjMask & RscToolboxItemFlags::Id )
- aItem.mnId = sal::static_int_cast<sal_uInt16>(ReadLongRes());
- else
- aItem.mnId = 1;
-
- if ( nObjMask & RscToolboxItemFlags::Type )
- aItem.meType = (ToolBoxItemType)ReadLongRes();
-
- if ( nObjMask & RscToolboxItemFlags::Status )
- aItem.mnBits = (ToolBoxItemBits)ReadLongRes();
-
- if( nObjMask & RscToolboxItemFlags::HelpId )
- aItem.maHelpId = ReadByteStringRes();
-
- if ( nObjMask & RscToolboxItemFlags::Text )
- {
- aItem.maText = ReadStringRes();
- aItem.maText = MnemonicGenerator::EraseAllMnemonicChars(aItem.maText);
- }
-
- if ( nObjMask & RscToolboxItemFlags::Disable )
- aItem.mbEnabled = ReadShortRes() == 0;
-
- if ( nObjMask & RscToolboxItemFlags::Hide )
- aItem.mbVisible = ReadShortRes() == 0;
-
- if ( nObjMask & RscToolboxItemFlags::Command )
- aItem.maCommandStr = ReadStringRes();
-
- // Try to load an image from the image list
- if (aItem.mnId)
- {
- aItem.maImage = maImageList.GetImage( aItem.mnId );
- aItem.maImageOriginal = aItem.maImage;
- }
-
- // if this is a ButtonItem, check ID
- bool bNewCalc;
- if ( aItem.meType != ToolBoxItemType::BUTTON )
- {
- bNewCalc = false;
- aItem.mnId = 0;
- }
- else
- {
- bNewCalc = true;
-
- SAL_WARN_IF( !aItem.mnId, "vcl", "ToolBox::InsertItem(): ItemId == 0" );
- SAL_WARN_IF( GetItemPos( aItem.mnId ) != TOOLBOX_ITEM_NOTFOUND, "vcl", "ToolBox::InsertItem(): ItemId already exists" );
- }
-
- // create item and add to list
- mpData->m_aItems.push_back( aItem );
- mpData->ImplClearLayoutData();
-
- // recalculate ToolBox and redraw
- ImplInvalidate( bNewCalc );
-
- // Notify
- sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(mpData->m_aItems.size() - 1);
- CallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos ) );
-}
-
void ToolBox::InsertItem( sal_uInt16 nItemId, const Image& rImage, ToolBoxItemBits nBits, sal_uInt16 nPos )
{
SAL_WARN_IF( !nItemId, "vcl", "ToolBox::InsertItem(): ItemId == 0" );