summaryrefslogtreecommitdiffstats
path: root/sw
diff options
context:
space:
mode:
authorRobert Roth <robert.roth.off@gmail.com>2013-01-28 03:53:55 +0200
committerCaolán McNamara <caolanm@redhat.com>2013-01-28 09:39:30 +0000
commita29032c951c53ac889de2a7644ae4ac9beef28dc (patch)
tree57f9f255b4d2a13e0c7888cd5a4ea8dcdbb66cad /sw
parentRemoved empty autocorr.src file (diff)
downloadcore-a29032c951c53ac889de2a7644ae4ac9beef28dc.tar.gz
core-a29032c951c53ac889de2a7644ae4ac9beef28dc.zip
Show meaningful title for search key not found infobox, fdo#59865
Change-Id: I5c99fc98552be705ddcb163320521620bdcbf7ef
Diffstat (limited to 'sw')
-rw-r--r--sw/source/ui/uiview/viewsrch.cxx29
1 files changed, 21 insertions, 8 deletions
diff --git a/sw/source/ui/uiview/viewsrch.cxx b/sw/source/ui/uiview/viewsrch.cxx
index 9cad97bcb9b3..8e1f9c3f43ae 100644
--- a/sw/source/ui/uiview/viewsrch.cxx
+++ b/sw/source/ui/uiview/viewsrch.cxx
@@ -37,6 +37,8 @@
#include <sal/macros.h>
#include <sfx2/request.hxx>
#include <svx/srchdlg.hxx>
+#include <svx/dialmgr.hxx>
+#include <svx/dialogs.hrc>
#include <vcl/msgbox.hxx>
#include <vcl/wrkwin.hxx>
#include "editeng/unolingu.hxx"
@@ -87,6 +89,21 @@ inline Window* GetParentWindow( SvxSearchDialog* pSrchDlg )
return pWin;
}
+inline void ShowNotFoundInfoBox( SvxSearchDialog* pSrchDlg )
+{
+ Window* pParentWindow = GetParentWindow( pSrchDlg );
+ InfoBox aBox( pParentWindow, SW_RES(MSG_NOT_FOUND));
+ if (pParentWindow)
+ {
+ aBox.SetText(pParentWindow->GetText());
+ }
+ else
+ {
+ aBox.SetText(SVX_RESSTR(RID_SVXSTR_FINDBAR_FIND));
+ }
+ aBox.Execute();
+}
+
void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage)
{
const SfxItemSet* pArgs = rReq.GetArgs();
@@ -211,8 +228,7 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage)
{
if( !bApi )
{
- Window* pParentWindow = GetParentWindow( pSrchDlg );
- InfoBox( pParentWindow, SW_RES(MSG_NOT_FOUND)).Execute();
+ ShowNotFoundInfoBox( pSrchDlg );
}
bFound = sal_False;
}
@@ -311,8 +327,7 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage)
{
if( !bApi )
{
- Window* pParentWindow = GetParentWindow( pSrchDlg );
- InfoBox( pParentWindow, SW_RES(MSG_NOT_FOUND)).Execute();
+ ShowNotFoundInfoBox( pSrchDlg );
}
bFound = sal_False;
return;
@@ -483,8 +498,7 @@ sal_Bool SwView::SearchAndWrap(sal_Bool bApi)
pWrtShell->EndAllAction();
if( !bApi )
{
- Window* pParentWindow = GetParentWindow( pSrchDlg );
- InfoBox( pParentWindow, SW_RES(MSG_NOT_FOUND)).Execute();
+ ShowNotFoundInfoBox( pSrchDlg );
}
bFound = sal_False;
pWrtShell->Pop();
@@ -528,8 +542,7 @@ sal_Bool SwView::SearchAndWrap(sal_Bool bApi)
return bFound;
if(!bApi)
{
- Window* pParentWindow = GetParentWindow( pSrchDlg );
- InfoBox( pParentWindow, SW_RES(MSG_NOT_FOUND)).Execute();
+ ShowNotFoundInfoBox( pSrchDlg );
}
return bFound = sal_False;
}