summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-07-29 08:48:22 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-07-29 08:50:31 +0100
commit0dd22165346f4296718656d17ae98ebbfe563719 (patch)
tree30c86e873a80eef2bdf548eba36295d98287f192 /writerfilter
parent6ab2cabeae02b6beb3c33238773ba075f41c4bb9 (diff)
fftester: null DestinationText
Change-Id: Icdd71733c4e9f4b36e6e957e4dea772087890faa
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/qa/cppunittests/rtftok/data/pass/destinationtest-1.rtfbin0 -> 196 bytes
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx6
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.hxx6
3 files changed, 9 insertions, 3 deletions
diff --git a/writerfilter/qa/cppunittests/rtftok/data/pass/destinationtest-1.rtf b/writerfilter/qa/cppunittests/rtftok/data/pass/destinationtest-1.rtf
new file mode 100644
index 000000000000..63465b073627
--- /dev/null
+++ b/writerfilter/qa/cppunittests/rtftok/data/pass/destinationtest-1.rtf
Binary files differ
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 45be8a691d4e..e3cd2b9f8bef 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1213,7 +1213,7 @@ void RTFDocumentImpl::text(OUString& rString)
rString = rString.copy(0, rString.getLength() - 1);
bEnd = true;
}
- m_aStates.top().pDestinationText->append(rString);
+ m_aStates.top().appendDestinationText(rString);
if (bEnd)
{
// always clear, necessary in case of group-less fonttable
@@ -1319,7 +1319,7 @@ void RTFDocumentImpl::text(OUString& rString)
case Destination::TOCENTRY:
case Destination::PROPNAME:
case Destination::STATICVAL:
- m_aStates.top().pDestinationText->append(rString);
+ m_aStates.top().appendDestinationText(rString);
break;
default:
bRet = false;
@@ -1348,7 +1348,7 @@ void RTFDocumentImpl::text(OUString& rString)
// Don't return earlier, a bookmark start has to be in a paragraph group.
if (m_aStates.top().eDestination == Destination::BOOKMARKSTART)
{
- m_aStates.top().pDestinationText->append(rString);
+ m_aStates.top().appendDestinationText(rString);
return;
}
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
index c8a28d321717..152f5a66af8a 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -282,6 +282,12 @@ public:
/// point to the buffer of the current destination
OUStringBuffer* pDestinationText;
+ void appendDestinationText(const OUString &rString)
+ {
+ if (pDestinationText)
+ pDestinationText->append(rString);
+ }
+
/// Index of the current style.
int nCurrentStyleIndex;
/// Index of the current character style.