diff options
-rw-r--r-- | basctl/uiconfig/basicide/toolbar/findbar.xml | 1 | ||||
-rw-r--r-- | officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu | 11 | ||||
-rw-r--r-- | officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu | 5 | ||||
-rw-r--r-- | sc/uiconfig/scalc/toolbar/findbar.xml | 1 | ||||
-rw-r--r-- | sd/uiconfig/sdraw/toolbar/findbar.xml | 1 | ||||
-rw-r--r-- | sd/uiconfig/simpress/toolbar/findbar.xml | 1 | ||||
-rw-r--r-- | svx/inc/tbunosearchcontrollers.hxx | 38 | ||||
-rw-r--r-- | svx/source/tbxctrls/tbunosearchcontrollers.cxx | 120 | ||||
-rw-r--r-- | svx/source/unodraw/unoctabl.cxx | 7 | ||||
-rw-r--r-- | svx/util/svx.component | 3 | ||||
-rw-r--r-- | sw/uiconfig/sglobal/toolbar/findbar.xml | 1 | ||||
-rw-r--r-- | sw/uiconfig/sweb/toolbar/findbar.xml | 1 | ||||
-rw-r--r-- | sw/uiconfig/swriter/toolbar/findbar.xml | 1 | ||||
-rw-r--r-- | sw/uiconfig/swxform/toolbar/findbar.xml | 1 |
14 files changed, 190 insertions, 2 deletions
diff --git a/basctl/uiconfig/basicide/toolbar/findbar.xml b/basctl/uiconfig/basicide/toolbar/findbar.xml index 57aec06d6ee0..a7cb69325ab2 100644 --- a/basctl/uiconfig/basicide/toolbar/findbar.xml +++ b/basctl/uiconfig/basicide/toolbar/findbar.xml @@ -22,6 +22,7 @@ <toolbar:toolbaritem xlink:href=".uno:FindText"/> <toolbar:toolbaritem xlink:href=".uno:DownSearch"/> <toolbar:toolbaritem xlink:href=".uno:UpSearch"/> + <toolbar:toolbaritem xlink:href=".uno:FindAll"/> <toolbar:toolbaritem xlink:href=".uno:MatchCase"/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:SearchDialog"/> diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu index 64fa7b078fd3..c4961d8f56cd 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu @@ -440,6 +440,17 @@ <value>com.sun.star.svx.MatchCaseToolboxController</value> </prop> </node> + <node oor:name="com.sun.star.svx.FindAllToolboxController" oor:op="replace"> + <prop oor:name="Command"> + <value>.uno:FindAll</value> + </prop> + <prop oor:name="Module"> + <value/> + </prop> + <prop oor:name="Controller"> + <value>com.sun.star.svx.FindAllToolboxController</value> + </prop> + </node> <node oor:name="c4" oor:op="replace" install:module="reportbuilder"> <prop oor:name="Command"> <value>.uno:FontColor</value> diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu index 92955f5a8c84..1134e9ed1101 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu @@ -1483,6 +1483,11 @@ <value xml:lang="en-US">Match Case</value> </prop> </node> + <node oor:name=".uno:FindAll" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Find All</value> + </prop> + </node> <node oor:name=".uno:ExitSearch" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> <value xml:lang="en-US">Exit Search</value> diff --git a/sc/uiconfig/scalc/toolbar/findbar.xml b/sc/uiconfig/scalc/toolbar/findbar.xml index f8052a181bfe..a3c5c0f20cea 100644 --- a/sc/uiconfig/scalc/toolbar/findbar.xml +++ b/sc/uiconfig/scalc/toolbar/findbar.xml @@ -23,6 +23,7 @@ <toolbar:toolbaritem xlink:href=".uno:DownSearch"/> <toolbar:toolbaritem xlink:href=".uno:UpSearch"/> <toolbar:toolbaritem xlink:href=".uno:MatchCase"/> + <toolbar:toolbaritem xlink:href=".uno:FindAll"/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:SearchDialog"/> </toolbar:toolbar> diff --git a/sd/uiconfig/sdraw/toolbar/findbar.xml b/sd/uiconfig/sdraw/toolbar/findbar.xml index f8052a181bfe..4e8ec6ba0743 100644 --- a/sd/uiconfig/sdraw/toolbar/findbar.xml +++ b/sd/uiconfig/sdraw/toolbar/findbar.xml @@ -22,6 +22,7 @@ <toolbar:toolbaritem xlink:href=".uno:FindText"/> <toolbar:toolbaritem xlink:href=".uno:DownSearch"/> <toolbar:toolbaritem xlink:href=".uno:UpSearch"/> + <toolbar:toolbaritem xlink:href=".uno:FindAll"/> <toolbar:toolbaritem xlink:href=".uno:MatchCase"/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:SearchDialog"/> diff --git a/sd/uiconfig/simpress/toolbar/findbar.xml b/sd/uiconfig/simpress/toolbar/findbar.xml index f8052a181bfe..4e8ec6ba0743 100644 --- a/sd/uiconfig/simpress/toolbar/findbar.xml +++ b/sd/uiconfig/simpress/toolbar/findbar.xml @@ -22,6 +22,7 @@ <toolbar:toolbaritem xlink:href=".uno:FindText"/> <toolbar:toolbaritem xlink:href=".uno:DownSearch"/> <toolbar:toolbaritem xlink:href=".uno:UpSearch"/> + <toolbar:toolbaritem xlink:href=".uno:FindAll"/> <toolbar:toolbaritem xlink:href=".uno:MatchCase"/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:SearchDialog"/> diff --git a/svx/inc/tbunosearchcontrollers.hxx b/svx/inc/tbunosearchcontrollers.hxx index b68b4b528be0..ab3693c0e34d 100644 --- a/svx/inc/tbunosearchcontrollers.hxx +++ b/svx/inc/tbunosearchcontrollers.hxx @@ -257,6 +257,43 @@ private: CheckBox* m_pMatchCaseControl; }; +class FindAllToolboxController : public svt::ToolboxController, + public css::lang::XServiceInfo +{ +public: + FindAllToolboxController( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); + ~FindAllToolboxController(); + + // XInterface + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) throw ( css::uno::RuntimeException ); + virtual void SAL_CALL acquire() throw (); + virtual void SAL_CALL release() throw (); + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() throw( css::uno::RuntimeException ); + virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException ); + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( css::uno::RuntimeException ); + + static OUString getImplementationName_Static( ) throw() + { + return OUString( "com.sun.star.svx.FindAllToolboxController" ); + } + + static css::uno::Sequence< OUString > getSupportedServiceNames_Static() throw(); + + // XComponent + virtual void SAL_CALL dispose() throw ( css::uno::RuntimeException ); + + // XInitialization + 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 ); + + // XStatusListener + virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) throw ( css::uno::RuntimeException ); +}; + // 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, @@ -310,6 +347,7 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL FindTextToolbarController_c css::uno::Reference< css::uno::XInterface > SAL_CALL DownSearchToolboxController_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr ); css::uno::Reference< css::uno::XInterface > SAL_CALL UpSearchToolboxController_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr ); css::uno::Reference< css::uno::XInterface > SAL_CALL MatchCaseToolboxController_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr ); +css::uno::Reference< css::uno::XInterface > SAL_CALL FindAllToolboxController_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr ); css::uno::Reference< css::uno::XInterface > SAL_CALL ExitFindbarToolboxController_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr ); css::uno::Reference< css::uno::XInterface > SAL_CALL FindbarDispatcher_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr ); diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx index 5270b076afa7..dcb32066abad 100644 --- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx +++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx @@ -31,6 +31,7 @@ #include <com/sun/star/util/URL.hpp> #include <com/sun/star/util/URLTransformer.hpp> +#include <svl/srchitem.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <vcl/toolbox.hxx> #include <vcl/svapp.hxx> @@ -40,6 +41,7 @@ namespace svx { +static const char SEARCHITEM_COMMAND[] = "SearchItem.Command"; static const char SEARCHITEM_SEARCHSTRING[] = "SearchItem.SearchString"; static const char SEARCHITEM_SEARCHBACKWARD[] = "SearchItem.Backward"; static const char SEARCHITEM_SEARCHFLAGS[] = "SearchItem.SearchFlags"; @@ -58,7 +60,8 @@ static const sal_Int32 REMEMBER_SIZE = 10; void impl_executeSearch( const css::uno::Reference< css::uno::XComponentContext >& rxContext, const css::uno::Reference< css::frame::XFrame >& xFrame, const ToolBox* pToolBox, - const sal_Bool aSearchBackwards = false ) + const sal_Bool aSearchBackwards = false, + const sal_Bool aFindAll = false ) { css::uno::Reference< css::util::XURLTransformer > xURLTransformer( css::util::URLTransformer::create( rxContext ) ); css::util::URL aURL; @@ -87,7 +90,7 @@ void impl_executeSearch( const css::uno::Reference< css::uno::XComponentContext } } - css::uno::Sequence< css::beans::PropertyValue > lArgs(4); + css::uno::Sequence< css::beans::PropertyValue > lArgs(5); lArgs[0].Name = OUString(SEARCHITEM_SEARCHSTRING); lArgs[0].Value <<= sFindText; lArgs[1].Name = OUString(SEARCHITEM_SEARCHBACKWARD); @@ -97,6 +100,9 @@ void impl_executeSearch( const css::uno::Reference< css::uno::XComponentContext lArgs[3].Name = OUString(SEARCHITEM_TRANSLITERATEFLAGS); lArgs[3].Value <<= (sal_Int32)(!aMatchCase ? com::sun::star::i18n::TransliterationModules_IGNORE_CASE : 0); + lArgs[4].Name = OUString(SEARCHITEM_COMMAND); + lArgs[4].Value <<= (sal_Int16)(aFindAll ? + SVX_SEARCHCMD_FIND_ALL : SVX_SEARCHCMD_FIND ); css::uno::Reference< css::frame::XDispatchProvider > xDispatchProvider(xFrame, css::uno::UNO_QUERY); if ( xDispatchProvider.is() ) @@ -726,6 +732,109 @@ void SAL_CALL MatchCaseToolboxController::statusChanged( const css::frame::Featu } //----------------------------------------------------------------------------------------------------------- +// class FindAllToolboxController + +FindAllToolboxController::FindAllToolboxController( const css::uno::Reference< css::uno::XComponentContext > & rxContext ) + : svt::ToolboxController( rxContext, + css::uno::Reference< css::frame::XFrame >(), + OUString( COMMAND_EXITSEARCH ) ) +{ +} + +FindAllToolboxController::~FindAllToolboxController() +{ +} + +// XInterface +css::uno::Any SAL_CALL FindAllToolboxController::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 FindAllToolboxController::acquire() throw () +{ + ToolboxController::acquire(); +} + +void SAL_CALL FindAllToolboxController::release() throw () +{ + ToolboxController::release(); +} + +// XServiceInfo +OUString SAL_CALL FindAllToolboxController::getImplementationName() throw( css::uno::RuntimeException ) +{ + return getImplementationName_Static( ); +} + + +sal_Bool SAL_CALL FindAllToolboxController::supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException ) +{ + const css::uno::Sequence< OUString > aSNL( getSupportedServiceNames() ); + const OUString * pArray = aSNL.getConstArray(); + + for( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) + if( pArray[i] == ServiceName ) + return true; + + return false; + +} + +css::uno::Sequence< OUString > SAL_CALL FindAllToolboxController::getSupportedServiceNames() throw( css::uno::RuntimeException ) +{ + return getSupportedServiceNames_Static(); +} + +css::uno::Sequence< OUString > FindAllToolboxController::getSupportedServiceNames_Static() throw() +{ + css::uno::Sequence< OUString > aSNS( 1 ); + aSNS.getArray()[0] = OUString("com.sun.star.frame.ToolbarController"); + return aSNS; +} + +// XComponent +void SAL_CALL FindAllToolboxController::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 FindAllToolboxController::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); +} + +// XToolbarController +void SAL_CALL FindAllToolboxController::execute( sal_Int16 /*KeyModifier*/ ) throw ( css::uno::RuntimeException ) +{ + if ( m_bDisposed ) + throw css::lang::DisposedException(); + + Window* pWindow = VCLUnoHelper::GetWindow( getParent() ); + ToolBox* pToolBox = (ToolBox*)pWindow; + + impl_executeSearch(m_xContext, m_xFrame, pToolBox, false, true); +} + +// XStatusListener +void SAL_CALL FindAllToolboxController::statusChanged( const css::frame::FeatureStateEvent& /*rEvent*/ ) throw ( css::uno::RuntimeException ) +{ + SolarMutexGuard aSolarMutexGuard; + if ( m_bDisposed ) + return; +} + +//----------------------------------------------------------------------------------------------------------- // class ExitSearchToolboxController ExitSearchToolboxController::ExitSearchToolboxController( const css::uno::Reference< css::uno::XComponentContext > & rxContext ) @@ -1028,6 +1137,13 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL MatchCaseToolboxController_ new MatchCaseToolboxController( comphelper::getComponentContext(rSMgr) ) ); } +css::uno::Reference< css::uno::XInterface > SAL_CALL FindAllToolboxController_createInstance( + const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr ) +{ + return static_cast< cppu::OWeakObject * >( + new FindAllToolboxController( comphelper::getComponentContext(rSMgr) ) ); +} + css::uno::Reference< css::uno::XInterface > SAL_CALL ExitFindbarToolboxController_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr ) { diff --git a/svx/source/unodraw/unoctabl.cxx b/svx/source/unodraw/unoctabl.cxx index ada66924b7a0..605f09264b2e 100644 --- a/svx/source/unodraw/unoctabl.cxx +++ b/svx/source/unodraw/unoctabl.cxx @@ -315,6 +315,13 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL svx_component_getFactory ( svx::MatchCaseToolboxController_createInstance, svx::MatchCaseToolboxController::getSupportedServiceNames_Static() ); } + else if ( svx::FindAllToolboxController::getImplementationName_Static().equalsAscii( pImplName ) ) + { + xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ), + svx::FindAllToolboxController::getImplementationName_Static(), + svx::FindAllToolboxController_createInstance, + svx::FindAllToolboxController::getSupportedServiceNames_Static() ); + } else if ( svx::ExitSearchToolboxController::getImplementationName_Static().equalsAscii( pImplName ) ) { xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ), diff --git a/svx/util/svx.component b/svx/util/svx.component index 458e2adba2d4..943a38a9883c 100644 --- a/svx/util/svx.component +++ b/svx/util/svx.component @@ -61,6 +61,9 @@ <implementation name="com.sun.star.svx.MatchCaseToolboxController"> <service name="com.sun.star.frame.ToolbarController"/> </implementation> + <implementation name="com.sun.star.svx.FindAllToolboxController"> + <service name="com.sun.star.frame.ToolbarController"/> + </implementation> <implementation name="com.sun.star.svx.FontHeightToolBoxController"> <service name="com.sun.star.frame.ToolbarController"/> </implementation> diff --git a/sw/uiconfig/sglobal/toolbar/findbar.xml b/sw/uiconfig/sglobal/toolbar/findbar.xml index f8052a181bfe..4e8ec6ba0743 100644 --- a/sw/uiconfig/sglobal/toolbar/findbar.xml +++ b/sw/uiconfig/sglobal/toolbar/findbar.xml @@ -22,6 +22,7 @@ <toolbar:toolbaritem xlink:href=".uno:FindText"/> <toolbar:toolbaritem xlink:href=".uno:DownSearch"/> <toolbar:toolbaritem xlink:href=".uno:UpSearch"/> + <toolbar:toolbaritem xlink:href=".uno:FindAll"/> <toolbar:toolbaritem xlink:href=".uno:MatchCase"/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:SearchDialog"/> diff --git a/sw/uiconfig/sweb/toolbar/findbar.xml b/sw/uiconfig/sweb/toolbar/findbar.xml index f8052a181bfe..4e8ec6ba0743 100644 --- a/sw/uiconfig/sweb/toolbar/findbar.xml +++ b/sw/uiconfig/sweb/toolbar/findbar.xml @@ -22,6 +22,7 @@ <toolbar:toolbaritem xlink:href=".uno:FindText"/> <toolbar:toolbaritem xlink:href=".uno:DownSearch"/> <toolbar:toolbaritem xlink:href=".uno:UpSearch"/> + <toolbar:toolbaritem xlink:href=".uno:FindAll"/> <toolbar:toolbaritem xlink:href=".uno:MatchCase"/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:SearchDialog"/> diff --git a/sw/uiconfig/swriter/toolbar/findbar.xml b/sw/uiconfig/swriter/toolbar/findbar.xml index f8052a181bfe..4e8ec6ba0743 100644 --- a/sw/uiconfig/swriter/toolbar/findbar.xml +++ b/sw/uiconfig/swriter/toolbar/findbar.xml @@ -22,6 +22,7 @@ <toolbar:toolbaritem xlink:href=".uno:FindText"/> <toolbar:toolbaritem xlink:href=".uno:DownSearch"/> <toolbar:toolbaritem xlink:href=".uno:UpSearch"/> + <toolbar:toolbaritem xlink:href=".uno:FindAll"/> <toolbar:toolbaritem xlink:href=".uno:MatchCase"/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:SearchDialog"/> diff --git a/sw/uiconfig/swxform/toolbar/findbar.xml b/sw/uiconfig/swxform/toolbar/findbar.xml index f8052a181bfe..4e8ec6ba0743 100644 --- a/sw/uiconfig/swxform/toolbar/findbar.xml +++ b/sw/uiconfig/swxform/toolbar/findbar.xml @@ -22,6 +22,7 @@ <toolbar:toolbaritem xlink:href=".uno:FindText"/> <toolbar:toolbaritem xlink:href=".uno:DownSearch"/> <toolbar:toolbaritem xlink:href=".uno:UpSearch"/> + <toolbar:toolbaritem xlink:href=".uno:FindAll"/> <toolbar:toolbaritem xlink:href=".uno:MatchCase"/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:SearchDialog"/> |