DEV300: changesets OOO330 up to m8
This commit is contained in:
commit
66ee906cda
@ -365,7 +365,7 @@ BOOL ModulWindow::BasicExecute()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( !pMethod || ( nStart < nCurMethodStart ) )
|
else if ( !pMethod || ( nStart < nCurMethodStart && !pM->IsHidden() ) )
|
||||||
{
|
{
|
||||||
pMethod = pM;
|
pMethod = pM;
|
||||||
nCurMethodStart = nStart;
|
nCurMethodStart = nStart;
|
||||||
|
@ -155,7 +155,7 @@ public:
|
|||||||
|
|
||||||
TYPEINIT1( BasicIDEShell, SfxViewShell );
|
TYPEINIT1( BasicIDEShell, SfxViewShell );
|
||||||
|
|
||||||
SFX_IMPL_VIEWFACTORY( BasicIDEShell, IDEResId( SVX_INTERFACE_BASIDE_VIEWSH ) )
|
SFX_IMPL_NAMED_VIEWFACTORY( BasicIDEShell, "Default" )
|
||||||
{
|
{
|
||||||
SFX_VIEW_REGISTRATION( BasicDocShell );
|
SFX_VIEW_REGISTRATION( BasicDocShell );
|
||||||
}
|
}
|
||||||
|
@ -364,13 +364,23 @@ Sequence< ::rtl::OUString > GetMethodNames( const ScriptDocument& rDocument, con
|
|||||||
SbModuleRef xModule = new SbModule( rModName );
|
SbModuleRef xModule = new SbModule( rModName );
|
||||||
xModule->SetSource32( aOUSource );
|
xModule->SetSource32( aOUSource );
|
||||||
USHORT nCount = xModule->GetMethods()->Count();
|
USHORT nCount = xModule->GetMethods()->Count();
|
||||||
aSeqMethods.realloc( nCount );
|
USHORT nRealCount = nCount;
|
||||||
|
|
||||||
for ( USHORT i = 0; i < nCount; i++ )
|
for ( USHORT i = 0; i < nCount; i++ )
|
||||||
{
|
{
|
||||||
SbMethod* pMethod = (SbMethod*)xModule->GetMethods()->Get( i );
|
SbMethod* pMethod = (SbMethod*)xModule->GetMethods()->Get( i );
|
||||||
|
if( pMethod->IsHidden() )
|
||||||
|
--nRealCount;
|
||||||
|
}
|
||||||
|
aSeqMethods.realloc( nRealCount );
|
||||||
|
|
||||||
|
USHORT iTarget = 0;
|
||||||
|
for ( USHORT i = 0 ; i < nCount; ++i )
|
||||||
|
{
|
||||||
|
SbMethod* pMethod = (SbMethod*)xModule->GetMethods()->Get( i );
|
||||||
|
if( pMethod->IsHidden() )
|
||||||
|
continue;
|
||||||
DBG_ASSERT( pMethod, "Method not found! (NULL)" );
|
DBG_ASSERT( pMethod, "Method not found! (NULL)" );
|
||||||
aSeqMethods.getArray()[ i ] = pMethod->GetName();
|
aSeqMethods.getArray()[ iTarget++ ] = pMethod->GetName();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -392,7 +402,7 @@ BOOL HasMethod( const ScriptDocument& rDocument, const String& rLibName, const S
|
|||||||
if ( pMethods )
|
if ( pMethods )
|
||||||
{
|
{
|
||||||
SbMethod* pMethod = (SbMethod*)pMethods->Find( rMethName, SbxCLASS_METHOD );
|
SbMethod* pMethod = (SbMethod*)pMethods->Find( rMethName, SbxCLASS_METHOD );
|
||||||
if ( pMethod )
|
if ( pMethod && !pMethod->IsHidden() )
|
||||||
bHasMethod = TRUE;
|
bHasMethod = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -554,11 +554,15 @@ IMPL_LINK( MacroChooser, BasicSelectHdl, SvTreeListBox *, pBox )
|
|||||||
// Die Macros sollen in der Reihenfolge angezeigt werden,
|
// Die Macros sollen in der Reihenfolge angezeigt werden,
|
||||||
// wie sie im Modul stehen.
|
// wie sie im Modul stehen.
|
||||||
MacroList aMacros;
|
MacroList aMacros;
|
||||||
USHORT nMacros = pModule->GetMethods()->Count();
|
USHORT nMacroCount = pModule->GetMethods()->Count();
|
||||||
USHORT nMethod;
|
USHORT nRealMacroCount = 0;
|
||||||
for ( nMethod = 0; nMethod < nMacros; nMethod++ )
|
USHORT iMeth;
|
||||||
|
for ( iMeth = 0; iMeth < nMacroCount; iMeth++ )
|
||||||
{
|
{
|
||||||
SbMethod* pMethod = (SbMethod*)pModule->GetMethods()->Get( nMethod );
|
SbMethod* pMethod = (SbMethod*)pModule->GetMethods()->Get( iMeth );
|
||||||
|
if( pMethod->IsHidden() )
|
||||||
|
continue;
|
||||||
|
++nRealMacroCount;
|
||||||
DBG_ASSERT( pMethod, "Methode nicht gefunden! (NULL)" );
|
DBG_ASSERT( pMethod, "Methode nicht gefunden! (NULL)" );
|
||||||
ULONG nPos = LIST_APPEND;
|
ULONG nPos = LIST_APPEND;
|
||||||
// Eventuell weiter vorne ?
|
// Eventuell weiter vorne ?
|
||||||
@ -580,8 +584,8 @@ IMPL_LINK( MacroChooser, BasicSelectHdl, SvTreeListBox *, pBox )
|
|||||||
}
|
}
|
||||||
|
|
||||||
aMacroBox.SetUpdateMode( FALSE );
|
aMacroBox.SetUpdateMode( FALSE );
|
||||||
for ( nMethod = 0; nMethod < nMacros; nMethod++ )
|
for ( iMeth = 0; iMeth < nRealMacroCount; iMeth++ )
|
||||||
aMacroBox.InsertEntry( aMacros.GetObject( nMethod )->GetName() );
|
aMacroBox.InsertEntry( aMacros.GetObject( iMeth )->GetName() );
|
||||||
aMacroBox.SetUpdateMode( TRUE );
|
aMacroBox.SetUpdateMode( TRUE );
|
||||||
|
|
||||||
if ( aMacroBox.GetEntryCount() )
|
if ( aMacroBox.GetEntryCount() )
|
||||||
|
@ -1176,7 +1176,11 @@ bool MenuSaveInData::LoadSubMenus(
|
|||||||
const OUString& rBaseTitle,
|
const OUString& rBaseTitle,
|
||||||
SvxConfigEntry* pParentData )
|
SvxConfigEntry* pParentData )
|
||||||
{
|
{
|
||||||
SvxEntries* pEntries = pParentData->GetEntries();
|
SvxEntries* pEntries = pParentData->GetEntries();
|
||||||
|
|
||||||
|
// Don't access non existing menu configuration!
|
||||||
|
if ( !xMenuSettings.is() )
|
||||||
|
return true;
|
||||||
|
|
||||||
for ( sal_Int32 nIndex = 0; nIndex < xMenuSettings->getCount(); nIndex++ )
|
for ( sal_Int32 nIndex = 0; nIndex < xMenuSettings->getCount(); nIndex++ )
|
||||||
{
|
{
|
||||||
@ -2593,17 +2597,20 @@ IMPL_LINK( SvxMenuConfigPage, SelectMenu, ListBox *, pBox )
|
|||||||
SvxConfigEntry* pMenuData = GetTopLevelSelection();
|
SvxConfigEntry* pMenuData = GetTopLevelSelection();
|
||||||
|
|
||||||
PopupMenu* pPopup = aModifyTopLevelButton.GetPopupMenu();
|
PopupMenu* pPopup = aModifyTopLevelButton.GetPopupMenu();
|
||||||
pPopup->EnableItem( ID_DELETE, pMenuData->IsDeletable() );
|
if ( pMenuData )
|
||||||
pPopup->EnableItem( ID_RENAME, pMenuData->IsRenamable() );
|
|
||||||
pPopup->EnableItem( ID_MOVE, pMenuData->IsMovable() );
|
|
||||||
|
|
||||||
SvxEntries* pEntries = pMenuData->GetEntries();
|
|
||||||
SvxEntries::const_iterator iter = pEntries->begin();
|
|
||||||
|
|
||||||
for ( ; iter != pEntries->end(); iter++ )
|
|
||||||
{
|
{
|
||||||
SvxConfigEntry* pEntry = *iter;
|
pPopup->EnableItem( ID_DELETE, pMenuData->IsDeletable() );
|
||||||
InsertEntryIntoUI( pEntry );
|
pPopup->EnableItem( ID_RENAME, pMenuData->IsRenamable() );
|
||||||
|
pPopup->EnableItem( ID_MOVE, pMenuData->IsMovable() );
|
||||||
|
|
||||||
|
SvxEntries* pEntries = pMenuData->GetEntries();
|
||||||
|
SvxEntries::const_iterator iter = pEntries->begin();
|
||||||
|
|
||||||
|
for ( ; iter != pEntries->end(); iter++ )
|
||||||
|
{
|
||||||
|
SvxConfigEntry* pEntry = *iter;
|
||||||
|
InsertEntryIntoUI( pEntry );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateButtonStates();
|
UpdateButtonStates();
|
||||||
|
@ -1,10 +1,29 @@
|
|||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
|
*
|
||||||
Source Code Control System - Header
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
$Header: /zpool/svn/migration/cvs_rep_09_09_08/code/extensions/source/plugin/unx/npnapi.cxx,v 1.11 2008-01-14 14:53:25 ihi Exp $
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
||||||
|
*
|
||||||
*************************************************************************/
|
* OpenOffice.org - a multi-platform office productivity suite
|
||||||
|
*
|
||||||
|
* This file is part of OpenOffice.org.
|
||||||
|
*
|
||||||
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Lesser General Public License version 3
|
||||||
|
* only, as published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Lesser General Public License version 3 for more details
|
||||||
|
* (a copy is included in the LICENSE file that accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
|
* version 3 along with OpenOffice.org. If not, see
|
||||||
|
* <http://www.openoffice.org/license.html>
|
||||||
|
* for a copy of the LGPLv3 License.
|
||||||
|
*
|
||||||
|
************************************************************************/
|
||||||
|
|
||||||
// MARKER(update_precomp.py): autogen include statement, do not remove
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
||||||
#include "precompiled_extensions.hxx"
|
#include "precompiled_extensions.hxx"
|
||||||
|
@ -1,10 +1,29 @@
|
|||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
|
*
|
||||||
Source Code Control System - Header
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
$Header: /zpool/svn/migration/cvs_rep_09_09_08/code/extensions/source/plugin/unx/nppapi.cxx,v 1.7 2008-01-14 14:53:38 ihi Exp $
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
||||||
|
*
|
||||||
*************************************************************************/
|
* OpenOffice.org - a multi-platform office productivity suite
|
||||||
|
*
|
||||||
|
* This file is part of OpenOffice.org.
|
||||||
|
*
|
||||||
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Lesser General Public License version 3
|
||||||
|
* only, as published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Lesser General Public License version 3 for more details
|
||||||
|
* (a copy is included in the LICENSE file that accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
|
* version 3 along with OpenOffice.org. If not, see
|
||||||
|
* <http://www.openoffice.org/license.html>
|
||||||
|
* for a copy of the LGPLv3 License.
|
||||||
|
*
|
||||||
|
************************************************************************/
|
||||||
|
|
||||||
// MARKER(update_precomp.py): autogen include statement, do not remove
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
||||||
#include "precompiled_extensions.hxx"
|
#include "precompiled_extensions.hxx"
|
||||||
|
@ -507,14 +507,12 @@ DBG_NAME(OControlModel)
|
|||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
Sequence<sal_Int8> SAL_CALL OControlModel::getImplementationId() throw(RuntimeException)
|
Sequence<sal_Int8> SAL_CALL OControlModel::getImplementationId() throw(RuntimeException)
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getImplementationId" );
|
|
||||||
return OImplementationIds::getImplementationId(getTypes());
|
return OImplementationIds::getImplementationId(getTypes());
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
Sequence<Type> SAL_CALL OControlModel::getTypes() throw(RuntimeException)
|
Sequence<Type> SAL_CALL OControlModel::getTypes() throw(RuntimeException)
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getTypes" );
|
|
||||||
TypeBag aTypes( _getTypes() );
|
TypeBag aTypes( _getTypes() );
|
||||||
|
|
||||||
Reference< XTypeProvider > xProv;
|
Reference< XTypeProvider > xProv;
|
||||||
@ -527,7 +525,6 @@ Sequence<Type> SAL_CALL OControlModel::getTypes() throw(RuntimeException)
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
Sequence<Type> OControlModel::_getTypes()
|
Sequence<Type> OControlModel::_getTypes()
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::_getTypes" );
|
|
||||||
return TypeBag( OComponentHelper::getTypes(),
|
return TypeBag( OComponentHelper::getTypes(),
|
||||||
OPropertySetAggregationHelper::getTypes(),
|
OPropertySetAggregationHelper::getTypes(),
|
||||||
OControlModel_BASE::getTypes()
|
OControlModel_BASE::getTypes()
|
||||||
@ -537,7 +534,6 @@ Sequence<Type> OControlModel::_getTypes()
|
|||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
Any SAL_CALL OControlModel::queryAggregation(const Type& _rType) throw (RuntimeException)
|
Any SAL_CALL OControlModel::queryAggregation(const Type& _rType) throw (RuntimeException)
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::queryAggregation" );
|
|
||||||
// base class 1
|
// base class 1
|
||||||
Any aReturn(OComponentHelper::queryAggregation(_rType));
|
Any aReturn(OComponentHelper::queryAggregation(_rType));
|
||||||
|
|
||||||
@ -561,7 +557,6 @@ Any SAL_CALL OControlModel::queryAggregation(const Type& _rType) throw (RuntimeE
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
void OControlModel::readHelpTextCompatibly(const staruno::Reference< stario::XObjectInputStream >& _rxInStream)
|
void OControlModel::readHelpTextCompatibly(const staruno::Reference< stario::XObjectInputStream >& _rxInStream)
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::readHelpTextCompatibly" );
|
|
||||||
::rtl::OUString sHelpText;
|
::rtl::OUString sHelpText;
|
||||||
::comphelper::operator>>( _rxInStream, sHelpText);
|
::comphelper::operator>>( _rxInStream, sHelpText);
|
||||||
try
|
try
|
||||||
@ -578,7 +573,6 @@ void OControlModel::readHelpTextCompatibly(const staruno::Reference< stario::XOb
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
void OControlModel::writeHelpTextCompatibly(const staruno::Reference< stario::XObjectOutputStream >& _rxOutStream)
|
void OControlModel::writeHelpTextCompatibly(const staruno::Reference< stario::XObjectOutputStream >& _rxOutStream)
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::writeHelpTextCompatibly" );
|
|
||||||
::rtl::OUString sHelpText;
|
::rtl::OUString sHelpText;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -609,7 +603,6 @@ OControlModel::OControlModel(
|
|||||||
// the native look is ugly ....
|
// the native look is ugly ....
|
||||||
// #i37342# / 2004-11-19 / frank.schoenheit@sun.com
|
// #i37342# / 2004-11-19 / frank.schoenheit@sun.com
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::OControlModel" );
|
|
||||||
DBG_CTOR(OControlModel, NULL);
|
DBG_CTOR(OControlModel, NULL);
|
||||||
if (_rUnoControlModelTypeName.getLength()) // the is a model we have to aggregate
|
if (_rUnoControlModelTypeName.getLength()) // the is a model we have to aggregate
|
||||||
{
|
{
|
||||||
@ -651,7 +644,6 @@ OControlModel::OControlModel( const OControlModel* _pOriginal, const Reference<
|
|||||||
,m_nTabIndex( FRM_DEFAULT_TABINDEX )
|
,m_nTabIndex( FRM_DEFAULT_TABINDEX )
|
||||||
,m_nClassId( FormComponentType::CONTROL )
|
,m_nClassId( FormComponentType::CONTROL )
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::OControlModel(copy)" );
|
|
||||||
DBG_CTOR( OControlModel, NULL );
|
DBG_CTOR( OControlModel, NULL );
|
||||||
DBG_ASSERT( _pOriginal, "OControlModel::OControlModel: invalid original!" );
|
DBG_ASSERT( _pOriginal, "OControlModel::OControlModel: invalid original!" );
|
||||||
|
|
||||||
@ -696,14 +688,12 @@ OControlModel::~OControlModel()
|
|||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
void OControlModel::clonedFrom( const OControlModel* /*_pOriginal*/ )
|
void OControlModel::clonedFrom( const OControlModel* /*_pOriginal*/ )
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::clonedFrom" );
|
|
||||||
// nothing to do in this base class
|
// nothing to do in this base class
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
void OControlModel::doResetDelegator()
|
void OControlModel::doResetDelegator()
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::doResetDelegator" );
|
|
||||||
if (m_xAggregate.is())
|
if (m_xAggregate.is())
|
||||||
m_xAggregate->setDelegator(NULL);
|
m_xAggregate->setDelegator(NULL);
|
||||||
}
|
}
|
||||||
@ -711,7 +701,6 @@ void OControlModel::doResetDelegator()
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
void OControlModel::doSetDelegator()
|
void OControlModel::doSetDelegator()
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::doSetDelegator" );
|
|
||||||
increment(m_refCount);
|
increment(m_refCount);
|
||||||
if (m_xAggregate.is())
|
if (m_xAggregate.is())
|
||||||
{
|
{
|
||||||
@ -724,14 +713,12 @@ void OControlModel::doSetDelegator()
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
InterfaceRef SAL_CALL OControlModel::getParent() throw(RuntimeException)
|
InterfaceRef SAL_CALL OControlModel::getParent() throw(RuntimeException)
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getParent" );
|
|
||||||
return m_xParent;
|
return m_xParent;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
void SAL_CALL OControlModel::setParent(const InterfaceRef& _rxParent) throw(com::sun::star::lang::NoSupportException, RuntimeException)
|
void SAL_CALL OControlModel::setParent(const InterfaceRef& _rxParent) throw(com::sun::star::lang::NoSupportException, RuntimeException)
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::setParent" );
|
|
||||||
osl::MutexGuard aGuard(m_aMutex);
|
osl::MutexGuard aGuard(m_aMutex);
|
||||||
|
|
||||||
Reference<XComponent> xComp(m_xParent, UNO_QUERY);
|
Reference<XComponent> xComp(m_xParent, UNO_QUERY);
|
||||||
@ -749,7 +736,6 @@ void SAL_CALL OControlModel::setParent(const InterfaceRef& _rxParent) throw(com:
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
::rtl::OUString SAL_CALL OControlModel::getName() throw(RuntimeException)
|
::rtl::OUString SAL_CALL OControlModel::getName() throw(RuntimeException)
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getName" );
|
|
||||||
::rtl::OUString aReturn;
|
::rtl::OUString aReturn;
|
||||||
OPropertySetHelper::getFastPropertyValue(PROPERTY_ID_NAME) >>= aReturn;
|
OPropertySetHelper::getFastPropertyValue(PROPERTY_ID_NAME) >>= aReturn;
|
||||||
return aReturn;
|
return aReturn;
|
||||||
@ -758,7 +744,6 @@ void SAL_CALL OControlModel::setParent(const InterfaceRef& _rxParent) throw(com:
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
void SAL_CALL OControlModel::setName(const ::rtl::OUString& _rName) throw(RuntimeException)
|
void SAL_CALL OControlModel::setName(const ::rtl::OUString& _rName) throw(RuntimeException)
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::setName" );
|
|
||||||
setFastPropertyValue(PROPERTY_ID_NAME, makeAny(_rName));
|
setFastPropertyValue(PROPERTY_ID_NAME, makeAny(_rName));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -766,7 +751,6 @@ void SAL_CALL OControlModel::setName(const ::rtl::OUString& _rName) throw(Runtim
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
sal_Bool SAL_CALL OControlModel::supportsService(const rtl::OUString& _rServiceName) throw ( RuntimeException)
|
sal_Bool SAL_CALL OControlModel::supportsService(const rtl::OUString& _rServiceName) throw ( RuntimeException)
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::supportsService" );
|
|
||||||
Sequence<rtl::OUString> aSupported = getSupportedServiceNames();
|
Sequence<rtl::OUString> aSupported = getSupportedServiceNames();
|
||||||
const rtl::OUString* pSupported = aSupported.getConstArray();
|
const rtl::OUString* pSupported = aSupported.getConstArray();
|
||||||
for (sal_Int32 i=0; i<aSupported.getLength(); ++i, ++pSupported)
|
for (sal_Int32 i=0; i<aSupported.getLength(); ++i, ++pSupported)
|
||||||
@ -778,7 +762,6 @@ sal_Bool SAL_CALL OControlModel::supportsService(const rtl::OUString& _rServiceN
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
Sequence< ::rtl::OUString > OControlModel::getAggregateServiceNames()
|
Sequence< ::rtl::OUString > OControlModel::getAggregateServiceNames()
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getAggregateServiceNames" );
|
|
||||||
Sequence< ::rtl::OUString > aAggServices;
|
Sequence< ::rtl::OUString > aAggServices;
|
||||||
Reference< XServiceInfo > xInfo;
|
Reference< XServiceInfo > xInfo;
|
||||||
if ( query_aggregation( m_xAggregate, xInfo ) )
|
if ( query_aggregation( m_xAggregate, xInfo ) )
|
||||||
@ -789,7 +772,6 @@ Sequence< ::rtl::OUString > OControlModel::getAggregateServiceNames()
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
Sequence<rtl::OUString> SAL_CALL OControlModel::getSupportedServiceNames() throw(RuntimeException)
|
Sequence<rtl::OUString> SAL_CALL OControlModel::getSupportedServiceNames() throw(RuntimeException)
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getSupportedServiceNames" );
|
|
||||||
return ::comphelper::concatSequences(
|
return ::comphelper::concatSequences(
|
||||||
getAggregateServiceNames(),
|
getAggregateServiceNames(),
|
||||||
getSupportedServiceNames_Static()
|
getSupportedServiceNames_Static()
|
||||||
@ -799,7 +781,6 @@ Sequence<rtl::OUString> SAL_CALL OControlModel::getSupportedServiceNames() throw
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
Sequence< ::rtl::OUString > SAL_CALL OControlModel::getSupportedServiceNames_Static() throw( RuntimeException )
|
Sequence< ::rtl::OUString > SAL_CALL OControlModel::getSupportedServiceNames_Static() throw( RuntimeException )
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getSupportedServiceNames_Static" );
|
|
||||||
Sequence< ::rtl::OUString > aServiceNames( 2 );
|
Sequence< ::rtl::OUString > aServiceNames( 2 );
|
||||||
aServiceNames[ 0 ] = FRM_SUN_FORMCOMPONENT;
|
aServiceNames[ 0 ] = FRM_SUN_FORMCOMPONENT;
|
||||||
aServiceNames[ 1 ] = ::rtl::OUString::createFromAscii( "com.sun.star.form.FormControlModel" );
|
aServiceNames[ 1 ] = ::rtl::OUString::createFromAscii( "com.sun.star.form.FormControlModel" );
|
||||||
@ -810,7 +791,6 @@ Sequence< ::rtl::OUString > SAL_CALL OControlModel::getSupportedServiceNames_Sta
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
void SAL_CALL OControlModel::disposing(const com::sun::star::lang::EventObject& _rSource) throw (RuntimeException)
|
void SAL_CALL OControlModel::disposing(const com::sun::star::lang::EventObject& _rSource) throw (RuntimeException)
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::disposing" );
|
|
||||||
// release the parent
|
// release the parent
|
||||||
if (_rSource.Source == m_xParent)
|
if (_rSource.Source == m_xParent)
|
||||||
{
|
{
|
||||||
@ -832,7 +812,6 @@ void SAL_CALL OControlModel::disposing(const com::sun::star::lang::EventObject&
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void OControlModel::disposing()
|
void OControlModel::disposing()
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::disposing" );
|
|
||||||
OPropertySetAggregationHelper::disposing();
|
OPropertySetAggregationHelper::disposing();
|
||||||
|
|
||||||
Reference<com::sun::star::lang::XComponent> xComp;
|
Reference<com::sun::star::lang::XComponent> xComp;
|
||||||
@ -847,7 +826,6 @@ void OControlModel::disposing()
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
void OControlModel::writeAggregate( const Reference< XObjectOutputStream >& _rxOutStream ) const
|
void OControlModel::writeAggregate( const Reference< XObjectOutputStream >& _rxOutStream ) const
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::writeAggregate" );
|
|
||||||
Reference< XPersistObject > xPersist;
|
Reference< XPersistObject > xPersist;
|
||||||
if ( query_aggregation( m_xAggregate, xPersist ) )
|
if ( query_aggregation( m_xAggregate, xPersist ) )
|
||||||
xPersist->write( _rxOutStream );
|
xPersist->write( _rxOutStream );
|
||||||
@ -856,7 +834,6 @@ void OControlModel::writeAggregate( const Reference< XObjectOutputStream >& _rxO
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
void OControlModel::readAggregate( const Reference< XObjectInputStream >& _rxInStream )
|
void OControlModel::readAggregate( const Reference< XObjectInputStream >& _rxInStream )
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::readAggregate" );
|
|
||||||
Reference< XPersistObject > xPersist;
|
Reference< XPersistObject > xPersist;
|
||||||
if ( query_aggregation( m_xAggregate, xPersist ) )
|
if ( query_aggregation( m_xAggregate, xPersist ) )
|
||||||
xPersist->read( _rxInStream );
|
xPersist->read( _rxInStream );
|
||||||
@ -866,7 +843,6 @@ void OControlModel::readAggregate( const Reference< XObjectInputStream >& _rxInS
|
|||||||
void SAL_CALL OControlModel::write(const Reference<stario::XObjectOutputStream>& _rxOutStream)
|
void SAL_CALL OControlModel::write(const Reference<stario::XObjectOutputStream>& _rxOutStream)
|
||||||
throw(stario::IOException, RuntimeException)
|
throw(stario::IOException, RuntimeException)
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::write" );
|
|
||||||
osl::MutexGuard aGuard(m_aMutex);
|
osl::MutexGuard aGuard(m_aMutex);
|
||||||
|
|
||||||
// 1. Schreiben des UnoControls
|
// 1. Schreiben des UnoControls
|
||||||
@ -912,7 +888,6 @@ void SAL_CALL OControlModel::write(const Reference<stario::XObjectOutputStream>&
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
void OControlModel::read(const Reference<stario::XObjectInputStream>& InStream) throw (::com::sun::star::io::IOException, RuntimeException)
|
void OControlModel::read(const Reference<stario::XObjectInputStream>& InStream) throw (::com::sun::star::io::IOException, RuntimeException)
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::read" );
|
|
||||||
osl::MutexGuard aGuard(m_aMutex);
|
osl::MutexGuard aGuard(m_aMutex);
|
||||||
|
|
||||||
Reference<stario::XMarkableStream> xMark(InStream, UNO_QUERY);
|
Reference<stario::XMarkableStream> xMark(InStream, UNO_QUERY);
|
||||||
@ -966,7 +941,6 @@ void OControlModel::read(const Reference<stario::XObjectInputStream>& InStream)
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
PropertyState OControlModel::getPropertyStateByHandle( sal_Int32 _nHandle )
|
PropertyState OControlModel::getPropertyStateByHandle( sal_Int32 _nHandle )
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getPropertyStateByHandle" );
|
|
||||||
// simply compare the current and the default value
|
// simply compare the current and the default value
|
||||||
Any aCurrentValue = getPropertyDefaultByHandle( _nHandle );
|
Any aCurrentValue = getPropertyDefaultByHandle( _nHandle );
|
||||||
Any aDefaultValue; getFastPropertyValue( aDefaultValue, _nHandle );
|
Any aDefaultValue; getFastPropertyValue( aDefaultValue, _nHandle );
|
||||||
@ -983,7 +957,6 @@ PropertyState OControlModel::getPropertyStateByHandle( sal_Int32 _nHandle )
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
void OControlModel::setPropertyToDefaultByHandle( sal_Int32 _nHandle)
|
void OControlModel::setPropertyToDefaultByHandle( sal_Int32 _nHandle)
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::setPropertyToDefaultByHandle" );
|
|
||||||
Any aDefault = getPropertyDefaultByHandle( _nHandle );
|
Any aDefault = getPropertyDefaultByHandle( _nHandle );
|
||||||
|
|
||||||
Any aConvertedValue, aOldValue;
|
Any aConvertedValue, aOldValue;
|
||||||
@ -997,7 +970,6 @@ void OControlModel::setPropertyToDefaultByHandle( sal_Int32 _nHandle)
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
Any OControlModel::getPropertyDefaultByHandle( sal_Int32 _nHandle ) const
|
Any OControlModel::getPropertyDefaultByHandle( sal_Int32 _nHandle ) const
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getPropertyDefaultByHandle" );
|
|
||||||
Any aReturn;
|
Any aReturn;
|
||||||
switch ( _nHandle )
|
switch ( _nHandle )
|
||||||
{
|
{
|
||||||
@ -1030,7 +1002,6 @@ Any OControlModel::getPropertyDefaultByHandle( sal_Int32 _nHandle ) const
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
void OControlModel::getFastPropertyValue( Any& _rValue, sal_Int32 _nHandle ) const
|
void OControlModel::getFastPropertyValue( Any& _rValue, sal_Int32 _nHandle ) const
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getFastPropertyValue" );
|
|
||||||
switch ( _nHandle )
|
switch ( _nHandle )
|
||||||
{
|
{
|
||||||
case PROPERTY_ID_NAME:
|
case PROPERTY_ID_NAME:
|
||||||
@ -1062,7 +1033,6 @@ sal_Bool OControlModel::convertFastPropertyValue(
|
|||||||
Any& _rConvertedValue, Any& _rOldValue, sal_Int32 _nHandle, const Any& _rValue)
|
Any& _rConvertedValue, Any& _rOldValue, sal_Int32 _nHandle, const Any& _rValue)
|
||||||
throw (com::sun::star::lang::IllegalArgumentException)
|
throw (com::sun::star::lang::IllegalArgumentException)
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::convertFastPropertyValue" );
|
|
||||||
sal_Bool bModified(sal_False);
|
sal_Bool bModified(sal_False);
|
||||||
switch (_nHandle)
|
switch (_nHandle)
|
||||||
{
|
{
|
||||||
@ -1092,7 +1062,6 @@ sal_Bool OControlModel::convertFastPropertyValue(
|
|||||||
void OControlModel::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const Any& _rValue)
|
void OControlModel::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const Any& _rValue)
|
||||||
throw (Exception)
|
throw (Exception)
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::setFastPropertyValue_NoBroadcast" );
|
|
||||||
switch (_nHandle)
|
switch (_nHandle)
|
||||||
{
|
{
|
||||||
case PROPERTY_ID_NAME:
|
case PROPERTY_ID_NAME:
|
||||||
@ -1125,7 +1094,6 @@ void OControlModel::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const A
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
void OControlModel::describeFixedProperties( Sequence< Property >& _rProps ) const
|
void OControlModel::describeFixedProperties( Sequence< Property >& _rProps ) const
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::describeFixedProperties" );
|
|
||||||
BEGIN_DESCRIBE_BASE_PROPERTIES( 4 )
|
BEGIN_DESCRIBE_BASE_PROPERTIES( 4 )
|
||||||
DECL_PROP2 (CLASSID, sal_Int16, READONLY, TRANSIENT);
|
DECL_PROP2 (CLASSID, sal_Int16, READONLY, TRANSIENT);
|
||||||
DECL_PROP1 (NAME, ::rtl::OUString, BOUND);
|
DECL_PROP1 (NAME, ::rtl::OUString, BOUND);
|
||||||
@ -1137,7 +1105,6 @@ void OControlModel::describeFixedProperties( Sequence< Property >& _rProps ) con
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
void OControlModel::describeAggregateProperties( Sequence< Property >& /* [out] */ _rAggregateProps ) const
|
void OControlModel::describeAggregateProperties( Sequence< Property >& /* [out] */ _rAggregateProps ) const
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::describeAggregateProperties" );
|
|
||||||
if ( m_xAggregateSet.is() )
|
if ( m_xAggregateSet.is() )
|
||||||
{
|
{
|
||||||
Reference< XPropertySetInfo > xPSI( m_xAggregateSet->getPropertySetInfo() );
|
Reference< XPropertySetInfo > xPSI( m_xAggregateSet->getPropertySetInfo() );
|
||||||
@ -1149,14 +1116,12 @@ void OControlModel::describeAggregateProperties( Sequence< Property >& /* [out]
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
::osl::Mutex& OControlModel::getMutex()
|
::osl::Mutex& OControlModel::getMutex()
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getMutex" );
|
|
||||||
return m_aMutex;
|
return m_aMutex;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
void OControlModel::describeFixedAndAggregateProperties( Sequence< Property >& _out_rFixedProperties, Sequence< Property >& _out_rAggregateProperties ) const
|
void OControlModel::describeFixedAndAggregateProperties( Sequence< Property >& _out_rFixedProperties, Sequence< Property >& _out_rAggregateProperties ) const
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::describeFixedAndAggregateProperties" );
|
|
||||||
describeFixedProperties( _out_rFixedProperties );
|
describeFixedProperties( _out_rFixedProperties );
|
||||||
describeAggregateProperties( _out_rAggregateProperties );
|
describeAggregateProperties( _out_rAggregateProperties );
|
||||||
}
|
}
|
||||||
@ -1164,49 +1129,42 @@ void OControlModel::describeFixedAndAggregateProperties( Sequence< Property >& _
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
Reference< XMultiPropertySet > OControlModel::getPropertiesInterface()
|
Reference< XMultiPropertySet > OControlModel::getPropertiesInterface()
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getPropertiesInterface" );
|
|
||||||
return Reference< XMultiPropertySet >( *this, UNO_QUERY );
|
return Reference< XMultiPropertySet >( *this, UNO_QUERY );
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
Reference< XPropertySetInfo> SAL_CALL OControlModel::getPropertySetInfo() throw( RuntimeException)
|
Reference< XPropertySetInfo> SAL_CALL OControlModel::getPropertySetInfo() throw( RuntimeException)
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getPropertySetInfo" );
|
|
||||||
return createPropertySetInfo( getInfoHelper() );
|
return createPropertySetInfo( getInfoHelper() );
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
::cppu::IPropertyArrayHelper& OControlModel::getInfoHelper()
|
::cppu::IPropertyArrayHelper& OControlModel::getInfoHelper()
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getInfoHelper" );
|
|
||||||
return m_aPropertyBagHelper.getInfoHelper();
|
return m_aPropertyBagHelper.getInfoHelper();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
void SAL_CALL OControlModel::addProperty( const ::rtl::OUString& _rName, ::sal_Int16 _nAttributes, const Any& _rInitialValue ) throw (PropertyExistException, IllegalTypeException, IllegalArgumentException, RuntimeException)
|
void SAL_CALL OControlModel::addProperty( const ::rtl::OUString& _rName, ::sal_Int16 _nAttributes, const Any& _rInitialValue ) throw (PropertyExistException, IllegalTypeException, IllegalArgumentException, RuntimeException)
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::addProperty" );
|
|
||||||
m_aPropertyBagHelper.addProperty( _rName, _nAttributes, _rInitialValue );
|
m_aPropertyBagHelper.addProperty( _rName, _nAttributes, _rInitialValue );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
void SAL_CALL OControlModel::removeProperty( const ::rtl::OUString& _rName ) throw (UnknownPropertyException, NotRemoveableException, RuntimeException)
|
void SAL_CALL OControlModel::removeProperty( const ::rtl::OUString& _rName ) throw (UnknownPropertyException, NotRemoveableException, RuntimeException)
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::removeProperty" );
|
|
||||||
m_aPropertyBagHelper.removeProperty( _rName );
|
m_aPropertyBagHelper.removeProperty( _rName );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
Sequence< PropertyValue > SAL_CALL OControlModel::getPropertyValues() throw (RuntimeException)
|
Sequence< PropertyValue > SAL_CALL OControlModel::getPropertyValues() throw (RuntimeException)
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getPropertyValues" );
|
|
||||||
return m_aPropertyBagHelper.getPropertyValues();
|
return m_aPropertyBagHelper.getPropertyValues();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
void SAL_CALL OControlModel::setPropertyValues( const Sequence< PropertyValue >& _rProps ) throw (UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException)
|
void SAL_CALL OControlModel::setPropertyValues( const Sequence< PropertyValue >& _rProps ) throw (UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException)
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::setPropertyValues" );
|
|
||||||
m_aPropertyBagHelper.setPropertyValues( _rProps );
|
m_aPropertyBagHelper.setPropertyValues( _rProps );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1249,7 +1207,6 @@ Any SAL_CALL OBoundControlModel::queryAggregation( const Type& _rType ) throw (R
|
|||||||
Any aReturn( OControlModel::queryAggregation(_rType) );
|
Any aReturn( OControlModel::queryAggregation(_rType) );
|
||||||
if (!aReturn.hasValue())
|
if (!aReturn.hasValue())
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::queryAggregation" );
|
|
||||||
aReturn = OBoundControlModel_BASE1::queryInterface(_rType);
|
aReturn = OBoundControlModel_BASE1::queryInterface(_rType);
|
||||||
|
|
||||||
if ( !aReturn.hasValue() && m_bCommitable )
|
if ( !aReturn.hasValue() && m_bCommitable )
|
||||||
@ -1426,11 +1383,20 @@ void OBoundControlModel::implInitValuePropertyListening( ) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
void OBoundControlModel::initOwnValueProperty( const ::rtl::OUString& i_rValuePropertyName )
|
||||||
|
{
|
||||||
|
OSL_PRECOND( !m_sValuePropertyName.getLength() && -1 == m_nValuePropertyAggregateHandle,
|
||||||
|
"OBoundControlModel::initOwnValueProperty: value property is already initialized!" );
|
||||||
|
OSL_ENSURE( i_rValuePropertyName.getLength(), "OBoundControlModel::initOwnValueProperty: invalid property name!" );
|
||||||
|
m_sValuePropertyName = i_rValuePropertyName;
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void OBoundControlModel::initValueProperty( const ::rtl::OUString& _rValuePropertyName, sal_Int32 _nValuePropertyExternalHandle )
|
void OBoundControlModel::initValueProperty( const ::rtl::OUString& _rValuePropertyName, sal_Int32 _nValuePropertyExternalHandle )
|
||||||
{
|
{
|
||||||
OSL_PRECOND( !m_sValuePropertyName.getLength() && -1 == m_nValuePropertyAggregateHandle,
|
OSL_PRECOND( !m_sValuePropertyName.getLength() && -1 == m_nValuePropertyAggregateHandle,
|
||||||
"OBoundControlModel::initValueProperty: already called before!" );
|
"OBoundControlModel::initValueProperty: value property is already initialized!" );
|
||||||
OSL_ENSURE( _rValuePropertyName.getLength(), "OBoundControlModel::initValueProperty: invalid property name!" );
|
OSL_ENSURE( _rValuePropertyName.getLength(), "OBoundControlModel::initValueProperty: invalid property name!" );
|
||||||
OSL_ENSURE( _nValuePropertyExternalHandle != -1, "OBoundControlModel::initValueProperty: invalid property handle!" );
|
OSL_ENSURE( _nValuePropertyExternalHandle != -1, "OBoundControlModel::initValueProperty: invalid property handle!" );
|
||||||
|
|
||||||
@ -1495,7 +1461,6 @@ Sequence< Type > OBoundControlModel::_getTypes()
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void OBoundControlModel::disposing()
|
void OBoundControlModel::disposing()
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::_getTypes" );
|
|
||||||
OControlModel::disposing();
|
OControlModel::disposing();
|
||||||
|
|
||||||
::osl::ClearableMutexGuard aGuard(m_aMutex);
|
::osl::ClearableMutexGuard aGuard(m_aMutex);
|
||||||
@ -1532,6 +1497,29 @@ void OBoundControlModel::disposing()
|
|||||||
disconnectValidator( );
|
disconnectValidator( );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
void OBoundControlModel::onValuePropertyChange( ControlModelLock& i_rControLock )
|
||||||
|
{
|
||||||
|
if ( hasExternalValueBinding() )
|
||||||
|
{ // the control value changed, while we have an external value binding
|
||||||
|
// -> forward the value to it
|
||||||
|
if ( m_eControlValueChangeInstigator != eExternalBinding )
|
||||||
|
transferControlValueToExternal( i_rControLock );
|
||||||
|
}
|
||||||
|
else if ( !m_bCommitable && m_xColumnUpdate.is() )
|
||||||
|
{ // the control value changed, while we are bound to a database column,
|
||||||
|
// but not committable (which means changes in the control have to be reflected to
|
||||||
|
// the underlying database column immediately)
|
||||||
|
// -> forward the value to the database column
|
||||||
|
if ( m_eControlValueChangeInstigator != eDbColumnBinding )
|
||||||
|
commitControlValueToDbColumn( false );
|
||||||
|
}
|
||||||
|
|
||||||
|
// validate the new value
|
||||||
|
if ( m_bSupportsValidation )
|
||||||
|
recheckValidity( true );
|
||||||
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
void OBoundControlModel::_propertyChanged( const PropertyChangeEvent& _rEvt ) throw ( RuntimeException )
|
void OBoundControlModel::_propertyChanged( const PropertyChangeEvent& _rEvt ) throw ( RuntimeException )
|
||||||
{
|
{
|
||||||
@ -1543,26 +1531,8 @@ void OBoundControlModel::_propertyChanged( const PropertyChangeEvent& _rEvt ) th
|
|||||||
"OBoundControlModel::_propertyChanged: where did this come from (2)?" );
|
"OBoundControlModel::_propertyChanged: where did this come from (2)?" );
|
||||||
|
|
||||||
if ( _rEvt.PropertyName == m_sValuePropertyName )
|
if ( _rEvt.PropertyName == m_sValuePropertyName )
|
||||||
{ // our control value changed
|
{
|
||||||
|
onValuePropertyChange( aLock );
|
||||||
if ( hasExternalValueBinding() )
|
|
||||||
{ // the control value changed, while we have an external value binding
|
|
||||||
// -> forward the value to it
|
|
||||||
if ( m_eControlValueChangeInstigator != eExternalBinding )
|
|
||||||
transferControlValueToExternal( aLock );
|
|
||||||
}
|
|
||||||
else if ( !m_bCommitable && m_xColumnUpdate.is() )
|
|
||||||
{ // the control value changed, while we are bound to a database column,
|
|
||||||
// but not committable (which means changes in the control have to be reflected to
|
|
||||||
// the underlying database column immediately)
|
|
||||||
// -> forward the value to the database column
|
|
||||||
if ( m_eControlValueChangeInstigator != eDbColumnBinding )
|
|
||||||
commitControlValueToDbColumn( false );
|
|
||||||
}
|
|
||||||
|
|
||||||
// validate the new value
|
|
||||||
if ( m_bSupportsValidation )
|
|
||||||
recheckValidity( true );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1673,7 +1643,6 @@ void SAL_CALL OBoundControlModel::disposing(const com::sun::star::lang::EventObj
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
StringSequence SAL_CALL OBoundControlModel::getSupportedServiceNames() throw(RuntimeException)
|
StringSequence SAL_CALL OBoundControlModel::getSupportedServiceNames() throw(RuntimeException)
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::disposing" );
|
|
||||||
return ::comphelper::concatSequences(
|
return ::comphelper::concatSequences(
|
||||||
getAggregateServiceNames(),
|
getAggregateServiceNames(),
|
||||||
getSupportedServiceNames_Static()
|
getSupportedServiceNames_Static()
|
||||||
@ -1696,7 +1665,6 @@ Sequence< ::rtl::OUString > SAL_CALL OBoundControlModel::getSupportedServiceName
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
void SAL_CALL OBoundControlModel::write( const Reference<stario::XObjectOutputStream>& _rxOutStream ) throw(stario::IOException, RuntimeException)
|
void SAL_CALL OBoundControlModel::write( const Reference<stario::XObjectOutputStream>& _rxOutStream ) throw(stario::IOException, RuntimeException)
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::getSupportedServiceNames_Static" );
|
|
||||||
OControlModel::write(_rxOutStream);
|
OControlModel::write(_rxOutStream);
|
||||||
|
|
||||||
osl::MutexGuard aGuard(m_aMutex);
|
osl::MutexGuard aGuard(m_aMutex);
|
||||||
@ -1797,7 +1765,6 @@ void SAL_CALL OBoundControlModel::read( const Reference< stario::XObjectInputStr
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
void OBoundControlModel::getFastPropertyValue(Any& rValue, sal_Int32 nHandle) const
|
void OBoundControlModel::getFastPropertyValue(Any& rValue, sal_Int32 nHandle) const
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OBoundControlModel::getFastPropertyValue" );
|
|
||||||
switch (nHandle)
|
switch (nHandle)
|
||||||
{
|
{
|
||||||
case PROPERTY_ID_INPUT_REQUIRED:
|
case PROPERTY_ID_INPUT_REQUIRED:
|
||||||
@ -1866,7 +1833,6 @@ sal_Bool OBoundControlModel::convertFastPropertyValue(
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
Any OBoundControlModel::getPropertyDefaultByHandle( sal_Int32 _nHandle ) const
|
Any OBoundControlModel::getPropertyDefaultByHandle( sal_Int32 _nHandle ) const
|
||||||
{
|
{
|
||||||
// RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "forms", "dev@dba.openoffice.org", "OControlModel::convertFastPropertyValue" );
|
|
||||||
Any aDefault;
|
Any aDefault;
|
||||||
switch ( _nHandle )
|
switch ( _nHandle )
|
||||||
{
|
{
|
||||||
|
@ -151,11 +151,14 @@ OImageControlModel::OImageControlModel(const Reference<XMultiServiceFactory>& _r
|
|||||||
:OBoundControlModel( _rxFactory, VCL_CONTROLMODEL_IMAGECONTROL, FRM_SUN_CONTROL_IMAGECONTROL, sal_False, sal_False, sal_False )
|
:OBoundControlModel( _rxFactory, VCL_CONTROLMODEL_IMAGECONTROL, FRM_SUN_CONTROL_IMAGECONTROL, sal_False, sal_False, sal_False )
|
||||||
// use the old control name for compytibility reasons
|
// use the old control name for compytibility reasons
|
||||||
,m_pImageProducer( NULL )
|
,m_pImageProducer( NULL )
|
||||||
|
,m_bExternalGraphic( true )
|
||||||
,m_bReadOnly( sal_False )
|
,m_bReadOnly( sal_False )
|
||||||
|
,m_sImageURL()
|
||||||
|
,m_xGraphicObject()
|
||||||
{
|
{
|
||||||
DBG_CTOR( OImageControlModel, NULL );
|
DBG_CTOR( OImageControlModel, NULL );
|
||||||
m_nClassId = FormComponentType::IMAGECONTROL;
|
m_nClassId = FormComponentType::IMAGECONTROL;
|
||||||
initValueProperty( PROPERTY_IMAGE_URL, PROPERTY_ID_IMAGE_URL);
|
initOwnValueProperty( PROPERTY_IMAGE_URL );
|
||||||
|
|
||||||
implConstruct();
|
implConstruct();
|
||||||
}
|
}
|
||||||
@ -165,22 +168,20 @@ OImageControlModel::OImageControlModel( const OImageControlModel* _pOriginal, co
|
|||||||
:OBoundControlModel( _pOriginal, _rxFactory )
|
:OBoundControlModel( _pOriginal, _rxFactory )
|
||||||
// use the old control name for compytibility reasons
|
// use the old control name for compytibility reasons
|
||||||
,m_pImageProducer( NULL )
|
,m_pImageProducer( NULL )
|
||||||
|
,m_bExternalGraphic( true )
|
||||||
|
,m_bReadOnly( _pOriginal->m_bReadOnly )
|
||||||
|
,m_sImageURL( _pOriginal->m_sImageURL )
|
||||||
|
,m_xGraphicObject( _pOriginal->m_xGraphicObject )
|
||||||
{
|
{
|
||||||
DBG_CTOR( OImageControlModel, NULL );
|
DBG_CTOR( OImageControlModel, NULL );
|
||||||
implConstruct();
|
implConstruct();
|
||||||
m_bReadOnly = _pOriginal->m_bReadOnly;
|
|
||||||
|
|
||||||
osl_incrementInterlockedCount( &m_refCount );
|
osl_incrementInterlockedCount( &m_refCount );
|
||||||
{
|
{
|
||||||
// simulate a propertyChanged event for the ImageURL
|
// simulate a propertyChanged event for the ImageURL
|
||||||
// 2003-05-15 - #109591# - fs@openoffice.org
|
// 2003-05-15 - #109591# - fs@openoffice.org
|
||||||
Any aImageURL;
|
|
||||||
getFastPropertyValue( aImageURL, PROPERTY_ID_IMAGE_URL );
|
|
||||||
::rtl::OUString sImageURL;
|
|
||||||
aImageURL >>= sImageURL;
|
|
||||||
|
|
||||||
::osl::MutexGuard aGuard( m_aMutex );
|
::osl::MutexGuard aGuard( m_aMutex );
|
||||||
impl_handleNewImageURL_lck( sImageURL, eOther );
|
impl_handleNewImageURL_lck( eOther );
|
||||||
}
|
}
|
||||||
osl_decrementInterlockedCount( &m_refCount );
|
osl_decrementInterlockedCount( &m_refCount );
|
||||||
}
|
}
|
||||||
@ -244,32 +245,20 @@ sal_Bool OImageControlModel::approveDbColumnType( sal_Int32 _nColumnType )
|
|||||||
return ImageStoreInvalid != lcl_getImageStoreType( _nColumnType );
|
return ImageStoreInvalid != lcl_getImageStoreType( _nColumnType );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
void OImageControlModel::_propertyChanged( const PropertyChangeEvent& _rEvent )
|
|
||||||
throw( RuntimeException )
|
|
||||||
{
|
|
||||||
if ( m_xColumnUpdate.is() )
|
|
||||||
{
|
|
||||||
OBoundControlModel::_propertyChanged( _rEvent );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{ // we're not bound. In this case, we have to manually care for updating the
|
|
||||||
// image producer, since the base class will not do this
|
|
||||||
::rtl::OUString sImageURL;
|
|
||||||
_rEvent.NewValue >>= sImageURL;
|
|
||||||
|
|
||||||
::osl::MutexGuard aGuard( m_aMutex );
|
|
||||||
impl_handleNewImageURL_lck( sImageURL, eOther );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
void OImageControlModel::getFastPropertyValue(Any& rValue, sal_Int32 nHandle) const
|
void OImageControlModel::getFastPropertyValue(Any& rValue, sal_Int32 nHandle) const
|
||||||
{
|
{
|
||||||
switch (nHandle)
|
switch (nHandle)
|
||||||
{
|
{
|
||||||
case PROPERTY_ID_READONLY : rValue <<= (sal_Bool)m_bReadOnly; break;
|
case PROPERTY_ID_READONLY:
|
||||||
|
rValue <<= (sal_Bool)m_bReadOnly;
|
||||||
|
break;
|
||||||
|
case PROPERTY_ID_IMAGE_URL:
|
||||||
|
rValue <<= m_sImageURL;
|
||||||
|
break;
|
||||||
|
case PROPERTY_ID_GRAPHIC:
|
||||||
|
rValue <<= m_xGraphicObject.is() ? m_xGraphicObject->getGraphic() : Reference< XGraphic >();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
OBoundControlModel::getFastPropertyValue(rValue, nHandle);
|
OBoundControlModel::getFastPropertyValue(rValue, nHandle);
|
||||||
}
|
}
|
||||||
@ -285,8 +274,51 @@ void OImageControlModel::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, con
|
|||||||
m_bReadOnly = getBOOL(rValue);
|
m_bReadOnly = getBOOL(rValue);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PROPERTY_ID_IMAGE_URL:
|
||||||
|
OSL_VERIFY( rValue >>= m_sImageURL );
|
||||||
|
impl_handleNewImageURL_lck( eOther );
|
||||||
|
{
|
||||||
|
ControlModelLock aLock( *this );
|
||||||
|
// that's a fake ... onValuePropertyChange expects to receive the only lock to our instance,
|
||||||
|
// but we're already called with our mutex locked ...
|
||||||
|
onValuePropertyChange( aLock );
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PROPERTY_ID_GRAPHIC:
|
||||||
|
{
|
||||||
|
Reference< XGraphic > xGraphic;
|
||||||
|
OSL_VERIFY( rValue >>= xGraphic );
|
||||||
|
if ( !xGraphic.is() )
|
||||||
|
m_xGraphicObject.clear();
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_xGraphicObject = GraphicObject::create( m_aContext.getUNOContext() );
|
||||||
|
m_xGraphicObject->setGraphic( xGraphic );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( m_bExternalGraphic )
|
||||||
|
{
|
||||||
|
// if that's an external graphic, i.e. one which has not been loaded by ourselves in response to a
|
||||||
|
// new image URL, then also adjust our ImageURL.
|
||||||
|
::rtl::OUString sNewImageURL;
|
||||||
|
if ( m_xGraphicObject.is() )
|
||||||
|
{
|
||||||
|
sNewImageURL = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.GraphicObject:" ) );
|
||||||
|
sNewImageURL = sNewImageURL + m_xGraphicObject->getUniqueID();
|
||||||
|
}
|
||||||
|
m_sImageURL = sNewImageURL;
|
||||||
|
// TODO: speaking strictly, this would need to be notified, since ImageURL is a bound property. However,
|
||||||
|
// this method here is called with a locked mutex, so we cannot simply call listeners ...
|
||||||
|
// I think the missing notification (and thus clients which potentially cannot observe the change)
|
||||||
|
// is less severe than the potential deadlock ...
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
OBoundControlModel::setFastPropertyValue_NoBroadcast(nHandle, rValue);
|
OBoundControlModel::setFastPropertyValue_NoBroadcast(nHandle, rValue);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -299,6 +331,15 @@ sal_Bool OImageControlModel::convertFastPropertyValue(Any& rConvertedValue, Any&
|
|||||||
case PROPERTY_ID_READONLY :
|
case PROPERTY_ID_READONLY :
|
||||||
return tryPropertyValue(rConvertedValue, rOldValue, rValue, m_bReadOnly);
|
return tryPropertyValue(rConvertedValue, rOldValue, rValue, m_bReadOnly);
|
||||||
|
|
||||||
|
case PROPERTY_ID_IMAGE_URL:
|
||||||
|
return tryPropertyValue( rConvertedValue, rOldValue, rValue, m_sImageURL );
|
||||||
|
|
||||||
|
case PROPERTY_ID_GRAPHIC:
|
||||||
|
{
|
||||||
|
const Reference< XGraphic > xGraphic( getFastPropertyValue( PROPERTY_ID_GRAPHIC ), UNO_QUERY );
|
||||||
|
return tryPropertyValue( rConvertedValue, rOldValue, rValue, xGraphic );
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return OBoundControlModel::convertFastPropertyValue(rConvertedValue, rOldValue, nHandle, rValue);
|
return OBoundControlModel::convertFastPropertyValue(rConvertedValue, rOldValue, nHandle, rValue);
|
||||||
}
|
}
|
||||||
@ -307,12 +348,24 @@ sal_Bool OImageControlModel::convertFastPropertyValue(Any& rConvertedValue, Any&
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
void OImageControlModel::describeFixedProperties( Sequence< Property >& _rProps ) const
|
void OImageControlModel::describeFixedProperties( Sequence< Property >& _rProps ) const
|
||||||
{
|
{
|
||||||
BEGIN_DESCRIBE_PROPERTIES( 2, OBoundControlModel )
|
BEGIN_DESCRIBE_PROPERTIES( 4, OBoundControlModel )
|
||||||
DECL_BOOL_PROP1 ( READONLY, BOUND );
|
DECL_IFACE_PROP2( GRAPHIC, XGraphic, BOUND, TRANSIENT );
|
||||||
DECL_PROP1 ( TABINDEX, sal_Int16, BOUND );
|
DECL_PROP1 ( IMAGE_URL, ::rtl::OUString, BOUND );
|
||||||
|
DECL_BOOL_PROP1 ( READONLY, BOUND );
|
||||||
|
DECL_PROP1 ( TABINDEX, sal_Int16, BOUND );
|
||||||
END_DESCRIBE_PROPERTIES();
|
END_DESCRIBE_PROPERTIES();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
void OImageControlModel::describeAggregateProperties( Sequence< Property >& /* [out] */ o_rAggregateProperties ) const
|
||||||
|
{
|
||||||
|
OBoundControlModel::describeAggregateProperties( o_rAggregateProperties );
|
||||||
|
// remove ImageULR and Graphic properties, we "overload" them. This is because our aggregate synchronizes those
|
||||||
|
// two, but we have an own sychronization mechanism.
|
||||||
|
RemoveProperty( o_rAggregateProperties, PROPERTY_IMAGE_URL );
|
||||||
|
RemoveProperty( o_rAggregateProperties, PROPERTY_GRAPHIC );
|
||||||
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
::rtl::OUString OImageControlModel::getServiceName() throw ( ::com::sun::star::uno::RuntimeException)
|
::rtl::OUString OImageControlModel::getServiceName() throw ( ::com::sun::star::uno::RuntimeException)
|
||||||
{
|
{
|
||||||
@ -411,18 +464,18 @@ sal_Bool OImageControlModel::impl_updateStreamForURL_lck( const ::rtl::OUString&
|
|||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
sal_Bool OImageControlModel::impl_handleNewImageURL_lck( const ::rtl::OUString& _rURL, ValueChangeInstigator _eInstigator )
|
sal_Bool OImageControlModel::impl_handleNewImageURL_lck( ValueChangeInstigator _eInstigator )
|
||||||
{
|
{
|
||||||
switch ( lcl_getImageStoreType( getFieldType() ) )
|
switch ( lcl_getImageStoreType( getFieldType() ) )
|
||||||
{
|
{
|
||||||
case ImageStoreBinary:
|
case ImageStoreBinary:
|
||||||
if ( impl_updateStreamForURL_lck( _rURL, _eInstigator ) )
|
if ( impl_updateStreamForURL_lck( m_sImageURL, _eInstigator ) )
|
||||||
return sal_True;
|
return sal_True;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ImageStoreLink:
|
case ImageStoreLink:
|
||||||
{
|
{
|
||||||
::rtl::OUString sCommitURL( _rURL );
|
::rtl::OUString sCommitURL( m_sImageURL );
|
||||||
if ( m_sDocumentURL.getLength() )
|
if ( m_sDocumentURL.getLength() )
|
||||||
sCommitURL = URIHelper::simpleNormalizedMakeRelative( m_sDocumentURL, sCommitURL );
|
sCommitURL = URIHelper::simpleNormalizedMakeRelative( m_sDocumentURL, sCommitURL );
|
||||||
OSL_ENSURE( m_xColumnUpdate.is(), "OImageControlModel::impl_handleNewImageURL_lck: no bound field, but ImageStoreLink?!" );
|
OSL_ENSURE( m_xColumnUpdate.is(), "OImageControlModel::impl_handleNewImageURL_lck: no bound field, but ImageStoreLink?!" );
|
||||||
@ -435,7 +488,7 @@ sal_Bool OImageControlModel::impl_handleNewImageURL_lck( const ::rtl::OUString&
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case ImageStoreInvalid:
|
case ImageStoreInvalid:
|
||||||
OSL_ENSURE( false, "OImageControlModel::impl_handleNewImageURL_lck: invalid current field type!" );
|
OSL_ENSURE( false, "OImageControlModel::impl_handleNewImageURL_lck: image storage type type!" );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -462,10 +515,7 @@ sal_Bool OImageControlModel::commitControlValueToDbColumn( bool _bPostReset )
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
::osl::MutexGuard aGuard(m_aMutex);
|
::osl::MutexGuard aGuard(m_aMutex);
|
||||||
|
return impl_handleNewImageURL_lck( eDbColumnBinding );
|
||||||
::rtl::OUString sImageURL;
|
|
||||||
m_xAggregateSet->getPropertyValue( PROPERTY_IMAGE_URL ) >>= sImageURL;
|
|
||||||
return impl_handleNewImageURL_lck( sImageURL, eDbColumnBinding );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return sal_True;
|
return sal_True;
|
||||||
@ -523,7 +573,13 @@ Any OImageControlModel::translateDbColumnToControlValue()
|
|||||||
{
|
{
|
||||||
switch ( lcl_getImageStoreType( getFieldType() ) )
|
switch ( lcl_getImageStoreType( getFieldType() ) )
|
||||||
{
|
{
|
||||||
case ImageStoreBinary: return makeAny( m_xColumn->getBinaryStream() );
|
case ImageStoreBinary:
|
||||||
|
{
|
||||||
|
Reference< XInputStream > xImageStream( m_xColumn->getBinaryStream() );
|
||||||
|
if ( m_xColumn->wasNull() )
|
||||||
|
xImageStream.clear();
|
||||||
|
return makeAny( xImageStream );
|
||||||
|
}
|
||||||
case ImageStoreLink:
|
case ImageStoreLink:
|
||||||
{
|
{
|
||||||
::rtl::OUString sImageLink( m_xColumn->getString() );
|
::rtl::OUString sImageLink( m_xColumn->getString() );
|
||||||
@ -538,6 +594,12 @@ Any OImageControlModel::translateDbColumnToControlValue()
|
|||||||
return Any();
|
return Any();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
Any OImageControlModel::getControlValue( ) const
|
||||||
|
{
|
||||||
|
return makeAny( m_sImageURL );
|
||||||
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
void OImageControlModel::doSetControlValue( const Any& _rValue )
|
void OImageControlModel::doSetControlValue( const Any& _rValue )
|
||||||
{
|
{
|
||||||
@ -593,11 +655,6 @@ void OImageControlModel::doSetControlValue( const Any& _rValue )
|
|||||||
void SAL_CALL OImageControlModel::disposing()
|
void SAL_CALL OImageControlModel::disposing()
|
||||||
{
|
{
|
||||||
OBoundControlModel::disposing();
|
OBoundControlModel::disposing();
|
||||||
|
|
||||||
{
|
|
||||||
::osl::MutexGuard aGuard( m_aMutex ); // setControlValue expects this
|
|
||||||
setControlValue( Any(), eOther );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
@ -634,11 +691,17 @@ void SAL_CALL OImageControlModel::startProduction( ) throw (RuntimeException)
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
IMPL_LINK( OImageControlModel, OnImageImportDone, ::Graphic*, i_pGraphic )
|
IMPL_LINK( OImageControlModel, OnImageImportDone, ::Graphic*, i_pGraphic )
|
||||||
{
|
{
|
||||||
ENSURE_OR_RETURN( i_pGraphic, "OImageControlModel::OnImageImportDone: illegal graphic!", 0L );
|
const Reference< XGraphic > xGraphic( i_pGraphic != NULL ? Image( i_pGraphic->GetBitmapEx() ).GetXGraphic() : NULL );
|
||||||
setPropertyValue(
|
m_bExternalGraphic = false;
|
||||||
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Graphic" ) ),
|
try
|
||||||
makeAny( Image( i_pGraphic->GetBitmapEx() ).GetXGraphic() )
|
{
|
||||||
);
|
setPropertyValue( PROPERTY_GRAPHIC, makeAny( xGraphic ) );
|
||||||
|
}
|
||||||
|
catch ( const Exception& )
|
||||||
|
{
|
||||||
|
DBG_UNHANDLED_EXCEPTION();
|
||||||
|
}
|
||||||
|
m_bExternalGraphic = true;
|
||||||
return 1L;
|
return 1L;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -794,16 +857,16 @@ bool OImageControlControl::implInsertGraphics()
|
|||||||
implClearGraphics( sal_False );
|
implClearGraphics( sal_False );
|
||||||
sal_Bool bIsLink = sal_False;
|
sal_Bool bIsLink = sal_False;
|
||||||
xController->getValue(ExtendedFilePickerElementIds::CHECKBOX_LINK, 0) >>= bIsLink;
|
xController->getValue(ExtendedFilePickerElementIds::CHECKBOX_LINK, 0) >>= bIsLink;
|
||||||
|
// Force bIsLink to be TRUE if we're bound to a field. Though we initialized the file picker with IsLink=TRUE
|
||||||
|
// in this case, and disabled the respective control, there might be picker implementations which do not
|
||||||
|
// respect this, and return IsLink=FALSE here. In this case, "normalize" the flag.
|
||||||
|
// #i112659# / 2010-08-26 / frank.schoenheit@oracle.com
|
||||||
|
bIsLink |= bHasField;
|
||||||
if ( !bIsLink )
|
if ( !bIsLink )
|
||||||
{
|
{
|
||||||
Graphic aGraphic;
|
Graphic aGraphic;
|
||||||
aDialog.GetGraphic( aGraphic );
|
aDialog.GetGraphic( aGraphic );
|
||||||
|
xSet->setPropertyValue( PROPERTY_GRAPHIC, makeAny( aGraphic.GetXGraphic() ) );
|
||||||
Reference< graphic::XGraphicObject > xGrfObj = graphic::GraphicObject::create( m_aContext.getUNOContext() );
|
|
||||||
xGrfObj->setGraphic( aGraphic.GetXGraphic() );
|
|
||||||
rtl::OUString sObjectID( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.GraphicObject:" ) );
|
|
||||||
sObjectID = sObjectID + xGrfObj->getUniqueID();
|
|
||||||
xSet->setPropertyValue( PROPERTY_IMAGE_URL, makeAny( ::rtl::OUString( sObjectID ) ) );
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
xSet->setPropertyValue( PROPERTY_IMAGE_URL, makeAny( ::rtl::OUString( aDialog.GetPath() ) ) );
|
xSet->setPropertyValue( PROPERTY_IMAGE_URL, makeAny( ::rtl::OUString( aDialog.GetPath() ) ) );
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
#include <com/sun/star/form/XImageProducerSupplier.hpp>
|
#include <com/sun/star/form/XImageProducerSupplier.hpp>
|
||||||
#include <com/sun/star/awt/XMouseListener.hpp>
|
#include <com/sun/star/awt/XMouseListener.hpp>
|
||||||
#include <com/sun/star/util/XModifyBroadcaster.hpp>
|
#include <com/sun/star/util/XModifyBroadcaster.hpp>
|
||||||
|
#include <com/sun/star/graphic/XGraphicObject.hpp>
|
||||||
#include <comphelper/propmultiplex.hxx>
|
#include <comphelper/propmultiplex.hxx>
|
||||||
#include <comphelper/implementationreference.hxx>
|
#include <comphelper/implementationreference.hxx>
|
||||||
#include <cppuhelper/implbase2.hxx>
|
#include <cppuhelper/implbase2.hxx>
|
||||||
@ -57,7 +58,11 @@ class OImageControlModel
|
|||||||
{
|
{
|
||||||
::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageProducer> m_xImageProducer;
|
::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageProducer> m_xImageProducer;
|
||||||
ImageProducer* m_pImageProducer;
|
ImageProducer* m_pImageProducer;
|
||||||
|
bool m_bExternalGraphic;
|
||||||
sal_Bool m_bReadOnly;
|
sal_Bool m_bReadOnly;
|
||||||
|
::rtl::OUString m_sImageURL;
|
||||||
|
::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphicObject >
|
||||||
|
m_xGraphicObject;
|
||||||
::rtl::OUString m_sDocumentURL;
|
::rtl::OUString m_sDocumentURL;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -86,9 +91,6 @@ public:
|
|||||||
// OComponentHelper
|
// OComponentHelper
|
||||||
virtual void SAL_CALL disposing();
|
virtual void SAL_CALL disposing();
|
||||||
|
|
||||||
// OPropertyChangeListener
|
|
||||||
virtual void _propertyChanged( const ::com::sun::star::beans::PropertyChangeEvent& ) throw(::com::sun::star::uno::RuntimeException);
|
|
||||||
|
|
||||||
// XPersistObject
|
// XPersistObject
|
||||||
virtual ::rtl::OUString SAL_CALL getServiceName() throw ( ::com::sun::star::uno::RuntimeException);
|
virtual ::rtl::OUString SAL_CALL getServiceName() throw ( ::com::sun::star::uno::RuntimeException);
|
||||||
virtual void SAL_CALL write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream) throw ( ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
|
virtual void SAL_CALL write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream) throw ( ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
|
||||||
@ -103,6 +105,9 @@ public:
|
|||||||
virtual void SAL_CALL startProduction( ) throw (::com::sun::star::uno::RuntimeException);
|
virtual void SAL_CALL startProduction( ) throw (::com::sun::star::uno::RuntimeException);
|
||||||
|
|
||||||
// OControlModel's property handling
|
// OControlModel's property handling
|
||||||
|
virtual void describeAggregateProperties(
|
||||||
|
::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rAggregateProps
|
||||||
|
) const;
|
||||||
virtual void describeFixedProperties(
|
virtual void describeFixedProperties(
|
||||||
::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps
|
::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps
|
||||||
) const;
|
) const;
|
||||||
@ -119,6 +124,8 @@ protected:
|
|||||||
translateDbColumnToControlValue( );
|
translateDbColumnToControlValue( );
|
||||||
virtual sal_Bool commitControlValueToDbColumn( bool _bPostReset );
|
virtual sal_Bool commitControlValueToDbColumn( bool _bPostReset );
|
||||||
|
|
||||||
|
virtual ::com::sun::star::uno::Any
|
||||||
|
getControlValue( ) const;
|
||||||
virtual void doSetControlValue( const ::com::sun::star::uno::Any& _rValue );
|
virtual void doSetControlValue( const ::com::sun::star::uno::Any& _rValue );
|
||||||
|
|
||||||
virtual sal_Bool approveDbColumnType(sal_Int32 _nColumnType);
|
virtual sal_Bool approveDbColumnType(sal_Int32 _nColumnType);
|
||||||
@ -134,7 +141,7 @@ protected:
|
|||||||
@precond
|
@precond
|
||||||
our own mutex is locked
|
our own mutex is locked
|
||||||
*/
|
*/
|
||||||
sal_Bool impl_handleNewImageURL_lck( const ::rtl::OUString& _rURL, ValueChangeInstigator _eInstigator );
|
sal_Bool impl_handleNewImageURL_lck( ValueChangeInstigator _eInstigator );
|
||||||
|
|
||||||
/** updates the binary stream, created from loading the file which the given URL points to, into our
|
/** updates the binary stream, created from loading the file which the given URL points to, into our
|
||||||
bound field, or the control itself if there is no bound field
|
bound field, or the control itself if there is no bound field
|
||||||
|
@ -351,6 +351,9 @@ void ImageProducer::startProduction() throw(::com::sun::star::uno::RuntimeExcept
|
|||||||
// delete interfaces in temporary list
|
// delete interfaces in temporary list
|
||||||
for( pCons = aTmp.First(); pCons; pCons = aTmp.Next() )
|
for( pCons = aTmp.First(); pCons; pCons = aTmp.Next() )
|
||||||
delete (::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageConsumer > *) pCons;
|
delete (::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageConsumer > *) pCons;
|
||||||
|
|
||||||
|
if ( maDoneHdl.IsSet() )
|
||||||
|
maDoneHdl.Call( NULL );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -759,6 +759,18 @@ protected:
|
|||||||
sal_Int32 _nValuePropertyExternalHandle
|
sal_Int32 _nValuePropertyExternalHandle
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/** initializes the part of the class which is related to the control value.
|
||||||
|
|
||||||
|
<p>In opposite to ->initValueProperty, this method is to be used for value properties which are <em>not</em>
|
||||||
|
implemented by our aggregate, but by ourselves.</p>
|
||||||
|
|
||||||
|
<p>Certain functionality is not available when using own value properties. This includes binding to an external
|
||||||
|
value and external validation. (This is not a conceptual limit, but simply missing implementation.)</p>
|
||||||
|
*/
|
||||||
|
void initOwnValueProperty(
|
||||||
|
const ::rtl::OUString& i_rValuePropertyName
|
||||||
|
);
|
||||||
|
|
||||||
/** suspends listening at the value property
|
/** suspends listening at the value property
|
||||||
|
|
||||||
<p>As long as this listening is suspended, changes in the value property will not be
|
<p>As long as this listening is suspended, changes in the value property will not be
|
||||||
@ -782,6 +794,16 @@ protected:
|
|||||||
*/
|
*/
|
||||||
void resumeValueListening( );
|
void resumeValueListening( );
|
||||||
|
|
||||||
|
/** (to be) called when the value property changed
|
||||||
|
|
||||||
|
Normally, this is done automatically, since the value property is a property of our aggregate, and we're
|
||||||
|
a listener at this property.
|
||||||
|
However, in some cases the value property might not be an aggregate property, but a property of the
|
||||||
|
delegator instance. In this case, you'll need to call <code>onValuePropertyChange</code> whenever this
|
||||||
|
property changes.
|
||||||
|
*/
|
||||||
|
void onValuePropertyChange( ControlModelLock& i_rControLock );
|
||||||
|
|
||||||
/** starts listening at the aggregate, for changes in the given property
|
/** starts listening at the aggregate, for changes in the given property
|
||||||
|
|
||||||
<p>The OBoundControlModel automatically registers a multiplexer which listens for
|
<p>The OBoundControlModel automatically registers a multiplexer which listens for
|
||||||
|
@ -141,6 +141,7 @@ namespace frm
|
|||||||
FORMS_CONSTASCII_STRING( PROPERTY_SUBMIT_METHOD, "SubmitMethod" );
|
FORMS_CONSTASCII_STRING( PROPERTY_SUBMIT_METHOD, "SubmitMethod" );
|
||||||
FORMS_CONSTASCII_STRING( PROPERTY_SUBMIT_ENCODING, "SubmitEncoding" );
|
FORMS_CONSTASCII_STRING( PROPERTY_SUBMIT_ENCODING, "SubmitEncoding" );
|
||||||
FORMS_CONSTASCII_STRING( PROPERTY_IMAGE_URL, "ImageURL" );
|
FORMS_CONSTASCII_STRING( PROPERTY_IMAGE_URL, "ImageURL" );
|
||||||
|
FORMS_CONSTASCII_STRING( PROPERTY_GRAPHIC, "Graphic" );
|
||||||
FORMS_CONSTASCII_STRING( PROPERTY_IMAGE_POSITION, "ImagePosition" );
|
FORMS_CONSTASCII_STRING( PROPERTY_IMAGE_POSITION, "ImagePosition" );
|
||||||
FORMS_CONSTASCII_STRING( PROPERTY_EMPTY_IS_NULL, "ConvertEmptyToNull" );
|
FORMS_CONSTASCII_STRING( PROPERTY_EMPTY_IS_NULL, "ConvertEmptyToNull" );
|
||||||
FORMS_CONSTASCII_STRING( PROPERTY_LISTSOURCETYPE, "ListSourceType" );
|
FORMS_CONSTASCII_STRING( PROPERTY_LISTSOURCETYPE, "ListSourceType" );
|
||||||
|
@ -61,7 +61,7 @@ namespace frm
|
|||||||
#define PROPERTY_ID_WRITING_MODE (PROPERTY_ID_START + 20)
|
#define PROPERTY_ID_WRITING_MODE (PROPERTY_ID_START + 20)
|
||||||
#define PROPERTY_ID_CONTEXT_WRITING_MODE (PROPERTY_ID_START + 21)
|
#define PROPERTY_ID_CONTEXT_WRITING_MODE (PROPERTY_ID_START + 21)
|
||||||
#define PROPERTY_ID_VERTICAL_ALIGN (PROPERTY_ID_START + 22)
|
#define PROPERTY_ID_VERTICAL_ALIGN (PROPERTY_ID_START + 22)
|
||||||
// free
|
#define PROPERTY_ID_GRAPHIC (PROPERTY_ID_START + 23)
|
||||||
// free
|
// free
|
||||||
// free
|
// free
|
||||||
// free
|
// free
|
||||||
|
@ -134,6 +134,7 @@ void PropertyInfoService::initialize()
|
|||||||
ADD_PROP_ASSIGNMENT(SUBMIT_METHOD);
|
ADD_PROP_ASSIGNMENT(SUBMIT_METHOD);
|
||||||
ADD_PROP_ASSIGNMENT(SUBMIT_ENCODING);
|
ADD_PROP_ASSIGNMENT(SUBMIT_ENCODING);
|
||||||
ADD_PROP_ASSIGNMENT(IMAGE_URL);
|
ADD_PROP_ASSIGNMENT(IMAGE_URL);
|
||||||
|
ADD_PROP_ASSIGNMENT(GRAPHIC);
|
||||||
ADD_PROP_ASSIGNMENT(EMPTY_IS_NULL);
|
ADD_PROP_ASSIGNMENT(EMPTY_IS_NULL);
|
||||||
ADD_PROP_ASSIGNMENT(LISTSOURCETYPE);
|
ADD_PROP_ASSIGNMENT(LISTSOURCETYPE);
|
||||||
ADD_PROP_ASSIGNMENT(LISTSOURCE);
|
ADD_PROP_ASSIGNMENT(LISTSOURCE);
|
||||||
|
@ -44,6 +44,7 @@ sr = "sr,en-US"
|
|||||||
sh = "sr,en-US"
|
sh = "sr,en-US"
|
||||||
sw = "sw,en-US"
|
sw = "sw,en-US"
|
||||||
th = "th,en-US"
|
th = "th,en-US"
|
||||||
|
uk = "ru,en-US"
|
||||||
vi = "vi,en-US,fr"
|
vi = "vi,en-US,fr"
|
||||||
zh-TW = "EMPTY,en-US"
|
zh-TW = "EMPTY,en-US"
|
||||||
zh-CN = "EMPTY,en-US"
|
zh-CN = "EMPTY,en-US"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user