diff options
author | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-03-15 14:07:56 +0100 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-03-15 14:07:56 +0100 |
commit | 6c07c7cad453e4ebb447577c7313323764d50ea9 (patch) | |
tree | 7410c4e721b8d15b4cdb48ad109c1a93caed0a86 /extensions | |
parent | 839c7d708a3acbbf52b5ce03f91196884c0dc258 (diff) |
dba33f: #i110036#: when creating new controls or grid columns, set MouseWheelBehavior to NEVER
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/dbpilots/gridwizard.cxx | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/extensions/source/dbpilots/gridwizard.cxx b/extensions/source/dbpilots/gridwizard.cxx index c3d50e6c112d..bee49039a99c 100644 --- a/extensions/source/dbpilots/gridwizard.cxx +++ b/extensions/source/dbpilots/gridwizard.cxx @@ -36,6 +36,7 @@ #include <comphelper/stl_types.hxx> #include <tools/string.hxx> #include <com/sun/star/form/XGridColumnFactory.hpp> +#include <com/sun/star/awt/MouseWheelBehavior.hpp> #include <com/sun/star/container/XNameContainer.hpp> #include <tools/debug.hxx> #include "dbptools.hxx" @@ -55,6 +56,7 @@ namespace dbp using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::container; using namespace ::com::sun::star::form; + using namespace ::com::sun::star::awt; using namespace ::svt; //===================================================================== @@ -114,6 +116,7 @@ namespace dbp static const ::rtl::OUString s_sDataFieldProperty = ::rtl::OUString::createFromAscii("DataField"); static const ::rtl::OUString s_sLabelProperty = ::rtl::OUString::createFromAscii("Label"); static const ::rtl::OUString s_sWidthProperty = ::rtl::OUString::createFromAscii("Width"); + static const ::rtl::OUString s_sMouseWheelBehavior = ::rtl::OUString::createFromAscii("MouseWheelBehavior"); static const ::rtl::OUString s_sEmptyString; // collect "descriptors" for the to-be-created (grid)columns @@ -205,23 +208,24 @@ namespace dbp // create a (grid)column for the (resultset)column try { - Reference< XPropertySet > xColumn = xColumnFactory->createColumn(*pColumnServiceName); + Reference< XPropertySet > xColumn( xColumnFactory->createColumn(*pColumnServiceName), UNO_SET_THROW ); + Reference< XPropertySetInfo > xColumnPSI( xColumn->getPropertySetInfo(), UNO_SET_THROW ); ::rtl::OUString sColumnName(*pColumnServiceName); disambiguateName(xExistenceChecker, sColumnName); - if (xColumn.is()) - { - // the data field the column should be bound to - xColumn->setPropertyValue(s_sDataFieldProperty, makeAny(*pFormFieldName)); - // the label - xColumn->setPropertyValue(s_sLabelProperty, makeAny(::rtl::OUString(*pFormFieldName) += *pColumnLabelPostfix)); - // the width (<void/> => column will be auto-sized) - xColumn->setPropertyValue(s_sWidthProperty, Any()); - - // insert the column - xColumnContainer->insertByName(sColumnName, makeAny(xColumn)); - } + // the data field the column should be bound to + xColumn->setPropertyValue(s_sDataFieldProperty, makeAny(*pFormFieldName)); + // the label + xColumn->setPropertyValue(s_sLabelProperty, makeAny(::rtl::OUString(*pFormFieldName) += *pColumnLabelPostfix)); + // the width (<void/> => column will be auto-sized) + xColumn->setPropertyValue(s_sWidthProperty, Any()); + + if ( xColumnPSI->hasPropertyByName( s_sMouseWheelBehavior ) ) + xColumn->setPropertyValue( s_sMouseWheelBehavior, makeAny( MouseWheelBehavior::SCROLL_DISABLED ) ); + + // insert the column + xColumnContainer->insertByName(sColumnName, makeAny(xColumn)); } catch(Exception&) { |