basegfx/source/polygon/b2dpolygontools.cxx               |    2 ++
 sw/qa/extras/ooxmlexport/data/table-ltr.docx             |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx                 |    9 +++++++++
 writerfilter/source/dmapper/DomainMapperTableHandler.cxx |    4 ++++
 4 files changed, 15 insertions(+)

New commits:
commit ed7a788dd916bd8786adb2d146ce543a727ce727
Author:     Justin Luth <jl...@mail.com>
AuthorDate: Thu Jun 30 06:43:46 2022 -0400
Commit:     Justin Luth <jl...@mail.com>
CommitDate: Fri Jul 1 15:32:39 2022 +0200

    tdf#126395 writerfilter: don't guess table direction
    
    Wihtout specifying a direction, TextToTable is going
    to guess. Well, import isn't a guessing game,
    and there is a default value for something unspecified.
    
    Perhaps specifying LR_TB would be better,
    but we'll try with CONTEXT first,
    since it is a LO default.
    
    Existing unit tests (not affected)
    Both ooxmlexport and rtfexport have a table-rtf test
    which ensure bidiVisual is properly applied to tables.
    
    Change-Id: I1cabf518937e57dd757aca75ae5d2527c61fa736
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136673
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <jl...@mail.com>

diff --git a/sw/qa/extras/ooxmlexport/data/table-ltr.docx 
b/sw/qa/extras/ooxmlexport/data/table-ltr.docx
new file mode 100644
index 000000000000..d627b81a312b
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/table-ltr.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 5cd096e737f5..c10290269305 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -718,6 +718,15 @@ DECLARE_OOXMLEXPORT_TEST(testTableRtl, "table-rtl.docx")
     CPPUNIT_ASSERT_EQUAL(text::WritingMode2::RL_TB, 
getProperty<sal_Int16>(xTable, "WritingMode"));
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTableLr, "table-ltr.docx")
+{
+    uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, 
uno::UNO_QUERY);
+    uno::Reference<container::XIndexAccess> 
xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY);
+    uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), 
uno::UNO_QUERY);
+    // This was text::WritingMode2::RL_TB, i.e. direction of the table was 
wrongly guessed.
+    CPPUNIT_ASSERT_EQUAL(text::WritingMode2::CONTEXT, 
getProperty<sal_Int16>(xTable, "WritingMode"));
+}
+
 DECLARE_OOXMLEXPORT_TEST(testOoxmlCjklist30, "cjklist30.docx")
 {
     sal_Int16   numFormat = getNumberingTypeOfParagraph(1);
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx 
b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index d0c42576202e..774cba78c3a1 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -33,6 +33,7 @@
 #include <com/sun/star/text/HoriOrientation.hpp>
 #include <com/sun/star/text/SizeType.hpp>
 #include <com/sun/star/text/TextContentAnchorType.hpp>
+#include <com/sun/star/text/WritingMode2.hpp>
 #include <com/sun/star/text/XTextField.hpp>
 #include <com/sun/star/text/XTextRangeCompare.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
@@ -666,6 +667,9 @@ TableStyleSheetEntry * 
DomainMapperTableHandler::endTableGetTableStyle(TableInfo
         m_aTableProperties->Insert( PROP_HORI_ORIENT, uno::Any( 
sal_Int16(nHoriOrient) ) );
         //fill default value - if not available
         m_aTableProperties->Insert( PROP_HEADER_ROW_COUNT, uno::Any( 
sal_Int32(0)), false);
+        m_aTableProperties->Insert(PROP_WRITING_MODE,
+                                   
uno::Any(sal_Int16(text::WritingMode2::CONTEXT)),
+                                   /*bOverWrite=*/false);
 
         // if table is only a single row, and row is set as don't split, set 
the same value for the whole table.
         if( m_aRowProperties.size() == 1 && m_aRowProperties[0] )
commit 779489ca5ad11476b39555d7b3169d320ff89d4b
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Fri Jul 1 09:48:38 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Jul 1 15:32:30 2022 +0200

    tdf#137544 reserve space in polygon
    
    Change-Id: I868584965b122735b8eb55cc17a3ee11a772b88a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136721
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/basegfx/source/polygon/b2dpolygontools.cxx 
b/basegfx/source/polygon/b2dpolygontools.cxx
index c6eb3cf5b28b..4b8550546e5c 100644
--- a/basegfx/source/polygon/b2dpolygontools.cxx
+++ b/basegfx/source/polygon/b2dpolygontools.cxx
@@ -3330,6 +3330,8 @@ namespace basegfx::utils
 
             if(0 != nCount)
             {
+                aRetval.reserve(nCount);
+
                 const css::awt::Point* pPointSequence = 
rPointSequenceSource.getConstArray();
                 const css::drawing::PolygonFlags* pFlagSequence = 
rFlagSequenceSource.getConstArray();
 

Reply via email to