summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-04-16 13:55:24 +0200
committerFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-04-16 13:55:24 +0200
commit9157048fbcfeb07b19781fa48b834aef43fe8b70 (patch)
tree12752e5df5af0c63898a4942bdca88b9e49a2ec3 /svx
parentb90b03e6d52d9627a59724125ef705181f57caf8 (diff)
parent933751b26402df56c714b9584e6ae574c2a36241 (diff)
dba33f: merge with m76-branch
Diffstat (limited to 'svx')
-rw-r--r--svx/inc/svx/fmshell.hxx22
-rw-r--r--svx/inc/svx/fmtools.hxx1
-rw-r--r--svx/inc/svx/gridctrl.hxx16
-rw-r--r--svx/inc/svx/sdrobjectfilter.hxx58
-rw-r--r--svx/inc/svx/svxids.hrc2
-rw-r--r--svx/prj/d.lst1
-rw-r--r--svx/sdi/fmslots.sdi2
-rw-r--r--svx/sdi/svx.sdi2
-rw-r--r--svx/source/fmcomp/dbaexchange.cxx57
-rw-r--r--svx/source/fmcomp/fmgridcl.cxx21
-rw-r--r--svx/source/fmcomp/gridcell.cxx115
-rw-r--r--svx/source/fmcomp/gridctrl.cxx47
-rw-r--r--svx/source/form/fmshell.cxx101
-rw-r--r--svx/source/form/fmshimp.cxx26
-rw-r--r--svx/source/form/fmtools.cxx2
-rw-r--r--svx/source/form/fmvwimp.cxx101
-rw-r--r--svx/source/form/formcontrolfactory.cxx8
-rw-r--r--svx/source/form/navigatortree.cxx2
-rw-r--r--svx/source/form/tabwin.cxx58
-rw-r--r--svx/source/inc/fmprop.hrc1
-rw-r--r--svx/source/inc/fmshimp.hxx3
-rw-r--r--svx/source/inc/fmvwimp.hxx5
-rw-r--r--svx/source/inc/gridcell.hxx3
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx12
-rw-r--r--svx/source/svdraw/svdobj.cxx8
-rw-r--r--svx/uiconfig/accelerator/en-US/default.xml2
-rw-r--r--svx/uiconfig/accelerator/es/default.xml2
27 files changed, 508 insertions, 170 deletions
diff --git a/svx/inc/svx/fmshell.hxx b/svx/inc/svx/fmshell.hxx
index 07e570b958..911ac0a78b 100644
--- a/svx/inc/svx/fmshell.hxx
+++ b/svx/inc/svx/fmshell.hxx
@@ -60,6 +60,11 @@ namespace com { namespace sun { namespace star { namespace form {
}
} } } }
+namespace svx
+{
+ class ISdrObjectFilter;
+}
+
//========================================================================
class SVX_DLLPUBLIC FmDesignModeChangedHint : public SfxHint
{
@@ -146,11 +151,28 @@ public:
const OutputDevice& _rDevice,
::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _out_rxControl
) const;
+
::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormController > GetFormController(
const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm >& _rxForm,
const SdrView& _rView,
const OutputDevice& _rDevice
) const;
+
+ /** puts the focus into the document window, if current a form control has the focus. Otherwise, moves the focus
+ to the control belonging to the given SdrUnoObj.
+ */
+ void ToggleControlFocus(
+ const SdrUnoObj& i_rNextCandidate,
+ const SdrView& i_rView,
+ OutputDevice& i_rDevice
+ ) const;
+
+ ::std::auto_ptr< ::svx::ISdrObjectFilter >
+ CreateFocusableControlFilter(
+ const SdrView& i_rView,
+ const OutputDevice& i_rDevice
+ ) const;
+
sal_Bool IsDesignMode() const { return m_bDesignMode; }
void SetDesignMode( sal_Bool _bDesignMode );
diff --git a/svx/inc/svx/fmtools.hxx b/svx/inc/svx/fmtools.hxx
index d814281bc0..4bd8310950 100644
--- a/svx/inc/svx/fmtools.hxx
+++ b/svx/inc/svx/fmtools.hxx
@@ -76,6 +76,7 @@
#include <comphelper/uno3.hxx>
#include <comphelper/stl_types.hxx>
#include <cppuhelper/implbase1.hxx>
+#include <svl/svstdarr.hxx>
#include <set>
diff --git a/svx/inc/svx/gridctrl.hxx b/svx/inc/svx/gridctrl.hxx
index 32a2bb28dc..496891c758 100644
--- a/svx/inc/svx/gridctrl.hxx
+++ b/svx/inc/svx/gridctrl.hxx
@@ -29,6 +29,8 @@
#include <tools/list.hxx>
#include <com/sun/star/sdbc/XRowSet.hpp>
+#include <com/sun/star/sdbc/XRowSetListener.hpp>
+#include <com/sun/star/sdb/XRowsChangeListener.hpp>
#include <com/sun/star/beans/PropertyChangeEvent.hpp>
#include <com/sun/star/util/XNumberFormatter.hpp>
#include <com/sun/star/util/Date.hpp>
@@ -247,6 +249,8 @@ private:
// For that reason we have to listen to some properties of our data source.
::comphelper::OPropertyChangeMultiplexer* m_pDataSourcePropMultiplexer;
FmXGridSourcePropListener* m_pDataSourcePropListener;
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XRowsChangeListener>
+ m_xRowSetListener; // get notification when rows were changed
void* m_pFieldListeners;
// property listeners for field values
@@ -523,15 +527,20 @@ public:
void setGridListener( FmGridListener* _pListener ) { m_pGridListener = _pListener; }
// helper class to grant access to selected methods from within the DbCellControl class
- struct GrantCellControlAccess
+ struct GrantControlAccess
{
friend class DbCellControl;
+ friend class RowSetEventListener;
protected:
- GrantCellControlAccess() { }
+ GrantControlAccess() { }
};
/// called when a controller needs to be re-initialized
- void refreshController(sal_uInt16 _nColId, GrantCellControlAccess _aAccess);
+ void refreshController(sal_uInt16 _nColId, GrantControlAccess _aAccess);
+
+ CursorWrapper* GetSeekCursor(GrantControlAccess /*_aAccess*/) const { return m_pSeekCursor; }
+ const DbGridRowRef& GetSeekRow(GrantControlAccess /*_aAccess*/) const { return m_xSeekRow; }
+ void SetSeekPos(sal_Int32 nPos,GrantControlAccess /*_aAccess*/) {m_nSeekPos = nPos;}
/**
@return
@@ -585,6 +594,7 @@ protected:
const DbGridRowRef& GetSeekRow() const { return m_xSeekRow; }
const DbGridRowRef& GetPaintRow() const { return m_xPaintRow; }
CursorWrapper* GetSeekCursor() const { return m_pSeekCursor; }
+
void ConnectToFields();
void DisconnectFromFields();
diff --git a/svx/inc/svx/sdrobjectfilter.hxx b/svx/inc/svx/sdrobjectfilter.hxx
new file mode 100644
index 0000000000..01565eff07
--- /dev/null
+++ b/svx/inc/svx/sdrobjectfilter.hxx
@@ -0,0 +1,58 @@
+/*************************************************************************
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2009 by Sun Microsystems, Inc.
+*
+* 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.
+************************************************************************/
+
+#ifndef SDROBJECTFILTER_HXX
+#define SDROBJECTFILTER_HXX
+
+#include "svx/svxdllapi.h"
+
+/** === begin UNO includes === **/
+/** === end UNO includes === **/
+
+class SdrObject;
+
+//........................................................................
+namespace svx
+{
+//........................................................................
+
+ //====================================================================
+ //= SdrObjectFilter
+ //====================================================================
+ /** specifies a boolean predicate on the set of all SdrObjects - vulgo a filter.
+ */
+ class SVX_DLLPUBLIC SAL_NO_VTABLE ISdrObjectFilter
+ {
+ public:
+ virtual bool includeObject( const SdrObject& i_rObject ) const = 0;
+
+ virtual ~ISdrObjectFilter() = 0;
+ };
+
+//........................................................................
+} // namespace svx
+//........................................................................
+
+#endif // SDROBJECTFILTER_HXX
diff --git a/svx/inc/svx/svxids.hrc b/svx/inc/svx/svxids.hrc
index 665ee7fba6..dddfa4023d 100644
--- a/svx/inc/svx/svxids.hrc
+++ b/svx/inc/svx/svxids.hrc
@@ -1026,7 +1026,7 @@
#define SID_DSBROWSER_EXPLORER ( SID_SVX_START + 764 )
#define SID_FM_CREATE_FIELDCONTROL ( SID_SVX_START + 765 )
#define SID_FM_DATACCESS_DESCRIPTOR ( SID_SVX_START + 766 )
-#define SID_FM_GRABCONTROLFOCUS ( SID_SVX_START + 767 )
+#define SID_FM_TOGGLECONTROLFOCUS ( SID_SVX_START + 767 )
#define SID_FM_SCROLLBAR ( SID_SVX_START + 768 )
#define SID_FM_SPINBUTTON ( SID_SVX_START + 769 )
#define SID_FM_CONVERTTO_SCROLLBAR ( SID_SVX_START + 770 )
diff --git a/svx/prj/d.lst b/svx/prj/d.lst
index 7d2f508d9d..9e19690b12 100644
--- a/svx/prj/d.lst
+++ b/svx/prj/d.lst
@@ -577,6 +577,7 @@ mkdir: %_DEST%\inc%_EXT%\svx
..\inc\svx\databaselocationinput.hxx %_DEST%\inc%_EXT%\svx\databaselocationinput.hxx
..\inc\svx\dbcharsethelper.hxx %_DEST%\inc%_EXT%\svx\dbcharsethelper.hxx
..\inc\svx\dbtoolsclient.hxx %_DEST%\inc%_EXT%\svx\dbtoolsclient.hxx
+..\inc\svx\sdrobjectfilter.hxx %_DEST%\inc%_EXT%\svx\sdrobjectfilter.hxx
..\inc\svx\subtoolboxcontrol.hxx %_DEST%\inc%_EXT%\svx\subtoolboxcontrol.hxx
..\inc\svx\svdtext.hxx %_DEST%\inc%_EXT%\svx\svdtext.hxx
diff --git a/svx/sdi/fmslots.sdi b/svx/sdi/fmslots.sdi
index 4c1b7181e8..2ba8bbaff1 100644
--- a/svx/sdi/fmslots.sdi
+++ b/svx/sdi/fmslots.sdi
@@ -657,7 +657,7 @@ shell FmFormShell
[
ExecMethod = Execute ;
]
- SID_FM_GRABCONTROLFOCUS
+ SID_FM_TOGGLECONTROLFOCUS
[
ExecMethod = Execute ;
]
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index bf8b234493..ecd6fcd930 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -11700,7 +11700,7 @@ SfxVoidItem ZoomVisArea SID_SIZE_VISAREA
]
//--------------------------------------------------------------------------
-SfxVoidItem GrabControlFocus SID_FM_GRABCONTROLFOCUS
+SfxVoidItem ToggleControlFocus SID_FM_TOGGLECONTROLFOCUS
()
[
/* flags: */
diff --git a/svx/source/fmcomp/dbaexchange.cxx b/svx/source/fmcomp/dbaexchange.cxx
index 6859e7023c..f61cbeac29 100644
--- a/svx/source/fmcomp/dbaexchange.cxx
+++ b/svx/source/fmcomp/dbaexchange.cxx
@@ -135,30 +135,19 @@ namespace svx
{
try
{
- // need a query composer for this
- Reference< XSQLQueryComposerFactory > xComposerFac;
- _rxForm->getPropertyValue(FM_PROP_ACTIVE_CONNECTION) >>= xComposerFac;
- Reference< XSQLQueryComposer > xComposer;
- if (xComposerFac.is())
- xComposer = xComposerFac->createQueryComposer();
-
- if (xComposer.is())
+ Reference< XTablesSupplier > xSupTab;
+ _rxForm->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SingleSelectQueryComposer"))) >>= xSupTab;
+
+ if(xSupTab.is())
{
- ::rtl::OUString sActiveCommand;
- _rxForm->getPropertyValue(FM_PROP_ACTIVECOMMAND) >>= sActiveCommand;
- xComposer->setQuery(sActiveCommand);
- Reference< XTablesSupplier > xSupTab(xComposer, UNO_QUERY);
- if(xSupTab.is())
+ Reference< XNameAccess > xNames = xSupTab->getTables();
+ if (xNames.is())
{
- Reference< XNameAccess > xNames = xSupTab->getTables();
- if (xNames.is())
+ Sequence< ::rtl::OUString > aTables = xNames->getElementNames();
+ if (1 == aTables.getLength())
{
- Sequence< ::rtl::OUString > aTables = xNames->getElementNames();
- if (1 == aTables.getLength())
- {
- sCommand = aTables[0];
- nCommandType = CommandType::TABLE;
- }
+ sCommand = aTables[0];
+ nCommandType = CommandType::TABLE;
}
}
}
@@ -457,34 +446,10 @@ namespace svx
String sObjectKind = (CommandType::TABLE == nObjectType) ? String('1') : String('0');
// check if the SQL-statement is modified
- sal_Bool bHasFilterOrSort(sal_False);
::rtl::OUString sCompleteStatement;
try
{
- ::rtl::OUString sFilter, sSort;
- if (::cppu::any2bool(_rxLivingForm->getPropertyValue(FM_PROP_APPLYFILTER)))
- _rxLivingForm->getPropertyValue(FM_PROP_FILTER) >>= sFilter;
- _rxLivingForm->getPropertyValue(FM_PROP_SORT) >>= sSort;
- bHasFilterOrSort = (sFilter.getLength()>0) || (sSort.getLength()>0);
-
_rxLivingForm->getPropertyValue(FM_PROP_ACTIVECOMMAND) >>= sCompleteStatement;
-
- // create a composer
- Reference< XSQLQueryComposerFactory > xFactory( xConnection, UNO_QUERY );
- Reference< XSQLQueryComposer > xComposer;
- if (xFactory.is())
- xComposer = xFactory->createQueryComposer();
-
- // let the composer compose
- if (xComposer.is())
- {
- xComposer->setQuery(sCompleteStatement);
- xComposer->setFilter(sFilter);
- xComposer->setOrder(sSort);
- sCompleteStatement = xComposer->getComposedQuery();
- }
- // Usually, I would expect the result of the composing to be the same as the ActiveCommand property
- // But this code here is pretty old, and I don't know wha the side effects are if I remove it now ...
}
catch(Exception&)
{
@@ -496,7 +461,7 @@ namespace svx
,sConnectionResource
,nObjectType
,sObjectName,xConnection
- ,!((CommandType::QUERY == nObjectType) && !bHasFilterOrSort)
+ ,!((CommandType::QUERY == nObjectType))
,sCompleteStatement);
}
diff --git a/svx/source/fmcomp/fmgridcl.cxx b/svx/source/fmcomp/fmgridcl.cxx
index 779017ff0c..8d0c1d2fe5 100644
--- a/svx/source/fmcomp/fmgridcl.cxx
+++ b/svx/source/fmcomp/fmgridcl.cxx
@@ -210,10 +210,11 @@ void FmGridHeader::RequestHelp( const HelpEvent& rHEvt )
Reference< ::com::sun::star::container::XIndexContainer > xColumns(static_cast<FmGridControl*>(GetParent())->GetPeer()->getColumns());
try
{
- Reference< ::com::sun::star::beans::XPropertySet > xColumn;
- ::cppu::extractInterface(xColumn, xColumns->getByIndex(nPos));
+ Reference< ::com::sun::star::beans::XPropertySet > xColumn(xColumns->getByIndex(nPos),UNO_QUERY);
::rtl::OUString aHelpText;
xColumn->getPropertyValue(FM_PROP_HELPTEXT) >>= aHelpText;
+ if ( !aHelpText.getLength() )
+ xColumn->getPropertyValue(FM_PROP_DESCRIPTION) >>= aHelpText;
if ( aHelpText.getLength() )
{
if ( rHEvt.GetMode() & HELPMODE_BALLOON )
@@ -1737,11 +1738,12 @@ void FmGridControl::InitColumnByField(
_pColumn->SetObject( (sal_Int16)nFieldPos );
return;
}
-
+/*
// handle readonly columns
sal_Bool bReadOnly = sal_True;
xField->getPropertyValue( FM_PROP_ISREADONLY ) >>= bReadOnly;
_pColumn->SetReadOnly( bReadOnly );
+*/
}
// the control type is determined by the ColumnServiceName
@@ -1999,7 +2001,11 @@ namespace
{
Reference<XPropertySet> xProp(GetPeer()->getColumns(),UNO_QUERY);
if ( xProp.is() )
+ {
xProp->getPropertyValue(FM_PROP_HELPTEXT) >>= sRetText;
+ if ( !sRetText.getLength() )
+ xProp->getPropertyValue(FM_PROP_DESCRIPTION) >>= sRetText;
+ }
}
break;
case ::svt::BBTYPE_COLUMNHEADERCELL:
@@ -2008,6 +2014,13 @@ namespace
GetModelColumnPos(
sal::static_int_cast< sal_uInt16 >(_nPosition)),
FM_PROP_HELPTEXT);
+ if ( !sRetText.getLength() )
+ sRetText = getColumnPropertyFromPeer(
+ GetPeer(),
+ GetModelColumnPos(
+ sal::static_int_cast< sal_uInt16 >(_nPosition)),
+ FM_PROP_DESCRIPTION);
+
break;
default:
sRetText = DbGridControl::GetAccessibleObjectDescription(_eObjType,_nPosition);
@@ -2029,7 +2042,7 @@ void FmGridControl::Select()
// die HandleColumn wird nicht selektiert
switch (nSelectedColumn)
{
- case -1 : break; // no selection
+ case SAL_MAX_UINT16: break; // no selection
case 0 : nSelectedColumn = SAL_MAX_UINT16; break;
// handle col can't be seledted
default :
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index dfedec322e..30b8f23b7a 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -45,6 +45,8 @@
#include <com/sun/star/form/XBoundComponent.hpp>
#include <com/sun/star/script/XEventAttacherManager.hpp>
#include <com/sun/star/sdb/XSQLQueryComposerFactory.hpp>
+#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
+#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
#include <com/sun/star/sdbc/ColumnValue.hpp>
#include <com/sun/star/sdbc/DataType.hpp>
#include <com/sun/star/sdbc/XStatement.hpp>
@@ -82,6 +84,7 @@ using namespace ::svt;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::sdbc;
+using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::form;
@@ -551,6 +554,7 @@ TYPEINIT1( DbFilterField, DbCellControl )
//------------------------------------------------------------------------------
DbCellControl::DbCellControl( DbGridColumn& _rColumn, sal_Bool /*_bText*/ )
:OPropertyChangeListener(m_aMutex)
+ ,m_pFieldChangeBroadcaster(NULL)
,m_bTransparent( sal_False )
,m_bAlignedController( sal_True )
,m_bAccessingValueProperty( sal_False )
@@ -574,6 +578,31 @@ DbCellControl::DbCellControl( DbGridColumn& _rColumn, sal_Bool /*_bText*/ )
implDoPropertyListening( FM_PROP_STATE, sal_False );
implDoPropertyListening( FM_PROP_TEXT, sal_False );
implDoPropertyListening( FM_PROP_EFFECTIVE_VALUE, sal_False );
+
+ // be listener at the bound field as well
+ try
+ {
+ Reference< XPropertySet > xColModelProps( m_rColumn.getModel(), UNO_QUERY );
+ Reference< XPropertySetInfo > xPSI;
+ if ( xColModelProps.is() )
+ xPSI = xColModelProps->getPropertySetInfo();
+
+ if ( xPSI.is() && xPSI->hasPropertyByName( FM_PROP_BOUNDFIELD ) )
+ {
+ Reference< XPropertySet > xField;
+ xColModelProps->getPropertyValue( FM_PROP_BOUNDFIELD ) >>= xField;
+ if ( xField.is() )
+ {
+ m_pFieldChangeBroadcaster = new ::comphelper::OPropertyChangeMultiplexer(this, xField);
+ m_pFieldChangeBroadcaster->acquire();
+ m_pFieldChangeBroadcaster->addProperty( FM_PROP_ISREADONLY );
+ }
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_ERROR( "DbCellControl::doPropertyListening: caught an exception!" );
+ }
}
}
@@ -605,17 +634,22 @@ void DbCellControl::doPropertyListening( const ::rtl::OUString& _rPropertyName )
{
implDoPropertyListening( _rPropertyName );
}
-
//------------------------------------------------------------------------------
-DbCellControl::~DbCellControl()
+void lcl_clearBroadCaster(::comphelper::OPropertyChangeMultiplexer*& _pBroadcaster)
{
- if ( m_pModelChangeBroadcaster )
+ if ( _pBroadcaster )
{
- m_pModelChangeBroadcaster->dispose();
- m_pModelChangeBroadcaster->release();
- m_pModelChangeBroadcaster = NULL;
+ _pBroadcaster->dispose();
+ _pBroadcaster->release();
+ _pBroadcaster = NULL;
// no delete, this is done implicitly
}
+}
+//------------------------------------------------------------------------------
+DbCellControl::~DbCellControl()
+{
+ lcl_clearBroadCaster(m_pModelChangeBroadcaster);
+ lcl_clearBroadCaster(m_pFieldChangeBroadcaster);
delete m_pWindow;
delete m_pPainter;
@@ -660,7 +694,14 @@ void DbCellControl::_propertyChanged(const PropertyChangeEvent& _rEvent) throw(R
}
else if ( _rEvent.PropertyName.equals( FM_PROP_READONLY ) )
{
- implAdjustReadOnly( xSourceProps );
+ implAdjustReadOnly( xSourceProps, true);
+ }
+ else if ( _rEvent.PropertyName.equals( FM_PROP_ISREADONLY ) )
+ {
+ sal_Bool bReadOnly = sal_True;
+ _rEvent.NewValue >>= bReadOnly;
+ m_rColumn.SetReadOnly(bReadOnly);
+ implAdjustReadOnly( xSourceProps, false);
}
else if ( _rEvent.PropertyName.equals( FM_PROP_ENABLED ) )
{
@@ -798,7 +839,7 @@ void DbCellControl::ImplInitWindow( Window& rParent, const InitWindowFacet _eIni
}
//------------------------------------------------------------------------------
-void DbCellControl::implAdjustReadOnly( const Reference< XPropertySet >& _rxModel )
+void DbCellControl::implAdjustReadOnly( const Reference< XPropertySet >& _rxModel,bool i_bReadOnly )
{
DBG_ASSERT( m_pWindow, "DbCellControl::implAdjustReadOnly: not to be called without window!" );
DBG_ASSERT( _rxModel.is(), "DbCellControl::implAdjustReadOnly: invalid model!" );
@@ -807,9 +848,12 @@ void DbCellControl::implAdjustReadOnly( const Reference< XPropertySet >& _rxMode
Edit* pEditWindow = dynamic_cast< Edit* >( m_pWindow );
if ( pEditWindow )
{
- sal_Bool bReadOnly = sal_True;
- _rxModel->getPropertyValue( FM_PROP_READONLY ) >>= bReadOnly;
- static_cast< Edit* >( m_pWindow )->SetReadOnly( m_rColumn.IsReadOnly() || bReadOnly );
+ sal_Bool bReadOnly = m_rColumn.IsReadOnly();
+ if ( !bReadOnly )
+ {
+ _rxModel->getPropertyValue( i_bReadOnly ? FM_PROP_READONLY : FM_PROP_ISREADONLY) >>= bReadOnly;
+ }
+ static_cast< Edit* >( m_pWindow )->SetReadOnly( bReadOnly );
}
}
}
@@ -846,7 +890,7 @@ void DbCellControl::Init( Window& rParent, const Reference< XRowSet >& _rxCursor
if ( xModelPSI->hasPropertyByName( FM_PROP_READONLY ) )
{
- implAdjustReadOnly( xModel );
+ implAdjustReadOnly( xModel,true );
}
if ( xModelPSI->hasPropertyByName( FM_PROP_ENABLED ) )
@@ -1003,7 +1047,7 @@ double DbCellControl::GetValue(const Reference< ::com::sun::star::sdb::XColumn >
//------------------------------------------------------------------------------
void DbCellControl::invalidatedController()
{
- m_rColumn.GetParent().refreshController(m_rColumn.GetId(), DbGridControl::GrantCellControlAccess());
+ m_rColumn.GetParent().refreshController(m_rColumn.GetId(), DbGridControl::GrantControlAccess());
}
/*************************************************************************/
@@ -3039,43 +3083,22 @@ void DbFilterField::Update()
if (!xForm.is())
return;
- Reference< XConnection > xConnection(getRowSetConnection(xForm));
- if (!xConnection.is())
- return;
-
- Reference< ::com::sun::star::sdb::XSQLQueryComposerFactory > xFactory(xConnection, UNO_QUERY);
- if (!xFactory.is())
- {
- DBG_ERROR("DbFilterField::Update : used the right place to request the ::com::sun::star::sdb::XSQLQueryComposerFactory interface ?");
- return;
- }
-
- Reference< ::com::sun::star::sdb::XSQLQueryComposer > xComposer = xFactory->createQueryComposer();
- try
- {
- Reference< ::com::sun::star::beans::XPropertySet > xFormAsSet(xForm, UNO_QUERY);
- ::rtl::OUString sStatement;
- xFormAsSet->getPropertyValue(FM_PROP_ACTIVECOMMAND) >>= sStatement;
- xComposer->setQuery(sStatement);
- }
- catch(const Exception&)
- {
- ::comphelper::disposeComponent(xComposer);
- return;
- }
+ Reference<XPropertySet> xFormProp(xForm,UNO_QUERY);
+ Reference< XTablesSupplier > xSupTab;
+ xFormProp->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SingleSelectQueryComposer"))) >>= xSupTab;
- Reference< ::com::sun::star::beans::XPropertySet > xComposerAsSet(xComposer, UNO_QUERY);
- if (!xComposerAsSet.is())
+ Reference< XConnection > xConnection(getRowSetConnection(xForm));
+ if (!xSupTab.is())
return;
// search the field
- Reference< ::com::sun::star::container::XNameAccess > xFieldNames;
- Reference< ::com::sun::star::container::XNameAccess > xTablesNames;
- Reference< ::com::sun::star::beans::XPropertySet > xComposerFieldAsSet;
-
- ::cppu::extractInterface(xFieldNames, xComposerAsSet->getPropertyValue(FM_PROP_SELECTED_FIELDS));
- ::cppu::extractInterface(xTablesNames, xComposerAsSet->getPropertyValue(FM_PROP_SELECTED_TABLES));
- ::cppu::extractInterface(xComposerFieldAsSet, xFieldNames->getByName(aName));
+ Reference< XColumnsSupplier > xSupCol(xSupTab,UNO_QUERY);
+ Reference< ::com::sun::star::container::XNameAccess > xFieldNames = xSupCol->getColumns();
+ if (!xFieldNames->hasByName(aName))
+ return;
+
+ Reference< ::com::sun::star::container::XNameAccess > xTablesNames = xSupTab->getTables();
+ Reference< ::com::sun::star::beans::XPropertySet > xComposerFieldAsSet(xFieldNames->getByName(aName),UNO_QUERY);
if (xComposerFieldAsSet.is() && ::comphelper::hasProperty(FM_PROP_TABLENAME, xComposerFieldAsSet) &&
::comphelper::hasProperty(FM_PROP_FIELDSOURCE, xComposerFieldAsSet))
diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx
index 4e21fc3761..17be8021d2 100644
--- a/svx/source/fmcomp/gridctrl.cxx
+++ b/svx/source/fmcomp/gridctrl.cxx
@@ -44,6 +44,8 @@
#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
#include <com/sun/star/accessibility/XAccessible.hpp>
#include <com/sun/star/sdb/XResultSetAccess.hpp>
+#include <com/sun/star/sdb/RowChangeAction.hpp>
+#include <com/sun/star/sdb/XRowsChangeBroadcaster.hpp>
#include <com/sun/star/sdbc/XResultSetUpdate.hpp>
#include <com/sun/star/sdbcx/Privilege.hpp>
#include <com/sun/star/container/XChild.hpp>
@@ -102,6 +104,39 @@ using namespace com::sun::star::accessibility;
| BROWSER_VLINESFULL \
| BROWSER_HEADERBAR_NEW \
+class RowSetEventListener : public ::cppu::WeakImplHelper1<XRowsChangeListener>
+{
+ DbGridControl* m_pControl;
+public:
+ RowSetEventListener(DbGridControl* i_pControl) : m_pControl(i_pControl)
+ {
+ }
+private:
+ // XEventListener
+ virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& /*i_aEvt*/)
+ {
+ }
+ virtual void SAL_CALL rowsChanged(const ::com::sun::star::sdb::RowsChangeEvent& i_aEvt)
+ {
+ if ( i_aEvt.Action == RowChangeAction::UPDATE )
+ {
+ ::DbGridControl::GrantControlAccess aAccess;
+ CursorWrapper* pSeek = m_pControl->GetSeekCursor(aAccess);
+ const DbGridRowRef& rSeekRow = m_pControl->GetSeekRow(aAccess);
+ const Any* pIter = i_aEvt.Bookmarks.getConstArray();
+ const Any* pEnd = pIter + i_aEvt.Bookmarks.getLength();
+ for(;pIter != pEnd;++pIter)
+ {
+ pSeek->moveToBookmark(*pIter);
+ // get the data
+ rSeekRow->SetState(pSeek, sal_True);
+ sal_Int32 nSeekPos = pSeek->getRow() - 1;
+ m_pControl->SetSeekPos(nSeekPos,aAccess);
+ m_pControl->RowModified(nSeekPos);
+ }
+ }
+ }
+};
//==============================================================================
class GridFieldValueListener;
@@ -987,6 +1022,7 @@ DbGridControl::~DbGridControl()
m_pDataSourcePropMultiplexer = NULL;
m_pDataSourcePropListener = NULL;
}
+ m_xRowSetListener.clear();
delete m_pDataCursor;
delete m_pSeekCursor;
@@ -1377,7 +1413,7 @@ sal_Bool DbGridControl::IsPermanentCursorEnabled() const
}
//------------------------------------------------------------------------------
-void DbGridControl::refreshController(sal_uInt16 _nColId, GrantCellControlAccess /*_aAccess*/)
+void DbGridControl::refreshController(sal_uInt16 _nColId, GrantControlAccess /*_aAccess*/)
{
if ((GetCurColumnId() == _nColId) && IsEditing())
{ // the controller which is currently active needs to be refreshed
@@ -1412,6 +1448,7 @@ void DbGridControl::setDataSource(const Reference< XRowSet >& _xCursor, sal_uInt
m_pDataSourcePropMultiplexer = NULL;
m_pDataSourcePropListener = NULL;
}
+ m_xRowSetListener.clear();
// is the new cursor valid ?
// the cursor is only valid if it contains some columns
@@ -1503,7 +1540,7 @@ void DbGridControl::setDataSource(const Reference< XRowSet >& _xCursor, sal_uInt
Reference< XPropertySet > xSet(_xCursor, UNO_QUERY);
if (xSet.is())
{
- // feststellen welche Updatem�glichkeiten bestehen
+ // feststellen welche Updatemoeglichkeiten bestehen
sal_Int32 nConcurrency = ResultSetConcurrency::READ_ONLY;
xSet->getPropertyValue(FM_PROP_RESULTSET_CONCURRENCY) >>= nConcurrency;
@@ -1565,6 +1602,12 @@ void DbGridControl::setDataSource(const Reference< XRowSet >& _xCursor, sal_uInt
xSet->getPropertyValue(FM_PROP_ROWCOUNT) >>= nRecordCount;
m_bRecordCountFinal = ::comphelper::getBOOL(xSet->getPropertyValue(FM_PROP_ROWCOUNTFINAL));
+ m_xRowSetListener = new RowSetEventListener(this);
+ Reference< XRowsChangeBroadcaster> xChangeBroad(xSet,UNO_QUERY);
+ if ( xChangeBroad.is( ) )
+ xChangeBroad->addRowsChangeListener(m_xRowSetListener);
+
+
// insert the currently known rows
// and one row if we are able to insert rows
if (m_nOptions & OPT_INSERT)
diff --git a/svx/source/form/fmshell.cxx b/svx/source/form/fmshell.cxx
index c40841f221..4a9a859c0e 100644
--- a/svx/source/form/fmshell.cxx
+++ b/svx/source/form/fmshell.cxx
@@ -78,6 +78,7 @@
#include <svx/fmglob.hxx>
#include <svl/eitem.hxx>
#include <tools/shl.hxx>
+#include <tools/diagnose_ex.h>
#include <svx/svdpage.hxx>
#include <svx/fmmodel.hxx>
#include <svx/dialmgr.hxx>
@@ -98,6 +99,8 @@
#include <svx/svxdlg.hxx> //CHINA001
#include <svx/dialogs.hrc> //CHINA001
+#include "svx/sdrobjectfilter.hxx"
+
#define HANDLE_SQL_ERRORS( action, successflag, context, message ) \
try \
{ \
@@ -544,7 +547,7 @@ void FmFormShell::Execute(SfxRequest &rReq)
case SID_FM_SCROLLBAR:
case SID_FM_SPINBUTTON:
{
- SFX_REQUEST_ARG( rReq, pGrabFocusItem, SfxBoolItem, SID_FM_GRABCONTROLFOCUS, sal_False );
+ SFX_REQUEST_ARG( rReq, pGrabFocusItem, SfxBoolItem, SID_FM_TOGGLECONTROLFOCUS, sal_False );
if ( pGrabFocusItem && pGrabFocusItem->GetValue() )
{ // see below
SfxViewShell* pShell = GetViewShell();
@@ -572,9 +575,9 @@ void FmFormShell::Execute(SfxRequest &rReq)
{
// #99013# if selected with control key, return focus to current view
// do this asynchron, so that the creation can be finished first
- // reusing the SID_FM_GRABCONTROLFOCUS is somewhat hacky ... which it wouldn't if it would have another
+ // reusing the SID_FM_TOGGLECONTROLFOCUS is somewhat hacky ... which it wouldn't if it would have another
// name, so I do not really have a big problem with this ....
- SfxBoolItem aGrabFocusIndicatorItem( SID_FM_GRABCONTROLFOCUS, sal_True );
+ SfxBoolItem aGrabFocusIndicatorItem( SID_FM_TOGGLECONTROLFOCUS, sal_True );
GetViewShell()->GetViewFrame()->GetDispatcher()->Execute( nSlot, SFX_CALLMODE_ASYNCHRON,
&aGrabFocusIndicatorItem, NULL );
}
@@ -595,11 +598,27 @@ void FmFormShell::Execute(SfxRequest &rReq)
}
break;
- case SID_FM_GRABCONTROLFOCUS:
+ case SID_FM_TOGGLECONTROLFOCUS:
{
FmFormView* pFormView = GetFormView();
- if ( pFormView )
+ if ( !pFormView )
+ break;
+
+ // if we execute this ourself, then either the application does not implement an own handling for this,
+ // of we're on the top of the dispatcher stack, which means a control has the focus.
+ // In the latter case, we put the focus to the document window, otherwise, we focus the first control
+ const bool bHasControlFocus = GetImpl()->HasControlFocus();
+ if ( bHasControlFocus )
+ {
+ const OutputDevice* pDevice = GetCurrentViewDevice();
+ Window* pWindow = dynamic_cast< Window* >( const_cast< OutputDevice* >( pDevice ) );
+ if ( pWindow )
+ pWindow->GrabFocus();
+ }
+ else
+ {
pFormView->GrabFirstControlFocus( );
+ }
}
break;
@@ -1353,6 +1372,78 @@ namespace
}
//------------------------------------------------------------------------
+void FmFormShell::ToggleControlFocus( const SdrUnoObj& i_rUnoObject, const SdrView& i_rView, OutputDevice& i_rDevice ) const
+{
+ try
+ {
+ // check if the focus currently is in a control
+ // Well, okay, do it the other way 'round: Check whether the current control of the active controller
+ // actually has the focus. This should be equivalent.
+ const bool bHasControlFocus = GetImpl()->HasControlFocus();
+
+ if ( bHasControlFocus )
+ {
+ Window* pWindow( dynamic_cast< Window* >( &i_rDevice ) );
+ OSL_ENSURE( pWindow, "FmFormShell::ToggleControlFocus: I need a Window, really!" );
+ if ( pWindow )
+ pWindow->GrabFocus();
+ }
+ else
+ {
+ Reference< XControl > xControl;
+ GetFormControl( i_rUnoObject.GetUnoControlModel(), i_rView, i_rDevice, xControl );
+ Reference< XWindow > xControlWindow( xControl, UNO_QUERY );
+ if ( xControlWindow.is() )
+ xControlWindow->setFocus();
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+
+//------------------------------------------------------------------------
+namespace
+{
+ class FocusableControlsFilter : public ::svx::ISdrObjectFilter
+ {
+ public:
+ FocusableControlsFilter( const SdrView& i_rView, const OutputDevice& i_rDevice )
+ :m_rView( i_rView )
+ ,m_rDevice( i_rDevice )
+ {
+ }
+
+ public:
+ virtual bool includeObject( const SdrObject& i_rObject ) const
+ {
+ const SdrUnoObj* pUnoObj = dynamic_cast< const SdrUnoObj* >( &i_rObject );
+ if ( !pUnoObj )
+ return false;
+
+ Reference< XControl > xControl = pUnoObj->GetUnoControl( m_rView, m_rDevice );
+ return FmXFormView::isFocusable( xControl );
+ }
+
+ private:
+ const SdrView& m_rView;
+ const OutputDevice& m_rDevice;
+ };
+}
+
+//------------------------------------------------------------------------
+::std::auto_ptr< ::svx::ISdrObjectFilter > FmFormShell::CreateFocusableControlFilter( const SdrView& i_rView, const OutputDevice& i_rDevice ) const
+{
+ ::std::auto_ptr< ::svx::ISdrObjectFilter > pFilter;
+
+ if ( !i_rView.IsDesignMode() )
+ pFilter.reset( new FocusableControlsFilter( i_rView, i_rDevice ) );
+
+ return pFilter;
+}
+
+//------------------------------------------------------------------------
SdrUnoObj* FmFormShell::GetFormControl( const Reference< XControlModel >& _rxModel, const SdrView& _rView, const OutputDevice& _rDevice, Reference< XControl >& _out_rxControl ) const
{
if ( !_rxModel.is() )
diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx
index d4028a3b18..3649cfb7c9 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -56,6 +56,7 @@
#include "svx/svxids.hrc"
/** === begin UNO includes === **/
+#include <com/sun/star/awt/XWindow2.hpp>
#include <com/sun/star/awt/XCheckBox.hpp>
#include <com/sun/star/awt/XListBox.hpp>
#include <com/sun/star/awt/XTextComponent.hpp>
@@ -4156,6 +4157,31 @@ void FmXFormShell::handleMouseButtonDown( const SdrViewEvent& _rViewEvent )
}
}
+//------------------------------------------------------------------------------
+bool FmXFormShell::HasControlFocus() const
+{
+ bool bHasControlFocus = false;
+
+ try
+ {
+ Reference< XFormController > xController( getActiveController() );
+ Reference< XControl > xCurrentControl;
+ if ( xController.is() )
+ xCurrentControl.set( xController->getCurrentControl() );
+ if ( xCurrentControl.is() )
+ {
+ Reference< XWindow2 > xPeerWindow( xCurrentControl->getPeer(), UNO_QUERY_THROW );
+ bHasControlFocus = xPeerWindow->hasFocus();
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+
+ return bHasControlFocus;
+}
+
//==============================================================================
//==============================================================================
SearchableControlIterator::SearchableControlIterator(Reference< XInterface> xStartingPoint)
diff --git a/svx/source/form/fmtools.cxx b/svx/source/form/fmtools.cxx
index e1d139dd10..3409125a5f 100644
--- a/svx/source/form/fmtools.cxx
+++ b/svx/source/form/fmtools.cxx
@@ -72,6 +72,8 @@
/** === end UNO includes === **/
#include <basic/sbxvar.hxx>
+#include <svl/eitem.hxx>
+#include <svl/stritem.hxx>
#include <comphelper/container.hxx>
#include <comphelper/extract.hxx>
#include <comphelper/processfactory.hxx>
diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx
index 8d75e4a882..802cbb59dd 100644
--- a/svx/source/form/fmvwimp.cxx
+++ b/svx/source/form/fmvwimp.cxx
@@ -823,6 +823,48 @@ void FmXFormView::AutoFocus( sal_Bool _bSync )
else
m_nAutoFocusEvent = Application::PostUserEvent(LINK(this, FmXFormView, OnAutoFocus));
}
+
+// -----------------------------------------------------------------------------
+bool FmXFormView::isFocusable( const Reference< XControl >& i_rControl )
+{
+ if ( !i_rControl.is() )
+ return false;
+
+ try
+ {
+ Reference< XPropertySet > xModelProps( i_rControl->getModel(), UNO_QUERY_THROW );
+
+ // only enabled controls are allowed to participate
+ sal_Bool bEnabled = sal_False;
+ OSL_VERIFY( xModelProps->getPropertyValue( FM_PROP_ENABLED ) >>= bEnabled );
+ if ( !bEnabled )
+ return false;
+
+ // check the class id of the control model
+ sal_Int16 nClassId = FormComponentType::CONTROL;
+ OSL_VERIFY( xModelProps->getPropertyValue( FM_PROP_CLASSID ) >>= nClassId );
+
+ // controls which are not focussable
+ if ( ( FormComponentType::CONTROL != nClassId )
+ && ( FormComponentType::IMAGEBUTTON != nClassId )
+ && ( FormComponentType::GROUPBOX != nClassId )
+ && ( FormComponentType::FIXEDTEXT != nClassId )
+ && ( FormComponentType::HIDDENCONTROL != nClassId )
+ && ( FormComponentType::IMAGECONTROL != nClassId )
+ && ( FormComponentType::SCROLLBAR != nClassId )
+ && ( FormComponentType::SPINBUTTON!= nClassId )
+ )
+ {
+ return true;
+ }
+ }
+ catch( const Exception& e )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return false;
+}
+
// -----------------------------------------------------------------------------
static Reference< XControl > lcl_firstFocussableControl( const Sequence< Reference< XControl > >& _rControls )
{
@@ -833,47 +875,19 @@ static Reference< XControl > lcl_firstFocussableControl( const Sequence< Referen
const Reference< XControl >* pControlsEnd = _rControls.getConstArray() + _rControls.getLength();
for ( ; pControls != pControlsEnd; ++pControls )
{
- try
- {
- if ( !pControls->is() )
- continue;
-
- Reference< XPropertySet > xModelProps( (*pControls)->getModel(), UNO_QUERY_THROW );
-
- // only enabled controls are allowed to participate
- sal_Bool bEnabled = sal_False;
- OSL_VERIFY( xModelProps->getPropertyValue( FM_PROP_ENABLED ) >>= bEnabled );
- if ( !bEnabled )
- continue;
-
- // check the class id of the control model
- sal_Int16 nClassId = FormComponentType::CONTROL;
- OSL_VERIFY( xModelProps->getPropertyValue( FM_PROP_CLASSID ) >>= nClassId );
-
- // controls which are not focussable
- if ( ( FormComponentType::CONTROL != nClassId )
- && ( FormComponentType::IMAGEBUTTON != nClassId )
- && ( FormComponentType::GROUPBOX != nClassId )
- && ( FormComponentType::FIXEDTEXT != nClassId )
- && ( FormComponentType::HIDDENCONTROL != nClassId )
- && ( FormComponentType::IMAGECONTROL != nClassId )
- && ( FormComponentType::SCROLLBAR != nClassId )
- && ( FormComponentType::SPINBUTTON!= nClassId )
- )
- {
- xReturn = *pControls;
- break;
- }
- }
- catch( const Exception& e )
+ if ( !pControls->is() )
+ continue;
+
+ if ( FmXFormView::isFocusable( *pControls ) )
{
- (void)e; // make compiler happy
+ xReturn = *pControls;
+ break;
}
-
- if ( !xReturn.is() && _rControls.getLength() )
- xReturn = _rControls[0];
}
+ if ( !xReturn.is() && _rControls.getLength() )
+ xReturn = _rControls[0];
+
return xReturn;
}
@@ -1008,11 +1022,6 @@ IMPL_LINK(FmXFormView, OnAutoFocus, void*, /*EMPTYTAG*/)
}
// -----------------------------------------------------------------------------
-namespace
-{
-}
-
-// -----------------------------------------------------------------------------
void FmXFormView::onCreatedFormObject( FmFormObj& _rFormObject )
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormView::onCreatedFormObject" );
@@ -1590,7 +1599,13 @@ bool FmXFormView::createControlLabelPair( const ::comphelper::ComponentContext&
xLabelModel.set( pLabel->GetUnoControlModel(), UNO_QUERY );
if ( xLabelModel.is() )
{
- xLabelModel->setPropertyValue( FM_PROP_LABEL, makeAny( sFieldName + _rFieldPostfix ) );
+ ::rtl::OUString sLabel;
+ if ( _rxField.is() && _rxField->getPropertySetInfo()->hasPropertyByName(FM_PROP_LABEL) )
+ _rxField->getPropertyValue(FM_PROP_LABEL) >>= sLabel;
+ if ( !sLabel.getLength() )
+ sLabel = sFieldName;
+
+ xLabelModel->setPropertyValue( FM_PROP_LABEL, makeAny( sLabel + _rFieldPostfix ) );
String sObjectLabel( SVX_RES( RID_STR_OBJECT_LABEL ) );
sObjectLabel.SearchAndReplaceAllAscii( "#object#", sFieldName );
xLabelModel->setPropertyValue( FM_PROP_NAME, makeAny( ::rtl::OUString( sObjectLabel ) ) );
diff --git a/svx/source/form/formcontrolfactory.cxx b/svx/source/form/formcontrolfactory.cxx
index 089b6986e0..e68d525f52 100644
--- a/svx/source/form/formcontrolfactory.cxx
+++ b/svx/source/form/formcontrolfactory.cxx
@@ -40,6 +40,7 @@
#include <com/sun/star/form/XFormComponent.hpp>
#include <com/sun/star/form/FormComponentType.hpp>
#include <com/sun/star/awt/ScrollBarOrientation.hpp>
+#include <com/sun/star/awt/MouseWheelBehavior.hpp>
#include <com/sun/star/form/XGridColumnFactory.hpp>
#include <com/sun/star/style/VerticalAlignment.hpp>
#include <com/sun/star/awt/LineEndFormat.hpp>
@@ -97,6 +98,7 @@ namespace svxform
/** === end UNO using === **/
namespace FormComponentType = ::com::sun::star::form::FormComponentType;
namespace ScrollBarOrientation = ::com::sun::star::awt::ScrollBarOrientation;
+ namespace MouseWheelBehavior = ::com::sun::star::awt::MouseWheelBehavior;
namespace LineEndFormat = ::com::sun::star::awt::LineEndFormat;
namespace ImageScaleMode = ::com::sun::star::awt::ImageScaleMode;
namespace DataType = ::com::sun::star::sdbc::DataType;
@@ -506,6 +508,12 @@ namespace svxform
_rxControlModel->setPropertyValue( FM_PROP_STRICTFORMAT, makeAny( sal_Bool( sal_True ) ) );
}
+ // mouse wheel: don't use it for scrolling by default (i110036)
+ if ( xPSI->hasPropertyByName( FM_PROP_MOUSE_WHEEL_BEHAVIOR ) )
+ {
+ _rxControlModel->setPropertyValue( FM_PROP_MOUSE_WHEEL_BEHAVIOR, makeAny( MouseWheelBehavior::SCROLL_DISABLED ) );
+ }
+
if ( xPSI->hasPropertyByName( FM_PROP_WRITING_MODE ) )
_rxControlModel->setPropertyValue( FM_PROP_WRITING_MODE, makeAny( WritingMode2::CONTEXT ) );
}
diff --git a/svx/source/form/navigatortree.cxx b/svx/source/form/navigatortree.cxx
index 4e1a0b3f95..2adf2854ed 100644
--- a/svx/source/form/navigatortree.cxx
+++ b/svx/source/form/navigatortree.cxx
@@ -2232,7 +2232,7 @@ namespace svxform
{
SdrPaintWindow* pPaintWindow = pFormView->GetPaintWindow( i );
OutputDevice& rOutDev = pPaintWindow->GetOutputDevice();
- if ( OUTDEV_WINDOW == rOutDev.GetOutDevType() )
+ if ( ( OUTDEV_WINDOW == rOutDev.GetOutDevType() ) && !aMarkRect.IsEmpty() )
{
pFormView->MakeVisible( aMarkRect, (Window&)rOutDev );
}
diff --git a/svx/source/form/tabwin.cxx b/svx/source/form/tabwin.cxx
index 0165212e24..8ecaa916ea 100644
--- a/svx/source/form/tabwin.cxx
+++ b/svx/source/form/tabwin.cxx
@@ -91,9 +91,46 @@ using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::form;
using namespace ::com::sun::star::container;
+using namespace ::com::sun::star;
using namespace ::svxform;
using namespace ::svx;
+
+struct ColumnInfo
+{
+ ::rtl::OUString sColumnName;
+ ::rtl::OUString sLabel;
+ bool bColumn;
+ ColumnInfo(const ::rtl::OUString& i_sColumnName,const ::rtl::OUString& i_sLabel)
+ : sColumnName(i_sColumnName)
+ , sLabel(i_sLabel)
+ , bColumn(true)
+ {
+ }
+ ColumnInfo(const ::rtl::OUString& i_sColumnName)
+ : sColumnName(i_sColumnName)
+ , bColumn(false)
+ {
+ }
+};
+
+void lcl_addToList( SvTreeListBox& _rListBox, const uno::Reference< container::XNameAccess>& i_xColumns )
+{
+ uno::Sequence< ::rtl::OUString > aEntries = i_xColumns->getElementNames();
+ const ::rtl::OUString* pEntries = aEntries.getConstArray();
+ sal_Int32 nEntries = aEntries.getLength();
+ for ( sal_Int32 i = 0; i < nEntries; ++i, ++pEntries )
+ {
+ uno::Reference< beans::XPropertySet> xColumn(i_xColumns->getByName(*pEntries),UNO_QUERY_THROW);
+ ::rtl::OUString sLabel;
+ if ( xColumn->getPropertySetInfo()->hasPropertyByName(FM_PROP_LABEL) )
+ xColumn->getPropertyValue(FM_PROP_LABEL) >>= sLabel;
+ if ( sLabel.getLength() )
+ _rListBox.InsertEntry( sLabel,NULL,FALSE,LIST_APPEND,new ColumnInfo(*pEntries,sLabel) );
+ else
+ _rListBox.InsertEntry( *pEntries,NULL,FALSE,LIST_APPEND,new ColumnInfo(*pEntries,sLabel) );
+ }
+}
//==================================================================
// class FmFieldWinListBox
//==================================================================
@@ -149,7 +186,8 @@ void FmFieldWinListBox::StartDrag( sal_Int8 /*_nAction*/, const Point& /*_rPosPi
aDescriptor[ daConnection ] <<= pTabWin->GetConnection().getTyped();
aDescriptor[ daCommand ] <<= pTabWin->GetObjectName();
aDescriptor[ daCommandType ]<<= pTabWin->GetObjectType();
- aDescriptor[ daColumnName ] <<= ::rtl::OUString( GetEntryText( pSelected ) );
+ ColumnInfo* pInfo = static_cast<ColumnInfo*>(pSelected->GetUserData());
+ aDescriptor[ daColumnName ] <<= pInfo->sColumnName;
TransferableHelper* pTransferColumn = new OColumnTransferable(
aDescriptor, CTF_FIELD_DESCRIPTOR | CTF_CONTROL_EXCHANGE | CTF_COLUMN_DESCRIPTOR
@@ -238,7 +276,8 @@ sal_Bool FmFieldWin::createSelectionControls( )
aDescr[ daCommand ] <<= GetObjectName();
aDescr[ daCommandType ] <<= GetObjectType();
- aDescr[ daColumnName ] <<= ::rtl::OUString( pListBox->GetEntryText( pSelected) );
+ ColumnInfo* pInfo = static_cast<ColumnInfo*>(pSelected->GetUserData());
+ aDescr[ daColumnName ] <<= pInfo->sColumnName;//::rtl::OUString( pListBox->GetEntryText( pSelected) );
// transfer this to the SFX world
SfxUnoAnyItem aDescriptorItem( SID_FM_DATACCESS_DESCRIPTOR, makeAny( aDescr.createPropertyValueSequence() ) );
@@ -344,15 +383,14 @@ void FmFieldWin::UpdateContent(const ::com::sun::star::uno::Reference< ::com::su
// the place, and connectRowset should be replaced with ensureRowSetConnection
// get the fields of the object
- Sequence< ::rtl::OUString> aFieldNames;
+
if ( m_aConnection.is() && m_aObjectName.getLength() )
- aFieldNames = getFieldNamesByCommandDescriptor( m_aConnection, m_nObjectType, m_aObjectName );
-
- // put them into the list
- const ::rtl::OUString* pFieldNames = aFieldNames.getConstArray();
- sal_Int32 nFieldsCount = aFieldNames.getLength();
- for ( sal_Int32 i = 0; i < nFieldsCount; ++i, ++pFieldNames)
- pListBox->InsertEntry( * pFieldNames);
+ {
+ Reference< XComponent > xKeepFieldsAlive;
+ Reference< XNameAccess > xColumns = getFieldsByCommandDescriptor( m_aConnection, m_nObjectType, m_aObjectName,xKeepFieldsAlive );
+ if ( xColumns.is() )
+ lcl_addToList(*pListBox,xColumns);
+ }
// Prefix setzen
UniString aPrefix;
diff --git a/svx/source/inc/fmprop.hrc b/svx/source/inc/fmprop.hrc
index 981fd384f0..d9f49b2fcc 100644
--- a/svx/source/inc/fmprop.hrc
+++ b/svx/source/inc/fmprop.hrc
@@ -174,5 +174,6 @@
#define FM_PROP_INPUT_REQUIRED rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "InputRequired" ) )
#define FM_PROP_WRITING_MODE rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "WritingMode" ) )
#define FM_PROP_MOUSE_WHEEL_BEHAVIOR rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MouseWheelBehavior" ) )
+#define FM_PROP_DESCRIPTION rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Description" ) )
#endif // _SVX_FMPROP_HRC
diff --git a/svx/source/inc/fmshimp.hxx b/svx/source/inc/fmshimp.hxx
index 957d737a1b..e10f4d9c61 100644
--- a/svx/source/inc/fmshimp.hxx
+++ b/svx/source/inc/fmshimp.hxx
@@ -477,6 +477,9 @@ public:
// if the form belongs to the controller (extern) displaying a grid, the according internal form will
// be displayed, _xForm else
+ // check if the current control of the active controler has the focus
+ bool HasControlFocus() const;
+
private:
DECL_LINK(OnFoundData, FmFoundRecordInformation*);
DECL_LINK(OnCanceledNotFound, FmFoundRecordInformation*);
diff --git a/svx/source/inc/fmvwimp.hxx b/svx/source/inc/fmvwimp.hxx
index 84a941ae1e..4087d8b1f4 100644
--- a/svx/source/inc/fmvwimp.hxx
+++ b/svx/source/inc/fmvwimp.hxx
@@ -240,6 +240,11 @@ public:
void onCreatedFormObject( FmFormObj& _rFormObject );
+ static bool
+ isFocusable(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& i_rControl
+ );
+
private:
FmWinRecList::iterator findWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >& _rxCC );
//void addWindow(const SdrPageViewWinRec*);
diff --git a/svx/source/inc/gridcell.hxx b/svx/source/inc/gridcell.hxx
index 9c1e7cf359..31bd37114c 100644
--- a/svx/source/inc/gridcell.hxx
+++ b/svx/source/inc/gridcell.hxx
@@ -219,6 +219,7 @@ class DbCellControl
{
private:
::comphelper::OPropertyChangeMultiplexer* m_pModelChangeBroadcaster;
+ ::comphelper::OPropertyChangeMultiplexer* m_pFieldChangeBroadcaster;
private:
sal_Bool m_bTransparent : 1;
@@ -348,7 +349,7 @@ private:
void implDoPropertyListening( const ::rtl::OUString& _rPropertyName, sal_Bool _bWarnIfNotExistent = sal_True );
/// updates the "readonly" setting on m_pWindow, according to the respective property value in the given model
- void implAdjustReadOnly( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel );
+ void implAdjustReadOnly( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel,bool i_bReadOnly );
/// updates the "enabled" setting on m_pWindow, according to the respective property value in the given model
void implAdjustEnabled( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel );
diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
index 3b53a9c543..ae20c58021 100644
--- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
@@ -299,10 +299,14 @@ namespace sdr { namespace contact {
//--------------------------------------------------------------------
void ControlHolder::invalidate() const
{
- Window* pWindow = VCLUnoHelper::GetWindow( m_xControl->getPeer() );
- OSL_ENSURE( pWindow, "ControlHolder::invalidate: no implementation access!" );
- if ( pWindow )
- pWindow->Invalidate();
+ Reference< XWindowPeer > xPeer( m_xControl->getPeer() );
+ if ( xPeer.is() )
+ {
+ Window* pWindow = VCLUnoHelper::GetWindow( xPeer );
+ OSL_ENSURE( pWindow, "ControlHolder::invalidate: no implementation access!" );
+ if ( pWindow )
+ pWindow->Invalidate();
+ }
}
//--------------------------------------------------------------------
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 0e910b9e2e..ee4074027c 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -121,6 +121,7 @@
#include <svx/sdrhittesthelper.hxx>
#include <svx/svdundo.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <svx/sdrobjectfilter.hxx>
using namespace ::com::sun::star;
@@ -3266,4 +3267,11 @@ void SdrObjFactory::RemoveMakeUserDataHdl(const Link& rLink)
rLL.RemoveLink(rLink);
}
+namespace svx
+{
+ ISdrObjectFilter::~ISdrObjectFilter()
+ {
+ }
+}
+
// eof
diff --git a/svx/uiconfig/accelerator/en-US/default.xml b/svx/uiconfig/accelerator/en-US/default.xml
index 67a6e9127c..1969c9b000 100644
--- a/svx/uiconfig/accelerator/en-US/default.xml
+++ b/svx/uiconfig/accelerator/en-US/default.xml
@@ -23,7 +23,7 @@
<accel:item accel:code="KEY_F" accel:mod1="true" xlink:href=".uno:SearchDialog"/>
<accel:item accel:code="KEY_Q" accel:shift="true" accel:mod1="true" xlink:href=".uno:BasicBreak"/>
<accel:item accel:code="KEY_F4" xlink:href=".uno:ViewDataSourceBrowser"/>
- <accel:item accel:code="KEY_F5" accel:mod1="true" xlink:href=".uno:GrabControlFocus"/>
+ <accel:item accel:code="KEY_F5" accel:mod1="true" xlink:href=".uno:ToggleControlFocus"/>
<accel:item accel:code="KEY_F7" accel:shift="true" accel:mod1="true" xlink:href=".uno:HangulHanjaConversion"/>
<accel:item accel:code="KEY_F11" accel:mod2="true" xlink:href=".uno:MacroDialog"/>
</accel:acceleratorlist>
diff --git a/svx/uiconfig/accelerator/es/default.xml b/svx/uiconfig/accelerator/es/default.xml
index 71ba6212d2..3a0c362b61 100644
--- a/svx/uiconfig/accelerator/es/default.xml
+++ b/svx/uiconfig/accelerator/es/default.xml
@@ -23,7 +23,7 @@
<accel:item accel:code="KEY_B" accel:mod1="true" xlink:href=".uno:SearchDialog"/>
<accel:item accel:code="KEY_Q" accel:shift="true" accel:mod1="true" xlink:href=".uno:BasicBreak"/>
<accel:item accel:code="KEY_F4" xlink:href=".uno:ViewDataSourceBrowser"/>
- <accel:item accel:code="KEY_F5" accel:mod1="true" xlink:href=".uno:GrabControlFocus"/>
+ <accel:item accel:code="KEY_F5" accel:mod1="true" xlink:href=".uno:ToggleControlFocus"/>
<accel:item accel:code="KEY_F7" accel:shift="true" accel:mod1="true" xlink:href=".uno:HangulHanjaConversion"/>
<accel:item accel:code="KEY_F11" accel:mod2="true" xlink:href=".uno:MacroDialog"/>
</accel:acceleratorlist>