[Libreoffice-commits] core.git: 6 commits - include/tools include/vcl rsc/inc rsc/source tools/source vcl/source
Caolán McNamara
caolanm at redhat.com
Wed Oct 12 10:40:53 UTC 2016
include/tools/rc.h | 49 ---------
include/tools/rcid.h | 4
include/tools/resmgr.hxx | 5
include/vcl/dockwin.hxx | 1
include/vcl/edit.hxx | 2
include/vcl/lstbox.hxx | 2
include/vcl/toolbox.hxx | 5
include/vcl/window.hxx | 4
rsc/inc/rscdb.hxx | 4
rsc/source/parser/rscicpx.cxx | 217 -----------------------------------------
rsc/source/parser/rscinit.cxx | 9 -
tools/source/rc/resmgr.cxx | 65 ------------
vcl/source/control/button.cxx | 2
vcl/source/control/ctrl.cxx | 2
vcl/source/control/edit.cxx | 6 -
vcl/source/control/fixed.cxx | 4
vcl/source/control/listbox.cxx | 6 -
vcl/source/window/dockwin.cxx | 38 -------
vcl/source/window/resource.cxx | 22 ----
vcl/source/window/toolbox.cxx | 54 ----------
vcl/source/window/toolbox2.cxx | 73 -------------
vcl/source/window/window.cxx | 2
22 files changed, 20 insertions(+), 556 deletions(-)
New commits:
commit 637587fc8fe4ed3ae7c254fc1dc117bb78f326cb
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Oct 12 10:42:47 2016 +0100
drop unused argument
Change-Id: I54a86f98289877abc435e2c7397ff5fd6c516545
diff --git a/include/vcl/edit.hxx b/include/vcl/edit.hxx
index 5aaa9f7..df00e80 100644
--- a/include/vcl/edit.hxx
+++ b/include/vcl/edit.hxx
@@ -132,7 +132,7 @@ protected:
using Window::ImplInit;
SAL_DLLPRIVATE void ImplInit( vcl::Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE static WinBits ImplInitStyle( WinBits nStyle );
- SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
+ SAL_DLLPRIVATE void ImplLoadRes();
SAL_DLLPRIVATE void ImplSetSelection( const Selection& rSelection, bool bPaint = true );
SAL_DLLPRIVATE ControlType ImplGetNativeControlType() const;
SAL_DLLPRIVATE long ImplGetExtraXOffset() const;
diff --git a/include/vcl/lstbox.hxx b/include/vcl/lstbox.hxx
index 4f22c06..4c3b3bb 100644
--- a/include/vcl/lstbox.hxx
+++ b/include/vcl/lstbox.hxx
@@ -107,7 +107,7 @@ protected:
using Window::ImplInit;
SAL_DLLPRIVATE void ImplInit( vcl::Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE static WinBits ImplInitStyle( WinBits nStyle );
- SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
+ SAL_DLLPRIVATE void ImplLoadRes();
bool IsDropDownBox() const { return mpFloatWin != nullptr; }
protected:
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 9b36a55..8563d95 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -635,8 +635,8 @@ protected:
SAL_DLLPRIVATE bool ImplSetClipFlagOverlapWindows( bool bSysObjOnlySmaller = false );
SAL_DLLPRIVATE WinBits ImplInitRes( const ResId& rResId );
- SAL_DLLPRIVATE WindowResHeader ImplLoadResHeader( const ResId& rResId );
- SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
+ SAL_DLLPRIVATE WindowResHeader ImplLoadResHeader();
+ SAL_DLLPRIVATE void ImplLoadRes();
SAL_DLLPRIVATE void PushPaintHelper(PaintHelper* pHelper, vcl::RenderContext& rRenderContext);
SAL_DLLPRIVATE void PopPaintHelper(PaintHelper* pHelper);
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index fc37a34..c5eed69 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -1214,7 +1214,7 @@ PushButton::PushButton( vcl::Window* pParent, const ResId& rResId ) :
WinBits nStyle = ImplInitRes( rResId );
ImplInitPushButtonData();
ImplInit( pParent, nStyle );
- ImplLoadRes( rResId );
+ ImplLoadRes();
if ( !(nStyle & WB_HIDE) )
Show();
diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx
index 2235cd4..c2d697d 100644
--- a/vcl/source/control/ctrl.cxx
+++ b/vcl/source/control/ctrl.cxx
@@ -60,7 +60,7 @@ Control::Control( vcl::Window* pParent, const ResId& rResId ) :
rResId.SetRT( RSC_CONTROL );
WinBits nStyle = ImplInitRes( rResId );
ImplInit( pParent, nStyle, nullptr );
- ImplLoadRes( rResId );
+ ImplLoadRes();
if ( !(nStyle & WB_HIDE) )
Show();
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index dbb6a76..2769a0f 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -176,7 +176,7 @@ Edit::Edit( vcl::Window* pParent, const ResId& rResId )
WinBits nStyle = ImplInitRes( rResId );
ImplInitEditData();
ImplInit( pParent, nStyle );
- ImplLoadRes( rResId );
+ ImplLoadRes();
if ( !(nStyle & WB_HIDE) )
Show();
@@ -1279,9 +1279,9 @@ void Edit::ImplSetCursorPos( sal_Int32 nChar, bool bSelect )
ImplSetSelection( aSelection );
}
-void Edit::ImplLoadRes( const ResId& rResId )
+void Edit::ImplLoadRes()
{
- Control::ImplLoadRes( rResId );
+ Control::ImplLoadRes();
sal_uInt16 nTextLength = ReadShortRes();
if ( nTextLength )
diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx
index ce01670..4e42bca 100644
--- a/vcl/source/control/fixed.cxx
+++ b/vcl/source/control/fixed.cxx
@@ -122,7 +122,7 @@ FixedText::FixedText( vcl::Window* pParent, const ResId& rResId )
rResId.SetRT( RSC_TEXT );
WinBits nStyle = ImplInitRes( rResId );
ImplInit( pParent, nStyle );
- ImplLoadRes( rResId );
+ ImplLoadRes();
if ( !(nStyle & WB_HIDE) )
Show();
@@ -843,7 +843,7 @@ WinBits FixedImage::ImplInitStyle( WinBits nStyle )
void FixedImage::ImplLoadRes( const ResId& rResId )
{
- Control::ImplLoadRes( rResId );
+ Control::ImplLoadRes();
sal_uLong nObjMask = ReadLongRes();
diff --git a/vcl/source/control/listbox.cxx b/vcl/source/control/listbox.cxx
index fa696fa..0b0edf1 100644
--- a/vcl/source/control/listbox.cxx
+++ b/vcl/source/control/listbox.cxx
@@ -63,7 +63,7 @@ ListBox::ListBox( vcl::Window* pParent, const ResId& rResId ) :
WinBits nStyle = ImplInitRes( rResId );
ImplInitListBoxData();
ImplInit( pParent, nStyle );
- ImplLoadRes( rResId );
+ ImplLoadRes();
if ( !(nStyle & WB_HIDE ) )
Show();
@@ -189,9 +189,9 @@ WinBits ListBox::ImplInitStyle( WinBits nStyle )
return nStyle;
}
-void ListBox::ImplLoadRes( const ResId& rResId )
+void ListBox::ImplLoadRes()
{
- Control::ImplLoadRes( rResId );
+ Control::ImplLoadRes();
// The resource short is actually to be treated as unsigned short.
sal_uInt16 nResPos = static_cast<sal_uInt16>(ReadShortRes());
diff --git a/vcl/source/window/resource.cxx b/vcl/source/window/resource.cxx
index 7887130..86326f9 100644
--- a/vcl/source/window/resource.cxx
+++ b/vcl/source/window/resource.cxx
@@ -36,7 +36,7 @@ WinBits Window::ImplInitRes( const ResId& rResId )
return nStyle;
}
-WindowResHeader Window::ImplLoadResHeader( const ResId& /*rResId*/ )
+WindowResHeader Window::ImplLoadResHeader()
{
WindowResHeader aHeader;
@@ -53,9 +53,9 @@ WindowResHeader Window::ImplLoadResHeader( const ResId& /*rResId*/ )
return aHeader;
}
-void Window::ImplLoadRes( const ResId& rResId )
+void Window::ImplLoadRes()
{
- WindowResHeader aHeader = ImplLoadResHeader( rResId );
+ WindowResHeader aHeader = ImplLoadResHeader();
SetHelpId( aHeader.aHelpId );
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 7086612..8db7645 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -104,7 +104,7 @@ Window::Window( vcl::Window* pParent, const ResId& rResId ) :
rResId.SetRT( RSC_WINDOW );
WinBits nStyle = ImplInitRes( rResId );
ImplInit( pParent, nStyle, nullptr );
- ImplLoadRes( rResId );
+ ImplLoadRes();
if ( !(nStyle & WB_HIDE) )
Show();
commit 3abc98687715072080ba408b12fd8ef0a17573d5
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Oct 12 10:30:56 2016 +0100
GetAutoHelpId logically can only return an empty string now
Change-Id: Ie7368f083a5aa6bcfb249375fbae1f4cd92e02ba
diff --git a/include/tools/resmgr.hxx b/include/tools/resmgr.hxx
index 100ae4c..d5a62cb 100644
--- a/include/tools/resmgr.hxx
+++ b/include/tools/resmgr.hxx
@@ -192,10 +192,7 @@ public:
sal_Int16 ReadShort();
sal_Int32 ReadLong();
OUString ReadString();
- OString ReadByteString();
-
- /// Generate auto help ID for current resource stack
- OString GetAutoHelpId();
+ OString ReadByteString();
static void SetReadStringHook( ResHookProc pProc );
static ResHookProc GetReadStringHook();
diff --git a/tools/source/rc/resmgr.cxx b/tools/source/rc/resmgr.cxx
index f0b4e55..c97f3ab 100644
--- a/tools/source/rc/resmgr.cxx
+++ b/tools/source/rc/resmgr.cxx
@@ -1386,57 +1386,6 @@ OString ResMgr::ReadByteString()
return aRet;
}
-OString ResMgr::GetAutoHelpId()
-{
- osl::Guard<osl::Mutex> aGuard( getResMgrMutex() );
-
- if( pFallbackResMgr )
- return pFallbackResMgr->GetAutoHelpId();
-
- OSL_ENSURE( nCurStack, "resource stack empty in Auto help id generation" );
- if( nCurStack < 1 || nCurStack > 2 )
- return OString();
-
- // prepare HID, start with resource prefix
- OStringBuffer aHID( 32 );
- aHID.append( OUStringToOString( pImpRes->aPrefix, RTL_TEXTENCODING_UTF8 ) );
- aHID.append( '.' );
-
- // append type
- const ImpRCStack *pRC = StackTop();
- OSL_ENSURE( pRC, "missing resource stack level" );
-
- if ( nCurStack == 1 )
- {
- // auto help ids for top level windows
- switch( pRC->pResource->GetRT() ) {
- default: return OString();
- }
- }
- else
- {
- // only controls with the following parents get auto help ids
- const ImpRCStack *pRC1 = StackTop(1);
- switch( pRC1->pResource->GetRT() ) {
- default:
- return OString();
- }
- }
-
- // append resource id hierarchy
- for( int nOff = nCurStack-1; nOff >= 0; nOff-- )
- {
- aHID.append( '.' );
- pRC = StackTop( nOff );
-
- OSL_ENSURE( pRC->pResource, "missing resource in resource stack level !" );
- if( pRC->pResource )
- aHID.append( sal_Int32( pRC->pResource->GetId() ) );
- }
-
- return aHID.makeStringAndClear();
-}
-
void ResMgr::SetReadStringHook( ResHookProc pProc )
{
osl::Guard<osl::Mutex> aGuard( getResMgrMutex() );
diff --git a/vcl/source/window/resource.cxx b/vcl/source/window/resource.cxx
index abc5eed..7887130 100644
--- a/vcl/source/window/resource.cxx
+++ b/vcl/source/window/resource.cxx
@@ -24,16 +24,6 @@
#include "window.h"
-static OString ImplAutoHelpID( ResMgr* pResMgr )
-{
- OString aRet;
-
- if( pResMgr && Application::IsAutoHelpIdEnabled() )
- aRet = pResMgr->GetAutoHelpId();
-
- return aRet;
-}
-
namespace vcl {
WinBits Window::ImplInitRes( const ResId& rResId )
@@ -46,18 +36,12 @@ WinBits Window::ImplInitRes( const ResId& rResId )
return nStyle;
}
-WindowResHeader Window::ImplLoadResHeader( const ResId& rResId )
+WindowResHeader Window::ImplLoadResHeader( const ResId& /*rResId*/ )
{
WindowResHeader aHeader;
aHeader.nObjMask = (RscWindowFlags)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
- aHeader.aHelpId = ImplAutoHelpID( rResId.GetResMgr() );
-
// ResourceStyle
aHeader.nRSStyle = (RSWND)ReadLongRes();
// WinBits
commit 540b7d3ae4ee9fa4b46d2af6261e44de6bd4d462
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Oct 12 10:28:17 2016 +0100
drop RSC_DOCKINGWINDOW*
Change-Id: Ibcddc2def40e15f4a2f92fec13c1c3fd2f824d68
diff --git a/include/tools/rc.h b/include/tools/rc.h
index 00f324e..7759037 100644
--- a/include/tools/rc.h
+++ b/include/tools/rc.h
@@ -77,12 +77,6 @@ namespace o3tl {
template<> struct typed_flags<RscMenuItem> : is_typed_flags<RscMenuItem, 0xd6f> {};
}
-// For "DockingWindow" resources:
-#define RSC_DOCKINGWINDOW_XYMAPMODE 0x01
-#define RSC_DOCKINGWINDOW_X 0x02
-#define RSC_DOCKINGWINDOW_Y 0x04
-#define RSC_DOCKINGWINDOW_FLOATING 0x08
-
// For "ImageButtons":
enum class RscImageButtonFlags {
Image = 0x01,
diff --git a/include/tools/rcid.h b/include/tools/rcid.h
index a96d3cc..4d69c85 100644
--- a/include/tools/rcid.h
+++ b/include/tools/rcid.h
@@ -59,8 +59,6 @@
#define RSC_FIXEDIMAGE (RSC_NOTYPE + 0x5a)
-#define RSC_DOCKINGWINDOW (RSC_NOTYPE + 0x72)
-
#define RSC_STRINGARRAY (RSC_NOTYPE + 0x79)
// (RSC_NOTYPE + 0x200) - (RSC_NOTYPE + 0x300) reserved for Sfx
diff --git a/rsc/inc/rscdb.hxx b/rsc/inc/rscdb.hxx
index 2500f2d..5536b04 100644
--- a/rsc/inc/rscdb.hxx
+++ b/rsc/inc/rscdb.hxx
@@ -191,8 +191,6 @@ class RscTypCont
RscTop * InitClassMenuItem( RscTop * pSuper );
RscTop * InitClassMenu( RscTop * pSuper, RscTop * pMenuItem );
- RscTop * InitClassDockingWindow( RscTop * pSuper,
- RscEnum * pMapUnit );
RscTop * InitClassSfxStyleFamilyItem( RscTop * pSuper,
RscTop * pClassBitmap,
RscTop * pClassImage,
diff --git a/rsc/source/parser/rscicpx.cxx b/rsc/source/parser/rscicpx.cxx
index 1908e0d..e2514b8 100644
--- a/rsc/source/parser/rscicpx.cxx
+++ b/rsc/source/parser/rscicpx.cxx
@@ -664,43 +664,6 @@ RscTop * RscTypCont::InitClassMenu( RscTop * pSuper,
return pClassMenu;
}
-RscTop * RscTypCont::InitClassDockingWindow( RscTop * pSuper,
- RscEnum * pMapUnit )
-{
- Atom nId;
- RscTop * pClassDockWindow;
-
- // initialize class
- nId = pHS->getID( "DockingWindow" );
- pClassDockWindow = new RscClass( nId, RSC_DOCKINGWINDOW, pSuper );
- pClassDockWindow->SetCallPar( *pWinPar1, *pWinPar2, *pWinParType );
- aNmTb.Put( nId, CLASSNAME, pClassDockWindow );
-
- // initialize variables
- nId = aNmTb.Put( "_FloatingPosMapMode", VARNAME );
- pClassDockWindow->SetVariable( nId, pMapUnit, nullptr, 0,
- RSC_DOCKINGWINDOW_XYMAPMODE );
- nId = aNmTb.Put( "_FloatingPosX", VARNAME );
- pClassDockWindow->SetVariable( nId, &aShort, nullptr, 0,
- RSC_DOCKINGWINDOW_X );
- nId = aNmTb.Put( "_FloatingPosY", VARNAME );
- pClassDockWindow->SetVariable( nId, &aShort, nullptr, 0,
- RSC_DOCKINGWINDOW_Y );
- nId = aNmTb.Put( "FloatingMode", VARNAME );
- pClassDockWindow->SetVariable( nId, &aBool, nullptr, 0,
- RSC_DOCKINGWINDOW_FLOATING );
-
- INS_WINBIT(pClassDockWindow,Moveable)
- INS_WINBIT(pClassDockWindow,Sizeable)
- INS_WINBIT(pClassDockWindow,EnableResizing)
- INS_WINBIT(pClassDockWindow,Closeable)
- INS_WINBIT(pClassDockWindow,HideWhenDeactivate);
- INS_WINBIT(pClassDockWindow,Zoomable);
- INS_WINBIT(pClassDockWindow,Dockable);
-
- return pClassDockWindow;
-}
-
RscTop * RscTypCont::InitClassSfxStyleFamilyItem( RscTop * pSuper,
RscTop * pClassBitmap,
RscTop * pClassImage,
diff --git a/rsc/source/parser/rscinit.cxx b/rsc/source/parser/rscinit.cxx
index 14730fd..78126c4 100644
--- a/rsc/source/parser/rscinit.cxx
+++ b/rsc/source/parser/rscinit.cxx
@@ -345,9 +345,6 @@ void RscTypCont::Init()
(sal_uInt32)RscMenuItem::Menu );
}
{
- RscTop* pClassDockingWindow = InitClassDockingWindow( pClassWindow, pMapUnit );
- pRoot->Insert( pClassDockingWindow );
-
RscTop* pClassSfxStyleFamilyItem = InitClassSfxStyleFamilyItem( pClassMgr,
pClassBitmap,
pClassImage,
diff --git a/tools/source/rc/resmgr.cxx b/tools/source/rc/resmgr.cxx
index bdf71ab..f0b4e55 100644
--- a/tools/source/rc/resmgr.cxx
+++ b/tools/source/rc/resmgr.cxx
@@ -1410,7 +1410,6 @@ OString ResMgr::GetAutoHelpId()
{
// auto help ids for top level windows
switch( pRC->pResource->GetRT() ) {
- case RSC_DOCKINGWINDOW: aHID.append( "DockingWindow" ); break;
default: return OString();
}
}
@@ -1419,19 +1418,6 @@ OString ResMgr::GetAutoHelpId()
// only controls with the following parents get auto help ids
const ImpRCStack *pRC1 = StackTop(1);
switch( pRC1->pResource->GetRT() ) {
- case RSC_DOCKINGWINDOW:
- // intentionally no breaks!
- // auto help ids for controls
- switch( pRC->pResource->GetRT() ) {
- case RSC_EDIT: aHID.append( "Edit" ); break;
- case RSC_LISTBOX: aHID.append( "ListBox" ); break;
- case RSC_PUSHBUTTON: aHID.append( "PushButton" ); break;
- case RSC_IMAGEBUTTON: aHID.append( "ImageButton" ); break;
- default:
- // no type, no auto HID
- return OString();
- }
- break;
default:
return OString();
}
commit 7091666cb9955683eabacaf329c66f10fe29eeb2
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Oct 12 10:25:22 2016 +0100
DockingWindow ResId code needed only by removed ToolBar src support
Change-Id: Ib0dff4b569ac1b95a59b618258036ecf3d2c4e73
diff --git a/include/vcl/dockwin.hxx b/include/vcl/dockwin.hxx
index 7fb7a89..f0543ff 100644
--- a/include/vcl/dockwin.hxx
+++ b/include/vcl/dockwin.hxx
@@ -254,7 +254,6 @@ protected:
using Window::ImplInit;
SAL_DLLPRIVATE void ImplInit( vcl::Window* pParent, WinBits nStyle );
SAL_DLLPRIVATE void ImplInitSettings();
- SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
SAL_DLLPRIVATE void DoInitialLayout();
diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx
index 9a523c7..0b82598 100644
--- a/vcl/source/window/dockwin.cxx
+++ b/vcl/source/window/dockwin.cxx
@@ -348,44 +348,6 @@ void DockingWindow::ImplInitSettings()
}
}
-void DockingWindow::ImplLoadRes( const ResId& rResId )
-{
- Window::ImplLoadRes( rResId );
-
- const sal_uInt32 nMask = ReadLongRes();
-
- if ( (RSC_DOCKINGWINDOW_XYMAPMODE | RSC_DOCKINGWINDOW_X |
- RSC_DOCKINGWINDOW_Y) & nMask )
- {
- // use Sizes of the Resource
- Point aPos;
- MapUnit ePosMap = MapUnit::MapPixel;
-
- if ( RSC_DOCKINGWINDOW_XYMAPMODE & nMask )
- ePosMap = (MapUnit)ReadLongRes();
-
- if ( RSC_DOCKINGWINDOW_X & nMask )
- {
- aPos.X() = ReadShortRes();
- aPos.X() = ImplLogicUnitToPixelX( aPos.X(), ePosMap );
- }
-
- if ( RSC_DOCKINGWINDOW_Y & nMask )
- {
- aPos.Y() = ReadShortRes();
- aPos.Y() = ImplLogicUnitToPixelY( aPos.Y(), ePosMap );
- }
-
- SetFloatingPos( aPos );
- }
-
- if ( nMask & RSC_DOCKINGWINDOW_FLOATING )
- {
- if ( ReadShortRes() != 0 )
- SetFloatingMode( true );
- }
-}
-
DockingWindow::DockingWindow( WindowType nType ) :
Window(nType)
{
commit c3c008f3607e9bc488e406df9c747364f5fa72b2
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Oct 12 10:21:09 2016 +0100
drop unused defines and enums
Change-Id: Ifc81443047380221a7329be5b6b094ee8bc76451
diff --git a/include/tools/rc.h b/include/tools/rc.h
index e213e6f..00f324e 100644
--- a/include/tools/rc.h
+++ b/include/tools/rc.h
@@ -77,49 +77,6 @@ namespace o3tl {
template<> struct typed_flags<RscMenuItem> : is_typed_flags<RscMenuItem, 0xd6f> {};
}
-// For "Field" resources:
-
-enum class RscNumFormatterFlags {
- Min = 0x01,
- Max = 0x02,
- StrictFormat = 0x04,
- DecimalDigits = 0x10,
- Value = 0x20,
-};
-namespace o3tl {
- template<> struct typed_flags<RscNumFormatterFlags> : is_typed_flags<RscNumFormatterFlags, 0x37> {};
-}
-
-#define NUMERICFIELD_FIRST 0x01
-#define NUMERICFIELD_LAST 0x02
-#define NUMERICFIELD_SPINSIZE 0x04
-
-// For "ToolBoxItem" resources:
-enum class RscToolboxItemFlags {
- Id = 0x0001,
- Type = 0x0002,
- Status = 0x0004,
- HelpId = 0x0008,
- Text = 0x0010,
- Disable = 0x0100,
- Hide = 0x0400,
- Command = 0x0800
-};
-namespace o3tl {
- template<> struct typed_flags<RscToolboxItemFlags> : is_typed_flags<RscToolboxItemFlags, 0xd1f> {};
-}
-
-// For "ToolBox" resources:
-enum class RscToolboxFlags {
- ButtonType = 0x01,
- Align = 0x02,
- LineCount = 0x04,
- ItemList = 0x80
-};
-namespace o3tl {
- template<> struct typed_flags<RscToolboxFlags> : is_typed_flags<RscToolboxFlags, 0x87> {};
-}
-
// For "DockingWindow" resources:
#define RSC_DOCKINGWINDOW_XYMAPMODE 0x01
#define RSC_DOCKINGWINDOW_X 0x02
commit 4cc4df51d962a9631da282d18e59aada35788a72
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Oct 12 10:19:11 2016 +0100
no toolboxes are loaded from .src anymore
Change-Id: Ia2eabf157845b9b6b00b745332a558ffdd1e0ec7
diff --git a/include/tools/rcid.h b/include/tools/rcid.h
index 356c7b2..a96d3cc 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 cdc368d..5024e08 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 30117dc..2500f2d 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 beba5ad..1908e0d 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 5761dd5..14730fd 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 d55926e..0ac1418 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 12239a5..af98244 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" );
More information about the Libreoffice-commits
mailing list