diff options
-rw-r--r-- | sc/qa/unit/bugfix-test.cxx | 12 | ||||
-rw-r--r-- | sc/qa/unit/data/html/tdf88821.html | 23 | ||||
-rw-r--r-- | svtools/source/svrtf/svparser.cxx | 7 |
3 files changed, 38 insertions, 4 deletions
diff --git a/sc/qa/unit/bugfix-test.cxx b/sc/qa/unit/bugfix-test.cxx index 6213593868b2..3968d381af6a 100644 --- a/sc/qa/unit/bugfix-test.cxx +++ b/sc/qa/unit/bugfix-test.cxx @@ -87,6 +87,7 @@ public: void testTdf91979(); // void testTdf40110(); void testTdf98657(); + void testTdf88821(); CPPUNIT_TEST_SUITE(ScFiltersTest); CPPUNIT_TEST(testTdf64229); @@ -96,6 +97,7 @@ public: CPPUNIT_TEST(testTdf91979); // CPPUNIT_TEST(testTdf40110); CPPUNIT_TEST(testTdf98657); + CPPUNIT_TEST(testTdf88821); CPPUNIT_TEST_SUITE_END(); private: uno::Reference<uno::XInterface> m_xCalcComponent; @@ -243,6 +245,16 @@ void ScFiltersTest::testTdf98657() CPPUNIT_ASSERT_EQUAL(double(285.0), rDoc.GetValue(ScAddress(1, 1, 0))); } +void ScFiltersTest::testTdf88821() +{ + ScDocShellRef xDocSh = loadDoc("tdf88821.", FORMAT_HTML); + ScDocument& rDoc = xDocSh->GetDocument(); + + // B2 should be 'Périmètre', not 'Périmètre' + CPPUNIT_ASSERT_EQUAL(OStringToOUString("P\xC3\xA9rim\xC3\xA8tre", RTL_TEXTENCODING_UTF8), rDoc.GetString(1, 1, 0)); + + xDocSh->DoClose(); +} ScFiltersTest::ScFiltersTest() : ScBootstrapFixture( "/sc/qa/unit/data" ) diff --git a/sc/qa/unit/data/html/tdf88821.html b/sc/qa/unit/data/html/tdf88821.html new file mode 100644 index 000000000000..f8e22c873e88 --- /dev/null +++ b/sc/qa/unit/data/html/tdf88821.html @@ -0,0 +1,23 @@ +<meta http-equiv="Content-type" content="application/xhtml+xml; charset=UTF-8" xmlns:myObj="urn:ms-kb" xmlns:myObjConvertBool="urn:ms-bool" xmlns:myObjConvertDecimal="urn:ms-dec" xmlns:myObjConvertText="urn:ms-text" /> +<HTML xmlns:myObj="urn:ms-kb" xmlns:myObjConvertBool="urn:ms-bool" xmlns:myObjConvertDecimal="urn:ms-dec" xmlns:myObjConvertText="urn:ms-text"> + <HEAD> + <STYLE>.HDR { background-color:bisque;font-weight:bold }</STYLE> + </HEAD> + <BODY> + <TABLE> + <COLGROUP WIDTH="150" ALIGN="LEFT" /> + <COLGROUP WIDTH="150" ALIGN="LEFT" /> + <TD CLASS="HDR" ALIGN="CENTER"> + Code de la liste</TD> + <TD CLASS="HDR" ALIGN="CENTER"> + Libellé de la liste</TD> + <TR> + <TD CLASS="TDR"> + ACT_PERIMETRE</TD> + <TD CLASS="TDR"> + Périmètre</TD> + </TR> + </TABLE> + </BODY> +</HTML> + diff --git a/svtools/source/svrtf/svparser.cxx b/svtools/source/svrtf/svparser.cxx index b749400a0e26..ae6c1ebcffe0 100644 --- a/svtools/source/svrtf/svparser.cxx +++ b/svtools/source/svrtf/svparser.cxx @@ -104,7 +104,6 @@ void SvParser::ClearTxtConvContext() void SvParser::SetSrcEncoding( rtl_TextEncoding eEnc ) { - if( eEnc != eSrcEnc ) { if( pImplData && pImplData->hConv ) @@ -172,13 +171,13 @@ sal_uInt32 SvParser::GetNextChar() { if( 0xfe == c1 && 0xff == c2 ) { - eSrcEnc = RTL_TEXTENCODING_UCS2; + SetSrcEncoding(RTL_TEXTENCODING_UCS2); bUCS2BSrcEnc = true; bSeekBack = false; } else if( 0xff == c1 && 0xfe == c2 ) { - eSrcEnc = RTL_TEXTENCODING_UCS2; + SetSrcEncoding(RTL_TEXTENCODING_UCS2); bUCS2BSrcEnc = false; bSeekBack = false; } @@ -198,7 +197,7 @@ sal_uInt32 SvParser::GetNextChar() bErr = rInput.IsEof() || rInput.GetError(); if( !bErr && ( 0xbf == c3 ) ) { - eSrcEnc = RTL_TEXTENCODING_UTF8; + SetSrcEncoding(RTL_TEXTENCODING_UTF8); bSeekBack = false; } } |