diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-05-25 14:42:05 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-05-25 15:51:31 +0100 |
commit | 86ac0bd31464bd802d4367f2152e7f8e0e9506e9 (patch) | |
tree | a3643b2bd71fdf8daa658e963d7edc92054610a7 | |
parent | new src file has ExtraLong in use anymore (diff) | |
download | core-86ac0bd31464bd802d4367f2152e7f8e0e9506e9.tar.gz core-86ac0bd31464bd802d4367f2152e7f8e0e9506e9.zip |
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
-rw-r--r-- | cui/source/dialogs/about.cxx | 15 | ||||
-rw-r--r-- | include/vcl/window.hxx | 3 | ||||
-rw-r--r-- | svx/source/tbxctrls/fillctrl.cxx | 3 | ||||
-rw-r--r-- | sw/source/ui/dbui/createaddresslistdialog.cxx | 13 | ||||
-rw-r--r-- | sw/source/uibase/inc/docstdlg.hxx | 1 | ||||
-rw-r--r-- | vcl/inc/window.h | 1 | ||||
-rw-r--r-- | vcl/source/window/window.cxx | 1 | ||||
-rw-r--r-- | vcl/source/window/window2.cxx | 10 |
8 files changed, 8 insertions, 39 deletions
diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx index de838b0d2bf5..89e83b5a0dc9 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 a2f3276ceefc..dea60a940d06 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 a1e1f9584e1b..9d3bfb067ae1 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 06d4974c78ed..b54d9e331068 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 abfee6d91d24..ea504d78b85d 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 0ff197a9092c..be5f0a91a9f5 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 623275beb0d8..83ae01cd4bf0 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 95a6e1de8794..cd67ca6e72f4 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; |