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

fdo#83464 RTF import: \plain should reset \rtlch and \hich as well

Regression from 36246aa9 (RTF import:
fix handling of \loch \hich \dbch \ltrch \rtlch, 2014-06-03), now that
\f no longer means the ascii font name, \plain should reset a few more
parser state members.

Change-Id: Ia6b0bdf25563dd5300e108b46731751f0886f67d
üst 9cf46f21
{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff31507\deff0\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang1033\deflangfe1033\themelang1033\themelangfe0\themelangcs1025
{\fonttbl
{\f0\fbidi \froman\fcharset0\fprq2 Times New Roman;}
{\f39\fbidi \fswiss\fcharset0\fprq2 Verdana;}
}
{\stylesheet
{\s43\ql \f39\fs16 Table Text;}
}
\pard\plain \ltrpar\ql \li0\ri0\sb60\sa60\widctlpar\tx360\jclisttab\tx720\tx1080\tx1440\tx1800\tx2160\tx2520\tx2880\tx3240\tx3600\tx3960\tx4320\tx4680\tx5040\tx5400\tx5760\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid10449364 \rtlch\fcs1 \af0\afs18\alang1037 \ltrch\fcs0 \fs16\lang1024\langfe1024\loch\af2\hich\af2\dbch\af35\cgrid\noproof\langnp1033\langfenp1033
\par
{\rtlch\fcs1 \ltrch\fcs0 \insrsid11419963
{\shp
{\*\shpinst\shpleft-90\shptop720\shpright9405\shpbottom2940\shpfhdr0\shpbxcolumn\shpbxignore\shpbymargin\shpbyignore\shpwr3\shpwrk0\shpfblwtxt0\shpz2\shplid1027
{\sp
{\sn shapeType}
{\sv 202}
}
{\shptxt \pard\plain\f39\fs16 Hello\par
}
}
}
}
\par
}
...@@ -1974,6 +1974,15 @@ DECLARE_RTFIMPORT_TEST(testFdo82071, "fdo82071.rtf") ...@@ -1974,6 +1974,15 @@ DECLARE_RTFIMPORT_TEST(testFdo82071, "fdo82071.rtf")
CPPUNIT_ASSERT_EQUAL(awt::FontUnderline::NONE, getProperty<sal_Int16>(xRun, "CharUnderline")); CPPUNIT_ASSERT_EQUAL(awt::FontUnderline::NONE, getProperty<sal_Int16>(xRun, "CharUnderline"));
} }
DECLARE_RTFIMPORT_TEST(testFdo83464, "fdo83464.rtf")
{
// Problem was that the text in the textfrme had wrong font.
uno::Reference<text::XTextRange> xFrameText(getShape(1), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(OUString("Hello"), xFrameText->getString());
// This was Times New Roman.
CPPUNIT_ASSERT_EQUAL(OUString("Verdana"), getProperty<OUString>(getRun(getParagraphOfText(1, xFrameText->getText()), 1), "CharFontName"));
}
CPPUNIT_PLUGIN_IMPLEMENT(); CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -2850,6 +2850,8 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword) ...@@ -2850,6 +2850,8 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
m_aStates.top().nCurrentEncoding = getEncoding(getFontIndex(m_nDefaultFontIndex)); m_aStates.top().nCurrentEncoding = getEncoding(getFontIndex(m_nDefaultFontIndex));
m_aStates.top().aCharacterAttributes = getDefaultState().aCharacterAttributes; m_aStates.top().aCharacterAttributes = getDefaultState().aCharacterAttributes;
m_aStates.top().nCurrentCharacterStyleIndex = -1; m_aStates.top().nCurrentCharacterStyleIndex = -1;
m_aStates.top().isRightToLeft = false;
m_aStates.top().eRunType = RTFParserState::LOCH;
} }
break; break;
case RTF_PARD: case RTF_PARD:
......
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