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 @@
com.sun.star.svx.FindTextToolboxController
+
+
+ .uno:SearchLabel
+
+
+
+
+
+ com.sun.star.svx.SearchLabelToolboxController
+
+
.uno:DownSearch
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
#include
#include
+#include
#include
#include
#include
#include
#include
+#include
#include
#include
#include
+#include
#include
#include
#include
@@ -63,6 +66,7 @@
#include
#include
#include
+#include
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
#include
+#include
+
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;
@@ -888,6 +880,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
@@ -1086,6 +1160,14 @@ com_sun_star_svx_FindAllToolboxController_get_implementation(
return cppu::acquire(new FindAllToolboxController(context));
}
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_svx_SearchLabelToolboxController_get_implementation(
+ css::uno::XComponentContext *context,
+ css::uno::Sequence 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 *,
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 @@
-