summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sfx2/source/dialog/taskpane.cxx22
-rw-r--r--sfx2/workben/custompanel/ctp_panel.cxx14
-rw-r--r--sfx2/workben/custompanel/ctp_panel.hxx1
3 files changed, 33 insertions, 4 deletions
diff --git a/sfx2/source/dialog/taskpane.cxx b/sfx2/source/dialog/taskpane.cxx
index 383306da42e8..c7d91df1ce6b 100644
--- a/sfx2/source/dialog/taskpane.cxx
+++ b/sfx2/source/dialog/taskpane.cxx
@@ -213,6 +213,7 @@ namespace sfx2
//==================================================================================================================
namespace
{
+ //--------------------------------------------------------------------------------------------------------------
::rtl::OUString lcl_identifyModule( const Reference< XFrame >& i_rDocumentFrame )
{
::rtl::OUString sModuleName;
@@ -229,6 +230,7 @@ namespace sfx2
return sModuleName;
}
+ //--------------------------------------------------------------------------------------------------------------
::rtl::OUString lcl_identifyModule( const SfxBindings* i_pBindings )
{
const SfxViewFrame* pViewFrame = i_pBindings->GetDispatcher()->GetFrame();
@@ -236,6 +238,8 @@ namespace sfx2
const Reference< XFrame > xFrame( pFrame->GetFrameInterface() );
return lcl_identifyModule( xFrame );
}
+
+ //--------------------------------------------------------------------------------------------------------------
}
//==================================================================================================================
@@ -361,9 +365,10 @@ namespace sfx2
private:
const ::rtl::OUString m_sUIName;
+ const Image m_aPanelImage;
const ::rtl::OUString m_sResourceURL;
CustomPanelUIElement m_aCustomPanel;
- bool m_bAttemptedCreation;
+ bool m_bAttemptedCreation;
};
//------------------------------------------------------------------------------------------------------------------
@@ -485,9 +490,18 @@ namespace sfx2
//------------------------------------------------------------------------------------------------------------------
Reference< XAccessible > CustomToolPanel::CreatePanelAccessible( const Reference< XAccessible >& i_rParentAccessible )
{
- // TODO
- (void)i_rParentAccessible;
- return NULL;
+ ENSURE_OR_RETURN( m_aCustomPanel.is(), "no panel to ask!", NULL );
+
+ Reference< XAccessible > xPanelAccessible;
+ try
+ {
+ xPanelAccessible.set( m_aCustomPanel.getToolPanel()->createAccessible( i_rParentAccessible ), UNO_SET_THROW );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return xPanelAccessible;
}
//==================================================================================================================
diff --git a/sfx2/workben/custompanel/ctp_panel.cxx b/sfx2/workben/custompanel/ctp_panel.cxx
index c159b65e497e..7cbd3b0dece4 100644
--- a/sfx2/workben/custompanel/ctp_panel.cxx
+++ b/sfx2/workben/custompanel/ctp_panel.cxx
@@ -71,6 +71,7 @@ namespace sd { namespace colortoolpanel
using ::com::sun::star::lang::EventObject;
using ::com::sun::star::awt::XDevice;
using ::com::sun::star::awt::XGraphics;
+ using ::com::sun::star::accessibility::XAccessible;
/** === end UNO using === **/
namespace WindowAttribute = ::com::sun::star::awt::WindowAttribute;
namespace PosSize = ::com::sun::star::awt::PosSize;
@@ -149,6 +150,19 @@ namespace sd { namespace colortoolpanel
}
//------------------------------------------------------------------------------------------------------------------
+ Reference< XAccessible > SAL_CALL SingleColorPanel::createAccessible( const Reference< XAccessible >& i_rParentAccessible ) throw (RuntimeException)
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+ if ( !m_xWindow.is() )
+ throw DisposedException( ::rtl::OUString(), *this );
+
+ // TODO: the following is wrong, since it doesn't respect i_rParentAccessible. In a real extension, you should
+ // implement this correctly :)
+ (void)i_rParentAccessible;
+ return Reference< XAccessible >( getWindow(), UNO_QUERY );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
void SAL_CALL SingleColorPanel::windowPaint( const PaintEvent& i_rEvent ) throw (RuntimeException)
{
try
diff --git a/sfx2/workben/custompanel/ctp_panel.hxx b/sfx2/workben/custompanel/ctp_panel.hxx
index c3882e3afe98..75283d686250 100644
--- a/sfx2/workben/custompanel/ctp_panel.hxx
+++ b/sfx2/workben/custompanel/ctp_panel.hxx
@@ -63,6 +63,7 @@ namespace sd { namespace colortoolpanel
// XToolPanel
virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL getWindow() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL createAccessible( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rParentAccessible ) throw (::com::sun::star::uno::RuntimeException);
// XPaintListener
virtual void SAL_CALL windowPaint( const ::com::sun::star::awt::PaintEvent& e ) throw (::com::sun::star::uno::RuntimeException);