summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-06-15 16:15:07 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-06-15 17:04:13 +0200
commit629001d4795fd9cc16625d3b10705e06778aeb64 (patch)
treed0a486cdde74cc9c057399546fe0ed08780da7d3 /writerfilter
parentfa2006828ff69509e1ead755af906dcd35a992bf (diff)
fdo#50087 fix RTF import of Title, Subject, Comments document properties
Change-Id: I3358fad4949c2c21ecf63983a36b7c8428df9f06
Diffstat (limited to 'writerfilter')
-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 caff49110a1a..190b1bd4b0a0 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -968,6 +968,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:
@@ -1377,6 +1380,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:
SAL_INFO("writerfilter", OSL_THIS_FUNC << ": TODO handle destination '" << lcl_RtfToString(nKeyword) << "'");
// Make sure we skip destinations (even without \*) till we don't handle them
@@ -3275,6 +3287,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 9bb994d9fd35..5756b5a6aa11 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
};
enum RTFBorderState