summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2014-04-28 16:45:06 +0300
committerTor Lillqvist <tml@collabora.com>2014-04-28 18:06:15 +0300
commitd87b312bcc8a5e64d9a5d0ea647a1050629421bd (patch)
treeb13b2b3f0eba249566248534acd191209529f2bc /sw
parentc921717bbe4102e6ff86e914209a844639c510a0 (diff)
Avoid SvxSearchDialogWrapper for non-desktop
Change-Id: Ie602ac05caafba132d9c41333d034a5621664c13
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/uibase/uiview/viewsrch.cxx28
-rw-r--r--sw/source/core/view/viewsh.cxx2
2 files changed, 28 insertions, 2 deletions
diff --git a/sw/source/core/uibase/uiview/viewsrch.cxx b/sw/source/core/uibase/uiview/viewsrch.cxx
index d9bb583119be..6dd8370d8b7e 100644
--- a/sw/source/core/uibase/uiview/viewsrch.cxx
+++ b/sw/source/core/uibase/uiview/viewsrch.cxx
@@ -17,6 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <config_features.h>
+
#include <string>
#include <boost/scoped_ptr.hpp>
@@ -189,6 +191,7 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage)
if( bRet )
Scroll(m_pWrtShell->GetCharRect().SVRect());
rReq.SetReturnValue(SfxBoolItem(nSlot, bRet));
+#if HAVE_FEATURE_DESKTOP
{
const sal_uInt16 nChildId = SvxSearchDialogWrapper::GetChildWindowId();
SvxSearchDialogWrapper *pDlgWrp = (SvxSearchDialogWrapper*)GetViewFrame()->GetChildWindow(nChildId);
@@ -199,6 +202,7 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage)
m_pSrchDlg->SetSrchFlag();
}
}
+#endif
}
break;
case SVX_SEARCHCMD_FIND_ALL:
@@ -206,11 +210,14 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage)
sal_Bool bRet = SearchAll();
if( !bRet )
{
+#if HAVE_FEATURE_DESKTOP
if( !bApi )
SvxSearchDialogWrapper::SetSearchLabel(SL_NotFound);
+#endif
m_bFound = sal_False;
}
rReq.SetReturnValue(SfxBoolItem(nSlot, bRet));
+#if HAVE_FEATURE_DESKTOP
{
const sal_uInt16 nChildId = SvxSearchDialogWrapper::GetChildWindowId();
SvxSearchDialogWrapper *pDlgWrp = (SvxSearchDialogWrapper*)GetViewFrame()->GetChildWindow(nChildId);
@@ -222,6 +229,7 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage)
m_pSrchDlg->SetSrchFlag();
}
}
+#endif
}
break;
case SVX_SEARCHCMD_REPLACE:
@@ -270,6 +278,7 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage)
m_pSrchItem->SetCommand( nOldCmd );
rReq.SetReturnValue(SfxBoolItem(nSlot, bRet));
}
+#if HAVE_FEATURE_DESKTOP
{
const sal_uInt16 nChildId = SvxSearchDialogWrapper::GetChildWindowId();
SvxSearchDialogWrapper *pDlgWrp = (SvxSearchDialogWrapper*)GetViewFrame()->GetChildWindow(nChildId);
@@ -281,6 +290,7 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage)
m_pSrchDlg->SetSrchFlag();
}
}
+#endif
break;
case SVX_SEARCHCMD_REPLACE_ALL:
@@ -322,8 +332,10 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage)
rReq.SetReturnValue(SfxBoolItem(nSlot, nFound != 0 && ULONG_MAX != nFound));
if( !nFound )
{
+#if HAVE_FEATURE_DESKTOP
if( !bApi )
SvxSearchDialogWrapper::SetSearchLabel(SL_NotFound);
+#endif
m_bFound = sal_False;
return;
}
@@ -336,6 +348,7 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage)
InfoBox( pParentWindow, aText ).Execute();
}
}
+#if HAVE_FEATURE_DESKTOP
const sal_uInt16 nChildId = SvxSearchDialogWrapper::GetChildWindowId();
SvxSearchDialogWrapper *pDlgWrp = (SvxSearchDialogWrapper*)GetViewFrame()->GetChildWindow(nChildId);
@@ -345,6 +358,7 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage)
m_pSrchDlg->SetDocWin( (Window*)m_pEditWin);
m_pSrchDlg->SetSrchFlag();
}
+#endif
break;
}
@@ -494,7 +508,11 @@ sal_Bool SwView::SearchAndWrap(sal_Bool bApi)
{
m_pWrtShell->EndAllAction();
if( !bApi )
+ {
+#if HAVE_FEATURE_DESKTOP
SvxSearchDialogWrapper::SetSearchLabel(SL_NotFound);
+#endif
+ }
m_bFound = sal_False;
m_pWrtShell->Pop();
return sal_False;
@@ -523,11 +541,12 @@ sal_Bool SwView::SearchAndWrap(sal_Bool bApi)
m_bFound = bool(FUNC_Search( aOpts ));
m_pWrtShell->EndAllAction();
pWait.reset();
-
+#if HAVE_FEATURE_DESKTOP
if (m_bFound)
SvxSearchDialogWrapper::SetSearchLabel(SL_End);
else if(!bApi)
SvxSearchDialogWrapper::SetSearchLabel(SL_NotFound);
+#endif
return m_bFound;
}
@@ -669,8 +688,9 @@ SwSearchOptions::SwSearchOptions( SwWrtShell* pSh, sal_Bool bBackward )
sal_uLong SwView::FUNC_Search( const SwSearchOptions& rOptions )
{
+#if HAVE_FEATURE_DESKTOP
SvxSearchDialogWrapper::SetSearchLabel(SL_Empty);
-
+#endif
sal_Bool bDoReplace = m_pSrchItem->GetCommand() == SVX_SEARCHCMD_REPLACE ||
m_pSrchItem->GetCommand() == SVX_SEARCHCMD_REPLACE_ALL;
@@ -756,10 +776,14 @@ sal_uLong SwView::FUNC_Search( const SwSearchOptions& rOptions )
SvxSearchDialog* SwView::GetSearchDialog()
{
+#if HAVE_FEATURE_DESKTOP
const sal_uInt16 nId = SvxSearchDialogWrapper::GetChildWindowId();
SvxSearchDialogWrapper *pWrp = (SvxSearchDialogWrapper*) SfxViewFrame::Current()->GetChildWindow(nId);
m_pSrchDlg = pWrp ? pWrp->getDialog () : 0;
return m_pSrchDlg;
+#else
+ return NULL;
+#endif
}
void SwView::StateSearch(SfxItemSet &rSet)
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 5edacaef09fd..b46d07108f2f 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -556,12 +556,14 @@ Window* SwViewShell::CareChildWin(SwViewShell& rVSh)
{
if(rVSh.mpSfxViewShell)
{
+#if HAVE_FEATURE_DESKTOP
const sal_uInt16 nId = SvxSearchDialogWrapper::GetChildWindowId();
SfxViewFrame* pVFrame = rVSh.mpSfxViewShell->GetViewFrame();
const SfxChildWindow* pChWin = pVFrame->GetChildWindow( nId );
Window *pWin = pChWin ? pChWin->GetWindow() : NULL;
if ( pWin && pWin->IsVisible() )
return pWin;
+#endif
}
return NULL;
}