Kaydet (Commit) f1e5e271 authored tarafından Miklos Vajna's avatar Miklos Vajna

fdo#68076 RTF import: default font had priority over the specified one

Regression from 60c17b28.

Change-Id: Ie16d611622e6a814d5cbea00c3f992cd9ecba027
üst 1984e24f
{\rtf1\ansi\ansicpg1251\uc1 \deff0\deflang1033\deflangfe1049
{\fonttbl
{\f0\froman\fcharset0\fprq2
{\*\panose 02020603050405020304}
Times New Roman;}
{\f31\froman\fcharset238\fprq2 Times New Roman CE;}
{\f32\froman\fcharset204\fprq2 Times New Roman Cyr;}
{\f34\froman\fcharset161\fprq2 Times New Roman Greek;}
{\f35\froman\fcharset162\fprq2 Times New Roman Tur;}
{\f36\froman\fcharset186\fprq2 Times New Roman Baltic;}
}
\paperw11906\paperh16838\margl1701\margr1134\margt1276\margb992 \widowctrl\ftnbj\aenddoc\hyphhotz142\hyphcaps0\hyphauto1\formshade\viewkind1\viewscale90\viewzk2\pgbrdrhead\pgbrdrfoot \fet0\sectd
\psz9\linex0\headery709\footery709\colsx709\endnhere\titlepg\sectdefaultcl
\pard\plain \li5812\nowidctlpar\widctlpar\adjustright \fs28\lang1049\cgrid
{\f32 \'ce\'e1\'fa\'e5\'ea\'f2 \endash \'f3}
{
\par }
}
...@@ -165,6 +165,7 @@ public: ...@@ -165,6 +165,7 @@ public:
void testFdo63428(); void testFdo63428();
void testGroupshapeRotation(); void testGroupshapeRotation();
void testFdo44715(); void testFdo44715();
void testFdo68076();
CPPUNIT_TEST_SUITE(Test); CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT) #if !defined(MACOSX) && !defined(WNT)
...@@ -314,6 +315,7 @@ void Test::run() ...@@ -314,6 +315,7 @@ void Test::run()
{"hello.rtf", &Test::testFdo63428}, {"hello.rtf", &Test::testFdo63428},
{"groupshape-rotation.rtf", &Test::testGroupshapeRotation}, {"groupshape-rotation.rtf", &Test::testGroupshapeRotation},
{"fdo44715.rtf", &Test::testFdo44715}, {"fdo44715.rtf", &Test::testFdo44715},
{"fdo68076.rtf", &Test::testFdo68076},
}; };
header(); header();
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i) for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
...@@ -1540,6 +1542,13 @@ void Test::testFdo44715() ...@@ -1540,6 +1542,13 @@ void Test::testFdo44715()
CPPUNIT_ASSERT_EQUAL(12.f, getProperty<float>(getParagraphOfText(2, xCell->getText()), "CharHeight")); CPPUNIT_ASSERT_EQUAL(12.f, getProperty<float>(getParagraphOfText(2, xCell->getText()), "CharHeight"));
} }
void Test::testFdo68076()
{
// Encoding of the last char was wrong (more 'o' than 'y').
OUString aExpected("\xD0\x9E\xD0\xB1\xD1\x8A\xD0\xB5\xD0\xBA\xD1\x82 \xE2\x80\x93 \xD1\x83", 19, RTL_TEXTENCODING_UTF8);
getParagraph(1, aExpected);
}
CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT(); CPPUNIT_PLUGIN_IMPLEMENT();
......
...@@ -382,9 +382,10 @@ void RTFDocumentImpl::checkFirstRun() ...@@ -382,9 +382,10 @@ void RTFDocumentImpl::checkFirstRun()
Mapper().startSectionGroup(); Mapper().startSectionGroup();
Mapper().startParagraphGroup(); Mapper().startParagraphGroup();
// set the requested default font // set the requested default font, if there are none
RTFValue::Pointer_t pFont = m_aDefaultState.aCharacterSprms.find(NS_sprm::LN_CRgFtc0); RTFValue::Pointer_t pFont = m_aDefaultState.aCharacterSprms.find(NS_sprm::LN_CRgFtc0);
if (pFont.get()) RTFValue::Pointer_t pCurrentFont = m_aStates.top().aCharacterSprms.find(NS_sprm::LN_CRgFtc0);
if (pFont && !pCurrentFont)
dispatchValue(RTF_F, pFont->getInt()); dispatchValue(RTF_F, pFont->getInt());
m_bFirstRun = false; m_bFirstRun = false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment