summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-06-15 16:15:07 +0200
committerCaolán McNamara <caolanm@redhat.com>2012-06-20 21:42:17 +0100
commit1943f7b4b70aa1286507a5581e67f2174b037aa2 (patch)
tree89511068e21a35469396d66af9ec6a9695fb8750
parentfa84c91b85b6934b21b02b07de1409be38425229 (diff)
fdo#50087 fix RTF import of Title, Subject, Comments document properties
Change-Id: I3358fad4949c2c21ecf63983a36b7c8428df9f06 Signed-off-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx18
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.hxx5
2 files changed, 22 insertions, 1 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 361ad8949094..e2935992d008 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1019,6 +1019,9 @@ void RTFDocumentImpl::text(OUString& rString)
case DESTINATION_FALT:
case DESTINATION_PARAGRAPHNUMBERING_TEXTAFTER:
case DESTINATION_PARAGRAPHNUMBERING_TEXTBEFORE:
+ case DESTINATION_TITLE:
+ case DESTINATION_SUBJECT:
+ case DESTINATION_DOCCOMM:
m_aStates.top().aDestinationText.append(rString);
break;
case DESTINATION_EQINSTRUCTION:
@@ -1442,6 +1445,15 @@ int RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword)
case RTF_PNTXTB:
m_aStates.top().nDestinationState = DESTINATION_PARAGRAPHNUMBERING_TEXTBEFORE;
break;
+ case RTF_TITLE:
+ m_aStates.top().nDestinationState = DESTINATION_TITLE;
+ break;
+ case RTF_SUBJECT:
+ m_aStates.top().nDestinationState = DESTINATION_SUBJECT;
+ break;
+ case RTF_DOCCOMM:
+ m_aStates.top().nDestinationState = DESTINATION_DOCCOMM;
+ break;
default:
#if OSL_DEBUG_LEVEL > 1
OSL_TRACE("%s: TODO handle destination '%s'", OSL_THIS_FUNC, lcl_RtfToString(nKeyword));
@@ -3301,6 +3313,12 @@ int RTFDocumentImpl::popState()
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_TITLE && m_xDocumentProperties.is())
+ m_xDocumentProperties->setTitle(m_aStates.top().aDestinationText.makeStringAndClear());
+ else if (m_aStates.top().nDestinationState == DESTINATION_SUBJECT && m_xDocumentProperties.is())
+ m_xDocumentProperties->setSubject(m_aStates.top().aDestinationText.makeStringAndClear());
+ else if (m_aStates.top().nDestinationState == DESTINATION_DOCCOMM && m_xDocumentProperties.is())
+ m_xDocumentProperties->setDescription(m_aStates.top().aDestinationText.makeStringAndClear());
else if (m_aStates.top().nDestinationState == DESTINATION_OPERATOR
|| m_aStates.top().nDestinationState == DESTINATION_COMPANY)
{
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
index aa2f756d2225..d7347e4dc2c3 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -114,7 +114,10 @@ namespace writerfilter {
DESTINATION_DRAWINGOBJECT,
DESTINATION_PARAGRAPHNUMBERING,
DESTINATION_PARAGRAPHNUMBERING_TEXTBEFORE,
- DESTINATION_PARAGRAPHNUMBERING_TEXTAFTER
+ DESTINATION_PARAGRAPHNUMBERING_TEXTAFTER,
+ DESTINATION_TITLE,
+ DESTINATION_SUBJECT,
+ DESTINATION_DOCCOMM
};