cui/source/dialogs/about.cxx | 15 ++------------- include/tools/rc.h | 10 ++++------ include/vcl/window.hxx | 3 --- rsc/source/parser/rscicpx.cxx | 18 ------------------ svx/source/tbxctrls/fillctrl.cxx | 3 --- sw/source/ui/dbui/createaddresslistdialog.cxx | 13 ++++++------- sw/source/uibase/inc/docstdlg.hxx | 1 - vcl/inc/window.h | 1 - vcl/source/window/resource.cxx | 11 ----------- vcl/source/window/window.cxx | 1 - vcl/source/window/window2.cxx | 10 ---------- 11 files changed, 12 insertions(+), 74 deletions(-)
New commits: commit 86ac0bd31464bd802d4367f2152e7f8e0e9506e9 Author: Caolán McNamara <[email protected]> Date: Wed May 25 14:42:05 2016 +0100 Window::SetData and Window::GetData are nearly unused now except for.. a) one use in sw which we can replace with a map b) one use in svx which didn't do anything c) one amusing piece of crazy in cui Change-Id: If66d9f7eab1eaddfb2bdab7815c3a6f22f4d7745 diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx index de838b0..89e83b5 100644 --- a/cui/source/dialogs/about.cxx +++ b/cui/source/dialogs/about.cxx @@ -53,12 +53,6 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; using namespace ::com::sun::star; -enum AboutDialogButton -{ - CREDITS_BUTTON, - WEBSITE_BUTTON -}; - AboutDialog::AboutDialog(vcl::Window* pParent) : SfxModalDialog(pParent, "AboutDialog", "cui/ui/aboutdialog.ui") { @@ -87,10 +81,6 @@ AboutDialog::AboutDialog(vcl::Window* pParent) SetLogo(); - // Allow the button to be identifiable once they are clicked - m_pCreditsButton->SetData( reinterpret_cast<void*>(CREDITS_BUTTON) ); - m_pWebsiteButton->SetData( reinterpret_cast<void*>(WEBSITE_BUTTON) ); - // Connect all handlers m_pCreditsButton->SetClickHdl( LINK( this, AboutDialog, HandleClick ) ); m_pWebsiteButton->SetClickHdl( LINK( this, AboutDialog, HandleClick ) ); @@ -120,10 +110,9 @@ IMPL_LINK_TYPED( AboutDialog, HandleClick, Button*, pButton, void ) OUString sURL = ""; // Find which button was pressed and from this, get the URL to be opened - AboutDialogButton aDialogButton = static_cast<AboutDialogButton>(reinterpret_cast<sal_Int64>(pButton->GetData())); - if ( aDialogButton == CREDITS_BUTTON ) + if (pButton == m_pCreditsButton) sURL = m_aCreditsLinkStr; - else if ( aDialogButton == WEBSITE_BUTTON ) + else if (pButton == m_pWebsiteButton) { sURL = officecfg::Office::Common::Help::StartCenter::InfoURL::get(); localizeWebserviceURI(sURL); diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index a2f3276..dea60a9 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -1187,9 +1187,6 @@ public: bool IsChild( const vcl::Window* pWindow, bool bSystemWindow = false ) const; bool IsWindowOrChild( const vcl::Window* pWindow, bool bSystemWindow = false ) const; - void SetData( void* pNewData ); - void* GetData() const; - /// Add all children to rAllChildren recursively. SAL_DLLPRIVATE void CollectChildren(::std::vector<vcl::Window *>& rAllChildren ); diff --git a/svx/source/tbxctrls/fillctrl.cxx b/svx/source/tbxctrls/fillctrl.cxx index a1e1f95..9d3bfb0 100644 --- a/svx/source/tbxctrls/fillctrl.cxx +++ b/svx/source/tbxctrls/fillctrl.cxx @@ -538,9 +538,6 @@ VclPtr<vcl::Window> SvxFillToolBoxControl::CreateItemWindow(vcl::Window *pParent if(GetSlotId() == SID_ATTR_FILL_STYLE) { mpFillControl.reset(VclPtr<FillControl>::Create(pParent)); - // Thus the FillControl is known by SvxFillToolBoxControl - // (and in order to remain compatible) - mpFillControl->SetData(this); mpLbFillType = mpFillControl->mpLbFillType; mpLbFillAttr = mpFillControl->mpLbFillAttr; diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx index 06d4974..b54d9e3 100644 --- a/sw/source/ui/dbui/createaddresslistdialog.cxx +++ b/sw/source/ui/dbui/createaddresslistdialog.cxx @@ -49,8 +49,9 @@ class SwAddressControl_Impl : public Control VclPtr<ScrollBar> m_pScrollBar; VclPtr<Window> m_pWindow; - ::std::vector<VclPtr<FixedText> > m_aFixedTexts; - ::std::vector<VclPtr<Edit> > m_aEdits; + std::vector<VclPtr<FixedText> > m_aFixedTexts; + std::vector<VclPtr<Edit> > m_aEdits; + std::map<Edit*, sal_Int32> m_aEditLines; SwCSVData* m_pData; Size m_aWinOutputSize; @@ -69,8 +70,6 @@ class SwAddressControl_Impl : public Control virtual void Command( const CommandEvent& rCEvt ) override; virtual Size GetOptimalSize() const override; - using Window::SetData; - public: SwAddressControl_Impl(vcl::Window* pParent , WinBits nBits ); virtual ~SwAddressControl_Impl(); @@ -177,7 +176,7 @@ void SwAddressControl_Impl::SetData(SwCSVData& rDBData) Link<Edit&,void> aEditModifyLink = LINK(this, SwAddressControl_Impl, EditModifyHdl_Impl); Edit* pLastEdit = nullptr; sal_Int32 nVisibleLines = 0; - sal_uIntPtr nLines = 0; + sal_Int32 nLines = 0; for(aHeaderIter = m_pData->aDBColumnHeaders.begin(); aHeaderIter != m_pData->aDBColumnHeaders.end(); ++aHeaderIter, nEDYPos += m_nLineHeight, nFTYPos += m_nLineHeight, nLines++) @@ -185,7 +184,7 @@ void SwAddressControl_Impl::SetData(SwCSVData& rDBData) VclPtr<FixedText> pNewFT = VclPtr<FixedText>::Create(m_pWindow, WB_RIGHT); VclPtr<Edit> pNewED = VclPtr<Edit>::Create(m_pWindow, WB_BORDER); //set nLines a position identifier - used in the ModifyHdl - pNewED->SetData(reinterpret_cast<void*>(nLines)); + m_aEditLines[pNewED.get()] = nLines; pNewED->SetGetFocusHdl(aFocusLink); pNewED->SetModifyHdl(aEditModifyLink); @@ -302,7 +301,7 @@ void SwAddressControl_Impl::MakeVisible(const Rectangle & rRect) IMPL_LINK_TYPED(SwAddressControl_Impl, EditModifyHdl_Impl, Edit&, rEdit, void) { //get the data element number of the current set - sal_Int32 nIndex = (sal_Int32)reinterpret_cast<sal_IntPtr>(rEdit.GetData()); + sal_Int32 nIndex = m_aEditLines[&rEdit]; //get the index of the set OSL_ENSURE(m_pData->aDBData.size() > m_nCurrentDataSet, "wrong data set index" ); if(m_pData->aDBData.size() > m_nCurrentDataSet) diff --git a/sw/source/uibase/inc/docstdlg.hxx b/sw/source/uibase/inc/docstdlg.hxx index abfee6d..ea504d7 100644 --- a/sw/source/uibase/inc/docstdlg.hxx +++ b/sw/source/uibase/inc/docstdlg.hxx @@ -60,7 +60,6 @@ private: void Update(); - using Window::SetData; void SetData(const SwDocStat &rStat); }; diff --git a/vcl/inc/window.h b/vcl/inc/window.h index 0ff197a..be5f0a9 100644 --- a/vcl/inc/window.h +++ b/vcl/inc/window.h @@ -212,7 +212,6 @@ public: // The canvas interface for this VCL window. Is persistent after the first GetCanvas() call css::uno::WeakReference< css::rendering::XCanvas > mxCanvas; - void* mpUserData; vcl::Cursor* mpCursor; Pointer maPointer; Fraction maZoom; diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 623275b..83ae01c 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -606,7 +606,6 @@ WindowImpl::WindowImpl( WindowType nType ) mpDlgCtrlDownWindow = nullptr; // window for dialog control mnEventListenersIteratingCount = 0; mnChildEventListenersIteratingCount = 0; - mpUserData = nullptr; // user data mpCursor = nullptr; // cursor mpControlFont = nullptr; // font properties mpVCLXWindow = nullptr; diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index 95a6e1d..cd67ca6 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -1304,16 +1304,6 @@ const OUString& Window::GetQuickHelpText() const return mpWindowImpl->maQuickHelpText; } -void Window::SetData( void* pNewData ) -{ - mpWindowImpl->mpUserData = pNewData; -} - -void* Window::GetData() const -{ - return mpWindowImpl->mpUserData; -} - bool Window::IsCreatedWithToolkit() const { return mpWindowImpl->mbCreatedWithToolkit; commit 8d1295a104235ce003c9f44fc24072985706290f Author: Caolán McNamara <[email protected]> Date: Wed May 25 14:37:45 2016 +0100 new src file has ExtraLong in use anymore Change-Id: I1d31fb41a8f7def6a95a46dd61d0be4b608c6994 diff --git a/include/tools/rc.h b/include/tools/rc.h index 06cd377..b1fd2c0 100644 --- a/include/tools/rc.h +++ b/include/tools/rc.h @@ -44,11 +44,10 @@ namespace o3tl { #define WINDOW_WHMAPMODE 0x0008 #define WINDOW_WIDTH 0x0010 #define WINDOW_HEIGHT 0x0020 -#define WINDOW_TEXT 0x0080 -#define WINDOW_HELPTEXT 0x0100 -#define WINDOW_QUICKTEXT 0x0200 -#define WINDOW_EXTRALONG 0x0800 -#define WINDOW_HELPID 0x1000 +#define WINDOW_TEXT 0x0040 +#define WINDOW_HELPTEXT 0x0080 +#define WINDOW_QUICKTEXT 0x0100 +#define WINDOW_HELPID 0x0200 // For "WorkWindow" resources: diff --git a/rsc/source/parser/rscicpx.cxx b/rsc/source/parser/rscicpx.cxx index f094b3e..adff902 100644 --- a/rsc/source/parser/rscicpx.cxx +++ b/rsc/source/parser/rscicpx.cxx @@ -278,8 +278,6 @@ RscTop * RscTypCont::InitClassWindow( RscTop * pSuper, RscEnum * pMapUnit, pClassWindow->SetVariable( nId, &aLangString, nullptr, 0, WINDOW_HELPTEXT ); nId = aNmTb.Put( "QuickHelpText", VARNAME ); pClassWindow->SetVariable( nId, &aLangString, nullptr, 0, WINDOW_QUICKTEXT ); - nId = aNmTb.Put( "ExtraLong", VARNAME ); - pClassWindow->SetVariable( nId, &aLong, nullptr, 0, WINDOW_EXTRALONG ); return pClassWindow; } diff --git a/vcl/source/window/resource.cxx b/vcl/source/window/resource.cxx index 9d47801..5f627e8 100644 --- a/vcl/source/window/resource.cxx +++ b/vcl/source/window/resource.cxx @@ -141,11 +141,6 @@ void Window::ImplLoadRes( const ResId& rResId ) } if ( nObjMask & WINDOW_QUICKTEXT ) SetQuickHelpText( ReadStringRes() ); - if ( nObjMask & WINDOW_EXTRALONG ) - { - sal_uIntPtr nRes = ReadLongRes(); - SetData( reinterpret_cast<void*>(nRes) ); - } } } /* namespace vcl */ commit bad1f11fff68ad204521a2dfb42dcd4a315a32b6 Author: Caolán McNamara <[email protected]> Date: Wed May 25 14:35:02 2016 +0100 no src file has BorderStyle in use anymore Change-Id: Id2d2d845c73a7c83bef2e66ede542e99b0475af8 diff --git a/include/tools/rc.h b/include/tools/rc.h index b84e6e2..06cd377 100644 --- a/include/tools/rc.h +++ b/include/tools/rc.h @@ -48,8 +48,7 @@ namespace o3tl { #define WINDOW_HELPTEXT 0x0100 #define WINDOW_QUICKTEXT 0x0200 #define WINDOW_EXTRALONG 0x0800 -#define WINDOW_BORDER_STYLE 0x1000 -#define WINDOW_HELPID 0x2000 +#define WINDOW_HELPID 0x1000 // For "WorkWindow" resources: diff --git a/rsc/source/parser/rscicpx.cxx b/rsc/source/parser/rscicpx.cxx index cf4e9e0..f094b3e 100644 --- a/rsc/source/parser/rscicpx.cxx +++ b/rsc/source/parser/rscicpx.cxx @@ -281,22 +281,6 @@ RscTop * RscTypCont::InitClassWindow( RscTop * pSuper, RscEnum * pMapUnit, nId = aNmTb.Put( "ExtraLong", VARNAME ); pClassWindow->SetVariable( nId, &aLong, nullptr, 0, WINDOW_EXTRALONG ); - // border style - RscEnum* pBorderStyleEnum = new RscEnum( pHS->getID( "WindowBorderStyle" ), RSC_NOTYPE ); - aBaseLst.push_back( pBorderStyleEnum ); - - // set constants in table - SETCONST( pBorderStyleEnum, pHS->getID( "WINDOW_BORDER_NORMAL" ), WindowBorderStyle::NORMAL ); - SETCONST( pBorderStyleEnum, pHS->getID( "WINDOW_BORDER_MONO" ), WindowBorderStyle::MONO ); - SETCONST( pBorderStyleEnum, pHS->getID( "WINDOW_BORDER_MENU" ), WindowBorderStyle::MENU ); - SETCONST( pBorderStyleEnum, pHS->getID( "WINDOW_BORDER_NOBORDER" ), WindowBorderStyle::NOBORDER ); - - // add variable - nId = aNmTb.Put( "BorderStyle", VARNAME ); - pClassWindow->SetVariable( nId, pBorderStyleEnum, nullptr, - 0, - WINDOW_BORDER_STYLE ); - return pClassWindow; } diff --git a/vcl/source/window/resource.cxx b/vcl/source/window/resource.cxx index fba41a6..9d47801 100644 --- a/vcl/source/window/resource.cxx +++ b/vcl/source/window/resource.cxx @@ -146,12 +146,6 @@ void Window::ImplLoadRes( const ResId& rResId ) sal_uIntPtr nRes = ReadLongRes(); SetData( reinterpret_cast<void*>(nRes) ); } - - if ( nObjMask & WINDOW_BORDER_STYLE ) - { - sal_uInt16 nBorderStyle = (sal_uInt16)ReadLongRes(); - SetBorderStyle( static_cast<WindowBorderStyle>(nBorderStyle) ); - } } } /* namespace vcl */
_______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
