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:
private:
sal_Int16 m_nActiveTabPageId;
TabPageListenerMultiplexer m_aTabPageListeners;
::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPage > > m_aTabPages;
};
#endif // _TOOLKIT_AWT_VCLXTABPAGEMODEL_HXX_
......@@ -66,7 +66,6 @@ SLOFILES= \
$(SLO)$/asynccallback.obj\
$(SLO)/vclxbutton.obj\
$(SLO)/vclxdialog.obj\
$(SLO)/vclxtabpagemodel.obj\
$(SLO)/vclxtabpagecontainer.obj\
$(SLO)/vclxfixedline.obj\
$(SLO)/vclxplugin.obj\
......
......@@ -112,7 +112,6 @@ void SAL_CALL VCLXTabPageContainer::setProperty(const ::rtl::OUString& PropertyN
TabControl* pTabPage = (TabControl*)GetWindow();
if ( pTabPage )
{
sal_Bool bVoid = Value.getValueType().getTypeClass() == TypeClass_VOID;
VCLXWindow::setProperty( PropertyName, Value );
}
}
......@@ -136,20 +135,27 @@ void SAL_CALL VCLXTabPageContainer::setActiveTabPageID( ::sal_Int16 _activetabpa
{
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)
{
TabControl* pTabCtrl = (TabControl*)GetWindow();
if ( pTabCtrl )
::vos::OClearableGuard aGuard( GetMutex() );
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
//da er mit Controls arbeitet und XTabPage ist Control
return NULL;
return xTabPage;
}
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
}
}
}
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)
......@@ -206,6 +212,7 @@ void SAL_CALL VCLXTabPageContainer::elementInserted( const ::com::sun::star::con
pTabCtrl->SetHelpText(nPageID,xP->getTooltip());
pTabCtrl->SetPageImage(nPageID,TkResMgr::getImageFromURL(xP->getImageURL()));
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)
......@@ -218,8 +225,9 @@ void SAL_CALL VCLXTabPageContainer::elementRemoved( const ::com::sun::star::cont
Reference< awt::XControl > xControl(xTabPage,UNO_QUERY );
Reference< awt::tab::XTabPageModel > xP( xControl->getModel(), UNO_QUERY );
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()
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();
if ( pWindow )
......@@ -63,7 +63,7 @@ void SAL_CALL VCLXTabPageModel::draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::
Point aPos = pDev->PixelToLogic( Point( nX, nY ) );
pWindow->Draw( pDev, aPos, aSize, WINDOW_DRAW_NOCONTROLS );
}*/
}
}
::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::
void SAL_CALL VCLXTabPageModel::setProperty(
const ::rtl::OUString& PropertyName,
const ::com::sun::star::uno::Any& Value )
const ::rtl::OUString& /*PropertyName*/,
const ::com::sun::star::uno::Any& /*Value*/ )
throw(::com::sun::star::uno::RuntimeException)
{
::osl::MutexGuard aGuard( GetMutex() );
......@@ -83,8 +83,6 @@ throw(::com::sun::star::uno::RuntimeException)
/*TabPage* pTabPage = (TabPage*)GetWindow();
if ( pTabPage )
{
sal_Bool bVoid = Value.getValueType().getTypeClass() == ::com::sun::star::uno::TypeClass_VOID;
VCLXWindow::setProperty( PropertyName, Value );
}*/
}
......
......@@ -728,9 +728,9 @@ void SAL_CALL ControlModelContainerBase::setGroup( const Sequence< Reference< XC
}
////----- 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[ 0 ] >>= nPageId ))
......@@ -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 ret;
::rtl::OUString baseLocation;
::rtl::OUString url;
rbase >>= baseLocation;
rUrl >>= url;
::rtl::OUString absoluteURL( url );
if ( url.getLength() > 0 )
{
INetURLObject urlObj(baseLocation);
urlObj.removeSegment();
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)
{
ImplUpdateResourceResolver();
}
......@@ -33,6 +33,7 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <toolkit/helper/unopropertyarrayhelper.hxx>
#include <toolkit/helper/property.hxx>
#include <toolkit/controls/geometrycontrolmodel.hxx>
#include <com/sun/star/awt/XVclWindowPeer.hpp>
#include <comphelper/processfactory.hxx>
#include <osl/diagnose.h>
......@@ -77,6 +78,8 @@ uno::Any UnoControlTabPageContainerModel::ImplGetDefaultValue( sal_uInt16 nPropI
{
case BASEPROPERTY_DEFAULTCONTROL:
return uno::makeAny( ::rtl::OUString::createFromAscii( szServiceName_UnoControlTabPageContainer ) );
case BASEPROPERTY_BORDER:
return uno::makeAny((sal_Int16) 2); // No Border
default:
return UnoControlModel::ImplGetDefaultValue( nPropId );
}
......@@ -284,5 +287,5 @@ Reference< XInterface > SAL_CALL UnoControlTabPageContainer_CreateInstance( cons
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
}
////----- XInitialization -------------------------------------------------------------------
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[ 0 ] >>= nPageId ))
......
......@@ -1463,7 +1463,7 @@ sal_Bool UnoControl::supportsService( const ::rtl::OUString& rServiceName ) thro
Sequence< ::rtl::OUString > aSNL = getSupportedServiceNames();
const ::rtl::OUString* pArray = aSNL.getConstArray();
const ::rtl::OUString* pArrayEnd = aSNL.getConstArray();
const ::rtl::OUString* pArrayEnd = aSNL.getConstArray() + aSNL.getLength();
for (; pArray != pArrayEnd; ++pArray )
if( *pArray == rServiceName )
break;
......
......@@ -107,3 +107,4 @@ const sal_Char __FAR_DATA szServiceName_UnoControlTabPage[] = "com.sun.star.awt.
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_UnoControlTabPageContainer[] = "com.sun.star.awt.tab.UnoControlTabPageContainer";
......@@ -128,3 +128,4 @@ Image TkResMgr::getImageFromURL( const ::rtl::OUString& i_rImageURL )
}
return Image();
}
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