diff options
-rw-r--r-- | include/svtools/rtfkeywd.hxx | 2 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/data/em.rtf | 8 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport.cxx | 13 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfattributeoutput.cxx | 12 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 10 |
5 files changed, 37 insertions, 8 deletions
diff --git a/include/svtools/rtfkeywd.hxx b/include/svtools/rtfkeywd.hxx index 8518f69f1330..cffa6499397c 100644 --- a/include/svtools/rtfkeywd.hxx +++ b/include/svtools/rtfkeywd.hxx @@ -1047,6 +1047,8 @@ #define OOO_STRING_SVTOOLS_RTF_ACCNONE "\\accnone" #define OOO_STRING_SVTOOLS_RTF_ACCDOT "\\accdot" #define OOO_STRING_SVTOOLS_RTF_ACCCOMMA "\\acccomma" +#define OOO_STRING_SVTOOLS_RTF_ACCCIRCLE "\\acccircle" +#define OOO_STRING_SVTOOLS_RTF_ACCUNDERDOT "\\accunderdot" #define OOO_STRING_SVTOOLS_RTF_TWOINONE "\\twoinone" #define OOO_STRING_SVTOOLS_RTF_HORZVERT "\\horzvert" #define OOO_STRING_SVTOOLS_RTF_FAHANG "\\fahang" diff --git a/sw/qa/extras/rtfexport/data/em.rtf b/sw/qa/extras/rtfexport/data/em.rtf new file mode 100644 index 000000000000..c255105d6f32 --- /dev/null +++ b/sw/qa/extras/rtfexport/data/em.rtf @@ -0,0 +1,8 @@ +{\rtf1 +none +{\accdot dot} +{\acccomma comma} +{\acccircle circle} +{\accunderdot underDot} +\par +} diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index 954dc2fac3ab..5c74c5385b68 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -16,6 +16,7 @@ #include <com/sun/star/frame/XStorable.hpp> #include <com/sun/star/table/BorderLine2.hpp> #include <com/sun/star/table/ShadowFormat.hpp> +#include <com/sun/star/text/FontEmphasis.hpp> #include <com/sun/star/text/RelOrientation.hpp> #include <com/sun/star/text/TextContentAnchorType.hpp> #include <com/sun/star/text/XFootnotesSupplier.hpp> @@ -689,6 +690,18 @@ DECLARE_RTFEXPORT_TEST(testAbi10076, "abi10076.odt") // Just make sure that we don't crash after exporting a fully calculated layout. } +DECLARE_RTFEXPORT_TEST(testEm, "em.rtf") +{ + // Test all possible \acc* control words. + CPPUNIT_ASSERT_EQUAL(text::FontEmphasis::NONE, getProperty<sal_Int16>(getRun(getParagraph(1), 1), "CharEmphasis")); + CPPUNIT_ASSERT_EQUAL(text::FontEmphasis::DOT_ABOVE, getProperty<sal_Int16>(getRun(getParagraph(1), 2), "CharEmphasis")); + CPPUNIT_ASSERT_EQUAL(text::FontEmphasis::ACCENT_ABOVE, getProperty<sal_Int16>(getRun(getParagraph(1), 3), "CharEmphasis")); + // This was missing. + CPPUNIT_ASSERT_EQUAL(text::FontEmphasis::CIRCLE_ABOVE, getProperty<sal_Int16>(getRun(getParagraph(1), 4), "CharEmphasis")); + // This one, too. + CPPUNIT_ASSERT_EQUAL(text::FontEmphasis::DOT_BELOW, getProperty<sal_Int16>(getRun(getParagraph(1), 5), "CharEmphasis")); +} + DECLARE_RTFEXPORT_TEST(testNumberingFont, "numbering-font.rtf") { uno::Reference<beans::XPropertySet> xStyle(getStyles("CharacterStyles")->getByName("ListLabel 1"), uno::UNO_QUERY); diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index a576ddcd9f10..a7eecbca3f0c 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -2330,11 +2330,17 @@ void RtfAttributeOutput::CharEmphasisMark(const SvxEmphasisMarkItem& rEmphasisMa case EMPHASISMARK_NONE: pStr = OOO_STRING_SVTOOLS_RTF_ACCNONE; break; - case EMPHASISMARK_SIDE_DOTS: + case EMPHASISMARK_DOT | EMPHASISMARK_POS_ABOVE: + pStr = OOO_STRING_SVTOOLS_RTF_ACCDOT; + break; + case EMPHASISMARK_ACCENT | EMPHASISMARK_POS_ABOVE: pStr = OOO_STRING_SVTOOLS_RTF_ACCCOMMA; break; - default: - pStr = OOO_STRING_SVTOOLS_RTF_ACCDOT; + case EMPHASISMARK_CIRCLE | EMPHASISMARK_POS_ABOVE: + pStr = OOO_STRING_SVTOOLS_RTF_ACCCIRCLE; + break; + case EMPHASISMARK_DOT|EMPHASISMARK_POS_BELOW: + pStr = OOO_STRING_SVTOOLS_RTF_ACCUNDERDOT; break; } m_aStyles.append(pStr); diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index d2661837374f..85884f945245 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -4714,19 +4714,19 @@ int RTFDocumentImpl::dispatchToggle(RTFKeyword nKeyword, bool bParam, int nParam switch (nKeyword) { case RTF_ACCNONE: - nSprm = 0; + nSprm = NS_ooxml::LN_Value_ST_Em_none; break; case RTF_ACCDOT: - nSprm = 1; + nSprm = NS_ooxml::LN_Value_ST_Em_dot; break; case RTF_ACCCOMMA: - nSprm = 2; + nSprm = NS_ooxml::LN_Value_ST_Em_comma; break; case RTF_ACCCIRCLE: - nSprm = 3; + nSprm = NS_ooxml::LN_Value_ST_Em_circle; break; case RTF_ACCUNDERDOT: - nSprm = 4; + nSprm = NS_ooxml::LN_Value_ST_Em_underDot; break; default: break; |