summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/svx/dialogs.hrc2
-rw-r--r--include/svx/srchdlg.hxx11
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu11
-rw-r--r--svx/inc/tbunosearchcontrollers.hxx32
-rw-r--r--svx/source/dialog/srchdlg.cxx52
-rw-r--r--svx/source/dialog/srchdlg.src8
-rw-r--r--svx/source/tbxctrls/tbunosearchcontrollers.cxx102
-rw-r--r--svx/uiconfig/ui/findreplacedialog.ui2
-rw-r--r--svx/util/svx.component4
-rw-r--r--sw/source/ui/uiview/viewsrch.cxx63
-rw-r--r--sw/uiconfig/sglobal/toolbar/findbar.xml2
-rw-r--r--sw/uiconfig/sweb/toolbar/findbar.xml2
-rw-r--r--sw/uiconfig/swriter/toolbar/findbar.xml1
-rw-r--r--sw/uiconfig/swxform/toolbar/findbar.xml2
14 files changed, 231 insertions, 63 deletions
diff --git a/include/svx/dialogs.hrc b/include/svx/dialogs.hrc
index 2bf58e7f7c2b..e0d70950f37b 100644
--- a/include/svx/dialogs.hrc
+++ b/include/svx/dialogs.hrc
@@ -242,11 +242,13 @@
#define RID_SVXSTR_LANGUAGE_ALL (RID_SVX_START + 15)
// Strings from the search dialog
+#define RID_SVXSTR_SEARCH_END (RID_SVX_START + 79)
#define RID_SVXSTR_SEARCH_STYLES (RID_SVX_START + 80)
#define RID_SVXSTR_SEARCH (RID_SVX_START + 81)
#define RID_SVXSTR_REPLACE (RID_SVX_START + 82)
#define RID_SVXSTR_WRITER_STYLES (RID_SVX_START + 83)
#define RID_SVXSTR_CALC_STYLES (RID_SVX_START + 85)
+#define RID_SVXSTR_SEARCH_NOT_FOUND (RID_SVX_START + 88)
// ResIds for the PageDialog
// Strings of the ToolBox-Controls from tbcontrl.cxx
diff --git a/include/svx/srchdlg.hxx b/include/svx/srchdlg.hxx
index b6401009f2d8..50f7d6366254 100644
--- a/include/svx/srchdlg.hxx
+++ b/include/svx/srchdlg.hxx
@@ -79,6 +79,13 @@ public:
// class SvxSearchDialogWrapper ------------------------------------------
+enum SearchLabel
+{
+ SL_Empty,
+ SL_NotFound,
+ SL_End
+};
+
class SvxSearchDialog;
class SVX_DLLPUBLIC SvxSearchDialogWrapper : public SfxChildWindow
{
@@ -89,6 +96,7 @@ public:
~SvxSearchDialogWrapper ();
SvxSearchDialog *getDialog ();
+ static void SetSearchLabel(const SearchLabel& rSL);
SFX_DECL_CHILDWINDOW_WITHID(SvxSearchDialogWrapper);
};
@@ -139,6 +147,8 @@ public:
void SetSaveToModule(bool b);
+ void SetSearchLabel(const OUString& rStr) { m_pSearchLabel->SetText(rStr); }
+
private:
Window* mpDocWin;
sal_Bool mbSuccess;
@@ -147,6 +157,7 @@ private:
ComboBox* m_pSearchLB;
ListBox* m_pSearchTmplLB;
FixedText* m_pSearchAttrText;
+ FixedText* m_pSearchLabel;
VclFrame* m_pReplaceFrame;
ComboBox* m_pReplaceLB;
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu
index b9308fd0f8ac..c25e19dc2030 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu
@@ -396,6 +396,17 @@
<value>com.sun.star.svx.FindTextToolboxController</value>
</prop>
</node>
+ <node oor:name="com.sun.star.svx.SearchLabelToolboxController" oor:op="replace">
+ <prop oor:name="Command">
+ <value>.uno:SearchLabel</value>
+ </prop>
+ <prop oor:name="Module">
+ <value/>
+ </prop>
+ <prop oor:name="Controller">
+ <value>com.sun.star.svx.SearchLabelToolboxController</value>
+ </prop>
+ </node>
<node oor:name="com.sun.star.svx.DownSearchToolboxController" oor:op="replace">
<prop oor:name="Command">
<value>.uno:DownSearch</value>
diff --git a/svx/inc/tbunosearchcontrollers.hxx b/svx/inc/tbunosearchcontrollers.hxx
index f1aaa583326b..97af023e39d5 100644
--- a/svx/inc/tbunosearchcontrollers.hxx
+++ b/svx/inc/tbunosearchcontrollers.hxx
@@ -111,7 +111,6 @@ public:
virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException );
// XToolbarController
- virtual void SAL_CALL execute( sal_Int16 KeyModifier ) throw ( css::uno::RuntimeException);
virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent ) throw ( css::uno::RuntimeException );
// XStatusListener
@@ -217,7 +216,6 @@ public:
virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException);
// XToolbarController
- virtual void SAL_CALL execute( sal_Int16 KeyModifier ) throw ( css::uno::RuntimeException );
virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent ) throw ( css::uno::RuntimeException );
// XStatusListener
@@ -257,6 +255,36 @@ public:
virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) throw ( css::uno::RuntimeException );
};
+class SearchLabelToolboxController : public svt::ToolboxController,
+ public css::lang::XServiceInfo
+{
+public:
+ SearchLabelToolboxController( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
+ ~SearchLabelToolboxController();
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) throw ( css::uno::RuntimeException ) SAL_OVERRIDE;
+ virtual void SAL_CALL acquire() throw () SAL_OVERRIDE;
+ virtual void SAL_CALL release() throw () SAL_OVERRIDE;
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() throw( css::uno::RuntimeException ) SAL_OVERRIDE;
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException ) SAL_OVERRIDE;
+ virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( css::uno::RuntimeException ) SAL_OVERRIDE;
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw ( css::uno::RuntimeException ) SAL_OVERRIDE;
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException) SAL_OVERRIDE;
+
+ // XToolbarController
+ virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent ) throw ( css::uno::RuntimeException ) SAL_OVERRIDE;
+
+ // XStatusListener
+ virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) throw ( css::uno::RuntimeException ) SAL_OVERRIDE;
+};
+
// protocol handler for "vnd.sun.star.findbar:*" URLs
// The dispatch object will be used for shortcut commands for findbar
class FindbarDispatcher : public css::lang::XServiceInfo,
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index 51202d288975..dd9361591a35 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -34,14 +34,17 @@
#include <sfx2/basedlgs.hxx>
#include <svl/cjkoptions.hxx>
#include <svl/ctloptions.hxx>
+#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/i18n/TransliterationModules.hpp>
#include <com/sun/star/i18n/TransliterationModulesExtra.hpp>
#include <com/sun/star/frame/XDispatch.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
+#include <com/sun/star/frame/XLayoutManager.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/configuration/theDefaultProvider.hpp>
#include <com/sun/star/frame/ModuleManager.hpp>
+#include <com/sun/star/ui/XUIElement.hpp>
#include <comphelper/processfactory.hxx>
#include <svl/itempool.hxx>
#include <svl/intitem.hxx>
@@ -63,6 +66,7 @@
#include <editeng/brushitem.hxx>
#include <tools/resary.hxx>
#include <svx/svxdlg.hxx>
+#include <vcl/toolbox.hxx>
using namespace com::sun::star::i18n;
using namespace com::sun::star::uno;
@@ -285,6 +289,10 @@ SvxSearchDialog::SvxSearchDialog( Window* pParent, SfxChildWindow* pChildWin, Sf
get(m_pSearchAllBtn, "searchall");
get(m_pSearchAttrText, "searchdesc");
m_pSearchAttrText->SetStyle(m_pSearchAttrText->GetStyle() | WB_PATHELLIPSIS);
+ m_pSearchAttrText->Show();
+ get(m_pSearchLabel, "searchlabel");
+ m_pSearchLabel->SetStyle(m_pSearchLabel->GetStyle() | WB_PATHELLIPSIS);
+ m_pSearchLabel->Show();
get(m_pReplaceFrame, "replaceframe");
get(m_pReplaceLB, "replaceterm");
@@ -294,6 +302,7 @@ SvxSearchDialog::SvxSearchDialog( Window* pParent, SfxChildWindow* pChildWin, Sf
get(m_pReplaceAllBtn, "replaceall");
get(m_pReplaceAttrText, "replacedesc");
m_pReplaceAttrText->SetStyle(m_pReplaceAttrText->GetStyle() | WB_PATHELLIPSIS);
+ m_pReplaceAttrText->Show();
get(m_pComponentFrame, "componentframe");
get(m_pSearchComponent1PB, "component1");
@@ -2324,4 +2333,47 @@ SfxChildWinInfo SvxSearchDialogWrapper::GetInfo() const
return aInfo;
}
+
+static Window* lcl_GetSearchLabelWindow()
+{
+ css::uno::Reference< css::beans::XPropertySet > xPropSet(
+ SfxViewFrame::Current()->GetFrame().GetFrameInterface(), css::uno::UNO_QUERY_THROW);
+ css::uno::Reference< css::frame::XLayoutManager > xLayoutManager;
+ xPropSet->getPropertyValue("LayoutManager") >>= xLayoutManager;
+ css::uno::Reference< css::ui::XUIElement > xUIElement =
+ xLayoutManager->getElement("private:resource/toolbar/findbar");
+ if (!xUIElement.is())
+ return 0;
+ css::uno::Reference< css::awt::XWindow > xWindow(
+ xUIElement->getRealInterface(), css::uno::UNO_QUERY_THROW);
+ ToolBox* pToolBox = (ToolBox*) VCLUnoHelper::GetWindow(xWindow);
+ for (size_t i = 0; pToolBox && i < pToolBox->GetItemCount(); ++i)
+ if (pToolBox->GetItemCommand(i) == ".uno:SearchLabel")
+ return pToolBox->GetItemWindow(i);
+ return 0;
+}
+
+void SvxSearchDialogWrapper::SetSearchLabel(const SearchLabel& rSL)
+{
+ OUString sStr;
+ if (rSL == SL_End)
+ sStr = SVX_RESSTR(RID_SVXSTR_SEARCH_END);
+ else if (rSL == SL_NotFound)
+ sStr = SVX_RESSTR(RID_SVXSTR_SEARCH_NOT_FOUND);
+
+ if (Window *pSearchLabel = lcl_GetSearchLabelWindow())
+ {
+ if (sStr.isEmpty())
+ pSearchLabel->Hide();
+ else
+ {
+ pSearchLabel->SetText(sStr);
+ pSearchLabel->Show();
+ }
+ }
+ if (SvxSearchDialogWrapper *pWrp = (SvxSearchDialogWrapper*) SfxViewFrame::Current()->
+ GetChildWindow( SvxSearchDialogWrapper::GetChildWindowId() ))
+ pWrp->getDialog()->SetSearchLabel(sStr);
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/dialog/srchdlg.src b/svx/source/dialog/srchdlg.src
index d17fc2463576..18b5e1117c54 100644
--- a/svx/source/dialog/srchdlg.src
+++ b/svx/source/dialog/srchdlg.src
@@ -42,5 +42,13 @@ String RID_SVXSTR_REPLACE
{
Text [ en-US ] = "(Replace)" ;
};
+String RID_SVXSTR_SEARCH_END
+{
+ Text [ en-US ] = "Reached the end of the document" ;
+};
+String RID_SVXSTR_SEARCH_NOT_FOUND
+{
+ Text [ en-US ] = "Search key not found" ;
+};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index 9ff2bb3b3d45..9a425d202b2c 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -42,6 +42,8 @@
#include <rtl/ref.hxx>
#include <rtl/instance.hxx>
+#include <vcl/fixed.hxx>
+
using namespace css;
namespace {
@@ -439,11 +441,6 @@ void SAL_CALL FindTextToolbarController::initialize( const css::uno::Sequence< :
SearchToolbarControllersManager::createControllersManager().registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY), m_aCommandURL);
}
-// XToolbarController
-void SAL_CALL FindTextToolbarController::execute( sal_Int16 /*KeyModifier*/ ) throw ( css::uno::RuntimeException )
-{
-}
-
css::uno::Reference< css::awt::XWindow > SAL_CALL FindTextToolbarController::createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent ) throw ( css::uno::RuntimeException )
{
css::uno::Reference< css::awt::XWindow > xItemWindow;
@@ -674,11 +671,6 @@ void SAL_CALL MatchCaseToolboxController::initialize( const css::uno::Sequence<
SearchToolbarControllersManager::createControllersManager().registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY), m_aCommandURL);
}
-// XToolbarController
-void SAL_CALL MatchCaseToolboxController::execute( sal_Int16 /*KeyModifier*/ ) throw ( css::uno::RuntimeException )
-{
-}
-
css::uno::Reference< css::awt::XWindow > SAL_CALL MatchCaseToolboxController::createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent ) throw ( css::uno::RuntimeException )
{
css::uno::Reference< css::awt::XWindow > xItemWindow;
@@ -889,6 +881,88 @@ void SAL_CALL ExitSearchToolboxController::statusChanged( const css::frame::Feat
}
//-----------------------------------------------------------------------------------------------------------
+// class SearchLabelToolboxController
+
+SearchLabelToolboxController::SearchLabelToolboxController( const css::uno::Reference< css::uno::XComponentContext > & rxContext )
+ : svt::ToolboxController( rxContext,
+ css::uno::Reference< css::frame::XFrame >(),
+ OUString( ".uno:SearchLabel" ) )
+{
+}
+
+SearchLabelToolboxController::~SearchLabelToolboxController()
+{
+}
+
+// XInterface
+css::uno::Any SAL_CALL SearchLabelToolboxController::queryInterface( const css::uno::Type& aType ) throw ( css::uno::RuntimeException )
+{
+ css::uno::Any a = ToolboxController::queryInterface( aType );
+ if ( a.hasValue() )
+ return a;
+
+ return ::cppu::queryInterface( aType, static_cast< css::lang::XServiceInfo* >( this ) );
+}
+
+void SAL_CALL SearchLabelToolboxController::acquire() throw ()
+{
+ ToolboxController::acquire();
+}
+
+void SAL_CALL SearchLabelToolboxController::release() throw ()
+{
+ ToolboxController::release();
+}
+
+// XServiceInfo
+OUString SAL_CALL SearchLabelToolboxController::getImplementationName() throw( css::uno::RuntimeException )
+{
+ return OUString( "com.sun.star.svx.SearchLabelToolboxController" );
+}
+
+
+sal_Bool SAL_CALL SearchLabelToolboxController::supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException )
+{
+ return cppu::supportsService(this, ServiceName);
+}
+
+css::uno::Sequence< OUString > SAL_CALL SearchLabelToolboxController::getSupportedServiceNames() throw( css::uno::RuntimeException )
+{
+ css::uno::Sequence< OUString > aSNS( 1 );
+ aSNS[0] = "com.sun.star.frame.ToolbarController";
+ return aSNS;
+}
+
+// XComponent
+void SAL_CALL SearchLabelToolboxController::dispose() throw ( css::uno::RuntimeException )
+{
+ SolarMutexGuard aSolarMutexGuard;
+
+ SearchToolbarControllersManager::createControllersManager().freeController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY), m_aCommandURL);
+
+ svt::ToolboxController::dispose();
+}
+
+// XInitialization
+void SAL_CALL SearchLabelToolboxController::initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException )
+{
+ svt::ToolboxController::initialize( aArguments );
+ SearchToolbarControllersManager::createControllersManager().registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY), m_aCommandURL);
+}
+
+// XStatusListener
+void SAL_CALL SearchLabelToolboxController::statusChanged( const css::frame::FeatureStateEvent& ) throw ( css::uno::RuntimeException )
+{
+}
+
+css::uno::Reference< css::awt::XWindow > SAL_CALL SearchLabelToolboxController::createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent ) throw ( css::uno::RuntimeException )
+{
+ Window *pSL= new FixedText(VCLUnoHelper::GetWindow( Parent ));
+ pSL->SetSizePixel(Size(250, 25));
+ return VCLUnoHelper::GetInterface(pSL);
+}
+
+//-----------------------------------------------------------------------------------------------------------
// class FindbarDispatcher
FindbarDispatcher::FindbarDispatcher()
@@ -1087,6 +1161,14 @@ com_sun_star_svx_FindAllToolboxController_get_implementation(
}
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_svx_SearchLabelToolboxController_get_implementation(
+ css::uno::XComponentContext *context,
+ css::uno::Sequence<css::uno::Any> const &)
+{
+ return cppu::acquire(new SearchLabelToolboxController(context));
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
com_sun_star_comp_svx_Impl_FindbarDispatcher_get_implementation(
SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &)
diff --git a/svx/uiconfig/ui/findreplacedialog.ui b/svx/uiconfig/ui/findreplacedialog.ui
index 5cfef2218282..fb50f0779cae 100644
--- a/svx/uiconfig/ui/findreplacedialog.ui
+++ b/svx/uiconfig/ui/findreplacedialog.ui
@@ -197,7 +197,7 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="searchformat">
+ <object class="GtkLabel" id="searchlabel">
<property name="width_request">1</property>
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
diff --git a/svx/util/svx.component b/svx/util/svx.component
index 8db99d97556b..5529d276dbfd 100644
--- a/svx/util/svx.component
+++ b/svx/util/svx.component
@@ -60,6 +60,10 @@
constructor="com_sun_star_svx_FindAllToolboxController_get_implementation">
<service name="com.sun.star.frame.ToolbarController"/>
</implementation>
+ <implementation name="com.sun.star.svx.SearchLabelToolboxController"
+ constructor="com_sun_star_svx_SearchLabelToolboxController_get_implementation">
+ <service name="com.sun.star.frame.ToolbarController"/>
+ </implementation>
<implementation name="com.sun.star.svx.FontHeightToolBoxController"
constructor="com_sun_star_svx_FontHeightToolBoxController_get_implementation">
<service name="com.sun.star.frame.ToolbarController"/>
diff --git a/sw/source/ui/uiview/viewsrch.cxx b/sw/source/ui/uiview/viewsrch.cxx
index 7bf41a51d482..f9ca08122714 100644
--- a/sw/source/ui/uiview/viewsrch.cxx
+++ b/sw/source/ui/uiview/viewsrch.cxx
@@ -23,6 +23,7 @@
#include <boost/scoped_ptr.hpp>
#include <hintids.hxx>
+
#include <com/sun/star/util/SearchOptions.hpp>
#include <svl/cjkoptions.hxx>
#include <svl/ctloptions.hxx>
@@ -86,18 +87,6 @@ static Window* GetParentWindow( SvxSearchDialog* m_pSrchDlg )
return pWin;
}
-static void ShowNotFoundInfoBox( SvxSearchDialog* m_pSrchDlg )
-{
- Window* pParentWindow = GetParentWindow( m_pSrchDlg );
- MessageDialog aBox(pParentWindow, "InfoNotFoundDialog",
- "modules/swriter/ui/infonotfounddialog.ui");
- if (pParentWindow)
- {
- aBox.SetText(pParentWindow->GetText());
- }
- aBox.Execute();
-}
-
void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage)
{
const SfxItemSet* pArgs = rReq.GetArgs();
@@ -231,9 +220,7 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage)
if( !bRet )
{
if( !bApi )
- {
- ShowNotFoundInfoBox( m_pSrchDlg );
- }
+ SvxSearchDialogWrapper::SetSearchLabel(SL_NotFound);
m_bFound = sal_False;
}
rReq.SetReturnValue(SfxBoolItem(nSlot, bRet));
@@ -349,9 +336,7 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage)
if( !nFound )
{
if( !bApi )
- {
- ShowNotFoundInfoBox( m_pSrchDlg );
- }
+ SvxSearchDialogWrapper::SetSearchLabel(SL_NotFound);
m_bFound = sal_False;
return;
}
@@ -527,9 +512,7 @@ sal_Bool SwView::SearchAndWrap(sal_Bool bApi)
{
m_pWrtShell->EndAllAction();
if( !bApi )
- {
- ShowNotFoundInfoBox( m_pSrchDlg );
- }
+ SvxSearchDialogWrapper::SetSearchLabel(SL_NotFound);
m_bFound = sal_False;
m_pWrtShell->Pop();
return sal_False;
@@ -537,27 +520,6 @@ sal_Bool SwView::SearchAndWrap(sal_Bool bApi)
m_pWrtShell->EndAllAction();
// Try again with WrapAround?
- int nRet = RET_NO;
- if( !bApi )
- {
- if (DOCPOS_START == aOpts.eEnd)
- {
- nRet = MessageDialog(GetParentWindow(m_pSrchDlg), "QueryContinueEndDialog",
- "modules/swriter/ui/querycontinueenddialog.ui").Execute();
- }
- else
- {
- nRet = MessageDialog(GetParentWindow(m_pSrchDlg), "QueryContinueBeginDialog",
- "modules/swriter/ui/querycontinuebegindialog.ui").Execute();
- }
- }
-
- if (nRet == RET_NO)
- {
- m_bFound = sal_False;
- m_pWrtShell->Pop();
- return sal_False;
- }
m_pWrtShell->StartAllAction();
m_pWrtShell->Pop(sal_False);
pWait.reset(new SwWait( *GetDocShell(), true ));
@@ -576,16 +538,15 @@ sal_Bool SwView::SearchAndWrap(sal_Bool bApi)
m_pWrtShell->SttDoc();
}
- m_bFound = 0 != FUNC_Search( aOpts );
+ m_bFound = bool(FUNC_Search( aOpts ));
m_pWrtShell->EndAllAction();
pWait.reset();
- if ( m_bFound )
- return m_bFound;
- if(!bApi)
- {
- ShowNotFoundInfoBox( m_pSrchDlg );
- }
- return m_bFound = sal_False;
+
+ if (m_bFound)
+ SvxSearchDialogWrapper::SetSearchLabel(SL_End);
+ else if(!bApi)
+ SvxSearchDialogWrapper::SetSearchLabel(SL_NotFound);
+ return m_bFound;
}
@@ -728,6 +689,8 @@ SwSearchOptions::SwSearchOptions( SwWrtShell* pSh, sal_Bool bBackward )
sal_uLong SwView::FUNC_Search( const SwSearchOptions& rOptions )
{
+ SvxSearchDialogWrapper::SetSearchLabel(SL_Empty);
+
sal_Bool bDoReplace = m_pSrchItem->GetCommand() == SVX_SEARCHCMD_REPLACE ||
m_pSrchItem->GetCommand() == SVX_SEARCHCMD_REPLACE_ALL;
diff --git a/sw/uiconfig/sglobal/toolbar/findbar.xml b/sw/uiconfig/sglobal/toolbar/findbar.xml
index 4e8ec6ba0743..807ffbfa2dcd 100644
--- a/sw/uiconfig/sglobal/toolbar/findbar.xml
+++ b/sw/uiconfig/sglobal/toolbar/findbar.xml
@@ -26,4 +26,6 @@
<toolbar:toolbaritem xlink:href=".uno:MatchCase"/>
<toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:SearchDialog"/>
+ <toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:SearchLabel"/>
</toolbar:toolbar>
diff --git a/sw/uiconfig/sweb/toolbar/findbar.xml b/sw/uiconfig/sweb/toolbar/findbar.xml
index 4e8ec6ba0743..807ffbfa2dcd 100644
--- a/sw/uiconfig/sweb/toolbar/findbar.xml
+++ b/sw/uiconfig/sweb/toolbar/findbar.xml
@@ -26,4 +26,6 @@
<toolbar:toolbaritem xlink:href=".uno:MatchCase"/>
<toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:SearchDialog"/>
+ <toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:SearchLabel"/>
</toolbar:toolbar>
diff --git a/sw/uiconfig/swriter/toolbar/findbar.xml b/sw/uiconfig/swriter/toolbar/findbar.xml
index 13e84ad6b8e9..f0c18542ace6 100644
--- a/sw/uiconfig/swriter/toolbar/findbar.xml
+++ b/sw/uiconfig/swriter/toolbar/findbar.xml
@@ -30,4 +30,5 @@
<toolbar:toolbaritem xlink:href=".uno:ScrollToPrevious"/>
<toolbar:toolbaritem xlink:href=".uno:NavigationPopup"/>
<toolbar:toolbaritem xlink:href=".uno:ScrollToNext"/>
+ <toolbar:toolbaritem xlink:href=".uno:SearchLabel"/>
</toolbar:toolbar>
diff --git a/sw/uiconfig/swxform/toolbar/findbar.xml b/sw/uiconfig/swxform/toolbar/findbar.xml
index 4e8ec6ba0743..807ffbfa2dcd 100644
--- a/sw/uiconfig/swxform/toolbar/findbar.xml
+++ b/sw/uiconfig/swxform/toolbar/findbar.xml
@@ -26,4 +26,6 @@
<toolbar:toolbaritem xlink:href=".uno:MatchCase"/>
<toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:SearchDialog"/>
+ <toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:SearchLabel"/>
</toolbar:toolbar>