Bugzilla – Attachment 154233 Details for
Bug 127337
FILEOPEN DOCX table column width changed in LO 6.2
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
0001-tdf-127337-writerfilter-use-UI-matching-numbers-for-.patch: hacky fix that probably causes as many issues as it solves
0001-tdf-127337-writerfilter-use-UI-matching-numbers-for-.patch (text/plain), 4.89 KB, created by
Justin L
on 2019-09-17 14:37:34 UTC
(
hide
)
Description:
0001-tdf-127337-writerfilter-use-UI-matching-numbers-for-.patch: hacky fix that probably causes as many issues as it solves
Filename:
MIME Type:
Creator:
Justin L
Created:
2019-09-17 14:37:34 UTC
Size:
4.89 KB
patch
obsolete
>From e410e708afe33181ae18969bcf24f7232fd48bf1 Mon Sep 17 00:00:00 2001 >From: Justin Luth <justin_luth@sil.org> >Date: Tue, 17 Sep 2019 16:25:14 +0200 >Subject: [PATCH] tdf#127337 writerfilter: use UI matching numbers for padding > >Using the UI rounds numbers (using denormalize and normalize). >If the imported document doesn't exactly match these values, >round-tripping a dialog box can inadvertently change some of >the properties - so it is best to import UI-valid values. > >This solves the stated problem in bug 127337 since it rounds >down and reduces the margin by the fraction of a cm needed. >Of course, in other examples it could round up and cause >a similar problem. So not a great overall solution, but >neither is having a document change when just OKing a dialog... > >Change-Id: I1b20a3ad9805e55135ab582dad5631e76b29d373 >--- > sw/qa/extras/ooxmlexport/ooxmlexport10.cxx | 8 ++++---- > sw/qa/extras/rtfexport/rtfexport5.cxx | 4 ++-- > writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 4 ++-- > 3 files changed, 8 insertions(+), 8 deletions(-) > >diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx >index babff3bbec07..cf6635709853 100644 >--- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx >+++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx >@@ -1172,12 +1172,12 @@ DECLARE_OOXMLEXPORT_TEST( testTableCellMargin, "table-cell-margin.docx" ) > table::BorderLine2 aLeftBorderLine; > aLeftBorder >>= aLeftBorderLine; > CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( "Incorrect left spacing computed from docx cell margin", >- cellLeftMarginFromOffice[i], aLeftMargin - 0.5 * aLeftBorderLine.LineWidth, 1 ); >+ cellLeftMarginFromOffice[i], aLeftMargin - 0.5 * aLeftBorderLine.LineWidth, 5 ); > // The 'a' in the fourth table should not be partly hidden by the border > if ( i == 3 ) > { > CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Incorrect cell left padding", >- 0.5 * aLeftBorderLine.LineWidth, aLeftMargin, 1); >+ 0.5 * aLeftBorderLine.LineWidth, aLeftMargin, 5); > // tdf#119885: cell's edit area must touch right border > sal_Int32 aRightMargin = -1; > xPropSet->getPropertyValue("RightBorderDistance") >>= aRightMargin; >@@ -1185,7 +1185,7 @@ DECLARE_OOXMLEXPORT_TEST( testTableCellMargin, "table-cell-margin.docx" ) > table::BorderLine2 aRightBorderLine; > aRightBorder >>= aRightBorderLine; > CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Incorrect cell right padding", >- 0.5 * aRightBorderLine.LineWidth, aRightMargin, 1); >+ 0.5 * aRightBorderLine.LineWidth, aRightMargin, 5); > } > } > } >@@ -1234,7 +1234,7 @@ DECLARE_OOXMLEXPORT_TEST( testTablePosition15, "table-position-15.docx" ) > uno::Reference< text::XTextViewCursor > xCursor = xTextViewCursorSupplier->getViewCursor(); > awt::Point pos = xCursor->getPosition(); > CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( "Incorrect X coord computed from docx", >- aXCoordsFromOffice[i], pos.X, 1 ); >+ aXCoordsFromOffice[i], pos.X, 5 ); > } > } > >diff --git a/sw/qa/extras/rtfexport/rtfexport5.cxx b/sw/qa/extras/rtfexport/rtfexport5.cxx >index 9ea411fae888..74d6296fe399 100644 >--- a/sw/qa/extras/rtfexport/rtfexport5.cxx >+++ b/sw/qa/extras/rtfexport/rtfexport5.cxx >@@ -629,8 +629,8 @@ DECLARE_RTFEXPORT_TEST(testFdo74229, "fdo74229.rtf") > uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); > uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); > // This was 0, due to ignoring RTF_TRGAPH. >- CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(67)), >- getProperty<sal_Int32>(xCell, "RightBorderDistance")); >+ CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(convertTwipToMm100(67)), >+ getProperty<sal_Int32>(xCell, "RightBorderDistance"), 3); > } > > DECLARE_RTFEXPORT_TEST(testFdo79959, "fdo79959.rtf") >diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx >index 90cb75dbbd5a..776a8557c65c 100644 >--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx >+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx >@@ -310,8 +310,8 @@ void lcl_adjustBorderDistance(TableInfo& rInfo, const table::BorderLine2& rLeftB > = std::max<sal_Int32>(nActualL + rRightBorder.LineWidth / 2, > rInfo.nLeftBorderDistance + rInfo.nRightBorderDistance) > - nActualL; >- rInfo.nLeftBorderDistance = nActualL; >- rInfo.nRightBorderDistance = nActualR; >+ rInfo.nLeftBorderDistance = round(nActualL/10.0)*10; >+ rInfo.nRightBorderDistance = round(nActualR/10.0)*10; > } > > } >-- >2.17.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 127337
:
153870
|
153871
| 154233 |
155699