1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "sal/config.h"
24 #include "dp_backend.h"
26 #include "rtl/ustring.hxx"
27 #include "rtl/uri.hxx"
28 #include "rtl/bootstrap.hxx"
29 #include "osl/file.hxx"
30 #include "cppuhelper/exc_hlp.hxx"
31 #include "comphelper/servicedecl.hxx"
32 #include "comphelper/unwrapargs.hxx"
33 #include "ucbhelper/content.hxx"
34 #include "com/sun/star/lang/WrappedTargetRuntimeException.hpp"
35 #include "com/sun/star/deployment/InvalidRemovedParameterException.hpp"
36 #include "com/sun/star/deployment/thePackageManagerFactory.hpp"
37 #include "com/sun/star/ucb/InteractiveAugmentedIOException.hpp"
38 #include "com/sun/star/ucb/IOErrorCode.hpp"
39 #include "com/sun/star/beans/StringPair.hpp"
40 #include "com/sun/star/sdbc/XResultSet.hpp"
41 #include "com/sun/star/sdbc/XRow.hpp"
42 #include "unotools/tempfile.hxx"
45 using namespace ::dp_misc
;
46 using namespace ::com::sun::star
;
47 using namespace ::com::sun::star::uno
;
48 using namespace ::com::sun::star::ucb
;
50 namespace dp_registry
{
53 //______________________________________________________________________________
54 PackageRegistryBackend::~PackageRegistryBackend()
58 //______________________________________________________________________________
59 void PackageRegistryBackend::disposing( lang::EventObject
const & event
)
60 throw (RuntimeException
)
62 Reference
<deployment::XPackage
> xPackage(
63 event
.Source
, UNO_QUERY_THROW
);
64 OUString
url( xPackage
->getURL() );
65 ::osl::MutexGuard
guard( getMutex() );
66 if ( m_bound
.erase( url
) != 1 )
68 SAL_WARN("desktop.deployment", "erase(" << url
<< ") != 1");
72 //______________________________________________________________________________
73 PackageRegistryBackend::PackageRegistryBackend(
74 Sequence
<Any
> const & args
,
75 Reference
<XComponentContext
> const & xContext
)
76 : t_BackendBase( getMutex() ),
77 m_xComponentContext( xContext
),
78 m_eContext( CONTEXT_UNKNOWN
),
81 assert(xContext
.is());
82 boost::optional
<OUString
> cachePath
;
83 boost::optional
<bool> readOnly
;
84 comphelper::unwrapArgs( args
, m_context
, cachePath
, readOnly
);
86 m_cachePath
= *cachePath
;
88 m_readOnly
= *readOnly
;
90 if ( m_context
== "user" )
91 m_eContext
= CONTEXT_USER
;
92 else if ( m_context
== "shared" )
93 m_eContext
= CONTEXT_SHARED
;
94 else if ( m_context
== "bundled" )
95 m_eContext
= CONTEXT_BUNDLED
;
96 else if ( m_context
== "tmp" )
97 m_eContext
= CONTEXT_TMP
;
98 else if (m_context
.matchIgnoreAsciiCase("vnd.sun.star.tdoc:/"))
99 m_eContext
= CONTEXT_DOCUMENT
;
101 m_eContext
= CONTEXT_UNKNOWN
;
104 //______________________________________________________________________________
105 void PackageRegistryBackend::check()
107 ::osl::MutexGuard
guard( getMutex() );
108 if (rBHelper
.bInDispose
|| rBHelper
.bDisposed
) {
109 throw lang::DisposedException(
110 "PackageRegistryBackend instance has already been disposed!",
111 static_cast<OWeakObject
*>(this) );
115 //______________________________________________________________________________
116 void PackageRegistryBackend::disposing()
119 for ( t_string2ref::const_iterator i
= m_bound
.begin(); i
!= m_bound
.end(); ++i
)
120 i
->second
->removeEventListener(this);
122 m_xComponentContext
.clear();
123 WeakComponentImplHelperBase::disposing();
125 catch (const RuntimeException
&) {
128 catch (const Exception
&) {
129 Any
exc( ::cppu::getCaughtException() );
130 throw lang::WrappedTargetRuntimeException(
131 "caught unexpected exception while disposing!",
132 static_cast<OWeakObject
*>(this), exc
);
137 //______________________________________________________________________________
138 Reference
<deployment::XPackage
> PackageRegistryBackend::bindPackage(
139 OUString
const & url
, OUString
const & mediaType
, sal_Bool bRemoved
,
140 OUString
const & identifier
, Reference
<XCommandEnvironment
> const & xCmdEnv
)
141 throw (deployment::DeploymentException
,
142 deployment::InvalidRemovedParameterException
,
143 ucb::CommandFailedException
,
144 lang::IllegalArgumentException
, RuntimeException
)
146 ::osl::ResettableMutexGuard
guard( getMutex() );
149 t_string2ref::const_iterator
const iFind( m_bound
.find( url
) );
150 if (iFind
!= m_bound
.end())
152 Reference
<deployment::XPackage
> xPackage( iFind
->second
);
155 if (!mediaType
.isEmpty() &&
156 mediaType
!= xPackage
->getPackageType()->getMediaType())
157 throw lang::IllegalArgumentException
158 ("XPackageRegistry::bindPackage: media type does not match",
159 static_cast<OWeakObject
*>(this), 1);
160 if (xPackage
->isRemoved() != bRemoved
)
161 throw deployment::InvalidRemovedParameterException(
162 "XPackageRegistry::bindPackage: bRemoved parameter does not match",
163 static_cast<OWeakObject
*>(this), xPackage
->isRemoved(), xPackage
);
170 Reference
<deployment::XPackage
> xNewPackage
;
172 xNewPackage
= bindPackage_( url
, mediaType
, bRemoved
,
173 identifier
, xCmdEnv
);
175 catch (const RuntimeException
&) {
178 catch (const CommandFailedException
&) {
181 catch (const deployment::DeploymentException
&) {
184 catch (const Exception
&) {
185 Any
exc( ::cppu::getCaughtException() );
186 throw deployment::DeploymentException(
187 "Error binding package: " + url
,
188 static_cast<OWeakObject
*>(this), exc
);
193 ::std::pair
< t_string2ref::iterator
, bool > insertion(
194 m_bound
.insert( t_string2ref::value_type( url
, xNewPackage
) ) );
195 if (insertion
.second
)
198 Reference
<XInterface
>(insertion
.first
->second
) != xNewPackage
,
199 "desktop.deployment", "mismatch");
202 { // found existing entry
203 Reference
<deployment::XPackage
> xPackage( insertion
.first
->second
);
206 insertion
.first
->second
= xNewPackage
;
210 xNewPackage
->addEventListener( this ); // listen for disposing events
214 OUString
PackageRegistryBackend::createFolder(
215 OUString
const & relUrl
,
216 Reference
<ucb::XCommandEnvironment
> const & xCmdEnv
)
218 const OUString sDataFolder
= makeURL(getCachePath(), relUrl
);
219 //make sure the folder exist
220 ucbhelper::Content dataContent
;
221 ::dp_misc::create_folder(&dataContent
, sDataFolder
, xCmdEnv
);
223 const String
baseDir(sDataFolder
);
224 const ::utl::TempFile
aTemp(&baseDir
, sal_True
);
225 const OUString url
= aTemp
.GetURL();
226 return sDataFolder
+ url
.copy(url
.lastIndexOf('/'));
229 //folderURL can have the extension .tmp or .tmp_
230 //Before OOo 3.4 the created a tmp file with osl_createTempFile and
231 //then created a Folder with a same name and a trailing '_'
232 //If the folderURL has no '_' then there is no corresponding tmp file.
233 void PackageRegistryBackend::deleteTempFolder(
234 OUString
const & folderUrl
)
236 if (!folderUrl
.isEmpty())
238 erase_path( folderUrl
, Reference
<XCommandEnvironment
>(),
239 false /* no throw: ignore errors */ );
241 if (folderUrl
[folderUrl
.getLength() - 1] == '_')
243 const OUString tempFile
= folderUrl
.copy(0, folderUrl
.getLength() - 1);
244 erase_path( tempFile
, Reference
<XCommandEnvironment
>(),
245 false /* no throw: ignore errors */ );
250 //usedFolders can contain folder names which have the extension .tmp or .tmp_
251 //Before OOo 3.4 we created a tmp file with osl_createTempFile and
252 //then created a Folder with a same name and a trailing '_'
253 //If the folderURL has no '_' then there is no corresponding tmp file.
254 void PackageRegistryBackend::deleteUnusedFolders(
255 OUString
const & relUrl
,
256 ::std::list
< OUString
> const & usedFolders
)
260 const OUString sDataFolder
= makeURL(getCachePath(), relUrl
);
261 ::ucbhelper::Content
tempFolder(
262 sDataFolder
, Reference
<ucb::XCommandEnvironment
>(), m_xComponentContext
);
264 Reference
<sdbc::XResultSet
> xResultSet(
265 StrTitle::createCursor( tempFolder
, ::ucbhelper::INCLUDE_FOLDERS_ONLY
) );
267 // get all temp directories:
268 ::std::vector
<OUString
> tempEntries
;
270 const char tmp
[] = ".tmp";
272 while (xResultSet
->next())
275 Reference
<sdbc::XRow
>(
276 xResultSet
, UNO_QUERY_THROW
)->getString(
279 if (title
.endsWith(tmp
))
280 tempEntries
.push_back(
281 makeURLAppendSysPathSegment(sDataFolder
, title
));
284 for ( ::std::size_t pos
= 0; pos
< tempEntries
.size(); ++pos
)
286 if (::std::find( usedFolders
.begin(), usedFolders
.end(), tempEntries
[pos
] ) ==
289 deleteTempFolder(tempEntries
[pos
]);
293 catch (const ucb::InteractiveAugmentedIOException
& e
)
295 //In case the folder containing all the data folder does not
296 //exist yet, we ignore the exception
297 if (e
.Code
!= ucb::IOErrorCode_NOT_EXISTING
)
304 //______________________________________________________________________________
309 //______________________________________________________________________________
310 Package::Package( ::rtl::Reference
<PackageRegistryBackend
> const & myBackend
,
311 OUString
const & url
,
312 OUString
const & rName
,
313 OUString
const & displayName
,
314 Reference
<deployment::XPackageTypeInfo
> const & xPackageType
,
316 OUString
const & identifier
)
317 : t_PackageBase( getMutex() ),
318 m_myBackend( myBackend
),
321 m_displayName( displayName
),
322 m_xPackageType( xPackageType
),
323 m_bRemoved(bRemoved
),
324 m_identifier(identifier
)
328 //We use the last segment of the URL
330 !m_name
.isEmpty(), "desktop.deployment", "non-empty m_name");
331 OUString name
= m_url
;
332 rtl::Bootstrap::expandMacros(name
);
333 sal_Int32 index
= name
.lastIndexOf('/');
334 if (index
!= -1 && index
< name
.getLength())
335 m_name
= name
.copy(index
+ 1);
339 //______________________________________________________________________________
340 void Package::disposing()
343 WeakComponentImplHelperBase::disposing();
346 //______________________________________________________________________________
347 void Package::check() const
349 ::osl::MutexGuard
guard( getMutex() );
350 if (rBHelper
.bInDispose
|| rBHelper
.bDisposed
) {
351 throw lang::DisposedException(
352 "Package instance has already been disposed!",
353 static_cast<OWeakObject
*>(const_cast<Package
*>(this)));
358 //______________________________________________________________________________
359 void Package::dispose() throw (RuntimeException
)
361 //Do not call check here. We must not throw an exception here if the object
362 //is being disposed or is already disposed. See com.sun.star.lang.XComponent
363 WeakComponentImplHelperBase::dispose();
366 //______________________________________________________________________________
367 void Package::addEventListener(
368 Reference
<lang::XEventListener
> const & xListener
) throw (RuntimeException
)
370 //Do not call check here. We must not throw an exception here if the object
371 //is being disposed or is already disposed. See com.sun.star.lang.XComponent
372 WeakComponentImplHelperBase::addEventListener( xListener
);
375 //______________________________________________________________________________
376 void Package::removeEventListener(
377 Reference
<lang::XEventListener
> const & xListener
) throw (RuntimeException
)
379 //Do not call check here. We must not throw an exception here if the object
380 //is being disposed or is already disposed. See com.sun.star.lang.XComponent
381 WeakComponentImplHelperBase::removeEventListener( xListener
);
384 // XModifyBroadcaster
385 //______________________________________________________________________________
386 void Package::addModifyListener(
387 Reference
<util::XModifyListener
> const & xListener
)
388 throw (RuntimeException
)
391 rBHelper
.addListener( ::getCppuType( &xListener
), xListener
);
394 //______________________________________________________________________________
395 void Package::removeModifyListener(
396 Reference
<util::XModifyListener
> const & xListener
)
397 throw (RuntimeException
)
400 rBHelper
.removeListener( ::getCppuType( &xListener
), xListener
);
403 //______________________________________________________________________________
404 void Package::checkAborted(
405 ::rtl::Reference
<AbortChannel
> const & abortChannel
)
407 if (abortChannel
.is() && abortChannel
->isAborted()) {
408 throw CommandAbortedException(
409 "abort!", static_cast<OWeakObject
*>(this) );
414 //______________________________________________________________________________
415 Reference
<task::XAbortChannel
> Package::createAbortChannel()
416 throw (RuntimeException
)
419 return new AbortChannel
;
422 //______________________________________________________________________________
423 sal_Bool
Package::isBundle() throw (RuntimeException
)
425 return false; // default
428 //______________________________________________________________________________
429 ::sal_Int32
Package::checkPrerequisites(
430 const css::uno::Reference
< css::task::XAbortChannel
>&,
431 const css::uno::Reference
< css::ucb::XCommandEnvironment
>&,
433 throw (css::deployment::DeploymentException
,
434 css::deployment::ExtensionRemovedException
,
435 css::ucb::CommandFailedException
,
436 css::ucb::CommandAbortedException
,
437 css::uno::RuntimeException
)
440 throw deployment::ExtensionRemovedException();
444 //______________________________________________________________________________
445 ::sal_Bool
Package::checkDependencies(
446 const css::uno::Reference
< css::ucb::XCommandEnvironment
>& )
447 throw (css::deployment::DeploymentException
,
448 css::deployment::ExtensionRemovedException
,
449 css::ucb::CommandFailedException
,
450 css::uno::RuntimeException
)
453 throw deployment::ExtensionRemovedException();
458 //______________________________________________________________________________
459 Sequence
< Reference
<deployment::XPackage
> > Package::getBundle(
460 Reference
<task::XAbortChannel
> const &,
461 Reference
<XCommandEnvironment
> const & )
462 throw (deployment::DeploymentException
,
463 CommandFailedException
, CommandAbortedException
,
464 lang::IllegalArgumentException
, RuntimeException
)
466 return Sequence
< Reference
<deployment::XPackage
> >();
469 //______________________________________________________________________________
470 OUString
Package::getName() throw (RuntimeException
)
475 beans::Optional
<OUString
> Package::getIdentifier() throw (RuntimeException
)
478 return beans::Optional
<OUString
>(true, m_identifier
);
480 return beans::Optional
<OUString
>();
483 //______________________________________________________________________________
484 OUString
Package::getVersion() throw (
485 deployment::ExtensionRemovedException
,
489 throw deployment::ExtensionRemovedException();
493 //______________________________________________________________________________
494 OUString
Package::getURL() throw (RuntimeException
)
499 //______________________________________________________________________________
500 OUString
Package::getDisplayName() throw (
501 deployment::ExtensionRemovedException
, RuntimeException
)
504 throw deployment::ExtensionRemovedException();
505 return m_displayName
;
508 //______________________________________________________________________________
509 OUString
Package::getDescription() throw (
510 deployment::ExtensionRemovedException
,RuntimeException
)
513 throw deployment::ExtensionRemovedException();
517 //______________________________________________________________________________
518 OUString
Package::getLicenseText() throw (
519 deployment::ExtensionRemovedException
,RuntimeException
)
522 throw deployment::ExtensionRemovedException();
526 //______________________________________________________________________________
527 Sequence
<OUString
> Package::getUpdateInformationURLs() throw (
528 deployment::ExtensionRemovedException
, RuntimeException
)
531 throw deployment::ExtensionRemovedException();
532 return Sequence
<OUString
>();
535 //______________________________________________________________________________
536 css::beans::StringPair
Package::getPublisherInfo() throw (
537 deployment::ExtensionRemovedException
, RuntimeException
)
540 throw deployment::ExtensionRemovedException();
541 css::beans::StringPair aEmptyPair
;
545 //______________________________________________________________________________
546 uno::Reference
< css::graphic::XGraphic
> Package::getIcon( sal_Bool
/*bHighContrast*/ )
547 throw (deployment::ExtensionRemovedException
, RuntimeException
)
550 throw deployment::ExtensionRemovedException();
552 uno::Reference
< css::graphic::XGraphic
> aEmpty
;
556 //______________________________________________________________________________
557 Reference
<deployment::XPackageTypeInfo
> Package::getPackageType()
558 throw (RuntimeException
)
560 return m_xPackageType
;
563 //______________________________________________________________________________
564 void Package::exportTo(
565 OUString
const & destFolderURL
, OUString
const & newTitle
,
566 sal_Int32 nameClashAction
, Reference
<XCommandEnvironment
> const & xCmdEnv
)
567 throw (deployment::ExtensionRemovedException
,
568 CommandFailedException
, CommandAbortedException
, RuntimeException
)
571 throw deployment::ExtensionRemovedException();
573 ::ucbhelper::Content
destFolder( destFolderURL
, xCmdEnv
, getMyBackend()->getComponentContext() );
574 ::ucbhelper::Content
sourceContent( getURL(), xCmdEnv
, getMyBackend()->getComponentContext() );
575 if (! destFolder
.transferContent(
576 sourceContent
, ::ucbhelper::InsertOperation_COPY
,
577 newTitle
, nameClashAction
))
578 throw RuntimeException( "UCB transferContent() failed!", 0 );
581 //______________________________________________________________________________
582 void Package::fireModified()
584 ::cppu::OInterfaceContainerHelper
* container
= rBHelper
.getContainer(
585 ::getCppuType( static_cast<Reference
<
586 util::XModifyListener
> const *>(0) ) );
587 if (container
!= 0) {
588 Sequence
< Reference
<XInterface
> > elements(
589 container
->getElements() );
590 lang::EventObject
evt( static_cast<OWeakObject
*>(this) );
591 for ( sal_Int32 pos
= 0; pos
< elements
.getLength(); ++pos
)
593 Reference
<util::XModifyListener
> xListener(
594 elements
[ pos
], UNO_QUERY
);
596 xListener
->modified( evt
);
602 //______________________________________________________________________________
603 beans::Optional
< beans::Ambiguous
<sal_Bool
> > Package::isRegistered(
604 Reference
<task::XAbortChannel
> const & xAbortChannel
,
605 Reference
<XCommandEnvironment
> const & xCmdEnv
)
606 throw (deployment::DeploymentException
,
607 CommandFailedException
, CommandAbortedException
, RuntimeException
)
610 ::osl::ResettableMutexGuard
guard( getMutex() );
611 return isRegistered_( guard
,
612 AbortChannel::get(xAbortChannel
),
615 catch (const RuntimeException
&) {
618 catch (const CommandFailedException
&) {
621 catch (const CommandAbortedException
&) {
624 catch (const deployment::DeploymentException
&) {
627 catch (const Exception
&) {
628 Any
exc( ::cppu::getCaughtException() );
629 throw deployment::DeploymentException(
630 "unexpected exception occurred!",
631 static_cast<OWeakObject
*>(this), exc
);
635 //______________________________________________________________________________
636 void Package::processPackage_impl(
637 bool doRegisterPackage
,
639 Reference
<task::XAbortChannel
> const & xAbortChannel
,
640 Reference
<XCommandEnvironment
> const & xCmdEnv
)
647 ::osl::ResettableMutexGuard
guard( getMutex() );
648 beans::Optional
< beans::Ambiguous
<sal_Bool
> > option(
649 isRegistered_( guard
, AbortChannel::get(xAbortChannel
),
651 action
= (option
.IsPresent
&&
652 (option
.Value
.IsAmbiguous
||
653 (doRegisterPackage
? !option
.Value
.Value
654 : option
.Value
.Value
)));
657 OUString displayName
= isRemoved() ? getName() : getDisplayName();
658 ProgressLevel
progress(
661 ? PackageRegistryBackend::StrRegisteringPackage::get()
662 : PackageRegistryBackend::StrRevokingPackage::get())
664 processPackage_( guard
,
667 AbortChannel::get(xAbortChannel
),
671 catch (lang::IllegalArgumentException
&) {
672 Any
e(cppu::getCaughtException());
673 throw deployment::DeploymentException(
675 ? getResourceString(RID_STR_ERROR_WHILE_REGISTERING
)
676 : getResourceString(RID_STR_ERROR_WHILE_REVOKING
))
678 static_cast< OWeakObject
* >(this), e
);
680 catch (const RuntimeException
&e
) {
682 "desktop.deployment",
683 "unexpected RuntimeException \"" << e
.Message
<< '"');
686 catch (const CommandFailedException
&) {
689 catch (const CommandAbortedException
&) {
692 catch (const deployment::DeploymentException
&) {
695 catch (const Exception
&) {
696 Any
exc( ::cppu::getCaughtException() );
697 throw deployment::DeploymentException(
699 ? getResourceString(RID_STR_ERROR_WHILE_REGISTERING
)
700 : getResourceString(RID_STR_ERROR_WHILE_REVOKING
))
701 + getDisplayName(), static_cast<OWeakObject
*>(this), exc
);
713 //______________________________________________________________________________
714 void Package::registerPackage(
716 Reference
<task::XAbortChannel
> const & xAbortChannel
,
717 Reference
<XCommandEnvironment
> const & xCmdEnv
)
718 throw (deployment::DeploymentException
,
719 deployment::ExtensionRemovedException
,
720 CommandFailedException
, CommandAbortedException
,
721 lang::IllegalArgumentException
, RuntimeException
)
724 throw deployment::ExtensionRemovedException();
725 processPackage_impl( true /* register */, startup
, xAbortChannel
, xCmdEnv
);
728 //______________________________________________________________________________
729 void Package::revokePackage(
731 Reference
<task::XAbortChannel
> const & xAbortChannel
,
732 Reference
<XCommandEnvironment
> const & xCmdEnv
)
733 throw (deployment::DeploymentException
,
734 CommandFailedException
, CommandAbortedException
,
735 lang::IllegalArgumentException
, RuntimeException
)
737 processPackage_impl( false /* revoke */, startup
, xAbortChannel
, xCmdEnv
);
741 PackageRegistryBackend
* Package::getMyBackend() const
743 PackageRegistryBackend
* pBackend
= m_myBackend
.get();
744 if (NULL
== pBackend
)
746 //May throw a DisposedException
748 //We should never get here...
749 throw RuntimeException(
750 "Failed to get the BackendImpl",
751 static_cast<OWeakObject
*>(const_cast<Package
*>(this)));
755 OUString
Package::getRepositoryName()
756 throw (RuntimeException
)
758 PackageRegistryBackend
* backEnd
= getMyBackend();
759 return backEnd
->getContext();
762 beans::Optional
< OUString
> Package::getRegistrationDataURL()
763 throw (deployment::ExtensionRemovedException
,
764 css::uno::RuntimeException
)
767 throw deployment::ExtensionRemovedException();
768 return beans::Optional
<OUString
>();
771 sal_Bool
Package::isRemoved()
772 throw (RuntimeException
)
778 //______________________________________________________________________________
779 Package::TypeInfo::~TypeInfo()
784 //______________________________________________________________________________
785 OUString
Package::TypeInfo::getMediaType() throw (RuntimeException
)
790 //______________________________________________________________________________
791 OUString
Package::TypeInfo::getDescription()
792 throw (deployment::ExtensionRemovedException
, RuntimeException
)
794 return getShortDescription();
797 //______________________________________________________________________________
798 OUString
Package::TypeInfo::getShortDescription()
799 throw (deployment::ExtensionRemovedException
, RuntimeException
)
804 //______________________________________________________________________________
805 OUString
Package::TypeInfo::getFileFilter() throw (RuntimeException
)
810 //______________________________________________________________________________
811 /**************************
814 * @param highContrast NOTE: disabled the returning of high contrast icons.
815 * This bool is a noop now.
816 * @param smallIcon Return the small version of the icon
818 Any
Package::TypeInfo::getIcon( sal_Bool
/*highContrast*/, sal_Bool smallIcon
)
819 throw (RuntimeException
)
823 const sal_uInt16 nIconId
= m_smallIcon
;
824 return Any( &nIconId
, getCppuType( static_cast<sal_uInt16
const *>(0) ) );
830 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */