summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-05-09 14:30:55 +0200
committerLuboš Luňák <l.lunak@suse.cz>2012-05-14 14:52:49 +0200
commitf644f31c8edf3e39b23d8cc4d4b484cca8e99910 (patch)
tree29843f0f3647b1c505a4d7a3509f26cc56cf5e2c
parent36c401f402a30f386dba82f121961a187ab8f7af (diff)
fdo#49683 implement RTF_KEYWORDS
Use comphelper::string::convertCommaSeparated(), as done in RtfExport::WriteInfo(). Change-Id: Iad4c3c57cf2e16c7256b9853cb1a6a0843463387 Signed-off-by: Luboš Luňák <l.lunak@suse.cz>
-rw-r--r--writerfilter/Library_rtftok.mk1
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx7
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.hxx1
3 files changed, 9 insertions, 0 deletions
diff --git a/writerfilter/Library_rtftok.mk b/writerfilter/Library_rtftok.mk
index 1afdd27d3c4a..c58b0774200b 100644
--- a/writerfilter/Library_rtftok.mk
+++ b/writerfilter/Library_rtftok.mk
@@ -48,6 +48,7 @@ $(eval $(call gb_Library_add_defs,rtftok,\
))
$(eval $(call gb_Library_add_linked_libs,rtftok,\
+ comphelper \
cppu \
cppuhelper \
oox \
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 1d45cb3e8651..125085566038 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -45,6 +45,7 @@
#include <vcl/graph.hxx>
#include <svtools/grfmgr.hxx>
#include <vcl/svapp.hxx>
+#include <comphelper/string.hxx>
#include <doctok/sprmids.hxx> // NS_sprm namespace
#include <doctok/resourceids.hxx> // NS_rtf namespace
@@ -981,6 +982,7 @@ void RTFDocumentImpl::text(OUString& rString)
case DESTINATION_FORMFIELDLIST:
case DESTINATION_DATAFIELD:
case DESTINATION_AUTHOR:
+ case DESTINATION_KEYWORDS:
case DESTINATION_OPERATOR:
case DESTINATION_COMPANY:
case DESTINATION_COMMENT:
@@ -1357,6 +1359,9 @@ int RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword)
case RTF_AUTHOR:
m_aStates.top().nDestinationState = DESTINATION_AUTHOR;
break;
+ case RTF_KEYWORDS:
+ m_aStates.top().nDestinationState = DESTINATION_KEYWORDS;
+ break;
case RTF_OPERATOR:
m_aStates.top().nDestinationState = DESTINATION_OPERATOR;
break;
@@ -3256,6 +3261,8 @@ int RTFDocumentImpl::popState()
m_xDocumentProperties->setPrintDate(lcl_getDateTime(m_aStates));
else if (m_aStates.top().nDestinationState == DESTINATION_AUTHOR && m_xDocumentProperties.is())
m_xDocumentProperties->setAuthor(m_aStates.top().aDestinationText.makeStringAndClear());
+ else if (m_aStates.top().nDestinationState == DESTINATION_KEYWORDS && m_xDocumentProperties.is())
+ m_xDocumentProperties->setKeywords(comphelper::string::convertCommaSeparated(m_aStates.top().aDestinationText.makeStringAndClear()));
else if (m_aStates.top().nDestinationState == DESTINATION_COMMENT && m_xDocumentProperties.is())
m_xDocumentProperties->setGenerator(m_aStates.top().aDestinationText.makeStringAndClear());
else if (m_aStates.top().nDestinationState == DESTINATION_OPERATOR
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
index 84ac9f32c521..fa21c81e2f2f 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -100,6 +100,7 @@ namespace writerfilter {
DESTINATION_REVISIONTIME,
DESTINATION_PRINTTIME,
DESTINATION_AUTHOR,
+ DESTINATION_KEYWORDS,
DESTINATION_OPERATOR,
DESTINATION_COMPANY,
DESTINATION_COMMENT,