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

tdf#122430 RTF import: fix lost font size on footnote start

This become more visible since commit
49614a9e (tdf#119599 RTF import: fix
missing deduplication of font size, 2018-09-24) as now incorrect font
size from style affects the rendering result.

Change-Id: I5b339337f021e2fc359f6fc5f5aa2ed0bcf844b9
Reviewed-on: https://gerrit.libreoffice.org/67034
Tested-by: Jenkins
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.com>
üst e9e1813a
{\rtf1\ansi\deff0\adeflang1025
{\fonttbl
{\f0\froman\fprq2\fcharset0 Times New Roman;}
{\f1\froman\fprq2\fcharset2 Symbol;}
{\f2\fswiss\fprq2\fcharset0 Arial;}
{\f3\froman\fprq2\fcharset0 Arial;}
{\f4\froman\fprq2\fcharset0 Cambria;}
{\f5\froman\fprq2\fcharset0 Calibri;}
{\f6\fnil\fprq2\fcharset0 Microsoft YaHei;}
{\f7\fnil\fprq2\fcharset0 Cambria;}
{\f8\fnil\fprq2\fcharset0 Times New Roman;}
{\f9\fnil\fprq2\fcharset0 Lucida Sans;}
{\f10\fswiss\fprq0\fcharset128 Lucida Sans;}
}
{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}
{\stylesheet
{\s0\snext0\ql\nowidctlpar\hyphpar0\ltrpar\cf1\kerning1\dbch\af7\langfe1081\dbch\af7\afs24\alang1081\loch\f0\fs24\lang1040 Normal;}
{\s43\snext43\ql\nowidctlpar\hyphpar0\faauto\li0\ri0\lin0\rin0\fi0\sb240\sa120\keepn\ltrpar\cf1\b\kerning1\dbch\af7\langfe1040\dbch\af9\afs24\alang1081\loch\f3\fs36\lang1040 Titolo 1;}
{\s61\sbasedon0\snext61\ql\nowidctlpar\hyphpar0\ltrpar\cf1\kerning1\dbch\af7\langfe1081\dbch\af7\afs24\loch\f0\fs24\lang1040 Footnote;}
}
\pard\plain \s43\ql\nowidctlpar\hyphpar0\faauto\li0\ri0\lin0\rin0\fi0\sb240\sa120\keepn\ltrpar\cf1\b\kerning1\dbch\af7\langfe1040\dbch\af9\afs24\alang1081\loch\f3\fs36\lang1040\sb240\sa120
{
{\super 1
{\*\footnote 1\pard\plain \s61\fs24
{\cf1\kerning1\dbch\af7\langfe1040\rtlch \ltrch\rtlch \ltrch\loch\fs20\lang1040
\tab A}
}
}
}
A
\par}
......@@ -355,6 +355,13 @@ DECLARE_RTFIMPORT_TEST(testTdf112211_2, "tdf112211-2.rtf")
CPPUNIT_ASSERT_LESS(300, nWidth);
}
DECLARE_RTFIMPORT_TEST(testTdf122430, "tdf122430.rtf")
{
// Without the accompanying fix in place, this test would have failed with
// 'Expected: 18, Actual : 12', i.e. the font was smaller than expected.
CPPUNIT_ASSERT_EQUAL(18.0f, getProperty<float>(getRun(getParagraph(1), 2), "CharHeight"));
}
DECLARE_RTFIMPORT_TEST(testFdo49892, "fdo49892.rtf")
{
uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
......
......@@ -773,6 +773,14 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
break;
case RTF_SUPER:
{
// Make sure character properties are not lost if the document
// starts with a footnote.
if (!isStyleSheetImport())
{
checkFirstRun();
checkNeedPap();
}
if (!m_aStates.top().pCurrentBuffer)
m_aStates.top().pCurrentBuffer = &m_aSuperBuffer;
......
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