Tag: cws_src680_hsqlcsv User: fs Date: 2008-01-17 02:18:50+0000 Modified: dba/dbaccess/source/ui/app/AppDetailPageHelper.cxx
Log: RESYNC: (1.20-1.27); FILE MERGED File Changes: Directory: /dba/dbaccess/source/ui/app/ ======================================= File [changed]: AppDetailPageHelper.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/app/AppDetailPageHelper.cxx?r1=1.15.12.7&r2=1.15.12.8 Delta lines: +54 -20 --------------------- --- AppDetailPageHelper.cxx 2006-12-18 07:51:11+0000 1.15.12.7 +++ AppDetailPageHelper.cxx 2008-01-17 02:18:48+0000 1.15.12.8 @@ -38,6 +38,9 @@ #ifndef DBAUI_APPDETAILPAGEHELPER_HXX #include "AppDetailPageHelper.hxx" #endif +#ifndef _DBAUI_MODULE_DBU_HXX_ +#include "moduledbu.hxx" +#endif #ifndef _TOOLS_DEBUG_HXX #include <tools/debug.hxx> #endif @@ -53,6 +56,12 @@ #ifndef DBAUI_DBTREELISTBOX_HXX #include "dbtreelistbox.hxx" #endif +#ifndef _COM_SUN_STAR_FRAME_XLAYOUTMANAGER_HPP_ +#include <com/sun/star/frame/XLayoutManager.hpp> +#endif +#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ +#include <com/sun/star/beans/XPropertySet.hpp> +#endif #ifndef _COM_SUN_STAR_AWT_XTABCONTROLLER_HPP_ #include <com/sun/star/awt/XTabController.hpp> #endif @@ -156,6 +165,8 @@ #include <tools/debug.hxx> #endif +#include <com/sun/star/document/XStandaloneDocumentInfo.hpp> + using namespace ::dbaui; using namespace ::com::sun::star::container; using namespace ::com::sun::star::uno; @@ -296,7 +307,7 @@ m_aTBPreview.SetHelpId(HID_APP_VIEW_PREVIEW_CB); m_aTBPreview.SetDropdownClickHdl( LINK( this, OAppDetailPageHelper, OnDropdownClickHdl ) ); m_aTBPreview.EnableMenuStrings(); - m_aTBPreview.Enable(!m_rBorderWin.getView()->getCommandController()->isDataSourceReadOnly()); + m_aTBPreview.Enable(TRUE); m_aBorder.SetUniqueId(UID_APP_VIEW_PREVIEW_1); @@ -332,8 +343,10 @@ { if ( m_pLists[i] ) { + m_pLists[i]->clearCurrentSelectionEntry(); m_pLists[i]->Hide(); - ::std::auto_ptr<Window> aTemp(m_pLists[i]); + ::std::auto_ptr<DBTreeListBox> aTemp(m_pLists[i]); + m_pLists[i]->clearCurrentSelectionEntry(); m_pLists[i] = NULL; } @@ -433,6 +446,24 @@ } } // ----------------------------------------------------------------------------- +void OAppDetailPageHelper::selectElements(const Sequence< ::rtl::OUString>& _aNames) +{ + int nPos = getVisibleControlIndex(); + if ( nPos < CONTROL_COUNT ) + { + DBTreeListBox& rTree = *m_pLists[nPos]; + rTree.SelectAll(FALSE); + const ::rtl::OUString* pIter = _aNames.getConstArray(); + const ::rtl::OUString* pEnd = pIter + _aNames.getLength(); + for(;pIter != pEnd;++pIter) + { + SvLBoxEntry* pEntry = rTree.GetEntryPosByName(*pIter); + if ( pEntry ) + rTree.Select(pEntry); + } + } +} +// ----------------------------------------------------------------------------- ::rtl::OUString OAppDetailPageHelper::getQualifiedName( SvLBoxEntry* _pEntry ) const { int nPos = getVisibleControlIndex(); @@ -680,12 +711,18 @@ pCurrent->Hide(); showPreview(NULL); + BOOL bHasFocus = FALSE; m_aFL.Show(); + { + bHasFocus = pCurrent->HasChildPathFocus(); _pWindow->Show(); + } m_aTBPreview.Show(); m_aBorder.Show(); switchPreview(m_ePreviewMode,TRUE); + if ( bHasFocus ) + _pWindow->GrabFocus(); Resize(); } // ----------------------------------------------------------------------------- @@ -961,11 +998,6 @@ return m_ePreviewMode != E_PREVIEWNONE; } // ----------------------------------------------------------------------------- -void OAppDetailPageHelper::switchPreview() -{ - // m_aTBPreview.GetClickHdl().Call(&m_aTBPreview); -} -// ----------------------------------------------------------------------------- void OAppDetailPageHelper::switchPreview(PreviewMode _eMode,BOOL _bForce) { if ( m_ePreviewMode != _eMode || _bForce ) @@ -1058,7 +1090,7 @@ m_aPreview.Hide(); m_aDocumentInfo.Clear(); m_aDocumentInfo.Show(); - Reference<XPropertySet> xProp(aPreview,UNO_QUERY); + Reference<document::XStandaloneDocumentInfo> xProp(aPreview,UNO_QUERY); if ( xProp.is() ) m_aDocumentInfo.fill(xProp,String()); } @@ -1096,6 +1128,12 @@ m_xFrame = Reference < XFrame > ( getBorderWin().getView()->getORB()->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Frame")) ), UNO_QUERY ); m_xFrame->initialize( m_xWindow ); + // work-around for #150518#: no layout manager (and thus no toolbars) in the preview + // Must be called after initialize ... but before any other call to this frame. + // Otherwhise frame throws "life time exceptions" as e.g. NON_INITIALIZED + Reference< XPropertySet > xFrameProps( m_xFrame, UNO_QUERY_THROW ); + xFrameProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" ) ), makeAny(Reference< XLayoutManager >()) ); + Reference<XFramesSupplier> xSup(getBorderWin().getView()->getController()->getFrame(),UNO_QUERY); if ( xSup.is() ) { @@ -1110,7 +1148,7 @@ Reference< XDatabaseDocumentUI > xApplication( getBorderWin().getView()->getController(), UNO_QUERY ); ::std::auto_ptr< DatabaseObjectView > pDispatcher( new ResultSetBrowser( - getBorderWin().getView()->getORB(), xApplication, _bTable + getBorderWin().getView()->getORB(), xApplication, NULL, _bTable ) ); pDispatcher->setTargetFrame( m_xFrame ); @@ -1189,11 +1227,6 @@ return 0L; } // ----------------------------------------------------------------------------- -void OAppDetailPageHelper::disableControls(sal_Bool _bDisable) -{ - m_aTBPreview.Enable(!_bDisable); -} -// ----------------------------------------------------------------------------- void OAppDetailPageHelper::KeyInput( const KeyEvent& rKEvt ) { KeyFuncType eFunc = rKEvt.GetKeyCode().GetFunction(); (void)eFunc; @@ -1212,11 +1245,12 @@ { Window::DataChanged( rDCEvt ); - if ( ( ( rDCEvt.GetType() == DATACHANGED_SETTINGS ) - || ( rDCEvt.GetType() == DATACHANGED_DISPLAY ) - ) - && ( rDCEvt.GetFlags() & SETTINGS_STYLE ) - ) + if ( (rDCEvt.GetType() == DATACHANGED_FONTS) || + (rDCEvt.GetType() == DATACHANGED_DISPLAY) || + (rDCEvt.GetType() == DATACHANGED_FONTSUBSTITUTION) || + ((rDCEvt.GetType() == DATACHANGED_SETTINGS) && + (rDCEvt.GetFlags() & SETTINGS_STYLE)) ) + { ImplInitSettings(); if ( m_pLists[ E_TABLE ] ) --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
