summaryrefslogtreecommitdiff
path: root/ucb/source
diff options
context:
space:
mode:
Diffstat (limited to 'ucb/source')
-rw-r--r--ucb/source/ucp/tdoc/tdoc_docmgr.cxx17
-rw-r--r--ucb/source/ucp/tdoc/tdoc_docmgr.hxx4
2 files changed, 15 insertions, 6 deletions
diff --git a/ucb/source/ucp/tdoc/tdoc_docmgr.cxx b/ucb/source/ucp/tdoc/tdoc_docmgr.cxx
index 0e11f546bb1e..39fa5bc828b5 100644
--- a/ucb/source/ucp/tdoc/tdoc_docmgr.cxx
+++ b/ucb/source/ucp/tdoc/tdoc_docmgr.cxx
@@ -556,13 +556,20 @@ void OfficeDocumentsManager::updateStreamDateModified(OUString const & uri) {
bool OfficeDocumentsManager::isDocumentPreview(
- const uno::Reference< frame::XModel > & xModel )
+ const uno::Reference< frame::XModel3 > & xModel )
{
if ( !xModel.is() )
return false;
- bool bIsPreview = ::comphelper::NamedValueCollection::getOrDefault( xModel->getArgs(), u"Preview", false );
- return bIsPreview;
+ uno::Sequence<beans::PropertyValue> props = xModel->getArgs2( { "Preview" } );
+ for (const auto & rProp : props)
+ if (rProp.Name == "Preview")
+ {
+ bool bIsPreview = false;
+ rProp.Value >>= bIsPreview;
+ return bIsPreview;
+ }
+ return false;
}
@@ -664,11 +671,13 @@ bool OfficeDocumentsManager::isOfficeDocument(
xStorageBasedDoc( xModel, uno::UNO_QUERY );
if ( !xStorageBasedDoc.is() )
return false;
+ uno::Reference< frame::XModel3 > xModel3( xDoc, uno::UNO_QUERY );
+ assert(xModel3 && "anything implementing frame:XModel is expected to implement XModel3 as well");
if ( !isWithoutOrInTopLevelFrame( xModel ) )
return false;
- if ( isDocumentPreview( xModel ) )
+ if ( isDocumentPreview( xModel3 ) )
return false;
if ( isHelpDocument( xModel ) )
diff --git a/ucb/source/ucp/tdoc/tdoc_docmgr.hxx b/ucb/source/ucp/tdoc/tdoc_docmgr.hxx
index 8daf9eba60e4..7115d0fe8e99 100644
--- a/ucb/source/ucp/tdoc/tdoc_docmgr.hxx
+++ b/ucb/source/ucp/tdoc/tdoc_docmgr.hxx
@@ -25,7 +25,7 @@
#include <com/sun/star/document/XDocumentEventListener.hpp>
#include <com/sun/star/embed/XStorage.hpp>
-#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/frame/XModel3.hpp>
#include <com/sun/star/frame/XModuleManager2.hpp>
#include <com/sun/star/frame/XGlobalEventBroadcaster.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
@@ -133,7 +133,7 @@ namespace tdoc_ucp {
const css::uno::Reference< css::uno::XInterface > & xDoc );
static bool isDocumentPreview(
- const css::uno::Reference< css::frame::XModel > & xModel );
+ const css::uno::Reference< css::frame::XModel3 > & xModel );
static bool isWithoutOrInTopLevelFrame(
const css::uno::Reference< css::frame::XModel > & xModel );