diff options
author | Michael Stahl <mstahl@redhat.com> | 2012-11-21 22:21:40 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-11-22 12:10:30 +0100 |
commit | 117fdb9898dcc379b4f83437e858c57fd1d11911 (patch) | |
tree | 809d9346dd75a6317f9f726a27b06807781c86e0 /svtools | |
parent | fe3303b3dce8f4cecf15b859c465ced6ff547386 (diff) |
convert users of XDocumentInfo to XDocumentProperties
Change-Id: I10f395f90d554d0ec26fe9f2654ae839e21c7ee5
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/contnr/contentenumeration.cxx | 25 | ||||
-rw-r--r-- | svtools/source/contnr/contentenumeration.hxx | 7 |
2 files changed, 15 insertions, 17 deletions
diff --git a/svtools/source/contnr/contentenumeration.cxx b/svtools/source/contnr/contentenumeration.cxx index c317a233abdc..766221a5badc 100644 --- a/svtools/source/contnr/contentenumeration.cxx +++ b/svtools/source/contnr/contentenumeration.cxx @@ -29,6 +29,7 @@ #include <com/sun/star/ucb/XContentAccess.hpp> #include <com/sun/star/util/DateTime.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/document/DocumentProperties.hpp> #include <comphelper/processfactory.hxx> #include <tools/debug.hxx> #include <vcl/svapp.hxx> @@ -71,6 +72,8 @@ namespace svt using ::com::sun::star::ucb::XContentAccess; using ::com::sun::star::ucb::XCommandEnvironment; using ::com::sun::star::beans::XPropertySet; + using ::com::sun::star::beans::PropertyValue; + using ::com::sun::star::document::DocumentProperties; using ::rtl::OUString; using ::ucbhelper::ResultSetInclude; using ::ucbhelper::INCLUDE_FOLDERS_AND_DOCUMENTS; @@ -379,26 +382,20 @@ namespace svt try { ::osl::MutexGuard aGuard( m_aMutex ); - if( !m_xDocInfo.is() ) + if (!m_xDocProps.is()) { - m_xDocInfo = m_xDocInfo.query( - ::comphelper::getProcessServiceFactory()->createInstance( - String( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.StandaloneDocumentInfo") ) - ) - ); + m_xDocProps.set(DocumentProperties::create( + ::comphelper::getProcessComponentContext())); } - DBG_ASSERT( m_xDocInfo.is(), "FileViewContentEnumerator::implGetDocTitle: no DocumentProperties service!" ); - if ( !m_xDocInfo.is() ) + assert(m_xDocProps.is()); + if (!m_xDocProps.is()) return sal_False; - m_xDocInfo->loadFromURL( _rTargetURL ); - Reference< XPropertySet > xPropSet( m_xDocInfo, UNO_QUERY ); + m_xDocProps->loadFromMedium(_rTargetURL, Sequence<PropertyValue>()); - Any aAny = xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" )) ); - - OUString sTitle; - if ( ( aAny >>= sTitle ) && !sTitle.isEmpty() ) + OUString const sTitle(m_xDocProps->getTitle()); + if (!sTitle.isEmpty()) { _rRet = sTitle; bRet = sal_True; diff --git a/svtools/source/contnr/contentenumeration.hxx b/svtools/source/contnr/contentenumeration.hxx index 8188bde91f59..775f2a661f25 100644 --- a/svtools/source/contnr/contentenumeration.hxx +++ b/svtools/source/contnr/contentenumeration.hxx @@ -21,7 +21,7 @@ #define SVTOOLS_SOURCE_CONTNR_CONTENTENUMERATION_HXX #include <com/sun/star/ucb/XCommandEnvironment.hpp> -#include <com/sun/star/document/XStandaloneDocumentInfo.hpp> +#include <com/sun/star/document/XDocumentProperties.hpp> #include <salhelper/thread.hxx> #include <ucbhelper/content.hxx> #include <rtl/ustring.hxx> @@ -198,8 +198,9 @@ namespace svt IEnumerationResultHandler* m_pResultHandler; bool m_bCancelled; - mutable ::com::sun::star::uno::Reference< ::com::sun::star::document::XStandaloneDocumentInfo > - m_xDocInfo; + mutable ::com::sun::star::uno::Reference< + ::com::sun::star::document::XDocumentProperties> + m_xDocProps; ::com::sun::star::uno::Sequence< ::rtl::OUString > m_rBlackList; |