Accepting request 982812 from LibreOffice:Factory

OBS-URL: https://build.opensuse.org/request/show/982812
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libreoffice?expand=0&rev=256
This commit is contained in:
Dominique Leuenberger 2022-06-17 19:20:29 +00:00 committed by Git OBS Bridge
commit 96993777db
19 changed files with 484 additions and 791 deletions

View File

@ -1,436 +0,0 @@
From d2a2d16b4836bf62db7c32faffa0c5b6d0d30a5e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCl=C5=9Fah=20K=C3=B6se?= <gulsah.kose@collabora.com>
Date: Mon, 11 Apr 2022 18:33:30 +0300
Subject: [PATCH] Revert "Revert "tdf#135843 Implement inside horizontal
vertical borders.""
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This reverts commit ea5a3e0247b1230c1fe7e2cb0afc597e56d0b4c2.
Change-Id: Ibd333c1e7b1530a2b6d9b8c5efbf4d9c822fa058
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132885
Tested-by: Jenkins
Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
---
oox/inc/drawingml/table/tablecell.hxx | 2 +
oox/source/drawingml/table/tablecell.cxx | 112 ++++++++++++++++--
.../drawingml/table/tableproperties.cxx | 16 ++-
sd/qa/unit/data/pptx/bnc480256-2.pptx | Bin 0 -> 23387 bytes
sd/qa/unit/data/pptx/tdf135843_insideH.pptx | Bin 0 -> 33449 bytes
sd/qa/unit/import-tests.cxx | 2 +-
sd/qa/unit/layout-tests.cxx | 38 ++++++
7 files changed, 158 insertions(+), 12 deletions(-)
create mode 100644 sd/qa/unit/data/pptx/bnc480256-2.pptx
create mode 100644 sd/qa/unit/data/pptx/tdf135843_insideH.pptx
diff --git a/oox/inc/drawingml/table/tablecell.hxx b/oox/inc/drawingml/table/tablecell.hxx
index d6e91da042f7..988b0d057a13 100644
--- a/oox/inc/drawingml/table/tablecell.hxx
+++ b/oox/inc/drawingml/table/tablecell.hxx
@@ -82,6 +82,8 @@ private:
oox::drawingml::LineProperties maLinePropertiesRight;
oox::drawingml::LineProperties maLinePropertiesTop;
oox::drawingml::LineProperties maLinePropertiesBottom;
+ oox::drawingml::LineProperties maLinePropertiesInsideH;
+ oox::drawingml::LineProperties maLinePropertiesInsideV;
oox::drawingml::LineProperties maLinePropertiesTopLeftToBottomRight;
oox::drawingml::LineProperties maLinePropertiesBottomLeftToTopRight;
diff --git a/oox/source/drawingml/table/tablecell.cxx b/oox/source/drawingml/table/tablecell.cxx
index e5ab3372d42e..15ab06303e3b 100644
--- a/oox/source/drawingml/table/tablecell.cxx
+++ b/oox/source/drawingml/table/tablecell.cxx
@@ -81,6 +81,14 @@ static void applyLineAttributes( const ::oox::core::XmlFilterBase& rFilterBase,
aBorderLine.LineWidth = static_cast< sal_Int16 >( GetCoordinate( rLineProperties.moLineWidth.get( 0 ) ) / 2 );
aBorderLine.LineDistance = 0;
}
+ else
+ {
+ aBorderLine.Color = sal_Int32( COL_AUTO );
+ aBorderLine.OuterLineWidth = static_cast< sal_Int16 >( GetCoordinate( rLineProperties.moLineWidth.get( 0 ) ) / 4 );
+ aBorderLine.InnerLineWidth = static_cast< sal_Int16 >( GetCoordinate( rLineProperties.moLineWidth.get( 0 ) ) / 4 );
+ aBorderLine.LineWidth = 12700;
+ aBorderLine.LineDistance = 0;
+ }
if ( rLineProperties.moPresetDash.has() )
{
@@ -150,9 +158,16 @@ static void applyTableStylePart( const ::oox::core::XmlFilterBase& rFilterBase,
oox::drawingml::LineProperties& rRightBorder,
oox::drawingml::LineProperties& rTopBorder,
oox::drawingml::LineProperties& rBottomBorder,
+ oox::drawingml::LineProperties& rInsideHBorder,
+ oox::drawingml::LineProperties& rInsideVBorder,
oox::drawingml::LineProperties& rTopLeftToBottomRightBorder,
oox::drawingml::LineProperties& rBottomLeftToTopRightBorder,
- TableStylePart& rTableStylePart )
+ TableStylePart& rTableStylePart,
+ bool bIsWholeTable = false,
+ sal_Int32 nCol = 0,
+ sal_Int32 nMaxCol = 0,
+ sal_Int32 nRow = 0,
+ sal_Int32 nMaxRow = 0)
{
::oox::drawingml::FillPropertiesPtr& rPartFillPropertiesPtr( rTableStylePart.getFillProperties() );
if ( rPartFillPropertiesPtr )
@@ -169,12 +184,35 @@ static void applyTableStylePart( const ::oox::core::XmlFilterBase& rFilterBase,
}
}
- applyBorder( rFilterBase, rTableStylePart, XML_left, rLeftBorder );
- applyBorder( rFilterBase, rTableStylePart, XML_right, rRightBorder );
- applyBorder( rFilterBase, rTableStylePart, XML_top, rTopBorder );
- applyBorder( rFilterBase, rTableStylePart, XML_bottom, rBottomBorder );
- applyBorder( rFilterBase, rTableStylePart, XML_tl2br, rTopLeftToBottomRightBorder );
- applyBorder( rFilterBase, rTableStylePart, XML_tr2bl, rBottomLeftToTopRightBorder );
+ // Left, right, top and bottom side of the whole table should be mean outer frame of the whole table.
+ // Without this check it means left top right and bottom of whole cells of whole table.
+ if (bIsWholeTable)
+ {
+ if (nCol == 0)
+ applyBorder( rFilterBase, rTableStylePart, XML_left, rLeftBorder );
+ if (nCol == nMaxCol)
+ applyBorder( rFilterBase, rTableStylePart, XML_right, rRightBorder );
+ if (nRow == 0)
+ applyBorder( rFilterBase, rTableStylePart, XML_top, rTopBorder );
+ if (nRow == nMaxRow)
+ applyBorder( rFilterBase, rTableStylePart, XML_bottom, rBottomBorder );
+
+ applyBorder( rFilterBase, rTableStylePart, XML_insideH, rInsideHBorder );
+ applyBorder( rFilterBase, rTableStylePart, XML_insideV, rInsideVBorder );
+ applyBorder( rFilterBase, rTableStylePart, XML_tl2br, rTopLeftToBottomRightBorder );
+ applyBorder( rFilterBase, rTableStylePart, XML_tr2bl, rBottomLeftToTopRightBorder );
+ }
+ else
+ {
+ applyBorder( rFilterBase, rTableStylePart, XML_left, rLeftBorder );
+ applyBorder( rFilterBase, rTableStylePart, XML_right, rRightBorder );
+ applyBorder( rFilterBase, rTableStylePart, XML_top, rTopBorder );
+ applyBorder( rFilterBase, rTableStylePart, XML_bottom, rBottomBorder );
+ applyBorder( rFilterBase, rTableStylePart, XML_tl2br, rTopLeftToBottomRightBorder );
+ applyBorder( rFilterBase, rTableStylePart, XML_tr2bl, rBottomLeftToTopRightBorder );
+ applyBorder( rFilterBase, rTableStylePart, XML_insideH, rInsideHBorder );
+ applyBorder( rFilterBase, rTableStylePart, XML_insideV, rInsideVBorder );
+ }
aTextCharProps.maLatinFont = rTableStylePart.getLatinFont();
aTextCharProps.maAsianFont = rTableStylePart.getAsianFont();
@@ -233,6 +271,8 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, cons
oox::drawingml::LineProperties aLinePropertiesRight;
oox::drawingml::LineProperties aLinePropertiesTop;
oox::drawingml::LineProperties aLinePropertiesBottom;
+ oox::drawingml::LineProperties aLinePropertiesInsideH;
+ oox::drawingml::LineProperties aLinePropertiesInsideV;
oox::drawingml::LineProperties aLinePropertiesTopLeftToBottomRight;
oox::drawingml::LineProperties aLinePropertiesBottomLeftToTopRight;
@@ -241,9 +281,16 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, cons
aLinePropertiesRight,
aLinePropertiesTop,
aLinePropertiesBottom,
+ aLinePropertiesInsideH,
+ aLinePropertiesInsideV,
aLinePropertiesTopLeftToBottomRight,
aLinePropertiesBottomLeftToTopRight,
- rTable.getWholeTbl() );
+ rTable.getWholeTbl(),
+ true,
+ nColumn,
+ nMaxColumn,
+ nRow,
+ nMaxRow );
if ( rProperties.isFirstRow() && ( nRow == 0 ) )
{
@@ -252,6 +299,8 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, cons
aLinePropertiesRight,
aLinePropertiesTop,
aLinePropertiesBottom,
+ aLinePropertiesInsideH,
+ aLinePropertiesInsideV,
aLinePropertiesTopLeftToBottomRight,
aLinePropertiesBottomLeftToTopRight,
rTable.getFirstRow() );
@@ -263,6 +312,8 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, cons
aLinePropertiesRight,
aLinePropertiesTop,
aLinePropertiesBottom,
+ aLinePropertiesInsideH,
+ aLinePropertiesInsideV,
aLinePropertiesTopLeftToBottomRight,
aLinePropertiesBottomLeftToTopRight,
rTable.getLastRow() );
@@ -274,6 +325,8 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, cons
aLinePropertiesRight,
aLinePropertiesTop,
aLinePropertiesBottom,
+ aLinePropertiesInsideH,
+ aLinePropertiesInsideV,
aLinePropertiesTopLeftToBottomRight,
aLinePropertiesBottomLeftToTopRight,
rTable.getFirstCol() );
@@ -285,6 +338,8 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, cons
aLinePropertiesRight,
aLinePropertiesTop,
aLinePropertiesBottom,
+ aLinePropertiesInsideH,
+ aLinePropertiesInsideV,
aLinePropertiesTopLeftToBottomRight,
aLinePropertiesBottomLeftToTopRight,
rTable.getLastCol() );
@@ -306,6 +361,8 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, cons
aLinePropertiesRight,
aLinePropertiesTop,
aLinePropertiesBottom,
+ aLinePropertiesInsideH,
+ aLinePropertiesInsideV,
aLinePropertiesTopLeftToBottomRight,
aLinePropertiesBottomLeftToTopRight,
rTable.getBand2H() );
@@ -317,6 +374,8 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, cons
aLinePropertiesRight,
aLinePropertiesTop,
aLinePropertiesBottom,
+ aLinePropertiesInsideH,
+ aLinePropertiesInsideV,
aLinePropertiesTopLeftToBottomRight,
aLinePropertiesBottomLeftToTopRight,
rTable.getBand1H() );
@@ -330,6 +389,8 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, cons
aLinePropertiesRight,
aLinePropertiesTop,
aLinePropertiesBottom,
+ aLinePropertiesInsideH,
+ aLinePropertiesInsideV,
aLinePropertiesTopLeftToBottomRight,
aLinePropertiesBottomLeftToTopRight,
rTable.getNwCell() );
@@ -341,6 +402,8 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, cons
aLinePropertiesRight,
aLinePropertiesTop,
aLinePropertiesBottom,
+ aLinePropertiesInsideH,
+ aLinePropertiesInsideV,
aLinePropertiesTopLeftToBottomRight,
aLinePropertiesBottomLeftToTopRight,
rTable.getSwCell() );
@@ -352,6 +415,8 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, cons
aLinePropertiesRight,
aLinePropertiesTop,
aLinePropertiesBottom,
+ aLinePropertiesInsideH,
+ aLinePropertiesInsideV,
aLinePropertiesTopLeftToBottomRight,
aLinePropertiesBottomLeftToTopRight,
rTable.getNeCell() );
@@ -363,6 +428,8 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, cons
aLinePropertiesRight,
aLinePropertiesTop,
aLinePropertiesBottom,
+ aLinePropertiesInsideH,
+ aLinePropertiesInsideV,
aLinePropertiesTopLeftToBottomRight,
aLinePropertiesBottomLeftToTopRight,
rTable.getSeCell() );
@@ -384,6 +451,8 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, cons
aLinePropertiesRight,
aLinePropertiesTop,
aLinePropertiesBottom,
+ aLinePropertiesInsideH,
+ aLinePropertiesInsideV,
aLinePropertiesTopLeftToBottomRight,
aLinePropertiesBottomLeftToTopRight,
rTable.getBand2V() );
@@ -395,6 +464,8 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, cons
aLinePropertiesRight,
aLinePropertiesTop,
aLinePropertiesBottom,
+ aLinePropertiesInsideH,
+ aLinePropertiesInsideV,
aLinePropertiesTopLeftToBottomRight,
aLinePropertiesBottomLeftToTopRight,
rTable.getBand1V() );
@@ -405,8 +476,11 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, cons
aLinePropertiesRight.assignUsed( maLinePropertiesRight );
aLinePropertiesTop.assignUsed( maLinePropertiesTop );
aLinePropertiesBottom.assignUsed( maLinePropertiesBottom );
+ aLinePropertiesInsideH.assignUsed( maLinePropertiesInsideH );
+ aLinePropertiesInsideV.assignUsed( maLinePropertiesInsideV );
aLinePropertiesTopLeftToBottomRight.assignUsed( maLinePropertiesTopLeftToBottomRight );
aLinePropertiesBottomLeftToTopRight.assignUsed( maLinePropertiesBottomLeftToTopRight );
+
applyLineAttributes( rFilterBase, xPropSet, aLinePropertiesLeft, PROP_LeftBorder );
applyLineAttributes( rFilterBase, xPropSet, aLinePropertiesRight, PROP_RightBorder );
applyLineAttributes( rFilterBase, xPropSet, aLinePropertiesTop, PROP_TopBorder );
@@ -414,6 +488,28 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, cons
applyLineAttributes( rFilterBase, xPropSet, aLinePropertiesTopLeftToBottomRight, PROP_DiagonalTLBR );
applyLineAttributes( rFilterBase, xPropSet, aLinePropertiesBottomLeftToTopRight, PROP_DiagonalBLTR );
+ // Convert insideH to Top and Bottom, InsideV to Left and Right. Exclude the outer borders.
+ if(nRow != 0)
+ {
+ aLinePropertiesInsideH.assignUsed( aLinePropertiesTop );
+ applyLineAttributes( rFilterBase, xPropSet, aLinePropertiesInsideH, PROP_TopBorder );
+ }
+ if(nRow != nMaxRow)
+ {
+ aLinePropertiesInsideH.assignUsed( aLinePropertiesBottom );
+ applyLineAttributes( rFilterBase, xPropSet, aLinePropertiesInsideH, PROP_BottomBorder );
+ }
+ if(nColumn != 0)
+ {
+ aLinePropertiesInsideV.assignUsed( aLinePropertiesLeft );
+ applyLineAttributes( rFilterBase, xPropSet, aLinePropertiesInsideV, PROP_LeftBorder );
+ }
+ if(nColumn != nMaxColumn)
+ {
+ aLinePropertiesInsideV.assignUsed( aLinePropertiesRight );
+ applyLineAttributes( rFilterBase, xPropSet, aLinePropertiesInsideV, PROP_RightBorder );
+ }
+
if (rProperties.getBgColor().isUsed() && !maFillProperties.maFillColor.isUsed() && maFillProperties.moFillType.get() == XML_noFill)
{
maFillProperties.moFillType = XML_solidFill;
diff --git a/oox/source/drawingml/table/tableproperties.cxx b/oox/source/drawingml/table/tableproperties.cxx
index 1622b8fc22ca..2c45004b3357 100644
--- a/oox/source/drawingml/table/tableproperties.cxx
+++ b/oox/source/drawingml/table/tableproperties.cxx
@@ -143,7 +143,8 @@ void TableProperties::pushToPropSet(const ::oox::core::XmlFilterBase& rFilterBas
{
sal_Int32 nColumn = 0;
sal_Int32 nColumnSize = tableRow.getTableCells().size();
- sal_Int32 nRemovedColumn = 0; //
+ sal_Int32 nRemovedColumn = 0;
+ sal_Int32 nRemovedRow = 0;
for (sal_Int32 nColIndex = 0; nColIndex < nColumnSize; nColIndex++)
{
@@ -169,6 +170,9 @@ void TableProperties::pushToPropSet(const ::oox::core::XmlFilterBase& rFilterBas
// props with pushToXCell.
bMerged = true;
}
+
+ if (rTableCell.getRowSpan() > 1)
+ nRemovedRow = (rTableCell.getRowSpan() - 1);
}
Reference<XCellRange> xCellRange(xTable, UNO_QUERY_THROW);
@@ -190,11 +194,17 @@ void TableProperties::pushToPropSet(const ::oox::core::XmlFilterBase& rFilterBas
else
xCell = xCellRange->getCellByPosition(nColumn, nRow);
+
+ sal_Int32 nMaxCol = tableRow.getTableCells().size() - nRemovedColumn - 1;
+ sal_Int32 nMaxRow = mvTableRows.size() - nRemovedRow - 1;
+
rTableCell.pushToXCell(rFilterBase, pMasterTextListStyle, xCell, *this, rTableStyle,
- nColumn, tableRow.getTableCells().size() - 1, nRow,
- mvTableRows.size() - 1);
+ nColumn, nMaxCol, nRow, nMaxRow);
+
if (bMerged)
nColumn += nRemovedColumn;
+
+ nRemovedRow = 0;
}
++nColumn;
}
--
2.34.1
From 6bf805ffb62a13f2f44a26f47f732f05c954ef49 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCl=C5=9Fah=20K=C3=B6se?= <gulsah.kose@collabora.com>
Date: Mon, 14 Mar 2022 14:52:59 +0300
Subject: [PATCH] tdf#147766 Export empty lines as line with noFill
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
We have a case that 0 width line but has auto color. If that case
exported there is no line over there, LO handles normally but MSO draws
back borders as default. To prevent this we have to export them as line
with noFill.
testTableBorderLineStyle change reverts a workaround for
3faf005a367cbd28077403bf93810bbaf4805851
testBnc480256 Cell(1,0) still invisible. We are just checking
this with another way.
Change-Id: If5f6d2dbdba5c295d58307fcfe3b37629ede8a8e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131532
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132886
---
oox/source/drawingml/table/tablecell.cxx | 10 +---------
oox/source/export/shapes.cxx | 6 ++++++
sd/qa/unit/export-tests.cxx | 3 ++-
sd/qa/unit/import-tests.cxx | 2 +-
4 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/oox/source/drawingml/table/tablecell.cxx b/oox/source/drawingml/table/tablecell.cxx
index 15ab06303e3b..fdf7950dcf2c 100644
--- a/oox/source/drawingml/table/tablecell.cxx
+++ b/oox/source/drawingml/table/tablecell.cxx
@@ -73,20 +73,12 @@ static void applyLineAttributes( const ::oox::core::XmlFilterBase& rFilterBase,
aBorderLine.LineWidth = static_cast< sal_Int16 >( GetCoordinate( rLineProperties.moLineWidth.get( 0 ) ) / 2 );
aBorderLine.LineDistance = 0;
}
- else if ( rLineProperties.moLineWidth.get(0)!=0 )
- {
- aBorderLine.Color = sal_Int32( COL_AUTO );
- aBorderLine.OuterLineWidth = static_cast< sal_Int16 >( GetCoordinate( rLineProperties.moLineWidth.get( 0 ) ) / 4 );
- aBorderLine.InnerLineWidth = static_cast< sal_Int16 >( GetCoordinate( rLineProperties.moLineWidth.get( 0 ) ) / 4 );
- aBorderLine.LineWidth = static_cast< sal_Int16 >( GetCoordinate( rLineProperties.moLineWidth.get( 0 ) ) / 2 );
- aBorderLine.LineDistance = 0;
- }
else
{
aBorderLine.Color = sal_Int32( COL_AUTO );
aBorderLine.OuterLineWidth = static_cast< sal_Int16 >( GetCoordinate( rLineProperties.moLineWidth.get( 0 ) ) / 4 );
aBorderLine.InnerLineWidth = static_cast< sal_Int16 >( GetCoordinate( rLineProperties.moLineWidth.get( 0 ) ) / 4 );
- aBorderLine.LineWidth = 12700;
+ aBorderLine.LineWidth = static_cast< sal_Int16 >( GetCoordinate( rLineProperties.moLineWidth.get( 0 ) ) / 2 );
aBorderLine.LineDistance = 0;
}
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 138106938ee2..97d09ca1be2e 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -1975,6 +1975,12 @@ void ShapeExport::WriteBorderLine(const sal_Int32 XML_line, const BorderLine2& r
DrawingML::WriteSolidFill( ::Color(ColorTransparency, rBorderLine.Color) );
mpFS->endElementNS( XML_a, XML_line );
}
+ else if( nBorderWidth == 0)
+ {
+ mpFS->startElementNS(XML_a, XML_line);
+ mpFS->singleElementNS(XML_a, XML_noFill);
+ mpFS->endElementNS( XML_a, XML_line );
+ }
}
void ShapeExport::WriteTableCellBorders(const Reference< XPropertySet>& xCellPropSet)
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index f1d0281aab0d..729d9f154b12 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -602,9 +602,10 @@ void SdExportTest::testBnc480256()
xCell->getPropertyValue("FillColor") >>= nColor;
CPPUNIT_ASSERT_EQUAL(Color(0x4697e0), nColor);
+ // This border should be invisible.
xCell.set(xTable->getCellByPosition(1, 0), uno::UNO_QUERY_THROW);
xCell->getPropertyValue("BottomBorder") >>= aBorderLine;
- CPPUNIT_ASSERT_EQUAL(COL_AUTO, Color(ColorTransparency, aBorderLine.Color));
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), sal_Int32(aBorderLine.LineWidth));
xDocShRef->DoClose();
}
--
2.34.1

View File

@ -1,286 +0,0 @@
From 8dfa3f0fcd057b402ebde0a4ad102956275f717e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= <l.lunak@collabora.com>
Date: Mon, 4 Apr 2022 16:30:58 +0200
Subject: [PATCH] limit Interpret() for dirty cells only to the given row range
(bsc#1197497)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
ScColumn::InterpretDirtyCells() already takes a row range, and Interpret()
can take a range inside a formula group, so don't lose the information
in DirtyCellInterpreter, otherwise a whole large formula could be
interpreted when just a subset would be enough.
Change-Id: I93e5a7a212976be6fd588de6f68204cd1a271348
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133305
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
(cherry picked from commit c315a2f7b99fc1dfbc3fc834590d22fbe41ea70f)
---
sc/source/core/data/column3.cxx | 37 +++++++++++++++++++++++++++++++--
1 file changed, 35 insertions(+), 2 deletions(-)
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 74b2e1ac7fad..7e133d565558 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -102,13 +102,46 @@ void ScColumn::BroadcastRows( SCROW nStartRow, SCROW nEndRow, SfxHintId nHint )
namespace {
-struct DirtyCellInterpreter
+class DirtyCellInterpreter
{
+public:
void operator() (size_t, ScFormulaCell* p)
{
- if (p->GetDirty())
+ if(!p->GetDirty())
+ return;
+ // Interpret() takes a range in a formula group, so group those together.
+ if( firstCell != nullptr && p->GetCellGroup() == p->GetCellGroup()
+ && p->aPos.Row() == lastPos.Row() + 1 )
+ {
+ assert( p->aPos.Tab() == lastPos.Tab() && p->aPos.Col() == lastPos.Col());
+ lastPos = p->aPos; // Extend range.
+ return;
+ }
+ flushPending();
+ if( !p->GetCellGroup())
+ {
p->Interpret();
+ return;
+ }
+ firstCell = p;
+ lastPos = p->aPos;
+
+ }
+ ~DirtyCellInterpreter()
+ {
+ flushPending();
+ }
+private:
+ void flushPending()
+ {
+ if(firstCell == nullptr)
+ return;
+ SCROW firstRow = firstCell->GetCellGroup()->mpTopCell->aPos.Row();
+ firstCell->Interpret(firstCell->aPos.Row() - firstRow, lastPos.Row() - firstRow);
+ firstCell = nullptr;
}
+ ScFormulaCell* firstCell = nullptr;
+ ScAddress lastPos;
};
}
--
2.35.3
From 7d66afaf709154c1af9b83994f7c87afb4be254e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= <l.lunak@collabora.com>
Date: Mon, 4 Apr 2022 17:52:04 +0200
Subject: [PATCH] try to limit cell interpreting to only visible cells when
drawing
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
If there's a document with a huge formula group, InterpretDirtyCells()
on load will only interpret the range needed for drawing. But then
scrolling just a bit could result in e.g. IsValue() call on a cell,
and that could result in unrestricted Interpret() on the whole
huge formula group, which could be slow. So explicitly interpret
just the drawn cells in the hope that it'll avoid any further
Interpret() calls.
Change-Id: I01c9f95cf8a1cf240b798feef27d21010957030c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133306
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
(cherry picked from commit 64cb1d10fffccebbc825c858083f13eb717b0553)
---
sc/inc/column.hxx | 1 +
sc/inc/document.hxx | 2 ++
sc/inc/table.hxx | 1 +
sc/source/core/data/column3.cxx | 39 +++++++++++++++++++++++++++-----
sc/source/core/data/document.cxx | 17 ++++++++++++++
sc/source/core/data/table1.cxx | 7 ++++++
sc/source/ui/view/output2.cxx | 5 ++++
7 files changed, 66 insertions(+), 6 deletions(-)
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index 01e58fb9d055..b8e348d00e70 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -651,6 +651,7 @@ public:
bool IsDrawObjectsEmptyBlock(SCROW nStartRow, SCROW nEndRow) const;
void InterpretDirtyCells( SCROW nRow1, SCROW nRow2 );
+ void InterpretCellsIfNeeded( SCROW nRow1, SCROW nRow2 );
static void JoinNewFormulaCell( const sc::CellStoreType::position_type& aPos, ScFormulaCell& rCell );
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 029a339f94a7..89ca4dee068a 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -1318,6 +1318,8 @@ public:
void SetDirty( const ScRange&, bool bIncludeEmptyCells );
void SetTableOpDirty( const ScRange& ); // for Interpreter TableOp
void InterpretDirtyCells( const ScRangeList& rRanges );
+ // Interprets cells that have NeedsInterpret(), i.e. the same like calling MaybeInterpret() on them.
+ void InterpretCellsIfNeeded( const ScRangeList& rRanges );
SC_DLLPUBLIC void CalcAll();
SC_DLLPUBLIC void CalcAfterLoad( bool bStartListening = true );
void CompileAll();
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index 5602d6dcacfe..27a1fcf67fd8 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -1031,6 +1031,7 @@ public:
void FillMatrix( ScMatrix& rMat, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, svl::SharedStringPool* pPool ) const;
void InterpretDirtyCells( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 );
+ void InterpretCellsIfNeeded( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 );
void SetFormulaResults( SCCOL nCol, SCROW nRow, const double* pResults, size_t nLen );
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 7e133d565558..d3c17d1da6d7 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -102,13 +102,11 @@ void ScColumn::BroadcastRows( SCROW nStartRow, SCROW nEndRow, SfxHintId nHint )
namespace {
-class DirtyCellInterpreter
+class CellInterpreterBase
{
-public:
- void operator() (size_t, ScFormulaCell* p)
+protected:
+ void Interpret(ScFormulaCell* p)
{
- if(!p->GetDirty())
- return;
// Interpret() takes a range in a formula group, so group those together.
if( firstCell != nullptr && p->GetCellGroup() == p->GetCellGroup()
&& p->aPos.Row() == lastPos.Row() + 1 )
@@ -127,7 +125,7 @@ public:
lastPos = p->aPos;
}
- ~DirtyCellInterpreter()
+ ~CellInterpreterBase()
{
flushPending();
}
@@ -144,6 +142,26 @@ private:
ScAddress lastPos;
};
+class DirtyCellInterpreter : public CellInterpreterBase
+{
+public:
+ void operator() (size_t, ScFormulaCell* p)
+ {
+ if(p->GetDirty())
+ Interpret(p);
+ }
+};
+
+class NeedsInterpretCellInterpreter : public CellInterpreterBase
+{
+public:
+ void operator() (size_t, ScFormulaCell* p)
+ {
+ if(p->NeedsInterpret())
+ Interpret(p);
+ }
+};
+
}
void ScColumn::InterpretDirtyCells( SCROW nRow1, SCROW nRow2 )
@@ -155,6 +173,15 @@ void ScColumn::InterpretDirtyCells( SCROW nRow1, SCROW nRow2 )
sc::ProcessFormula(maCells.begin(), maCells, nRow1, nRow2, aFunc);
}
+void ScColumn::InterpretCellsIfNeeded( SCROW nRow1, SCROW nRow2 )
+{
+ if (!GetDoc().ValidRow(nRow1) || !GetDoc().ValidRow(nRow2) || nRow1 > nRow2)
+ return;
+
+ NeedsInterpretCellInterpreter aFunc;
+ sc::ProcessFormula(maCells.begin(), maCells, nRow1, nRow2, aFunc);
+}
+
void ScColumn::DeleteContent( SCROW nRow, bool bBroadcast )
{
sc::CellStoreType::position_type aPos = maCells.position(nRow);
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index b62407916300..dbf6233efa6b 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -3923,6 +3923,23 @@ void ScDocument::InterpretDirtyCells( const ScRangeList& rRanges )
mpFormulaGroupCxt.reset();
}
+void ScDocument::InterpretCellsIfNeeded( const ScRangeList& rRanges )
+{
+ for (size_t nPos=0, nRangeCount = rRanges.size(); nPos < nRangeCount; nPos++)
+ {
+ const ScRange& rRange = rRanges[nPos];
+ for (SCTAB nTab = rRange.aStart.Tab(); nTab <= rRange.aEnd.Tab(); ++nTab)
+ {
+ ScTable* pTab = FetchTable(nTab);
+ if (!pTab)
+ return;
+
+ pTab->InterpretCellsIfNeeded(
+ rRange.aStart.Col(), rRange.aStart.Row(), rRange.aEnd.Col(), rRange.aEnd.Row());
+ }
+ }
+}
+
void ScDocument::AddTableOpFormulaCell( ScFormulaCell* pCell )
{
if (m_TableOpList.empty())
diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index d613ec905575..a03ab678e7d0 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -2536,6 +2536,13 @@ void ScTable::InterpretDirtyCells( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW
aCol[nCol].InterpretDirtyCells(nRow1, nRow2);
}
+void ScTable::InterpretCellsIfNeeded( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 )
+{
+ nCol2 = ClampToAllocatedColumns(nCol2);
+ for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
+ aCol[nCol].InterpretCellsIfNeeded(nRow1, nRow2);
+}
+
void ScTable::SetFormulaResults( SCCOL nCol, SCROW nRow, const double* pResults, size_t nLen )
{
if (!ValidCol(nCol))
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index ba4a1b13a795..53ee54fad4c3 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -1552,6 +1552,11 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co
const SfxItemSet* pOldCondSet = nullptr;
SvtScriptType nOldScript = SvtScriptType::NONE;
+ // Try to limit interpreting to only visible cells. Calling e.g. IsValue()
+ // on a formula cell that needs interpreting would call Interpret()
+ // for the entire formula group, which could be large.
+ mpDoc->InterpretCellsIfNeeded( ScRange( nX1, nY1, nTab, nX2, nY2, nTab ));
+
// alternative pattern instances in case we need to modify the pattern
// before processing the cell value.
std::vector<std::unique_ptr<ScPatternAttr> > aAltPatterns;
--
2.35.3

391
bsc1198665.patch Normal file
View File

@ -0,0 +1,391 @@
From 5319087ab75a01793462c8c41cebfa1996cc688a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Toma=C5=BE=20Vajngerl?= <tomaz.vajngerl@collabora.co.uk>
Date: Mon, 6 Jun 2022 22:53:23 +0200
Subject: [PATCH] tdf148321: convert OOXML inset values to text distance values
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Inset values for top, bottom are calcualted differently in OOXML
and need to be coverted on import to the text distance LO values,
that place the text relative to the shape correctly.
At export, the values can be converted back to the OOXML inset
compatible values, but the values are not always converted back to
the same values as the conversion is not bijective, however they
do render the same.
This also adds the test for the conversion when importing and
checks that the exported values are expected.
Change-Id: Ic64eec1a2a80ddad997f916da3e87dc30aaa12be
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135463
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit e216988657e20a1e52986f742ab60464697bcb41)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135504
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
---
oox/inc/drawingml/textbodyproperties.hxx | 17 +-
oox/source/drawingml/shape.cxx | 9 +-
oox/source/drawingml/textbodyproperties.cxx | 129 +++++-
oox/source/export/drawingml.cxx | 48 ++-
...ppunitTest_sd_shape_import_export_tests.mk | 74 ++++
sd/Module_sd.mk | 1 +
sd/qa/unit/ShapeImportExportTest.cxx | 381 ++++++++++++++++++
sd/qa/unit/data/TextDistancesInsets1.pptx | Bin 0 -> 60484 bytes
sd/qa/unit/data/TextDistancesInsets2.pptx | Bin 0 -> 111830 bytes
sd/qa/unit/data/TextDistancesInsets3.pptx | Bin 0 -> 60276 bytes
10 files changed, 619 insertions(+), 40 deletions(-)
create mode 100644 sd/CppunitTest_sd_shape_import_export_tests.mk
create mode 100644 sd/qa/unit/ShapeImportExportTest.cxx
create mode 100644 sd/qa/unit/data/TextDistancesInsets1.pptx
create mode 100644 sd/qa/unit/data/TextDistancesInsets2.pptx
create mode 100644 sd/qa/unit/data/TextDistancesInsets3.pptx
diff --git a/oox/inc/drawingml/textbodyproperties.hxx b/oox/inc/drawingml/textbodyproperties.hxx
index 41fbb832a5d8..7cc1b9d8041c 100644
--- a/oox/inc/drawingml/textbodyproperties.hxx
+++ b/oox/inc/drawingml/textbodyproperties.hxx
@@ -21,12 +21,15 @@
#define INCLUDED_OOX_DRAWINGML_TEXTBODYPROPERTIES_HXX
#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
+#include <com/sun/star/drawing/XShape.hpp>
#include <oox/helper/helper.hxx>
#include <oox/helper/propertymap.hxx>
#include <optional>
+#include <array>
-namespace oox::drawingml {
+class Size;
+namespace oox::drawingml {
struct TextBodyProperties
{
@@ -35,7 +38,7 @@ struct TextBodyProperties
bool mbAnchorCtr;
OptValue< sal_Int32 > moVert;
bool moUpright = false;
- std::optional< sal_Int32 > moInsets[4];
+ std::array<std::optional<sal_Int32>, 4> moInsets;
std::optional< sal_Int32 > moTextOffUpper;
std::optional< sal_Int32 > moTextOffLeft;
std::optional< sal_Int32 > moTextOffLower;
@@ -47,10 +50,14 @@ struct TextBodyProperties
OUString msHorzOverflow;
OUString msVertOverflow;
- explicit TextBodyProperties();
+ std::array<std::optional<sal_Int32>, 4> maTextDistanceValues;
+
+ explicit TextBodyProperties();
+
+ void pushTextDistances(Size const& rShapeSize);
+ void readjustTextDistances(css::uno::Reference<css::drawing::XShape> const& xShape);
+ void pushVertSimulation();
- void pushRotationAdjustments();
- void pushVertSimulation();
};
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index cd800f892030..bebcbae240b6 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -1119,7 +1119,7 @@ Reference< XShape > const & Shape::createAndInsert(
// add properties from textbody to shape properties
if( mpTextBody )
{
- mpTextBody->getTextProperties().pushRotationAdjustments();
+ mpTextBody->getTextProperties().pushTextDistances(Size(aShapeRectHmm.Width, aShapeRectHmm.Height));
aShapeProps.assignUsed( mpTextBody->getTextProperties().maPropertyMap );
// Push char properties as well - specifically useful when this is a placeholder
if( mpMasterTextListStyle && mpMasterTextListStyle->getListStyle()[0].getTextCharacterProperties().moHeight.has() )
@@ -1685,9 +1685,14 @@ Reference< XShape > const & Shape::createAndInsert(
}
}
- if( mxShape.is() )
+ if (mxShape.is())
+ {
finalizeXShape( rFilterBase, rxShapes );
+ if (mpTextBody)
+ mpTextBody->getTextProperties().readjustTextDistances(mxShape);
+ }
+
return mxShape;
}
diff --git a/oox/source/drawingml/textbodyproperties.cxx b/oox/source/drawingml/textbodyproperties.cxx
index 2ffa7de1085f..e44a103e3865 100644
--- a/oox/source/drawingml/textbodyproperties.cxx
+++ b/oox/source/drawingml/textbodyproperties.cxx
@@ -22,9 +22,17 @@
#include <drawingml/textbodyproperties.hxx>
#include <oox/token/properties.hxx>
#include <oox/token/tokens.hxx>
+#include <tools/gen.hxx>
+#include <svx/svdobj.hxx>
+#include <svx/svdotext.hxx>
+#include <svx/svdoashp.hxx>
+#include <svx/sdtditm.hxx>
+
+#include <array>
using namespace ::com::sun::star::drawing;
using namespace ::com::sun::star::text;
+using namespace css;
namespace oox::drawingml {
@@ -57,14 +65,21 @@ void TextBodyProperties::pushVertSimulation()
maPropertyMap.setProperty( PROP_TextHorizontalAdjust, TextHorizontalAdjust_CENTER);
}
-/* Push adjusted values, taking into consideration Shape Rotation */
-void TextBodyProperties::pushRotationAdjustments()
+/* Push text distances / insets, taking into consideration Shape Rotation */
+void TextBodyProperties::pushTextDistances(Size const& rTextAreaSize)
{
- sal_Int32 nOff = 0;
- static sal_Int32 const aProps[] { PROP_TextLeftDistance, PROP_TextUpperDistance, PROP_TextRightDistance, PROP_TextLowerDistance };
- sal_Int32 n = SAL_N_ELEMENTS( aProps );
+ for (auto & rValue : maTextDistanceValues)
+ rValue.reset();
+
+ sal_Int32 nOff = 0;
+ static constexpr const std::array<sal_Int32, 4> aProps {
+ PROP_TextLeftDistance,
+ PROP_TextUpperDistance,
+ PROP_TextRightDistance,
+ PROP_TextLowerDistance
+ };
- switch( moRotation.get(0) )
+ switch (moRotation.get(0))
{
case 90*1*60000: nOff = 3; break;
case 90*2*60000: nOff = 2; break;
@@ -72,28 +87,104 @@ void TextBodyProperties::pushRotationAdjustments()
default: break;
}
- for( sal_Int32 i = 0; i < n; i++ )
+ for (size_t i = 0; i < aProps.size(); i++)
{
sal_Int32 nVal = 0;
// Hack for n#760986
// TODO: Preferred method would be to have a textbox on top
// of the shape and the place it according to the (off,ext)
- if( nOff == 0 && moTextOffLeft ) nVal = *moTextOffLeft;
- if( nOff == 1 && moTextOffUpper ) nVal = *moTextOffUpper;
- if( nOff == 2 && moTextOffRight ) nVal = *moTextOffRight;
- if( nOff == 3 && moTextOffLower ) nVal = *moTextOffLower;
- if( nVal < 0 ) nVal = 0;
-
- if( moInsets[i] )
- maPropertyMap.setProperty( aProps[ nOff ], static_cast< sal_Int32 >( *moInsets[i] + nVal ));
- else if( nVal )
- maPropertyMap.setProperty( aProps[ nOff ], nVal );
-
- nOff = (nOff+1) % n;
+ if (nOff == 0 && moTextOffLeft)
+ nVal = *moTextOffLeft;
+
+ if (nOff == 1 && moTextOffUpper)
+ nVal = *moTextOffUpper;
+
+
+ if (nOff == 2 && moTextOffRight)
+ nVal = *moTextOffRight;
+
+ if (nOff == 3 && moTextOffLower)
+ nVal = *moTextOffLower;
+
+
+ if( nVal < 0 )
+ nVal = 0;
+
+ sal_Int32 nTextOffsetValue = nVal;
+
+ if (moInsets[i])
+ {
+ nTextOffsetValue = *moInsets[i] + nVal;
+ }
+
+ // if inset is set, then always set the value
+ // this prevents the default to be set (0 is a valid value)
+ if (moInsets[i] || nTextOffsetValue)
+ {
+ maTextDistanceValues[nOff] = nTextOffsetValue;
+ }
+
+ nOff = (nOff + 1) % aProps.size();
+ }
+
+ // Check if bottom and top are set
+ if (maTextDistanceValues[1] && maTextDistanceValues[3])
+ {
+ double nHeight = rTextAreaSize.getHeight();
+
+ double nTop = *maTextDistanceValues[1];
+ double nBottom = *maTextDistanceValues[3];
+
+ // Check if top + bottom is more than text area height.
+ // If yes, we need to adjust the values as defined in OOXML.
+ if (nTop + nBottom >= nHeight)
+ {
+ double diffFactor = (nTop + nBottom - nHeight) / 2.0;
+
+ maTextDistanceValues[1] = nTop - diffFactor;
+ maTextDistanceValues[3] = nBottom - diffFactor;
+ }
+ }
+
+ for (size_t i = 0; i < aProps.size(); i++)
+ {
+ if (maTextDistanceValues[i])
+ maPropertyMap.setProperty(aProps[i], *maTextDistanceValues[i]);
}
}
+/* Readjust the text distances / insets if necessary to take
+ the text area into account, not just the shape area*/
+void TextBodyProperties::readjustTextDistances(uno::Reference<drawing::XShape> const& xShape)
+{
+ // Only for custom shapes (for now)
+ auto* pCustomShape = dynamic_cast<SdrObjCustomShape*>(SdrObject::getSdrObjectFromXShape(xShape));
+ if (pCustomShape)
+ {
+ sal_Int32 nLower = pCustomShape->GetTextLowerDistance();
+ sal_Int32 nUpper = pCustomShape->GetTextUpperDistance();
+
+ pCustomShape->SetMergedItem(makeSdrTextUpperDistItem(0));
+ pCustomShape->SetMergedItem(makeSdrTextLowerDistItem(0));
+
+ tools::Rectangle aAnchorRect;
+ pCustomShape->TakeTextAnchorRect(aAnchorRect);
+ Size aAnchorSize = aAnchorRect.GetSize();
+
+ pushTextDistances(aAnchorSize);
+ if (maTextDistanceValues[1] && maTextDistanceValues[3])
+ {
+ nLower = *maTextDistanceValues[3];
+ nUpper = *maTextDistanceValues[1];
+ }
+
+ pCustomShape->SetMergedItem(makeSdrTextLowerDistItem(nLower));
+ pCustomShape->SetMergedItem(makeSdrTextUpperDistItem(nUpper));
+ }
+}
+
+
} // namespace oox::drawingml
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 2a11fa507959..c4795cf9e5b8 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -3132,20 +3132,22 @@ void DrawingML::WriteText(const Reference<XInterface>& rXIface, bool bBodyPr, bo
sal_Int32 nXmlNamespace, bool bWritePropertiesAsLstStyles)
{
// ToDo: Fontwork in DOCX
- Reference< XText > xXText( rXIface, UNO_QUERY );
+ uno::Reference<XText> xXText(rXIface, UNO_QUERY);
if( !xXText.is() )
return;
- Reference< XPropertySet > rXPropSet( rXIface, UNO_QUERY );
+ uno::Reference<drawing::XShape> xShape(rXIface, UNO_QUERY);
+ uno::Reference<XPropertySet> rXPropSet(rXIface, UNO_QUERY);
sal_Int32 nTextPreRotateAngle = 0;
double nTextRotateAngle = 0;
-#define DEFLRINS 254
-#define DEFTBINS 127
- sal_Int32 nLeft, nRight, nTop, nBottom;
- nLeft = nRight = DEFLRINS;
- nTop = nBottom = DEFTBINS;
+ constexpr const sal_Int32 constDefaultLeftRightInset = 254;
+ constexpr const sal_Int32 constDefaultTopBottomInset = 127;
+ sal_Int32 nLeft = constDefaultLeftRightInset;
+ sal_Int32 nRight = constDefaultLeftRightInset;
+ sal_Int32 nTop = constDefaultTopBottomInset;
+ sal_Int32 nBottom = constDefaultTopBottomInset;
// top inset looks a bit different compared to ppt export
// check if something related doesn't work as expected
@@ -3158,6 +3160,27 @@ void DrawingML::WriteText(const Reference<XInterface>& rXIface, bool bBodyPr, bo
if (GetProperty(rXPropSet, "TextLowerDistance"))
mAny >>= nBottom;
+ // Transform the text distance values so they are compatible with OOXML insets
+ if (xShape.is())
+ {
+ sal_Int32 nTextHeight = xShape->getSize().Width;
+
+ auto* pCustomShape = dynamic_cast<SdrObjCustomShape*>(SdrObject::getSdrObjectFromXShape(xShape));
+ if (pCustomShape)
+ {
+ tools::Rectangle aAnchorRect;
+ pCustomShape->TakeTextAnchorRect(aAnchorRect);
+ nTextHeight = aAnchorRect.GetSize().getHeight();
+ }
+
+ if (nTop + nBottom >= nTextHeight)
+ {
+ sal_Int32 nDiff = std::abs(std::min(nTop, nBottom));
+ nTop += nDiff;
+ nBottom += nDiff;
+ }
+ }
+
TextVerticalAdjust eVerticalAlignment( TextVerticalAdjust_TOP );
const char* sVerticalAlignment = nullptr;
if (GetProperty(rXPropSet, "TextVerticalAdjust"))
@@ -3229,7 +3252,6 @@ void DrawingML::WriteText(const Reference<XInterface>& rXIface, bool bBodyPr, bo
{
if (mpTextExport)
{
- uno::Reference<drawing::XShape> xShape(rXIface, uno::UNO_QUERY);
if (xShape)
{
auto xTextFrame = mpTextExport->GetUnoTextFrame(xShape);
@@ -3377,10 +3399,10 @@ void DrawingML::WriteText(const Reference<XInterface>& rXIface, bool bBodyPr, bo
XML_horzOverflow, sHorzOverflow,
XML_vertOverflow, sVertOverflow,
XML_fromWordArt, sax_fastparser::UseIf("1", bFromWordArt),
- XML_lIns, sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nLeft)), nLeft != DEFLRINS),
- XML_rIns, sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nRight)), nRight != DEFLRINS),
- XML_tIns, sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nTop)), nTop != DEFTBINS),
- XML_bIns, sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nBottom)), nBottom != DEFTBINS),
+ XML_lIns, sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nLeft)), nLeft != constDefaultLeftRightInset),
+ XML_rIns, sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nRight)), nRight != constDefaultLeftRightInset),
+ XML_tIns, sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nTop)), nTop != constDefaultTopBottomInset),
+ XML_bIns, sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nBottom)), nBottom != constDefaultTopBottomInset),
XML_anchor, sVerticalAlignment,
XML_anchorCtr, sax_fastparser::UseIf("1", bHorizontalCenter),
XML_vert, sWritingMode,
@@ -3465,7 +3487,6 @@ void DrawingML::WriteText(const Reference<XInterface>& rXIface, bool bBodyPr, bo
{
// tdf#112312: only custom shapes obey the TextAutoGrowHeight option
bool bTextAutoGrowHeight = false;
- uno::Reference<drawing::XShape> xShape(rXIface, uno::UNO_QUERY);
auto pSdrObjCustomShape = xShape.is() ? dynamic_cast<SdrObjCustomShape*>(SdrObject::getSdrObjectFromXShape(xShape)) : nullptr;
if (pSdrObjCustomShape && GetProperty(rXPropSet, "TextAutoGrowHeight"))
{
@@ -3517,7 +3538,6 @@ void DrawingML::WriteText(const Reference<XInterface>& rXIface, bool bBodyPr, bo
if( !enumeration.is() )
return;
- uno::Reference<drawing::XShape> xShape(rXIface, uno::UNO_QUERY);
SdrObject* pSdrObject = xShape.is() ? SdrObject::getSdrObjectFromXShape(xShape) : nullptr;
const SdrTextObj* pTxtObj = dynamic_cast<SdrTextObj*>( pSdrObject );
if (pTxtObj && mpTextExport)

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0606f74b1182ab732a17c11613cbbaf7084f2e6cca432642d0e3ad7c224c3689
size 2465212

3
curl-7.83.1.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2cb9c2356e7263a1272fd1435ef7cdebf2cd21400ec287b068396deb705c22c4
size 2474940

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ee12bdbe1621c20e2744bc5b6c5967810f25a5760b98ac5812d550ab00968685
size 256036064

View File

@ -1,16 +0,0 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEwoOeytlAj76VMcPp9DSh76/urqMFAmJpLnYACgkQ9DSh76/u
rqOqRBAAiaPazVr5Oq/dSG+DeJqV6ASym+Yrsi0xIxIXS3ZoTILEen93V2cldo6H
XKZ3urKpvFh0wN2K8177fTI+wfIR8lkehAIofyaRp5CH7KKdWR50I1Bt/NrycBck
2eGPTf+W5PWqkWjfjSKRIBgp3VVqTs8rzHLixMuH+1Efv7CtaymiQwgKjkYm+iGB
4y1OEfjbmEuIKnx4wkew+tk12GOxQfo0CumdlXO1N1p7JY+VW15gM2A3t8vBIbyA
KR/c9lIo20U2lAliXmuskImc+Hi1p67oP7quoXCE0tcMtmy6o9qKM1JK+RnsUmib
YJ9LZW95FN7mzVJn17Djbg/sIWEayCqtPyaWKkGDa3VKpghT/mKF1um/XU+lsNwX
NwuHXvYziCoWn3Je8Fw3GaxIj7rzgAzQ82U1iNwEWbltL6gay8QYAHnwJ7a/Y/X5
lpRTuVQ3yvLc+Uo1CxnSkTCDHJp0sq1hbimml1I7EiCJ+MPjyJ0Ty4OY0z7n5Qi8
w72pmTP/aP/T80A4lcjQW91dTFiQ7l9GHX9OrCMp+zcK6OHXqL6bob6FrMU7vMjB
H/hawJKjYQL4ikFQ/ZPnTU3oEnSbu30bl/uUNJYpXecOe+JbGrVEwc76QT310g/s
dbzywpPJhkkP2RPCFFqOgLf3nOQeiUVl/oKtsOrLocv906R4P4Q=
=JhoT
-----END PGP SIGNATURE-----

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:48309056aa797eb2ae3aa3ef1b1bc49bd435fd4f2ad5770c45f4aa56fe6f0ff6
size 256373724

View File

@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEwoOeytlAj76VMcPp9DSh76/urqMFAmKX2fcACgkQ9DSh76/u
rqMvDRAAz3STt8tRWpbnR3/kc3/Cw1rwjxsZxlGjWLq24bnIcQwqUcEFghNmr+wy
WNAmHtnzXS9Wpk3kZYIKmMsNdeY6nu/8uW41Z6fPbt4a9/+xju+xeFg0Xfx85xOG
4nRoCA/ZKEyPexq51l8fqfg3F8pdmhVaBzMA7iTDTCaj83tM0YcmoGOriLqk1bms
tb2Ddhf/yDfdO03K6XRz4VcaIdbIdeJ2KOuiL4PLyL78UmulGtnF42HmaGd3sMgj
8bXa7jBMFmarBpigu4Hu6ASpqJbBb2Hn9OzrfmRpOfgKv7eZgqGbb2EwqE0DXwHb
DGhQJHZobj2X9cS3qdKmxCMYppQ82krICBaI1uP0qgrS6czpJrEnrsfqLg4Tvqz8
4ED72doRVu+7iHGmMapTeqgT9cKTNKlOU+bhV/2hXzdzJiijy37anHhRHIWs70pe
c6X1jXShY5NRarCYpX9eV71CG4OhqBvp0u1kNIQdat21wX17gFNB980tnOi4Swq3
LNSLiuJvjaPV1xEE8MmNfD7B1stvBmuwxEaJb58Mr3m+mYBgJ0Umysiu2Vm7ySE5
5DermMXJaj9pMOHiDb8PhzGULRIWzmeqGz6ZH9ya9ZnYTGB+U9AYdESSds49OS7l
RHgMcnFCvaHu458Wj0qjRzbGHeo3fXg0oE9Sk+ibprYFuKfQqjg=
=SP5t
-----END PGP SIGNATURE-----

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:688634eccb802c156496124b394c0ec5e21059a9b6cd0095930f9e76f9eefe9b
size 112209704

View File

@ -1,16 +0,0 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEwoOeytlAj76VMcPp9DSh76/urqMFAmJpLnwACgkQ9DSh76/u
rqNAyA/6AuXTPd6PyaDkVL8M3/UV4+Ybyn1SYNDA0VSoHAuaLI529dg4HOY3Jwdz
+OqBSrsZn72308sWeePSNcr3vTe0TdhpsoDZa5m+e5PRTPmlykwOUVOGMjaaD+1I
HAeDdtwMyt6NOh9rgsyi2ZIW51RMT7R5XRq4WAOtNU/406QDrEOvdgX5UfIieZTv
aI5vpPdZoFOkIN8CS7MU+igFOsOZZ6Qp0y1WOL0BJ00BXGsE+pcJ47PtiaWSkJfR
jaJaH9Q6HLCVu+zFYp1yQ5W7JltYs98i0qHPWCVO4ol+EeCLRBBQv7Qn6lFJwFon
tOk2lIwPTNBemdLCT29SoiCJEDiNslDgJo1X/AYSHtt/p9CuDYgbDM9FiYiHkpC2
OBKcAJ37XAbh0CcWSdVuWJucUbOZj2LbaFekn4YYcInyRLO7wNgNDGQGCvcmxiMU
gKs1osajXV9qNHh9odkUd/K0wI30OC2yBBZS5wSs3CNiRyZ7PPF61epRZRmMNahK
TY7TV7c6bSwZjbDkwTnH0VwrA4FrzfVLDpnA/xCdAoPWpMHnMiupdxg3KTdBw54x
AsW+yuZKfCGLkRjxa0PSEP+0zPEdI+aLzML+4fwACD4Qjn+447m4F1PMqSUfUSpr
6ilXWQTLUdBkOxDGO+N2foLO+BfyXmIR2UZBWJkI1SVmQ18Gy3U=
=yGtf
-----END PGP SIGNATURE-----

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:eef1324f1796196718973cd110c5579fa142cd4ac947d7b1b1fea87c12aa42ad
size 112208564

View File

@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEwoOeytlAj76VMcPp9DSh76/urqMFAmKX2f0ACgkQ9DSh76/u
rqM3NBAAzdD6z2ua/NjFTKlhbgMaP/Q9s7QhfFQno99hXn87WF/B+rFjBm9SzBcT
SPz+nrnPnk4z1SyW735Ek3lWzzqZjPvH3uZpRVcHqH5k83E779pzQUq1kbgDxbNl
vb+BIxVd4b36H/JeQTnJew+PUXfXRVLIeO77A2enmMak9AJHsu9konavSCFN/jFH
AAfdRpd2Q5gx6JAsc7CRjFBfD4TDWY9AmFoolqFzujuz+MEFy9rVxjtp5bPLMEZY
QIxbUr8b6UQTzjGbNxzHmV/2afIUBou0hUIMVvbgUKemFguyD8T2K7LqRYC2UJr1
8iQv1TlT6aUIrBERMeoI5e+TDdVFCWy2RCwUlGgfsoH8CbYNAOK2SckrESvD1uy2
eaL9t+ezRd1E3AYUyzV6VNBlXN6K4CyGwlotMly6IpyoHLlgNDCkFBtQKFvmVIz6
YQBqJOO0vpTJ1ohatDmZ2i1cwn2rqjXxP6t8j0ZBXmSSQYK4A689lZ8P4l0IEnix
pFdpLYzDfg6Qlh5NH4eiZquv6y8pfHXn4wh1y+CkBWeNmBrIZBuXDA+0U8jHs9rl
tH0Z4ndXguCIgjm4IcpVYiiKObsjfffI1bKptbuOnE6XtzinsYsGaVCTQljeAvbF
4TNLOl38FrTOKIECroAFAK3uKWmtZa+2Y72tikkM0UhH0oQp2ss=
=ZLkM
-----END PGP SIGNATURE-----

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b91b0a482fa42d59e1605f39a3917166e7ff76bfa8e9b62d6eef0a9b04b3351c
size 196316184

View File

@ -1,16 +0,0 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEwoOeytlAj76VMcPp9DSh76/urqMFAmJpLn0ACgkQ9DSh76/u
rqMRzw//cTK7matWpmz3ymeDnyKp+m4NW9fqIQBkKHLM23wC+5GFLH9JqAzRfGUe
48NW2wF6FLzqJ4NDFPf0XJ6YMOjXXzK/iAYvD7O0p07pOx9QFWBaU34JqzBd2wc+
tydYU2NECSxuNEgXvGBFKR5tdurSYJG3IuQB4cBKfcSLn7CVwfxl1wz+cV9PQovc
8NkChQytCshB3KteErflway5hiGweQfhSARy0nFb9gHdX+KoaasoBzy8zGtflpSP
GHJCy3um5bhfqrEd1LqxqMHBdECrUtIniCjDTccl+yiUdhVkOJFpavhfbVfx6n5o
iYFg1NfJyxtoX4J9197G3J1sNOR26daSr2M0u3+uhiD7JYcVeBnfvNrumnaW8gen
VtQufdJEUgA9rRBBwppZulT6wMNYWB6HWF+uSnKw8sCqsTttAL9mRgxlbCNs5O5I
FUjQUqybawPbEy69DAfmYKRoGWBxpuyzRf3B4gZDeigyUU8ec6DpYsHiS5kA1+Pb
Ci/GRhlYmN62I8oGg61U08qfRntfslGMax4bMBnOa/LKaATkuS+e2ODDK2upqfJd
YX2vcVMPMtckmrbmeHL+3H5vovcuWYNONIU42QpZhQxi4SNecyLq4tdLWqiBKjZQ
z6FC9/i8Ov/VNrc++B6xqAqzwbz6WjpL7TLfIU/WoqvA/rthIIQ=
=q7b6
-----END PGP SIGNATURE-----

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9ebc0c2f666d3677d28a01d69f247a8f9fa2dd64fe3d1092058a20cfee615379
size 196429092

View File

@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEwoOeytlAj76VMcPp9DSh76/urqMFAmKX2f4ACgkQ9DSh76/u
rqNxBRAAwMfmJPu/0qcmK4EWS3i585r4jHibQFWR8HzuHs49rs3SPkkfWle7VUYa
/O6eGnMnhLigRKqj+e+0ukwAIzb4GKLyItNKkMKWcWxJd5mzWSfTeG0mmuUJhST8
Lv6Nq2O4lq1CuMaqaOmORlSvY0102LFb4Vzhb1T5wCLU+kTe1FixBXDGg/OkXIYY
oS6l5JcbgAbl/BSfG8tmcl/8f0H4XCbcTOiojw7naEzVuB3nCF075ffZVp4nKrpk
wrOy1qVrhzUmoGEYml0dhW/cXKjqQGfAUyFgIf2Qh/6s90NObTGO45+YoXmcx5eG
Q8DfEdIwv42bwm/tH5bMH8moD+Hr2G3lf3v0e33d4IYRdugkbIBvLN5V63Dl9jEG
lWGmxjXywdOaYrylE5R8QeRkm3gkkWK4LZQg9yW56xdePSdPme5nSfLhaV7aRzqF
vKan1R34fWoNq0crQ482DE3DnD52fC8UnxVVgKALx7LkZ8Rp+H1LjyRvB5mBwLc1
SfDbejWQvFEl14+nyUTXlaX/Y+HLdfxIDjDFiWF6zmNI+c2iGQtKaxjWihnuTgiO
ZPBO6GCLh5nK4sC2t3MEgP62o7kZSAfjr5WTQ2h2XhGhkoh2FrSO+VVnHUmC4dmN
rrb4CQkkDknTB0kaE8PNKf7WbTZ14EbH2xhQRUS750kERdLcI8Q=
=hqcU
-----END PGP SIGNATURE-----

View File

@ -1,3 +1,27 @@
-------------------------------------------------------------------
Wed Jun 15 13:35:15 UTC 2022 - Danilo Spinella <danilo.spinella@suse.com>
- Use bundled openjpeg2 on SLE-12-SP5
-------------------------------------------------------------------
Fri Jun 10 14:00:00 UTC 2022 - Danilo Spinella <danilo.spinella@suse.com>
- Update to version 7.3.4.2:
You can find the complete release notes here:
https://wiki.documentfoundation.org/Releases/7.3.4/RC2
https://wiki.documentfoundation.org/Releases/7.3.4/RC1
- Remove upstreamed patches:
* bsc1192616.patch
* bsc1197497.patch
- Updated bundled dependencies:
* curl-7.79.1.tar.xz -> curl-7.83.1.tar.xz
-------------------------------------------------------------------
Fri Jun 10 13:03:44 UTC 2022 - Andras Timar <andras.timar@collabora.com>
- Fix bsc#1198665 - LO-L3: PPTX: text on top of circular object misplaced
* bsc1198665.patch
-------------------------------------------------------------------
Tue May 17 09:45:36 UTC 2022 - Andras Timar <andras.timar@collabora.com>

View File

@ -49,7 +49,7 @@
%endif
%bcond_with firebird
Name: libreoffice
Version: 7.3.3.2
Version: 7.3.4.2
Release: 0
Summary: A Free Office Suite (Framework)
License: LGPL-3.0-or-later AND MPL-2.0+
@ -107,10 +107,8 @@ Patch3: mediawiki-no-broken-help.diff
Patch6: gcc11-fix-error.patch
Patch9: fix_math_desktop_file.patch
Patch10: fix_gtk_popover_on_3.20.patch
# Bug 1192616 - LO-L3: Extraneous/missing lines in table in Impress versus PowerPoint
Patch13: bsc1192616.patch
# Bug 1197497 - LO-L3: Loading XLSX with 1M rows is ultra slow (or crashes Calc)
Patch14: bsc1197497.patch
# Bug 1198665 - LO-L3: PPTX: text on top of circular object misplaced
Patch15: bsc1198665.patch
# Build with java 8
Patch101: 0001-Revert-java-9-changes.patch
# try to save space by using hardlinks
@ -133,7 +131,7 @@ BuildRequires: cups-devel
%if %{with system_curl}
BuildRequires: curl-devel >= 7.68.0
%else
Source2013: %{external_url}/curl-7.79.1.tar.xz
Source2013: %{external_url}/curl-7.83.1.tar.xz
%endif
# Needed for tests
BuildRequires: dejavu-fonts
@ -215,7 +213,6 @@ BuildRequires: pkgconfig(libmspub-0.1) >= 0.1
BuildRequires: pkgconfig(libmwaw-0.3) >= 0.3.19
BuildRequires: pkgconfig(libnumbertext) >= 1.0.6
BuildRequires: pkgconfig(libodfgen-0.1) >= 0.1.4
BuildRequires: pkgconfig(libopenjp2)
BuildRequires: pkgconfig(liborcus-0.17)
BuildRequires: pkgconfig(libpagemaker-0.0)
BuildRequires: pkgconfig(libpng)
@ -315,6 +312,7 @@ BuildRequires: pkgconfig(icu-i18n)
BuildConflicts: java < 9
BuildConflicts: java-devel < 9
BuildConflicts: java-headless < 9
BuildRequires: pkgconfig(libopenjp2)
%endif
%if 0%{?suse_version}
# needed by python3_sitelib
@ -1022,8 +1020,7 @@ Provides %{langname} translations and additional resources (help files, etc.) fo
%patch3
%patch6 -p1
%patch9 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%if 0%{?suse_version} < 1500
%patch10 -p1
%patch101 -p1
@ -1178,6 +1175,9 @@ export NOCONFIGURE=yes
%endif
%if 0%{?suse_version} < 1500
--without-system-icu \
--without-system-openjpeg \
%else
--with-system-openjpeg \
%endif
%if %{with system_curl}
--with-system-curl \