Kaydet (Commit) 0a966b90 authored tarafından Ocke Janssen [oj]'s avatar Ocke Janssen [oj]

tabcontrol: fix some compile errors

üst 265043a9
...@@ -85,5 +85,6 @@ protected: ...@@ -85,5 +85,6 @@ protected:
private: private:
sal_Int16 m_nActiveTabPageId; sal_Int16 m_nActiveTabPageId;
TabPageListenerMultiplexer m_aTabPageListeners; TabPageListenerMultiplexer m_aTabPageListeners;
::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPage > > m_aTabPages;
}; };
#endif // _TOOLKIT_AWT_VCLXTABPAGEMODEL_HXX_ #endif // _TOOLKIT_AWT_VCLXTABPAGEMODEL_HXX_
...@@ -66,7 +66,6 @@ SLOFILES= \ ...@@ -66,7 +66,6 @@ SLOFILES= \
$(SLO)$/asynccallback.obj\ $(SLO)$/asynccallback.obj\
$(SLO)/vclxbutton.obj\ $(SLO)/vclxbutton.obj\
$(SLO)/vclxdialog.obj\ $(SLO)/vclxdialog.obj\
$(SLO)/vclxtabpagemodel.obj\
$(SLO)/vclxtabpagecontainer.obj\ $(SLO)/vclxtabpagecontainer.obj\
$(SLO)/vclxfixedline.obj\ $(SLO)/vclxfixedline.obj\
$(SLO)/vclxplugin.obj\ $(SLO)/vclxplugin.obj\
......
...@@ -112,7 +112,6 @@ void SAL_CALL VCLXTabPageContainer::setProperty(const ::rtl::OUString& PropertyN ...@@ -112,7 +112,6 @@ void SAL_CALL VCLXTabPageContainer::setProperty(const ::rtl::OUString& PropertyN
TabControl* pTabPage = (TabControl*)GetWindow(); TabControl* pTabPage = (TabControl*)GetWindow();
if ( pTabPage ) if ( pTabPage )
{ {
sal_Bool bVoid = Value.getValueType().getTypeClass() == TypeClass_VOID;
VCLXWindow::setProperty( PropertyName, Value ); VCLXWindow::setProperty( PropertyName, Value );
} }
} }
...@@ -136,20 +135,27 @@ void SAL_CALL VCLXTabPageContainer::setActiveTabPageID( ::sal_Int16 _activetabpa ...@@ -136,20 +135,27 @@ void SAL_CALL VCLXTabPageContainer::setActiveTabPageID( ::sal_Int16 _activetabpa
{ {
return (getActiveTabPageID() == tabPageIndex); return (getActiveTabPageID() == tabPageIndex);
} }
Reference< ::com::sun::star::awt::tab::XTabPage > SAL_CALL VCLXTabPageContainer::getTabPage( ::sal_Int16 /*tabPageIndex*/ ) throw (RuntimeException) Reference< ::com::sun::star::awt::tab::XTabPage > SAL_CALL VCLXTabPageContainer::getTabPage( ::sal_Int16 tabPageIndex ) throw (RuntimeException)
{ {
return NULL; return (tabPageIndex >= 0 && tabPageIndex < static_cast<sal_Int16>(m_aTabPages.size())) ? m_aTabPages[tabPageIndex] : NULL;
} }
Reference< ::com::sun::star::awt::tab::XTabPage > SAL_CALL VCLXTabPageContainer::getTabPageByID( ::sal_Int16 tabPageID ) throw (RuntimeException) Reference< ::com::sun::star::awt::tab::XTabPage > SAL_CALL VCLXTabPageContainer::getTabPageByID( ::sal_Int16 tabPageID ) throw (RuntimeException)
{ {
TabControl* pTabCtrl = (TabControl*)GetWindow(); ::vos::OClearableGuard aGuard( GetMutex() );
if ( pTabCtrl ) Reference< ::com::sun::star::awt::tab::XTabPage > xTabPage;
::std::vector< Reference< ::com::sun::star::awt::tab::XTabPage > >::iterator aIter = m_aTabPages.begin();
::std::vector< Reference< ::com::sun::star::awt::tab::XTabPage > >::iterator aEnd = m_aTabPages.end();
for(;aIter != aEnd;++aIter)
{ {
TabPage* pTabPage = pTabCtrl->GetTabPage(tabPageID); Reference< awt::XControl > xControl(*aIter,UNO_QUERY );
Reference< awt::tab::XTabPageModel > xP( xControl->getModel(), UNO_QUERY );
if ( tabPageID == xP->getTabPageID() )
{
xTabPage = *aIter;
break;
}
} }
//methode um aus tabpage ein XTabpage zuerzeugen fehlt - Xcontainer methoden vielleicht nutzen return xTabPage;
//da er mit Controls arbeitet und XTabPage ist Control
return NULL;
} }
void SAL_CALL VCLXTabPageContainer::addTabPageListener( const Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (RuntimeException) void SAL_CALL VCLXTabPageContainer::addTabPageListener( const Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (RuntimeException)
{ {
...@@ -183,7 +189,7 @@ void VCLXTabPageContainer::ProcessWindowEvent( const VclWindowEvent& _rVclWindow ...@@ -183,7 +189,7 @@ void VCLXTabPageContainer::ProcessWindowEvent( const VclWindowEvent& _rVclWindow
} }
} }
} }
void SAL_CALL VCLXTabPageContainer::disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException) void SAL_CALL VCLXTabPageContainer::disposing( const ::com::sun::star::lang::EventObject& /*Source*/ ) throw (::com::sun::star::uno::RuntimeException)
{ {
} }
void SAL_CALL VCLXTabPageContainer::elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException) void SAL_CALL VCLXTabPageContainer::elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException)
...@@ -206,6 +212,7 @@ void SAL_CALL VCLXTabPageContainer::elementInserted( const ::com::sun::star::con ...@@ -206,6 +212,7 @@ void SAL_CALL VCLXTabPageContainer::elementInserted( const ::com::sun::star::con
pTabCtrl->SetHelpText(nPageID,xP->getTooltip()); pTabCtrl->SetHelpText(nPageID,xP->getTooltip());
pTabCtrl->SetPageImage(nPageID,TkResMgr::getImageFromURL(xP->getImageURL())); pTabCtrl->SetPageImage(nPageID,TkResMgr::getImageFromURL(xP->getImageURL()));
pTabCtrl->SelectTabPage(nPageID); pTabCtrl->SelectTabPage(nPageID);
m_aTabPages.push_back(xTabPage);
} }
} }
void SAL_CALL VCLXTabPageContainer::elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException) void SAL_CALL VCLXTabPageContainer::elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException)
...@@ -218,8 +225,9 @@ void SAL_CALL VCLXTabPageContainer::elementRemoved( const ::com::sun::star::cont ...@@ -218,8 +225,9 @@ void SAL_CALL VCLXTabPageContainer::elementRemoved( const ::com::sun::star::cont
Reference< awt::XControl > xControl(xTabPage,UNO_QUERY ); Reference< awt::XControl > xControl(xTabPage,UNO_QUERY );
Reference< awt::tab::XTabPageModel > xP( xControl->getModel(), UNO_QUERY ); Reference< awt::tab::XTabPageModel > xP( xControl->getModel(), UNO_QUERY );
pTabCtrl->RemovePage(xP->getTabPageID()); pTabCtrl->RemovePage(xP->getTabPageID());
m_aTabPages.erase(::std::remove(m_aTabPages.begin(),m_aTabPages.end(),xTabPage));
} }
} }
void SAL_CALL VCLXTabPageContainer::elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException) void SAL_CALL VCLXTabPageContainer::elementReplaced( const ::com::sun::star::container::ContainerEvent& /*Event*/ ) throw (::com::sun::star::uno::RuntimeException)
{ {
} }
...@@ -50,7 +50,7 @@ VCLXTabPageModel::~VCLXTabPageModel() ...@@ -50,7 +50,7 @@ VCLXTabPageModel::~VCLXTabPageModel()
void SAL_CALL VCLXTabPageModel::draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::sun::star::uno::RuntimeException) void SAL_CALL VCLXTabPageModel::draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::sun::star::uno::RuntimeException)
{ {
/*::osl::MutexGuard aGuard( GetMutex() ); ::osl::MutexGuard aGuard( GetMutex() );
Window* pWindow = GetWindow(); Window* pWindow = GetWindow();
if ( pWindow ) if ( pWindow )
...@@ -63,7 +63,7 @@ void SAL_CALL VCLXTabPageModel::draw( sal_Int32 nX, sal_Int32 nY ) throw(::com:: ...@@ -63,7 +63,7 @@ void SAL_CALL VCLXTabPageModel::draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::
Point aPos = pDev->PixelToLogic( Point( nX, nY ) ); Point aPos = pDev->PixelToLogic( Point( nX, nY ) );
pWindow->Draw( pDev, aPos, aSize, WINDOW_DRAW_NOCONTROLS ); pWindow->Draw( pDev, aPos, aSize, WINDOW_DRAW_NOCONTROLS );
}*/ }
} }
::com::sun::star::awt::DeviceInfo VCLXTabPageModel::getInfo() throw(::com::sun::star::uno::RuntimeException) ::com::sun::star::awt::DeviceInfo VCLXTabPageModel::getInfo() throw(::com::sun::star::uno::RuntimeException)
...@@ -74,8 +74,8 @@ void SAL_CALL VCLXTabPageModel::draw( sal_Int32 nX, sal_Int32 nY ) throw(::com:: ...@@ -74,8 +74,8 @@ void SAL_CALL VCLXTabPageModel::draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::
void SAL_CALL VCLXTabPageModel::setProperty( void SAL_CALL VCLXTabPageModel::setProperty(
const ::rtl::OUString& PropertyName, const ::rtl::OUString& /*PropertyName*/,
const ::com::sun::star::uno::Any& Value ) const ::com::sun::star::uno::Any& /*Value*/ )
throw(::com::sun::star::uno::RuntimeException) throw(::com::sun::star::uno::RuntimeException)
{ {
::osl::MutexGuard aGuard( GetMutex() ); ::osl::MutexGuard aGuard( GetMutex() );
...@@ -83,8 +83,6 @@ throw(::com::sun::star::uno::RuntimeException) ...@@ -83,8 +83,6 @@ throw(::com::sun::star::uno::RuntimeException)
/*TabPage* pTabPage = (TabPage*)GetWindow(); /*TabPage* pTabPage = (TabPage*)GetWindow();
if ( pTabPage ) if ( pTabPage )
{ {
sal_Bool bVoid = Value.getValueType().getTypeClass() == ::com::sun::star::uno::TypeClass_VOID;
VCLXWindow::setProperty( PropertyName, Value ); VCLXWindow::setProperty( PropertyName, Value );
}*/ }*/
} }
......
...@@ -728,9 +728,9 @@ void SAL_CALL ControlModelContainerBase::setGroup( const Sequence< Reference< XC ...@@ -728,9 +728,9 @@ void SAL_CALL ControlModelContainerBase::setGroup( const Sequence< Reference< XC
} }
////----- XInitialization ------------------------------------------------------------------- ////----- XInitialization -------------------------------------------------------------------
void SAL_CALL ControlModelContainerBase::initialize (const Sequence<Any>& rArguments) void SAL_CALL ControlModelContainerBase::initialize (const Sequence<Any>& rArguments) throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException)
{ {
sal_Int16 nPageId; sal_Int16 nPageId = -1;
if ( rArguments.getLength() == 1 ) if ( rArguments.getLength() == 1 )
{ {
if ( !( rArguments[ 0 ] >>= nPageId )) if ( !( rArguments[ 0 ] >>= nPageId ))
...@@ -1781,22 +1781,29 @@ uno::Reference< graphic::XGraphic > ControlContainerBase::Impl_getGraphicFromURL ...@@ -1781,22 +1781,29 @@ uno::Reference< graphic::XGraphic > ControlContainerBase::Impl_getGraphicFromURL
::rtl::OUString getPhysicalLocation( const ::com::sun::star::uno::Any& rbase, const ::com::sun::star::uno::Any& rUrl ) ::rtl::OUString getPhysicalLocation( const ::com::sun::star::uno::Any& rbase, const ::com::sun::star::uno::Any& rUrl )
{ {
::rtl::OUString ret;
::rtl::OUString baseLocation; ::rtl::OUString baseLocation;
::rtl::OUString url; ::rtl::OUString url;
rbase >>= baseLocation; rbase >>= baseLocation;
rUrl >>= url; rUrl >>= url;
::rtl::OUString absoluteURL( url );
if ( url.getLength() > 0 ) if ( url.getLength() > 0 )
{ {
INetURLObject urlObj(baseLocation); INetURLObject urlObj(baseLocation);
urlObj.removeSegment(); urlObj.removeSegment();
baseLocation = urlObj.GetMainURL( INetURLObject::NO_DECODE ); baseLocation = urlObj.GetMainURL( INetURLObject::NO_DECODE );
::osl::FileBase::getAbsoluteFileURL( baseLocation, url, ret );
const INetURLObject protocolCheck( url );
const INetProtocol protocol = protocolCheck.GetProtocol();
if ( protocol == INET_PROT_NOT_VALID )
{
::rtl::OUString testAbsoluteURL;
if ( ::osl::FileBase::E_None == ::osl::FileBase::getAbsoluteFileURL( baseLocation, url, testAbsoluteURL ) )
absoluteURL = testAbsoluteURL;
}
} }
return ret; return absoluteURL;
} }
...@@ -460,3 +460,4 @@ throw (RuntimeException) ...@@ -460,3 +460,4 @@ throw (RuntimeException)
{ {
ImplUpdateResourceResolver(); ImplUpdateResourceResolver();
} }
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <toolkit/helper/unopropertyarrayhelper.hxx> #include <toolkit/helper/unopropertyarrayhelper.hxx>
#include <toolkit/helper/property.hxx> #include <toolkit/helper/property.hxx>
#include <toolkit/controls/geometrycontrolmodel.hxx>
#include <com/sun/star/awt/XVclWindowPeer.hpp> #include <com/sun/star/awt/XVclWindowPeer.hpp>
#include <comphelper/processfactory.hxx> #include <comphelper/processfactory.hxx>
#include <osl/diagnose.h> #include <osl/diagnose.h>
...@@ -77,6 +78,8 @@ uno::Any UnoControlTabPageContainerModel::ImplGetDefaultValue( sal_uInt16 nPropI ...@@ -77,6 +78,8 @@ uno::Any UnoControlTabPageContainerModel::ImplGetDefaultValue( sal_uInt16 nPropI
{ {
case BASEPROPERTY_DEFAULTCONTROL: case BASEPROPERTY_DEFAULTCONTROL:
return uno::makeAny( ::rtl::OUString::createFromAscii( szServiceName_UnoControlTabPageContainer ) ); return uno::makeAny( ::rtl::OUString::createFromAscii( szServiceName_UnoControlTabPageContainer ) );
case BASEPROPERTY_BORDER:
return uno::makeAny((sal_Int16) 2); // No Border
default: default:
return UnoControlModel::ImplGetDefaultValue( nPropId ); return UnoControlModel::ImplGetDefaultValue( nPropId );
} }
...@@ -284,5 +287,5 @@ Reference< XInterface > SAL_CALL UnoControlTabPageContainer_CreateInstance( cons ...@@ -284,5 +287,5 @@ Reference< XInterface > SAL_CALL UnoControlTabPageContainer_CreateInstance( cons
Reference< XInterface > SAL_CALL UnoControlTabPageContainerModel_CreateInstance( const Reference< XMultiServiceFactory >& ) Reference< XInterface > SAL_CALL UnoControlTabPageContainerModel_CreateInstance( const Reference< XMultiServiceFactory >& )
{ {
return Reference < XInterface >( ( ::cppu::OWeakObject* ) new UnoControlTabPageContainerModel ); return Reference < XInterface >( ( ::cppu::OWeakObject* ) new OGeometryControlModel<UnoControlTabPageContainerModel>() );
} }
...@@ -192,8 +192,9 @@ uno::Reference< beans::XPropertySetInfo > UnoControlTabPageModel::getPropertySet ...@@ -192,8 +192,9 @@ uno::Reference< beans::XPropertySetInfo > UnoControlTabPageModel::getPropertySet
} }
////----- XInitialization ------------------------------------------------------------------- ////----- XInitialization -------------------------------------------------------------------
void SAL_CALL UnoControlTabPageModel::initialize (const Sequence<Any>& rArguments) void SAL_CALL UnoControlTabPageModel::initialize (const Sequence<Any>& rArguments)
throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException)
{ {
sal_Int16 nPageId; sal_Int16 nPageId = -1;
if ( rArguments.getLength() == 1 ) if ( rArguments.getLength() == 1 )
{ {
if ( !( rArguments[ 0 ] >>= nPageId )) if ( !( rArguments[ 0 ] >>= nPageId ))
......
...@@ -1463,7 +1463,7 @@ sal_Bool UnoControl::supportsService( const ::rtl::OUString& rServiceName ) thro ...@@ -1463,7 +1463,7 @@ sal_Bool UnoControl::supportsService( const ::rtl::OUString& rServiceName ) thro
Sequence< ::rtl::OUString > aSNL = getSupportedServiceNames(); Sequence< ::rtl::OUString > aSNL = getSupportedServiceNames();
const ::rtl::OUString* pArray = aSNL.getConstArray(); const ::rtl::OUString* pArray = aSNL.getConstArray();
const ::rtl::OUString* pArrayEnd = aSNL.getConstArray(); const ::rtl::OUString* pArrayEnd = aSNL.getConstArray() + aSNL.getLength();
for (; pArray != pArrayEnd; ++pArray ) for (; pArray != pArrayEnd; ++pArray )
if( *pArray == rServiceName ) if( *pArray == rServiceName )
break; break;
......
...@@ -106,4 +106,5 @@ const sal_Char __FAR_DATA szServiceName_GridColumn[] = "com.sun.star.awt.grid.Gr ...@@ -106,4 +106,5 @@ const sal_Char __FAR_DATA szServiceName_GridColumn[] = "com.sun.star.awt.grid.Gr
const sal_Char __FAR_DATA szServiceName_UnoControlTabPage[] = "com.sun.star.awt.tab.UnoControlTabPage"; const sal_Char __FAR_DATA szServiceName_UnoControlTabPage[] = "com.sun.star.awt.tab.UnoControlTabPage";
const sal_Char __FAR_DATA szServiceName_UnoControlTabPageModel[] = "com.sun.star.awt.tab.UnoControlTabPageModel"; const sal_Char __FAR_DATA szServiceName_UnoControlTabPageModel[] = "com.sun.star.awt.tab.UnoControlTabPageModel";
const sal_Char __FAR_DATA szServiceName_UnoControlTabPageContainerModel[] = "com.sun.star.awt.tab.UnoControlTabPageContainerModel"; const sal_Char __FAR_DATA szServiceName_UnoControlTabPageContainerModel[] = "com.sun.star.awt.tab.UnoControlTabPageContainerModel";
const sal_Char __FAR_DATA szServiceName_UnoControlTabPageContainer[] = "com.sun.star.awt.tab.UnoControlTabPageContainer"; const sal_Char __FAR_DATA szServiceName_UnoControlTabPageContainer[] = "com.sun.star.awt.tab.UnoControlTabPageContainer";
\ No newline at end of file
...@@ -127,4 +127,5 @@ Image TkResMgr::getImageFromURL( const ::rtl::OUString& i_rImageURL ) ...@@ -127,4 +127,5 @@ Image TkResMgr::getImageFromURL( const ::rtl::OUString& i_rImageURL )
DBG_UNHANDLED_EXCEPTION(); DBG_UNHANDLED_EXCEPTION();
} }
return Image(); return Image();
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment