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