1*96de5490SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*96de5490SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*96de5490SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*96de5490SAndrew Rist  * distributed with this work for additional information
6*96de5490SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*96de5490SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*96de5490SAndrew Rist  * "License"); you may not use this file except in compliance
9*96de5490SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*96de5490SAndrew Rist  *
11*96de5490SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*96de5490SAndrew Rist  *
13*96de5490SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*96de5490SAndrew Rist  * software distributed under the License is distributed on an
15*96de5490SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*96de5490SAndrew Rist  * KIND, either express or implied.  See the License for the
17*96de5490SAndrew Rist  * specific language governing permissions and limitations
18*96de5490SAndrew Rist  * under the License.
19*96de5490SAndrew Rist  *
20*96de5490SAndrew Rist  *************************************************************/
21*96de5490SAndrew Rist 
22*96de5490SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_dbaccess.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #ifndef DBACCESS_SOURCE_UI_INC_OPENDOCCONTROLS_HXX
28cdf0e10cSrcweir #include "opendoccontrols.hxx"
29cdf0e10cSrcweir #endif
30cdf0e10cSrcweir 
31cdf0e10cSrcweir /** === begin UNO includes === **/
32cdf0e10cSrcweir #ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_
33cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.hxx>
34cdf0e10cSrcweir #endif
35cdf0e10cSrcweir #ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
36cdf0e10cSrcweir #include <com/sun/star/beans/PropertyValue.hpp>
37cdf0e10cSrcweir #endif
38cdf0e10cSrcweir #ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
39cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp>
40cdf0e10cSrcweir #endif
41cdf0e10cSrcweir #ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_
42cdf0e10cSrcweir #include <com/sun/star/container/XNameAccess.hpp>
43cdf0e10cSrcweir #endif
44cdf0e10cSrcweir #ifndef _COM_SUN_STAR_UI_XMODULEUICONFIGURATIONMANAGERSUPPLIER_HPP_
45cdf0e10cSrcweir #include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp>
46cdf0e10cSrcweir #endif
47cdf0e10cSrcweir #ifndef _COM_SUN_STAR_UI_XUICONFIGURATIONMANAGER_HPP_
48cdf0e10cSrcweir #include <com/sun/star/ui/XUIConfigurationManager.hpp>
49cdf0e10cSrcweir #endif
50cdf0e10cSrcweir #ifndef _COM_SUN_STAR_GRAPHIC_XGRAPHIC_HPP_
51cdf0e10cSrcweir #include <com/sun/star/graphic/XGraphic.hpp>
52cdf0e10cSrcweir #endif
53cdf0e10cSrcweir #ifndef _COM_SUN_STAR_UI_XIMAGEMANAGER_HPP_
54cdf0e10cSrcweir #include <com/sun/star/ui/XImageManager.hpp>
55cdf0e10cSrcweir #endif
56cdf0e10cSrcweir /** === end UNO includes === **/
57cdf0e10cSrcweir 
58cdf0e10cSrcweir #ifndef _COMPHELPER_PROCESSFACTORY_HXX_
59cdf0e10cSrcweir #include <comphelper/processfactory.hxx>
60cdf0e10cSrcweir #endif
61cdf0e10cSrcweir #ifndef _SV_GRAPH_HXX
62cdf0e10cSrcweir #include <vcl/graph.hxx>
63cdf0e10cSrcweir #endif
64cdf0e10cSrcweir #ifndef _SV_HELP_HXX
65cdf0e10cSrcweir #include <vcl/help.hxx>
66cdf0e10cSrcweir #endif
67cdf0e10cSrcweir #ifndef INCLUDED_SVTOOLS_HISTORYOPTIONS_HXX
68cdf0e10cSrcweir #include <unotools/historyoptions.hxx>
69cdf0e10cSrcweir #endif
70cdf0e10cSrcweir #ifndef _COMPHELPER_SEQUENCEASHASHMAP_HXX_
71cdf0e10cSrcweir #include <comphelper/sequenceashashmap.hxx>
72cdf0e10cSrcweir #endif
73cdf0e10cSrcweir #ifndef _URLOBJ_HXX
74cdf0e10cSrcweir #include <tools/urlobj.hxx>
75cdf0e10cSrcweir #endif
76cdf0e10cSrcweir #ifndef SVTOOLS_FILENOTATION_HXX
77cdf0e10cSrcweir #include <svl/filenotation.hxx>
78cdf0e10cSrcweir #endif
79cdf0e10cSrcweir 
80cdf0e10cSrcweir //........................................................................
81cdf0e10cSrcweir namespace dbaui
82cdf0e10cSrcweir {
83cdf0e10cSrcweir //........................................................................
84cdf0e10cSrcweir 
85cdf0e10cSrcweir     namespace
86cdf0e10cSrcweir     {
87cdf0e10cSrcweir         using ::com::sun::star::uno::Reference;
88cdf0e10cSrcweir         using ::com::sun::star::uno::Exception;
89cdf0e10cSrcweir         using ::com::sun::star::uno::Sequence;
90cdf0e10cSrcweir         using ::com::sun::star::uno::UNO_QUERY_THROW;
91cdf0e10cSrcweir         using ::com::sun::star::container::XNameAccess;
92cdf0e10cSrcweir         using ::com::sun::star::lang::XMultiServiceFactory;
93cdf0e10cSrcweir         using ::com::sun::star::beans::PropertyValue;
94cdf0e10cSrcweir         using ::com::sun::star::ui::XModuleUIConfigurationManagerSupplier;
95cdf0e10cSrcweir         using ::com::sun::star::ui::XUIConfigurationManager;
96cdf0e10cSrcweir         using ::com::sun::star::ui::XImageManager;
97cdf0e10cSrcweir         using ::com::sun::star::graphic::XGraphic;
98cdf0e10cSrcweir 
GetCommandText(const sal_Char * _pCommandURL,const::rtl::OUString & _rModuleName)99cdf0e10cSrcweir         String GetCommandText( const sal_Char* _pCommandURL, const ::rtl::OUString& _rModuleName )
100cdf0e10cSrcweir         {
101cdf0e10cSrcweir             ::rtl::OUString sLabel;
102cdf0e10cSrcweir             if ( !_pCommandURL || !*_pCommandURL )
103cdf0e10cSrcweir                 return sLabel;
104cdf0e10cSrcweir 
105cdf0e10cSrcweir             Reference< XNameAccess > xUICommandLabels;
106cdf0e10cSrcweir             ::rtl::OUString sCommandURL = ::rtl::OUString::createFromAscii( _pCommandURL );
107cdf0e10cSrcweir 
108cdf0e10cSrcweir             try
109cdf0e10cSrcweir             {
110cdf0e10cSrcweir                 do
111cdf0e10cSrcweir                 {
112cdf0e10cSrcweir                     // Retrieve popup menu labels
113cdf0e10cSrcweir                     Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
114cdf0e10cSrcweir                     if ( !xFactory.is() )
115cdf0e10cSrcweir                         break;
116cdf0e10cSrcweir 
117cdf0e10cSrcweir                     Reference< XNameAccess> xNameAccess;
118cdf0e10cSrcweir                     xNameAccess = xNameAccess.query( xFactory->createInstance(
119cdf0e10cSrcweir                         ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.UICommandDescription" ) )
120cdf0e10cSrcweir                     ) );
121cdf0e10cSrcweir                     if ( !xNameAccess.is() )
122cdf0e10cSrcweir                         break;
123cdf0e10cSrcweir 
124cdf0e10cSrcweir                     xNameAccess->getByName( _rModuleName ) >>= xUICommandLabels;
125cdf0e10cSrcweir                     if ( !xUICommandLabels.is() )
126cdf0e10cSrcweir                         break;
127cdf0e10cSrcweir 
128cdf0e10cSrcweir                     Sequence< PropertyValue > aProperties;
129cdf0e10cSrcweir                     if ( !( xUICommandLabels->getByName(sCommandURL) >>= aProperties ) )
130cdf0e10cSrcweir                         break;
131cdf0e10cSrcweir 
132cdf0e10cSrcweir                     sal_Int32 nCount( aProperties.getLength() );
133cdf0e10cSrcweir                     for ( sal_Int32 i=0; i<nCount; ++i )
134cdf0e10cSrcweir                     {
135cdf0e10cSrcweir                         ::rtl::OUString sPropertyName( aProperties[i].Name );
136cdf0e10cSrcweir                         if ( sPropertyName.equalsAscii("Label" ) )
137cdf0e10cSrcweir                         {
138cdf0e10cSrcweir                             aProperties[i].Value >>= sLabel;
139cdf0e10cSrcweir                             break;
140cdf0e10cSrcweir                         }
141cdf0e10cSrcweir                     }
142cdf0e10cSrcweir                 }
143cdf0e10cSrcweir                 while ( false );
144cdf0e10cSrcweir             }
145cdf0e10cSrcweir             catch( Exception& rException )
146cdf0e10cSrcweir             {
147cdf0e10cSrcweir                 (void)rException;
148cdf0e10cSrcweir             }
149cdf0e10cSrcweir 
150cdf0e10cSrcweir             return sLabel;
151cdf0e10cSrcweir         }
152cdf0e10cSrcweir 
GetCommandIcon(const sal_Char * _pCommandURL,const::rtl::OUString & _rModuleName)153cdf0e10cSrcweir         Image GetCommandIcon( const sal_Char* _pCommandURL, const ::rtl::OUString& _rModuleName )
154cdf0e10cSrcweir         {
155cdf0e10cSrcweir             Image aIcon;
156cdf0e10cSrcweir             if ( !_pCommandURL || !*_pCommandURL )
157cdf0e10cSrcweir                 return aIcon;
158cdf0e10cSrcweir 
159cdf0e10cSrcweir             Reference< XNameAccess > xUICommandLabels;
160cdf0e10cSrcweir             ::rtl::OUString sCommandURL = ::rtl::OUString::createFromAscii( _pCommandURL );
161cdf0e10cSrcweir             try
162cdf0e10cSrcweir             {
163cdf0e10cSrcweir                 do
164cdf0e10cSrcweir                 {
165cdf0e10cSrcweir                     // Retrieve popup menu labels
166cdf0e10cSrcweir                     Reference< XMultiServiceFactory> xFactory( ::comphelper::getProcessServiceFactory() );
167cdf0e10cSrcweir                     if ( !xFactory.is() )
168cdf0e10cSrcweir                         break;
169cdf0e10cSrcweir 
170cdf0e10cSrcweir                     Reference< XModuleUIConfigurationManagerSupplier > xSupplier(
171cdf0e10cSrcweir                         xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
172cdf0e10cSrcweir                             "com.sun.star.ui.ModuleUIConfigurationManagerSupplier" ) ) ),
173cdf0e10cSrcweir                         UNO_QUERY_THROW );
174cdf0e10cSrcweir 
175cdf0e10cSrcweir                     Reference< XUIConfigurationManager > xManager( xSupplier->getUIConfigurationManager( _rModuleName ) );
176cdf0e10cSrcweir                     Reference< XImageManager > xImageManager;
177cdf0e10cSrcweir                     if ( xManager.is() )
178cdf0e10cSrcweir                         xImageManager = xImageManager.query( xManager->getImageManager() );
179cdf0e10cSrcweir                     if ( !xImageManager.is() )
180cdf0e10cSrcweir                         break;
181cdf0e10cSrcweir 
182cdf0e10cSrcweir                     Sequence< ::rtl::OUString > aCommandList( &sCommandURL, 1 );
183cdf0e10cSrcweir                     Sequence<Reference< XGraphic> > xIconList( xImageManager->getImages( 0, aCommandList ) );
184cdf0e10cSrcweir                     if ( !xIconList.hasElements() )
185cdf0e10cSrcweir                         break;
186cdf0e10cSrcweir 
187cdf0e10cSrcweir                     aIcon = Graphic( xIconList[0] ).GetBitmapEx();
188cdf0e10cSrcweir                 }
189cdf0e10cSrcweir                 while ( false );
190cdf0e10cSrcweir             }
191cdf0e10cSrcweir             catch ( Exception& rException )
192cdf0e10cSrcweir             {
193cdf0e10cSrcweir                 (void)rException;
194cdf0e10cSrcweir             }
195cdf0e10cSrcweir 
196cdf0e10cSrcweir             return aIcon;
197cdf0e10cSrcweir         }
198cdf0e10cSrcweir 
199cdf0e10cSrcweir 
200cdf0e10cSrcweir     }
201cdf0e10cSrcweir 
202cdf0e10cSrcweir 	//====================================================================
203cdf0e10cSrcweir 	//= OpenButton
204cdf0e10cSrcweir 	//====================================================================
205cdf0e10cSrcweir 	//--------------------------------------------------------------------
OpenDocumentButton(Window * _pParent,const sal_Char * _pAsciiModuleName,const ResId & _rResId)206cdf0e10cSrcweir     OpenDocumentButton::OpenDocumentButton( Window* _pParent, const sal_Char* _pAsciiModuleName, const ResId& _rResId )
207cdf0e10cSrcweir         :PushButton( _pParent, _rResId )
208cdf0e10cSrcweir     {
209cdf0e10cSrcweir         impl_init( _pAsciiModuleName );
210cdf0e10cSrcweir     }
211cdf0e10cSrcweir 
212cdf0e10cSrcweir     //--------------------------------------------------------------------
impl_init(const sal_Char * _pAsciiModuleName)213cdf0e10cSrcweir     void OpenDocumentButton::impl_init( const sal_Char* _pAsciiModuleName )
214cdf0e10cSrcweir     {
215cdf0e10cSrcweir         DBG_ASSERT( _pAsciiModuleName, "OpenDocumentButton::impl_init: invalid module name!" );
216cdf0e10cSrcweir         m_sModule = ::rtl::OUString::createFromAscii( _pAsciiModuleName );
217cdf0e10cSrcweir 
218cdf0e10cSrcweir         // our label should equal the UI text of the "Open" command
219cdf0e10cSrcweir         String sLabel( GetCommandText( ".uno:Open", m_sModule ) );
220cdf0e10cSrcweir         sLabel.SearchAndReplaceAllAscii( "~", String() );
221cdf0e10cSrcweir         sLabel.Insert( (sal_Unicode)' ', 0 );
222cdf0e10cSrcweir         SetText( sLabel );
223cdf0e10cSrcweir 
224cdf0e10cSrcweir         // Place icon left of text and both centered in the button.
225cdf0e10cSrcweir         SetModeImage( GetCommandIcon( ".uno:Open", m_sModule ), BMP_COLOR_NORMAL );
226cdf0e10cSrcweir         EnableImageDisplay( sal_True );
227cdf0e10cSrcweir         EnableTextDisplay( sal_True );
228cdf0e10cSrcweir         SetImageAlign( IMAGEALIGN_LEFT );
229cdf0e10cSrcweir         SetStyle( GetStyle() | WB_CENTER );
230cdf0e10cSrcweir     }
231cdf0e10cSrcweir 
232cdf0e10cSrcweir 	//====================================================================
233cdf0e10cSrcweir 	//= OpenDocumentListBox
234cdf0e10cSrcweir 	//====================================================================
235cdf0e10cSrcweir     //--------------------------------------------------------------------
OpenDocumentListBox(Window * _pParent,const sal_Char * _pAsciiModuleName,const ResId & _rResId)236cdf0e10cSrcweir     OpenDocumentListBox::OpenDocumentListBox( Window* _pParent, const sal_Char* _pAsciiModuleName, const ResId& _rResId )
237cdf0e10cSrcweir         :ListBox( _pParent, _rResId )
238cdf0e10cSrcweir     {
239cdf0e10cSrcweir         impl_init( _pAsciiModuleName );
240cdf0e10cSrcweir     }
241cdf0e10cSrcweir 
242cdf0e10cSrcweir     //--------------------------------------------------------------------
impl_init(const sal_Char * _pAsciiModuleName)243cdf0e10cSrcweir     void OpenDocumentListBox::impl_init( const sal_Char* _pAsciiModuleName )
244cdf0e10cSrcweir     {
245cdf0e10cSrcweir         DBG_ASSERT( _pAsciiModuleName, "OpenDocumentListBox::impl_init: invalid module name!" );
246cdf0e10cSrcweir 
247cdf0e10cSrcweir         Sequence< Sequence< PropertyValue> > aHistory = SvtHistoryOptions().GetList( ePICKLIST );
248cdf0e10cSrcweir         Reference< XNameAccess > xFilterFactory;
249cdf0e10cSrcweir         xFilterFactory = xFilterFactory.query( ::comphelper::getProcessServiceFactory()->createInstance(
250cdf0e10cSrcweir             ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.FilterFactory" ) ) ) );
251cdf0e10cSrcweir 
252cdf0e10cSrcweir         sal_uInt32 nCount = aHistory.getLength();
253cdf0e10cSrcweir         for ( sal_uInt32 nItem = 0; nItem < nCount; ++nItem )
254cdf0e10cSrcweir         {
255cdf0e10cSrcweir             try
256cdf0e10cSrcweir             {
257cdf0e10cSrcweir                 //  Get the current history item's properties.
258cdf0e10cSrcweir                 ::comphelper::SequenceAsHashMap aItemProperties( aHistory[ nItem ] );
259cdf0e10cSrcweir                 ::rtl::OUString sURL = aItemProperties.getUnpackedValueOrDefault( HISTORY_PROPERTYNAME_URL, ::rtl::OUString() );
260cdf0e10cSrcweir                 ::rtl::OUString sFilter = aItemProperties.getUnpackedValueOrDefault( HISTORY_PROPERTYNAME_FILTER, ::rtl::OUString() );
261cdf0e10cSrcweir                 String          sTitle = aItemProperties.getUnpackedValueOrDefault( HISTORY_PROPERTYNAME_TITLE, ::rtl::OUString() );
262cdf0e10cSrcweir                 ::rtl::OUString sPassword = aItemProperties.getUnpackedValueOrDefault( HISTORY_PROPERTYNAME_PASSWORD, ::rtl::OUString() );
263cdf0e10cSrcweir 
264cdf0e10cSrcweir                 //  If the entry is an impress file then insert it into the
265cdf0e10cSrcweir                 //  history list and the list box.
266cdf0e10cSrcweir                 Sequence< PropertyValue > aProps;
267cdf0e10cSrcweir                 xFilterFactory->getByName( sFilter ) >>= aProps;
268cdf0e10cSrcweir 
269cdf0e10cSrcweir                 ::comphelper::SequenceAsHashMap aFilterProperties( aProps );
270cdf0e10cSrcweir                 ::rtl::OUString sDocumentService = aFilterProperties.getUnpackedValueOrDefault(
271cdf0e10cSrcweir                     ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DocumentService" ) ), ::rtl::OUString() );
272cdf0e10cSrcweir                 if ( sDocumentService.equalsAscii( _pAsciiModuleName ) )
273cdf0e10cSrcweir                 {
274cdf0e10cSrcweir                     // yes, it's a Base document
275cdf0e10cSrcweir                     INetURLObject aURL;
276cdf0e10cSrcweir                     aURL.SetSmartURL( sURL );
277cdf0e10cSrcweir                     // The password is set only when it is not empty.
278cdf0e10cSrcweir                     if ( sPassword.getLength() > 0 )
279cdf0e10cSrcweir                         aURL.SetPass( sPassword );
280cdf0e10cSrcweir 
281cdf0e10cSrcweir                     if ( !sTitle.Len() )
282cdf0e10cSrcweir                         sTitle = aURL.getBase( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_UNAMBIGUOUS );
283cdf0e10cSrcweir 
284cdf0e10cSrcweir                     String sDecodedURL = aURL.GetMainURL( INetURLObject::NO_DECODE );
285cdf0e10cSrcweir 
286cdf0e10cSrcweir                     sal_uInt16 nPos = InsertEntry( sTitle );
287cdf0e10cSrcweir                     m_aURLs.insert( MapIndexToStringPair::value_type( nPos, StringPair( sDecodedURL, sFilter ) ) );
288cdf0e10cSrcweir                 }
289cdf0e10cSrcweir             }
290cdf0e10cSrcweir             catch( Exception& rException )
291cdf0e10cSrcweir             {
292cdf0e10cSrcweir                 (void)rException;
293cdf0e10cSrcweir             }
294cdf0e10cSrcweir         }
295cdf0e10cSrcweir     }
296cdf0e10cSrcweir 
297cdf0e10cSrcweir     //--------------------------------------------------------------------
GetSelectedDocumentURL() const298cdf0e10cSrcweir     String OpenDocumentListBox::GetSelectedDocumentURL() const
299cdf0e10cSrcweir     {
300cdf0e10cSrcweir         String sURL;
301cdf0e10cSrcweir         sal_uInt16 nSelected = GetSelectEntryPos();
302cdf0e10cSrcweir         if ( LISTBOX_ENTRY_NOTFOUND != GetSelectEntryPos() )
303cdf0e10cSrcweir             sURL = impl_getDocumentAtIndex( nSelected ).first;
304cdf0e10cSrcweir         return sURL;
305cdf0e10cSrcweir     }
306cdf0e10cSrcweir 
307cdf0e10cSrcweir     //--------------------------------------------------------------------
GetSelectedDocumentFilter() const308cdf0e10cSrcweir     String OpenDocumentListBox::GetSelectedDocumentFilter() const
309cdf0e10cSrcweir     {
310cdf0e10cSrcweir         String sFilter;
311cdf0e10cSrcweir         sal_uInt16 nSelected = GetSelectEntryPos();
312cdf0e10cSrcweir         if ( LISTBOX_ENTRY_NOTFOUND != GetSelectEntryPos() )
313cdf0e10cSrcweir             sFilter = impl_getDocumentAtIndex( nSelected ).second;
314cdf0e10cSrcweir         return sFilter;
315cdf0e10cSrcweir     }
316cdf0e10cSrcweir 
317cdf0e10cSrcweir     //--------------------------------------------------------------------
impl_getDocumentAtIndex(sal_uInt16 _nListIndex,bool _bSystemNotation) const318cdf0e10cSrcweir     OpenDocumentListBox::StringPair OpenDocumentListBox::impl_getDocumentAtIndex( sal_uInt16 _nListIndex, bool _bSystemNotation ) const
319cdf0e10cSrcweir     {
320cdf0e10cSrcweir         MapIndexToStringPair::const_iterator pos = m_aURLs.find( _nListIndex );
321cdf0e10cSrcweir         DBG_ASSERT( pos != m_aURLs.end(), "OpenDocumentListBox::impl_getDocumentAtIndex: invalid index!" );
322cdf0e10cSrcweir 
323cdf0e10cSrcweir         StringPair aDocumentDescriptor;
324cdf0e10cSrcweir         if ( pos != m_aURLs.end() )
325cdf0e10cSrcweir         {
326cdf0e10cSrcweir             aDocumentDescriptor = pos->second;
327cdf0e10cSrcweir             if ( _bSystemNotation && aDocumentDescriptor.first.Len() )
328cdf0e10cSrcweir             {
329cdf0e10cSrcweir                 ::svt::OFileNotation aNotation( aDocumentDescriptor.first );
330cdf0e10cSrcweir                 aDocumentDescriptor.first = aNotation.get( ::svt::OFileNotation::N_SYSTEM );
331cdf0e10cSrcweir             }
332cdf0e10cSrcweir         }
333cdf0e10cSrcweir         return aDocumentDescriptor;
334cdf0e10cSrcweir     }
335cdf0e10cSrcweir 
336cdf0e10cSrcweir     //--------------------------------------------------------------------
RequestHelp(const HelpEvent & _rHEvt)337cdf0e10cSrcweir     void  OpenDocumentListBox::RequestHelp( const HelpEvent& _rHEvt )
338cdf0e10cSrcweir     {
339cdf0e10cSrcweir 	    if( !( _rHEvt.GetMode() & HELPMODE_QUICK ) )
340cdf0e10cSrcweir             return;
341cdf0e10cSrcweir         if ( !IsEnabled() )
342cdf0e10cSrcweir             return;
343cdf0e10cSrcweir 
344cdf0e10cSrcweir         Point aRequestPos( ScreenToOutputPixel( _rHEvt.GetMousePosPixel() ) );
345cdf0e10cSrcweir         sal_uInt16 nItemIndex = LISTBOX_ENTRY_NOTFOUND;
346cdf0e10cSrcweir         if ( GetIndexForPoint( aRequestPos, nItemIndex ) != -1 )
347cdf0e10cSrcweir         {
348cdf0e10cSrcweir             Rectangle aItemRect( GetBoundingRectangle( nItemIndex ) );
349cdf0e10cSrcweir             aItemRect = Rectangle(
350cdf0e10cSrcweir                 OutputToScreenPixel( aItemRect.TopLeft() ),
351cdf0e10cSrcweir                 OutputToScreenPixel( aItemRect.BottomRight() ) );
352cdf0e10cSrcweir             String sHelpText = impl_getDocumentAtIndex( nItemIndex, true ).first;
353cdf0e10cSrcweir             Help::ShowQuickHelp( this, aItemRect, sHelpText, QUICKHELP_LEFT | QUICKHELP_VCENTER );
354cdf0e10cSrcweir         }
355cdf0e10cSrcweir     }
356cdf0e10cSrcweir 
357cdf0e10cSrcweir //........................................................................
358cdf0e10cSrcweir } // namespace dbaui
359cdf0e10cSrcweir //........................................................................
360