diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-03-10 15:04:25 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-03-10 17:43:23 +0100 |
commit | 275443f052887f67a6d459d443293690daa3ae24 (patch) | |
tree | 88bc19dba48f4981fbfca98a7741d5381800a01c /writerfilter | |
parent | ac8e83cfb41265c6d8a3f05000e2593bc01494e7 (diff) |
sfx2 classification: merge common code from sw and writerfilter
The two versions were almost a duplicate.
Change-Id: I3148150d62484a55fc8d59ca354998f211435c0b
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 38 |
1 files changed, 2 insertions, 36 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index c51ea1407fc8..021d802b8f4f 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -5131,39 +5131,6 @@ bool lcl_containsProperty(const uno::Sequence<beans::Property>& rProperties, con }) != rProperties.end(); } -namespace -{ - -RTFError lcl_checkClassification(const uno::Reference<document::XDocumentProperties>& xSource, const uno::Reference<document::XDocumentProperties>& xDestination) -{ - switch (SfxClassificationHelper::CheckPaste(xSource, xDestination)) - { - case SfxClassificationCheckPasteResult::None: - { - return RTFError::OK; - } - break; - case SfxClassificationCheckPasteResult::TargetDocNotClassified: - { - if (!Application::IsHeadlessModeEnabled()) - ScopedVclPtrInstance<MessageDialog>::Create(nullptr, SfxResId(STR_TARGET_DOC_NOT_CLASSIFIED), VCL_MESSAGE_INFO)->Execute(); - return RTFError::CLASSIFICATION; - } - break; - case SfxClassificationCheckPasteResult::DocClassificationTooLow: - { - if (!Application::IsHeadlessModeEnabled()) - ScopedVclPtrInstance<MessageDialog>::Create(nullptr, SfxResId(STR_DOC_CLASSIFICATION_TOO_LOW), VCL_MESSAGE_INFO)->Execute(); - return RTFError::CLASSIFICATION; - } - break; - } - - return RTFError::OK; -} - -} - RTFError RTFDocumentImpl::popState() { //SAL_INFO("writerfilter", OSL_THIS_FUNC << " before pop: m_pTokenizer->getGroup() " << m_pTokenizer->getGroup() << @@ -5985,9 +5952,8 @@ RTFError RTFDocumentImpl::popState() if (!m_bIsNewDoc) { // Check classification. - RTFError nError = lcl_checkClassification(xDocumentProperties, m_xDocumentProperties); - if (nError != RTFError::OK) - return nError; + if (!SfxClassificationHelper::ShowPasteInfo(SfxClassificationHelper::CheckPaste(xDocumentProperties, m_xDocumentProperties))) + return RTFError::CLASSIFICATION; } uno::Reference<beans::XPropertyContainer> xClipboardPropertyContainer = xDocumentProperties->getUserDefinedProperties(); |