summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/browser/unodatbr.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'dbaccess/source/ui/browser/unodatbr.cxx')
-rw-r--r--dbaccess/source/ui/browser/unodatbr.cxx71
1 files changed, 43 insertions, 28 deletions
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx
index 57a4a9270c25..98caa841c84c 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -60,6 +60,8 @@
/** === begin UNO includes === **/
#include <com/sun/star/awt/LineEndFormat.hpp>
+#include <com/sun/star/awt/LineEndFormat.hpp>
+#include <com/sun/star/awt/MouseWheelBehavior.hpp>
#include <com/sun/star/awt/TextAlign.hpp>
#include <com/sun/star/awt/VisualEffect.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
@@ -684,13 +686,23 @@ sal_Bool SbaTableQueryBrowser::InitializeGridModel(const Reference< ::com::sun::
aCopyProperties.push_back( PROPERTY_WIDTH );
// help text to display for the column
- Any aDescription; aDescription <<= ::rtl::OUString();
+ Any aDescription;
if ( xColPSI->hasPropertyByName( PROPERTY_HELPTEXT ) )
- aDescription <<= ::comphelper::getString( xColumn->getPropertyValue( PROPERTY_HELPTEXT ) );
+ aDescription = xColumn->getPropertyValue( PROPERTY_HELPTEXT );
+ if ( !aDescription.hasValue() )
+ aDescription <<= ::rtl::OUString();
aInitialValues.push_back( NamedValue( PROPERTY_HELPTEXT, aDescription ) );
// ... horizontal justify
- aInitialValues.push_back( NamedValue( PROPERTY_ALIGN, makeAny( sal_Int16( ::comphelper::getINT32( xColumn->getPropertyValue( PROPERTY_ALIGN ) ) ) ) ) );
+ Any aAlign; aAlign <<= sal_Int16( 0 );
+ Any aColAlign( xColumn->getPropertyValue( PROPERTY_ALIGN ) );
+ if ( aColAlign.hasValue() )
+ aAlign <<= sal_Int16( ::comphelper::getINT32( aColAlign ) );
+ aInitialValues.push_back( NamedValue( PROPERTY_ALIGN, aAlign ) );
+
+ // don't allow the mouse to scroll in the cells
+ if ( xGridColPSI->hasPropertyByName( PROPERTY_MOUSE_WHEEL_BEHAVIOR ) )
+ aInitialValues.push_back( NamedValue( PROPERTY_MOUSE_WHEEL_BEHAVIOR, makeAny( MouseWheelBehavior::SCROLL_DISABLED ) ) );
// now set all those values
for ( ::std::vector< NamedValue >::const_iterator property = aInitialValues.begin();
@@ -2346,31 +2358,34 @@ sal_Bool SbaTableQueryBrowser::implSelect(const ::rtl::OUString& _rDataSourceNam
SvLBoxEntry* pCommandType = NULL;
SvLBoxEntry* pCommand = getObjectEntry( _rDataSourceName, _rCommand, _nCommandType, &pDataSource, &pCommandType, sal_True, _rxConnection );
- // if (pDataSource) // OJ change for the new app
+ if (pCommand)
{
- if (pCommand)
+ bool bSuccess = true;
+ if ( _bSelectDirect )
{
- if ( _bSelectDirect )
- {
- implSelect( pCommand );
- }
- else
- m_pTreeView->getListBox().Select(pCommand);
+ bSuccess = implSelect( pCommand );
+ }
+ else
+ {
+ m_pTreeView->getListBox().Select( pCommand );
+ }
+ if ( bSuccess )
+ {
m_pTreeView->getListBox().MakeVisible(pCommand);
m_pTreeView->getListBox().SetCursor(pCommand);
}
- else if (!pCommandType)
- {
- if ( m_pCurrentlyDisplayed )
- { // tell the old entry (if any) it has been deselected
- selectPath(m_pCurrentlyDisplayed, sal_False);
- m_pCurrentlyDisplayed = NULL;
- }
-
- // we have a command and need to display this in the rowset
- return implLoadAnything(_rDataSourceName, _rCommand, _nCommandType, _bEscapeProcessing, _rxConnection);
+ }
+ else if (!pCommandType)
+ {
+ if ( m_pCurrentlyDisplayed )
+ { // tell the old entry (if any) it has been deselected
+ selectPath(m_pCurrentlyDisplayed, sal_False);
+ m_pCurrentlyDisplayed = NULL;
}
+
+ // we have a command and need to display this in the rowset
+ return implLoadAnything(_rDataSourceName, _rCommand, _nCommandType, _bEscapeProcessing, _rxConnection);
}
}
return sal_False;
@@ -2437,7 +2452,8 @@ bool SbaTableQueryBrowser::implSelect( SvLBoxEntry* _pEntry )
Reference< ::com::sun::star::form::XLoadable > xLoadable = getLoadable();
bRebuild |= !xLoadable->isLoaded();
- if(bRebuild)
+ bool bSuccess = true;
+ if ( bRebuild )
{
try
{
@@ -2458,7 +2474,7 @@ bool SbaTableQueryBrowser::implSelect( SvLBoxEntry* _pEntry )
if ( !pConData->xConnection.is() )
{
unloadAndCleanup( sal_False );
- return 0L;
+ return false;
}
Reference<XNameAccess> xNameAccess;
@@ -2532,6 +2548,7 @@ bool SbaTableQueryBrowser::implSelect( SvLBoxEntry* _pEntry )
}
catch (Exception&)
{
+ DBG_UNHANDLED_EXCEPTION();
}
}
}
@@ -2540,10 +2557,8 @@ bool SbaTableQueryBrowser::implSelect( SvLBoxEntry* _pEntry )
}
String sDataSourceName( getDataSourceAcessor( pConnection ) );
- if ( implLoadAnything( sDataSourceName, aName, nCommandType, sal_True, pConData->xConnection ) )
- // set the title of the beamer
- ;/*updateTitle();*/
- else
+ bSuccess = implLoadAnything( sDataSourceName, aName, nCommandType, sal_True, pConData->xConnection );
+ if ( !bSuccess )
{ // clean up
criticalFail();
}
@@ -2573,7 +2588,7 @@ bool SbaTableQueryBrowser::implSelect( SvLBoxEntry* _pEntry )
xRowSetProps->setPropertyValue(PROPERTY_ACTIVE_CONNECTION,Any());
}
}
- return true;
+ return bSuccess;
}
// -----------------------------------------------------------------------------