fltdlg.cxx (86e1cf34) fltdlg.cxx (7a164331)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 124 unchanged lines hidden (view full) ---

133 }
134}
135
136/*-************************************************************************************************************//**
137 @short ask user for his decision
138 @descr We show the dialog and if user finish it with "OK" - we try to find selected item in internal saved
139 name list (which you must set in "ChangeFilters()"!). If we return sal_True as result, you can use out
140 parameter "pSelectedItem" as pointer into your FilterNameList to get selected item really ...
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 124 unchanged lines hidden (view full) ---

133 }
134}
135
136/*-************************************************************************************************************//**
137 @short ask user for his decision
138 @descr We show the dialog and if user finish it with "OK" - we try to find selected item in internal saved
139 name list (which you must set in "ChangeFilters()"!). If we return sal_True as result, you can use out
140 parameter "pSelectedItem" as pointer into your FilterNameList to get selected item really ...
141 but if we return sal_False ... user hsa cancel the dialog ... you shouldn't do that. pSelectedItem isn't
141 but if we return sal_False ... user has canceled the dialog ... you shouldn't do that. pSelectedItem isn't
142 set to any valid value then. We don't change them ...
143
144 @seealso method ChangeFilters()
145
146 @param "pSelectedItem", returns result of selection as pointer into set list of filter names
147 (valid for function return sal_True only!)
148 @return true => pSelectedItem parameter points into name list and represent use decision
142 set to any valid value then. We don't change them ...
143
144 @seealso method ChangeFilters()
145
146 @param "pSelectedItem", returns result of selection as pointer into set list of filter names
147 (valid for function return sal_True only!)
148 @return true => pSelectedItem parameter points into name list and represent use decision
149 false => use has cancelled dialog (pSelectedItem isn't valid then!)
149 false => use has canceled dialog (pSelectedItem isn't valid then!)
150
151 @onerror We return false ... but don't change pSelectedItem!
152 @threadsafe no
153*//*-*************************************************************************************************************/
154bool FilterDialog::AskForFilter( FilterNameListPtr& pSelectedItem )
155{
156 bool bSelected = sal_False;
157

--- 45 unchanged lines hidden (view full) ---

203 return (sal_Int32)(m_pDevice->GetTextWidth(String(sString)));
204 }
205
206 private:
207 const OutputDevice* m_pDevice;
208};
209
210/*-************************************************************************************************************//**
150
151 @onerror We return false ... but don't change pSelectedItem!
152 @threadsafe no
153*//*-*************************************************************************************************************/
154bool FilterDialog::AskForFilter( FilterNameListPtr& pSelectedItem )
155{
156 bool bSelected = sal_False;
157

--- 45 unchanged lines hidden (view full) ---

203 return (sal_Int32)(m_pDevice->GetTextWidth(String(sString)));
204 }
205
206 private:
207 const OutputDevice* m_pDevice;
208};
209
210/*-************************************************************************************************************//**
211 @short try to build short name of given URL to show it n GUI
211 @short try to build short name of given URL to show it in GUI
212 @descr We detect type of given URL automatically and build this short name depend on this type ...
212 @descr We detect type of given URL automatically and build this short name depend on this type ...
213 If we couldnt make it right we return full given string without any changes ...
213 If we couldn't make it right we return full given string without any changes ...
214
215 @seealso class LocalFileHelper
216 @seealso method InetURLObject::getAbbreviated()
217
218 @param "sName", file name
219 @return A short file name ...
220
221 @onerror We return given name without any changes.
222 @threadsafe no
223*//*-*************************************************************************************************************/
224String FilterDialog::impl_buildUIFileName( const String& sName )
225{
226 String sShortName( sName );
227
228 if( ::utl::LocalFileHelper::ConvertURLToSystemPath( sName, sShortName ) == sal_True )
229 {
214
215 @seealso class LocalFileHelper
216 @seealso method InetURLObject::getAbbreviated()
217
218 @param "sName", file name
219 @return A short file name ...
220
221 @onerror We return given name without any changes.
222 @threadsafe no
223*//*-*************************************************************************************************************/
224String FilterDialog::impl_buildUIFileName( const String& sName )
225{
226 String sShortName( sName );
227
228 if( ::utl::LocalFileHelper::ConvertURLToSystemPath( sName, sShortName ) == sal_True )
229 {
230 // its a system file ... build short name by using osl functionality
230 // it's a system file ... build short name by using osl functionality
231 }
232 else
233 {
234 // otherwise its really a url ... build short name by using INetURLObject
235 ::com::sun::star::uno::Reference< ::com::sun::star::util::XStringWidth > xStringCalculator( new StringCalculator(&m_ftURL) );
236 if( xStringCalculator.is() == sal_True )
237 {
238 INetURLObject aBuilder ( sName );
239 Size aSize = m_ftURL.GetOutputSize();
240 sShortName = aBuilder.getAbbreviated( xStringCalculator, aSize.Width(), INetURLObject::DECODE_UNAMBIGUOUS );
241 }
242 }
243
244 return sShortName;
245}
246
247} // namespace uui
231 }
232 else
233 {
234 // otherwise its really a url ... build short name by using INetURLObject
235 ::com::sun::star::uno::Reference< ::com::sun::star::util::XStringWidth > xStringCalculator( new StringCalculator(&m_ftURL) );
236 if( xStringCalculator.is() == sal_True )
237 {
238 INetURLObject aBuilder ( sName );
239 Size aSize = m_ftURL.GetOutputSize();
240 sShortName = aBuilder.getAbbreviated( xStringCalculator, aSize.Width(), INetURLObject::DECODE_UNAMBIGUOUS );
241 }
242 }
243
244 return sShortName;
245}
246
247} // namespace uui