summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/rtfexport/data/hyphpar.rtf5
-rw-r--r--sw/qa/extras/rtfexport/rtfexport.cxx6
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.cxx16
3 files changed, 13 insertions, 14 deletions
diff --git a/sw/qa/extras/rtfexport/data/hyphpar.rtf b/sw/qa/extras/rtfexport/data/hyphpar.rtf
new file mode 100644
index 000000000000..762392e38c17
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/hyphpar.rtf
@@ -0,0 +1,5 @@
+{\rtf1\hyphauto1
+\pard\plain AAA\par
+\pard\plain\hyphpar0 BBB\par
+\pard\plain CCC\par
+}
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index dc1107a6b9dd..47a91db92771 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -872,6 +872,12 @@ DECLARE_RTFEXPORT_TEST(testHyphauto, "hyphauto.rtf")
CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(getParagraph(1), "ParaIsHyphenation"));
}
+DECLARE_RTFEXPORT_TEST(testHyphpar, "hyphpar.rtf")
+{
+ // Hyphenation was enabled for all 3 paragraphs, but it should be disabled for the 2nd one.
+ CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(getParagraph(2), "ParaIsHyphenation"));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 4f7ce74f8a83..c05aacf0d3a0 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -2663,20 +2663,8 @@ void RtfAttributeOutput::ParaTabStop(const SvxTabStopItem& rTabStop)
void RtfAttributeOutput::ParaHyphenZone(const SvxHyphenZoneItem& rHyphenZone)
{
- sal_Int32 nFlags = rHyphenZone.IsHyphen() ? 1 : 0;
- if (rHyphenZone.IsPageEnd())
- nFlags += 2;
- m_aStyles.append('{');
- m_aStyles.append(OOO_STRING_SVTOOLS_RTF_IGNORE);
- m_aStyles.append(OOO_STRING_SVTOOLS_RTF_HYPHEN);
- m_aStyles.append((sal_Int32)nFlags);
- m_aStyles.append(OOO_STRING_SVTOOLS_RTF_HYPHLEAD);
- m_aStyles.append((sal_Int32)rHyphenZone.GetMinLead());
- m_aStyles.append(OOO_STRING_SVTOOLS_RTF_HYPHTRAIL);
- m_aStyles.append((sal_Int32)rHyphenZone.GetMinTrail());
- m_aStyles.append(OOO_STRING_SVTOOLS_RTF_HYPHMAX);
- m_aStyles.append((sal_Int32)rHyphenZone.GetMaxHyphens());
- m_aStyles.append('}');
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_HYPHPAR);
+ m_aStyles.append(int(rHyphenZone.IsHyphen()));
}
void RtfAttributeOutput::ParaNumRule_Impl(const SwTxtNode* pTxtNd, sal_Int32 nLvl, sal_Int32 nNumId)