summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-03-10 15:04:25 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-07-07 17:42:46 +0200
commit85686bc2f4dd29923e83f386d2b0b52bc7ee4255 (patch)
tree6493c5a1e5eaabb60166dc59de143d1242794ca2 /writerfilter
parentb83154a889573eb31067be15657cbd18e6aa7ab7 (diff)
sfx2 classification: merge common code from sw and writerfilter
The two versions were almost a duplicate. Change-Id: I3148150d62484a55fc8d59ca354998f211435c0b (cherry picked from commit 275443f052887f67a6d459d443293690daa3ae24)
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx38
1 files changed, 2 insertions, 36 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index b1ffb6b73bca..80106f105685 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -5262,39 +5262,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() <<
@@ -6130,9 +6097,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();