diff options
-rw-r--r-- | chart2/source/tools/NumberFormatterWrapper.cxx | 3 | ||||
-rw-r--r-- | sw/qa/extras/layout/data/tdf130969.docx | bin | 0 -> 26299 bytes | |||
-rw-r--r-- | sw/qa/extras/layout/layout.cxx | 16 |
3 files changed, 19 insertions, 0 deletions
diff --git a/chart2/source/tools/NumberFormatterWrapper.cxx b/chart2/source/tools/NumberFormatterWrapper.cxx index a585c04b7dc3..50f6dc7fb132 100644 --- a/chart2/source/tools/NumberFormatterWrapper.cxx +++ b/chart2/source/tools/NumberFormatterWrapper.cxx @@ -105,6 +105,9 @@ OUString NumberFormatterWrapper::getFormattedString( sal_Int32 nNumberFormatKey, m_aNullDate >>= aNewNullDate; m_pNumberFormatter->ChangeNullDate(aNewNullDate.Day,aNewNullDate.Month,aNewNullDate.Year); } + // tdf#130969: use UNLIMITED_PRECISION in case of GENERAL Number Format + if( m_pNumberFormatter->GetStandardPrec() != SvNumberFormatter::UNLIMITED_PRECISION ) + m_pNumberFormatter->ChangeStandardPrec(SvNumberFormatter::UNLIMITED_PRECISION); m_pNumberFormatter->GetOutputString(fValue, nNumberFormatKey, aText, &pTextColor); if ( m_aNullDate.hasValue() ) { diff --git a/sw/qa/extras/layout/data/tdf130969.docx b/sw/qa/extras/layout/data/tdf130969.docx Binary files differnew file mode 100644 index 000000000000..446dc16e7dd8 --- /dev/null +++ b/sw/qa/extras/layout/data/tdf130969.docx diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index b6295cab0ef5..2a24e68ccd35 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -2547,6 +2547,22 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf124796) "15"); } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf130969) +{ + SwDoc* pDoc = createDoc("tdf130969.docx"); + SwDocShell* pShell = pDoc->GetDocShell(); + + // Dump the rendering of the first page as an XML file. + std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile(); + MetafileXmlDump dumper; + xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); + CPPUNIT_ASSERT(pXmlDoc); + + // This failed, if the minimum value of Y axis is not 0.35781 + assertXPathContent( + pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/textarray[5]/text", "0.35781"); +} + CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf129054) { SwDoc* pDoc = createDoc("tdf129054.docx"); |