[Libreoffice-commits] core.git: 2 commits - include/svx officecfg/registry svx/inc svx/source svx/uiconfig svx/util sw/source sw/uiconfig

Matúš Kukan matus.kukan at collabora.com
Wed Feb 5 10:09:55 PST 2014


 include/svx/dialogs.hrc                                         |    2 
 include/svx/srchdlg.hxx                                         |   11 
 officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu |   11 
 svx/inc/tbunosearchcontrollers.hxx                              |   32 ++
 svx/source/dialog/srchdlg.cxx                                   |   52 ++++
 svx/source/dialog/srchdlg.src                                   |    8 
 svx/source/tbxctrls/tbunosearchcontrollers.cxx                  |  115 ++++++++--
 svx/uiconfig/ui/findreplacedialog.ui                            |    2 
 svx/util/svx.component                                          |    4 
 sw/source/ui/uiview/viewsrch.cxx                                |   63 +----
 sw/uiconfig/sglobal/toolbar/findbar.xml                         |    2 
 sw/uiconfig/sweb/toolbar/findbar.xml                            |    2 
 sw/uiconfig/swriter/toolbar/findbar.xml                         |    1 
 sw/uiconfig/swxform/toolbar/findbar.xml                         |    2 
 14 files changed, 231 insertions(+), 76 deletions(-)

New commits:
commit f25cdaa78d5e7d200fbaf31cce9895bab7c5ee63
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Tue Feb 4 15:46:41 2014 +0100

    fdo#74132: Do not interrupt search in Writer.
    
    Instead of "Do you want to continue at the beginning?" dialog,
    just inform that we were at the end of the document in new label.
    
    Also replace 'Search key not found' dialog with label.
    
    Change-Id: I6a140cbad93406b73996f87a6d05fcc5d245fdbf

diff --git a/include/svx/dialogs.hrc b/include/svx/dialogs.hrc
index 2bf58e7..e0d7095 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 b640100..50f7d63 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 b9308fd..c25e19d 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 f1aaa58..97af023 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 51202d2..dd93615 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 d17fc24..18b5e11 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 9ff2bb3..9a425d2 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 5cfef22..fb50f07 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 8db99d9..5529d27 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 7bf41a5..f9ca081 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 4e8ec6b..807ffbf 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 4e8ec6b..807ffbf 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 13e84ad..f0c1854 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 4e8ec6b..807ffbf 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>
commit d6f13b6a84e4b12320111c2e92cd8af20ed44d4c
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Mon Feb 3 14:11:03 2014 +0100

    Remove unfinished code.
    
    Change-Id: Iee9e2ff03fc1bce45965148a772c0984a0a9f8d0

diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index 2cbdc93..9ff2bb3 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -598,9 +598,6 @@ void SAL_CALL UpDownSearchToolboxController::execute( sal_Int16 /*KeyModifier*/
 // XStatusListener
 void SAL_CALL UpDownSearchToolboxController::statusChanged( const css::frame::FeatureStateEvent& /*rEvent*/ ) throw ( css::uno::RuntimeException )
 {
-    SolarMutexGuard aSolarMutexGuard;
-    if ( m_bDisposed )
-        return;
 }
 
 //-----------------------------------------------------------------------------------------------------------
@@ -702,12 +699,8 @@ css::uno::Reference< css::awt::XWindow > SAL_CALL MatchCaseToolboxController::cr
 }
 
 // XStatusListener
-void SAL_CALL MatchCaseToolboxController::statusChanged( const css::frame::FeatureStateEvent& rEvent ) throw ( css::uno::RuntimeException )
+void SAL_CALL MatchCaseToolboxController::statusChanged( const css::frame::FeatureStateEvent& ) throw ( css::uno::RuntimeException )
 {
-    (void) rEvent;
-    SolarMutexGuard aSolarMutexGuard;
-    if ( m_bDisposed )
-        return;
 }
 
 //-----------------------------------------------------------------------------------------------------------
@@ -795,9 +788,6 @@ void SAL_CALL FindAllToolboxController::execute( sal_Int16 /*KeyModifier*/ ) thr
 // XStatusListener
 void SAL_CALL FindAllToolboxController::statusChanged( const css::frame::FeatureStateEvent& /*rEvent*/ ) throw ( css::uno::RuntimeException )
 {
-    SolarMutexGuard aSolarMutexGuard;
-    if ( m_bDisposed )
-        return;
 }
 
 //-----------------------------------------------------------------------------------------------------------
@@ -896,9 +886,6 @@ void SAL_CALL ExitSearchToolboxController::execute( sal_Int16 /*KeyModifier*/ )
 // XStatusListener
 void SAL_CALL ExitSearchToolboxController::statusChanged( const css::frame::FeatureStateEvent& /*rEvent*/ ) throw ( css::uno::RuntimeException )
 {
-    SolarMutexGuard aSolarMutexGuard;
-    if ( m_bDisposed )
-        return;
 }
 
 //-----------------------------------------------------------------------------------------------------------


More information about the Libreoffice-commits mailing list