diff options
author | Matúš Kukan <matus.kukan@collabora.com> | 2014-02-04 18:16:37 +0100 |
---|---|---|
committer | Matúš Kukan <matus.kukan@collabora.com> | 2014-02-05 19:09:41 +0100 |
commit | 4784e94cec2e8f96a08add2f19f482057058b2eb (patch) | |
tree | b56aced5a8a3ec617d14db312b4a68472c3af2bd /sw | |
parent | ac789ae775d30e97e13da6e82360f47d9d9cdff2 (diff) |
GetSearchDialog() returns SvxSearchDialog; and use it in more places too.
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/mdiexp.hxx | 3 | ||||
-rw-r--r-- | sw/source/core/crsr/viscrs.cxx | 3 | ||||
-rw-r--r-- | sw/source/ui/docvw/edtwin3.cxx | 5 | ||||
-rw-r--r-- | sw/source/ui/inc/view.hxx | 2 | ||||
-rw-r--r-- | sw/source/ui/uiview/viewsrch.cxx | 35 |
5 files changed, 11 insertions, 37 deletions
diff --git a/sw/inc/mdiexp.hxx b/sw/inc/mdiexp.hxx index fe7b902de44b..4c715c700f5c 100644 --- a/sw/inc/mdiexp.hxx +++ b/sw/inc/mdiexp.hxx @@ -26,7 +26,6 @@ class SwRect; class Size; -class Dialog; class SwViewShell; class SwDoc; class SwDocShell; @@ -52,8 +51,6 @@ void RescheduleProgress( SwDocShell *pDocShell ); void EnableCmdInterface(sal_Bool bEnable = sal_True); -Dialog* GetSearchDialog(); - void RepaintPagePreview( SwViewShell* pVwSh, const SwRect& rRect ); // ndgrf.cxx diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx index d88c3a9e3438..0d410f8df29f 100644 --- a/sw/source/core/crsr/viscrs.cxx +++ b/sw/source/core/crsr/viscrs.cxx @@ -40,6 +40,7 @@ #include <mdiexp.hxx> #include <wrtsh.hxx> #include <comcore.hrc> +#include <view.hxx> #include <svx/sdr/overlay/overlaymanager.hxx> #include <svx/sdrpaintwindow.hxx> @@ -584,7 +585,7 @@ SwCursor* SwShellCrsr::Create( SwPaM* pRing ) const short SwShellCrsr::MaxReplaceArived() { short nRet = RET_YES; - Window* pDlg = ::GetSearchDialog(); + Window* pDlg = (Window*) SwView::GetSearchDialog(); if( pDlg ) { // Terminate old actions. The table-frames get constructed and diff --git a/sw/source/ui/docvw/edtwin3.cxx b/sw/source/ui/docvw/edtwin3.cxx index 1ca1025a6c8d..36ea5e4d49f2 100644 --- a/sw/source/ui/docvw/edtwin3.cxx +++ b/sw/source/ui/docvw/edtwin3.cxx @@ -130,11 +130,6 @@ void SwAccessibilityScrollMDI(SwViewShell* pVwSh, const SwRect& rRect , sal_uInt } -Dialog* GetSearchDialog() -{ - return SwView::GetSearchDialog(); -} - TblChgMode GetTblChgDefaultMode() { SwModuleOptions* pOpt = SW_MOD()->GetModuleConfig(); diff --git a/sw/source/ui/inc/view.hxx b/sw/source/ui/inc/view.hxx index d6b68223f89a..2bcb9b596c0f 100644 --- a/sw/source/ui/inc/view.hxx +++ b/sw/source/ui/inc/view.hxx @@ -483,7 +483,7 @@ public: void CheckVisArea(); void RecheckBrowseMode(); - static Dialog* GetSearchDialog(); + static SvxSearchDialog* GetSearchDialog(); static sal_uInt16 GetMoveType(); static void SetMoveType(sal_uInt16 nSet); diff --git a/sw/source/ui/uiview/viewsrch.cxx b/sw/source/ui/uiview/viewsrch.cxx index f9ca08122714..1f6682390409 100644 --- a/sw/source/ui/uiview/viewsrch.cxx +++ b/sw/source/ui/uiview/viewsrch.cxx @@ -77,22 +77,15 @@ struct SwSearchOptions SwSearchOptions( SwWrtShell* pSh, sal_Bool bBackward ); }; -static Window* GetParentWindow( SvxSearchDialog* m_pSrchDlg ) +static Window* GetParentWindow( SvxSearchDialog* pSrchDlg ) { - Window* pWin; - if( m_pSrchDlg && m_pSrchDlg->IsVisible() ) - pWin = m_pSrchDlg; - else - pWin = 0; - return pWin; + return pSrchDlg && pSrchDlg->IsVisible() ? pSrchDlg : 0; } void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage) { const SfxItemSet* pArgs = rReq.GetArgs(); const SfxPoolItem* pItem = 0; - const sal_uInt16 nId = SvxSearchDialogWrapper::GetChildWindowId(); - SvxSearchDialogWrapper *pWrp = (SvxSearchDialogWrapper*)GetViewFrame()->GetChildWindow(nId); sal_Bool bQuiet = sal_False; if(pArgs && SFX_ITEM_SET == pArgs->GetItemState(SID_SEARCH_QUIET, sal_False, &pItem)) bQuiet = ((const SfxBoolItem*) pItem)->GetValue(); @@ -135,9 +128,9 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage) DELETEZ( m_pSrchList ); DELETEZ( m_pReplList ); - if ( pWrp ) + m_pSrchDlg = GetSearchDialog(); + if (m_pSrchDlg) { - m_pSrchDlg = static_cast <SvxSearchDialog*> (pWrp->getDialog ()); // We will remember the search-/replace items. const SearchAttrItemList* pList = m_pSrchDlg->GetSearchItemList(); if( pList && pList->Count() ) @@ -156,14 +149,9 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage) { if(FID_SEARCH_NOW == nSlot && !rReq.IsAPI()) SwView::SetMoveType(NID_SRCH_REP); - if ( pWrp ) - { - m_pSrchDlg = static_cast <SvxSearchDialog*> (pWrp->getDialog ()); - } - else - m_pSrchDlg = 0; } + m_pSrchDlg = GetSearchDialog(); if (m_pSrchDlg) { DELETEZ( m_pSrchList ); @@ -503,10 +491,6 @@ sal_Bool SwView::SearchAndWrap(sal_Bool bApi) else m_bExtra = !m_bExtra; - const sal_uInt16 nId = SvxSearchDialogWrapper::GetChildWindowId(); - SvxSearchDialogWrapper *pDlgWrp = (SvxSearchDialogWrapper*)GetViewFrame()->GetChildWindow(nId); - m_pSrchDlg = pDlgWrp ? static_cast <SvxSearchDialog*> (pDlgWrp->getDialog ()) : 0; - // If starting position is at the end or beginning of the document. if (aOpts.bDontWrap) { @@ -775,14 +759,11 @@ sal_uLong SwView::FUNC_Search( const SwSearchOptions& rOptions ) return nFound; } -Dialog* SwView::GetSearchDialog() +SvxSearchDialog* SwView::GetSearchDialog() { const sal_uInt16 nId = SvxSearchDialogWrapper::GetChildWindowId(); - SvxSearchDialogWrapper *pWrp = (SvxSearchDialogWrapper*)SfxViewFrame::Current()->GetChildWindow(nId); - if ( pWrp ) - m_pSrchDlg = pWrp->getDialog (); - else - m_pSrchDlg = 0; + SvxSearchDialogWrapper *pWrp = (SvxSearchDialogWrapper*) SfxViewFrame::Current()->GetChildWindow(nId); + m_pSrchDlg = pWrp ? pWrp->getDialog () : 0; return m_pSrchDlg; } |