[Libreoffice-commits] .: Branch 'libreoffice-3-6' - sw/CppunitTest_sw_subsequent_rtfexport.mk sw/qa sw/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Thu Jan 17 03:40:40 PST 2013
sw/CppunitTest_sw_subsequent_rtfexport.mk | 2 ++
sw/qa/extras/rtfexport/data/fdo52286.odt |binary
sw/qa/extras/rtfexport/rtfexport.cxx | 23 +++++++++++++++++++++++
sw/source/filter/ww8/rtfattributeoutput.cxx | 11 ++++++++++-
4 files changed, 35 insertions(+), 1 deletion(-)
New commits:
commit 598223e6f828f0e4bedf3f9840703d14f4316048
Author: Miklos Vajna <vmiklos at suse.cz>
Date: Thu Jan 17 09:41:07 2013 +0100
fdo#52286 fix RTF export of sub/super script font height
(cherry picked from commit 796e9a796603397c79e160610c8541e16dfc4c82)
Conflicts:
sw/qa/extras/rtfexport/rtfexport.cxx
Change-Id: If71cb6a20842f2fbe8eae94955da2d53842999a4
Reviewed-on: https://gerrit.libreoffice.org/1732
Reviewed-by: Noel Power <noel.power at suse.com>
Tested-by: Noel Power <noel.power at suse.com>
diff --git a/sw/CppunitTest_sw_subsequent_rtfexport.mk b/sw/CppunitTest_sw_subsequent_rtfexport.mk
index 3943f7e..407aae4 100644
--- a/sw/CppunitTest_sw_subsequent_rtfexport.mk
+++ b/sw/CppunitTest_sw_subsequent_rtfexport.mk
@@ -58,7 +58,9 @@ $(eval $(call gb_CppunitTest_use_components,sw_subsequent_rtfexport,\
filter/source/config/cache/filterconfig1 \
framework/util/fwk \
i18npool/util/i18npool \
+ package/source/xstor/xstor \
package/util/package2 \
+ sax/source/expatwrap/expwrap \
sfx2/util/sfx \
svl/source/fsstor/fsstorage \
svtools/util/svt \
diff --git a/sw/qa/extras/rtfexport/data/fdo52286.odt b/sw/qa/extras/rtfexport/data/fdo52286.odt
new file mode 100644
index 0000000..b6e70ef
Binary files /dev/null and b/sw/qa/extras/rtfexport/data/fdo52286.odt differ
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index 428b7e1..62bdba8 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -49,6 +49,7 @@ public:
void testFdo44174();
void testFdo50087();
void testFdo50831();
+ void testFdo52286();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -58,6 +59,7 @@ public:
CPPUNIT_TEST(testFdo44174);
CPPUNIT_TEST(testFdo50087);
CPPUNIT_TEST(testFdo50831);
+ CPPUNIT_TEST(testFdo52286);
#endif
CPPUNIT_TEST_SUITE_END();
@@ -144,6 +146,27 @@ void Test::testFdo50831()
CPPUNIT_ASSERT_EQUAL(10.f, fValue);
}
+void Test::testFdo52286()
+{
+ // The problem was that font size wasn't reduced in sub/super script.
+ roundtrip("fdo52286.odt");
+
+ uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
+ uno::Reference<container::XEnumerationAccess> xRunEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xRunEnum = xRunEnumAccess->createEnumeration();
+ xRunEnum->nextElement();
+ uno::Reference<beans::XPropertySet> xPropertySet(xRunEnum->nextElement(), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(58), xPropertySet->getPropertyValue("CharEscapementHeight").get<sal_Int32>());
+
+ xRunEnumAccess.set(xParaEnum->nextElement(), uno::UNO_QUERY);
+ xRunEnum = xRunEnumAccess->createEnumeration();
+ xRunEnum->nextElement();
+ xPropertySet.set(xRunEnum->nextElement(), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(58), xPropertySet->getPropertyValue("CharEscapementHeight").get<sal_Int32>());
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 99160de..6944bbb 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -1872,6 +1872,16 @@ void RtfAttributeOutput::CharEscapement( const SvxEscapementItem& rEsc )
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
+ short nEsc = rEsc.GetEsc();
+ if (rEsc.GetProp() == DFLT_ESC_PROP)
+ {
+ if ( DFLT_ESC_SUB == nEsc || DFLT_ESC_AUTO_SUB == nEsc )
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_SUB);
+ else if ( DFLT_ESC_SUPER == nEsc || DFLT_ESC_AUTO_SUPER == nEsc )
+ m_aStyles.append(OOO_STRING_SVTOOLS_RTF_SUPER);
+ return;
+ }
+
const char * pUpDn;
SwTwips nH = ((SvxFontHeightItem&)m_rExport.GetItem( RES_CHRATR_FONTSIZE )).GetHeight();
@@ -1886,7 +1896,6 @@ void RtfAttributeOutput::CharEscapement( const SvxEscapementItem& rEsc )
else
return;
- short nEsc = rEsc.GetEsc();
short nProp = rEsc.GetProp() * 100;
if( DFLT_ESC_AUTO_SUPER == nEsc )
{
More information about the Libreoffice-commits
mailing list